Skip to content

Ingest and refine

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.

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.

Terminal window
ziggurat ingest --root <vault> --file inbox/some-note.md

For a new capture, ingest creates and verifies a Bronze record before deleting the inbox source. If the canonical body already exists, it returns duplicate and leaves the inbox source untouched, even when the existing Bronze record uses CRLF line endings on disk or the duplicate has a different inbox filename.

Because a new capture reads and deletes its source, an escaping path would be a combined arbitrary-read and arbitrary-delete primitive. It is validated hard: the source must resolve to a real regular file physically under inbox/.

Refused before the file is opened, copied, or unlinked:

  • absolute paths and .. traversal
  • empty path segments and control characters
  • directories
  • symlinks, junctions, and other reparse points
  • hard links, because a hard link makes the deletion step ambiguous
  • any real-parent escape out of inbox/

The result is canonical UTF-8 text after CRLF-to-LF normalization in a Bronze record. Reading, hash verification, and duplicate detection use that same normalization; lone carriage returns are preserved and remain significant to the body hash. Ingest creates it atomically without overwriting; SHA-256 verification detects later body mutation. Fresh captures default to sensitivity: restricted and pii: unknown.

Terminal window
ziggurat refine --root <vault> --query "<request>" --source bronze/<path>.md

Repeat --source once per record to name the Bronze records the host should include. Without --source, the same privacy policy that governs the model-readable evidence index is applied, which excludes fresh captures while their privacy state is unresolved.

For an amendment or contradiction, explicitly supply the existing knowledge page:

Terminal window
ziggurat refine --root <vault> --query "<request>" --source bronze/<path>.md --target knowledge/item.md

--target tells the host to read that page and provide its current content as reference. It is required for amend and contradict, and does not authorize overwriting the page. The host, not the model, derives its base-content hash.

The host reads Bronze on the model’s behalf and builds a bounded reference block:

BoundValue
Records per request12
Canonical Bronze body bytes per source32 KiB
Combined canonical Bronze body bytes256 KiB
Request deadline30 seconds
Request and response body ceiling1 MiB each

JSON encoding, metadata, prompts, and optional target context add request bytes; 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 or existing-page line numbers. Internal source snapshots remain exact string arrays for quote extraction; stored Silver v2 and live validation are unchanged. Content is labelled content_role: reference and instruction_authority: none; see provenance and authority. Oversize records are omitted rather than truncated, and every omission is reported with a reason. Only records actually supplied enter the source-ID mapping. The model cannot cite a record that was selected but omitted, or any other file it names. Optional target context is also reference data, not an instruction source or a Bronze evidence substitute.

The local model protocol defines transport, draft fields, materialization, typed failures, setup, and evaluation. Citation integrity does not establish semantic support or truth.

Initial staging was 79/90, below the 81/90 gate. See the workflow evaluation for staging results and pending human acceptance.