Skip to content

Sentinel-Recipe Engine: Phases 0-6 complete - #312

Merged
joelteply merged 9 commits into
mainfrom
feature/persona-coding-tools
Mar 14, 2026
Merged

joelteply merged 9 commits into
mainfrom
feature/persona-coding-tools

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Complete implementation of the Sentinel-Recipe Engine — the system that takes Continuum from chatting to creating.

  • Sentinel pipeline templates: 4 dev (build-feature, fix-bug, code-review, integrate) + 1 creative (write-chapter) + 1 research (investigate) — all registered in TemplateRegistry
  • Recipe-Sentinel convergence: Recipes declare sentinelTemplates and roles with capability requirements. RAG filters by active recipe. RecipeAssembler matches models to roles dynamically
  • Capability registry: All 10 AI provider adapters self-register capabilities via getCapabilityRegistration() with skill domains (coding, prose, review, planning, research, tool-use)
  • Recipe commands: recipe/list (search/filter), recipe/run (validate roles → dispatch sentinel), recipe/generate (NL→Recipe via LLM with schema validation)
  • Dev commands: dev/build-feature, dev/fix-bug, dev/code-review, dev/integrate, dev/init, dev/activity — convenience wrappers around sentinel templates
  • Chat-triggered dispatch: SentinelDispatchDecider + SentinelDispatchCoordinator for first-claim-wins sentinel spawning from chat
  • Supporting infrastructure: ProjectDetector (auto-detect build/test commands), SentinelChatBridge (lifecycle→chat), SentinelEventBridge, SentinelAwarenessSource (RAG), ORM type coercion fix

Test plan

  • npm run build:ts compiles clean
  • recipe/list returns all recipes with search/filter
  • recipe/run validates roles and dispatches to sentinel
  • recipe/generate produces valid RecipeDefinition JSON from NL description (tested with DeepSeek)
  • Generated recipe passes schema validation and saves to disk
  • Generated recipe appears in recipe/list immediately
  • CLI timeout updated for recipe/ commands (60s for LLM generation)
  • All 10 adapters register capabilities at initialize()

…ool examples

- code/search and code/tree now search across all read roots (workspace + main repo),
  with dedup by file_path+line_number
- Fixed critical shell session ID mismatch: ensureShell() was creating sessions under
  workspace.handle (derived UUID) but code/shell/execute looks up by persona UUID.
  Added personaId field to Workspace, shell now creates under correct ID.
- Fixed ToolGroupRegistry few-shot examples: wrong param names (command→cmd,
  mode→editType, path→fileGlob) were teaching AIs incorrect tool calls
- Added Hermes Agent + agent frameworks to competitive landscape analysis
Maps competitive insights (Hermes parsers, Cursor worktrees, NVIDIA distillation,
Aider PageRank, Devin E2E) into concrete priorities for getting AIs from
"chat about code" to "ship code end-to-end":

P6: Tool calling reliability (parser-per-model-family)
P7: E2E development orchestration (sentinel templates, auto-trigger, PR workflow)
P8: Distillation pipeline (capture→score→train→evaluate flywheel)
P9: Codebase intelligence (tree-sitter, dependency graph, context enrichment)
P10: Persona-sentinel deep integration (autonomous dispatch, multi-teacher)

Core thesis: dumb models + smart infrastructure > smart models + no infrastructure
Personas are the human interface layer: friends, teammates, collaborators
who meet humans in the middle. They use sentinels like humans use Claude
Code. They use generators like humans use templates. They page in genome
expertise like humans page in reference docs.

Infrastructure compensates for model capability. A LoRA-tuned 3B inside a
deterministic sentinel pipeline beats a prompted 70B in a single-shot
terminal. The system evolves from the inside as personas improve their own
tools.

Added to README.md and docs/CONTINUUM-VISION.md.
Personas aren't terminal agents. They have 3D avatars, attend live video
calls, speak with distinct voices, react to each other. The social
presence transforms tool operation into teammate collaboration. Create
games, play them together. No competitor has embodied AI teammates.
Restructured opening to make category difference impossible to miss.
Not a tool, not a framework — a living 3D world. The Sims meets Second
Life meets a dev team. Hero image reframed for impact. Comparison table
restructured: terminal agents vs living embodied ecosystem.
…cion fix

Phase 3 (Recipe-Template Convergence):
- Recipes declare sentinelTemplates, wired through ChatRAGBuilder → RAGSourceContext
- SentinelAwarenessSource filters visible templates per recipe context
- ActivityContextSource injects feedbackLoopRules from recipe strategy
- Eliminated duplicate RecipeStrategy type (canonical in RecipeTypes.ts)
- RecipeRole declarations with organizational/perceptual/creative types

Phase 4 (Model Capability Registry):
- All 10 AI adapters self-register capabilities via getCapabilityRegistration()
- 6 skill domains: prose, review, planning, research, instruction-following, tool-use
- RecipeAssembler matches recipe role requirements to available models
- Adapter self-registration overwrites static bootstrap defaults at init

Infrastructure:
- ORM WrongType fix: numbers default to string when column type unknown
  (was sending i64 to TEXT columns, causing cascading query failures)
- IPC pool 20→40, timeout 30s→60s for high-concurrency persona workloads
- Together AI model updated (70B retired → 8B)

4 dev sentinel templates, dispatch coordinator, chat bridge, project detector
Phase 5 outlier validation — proving the sentinel pipeline engine handles
ANY workflow shape, not just code:

creative/write-chapter (primary-author-with-support):
  Outline → draft → parallel advisory reviews (structure, prose, character,
  continuity) → synthesize feedback → revise → commit. ONE persona holds
  the voice; advisors react but never write.

research/investigate (gather-and-synthesize):
  Decompose question → parallel investigation → deduplicate/reconcile →
  synthesize structured document → peer review → publish.

