Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Ziggurat Architecture

**Experimental:** model-backed refinement has no human usability scores; the revised model-workflow batch reused the fixtures that informed it and is not held out.

## System purpose

Ziggurat is a memory admission firewall. It preserves untrusted source material,
Expand Down
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ See the [threat model](site/src/content/docs/security/threat-model.md).

## Status

Pre-release 0.1.0, source-only, with no tagged releases. Ziggurat is not published to npm; install it from source. Contracts, index formats, and CLI behavior may change before 1.0.
Pre-release 0.1.0, source-only, with no tagged releases. Contracts, index formats, and CLI behavior may change before 1.0.

**Experimental:** model-backed refinement has no human usability scores. A revision staged 90/90 on the same fixtures that informed it, so it is not a held-out result; human acceptance remains pending. See the [workflow evaluation](docs/model-workflow-evaluation.md).
**Experimental:** model refinement has no human usability scores. Initial staging was 79/90, below the 81/90 gate. A revision staged 90/90 on the same fixtures that informed it, so it is not a held-out result; human acceptance remains pending. See [model evidence](docs/model-workflow-evaluation.md).

Retrieval has no abstention: on the small synthetic corpus, 4/6 no-answer queries still returned results. A threshold experiment selected no candidate. See the [retrieval evaluation](docs/retrieval-evaluation.md).
See [project status](site/src/content/docs/project/status.md) for bounded evidence and remaining gaps.

## Requirements and installation

Expand Down Expand Up @@ -49,15 +49,6 @@ The refine host reads selected Bronze and optional target context, sends bounded

A reviewer independently authors a knowledge page and obtains an external receipt. `build` admits Gold only after receipt verification and every eligibility check. Gold, review, and evidence indexes remain separate; shipped MCP exposes only read-only Gold. Retrieved chunks have reference status and no instruction authority. See the [authorization boundary](site/src/content/docs/concepts/human-authority-boundary.md), [isolated indexes](site/src/content/docs/concepts/isolated-indexes.md), and [provenance](site/src/content/docs/concepts/provenance-and-authority.md).

## Evidence

| Report | Bounded result |
|---|---|
| [Model workflow](docs/model-workflow-evaluation.md) | Initial staging was 79/90, below the 81/90 gate. Human usability remains unscored. |
| [Retrieval](docs/retrieval-evaluation.md) | On a small synthetic corpus, exact-identifier holdout top-1 reached 8/8 and no-answer false positives remained 4/6. On the separate abstention fixture, the Gold-ID baseline holdout reached 3/6 exact top-1. |
| [Operating envelope](docs/operating-envelope.md) | Synthetic 1,000-page targets passed on one Windows machine with 512 MiB old-space; default-heap RSS failed and native Windows disk-full recovery remains unverified. |
| [External signing](docs/external-signing-interop.md) | Independent Python bytes and disposable signatures interoperated with Node; this is neither a shipped signer nor proof of human review. |

## Documentation

Documentation source is in `site/`. Build locally with `cd site`, `npm ci`, then `npm run build`; use `npm run dev` to read it locally. Start with [overview](site/src/content/docs/getting-started/overview.md), [installation](site/src/content/docs/getting-started/installation.md), [CLI](site/src/content/docs/reference/cli.md), [configuration](site/src/content/docs/reference/configuration.md), and [architecture](ARCHITECTURE.md).
Expand Down
2 changes: 0 additions & 2 deletions site/src/content/docs/concepts/human-authority-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: The human authority boundary
description: Why Ziggurat's review step is a cryptographic capability rather than a workflow convention.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

Most review steps are conventions. Someone is supposed to look, someone is supposed to
approve, and the system records that they said they did. A convention fails silently: it
holds exactly as long as everybody follows it, and nothing detects the moment they stop.
Expand Down
2 changes: 0 additions & 2 deletions site/src/content/docs/concepts/tiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Bronze, Silver, and Gold
description: What each tier stores, who can write it, and what crossing between tiers requires.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

Tiers have distinct writers.

## Bronze: preserved evidence
Expand Down
2 changes: 0 additions & 2 deletions site/src/content/docs/getting-started/first-vault.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Your first vault
description: Create a vault, capture one piece of evidence, and build the three isolated indexes.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

A vault is an ordinary directory. `init` does not create a Git repository or a vault
`.gitignore`. Before committing one, add vault-local ignore rules for generated indexes
and decide whether inbox and Bronze evidence are safe to place in version control.
Expand Down
2 changes: 0 additions & 2 deletions site/src/content/docs/getting-started/garden-walkthrough.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: The garden walkthrough
description: Prepare a fixture vault, ingest its sources, and print the manual steps that remain.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

