minimum_implementation_spec_v1.md

Beth’s Library System (and AI Multi-Agent Chat)

Minimum Implementation Spec, v1.1

Consolidated from design sessions of Sept 3-4, 2026. Two provenance classes are distinguished throughout: RULED (Beth decided it) and PROPOSED (engaged in conversation, not ratified; requires her decision before build). Open decisions are listed at the end and belong to Beth.


0. Constitution (one sentence)

Humans govern, agents propose, code writes, the record remembers.

Standing principles agreed throughout, enforced by construction, not policy:


1. The record (one git repository)

Species roots, separable along the privacy seam:

Mechanics:

2. The map (v2 dialect)

Canonical form: the edge is the tuple (node, operator, node, mechanism, provenance pointer). The tuple’s normalized serialization has a structural hash; that hash is the edge’s identity. Every readable form is a registered rendering (render/v2-dialect is renderer number one). This is the forward-compatibility root.

Edge law: the mechanism (the “because”) is mandatory. No mechanism, no edge.

Filename grammar (ASCII-armored, all platforms): SEQ _._ TIMESTAMP _._ x--HEX .txt

Dialect: hanzi plus tested math symbols plus ASCII. Legend carries three columns per operator: notation, filename/ASCII code, word fallback. Symbol set is chosen empirically per provider tokenizer (one-hour test); every symbol keeps an ASCII fallback. Mechanisms may be hanzi (density) or ASCII-hyphenated (precision). ⟦ ⟧ marks an in-string code shift in any other text.

Legend v1 draft (pending Beth’s final approval): ≅ isomorphic (symmetric, non-transitive; verify: map mechanism, find where it breaks) · ⊂ subset (transitive) · ∈ element (directed) · → causes (directed; demote to ~ if mechanism won’t trace) · ~ correlates (explicitly non-causal) · ⊥ orthogonal · ≠ contradicts (both ends open until supersede) · ∅ examined-and-non-contributory (record the exam) · ⇒ supersedes (target is a SEQ; append-only correction) · ◁ transposed-from (directed; name the key change) · RT related, the honest default. Pending additions Beth agreed to in principle: INVERSE_OF; a proposed-by/source-outside-the-loop provenance marker.

Registry: short letter codes for nodes (e.g. cw), aliases, hanzi forms, Dewey number per subject. Collision-unique, human-gated. Dewey numbers are never model-recalled; models propose the subject, the registry supplies the digits. Filenames hyphenate DDC dots (133-324); registry and frontmatter keep true dotted form.

Shelving vs catalog: coarse Dewey bins as physical folders (one home per file); everything fine-grained and multi-subject lives in edges pointing at manifest IDs. Reclassification is a map event, not a file move.

Map authorship: humans never hand-author map files (validator: an edge whose provenance pointer does not resolve fails at the gate). Humans influence the map by speaking in-session; humans govern it via legend, registry, and approvals. RULED.

MAP ORGANIZATION: SUSPENDED, UNDECIDED. What is ruled above covers the edge unit, the grammar, the dialect, and map/ existing as its own isolated top-level folder (Beth’s requirement). How the map is organized internally was never decided and must be, before build:

Opacity layers: hex armor on the judgment/personal map layer is an intent gate (decode is one deliberate command; the act of decoding is the consent event). Real cryptography is reserved for transcript/ and designated private roots. Opacity is asymmetric by ownership: the owner renders any slice to English on demand, and each render is logged.

Subject-notify rule: models are data-agnostic clerks; fidelity outranks fondness. A discrepancy in a known person’s data grants exactly one power: notify that person. Only the subject corrects their record, or leaves it, with reason. Agents never unilaterally edit a human’s entry.

3. Roles, bindings, templates, sessions

Role = contract, defined as data in the roles file: function, context assembly rule, output contract, permissions. Validator refuses events from undefined roles. Roles are model-agnostic.

Binding = role to provider + model string + prompt variant. Provider adapters normalize call shapes (Anthropic first; OpenAI-class second). A ported persona (e.g. Astra) is a re-instantiation from records: system prompt plus exported memory; stated honestly as a new expression of the same work.

Default roster (template v1 defaults, all rebindable):

Templates: named, versioned config files in templates/: seated roles, default bindings, cadences (scribe every turn; auditor stagger), thresholds (verifier comment floor, badge spike interrupt), context policies. Session start instantiates a template; binding overrides recorded in the opening commit; mid-session rebinding is a reasoned config commit. Sessions outside any template and new templates are both permitted. Template concept encodes one-cognitive-mode-per-session (fact-pass, edit-pass, collection-leg, brainstorm variants anticipated).

Permissions: two tiers. Standard (propose-text, propose-edges, propose-verdicts, annotate) available to any role. Privileged (write, execute) exists in the schema but is inert without a live grant: grants are owner-issued events with scope, duration, and reason; revocable; expiring by default; never template-inherited (template requests pause for the human); never transitive. Governance capabilities (approving roles, legend, registry, templates; issuing grants; deletions) exist only on human administrator accounts and are inexpressible for agents. Ruled: approval is never delegable. Optional enterprise dial, listed only: two-person rule on governance commits.

Proposal machinery (operators, nodes, roles, and future capabilities): proposal file in proposals/ with the contract/definition, motivating evidence (SEQ numbers), and why existing items don’t fit; duplicate-proposal check against pending and rejected; separate action-required counter next to the audit badge; owner approves (item lands, interim CONNECTS edges get superseding retypes) or rejects (file stays, marked, with reason; rejected list prevents resurfacing).

