From 1f78867993e9900ca1594b700e09e0e7ab327ce9 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 10 Sep 2026 21:19:29 +0200 Subject: [PATCH] Give Odin its own doctrine, re-entry surfaces, and a deployment handoff Odin had no AGENTS.md, no CLAUDE.md and no notes/ or state/, so every session started cold in the repo whose deployment is the least routine in the estate. AGENTS.md carries what is specific to Odin rather than repeating estate doctrine: that the host is authoritative, that a local compile says nothing about the Linux release, that /etc/machine-id must be mounted or identity tests fail in a way that looks like broken code, and the two listing traps that have each misled a reading -- an alphabetically truncated unit list, and odin.service being active while owning no process. notes/odin-deployment-handoff-2026-09-10.md records why Odin currently cycles and why the two obvious interventions fail: an engaged lifecycle brake parks a continuity transaction on the target and blocks deployment, which the operator doctrine says it must not; and freeze_one_queued_command only runs when continuity made no progress, so a queued deployment is starved on exactly the unstable target it exists to repair. Both defects are named with the state that proves them rather than left as a description of a bad night. Co-Authored-By: Claude Opus 5 --- AGENTS.md | 87 +++++++++++++++ CLAUDE.md | 3 + notes/odin-deployment-handoff-2026-09-10.md | 111 ++++++++++++++++++++ 3 files changed, 201 insertions(+) create mode 100644 AGENTS.md create mode 100644 CLAUDE.md create mode 100644 notes/odin-deployment-handoff-2026-09-10.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3f33610 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,87 @@ +# Odin Instructions + +## Project Purpose + +Odin is the all-seer and rendezvous organ for the CultMesh Verse: discovery, +schema awareness, translation routes, and interface aggregation. Every other +GameCult target is observed *through* Odin, which is why its availability is +load-bearing for the estate rather than for itself. + +Estate-wide doctrine — the Prime Directive, Code Is A Liability, the Loud +Rebuild Contract, Odin-class architecture, the CultCache/CultNet/CultMesh +substrate rules — lives in `F:\Projects\CLAUDE.md` and `~/.claude/CLAUDE.md` and +is loaded automatically. It is not repeated here. + +## Canonical State + +- `docs/architecture.md` — the source-grounded architecture note. +- `docs/transport-shortcut-inventory.md` — a **dated ledger**. Entries are left + as written and corrected by dated notes on top, never rewritten. Follow that + convention for anything else recording history here. +- `notes/` — compact re-entry packets. Read the newest before touching + deployment. +- `state/map.yaml` — the current deployment and admission map. This is the one + file that goes stale fastest; verify it against the host before trusting it. +- `personas/gjallar.persona_state.cc` — Gjallar's Persona state, in the portable + `gamecult.persona_state.v0` shape. + +## Important Paths + +Relative to the repository root. + +- Daemon: `crates/odin-daemon` +- Shared records and documents: `crates/odin-core` +- Deployment recipe Idunn seals and builds from: `deployment/idunn/recipe.toml` +- Operator binding (lives on the host, not here): + `/etc/gamecult/idunn/bindings/odin.toml` + +## Build And Deploy Target + +Odin runs on Linux under Idunn on `yggdrasil`. This workstation is Windows and +is where the shell is, not where the artifact runs: **a local compile is not +evidence about the Linux release.** Build on the target or through the deploy +path's own builder, and say which one you used. + +```bash +git archive HEAD | ssh ygg 'sudo rm -rf /srv/build/odin && sudo mkdir -p /srv/build/odin && sudo tar -x -C /srv/build/odin && sudo chown -R gamecultadmin:gamecultadmin /srv/build/odin' +ssh ygg 'sudo docker run --rm -v /srv/build/odin:/w -v /etc/machine-id:/etc/machine-id:ro -v /srv/build/cargo-registry:/usr/local/cargo/registry -v /srv/build/cargo-git:/usr/local/cargo/git -w /w rust:1.95-bookworm cargo test -p odin-core -p odin-daemon' +``` + +`/etc/machine-id` **must** be mounted or every identity-enrolling test fails +with `Linux machine-id is unavailable` — a wall of failures that looks like +broken code and is a missing mount. + +`muninn-psmoveapi-tracker` fails to link in that image for want of +`libpsmoveapi`. It declares no CultLib dependency; scope test runs to the crates +you are changing. + +## Session Bootstrap And Re-entry Protocol + +On fresh session load, before touching deployment: + +1. Read the newest file in `notes/`. +2. Read `state/map.yaml`, then **verify it on the host** — it describes a live + system and is the first thing to rot. +3. `git log --oneline -5` and `git status --short --branch`. + +The host is authoritative for every question of the form "is X running", "is X +admitted", "what release is live". Two commands answer most of them: + +```bash +ssh ygg 'systemctl list-units --all "idunn-odin-*" --state=active' +ssh ygg 'sudo /usr/local/bin/idunn status --state-store /var/lib/gamecult/idunn/control.cc' +``` + +## Operating Discipline + +- **Never conclude from a partial listing.** `systemctl list-units | head` sorts + alphabetically and will hide the one active unit among dozens of failed ones. + Enumerate completely or state that the answer is unknown. +- **A unit can be `active` and own no process.** `odin.service` in + `/etc/systemd/system/` is exactly that: active, `MainPID 0`, owning nothing. + It has misled at least two separate readings. Check `-p MainPID` before + believing a status line. +- Verify changing facts against the host or source, never against a document — + including the documents in this repository. +- Redeploying Odin is not routine. Read `notes/` first; the failure mode is + documented and it is not obvious. diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..51a22c5 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,3 @@ +Repository doctrine for this project lives in AGENTS.md. + +@AGENTS.md diff --git a/notes/odin-deployment-handoff-2026-09-10.md b/notes/odin-deployment-handoff-2026-09-10.md new file mode 100644 index 0000000..b6c2905 --- /dev/null +++ b/notes/odin-deployment-handoff-2026-09-10.md @@ -0,0 +1,111 @@ +# Odin cannot currently be redeployed, and it cycles + +Written 2026-09-10 after an incident caused by an optional dependency bump. +Read this before running `idunn up odin`. + +## State on yggdrasil as of writing + +| | | +|---|---| +| Odin | **up**, cycling: ~9 unit starts/hour, self-terminates every ~96s under load | +| running release | `sha256-61c32655...` (from `up-07cb1979`, admitted 2026-09-09 22:17) | +| Idunn | `active`, 0 restarts, healthy throughout | +| queued deployment | `up-fc005d83-79d4-418c-bc76-80d07dd6eff3` — **stuck `queued`, cannot dequeue** | +| lifecycle brake | released | +| `control.cc` | 6.5 MB · `history.cc` 2.5 MB (archival working) | + +Odin is *serving* between restarts. This is degradation, not an outage. + +## The loop, precisely + +``` +Odin rejected CultMesh RUDP application message DocumentPutRaw + odin-presence:odin-yggdrasil:sha256-:... + : runtime presence has no exact current activation and provider anchor +Error: timed out waiting for reliable acknowledgement from CultMesh RUDP catalog 127.0.0.1:17972 +``` + +1. Odin's runtime-presence publisher publishes to **Odin's own catalog**. +2. The catalog rejects it: the projection at + `/var/lib/gamecult/idunn-projection/topology.cc` holds no activation matching + the unit this process was launched with. +3. No acknowledgement ever arrives. The publisher times out after ~96 s and the + daemon **exits 1 on its own** — systemd is not stopping it. +4. Continuity restarts it under a fresh unit, which **mints a new activation**, + and the projection is behind again. + +**Continuity restarting Odin is what keeps the activation ahead of the +projection.** The restart is not the recovery; it is the thing that guarantees +the next failure. + +## Why the two obvious moves do not work + +### Braking continuity blocks deployment + +Engaging the lifecycle brake *does* stop the loop — Odin converged clean, four +minutes up, zero rejections, which is what confirmed the diagnosis. But a +continuity transaction that opened **before** the brake then parks forever: + +``` +waiting on lifecycle brake denies continuity restart +``` + +It owns the target, so no deployment can freeze while the brake is engaged. +`F:\Projects\CLAUDE.md` says a lifecycle brake must not gate deployment +authority. **It does.** That separation is not holding, and it is defect 1. + +### The queued deployment is starved by design + +`run_scheduler_tick` (`Idunn/src/control_plane.rs`) runs +`freeze_one_queued_command` **only** when neither a resumed transaction nor +continuity made progress that tick. The ordering is deliberate — "unfinished +ownership work first, admitted-body continuity second, new commands last" — but +on an unstable target continuity always has work, so a queued command never +runs. Observed across four separate windows where nothing owned the target. + +That is defect 2, and it is the shape this estate keeps producing: **the one +command that could repair the instability cannot run because the target is +unstable.** + +## Underlying cause, older than this incident + +Redeploying Odin destroys the observer Idunn needs in order to admit the +replacement. Idunn publishes the candidate's Expected projection into the store +the incumbent reads; the incumbent can no longer validate its own presence and +dies. This is recorded as R17 and it is why an Odin deployment is never routine. + +## What to try, in order + +1. **Settle Odin first, deploy second.** The activation/projection race is the + root; everything else is consequence. A candidate whose projection matches at + launch is what ended this loop at 22:17 on 09-09. +2. **Fix the freeze starvation** so a queued deployment can take a target that + continuity is fighting over — otherwise the repair can never be applied by + the machine that needs it. +3. **Fix the brake separation** so an engaged lifecycle brake suspends + continuity actuation without parking a transaction on the target. +4. Only then re-run the deployment. The pin bump it carries (`0e540ca`, + `f7e3fc3`) is committed on `main` and undeployed; nothing is lost by waiting. + +There is **no cancel verb** (recorded as R16), so `up-fc005d83` will fire +whenever the target frees. Treat it as armed. + +## What not to do + +- Do not `systemctl start` a failed Idunn unit by hand. It mints a new + `InvocationID`, and Idunn then refuses to stop a unit whose invocation it + cannot match — this blocked a recovery for 20 minutes on 09-09 and needed + `systemctl reset-failed` to undo. +- Do not read a gap between restarts as convergence. Odin holds for ~90 s + between cycles; that window was misread as "stable" twice in one night. + Measure `Started idunn-odin` counts over an hour instead. +- Do not trust `head` on a unit listing. See `AGENTS.md`. + +## What is verified working + +- History archival: terminal transactions leave `control.cc` for `history.cc` + on completion. `history.cc` exists and is 2.5 MB; `status` merges both. +- Continuity gives up after `CONTINUITY_RESTART_ATTEMPTS = 3` against one + generation, which is what frees a target after repeated failure. +- Idunn survives all of this: a faulting scheduler tick is logged, not fatal, + and startup no longer depends on the deployment brake anchor.