On this page

Anti-drift operating model

Documentation governance and canonicalization

How the Zola atlas, executable schemas, source comments, generated references, and historical root docs stay synchronized without creating parallel truth.

Status
Zola is the sole canonical narrative source
For
Every contributor and release maintainer
On this page
  1. What “canonical” means
  2. Content classes
  3. Page status vocabulary
  4. Source-comment link policy
  5. Historical root-doc absorption map
    1. Man-page disposition
  6. Update checklists by change type
    1. Add or change a builtin
    2. Add or change a value method
    3. Add or change an RPC method
    4. Add or change configuration
    5. Add or change a crate
    6. Add or change a durable schema
  7. Anti-drift automation
  8. Documentation review evidence
  9. Pull-request documentation gate
  10. Ownership and cadence
  11. Canonicalization invariant

Shoal’s canonical narrative documentation lives in this Zola site. Root Markdown design documents, wiki pages, issue descriptions, scratch audits, and source comments may explain local context, but they must not become independent normative manuals.

The rule is simple:

One narrative home, many executable authorities, no duplicated hand-maintained registries.

What “canonical” means🔗

flowchart TD
accTitle: What “canonical” means
accDescr: Shows the components and relationships described in What “canonical” means.
  Zola["site/content — canonical narrative"]
  Source["public Rust types + executable registries"]
  Corpus["spec/cases — observable language behavior"]
  Schemas["serde/TOML/SQLite/protocol schemas"]
  Tests["unit/property/live compatibility evidence"]
  Comments["source comments and Rustdoc"]
  Generated["generated CLI/schema/API references"]
  Old["historical root docs / wiki / scratch"]
  Source --> Zola
  Corpus --> Zola
  Schemas --> Zola
  Tests --> Zola
  Zola --> Comments
  Source --> Generated
  Generated --> Zola
  Old -. "absorbed once, then retired" .-> Zola

“Sole canonical narrative” does not mean prose overrides code. It means architectural intent, explanations, maturity labels, diagrams, guides, and cross-links have one maintained home. Exact enumerations and observable behaviors remain executable:

InformationNormative authorityNarrative treatment
builtin namesshoal_syntax::commands::builtin_names()explain categories and lifecycle; do not hand-copy as authority
value methodsmetadata in methods/suggest.rs plus real dispatchpublish generated tables and call out drift
AST/wire/config structspublic serde/Rust typesexplain invariants, compatibility, and examples
RPC integer codesshoal_proto::error_code + pinned testexplain meaning and client handling
adapter/manifest grammardeserializers and fixture corpusexplain precedence and extension process
language behaviorreviewed spec/cases + implementation testsgive coherent semantics and links
SQLite schema/versionjournal schema/migration source + old fixturesexplain lifecycle, data safety, and operations
CLI flagsargument parser or generated CLI schemaprovide task-oriented usage and generated reference

Content classes🔗

Every page should make its class obvious:

  • User guide: supported tasks and behavior; should not expose internal uncertainty unless it affects users.
  • Reference: exhaustive, source-derived shapes/names/defaults; ideally generated or verified.
  • Architecture: ownership, control/data flow, invariants, failure modes, diagrams, change map.
  • Implementation status: what is wired and tested now, distinct from schema/scaffold.
  • Roadmap: ordered future work with dependencies and exit evidence.
  • Decision/rationale: why a durable choice exists and what would justify reversing it.

Do not mix roadmap aspiration into a reference table without a status column. Do not mark a feature implemented because a type, config key, renderer branch, or protocol struct exists.

Page status vocabulary🔗

Use consistent evidence labels:

LabelMeaning
implementedreachable through a real host path with behavioral tests
partialuseful path exists, but named cases/platforms/consumers are missing
scaffoldedtype/schema/renderer/handler shell exists without end-to-end wiring
aspirationaldesign intent only; no current behavior claim
deprecatedstill accepted/served for compatibility, with a replacement
historicalrationale or migration context, not current contract

“Done” is not a useful implementation-status label without the evidence and platform boundary.

Rustdoc and source comments should be local first and link outward only for cross-cutting context:

  1. explain the immediate invariant beside the code;
  2. link to a canonical Zola page/section for architecture or user-visible contract;
  3. link to a Rust type/function for exact signatures;
  4. never cite scratch/, a wiki, ignored file, deleted root design doc, or mutable issue as normative;
  5. avoid section-number-only citations such as “TDD §317”; use a stable page slug and descriptive anchor/text;
  6. when a published-site URL is unsuitable for offline Rustdoc, name the page slug and repository source path in one stable form chosen project-wide.