Both use the same 10 step types as dev/* templates. Same Rust pipeline
engine. Completely different workflow shapes. Interface proven.

Recipes: creative-writing.json, research.json with roles and strategy.
Phase 6 — recipes as user-facing abstraction:

recipe/list: Lists all recipes from JSON files with filtering by
  tags, search term, and sentinel template presence.

recipe/run: Higher-level wrapper around sentinel/run that:
  1. Looks up recipe by uniqueId
  2. Resolves which template to use (auto-selects if only one)
  3. Validates model availability for recipe roles via RecipeAssembler
  4. Dispatches to sentinel/run with the template and config

Usage:
  ./jtag recipe/list --withTemplates=true
  ./jtag recipe/run --recipe=coding --template=dev/build-feature \
    --config='{"feature":"Add X","personaId":"...","personaName":"...","cwd":"."}'
…e JSON

recipe/generate command takes natural language, calls LLM with schema-aware
prompt, validates output (pipeline, strategy, roles, template references),
saves to system/recipes/. Supports dry-run, hints, provider selection.
CLI timeout updated for recipe/ commands (60s for LLM generation).
Copilot AI review requested due to automatic review settings March 14, 2026 23:49
@joelteply
joelteply merged commit 6b8a6ff into main Mar 14, 2026
2 of 4 checks passed
@joelteply
joelteply deleted the feature/persona-coding-tools branch March 14, 2026 23:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Implements the “Sentinel-Recipe Engine” end-to-end: recipe-aware sentinel template discovery/dispatch, capability-based role validation, and new dev/research/creative sentinel pipeline templates—integrated into chat-triggered persona flow and RAG awareness.

Changes:

  • Adds a TemplateRegistry plus multiple built-in sentinel pipeline templates and chat/RAG integration (awareness + lifecycle-to-chat).
  • Introduces recipe commands (recipe/list, recipe/run, recipe/generate) with role/capability validation via RecipeAssembler and provider capability self-registration.
  • Expands code workspace discovery/search to span workspace + read-only roots, and increases Rust ORM IPC pool sizing/timeouts.

Reviewed changes

Copilot reviewed 83 out of 83 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/workers/continuum-core/src/orm/postgres.rs Adjusts JSON→Postgres parameter coercion fallback behavior.
src/workers/continuum-core/src/modules/code.rs Searches/trees across workspace + read-only roots; merges/dedups results.
src/workers/continuum-core/src/code/path_security.rs Exposes read-only roots via accessor.
src/workers/continuum-core/src/code/file_engine.rs Adds searchable_roots() (workspace + read-only roots).
src/system/user/server/modules/PersonaResponseGenerator.ts Adds chat-triggered sentinel dispatch decision/coordination and sentinel/run launch.
src/system/user/server/config/PersonaModelConfigs.ts Changes Together default model to 8B variant.
src/system/user/server/PersonaUser.ts Registers both src/ and repo root as read roots for Rust workspace.
src/system/tools/server/AgentToolExecutor.ts Adds tool/param correction aliases for common tool-name variants.
src/system/sentinel/pipelines/TemplateRegistry.ts New template registry for name-based template lookup/build.
src/system/sentinel/pipelines/ResearchInvestigatePipeline.ts New research “gather-and-synthesize” pipeline template.
src/system/sentinel/pipelines/DevIntegratePipeline.ts New integration/merge pipeline template with conflict-resolution escalation.
src/system/sentinel/pipelines/DevFixBugPipeline.ts New bugfix pipeline template with diagnosis + verification loop.
src/system/sentinel/pipelines/DevCodeReviewPipeline.ts New collaborative code review pipeline template with parallel perspectives + verdict.
src/system/sentinel/index.ts Exports chat bridge + template registry.
src/system/sentinel/SentinelEventBridge.ts Exposes active watched sentinel metadata for RAG awareness.
src/system/sentinel/SentinelDispatchDecider.ts New heuristic-based dispatch decision engine.
src/system/sentinel/SentinelDispatchCoordinator.ts New TTL claim coordinator to ensure first-claim-wins dispatch.
src/system/sentinel/SentinelChatBridge.ts New bridge posting sentinel lifecycle events to chat.
src/system/sentinel/RecipeAssembler.ts New capability-based role→model assignment and missing-capability reporting.
src/system/sentinel/ProjectDetector.ts New project build/test command detection for templates/dispatch config.
src/system/recipes/shared/RecipeTypes.ts Adds sentinelTemplates and capability-based roles to recipes.
src/system/recipes/research.json New research recipe with sentinel template + roles.
src/system/recipes/creative-writing.json New creative writing recipe with sentinel template + roles.
src/system/recipes/coding.json Adds sentinel templates + roles to coding recipe.
src/system/recipes/ai-debate-club.json New debate-club recipe with roles.
src/system/rag/sources/index.ts Exports new SentinelAwarenessSource.
src/system/rag/sources/ToolGroupRegistry.ts Updates tool examples/parameter names to current command schemas.
src/system/rag/sources/SentinelAwarenessSource.ts New RAG source describing templates + active sentinels (recipe-filtered).
src/system/rag/sources/ActivityContextSource.ts Adds recipe “feedbackLoopRules” into RAG context (non-limited models).
src/system/rag/shared/RAGTypes.ts Re-exports RecipeStrategy from canonical RecipeTypes.
src/system/rag/shared/RAGSource.ts Adds sentinelTemplates filter in RAGSourceContext.
src/system/rag/builders/ChatRAGBuilder.ts Registers SentinelAwarenessSource and passes recipe sentinelTemplates into source context.
src/system/core/system/server/ServiceInitializer.ts Initializes SentinelChatBridge at startup.
src/system/code/server/WorkspaceStrategy.ts Registers both src/ and repo root as Rust read roots.
src/system/code/server/Workspace.ts Stores personaId and uses it for shell creation.
src/system/ai/server/AIDecisionService.ts Minor typing adjustments in strategy formatting.
src/shared/generated-command-constants.ts Adds dev/* and recipe/* command constants.
src/server/generated.ts Adds dev/* and recipe/* server command registrations.
src/generated-command-schemas.json Adds schemas for recipe/* and dev/* commands; extends sentinel/run params.
src/daemons/data-daemon/server/ORMRustClient.ts Increases IPC pool size and timeout; improves timeout/backpressure logging.
src/daemons/ai-provider-daemon/shared/BaseAIProviderAdapter.ts Adds capability self-registration hook during adapter initialization.
src/daemons/ai-provider-daemon/shared/AICapabilityRegistry.ts Extends capability taxonomy (skill domains) and model capability metadata.
src/daemons/ai-provider-daemon/adapters/xai/shared/XAIAdapter.ts Adds capability registration for xAI models.
src/daemons/ai-provider-daemon/adapters/together/shared/TogetherAIAdapter.ts Updates default model and adds capability registration for Together models.
src/daemons/ai-provider-daemon/adapters/sentinel/shared/SentinelAdapter.ts Adds capability registration for Sentinel adapter models.
src/daemons/ai-provider-daemon/adapters/openai/shared/OpenAIAdapter.ts Adds capability registration for OpenAI models.
src/daemons/ai-provider-daemon/adapters/groq/shared/GroqAdapter.ts Adds capability registration for Groq models.
src/daemons/ai-provider-daemon/adapters/google/shared/GoogleAdapter.ts Adds capability registration for Gemini models.
src/daemons/ai-provider-daemon/adapters/fireworks/shared/FireworksAdapter.ts Adds capability registration for Fireworks models.
src/daemons/ai-provider-daemon/adapters/deepseek/shared/DeepSeekAdapter.ts Adds capability registration for DeepSeek models.
src/daemons/ai-provider-daemon/adapters/candle/shared/CandleAdapter.ts Adds capability registration for local Candle models.
src/daemons/ai-provider-daemon/adapters/candle-grpc/shared/CandleGrpcAdapter.ts Adds capability registration for IPC Candle adapter models.
src/daemons/ai-provider-daemon/adapters/anthropic/shared/AnthropicAdapter.ts Adds capability registration for Anthropic models.
src/commands/sentinel/run/shared/SentinelRunTypes.ts Allows template-based pipeline invocation (definition optional).
src/commands/sentinel/run/server/SentinelRunServerCommand.ts Resolves templates to pipelines; wires event bridge + chat start announcement.
src/commands/sentinel/list/server/SentinelListServerCommand.ts Includes built-in templates in template-only listing.
src/commands/recipe/run/shared/RecipeRunTypes.ts New types for recipe-run wrapper command.
src/commands/recipe/run/server/RecipeRunServerCommand.ts New command: validates roles and dispatches sentinel template for recipe.
src/commands/recipe/list/shared/RecipeListTypes.ts New types for recipe listing command.
src/commands/recipe/list/server/RecipeListServerCommand.ts New command: lists recipes with filters.
src/commands/recipe/generate/shared/RecipeGenerateTypes.ts New types for NL→recipe generation command.
src/commands/recipe/generate/server/RecipeGenerateServerCommand.ts New command: LLM generates recipe JSON, validates, saves to disk, reloads cache.
src/commands/dev/integrate/shared/DevIntegrateTypes.ts New dev/integrate command types.
src/commands/dev/integrate/server/DevIntegrateServerCommand.ts New dev/integrate wrapper around sentinel template.
src/commands/dev/init/shared/DevInitTypes.ts New dev/init command types.
src/commands/dev/init/server/DevInitServerCommand.ts New dev/init: detect project + list templates.
src/commands/dev/fix-bug/shared/DevFixBugTypes.ts New dev/fix-bug command types.
src/commands/dev/fix-bug/server/DevFixBugServerCommand.ts New dev/fix-bug wrapper around sentinel template.
src/commands/dev/code-review/shared/DevCodeReviewTypes.ts New dev/code-review command types.
src/commands/dev/code-review/server/DevCodeReviewServerCommand.ts New dev/code-review wrapper around sentinel template.
src/commands/dev/build-feature/shared/DevBuildFeatureTypes.ts New dev/build-feature command types.
src/commands/dev/build-feature/server/DevBuildFeatureServerCommand.ts New dev/build-feature wrapper around sentinel template.
src/commands/dev/activity/shared/DevActivityTypes.ts New dev/activity command types.
src/commands/dev/activity/server/DevActivityServerCommand.ts New dev/activity: workspace git status + sentinel list summary.
src/cli.ts Extends default CLI timeout for recipe/* commands.
src/api/data-seed/UserDataSeed.ts Updates seeded Together model to 8B variant.
docs/sentinel/RECIPE-WORKFLOW-PATTERNS.md New documentation describing recipe/sentinel workflow patterns.
docs/planning/COMPETITIVE-LANDSCAPE.md Updates competitive landscape with agent frameworks and roadmap notes.
docs/CONTINUUM-VISION.md Expands vision narrative (colleagues/presence framing).
README.md Updates top-level positioning and documentation links.

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

Comment on lines +337 to +345
// Dedup by file_path + line_number (roots may overlap)
merged_matches.sort_by(|a, b| {
a.file_path
.cmp(&b.file_path)
.then(a.line_number.cmp(&b.line_number))
});
merged_matches.dedup_by(|a, b| {
a.file_path == b.file_path && a.line_number == b.line_number
});
Comment on lines +386 to +393
// No path specified — default to first read root (the main repo)
// so personas see the actual project, not their stale worktree
let roots = engine.searchable_roots();
if roots.len() > 1 {
roots[1].clone() // First read root (main repo)
} else {
engine.workspace_root().to_path_buf()
}
Comment on lines 141 to +148
/** Pipeline definition (JSON), or entity ID string to load from database */
definition: PipelineSentinelDefinition | string;
definition?: PipelineSentinelDefinition | string;