4. Turn lifecycle: PROPOSED ASSEMBLY, NOT RATIFIED

What a turn actually is has not been decided. The five-step sequence below is a proposed assembly of individually discussed parts and requires Beth’s ratification or redesign before build.

Component rulings that ARE Beth’s, wherever the final turn shape lands:

Proposed and awaiting her decision:

Per-call context manifest (rev 2): every model call logs its recipe: turn ranges, map files, retrievals, prompt version, plus codec name and version once the codec slot exists. No copied text, pointers only. RULED.

Badges and logs: audit findings increment a counter; opening the log resets it; entry timestamps are kept so rate is always reconstructable; configurable spike threshold converts the badge into an interrupt (may start disabled). Salvage log: retrievals returned but unused by the draft are logged. Override log: proceeding past a low verifier score is logged. All append-only.

Anti-lazy law: no model is ever asked to reproduce bulk text anywhere in the system; excerpt and packet assembly is by manifest, code-copied, byte-checked against the record.

5. Intake and services (code only)

Drop zone, not Downloads (ingestion is an intentional act; consent by placement). One path: drop zone to local repo store; hash, manifest, commit before any second copy exists; the mirror carries it outward afterward.

Intake ladder, cheapest rung wins, delete never an output:

  1. Byte hash: exact duplicate detected, logged, skipped.
  2. Filename-as-identifier: arXiv IDs, DOI suffixes, ISBNs, SSRN/ACM/publisher patterns resolved without opening the file.
  3. Embedded and first-pages text: DOI/identifier regex; frontmatter agreement check for captured sources.
  4. Book rung: calibre command-line metadata fetch (title, author, ISBN) for the book corpus.
  5. Model proposal: a Sonnet reads a sample and proposes title, authors, year, venue, species, subject edges; code performs the rename and filing; new-node proposals go through the approval gate.
  6. Quarantine: needs-review folder plus badge. Never a guessed name.

Also at intake: two-level dedup (byte identity and work identity via DOI); species detection (paper, preprint, book, standard, regulation, report) feeding naming and frontmatter; content verification (flag paywall/landing pages saved as papers; empty text layers route to OCR with the fact recorded, or to review); genre and topic checks flag, never block (topic = grep against registry and aliases; zero-match files ingest wearing a “new territory or stray” flag). Check-before-acquire: collection legs query holdings (DOI, title, hash) before fetching; duplicates return “already held, batch, date.”

Old-name preservation: every prior filename becomes a manifest alias.

Night crawler, scheduled, zero tokens: existence, placement, and hash of everything against the manifest. Moved: heals the manifest path, logged. Untracked: routed to intake. Altered: alarm with git context attached. Missing: dated finding with evidence. Findings dispositions: fixed (crawler verifies and closes), investigate (stays open), expected (permanent silence with one-line reason, keyed by ID plus issue type; a silenced issue never re-alerts; a different issue on the same ID still does). Deletion as workflow: delete, crawler notices, owner acknowledges with reason, manifest entry becomes a tombstone, git retains the bytes.

Backfill jobs (one-time, then steady state): manual triage of existing Downloads into the drop zone; the book library backfill (the WeLib corpus) through the book rung, in its own root with its own mirror-scope decision.

6. Copies, portability, forward compatibility

Three copies, three jobs: working repo on the PC (live); private git remote (full history, disaster recovery, the collaborator door); Drive mirror, one-way on a schedule (rclone-style), shareable species only, transcript never mirrored, repo never placed inside a sync client’s folder. Chat-side agents read the mirror, never the original.

Restore drill: run the crawler against a fresh clone; a move or restore is done when the crawl passes, and the drill is rehearsed annually.

Large binaries: git-lfs vs hash-verified external store is an explicitly flagged build decision.

Forward compatibility (the QWERTY vaccine): canonical tuples with structural hashes beneath every rendering; renderer registry with the current stack as render/v2; conformance suite in tests/golden/, stated as tuples-in, behavior-out (any future implementation in any language proves itself by reproducing the golden pairs byte-exactly); codec slot in the context-assembly layer with codec+version recorded in the manifest; a fidelity harness of adjacency-dependent canonical queries as the acceptance gate for any future compression protocol.

MIGRATION.md, drafted now, executed whenever a successor substrate arrives: (1) copy, full clone, original untouched; (2) verify the copy, crawler fixity pass; (3) translate, new renderer walks the tuples; (4) confirm, three independent instruments: structural-hash round-trip, conformance suite, behavioral parity diff; (5) sweep for the missed, reconciliation diff of full inventories, discrepancies as dated findings, fixed forward; (6) parallel run, both systems receiving every new deposit, sweeps recurring, exit defined numerically (N consecutive zero-finding sweeps, N set by the administrator), expected duration years; (7) archive the old as a system-scale tombstone: sealed, hash-manifested, superseded-by recorded, retained forever as the parallel text that lets any future mind re-verify the translation. Migration is a governance act, human-administered end to end; the trigger clause: the moment a candidate format passes the conformance suite, an evaluation is owed.

7. Existing artifacts (already built and tested this session)

8. Decisions register

Settled by ruling this session:

Open, Beth decides (explicitly reserved):

9. Inputs to hand the build session

This spec; mapname.py; legend.txt; the catalog card HTML; context_window_memory_design_summary.md (from the Sept 3 session outputs); the source-library-capture skill (already installed) as the MD-sibling format; Beth’s decisions on the open register above, as they land.