Examples of intended retargeting:

Stale citation familyStable destination
docs/TDD.md language decisionsLanguage and conformance contract
docs/CONTRACTS.md ports/signaturesInter-crate and protocol contracts
docs/ROADMAP.md completion/status claimsImplementation status + prioritized roadmap
docs/AGENT-SURFACE.md handler inventoryKernel RPC handler reference
scratch/design-prompt.mdPrompt, editor, completion, picker, and LSP
scratch/audit-arch.md port/DAG notesinter-crate contract + evaluator/system maps
scratch/audit-quality.md lint/test notesTooling and quality gates

Historical root-doc absorption map🔗

The following migration table records where useful content went and whether the root artifact can be retired. “Retire” means delete after source links and repository navigation have been retargeted—not silently preserve two copies.

Historical artifactValuable content absorbed intoGaps corrected during absorptionDisposition
docs/VISION.mdexternal overview plus system map/status/roadmapsingle mandatory kernel and broad completion claims separated from current hostingretire after overview review
docs/ROADMAP.mdimplementation status + prioritized roadmap + change map“done” waves replaced by source/test/wiring evidenceretire
docs/TDD.mdlanguage/conformance contract plus focused syntax/value/process/security/storage chaptersstale name lists, state paths, mandatory interactive kernel, aspiration vs behaviorretire and retarget all comments
docs/STREAMS.mdstreams/channels chapter plus external stream guideper-source boundedness, evaluator-language EventBus unbounded live subscribers, implemented vs proposed sourcesretire
docs/IO.mdvalue/feed/process/script-runner chapters and external I/O guideexact runner/feed behavior checked against source; aspirations labeledretire
docs/REEF.mdReef resolution chapter, config and external guideactual multi-scope discovery, empty-tools manifest gap, provider/lock behaviorretire
docs/CONFIG.mdconfiguration reference + external configuration guidenearest-only project layer, parallel prompt/Reef parsers, inert fieldsretire
docs/AGENT-SURFACE.mdkernel/protocol/RPC reference, MCP, security, status/roadmapunattached approval/journal handlers, colliding plan identity, token reload semantics, raw-base64 bypass, incomplete stream/ref promisesretire and retarget protocol comments
docs/CONTRACTS.mdinter-crate/protocol contract + focused crate chaptersexact APIs delegated to source, port bypasses admitted, current DAG/types usedretire and retarget comments
docs/BENCHMARKS.mdtooling/quality performance review sectionbudgets labeled reviewed targets rather than asserted resultsretire
docs/shoal.1external CLI reference and generated man-page pipelinecurrent hand-written page is tiny and can drift from argsreplace/retain only as generated packaging artifact

Man-page disposition🔗

The man page is different from design prose because packages may install it. Do not simply delete it until packaging/install scripts are searched. The preferred model is:

If current packaging consumes docs/shoal.1, retain the path but generate/verify its synopsis, options, subcommands, exit status, environment, files, and examples from the argument definition. Until generation exists, mark it a packaging artifact and add a drift check against shoal --help. The Zola CLI page remains the canonical human narrative.

Update checklists by change type🔗

Add or change a builtin🔗

  1. update the canonical builtin-name registry and evaluator dispatch;
  2. define signature/flags, effects, result/error behavior;
  3. add focused and conformance cases;
  4. audit completion, highlighter, LSP, plan/explain, Leash, journal;
  5. regenerate/update external command reference and internal builtin ledger;
  6. confirm no separate word list was introduced.

Add or change a value method🔗

  1. update real dispatch and methods/suggest.rs metadata together;
  2. test every supported receiver, arity, type error, closure callback, stream boundedness, and effect;
  3. audit field-to-zero-arg-method fallback;
  4. audit render/JSON/feed/wire when result types change;
  5. add corpus behavior and regenerate the method matrix;
  6. resolve metadata/dispatch diff to zero or document the intentional exception.

Add or change an RPC method🔗

  1. add typed params/results in shoal-proto with serde defaults for compatibility;
  2. register/dispatch the handler and attachment/authority rules;
  3. define ref lifetime, elision, error codes, and notification sequencing;
  4. add handler and live socket tests, plus MCP mapping if exposed;
  5. update RPC tables, wire diagrams, security matrix, external agent reference;
  6. test old/malformed clients and frame/context bounds.

Add or change configuration🔗

  1. typed field and safe default;
  2. schema shape, semantic validation, optional explicit environment mapping;
  3. merge/error tests;
  4. wire every applicable host and add behavioral tests;
  5. expose configured versus effective state in doctor/introspection;
  6. update internal wiring matrix and external reference;
  7. do not call it implemented while it is snapshot-only.

Add or change a crate🔗

  1. state one owned invariant and why an existing crate cannot own it;
  2. audit Cargo direction/features/dev-only edges and cycle pressure;
  3. add it to workspace checks, crate/module ledger, system map, ownership/change maps;
  4. define public compatibility and error/effect boundaries;
  5. add focused tests and release packaging where applicable;
  6. remove obsolete ownership claims from neighboring crates.

Add or change a durable schema🔗

  1. define forward/backward compatibility window;
  2. add a real prior-version fixture and data-preservation test;
  3. refuse unsupported newer versions safely;
  4. audit backup, GC, undo, refs, transaction/concurrency semantics;
  5. update storage reference, operational recovery guide, and release notes.

Anti-drift automation🔗

The documentation pipeline should fail on mechanically detectable divergence:

CheckMechanism
broken internal linksZola build plus explicit @/… target scan
missing source pathsscan inline/backtick source paths against checkout
builtin docs driftcompare rendered table data to builtin_names()
method docs driftcompare metadata to real dispatch and generated table
RPC docs driftderive method/param/error-code inventory from proto/kernel registries
config docs driftserialize default config + schema/env mapping inventory
corpus ledger driftcount suite files/cases; ensure all 77/current suites appear once
crate ledger driftderive workspace members and internal dependency edges from Cargo metadata
stale old-doc linksrg forbidden paths (docs/TDD.md, scratch/…, wiki URLs) in source
diagrams/fencesMarkdown fence balance and Mermaid parse/render smoke test
CLI/man driftcompare generated/reference options to parser --help snapshots

Generated output should be clearly marked and regenerated by one documented command. Do not hand-edit generated tables. Narrative surrounding the table remains reviewed prose.

Documentation review evidence🔗

A documentation-only claim should cite at least one of:

  • exact source module/type/handler;
  • focused test or corpus suite;
  • reproducible command and dated result;
  • durable schema/migration fixture;
  • live protocol/process/PTY integration test.

When the evidence is inference, say so. When a value can change—counts, platform support, current default, CI matrix—date it or derive it. Avoid screenshots as the only contract evidence.

Pull-request documentation gate🔗

Reviewers should ask:

  • Did this change alter a name, default, wire/storage shape, error, effect, platform, or host path?
  • Is the update in the canonical Zola page rather than a new root Markdown file?
  • Does the page distinguish intent, current wiring, and tests?
  • Are source comments linked to a stable destination?
  • Can a table be generated or mechanically checked?
  • Did an old page become redundant, and was it retired/redirected?
  • Do diagrams still match control/data/authority flow?
  • Does the implementation-status/roadmap ranking change?

Ownership and cadence🔗

The contributor changing a contract owns its documentation in the same change. Release maintainers run the global link/generation/status audit; they do not reverse-engineer every feature after the fact. Periodic doc sweeps are still useful for cross-cutting drift, but they are a safety net rather than the primary update mechanism.

At release time:

  1. run the complete corpus/workspace/CI-equivalent checks;
  2. regenerate registries/reference tables/man page;
  3. verify implementation-status evidence and roadmap priorities;
  4. build Zola with warnings treated as failures where possible;
  5. scan for forbidden canonical links and stale root docs;
  6. publish the same site revision as the release source revision.

Canonicalization invariant🔗

After migration, repository navigation should be unambiguous:

  • README introduces and links the Zola site;
  • Zola owns all maintained narrative/reference/architecture content;
  • Rustdoc owns exact local API documentation and links into Zola for systems context;
  • executable schemas/registries/corpus own enumerated facts;
  • generated man/reference artifacts come from those authorities;
  • issues/roadmap tools link to the status/roadmap pages rather than duplicating them;
  • no wiki or root design-document fork remains available to age silently.
Type to search every guide navigate open esc close
Diagram