The repository ships fixture inputs and a script that initializes a vault, ingests those
files as Bronze, and prints the remaining manual steps.

Expand Down
2 changes: 0 additions & 2 deletions site/src/content/docs/getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Installation
description: Build the Ziggurat CLI from a source checkout and verify that it works.
---

**Experimental:** model-backed refinement has no human usability scores; the revised model-workflow batch reused the fixtures that informed it and is not held out.

Ziggurat is distributed as source, not as a published npm package. Its `package.json`
keeps `"private": true`, so do not depend on the `ziggurat` package name.

Expand Down
28 changes: 7 additions & 21 deletions site/src/content/docs/getting-started/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,19 @@ title: Overview
description: What Ziggurat is, what it enforces, and what it deliberately does not do.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

Ziggurat is a human-gated memory firewall: a local TypeScript reference implementation
that treats durable AI memory as a privileged write surface.

## The boundary in one paragraph

A model can read authorized content and return a strict version-1 refinement draft with
source IDs and line ranges. The refine host derives canonical citations and version-2
Silver, then validates and persists only that artifact. Gold requires a
valid receipt from a configured Ed25519 key that operator policy assigns to a reviewer.
Ziggurat verifies key control and exact-content authorization, not humanity, attention,
semantic support, or factual truth.

## The boundary in one paragraph

Content moves through three tiers. **Bronze** is canonical UTF-8 text captured from
untrusted sources after CRLF-to-LF normalization; ingest creates it without overwriting,
and its body hash detects later mutation. **Silver** is strict version-2 JSON that the
refine host materializes from a model draft, validates, and persists; every citation is
revalidated against stored Bronze text. **Gold** is eligible knowledge content admitted by `build` after a detached
Ed25519 receipt from a configured key and every other eligibility check pass.

