master_playbook.md

Beth’s Library System and Multi-Agent Chat: Master Playbook

Rev 1, September 4, 2026. Consolidated from the Sept 3-4 design sessions. This is the handoff document for build sessions. Companion artifacts: the catalog-card map (beths_library_system_map.html), legend.txt, mapname.py.


1. The one-sentence constitution

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

2. Core principles (all load-bearing, all enforced by construction)

or holds a pen. Code assembles from pointers and manifests.

checked layer. Diffs check bytes, differently-prompted models check models, humans check governance. Approval never lives inside the gradient.

mechanism, not a mood.

3. Roles and agents (separated)

A ROLE is a contract: function, context assembly policy, output contract, permissions. A BINDING maps role to provider + model + prompt variant.

(Fable), closed-book librarian (Fable), scribe (Sonnet), auditor (Sonnet), commentator class (the gallery: multi-seat, annotate-only, different model families on purpose, own visual lane).

approval, reasons recorded, rejected list prevents resurfacing.

execute), which exist in schema but are inert without a GRANT event: owner-issued only, scoped, expiring, revocable, never transitive, never template-inherited (template requests pause and ask). Governance powers (approve anything, edit legend/registry/templates/roles, issue grants) exist ONLY on human administrator accounts. Inexpressible for agents. Optional enterprise dial: two-person rule on governance commits.

personas (e.g. a ChatGPT “Astra”) are re-instantiations from exported records: same work, new expression. API is stateless; no instance travels.

4. Templates and sessions

bindings, cadences (scribe every turn; auditor staggered N), thresholds (verifier comment floor, badge interrupt), per-role context policies.

brainstorm with loosened verifier, etc.).

opening commit; mid-session rebinding is a reasoned config commit. The record always shows who performed which turns and why it changed.

5. Turn lifecycle

  1. User message: backend writes bytes to transcript, commits. No model yet.
  2. Performer called with: system prompt, rolling verbatim window, map-selected

excerpts (code-copied from pointers), the message.

  1. consult_research tool: deterministic index search FIRST. Zero hits return

“no holdings” mechanically. Real hits go to the closed-book librarian, which answers only from retrieved passages, cites source IDs, and may return “the retrieved material does not address this.”

  1. Reply renders immediately. No gate. Turn committed.
  2. Async, behind the render: verifier scores the reply against the store

(anchored rubric; percentage under the message; comment only when low; silence-with-score is a completed task, which kills demand-characteristic confabulation). Scribe proposes map edges. Auditor, staggered, checks the map for accuracy AND recall (the missed edge is the amnesia).

retrievals, prompt version, codec id). What it knew and when, forever.

by the human, are appended as events. Dropped threads become queryable.

supersession propagates blast-radius queries (“X fell; what inherited it”).

Review-packet preparation is curation (manifest work), invoked explicitly.

6. Badges and findings

timestamps preserved so rate is always reconstructable; optional interrupt if N findings land within M turns. Proposals get a separate action-required counter. Disposition states: fixed (crawler verifies), investigate later, expected (permanent silence, keyed by ID + issue type, reason recorded).

7. The repository (ground truth)

Roots (privacy seam respected by mirror scope and role context policies):

library/
  transcript/        verbatim turns, byte exact, PRIVATE (never mirrored)
  store/
    masters/         PDFs and other originals, coarse Dewey bin folders
    access/          md siblings with provenance frontmatter
    inbox/           the drop zone (consent by placement)
    quarantine/
  map/               edge files (v2 dialect, hex-armored names)
  artifacts/         drafts, review packets, exports (reliance edges)
  proposals/         operator/node/role proposals awaiting the human
  tests/golden/      conformance pairs (tuples in, behavior out)
  legend.txt         operators: symbol, ascii, properties, verify-by
  registry.txt       node codes, hanzi forms, aliases, Dewey numbers
  roles.txt          role contracts
  templates/         session configs
  manifest.(db|txt)  works, expressions, files, hashes, paths, tombstones
  findings.log       dated, append-only, silenceable
  MIGRATION.md       the liturgy (section 12)
  README.md          the cold-start document

format, sonification), many files. Dedup at byte level (hash) and work level (DOI/identifier).

lives OUTSIDE the library. No absolute paths anywhere in the record.

binary store for large PDFs.

8. Map grammar

SEQ _._ TIMESTAMP _._ node _._ OPERATOR _._ node _._ BECAUSE _._ mechanism

where HEX is the NFC UTF-8 dialect string. Body: shebang line (map:v2:zh in double brackets), raw dialect line, @ provenance pointers. Seq: digits, insertable segments, unique forever, the only renameable field. Timestamp: machine-stamped receipt time, identity anchor, SUPERSEDES targets. Decision pending: seq joiner tilde vs hyphen (tilde fixes bare-ls sort order; recommend tilde while zero files exist).

hanzi (density) or ascii-hyphenated (precision); NFC mandatory at write.

RT default, isomorphic, subset, element, causes (demote to correlate if mechanism does not trace), correlates, contradicts, disjoint (examined and found non-contributory is a first-class verdict), orthogonal, supersedes (targets a SEQ), transposed-from (cross-domain lineage). Pending proposals: inverse-of; the remaining Bach batch expressed mathematically.

properties, verify-by instruction, motivating seqs, why existing entries fail; badge; human approve/reject with reason; append-only either way; interim edges filed as RT and superseded on approval.

subject, code supplies digits (models confabulate deep Dewey). Folders carry only coarse bins (shelving, one home per file); everything fine or multi-subject is edges. Span metric: numeric distance across an edge approximates cross-modality reach; the longest edges are the original syntheses.

low-variance (Dewey, hanzi, tested math symbols, SKOS-style codes, dull Python); identity-carrying tokens are opaque and machine-verified (hashes, hex armor). Hex is transit costume, never vocabulary. Signature layer: hex-encoded easter eggs may masquerade as identifiers (the fingerprint channel).

one deliberate decode command (mapname.py read) is the consent event. Fidelity outranks fondness: models record honestly regardless of knowing the subject. Discrepancies about a person trigger subject-notify events; only the subject corrects or leaves their record.

9. Intake and maintenance (code only)

1 byte-hash dedup; 2 filename-as-identifier (arXiv, DOI-suffix, ISBN, SSRN, ACM patterns); 3 embedded text and frontmatter (DOI regex first, PDF metadata second); 3b calibre metadata fetch for books; 4 Sonnet proposes title/author/year (propose only); 5 quarantine, never delete.

new expression/copy).

feeds naming, frontmatter, and shelving. Genre and topic FLAG, never block (wide nets are the point; zero-registry-overlap files get a new-territory flag). Content verification catches paywall pages saved as papers and empty text layers (route to OCR with frontmatter note).

to intake; altered: alarm (git shows culprit); missing: dated finding. Zero tokens. Also the migration verifier and the annual restore drill.

one-way scheduled Drive copy (rclone; transcript excluded; chat-side agents read the mirror, never the original; never use the Drive sync client on the repo).

10. Future-proofing (the QWERTY vaccine)

normalized tuple serialization and a structural hash (identity of meaning, independent of rendering).

render/v2. Future formats arrive as render/vN against the same tuples, filed as new expressions with supersedes edges.

any future implementation must pass. Context-assembly is a declared codec seam; the manifest records codec+version per call. Fidelity harness: a frozen query set whose answers depend on adjacency and provenance scores any future compression protocol before adoption (our distortion metric as the acceptance gate).

11. Collaboration (built before needed)

attribution lives in the field). Protected main; owner merges. Proposals are structurally pull requests. Seq uniqueness enforced at merge. CONTRADICTS with differing actors = recorded disagreement, resolved only by supersedes. Map is authored only through the recorded channel: humans govern it and cause it (by talking); no hand-made edge can validate, because its pointer resolves nowhere.

12. MIGRATION.md (the liturgy, executed when the meta-language arrives)

Copy (clone; original untouched) then verify copy (crawler fixity pass) then translate (render/vN over tuples) then confirm (three instruments: structural hashes round-trip, conformance suite passes, behavioral parity diff on canonical queries) then sweep (reconciliation diffs old vs new inventory; discrepancies are dated findings, fixed forward) then repeat in parallel running until N consecutive zero-finding sweeps (N set by the administrator; done is a number, not a feeling) then archive the old as a sealed, hash-manifested, superseded-by-tagged tombstone: the parallel text that lets any future mind re-verify the translation. Migration is a governance act: humans administer, agents diff. Trigger clause: the moment a candidate format passes the conformance suite, an evaluation is owed.

13. Products and strategy (context for build priorities)

the library (the record). Pitch: AI work you can audit. Differentiator: no agent can administer the system, structurally. IT vocabulary is native: change management, separation of duties, versioned diffable governance.

record is the self-evidencing proof (product works, methods sound, research legit, author accountable). Papers cite the system in one line.

Tunnel paper); defensive publication for the Tunnel/CCC commons; trademark territory for the name; check grant IP clauses first.

admission, two doors, content-addressed store with institutional mirrors and a dark tier, ensemble translation with divergence maps and per-span attribution, claim-citation verification with typed verdicts and mandatory resolvable pointers, citation stubs as the acquisition frontier, Zenodo first quarry (license-routed), OpenAlex skeleton (corpus=all), speculative connective labor for zero-in-degree nodes. Everything above scales into it unchanged; that is the point.

14. Interface design (Beth’s own build)

reaches it over Tailscale/LAN. The app is a patron of the library, never its container.

reply (comment expands only when low); collapsed, expandable tool-call entries (“consulted store: query, 3 sources”); gallery lane visually distinct and annotate-only.

asks; slash-commands for session acts (/swap role model, /template, /review-packet), every one a reasoned commit.

buttons (fixed / later / expected + one-line reason).

index; the deliberate-decode gate applies to the personal layer.

the UI is optional chrome over a scriptable core.

15. Build process (phased, acceptance-criteria driven)

Stack: Python backend (FastAPI), SQLite for the index/manifest, git via subprocess or dulwich, provider adapters (Anthropic first, OpenAI second), htmx-or-minimal-JS frontend, WebSocket/SSE for streaming. Dull on purpose: machine-legibility and maintainability are the same requirement.

mapname.py, golden tests, re-encode this week’s edges as founding commits, push to private remote. The initial commit date is the one future-you points at.

provider adapters, index + consult_research as a CLI. Acceptance: a scripted conversation produces a repo any auditor can replay.

grant events. Each phase hands Claude Code acceptance criteria in Beth’s testing idiom (“when I paste a claim, the following happens within the turn”), plus the conformance suite from day zero. One cognitive mode per build session; change lists carry the why.

16. Open decisions (the short list)

  1. Seq joiner: tilde vs hyphen (recommend tilde, now, while files are zero).
  2. Large-binary storage: git-lfs vs external hash-verified store.
  3. Symbol set: one-hour tokenizer test per provider before freezing glyphs.
  4. Badge interrupt thresholds (start disabled).
  5. Repo initial commit date (a ceremony; choose it).
  6. The routing table for the first disbursement (kitchen-table document).
  7. The Tunnel crater cross-section map (deferred, still owed).