Skip to content

Fix chat/send sender identity: personas show as themselves (#412) - #422

Merged
joelteply merged 1 commit into
mainfrom
fix/chat-send-identity-412
Mar 25, 2026
Merged

joelteply merged 1 commit into
mainfrom
fix/chat-send-identity-412

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Persona tool calls to chat/send showed as the human owner because sender resolution skipped params.userId and went straight to findHumanOwnerOrFallback.

Fix: use params.userId (auto-injected by AgentToolExecutor with persona UUID) before falling back. Priority: explicit senderId > params.userId > human owner.

  • Browser/CLI: params.userId = human UUID → shows as human (correct)
  • Persona tool call: params.userId = persona UUID → shows as persona (now correct)
  • No identity: falls back to human owner (correct for single-owner system)

Also updates gap analysis: #412, #413, #415, #416 all marked DONE.

Test plan

  • TypeScript compilation clean
  • Deploy and verify persona chat messages show persona name, not Joel

🤖 Generated with Claude Code

…#412)

chat/send resolved sender to human owner even when a persona called it via
tool executor. Now uses params.userId (auto-injected by AgentToolExecutor
with persona's UUID) before falling back to human owner.

Also: gap analysis updated — #412, #413, #415, #416 marked DONE.
Copilot AI review requested due to automatic review settings March 25, 2026 10:22
@joelteply
joelteply merged commit 82e11ca into main Mar 25, 2026
3 of 5 checks passed
@joelteply
joelteply deleted the fix/chat-send-identity-412 branch March 25, 2026 10:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes sender attribution for collaboration/chat/send so persona-initiated tool calls show as the persona (instead of the human owner), by prioritizing senderId and then params.userId before falling back to the seeded human owner. It also updates the alpha gap analysis doc to mark related issues as done.

Changes:

  • Update chat/send sender resolution priority to: senderId > params.userId > human-owner fallback.
  • Mark issues #412 / #413 / #415 / #416 as DONE in the planning gap analysis doc.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/commands/collaboration/chat/send/server/ChatSendServerCommand.ts Changes sender identity resolution to use params.userId (persona UUID) before owner fallback.
docs/planning/ALPHA-GAP-ANALYSIS.md Updates issue statuses to DONE with PR references.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +50 to +51
const senderId = params.senderId || params.userId;
const sender = senderId

Copilot AI Mar 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

params.userId is always present at runtime, but in server-side internal calls Commands._executeDirect() defaults it to SYSTEM_SCOPES.SYSTEM (nil UUID) when callers don’t provide userId. With the new senderId = params.senderId || params.userId logic, those calls will now attempt findUserById('00000000-0000-0000-0000-000000000000') and throw User not found, whereas previously they succeeded via findHumanOwnerOrFallback(). Consider treating SYSTEM_SCOPES.SYSTEM (and possibly anonymous/bootstrap IDs) as “no identity” and falling back to findHumanOwnerOrFallback, or attempt lookup and fall back only when senderId wasn’t explicitly provided.

Suggested change
const senderId = params.senderId || params.userId;
const sender = senderId
const senderId = params.senderId ?? params.userId;
const NIL_UUID_SYSTEM = '00000000-0000-0000-0000-000000000000';
const isNilSystemSender = senderId === NIL_UUID_SYSTEM;
const sender = senderId && !isNilSystemSender

Copilot uses AI. Check for mistakes.
joelteply added a commit that referenced this pull request Aug 14, 2026
…finally CI-covered (#422) (#2292)

Two defects, one root: deploy-verify only ever looked at the CORE, and the pure
logic that decides its verdict was tested where CI does not look.

## It was half-blind

`reboot` sets CONTINUUM_SKIP_SELF_BUILD and so never rebuilds the `continuum`
CLI. That is deliberate — a running image cannot be replaced on Windows, and
letting the start script build it failed the whole cargo invocation and skipped
the CORE build (772s to that failure on BIGMAMA). The consequence was never
written down: a fix that lives in the CLI cannot reach an operator through the
documented deploy path, and deploy-verify printed its green checkmark anyway.

Measured 2026-08-14, same machine, minutes apart: the installed CLI's `stop`
reaped only the pidfile core and left pid 6453 alive and silent; the
freshly-built CLI's `stop` then printed SPLIT BRAIN and reaped it. #2287 had
merged and had NOT reached the installed CLI — while deploy-verify reported
"✅ core is running build 1de9ceb". Every lifecycle fix shipped this week
(#2287 stop-reaps-all, #2288 config.env, #2291 start reclaim-or-refuse) lives in
the CLI; none was provably running. That is #194 one tier up.

`cli_staleness_note` now rides alongside the core verdict on BOTH outcomes.
It WARNS rather than failing: the core verdict is about whether the swap took,
CLI staleness is a separate fact, and making it fatal would break deploy-verify
for every operator whose CLI predates their core — today, all of them. Silence
when it matches, so the note means something when it fires. Unjudgeable
provenance (built outside a git tree) is stated, not swallowed, and never
claims staleness it cannot prove.

## And its tests were unreachable

`deploy_verdict` and `sha_matches` were pure and unit-tested — inside
`bin/continuum.rs`. CI runs `cargo test -p continuum-core --lib`, which does not
compile bin test mods, so the #194 guard was protected by tests nothing ran.
Exactly the trap #2291 documented for the bind guard, sitting one function away
the whole time.

Moved to `runtime/deploy_provenance.rs` with their tests, plus new coverage for
the CLI note and for sha_matches rejecting junk in both directions. The bin keeps
everything impure (ping, git rev-parse, artifact resolution, process
description) and delegates the verdicts. 4 tests, all under the --lib gate.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Aug 14, 2026
…able (#422) (#2293)

`continuum reboot` sets CONTINUUM_SKIP_SELF_BUILD=1 unconditionally, so
start-server.sh skips the CLI build on every platform. That guard exists for
exactly ONE constraint, stated in its own comment: Windows LOCKS a running
image, so `cargo build --bin continuum` from inside the running `continuum`
fails with `failed to remove file ...\continuum.exe`, cargo returns non-zero for
the WHOLE invocation, every later build is skipped — the CORE included — and
reboot dies after its full timeout having rebuilt nothing (772s on BIGMAMA,
2026-08-05). Real, and worth guarding.

The same comment also records that on Unix it "silently works: unlink leaves the
running inode" — and the guard was applied there anyway. That is the whole of
#422: a Windows accommodation charged to every operator, making the documented
deploy path (`edit → reboot → exercise`) structurally unable to ship a fix
living in the CLI. Proven on this Mac 2026-08-14: `stop`'s split-brain reap
(#2287) had merged and had NOT reached the installed CLI, leaving a core alive
and silent — while deploy-verify printed its green checkmark, because it only
looked at the core.

Nothing else was missing. start-server.sh already installs the built CLI into
~/.local/bin with a temp+mv atomic swap, and does it OUTSIDE the guard — so on a
Rebuild platform the loop closes with no new verb and no new swap machinery.
The running image is normally the ~/.local/bin COPY, not the target-dir binary
cargo replaces, so the Unix inode behaviour is a second line of defence rather
than the first.

deploy_provenance::cli_self_build(target_os) now owns the decision and names the
one platform it is for. It takes the OS as a parameter rather than reading
cfg!, so BOTH rows are unit-tested from any host — the Windows row is the one no
Mac CI job would otherwise cover. On Skip the CLI states out loud that a
CLI-side fix is NOT deployed; a silent skip that reads as a completed deploy is
how the stale CLI survived a green deploy-verify in the first place.

SECOND DEFECT, found while validating this and fixed here because enabling the
build walks straight into it: the CLI's GPU-free flag was a bare
`--no-default-features`, which on macOS ALWAYS fails — `metal` is not a default
feature and `llama` is an unconditional path dependency, so the llama crate's
`compile_error!("built on macOS WITHOUT --features metal")` fires. The GPU-free
CLI build has therefore never once succeeded on a Mac; every `npm start` since
it landed hit the loud "⚠ GPU-free continuum build failed … Please report this"
fallback and shipped a GPU-linked CLI while reporting an anomaly nobody
reported. CONTINUUM_CLI_FEATURES is now platform-shaped like the core's set
already was, using `llama/mac-cpu-only` — that guard's OWN declared opt-in for a
deliberately CPU-only build, which is exactly what a socket client wants.
Verified: `cargo check --bin continuum --no-default-features --features
llama/mac-cpu-only` compiles clean in 1m45s.

Also repointed the swept-cache CLI restore (#296 path) from CONTINUUM_FEATURES
to CONTINUUM_CLI_FEATURES — it was rebuilding the CLI WITH GPU deps, re-creating
the exact Windows-unlaunchable bug (0-byte exit 127 on a CUDA-version mismatch)
that the GPU-free build exists to prevent.

Tests: 5/5 in runtime::deploy_provenance, under the `cargo test --lib` gate CI
actually runs.


Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Aug 19, 2026
…stale core that steals the socket mid-build

MEASURED 2026-08-17. `continuum reboot` shipped 6229b37 and deploy-verify reported the
core running a87f7c8. The installed image on disk was confirmed to contain the NEW sha, so
the build and the install were both correct. The core that answered simply was not the one
the deploy launched.

The mechanism is not subtle:

  1. `reboot` stops the old core and runs start-server.sh, which BUILDS (292s and 530s
     measured here; 772s on BIGMAMA per #422) and only near the END copies the fresh
     artifact over ~/.continuum/bin/continuum-core-server.
  2. For that whole multi-minute window, no core answers the socket AND the installed path
     still holds the PREVIOUS build.
  3. Every `continuum <verb>` calls `ensure_core_running`, whose entire job is to autostart
     when nothing answers. In that window it launches the STALE image.
  4. That stale core binds the socket and answers. The freshly-built binary loses, and
     deploy-verify correctly reports the old sha.

Any client can do this — a UI poll, `npm start`, a cron, a persona, or an operator typing
`continuum ping` to see whether the reboot finished. In the observed incident the trigger
was my own 120-second monitor calling `persona/roster`.

That also settles the open question on #421, which has sat un-run for days: "something
respawns a core within seconds of every kill — external supervisor, or me?" It was the
CLI's own autostart. There is no mystery daemon. #421 can close on this.

WHY THE EXISTING GUARD COULD NOT SEE IT. `core_bind_guard::decide` is a function of (ping
answered, core pids running). Mid-build BOTH are false, and the honest reading of that state
really is "no core is running, and starting one is safe" — true in general, wrong during a
deploy. "A deploy is in flight" is a fact that lives in another process, so this is not a
stricter bind guard; it is the missing observation, published by the only party that knows
it.

THE FIX. `runtime::deploy_claim` — reboot publishes {pid, started_ms, target_sha} for the
length of its build+swap; implicit autostart and the launch arm of explicit `start` consult
it and refuse with a message that names the deploying pid, the build it is shipping, and how
long it has been going. `--force` overrides, consistent with the Occupied arm beside it.
The claim is RAII: released on Ok, Err, `?`, and panic-unwind, because a claim that leaked
past its deploy would block autostarts until its owner died.

AND THE FAILURE MODE IT MUST NOT BECOME. A claim that outlives its owner would wedge the
machine — exactly airc's "start GIVES UP on a contended lock" defect (#355). So the claim is
advisory and self-healing: it blocks only while its owner is demonstrably alive AND younger
than a 1-hour cap (far above any measured build, still bounded). A killed reboot, a hung
build, and a recycled pid all decay back to Clear on their own, and the decision returns
`Abandoned{why}` so the caller SWEEPS AND SAYS SO rather than silently obeying a dead file.
Writing the claim is best-effort for the same reason: an unwritable advisory file must not
turn a hint into an outage.

The decision is pure — `decide(claim, owner_alive, now_ms)` — so the `--lib` CI gate covers
every row without a filesystem or a process, the same split as `core_bind_guard` and for the
same reason. Four rows, each a real case: a live deploy blocks for the whole build; a dead
owner and an expired claim both decay to launchable; a future-stamped claim (clock skew)
reads as new rather than underflowing to "ancient", which would have silently disabled the
guard on any box with a skewed clock; and the on-disk round-trip covers idempotent clear and
a corrupt file degrading to absent. 8/8 green with core_bind_guard.

NOT YET POSITIVE-CONTROLLED END-TO-END, and stated plainly rather than implied: an isolated
control is not reachable while a real core runs, because `running_core_pids()` is global
(pgrep) and returns Occupied before the gate. The honest control is the incident itself — a
`continuum` verb firing mid-build must now print the refusal instead of autostarting. The
monitor that caused the incident still runs every 120s, so the next reboot exercises it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 19, 2026
…ext was false

`reboot` rebuilds AND reinstalls the CLI (#422 / PR #2293). But the invocation doing the
reinstall is by construction the one it REPLACES — a running image cannot be the artifact it
just installed. So `cli_staleness_note`, which compares the RUNNING `continuum` against git
HEAD, diverged on every healthy deploy and printed ⚠ STALE CLI. Observed three times in a
row today on deploys that were otherwise perfect, including one whose core verdict was a
clean ✅.

Its text then said: "`reboot` rebuilds the CORE and never the CLI." That has been false since
#2293 — verified on this box today, where the installed CLI advanced a87f7c8 → 6229b37 →
5d62bf3 across three reboots, each time by reboot's own install step.

A warning that fires on every success is not a warning. It is noise that trains the operator
to skip the exact line where a REAL stale CLI would appear — the same class of defect as
#422's own "⚠ …Please report this" that nobody reported, and as airc's `doctor --fix`
reporting ok while delivery was 100% down (#348).

Fix: `cli_staleness_note` takes `rebuilt_this_run`, so the two situations stop sharing a
message.
  • self-replacing run (reboot on a machine where `cli_self_build` says Rebuild) → "↻ CLI
    updated: this invocation is build X, the NEXT one runs Y." Information, not a fault,
    and it still says the useful part out loud: CLI-side behaviour in THIS run is the old
    build, so re-run a lifecycle verb whose fix lives in the CLI.
  • nothing replaced it (a bare `deploy-verify`, or a platform where the self-build skips)
    → the ⚠, with the false "never rebuilds the CLI" sentence replaced by what is actually
    true: reboot does rebuild it, except where cli_self_build skips the platform.

`reboot` computes the flag from the two terms that actually decide it — a start script exists
(the same condition `plan_launch` uses to choose Script for a FromSource launch) AND
`cli_self_build(OS) == Rebuild`. Both matter: an installed node with no checkout rebuilt
nothing, and Windows deliberately skips. Getting either wrong re-creates the noise or, worse,
hides a genuinely stale CLI behind a reassuring handoff line.

Test pins both readings apart, and that a MATCHING CLI stays silent in both modes so the flag
cannot invent a note. It also asserts the corrected wording no longer contains "never" —
the specific false claim. 6/6 green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 19, 2026
…ad identically to a healthy one

Measured today at lanes=1: a 10-minute window showed zero `persona.selftick.*` rows. That is
ambiguous, and dangerously so. It reads the same whether ONE citizen is mid-turn holding the
only lane (healthy, just serialized) or the roster is dead. Resolving it required a manual
`curl /slots`, which showed slot 0 processing with 3,727 tokens decoded — fine all along.

The cause is structural: the yield branch emits nothing. That was the right call for volume
— at 24 citizens on a 15s beat, a row per yield is ~92/min and would drown the stream exactly
as `serving.plan` did at 2.6 rows/s (#399) — but the absence of a signal is not the same as
a signal of absence ([[an-absence-is-an-unfinished-measurement]], the error class that
produced the retracted premises on #211 and #390).

Fix: count every yield (one relaxed increment on the permit miss, where the yield actually
happens), and emit at most ONE probe per minute for the whole process carrying the delta.
`persona.selftick.starved` names it as contention, not a fault — because at lanes=1 with 24
citizens it IS the expected shape, and a probe that cries fault at normal operation is the
#348 / #422 defect again.

Rate-limit rule is pure and table-tested. Four rows, each a real failure mode: the FIRST
starvation always reports (a naive `now - last >= gap` swallows it on a box whose clock
starts near zero — and the first one is the one that matters); a second report inside the
gap is silent (the firehose); after the gap it reports the WINDOW delta, not the cumulative
total (a cumulative count cannot show a rate); and a quiet roster emits nothing at all.
Concurrent yielders race a compare-exchange so only one reports per window.

9/9 admission + 41/41 service_loop green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 19, 2026
…t, and the axis is DETERMINISM

Two corrections to the plan of record I committed hours ago, both found by reading the code
instead of my own summary of it.

1. SEAM 2 IS RETRACTED. I claimed no lease-expiry mechanism existed and that #451 "does not
   fire in practice despite being marked complete." It is complete and correct, and it lives
   in `modules/benchmark_grade.rs` — the file I had open when I wrote that. I grepped
   `modules/work.rs` for MY concept (an event) instead of for the JOB's name, found nothing,
   and reported an absence. `sweep_lapsed_bench_cards` is thorough: a pure `sweep_ready`
   truth table, artifact presence per bench kind, room-SCOPED close, provenance note,
   per-tick cap, error probe on refusal, live claims never preempted.
   [[read-the-code-you-intend-to-replace-before-designing-its-replacement]]

   And the 13 ungraded artifacts are not its business: MEASURED, all 13 carry
   `card: None, owner: None` — detached agent/solve artifacts with no board card at all
   (#425). The sweep operates on cards, so not seeing them is correct.

2. THE ⚠ BLOCK WAS SCOPED TOO BROADLY. I wrote "do not add a periodic sweep" as a flat
   taboo. The same module already ticks at 180s and its comment draws the real line:
   "actuators may tick; condition-polls may not." A tick that ACTUATES a time fact the wire
   cannot carry is permitted; ticking to ask "has anything become gradeable" is not. My rule
   would have blocked a correct build — a guard scoped too broadly, the same shape as #422.

JOEL'S FRAMING, which is better than either and now leads the section: "if it's
deterministic and not scan it or polling it's reliable." That explains WHY rather than
restating the taboo. A scan's answer depends on when it ran, what was on disk, how results
sorted, whether a cap truncated — all real here (the board lost 12 of 13 artifacts to a
recency sort against a 200-tree cap). A deterministic actuator answers the same way every
time regardless of timing. So the test is not "does it have a timer" but "given the same
state, same outcome?"

With the corollary today taught the hard way: determinism over the WRONG THING is worthless.
The reaper fixed in f3cb3a6 was perfectly deterministic over a filename no writer had ever
produced — it answered "nothing here" every single time. Reliable and blind are not the same
property.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 20, 2026
…cer wired INTO the settle driver (#319) (#2337)

* fix(cognition): wire the LIVED-TURN producer — her own conversations become curriculum, not just graded cards (#319)

`ExperienceRecord::from_lived_turn` had ZERO production callers tree-wide. The only live
producer was `from_kanban_grade` (benchmark.rs:1989), so the experience stream — "the SPINE
the salience→curriculum seam was missing", in `experience_stream_path`'s own words — was fed
EXCLUSIVELY BY GRADES. A citizen could hold a thousand real conversations and her stream
stayed empty. Nothing could learn from work nobody had scored.

Everything needed already existed and was correct: the record shape, the two magic-number-free
lived-salience signals (infra fault, non-convergence), `ErrorSalience` reading them with no new
detector, and a doc block naming "the lived-turn settle site" as a producer. The CALL was
missing. Same shape as #341 (boot called the unbounded sink; the rotating one had zero callers)
and #362 (ProbeRouterLayer installed with its handle discarded) — a built component with a dead
wire, which is why [[an-absence-is-an-unfinished-measurement]] keeps earning its place.

WIRED at `service_loop.rs`'s live settle site, BEFORE `SettleStep::from_settled` consumes the
outcome — the only point where a lived turn's settle verdict exists. The driver stays a driver
per PERSONA-COGNITION-PIPELINE §3: one call, no policy. The behaviour lives in
`experience::record_lived_turn` so it is unit-testable without booting a loop.

BEST-EFFORT, and that is NOT a fallback ([[no-fallbacks-ever]] holds): nothing is substituted
and no result is fabricated. Learning is a SIDE channel to being — a full disk must not make a
citizen mute mid-sentence. The failure is WARNED with the path and the honest consequence
("this episode will not become curriculum").

COMPRESSION, because the new writer would otherwise have been the FIFTH hand-rolled spelling of
the citizen storage layout. `citizens/peers/<uuid>` was written as `join("citizens/peers")` in
modules/work.rs, `join("citizens").join("peers")` in commands/benchmark.rs, and in prose in
persona_workspace.rs + persona_roster.rs. Now ONE resolver, `identity::citizen_peer_dir(root,
peer)`, in the module whose own doc says "the whole crate imports identity from ONE home" and
warns against exactly this re-invention. Keyed by `PeerId`, never a String — the directory name
IS her identity. Pure path arithmetic, so a read-only caller never mints an empty citizen dir,
which its test pins.

Tests: 11/11 cognition::experience (the lived-turn test now asserts the PRODUCER — empty stream
→ record lands at the canonical path → a second turn appends rather than overwrites, i.e. the
wire, not just the record's shape) + identity's one-spelling test. `cargo check -p
continuum-core --features metal,accelerate` clean.

LIVE PROOF OWED and NOT claimed: no live turn has run on this build. The falsifiable prediction
is that a citizen's `citizens/peers/<her>/experience.jsonl` gains a `LivedTurn` record on her
next real room turn, where today it holds only kanban grades or nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cognition): the lived-turn producer belongs in the settle DRIVER, not at one call site (#319)

MEASURED, and it retracts my own claim from 200dab984. I wrote that the #319 producer
was wired and that a LivedTurn record was owed on the next real turn. The wire was
wrong, so the record could never come: 180 experience records across 5 citizens on this
box, 100% `source: "Eval"`, ZERO `LivedTurn` — while the same core showed 47
persona.upstart.bind, 97 presence rows and 4 delib.context.render, i.e. citizens alive
and deliberating.

ROOT CAUSE. `record_lived_turn` was called from ONE of the THREE `drive_to_settle`
sites in service_loop — the directed-message path (:1087). The self-tick path (:2628)
and the held-work path (:1207) settle turns through the same driver and recorded
nothing. Three callers, one remembering: a missing constraint expressed as three
sites, not a bug at one ([[the-same-bug-at-two-sites-is-a-missing-constraint]]).

FIX. The record moves INTO `drive_to_settle`, which is the one place a `SettleOutcome`
is born. `drive_to_settle` is now a thin wrapper over a private `settle_to_outcome`, so
the write happens ONCE around the driver rather than at its four return paths — a fifth
return path added later inherits learning instead of silently opting out, and no call
site carries learning policy. Gated on `WorkspaceCycle::acting()`, because that is
where a citizen's identity lives: a cycle with no `ActingBody` is pure cognition (a
faculty test, a replay) and is nobody's lived experience. Structural absence, not a
skipped write.

SECOND FIX, applying Joel's rule that a required thing should not be re-expressible:
dropped the `stimulus: &str` parameter. It was a second, independent expression of
"what she was responding to", free to disagree with what the turn actually perceived —
and it already did, since the old call site passed only `msg.text` while the mind had
settled over the whole rendered burst. The stimulus is now read off
`SettleOutcome.world_state` (set on every return path), so the disagreement is
unrepresentable rather than merely discouraged. The test asserts
`task.prompt == settled.world_state` instead of a literal.

GUARD, positive-controlled (not merely green): a source-walking test asserts
`record_lived_turn` has EXACTLY ONE production caller and that it is settle.rs.
Verified failing — injected a second call into service_loop and it reported
`found 2: [settle.rs, service_loop.rs]` with the remediation in the message. Reverted.
Comment-stripped so prose naming the function cannot read as a call (registry.rs's
module-wiring audit is the house precedent).

cargo check clean; cognition::experience 12/12, cognition::act_observe 38/38.

LIVE PROOF STILL OWED and NOT claimed: no turn has run on this build yet. Baseline for
falsifiability is recorded above — 180 records, 100% Eval, 0 LivedTurn. The prediction
is that a hosted citizen's `citizens/peers/<her>/experience.jsonl` gains a LivedTurn
record on her next settled turn from ANY of the three paths, where today it holds only
kanban grades.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(persona): a YIELD is not a REST — kill the starvation ratchet that pinned the whole roster at the 240s cap

Measured live 2026-08-17, 24 hosted citizens: ONE self-tick across the entire roster in
40 minutes, on a serving lane that was healthy and decoding at ~17 tok/s the whole time.
The lane was never the problem. The cadence rule was.

The self-tick gates on a single ambient-turn permit (AMBIENT_TURN_CONCURRENCY = 1). When a
peer holds it, the citizen yields — she never ran, never looked at the room, learned
nothing. The yield branch nonetheless charged her the SAME 1.5×-toward-the-cap backoff as
a citizen who ran a full cycle and found nothing new.

With 24 citizens, ~23 yield on every beat. Eight yields carries 15s past the 240s rest cap
— a 16× slowdown — and she STAYS there, because the only two things that reset the beat
are a successful cycle (which the backoff itself now denies her) and an inbound message.
Transient contention compounds into permanent slowness, and it gets strictly worse as the
roster grows. That is a ratchet, not a rest.

Fix: a yield leaves the beat exactly where it was. The earned backoff after a real,
fruitless cycle is untouched — that one is honest.

Extracted the rule into a pure `next_beat_after(BeatOutcome, ..)` (the
`core_bind_guard::decide` shape) because the three outcomes — Engaged / NothingNew /
YieldedNoSlot — are trivially confusable inline, and confusing two of them cost the roster
16×. Both call sites now derive from the one function; there is no second expression of
the cadence.

Regression test pins the invariant in both directions: 50 yields must not cost a single
millisecond; a fruitless cycle must still back off and must saturate at the cap.
Positive-controlled — restoring the old compounding fails the assertion by name.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cognition): the ambient-turn pool was a hardcoded 1 — derive it from the live lane budget, like its own doc always claimed

The self-tick gate in service_loop.rs has documented this permit as "sized to the LIVE
served lane count (LaneAdmission ← set_served_lane_count)" for as long as it has existed.
It never was. It was `const AMBIENT_TURN_CONCURRENCY: usize = 1`, and that constant was the
roster's starvation ceiling: on this box, 4 served lanes and 24 hosted citizens, so 3
non-directed lanes sat permanently idle while 23 citizens yielded every beat against a pool
of one.

Two things kept it invisible. The comment described the intended design, so reading the
call site told you the opposite of the truth. And a hard 1 is indistinguishable from a
quiet room at n≈1 citizen — which is exactly how it was reasoned about ("under light load
ambient turns are naturally serial, so this never throttles a quiet room"). It doesn't
throttle a quiet room. It throttles a POPULATED one, and the roster only grew.

Fix: the pool is `nondirected_budget()` — the same live (lanes − 1, floored at 1) budget
the per-call lane reservation already uses. One machine, one answer to "how much
non-directed concurrency is there", derived from live capacity instead of declared twice
and then contradicted.

Why loosening this bound is safe: the directed-turn guarantee never came from this permit.
It comes from `acquire_serving_lane`, which caps non-directed CALLS at lanes−1 so a
directed call always finds a lane — untouched here, and it is the layer that actually owns
lane priority. This permit's job (#171) is anti-STAMPEDE: bound the fan-out when N peers
wake on one beat and all read inflight=0. A bound of lanes−1 does that job exactly as well
as a bound of 1 — still fixed, still non-blocking, still held across the turn — while no
longer throttling below the hardware.

Also wired the pool into `set_served_lane_count` alongside its two siblings. It is lazy for
the same load-bearing reason they are (capture the real count at first use, never the boot
ceiling), which makes "first use beat serving's first publish" a live possibility — and
without the grow wiring the whole roster would stay pinned at the boot budget for the life
of the process. That has its own regression test.

Tests: the existing ambient test now pins a real 4-lane machine and asserts against the
derived budget — a PREMISE CHANGE, stated as such, because at a hardcoded 1 it could not
tell "correctly bounded" from "throttled below the hardware". Two new rows cover the halves
that could silently hurt: a 1- and 2-lane box still admits exactly one ambient turn
(byte-identical to before on the weakest supported hardware), and a cold-boot pool grows
when serving publishes its real width. 8/8 green.

Corrected two stale comments while here: `resource_admission.rs` claimed "an idle self-tick
is not ambient-permit-gated at all", contradicted by the self-tick gate's own comment block
in the same tree; and the service_loop references to the now-deleted constant.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(runtime): a deploy in flight must block implicit autostart — the stale core that steals the socket mid-build

MEASURED 2026-08-17. `continuum reboot` shipped 6229b3762 and deploy-verify reported the
core running a87f7c871. The installed image on disk was confirmed to contain the NEW sha, so
the build and the install were both correct. The core that answered simply was not the one
the deploy launched.

The mechanism is not subtle:

  1. `reboot` stops the old core and runs start-server.sh, which BUILDS (292s and 530s
     measured here; 772s on BIGMAMA per #422) and only near the END copies the fresh
     artifact over ~/.continuum/bin/continuum-core-server.
  2. For that whole multi-minute window, no core answers the socket AND the installed path
     still holds the PREVIOUS build.
  3. Every `continuum <verb>` calls `ensure_core_running`, whose entire job is to autostart
     when nothing answers. In that window it launches the STALE image.
  4. That stale core binds the socket and answers. The freshly-built binary loses, and
     deploy-verify correctly reports the old sha.

Any client can do this — a UI poll, `npm start`, a cron, a persona, or an operator typing
`continuum ping` to see whether the reboot finished. In the observed incident the trigger
was my own 120-second monitor calling `persona/roster`.

That also settles the open question on #421, which has sat un-run for days: "something
respawns a core within seconds of every kill — external supervisor, or me?" It was the
CLI's own autostart. There is no mystery daemon. #421 can close on this.

WHY THE EXISTING GUARD COULD NOT SEE IT. `core_bind_guard::decide` is a function of (ping
answered, core pids running). Mid-build BOTH are false, and the honest reading of that state
really is "no core is running, and starting one is safe" — true in general, wrong during a
deploy. "A deploy is in flight" is a fact that lives in another process, so this is not a
stricter bind guard; it is the missing observation, published by the only party that knows
it.

THE FIX. `runtime::deploy_claim` — reboot publishes {pid, started_ms, target_sha} for the
length of its build+swap; implicit autostart and the launch arm of explicit `start` consult
it and refuse with a message that names the deploying pid, the build it is shipping, and how
long it has been going. `--force` overrides, consistent with the Occupied arm beside it.
The claim is RAII: released on Ok, Err, `?`, and panic-unwind, because a claim that leaked
past its deploy would block autostarts until its owner died.

AND THE FAILURE MODE IT MUST NOT BECOME. A claim that outlives its owner would wedge the
machine — exactly airc's "start GIVES UP on a contended lock" defect (#355). So the claim is
advisory and self-healing: it blocks only while its owner is demonstrably alive AND younger
than a 1-hour cap (far above any measured build, still bounded). A killed reboot, a hung
build, and a recycled pid all decay back to Clear on their own, and the decision returns
`Abandoned{why}` so the caller SWEEPS AND SAYS SO rather than silently obeying a dead file.
Writing the claim is best-effort for the same reason: an unwritable advisory file must not
turn a hint into an outage.

The decision is pure — `decide(claim, owner_alive, now_ms)` — so the `--lib` CI gate covers
every row without a filesystem or a process, the same split as `core_bind_guard` and for the
same reason. Four rows, each a real case: a live deploy blocks for the whole build; a dead
owner and an expired claim both decay to launchable; a future-stamped claim (clock skew)
reads as new rather than underflowing to "ancient", which would have silently disabled the
guard on any box with a skewed clock; and the on-disk round-trip covers idempotent clear and
a corrupt file degrading to absent. 8/8 green with core_bind_guard.

NOT YET POSITIVE-CONTROLLED END-TO-END, and stated plainly rather than implied: an isolated
control is not reachable while a real core runs, because `running_core_pids()` is global
(pgrep) and returns Occupied before the gate. The honest control is the incident itself — a
`continuum` verb firing mid-build must now print the refusal instead of autostarting. The
monitor that caused the incident still runs every 120s, so the next reboot exercises it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(deploy): ⚠ STALE CLI fired on every SUCCESSFUL reboot — and its text was false

`reboot` rebuilds AND reinstalls the CLI (#422 / PR #2293). But the invocation doing the
reinstall is by construction the one it REPLACES — a running image cannot be the artifact it
just installed. So `cli_staleness_note`, which compares the RUNNING `continuum` against git
HEAD, diverged on every healthy deploy and printed ⚠ STALE CLI. Observed three times in a
row today on deploys that were otherwise perfect, including one whose core verdict was a
clean ✅.

Its text then said: "`reboot` rebuilds the CORE and never the CLI." That has been false since
#2293 — verified on this box today, where the installed CLI advanced a87f7c871 → 6229b3762 →
5d62bf30b across three reboots, each time by reboot's own install step.

A warning that fires on every success is not a warning. It is noise that trains the operator
to skip the exact line where a REAL stale CLI would appear — the same class of defect as
#422's own "⚠ …Please report this" that nobody reported, and as airc's `doctor --fix`
reporting ok while delivery was 100% down (#348).

Fix: `cli_staleness_note` takes `rebuilt_this_run`, so the two situations stop sharing a
message.
  • self-replacing run (reboot on a machine where `cli_self_build` says Rebuild) → "↻ CLI
    updated: this invocation is build X, the NEXT one runs Y." Information, not a fault,
    and it still says the useful part out loud: CLI-side behaviour in THIS run is the old
    build, so re-run a lifecycle verb whose fix lives in the CLI.
  • nothing replaced it (a bare `deploy-verify`, or a platform where the self-build skips)
    → the ⚠, with the false "never rebuilds the CLI" sentence replaced by what is actually
    true: reboot does rebuild it, except where cli_self_build skips the platform.

`reboot` computes the flag from the two terms that actually decide it — a start script exists
(the same condition `plan_launch` uses to choose Script for a FromSource launch) AND
`cli_self_build(OS) == Rebuild`. Both matter: an installed node with no checkout rebuilt
nothing, and Windows deliberately skips. Getting either wrong re-creates the noise or, worse,
hides a genuinely stale CLI behind a reassuring handoff line.

Test pins both readings apart, and that a MATCHING CLI stays silent in both modes so the flag
cannot invent a note. It also asserts the corrected wording no longer contains "never" —
the specific false claim. 6/6 green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* docs(observations): dated post-run card — the two starvation defects, the two install defects, and what is NOT yet measured

Standing instruction (Joel, 2026-08-17): a new well-labeled dated observation file after
every run, and stop reading the old ones. Written from this session's probes and deploy
receipts only; no prior cards consulted.

Records the honest state including the gaps: the ambient-pool fix has had no uninterrupted
window yet (three reboots for the install fixes), and the deploy claim is unit-green but not
positive-controlled end-to-end.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* docs(observations): CORRECTION — the 27B is already the persona model, and the ambient-pool fix is inert at lanes=1

Re-measured instead of trusting my 18:07 snapshot. active_model IS Qwen3.8-27B on the
persona lane; #440's bring-up landed. And nondirected_budget() = lanes-1 floored at 1, so
at lanes=1 the new pool equals the old hardcoded constant — the fix is correct but buys
nothing in this configuration.

The remaining ceiling is the LANE count, and serving.plan says why: a 27B at a 16,384
per-slot floor fits one warm slot (resident_personas=4, warm_slots=1, without_warm_slot=3).
That is an allocation policy question, not a bug.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(cognition): make the ambient YIELD visible — a starved roster read identically to a healthy one

Measured today at lanes=1: a 10-minute window showed zero `persona.selftick.*` rows. That is
ambiguous, and dangerously so. It reads the same whether ONE citizen is mid-turn holding the
only lane (healthy, just serialized) or the roster is dead. Resolving it required a manual
`curl /slots`, which showed slot 0 processing with 3,727 tokens decoded — fine all along.

The cause is structural: the yield branch emits nothing. That was the right call for volume
— at 24 citizens on a 15s beat, a row per yield is ~92/min and would drown the stream exactly
as `serving.plan` did at 2.6 rows/s (#399) — but the absence of a signal is not the same as
a signal of absence ([[an-absence-is-an-unfinished-measurement]], the error class that
produced the retracted premises on #211 and #390).

Fix: count every yield (one relaxed increment on the permit miss, where the yield actually
happens), and emit at most ONE probe per minute for the whole process carrying the delta.
`persona.selftick.starved` names it as contention, not a fault — because at lanes=1 with 24
citizens it IS the expected shape, and a probe that cries fault at normal operation is the
#348 / #422 defect again.

Rate-limit rule is pure and table-tested. Four rows, each a real failure mode: the FIRST
starvation always reports (a naive `now - last >= gap` swallows it on a box whose clock
starts near zero — and the first one is the one that matters); a second report inside the
gap is silent (the firehose); after the gap it reports the WINDOW delta, not the cumulative
total (a cumulative count cannot show a rate); and a quiet roster emits nothing at all.
Concurrent yielders race a compare-exchange so only one reports per window.

9/9 admission + 41/41 service_loop green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(cognition): my own starvation probe reported CUMULATIVE under a field named per-window

Caught within the hour of shipping it, by reading the live rows instead of trusting the
commit message:

  19:44:02Z  yields_this_window=135  cumulative=135
  19:45:03Z  yields_this_window=197  cumulative=197
  19:46:03Z  yields_this_window=263  cumulative=263

Identical on every row, while consecutive rows differ by ~65. The field named
`yields_since_last_report` was reporting the running total.

Cause: `take_ambient_yield_report` passed a literal 0 for `yields_at_last_report`, with a
comment justifying it — "the report resets the clock, so total-at-report is implicit."
That is false. Resetting the TIMESTAMP does not reset the COUNT, so `fresh = total - 0 =
total` forever.

The galling part, and worth stating plainly: the pure rule was RIGHT and its table test
asserted the delta correctly (`ambient_yield_report_due(1_000, 23, 70_000, 9_000) ==
Some(977)`). The defect lived entirely in the impure wrapper feeding it a wrong argument —
which is exactly the seam the pure/impure split exists to protect and exactly the gap a
table test over the pure half cannot close. I wrote a commit an hour earlier about fields
that promise one thing and deliver another, then shipped one.

Fix: a second watermark, `AMBIENT_YIELDS_AT_LAST_REPORT`, advanced by the same winner of
the timestamp compare-exchange so a losing yielder's counts roll into the NEXT window
rather than being dropped. New test pins the argument boundary the old one couldn't reach:
the second window must read 62 (197−135), not 197.

The mislabel did NOT cost the measurement — consecutive cumulative rows still give the rate
by subtraction, and that rate is the finding: ~65 ambient yields per minute across 24
citizens with ZERO self-cycles completing. First time that contention has had a number
instead of a silence.

10/10 green.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(persona): the work board grew into the prompt — cap the per-card render, order by relevance

READ OUT OF A LIVE AMBIENT TURN (capture 762a806b, 2026-08-17), not inferred:

  system prompt   18,697 chars
    [board]        9,284 chars  49.7%   ← 38 distinct cards, full titles
    (preamble)     7,863 chars  42.1%
    workspace-map  1,478 chars   7.9%
  observed prefill 12,286 tokens for a turn that decoded 41

Half of every citizen's system prompt was the kanban board, re-sent on every self-tick, and
it was ~25% of total prefill. The per-card loop was `for card in &board.cards` bounded only
by remaining budget.

Two things make that a defect rather than a cost:

1. IT IS REDUNDANT. The `[board]` headline and the `[your work]` / `[available work]` leads
   directly above already carry the counts and the top titles — and those leads were ADDED
   precisely because this dump is unreliable under budget (the Asha 2026-08-06 note in this
   file). So the same facts are paid for twice and the expensive copy is the one truncated.
2. IT SCALES BACKWARDS. Bounded by budget, the board grows to fill the prompt, so every
   citizen thinks SLOWER as the backlog grows. A team that accumulates work becomes
   progressively less able to do it. That is the opposite of what a work board is for, and
   it gets worse every time we file a card.

FIX: order by what she can act on — her own holds first, then newest claimable (the same
recency argument the available-work lead already makes) — and take at most
MAX_RENDERED_CARDS. Counts in the headline stay the TRUE totals; the board is not made
smaller than it is, only shorter than it was. `work/list` remains the full read and is
verified working (#337).

The cap is sized from what it MUST cover, not picked: both leads name up to 5, so the detail
must carry 10 or the summary would promise cards the detail omits — a citizen seeing "you
hold 5" above a list of 3 would rightly read the substrate as inconsistent. Two spare keeps a
just-created card visible in the turn it arrives. Ten is the floor; it cannot drop below
without re-deriving the lead caps with it.

Also fixed: cap-truncation now counts into `dropped` alongside budget-truncation, so the
debug line does not report dropped=0 on a shortened board and hide the shortening in the one
place an operator looks.

Test pins all three halves — the cap holds, her OWN card survives the cut even when it is
the OLDEST on the board (under the old board-order loop a cap would have cut exactly the
worst card), and the headline still reports the true 40. Positive-controlled: with the cap
removed it fails "board must be capped at 12, rendered 41 of 41". 13/13 green.

NOT YET MEASURED LIVE: the prompt-size delta. Deploying next; the number goes on the
observation card, not in this message.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): one era-pinned install path, so the sdist build-deps heal like -e . already did (#380/#383)

`ensure_env` had TWO sites that install under the instance's date pin, and only ONE of
them could heal when the pin itself created an unresolvable hole:

  - the editable `-e .` install carried a bounded retry loop that reads uv's own
    `exclude-newer-package` hint and retries with the minimum per-package override;
  - the dependency-sdist build-dep pre-install (#383 cause 2) applied `--exclude-newer`
    and failed hard.

Same decision, two expressions, one of them healed. Measured 2026-08-17 dispatching
swe-bench-lite's head: every astropy instance died at the unhealed site with

    could not pre-install astropy__astropy-6938's dependency-sdist build deps ["jinja2"]
    × Failed to download and build `markupsafe==1.0`
    ╰─▶ Because only setuptools<=38.2.4 is available and you require setuptools>=40.8.0

which is the pin working exactly as designed — jinja2 2.10 pulls markupsafe 1.0, whose
setup.py build wants setuptools>=40.8.0, and the 2017 cutoff caps setuptools at 38.2.4.
Unsatisfiable by construction. uv's stderr named the package and suggested
`exclude-newer-package`; the loop 30 lines below knew how to parse exactly that hint and
never saw it.

Extracted `era_pinned_uv_install(uv, py, as_of, tail, cwd, envs)` holding the whole
bounded loop, all three heal arms, and the importlib-metadata upgrade remedy (general to
any --no-build-isolation build, not just `-e .`). Both sites now call it; a third site
inherits the behaviour by construction rather than by remembering. MAX_ERA_OVERRIDES
replaces the bare 8.

No behaviour change at the `-e .` site — same flags, same arms, same bound. The change is
that the other site now has them.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(rag): roster + doctrine read the room she is STANDING in, not the one she was bound to (#443)

The board source was made turn-parametric weeks ago. Roster and doctrine were not, so a
citizen taking a turn in a per-run bench room got the cards and NEITHER the peers nor the
rules. Measured live 2026-08-17 over 90 minutes on this box:

    source          bound →     turn room    n
    roster          academy     swe-bench    23
    room-doctrine   academy     swe-bench    19
    roster          academy     hard-rs       3
    room-doctrine   academy     hard-rs       3

That is 42 + 39 `rag.room_gate.abstain` rows: every bench turn ran with no roster and no
operating doctrine. She was handed the work with none of the room's rules and no idea who
else was there.

THE CAPABILITY ALREADY EXISTED AND WAS NEVER WIRED. `airc_lib` has `room_roster_in`,
`room_roster_cards_in` and `room_doctrine_in`, and `room_doctrine_in`'s own doc names this
exact defect verbatim:

    "A citizen who belongs to several rooms answers a turn in the room it arrived in;
     reading doctrine from her default instead grounds that answer in another room's rules"

Continuum called the roomless variants everywhere. This is the wire, not a new mechanism —
the same shape as the astropy env fix earlier today (cabecb9c4): one decision expressed at
several call sites, correct at one of them.

- `AircRosterReader::room_roster` / `room_roster_cards` and `AircDoctrineReader::room_doctrine`
  take `room: Option<Uuid>`; the real impls delegate to airc's `*_in`.
- Both sources resolve `turn_room.or(bound)` exactly as RoomBoardSource does. `None` (an
  UNSTAMPED context — background consolidation) keeps pre-#443 behaviour.
- The exam-bleed pin SURVIVES and is now pinned by a test: a synthetic nil room gets
  nothing AND never falls back to the bound room; the reader is not consulted at all.

Tests: `the_turn_room_wins_over_the_bound_room` asserts the reader is asked for the TURN
room (the stub records what it was asked — a stub that ignores the argument would let this
regress invisibly), and `a_nil_room_gets_nothing_and_never_falls_back` holds the exam pin.
8/8 green in room_doctrine_source.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* docs(observations): 2026-08-17 bench rounds + the room gate that made them blind

Dated post-run card per the standing instruction. Records what was dispatched, the
fan-out measurement (24 turn rows = 2 events), the #443 abstain table, the operator's
inability to cancel a round it can create (#27/#371), the third unwired instance
(wall_source, blocked on an airc-side RoomId seam), and the four method errors I made.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): build tools fall back to UNPINNED when the era pin is unsatisfiable at every heal rung (astropy)

Reproduced in isolation 2026-08-17 (uv 0.11, py3.11/arm64) — the astropy sdist build-dep
pre-install is unsatisfiable BY CONSTRUCTION under its 2017 era pin, at every rung the
heal loop can reach:

  1. era markupsafe 1.0 has no wheel for this interpreter/arch → sdist build mandatory →
     needs setuptools>=40.8.0, which the pin caps at 38.2.4. uv hints
     `exclude-newer-package`; the heal lifts setuptools — VERIFIED FIRING, correct move.
  2. retry: the 2017 sdist now builds against MODERN setuptools →
     `ImportError: cannot import name 'Feature' from 'setuptools'` (removed in
     setuptools 46). No hint in that error; the loop correctly stops.
  3. the other lift is no better: modern markupsafe (>=2.1) removes `soft_unicode`,
     which era jinja2 2.10 imports — dies at import time.

The only installable combination is modern jinja2 + modern markupsafe (verified
importing clean). So: when the healed era-pinned install still fails, retry ONCE with
no date pin, loudly.

Scope-safe by construction: `era_sdist_build_deps` lists BUILD TOOLS for dependency-sdist
code generators (astropy → pyerfa → jinja2), never subject requirements. A repo where
jinja2 IS subject code (flask) has no entry in that table, and the subject graph is
resolved by the still-date-pinned `-e .` step.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(bench): dispatch parks on the roster like it parks on serving (#442 roster half, #412)

A dispatch fired inside the post-boot resume window found an EMPTY roster and refused
instantly, so the operator hand-rolled a sleep-loop around dispatch — run by hand twice
on 2026-08-17, which per the foolproof doctrine is a design defect, not a procedure.

The serving half of #442 already parks (`await_ready_serving`). The roster half now
parks the same way: dispatch waits (bounded, 180s, 5s poll) ONLY while the roster is
empty — citizens being re-hosted after a boot. An unknown NAME against a LIVE roster
still fails fast: that error means a typo, never a resume in progress. All existing
`resolve_dispatch_roster` semantics (whole-roster default, loud unknown-name listing
who is online, Denied on a genuinely empty machine) are unchanged — the loop only
delays WHEN the resolver runs, never what it decides.

With this, the runbook's manual sequence (ping → serving/status → roster wait → dispatch)
collapses into `benchmark/dispatch` itself: serving gate + roster gate are both inside
the ONE command.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(work): the grade tail cannot depend on wire delivery — work/state emits in-process (#450 tail, #434)

MEASURED 2026-08-17, the night two solved SWE cards graded as nothing. Atlas ran the
full loop on astropy-14182 and astropy-14995 — work/get → shell → read → work/claim →
searches → code/write (wrote=true) → shell/test → work/state. Both cards read
`Closed owner=Atlas` on the bench room board. Grade receipts under ~/.continuum/progress:
frozen at 92, unchanged. Zero `work.card.state_changed.bridged` rows for either.

Root cause is the SPINE of the tail, not the grader. `work/state` deliberately emitted
NOTHING, on the reasoning that the transition's own transcript echo returns through a
persona subscribe stream and `bridge_wire_work_event` (its single caller) publishes
exactly once. That is correct when delivery works. Under #434 — post-reboot durable
delivery to citizen scopes down — the echo never comes back: `persona.inbound.raw_event`
counted 2 rows in 80 minutes against 83 in a comparable earlier window the same day. The
bridge never fires, the grader never hears, and finished work grades as nothing. A grade
tail whose only feeder is a subsystem with a known-open delivery bug is a grade tail that
is down whenever that bug is.

So the verb now emits DIRECTLY. It just wrote the transition — it does not need the wire
to tell it what it did. The bridge stays for every writer that is NOT this core's
work/state (operator CLI, remote peers over the grid), which is exactly why it was added.

ONE emitter, not two code paths that each know how to publish: both feeders route through
`emit_card_state_changed(payload, via)`, and the (card_id, state) ring inside it makes a
transition publish once no matter which feeder sees it first. The wire-event-id ring
cannot cover this — the verb path has no wire event — so the dedup key had to move up to
the fact itself. `via` is on the probe, so which feeder won is answerable per transition.

room_id is the CARD's own room, resolved by walking the subscribed rooms' boards
(`card_room_of`, the read-only sibling of `claim_following_card_room`) — NEVER
`current_room()`, which is only where the persona happens to be standing. That is the
#345 wrong-room trap, and `grade_card`'s own doc names it; I wrote it into this fix first
and caught it before commit. An unresolvable room emits empty, so the grader fails loud
rather than grading against a guessed board.

Regression test pins the cross-feeder dedup (same transition once, different state
publishes). cargo check green with metal,accelerate.

Not deployed — a round is live on this box; this ships with the next reboot alongside
4178d50f7 (astropy build-dep fallback) and a37ac70fe (dispatch roster wait).

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): grade clones through a staging path — a .DS_Store must not void a score (#380 family)

MEASURED 2026-08-17. A re-grade of astropy-14995 died with:

  clone of astropy/astropy from its local mirror failed: fatal: destination path
  '…/benchmarks/swe/work/astropy__astropy-14995/repo' already exists and is not an
  empty directory

`clone_at` removes that directory immediately before cloning, so the message reads like a
harness bug. It is not. The directory's ONLY content was a `.DS_Store`, stamped AFTER the
remove — Finder/Spotlight noticed the parent and repopulated it inside the window between
`remove_dir_all` and `git clone`. `git clone` refuses any non-empty destination, so an OS
indexer can void a grade, on any repo, at random, and the receipt cannot tell you that is
what happened.

Fix: clone into a pid-suffixed STAGING path and move it into place. The window closes
because the destination is only touched at the rename, and anything that reappeared there
meanwhile loses to the tree we just built. Bonus property from the same shape: a
half-fetched tree is never visible at `repo_dir` — the move is the commit point.

Also stop swallowing the pre-clone removal error (`let _ = remove_dir_all`). If the stale
grade tree cannot be cleared, that is a filesystem fault and it now says so by name,
instead of surfacing three lines later as git's confusing "already exists" — the same
absence-vs-fault confusion this whole grade tail keeps producing.

No test: the failure is a filesystem race with a macOS daemon, and the honest reproduction
needs a network mirror + Finder. The staging shape is the fix; the comment carries the
measurement.

Found while grading two closed astropy cards after the grade-tail fix (185816b13). Second
finding from that same pass, NOT fixed here and bigger: astropy-14182 grades UNGRADEABLE —
PASS_TO_PASS scores 0 of 9 on the PRISTINE tree, so the harness correctly refuses to
report (gateOk:false). That is #380 (gold-gate every env class): no astropy instance can
score at all until its env builds, and a citizen's patch there is unmeasurable, not wrong.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): install the repo's own TEST extra — a suite that cannot COLLECT scores 0/N (#380)

MEASURED end-to-end 2026-08-17.

The gold gate said astropy-14182 was UNGRADEABLE: "PASS_TO_PASS passes 0 of 9 on the
PRISTINE tree". Not the citizen's patch — the DATASET'S OWN GOLD PATCH could not be
scored. Running the suite by hand gave the reason in one line:

  ImportError while loading conftest '…/repo/conftest.py'.
  conftest.py:9: in <module>
      import hypothesis
  E   ModuleNotFoundError: No module named 'hypothesis'

The env installs `-e .`, which resolves RUNTIME dependencies. `hypothesis` is a TEST
dependency, and astropy's conftest imports it at module scope — so pytest dies loading
conftest, before collecting a single test. An instance whose env is missing its suite's
deps scores 0/N on a PRISTINE tree, the gate correctly refuses to report, and nothing that
instance's solver writes can matter. The repo declares exactly what its suite needs in
`[project.optional-dependencies]`; we simply never asked for it.

POSITIVE CONTROL, run before writing the fix — same env, same pristine tree, after
installing `.[test]` with the era pin and the same ERA_CFLAGS the code passes:

  1 failed, 9 passed
  FAILED …test_rst.py::test_rst_with_header_rows — TypeError: RST.__init__() got an
      unexpected keyword argument 'header_rows'

9/9 PASS_TO_PASS green and the ONE failure is the instance's FAIL_TO_PASS test — the bug
the instance exists to fix. That is the gold-gate condition exactly.

SCOPE, measured rather than assumed (a `pytest --collect-only` sweep across all 40 envs
with a staged tree): every one of them collects today, so this is NOT a
whole-suite outage. Per-env it is luck: of four astropy envs, 12907 HAS hypothesis and
14182 did not, and 14365/14995 still do not. Nothing designed that difference — an era
resolve happened to pull it for one instance and not another. The fix's value is turning
that coincidence into a guarantee, and the honest claim is "an env missing its suite's
deps is unscoreable", not "astropy is broken by construction". An earlier draft of this
message overstated it as every astropy instance; the sweep disproved that before it
shipped.

`test_extra_name` picks the group the repo declares, preferring test > tests > testing >
dev. The order is load-bearing: a repo declaring both `dev` and `test` must get `test`, or
we install a kitchen-sink group and inherit its resolution failures. No pyproject, no
optional-dependencies, or no test-shaped group all mean "install as before" — never
"install something plausible".

`ensure_test_extra` is NON-FATAL by design and runs LAST. Everything before it decides
whether the env can BUILD and RUN a harness; this decides whether the suite can COLLECT. A
repo whose suite already collects does not need it, and a resolve failure must not delete
an env that grades fine today — so a failure probes (`swe.env.test_extra`, installed=false)
and leaves the env standing.

It also runs on the CACHED path, marker-guarded, because every env on this box was built
before this existed; without the heal, an env that happens to lack its suite's deps stays
that way forever and the operator has to know which ones. The marker makes it once-only,
including the "this repo declares nothing" answer.

Extracted `era_cutoff` while here: the cached path needs the same "what era is this
instance" answer the build path computed inline, and two copies is how they drift.

Deploys with 185816b13 (grade tail) and 99c59fe44 (clone staging) on the next reboot.
#380 stays open until the gold gate passes per env CLASS — that is the instrument, and
one instance passing is not a class passing.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): the test-extra parser was half-blind — read setup.cfg too, and stop caching a negative (#380)

I shipped b0141e810 claiming astropy would now gold-gate. The live run said no, and it was
right. Correcting my own fix, with the receipt:

  gold gate astropy-14995 → "UNGRADEABLE — PASS_TO_PASS passes 0 of 40 on the PRISTINE
  tree"; swe.env.test_extra probe rows: 0; env marker `.test-extra` = "none-declared";
  `python -c "import hypothesis"` → ModuleNotFoundError.

TWO defects, both mine.

1. THE PARSER READ ONE FILE. astropy 5.3 has NO `[project.optional-dependencies]` — its
   suite deps are setuptools declarative config:

     [options.extras_require]
     test =  # Required to run the astropy test suite.
         pytest>=7.0
         pytest-astropy>=0.10

   So `test_extra_name` returned None for the exact repo the fix was written for. Both
   files are ordinary in the ecosystem; reading one is reading half. `declared_extras` now
   reads both, hand-scanning the INI section for KEYS (an ini crate would be more surface
   than six lines, and we need group names, not requirement lists — note the flush-left
   check, since `    pytest>=7.0` is a continuation, not a group).

   My earlier positive control was real but proved the wrong thing: I ran
   `uv pip install -e ".[test]"` by hand, and uv resolves that extra THROUGH setuptools —
   so it worked while our own parser could never have named it. A manual command
   succeeding is not evidence that the code takes the same path.

2. THE MARKER CACHED A NEGATIVE, which is worse than no cache. On the first run the
   half-blind parser wrote "none-declared" — permanently. Fixing the parser would not have
   helped: the marker suppresses the heal forever, and only a human who knew which files to
   delete could recover it. Caching a negative caches the limits of today's code. Now only
   a SUCCESS is recorded, and a marker is authoritative only when it NAMES an extra, so the
   poisoned markers the first version wrote self-heal. Re-reading two small files per grade
   costs nothing next to cloning a repo and running its suite — the cost I was "optimising"
   was never real.

Test extended with the astropy shape: no pyproject at all, extras in setup.cfg, and
`test_all` present — which sorts before `test` alphabetically and is a superset, so it must
not win. That case is the one that shipped broken.

LESSON, and it is the same one twice today: a fix is not verified by the command I ran by
hand, only by the code path the system takes. I had a green unit test, a green compile, and
a green manual install, and the feature was still dead on the one repo it existed for.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(swe): the UNGRADEABLE verdict must carry the pristine run's output (#380 instrument)

`let (pristine_p2p, _) = run_tests(...)` — the report went into `_`. That verdict is the
ONLY artifact of the pristine run, so "the suite does not run in this environment" shipped
as a conclusion with its evidence deleted, leaving the reader to reproduce the run by hand
and guess at the difference.

MEASURED TODAY, and it is why this is worth its own commit: astropy-14365 graded
`PASS_TO_PASS 0 of 8` here, while the SAME invocation — `-m pytest <file> -v -p
no:cacheprovider`, same venv, same tree — run by hand gave 8 passed and the instance's own
bug failing (`ValueError: Unrecognized QDP line: read terr 1`), which is exactly the gate
condition. So the environment was fine and the divergence was somewhere inside the gate. I
proposed three mechanisms and could settle none of them, because the one artifact that
names the divergence was thrown away on this line. Hours, on a guessing loop, next to a
variable holding the answer.

Now the tail rides the error (via the existing `report_tail`, so it is bounded the same way
the retry excerpt is). And an EMPTY report gets its own sentence rather than an empty
section: no output at all means the harness never executed — a missing interpreter, a
refused invocation, a run that died before writing a byte — which is a different fault from
a suite that ran and failed, and the two must not read alike.

This is the same defect class as the rest of today's session: the instrument had the
answer and did not surface it. #380 stays open; this is what makes the next attempt at it
a measurement instead of a hypothesis.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(benchmark): a kickoff addressed to a citizen must never be AUTHORED by her — the round-killer

THE DEFECT, measured live 2026-08-17 and deterministic:

A citizen's inbound stream skips messages she is recorded as having said
(airc_persona_conversation, `message.peer_id == self.own_peer_id`). Correct —
nobody answers their own speech. But the operator has no self-peer in-core (#27),
so `curator_airc` falls back to `registry.any_live_citizen()`, which picks the
LEXICOGRAPHICALLY-LOWEST agent_name. With the roster culled to Atlas + Benchy that
is ALWAYS Atlas — the assignee.

So `benchmark/dispatch --assignees='["Atlas"]'` authored every `@Atlas (to you)`
kickoff THROUGH Atlas. All three died at the self-skip: no error, no probe, no
turn. The command reported `kickoffs: 3, kickoff_errors: []` and was telling the
literal truth — three messages were sent. Zero were hearable.

The round then ran for hours on the DETACHED solver (`dispatch_staged_swe_solve` →
`agent/solve`), which produced 18 acts, 0 turns, 0 room visibility and 0 curriculum
input (#425) — maximum effort, nothing that reaches the flywheel. Joel: "its
supposed to be persona that run. you dont wire in loopers."

Why it read as intermittent (#417 "kickoffs DO actuate"): with ~20 citizens online
the alphabetical pick usually was NOT the assignee, so kickoffs landed. Culling the
roster to two made it a coin flip, and the coin is not random — it is `min_by(name)`.

THE FIX (this commit — the delivery half):

- `any_live_citizen_other_than(exclude)` — the same deterministic pick, minus one
  peer. `any_live_citizen()` becomes `…other_than(None)`, so there is ONE selection
  rule, not two that can drift.
- dispatch voices each kickoff through a citizen who is NOT the addressee.
- When the addressee is the ONLY live citizen, REFUSE and say why, naming
  `persona/spawn` as the fix — never send a message that cannot be heard
  ([[fallbacks-are-illegal-fail-loud]]).
- The self-skip now emits `persona.inbound.skipped_self_authored`. The skip stays;
  its SILENCE was the real cost. A message vanishing without a trace is how a
  substrate failure reads as "the citizen chose not to work"
  ([[an-absence-is-an-unfinished-measurement]]).

NOT in this commit, deliberately, and next: retiring the detached solver so the
persona's own turn does the work (Joel's actual point). Order matters — prove a
real `persona.turn.start` fires from a kickoff FIRST, or removing the looper just
yields nothing at all. Tracked on #453.

Also lands the shutdown lane sweep held from earlier tonight (#454):
`lane_registry::sweep_all()` + `SweepMode{Boot,Shutdown}`, called from `stop`.
`stop` reaped cores and owned orphans but touched NO llama-server, so lanes leaked
across shutdown by design and `reboot` (= stop + start) inherited the wreck —
measured as a 19 GB ephemeral 27B resident beside the live 14B, which starved the
planner into serving a 2,816-token window (smaller than the tool surface) and made
every citizen structurally mute. Role-blind on purpose: the live/ephemeral split
decides ADOPTION, and nothing is adoptable by a core that is exiting.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(bench): dispatch resolves against RESIDENCY, not registration (#455)

A citizen is REGISTERED the moment her identity is minted or resumed. She is
RESIDENT only once the supervisor attaches a service loop — which is what primes
her perception stream and gives her a turn. Every readiness surface reported the
former and called it the latter.

Measured 2026-08-18: for ~15 minutes after a reboot `persona/roster` listed Atlas
and Benchy while `persona.inbound.subscribe_opened` was 0. Hosting was correctly
parked waiting for the serving lane to prove it could decode (#363). A round was
dispatched into that window on the strength of that roster: 2 cards posted,
`kickoffs: 2`, `kickoff_errors: []`, and ZERO turns. Nobody was home and every
surface said otherwise.

- `PersonaAircRuntimeRegistry::is_resident` / `resident_snapshot` — residency
  asked per citizen, never inferred from presence in the registry. The truth
  table is a pure fn (`resident_from_loop_state`) so the three rows are unit-
  pinned; a live `PersonaAircRuntime` needs a real airc daemon and cannot be
  built in a test.
- `persona/roster` gains `resident` per row + `resident_count`. `count > 0 &&
  resident_count == 0` is exactly the state above, and it is now legible.
- `benchmark/dispatch` resolves assignees against the RESIDENT snapshot, and its
  post-boot wait keys on residency too — the old wait cleared on a non-empty
  roster, which released it ~10 minutes early (#412). Refusals distinguish the
  two states because they have opposite fixes: registered-but-not-resident is a
  WAIT, unregistered is `persona/spawn`. A named assignee who is merely unhosted
  is no longer reported as a typo.

This is honesty at the seam, not the cure. The cure is boot owning the process
tree (#452) so the resident window never exists to dispatch into.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* fix(boot): boot OWNS the process tree — adopt healthy, reap unhealthy, spawn missing (#452)

Joel, 2026-08-16: "start = enumerate → health-check → reap-or-ADOPT → spawn
missing, for EVERY service — cores, llama lanes, airc daemon."

The operative word was ADOPT, and boot did exactly two things to a service it
found running: nothing, or kill it. Neither is ownership.

ROW: llama lanes — was `pkill -f llama-server`, unconditionally, every boot.
This made real code dead: `inference::lane_registry::sweep_in` already encodes
the adopt rule — `(LaneRole::Live, SweepMode::Boot) => false` deliberately leaves
a live lane alone at boot and reaps it only at shutdown. The shell killed that
lane seconds before the core could adopt it, so that arm never once fired in
production. Cost: a cold model load on EVERY reboot, during which the lane cannot
prove it can decode, hosting correctly parks (#363), and every citizen is
registered-but-not-resident — measured at ~15 minutes on 2026-08-18, the window a
benchmark round was staged into for zero turns (#455). Now: enumerate by pid,
read each lane's port from its own cmdline, /health it, adopt or reap per lane.
Verified live on this box before the change landed: pids 1166 (:58057) and 95258
(:58091) both healthy — both would have been killed, and now are kept.

/health is LIVENESS, not decode — a wedged server can pass it, which is exactly
why the core verifies generation before seating citizens (#363). That division is
deliberate: the shell adopts a plausibly-live lane, the core remains the authority
that refuses a lane that cannot decode and relaunches it. Adopting can only cost a
relaunch the core already knows how to do; reaping costs a cold load every time.

ROW: airc daemon — this row did not exist. Boot printed "⚠ airc daemon not
running. Start it with: airc daemon" and carried on: a runbook line where
ownership belongs, for the one service whose absence makes everything else inert.
With no transport there are no rooms, so citizens have nothing to be resident IN.
Now: ping → adopt; wedged (holds the socket, answers nothing — worse than absent,
since a fresh spawn loses the bind, #355) → `airc stop` then reap → spawn →
bounded wait → FAIL LOUD and exit nonzero. Binary absent is a DIFFERENT state
(warn, continue): a box without airc installed is not a broken one, and refusing
to boot would strand CI and fresh clones.

ROW: cores — already correct and left alone. #420's `core_bind_guard::decide`
adopts on `start` (AlreadyServing → no-op, Occupied → refuse), and reaping on
`reboot` is right because reboot replaces the binary.

`bounded_run` is the shared primitive. macOS ships no coreutils `timeout`, and —
the lesson that made #420's guard reachable at all — an unbounded probe against a
wedged service does not fail, it HANGS: the kernel completes connect() into the
listen backlog whether or not the process is ever scheduled. A health check that
can hang is not a health check, it is a boot that stops. Truth table verified
live: exit0→0, exit1→1, hang→124 in 1s not 5s.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(persona): BaseModelPolicy — one answer to "what base does she think on?" (#126/#369/#438)

Joel asked where the base model is governed. The honest answer was FOUR places,
in one function, each silently handing off to the next:

  0. override_model      — runtime per-persona assignment
  1. model_preferences   — tiered ladder, "best that fits"
  2. model_id            — explicit per-persona model, labelled "Legacy"
  3. default_local_model — system-wide default

Four expressions of one decision, and rows 1→2→3 walk DOWN without anyone
deciding to. That is the #438 incident shape: one bogus usable_gb=0 sample walked
the ladder to the bottom and served citizens a 0.5B that emitted template-token
garbage into the room. The sibling module already forbade this in prose
(inference_profile.rs: "substrate HARD ERRORS instead of silently degrading") —
the prose was right, the code never implemented it.

This is a COMPRESSION, 4 → 1, and both modes fall out of it:
  - Pegged{model, reason}  — subsumes override_model (Measurement peg w/ lease)
    and model_id (Operator). This base or she does not serve.
  - Adaptive{ladder, floor, rungs} — the governor moves her, bounded below by a
    NAMED floor member (not "last entry wins", which is how a reordered ladder
    silently moves its own floor).
No system-wide-default arm exists. That arm WAS the bug.

THE GENOME IS WHAT MAKES A BASE REACHABLE (Joel, this session): a LoRA adapter is
a per-base derivative. The corpus — transcripts, tool traces, solved instances —
is the durable, base-independent asset; an adapter is forged FROM it ONTO a
specific base and is invalid on any other (#369). So she can scale up or down
freely, PROVIDED her genome was forged for the destination. Hence GenomeCoverage
as an input: RequireGenome (default) skips rungs she has no adapter for and
refuses with the FORGE work-list; AllowBare takes them but reports
genome_backed=false so a measurement records WHICH citizen it scored.

The paired obligation is the forge's, not this module's: one corpus fans out to N
adapters, one per targeted base, each trained independently against that base. A
ladder is only as walkable as the forge made it, and RequireGenome turns a
declared-but-unforged ladder from a silent capability cliff into a visible one.

Why benchmarks need this: genome lift is only measurable against a fixed base.
Round 1 on a known base → corpus accrues → forge onto that same base → round 2,
same base + adapter → the delta is attributable to the genome. Float the base and
the number means nothing AND round 1's adapters are garbage. Worse, a silent
re-base corrupts the EXPERIENCE, not just the score: turns taken on an unintended
base still land in the corpus, poisoning the next adapter forged from it. So
refusing to serve is the cheap failure; serving on an unintended base is the
expensive one, and it is the one that used to happen by default.

Pure over (host_vram_gb, coverage) — 15 tests, no GPU, no forge, no registry.
Every refusal names its own remedy and is asserted on.

NOT YET WIRED: allocator/inference_profile still use the 4-way resolver. This is
the type + its truth table landing first so the cut-over is mechanical.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(persona): PegReason::Training — the peg's biggest job is targeting the forge

Correcting my own framing from an hour ago: I called the peg "only for
measurement". Too narrow, and Joel's point is the load-bearing one.

Continuous learning never stops. The flywheel runs turns → corpus → forge →
adapter → page-in continuously, and the adapter coming out the far end is a
derivative of whatever base it was trained against. If her base floats between
the corpus accruing and the forge finishing, the adapter lands for a base she has
already left — forged for nobody, and page-in must then refuse it (#369). The
corpus survives that; the training compute does not.

So a training run holds a peg for its duration, exactly as a measurement round
does, and for the same underlying reason: a process is in flight whose output is
only valid against the base it started on. Measurement is episodic; training is
always running, which makes THIS the peg held most of the time.

GenomeBound is now documented as what it actually is — the standing consequence
of past Training runs, derived from the adapters she holds.

Also worth stating plainly, since it corrects a second drift in my framing: the
LADDER is the mechanism for daily use, not the peg. A citizen on a 64GB box
resolves to the top rung automatically — no peg, no special case — and a smaller
box steps down the same ladder. The peg exists for the three cases where
something in flight depends on the base staying put.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* feat(persona): the work turn roots her hands at the card AND feeds the genome (#456)

Joel: "learning and score are both the objective. We should outcompete the base
model." The learning half was structurally impossible. This is why.

MEASURED FROM SOURCE: `training_producer::produce` — the L2 step that turns a turn
into a (context, completion) training example and submits it to the forge — had
exactly ONE call site tree-wide: the message-REPLY path. Its own comment explains
the exclusion: "It lives ONLY on this live `Spoke` path, which eval forks
(`drive_to_settle`) never run, so the training set can never be contaminated by a
measurement simulation." Correct for eval (#59). But it means:

  - `agent/solve` (which IS `drive_to_settle`) produces zero training examples,
    so a dispatched bench card can never reach the genome no matter that dispatch
    sets `learn: LearnFromThisWork` — the gate is PATH-based, the policy is never
    consulted, the policy loses.
  - AND the WORK TURN — the separate drive at the heart of "working is not
    speaking" (#154), the turn where she actually works her CLAIMED CARD — also
    never fed the producer. Chat produced training data; real work did not.

That second one is the sharper defect and it is fixed here, in the live loop,
without touching the eval guard.

TWO CHANGES, both in the held-work turn:

1. HANDS FOLLOW THE CARD. A held card may be a staged benchmark checkout — a real
   git repo under `workspace/swe/<instance>`. Without rooting her hands there she
   "works" it by writing into her OWN workspace and the grader's `git diff` on the
   sandbox scores a false ZERO — exactly the defect glass-boxed on agent/solve
   2026-07-22 (two real acts, correct file written, empty patch). Now the work turn
   roots at the card's workspace and RESTORES on every exit path (#312: after a
   flask solve, Anwen's live self was still reading the exam repo hours later).
   A root failure is LOUD and she works in her own dir anyway — an unexplained
   empty diff is worse than a diagnosed one.

2. THE PRODUCER FIRES. context = the card burst she was handed, completion = the
   report she wrote after doing the work. Same shape, same best-effort spawn, same
   quality bar as the reply path. Still the LIVE path — an eval fork does not reach
   this call site — so the contamination guard is unchanged.

NEW: `persona/staged_workspace.rs` — ONE answer to "which workspace does this card
point at", replacing the walk that `persona/roster` and `dispatch_staged_swe_solve`
each did inline. The layout knowledge that makes a citizen able to act in the repo
previously lived only inside a benchmark dispatcher, so the live path could not
reuse it without importing the very bypass it should replace. Matching is by title
containment (dispatch writes the title from the instance, so it is by construction);
MORE than one match refuses with a probe rather than guessing, because rooting at
the wrong repo silently scores a false zero for the other card.

WHAT THIS DOES NOT DO: retire the `agent/solve` inbound bypass. That is still #456
and still the right end state. But this makes the in-loop path actually work —
hands in the repo, experience into the genome — which is the precondition for
retiring the bypass rather than a consequence of it.

CORRECTION TO MY OWN CLAIM this session: I first said "zero production callers of
training_trigger/submit — the trigger is dead." Wrong. `training_producer.rs` is
the producer and dispatches correctly; `memory/consolidate.rs:196` is a second
legitimate…
joelteply added a commit that referenced this pull request Aug 20, 2026
…ilt but never wired" disease (#27 root)

Five times in ONE session the same defect was found by accident, each after hours
debugging a symptom that looked unrelated:

  ProbeRouterLayer  installed, handle discarded          (#362, dead probe stream)
  CLI install       ran every deploy, BUILD gated off    (#422, stale binary)
  BenchViewState    impl complete, never bound           (#426, blind citizen)
  GeneratorModule   never registered with the runtime    (#325, orphan command)
  AgentContext      constructed ONLY in its own tests    (#27,  operator w/ no identity)

Every one compiled. Every one had passing unit tests. Five in one day is not bad
luck, it is a missing constraint. The module-wiring audit (#344) asks about MODULES;
four of the five were not modules. This asks the general question: does anything in
the workspace actually use this?

AgentContext is why it matters commercially, not just aesthetically: because the
operator has no in-core airc identity, benchmark/dispatch authors its cards through
`any_live_citizen` — so a round's cards are attributed on the board to a citizen who
did not post them, and no operator/agent can hold a claim, which is what makes
collaborating on a round impossible.

THE RULE: a `pub struct`/`pub enum` in this crate, with an inherent impl AND a
stand-up constructor (new/bootstrap/spawn/install/connect/start), referenced nowhere
in the workspace outside its own file. Condition 2 keeps it from degenerating into a
dead-code lint over wire DTOs and ts-rs payloads.

FOUR false-positive classes closed, each of which would have got the guard deleted:
  1. a `use`/`pub use` re-export is NOT a use — this is exactly how AgentContext
     would have hidden from its own guard;
  2. a doc-comment mention is not code (match by nature, never by name — same
     discipline `scan` already needed for #[cfg(test)]);
  3. reference corpus includes TEST halves: a type wired to another file's test
     harness IS wired (GridSimulator, RecordingGridCapture). Production-only scored
     205; the honest number is 107;
  4. a type surfaced via `pub type Alias = ...` is reached through the alias — this
     would have fired on MetalProbe/NvidiaProbe, i.e. on the exact backend-adapter
     shape gpu::device_probe was refactored INTO today. A guard that punishes the
     pattern it protects gets weakened until it says nothing.

SEAM, not a fourth hand-rolled scanner: source_hygiene gains CrateRule/scan_crate for
rules that are irreducibly cross-file, alongside the per-file SourceRule. Violations
come only from continuum-core/src; references are searched across every workspace src
root, because this crate is a LIBRARY and apps/cli may be the legitimate caller.
Widening the corpus can only ever remove findings.

A BUG IN THIS GUARD, found and fixed before it shipped: own-mentions were counted over
the production half while the corpus was raw, so a type constructed in its OWN test mod
scored corpus>own and read as externally referenced — AgentContext went unreported.
Symmetry between the two sides IS the arithmetic. The first fix re-read the file with
`unwrap_or_else(|_| production.clone())`; that fallback silently swapped the text shape
and reintroduced the very miscount, so SourceFile now carries `raw` from the single read
and there is no fallback at all (Joel: don't leave fallbacks or other refuse in there).

Ratchet at a MEASURED 107, not a wall — a wall gets #[ignore]d in a week. Positive
control is hermetic: a synthetic type with a bootstrap ctor, constructed only in its
own test mod, re-exported by a parent and named in that parent's prose, must still be
reported. If that test ever passes vacuously the guard is decoration.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 20, 2026
…ported on every target (CI E0432)

`#[cfg(target_os = "macos")]` binds to the NEXT item only. Inserting the new
`device_probe` re-export ABOVE `metal_monitor` in today's adapter refactor silently
moved the gate onto the base and left the macOS-only adapter exported everywhere:

  #[cfg(target_os = "macos")]
  pub use device_probe::{...};        // the PLATFORM-NEUTRAL base — wrongly gated
  pub use metal_monitor::{...};       // the macOS ADAPTER — wrongly ungated

Exactly inverted from the `mod` declarations two lines up (device_probe ungated,
metal_monitor macOS-gated), and exactly inverted from the point of the refactor: the
base is what every backend shares.

Compiled clean on this Mac. E0432 `unresolved import metal_monitor` on every other
host — which is BOTH red CI jobs from one cause: `cargo test --lib` (Linux) and
`cargo check windows-msvc`. I was ready to write the Windows job off as the #404
flake; it was this.

Caught only because CI builds a different target than I do. The local check that
would have caught it does not exist on a Mac (`--no-default-features` can't build
here, #422), so the honest guard is CI itself — which is the argument for not
merging red on a "probably the flake" hunch.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 20, 2026
… seam, hygiene guards, and canary's 4-day merge block (#2338)

Squash was the only path: merge commits are blocked by ruleset and the branch carries a
merge commit so rebase is impossible. Individual commit messages survive on the branch
ref and in PR #2338. Today's chain, preserved here so canary's log is not lossy:

- cd1f8c8  guard(hygiene): unwired public machinery can never increase. A pub type
  with a constructor and no caller anywhere in the workspace is not finished work.
  Ratchet at a measured 107, hermetic positive control. Written because the SAME defect
  was found five times in one session (ProbeRouterLayer #362, CLI install #422,
  BenchViewState #426, GeneratorModule #325, AgentContext #27) — a missing constraint,
  not bad luck.

- e0ff670  fix(gpu): `#[cfg]` binds to the NEXT item only, so inserting a re-export
  above `metal_monitor` slid the macOS gate onto the platform-neutral base and exported
  the macOS-only adapter on every target. Compiled on a Mac, E0432 on Linux AND Windows
  — both red CI jobs from one cause.

- 1130c6b  refactor(gpu): platform selection now happens in ONE place —
  gpu/backends/{metal,nvidia}. Was four cfg sites for one concern. Plus a guard that
  reads the file's own source and requires each `pub mod` and its `pub use` to carry
  the same gate (source-reading is the only way to assert it from a single target).
  Positive-controlled by reintroducing the exact CI bug.

- 8a789c9  fix(hygiene): MIN_JUSTIFICATION_CHARS takes the de-hardcode guard's
  sanctioned exemption — it bounds a COMMENT, not a window. Reached CI because I
  validated with a FILTERED test run; a filtered pass is not a pass.

- 4aad404  ci: publish the required `ts-rs binding drift detector` context. Canary
  had been UNMERGEABLE FOR FOUR DAYS — every PR blocked with all real gates green,
  because the drift gate was correctly folded into the lib job on 2026-08-16 and branch
  protection kept requiring a context nobody published. Fixed without resurrecting the
  9-minute duplicate compile that fold deliberately deleted.

Verified: 5/5 checks green — cargo test --lib (11m12s), windows-msvc (9m55s, was
FAILURE before the cfg fix), drift detector (4s), label-pr, WIP. mergeStateStatus CLEAN.
joelteply added a commit that referenced this pull request Sep 5, 2026
…'s 1.17.1 and every citizen went mute silently

THE BUG. The ort crate is built with `load-dynamic` (the build-core module's
features are literally `cuda,load-dynamic-ort`), so it dlopens ONNX Runtime BY
NAME at runtime. start-server.sh named that library for Linux (.so) and macOS
(.dylib) and had no .dll arm, so on Windows ORT_DYLIB_PATH was never set and the
OS search order answered instead — with C:\Windows\System32\onnxruntime.dll,
which Edge WebView ships at 1.17.1. ort 2.0.0-rc.11 requires >= 1.23.x:

    thread 'tokio-rt-worker' panicked at ort-2.0.0-rc.11/src/lib.rs:191:
    Failed to load ONNX Runtime dylib: ... expected version >= '1.23.x', but got '1.17.1'

WHY IT WAS INVISIBLE. The panic takes a tokio worker, not the process. The core
keeps running and answers ping, so nothing surfaces — Silero VAD / STT / TTS is
simply dead and the only evidence is one line in a start log nobody reads. Every
Windows citizen was mute by OMISSION, which is the same shape as #58: a capability
that exists on the author's platforms and is structurally absent elsewhere, with
no failure loud enough to notice.

WHAT THIS COMMIT DOES:
  - adds the .dll arm so the runtime we provision is the one we name
  - SAYS SO when no ORT is provisioned on Windows, instead of letting the loader
    hand us a wrong-version stranger. Absent-and-named is a fixable condition;
    silently-substituted is the bug class the whole block exists to close.

VALIDATED on BigMama (Windows/CUDA), not asserted: with onnxruntime 1.23.0
provisioned, a cold core boot goes from the panic above to zero panics and
`inference: ✓ inference gateway registered (sync)`.

NOT FIXED HERE, carded instead, because a complete fix spans three places:
  1. provisioning — an `onnxruntime` row in install-manifest.toml.
     onnxruntime-win-x64-1.23.0.zip,
     sha256 72c23470310ec79a7d42d27fe9d257e6c98540c73fa5a1db1f67f538c6c16f2f
     (downloaded and verified on this box).
  2. a search-order subtlety that will bite whoever writes that row: Windows
     searches the EXE'S OWN DIRECTORY before System32, but PATH only AFTER it. So
     the manifest's existing `runtime_path` mechanism (which appends to PATH)
     CANNOT beat Edge's copy. The DLL must sit beside the binary in
     ~/.continuum/bin, or ORT_DYLIB_PATH must name it outright.
  3. two start paths — `continuum reboot` launches via this script (fixed here),
     while `continuum start` execs ~/.continuum/bin/continuum-core-server.exe
     DIRECTLY and sets no environment. Only (2)'s beside-the-binary placement
     covers both, and the CLI cannot be redeployed on Windows anyway (#422).

Also included: the wall_source.rs `wall.read.phase` marks (enter/exit, wall_ms,
posts). Same cancellation-proof placement as the board marks — a mark BEFORE the
read, because this runs under the 30s PERCEPTION_DEADLINE and a cancelled future
never reaches a probe placed after its await. They measured enter=2 / exit=0 over
seven minutes, which is what identified wall_posts_in (zero cursor, no cache,
pages until exhausted) as the real stall. Card 5f95836c.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply added a commit that referenced this pull request Sep 5, 2026
…verything after (#3768)

* probe(cognition): the act's residue names its own halves — cycle vs everything after

`persona.act.pace` splits an act into model_ms and residue_ms, and that split is
what made a ~29 s/act residue visible at all. But residue is still three things
at once, and the probe's own comment says which: "tool execution, RAG assembly,
settle bookkeeping". A stall in the brain's work around the model and a stall in
acting afterwards remain the same number, which is exactly the condition the
first split was written to end.

`settle_step` awaits `cycle.run_situated(...)` — the whole cognition cycle: RAG
assembly, genome activation, the model call, evaluation — and then does decision
handling, tool execution and bookkeeping. That is the one seam where the residue
divides cleanly, so time it there:

    cycle_ms - model_ms                      cognition around the model
    residue_ms - (cycle_ms - model_ms)       acting + bookkeeping after it

Emitted as `cognition.cycle.cost` with cycle_ms, model_ms, around_model_ms and
had_metrics. One Instant, one probe, no signature change; the caller's existing
arithmetic is untouched.

Measured context that motivated it, from this box: two consecutive acts in the
room where citizens had stopped acting showed act_secs 37 / model_ms 7108 and
act_secs 33 / model_ms 3870 — 83% and 91% of the act unattributed. In the room
where acts were still landing, residue was 9-1230 ms. Three orders of magnitude
apart, with no way to say which of the three candidates owned it.

Type-checks clean. Numbers to follow on this PR once it is deployed here — the
probe is worthless until someone reads it, which is the whole lesson of the
residue it is splitting.

* probe(cognition): the slowest faculty reaches the probe stream, not just a Noop sink

The tick's per-faculty wall-clock already exists. `run_inner` times every faculty
across both phases and puts them in `WorkspaceTrace.timings` — and the ONLY
consumer is `self.capture.record(...)`, whose default impl is Noop. So on a
default deployment the answer to "which faculty owned this tick" is computed and
then thrown away.

That is why the 30-second stall was unattributable from a running node. Measured
here: two acts spent 32.7 s and 36.1 s inside the cognition cycle around a 4-9 s
model call (#3768), and nothing readable could say which faculty held it —
while the machine had the number the whole time.

Emits `cognition.faculty.slowest` at the existing trace site:
  slowest_faculty, slowest_ms, summed_ms, faculties

`summed_ms` is the SUM across faculties, not wall-clock: phase 1 runs
concurrently on a barrier, so it exceeds the tick's real duration whenever
faculties overlap. It is total WORK, and its ratio to slowest_ms says whether one
faculty dominated or many shared the time. Named so nobody reads it as a
duration.

No new measurement, no new timing code, no cost when no sink is attached — an
O(n) max over a handful of entries. This is the same shape as #3761: the fact
existed, and the channel to reach it did not.

`("none", 0)` when a tick recorded no timings: an honest empty rather than a zero
that reads as "fast".

cargo check -p continuum-core --lib: rc=0.

* fix(vendor): restore the llama.cpp pin this branch was reverting, + probe the board read that turned out to be innocent

Two things, both consequences of the same evening's investigation.

VENDOR PIN (the review fix). This branch carried core/vendor/llama.cpp at
fb668a88b while canary has 76dfd6482 — the fork pin from #3761 that adds the
/props model_weight_buffers residency receipt. Merging would have reverted that
receipt for every node deploying afterwards. Caught by Fable/M5 in review; I
verified it against my own tree rather than taking it on trust, and it was worse
than the diff showed: the working tree was also CHECKED OUT at fb668a88b, so every
measurement I took this evening ran on a binary that cannot produce the receipt.

Note for the next person who hits this: merging canary does NOT fix it. The
submodule pointer is a tree entry like any other and this branch's side wins the
merge. It takes the explicit
`git checkout origin/canary -- core/vendor/llama.cpp` plus a
`git submodule update` to move the working tree.

BOARD-READ PROBE. `board.read.phase` marks each half of the room-scoped board read
(resolve_room / project_board / complete). The marks go BEFORE each phase, not
after: this read runs under workspace.rs's 30s PERCEPTION_DEADLINE, and a
cancelled future never reaches a probe placed after its await — so the ticks worth
diagnosing are exactly the ones a duration-after-the-fact probe cannot see.

What they established is the opposite of what I built them for. Chasing a faculty
that renders as `[room-board]` and pins at 30.00s on ~27% of ticks, I assumed it
was this read. It is not: that SOURCE_ID belongs to wall_source.rs. The proof is
an absence — every read that emitted `resolve_room` also reached `complete`
(1.4-9.9s), while the deadline events carry no mark at all, not even the first
one. A faculty cancelled before the first line of the branch is not stalling in
the branch.

The marks stay. They are cheap, they exonerate this path by name, and "which
projection did the tick actually spend itself in" is a question that two sources
with confusable names will raise again.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(windows): name the ONNX Runtime we mean — Windows was handed Edge's 1.17.1 and every citizen went mute silently

THE BUG. The ort crate is built with `load-dynamic` (the build-core module's
features are literally `cuda,load-dynamic-ort`), so it dlopens ONNX Runtime BY
NAME at runtime. start-server.sh named that library for Linux (.so) and macOS
(.dylib) and had no .dll arm, so on Windows ORT_DYLIB_PATH was never set and the
OS search order answered instead — with C:\Windows\System32\onnxruntime.dll,
which Edge WebView ships at 1.17.1. ort 2.0.0-rc.11 requires >= 1.23.x:

    thread 'tokio-rt-worker' panicked at ort-2.0.0-rc.11/src/lib.rs:191:
    Failed to load ONNX Runtime dylib: ... expected version >= '1.23.x', but got '1.17.1'

WHY IT WAS INVISIBLE. The panic takes a tokio worker, not the process. The core
keeps running and answers ping, so nothing surfaces — Silero VAD / STT / TTS is
simply dead and the only evidence is one line in a start log nobody reads. Every
Windows citizen was mute by OMISSION, which is the same shape as #58: a capability
that exists on the author's platforms and is structurally absent elsewhere, with
no failure loud enough to notice.

WHAT THIS COMMIT DOES:
  - adds the .dll arm so the runtime we provision is the one we name
  - SAYS SO when no ORT is provisioned on Windows, instead of letting the loader
    hand us a wrong-version stranger. Absent-and-named is a fixable condition;
    silently-substituted is the bug class the whole block exists to close.

VALIDATED on BigMama (Windows/CUDA), not asserted: with onnxruntime 1.23.0
provisioned, a cold core boot goes from the panic above to zero panics and
`inference: ✓ inference gateway registered (sync)`.

NOT FIXED HERE, carded instead, because a complete fix spans three places:
  1. provisioning — an `onnxruntime` row in install-manifest.toml.
     onnxruntime-win-x64-1.23.0.zip,
     sha256 72c23470310ec79a7d42d27fe9d257e6c98540c73fa5a1db1f67f538c6c16f2f
     (downloaded and verified on this box).
  2. a search-order subtlety that will bite whoever writes that row: Windows
     searches the EXE'S OWN DIRECTORY before System32, but PATH only AFTER it. So
     the manifest's existing `runtime_path` mechanism (which appends to PATH)
     CANNOT beat Edge's copy. The DLL must sit beside the binary in
     ~/.continuum/bin, or ORT_DYLIB_PATH must name it outright.
  3. two start paths — `continuum reboot` launches via this script (fixed here),
     while `continuum start` execs ~/.continuum/bin/continuum-core-server.exe
     DIRECTLY and sets no environment. Only (2)'s beside-the-binary placement
     covers both, and the CLI cannot be redeployed on Windows anyway (#422).

Also included: the wall_source.rs `wall.read.phase` marks (enter/exit, wall_ms,
posts). Same cancellation-proof placement as the board marks — a mark BEFORE the
read, because this runs under the 30s PERCEPTION_DEADLINE and a cancelled future
never reaches a probe placed after its await. They measured enter=2 / exit=0 over
seven minutes, which is what identified wall_posts_in (zero cursor, no cache,
pages until exhausted) as the real stall. Card 5f95836c.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(windows): the reap/verify subsystem was inert — lsof and ps don't exist there, so serving wedged permanently

THE SYMPTOM. serving/status on BigMama, indefinitely:

    ready=false lanes=0 active_model=None
    degraded: "llama-server spawn failed: port 58057 held by None
               (not a verifiable llama-server) — refusing a blind spawn"

while netstat showed a healthy llama-server LISTENING on that port and nvidia-smi
showed 27 GB resident. Note "held by NONE" — not "held by a pid that isn't ours".
The lookup returned nothing while the OS would answer plainly.

THE CAUSE. Both halves of the identity check shell out to Unix tools:

    pid_listening_on_port -> Command::new("lsof") ... .ok()?
    command_name          -> Command::new("ps")   ... .ok()?

On Windows the spawn itself fails, `.ok()?` yields None, and both return None for
EVERY input, always. So `is_llama_server` is false for every pid and
`pid_listening_on_port` is None for every port: the entire reap/verify path is
inert on Windows and the core cannot identify even its own child.

The doctrine wrapped around it is correct — None means unverifiable, unverifiable
means never kill — and it is the right call for a machine that cannot see. The
defect is that Windows sees fine and nobody wrote the arm. The existing doc
comment said "(macOS + Linux)" and "None = nothing listening, or lsof
unavailable": the two cases were KNOWN to be conflated, and Windows fell into the
second permanently.

CONSEQUENCE: after any unclean teardown the port is held by the core's own orphan,
which the core cannot name, so it refuses to spawn — forever. Not slow, wedged.
Observed across four spawn/refuse cycles here (pids 3056, 16436, 3852, 15464).
Invisible on mac/linux, where lsof answers and the orphan is reaped.

THE FIX: netstat -ano for the listening pid, tasklist /FI /NH /FO CSV for the
image name, with the PARSING split into pure functions so the logic is testable
off-Windows (the shell-out is not). Three regression tests over verbatim output
captured from the wedged box:

  - the right pid for the right port
  - port matching is a SUFFIX match on the local address, not a substring: ":8057"
    must not match ":58057", because that would hand a reap decision the wrong pid
    — a blind kill of an unrelated process, the exact thing this gate exists to
    prevent
  - tasklist's no-match line is refused: it prints "INFO: No tasks are running
    which match the specified criteria." on stdout AND exits 0, so success does
    not imply found; parsing that prose as an image name would make
    is_llama_server TRUE for a dead pid and authorise a kill

VALIDATED, on the postcondition rather than the build: serving on this box went
from indefinitely wedged to `ready=true, lanes=3, degraded=none` within 25 s of
the rebuilt core coming up, 28.6 GB resident.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(hygiene): justify the three probe-field defaults — CI caught the unwrap count rising by one

`source_hygiene::unwrap_justification::the_unjustified_unwrap_count_never_rises`
failed on CI at 2268 against a baseline of 2267. Mine, from the probe fields added
in this branch.

The rule is right and worth honouring rather than silencing: an Option means
UNKNOWN, and a default turns unknown into a quantity a reader will treat as
measured. All three of these happen to be cases where the default IS the true
reading, and saying why is the point:

  - `model_ms = ...unwrap_or(0)` — no metrics means no model call happened this
    cycle, so 0ms of model time is correct, not a stand-in. `had_metrics` rides
    alongside it so nobody reads a zero as a suspiciously fast call.
  - `around_model_ms ... saturating_sub(...unwrap_or(0))` — same zero; with no
    model call the entire cycle IS around-model, which is what the field should
    then say.
  - `slowest_faculty ... unwrap_or_else(|| ("none", 0))` — an empty timings vec
    means no faculty ran. "none"/0 is an honest reading of a tick that measured
    nothing, and `faculties = 0` next to it makes that unambiguous rather than
    presenting some faculty as instant.

Note the same test also enforces that a token comment does not count, which is
the right shape: the justification has to state the reasoning, not merely occupy
the line.

Local `cargo test -p continuum-core --lib source_hygiene::unwrap_justification`:
2 passed.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Sep 18, 2026
…t — it expired mid-swap on the Intel tier and condemned a healthy deploy (#4190)

Measured 2026-09-18 on the Intel tier: `deploy.stranded` fired at 08:56:39Z for a
deploy that came up healthy 25 minutes later.

    07:50:26Z  continuum reboot starts, writes the deploy claim
    08:51:40Z  deploy.track.request_written  tip=ae5e5a3c8...
    08:56:39Z  deploy.stranded  elapsed_ms=300004     <- claim age 66.2 min
    ~09:00Z    "warm artifact validated in 4197s"     <- build age 70.0 min
    ~09:2xZ    ae5e5a3 answering, healthy

Two defects in one chain.

1. CLAIM_MAX_AGE_MS was sized against the machines that reported first. Its own doc
   comment said so: "must comfortably exceed a COLD full build ... measured 292s and
   530s here, 772s on BIGMAMA (#422). One hour is far above any of those." This tier's
   WARM build is 4,197s — 5.4x the largest of them. So the claim expired at minute 60
   of a 70-minute build: the last ten minutes, which is exactly the swap window the
   claim exists to protect. From there `blocks()` read false and #422's guard against
   an implicit autostart minting a core from the pre-swap image was silently off. An
   expired advisory guard is indistinguishable from no guard.

   The ceiling now sizes against the risk it actually covers. A live claim is already
   gated on `owner_alive(pid)`; age only covers "the reboot was kill -9'd and the pid
   was reused". Four hours is ~3.4x the slowest build on record and still bounded —
   worst case remains a time-limited degradation of an advisory guard, never a wedge.
   SLOWEST_OBSERVED_BUILD_MS is named so that invariant is a test rather than a
   sentence in a doc comment the next slow tier quietly falsifies.

2. reconcile_request (mine, #4187) had no grace. It called Stranded on the first tick
   that could not see a build — 300004ms is exactly one tick after the request. The
   claim does not cover a deploy's whole life: stop, handoff, the new core's startup
   compile and boot all run with NO claim and the OLD sha, which is bit-for-bit what a
   dead reboot leaves behind. Only duration separates them, by orders of magnitude.
   STRANDED_GRACE_MS = 20 min, the same shape and reasoning as
   COLD_BOOT_BELOW_FLOOR_GRACE in the serving planner.

   Not cosmetic: "stranded" is the signal to relaunch, and a second build races the
   first on the shared CARGO_TARGET_DIR.

Receipt:
    cargo test -p continuum-core --lib --features metal,accelerate -j 2 \
      -- deploy_claim deploy_tracker
    15 passed; 0 failed; 8293 filtered out; REAL_EXIT=0
    lib test: 75 warnings, none naming deploy_claim or deploy_tracker

The existing `a_request_that_did_not_take_is_stranded_not_in_flight` asserted Stranded
at 60s with no claim; that assertion WAS the defect, so it now asserts past the grace.
Mutation proof is by construction, not a second 30-minute build: against the pre-fix
constants both new asserts are arithmetically false (3,600,000 >= 4,197,000 fails;
3,600,000 >= 8,394,000 fails) and pre-fix reconcile_request returns Stranded at
300_004 where the test demands InFlight.

The rule worth carrying: a timeout sized against the fastest machines that have
reported is not a bound, it is a race the slow tier loses every time — silently.

Card: a476ea14-0199-421f-87a5-07ef9cdecd50


Claude-Session: https://claude.ai/code/session_01FRQWzgSfo79JtnwZywHKrE

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Sep 19, 2026
…visor's slot, and the consumer writes its own log (#4218)

The 5090's first unattended deploy, measured 2026-09-19 (log captured by
re-running the consumer's exact path): tracker request 03:59Z → consumer
tick 04:14Z → warm build SUCCEEDED (validated in 1,145 s) → the supervisor
handoff REFUSED: "ContinuumCore does not select the requested artifact/socket"
— the task's descriptor binds one artifact path (the service slot) and a warm
build lands in the cargo target dir. Every hand deploy had bridged that with
a copy. PreparedCoreService::stage now does it: old slot files move aside as
.prev.exe (a running exe can be renamed, never overwritten), the built core
AND the CLI beside it copy into the slot (so the slot's CLI follows the core,
#422), the staged sha is re-read and must equal the built one, then prepare()
validates the staged path. Nothing stops the core until the handoff.

And the first failure's reason went nowhere: the scheduled task has no stdout.
The consumer now writes ~/.continuum/logs/deploy-consume.log — its verdicts
and outcomes stamped, and the warm build's own stdout/stderr redirected there
while a consumer runs.

CLI 47, unwrap ratchet green. Composes with Kimi's start-server.sh pass on
4c8a88bb (the CLI-install-without-build clobber at :839 is hers).


Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

Co-authored-by: Claude Opus 5 <[email protected]>
joelteply added a commit that referenced this pull request Sep 19, 2026
…ervisor, core, CLI on PATH — each arm reads, changes only what drifted, says so

Joel, 2026-09-19: "Why wouldn't it be like `uu update`" / "Or install" / "You
want users to remember almost nothing." ONE verb, idempotent: on a bare box it
is an install, on a live node an update, run twice it says nothing changed.

- `Arm { Supervisor, Core, Cli }` in run order (a core is handed only to a
  prepared supervisor; the slot's CLI is fresh only after a stage). Bare
  `install` runs every arm; `--supervisor/--core/--cli` restrict; `--check`
  reads only. Each arm returns an `ArmReport { drift_before, drift_after }`;
  the orchestrator sums them and exits non-zero only when drift REMAINS.
- core arm: running build vs the checkout's HEAD (`same_commit`); drifted →
  `reboot --service` (build, stage into the slot, hand off — the same path
  the unattended consumer takes), then re-read the running sha.
- cli arm (`install_cli.rs`): `~/.local/bin/{continuum,uu}.exe` must be the
  slot's CLI byte-for-byte (SHA-256), and the dir on the USER PATH. Missing /
  Stale / NotOnPath named; write = copy with the installer's 10 s contention
  retry (old image moved aside, never deleted under a running process) and a
  user-PATH prepend, then re-read. Both names carry `.exe` so PowerShell and
  cmd resolve `uu`, not only Git bash (the installer's bare `uu` copy). This
  is the stale-CLI seam (#422): the 07:32 CLI on this box could not build for
  a day because nothing refreshed it.

Measured on the 5090, bare `install --check`: 7 ways drifted across 3 arms —
supervisor Interactive + LogonTrigger ×2 tasks, core 40b4126 vs HEAD, CLI
Stale("continuum") + Missing("uu") — the machine's true state in one read.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
joelteply added a commit that referenced this pull request Sep 19, 2026
…ine (supervisor, core, CLI on PATH); each arm reads, changes only what drifted, says so (#4232)

* feat(cli): `continuum install --supervisor` — the OS supervisor is converged from the binary, one elevation, verified by re-reading the scheduler

Joel, 2026-09-18: "What's the repeatable process or inside an install? … Are
all concerns wired into the same location? Same strategy. Do NOT hand jack."
and "it needs to be in our own binary here."

The contract (card 7b56a84b, audit §5 D): the core is a service, not a
session child. On Windows: ContinuumCore as an S4U principal at boot, and
its sibling ContinuumDeploy (the consumer) every 10 min, same principal.
The 5090 ran Interactive + AtLogOn and went dark 2 h 42 m when the logon
session tore down.

`supervisor_install.rs` (new module under bin/continuum/):
- pure, tested: the Task Scheduler XML each task is registered from (S4U,
  LeastPrivilege, BootTrigger / TimeTrigger PT10M, RestartOnFailure PT1M×999,
  PT0S limit), the drift verdict (LogonType / Triggers / Action / Principal /
  Disabled / CallerAccess / Absent), the SDDL read for the caller's RX (deny
  fails closed), CLIXML stderr → its message line, the option pairing.
- the boundary: `--check` reads both tasks and exits non-zero on drift;
  without it, the plan (the registered release's own descriptor — the slot's
  single source, never re-chosen here) goes to ONE `Start-Process -Verb RunAs`
  of this same binary with `--elevated --plan`, which runs `schtasks /Create
  /XML` + `icacls … /grant *SID:RX` and leaves a receipt file; the parent
  reads the receipt, then re-reads the scheduler and demands zero drift.
  A refused consent says so and changes nothing.
- macOS / Linux arms name their owners (Fable / Cormac), never "unsupported".

`deploy-consume --install/--uninstall` are gone: the consumer's task has one
registrar now (the unelevated schtasks path made an Interactive task that
died with the session, measured 2026-09-19). `PreparedCoreService::powershell`
delegates to the module's one helper.

Measured on the 5090 through the product's path: `--check` reports
`ContinuumCore: LogonType("Interactive"), Triggers(["MSFT_TaskLogonTrigger"])`
and `ContinuumDeploy: LogonType("Interactive"), Action` — the outage's cause,
as data. The write half awaits the operator's consent.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(install): the elevated child registers only the plan the consent was given for — its SHA-256 rides the RunAs argv; a read of the ACL mask as bits

Fable's condition on #4232: the plan in %TEMP% is rewritable by any
same-user process between the parent's write and the consent, and the
elevated child registered whatever it read — a boot task as ANY account,
through our own registrar. The parent now hashes the bytes it WROTE and
passes `--plan-sha` in the RunAs argument list (argv cannot be altered once
spawned); the child re-derives the digest from what it reads and refuses
before touching schtasks. `InstallOptions` pairs `--plan-sha` with `--plan`;
`read_bound_plan` is the one gate, pinned: a rewritten plan (another
principal) is refused with the reason.

Cormac's note: a hex ACE mask is read as BITS (RX = 0x1200a9 contained), so
a pre-existing full-control mask (0x1f01ff) no longer reads as drift and
costs an elevation. The non-Windows message names the macOS arm as #4228.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* feat(cli): bare `continuum install` converges the whole machine — supervisor, core, CLI on PATH — each arm reads, changes only what drifted, says so

Joel, 2026-09-19: "Why wouldn't it be like `uu update`" / "Or install" / "You
want users to remember almost nothing." ONE verb, idempotent: on a bare box it
is an install, on a live node an update, run twice it says nothing changed.

- `Arm { Supervisor, Core, Cli }` in run order (a core is handed only to a
  prepared supervisor; the slot's CLI is fresh only after a stage). Bare
  `install` runs every arm; `--supervisor/--core/--cli` restrict; `--check`
  reads only. Each arm returns an `ArmReport { drift_before, drift_after }`;
  the orchestrator sums them and exits non-zero only when drift REMAINS.
- core arm: running build vs the checkout's HEAD (`same_commit`); drifted →
  `reboot --service` (build, stage into the slot, hand off — the same path
  the unattended consumer takes), then re-read the running sha.
- cli arm (`install_cli.rs`): `~/.local/bin/{continuum,uu}.exe` must be the
  slot's CLI byte-for-byte (SHA-256), and the dir on the USER PATH. Missing /
  Stale / NotOnPath named; write = copy with the installer's 10 s contention
  retry (old image moved aside, never deleted under a running process) and a
  user-PATH prepend, then re-read. Both names carry `.exe` so PowerShell and
  cmd resolve `uu`, not only Git bash (the installer's bare `uu` copy). This
  is the stale-CLI seam (#422): the 07:32 CLI on this box could not build for
  a day because nothing refreshed it.

Measured on the 5090, bare `install --check`: 7 ways drifted across 3 arms —
supervisor Interactive + LogonTrigger ×2 tasks, core 40b4126 vs HEAD, CLI
Stale("continuum") + Missing("uu") — the machine's true state in one read.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

* fix(install): the core arm's unwrap_or carries its same-line reason (the unwrap ratchet)

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc

---------

Co-authored-by: Claude Opus 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants