Skip to content

SAGE minds: need-ranked frames, the causal contract (no reopen loops), hot tier and disk relief as components, health measured on one slot - #6213

Merged
joelteply merged 185 commits into
canaryfrom
fable/refusal-at-door
Nov 23, 2026
Merged

joelteply merged 185 commits into
canaryfrom
fable/refusal-at-door

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Serves the residents directly: a turn whose prompt plus requested reply cannot fit one stream is refused before any prefill, with the Core's own numbers, so cognition refits once instead of a turn failing mid-answer or being resent blind. Order of work: line 3/3b (one admission owner in the engine), goal 9.

Receipts that motivated it (the M5, 2026-11-21)

  • 07:31-07:57Z: seven live turns admitted with prompts of 23,791-24,277 into a 24,320 stream; each decoded to from=24320 count=1 and failed mid-answer.
  • 09:54:04Z / 09:57:12Z (Codex, at 8c7d4f1): resident 2f50b223 refused at prompts 24,720 / 24,677 vs cap 24,320. The refusal came back as text, which the provider mapped to Transient, so the caller resent unchanged.

Change

  • StreamCapacity::admit(prompt, max_tokens): Ok if and only if prompt + reply <= n_ctx_seq; Infeasible carries reply_tokens, and the transition probe carries it too.
  • The door answers TokenEvent::Exceeded { prompt_tokens, capacity }. TurnAnswer::collect returns InferenceError::ContextExceeded (an out-of-range count is Protocol, as serving_guard types one).
  • The llamacpp provider's body is now generate_stream_checked, so the typed error survives DispatchTermsPolicy::generate_admitted. generate_stream and generate_text are its text and drained forms. Whole answers reach the sink through one stream_sinks::deliver_whole, shared with the trait default.
  • Cognition already refits on this shape (verdict/contribute.rs: PromptCalibration::counted, fit_window = min(fit_window, available)).

Tests

  • a_turn_is_admitted_only_when_her_prompt_and_reply_both_fit. Mutating the door back to the prompt-only rule fails it.
  • a_turn_the_core_cannot_fit_reaches_its_caller_as_context_exceeded.
  • cargo test -p continuum-engine --lib -- persona_scheduler llama_cpp_backend stream_sinks llamacpp_adapter: 40 passed. cargo check -p continuum-engine -p continuum-cognition -p continuum-core --tests is clean. Ratchets vs origin/codex/native-tail-tools pass.

Measured

Deployed to the M5 as c0f87b4 (build 7207, built 15:00:06Z). The 15-minute live read follows in a comment: persona.engine.infeasible with reply_tokens, ContextExceeded refits, and turn rows vs refusals. Owner: Fable. Deadline: today.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

joelteply and others added 30 commits November 18, 2026 00:18
…gine pin moves to #147 (merged with the live engine)