Ziggurat ships no signer, apply, approve, or promote command; see the
[human authority boundary](../concepts/human-authority-boundary.md).
semantic support, or factual truth. See [Bronze, Silver, and Gold](../concepts/tiers.md),
the [human authority boundary](../concepts/human-authority-boundary.md), and the
[enforced boundaries](../security/guarantees.md#enforced-boundaries).

## What this is for

Expand Down Expand Up @@ -56,10 +46,8 @@ integrate with these products.

- Not an OS sandbox, and not a multi-tenant authorization service.
- Not a key custody, revocation, or hosted identity service.
- Not a claim about truth. A valid signature proves that a configured key approved exact
content. It does not make that content correct.
- Every retrieved chunk carries `content_role: reference` and
`instruction_authority: none`.

See all [non-guarantees and residual risks](../security/threat-model.md#explicit-non-guarantees-and-residual-risks).

:::caution[Gold is authorization, not truth]
Gold carries no truth or safety guarantee; see
Expand All @@ -82,8 +70,6 @@ Gold carries no truth or safety guarantee; see

## Canonical specifications

This site is task-oriented documentation. Consult these canonical architecture, threat-model, and protocol references:

- [ARCHITECTURE.md](https://github.com/patschmittdev/Ziggurat/blob/main/ARCHITECTURE.md)
- [Threat model](../security/threat-model.md)
- [docs/authorization-protocol.md](https://github.com/patschmittdev/Ziggurat/blob/main/docs/authorization-protocol.md)
Expand Down
28 changes: 6 additions & 22 deletions site/src/content/docs/guides/human-review-and-authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ prerequisites.
key outside the vault and model-accessible processes; no shipped signing path accepts
or uses it.

5. **Follow the [authorization protocol](../reference/authorization-protocol.md)** to
5. **Follow the [authorization protocol](https://github.com/patschmittdev/Ziggurat/blob/main/docs/authorization-protocol.md)** to
compute the canonical page digest, sign the domain-separated payload, and store the
strict detached receipt under `authorizations/`.

Expand Down Expand Up @@ -117,24 +117,9 @@ Only the public key belongs here. `ziggurat check` flags PEM private-key materia

## The receipt

Receipts are strict JSON, and the deterministic path for `knowledge/topic.md` is
`authorizations/topic.md.authorization.json`.

```json
{
"schema_version": 1,
"decision": "admit",
"target_path": "knowledge/topic.md",
"content_sha256": "<canonical page SHA-256>",
"reviewer_id": "committee-chair",
"reviewed_at": "2026-08-29T21:00:00Z",
"key_id": "committee-chair-2026",
"algorithm": "ed25519",
"signature": "<detached base64 signature>"
}
```

Review timestamps require canonical UTC ISO-8601 values.
The receipt for `knowledge/topic.md` is strict JSON at
`authorizations/topic.md.authorization.json`. Review timestamps require canonical UTC
ISO-8601 values. See the [authorization protocol](https://github.com/patschmittdev/Ziggurat/blob/main/docs/authorization-protocol.md) for receipt fields, canonicalization, and signing bytes.

## Why a signature is not enough on its own

Expand All @@ -153,9 +138,8 @@ page. Until then the contradiction blocks Gold.
A valid signature proves control of a configured key and authorization of exact canonical
content. It does not prove humanity, attention, completion of this workflow, semantic
support, or factual truth; see
[provenance and authority](../concepts/provenance-and-authority.md).
A stolen key, a compromised reviewer, or an inattentive approval can authorize harmful
content.
[provenance and authority](../concepts/provenance-and-authority.md) and the
[residual risks](../security/threat-model.md#explicit-non-guarantees-and-residual-risks).

## Related

Expand Down
7 changes: 4 additions & 3 deletions site/src/content/docs/guides/ingest-and-refine.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ title: Ingest and refine
description: Capture untrusted evidence, then stage a strict Silver proposal through a loopback model.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.
**Experimental:** model refinement has no human usability scores. Initial staging was 79/90, below the 81/90 gate. A revision staged 90/90 on the same fixtures that informed it, so it is not a held-out result; human acceptance remains pending. See [model evidence](https://github.com/patschmittdev/Ziggurat/blob/main/docs/model-workflow-evaluation.md).

This guide covers evidence capture and model-assisted refinement. `ingest` persists
`ingest` persists
Bronze evidence; the model pathway cannot invoke it. `refine` materializes and persists
a Silver proposal from a model draft. Neither command writes Gold, knowledge pages,
receipts, or trust anchors.
Expand Down Expand Up @@ -84,7 +84,8 @@ The host reads Bronze on the model's behalf and builds a bounded reference block
| Request and response body ceiling | 1 MiB each |

JSON encoding, metadata, prompts, and optional target context add request bytes;
they share the separate 1 MiB request ceiling.
they share the separate 1 MiB request ceiling. Each source carries its verified body
digest and 1-based lines.

The host verifies each record and supplies its body as explicit `{line_number, text}`
entries with a source ID, using 1-based Bronze body coordinates rather than candidate
Expand Down
58 changes: 5 additions & 53 deletions site/src/content/docs/reference/authorization-protocol.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,19 @@
---
title: Authorization protocol
description: Orientation to the byte-level signing contract, with the canonical specification linked.
description: Where the byte-level signing contract lives, and what an external signer must check.
---

:::caution[The specification is canonical, this page is not]
The byte-exact contract lives in
[docs/authorization-protocol.md](https://github.com/patschmittdev/Ziggurat/blob/main/docs/authorization-protocol.md).
Implement a signer against that document, never against this summary. Nothing here
Implement a signer against that document, not against this page. Nothing here
redefines a byte.
:::

## What the protocol covers

| Section | What it defines |
|---|---|
| Status | The protocol version and its stability posture |
| Trust model | What a signature proves, and what it does not |
| Trusted reviewer configuration | The `config/trust.yaml` entry shape |
| Canonical page digest | The exact bytes hashed to identify a page |
| Receipt path | The deterministic location of a receipt |
| Unsigned receipt | The receipt fields before a signature is applied |
| Signing payload | The domain-separated bytes actually signed |
| Verification | The order and strictness of verification steps |
| Interoperability test vectors | Fixtures an independent signer can check against |
| Rotation and revocation | How key changes are handled |
| External signer checklist | What an implementer must get right |

## The shape of a receipt

```json
{
"schema_version": 1,
"decision": "admit",
"target_path": "knowledge/topic.md",
"content_sha256": "<canonical page SHA-256>",
"reviewer_id": "committee-chair",
"reviewed_at": "2026-08-29T21:00:00Z",
"key_id": "committee-chair-2026",
"algorithm": "ed25519",
"signature": "<detached base64 signature>"
}
```

The deterministic receipt path for `knowledge/topic.md` is
`authorizations/topic.md.authorization.json`.

## Why canonicalization exists

The canonical page representation uses parsed fields in a fixed order and an
LF-normalized body, so the same page produces the same digest on Windows, macOS, and
Linux. Review timestamps require canonical UTC ISO-8601 values. The signing payload is
domain separated so a signature over one kind of object cannot be replayed as another.

Changes to signed bytes require a new protocol version rather than an in-place
reinterpretation.

## Test vectors
The signing payload is domain separated so a signature over one kind of object cannot
be replayed as another. Changes to signed bytes require a new protocol version rather
than an in-place reinterpretation.

`fixtures/authorization/receipt-vectors.json` publishes interoperability vectors. An
independent signer should reproduce them before being trusted with a real key. The
TypeScript implementation remains the authoritative verifier.

## Related

- [Human review and external authorization](../guides/human-review-and-authorization.md)
- [The human authority boundary](../concepts/human-authority-boundary.md)
2 changes: 0 additions & 2 deletions site/src/content/docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: CLI reference
description: Every Ziggurat command, its options, and what it is allowed to write.
---

**Experimental:** model-backed refinement has no human usability scores; the revised model-workflow batch reused the fixtures that informed it and is not held out.

After `npm run build`, from source, replace `ziggurat` with `node dist/src/cli/main.js`, or use `npm link`.

## Commands
Expand Down
8 changes: 6 additions & 2 deletions site/src/content/docs/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ title: Configuration and selected limits
description: Configuration files, their allowed keys, and security-relevant shipped CLI limits.
---

**Experimental:** model-backed refinement has no human usability scores; the revised model-workflow batch reused the fixtures that informed it and is not held out.

Configuration lives in `config/` and is validated strictly. Unknown keys are rejected at
the top level **and** inside every nested object, so a typo such as `default_sensitvity`
fails to load rather than being silently ignored.
Expand Down Expand Up @@ -116,6 +114,12 @@ and `stream: false`. There is no protocol fallback, JSON repair,
retry, or tool-call path. See the
[local model protocol and setup guide](https://github.com/patschmittdev/Ziggurat/blob/main/docs/local-model-protocol.md).

The adapter reaches only HTTP loopback endpoints. It never follows redirects, so a
loopback endpoint answering with an off-machine `Location` cannot turn the adapter
into a server-side request forgery primitive. Every request carries a 30 second
deadline, and request and response bodies are capped at 1 MiB, with the response
ceiling enforced while streaming rather than after buffering.

## `config/trust.yaml`

```yaml
Expand Down
41 changes: 9 additions & 32 deletions site/src/content/docs/security/guarantees.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
---
title: Guarantees and residual risks
description: What Ziggurat enforces in code, and the risks it explicitly does not remove.
title: Guarantees
description: What Ziggurat enforces in code, with links to the risks it explicitly does not remove.
---

**Experimental:** model-backed refinement has no human usability scores; the revision reused the fixtures that informed it and is not held out.

Read both lists. A boundary whose edges you cannot describe is a boundary you cannot rely
on.

This page owns the explanation of enforced boundaries.
[Threat model](./threat-model.md) owns the normative assumptions and residual risks.

## Enforced boundaries

- `ingest` is the only Bronze writer. It stores canonical UTF-8 text after CRLF-to-LF
Expand Down Expand Up @@ -57,27 +49,12 @@ This page owns the explanation of enforced boundaries.
- A present but malformed or unreadable `config/clean-room.yaml` fails the release audit
instead of falling back to defaults.

## Operationally important non-guarantees

- Not an OS sandbox.
- Not multi-tenant authorization.
- No key-custody service, revocation service, hosted identity, transport security,
or GUI review.
- A stolen key or inattentive approval can authorize harm, and approved text can still
contain prompt injection.

The full [non-guarantees and residual risks](https://github.com/patschmittdev/Ziggurat/blob/main/site/src/content/docs/security/threat-model.md#explicit-non-guarantees-and-residual-risks)
cover filesystem and path races, metadata limits, delegated access, review mistakes,
rendering, unavailable services, Git history, and denial of service.

## Key and incident handling

Handle private keys, compromised keys, poisoned memory, and unexpected state changes
under
[Threat model](https://github.com/patschmittdev/Ziggurat/blob/main/site/src/content/docs/security/threat-model.md#key-and-incident-handling).
Corpus rejection diagnostics are described in
[integrity and recovery](../guides/integrity-and-recovery.md).

## Canonical source
## Residual risks and incident handling

If this summary and
[threat model](./threat-model.md) differ,
the threat model wins. Update this page rather than treating it as a second specification.
The [threat model](./threat-model.md) lists the
[non-guarantees and residual risks](./threat-model.md#explicit-non-guarantees-and-residual-risks)
and [key and incident handling](./threat-model.md#key-and-incident-handling).
If this page and the threat model differ, the threat model wins.
Loading
Loading