diff --git a/notes/eureka-pipeline-state-cut.md b/notes/eureka-pipeline-state-cut.md index ba76f172..0e1058ae 100644 --- a/notes/eureka-pipeline-state-cut.md +++ b/notes/eureka-pipeline-state-cut.md @@ -1,1402 +1,1676 @@ # Eureka pipeline state: cut map -Date: 2026-09-15 (first Imagination pass). +Date: 2026-09-15 (first Imagination pass), remapped 2026-09-16 after the +operator rejected the repo-owned store. Status: cut map. The ends are owned by `notes/eureka-pipeline-state-target.md`; this document owns the means. Self updates this header in every landing commit. -**Cut 1 landed** at `2b76c2e7` (re-pin) and `df82992c` (pin tests), and passed -Soul. -- **Verification:** core tests 156/156 with 0 warnings; the four library - packages and all 9 bins check; `?` is propagated at all 8 - `add_generic_backing_store` sites (fail-closed; no site can hit the new - refusals). -- **Soul found no drift on a live path.** Recorded: - - **F1 (medium, latent).** Under cultcache-rs 0.2.0 a cache with no store - accepts `put`/`put_envelope`/`delete` in memory only; at `e171eca3` it - refused. Epiphany's read caches (`state_cache`, `persona_social_cache`, - `runtime_spine_schema_cache`, and the cache in - `require_store_retirement_receipt`) have no mutating caller today, but a - future `put` on one would vanish silently. - - **F2 (low).** The two pin tests prove "this store file is not rewritten", - not "no store is attached": a store attached at a shadow path survives all - 156 tests. Fixed before Cut 2. - - **F5 (gap).** Typed reads of current-epoch Mind and resident stores under - 0.2.0 are unproven, because no current-epoch store exists locally. Raw - reads of 8 real stores are byte-identical, and the ledger's typed read - works. +**Cuts 1, 2 and 3a landed. Everything from Cut 4 on is unbuilt.** The old Cuts +3b-7 described a repo-owned store and are dead; they are kept, clearly marked, +under "History" at the end of this file. Nothing above that section describes +the old model. -**Cut 2 landed** at `00991c1b` (F2 fix: storeless reads are pinned by a -directory snapshot) and `46460efc` (`TypedCommitStore` profile on the one -commit owner). -- **Verification:** 158/158. -- **Soul confirmed Mind is unchanged:** the pin test run verbatim at base - `589e71c3` yields the same receipt id. -- **Being fixed before Cut 3a:** - - The Mind profile's epoch check is unpinned, so dropping - `validate_runtime_store_epoch` passes. - - "Validation before replay" is unpinned. - - Reads go through the profile's `open_cache`, but the CAS and the conflict - re-read hard-code `runtime_spine_backing_store`, so a profile could read one - store and write another. -- **Carried into Cut 3a/3b:** - - The profile's implicit contracts: register `EpiphanyMindCommitReceipt`, and - register every stored type or the load refuses. - - Owner errors say "Mind mutation", so pipeline code maps them to its own - refusal. - - The owner takes a path, not a writer-lease handle, so lease binding for - `pipeline.cc` needs a structural guard, not grep. -- **Recorded (low):** the F2 snapshot cannot see a store attached in another - directory. This is F1's mirror; it takes a deliberately misplaced attach. -- **Spec correction:** six owner call sites, not five, including - `commit_mind_mutation`. +- **Cut 1 landed** at `2b76c2e7`, `df82992c`. CultLib re-pinned to `a0813c6`. +- **Cut 2 landed** at `00991c1b`, `46460efc`, `cb6ef5d2`. One commit owner, + parameterised by a `TypedCommitStore` profile. +- **Cut 3a landed** at `a1473c45`, `ad18c385`, then fixes at `b4f88d29`, + `187e01e7`, `a317d4cf`. Ten document kinds, ten derived schemas, plus the + store opener, writer lease and git preconditions that **Cut 4 now deletes**. +- **Target rewritten** at `5fb4eb22`. -**Cut 2 fixes landed** at `cb6ef5d2` and passed Soul (160/160). -- **What changed:** - - The profile owns its backing store (`backing_store: fn(&Path)`), and the - opener receives the resolved store. - - The Mind epoch refusal is pinned; M2b drops the check from the Mind opener - only. - - Validation-before-replay is pinned. -- **Every mutation was caught,** including two of Soul's own. -- **Open decisions for the Cut 3b spec:** - - **Replay under a changed validator.** Validation-before-replay means a - newer, stricter binary refuses a retry of a batch that was already admitted, - for example after a lost response. For `pipeline-merge` that refusal is - intended. For a plain retry it probably is not. Cut 3b decides whether an - exact stored receipt short-circuits validation for same-store retries. - - **Lost race between identical commits.** The loser gets `Conflict`, not the - replayed receipt (`reasoning_context.rs:1680-1721`). This predates Cut 2. - Cut 3b should map it to `AlreadyAdmitted` if the receipt matches. -- **Recorded (low):** an opener can still ignore the resolved store and attach - none. The CAS protects the file, so the worst case is a spurious conflict. - -**Cut 3a landed** at `a1473c45` and `ad18c385`: 10 document kinds, the opener, -the writer lease, and 10 derived schemas; tests 171/171. - -Soul found: -- **F1 (high):** an identity-less first commit bricks the store. -- **F2:** key collisions through dotted attempt, pass and finding labels. -- **F3:** parent ids only prefix-checked; the wrong-kind check is untested. -- **F4:** resolution keys skip label validation, and the subject kind is not - tied to its id. -- **F5:** the pipeline store is writable without the lease or admission, both - from inside the crate and through the exported wrappers. -- **F6:** a worktree can take the lease and write its own tree's store. -- **Low:** a stale holder can be named after a crash; git reads local excludes - and global attribute files; macro field lists are duplicated; repo fields are - unchecked; `LandedNameKind` and two caps have no consumer. - -**Rulings (operator, 2026-09-15: "all recommendations, go ahead"):** - -10. **One store per clone.** The store always lives in the clone's main working - tree. The session's MCP process holds the single per-clone lease, and a - caller in a worktree admits into the main tree's store. -11. **Numeric attempt and pass.** `attempt` and `pass` are numeric, and attempts - count up per cut across spec revisions. -12. **The profile owns identity-on-first-write.** The commit profile's - validation, which is the single owner, enforces that the first write carries - the pipeline identity, so it can never admit a store its opener refuses. - -13. **The operator channel is the Claude Code session; notification only.** - Eureka has no Persona. The root session is Self and the operator surface, - because spec iteration works best where the question and the tree share a - context. Questions and rulings are typed documents, so the channel is a - rendering choice, not an architecture. - - When a blocking question is admitted while the operator is away, Eureka - calls whatever notification MCP tool the user has configured. Eureka owns - no transport and names no provider, so anyone can swap in their own. - - Answers come back in the session and become rulings there. - - Answering over a chat channel is a later campaign, and it needs identity - binding before a reply can become a ruling. - - The operator's framing: "A big draw of Epiphany is each repo having a - recognizable identity and memories and a Persona you can talk to, but - Eureka is the cut-down Claude-native version anyone can use". Repo - identity and Persona stay Epiphany's. - -**The Cut 3a fixes landed** at `b4f88d29`, `187e01e7` and `a317d4cf`: rulings -10-12, findings F1-F8, and the low items. Tests 180/180, 27 mutations defined -and caught. Soul is verifying. - -Two Hands deviations, both accepted by Self: -- The `SubtractionEstimate` and `StructuralDelta` lists stay, since D1 names - them; only their invented cap numbers were unified to one documented default - of 64. -- `attach(repo_root, host, session)` replaces D3's `attach(repo_root, holder)`, - so a caller cannot declare a false process identity. Liveness is taken from - the live process. - -A Hands pass fixes F1-F8. It also makes the document wrappers crate-private, -unifies the macro field list, validates `repo` fields, deletes `LandedNameKind` -and the unconsumed caps, and nulls git's exclude and attribute files. - -Pins. Code anchors are `file:line` against Epiphany `81be7a2f`. HEAD has since -moved to `0636176a`, but only the target and `state/map.yaml` changed, so every -code anchor still holds. The other pins: +Pins for this pass. Code anchors are `file:line` against Epiphany +`5fb4eb22`, tree clean, branch `codex/eureka-pipeline-state`. - CultLib `main` `a0813c6`. -- VoidBot `main` `46d891b`. -- gamecult-ops `main` `647e57e`. -- The Eureka skill at `~/.claude/skills/eureka`, which is not a git repository. +- Huginn `main` `91b7fcf` at `F:\Projects\Huginn` (upstream public, default + branch `main`, last pushed 2026-06-21). +- VoidBot `main`. gamecult-ops `main`. +- The Eureka skill is now a git repo: `GameCult/Eureka`, public, `main` at + `6ca7882`, checked out at `~/.claude/skills/eureka`. -## Rulings in force (operator, 2026-09-15) +## What the rewrite changed -1. Epiphany owns the schemas and admission. -2. The store serves agents first. Exact and filtered queries live in Epiphany; - voidbot indexes a projection for semantic search. The typed store is the truth. -3. There are two campaigns. This one covers schemas, store, admission, the MCP - server, the voidbot projection, the skill wiring, and a proof. Epiphany's own - organs consuming the documents belong to the second. -4. The MCP server is Rust, stdio, launched per Claude Code session, built as an - Epiphany package, and adds no daemon. It writes through a public admission - path under organ provenance `eureka`. -5. **The store lives in the repo where the task runs.** It is committed on the - campaign's working branch and is separate from the runtime and Mind stores, - with its own epoch. Knowledge crosses repos only through explicit sharing. The - operator's words: "have the pipeline store sit in the repo where the task - takes place. Each Epiphany learns for itself, with affordances for sharing - knowledge, same when running Eureka. Then the Eureka working branch can sync - with Yggdrasil". - (This supersedes the earlier same-day ruling of one user-level store. Nothing - below describes that design.) -6. **One runner per repo, plus a merge tool.** The operator's words: "There - should only ever be one Epiphany/Eureka running in any one repo. Nonetheless, - we should have a merge tool in case it ever happens." -7. Re-pin CultLib from `e171eca3` to `a0813c6` first. -8. **Q1-Q5 are all ruled A (operator, 2026-09-15: "all recommendations, go - ahead").** - - Q1: one single-file `.cc` per repo plus the admission-replay merge command. - - Q2: additive changes keep the epoch; a breaking bump refuses the old store. - - Q3: an all-or-nothing merge, settled through a typed `merge_exclusion`. - - Q4: voidbot indexes the default branch only. - - Q5: `schemars` becomes an unconditional `epiphany-core` dependency. +The first model made a repo own the store. Nothing owned the state, so the +machinery grew to compensate. The operator's correction is that **an instance +owns its mind**, a **service owns that state**, and **minds leave git**. - The question text below is the record of the choice, not open work. -9. **Eureka is published as its own repo** (operator, 2026-09-15: "we'll want to - publish Eureka as a repo"). The skill moves from an untracked - `~/.claude/skills/eureka` directory to `GameCult/Eureka`. Cut 5's skill wiring - edits land as commits there, and every "SKILL.md" or "briefs.md" path in Cut 5 - means that repo. +The mechanical consequence, which drives Cut 4: every layer that existed only to +make a *repo-resident, git-committed, multi-clone* store safe is now dead +weight. That is the writer lease, the main-work-tree resolution, the committed +`.gitattributes` / `.gitignore` preconditions, the branch binding, and the merge +tool that was never built. -## Operator questions (ruled; see ruling 8) +## Rulings in force -Each question lists what depends on it. Cut 3a needs Q1 and Q5, Cut 3c needs -Q3, Cut 3a's epoch text needs Q2, and Cut 7 needs Q4. +Numbering follows the target. Rulings 5, 6, 10, 11 and 13's store clauses are +superseded by 14-17; see History. -- **Q1. Store layout.** Candidates: - - **A.** One single-file `.cc` per repo, merged by an explicit admission-replay - command. - - **B.** Port C#'s v4 directory store to cultcache-rs. - - **C.** One single-file `.cc` per record, with receipts acting as batch - manifests. +1. **Epiphany owns the schemas** for pipeline state. +2. **Searchable state serves agents first.** Rehydration and precedent checks + come before operator browsing. +3. **Two campaigns.** This one covers schemas, the memory organ, admission, the + MCP client and a proof. Epiphany adopting Eureka's habits is the second. +4. **Re-pin first.** Landed. +7. **Eureka is published** as `GameCult/Eureka`, MIT. +8. **Q2 and Q5 survive the rewrite.** Additive schema changes keep the epoch and + a breaking bump refuses the old store (Q2). `schemars` is an unconditional + dependency and published JSON schemas are derived from the Rust types (Q5). +9. **The operator channel is the Claude Code session.** Eureka has no Persona. + Blocking questions may be pushed through any notification MCP; Eureka owns no + transport and names no provider. Answers come back in the session. +11. **Numeric attempt and pass.** `attempt` and `pass` are numeric, and attempts + count up per cut across spec revisions. (Survives; it is a key rule, not a + store rule.) +14. **An instance owns its mind.** A store is canonical to exactly one instance. + Identity lives in the state, not in a path. Admission refuses a write + carrying another instance's identity, whatever the transport. Stewardship + over repos is an assignment recorded in that mind, and one instance may + steward several repos. Reassignment is an explicit typed hand-off recorded + in both minds. +15. **A service owns the state, on Yggdrasil.** The memory organ is a daemon. No + per-clone lease, no git-attribute precondition, no divergence between clones. +16. **The organ depends on Qdrant directly, not on voidbot.** It owns its own + collections and indexes at admission time. Embeddings come from Ollama. +17. **Huginn is the memory organ.** The dormant `.cc`-to-Eve CLI is retired and + generic `.cc` inspection belongs to CultCache Studio in CultLib. - **Recommended: A.** Git never merges the bytes of a binary file, so every - divergent merge is forced through the merge command, which is Epiphany's - admission. B and C both let git silently union two branches' records around - admission. - - B also adds a CultLib foundation store with C# wire parity, and its manifest - is one hot file that conflicts on every divergent branch anyway - (`DirectoryMessagePackBackingStore.cs:15-18`, `WriteManifest` at `:287-295`). - - C loses batch atomicity: a multi-file batch cannot meet cultcache-rs's - atomic `push_all` contract (`lib.rs:307-336`). - - Probes, 300 documents of about 1 KB each, 30 commits, after - `git gc --aggressive`: +## Probes and source reads this pass - | Layout | Pack size | - |---|---| - | single file | 20 KiB | - | per record | 46 KiB | +No cargo build ran this pass. Every new mechanism claim below was settled by a +source read; the one build-dependent claim (rmcp as a stdio server) was settled +by P4 in the first pass and is unchanged. No build outputs were created, so +none were deleted. Claims are marked **(source read)** or **(probe)**. - The payload was highly compressible, so these are lower bounds. The per-record - layout merged disjoint branches cleanly, and a same-subject resolution raised - an add/add conflict. Single-writer (ruling 6) removes the case per-record was - built for. - - Depends on it: Cut 3a's store module, Cut 3c, and Cut 7's discovery path. -- **Q2. An older repo store meets a newer schema.** Candidates: - - **A.** Additive changes (new named fields carrying `#[serde(default)]`) keep - the epoch. A breaking change bumps it, and the new binary refuses the old - store for reads and writes with `ForeignEpoch`. The old store stays in git - history and remains readable by the binary tagged at its epoch. The operator - decides per repo whether to re-author live state. - - **B.** A breaking bump ships a one-release `pipeline-migrate` that - re-admits old documents through admission. - - **C.** A compatibility reader. - - **Recommended: A.** It keeps "no compatibility reader" (target, Store) and - Epiphany's no-migrator precedent (`state/map.yaml:118`, "No compatibility - reader, bootstrap aggregate, schema migrator, or dual reader survives"). - Nested values are named MessagePack maps, which tolerate added fields - (`cultcache-rs` `prepare_entry_named` docs, `lib.rs:2176-2180`). B is the - fallback if a live campaign ever straddles a breaking bump. - - Depends on it: Cut 3a's opener refusal text and the README's evolution rule. -- **Q3. Settling a merge conflict.** Candidates: - - **A.** The merge is all-or-nothing. It reports every conflict and writes - nothing. The operator settles by admitting, on ours, an explicit typed - `merge_exclusion` naming the theirs receipt and the reason, then re-runs the - merge. The merge skips excluded batches and reports their dependents as - conflicts too. The excluded documents are re-authored by hand. - - **B.** The merge only refuses and reports. Settlement happens outside the - tool. - - **Recommended: A.** Under B, a conflicted binary store cannot be merged at - all, because neither side's history can be rewritten. A keeps the settlement - typed, dated and queryable, and never lets the last writer win. - - Depends on it: whether Cut 3c adds the eleventh kind, `merge_exclusion`. -- **Q4. voidbot index scope.** The target says pushing the working branch is the - sync. The Body says otherwise: the mirror catalogs only public repos and fetches - only each repo's `default_branch` (gamecult-ops - `scripts/refresh-voidbot-sources.sh:84-89`, - `scripts/sync-gamecult-org-repos.sh:24-57`). Candidates: - - **A.** Index the default branch only, so learning becomes searchable across - repos when the campaign branch merges. - - **B.** Also mirror and index branches that carry a pipeline store. - - **Recommended: A.** Inside the running repo, Self reads the branch store - directly through `eureka-state`. Cross-repo discovery should surface settled, - merged learning, not abandoned or rebased campaign state. Private repos such as - gamecult-ops are never indexed under either option. - - Depends on it: Cut 7's scope. -- **Q5. `schemars` in `epiphany-core`.** Commit `07529fb5` deleted unused - `schemars` from Epiphany (`state/map.yaml:96-108`). Candidates: - - **A.** Make it an unconditional core dependency, derived on the pipeline - value types. Published JSON schemas and MCP tool schemas then come from one - Rust authority. - - **B.** Put it behind a core feature enabled only by the MCP package. - - **C.** Hand-write the JSON schemas and give MCP its own DTOs. - - **Recommended: A.** It now has two live consumers: the schema publication and - rmcp tool schemas, since rmcp's `server` feature already pulls `schemars` 1.x. - - B compiles `epiphany-core` twice in the shared target, because a - dependency's features change core's fingerprint. - - C creates a second owner of every field. - - Depends on it: Cut 3a's dependency line and Cut 4's tool types. - -## Probes and what they established - -All probes ran under the scratchpad at -`...\scratchpad\eureka-imagination\`. Cargo used -`CARGO_TARGET_DIR=C:\Users\Meta\.cargo-target-codex`, one invocation at a time. -Afterwards 3,796 probe outputs (2.1 GiB) were deleted. The shared target is back -to 5.6 GiB, with `debug\epiphany-state.exe` (1,776,640 bytes, 2026-08-24) -preserved. The scratch worktree was removed. - -| # | Probe | Result | +| # | Claim | Evidence | |---|---|---| -| P1 | Detached worktree at `81be7a2f`, pins sed-replaced to `a0813c6`, then `cargo check -p epiphany-core --lib` and `--lib --tests` | 12 × E0599 `load_envelope` not found; nothing else. `Cargo.lock` changes 5+/5−. | -| P2 | P1 plus `load_envelope` → `put_envelope` at the 12 sites | Lib builds clean except 3 `unused Result` warnings; lib tests add 5 more (8 total). | -| P3 | P2: `cargo test -p epiphany-core --lib`; `cargo check --lib` for `epiphany-model-adapter`, `epiphany-tool-adapter`, `epiphany-openai-runtime`, `epiphany-tool-mcp-runtime` | 154/154 tests pass; all four checks pass. Test children read before running: `git`, a PowerShell sleep, `cargo metadata`. None re-launches itself. | -| P4 | `rmcpprobe`: rmcp 2.2.0 with `default-features=false, features=["server","macros","transport-io"]`; one `#[tool]` returning `Json`; driven over stdin with JSON-RPC | Handshake at `protocolVersion 2025-06-18` works. `tools/list` carries both `inputSchema` and `outputSchema` from schemars. The call returns `structuredContent` plus a text copy. `ErrorData::invalid_params` becomes JSON-RPC `-32602`. The binary spawns nothing. | -| P5 | `lockprobe`: `SingleFileMessagePackBackingStore` at `a0813c6`; 4 writer processes × 200 (a disjoint insert plus a read-modify-CAS counter), 2 reader processes × 500 | 800/800 rows, counter 800/800, 0 read errors. Each writer lost about 500 CAS races, which it retried. The store lock is held per operation (`lib.rs:705-722`), so it serializes commits but excludes nothing at session scope. | -| P6 | `layoutprobe`: per-record files, a store-wide fs2 lock, receipt written last; 4 writers × 60 batches with 2 overlapping unlocked auditors | 240/240 receipts, 720/720 records, about 2.6M audited reads, 0 violations. On Windows, atomic replace is safe under concurrent unlocked readers. Kept as evidence for Q1-C, which is not recommended. | -| P7 | cultcache-ts `inspectCultCacheBytes` (CultLib dist 0.14.0) on a Rust-written record (a `DatabaseEntry` wrapper around a named nested struct holding an enum and an `Option`) | Format is `cultcache.store.v1`. The payload decodes as `[ {id, text, confidence: "Plausible", locations: [...], cut: null} ]`. Rust writes an empty member catalog (`members: []`), so the TS decode is generic, not typed. | -| P8 | Git with `* text=auto` (Epiphany's `.gitattributes`); system `core.autocrlf=true` on this machine | A 434-byte record holds no NUL, so git classified it `text: auto` (numstat `1 0`). With `binary` set, numstat is `- -` and `text/diff/merge` are unset. | -| P9 | Git merge rehearsal on per-record files | Disjoint branches merge cleanly; two branches writing the same resolution key conflict add/add. | -| P10 | Session lease: process A takes fs2 `try_lock_exclusive` and writes a sibling holder file; process B tries; A is killed with `-9`; B tries again | B is refused with `os error 33`, and the holder file is readable while the lock is held. After the kill, B acquires. The OS releases on death, so no repair step is needed. | -| P11 | Git history growth (Q1) | See Q1. | +| R1 | **No Rust Qdrant client exists anywhere under `F:\Projects`.** | (source read) `grep -rn qdrant --include=Cargo.toml --include=Cargo.lock --include=*.rs` over `F:\Projects` returns nothing in any live tree. | +| R2 | **Epiphany had one, and deleted it.** `856648de` "Delete unused semantic projection subsystem" removed `semantic_backend.rs` (1,018 lines), "Typed boundary around the Qdrant and Ollama HTTP APIs", plus 8,800 more lines of projector. | (source read) `git show 856648de --stat`; `git show 856648de^:epiphany-core/src/semantic_backend.rs`. | +| R3 | **That client was plain `reqwest::blocking` against Qdrant's REST API**, not a Qdrant crate: `PUT/GET/DELETE {base}/collections/{name}`, `PUT {base}/collections/{name}/points`, `POST .../points/query`, `.../points/scroll`, `.../points/delete`. Embeddings were `POST {base}/api/embed` returning `.embeddings`. | (source read) `856648de^:.../semantic_backend.rs:116,130,157,207,244,262,287,318,351,397,535,560`; deps at `856648de^:epiphany-core/Cargo.toml:37` (`reqwest = { version = "0.12", features = ["blocking","json"] }`). | +| R4 | **Epiphany has no CultNet *server* for documents.** Its live `cultnet_rs::` usage is service identity and trust anchors only. Its only UDP binds are the Persona Discord permit issuer, the Persona delivery client and Atlas publication. | (source read) `grep cultnet_rs::` over `epiphany-core/src` yields only `ServiceIdentitySigner`, `GameCultServiceTrustAnchorRecord`, `open/enroll_service_identity_at`, `derive_service_identity_id`. `UdpSocket::bind` appears only at `atlas/transport.rs:245`, `bin/epiphany-persona-discord-permit.rs:38`, `persona_discord_crossing.rs:322`. | +| R5 | **The permit issuer is a hand-rolled request/response loop**, not a reusable document server: `serve_persona_discord_permit_rudp` loops `transport.receive_once()`, matches one `DocumentPutRaw`, and replies with another. | (source read) `persona_discord_permit.rs:330-400`. | +| R6 | **Odin is the real harness to copy.** `odin-daemon` runs `CultMeshRudpDocumentServer::new(socket, SinkHandle, SnapshotHandle, CultMeshSystemClock, options)` and a `poll_once` loop, with Idunn activation, a process write lease, signal handling and presence-health publication. | (source read) `Odin/crates/odin-daemon/src/main.rs:14-40,542-560,600-700`. | +| R7 | **CultMesh's document server is port-shaped and mockable.** `CultMeshRudpRawDocumentSink::accept_raw_document(receipt)` and `CultMeshRudpSnapshotSource::raw_snapshot(&query)` are traits with blanket impls for closures; the clock is a trait. | (source read) `CultLib/packages/cultmesh-rs/src/rudp_document_server.rs:51-95`. | +| R8 | **A lean CultNet daemon needs six dependencies.** `odin-daemon` is `signal-hook, anyhow, chrono, cultcache-rs, cultmesh-rs, cultnet-rs, fs2, rmp-serde, serde`, and Odin's whole lock file is 156 packages. Epiphany's is 295. | (source read) `Odin/crates/odin-daemon/Cargo.toml`; `grep -c '^\[\[package\]\]' Cargo.lock` in both repos. | +| R9 | **`epiphany-core` is 40,941 lines across 37 modules with 39 `mod` declarations**, and pulls Ghostlight, `ed25519-dalek`, `ignore`, `semver`, `cultmesh-rs`, `cultnet-rs` and `windows-sys`. | (source read) `wc -l epiphany-core/src/*.rs`; `epiphany-core/Cargo.toml`. | +| R10 | **Epiphany's commit owner and its profile are crate-private**, so no external crate can reuse admission as it stands. | (source read) `reasoning_context.rs:1590` `pub(crate) struct TypedCommitStore`, `:1606` `pub(crate) const MIND_COMMIT_STORE`, `:1613` `pub(crate) fn commit_authorized_mind_mutation`. | +| R11 | **`RedbMessagePackBackingStore` stores one redb row per `(type, key)`**, transactionally, and creates parent directories. redb permits one writable handle per path, and the CultCache lock owns the open/transaction/close interval. | (source read) `cultcache-rs/src/lib.rs:960-1013`, `:979-982`. | +| R12 | **Nothing consumes `@gamecult/huginn`.** The only `package.json` naming it is Huginn's own. Eve's Huginn entry points at a checked-in fixture file, not the package. | (source read) Grep over every `package.json` under `F:\Projects`; `Eve/web/local-provider-catalog.json:72-83` gives `"url": "./fixtures/huginn-cc-surface.eve"`. | +| R13 | **Eve's Huginn fixture is static and already stale.** It describes `E:\Projects\CultCacheTS\.voidbot\state\huginn.cc` and declares `"freshness": {"state": "fixture"}`, `"splitTarget": "Huginn"`. | (source read) `Eve/web/fixtures/huginn-cc-surface.eve:16`; `huginn-cc-surface.conformance.json`. | +| R14 | **CultCache Studio exists** as a Unity editor surface in CultLib. | (source read) `CultLib/src/GameCult.Unity/Assets/Caching/Editor/CultCacheStudioWindow.cs`, `CultCacheStudioDrawers.cs`. | +| R15 | **Qdrant on Yggdrasil is voidbot's container**, `qdrant/qdrant:v1.17.1`, host network, bound `127.0.0.1`, storage `/srv/voidbot/qdrant`, started by `voidbot-retrieval.service`. | (source read) `gamecult-ops/compose/voidbot-retrieval.yggdrasil.yaml`; `systemd/voidbot-retrieval.service`. | +| R16 | **Two Ollama endpoints exist, and the Yggdrasil precedent is the local one.** `epiphany.service` embeds against `http://10.77.0.1:11435` with `qwen3-embedding:0.6b`; voidbot's indexer uses Nightwing `10.77.0.3:11434` with the same model. | (source read) `gamecult-ops/systemd/epiphany.service:14-15`; `runbooks/yggdrasil-replacement-2026-07.md:184,193`; `runbooks/voidbot-retrieval-recovery-yggdrasil.md:42-62`. | +| R17 | **Idunn v2 is recipe-plus-binding.** A repo publishes `deployment/idunn/recipe.toml` (`gamecult.idunn.target_declaration.v1`: steps, artifacts, `[service]`, `[state.slots]`, `[[provides]]`, `[[dependencies]]`); Yggdrasil admits a paired `gamecult.idunn.operator_binding.v2` naming runners, workload roots, route, brakes, rollout and placement. | (source read) `Odin/deployment/idunn/recipe.toml`; `Ghostlight/deployment/idunn/recipe.toml:168-187`; `gamecult-ops/idunn/yggdrasil/bindings/odin.toml.in`, `bindings/README.md`. | +| R18 | **Idunn brakes are typed and already separated.** `idunn.deployment_brake.v1` (scope `deployment`) and `idunn.lifecycle_brake.v1` (scope `continuity-restart`) are distinct records with distinct authorities. | (source read) `cultnet-rs/src/idunn_deployment_brake.rs:9-15`; `idunn_lifecycle_brake.rs:4-7`. | +| R19 | **The authority backup is an explicit path list, daily at 03:20 UTC.** It tars a fixed set including `var/lib/gamecult/epiphany` and `srv/voidbot/state`; a path not listed is not backed up. | (source read) `gamecult-ops/scripts/backup-gamecult-authority-yggdrasil.sh:80-105`; `systemd/gamecult-authority-backup.timer`. | +| R20 | **The workstation reaches Yggdrasil by a supervised SSH tunnel with a fixed forward table**, scheduled task `GameCult-Yggdrasil-Tunnel`. It already forwards `17875` (voidbot MCP) and `16333/16334` (Qdrant). | (source read) `gamecult-ops/scripts/start-yggdrasil-tunnel.ps1:13-26`; `runbooks/yggdrasil-ssh-tunnel.md:86-88`. | +| R21 | **Allocated `178xx` RUDP/service ports** are 17870 Idunn health, 17871 Odin rendezvous, 17873 VoidBot swarm publisher, 17874 Hermodr, 17875 voidbot MCP, 17876 Epiphany permit listener, 17877 Starfire permit requester, 17878 dings. **17872 and 17879 are unallocated.** | (source read) `gamecult-ops/inventory.md:247,455,502,537`; `runbooks/yggdrasil-replacement-2026-07.md:315-321`; `idunn/yggdrasil/bindings/*.in`. | -Source reads that mechanism claims rely on: +Carried forward from the first pass and still load-bearing: -- **Every `load_envelope` site uses a storeless cache.** Each builds - `CultCache::new()` and feeds it envelopes it pulled separately: - `persona_conversation.rs:959-961`, `persona_social_state.rs:231-251` then - `:846-866`, and `resident_self.rs:764-815`. `put_envelope` with zero stores - inserts into memory only (`home_index` returns `None`, `lib.rs:2425-2432`), - which is exactly the deleted `load_envelope` (CultLib `4ed9871`: "it had no - callers and admitted records into the view without a store"). -- **The old pin already refused unregistered types at pull** - (`e171eca3` `lib.rs:1965-1986`). The re-pin adds only the home-store check, - and every Epiphany cache has a single generic store. -- **Cargo.lock has one CultLib source** (`Cargo.lock:367,385,395,406`). No - second revision arrives through codex-connector or ghostlight. -- **VoidBot's vendored cultcache-ts is 0.1.0** and decodes only the legacy - envelope array (`vendor/cultcache-ts/dist/single-file-messagepack-backing-store.js:31`). - It cannot read a `cultcache.store.v1` store. +- **P4 (probe).** rmcp 2.2.0 with `features = ["server","macros","transport-io"]` serves stdio JSON-RPC, handshakes at `2025-06-18`, emits both `inputSchema` and `outputSchema` from schemars, returns `structuredContent`, maps `ErrorData::invalid_params` to `-32602`, and spawns nothing. +- **P7 (probe).** cultcache-ts `inspectCultCacheBytes` decodes a Rust-written `cultcache.store.v1` record; Rust writes an empty member catalog, so the TS decode is generic. -Not probed: the working directory Claude Code gives a user-scope stdio server. -The design does not depend on it, because every tool takes an explicit -`repo_root`. +Superseded probes: P5, P6, P8, P9, P10 and P11 all measured git layout, store locking at session scope, or git attribute classification. They were evidence for a repo-committed store and no longer bear on any live design. P1-P3 were Cut 1 and landed. -## Shared design (cuts cite these sections) +## D1. Package boundaries and where admission lives -### D1. Documents +This is the decision the brief asks for, so it is stated first. -Every pipeline document follows the Mind value-wrapper pattern -(`mind_documents.rs:129-137`). A `DatabaseEntry` has one slot: +**Ruling 1 says Epiphany owns the schemas. The target's End state assigns +admission, queries and the index to the organ** ("**The organ (Huginn).** One +service owns every mind it hosts: admission, with per-document rules and typed +refusals; ... queries ...; semantic search ...; a typed hand-off"). Those are +consistent, and together they settle the split: -```rust -#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] -#[cultcache(type = "epiphany.pipeline.ruling.v1", schema = "EpiphanyPipelineRulingDocument")] -pub struct EpiphanyPipelineRulingDocument { #[cultcache(key = 0)] pub value: PipelineRuling } -``` +- **Epiphany owns the document types, their keys, their bounds and the published + JSON schemas.** +- **Huginn owns admission rules, receipts, storage, queries, the index, the + hand-off and the CultNet surface.** -Encoding and schema follow from that shape: +**Admission does not live in `epiphany-core`, and Huginn does not depend on it.** +Three source-grounded reasons: -- The value is a plain `serde` + `schemars::JsonSchema` struct. -- It is always prepared with `prepare_entry_named` (`lib.rs:2181-2200`). -- On the wire the payload is a one-element MessagePack array whose element is a - named map (P7, derive `lib.rs:216-245`). -- There are no per-field slot numbers: the named map is the evolution surface, - and slot 0 is the only slot. -- The published JSON Schema describes the value, which is exactly what MCP - clients send and receive and what cultcache-ts decodes as - `payloadPreview[0]`. +1. **It cannot.** The commit owner, its profile and the wrappers are all + `pub(crate)` (R10). Exposing them would publish Epiphany's Mind commit + machinery as a public API to make an unrelated service compile. +2. **The weight is absurd.** Huginn would compile 40,941 lines and 295 lock + packages, including Ghostlight and `ed25519-dalek`, to use about 2,000 lines + of it (R9). Odin's comparable daemon costs 156 packages total (R8). This is + exactly the build fan-out AGENTS.md's Source And Build Economy forbids. +3. **The rules are not the same rules.** Epiphany's admission is bound to a + scheduler: launch requests, sealed reasoning bases, decision contexts. + Pipeline admission is bound to an instance and a campaign. Sharing the + function would mean sharing none of the interesting part. -Type ids are `epiphany.pipeline..v1`. Schema names are -`EpiphanyPipelineDocument`. The store epoch is `epiphany.pipeline.epoch.v1`. +**So a third package owns the shared half.** New leaf library +`epiphany-pipeline`, in the Epiphany repo, workspace member, `autobins = false`: -**Bounds, with no blob fields.** No `Vec`, no `serde_json::Value`, and no -free-form maps. Text fields use three bounded aliases, checked in UTF-8 bytes -following the `persona_feedback_admission.rs:994` precedent: - -| Alias | Bound | +| | | |---|---| -| `Short` | ≤ 200 bytes | -| `Line` | ≤ 1,000 bytes | -| `Para` | ≤ 4,000 bytes | +| **Owner** | The ten document kinds plus the three new ones, their value types, bound aliases, format rules, key derivation, and the derived JSON schemas. | +| **Dependencies** | `cultcache-rs`, `schemars`, `serde`, `rmp-serde`, `chrono`, `anyhow`. Nothing else. | +| **Consumers** | Huginn's `huginn-mind` (admission) and `eureka-state` (typed tool schemas), both by git rev. Epiphany itself does **not** consume it in this campaign; that is campaign two. | +| **Why a new crate** | A live cross-repo consumer needs these types without Epiphany's 295-package graph. `F:\Projects\CLAUDE.md` says authority separation alone does not justify a crate; this is not authority separation, it is a named external consumer and a hard dependency boundary. | +| **Why in the Epiphany repo** | Ruling 1. The schema publication path, `schemas/cultnet/index.json` and the derivation test stay where they are. | -Every list has a maximum count, given below. Long narrative stays in repo docs and -is cited by `DocRef { path: Short, start_line: u32, end_line: u32, commit: Sha }`. -A breach is refused with `FieldBound { field, limit, actual }`. +`epiphany-core` keeps the schema-derivation test's *outputs* — the committed +`schemas/cultnet/epiphany.pipeline.*.v1.schema.json` files are Epiphany's +publication artifact — but the test that derives and compares them moves into +`epiphany-pipeline`, reading `../schemas/cultnet` the way it already does +(`pipeline_store.rs:1173`). -**Shared value types.** +**Huginn's package boundary**, applying AGENTS.md's one-package-per-production- +entrypoint rule. Two entrypoints, so two binary-owning packages plus one library: -- `Sha`: 7–40 lowercase hex characters. -- `Date`: `YYYY-MM-DD`. -- `PipelineKind` is a closed enum: `Campaign`, `Target`, `Question`, `Ruling`, - `CutSpec`, `CutReport`, `Verdict`, `Finding`, `FollowUp`, `Resolution`, plus - `MergeExclusion` only if Q3 is A. -- `PipelineRef { kind, id: Short }`. -- `CodeLocation { path: Short, line: u32, end_line: Option }`. -- `CommitRange { base: Sha, head: Sha }`. -- `Evidence { kind: EvidenceKind, locator: Line, result: Line }`, where - `EvidenceKind` is one of `Command`, `Test`, `Mutation`, `Probe`, `SourceRead`, - `Capture`. -- `ForeignRef { repo: Short /* Org/Repo */, commit: Sha(40), kind, id: Short, payload_sha256: 64 hex }`: - the sharing citation (D6). -- `Faculty`: `SelfFaculty`, `Imagination`, `Hands`, `Soul`, `MindSteward`, - `Eyes`, `Operator`. +| Package | Kind | Owns | +|---|---|---| +| `huginn-mind` | library | Mind storage, admission rules, receipts, queries, derivations, the index port and the embedding port. No process, no socket. | +| `huginn-daemon` | binary `huginn-daemon` | The CultNet surface, the Idunn lifecycle, Qdrant and Ollama adapters, the serve loop. | +| `eureka-state` | binary `eureka-state` | The stdio MCP client. | -**Keys: identity, not convenience.** Single-writer means a key only has to be -unique within one repo's history. It must also be stable across a merge, so that -the same document on two copies is the same key and a different document under -the same key surfaces as a real conflict. Keys are semantic and derived from -fields; admission recomputes each key and refuses a mismatch with -`InvalidIdentity { kind, key, expected }`, as `validate_mind_write_envelope` does -for Mind (`mind_documents.rs:357-382`). +**The daemon test (`F:\Projects\CLAUDE.md`).** `huginn-daemon` earns its process: +it outlives every Claude Code session, owns an independent resource dependency +(Qdrant, a redb store), and isolates a dead session from a corrupted mind. That +is lifecycle, resource and failure isolation, and it protects the named +invariant "exactly one writer per mind". `eureka-state` earns a *separate* +entrypoint but is **not** a daemon: it is a per-session stdio child with a +different dependency set (rmcp, tokio) and a different lifecycle. `huginn-mind` +earns no process at all. + +**Why `eureka-state` lives in Huginn, not Epiphany.** The client and the server +share the request and response document types. Putting the client in Epiphany +would make the wire contract have two owners in two repos. It also keeps rmcp +and tokio out of Epiphany's release bundle, which was the original Cut 4's +reason for a separate package anyway (`construction.rs:82-98` lists the nine +packaged binaries; none changes). + +## D2. Documents + +Unchanged from the landed Cut 3a except as noted: the value-wrapper pattern, the +`value_types!` single field list, the bound aliases (`Short` 200, `Line` 1,000, +`Para` 4,000 UTF-8 bytes), the format types (`Label`, `Slug`, `OrgRepo`, `Sha`, +`FullSha`, `Sha256Hex`, `Date`), key derivation, and the ten kinds all survive +verbatim. The epoch stays `epiphany.pipeline.epoch.v1`; every change here is +additive, so Q2 keeps the epoch. + +**Deleted from the set:** `PipelineWriterHolder` and its wrapper +`EpiphanyPipelineWriterHolder` (`pipeline_documents.rs:334-349,492-497`). They +were the display record of the per-clone lease. + +**Added: three kinds, each with a live consumer.** + +| Kind | Type id | Value fields | Live consumer | +|---|---|---|---| +| `instance` | `epiphany.pipeline.instance.v1` | `instance: Slug`, `display_name: Short`, `created_at: Date`, `host: Short` | The mind's identity document. Admission's identity check (ruling 14); `whoami` in `eureka-state`; the hand-off's `from`/`to`. | +| `stewardship` | `epiphany.pipeline.stewardship.v1` | `instance: Slug`, `repo: OrgRepo`, `assigned_on: Date`, `note: Line` | Ruling 14's "stewardship is an assignment". Query "which repos does this instance steward"; the Rehydrate brief; admission's campaign-repo check. | +| `hand_off` | `epiphany.pipeline.hand_off.v1` | `from_instance: Slug`, `to_instance: Slug`, `repo: OrgRepo`, `documents: Vec[256]`, `reason: Para`, `handed_on: Date` | Ruling 14's "reassignment is an explicit typed hand-off recorded in both minds". Cut 12's import path. | + +**Keys.** | Kind | Key | |---|---| -| campaign | `` | -| everything else | `::` | +| `instance` | `` | +| `stewardship` | `:stewardship:` | +| `hand_off` | `:hand_off:..` | +| campaign | `` (unchanged) | +| everything else | `::` (unchanged) | -`` and `` match `[A-Za-z0-9._-]{1,64}`. `` is the human label -agents already cite: +`` is the `OrgRepo` with `/` replaced by `_`, because `/` is not a +`Label` byte and the key must segment unambiguously. Admission recomputes it and +refuses a mismatch with the existing `InvalidIdentity`. -| Kind | Local label | Example | +**Resolution matrix additions.** `stewardship` resolves by +`Superseded{by: stewardship}` or `Withdrawn`. `instance` and `hand_off` are not +resolvable. Everything else is unchanged. + +**`PipelineRefusal` splits.** The landed enum (`pipeline_store.rs:41-55`) mixes +document refusals with store, git and lease refusals. It becomes two: + +- `epiphany-pipeline` keeps the document half: `FieldBound`, `InvalidFormat`, + `InvalidIdentity`. +- `huginn-mind` owns the service half: `MissingIdentity`, `ForeignEpoch`, + `ForeignStore`, plus every admission-rule refusal (`MissingReference`, + `WrongReferenceKind`, `IdentityCollision`, `AlreadyResolved`, + `IncompatibleResolution`, `CitesResolvedDocument`, `RevisionWithoutSupersession`, + `InvalidOptions`, `InvalidChoice`, `RepoNotInCampaign`, `DuplicateLabel`, + `CutReportWithoutSpec`, `RangeOutsideCommits`, `FalsifiedClaimWithoutConfirmedFinding`, + `UnprovenClaimWithConfirmedFinding`, `FindingWithoutRange`, `FindingWithoutEvidence`, + `UnknownInvariant`), plus `ForeignInstance { declared, mind }` (ruling 14) and + `Unavailable`. + +**Deleted refusals:** `NotRepoRoot`, `NoMainWorkTree`, `StoreNotMarkedBinary`, +`LockNotIgnored`, `WrongBranch`, `WriterLeaseHeld`. Every one of them is a +statement about a repo-resident store. + +## D3. The organ's storage and admission + +**One mind per instance, one redb store per mind.** +`/minds//mind.cc` as a `RedbMessagePackBackingStore` +(R11). Redb, not the single-file store, because a mind grows without bound and +the single-file backing store rewrites the whole snapshot on every write; that +is the monolithic-store footgun `~/.claude/CLAUDE.md` names under +Infrastructure. Odin uses the single-file store, but its topology store is small +and bounded. + +**Identity.** The first write to a mind carries both the +`EpiphanyPipelineIdentity` (epoch) and the `instance` document, in one batch. +The opener refuses records-without-identity (`MissingIdentity`), a foreign epoch +(`ForeignEpoch`) and any unregistered type (`ForeignStore`), exactly as the +landed `pipeline_cache` does (`pipeline_store.rs:87-120`) — that logic moves +almost verbatim; only its backing store changes. + +**Admission.** One public entry: + +``` +admit(&mut Mind, PipelineAdmissionBatch) -> PipelineAdmissionOutcome +``` + +with `PipelineAdmissionBatch { instance, provenance, documents (1..64) }` and the +outcome one of `Committed { receipt_id, committed_at, writes }`, +`AlreadyAdmitted { receipt_id }`, `Refused(PipelineRefusal)` or +`Conflict { identities }`. + +Steps, in order: + +1. **Identity check (ruling 14).** `batch.instance` must equal the mind's + `instance` document, or `ForeignInstance`. This is the check that replaces + the whole lease. +2. Validate bounds and formats. +3. Recompute keys. +4. Check references against the store image plus the batch. +5. Apply the per-kind rules (unchanged from the old D4, minus the campaign + `origin` check, which no longer has a repo to inspect — `repo` must instead + be one the instance stewards, giving `RepoNotInCampaign` a new source). +6. Derive writes (the `Answered` resolution for a ruling that answers a + question; the paired `stewardship` records on a `hand_off`). +7. Commit. + +**Receipts stay, and Huginn owns its own commit primitive.** `huginn-mind` +defines `HuginnCommitReceipt` with its own type id +`huginn.mind_commit_receipt.v1`, carrying the same shape that earned its keep in +Epiphany: authority, invariant owner, strong reads, writes, a content-digest +receipt id, and `committed_at`. It replays idempotently on an exact match and +returns typed `Conflict` on a lost CAS. + +This is deliberately **not** a reuse of `EpiphanyMindCommitReceipt`. The landed +Cut 3a reused it with `store_id = "epiphany-pipeline"` because both lived in one +crate; across a repo boundary that reuse would drag the whole crate (D1). +Roughly 120 lines of receipt/replay/CAS logic are re-implemented. That is a real +duplication and it is the honest price of the service boundary — it is named +here, in the subtraction ledger, and as follow-up FU-3, rather than hidden. + +**Admission time** lives on the receipt, never in a document, so exact replay +stays byte-identical. Unchanged. + +**Concurrency.** The organ is the only writer to any mind it hosts, and it is +single-process. CAS stays as defence in depth against its own bugs and against +the import path. The old session lease has no successor: there is nothing left +for it to exclude. + +## D4. Queries + +`huginn-mind` owns every derivation; no client re-derives status. + +- `get(id) -> Option` +- `query(&PipelineQuery) -> Vec` +- `open_items(campaign) -> PipelineOpenItems` +- `rulings_in_force(Option) -> Vec` +- `stewardship(instance) -> Vec` + +`PipelineDocumentView` is +`{ id, kind, document, resolution: Option<(id, PipelineResolution)>, receipt_id, admitted_at, faculty }`, +its admission fields joined from the receipts naming the document. + +`PipelineQuery` keeps its landed field set — `campaign`, `repo`, `cut`, `kinds`, +`status`, `outcome`, `faculty`, `admitted_after/before`, `text_contains`, +`limit` ≤ 200 — and gains `instance` and `semantic: Option<{ text, top_k }>`. +When `semantic` is set the query runs through the index (D5) and the hit ids are +resolved back through the typed store, so the store stays the truth. + +Derived state, never stored, unchanged from the landed design: a document is +**in force** when no resolution names it; **open items** are unresolved +questions, findings and follow-ups, in-force cut specs with no report, and cut +reports with no verdict. + +## D5. The index + +**Owner:** `huginn-daemon`, through two ports defined in `huginn-mind` so the +library stays testable without either service: + +``` +trait EmbeddingPort { fn embed(&self, texts: &[String]) -> Result>>; } +trait IndexPort { fn upsert(&self, points: Vec) -> Result<()>; + fn search(&self, vector: Vec, top_k: u32, filter: IndexFilter) -> Result>; + fn delete(&self, ids: Vec) -> Result<()>; } +``` + +**Adapters.** `QdrantIndex` and `OllamaEmbedding`, both plain `reqwest::blocking` +against the REST endpoints R3 establishes, ported in shape from the deleted +`semantic_backend.rs`. That module is the precedent: it confined JSON to one +xenos-facing boundary and treated Qdrant as "a rebuildable projection rather +than canonical authority", which is exactly this design's relationship to it. + +**Collections.** `huginn_pipeline_documents`, one point per document, vector +size 1,024 (`qwen3-embedding:0.6b`, R16). Payload `{ instance, campaign, repo, +kind, doc_id, admitted_at }`, with payload indexes on `instance`, `campaign`, +`repo` and `kind`. Receipts, identity and provenance are never indexed. +In-force status is never indexed; clients resolve it through `get`. + +**Indexing is at admission, in the same call, but not in the same transaction.** +The typed commit lands first; the index upsert follows. If the upsert fails the +admission still succeeded, and the organ records the document id in a +`pending_index` slot and retries on its next poll. The index is a projection, so +a stale index is a degraded read, never a lost write. The reverse order would +let an index failure reject an admitted document. + +**Rebuild.** `huginn-daemon --reindex ` drops and rebuilds the +collection from the typed store. This is the affordance that makes the +projection disposable, and it is the negative proof that the index is not truth. + +## D6. The CultNet surface + +**Copy Odin's harness (R6, R7).** `huginn-daemon` binds one loopback UDP socket +from `GAMECULT_IDUNN_CANDIDATE_BIND`, constructs +`CultMeshRudpDocumentServer::new(socket, sink, snapshot, CultMeshSystemClock::default(), options)`, +and runs a `poll_once` loop with `signal-hook` handling SIGTERM/SIGINT. + +Requests arrive as `DocumentPutRaw` and replies go back as `DocumentPutRaw`, +the shape Epiphany's permit issuer already uses (R5) and that the document +server routes natively. Two request documents and two response documents: + +| Document | Type id | Payload | |---|---|---| -| target | `r` | `r2` | -| question | `Q-` | `Q10-1` | -| ruling | label | `R6` | -| cut spec | `cut-