PersonaBlocks owns one llama_persona: new (blocks prepared for this context's memory), reserve
(her token history, once, for a PersonaOwner), save (her state out of the context, raw), load (her
blocks into an empty stream), owner (the stamp of the last save), tokens (her history in place),
and Drop frees her. Every refusal is a typed PersonaRefusal carrying the fork's status name; the
fork validates before writing, so a refusal leaves both sides as they were.

The submodule moves from 5e4163402 (live) to 4caa55bf9: fork #147's head with 5e4163402 merged in,
so the live engine's learn-abort fix (#150) is kept. Depends on fork #147 merging; draft until then.

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

Joel: "we don't reserve. We literally do the opposite. We grow and shrink."

- PersonaBlocks::new(ctx, owner) makes her owned from the start; reserve is gone.
- shrink() beside grow(): gives back the room she does not hold as she cools, dropping nothing.
- Fork 37baf8c12: llama_persona_init(ctx, persona, epoch), llama_persona_shrink_tokens, and ownership
  enforced in the native save/load/bind (one check, no path skips it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…er over the fork's native blocks

continuum-persona-llama: the persona engine's residency Tier on one libllama context. Two execution
streams: the active mind decodes in one while the next binds into the other; every other mind's blocks
stay in RAM exactly as she left them. A move out is the fork's native save, a move in its native bind;
both are synchronous, so the fence has landed when it exists. Each persona gets an exact 64-bit owner
stamp from this tier (a persona is 128 bits; the fork stamps 64).

Fork a88f255cc: a mind binds as whichever sequence she is bound as (her cells are relabeled), so two
streams serve any number of minds.

examples/persona_switch drives N minds through Roles (stage, handoff, copy-out, release) on a real model.

## Measured (M5, Qwen3.6-35B-A3B Q4_K_M, serving down 07:32-07:37Z, fork a88f255cc)
4,096-token history per mind, 64 decoded tokens per turn, 3 rounds:
- 4 minds:  switch p50 8.83 ms, p90 10.76 ms; decode 54.7 tok/s; sustained incl. switches 54.3 tok/s
- 8 minds:  switch p50 8.36 ms, p90  9.82 ms; decode 55.7 tok/s; sustained 55.3 tok/s
- 16 minds: switch p50 8.59 ms, p90 10.06 ms; decode 55.3 tok/s; sustained 54.9 tok/s
Live serving the same morning: KV page saves 8.7-13.1 s. Switching now costs under 1% of decode.
Not yet at the 80 tok/s gate: this harness decodes one greedy token per step with no MTP draft; the
live engine's 80 comes with the draft model, which the persona engine has to drive next.
Fork tests at a88f255cc: 6/6 persona tests passed, including a saved-as-0, bound-as-1 continuation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… own their occupancy; switches report the rebind kind (Codex on #6134)

- A request for an older epoch than the one held is refused and leaves her blocks; a newer epoch prepares
  its blocks first and replaces the old ones only once they exist, so a refused allocation keeps custody.
- Occupancy is the two streams' own [Option<PersonaId>; 2], not a scan of every mind.
- Each bind reports Rebind::SameSequence or Rebind::OtherSequence (the fork relabels her cells over her
  span on the latter); the example splits switch timings by kind and probes a stale epoch at the end.

## Measured (M5, Qwen3.6-35B-A3B Q4_K_M, serving down 07:47-07:57Z)
- 4 / 8 / 16 minds, 4,096-token history: switch p50 8.57 / 8.57 / 8.41 ms; decode 58.0 / 57.8 / 57.5 tok/s;
  stale epoch refused and her blocks still bind, every run.
- Rebind kind at equal history: 4,096 tokens same 9.15 ms (n=8) vs other 9.07 ms (n=10, 5 minds);
  16,384 tokens same 27.80 ms (n=8, 4 minds) vs other 27.88 ms (n=10, 5 minds). The relabel walk is not
  measurable; the switch scales with the bytes copied.
- Stage, handoff and copy-out run serially before her decode here, not overlapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…s not compile

MODULE-ARCHITECTURE 9.4: "a shared resource is a dependency too: the engine's decode is one resource,
so the minds' decodes are ordered children of the engine, serialized by that edge." Joel, 2026-11-18:
--parallel N must be structurally impossible.

PersonaEngine (continuum-persona-engine, engine.rs) owns Roles and the tier that moves minds:
- decode(&mut self, step) hands out only the active mind and the tier she is bound in. The edge is the
  borrow: a decode inside a decode is a compile error (compile_fail doc test, E0499), and no count, lane
  or launch parameter exists to ask for two.
- stage begins her copy-in through the tier and holds her as next under its fence. When next is occupied
  or she is already here it refuses BEFORE starting a transfer, and hands her back.
- handoff binds next once her copy-in landed, then begins the previous mind's copy-out (never
  suspend-then-resume). A refused copy-out keeps her retiring in the engine's custody; retry_retire
  begins it.
- release_retired gives her back once her copy-out landed.

Tests (engine/tests.rs, a recording tier whose fences the test lands): decode reaches only the active
mind while the next streams in; the previous mind's copy-out begins after the bind and she is released
only once it lands; a handoff before the copy-in lands changes nothing; a refused stage starts no
transfer and returns her; a refused copy-out keeps her retiring until it begins.

Built and tested in CI, not on the serving M5 (rule 2). No serving change yet: serving drives this
owner over UnifiedTier (#6134) next, and the lane-launch path for our minds is deleted then.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…y, and keeps the fork's refusals

Codex on #6134 (d815ce5): UnifiedTier::new takes any live Context with streams = [None, None], and a
never-saved mind's move in marked stream 0 occupied without asking whether its sequence held state. A
tier wrapping a context already in use could therefore report a successful first bind over prior KV. And
move_in/move_out mapped the fork's typed refusals to a fixed string.

- move_in, for a mind never saved, asks the engine's own memory (memory_seq_pos_max on the stream's
  sequence) and refuses "her stream already holds another sequence's state" unless it is -1 (empty).
  The evidence is the engine's, never this tier's bookkeeping; the refusal changes nothing.
- TierRefusal carries Native: NotAsked (the tier's own precondition) or Refused { status, name } (the
  fork's llama_persona status and its name). move_in/move_out keep the fork's refusal instead of erasing
  it; the error text appends it.
- persona_switch runs the adoption scenario before its measurement: one token decoded into sequence 0
  before the tier exists; a new mind's move in is refused and sequence 0's state is unchanged; after the
  stream is cleared she binds. (Needs a real model, as the harness does; it is not a CI test.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…another persona's or a stale epoch's blocks before the fork

Codex on #6132 (ea955a8): bind(ctx, seq) carried no expected persona or epoch. The fork's bind/load
validate a handle's blocks against that handle's own identity, which keeps blocks consistent but cannot
detect that the caller selected the wrong intact handle.

- bind(ctx, seq, expected: PersonaOwner) compares the handle's stamp (the owner its last completed save
  wrote) with the transfer's owner, persona AND epoch, and refuses BindRefusal::WrongOwner { expected,
  held } before calling the fork. The destination is untouched. A never-saved handle has no stamp and is
  refused the same way.
- The fork's own refusal stays typed as BindRefusal::Native(PersonaRefusal).
- Test only_the_expected_owner_and_epoch_bind: two intact handles at one reusable sequence (another
  persona, the same persona at a stale epoch, an unstamped handle) are each refused; the expected owner
  binds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…me her owner and epoch

Codex on #6134 (de0e34a): move_in called hold before checking occupancy. With epoch 1 parked in RAM
and the chosen stream occupied (an adopted context), hold(epoch 2) replaced and dropped epoch 1's
blocks, and only then did move_in refuse.

- move_in decides everything before it changes anything: a stale epoch is refused; the same epoch
  rebinds from the stream she was saved from; a new mind or a newer epoch starts over, and only then is
  the stream's emptiness checked against the engine's own memory. hold (which may replace an older
  epoch's blocks) runs only after every check passed, so a refusal keeps the blocks she had.
- The bind passes the owner the transfer is for (her issued stamp at this epoch), through #6132's new
  PersonaBlocks::bind(ctx, seq, expected); a wrong or stale stamp is a refusal naming it, a fork refusal
  keeps its native status.
- tier.rs: the first doc line had error-attribute text pasted into it; restored.
- persona_switch replays the scenario before measuring: epoch 1 decodes and parks; another sequence's
  state lands on her stream; epoch 2 is refused there; the stream is cleared; epoch 1 binds back at the
  position she left. (Real model, so not CI. Byte-identical continuation after a bind is the fork's
  test-persona-blocks.)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…al.native, #6134)

#6134 gives TierRefusal a `native` field so a fork refusal keeps its status. The engine's own refusal
(a copy-out the pipeline would not begin) and the test tier's refusal are preconditions, not backend
answers: Native::NotAsked. Merges fable/unified-tier so #6139 builds on #6134.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…lds a switch until it lands

Codex on #6139 (cb57325): decode handed the caller &mut T. Through UnifiedTier::context() the
callback could decode a batch under another sequence id or call tier.begin directly, bypassing the
binding; and the Rust borrow ended at callback return while a launched GPU decode could still be in
flight.

- residency::Execute (new): a tier that runs the bound mind's decode. submit(persona, epoch, work)
  takes her tokens, never a sequence id, and returns a Completion the engine holds.
- PersonaEngine: decode(step) is gone. submit(work) asks the tier for the active mind only, refuses
  while her previous step has not landed (one decode in flight), and handoff is refused with
  DecodeInFlight until it has, changing nothing. stage() still runs while she decodes, so the next
  mind's copy-in progresses beside it. active_mut() gives only her own state; tier() is read-only.
- UnifiedTier: implements Execute (Step { tokens, from, logits_at_end } decoded on her bound stream,
  epoch checked; libllama's decode returns once outputs are readable, so Decoded is complete).
  context() is removed; logits_ith() and position_of() report read-only; raw_context() exists only
  under the test-fixtures feature, for custody replays that must put foreign state on a stream.
- residency::Native::Reported(message) keeps a backend refusal that has a message and no status.
- persona_switch runs through PersonaEngine (stage, handoff, release, submit) and requires
  test-fixtures for its replays.
- Tests: a step runs only for the active mind and one at a time; a handoff waits for a delayed decode
  completion while the next mind's copy-in is begun and landed, then binds next. The compile_fail test
  now covers holding her state across a submit.

Not built locally (the M5 is serving); CI is the first compile.

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

Codex on #6139 (80bc49c): UnifiedTier::Decoded was complete by construction, but Context::decode
reaches llama_decode only, and libllama synchronizes on result retrieval, so a submit (above all with
logits_at_end = false) can return while the device still runs the graph.

- llama: Context::synchronize() wraps llama_synchronize.
- residency::Execute gains settle(): wait until every submitted step finished on the device. The
  engine's settle() calls it; handoff still refuses while the decode is not landed.
- UnifiedTier: Decoded carries a landed flag the tier sets only when the device is known to be done:
  on settle() (llama_synchronize), or on logits_ith() (llama_get_logits_ith synchronizes). Her save
  (move out) settles first, so it never reads cells a decode is still writing.
- The handoff test now lands the decode through the tier's settle() (its attestation), not by hand.
- persona_switch settles after the replay's logits-free decode before her save.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…er the same basis

The persona scheduler's first decision for every turn (S1 of the serving integration): her token
history is the engine's, so a prompt that extends what her blocks hold, under the same basis (model,
adapter set and scales, her epoch, native media identity; Codex), prefills only the new tail.
Anything else restarts her at a newer epoch so stale blocks are never decoded against. A prompt that
adds nothing re-decodes her last token, since sampling needs its logits.

Pure planning in turn.rs, unit-tested without a model: tail-only prefill, the re-decoded last token,
diverging/shorter/empty/nothing-held restarts, and the same tokens under another model, adapter set,
epoch or media identity restart.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… time, and a turn prefills only her new tail

Serving integration S1 (MODULE-ARCHITECTURE 9.4, CONTINUUM-ENGINE 4.14). llamacpp_scheduler.rs (776
lines) advanced n_seq_max sequences per decode and dropped every sequence's KV when its turn ended,
so each turn re-prefilled the whole prompt. It is deleted. backends/persona_scheduler takes its place
behind the same surface (Scheduler / GenerationRequest / TokenEvent), so LlamaCppBackend changes only
where it spawns it:

- one driver thread owns the context and a PersonaEngine over UnifiedTier (two streams: the active
  mind and the next). Turns are served one after another; a switch is stage, settle, handoff, and the
  previous mind parks in the RAM tier (a one-off is forgotten).
- each persona keeps her blocks between turns. turn::plan decides the prefill from what her blocks
  hold under the same basis (gene set; the model is the context's own; no native media on this path):
  an extending prompt prefills only its tail, anything else starts her over at position 0.
- each Step carries its gene set; the tier applies it only when it differs from the set on the
  context, and only for the bound mind. A step at `from` drops whatever she held from there, so her
  stream never holds two tokens at one position (a re-decoded last token, a restart, a failed turn's
  partial tail).
- engine: Tier::release + PersonaEngine::forget give up a one-off's blocks only after she left the
  pipeline (tested: refused while active or retiring, the tier asked once after).
- the backend sizes the context as per-mind window x STREAMS. The launch's n_seq_max no longer
  drives decode; its plumbing (with_n_seq_max, batching_probe, LlamaCppLaunch.n_seq_max, profile
  lanes) is removed with the lanes in S3.

Not yet: the next mind's copy-in overlapping the active decode, cold minds paging out of RAM, and
routing residents here (S2; production still decodes over llama-server). Not built locally (the M5
is serving); CI is the first compile. A real-model run of the scheduler waits for a non-serving
executor.

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

# Conflicts:
#	core/vendor/LLAMA_CPP_PIN
#	core/vendor/llama.cpp
… MLX scaffold goes

Ratchets on #6140: three unwrap/unwrap_or sites in driver.rs become typed (a missing persona is a
one-off, a parked miss is a new mind by match, the turn result is a typed TurnError), and the one
saturation keeps its same-line reason. backends/mod.rs carried the tree's only OS gate there, for a
101-line phase-A MLX scaffold nothing calls; it and its two empty features are deleted. The doc-only
edits to prompt_assembly.rs and concurrent_streams_test.rs are reverted so their old sites stay out
of this change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…hold, the test tier releases

CI on d2c3d82: persona-llama failed to build (Step derived Debug/PartialEq/Eq while carrying its
genes, Arc<[(Arc<LoraAdapter>, f32)]>, which can have none of them; nothing compared or printed a
Step, so the derives go). persona-engine's pipeline TestTier lacked Tier::release. The ratchets rose
by one each: Scheduler::spawn/enqueue now refuse with SchedulerError {Spawn(io), Closed} instead of
a String (the backend's OnceLock keeps the typed refusal, no clone in argument position), and the
turn's elapsed_ms saturates through Duration arithmetic instead of a u64::MAX sentinel.

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

add/add conflicts in the five persona files and the content conflict in ci-change-scope.test.cjs
resolve to this branch's side. Verified: canary's persona files equal #6139's reviewed head
efa6150; every file this PR changes equals 997e30a; no other file differs from canary; the
only Cargo.lock difference is this PR's own two persona-engine dependencies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…fused retirement before any switch

Codex on #6140 at 17c208c, two defects the happy-path GPU replay did not exercise:

- Driver::serve sampled every prefill chunk and kept only the last. The sampler accepts what it
  samples, so a long prompt advanced her grammar, repeat penalties and RNG on phantom output.
  Earlier chunks now request no logits and are settled (UnifiedTier::settle synchronizes and marks
  the step landed); only the final prompt position is sampled.
- Driver::switch_to could not recover a refused copy-out: handoff had already bound next, the old
  mind stayed retiring, and the next turn skipped the retirement for an active id or staged into an
  occupied tier. PersonaEngine::finish_retirement now retries her copy-out and gives her back once it
  landed (RetireError when refused or still moving, she stays in custody). The driver finishes any
  retirement before it stages and again after the handoff; a CopyOut refusal during the handoff
  leaves next bound and is retried, never skipped.

Test: a_refused_copy_out_is_finished_before_the_next_switch_and_given_back_once (refused, then begun
and not landed, then given back exactly once, then A/B/A holds one of each).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… incarnation (agreed with Codex)

Scheduler::state() is a watch of EngineState: Starting(incarnation), Ready(EngineGeometry) read
from the created context (llama.cpp's applied n_ctx / n_batch / n_ubatch, the KV types and
attention it was made with, decoding = 1, staging = STREAMS - 1), or Refused with the reason.
Each snapshot names the engine incarnation it came from (rising per spawn), so serving retires a
stale observation. The batch the driver prefills in is now the applied one, not the request's.
llama: Context::n_batch / n_ubatch.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply and others added 16 commits November 21, 2026 19:12
…aptures

Every act a mind took must reach her next prompt as her step: the call and its outcome bound by
id. Counts calls missing from her next prompt, outcomes missing, 'its whole is #n above' lines that
point at a result her prompt does not hold, calls written as prose, and runs of identical acts.
std + serde_json; 1.2 s over the M5's 470 MB of captures.

## Measured (the M5, captures through build f3df880, 2026-11-22 01:12Z)
3,747 acts of 12 minds: 1,816 steps seen whole; 54 calls missing from her next prompt; 0 outcomes
missing; 209 dangling 'its whole is #n above' (checked by hand: a prompt saying 'its whole is #525
above' holds no #525); 0 prose calls; 9 runs of 3+ identical acts, longest 8. Broken: 263.

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

A peer's room message can quote her raw tool response (a MacBookPro resident posted repeat lines
and </tool_response> into chat), so 'its whole is #n above' counts only in her own tool results and
action lines. A yield her next prompt does not show is the time she cannot see passing, counted
apart from a dropped outcome.

## Measured (the M5, all captures, 2026-11-22 01:38Z)
3,789 acts: 1,853 steps seen whole; 6 calls dropped (3 code_shell, 2 across a room switch; 1
tool_output); 50 yields unseen; 0 outcomes missing; 0 dangling (the 209 reported in 1f41d13 were
peers' leaked text, retracted); 0 prose calls; 9 runs of 3+ identical acts. Broken: 6.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…s never reaches the room

Glass-boxed on the IntelMac by Cormac (2026-11-22; qwen2.5-coder-1.5b, 20k lanes): every result ended
with 'saved: tool_output({"outputId":..})', a ready-made call a 1.5B resident copied as her next act,
reopening a read whose whole was already in her prompt (4c9bb8d9: 4 times in a row, each succeeding).
And her '💭' room line posted her words whole, a fenced JSON call included, so roommates copied it with
an output id that was not theirs (8faf9269 replayed Soren's call; refused; then invented a near id).

- ResultAttribution::shown_whole: a result shown whole names no handle (results ring, act whole,
  stored whole, newest result label, full-result message). A summary or a collapsed pointer, where
  content is not shown, still names the handle that reopens it.
- continuum-tool-protocol without_calls: her words minus each fenced block or balanced object that
  parse_tool_calls reads as a call (the syntax owner decides, never a look). The act's room line uses
  it; a batch whose words were only a call leads with its act lines.

Tests: continuum-cognition lib 1,022 passed; the two working-memory tests that pinned a handle on a
whole result now pin its absence; continuum-tool-protocol her_words_keep_everything_but_the_calls.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…rom the archive drive before the engine loads it

The 5090 served Qwen3.8-27B from a 16 TB SATA HDD (Codex, 2026-11-22: the GGUF and the core exe on D:,
the home and KV pages on C: NVMe) because an install step pointed HF_HOME at the big drive, so one path
held the archive and the served model. Users install with no agent and no programming knowledge, so the
placement is the core's (docs/architecture/STORAGE-SERVING-TIER-GOVERNOR.md, ensure_hot_resident).

- model_registry::artifacts::hot_tier: before a launch, a model stored on another drive than the
  continuum home is copied (its shards and the sidecars the engine reads beside them: chat template,
  projector, json; never other quantizations in its folder) into <home>/models/hot/, each file to .part
  and renamed only when all are written. Room is the disk-pressure monitor's rule
  (DiskPressureLevel::from_pressure, now public): a copy that would push the home's volume out of
  Normal is not made, and models.hot.no_room says so. resolve_gguf prefers a complete hot copy
  (every file present at its stored size), so launch, sizing and sidecars read one path.
- The copy lives inside the tracked served-weights class (<home>/models), whose owner never evicts the
  active model; a hot copy always has its archive twin, so dropping an unserved one loses nothing.
- shard_set: the one definition of a model's weight files, shared by sizing (total_gguf_bytes) and the copy.
- prepare_local_launch promotes off the runtime (spawn_blocking) and loads Promotion::serving_path.

Not yet: volumes ranked by measured read throughput (today the home's drive is the fast tier by the
install's placement; Cormac's install design records measured throughput per volume, PR #6217), and the
placement on the health line.

Tests: hot_tier the_served_model_is_copied_up_once_and_read_from_the_fast_drive; continuum-engine
artifacts 18 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…nd; the node bus moves into SAGE

Joel, 2026-11-22: placement is the core's at runtime, dynamic, in Rust and the disk governor, never
an install step; 'c is typically fast flash and d is more of a cold cache ... same for mac too external
drives'. 0c7f5cb copied the model inside the launch path (a 16 GB copy blocking the launch); now:

- hot_tier::component::HotTier, a SAGE Component on the node bus: it watches serving/model (the
  launcher says which stored GGUF it serves via hot_tier::serve, never waiting), and when that model
  sits on a slower drive copies it up on the blocking pool while serving goes on; it publishes where the
  model is read from on serving/placement. The resolver reads a complete hot copy, so the next launch
  takes it; nothing relaunches for a copy.
- drives::DriveKind {Unknown, Spinning, Flash} from the OS (sysinfo Disk::kind), on every DriveInfo. A
  model moves up only onto a strictly faster drive (an unreported kind never wins; a home on a slow disk
  never pulls a model off flash: Cormac's review of 0c7f5cb), and only while the drive stays out of
  disk pressure by the monitor's thresholds.
- continuum_sage::component::node(): the node's one bus, below every crate that hears or says a node
  fact (it lived in continuum-mind, out of the engine's reach); the mind's room feed starts on it.

Tests: hot_tier 2 (copy-up once and read from the fast drive; moves only onto a faster drive with
room), continuum-sage 49, continuum-kernel drive 6 and disk 59, continuum-mind senses 3.
Cargo.lock: step-replay (1f41d13) recorded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
c876007 wired only the llama-server launch; the M5 serves in-process, so no placement was made.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
Joel, 2026-11-22: 'Don't enforce arbitrary rules'; 'switching contexts is so damn fast anyway' (26 ms
p50 on the M5, aa734cc). frame::pick returned a running turn before asking anything, so a turn that
began kept the Core whatever waited: Aris decoded 19,540 tokens for 10.4 min (b8ad572's previous
build, 03:06Z) with 13 turns queued, an addressed mind among them able only to wait.

Now the pick ranks every turn by need. A running turn keeps the Core while nothing needs it more,
because at equal need a switch gains nothing (so turns still run whole, the 11-21 measurement); a more
urgent turn takes the next frame and the running one resumes from her cached state when it is next most
needed. The driver already advances one step per frame and binds whichever turn is picked.

Next (not here): a running turn's need from her own output's novelty, so a turn that repeats itself or
runs far past what she has needed fades on its own.

Tests: persona_scheduler 23 passed; the_most_urgent_turn_takes_the_next_frame_even_from_a_running_one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
… it, never the pools by their own budgets

On the M5 (2026-11-22) the volume sat at 92% (High) while the broker relieved nothing every five
seconds: it ranked pools by their OWN budget (broker.rs relieve: p.pressure() >= act_above), so the
only pool that read pressured was the disk monitor itself, which is signal-only and frees 0 by design
(disk_pressure.rs ResourcePool impl), and every pool that held bytes read under budget (the KV page
store: own pressure 0.0, volume 0.92). 42 GB of finished worktrees and build output stayed.

- system_resources::disk_relief: the disk monitor's poll is said on the node bus as one frame
  (resources/disk, every drive). DiskRelief, a SAGE component, watches it; for each volume at High or
  Critical it asks the pools whose root() is on that volume, the most to give first, for exactly the
  bytes back below Warning, stopping when enough is freed, and publishes what each gave
  (resources/disk_relief) with a disk.relief probe. Need Urgent while relieving, Content otherwise.
- ResourcePool::root(): where a pool's bytes live (None for memory/device pools). KvPageStorePool,
  RotationLogPool and FilesystemTierPool name their tracked folders.
- PressureBroker::register hands any pool with a root to disk relief and leaves it out of relieve;
  the broker still shows it.
- DiskPressureLevel::{WARNING_AT, HIGH_AT, CRITICAL_AT}: the thresholds have one owner.
- continuum-kernel depends on continuum-sage (sage depends only on continuum-base).

Next: pools for the classes with none (build output, finished worktrees with alternates repointed
first), then the remaining tiers (RAM, VRAM) as the same components.

Tests: disk_relief a_volume_at_high_asks_the_pools_on_it_for_the_room_back_below_warning; kernel
broker 27, pool 73, disk 59 passed. One pre-existing flake under the parallel run, unrelated:
class_writer a_held_lock_refuses_a_second_holder passes alone (shared lock path between tests).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…he broker's; resolution probes only on news

- DevWorktreePool (new, owner of the newly tracked `worktrees` class: 40 GB untracked on the M5,
  2026-11-22): removes only what git's facts say is safe, least recently touched first, via
  `git worktree remove`: clean (no uncommitted change), recreatable (HEAD on a remote branch),
  unborrowed (no other object store's alternates name a store in its git dir: the chain that broke
  three checkouts when removed by hand), idle (untouched a day). A kept worktree is named
  (disk.worktrees.kept) with its reason.
- CargoTargetPool::root(): build output reaches disk relief.
- Correction to 6af90ba: the broker again trims a disk pool over its OWN budget (its cap);
  disk relief adds the volume's pressure, which no one covered. Both broker tests that pinned the
  cap (broker_relieve_actually_deletes_from_an_over_budget_pool, broker_reclaims_release_...) pass.
- disk.root.resolution: said when a root's outcome changes or a resolution takes a poll interval
  (~250 identical lines a minute for absent roots on the M5).

Tests: dev_worktree_pool only_a_finished_clean_pushed_unborrowed_worktree_is_removable (real git
repos: done removable; recent, dirty, unpushed, borrowed-from kept); every_cache_class_has_a_decided
_eviction_story; kernel disk 60, broker 27, pool 74 passed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
- STARVED is measured, never a minds-per-lane ratio (Joel: "Remember we're one slot"):
  more turns that never reached the model than acts that did. The M5's 07:17Z hour
  (4 minds, 1 slot, 78 acts, 0 never-reached, 84% reuse) read STARVED; it is now a test
  that must read healthy. The verdict drives no action; the spawner's seat cap is unchanged.
- step-replay resolves its home through continuum_base::home::continuum_home()
- continuum-host::system_volume: the system root and the mount-comparison spelling, logic
  once in mod.rs, the OS calls in unix.rs/windows.rs; drives.rs uses it (no cfg in logic)
- drives.rs is named as the drive inventory's one probe in the probe ratchet's OWNERS
- dead process_rss_mb removed (no caller), with its cfg branches and private probes
- system_profile reads free RAM from the memory authority's sample_host_memory()
- exact restoration asks read_pin::FORBIDS_REPLACEMENT instead of cfg!(windows)
- gguf_has_embedded_mtp reads tensor names through candle's GGUF reader (the hand parser and
  its literal take() ceilings deleted; artifacts tests 19/19)
- DevWorktreePool runs git through bounded_command (spawn sites back to the base)
- unwrap defaults: is_some_and / trim_start_matches, or justified on the line

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
- gguf_has_embedded_mtp returns candle's own error (io errors convert), no stringly map_err
- DevWorktreePool::Kept::RemoveRefused, a unit variant in place of a constant String
- the SAGE scheduler owes no yield when no running ticket is unasked (let-else, no map_or(0))
- hot_tier::serve borrows the served path; the broker registers rooted pools with Arc::clone

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply changed the title A turn that cannot fit is refused at the door as ContextExceeded, so her caller refits once SAGE minds: need-ranked frames, the causal contract (no reopen loops), hot tier and disk relief as components, health measured on one slot Nov 22, 2026
@joelteply
joelteply changed the base branch from codex/native-tail-tools to canary November 22, 2026 08:30
joelteply and others added 3 commits November 22, 2026 02:32
…kernel, host or CLI-lifecycle dependency)

The selector's own test expected a kernel, host or CLI-lifecycle change to run them; neither depends on
those crates (sage is under the kernel, step-replay reads captures on continuum-base alone), so the
selector rightly skipped them and the test failed, skipping every crate job behind it.

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

Copy link
Copy Markdown
Contributor Author

PASS at d4d48bd (Cormac, IntelMac; source and tests read at the exact head, not my session's work).

Claims verified:

  1. Health verdict is measured. continuum-vitals/src/health_ledger.rs::verdict returns Starved only when lane_starved > acts (after Held, Empty and Idle), never from minds per lane. continuum-core/src/modules/citizen_health/tests.rs:42-43 pins the M5's 07:17Z hour (h(4,1,78,6)) as Healthy, and the 78=78 boundary as Healthy. Ran cargo test -p continuum-core --lib citizen_health: 11/11. Mutation: >= for > fails tests.rs:43, so the boundary is enforced.
  2. The system_volume adapter owns the SystemRoot read. continuum-host/src/system_volume/mod.rs holds the logic, unix.rs/windows.rs hold only the OS calls (SystemRoot env on Windows, verbatim-prefix normalization), and continuum-kernel/src/system_resources/drives.rs:89,117,126,148,151 goes through it. Its only cfg(windows) sites are test-fixture spellings, not branches in logic. Ran cargo test -p continuum-host --lib system_volume: 2/2; cargo test -p continuum-kernel --lib drives -- --skip metal: 4/4.
  3. The loop fix ae790c5 is in head. continuum-tool-protocol/src/parser/without_calls.rs strips a fenced block or balanced object only when parse_tool_calls reads a call in it (strings and escapes respected), and ResultAttribution::shown_whole drops the reopen handle from a result shown whole. Ran cargo test -p continuum-tool-protocol --lib: 66/66.

Not covered by this review: the other ~265 files of the 271 changed; CI is the gate for those.

joelteply and others added 2 commits November 22, 2026 19:31
…ounded

CI's core lib job ran out its hour on airc::inbound_attach::tests::
a_peer_command_in_a_room_never_reaches_a_mind_and_room_speech_still_does (2026-11-23, run
45086472721). Inferred cause, the same class as the SAGE clock's: the one feed was a SAGE component
started lazily on whichever runtime first heard an event; when that runtime (an earlier test's)
ended, its worker ended with it, later events went nowhere, and the test waited on
calling.changed() unbounded.

The feed only classified an event and emitted it, so the hearing task now does that itself, under a
tokio mutex no runtime owns: one less queue hop on every live room event, and no worker to outlive.
The feed is still the SAGE topic node/feed that every resident's senses subscribes to. The test
waits at most 30 s, so a wake that never comes fails in seconds.

Local: continuum-mind senses 3/3, continuum-core inbound_attach 17/17; the full ordering is CI's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…egistry; CI's three failures fixed

- feed_events looked her name up in PersonaAircRuntimeRegistry::try_global(); a runtime held in
  any other registry (the membership test's own) read as nameless, so her feed never started and a
  rejoin left her pump detached ((false,false) where (true,true) is owed). AircCitizen gains
  agent_name() (PersonaAircRuntime its field, the adapter Airc::agent_name, the stub a fixed name)
  and her senses read it from the runtime she already holds.
- pinned_act_result test asserted the saved inventory's handle after an exact-refusal refit. Since
  ae790c5 a result shown whole carries no reopen call, and the refit (41 tokens off her fresh
  tail) correctly leaves her held view whole. The invariant is goal 7's: the inventory is whole or
  reachable by its handle, the same form custody.rs took in that commit.
- stringly_errors_in_tests 260 -> 259: the bounded wake wait's outcome is typed (elapsed / ended /
  wake), not formatted into a String.

continuum-core: membership + pinned_act_result 2/2, inbound_attach 17/17; continuum-mind senses and
conversation 14/14.

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

Copy link
Copy Markdown
Contributor Author

PASS at 795662d (Cormac, IntelMac). This re-verify covers the two commits after my d4d48bd PASS (0831771, 795662d). I checked it by reading the diff and CI at this head; I did not run tests locally at this head.

Claims verified:

  1. The ratchet failure at 0831771 (stringly_errors_in_tests 259 -> 260) is fixed. The inbound_attach wake wait now keeps a typed outcome (elapsed / ended / wake) instead of formatting it into a String. CI's "source-hygiene ratchets (fast)" passes at this head.
  2. Her senses take her name from her own runtime. AircCitizen::agent_name() is implemented by PersonaAircRuntime (its field), the adapter (Airc::agent_name) and the stub. polled.rs reads self.runtime.agent_name(). The PersonaAircRuntimeRegistry::try_global() lookup and its mind.feed.unbooted None path are deleted. That lookup made a runtime held in any other registry read as nameless, so the feed never started; this is one owner instead of a process-global lookup.
  3. The room feed has no worker of its own (0831771). hear classifies before taking the lock, and only the emit is serialized, so it waits no longer than the old tell().

CI at this head: every check SUCCESS or SKIPPED except "core binaries (windows-x86_64)", which was still in progress when I read it.

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.

1 participant