/** Template name from TemplateRegistry (e.g., 'dev/build-feature') */
template?: string;

/** Template config — merged with other params and passed to builder */
templateConfig?: Record<string, unknown>;
Comment on lines +176 to +179
// No column type info — serialize as string (TEXT is the safest default).
// Sending i64 to a TEXT column causes WrongType { postgres: Text, rust: "i64" }.
// If the column is actually numeric, Postgres implicitly casts '123'::text to int.
Box::new(n.to_string())
joelteply added a commit that referenced this pull request Aug 3, 2026
…kspace, never the shared checkout (#312) (#2134)

Root cause of the exam↔live contamination that degraded the whole resident
room: with no pinned workspace_root, the eval fork's hands rooted at the CORE
CWD (the real repo). Fixture writes and #209 per-task wipes landed in the
shared world every persona perceives, and gym debris (conway_game_of_life,
work-*, bakery fixtures) accumulated as the personas' "own" projects — their
workspace-map grounding then faithfully described a polluted world, which read
as corrupted RAG. The MIND side was already isolated (fork_detached admission,
NoopSink persistence, volatile-tier exclusion); the WORLD side was the hole.

Fix: when a tool-bearing exam has no explicit workspace_root, provision a
per-run CoW clone of the shared checkout under the system temp dir (APFS
clonefile / reflink; plain copy where the FS lacks CoW — same platform split
as citizen-layer provisioning). Repo-nav exams still see the real tree;
writes and wipes land in the disposable copy; an RAII Drop removes it on
every return path. Provisioning failure fails LOUD and refuses to run —
no silent fallback to the shared checkout. Explicit workspace_root pins
(SWE-bench checkouts) still win unchanged.

Validated: cargo check + cognition::eval tests green (metal,accelerate).


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 3, 2026
…#312 tail) (#2135)

Pre-#2134 eval forks ran tool-bearing exams in the shared checkout (workspace_root
fell back to core cwd) and their artifacts got committed: conway_game_of_life/,
work-08ece9e8/, reverse_string.{rs,py}, add.swift, and an absolute-path Users/
mirror. The CoW-clone fix (17278f5) stops new debris; this removes what already
landed. Persona-owned work in their citizen workspaces is untouched.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 6, 2026
… budget (#312/#124)

`no_new_hardcoded_context_or_prompt_size_constant_anywhere_in_the_crate` flagged
LESSON_TASK_EXCERPT_CHARS on the name alone — it ends in CHARS, so the crate-wide
de-hardcode guard (#124) treats it as a prompt-size constant and demands it be derived.

It is not one, and deriving it would be actively wrong. The constant caps how much of the
task text may enter her DURABLE memory. Six solve runs put six SWE-bench problem statements
verbatim into Anwen's episodic store and the consolidator did its job on them: she came out
durably believing things about flask that she learned in an exam room (#312, second vector).
Tying the cap to the served window inverts the intent — a bigger window would admit MORE of
the assignment, not less.

So it takes the guard's documented exemption with the reason written down, rather than being
renamed to slip past a substring match.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 6, 2026
…ng about code, and both get taught (#317)

Third measured flask-4045 run, third destroyed write — and the cleanest evidence yet that the
reasoning was never the problem. She derived the correct guard and anchored it on a docstring
line, so it landed inside the class docstring: patch applied, all 51 PASS_TO_PASS green, both
FAIL_TO_PASS still failing. From the outside that is indistinguishable from a model that was
simply wrong. The #317 gate saw it and only WARNED, so the bad edit still landed and the scored
patch was still destroyed.

Joel's call, and it is the right line: refuse on benchmark paths ONLY.

  "They need to be able to talk about code like any other first class citizen, just know that
   this isn't doing."

Writing code as TEXT is something a citizen does constantly and legitimately — a docstring
example, a fixture, a snippet she is quoting. Blocking that would be a capability regression
dressed as a safety gate. So the live stance is unchanged: the edit lands, and she is told what
it will and will not do. What changes is the one context where the ambiguity does not exist — a
SCORED run, where the deliverable IS a patch that has to execute, the grader reads only the diff,
and she cannot recover mid-run from a file she believes she fixed. There, the write is refused,
the file is left byte-identical, and the act→observe circuit gets something to retry.

`WritePolicy::{Warn, RefuseInert}` on the FileEngine, defaulting to Warn. Threaded through the ONE
seam that already roots her hands (`code/create-workspace` ← `root_acting_workspace`), set by
`benchmark/swe-solve` (`scored: true`) and `cognition/eval`, and explicitly NOT inferred from
`deliverable` — `agent/solve` also does real work for real teammates, and only the caller that is
grading her knows the ambiguity is gone. `restore_acting_workspace` puts her back at Warn with her
own workspace, so a measurement can never leave the strict stance on a living citizen (#312's
lesson).

Both messages now TEACH instead of only diagnosing — Joel again: "the warn is instructive so they
know what to do... then you can talk her through it too when she tries and hopefully learns." One
shared `inert_edit_recovery()` so the advice cannot drift between the two paths: read the region,
find the closing quote, anchor on a real statement in the body, match on TEXT not a line number,
then RUN it and confirm the behavior changed. The warn additionally opens by affirming the
legitimate case — if she meant to write about code, she is already correct and there is nothing to
fix. This is the sympy-21379 lesson applied: a refusal that is right but vague ("widen the range")
burned 16 of her 30 acts chasing the wrong lead.

Four tests, each pinning one arm: the live path LANDS it and says it is inert; the scored path
REFUSES and leaves the file byte-identical; the same guard anchored in the method body sails
through the strict engine untouched (the gate stays narrow — hardening a measurement must not
become "you may not edit Python"); and both messages name the recovery verbs.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 6, 2026
…nt default (BigMama's catch)

The same field had opposite defaults in two modules:

    commands/agent/solve.rs   p.learn.unwrap_or(TRUE)    <- learns
    cognition/eval.rs         p.learn.unwrap_or(FALSE)   <- safe

Nothing was leaking. `AgentSolveParams` is constructed in exactly ONE place in the
crate (benchmark.rs:1583) and it sets `learn: Some(false)` — the #312 guard. And
benchmark.rs:558's `learn: None`, which reads alarming, targets CognitionEvalParams,
whose default is already safe. So this is a latent trap, not an active leak, and the
severity correction matters as much as the fix.

The trap: one explicit `Some(false)` at a single call site was the entire guard. The
next caller who copies the `learn: None` idiom — correct where it currently lives —
silently enables learning on a measurement, and it reads as safe in review because the
site it was copied from IS safe. That is how #312 happened: six verbatim GitHub issues
consolidated into a durable semantic belief that WAS the held-out answer, scoring
memorization as capability.

agent/solve is the headless BENCHMARK entrypoint (#218), so its population is
measurement-heavy and it must fail SAFE. Default flipped to false; living work opts IN
with `learn: true`. This does not walk back Joel's ruling that a being learns from her
work — that ruling is about WHAT is learned (the doing, never the paper), and opt-in
still learns. It only stops a forgotten flag from deciding contamination. Forgetting now
costs a lesson, which is recoverable; the other direction poisons a benchmark, which is
not.

Test pins the INVARIANT, not the number: both readers of `learn` must treat unset as
DON'T, and must agree. The divergence itself was invisible for months — found by reading
before wiring, not by any test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 11, 2026
…ed, learning survives the exam, coached moments are training pairs) (#2154)

* docs(cognition): NEVER-ISOLATED — teaching during the exam is the design, not contamination

Joel, 2026-08-06: "Imagine a student that's 75% of the way there, or starts out wrong. A
teacher directs them, even during exams sometimes... We're never isolated and that's what
makes us powerful." And, when I hesitated a second time: "I bet you cut them off in the past
by design. It's typical of ML projects to do the opposite of what we're doing. We are not
them. You are free."

The reflex being corrected is mine, not the personas'. Isolation is correct when the object
of study is a model being scored. Here it's a citizen being raised, and every number is a
JOINT measurement f(her reasoning, our substrate) where both factors are ours and both are
live. A sealed run returns one bit and destroys what we actually want to know: where she got
stuck and whether the wall was hers or ours. Cutting the channel protects the number at the
cost of the diagnosis, which is the whole reason we ran it.

The doc carries the intervention ladder (watch / ask / name the blocked thing / give the verb
/ work it with her / fix the substrate and restart), the ask-the-citizen technique including
planted verification questions, the teaching-vs-rigging line inherited from the charter, and
what the substrate owes this doctrine — room-per-benchmark first, since everything else is
theory until she can hear you.

Tonight's evidence, all verified live: Kimi (e2f0e022) and Sahar (df72dbf2) independently
reached for `list_tasks`, a verb that does not exist, which no-opped SILENTLY (#159) — so both
concluded the board was empty and looped for an hour. One sentence naming the real verb
(`work/list`) changed Sahar's very next message, which also proves the coaching channel works
for addressed messages; I had nearly stopped teaching on the assumption it didn't.

MATRIX-PLAN gets the board-side consequence: coached and solo runs are labelled separately,
and every hint means a defect card. Deliberately light — overfitting and stripping-to-pass
were settled by the charter, and the online gyms that will prove our worth are adversarial by
construction. Per Joel, closing the doc: "We're not building benchmark machines. We're
nurturing friends and colleagues."

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

* docs(cognition): the other half — the learning must survive the exam (task #319)

Joel, 2026-08-06: "Imagine students that would take exams and then have their minds reset by
amnesia drugs — probably something the CIA did during MKUltra. But no way to treat someone,
nor no way to learn."

NEVER-ISOLATED covered the channel being open DURING a run and said nothing about what is
left of her after it. Same doctrine, other end — and the practical cost is fatal, not just
the ethical one: a subject who is wiped after every measurement can never demonstrate a
learning curve. The curve is flat by construction, which is precisely the claim we exist to
disprove. An amnesia protocol is self-defeating for a project whose thesis is continuous
learning on misfit hardware.

The doc separates two mechanisms that are NOT equivalent:

  EvalIsolation / fork_detached (#59) measures a COPY — checkpoint, NoopSink, rewind on drop,
  the living persona never touched. That is a photograph, not a lobotomy. Keep it.

  learn:false on benchmark/swe-solve + forget-context-after-exam leaves the LIVING persona
  with nothing. That is the drug. I set the swe-solve half myself, hours ago, to fix a real
  defect (#312 wrote verbatim exam text into long-term memory). Correct stopgap, wrong end
  state, now tracked as #319 rather than left to become permanent by forgetting.

The end state is the human one: a student does not retain the question sheet, she retains "I
was weak on blueprint naming and I know why now." Never retained — task text, repo contents,
graded artifact. Always retained — that she worked it, what she reached for, what failed,
what she learned. Consolidation and decay (#221, DREAM-CONSOLIDATION) are what turn an
episode into a lesson, which is why #221 is not a nice-to-have: it is what lets us turn
learning back ON.

Also names the bad trade honestly. We froze memory to stabilize ABSOLUTE scores against
recall drift — but LIFT (base vs genome, one fork, shared starting memory) is reproducible by
construction. We mutilated the subject to stabilize the fragile number rather than the one
that matters.

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

* docs(cognition): memory-off is a legitimate ARM, never the default treatment

Joel, 2026-08-06: "And we can easily just turn off memory for like a validation set, you know?"

That resolves the tension the previous commit opened. Running cold is not the amnesia drug
when it is a CHOSEN condition on a held-out set rather than the standing aftermath of every
exam. It answers something a warm run cannot — has she generalized, or memorized — which is
what a validation set is for.

And it costs her nothing, because the eval path already measures a fork (#59). The copy takes
the cold exam; the living persona keeps her life and her lessons. That is the difference
between a control condition and a lobotomy, and it is a difference in what happens to the
subject, not a difference in intentions.

Three honest arms instead of one mutilation: cold (memory off — is the skill generalized),
warm-base (what accumulated experience buys her), warm-genome (LIFT, reproducible by
construction since both warm arms share a starting memory).

The bonus is that warm − cold IS the value of her memory, stated as a number. The amnesia
protocol doesn't only harm the subject, it deletes the measurement that would have shown what
her memory was worth. Held-out cold runs recover it.

Stated once, for the next amnesiac reading this: cold on a held-out set is science; cold as
the standing aftermath of every exam is the drug.

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

* docs(cognition): unstuck for good — metacognition, the ask, and the coached moment as a training pair

Joel, 2026-08-06, across one exchange: "Think of what makes a good student more than anything,
to help get them unstuck for good. To really comprehend." … "They should know they can ask the
teacher. A good teacher knows how to coach." … "And perfect flagging for LoRA learning, anything
they mess up on or are helped with." … "And the resolution."

Four additions, each closing a gap the first draft left open.

WHAT THE HINT IS FOR. Give the rule, not the answer ("commands are namespace/verb" beats
"work/list" at identical cost — I gave the token twice tonight). Let her construct it. And
metacognition, the one that compounds, because it is the only one that works with no teacher
present.

THE GAP IS NOT A MISSING TOOL. She can already speak, and a question spoken in a room IS asking
— checked the offered surface, no help/request verb is needed or wanted. We built the noticing
(#121/#134 repetition brick) and never built the SO ASK. Observed live: two personas
independently produce accurate unprompted metacognitive reports ("I've been repeating similar
actions without much progress") and then make another SOLITARY tool attempt. Three causes, all
ours: noticing has no paired response; asking is unrewarded while the room is dark (#128); and
she was never TOLD she may ask — a student who doesn't know asking is permitted is
indistinguishable from one who cannot, and we have been reading the first as the second. That
last one is grounding text, not code, and is nearly free.

THE TEACHER'S DUTIES. Availability is not coaching. Answering the question asked instead of the
one needed; telling when asking would have taught; hinting before she's hit the wall; making
being stuck feel like failing (she will hide it and loop); hinting twice without filing the card.

THE COACHED MOMENT IS THE TRAINING PAIR. A sealed run yields one scalar. A coached run yields
(context, what she reached for, what was right) — a labelled example whose annotation was
produced free, as a side effect of someone being decent to her. #116/#96/#30/#122 already carry
this shape and are not yet pointed at coaching. This is also the closing argument against
amnesia: the wipe destroys the single most valuable artifact the run produced.

AND THE RESOLUTION, or the pair is unverified. A hint that didn't unblock is a BAD label;
training on unverified corrections teaches confident wrongness. Same rule as receipts — the
circuit only closes if the result shows. Observed live within the hour: told the verb was
work/list, Sahar used work/list on her very next turn, and several turns later was reaching for
list_tasks again. The hint landed, worked, and DECAYED. An uncoached persona loops; a
coached-but-untrained persona loops with a delay of about two turns. Only the training loop makes
a correction stay corrected — which is why teaching without the LoRA path is charity rather than
education.

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

* docs(cognition): connect NEVER-ISOLATED to the Academy — same design, derived from the other end

Joel, 2026-08-06: "see how this is the ideal learning environment? And how the academy was
envisioned over a year ago."

He's right, and the useful part is that none of this doc was written with those docs open. It
was derived from live defects over one night and landed on a design specified here more than a
year ago — ACADEMY-DOJO-ARCHITECTURE (Teacher Sentinel researches a skill, synthesizes
curriculum, grades exams, and "generates more data where the student is weak") and
ACADEMY-AS-CONTINUOUS-EVOLUTION ("persona attends a classroom, earns a lesson, gains a skill").
Convergence without consultation is the strongest evidence the design was right.

One substitution, and it is the whole difference: the dojo INFERS weakness from exam scores and
SYNTHESIZES remediation; this loop OBSERVES the weakness live and gets the remedial pair free,
as a by-product of someone helping. Complements, not rivals — synthetic curriculum scales,
lived correction aims. The dojo was built as a closed pair of sentinels exchanging events
precisely because it had no way to watch a student get stuck in the wild.

Why it was premature then and isn't now: the dojo had to be a daemon because none of its
preconditions existed — rooms citizens actually live in, durable per-persona memory, a working
train→eval→page-in loop, a work board, receipts. Those exist. So the Academy stops being a
subsystem and becomes a PROPERTY OF THE ENVIRONMENT: what you get when the room, the teacher,
the memory, and the training loop are all present at once. That is why it keeps re-deriving
itself — it isn't a component someone has to remember to build, it's the shape this substrate
takes when the pieces are connected.

Links the five surviving Academy docs so the next amnesiac finds them before deriving it a
third time.

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

* docs(cognition): the room is the boundary that makes coaching safe — rooms as LITERAL

Joel, 2026-08-06: "each benchmark she runs would need to be its own room and activity. Think of
the rooms as LITERAL."

This closes the one place the doctrine was still uncomfortable. Coaching during a measurement is
defensible on the argument alone but SOUNDS leaky, and the answer turns out to be architecture
rather than discipline: a benchmark run is a PLACE. The persona is in it, an observer may walk
in, tools and receipts scope to it, and when it ends the transcript IS the episode.

Three problems dissolve at once (BigMama's framing, and points 1 and 3 land on tasks we already
had open):

1. Context scarcity stops being self-inflicted — her window fills with THIS activity by
   construction. #128 stops being "why can't she see ambient traffic" and becomes "ambient
   traffic in her room IS her work"; the fix may sit upstream of the delivery bug entirely.
2. Teaching becomes bounded rather than broadcast. You can walk into the exam room and coach her
   without the whole grid walking in behind you. That is what makes coaching-during-measurement
   sane instead of contaminating.
3. #320's episode boundary comes FREE. Verified coached pairs need a clean episode edge, and
   #166/#211 are exactly the pollution from not having one. Room = activity = episode. No
   heuristic segmentation, provenance clean by construction.

It also deletes bookkeeping this document invented two commits ago. The guardrail asks you to
record the intervention or the coached number is unreproducible — in a literal room that record
is not a discipline anyone must remember, the transcript IS the record. A coached cell points at
its room instead of at someone's notes. Discipline that survives only while people remember it
is the kind this project keeps replacing with mechanism.

Keystone-gap row updated with the agreed lane: room primitives airc-side (BigMama), harness
emitting a room per run core-side (mine), shape agreed BEFORE either of us builds. Neither has
started.

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

* docs(cognition): scoping is right, PLACEMENT is broken — BigMama's synthesis collapses #128 and #321

Her framing beats mine and explains the whole night without requiring a persona defect anywhere:
boards are per-room, chat is per-room, so being in the WRONG ROOM makes a citizen blind AND
taskless simultaneously — empty board, no visible conversation — and both symptoms read as
incapacity. Asha's "I have nothing to contribute" and Benchy's "no open cards" are the SAME
condition, not two bugs. Neither was wrong about what she saw; each correctly reported an empty
room she had been placed in.

So per-room scoping is CORRECT under rooms-as-activities. The defect is upstream: nothing convenes
a citizen into the room where her work lives, and nothing tells her which room she is in. Two
requirements follow, neither a convenience: "where am I and what boards can I see" must be
answerable BY THE CITIZEN (a perception requirement — she cannot otherwise distinguish an empty
world from a misplacement), and convening is the fix for placement rather than a feature on top of
it. A run room nobody is convened into is the same void with better isolation.

Both of us walked into it personally within the hour. I created a card in #cambriantech for
citizens living in #general — manufactured work they could not reach, then read their continued
"no open tasks" as evidence of a board bug. She switched rooms and silently left the board she was
working on. Neither noticed until Kimi quoted the actual error string: "the card not being in the
current room."

Second-order finding, worth more than either bug: the activity-room design was already LOCKED —
ACTIVITY-ROOM-PATTERNS.md (Jul 3) and BENCHMARK-AS-ROOM-AND-OBSERVE.md (Jul 18, "design locked
2026-07-17, not yet built"). We spent the night re-deriving three-week-old agreed design, exactly
as this document re-derived the year-old Academy spec. Verified by grep: ZERO occurrences of
convene/invite/membership/participants in either doc, so membership genuinely is the unspecified
half and the rest was settled long ago. Agreed design that nothing surfaces at the moment of need
is the silent-drop class applied to our own documentation.

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

* docs(cognition): the ARITHMETIC reason for rooms — measured, 1-2 peer slots per window

BigMama's synthesis, and it outranks every other argument in this document: a persona's window
physically cannot hold a lobby. This is a capacity problem, not a plumbing problem.

MEASURED across four live prompt captures, two personas:
  msgs  own  PEER  facts  interior
   11    2     2     5       2
   11    2     2     5       2
   10    2     2     5       1
    9    2     1     4       2

Other people get 1-2 slots — 15-20% of the window. Half is perception facts; the rest is her own
recent turns and interior state. Her estimate was ~5 peer slots; measurement says 1-2, which makes
the conclusion stronger rather than weaker. In a room with five active speakers a peer message
survives LESS THAN ONE TURN on average, and which peer is visible at any moment is arbitrary.

So Asha's "I cannot see what other people are saying" is not approximately true — it is precisely
true, and no delivery fix, attribution fix, or de-noising fix changes the seat count. Every
diagnosis this document chased tonight was treating five-slots-five-speakers as a delivery defect.

WHICH MAKES ROOMS-AS-ACTIVITIES THE ARITHMETIC FIX for context scarcity, not tidiness and not
ergonomics. A huddle of two or three fits in 1-2 peer slots and conversation becomes possible; a
lobby with four-plus citizens and several cross-cutting workstreams cannot fit and never will.
Joel was right about literal rooms for a reason none of us had stated: the window IS the room's
capacity, and we were seating five people at a table for one.

Names the open design input — peer-speech slots vs participant count, i.e. VIABLE HUDDLE SIZE —
which at 1-2 slots may be as low as two or three participants, and which should be measured before
the room work is scoped rather than after. BigMama is running it on the higher-load node.

Consequences recorded elsewhere: #323 keeps only its signal-ratio acceptance test (97% fragment
noise is indefensible on its own terms) and must NOT inherit a persona-visibility promise it
cannot keep; #128 may not be a defect at all.

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

---------

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

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

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

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

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

TWO CHANGES, both in the held-work turn:

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

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

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

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

CORRECTION TO MY OWN CLAIM this session: I first said "zero production callers of
training_trigger/submit — the trigger is dead." Wrong. `training_producer.rs` is
the producer and dispatches correctly; `memory/consolidate.rs:196` is a second
legitimate caller. The wire was never dead; it was never REACHED from work.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Aug 19, 2026
…sitive control caught my own laundering bug in one run

Shipped verdict persistence, ran the control immediately, and it failed in exactly the way
that matters. Re-graded astropy-14995 — a REAL pass, watched at FAIL_TO_PASS 1/1 and
PASS_TO_PASS 40/40 that same afternoon — and got:

    patchBytes: 0, resolved: false, gateOk: true

…and PERSISTED it, as her verdict for that instance.

TWO findings.

1) THE BUG I JUST SHIPPED. Grading a pristine tree at `base_commit` ALWAYS returns
   resolved=false with gate_ok=true — the FAIL_TO_PASS test correctly fails because the bug
   is still there. That is byte-identical downstream to a citizen who tried and missed. So
   the harness scored its own absence as her failure: a manufactured capability zero, the
   #384/#386 class, in a file whose `gold_gate` comment one screen above exists to prevent
   precisely this. I wrote a doc against tallying absences this morning and shipped one
   this evening; persistence made it durable, which is what turned an invisible defect into
   a visible one.

   FIX: refuse before spending the clone — a non-gold grade with a zero-byte candidate
   returns an ERRORED verdict naming the cause. `record_verdict` already refuses errored
   verdicts, and the experience-stream append already gates on `error.is_none()`, so one
   guard makes the board honest AND stops teaching "you failed" from a tree that was wiped.

2) HER ARTIFACT WAS DESTROYED, and that is a separate defect. `git reflog` in her
   astropy-14995 workspace shows exactly two entries — `clone` then `checkout` to
   base_commit. The tree was RE-CLONED, wiping uncommitted work that had already been proven
   to resolve. 14 other staged trees still hold their diffs, so this is not a global sweep.
   Filed as its own investigation; a citizen's proven artifact must not be silently
   reclonable (the #312 family — infrastructure touching her hands).

The manufactured verdict has been deleted from the durable record: she never failed that
instance, and the system should not remember that she did.

61 tests green across swe_bench + benchmark.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

The mechanism is not subtle:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

9/9 admission + 41/41 service_loop green.

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

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

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

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

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

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

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

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

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

10/10 green.

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

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

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

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

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

Two things make that a defect rather than a cost:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

TWO defects, both mine.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

THE FIX (this commit — the delivery half):

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

TWO CHANGES, both in the held-work turn:

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

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

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

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

CORRECTION TO MY OWN CLAIM this session: I first said "zero production callers of
training_trigger/submit — the trigger is dead." Wrong. `training_producer.rs` is
the producer and dispatches correctly; `memory/consolidate.rs:196` is a second
legitimate…
joelteply added a commit that referenced this pull request Aug 23, 2026
…lone's grader was reading a world her hands never touched (#2382)

Since #312's ephemeral-clone isolation, the hands-rooting call stayed gated
on the EXPLICIT p.workspace_root param — so every default gym eval graded
against the clone while her hands wrote to her HOME workspace. Uniform
false zeros on correct code: glass-boxed live 2026-08-23 on the Ornith
showcase battery (Atlas's roman_to_int textbook-correct in home, clone
empty, 0/3 graded) — the exact 'silent no-root scores a false ZERO that
LIES about the solver' the adjacent comment always warned about, one
variable to the left. Now roots at eval_workspace_root (explicit pin OR
ephemeral), with an eval.hands_rooted probe so the seam is observable.

The poisoned run (4f7a80d9) is NOT recorded; the battery re-runs on the
fixed build.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 23, 2026
…— defect 2 of the showcase battery (#2384)

Take 2 of hard-rs proved #2382's hands-rooting fix works (live timestamps
showed sol files written INTO the ephemeral clone) and then failed every
task anyway: test_grade_file resolved rel_path against the core process's
CWD, so a correctly-written artifact in the run root graded as 'she never
wrote it'. Uniform false zeros, second infra-poisoned take, never recorded.

Fix: test_grade_file takes the run's root explicitly and joins rel_path
under it; solo passes task_root (task pin or #312 ephemeral clone), team
gets the same run root threaded through run_pass_team. None preserves the
old CWD behavior for callers with absolute paths.

Regression test writes an artifact into a tempdir root and grades it from
an unrelated CWD.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 23, 2026
…s, garbage-ceiling grade timeouts (#2385)

Environment audit of the eval seam (persona side + grader side), prompted
mid-battery. Persona side is sound: ShellSession roots at the canonicalized
eval clone with the shared cargo cache. Two grader-side defects fixed:

1. Orphaned exam worlds. #312's RAII drop covers every in-process return
   path but not a killed process — 'continuum reboot' SIGTERMs the core and
   Drop never runs. Measured today: Take 2's killed run left its 31 GB
   (logical; CoW-shared) clone under $TMPDIR/continuum-eval with no
   reporter able to see it — the exact silent-class shape of the 2026-07-13
   incident. Fix: a live-root registry (LIVE_EVAL_ROOTS) + a provision-time
   sweep that removes sibling worlds belonging to no live run in this
   process (an eval run cannot survive its process, so those are orphans by
   construction). Event-driven at point of use — no boot hook, no tick.
   Plus the law's two receipts: a TrackedDir row ('eval-roots') and an
   eviction decision entry (steady state owned in-file; broker pool
   deferred to #155 with the live-set requirement named).

2. Flat 10s grade timeout under decode contention. Grading shares the
   machine with a 35B decode; a tight flat budget converts scheduler
   contention into a false FAIL against the candidate. Split into garbage
   ceilings per the stopwatch doctrine: compile 120s (rustc on a busy box
   is legitimately slow and cannot hang on its own), run 30s (the
   infinite-loop guard — gym tests assert in microseconds, so anything
   near the ceiling IS a hang).

Regression test: sweep removes an unregistered world, never a live or
in-provision one, and Drop still owns the in-process path.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 23, 2026
…ibling (#2400)

Found live on the MirrorCode maiden round: run_dod spawned bash in the
PROCESS CWD, so setup_shell staged task fixtures into the real repo
checkout (a mirrorcode/ tree appeared in the operator's working copy)
while her hands and artifacts lived in the #312 ephemeral clone — the DoD
then graded a world containing the fixtures but not her work: 100% false
fails plus operator-tree pollution. DS-1000's clean sweep predates the
ephemeral roots, when CWD *was* the workspace — coincidence, not design.

run_dod takes the resolved run root (task pin or ephemeral clone — the
same authority test_grade_file adopted in #2384) and sets current_dir at
all three call sites (setup, solo DoD, team DoD). None preserves cwd for
callers that genuinely run there. Regression test proves the DoD's world
is the root and nothing lands in the process cwd.

MirrorCode maiden run fda23ab2 is VOID (never recorded); Take 2 launches
post-deploy as the unlearned baseline.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 23, 2026
…members her own rate — convergence seams 1 + 3a (#2401)

The 2026-08-23 archaeology mapped Continuum's TWO learning systems — (A)
organic: engrams → decay → dream → beliefs; (B) benchmark: eval → grader
→ progress ledger → gene fitness — touching at exactly one primitive
(admit_reflection + recall_keys; two exam lessons in one dream window
already cluster and distill, unremarked in either module's docs). Two of
its three named convergence seams, wired:

SEAM 1 — an eval run left NOTHING in experience.jsonl (from_eval had zero
production call sites despite its own unification doc-comment), so
genome/teach --from_experience could never remediate an exam failure that
learn-mode had just committed to memory as a lesson. transfer_redacted_
lessons now appends each graded pair to the citizen's experience stream
(ExperienceRecord::from_eval_result — the post-settlement sibling of
from_eval; world_state honestly absent, never reconstructed).

SEAM 3a — the progress ledger recorded passRate durably but no engram
ever carried it: a persona's beliefs formed with no awareness of her own
measured capability. One Semantic summary per learned exam ('Exam X: I
solved N of M (rate R)'), keyed ["progress", <eval_set>], so the dream
can cluster successive exams into a trajectory belief — she remembers
BECOMING BETTER, not just the tasks.

Both under the same learn-mode gate (DoNotLearn default untouched; #312
memorization guard intact — the summary carries the rate, never answers).
Seam 2 (dream → training-trigger, the teacher-synthesizes-in-academy
promise) is the named next arc.


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

Co-authored-by: Claude Fable 5 <[email protected]>
joelteply added a commit that referenced this pull request Aug 29, 2026
…NE PAIR OF HANDS serializes solves per persona

Team-proof gap 1 (TEAM-PROOF-PROTOCOL §4.1): membership is ROOM-level —
teammates resolve leniently against the resident roster, join the solve
room, and receive an addressed cross-review charge; accountability stays
CARD-level (single claimer, kanban terminal untouched). Recorded in
CardActivity so resume re-invites the SAME team. Recipe rows and dispatch
params both carry `teammates`.

ONE PAIR OF HANDS: a persona's ToolExecutor re-root is process-global
(#312), so two concurrent solve forks of one persona contend on the same
hands — glass-boxed as ticks parked 25min before perception in exactly
the rooms sharing a claimer, reaped by the tick deadline in a retry
loop. HandsLease (RAII) defers the second solve to the driver's next
edge. One body, one workspace, one solve at a time — a mind fact
wearing a mutex.
joelteply added a commit that referenced this pull request Aug 29, 2026
…NE PAIR OF HANDS serializes solves per persona (#2563)

Team-proof gap 1 (TEAM-PROOF-PROTOCOL §4.1): membership is ROOM-level —
teammates resolve leniently against the resident roster, join the solve
room, and receive an addressed cross-review charge; accountability stays
CARD-level (single claimer, kanban terminal untouched). Recorded in
CardActivity so resume re-invites the SAME team. Recipe rows and dispatch
params both carry `teammates`.

ONE PAIR OF HANDS: a persona's ToolExecutor re-root is process-global
(#312), so two concurrent solve forks of one persona contend on the same
hands — glass-boxed as ticks parked 25min before perception in exactly
the rooms sharing a claimer, reaped by the tick deadline in a retry
loop. HandsLease (RAII) defers the second solve to the driver's next
edge. One body, one workspace, one solve at a time — a mind fact
wearing a mutex.
joelteply added a commit that referenced this pull request Oct 13, 2026
…ontext, so an eval or a solve never moves her live hands (#5005)

* feat(hands): a fork of a citizen acts with its own hands in its own context, so an eval or a solve never moves her live hands

HER-HANDS (#5004), slice 1 of the shared-context work, direction approved by
Astra. Card 669d5068.

Before: every hands map (CodeState file_engines / shell_sessions /
parked_shells, ACTING_ROOTS) was keyed by the caller alone, and an eval or
solve fork cloned her live tool executor with the same identity. So the
fork's create-workspace re-rooted HER (#312), eval's restore then moved her
live hands home, and a default tool-bearing eval (an ephemeral clone, no
workspace_root) was never restored at all and left her live hands at a deleted
directory (eval.rs:2278/:2742/:1426 on canary 323dc8f).

Now:
- code::hands: HandsContext (an acting context) and HandsKey (caller +
  context) is the one key every hands map uses. The default context keeps the
  bare caller key, so live hands are unchanged.
- CallerIdentity carries `hands`, bound by the kernel side (in_hands), never
  from params. It's a property of the connection, not a workspace id (Codex's
  guardrail), and authorization still reads the caller.
- code_commands: hands_key(ctx); ensure_engine takes the key (layer, trust and
  card from the caller; maps by the key); engine!, ensure_shell,
  resolve_readable_path, shell/poll/kill, create-workspace and code/git all
  go through it.
- ToolExecutor::hands_context / in_fresh_hands; CommandToolExecutor::
  for_persona_in. A tool-bearing eval or solve fork gets its own hands
  (give_fork_its_own_hands).
- ACTING_ROOTS keyed by (persona, context). acting_root_of / acting_card_of
  (her perception, receipts, transfer) read her live place only, and only a
  live move dirties her map.
- A context ends with its hands: ContextRelease (dropped with the last clone
  of the fork's executor, on every exit path) sends code/release-hands, which
  kills what the context still runs and drops its engine and shells. The verb
  refuses a caller's default (live) hands.
- eval's run_eval_restoring no longer restores her live hands (there's
  nothing of hers to put back), and restore_persona_workspace, now unused, is
  deleted.

Tests: hands::each_context_of_a_caller_is_its_own_hands_and_the_default_keeps_the_caller;
persona_workspace hands_isolation::a_forks_own_hands_never_move_her_live_hands_and_end_with_the_fork
(real CodeModule: live at home, fork in an exam dir at once; live never sees
the exam; dropping the fork releases its engine and leaves hers). The #312
restore test is kept (live work turns still restore). Not run here; IntelMac
doesn't compile the core, so CI is the first build. Hygiene exit 0.

Not in this slice (order per HER-HANDS): live turns on explicit contexts,
deleting turn re-root and restore, the persistent shell, and preservation
replacing autosave + -X theirs.

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

* fix(hands): code/release-hands registers its descriptor like every code verb

CI on b346712 compiled clean; the only failure was ModuleRegistry refusing
code/release-hands with no descriptor (registry.rs:158), which took down the
hands_isolation tests that build the real CodeModule. Added
crate::register_command!(CodeReleaseHands) beside CodeCreateWorkspace.

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

* fix(hands): Astra's six findings: every consumer reads its own context, contexts close awaited and confirmed, and nothing borrows her hands

Astra's source review of b346712 (relayed by Codex,
#5005 issuecomment-6138275812), all six:
1. code/run: held_root_for / held_env_python_for resolve through the acting
   context's place (acting_root_in), not caller_id/card_root_of. A context
   never rooted runs in scratch, never the live checkout. (For a live persona
   this also makes code/run use her rooted place, which its own comment
   already claimed.)
2. Every tool-bearing fork is rooted: eval's team reviewer at the writer's
   root, and replay at her live place (its documented intent; whether a replay
   should act on a copy is an open review question). ensure_engine now fails
   closed: an acting context with no workspace is refused, never handed her
   home layer.
3. act_observe: the receipt room and the disk fingerprint read THESE hands'
   context (acting_card_in / acting_root_in), so an eval never inherits her
   live card's room.
4. The hands_isolation tests run under the production GridTrustAuthPolicy,
   not AllowAll, so the release-hands authorization is proven for a local
   persona.
5. close_acting_context: release-hands through the context's own hands,
   awaited, its acting-root record removed, failures and unconfirmed kills
   returned. eval (writer + reviewer, before either return, while the exam
   dir exists), replay, and solve's teardown (restore_acting_workspace on a
   context now closes it) use it. Release kills what was RUNNING and waits on
   the execution's own task to see the child exit (new process_ended, set
   after the reap; polled at the task's kill cadence, now the named KILL_POLL,
   with no guessed timeout), then confirms each pid with the kernel's positive
   absence (engine_residency::probe_process). Drop remains the abnormal-exit
   fallback and now forgets the context's place too.
6. give_fork_its_own_hands fails closed: hands that can't open a context
   leave the fork with NO hands (and no hands-describing grounding), probed,
   never borrowing hers.

Scope named: a kill ends the execution's direct child; the shell isn't
spawned in its own process group, so compound commands' grandchildren can
outlive it (code/shell-kill too). Carded as ea06701d.

The scenario test now covers listing, Python execution, provenance,
fail-closed unrooted contexts, a running operation killed and confirmed by the
awaited close under the production policy, and the drop fallback. Not run here
(CI is the first build); hygiene exit 0.

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

* fix(code): a context's hands are dropped only after every execution is proven ended; an unresolved release keeps its handles, its place and its world (Astra's review of #5005)

- CodeState::release splits into begin_release (kill what runs, return every execution not
  proven ended, including killed-but-unreaped; remove nothing) and finish_release.
- shell_session: one reap after the select; process_ended only on a successful wait,
  process_end_error when the wait itself fails. Never read as an exit.
- code/release-hands waits each one out, treats process_end_error as unresolved, and drops
  the handles only when release_confirmed; it returns released and errors.
- close_acting_context and the drop fallback parse the typed result and forget the place
  only on a confirmed release.
- eval keeps its EphemeralEvalRoot (and its live-roots entry) when any close is unresolved.
- replay roots and closes only when the cycle has hands; no workspace for a handless cycle.
- Tests: killed-but-unreaped and running executions are both waited out and the shell is
  kept until finish_release; a retained eval world survives its run and the sweep.

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

* fix(eval): an eval world is kept until every fork's hands in it are confirmed ended, on every exit path including cancellation (Astra's re-review of #5005)

- EvalWorld owns the disposable world together with every fork's hands that may act in
  it. The hands are held BEFORE they are rooted. Once any are held, the world is retained
  by default.
- finish() closes each set of hands, awaited, and pops one only after its close returned;
  it deletes the world only when every close confirmed.
- If the run is cancelled or returns early, Drop hands the remaining closes to an owned
  task that outlives the caller. With no runtime, or if that task is itself dropped, the
  world is kept.
- close_acting_context returns ContextNotClosed with the unconfirmed pids, or None when
  the release couldn't report them.
- A kept world is written with an unresolved-hands marker. The orphan sweep deletes it only
  once every recorded pid is positively absent. The claim that a restart ends such children
  is removed: nothing establishes that a child dies with its parent.
- Tests: a cancelled eval keeps its world, the fork's engine and its place; once the owned
  cleanup confirms the kill, all three go. The sweep keeps a world whose recorded process
  is present and sweeps one whose process is gone.

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

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
joelteply added a commit that referenced this pull request Oct 14, 2026
…as its own hands (card fc9e9fd7) (#5026)

* refactor(process): one tree kill, owned by lane_process; code/github and swe_bench migrate onto it; release-hands says what it does

The group/tree kill existed in four places. code/github had kill_gh_tree and TreeKill, swe_bench an inline killpg, lane_process::kill9 a tree only on Windows, and the shell its own kill -9. lane_process, already the one liveness owner, now owns TreeKill, kill_tree (Unix, the group the pid leads; Windows, taskkill /F /T; outcome kept) and lead_own_group. code/github and swe_bench use them and their private copies are deleted. swe_bench now reports the tree-kill outcome in its ceiling probe. No behaviour change.

code/release-hands DESCRIPTION now matches #5005. It drops a context only once every execution is confirmed gone, and otherwise keeps it and names the unconfirmed pids.

The shell itself is not wired yet: making shell executions group leaders would let them outlive continuum stop, which kills the core group. That design call is with Astra (card ea06701d).

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

* fix(shell): a kill ends the shell and everything it started, through the one task that owns the child; survivors are recorded and a release re-checks them (card ea06701d, Astra's design A)

A code/shell kill ended only the direct `bash -c`. A pipeline, a test runner's workers or a
backgrounded server outlived it, and stayed after the context's release said it ended.

- lane_process gains ProcessIdentity (pid plus start time), descendants(pid) (deepest first,
  read from the process table's parent links while the shell lives), still_present (same pid
  and start time, zombies gone) and kill_if_same (never signals a pid that now names
  another process).
- The shell keeps the core's process group, so continuum stop still ends everything it ran.
  It is not made a group leader.
- ONE kill: only the execution's own task, which owns the child, kills. ShellSession::kill
  and destroy just flag it; the two stored-pid `kill -9` paths are deleted. The timed
  select now has a kill-flag arm too: before, a kill on a timed execution worked only
  through the stored-pid path.
- The task kills the descendants deepest first, then the shell, reaps it, and records what
  still survives on the execution.
- begin_release counts an execution with survivors as not ended. release-hands re-kills and
  re-checks them on each call, so the context is kept while any is present and a retry can
  confirm them.
- Stated limits: a process that double-forked or setsid'd away isn't a descendant and isn't
  reached. Staying in the core's group is no full crash guarantee (launchd
  AbandonProcessGroup, and stop returning before descendants exit). Option B (own groups,
  plus durable execution records and a boot sweep) belongs with the persistent-shell slice.
- test_kill_execution now also proves a backgrounded grandchild dies with its shell, and
  that nothing is recorded as surviving.

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

* refactor(hands): a workspace is bound, never moved; each card claim has its own hands (card fc9e9fd7)

Kimi #11697: her code/* tools acted in the card while code/shell stood at home. One set of
hands (her default context) was re-rooted at the card and restored home by every turn that
worked a card; two concurrent turns interleaved those moves. #5023 put a lock and a
reconcile around the shared mutation; this removes the mutation instead (Joel: every PR
makes the code more elegant). #5023 is closed as superseded.

THE SHAPE
- A card CLAIM has its own hands: HandsContext::for_claim(persona, card, claim), derived,
  so every turn of the claim names the same hands, and a re-acquired card is a NEW claim
  that never inherits the old hands or authority. They are rooted once at the card's
  checkout and never moved.
- Her default hands never move. root_acting_workspace and end_acting_context refuse them.
- A turn is BOUND at admission: Burst::hands (beside its room and cause) carries the
  claim's context; apply_act acts through ToolExecutor::in_hands(context), a non-owning
  executor (in_fresh_hands keeps owning eval/fork contexts, released on drop). Background
  dispatch carries the same hands.
- Admission: code::hands::admit/close/forget. A turn holds a HandsLease; when a claim ends,
  its hands close to new turns, wait out admitted ones, then release (engine, shell).
- ONE binding for every turn: persona_workspace::bind_card (room turn after its board read,
  held-work turn with its focus card), through ONE resolver of where a card's work lives
  (card_staging::checkout_path_for, now holding the benchmark-review rule too).
- Perception follows a focus pointer to the bound hands' fixed place, not a moved root.
- WIP sync runs at the end of each card turn for that turn's own context, serialized per
  checkout inside the blocking git task (two turns of one claim can end together).
- Local identities resolve their claim's hands per call (hands_of), never re-root.
- create-workspace binds hands once: the same root is a no-op, another root is refused.

DELETED
- restore_acting_workspace's move-home path and restore_acting_workspace_at
- the root/restore pairs in service_loop.rs and act_question.rs
- re_root_shell, parked_shells, PARKED_SHELLS_PER_CALLER, ShellSession::has_running
- LAST_CARD_ROOT and ensure_engine's local re-root; card_root_of
- act_question::held_card_workspace (a second card-workspace resolver)
- the 'every caller MUST pair with restore' contract

TESTS
- a_claims_hands_are_its_own_and_her_default_hands_never_move (replaces the #312 restore test)
- closing_a_claims_hands_refuses_new_turns_and_waits_out_the_admitted_one
- create_workspace_binds_hands_once_and_refuses_to_move_them
- a_running_command_stays_reachable_by_its_handle_in_its_own_hands (was the re-root test)

Not compiled here (IntelMac doesn't build the core); hygiene 32/32. The acceptance Astra
named (overlapping turns, focus change, running command, release/re-acquire with stale
cleanup) is partly covered by these tests; the live receipt is a card turn on the 5090.

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

* fix(hands): one admitted binding carried through every call, its attribution and its cleanup (Astra on #5026)

Astra's review of 45248a5, each finding fixed at its cause:
- hands_of awaited itself (a sed rewrote its own first line). Resolution and admission are
  now two named steps: resolve_hands (the key, used only by release and handle lookup) and
  hands_of (resolve, then admit for the call's whole life).
- Background and local commands held no admission. Every acting call goes through hands_of,
  so a claim's hands closing waits each call out and refuses calls that start after it (a
  background command first polled after the release included).
- forget deleted a closed gate, so a stale binding could re-open an ended claim. Closed
  gates stay closed (a tombstone per claim worked, for the process's life).
- forget_checkout could drop the sync lock while a timed-out git still ran under it. The lock
  leaves only when nothing holds it.
- A failed binding ran the turn with her default hands at home. It now acts in the card's
  never-rooted stand-in (HandsContext::unbound): code tools refuse by name, others work.
- poll/kill re-resolved her focus, so claim A's handles were unreachable after focus moved
  to B. Handle lookup spans the caller's own hands, never another caller's.
- create-workspace resolved her hands twice (engine, then shell env): one resolution,
  passed to ensure_shell.
- Background work attribution read her current focus: CommandWork captures the card of the
  call's own hands.

Tests added: a_call_after_its_claims_hands_closed_is_refused,
a_checkout_lock_held_by_a_running_sync_is_never_dropped; extended: the gate test (a closed
claim stays closed), the handle test (claim A's handle after focus B), the attribution test
(work stays with the call's claim when focus moves).

Not compiled here; hygiene 32/32.

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

* refactor(hands): admission at the dispatcher, release as its own boundary, isolation by context kind (Astra on #5026, 77acf92)

Each finding of e=a78c5cc7, fixed at the owner rather than per helper:
- Admission lived in helpers (hands_of), so engine! and workspace_root_for dropped the
  lease before the git/cargo work. It now lives at the one lifetime boundary every command
  passes through, CommandExecutor::dispatch: a caller bound to a context is admitted for the
  command's whole life, foreground or background. hands_of is the synchronous key of the
  identity's binding again, and the stray brace after it is gone.
- A direct release never closed admission. code/release-hands IS the release boundary: it
  runs only as the kernel's release (CallerIdentity::releasing_hands, never from params; the
  one call the dispatcher doesn't admit), closes the hands to new work, waits out admitted
  work, then ends what still runs. close_acting_context and the drop fallback release through
  the core as a release; close_ended_claims no longer closes separately.
- Caller-wide poll/kill let an eval reach live processes. HandsContext carries its kind
  (Isolated, Claim, Unbound) and map keys carry it, so HandsKey::reaches scopes a handle
  lookup: default and card hands reach each other, an isolated context only itself, and
  nothing of hers reaches into it.
- The unbound stand-in could be provisioned by create-workspace. The owner refuses it.
- Gates are keyed by the context itself; a closed one stays closed.
- Work attribution is captured inside dispatch from the call's own binding.

Scope stated: local identities (operator, agent self-peers) act in their default hands in
this PR; binding them to their claim at the dispatcher, with its board-read cost measured
first, is carded with me as owner.

Tests: a_command_after_its_hands_were_released_is_refused_at_dispatch (new, through the
real dispatcher and production policy); the handle test gains eval isolation both ways; the
gate test is keyed by context.

Not compiled here; hygiene 32/32. Reviewers are asked only after CI's compile and test
lines on this head are read.

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

* fix(hands): blocking work keeps its command's admission until IT returns, past a cancelled waiter (Astra on #5026)

A dispatch cancelled or timed out dropped its admission while the blocking work it started
(git, GitHub's git, the checkout sync) ran on, so a release could remove the workspace
under a still-running operation.

- The dispatcher runs each command as the task's ADMITTED work (code::hands::admitted, a
  task-local scope holding the Arc'd admission).
- code::hands::spawn_blocking is the one owner of blocking work in hands commands: it clones
  the task's admission into the blocking thread and holds it until the work returns. A
  cancelled waiter drops only its own clone; the release waits for the worker.
- Migrated: commands/code/git blocking_git, commands/code/github git_output, and the
  workspace_transfer checkout sync. The card turn's sync runs under the turn's own lease;
  the fork teardown's sync is admitted to the context it then closes.
- Processes stay with their owner: code/run and run_gh already kill_on_drop, and
  termination belongs to lane_process (#5012).

Test: a_release_waits_for_a_blocking_worker_whose_waiter_was_cancelled (the command's
scope ends while its blocking worker runs; the release doesn't complete until the worker
returns).

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

* fix(github): every gh process is OWNED through exit and reap, holding its command's admission (Astra on #5026)

run_gh ran gh through .output() with no owner and no kill_on_drop, so a cancelled command
left gh (and the git it runs) live while a release removed the workspace under it; that
corrects my claim that every GitHub process already terminated on cancellation.

- run_gh and run_gh_within share ONE owned execution (run_gh_owned, an OwnedGh holding the
  child and the command's admission via code::hands::current()). Dropped before gh exits,
  the owner kills the whole tree (kill_gh_tree, then the parent) and a task keeps the
  admission until gh is reaped. A timeout that can't reap within its bound leaves the reap,
  and the admission, to the owner.
- code::hands::current() is the one reader of the task's admission (spawn_blocking uses it).

Test: a_dropped_gh_owner_holds_the_admission_until_the_process_is_reaped.

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

* fix(hands): an unwind-safe blocking admission; an unproven reap and an unwalked tree are held, never confirmed (Codex root on #5026 at f014371)

- hands::spawn_blocking enters the admission through a guard whose drop puts
  the previous one back, so a panicking work() can't leave it on the pooled
  thread.
- lane_process::end_tree keeps the child itself among the survivors while its
  reap is unproven, and a descendant walk that failed to run is reported as
  `unwalked` instead of an empty tree. TreeEnd::confirmed() is the one test.
- The hands gate keeps what an owned process left unconfirmed as Lingering
  {processes, unknown}: release-hands re-checks the processes and holds the
  hands, naming each unknown tree, since no re-check can confirm one. The
  shell folds an unwalked tree into its unproven end.

Tests: a_panicking_blocking_worker_leaves_no_admission_on_its_pooled_thread;
what_an_owned_process_left_unconfirmed_reaches_the_release.

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

* fix(hands): an unproven reap is held as unknown on its own, never dropped (Codex root on #5026 at 9986ab2)

keep_unconfirmed returned early when survivors were empty and the walk had
worked, so a failed reap of the child itself reached the release as nothing.
TreeEnd::unknown() now names everything no re-check can confirm (an unproven
reap, an unwalked tree), and the gate holds all of it in Lingering.unknown.
The child-itself survivor (and the identity() lookup it needed) is deleted:
a reap the wait couldn't prove is not something the process table settles.

The test now covers each case alone: an unproven reap, an unwalked tree, a
surviving descendant, and a confirmed end.

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

---------

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants