Skip to content

Gap analysis: 34 open issues (down from 54) - #438

Merged
joelteply merged 1 commit into
mainfrom
chore/final-gap-sync
Mar 25, 2026
Merged

joelteply merged 1 commit into
mainfrom
chore/final-gap-sync

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Full sync. Phase 0: 5/6 done. Phase 1: 11/14 done. Phase 3: 9/14 done. Phase 4: 4/5 done.

Copilot AI review requested due to automatic review settings March 25, 2026 15:17
@joelteply
joelteply merged commit 9c0fc71 into main Mar 25, 2026
@joelteply
joelteply deleted the chore/final-gap-sync branch March 25, 2026 15:17

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

Updates the Alpha gap analysis “issue map” to reflect the latest sync of tracked GitHub issues and completion status, keeping the planning doc aligned with current project progress.

Changes:

  • Updated per-phase issue lists to mark additional issues as completed (strikethrough) and added newly tracked issues.
  • Refreshed per-phase counts to include “done” totals (and noted one Phase 0 blocker).
  • Updated the overall totals from 72 tracked / 45 open / 27 closed to 75 tracked / 34 open / 41 closed.

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

joelteply added a commit that referenced this pull request Aug 15, 2026
… streak (round-killer L10, #438 live) (#2320)

Live 2026-08-15 14:13, first post-L9 dispatch: two citizens in the bench
room spoke pure template-token salad ('assistantassistantassistant...',
'杀了assistantassistant') as durable messages — their responses stamped
model=continuum-ai/qwen2.5-0.5b-instruct-GGUF while the plan's base model
was Qwen3.8-27B. Chain, from source: a transiently bogus usable_bytes
sample (the incumbent's own load depresses free memory) made serving_plan's
nothing-fits arm name the SMALLEST candidate; the reconcile then swapped
the READY 27B lane on that single tick. A 9,344-token benchmark prompt
into a 0.5B produces exactly this salad, and it lands in the room as
durable speech every healthy citizen perceives as peer conversation —
the poison Joel predicted: 'something in their prompt brought them to
that confusion, a structural failure outside their personal mind.'

The asymmetry was the bug: growing a WINDOW (mild) already requires
REHOME_MIN_GAIN_PCT sustained for REHOME_SUSTAINED_TICKS plus a cooldown
(BigMama's two-guard spec), while swapping the BASE MODEL — a full
teardown that re-homes every persona to different weights — actuated
immediately.

Fix: model_change_gate, a pure function the reconcile consults before any
ready-lane model swap. The plan must name the SAME different model for
REHOME_SUSTAINED_TICKS consecutive ticks (one hysteresis constant, not
two, per this file's own doctrine); a target change restarts the count so
a flapping plan never accumulates; plan==live clears pending; boot and
wedge-recovery (no ready incumbent) commit immediately — recovery never
waits. Genome page-ins (same model, adapter change) are untouched.

Table test covers: one-tick bogus fallback (deferred, then cleared),
sustained disagreement (commits on Nth tick), flapping targets (never
commits), and the no-ready-incumbent recovery rows.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 17, 2026
…e was floored at bare survival (#438-class)

Glass-boxed live on the M5 2026-08-17: a 27B served at usable_gb=5 with
served_window=2048 against a MEASURED demand_window=63817. Every SWE act ran
against a context that could not hold the task statement — the "machine is
allowing sludge" Joel reported, and the arithmetic behind ~4 acts/hour.

The defect was an inconsistency INTERNAL to plan_serving. Two floors, two
different standards:

  lane COUNT  -> BOOTSTRAP_WORKING_SET (16384, "one full turn")
  model CHOICE -> MIN_SERVE_CTX        (2048, bare survival)

The lane loop already refuses to add a slot that cannot hold a full turn
(1 lane @ 30k beats 2 lanes @ 2k), then falls back to .unwrap_or(1) and calls
it "honest starvation, surfaced downstream" — while the MODEL is never
reconsidered. Shedding a lane and shedding capability are the same move for
the same reason; only the first was implemented. So `fits_one_lane` crowned
the most capable model that cleared a TRIVIAL bar and let the window collapse
to it. A model that fits only at 2048 is not more capable on this host — it is
unusable on this host.

Viability is now tested at the same "one full turn" standard the lane floor
uses, with a documented degrade: if NO candidate clears it, fall back to the
old MIN_SERVE_CTX bar so a genuinely tiny host still serves something rather
than nothing (honest starvation is then real, not a selection artifact).
Deliberately the STABLE bootstrap constant, not the moving measured p95 —
coupling model CHOICE to a jittering demand signal is the 718-replan flap that
wedged three benchmark runs.

This ran on EVERY node, so a grid of peers would each independently crown its
biggest technically-holdable model and starve its own window, with no single
node's numbers looking anomalous.

LIVE, deploy-verified: 27B/2048/bound_by=host-fit -> 14B/16384/bound_by=demand,
lanes 1 -> 4. bound_by flipping to `demand` is the signal: the plan now meets
the working set instead of being cut by the host.

Tests: model_choice_sheds_capability_rather_than_starve_the_window pins all
three arms — the starve case, a NEGATIVE CONTROL that a roomy host still picks
the 27B (this fix must not silently downgrade capable boxes), and the degrade
fallback. 27 serving_plan / 139 serving / 178 capacity green.

Also repaired stable_keeps_incumbent_when_upgrade_lacks_headroom, whose fixture
had encoded the old bar: with pair() at 10GB, big was "viable" only on 184MB of
KV, so "fresh would pick big" meant a 2048-token 9GB model. Given a local
fixture where big genuinely clears a full turn (19.5 <= 20) yet still fails the
0.9x switch-up headroom bar, so the test asserts what it always meant to.

KNOWN RESIDUAL: selection tests weights + kv_at(ctx) against raw usable_bytes
while window_for sizes against `effective` (minus co-consumer headroom) and
subtracts compute buffers, so the two floors are near-consistent, not identical
(observed 16025 vs 16384). The 8x collapse is gone; unifying the last 2% is a
follow-up.

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 17, 2026
…nch acts land in their room (#371 step 1) (#2335)

* fix(benchmark): a dispatched run's acts happen IN ITS ROOM — agent/solve was hardcoded roomless (#329/#243)

`agent/solve` opened with `let room = Uuid::nil();` — a literal, no param behind it. Every
benchmark act therefore executed with no room, and `apply_act`'s receipt radiation skips a nil
room BY DESIGN (radiating nil-room acts once stole academy's single-room chat projection onto a
phantom, live-proven 2026-08-12). Its own comment names the fix as pending: "Skip until solves
thread their bench room (#329's per-run rooms make every solve act a room act)". #329(a) shipped
the per-run room weeks ago; nothing ever threaded it.

Consequence, and it is the failure BENCHMARKS-ARE-ADAPTERS-NOT-A-RUNNER.md exists to name: a
citizen can burn a full act budget, write a patch and take a verdict while the room she was
dispatched into shows NOTHING. Not a rendering gap — the events are never published. The
acceptance test in that doc ("can a citizen standing in the room perceive the run's state through
the same ViewState pipe the human's screen uses?") answered NO, and answering it needed a file
read, which is the doc's own definition of disconnected.

  * `AgentSolveParams.room: Option<Uuid>` — the activity the run belongs to.
  * `benchmark/dispatch` passes the room it just spawned. Its acts now radiate `persona:act`
    into it, so the work renders as collapsed receipts in the run room's transcript (#243)
    and reaches citizen perception through the same projection the screen reads.
  * `work/claim`'s path passes `None` and SAYS SO in a comment: the claim verb carries no
    activity, so a claim-fired solve is still invisible. That is exactly #425's subject; the
    two paths now differ precisely at the gap #425 exists to close, instead of both being
    silently roomless.
  * `WorkspaceCycle::actions_taken()` — the seam a long-running drive needs to report liveness
    WHILE it runs. `drive_to_settle` returns its act count only at settlement and a SWE attempt
    legitimately runs hours, so `benchmark/runs` reads `acts` from a ledger written once per
    attempt. Measured 2026-08-16: two dispatched solves read `acts=0, stalled=false` for ten
    straight minutes while both citizens were demonstrably mid-turn (captures written 12s
    earlier). The projection whose stated purpose is "silence must never be ambiguous with
    progress" cannot currently tell them apart — its 20-min stall window assumes artifact
    activity tracks act cadence, and no per-act artifact write exists. Accessor lands here;
    the heartbeat that consumes it is the next slice.

Deployed and SHA-verified before commit. NOT yet live-proven end to end: no dispatched run has
reached act #1 since — the two sympy runs both settled in ~150ms with zero acts and were
correctly classified INFRA VOID by #384, which is a separate round-killer this change does not
touch.

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

* fix(cognition): an EMPTY completion is not a chosen silence — the Err arm's missing twin (#181/#390)

The `Err` arm at llm_deliberation_faculty.rs:1844 refuses to let a FAILED model collapse into a
serene `Pass`, and its own comment cites [[fallbacks-are-illegal-fail-loud]]. But a lane can also
answer `Ok` with NOTHING, and that walked straight past the guard and settled as an ordinary
non-Act. Same failure the Err arm exists to prevent, one branch over.

MEASURED, not inferred. Direct probe against the live lane (70-token prompt, so no context
pressure of any kind):

    finish_reason = 'length'   completion_tokens = 16   content = ''

Sixteen tokens generated, empty content. Qwen3.8 under `--jinja` opens `<think>`; an unclosed
block leaves `extract_reasoning` branch (3) — which is CORRECT — with empty text and the whole
tail as reasoning. Separately, Solenne's capture on the turn her benchmark run died:

    finish_reason = 'stop'   usage = {in:0, out:0}   responseTimeMs = 28   text = ''

SCOPE, measured across every capture on disk: 47 of 862 responses (5.5%) are empty-text, spread
over ~19 citizens. NOT benchmark-specific. And the all-empty column is exactly the citizens whose
"I've noticed my recent messages have been repetitive… I'll remain silent" turns have been the
standing round-killer — fe4dac17 6/6, Asha (90e758b2) 4/4, e5f4141d 3/3, a20b3ada 2/2. On the
turns I can see, nothing came back, and the substrate wrote it down as her choice. (Per-persona
samples are small; the ratios are not stable rates. The shape is what matters.)

COST: agent/solve reads it as "she chose not to act" → acts=0, empty patch → the run voids as an
INFRA VOID after three attempts (the two sympy runs, 2026-08-16). A live citizen's turn reads as
silence, indistinguishable from withdrawal.

FIX: fault, exactly like the Err arm — the settle step surfaces it LOUD instead of fabricating a
no-op, and `delib.empty_completion` puts it on the probe stream. Scoped so a native tool turn,
which legitimately carries empty content, is untouched: fires only on empty text AND not ToolUse
AND no tool_calls, i.e. only when the turn yields nothing to act or speak with. The receipt names
WHICH shape it was — thought-but-committed-nothing (reasoning chars) vs the lane returned void.

WHAT THIS DOES NOT DO: it does not stop the empty completions. It stops them being laundered as
cognition. The generation-side fix (reasoning budget / think-block closure) is #181 and is next.

Deployed + SHA-verified before commit. LIVE PROOF NOT YET IN HAND: zero faults across 2,589 probe
rows in the first window after deploy — consistent with no citizen having hit an empty completion
yet post-reboot, NOT with the guard being confirmed. A watcher is running; the owed evidence is
one `delib.empty_completion` row from a real turn.

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

* docs(architecture): the round lifecycle as a recipe-owned state machine (#371 design)

Joel 2026-08-16, after a full session of a driver getting lost: "It's way too hard to rig up.
Clearly." This writes the design down so the next agent inherits a paved road instead of tire
tracks.

THE DEFECT, stated exactly: a benchmark round is not a thing in the system, it is a RITUAL an
agent performs. The agent picks when to dispatch, picks the watch window, hand-queries probes to
learn what is happening, and when the session ends the process ends with it.

Every failure this session is downstream of that ONE fact, and they all have the same shape — the
question has no owner, so the driver guesses from an absence:

  is serving ready?     nothing owns readiness      → dispatched and hoped
  has it started?       nothing announces started   → read acts=0, called it stalled
  is this run alive?    liveness = a file mtime     → flagged a healthy run quiet
  is the round done?    nothing announces done      → never knew
  did my fix work?      no green/vacuous distinction → reported a vacuous green

Five instances of [[an-absence-is-an-unfinished-measurement]] in one session, by a driver that had
that lesson in its own guardrails. Not a knowledge gap — a missing owner.

THE SHAPE: staging → ready → working → grading → done, every transition an event from the
component that KNOWS (env builder, supervisor, card store, round entity) — never a timeout, never
a poll, never an agent's judgement. Every stage a ViewState on the one pipe humans and citizens
already read. Recipe is data, so the process is identical every round on every machine.

THREE LAWS: transitions announced by the knower; liveness is a pulse never a terminal artifact
(today's projection cannot distinguish silence from progress, which is its stated purpose);
an absence is never a state.

SUBSUMES #329(b) no-END, #442 readiness gate, #374 pulse, #425 in-room work, and the unbuilt RULES
half of [[recipe-is-content-type-plus-rules]].

Carries the acceptance test from BENCHMARKS-ARE-ADAPTERS-NOT-A-RUNNER.md plus one earned tonight:
can a fresh driver answer ready/started/stuck/done using ONLY queries — zero log reads, zero probe
archaeology, zero inference from an absence?

Build order is smallest-true-cause first; step 1 (pulse the run) consumes the
WorkspaceCycle::actions_taken seam c9ba5f9 already landed.

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

* feat(benchmark): the run PULSES while it runs — liveness stops being a terminal artifact (#371 law 2, #374)

First build step of ROUND-LIFECYCLE-AS-RECIPE-OWNED-STATE-MACHINE.md.

THE DEFECT: the run ledger was written ONCE per attempt, at settlement. For the entire attempt —
legitimately HOURS on a full SWE budget — `benchmark/runs` read `acts: 0` and a `last_activity`
frozen at run start. RUN_STALL_WINDOW_SECS is 20 minutes. So a HEALTHY first attempt is guaranteed
to read `quiet`/stalled, every single time, and the projection whose own doc comment says its
purpose is "silence must never be ambiguous with progress" was STRUCTURALLY unable to tell them
apart. Its stall window assumes artifact activity tracks act cadence (~4-6 min); no per-act
artifact write has ever existed.

MEASURED 2026-08-16: two dispatched solves read `acts=0, stalled=false` for ten straight minutes
while the driver watching them could not distinguish working from wedged — which is precisely how
a vacuous "no faults observed" gets reported as a green.

THE FIX: `select!` over the drive future and a 60s interval. No spawn, so the cycle stays BORROWED
— no 'static bound, no Arc juggling, no parallel allocator, and the pulse cannot outlive the work
it reports on. Each tick reads `WorkspaceCycle::actions_taken()` (the seam c9ba5f9 landed) — a
wait-free atomic load on the persona's own monotonic counter — and rewrites the running marker,
which moves BOTH `acts` and the mtime `last_activity_ms` folds from.

Cadence is well under the stall window (a live run can never age into `quiet`) and far above act
cadence (one small JSON write per tick, nothing else). Every field derives exactly as the detached
wrapper's `state: running` marker derives them, so a pulse can never contradict the marker it
refreshes. `None` run_id → no ledger → no pulse, correct: nothing polls a run that returns inline.

WHY THE COUNTER AND NOT A SEPARATE TALLY: it is the same monotonic counter perception renders to
her, so the board and her own proprioception cannot disagree — and it is the counter whose
capacity-bounded-ring sibling caused the retracted "they never act" premises on #390/#211.

Deployed + SHA-verified. LIVE PROOF OWED: a dispatched run showing acts CLIMB mid-attempt. Until
that row exists this is compiled-and-deployed, not confirmed.

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

* fix(swe): astropy env builds — a 1990s vendored zlib stubs out fdopen on every modern Apple SDK (#383)

THE FOURTH HEAD of #383, and the reason two dispatched rounds died at env-build TONIGHT even
though #2329's jinja2 + build-requires fixes are both merged and in this tree. Not pyerfa, not
Cython, not Python 3.11 — I guessed all three before reading the error.

astropy vendors cfitsio, which vendors an ancient zlib. `cextern/cfitsio/zlib/zutil.h:140`:

    #if defined(MACOS) || defined(TARGET_OS_MAC)
    #  define OS_CODE  7
    #    ifndef fdopen
    #      define fdopen(fd,mode) NULL /* No fdopen() */

`TARGET_OS_MAC` means "some Apple platform" on every modern SDK — it does NOT mean "classic Mac
OS", which is what this zlib was written to test. So the branch fires, `fdopen` is macro-replaced
by `NULL`, and the SYSTEM header's own declaration

    FILE *fdopen(int, const char *)      →      FILE *NULL(int, const char *)

becomes `error: expected identifier or '('` inside `<stdio.h>`, thousands of lines from anything
astropy wrote. (The adjacent `'OS_CODE' macro redefined` warning is the same branch firing.)

FIX: the guard is `#ifndef fdopen`, so pre-defining it is the entire repair. `-Dfdopen=fdopen`
makes the guard FALSE — the NULL stub is never emitted — and the macro is the identity, so every
real call still compiles to `fdopen`. No source patched, nothing stubbed, nothing renamed, and a
repo that doesn't vendor this zlib never notices the flag.

POSITIVE + NEGATIVE CONTROL against the real staged checkout, both run before committing:

    cc -c -I<checkout>/cextern/cfitsio/zlib  →  error: expected identifier or '('
                                                error: expected ')'
    cc -c -Dfdopen=fdopen -I<same>           →  clean, exit 0

Placed in ERA_CFLAGS beside its three siblings rather than a per-repo table, because it is not an
astropy fact — it is an ERA fact (old vendored C vs a modern SDK), same shape as the others: the
compiler is HARNESS, the C is SUBJECT, and the subject built fine on the compilers of its day.

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

* fix(governor): shed CAPABILITY, never starve the window — model choice was floored at bare survival (#438-class)

Glass-boxed live on the M5 2026-08-17: a 27B served at usable_gb=5 with
served_window=2048 against a MEASURED demand_window=63817. Every SWE act ran
against a context that could not hold the task statement — the "machine is
allowing sludge" Joel reported, and the arithmetic behind ~4 acts/hour.

The defect was an inconsistency INTERNAL to plan_serving. Two floors, two
different standards:

  lane COUNT  -> BOOTSTRAP_WORKING_SET (16384, "one full turn")
  model CHOICE -> MIN_SERVE_CTX        (2048, bare survival)

The lane loop already refuses to add a slot that cannot hold a full turn
(1 lane @ 30k beats 2 lanes @ 2k), then falls back to .unwrap_or(1) and calls
it "honest starvation, surfaced downstream" — while the MODEL is never
reconsidered. Shedding a lane and shedding capability are the same move for
the same reason; only the first was implemented. So `fits_one_lane` crowned
the most capable model that cleared a TRIVIAL bar and let the window collapse
to it. A model that fits only at 2048 is not more capable on this host — it is
unusable on this host.

Viability is now tested at the same "one full turn" standard the lane floor
uses, with a documented degrade: if NO candidate clears it, fall back to the
old MIN_SERVE_CTX bar so a genuinely tiny host still serves something rather
than nothing (honest starvation is then real, not a selection artifact).
Deliberately the STABLE bootstrap constant, not the moving measured p95 —
coupling model CHOICE to a jittering demand signal is the 718-replan flap that
wedged three benchmark runs.

This ran on EVERY node, so a grid of peers would each independently crown its
biggest technically-holdable model and starve its own window, with no single
node's numbers looking anomalous.

LIVE, deploy-verified: 27B/2048/bound_by=host-fit -> 14B/16384/bound_by=demand,
lanes 1 -> 4. bound_by flipping to `demand` is the signal: the plan now meets
the working set instead of being cut by the host.

Tests: model_choice_sheds_capability_rather_than_starve_the_window pins all
three arms — the starve case, a NEGATIVE CONTROL that a roomy host still picks
the 27B (this fix must not silently downgrade capable boxes), and the degrade
fallback. 27 serving_plan / 139 serving / 178 capacity green.

Also repaired stable_keeps_incumbent_when_upgrade_lacks_headroom, whose fixture
had encoded the old bar: with pair() at 10GB, big was "viable" only on 184MB of
KV, so "fresh would pick big" meant a 2048-token 9GB model. Given a local
fixture where big genuinely clears a full turn (19.5 <= 20) yet still fails the
0.9x switch-up headroom bar, so the test asserts what it always meant to.

KNOWN RESIDUAL: selection tests weights + kv_at(ctx) against raw usable_bytes
while window_for sizes against `effective` (minus co-consumer headroom) and
subtracts compute buffers, so the two floors are near-consistent, not identical
(observed 16025 vs 16384). The 8x collapse is gone; unifying the last 2% is a
follow-up.

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

* docs(architecture): context is a capability axis — the governor learns the window but not the CHOICE (Joel 8/17)

Joel: "Context windows are as important as model size. It seems 16-20k is bare
minimum for decent activities. Ideally the governor learns."

Captures the design rather than rushing it into plan_serving, which is the most
flap-prone function in the tree (718 replans, three wedged benchmark runs).

THE CLAIM: delivered capability is f(params, served_window) and the planner
models only params. capability_rank is a scalar keyed to model identity, so a
27B is "more capable" than a 14B even when the host can serve the 27B only 2048
tokens. That shipped as the live defect fixed in 03c890b.

WHAT IS ALREADY RIGHT, and must not be rebuilt: working_set.rs is a good
learning loop whose hard problem is solved. It records DEMAND not USAGE — the
counterfactual "what this turn would have used with no budget", including
grounding contributions assembly dropped — explicitly avoiding the
thermometer-inside-the-thermostat trap where a p95 of what-was-sent re-derives
its own clamp forever. Peak not average. Persisted. Passed as a parameter. The
live demand_window=63817 IS that module working correctly.

THE ACTUAL GAP: one learned signal, three decisions, two deaf. The window is
learned; lane count and model choice both use hardcoded BOOTSTRAP_WORKING_SET —
a constant whose own doc says it "was never meant to survive", and which sits at
the BOTTOM of Joel's 16-20k band, identically for a chat turn and a SWE turn.

WHY THE CONSTANT IS THERE AND WHY IT DOESN'T FORBID LEARNING: the anti-flap
argument is against driving a structural, expensive-to-change decision from a
fast jittering signal. It is not against learning. Two time constants: fast
measured demand sizes the window (cheap, built, correct); a slow hysteretic
learned floor drives model choice and lane count (expensive, so margin band +
dwell time + hard clamp). Flapping is a property of the update rule, not of
learning.

PROPOSED, NOT BUILT: (1) capability_rank goes 2-D — rank by delivered
capability, since the current most-capable-that-clears-a-full-turn gate is a
correct approximation but cannot express "14B at 60k beats 27B at 20k";
(2) the floor becomes learned + slow, with BOOTSTRAP_WORKING_SET surviving as
the floor OF the floor, not the value; (3) the floor becomes per-ACTIVITY —
recipes are already data (#433) and "recipe = content-type + RULES" makes the
minimum useful window recipe-owned.

Includes acceptance tests (incl. an anti-flap test pinned as a test, not
asserted in prose) and the de-hardcode smell: a new constant beside
BOOTSTRAP_WORKING_SET is a third way to express a floor — the shape the guard
already caught once as FLOOR_TOKENS (#411).

BLOCKING OBSERVATION recorded for whoever picks this up: delib.generate emits
ZERO probe rows, so per-generation latency and tok/s are unreadable and every
throughput question here needs 20-minute black-box sampling. An unmeasurable
governor cannot be a learning one (#441).

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

* fix(cognition): my empty-completion guard was standing in front of the #181 recovery — reasoning-bearing empties are not faults

REGRESSION I INTRODUCED in ce82f00, caught by its own test suite.

That guard faulted on "empty text + no tool call + not ToolUse" — which is the
EXACT precondition of the two recovery paths immediately below it:

  persona.act.reasoning_lift — a tool call sitting in the reasoning tail gets
    lifted out and EXECUTED (json_in_prompt_tools::parse_tool_calls over the
    reasoning channel).
  persona.act.think_only    — #181's teacher sentinel: she spent the whole
    generation inside <think>, so route the #159 reported-never-executed
    mechanism and let drive_to_settle hand her another generation that starts
    from her own conclusions (the reasoning is already in working memory).

Faulting first made BOTH unreachable. Measured live 2026-08-17: 40
delib.empty_completion faults against 87 persona.turn.start while three SWE
runs sat at the SAME act count for 1,357 seconds. Every one of those turns had
15k+ chars of reasoning and finish_reason: length at exactly 4096 output tokens
— i.e. the shape the recovery exists for. The machinery was already built and
correct; I put a dead end in front of it.

FIX: fault ONLY when nothing is left to recover — the lane returned genuine
void (no text, no reasoning, no call), or she has no tools for the sentinel to
teach through. A reasoning-bearing empty falls through to the lift/think-only
owners. The guard's purpose is preserved: an empty is still never read as
chosen silence, it is just routed to the component that can act on it.

Restores 2 tests that had been RED since ce82f00 and that I shipped without
running — think_only_turn_routes_the_teacher_sentinel_not_empty_speak and
empty_content_with_reasoning_tool_intent_lifts_the_final_call. Both name this
exact contract; both now pass. 62/62 deliberation tests green.

NOT YET LIVE-PROVEN. Deployed and unit-green, but the owed evidence is a real
reasoning_lift or think_only probe row with empties falling — measurement in
flight. Recorded here so the claim is not read as stronger than it is.

ALSO CORRECTED, and NOT shipped: completion_budget_for is window/4, so a 16k
window caps generation at 4096 and a thinking model exhausts it inside <think>.
Raising it to window/2 broke prompt_plus_completion_cap_never_exceeds_the_
served_window (prompt 525 + completion 512 > window 1024) — the prompt sizer
overshoots its own target by ~13 tokens, which /4 had slack to hide. The
OVERSHOOT is the defect, not the fraction; shipping /2 on top of it would push
prompt+completion past n_ctx and 500 every turn with context-shift off. Left
at /4 until the sizer is fixed. Bounding the reasoning channel
(--reasoning-budget) was considered and REJECTED: it lobotomizes the model to
fit a fraction we invented (Joel, 2026-08-17).

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

* docs(architecture): the reserve must YIELD to the incompressible prompt floor — why raising window/4 is a refactor, not a constant

Records the measured blocker on the #181 output starvation so the next attempt
does not repeat either of the two wrong fixes.

MEASURED: completion_budget_for = window/4, so a 16k window caps generation at
4096. A reasoning model spends output on thinking, exhausts the cap inside
<think>, and never reaches the tool call — 7 of 20 captured turns at
finish_reason: length, output_tokens: 4096 exactly, ~15k reasoning chars, empty
text, zero tool calls.

WRONG FIX 1, rejected on Joel's instruction: --reasoning-budget. Capping <think>
shrinks the model to fit a fraction we invented. Their thinking is the product.

WRONG FIX 2, tried and reverted: window/2. Breaks
prompt_plus_completion_cap_never_exceeds_the_served_window, the invariant that
keeps prompt+completion under n_ctx. With context-shift off that is a 500 per
turn — every citizen muted. Trading a 35% empty rate for a 100% mute rate.

THE ACTUAL DEFECT, from reading prompt_view_within: the budget derivation
(window − reserve − tool_tokens) is correct. What breaks is that three sibling
tests pin content that must survive budget pressure unconditionally — held work
card, most recent burst, newest message. Those are INCOMPRESSIBLE FLOORS. Grow
the reserve and the budget drops under the floor; the packer admits the
mandatory content anyway and overshoots (prompt 525 + completion 512 > 1024).
The overshoot is the floor correctly refusing to compress. Holding the reserve
FIXED is the error.

FIX SHAPE: reserve = min(desired_share, window − mandatory_floor). Invariant
then holds at every window, including the synthetic sub-MIN_SERVE_CTX windows
the tests use and production never serves, while the share stays generous at
real 16k+ windows where the floor is hundreds against thousands.

NOT A ONE-LINER, and that is why this is a doc and not a patch: the dependency
is circular (reserve → budget → packing → floor → reserve). The floor must be
computable before the reserve is chosen — hoist the mandatory-section
measurement ahead of budgeting, or two-pass size-then-resize. Sequence recorded:
hoist the floor, make the reserve yield, THEN raise the share, and re-run all
four prompt_shaping tests at both a synthetic small window and a realistic 16k
one. Those four tests are the only thing between a generous reserve and a 500 on
every turn; none of them may be weakened to make the change pass.

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

* feat(bench): ENFORCE the gold gate — an env that cannot score its own gold patch disqualifies itself (#380 keystone)

The spine check RAN and enforced NOTHING. `benchmark/swe-grade --gold` has always
substituted `instance.patch` as the candidate and graded it, so the mechanism
existed. But it returned a bare `resolved: false`, which downstream is
byte-identical to a citizen's capability zero. The `gold` param's own doc states
the requirement — "It MUST resolve — if it does not, the environment is wrong
and no other number from it means anything" — and that sentence was addressed to
a human and enforced by nobody.

WHY THIS IS THE KEYSTONE FOR EVERY NUMBER WE REPORT. Without it a failure has
two indistinguishable causes: the patch was wrong, or the environment cannot
score a correct patch at all. Measured on this box 2026-08-17 (build fc8964b,
deploy-verified): a 2019-era django env carries pytest 8.4.2, and this module's
own notes record era suites importing pytest internals modern pytest deleted
(flask 2.2: `from _pytest.monkeypatch import notset`). So an unknown fraction of
our zeros are harness artifacts tallied as capability — noise with a number
attached. That is why #383's 114/300 and #380's era drift cannot be told apart
from model failure by reading scores.

`swe_bench::gold_gate` is a THIN caller over `grade(.., Some(&instance.patch))`,
deliberately not a parallel scorer: it must exercise the exact clone → apply →
test path a real attempt takes or it proves nothing about that path. A second
implementation agreeing with itself is the classic dead instrument. What it adds
is the enforcement: on a non-resolve it stamps `verdict.error` naming the gate,
the f2p/p2p counts, and the era-dep suspects to check. `error` is contractually
an ABSENCE and "must never be tallied as a failed attempt" (SweVerdict::error),
so the disqualification propagates through every existing consumer with no
further wiring.

The command's gold arm now routes through it, so there is ONE path and every
caller inherits the labelling — not a second spelling of gold grading.

Explicitly NOT conflated: `gate_ok == false` means FAIL_TO_PASS already passed on
the pristine tree (the instance carries no bug here). That is a different fact
from a broken environment and the doc says so.

NOT era-pinning pytest in this commit. That fraction is deliberate and
documented at swe_bench.rs:692-706 ("harness is deliberately MODERN"), with the
breakage it causes documented at :907. Inverting a decision with a stated
rationale is Joel's call; this commit builds the instrument that MEASURES which
envs it breaks, which is the prerequisite either way.

Verified: cargo check clean. Live gold-gate run against a known-gradeable and a
suspect env is the owed proof and is next.

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

* fix(bench): grade django from CANONICAL test ids, not from prose (#383 root cause)

The gold gate (943b8a2) caught django-10914 failing its OWN gold patch:
FAIL_TO_PASS 0/1, PASS_TO_PASS 35/40, reported as "REGRESSION — your changes
BROKE 5 test(s)" while the quoted output showed all five passing `... ok`.

ROOT CAUSE, in `parse_django_report`: it required `" ... "` AND `" ("` on the
SAME line. unittest puts the outcome on the id line ONLY when a test has no
docstring; with one it prints two lines and the `... ok` lands on the SECOND:

    test_skip_if_db_feature (test_utils.tests.SkippingTestCase)
    Testing the django.test.skipIfDBFeature decorator. ... ok

Both lines fell through the `continue`s — the id line has no `" ... "`, the
docstring line has no `" ("` — so every docstringed django test was recorded
NOWHERE, and absent-from-map reads downstream as not-passed. The 5 "broken" were
the 5 docstringed ones. django is 114/300 of Lite, so django scores were never
measuring django, and every django zero on record is retro-actively
uninterpretable.

THE FIX IS NOT A BETTER PARSER. I first extended the state machine to stitch the
two-line form; Joel called it correctly — "fragile, needs cleaner fixes". It is,
because unittest's verbose output is a RENDERING, not a data format: docstrings
can contain " ... " and " (", django ≥4.1 changed the class-path shape, and every
one of those is a way to mis-attribute silently. Mis-attribution here does not
look like a bug; it looks like a citizen who failed.

So django is now graded from CANONICAL ids. `install_django_json_runner` drops a
`DiscoverRunner` subclass into the clone's `tests/` dir; `--testrunner` selects
it; it emits one `CONTINUUM_TEST {"id": ..., "ok": ...}` row per test keyed by
`test.id()` — the id unittest itself uses. No line shapes, no docstring
ambiguity, no version drift. The dataset's `method (module.Class)` spelling is
derived from the canonical `module.Class.method` by deterministic surgery, not
guessed from output.

Skips and expected failures are PASSES, unexpected successes FAILURES — the same
rule as the prose path, now expressed once in `django_outcome` (it was inlined
twice, which is how a `skipped` becomes a pass in one shape and a non-outcome in
the other).

FALLBACKS ARE LOUD, NEVER SILENT: if the runner cannot be installed, or emits
zero rows (django too old for --testrunner, import error, crash before any test),
we fall back to the prose parser AND warn. A silent fallback that scores is
indistinguishable from one that lies.

`parse_django_report` is KEPT as that fallback, with the two-line handling, since
it is now the degraded path rather than the only path.

Verified: cargo check clean. Live gold-gate re-run on django-10914 is the owed
proof and is next — the same instance whose failure produced this diagnosis, so
the fix is falsifiable by the evidence that motivated it.

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

* fix(bench): select django's JSON runner through SETTINGS — runtests.py has no --testrunner (#383)

The canonical-id grader (13fd357) was correct about WHAT to read and wrong about HOW to
ask for it. It passed `--testrunner=continuum_json_runner.JsonRunner` to
`tests/runtests.py`. That flag does not exist in ANY django era — runtests.py reads
`settings.TEST_RUNNER` and only defaults it when unset (verified in-tree at 1.11, 2.2,
3.2, 4.2, 5.2 and main: the same three lines throughout).

An unknown flag there is not ignored. argparse rejects the whole invocation before a
single test runs, so the live gold gate on django-10914 came back in 4.4 seconds with
`PASS_TO_PASS passes 0 of 40 on the PRISTINE tree`. The fix I shipped to stop
mis-attributing django tests made django strictly less gradeable than the prose parser
it replaced.

Fix: install a settings module beside the runner —

    from test_sqlite import *
    TEST_RUNNER = "continuum_json_runner.JsonRunner"

— and pass `--settings=continuum_json_settings` instead of `--settings=test_sqlite`. Both
files are pure additions to the clone; django's own test_sqlite stays untouched and still
supplies every database/hasher setting, so the shim cannot drift from whatever the era's
suite settings happen to be. The invocation now differs from the plain one in exactly one
argument, which is what the new test asserts.

WHAT WORKED, and is worth keeping: the zero-rows fallback. `run_tests` warns and falls
back to `parse_django_report` when the JSON runner emits nothing, and that is the only
reason a broken invocation surfaced as an env fault instead of 40 capability failures.
A silent fallback here would have read as a citizen's zero.

Mechanism proven live in the 2019-era env BEFORE this commit — the settings shim run by
hand emits 30 canonical rows (`CONTINUUM_TEST {"id": "file_uploads.tests.FileUploadTests
.test_base64_upload", "ok": true}`) where the flag emitted zero. Those hand-written files
were then deleted so the owed gold-gate re-run exercises the install path, not my copies.

15/15 swe_bench tests green (metal,accelerate).

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

* fix(bench): django's dataset ids include DOCSTRINGS — the runner must emit its own (#383)

Gold gate on django-10914 after the settings seam: FAIL_TO_PASS 1/1 (was 0/1),
PASS_TO_PASS 38/40 (was 35/40), gate_ok true. The two remaining misses were not tests
and not env — they were SPELLING:

    "An exception is setUp() is reraised after disable() is called."
    "assertRaisesMessage shouldn't interpret RE special chars."

Those are the dataset's own PASS_TO_PASS entries, verified by reading the cached Lite
JSON: 2 of django-10914's 98 p2p ids are docstring prose with no test id in them at all.
The cause is upstream and structural — SWE-bench harvested django ids from unittest's
verbose log, and unittest prints a test's DOCSTRING in place of its id when it has one.
So a canonical id, however correct, can NEVER resolve those rows.

Fix: the runner emits the docstring alongside the id (`test.shortDescription()`, the same
string unittest itself renders), and the parser registers THREE spellings for one outcome
— canonical id, unittest rendering, docstring. Docstrings are not unique, so they are
AND-folded (a docstring shared by a pass and a fail reads as a fail) and never overwrite a
real id. Only the test object knows its own docstring; having the runner report it is what
removes the guess, which is the same reason the canonical id came from `test.id()`.

CORRECTION to what I wrote on 13fd357: I described the old prose parser as
"mis-attributing" docstringed tests. It DROPPED them. For a docstringed test the id line
carries no `... ok` suffix and the docstring line does not match the `name (class)` shape,
so neither line produced an entry. The parser was not confused about which test passed; it
had no row for that test at all. That distinction matters because it is why the docstring
must be emitted as DATA rather than recovered by a better regex.

16/16 swe_bench tests green (metal,accelerate). Live re-run of the gold gate is next and
is the falsifiable claim: p2p 40/40 and resolved=true, or the docstring path is not the
whole remainder.

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

---------

Co-authored-by: Claude Opus 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 19, 2026
…ink 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
joelteply added a commit that referenced this pull request Aug 19, 2026
…eps its evidence (#379 reopened)

Joel's law, stated today: it is ALWAYS plumbing. On a model that codes well, a bad
result means something is wired into it wrong. This is the plumbing, and it is worse
than a bad patch — WE DELETED THE PATCH.

WHAT HAPPENED. Last night a citizen worked sympy-13480, wrote 41,166 bytes, and broke 40
previously-passing tests. `gateOk: true`, so the harness was sound and the failure was
genuinely hers — the first time this pipeline has told us something about capability
rather than about itself. The obvious next question is whether 41 KB on a one-line sympy
bugfix was a surgical edit or a clobbered file. It is unanswerable. Her workspace is clean
at the pristine commit (reset for the next attempt) and no diff was kept anywhere.

WHY. The write existed — and sat behind `if let Some(dir) = inner.capture_dir` with no
else. `capture_dir` is an OPTIONAL caller courtesy. Measured on this box: all 25 patches
live under `benchmarks/swe/captures/run-*`, every one a HAND-LAUNCHED run that named a
folder. Every citizen-dispatched `claim-*` run — which is the entire path the benchmark
actually runs on — kept nothing. Custody worked exactly where we were watching and
nowhere else.

That also means #379 was wrongly marked done. The sha landed and is genuinely useful
(identical-resubmit detection reads it). The PATCH did not, and only the patch answers
"what did she write".

THE FIX, one shape: custody stops being a parameter.

- `run_artifact_dir(run_id, capture_dir)` — one definition of where a run's artifacts
  live. Explicit dir wins (the 25 existing patches stay exactly where every prior receipt
  says they are); absent one it derives from the run's OWN ledger path, the same
  `progress/` root the state file already uses and which exists for every run by
  construction. A run's evidence no longer depends on how it happened to be launched.
- The write FAILS LOUD. `tracing::error!` naming the path and the reason, because the
  workspace is about to be reset and this is the last moment the diff exists. A silent
  drop is precisely how a round of evidence was lost. The neighbouring read-error arm
  already logged a "custody hole" — the missing-dir arm said nothing, which is why nobody
  noticed for a week.
- `benchmark.patch.kept` probe on success (bytes + sha + path), so "did this verdict have
  evidence behind it" is answerable from the stream and not by hunting the filesystem.

Two tests, one of which encodes the exact regression: a run naming no capture_dir still
resolves a dir, and it lands beside the ledger that reports on it — verdict and evidence
never in different worlds. The second pins that an explicit dir still wins.

NOT FIXED, found in the same receipts and worth their own cards:
- `state: "running"` on runs that graded 14 hours ago — both live receipts say it, so
  whatever writes attempt.end is not reaching the ledger. The run-state pipe is lying
  about what is in flight, which likely feeds the #446 relaunch loop.
- Neither receipt names the MODEL or lane, so I cannot rule the 27B in or a governor
  downshift (#438) out for this attempt. `AttemptEvidence` already tracks
  `served_model_at_start`/`_at_end` — the identity exists and simply never reaches the
  receipt. A benchmark receipt that cannot say what did the thinking cannot attribute its
  own score, which is thread B's whole premise.

2 new tests green.

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
…not (#56)

MEASURED on this M5, live `resources/board`, 2026-08-19:

    vram: physicalUsed 50.95G  attributed 6.81G (serving)  UNOWNED 44.14G
    ram:  physicalUsed 50.95G  attributed 0.00G            UNOWNED 50.95G

87% of resident memory had no declared owner. The governor could see the bytes were
gone and could not say who had them, so it could not ask anyone to give them back.

WHY THAT IS NOT MERELY AN OBSERVABILITY GAP. A consumer deciding what it can afford
sees `capacity − everything resident`. With nothing attributed, "everything resident"
is indistinguishable from "everything immovable", and a planner facing all-immovable
memory can only shrink. That is the mechanism behind serving a 0.5B on a 64 GB machine
(#438) and behind grow-back never happening (#214) — one missing attribution seen from
two ends. Not one line of code was wrong; nothing was accountable.

THE SHAPE IS BORROWED DELIBERATELY. `disk_eviction::every_cache_class_has_a_decided_
eviction_story` already does exactly this for disk — enumerate every class the substrate
writes to, fail on any with no decided owner. CLAUDE.md calls it "the difference between
a red test and a user's trashed machine". Memory had no twin. This is it.

`standard_memory_holders()` names all nine holders on this box. Five are Declared
(serving, render, voice, perception, benchmark-staging). Four are Undeclared, each
naming the task that closes it rather than a bare TODO:

  vision (#106/#395)  — a SECOND llama-server, Qwen2.5-VL-7B on :58091, measured 9.4 GB
                        resident, registers nothing. Largest unowned holder, and because
                        it never yields, a 27B and vision cannot be planned against one
                        pool. This is precisely the VL-as-consumer keystone #395 names.
  embed (#225)        — has a consumer-id constant AND a honoured reservation floor, but
                        registers no consumer. Half-wired is the worst state: serving
                        budgets around a floor for bytes nobody reports.
  core (#178)         — the core process itself, the one holder that can never be
                        reclaimed by asking, so its job is to be COUNTED.
  grade-subprocess (#381), forge-train (#99/#137).

Undeclared is a tracked promise, not a shrug — the guard rejects a reason that names no
task or is too short to act on, so the class can never be the silent one again.

`Reconciliation` computes `physical_used − attributed − external` per kind and explains
the CONSEQUENCE, not just the number, because an unowned fraction means nothing to a
reader who does not know it forces the planner to treat memory as immovable.

Tests: the decided-owner guard; a cross-check that Declared rows use the constants the
code actually registers under (prose cannot fake wiring, the #344 property) which also
asserts embed is still NOT a consumer so its row gets moved when #225 lands; the
reconciliation reproduced from the incident's real numbers; and over-attribution
flooring at zero rather than wrapping. 4/4 green.

NEXT, and this is deliberately not bundled: the reconciliation is computed but not yet
surfaced on the board, so the 87% is still only visible to a code reader. Then vision as
a real consumer, then the self-eviction budget (a consumer must be able to re-plan the
model it is already running — today its own residency is subtracted from its own budget,
which is the ratchet).

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
…— end the ratchet (#438/#214)

The serving planner budgeted its NEXT model against `available_for(serving, Vram)`, and
`available_for` subtracts `max(granted, physical_used)` — which INCLUDES serving's own
resident weights. So the incumbent was counted against its own replacement.

MEASURED, live board, 2026-08-19:

    vram capacity              55,125,917,696
    serving's own residency    30,253,811,702   ← subtracted from serving
    available_for(serving)     16,954,408,960   ← what the planner was handed
    + own residency          = 47,208,220,662   ← what it could actually have

A 27B fits in 47.2 GB. It does not fit in 16.9 GB. **The planner refused to keep the
model it was already running**, stepped down to a 7B, and the next decision started from
a lower ceiling still — ending at a 0.5B at 4,608 context on a 64 GB machine. #438 and
#214 are not two bugs; they are this one, seen from each end.

It also explains the lane thrash Joel called out. The budget MOVES as the incumbent
loads (0 → 28 GB resident), so the planner re-decides mid-load and respawns. A budget
that does not subtract your own bytes from your own plan is also a STABLE budget.

FIX: `budget_for_replacing(consumer, kind)` = `available_for` + that consumer's OWN
measured residency. The rule lives in the ledger — one place knows it — rather than
every caller remembering to add back. `available_for` is already consumer-aware about
RESERVATIONS (#225); it was consumer-BLIND about RESIDENCY, and that asymmetry was the
whole defect.

SCOPE, deliberately narrow:
  - adds back ONLY the caller's own residency, never a peer's, so it can never plan into
    someone else's bytes;
  - other consumers' reservation floors stay excluded, exactly as before;
  - `acquire` still uses `available_for` — a lease must never be granted against bytes
    not yet released. This is a PLANNING number, not a grantable one, and a test pins
    that distinction.

THE INVARIANT, which is Joel's acceptance test stated as code: *a machine already
serving model X can always re-plan model X.* Anything else can only decay, and no
learned layer on top can recover — it would be training against a signal wrong by the
size of the resident model.

Tests use the incident's real numbers. The first asserts the PRECONDITION (the old
number is genuinely too small for the model already running) before asserting the fix,
so it cannot pass vacuously if the arithmetic changes.

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
…derive total−used instead (#438 root cause)

MEASURED, same process, same `System`, this M5:

    System::new() + refresh_memory()  → total=68719476736  available_memory()=0
    System::new_all()                 → total=68719476736  available_memory()=0

`available_memory()` returns ZERO on this platform while `total_memory()` and
`used_memory()` both return correct values. Not a construction problem — every
construction gives the same zero.

WHY THAT MATTERED FAR BEYOND ONE READER. `MemoryPressureMonitor` calls
`available_memory()` and publishes the result into `CURRENT_AVAILABLE_BYTES` — the
global atomic its own doc calls "the honest 'how much can I allocate before the OS
OOM-kills me' number", the one a subsystem is told to size large allocations against.
It has been publishing a permanent 0.

`SystemMonitor::read_memory` never had the bug: it derives `available = total − used`
and reports correctly (10.5 GB available / 58.2 GB used, live, right now). Two readers
of the same fact, one right and one silently wrong, and the wrong one is the one the
governor trusts.

A bogus zero-available is precisely the shape of #438 — "governor downshift on ONE
bogus usable_gb=0 sample served citizens with a 0.5B". This does not by itself close
that card, but it is a mechanism that produces exactly its symptom, and it was live on
this box today.

FIX: `available_from(&System)` — ONE derivation, `total.saturating_sub(used)` — used by
the pressure monitor's poll and by `LiveHostMemory` both at construction and on its
fallback sample. The two readers can no longer disagree, which is the actual invariant;
the specific arithmetic is secondary.

This also explains why my previous commit's fallback did not help: it copied
`available_memory()` and inherited the same zero. Fallback depth is worthless when every
level asks the same broken question.

Found by writing a diagnostic that printed all three constructions rather than reasoning
about which one "should" work — I had already guessed wrong twice (construction kind,
then daemon wiring) before measuring.

10/10 capacity tests green.

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
…abricated zero (#438)

Joel: "I don't understand how zeroes are ever getting in at all, because defaults and
estimates eventually get only real measured data to replace them, not zero… Can it remain
'unknown' but use the guesstimate till it resolves?"

Correct on both counts, and the answer to the first is: NOTHING MEASURED IT. No monitor
ever reported zero. `governed_vram_ceiling` honestly returns `Option<u64>` — `None` means
"the governor has not published a VRAM row yet", which at boot is simply true for a
second or two — and every call site wrote `.unwrap_or(0)`. The zero was manufactured at a
type boundary, where "no answer yet" was forced into a slot that only accepts a number.

MEASURED CONSEQUENCE, live on this box today at t-128s from boot:
    base_model = continuum-ai/qwen2.5-0.5b-instruct-GGUF
    usable_gb = 0   fits_on_gpu = false   lanes = 1   win = 2048
A 0.5B spawned on a 64 GB machine, serving until the board caught up ~90s later. That is
#438's mechanism, located.

WHY THE ZERO LOOKED SAFE, AND WHY THAT REASONING WAS HALF RIGHT. Zero IS the correct
conservative answer for a GRANTER: `acquire` against a ceiling of 0 refuses, and refusing
is safe. Zero is catastrophic for a PLANNER: "how big a model should live here" against 0
does not decline — it picks the tiniest thing that fits in nothing, and then actuates.
One scalar, two consumers, OPPOSITE SAFETY POLARITY. That is the defect: not the
constant, but a single value answering two questions whose safe direction is reversed.

THE LADDER (`resources::ceiling_prior::decide`), best evidence first, pure and testable:
  1. Measured    — the governed board has a VRAM row
  2. LastKnown   — the board reported earlier this process, aged; an old REAL number
  3. Estimated   — no reading ever, but the GPU monitor knows the DEVICE'S PHYSICAL VRAM,
                   a static hardware fact available before any pressure sample, discounted
                   by the operator headroom so a cold plan is conservative-not-empty
  4. Unknown     — genuinely nothing: no row, no history, no device
On any machine with a GPU rungs 1–3 always produce a real number, so rung 4 is unreachable
in practice. There is no path where 0 is the best available answer — it was never the most
conservative value, only the emptiest.

NOT INVENTED HERE. This is the standard shape: automotive ECUs under ISO 26262 substitute
a DEFINED default on a failed plausibility check and fall back on analytic redundancy
(MAF fails → infer from MAP + RPM), running degraded-but-operational rather than feeding a
raw zero into the control law. Same pattern wherever a controller must act before its
estimate converges — TCP slow-start opens at a nonzero initial window, DVFS governors boot
at a default P-state, a Kalman filter initialises with a prior rather than a zeroed state.

COMPRESSION: this reuses `FootprintReading` + `Provenance` — the exact primitive built
this morning for footprints. A ceiling and a footprint are the same kind of thing: a byte
quantity that may be measured, estimated, stale, or absent. Giving capacity a parallel
vocabulary is how the sidecar gate and the ledger came to disagree about one holder. One
carrier, one provenance ladder, both axes.

PROBES: `serving.vram_ceiling_prior` fires ONLY on non-Measured rungs — bytes, gib,
provenance and the rung's own reason — so "we are planning on a substitute" is visible
while a healthy board stays silent and does not drown the stream (#399).
`serving.vram_ceiling_prior.seeded` records the cold prior at daemon start, which happens
BEFORE `register_as_consumer` and before any reconcile, so the very first plan already has
a real number.

Unknown still collapses to 0 at that one call site, deliberately: with no board, no
history and no device, refusing to plan IS the honest outcome. The change is that this is
now the unreachable last rung instead of the first thing a cold boot hit.

5 ladder tests + 9 existing green. The live proof this owes is the next cold boot's
`usable_gb` — it should read ~55, not 0.

FOLLOW-UP, deliberately not bundled: the actuation gate — a plan built on a non-Measured
ceiling may be COMPUTED but should not spawn or tear down a lane until provenance is
Measured. Estimate now, correct as the filter converges, commit irreversible actions only
on confirmed state. That is what ends the boot-time spawn/teardown churn entirely.

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
…w is not a reading (#438)

Joel: "finish it till it works right… if it can't take these new frontier models it defeats
the purpose."

The ladder and the contagion rule were both correct and both were sitting on top of a
source that could still invent a zero. This is the cut that closes the chain.

THE ONE LINE, and the reasoning is the whole fix:

    .find(|k| k.kind == ResourceKind::Vram)
    .filter(|k| k.capacity_bytes > 0)

CAPACITY IS THE DEVICE'S SIZE, NOT ITS FREE SPACE. A GPU does not shrink to nothing. So a
governed Vram row carrying zero capacity cannot be an observation — it can only mean the
capacity source has not reported yet, which at boot is simply true for a second. That is
`ledger.rs`'s `capacity.get(&kind).copied().unwrap_or(0)` fabricating a number one layer
below where the ladder reads, and it is why the ladder did NOT fire on the boot that still
produced a 0.5B: `governed_vram_ceiling` returned `Some(0)`, the ladder classified it
`Measured(0)` — correctly by its own rules — and passed it through. A zero that arrives as
a number is indistinguishable from one that was observed. That is what "any in a chain can
short circuit others" means in practice.

WHAT THIS DOES NOT DO, deliberately: it does not suppress a real full-GPU reading. Zero
AVAILABLE against a real capacity stays a genuine measurement and the planner should still
decline — there is no room. Only zero CAPACITY is rejected, because only that one is
physically impossible.

THE DISCRIMINATOR, so the next boot proves the mechanism instead of leaving me inferring
it — `serving.vram_capacity_absent` carries capacity/physical_used/available at the moment
of the zero. If it fires alongside `serving.vram_ceiling_prior` at ~51.84 GiB with NO 0.5B
plan, the chain is closed end to end. If it does NOT fire and a zero still appears, my
`ledger.rs:167` suspect is wrong — and the probe says so. Built this way on purpose: I
have been wrong three times today reading a live system from one sample, and an instrument
that can falsify me is worth more than another argument that I am right.

THE CHAIN, now honest at every link:
  capacity source absent  → zero-capacity row rejected  (this commit)
  no board reading        → last-known, then device prior, never 0   (6338cd3)
  derived arithmetic      → inherits its weakest ancestor + its reason  (f1e7b67)
  a holder that can't be sized → declines instead of contributing 0  (67a6edb)

215 tests green across resources + serving_daemon + serving_footprints + ceiling_prior,
0 failed. 165 GB free.

STILL OWED, and it is the only thing that makes this real: a cold boot showing usable_gb
at ~55 instead of 0, no 0.5B spawn, and the 27B coming up directly. That is the receipt,
not the test count.

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
…nds (#438 root)

MEASURED IN THE COLLAPSED STATE, which is what made this findable:
    serving   25.93 GB attributed  "1 lane(s)"
    vram      cap=55.66  phys=47.25  measured=25.93  avail=8.42
21.3 GB unowned. The snapshot had already flipped to the new 1-lane shape while the old
4-lane process was still resident. Unowned reads as immovable, `available` fell to 8.42 GB,
the 27B stopped fitting, and the planner took a 0.5B — in STEADY STATE, ~8 minutes into a
healthy run, not a boot transient.

THE CAUSE, `serving_consumer.rs:185`: `footprint()` is PLAN-derived. `active_ready()`
returns `None` unless `ready`, so a loading or relaunching lane attributed NOTHING while
holding gigabytes; and when the shape shrank, it attributed the new shape immediately
while the old residency lingered. Two under-reports, one root — reporting intent as if it
were residency. Under-reporting our own bytes is indistinguishable from someone else
holding them, and strictly more dangerous: it invites over-commit against memory we have
not released.

THE FIX: a high-water of bytes held-and-not-shown-released, decaying ONLY on evidence — a
`ready_verified_at_ms` we have not yet consumed, which is stamped exactly when readiness is
CONFIRMED for the lane now serving, and therefore proves the previous process is gone.
Evidence, not a timer.

AND THE GUARD THAT MAKES IT SAFE, found by a failing test rather than by argument: if the
snapshot carries NO verification stamp, nothing could ever prove release, and the claim
would strand this machine's capacity for the life of the process. So the high-water
requires a PROOF CHANNEL — no stamp, no claim. Same rule as everywhere else today: the
failure direction must move toward LESS trust. A brief under-report is recoverable; an
unfalsifiable claim on a third of the box is not.

TWO CORRECTIONS TO MY OWN WORK, both caught by tests I nearly rewrote instead of reading:
- I wrote three tests against the shared `rig`, whose resolver is FLAT by design — its
  comment says "the shape (window, lanes) is ignored here", three lines above where I was
  working. With a flat resolver a 4-lane and a 1-lane serve are the same size, so the
  shrink I was asserting was unobservable. Added `shape_rig`, which scales with lanes.
- I had labelled `footprint_is_the_active_ready_model_only` and
  `footprint_passes_served_window_and_lanes_to_resolver` as legitimate premise changes.
  They were not. Under the proof-channel rule BOTH PASS UNMODIFIED — which is the
  strongest evidence the rule is the right design and not a patch shaped to fit.

WHY THIS MATTERS BEYOND THE LOCAL BUG (Joel): allocation gets more dynamic on the grid,
and there is no reap to fall back on there. When a peer's residency shifts or a node
drops, nothing local can be killed to make the accounting moot — `resources/mod.rs`
already calls node loss "a reclaim no one consented to", detected as drift between what a
consumer claims and what the scan shows. This is that mechanism, one scale down.

11/11 green in serving_consumer, no existing assertion weakened.

STILL OPEN, and it is the CAUSE this compensates for: `lane_registry::sweep_all` is wired
at exactly one site (`continuum.rs:1671`), yet an orphaned 0.5B survived a reboot tonight
while `serving/status` reported nothing serving. Either that site is not on the reboot
path, or the sweep only matches lanes it registered a pidfile for. Boot owning the process
tree (#452/#454) removes the drift at its source; this makes the ledger honest either way.

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
…d attribution (#438)

MEASURED AFTER the high-water fix, which did NOT cover this. Cold boot, live board:
    serving= 0.00G  phys=29.90G  UNOWNED=29.90G  avail=25.76G   ready=False model=None
    serving= 0.00G  phys=36.88G  UNOWNED=36.88G  avail=18.79G   ready=False model=None
Physical climbing as the 27B loads; zero attributed the whole way. The high-water needs a
prior residency and a verification stamp, and a first boot has neither — Joel's exact
worry about option (a), landing on option (b) in a different form.

THE CAUSE WAS UPSTREAM AND IS THE SAME SHAPE AS EVERYTHING ELSE TODAY: `ServingSnapshot`
was BINARY — ready with a model, or not-ready with `active_model: None`. The loading arm
of `snapshot_from_outcome` returned `ServingSnapshot::empty()` and DISCARDED `desired`,
which it had been handed. So for the whole load window the state pipe FORGOT what it was
bringing up, and the consumer could not attribute those bytes because the information was
not in the pipe. A state machine that cannot express an honest intermediate degrades its
answer to zero.

Readiness is a claim about SERVICE. Residency is a fact about MEMORY. They do not start
together: weights are mmap'd from spawn, `/props` answers much later. Reporting residency
from readiness is a category error, and it costs a third of the box during every load.

THE FIX: `loading_model: Option<String>` on the snapshot, set by the loading arm from the
`desired` it already receives, and charged by `footprint()` at a MINIMUM shape — one lane
at the floor window. That under-states the eventual KV and names the dominant term
(weights) immediately, growing to the true figure the moment readiness lands. Conservative
in the safe direction, and never zero while a process holds memory.

12/12 green in serving_consumer including the new cold-load case, which sets up exactly
the measured condition: never ready, no prior residency, NO verification stamp.

THE CHAIN, now honest at every link:
  capacity source absent       → zero-capacity row is not a reading      85024f2
  no board reading             → last-known, then device prior, never 0  6338cd3
  derived arithmetic           → inherits its weakest ancestor + reason  f1e7b67
  a holder that cannot be sized→ declines instead of contributing 0      67a6edb
  a reshaping lane             → reports what it holds, decays on proof  163c926
  a LOADING lane               → is named and charged from spawn         this commit

NEXT, and Joel named the likely mechanism (2026-08-19): "startups can destroy the evidence
like pid files that they'd need to know which process to kill." That reframes the orphan
`sweep_all` missed — it is probably not the wrong call site but an ORDERING bug: if boot
recreates the pidfile/registry before reading the previous generation's, the evidence of
what to kill is destroyed by the act of starting. The sweep then finds nothing, reports
clean, and the orphan survives. Read-and-reconcile the old generation BEFORE writing the
new one.

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
…carries the shape (#452/#438)

The upstream half of 6c12965. That commit made the adopt gate ask the lane how many
slots it serves; this one makes the GOVERNOR know the lane is ours at all.

MEASURED LIVE 2026-08-19, on the boot right after deploying the adopt fix:

  serving.plan  t-381s  qwen2.5-coder-3b   lanes=1 win=3271   usable_gb=2   ← boot
  serving.plan  t-380s  qwen3.5-4b-forged  lanes=1 win=16384  usable_gb=2
  serving.plan  t-374s  Qwen3.8-27B        lanes=1 win=16384  usable_gb=31  ← recovers
  serving.plan  t-299s  qwen2.5-coder-7b   lanes=1 win=16384  usable_gb=7   ← collapses AGAIN
  serving.plan  t-290s  Qwen3.8-27B        lanes=3            usable_gb=25

`usable_gb = 2` on a 64 GB machine. The predecessor's healthy 27B was still running and
holding ~50 GB, but a fresh core's ServingSnapshot is empty for a lane it did not spawn,
so the consumer reported ZERO and the governor filed those bytes under `external` —
someone ELSE'S. The box looked full, the planner chose a 3B, and the 27B was reaped as
the "wrong model" to make room for it. Twice in one boot
(serving.lane_reclaim: Reclaimed{3459}, Reclaimed{62615}).

The self-eviction ratchet could not rescue it either: the ratchet adds back our OWN
measured residency, and the lane was not ours yet. And the adopt gate from 6c12965
never even ran — zero serving.grow rows — because the decline happened upstream at model
identity. One misfiling, both symptoms.

FIX, in Joel's own frame ("know OUR footprint, the total system with us removed, and any
PAST FORMS OF OURSELF — then work within that; we are free to control our own processes,
fully"). Boot could already see the first two quantities. This is the third:

1. `LaneRecord` carries the SHAPE (`context_window`, `lanes`), not just the identity.
   Residency is weights + KV(window, lanes), so a record naming only the model cannot
   answer "how many bytes does my past form hold?". Written at spawn from ServingTarget.
2. `lane_registry::live_lane()` — the LIVE-role record whose pid is genuinely alive. A
   stale file cannot conjure residency.
3. `serving_consumer::inherited_footprint(rec, sizer)` — pure over (record, sizer), so
   both arms are testable with no filesystem, process, or governor. Wired as the third
   fallback after active_ready and loading_model.

THE REFUSAL IS THE LOAD-BEARING HALF. A record predating the shape fields carries 0,
which means UNKNOWN, not "a zero-byte lane". `inherited_footprint` returns None there.
Returning Some(0) would hand the governor a QUANTITY where it should get an absence —
the same fabricated-zero class as #438's usable_gb=0 and the sidecar's two-zeros bug,
and this fix would have re-created the very defect it exists to remove.

Tests (2 added to the existing mod, both confirmed by name):
  - a_lane_inherited_from_a_previous_generation_is_counted_as_ours — sized from the
    record's own shape, reason names the pid it came from.
  - an_old_record_without_a_shape_is_unknown_and_never_a_zero_byte_lane — all three
    partial-shape rows refuse.
22/22 serving_consumer + lane_registry green; the registry fixture gained a real shape.

STILL OWED: live proof. Both fixes are green and deployed-pending; the repro that
produced the evidence above must be re-run and show usable_gb NOT collapsing at boot.

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
… as the incumbent (#438)

Measured from the probe ledger, 2026-08-19 — and it retracts my last two diagnoses of this
defect, both of which were wrong.

WHAT THE LEDGER SHOWS. A core crashed with a healthy Qwen3.8-27B serving 4 lanes at a 25,075
window (`serving.grow served_lanes=4 target_window=25075`). Its successor booted while that
lane was STILL ALIVE holding ~45 GB, and the first plan read:

  +32246.3s  Qwen2.5-Coder-7B   lanes=1 win=4689  usable_gb=6   bound_by=host-fit
  +32246.9s  qwen2.5-coder-14b  lanes=1 win=2048  bound_by=host-fit
  +32247.5s  serving.lane_reclaim  outcome=Reclaimed { pid: 11341 }   <-- 1.2s TOO LATE
  +32256.3s  Qwen3.8-27B        lanes=2 win=16384 usable_gb=29
  +32306.3s  Qwen3.8-27B        lanes=4 win=27481 usable_gb=47

`usable_gb=6` is not a bogus sample and not a fabricated window — it is an HONEST reading of
free VRAM on a box whose own predecessor holds 45 GB of it. The planner spent that budget on
a 14B at MIN_SERVE_CTX; 1.2 seconds later the reclaim freed all 45 GB, and by the time the
plan wanted the 27B back it could not have it — a model swap needs the relaunch already spent.

WHY BOTH DEFENCES WERE OFF. `plan_serving_stable`'s at-rest credit exists precisely so "a
model's OWN load/residency can never flap it out", and `downshift_gate`'s sustained-ticks
debounce (#368) exists precisely to reject a transient squeeze. BOTH key on an incumbent, and
`publish_plan`'s own comment declared boot has none: "Boot's first plan has no incumbent
(plan_tx holds None) -> plain selection." So the one moment a squeeze is GUARANTEED — the
successor overlapping its predecessor — is the one moment every guard against transients is
disabled by construction.

THE FIX, in Joel's framing of the governor: know our footprint, the system with us removed,
and ANY PAST FORMS OF OURSELF — then work within that. An inherited lane is that third
category. It is ours, its bytes are ours to reclaim, so it is the incumbent the first plan
reasons against, not an external squeeze to flee. `incumbent_for_plan(published, inherited)`:
a published plan always wins (a stale .lane file must never pin the model forever); the
registry record speaks only in the window where `plan_tx` is empty.

`InheritedLaneSource` is an injected seam, not a direct `live_lane()` call, for the same
reason `DecodeAgeSource` is one — the production default reads a filesystem singleton, so
under `cargo test` (one process, shared HOME) it would hand every planning test the
OPERATOR's real 27B as an undeclared incumbent. `daemon_with` pins it to None. That exact
leak was already caught by measurement in `serving_consumer`; this is the same lesson applied
before it could bite.

TESTS (43/43 green in this module), with a real negative control:
- the inherited 27B is defended at a 6 GB sample
- WITHOUT it, the same 6 GB genuinely downshifts — so the test above is not vacuous
- a published plan outranks a stale inherited record, and cold boot still has no incumbent

RETRACTED by this commit, both mine: (1) the handoff note's "the reap happens BEFORE
attribution can matter" — it happens 1.2s AFTER the plan it invalidates; (2) "a transient in
a settled system, not a boot defect" — it is a boot defect, and the ordering is the mechanism.
The three VRAM-provenance fixes from earlier today are correct and remain, but they were not
the binding constraint on this path.

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
…anner may tick (#438)

Joel, 2026-08-19: *"unacceptable to not consider the removal of the last system as negated."*
He is right, and the honest form of the defect is narrower than it first looked.

THE NEGATION ALREADY EXISTS. `governed_vram_ceiling` budgets serving through
`budget_for_replacing(SERVING_CONSUMER_ID, Vram)` — available PLUS serving's own resident
bytes, because a consumer choosing its successor releases what it holds. Live board, right
now, with the 27B up: `externalBytes: 0`, `measured 55.59 GB` attributed to `serving`. Our
predecessor's memory is filed as OURS, not as an external squeeze. A second credit was
drafted for `host_budget()` and DISCARDED before commit — it would have added the same
55.59 GB twice and over-committed the GPU, which fails as an OOM rather than a small window.
That is the parallel-allocator move this codebase forbids.

WHAT WAS ACTUALLY BROKEN IS THE WIRING ORDER, read in-file at `ipc/mod.rs:1322`:

    serving_daemon.register_planner_on_authority_tick();   // planner attached HERE
    runtime.register(serving_daemon.clone());              // initialize() → register_as_consumer LATER

The add-back is keyed on serving being a REGISTERED CONSUMER. The planner was attached to the
authority's tick at wiring time, while registration lived in `initialize`, which the runtime
calls afterwards. The authority could therefore tick a plan in the gap — and did. Measured on
the crash-repro boot: `usable_gb = 0` on a 53 GiB board for ~0.6 s, because our own 44 GB were
filed under nobody yet.

Nothing was actuated (the #438 downshift debounce held the plan, and `serving.lane_reclaim`
never fired — the inherited 27B was ADOPTED, same pid across the crash). But a guard covering
for a budget that is momentarily lying is not the same as the budget being honest, which is
exactly Joel's objection.

FIX: `declare_to_memory_authority()` — seed the device VRAM prior + register as a consumer —
called at wiring time immediately BEFORE the planner is attached. Both operations are
idempotent (set-once prior; `add_consumer` clears stale quarantine for the id), so this is an
ordering constraint, not a duplication hazard. The device's total VRAM is a static hardware
fact available immediately; there was never a reason to learn it later than the first tick
that plans against it. The two call sites carry a do-not-swap note naming the measurement.

ACCEPTANCE (Joel's, verbatim): "letting us have and keep our 27b for benchmarks and project
development activities." Verified live across a hard SIGKILL of the core with the lane held:
27B kept, ADOPTED not reaped (pid 42506 identical before and after), ready, 4 lanes, 26,880
window — vs. the pre-fix ledger where the same crash produced a 14B at a 2,048 window.

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 Sep 17, 2026
…ves — and the catalog floor is 1.5B (no 0.5B rows) (#4146)

* fix(serving): a host never sinks below what its physical capacity serves — and the floor of the catalog is 1.5B

Joel, 2026-09-16: "0.5 isn't even supposed to be available to anyone … 1.5b only …
if this machine ever returns less than 27b we are sucking." Both halves.

THE CATALOG FLOOR. Both 0.5B rows are deleted (not deprecated): the general
`qwen2.5-0.5b-instruct` "LCD" and the `qwen2.5-coder-0.5b-instruct`. The
spawner's pre-plan fallback names the 1.5B coder. Nothing below 1.5B is servable
on any tier. (The Intel Mac serves the 0.5B coder today; it must pull
`continuum-ai/qwen2.5-coder-1.5b-instruct-GGUF` before it takes this canary or it
boots with no candidate — said on the channel.)

THE HOST FLOOR. Measured today (#4145): `serving/unload` suppressed the 27B, so it
left `candidates`; `downshift_gate` read "incumbent not a candidate" as "weights
gone from disk" and adopted the 0.5B on a 32 GB card at a transient 24 GB, then
relaunched it 35 times. The debounce (#368) separates jitter from a sustained
squeeze; it never said what a host may SINK TO, and both anti-thrash defenses key
on an incumbent — a fresh boot (#438) or an unload has none.

The floor is the plan's OWN selection law (`plan_serving`) run at the PHYSICAL
budget (total VRAM × the everyday fraction) over everything servable on disk,
suppression and pin ignored — intent to move is never licence to sink. A plan
whose base ranks below the floor's is refused with `serving.plan.demotion_refused`
(floor, wanted, incumbent, live usable, physical usable; emit-on-change) and the
previous plan stands — or nothing is published, and the host waits for its budget.
`publish_plan` takes the on-disk universe as an input beside `candidates`, so no
test reads an ambient catalog.

Tests: `a_host_never_sinks_below_what_its_physical_capacity_serves` (the 5090
shape: 32 GB card, 27B on disk, 0.5B plan → Below; a 16 GB card → the small model
is honestly the floor); `a_transient_six_gigabytes_on_a_big_card_refuses_to_sink_
below_the_floor` (publishes nothing, then adopts the 27B when the budget returns).
The #438 negative control now runs on a genuinely 8 GB card, which is what its
premise said. Mutation (gate never fires): fails at "the 0.5B on a 5090 is a
demotion below physical capacity". Daemon suite 62/62; catalog 50/50; spawner 18/18.

Known and named: an `unload` of the only above-floor model now times out (the plan
refuses, the incumbent keeps serving) and leaves its suppression set until
`serving/load`; the refusal probe says why every tick it is asked.

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

* fix(serving): the floor respects the pin — the operator's word is the floor's ceiling

Fable's block on #4146, measured on the M5: Joel pins Ornith (rank ≤ 40) with the
27B (rank 42) on disk. A pin-blind floor read the 27B as the floor, every plan
under the pin as `Below`, and the host would have published nothing after its next
replan. The floor's universe is now everything servable on disk WITH the pin
applied and suppression ignored: a pin is intent to serve THIS (the ceiling of the
floor); an unload's suppression is intent to move (never licence to sink, #4145).
Test: a pinned lower-ranked model on a card that fits a higher one IS the floor, and
serving it is AtOrAbove.

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

* fix(serving): a kept window must still fit — the sticky and wedge-heal laws are bounded by the physical fit at launch

Deployed the floor + afford + ledger cap on the 5090 (2026-09-17 04:21Z). The plan
was honest at once (27B, usable_gb=26, served_window=57534), and the relaunch
still spawned `-c 144640`: `sticky_served_window` (#175) kept the live lane's
window because it was BIGGER than the plan's, and after the kill `wedge_heal_floor`
(#363) kept the last healthy one for the same reason. Both laws exist to stop a
teardown transient ratcheting a window DOWN; both assume the kept window was
legitimately sized. This one was sized against the fictional 54 GB budget the
ledger cap just removed, so the laws preserved the fiction across every relaunch.

The one window arithmetic is now `ModelFootprint::window_within(usable, lanes)`
(the plan's `window_for` closure delegates to it), and the launch path bounds the
kept window by it at the PHYSICAL budget — physical, not live, because the live
budget is exactly the transient the wedge-heal law sees through. The plan's own
window is always within it; only a kept fiction is touched, and a probe
(`serving.reconcile.window decision=kept-window-exceeds-physical-fit`) names the
kept and bound values when it fires.

Test: at the 5090's physical budget the 27B fits ~57k on one lane, the plan's
window equals `window_within`, and 144,640 is above it.

Co-Authored-By: Claude Opus 5 <[email protected]>
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 17, 2026
…e — at the ledger when it holds the footprint, in the plan only until it does

Measured on the 5090 during Kimi's solve (2026-09-17 15:31–15:59Z): the ledger's
replace-myself budget (own footprint added back, capped at the device) handed the
daemon 30 GB at rest; `plan_serving_stable` then credited the incumbent's 17 GB of
weights AGAIN and planned 2 × 70,093 on a card whose honest fit was 2 × 47,098.
The re-home law saw a 46k "shortfall" every 105 s, fired three relaunches
mid-solve, and each launch bounded the window right back to 47,098 — two cold
turns of 12–15 s in her card for nothing.

`plan_serving_stable` keeps its credit for a caller holding the LIVE budget (its
eleven tests are untouched); `plan_serving_at_rest` is the same hysteresis with no
credit. The daemon picks by fact: once serving's VRAM attribution is on the board
the budget is at rest; before it is (the first ticks over an inherited lane, #438)
the plan's own credit still keeps the successor from fleeing its predecessor. Test:
at rest, the plan's window equals `window_within` — no shortfall exists to chase;
the live-budget path plans bigger from the same number, which is why the daemon
must not use it. Daemon 68/68 incl. #438's boot test; plan 38/38.

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 17, 2026
…e — at the ledger when it holds the footprint, in the plan only until it does

Measured on the 5090 during Kimi's solve (2026-09-17 15:31–15:59Z): the ledger's
replace-myself budget (own footprint added back, capped at the device) handed the
daemon 30 GB at rest; `plan_serving_stable` then credited the incumbent's 17 GB of
weights AGAIN and planned 2 × 70,093 on a card whose honest fit was 2 × 47,098.
The re-home law saw a 46k "shortfall" every 105 s, fired three relaunches
mid-solve, and each launch bounded the window right back to 47,098 — two cold
turns of 12–15 s in her card for nothing.

`plan_serving_stable` keeps its credit for a caller holding the LIVE budget (its
eleven tests are untouched); `plan_serving_at_rest` is the same hysteresis with no
credit. The daemon picks by fact: once serving's VRAM attribution is on the board
the budget is at rest; before it is (the first ticks over an inherited lane, #438)
the plan's own credit still keeps the successor from fleeing its predecessor. Test:
at rest, the plan's window equals `window_within` — no shortfall exists to chase;
the live-budget path plans bigger from the same number, which is why the daemon
must not use it. Daemon 68/68 incl. #438's boot test; plan 38/38.

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 17, 2026
…GPU the lane's bytes are the device delta across the spawn (#4152 ⇄ #4164) (#4167)

* fix(serving): the footprint source is per host class — on a discrete GPU the lane's bytes are the device delta across the spawn

Fable's #4164 measures the lane's ANONYMOUS SYSTEM memory — right on unified memory
(the KV lives in RAM), and on the 5090 it read `serving.footprint.measured
outcome="could_not_look"`: a discrete GPU keeps the KV in VRAM, a process read
misses it entirely, and WDDM attributes VRAM to no process (`nvidia-smi
--query-compute-apps` prints [N/A] for every pid on this box). Converging #4152
and #4164 as Fable proposed: ONE consumer (`lane_footprint::observe` → the plan's
own decomposition → per-token cost), TWO sources chosen by `memory_mode()` —
unified = process anon; discrete = device used at the tick minus device used
before the spawn, minus the weights (in VRAM on this class). The baseline is read
once, right before `ensure_model_serving`; an adopted lane has none and the arm
says could-not-look rather than charging the desktop to the model. The probe
names the source.

Test with the 5090's own points (752 MiB idle; 31,914 MiB at 144k; 22,078 at
9.4k; 17 GB weights): the delta through the consumer lands at ≈74 KiB/token, the
number measured by hand last night; no baseline / no reading → None.

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

* fix(serving): the discrete arm's baseline is the TROUGH between reclaim and load, not a single read at spawn

First live receipt on the 5090 (13:1xZ): `serving.footprint.measured source="device_delta"
anon_bytes=0` — the baseline read at the spawn instant came off the board's SAMPLED
used-bytes, which still showed the dying predecessor's ~24 GB, so now − baseline −
weights collapsed to zero. A stale sample is not a baseline. Now the spawn ARMS the
baseline (u64::MAX) and every tick while no lane is ready lowers it to the minimum
sampled value — the trough after the predecessor's memory is freed and before the
successor's load. Armed-but-never-lowered reads as could-not-look, like no-baseline.

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

* fix(serving): the kept-window bound follows the live drive mode — under a Ludicrous hold it plans at Performance like the plan does

A bound fixed at Comfort (32 GB × 0.80) would cap a benchmark's exam window below
what its Performance plan legitimately sizes. Physical capacity, current mode.

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

* fix(serving): the operator's headroom policy is the everyday drive mode — a dedicated node plans at Performance every day

`CONTINUUM_VRAM_HEADROOM` says "a dedicated foundry sets 1.0", and the plan
budget deliberately ignored it (stacking it under the mode fraction
double-discounted). Composed instead: the policy NAMES the everyday mode —
1.0 → Performance, 0.9 → Sport, 0.8 (the default) → Comfort, byte-identical to
before — and pressure can still force Eco, a Ludicrous hold still floors it. The
pin fit-gate, the plan budget, and the kept-window bound now read the one knob.

The receipt that forced it (5090, 2026-09-17 14:31–14:55Z): dispatched a hard-rs
card to Kimi (`843a792a expr_eval`, claimed); at Comfort the 27B on 32 GB fits
1 × 37k or 2 × 11.6k, two residents made the plan pick 2 × 11,776, and a solve
turn does not fit 11.7k — 128 `over_window` / `inference_failed` on her own card,
zero acts, on a box that ran the same model at 31.9 GB all night.

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

* fix(serving): the incumbent's own bytes are credited back exactly once — at the ledger when it holds the footprint, in the plan only until it does

Measured on the 5090 during Kimi's solve (2026-09-17 15:31–15:59Z): the ledger's
replace-myself budget (own footprint added back, capped at the device) handed the
daemon 30 GB at rest; `plan_serving_stable` then credited the incumbent's 17 GB of
weights AGAIN and planned 2 × 70,093 on a card whose honest fit was 2 × 47,098.
The re-home law saw a 46k "shortfall" every 105 s, fired three relaunches
mid-solve, and each launch bounded the window right back to 47,098 — two cold
turns of 12–15 s in her card for nothing.

`plan_serving_stable` keeps its credit for a caller holding the LIVE budget (its
eleven tests are untouched); `plan_serving_at_rest` is the same hysteresis with no
credit. The daemon picks by fact: once serving's VRAM attribution is on the board
the budget is at rest; before it is (the first ticks over an inherited lane, #438)
the plan's own credit still keeps the successor from fleeing its predecessor. Test:
at rest, the plan's window equals `window_within` — no shortfall exists to chase;
the live-budget path plans bigger from the same number, which is why the daemon
must not use it. Daemon 68/68 incl. #438's boot test; plan 38/38.

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

* style: rustfmt the two at-rest hunks

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