The stock lenses pass is closed. - The ghostlight library ships eight lenses. - Worlds carry weights as world data, and the owner can replace them. - Each elaborator session draws its lens replayably and records the lens and its instruction text. - Sessions run concurrently under their own permit ceiling. - In-flight work is found again by reading the store. All eight target invariants hold. The cut map records the second Cut 4 fix batch, Soul's final pass, Cut 5's verdicts and the ledger's actuals. The actuals are +4,907 / −266 in crates against about +1,300 estimated, the overrun overwhelmingly tests that caught real defects. Recorded as follow-ups: an Uncovered case the tests do not pin (L1.f15), and whether consumers may supply their own lens sets (L1.f16, the operator's). The target is rewritten as reconciled. The ontology loop no longer claims seed requests or Vault evidence for the Active sweep, the handoff says lens weights, and map.yaml names L2 as next. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
126 KiB
Ghostlight stock lenses — cut map (plan step 15, L1)
Ends are owned by ghostlight-stock-lenses.md; this document owns the means.
Written 2026-09-16 against Ghostlight 817c9f4 on
codex/ghostlight-dungeon-mvp; first committed at b846c68, refreshed at
d3b2c0e; refreshed again the same day with the operator's rulings on
L1-Q4 (twice), L1-Q5, L1-Q6, L1-Q7 and L1-Q9, and with the stranding probe.
Those commits changed only this file, so every line number below is against
817c9f4 = d3b2c0e source unless a cut says otherwise. Every question now
carries a ruling; Hands start at Cut 1 from d3b2c0e (after this refresh is
committed, from that commit). Where a ruling superseded an earlier recommendation, the
earlier text is kept under "History" inside the question and nowhere else,
so there is one live design.
How status is read
Status is derived from what this document records; nothing here is a maintained header.
- A question (
L1-Qn) is open exactly when it has noRulingfield.Authorityisoperator,self-under-standing-go, ordefaulted. - A cut is landed when its
Landedfield names commits, and closed when every promise (P<cut>.<n>) in its Verdicts table has a verdict (HOLDS | FALSIFIED | UNPROVEN). The root agent fillsLandedand the Verdicts; Hands and Soul do not edit this file. - A mutation (
M<cut>.<n>) names file, line, before and after; the commit it ran against is filled at execution. Mutations run against committed code and are restored with a diff, nevergit checkout. - A finding (
L1.f<n>) is something no cut owns; each carries introduced-or-pre-existing, severity, and triage (fix | operator | recorded). - The ledger carries an estimate per cut; the Actual column is computed from the diff at landing and is empty until then.
The pass is open until every cut is closed and every question has a ruling.
What the probes established
All probes ran in detached scratch worktrees at 817c9f4 (removed; repo
clean) on the Windows workstation with a scratch CARGO_TARGET_DIR (removed).
They prove mechanism on Windows only. Logs: session scratchpad
base-test-list.log, probe1.log, probe2.log, probe2b.log,
probe2-dungeon.log, probeq7-base.log, probeq7-a.log, probe-strand.log;
not repo artifacts.
- Base test census (
-- --list, which counts ignored tests): library--lib420 (419 + 1 ignored,controllers::tests::real_codex_connector_cognition_modes_commit_speech);--doc10;--test external_admission8; Dungeon--bin ghostlight-dungeon51 (50 + 1 ignored,runtime::tests::live_smoke_seeds_then_ticks_a_world_against_the_connector);--test build_provenance1;ghostlight-persona-projection13. Library by module: action 34, clock_tests 45, consumer 30, controllers 81, cover 18, custody_tests 17, elaboration 14, journal 24, knowledge_tests 21, mailbox 15, patch 34, sdk_inference 23, soul_knowledge_tests 9, tests 32, vault 6, witness_tests 17. Dungeon by module: app_session 8, eve 5, heimdall 5, idunn_health 4, mesh 4, runtime 25. - The 55-versus-51 discrepancy is resolved. The Dungeon crate carries 55
#[test]/#[tokio::test]attributes insrc/(app_session 8, eve 5, heimdall 5, idunn_health 6, mesh 4, runtime 27). Four are#[cfg(target_os = "linux")]:runtime.rs:2448,:2472,idunn_health.rs:1330,:1367. On Windows the bin lists 51; on Linux (Idunn's recipe run) it lists 55. The substrate map's "expected 50 + 1 ignored" was the Windows count. This map pins the Windows baseline and states the Linux one. - Probe 1, collision (concrete). Two
ElaborationRunners over one realCultCacheControllerWorkStore, oneelaboration_mailbox()world (one boundary inPlaceSubtree(commons)), started withtokio::join!on the same jurisdiction through a barrier port that holds both ininferuntil each has persisted its initial checkpoint. Result:a=Ok(Committed),b=Err(WorkPersistence("controller command <id> attempted an illegal checkpoint transition")),inferences=2,distinct_request_ids=1, custodyelaboration_commands: 1. So today two concurrent sessions on one answer share one command id (elaboration.rs:1271-1277), one store row, and one provider request id (controllers.rs:6314-6327hashes command id, purpose, round, instructions, input — all equal), spend two inferences, and the loser dies atpersist(controllers.rs:1701-1705) when itsReadyToSubmit{completed:[o2]}failsvalid_elaboration_progressionagainst the winner'sReadyToSubmit{completed:[o1]}(elaboration.rs:245, the_ => falsearm). Undersweep(runtime.rs:1837) that error is atracing::debug!and nothing else. What makes this path unreachable after Cut 4 is stated there. - Probe 2, lens on the session under v16 (mechanism). Adding
lens: StringtoElaboratorSession(elaboration.rs:57-66,deny_unknown_fields), setting it in bothselect_answerarms, and bumpingcontroller_work.v15→v16(controllers.rs:77-78): the whole library suite passes (419 + 1 ignored, plus the probe tests), Dungeon passes 50 + 1 ignored, andsdk_inference::tests::schema_fixtures_match_the_checked_in_sidecar_grammaris untouched. A lensed session persisted asElaboratorInFlightthrough the real store, reopened from disk (decode, canonical-bytes check,integrity_is_validat open,controllers.rs:1591-1608), resumed by a fresh runner through the repair path (Rejected→ reopen →Committed) under one command id:rows=1,row_type=controller_work.v16, the lens read back from the row's bytes equals what was written, and the same payload under acontroller_work.v15envelope is refused at open. The four existing refusal tests (controllers.rs:6439,:10605,:11343for v10/v9) do not pinv15literally and pass unchanged. - Probe Q7, base: an instruction edit refuses the whole store. At
817c9f4, anElaboratorInFlightrow whose storedPreparedInferencewas prepared under"OLD INSTRUCTIONS FROM A PREVIOUS BUILD"(viatool_request, pushed raw throughOwnedRedbMessagePackBackingStoreunder the currentv15envelope) is refused at open with"controller work row <id> failed its checkpoint binding", becauseintegrity_is_validrebuilds the request from the code constant (elaboration.rs:153,:1244) andprepared_matches_requestcompares the whole provider request (controllers.rs:1462-1470). The same row prepared under the current constant opens. So today any edit toELABORATION_INSTRUCTIONSrefuses every store holding an in-flight elaboration row; the pass discipline has always bumped the row version on such edits, which refuses the same rows one check earlier. Row sizes: the in-flight row is 58,366 bytes under the current text and 58,233 under the 133-character-shorter text; the row is dominated by the 39 tool schemas inside the stored invocation, so instruction text is well under 1% of it. - Probe Q7, option (a): instructions persisted on the session. With
ElaboratorSession { lens: String, instructions: String },select_answerfillinginstructionswith the constant plus aLens: Patina …clause,elaboration_requesttakinginstructions: &str, and all three callers (step:445,persist_repair:584,integrity_is_valid:153) passingsession.instructions: the library suite passes (419 + 1 ignored plus the probes); through the real store, round one isRejectedand persisted, the store is dropped and reopened (open-time integrity now binds the stored invocation to the stored text, and the stored text differs from the bare constant, so it passed by the new rule), a fresh runner resumes,persist_repairbuilds the round-two invocation from the stored text, and the session endsCommittedunder one command id; both wire invocations carryLens: Patinaininstructions(241 bytes), and the two rounds have distinct provider request ids (round is in the id). A row whose stored text and stored request disagree is refused by the same comparison, from source:prepared_matches_requestcomparesrequest.instructionsagainst the request rebuilt from the stored text.PreparedInference::preparerefuses empty instructions (InferenceFault { RecoveryRequired, "invalid instructions" }), so an empty stored text cannot be persisted. - Probe 3, stranding: an unrelated commit and the next sweep. Ran at
b846c68(same source as817c9f4), realCultCacheControllerWorkStore, one scripted bad-shed round per step so each step endsRejectedand persists anElaboratorInFlightrow with one refusal. The unrelated commit issubmit_clock(60), which moveslast_commit_digest. Then a fresh runner callsstepon the same jurisdiction.- Deficit path (a world with
targets {person: 3}, rootcommonsat 1000 ‰, no boundary):a=Rejected b=Rejected ancestry_moved=true inferences=2 second_saw_refusal=false custody elaboration_commands: 2.select_answer(elaboration.rs:669) digests the ancestry into the deficit'sanswer_digest, so the second step derives a different command id,lookupisMissing, a fresh session starts with a fresh prompt that never sees the first refusal, inference is repeated, and the old row stays in the store: stranded, one orphan row per interrupted deficit session per commit. - Boundary path (
elaboration_mailbox(), the dead-end road):a=Rejected b=Superseded ancestry_moved=true inferences=1 second_saw_refusal=false custody elaboration_commands: 1. The boundary digest excludes ancestry, so the id is the same and the row is found, butElaboratorSession.ancestryis a field of the session andcheckpoint.session() != &sessionatelaboration.rs:404-405returnsSuperseded. No inference is repeated and no orphan accrues, but the stored ancestry never returns, so every later sweep answersSupersededfor as long as the boundary survives: the boundary's repair stalls permanently after any commit, including every clock tick. The comment atelaboration.rs:2564-2567("a boundary that survives a repair keeps its id, which is what makes the resume idempotent") describes the id and not the equality check that follows it. Finding L1.f10 and question L1-Q9.
- Deficit path (a world with
- Source-verified facts the design rests on (read, not probed):
agent_promptis persisted and reused on resume, never rebuilt (elaboration.rs:414-435);ELABORATION_INSTRUCTIONSis a static feedingtool_request→provider_request_id(elaboration.rs:1244,controllers.rs:6018,:6314-6327); the SDK sidecar takesinstructionsassystemPrompt(sdk_inference.rs:558,sidecar/claude-sdk/src/main.ts:242);patch_tools()andpatch_tool_signatures()read onlyPATCH_TOOLSand take no world input (patch.rs:6114-6146); the only kernel entropy isselect_bandoverBandPreimage(action.rs:121-127,:780-818), and the library has norand(Dungeon does,crates/ghostlight-dungeon/Cargo.toml:28, for cookies and nonces only); the runtime's sweep holds no controller permit (runtime.rs:1823-1841) and sweeps never overlap (the loop awaitssweep()before the nextinterval.tick()); the pool is oneSemaphore(runtime.rs:80,:355,:1866-1872, envGHOSTLIGHT_CONTROLLER_MAX_CONCURRENT, default 4, documented atdocs/architecture/ghostlight-dungeon-mvp.md:478) that a speak turn (:1082) and each cover cell (:1959-1980) take from;scale_intentis written byadmit_resolvedfromResolvedPatch.scale_intent, which isSomeonly on the genesis lane (lib.rs:2045-2047,patch.rs:1900-1903), andreducehandsresolve_patchNonefor everyAdmitPatch(lib.rs:1641);CreateWorldis serialized into the genesis commit row (lib.rs:905-908,journal.rs:214), so a new field on it is a commit schema change;require_system_capability(lib.rs:1656-1673) and its twin atapply_effect(:4716-4728) admit a system caller for exactly the listed pairs, so a new owner-onlyCommandBodyis refused to every system caller without a new clause; Dungeon matchesCommandBodyonly by construction (runtime.rs:1504-1537), never exhaustively, and never namesMismatch::orWorldEffect; the create path isCreatePayload(runtime.rs:158-179,deny_unknown_fields) →CreateWorldIntent(:1441-1478), the Eve descriptor isCREATE_BINDINGS(eve.rs:49-57, used at:307and:312) withoperation_schemaat:614, and the tests that nameghostlight.world_create.v3areruntime.rs:2886,:2967,:4017-4045(a v2 payload is denied) and the smoke harness'stitled_two_cell_world(:3122-3154) used by the road test (:3792).
Questions
L1-Q1 What seeds the lens draw
- Asked: 2026-09-16.
- Context: nothing counts sessions. The kernel's one entropy recipe is a
digest over a typed preimage plus modulo and a cumulative walk
(
action.rs:780-818). The command id is the session's fixed identity (elaboration.rs:1271-1277) and, under L1-Q4 as revised, does not contain the lens, so seeding from it is not circular. - Options: A: seed from the session identity —
LensPreimage { world_id, command_id }digested with the kernel'ssha256:recipe, first sixteen hex asu64, modulo the weight total, cumulative walk inLensorder; the draw is a pure function of (world, session identity, weights). B: a new session ordinal counted somewhere; requires a counter owner and a write per session. C: the snapshot revision at session start; not replayable across resume without recording it, which is A with an extra field. - Recommendation: A, because it introduces no counter, reuses the one recipe, and makes "the same session identity draws the same lens" true by construction. Replayability, not determinism of model output, is the invariant.
- Depends on it: Cut 1 (
lens::draw), Cut 3 (draw site). - Ruling: A. The operator: "I couldn't care less what seeds the lens draw
as long as it's replayable - deterministic generation is out of reach
regardless." The seed is chosen on engineering grounds as A. The preimage
was briefly
{world_id, jurisdiction, answer_digest}while L1-Q4 had the lens inside the command id; with the lens out of the id (L1-Q4 revised){world_id, command_id}is the simplest preimage — two fields, the second already the session's key — and is the one Cut 1 specifies. Replayability is unchanged: the same command id under the same weights draws the same lens, and the row records the lens so a resume never redraws. - Authority: self-under-standing-go.
- Ruled: 2026-09-16.
L1-Q2 Where weights live and how they are admitted
- Asked: 2026-09-16.
- Context:
WorldStatehas nodeny_unknown_fields(lib.rs:780); the only genesis-written world scalar isscale_intent(lib.rs:845), validated inresolve_patch(patch.rs:4597-4615) and re-checked at replay (journal.rs:722-738);STATE_SCHEMA/COMMIT_SCHEMAareconsumer.v4(lib.rs:172-173), pinned literally atconsumer.rs:2237and by length at:1771, and older stores are refused (journal.rs:473,:1245). - Options: A:
WorldState.lens_weights: LensWeightsbesidescale_intent, written by genesis throughResolvedPatch.lens_weights: Option<LensWeights>exactly asscale_intentis, carried onCreateWorldandCreateWorldIntent, validated inresolve_patchandverify_state_shape; both schemas bump toconsumer.v5. B: fold the weights intoWorldScaleIntent; wrong owner — scale is a count target, lenses are flavor, and L3 replaces the intent's permille half. C: keep weights outside the world (runtime config); then a world's flavor is not world data and replay cannot re-derive a session's draw. - Recommendation: A.
- Depends on it: Cut 2.
- Ruling: A. The operator: "Lens weights live in the world, they're what determine the flavor of the world after all."
- Authority: operator.
- Ruled: 2026-09-16.
L1-Q3 Whether an owner command to change weights belongs in L1
- Asked: 2026-09-16.
- Context: no command changes a world scalar after creation except
AdvanceTime(lib.rs:651-673);soul_the_scale_intent_is_written_once_by_genesis(lib.rs:14330) pins that shape for scale. Session Zero's policy says the owner changes weights in Draft and Active (ghostlight-session-zero.md:59-61). - Options: A:
CommandBody::SetLensWeights { weights }in L1, owner-only, any phase, same admission as genesis, one reducer arm and one effect. B: defer to a later pass; weights are write-once in L1. - Recommendation: A, given the ruling; its L1 consumers are the library and external-admission tests, and Dungeon's route and button are D2.
- Depends on it: Cut 2; Cut 3's adoption rule (a resumed session keeps the row's lens whatever the weights now say).
- Ruling: A. The operator: "Changing weights after creation, sure, I don't see why not." A session that already drew keeps its recorded lens.
- Authority: operator.
- Ruled: 2026-09-16.
L1-Q4 How concurrent sessions stay distinct and take controller permits
- Asked: 2026-09-16.
- Context: probe 1 above.
sweepis a sequential loop over jurisdictions (elaboration.rs:607-632);select_answer(:642-677) picks one answer per jurisdiction per call — the oldest boundary, else the deficit — so two runners on one jurisdiction pick the same answer. The runtime holds no permit for the sweep; today one pool serves speak turns and cover cells (runtime.rs:1080-1082"There is no second concurrency owner"). - Options as posed: A: claim distinct demand, identity unchanged, the sweep borrows Dungeon's single pool. B: a slot ordinal in the identity. C: A plus deficit slots. D: both — the lens in the identity and a per-sweep claim set — with the pool split.
- Ruling: D, revised the same day. The operator: "Both, split the pool.
Neither elaboration nor simulation should starve the other. Elaboration
pool is a ceiling, not a budget like the Simulation pool." Then, accepting
the root agent's correction: the lens is recorded on the session and does
not enter the command identity, because the identity is the command's
idempotency key and must be a fixed property of the demand entry it
answers; keying it on a lens drawn from mutable weights strands rows when
weights change. Read as:
- Distinct demand, recorded lens.
session_command_idis unchanged (elaboration.rs:1271-1277: world, jurisdiction, answer digest). The runner hands concurrently running sessions distinct demand entries:demand_entries(snapshot)enumerates every open boundary per jurisdiction plus one deficit per jurisdiction with a nonzero row, derives each id, and dedups by id. That claim set is an in-memory value rebuilt each sweep — scheduling state, never world state, never persisted. Each entry's lens is drawn from its id (L1-Q1) and recorded on its session (Cut 3). - Split the pool. Dungeon carries two
Semaphores: the existingcontroller_permitsbecomes the simulation pool (speak turns atruntime.rs:1082, cover cells at:1975), configured byGHOSTLIGHT_CONTROLLER_MAX_CONCURRENT(default 4, unchanged); a newelaboration_permitsis the elaboration pool, configured byGHOSTLIGHT_ELABORATION_MAX_CONCURRENT(default 2, minimum 1, read at open beside the other,:1866-1872shape).sweep(&self, permits: Arc<Semaphore>)receives the elaboration pool only. Neither lane ever acquires from the other's semaphore, so neither can starve the other in this process. - Budget versus ceiling. The simulation pool is capacity simulation
always has: no other lane draws from it. The elaboration pool is a
ceiling: the most sessions elaboration may run at once, and nothing
reserves that capacity for it downstream. The ceiling is enforced by the
semaphore's size alone: a session holds one permit for its whole step
and is spawned only after
acquire_ownedreturns, so at most N elaboration inferences are in flight. Connector-level quota is shared by both pools through one caller id; when the connector refuses for capacity, elaboration's refusal is a retryable fault that ends the session's step and is retried next sweep, and simulation's is the same retryable fault it is today (runtime.rs:1863-1865). The process guarantees no local starvation; it cannot make the connector prefer simulation, and this map says so (L1.f8). - Test.
saturating_one_pool_never_delays_the_other(Dungeon,runtime.rstests): hold every elaboration permit in the test, runrun_cover_tickon the two-cell world with a counting port, assert both cells ran and the tick's wall time is bounded (no wait on the held pool); then hold every simulation permit and run a sweep on a world with one boundary, assert oneinfercall completed. Library side:the_sweep_never_exceeds_its_ceiling(pool 1 → max one in flight) anddistinct_entries_run_at_once_under_the_ceiling(pool 2 → max two).
- Distinct demand, recorded lens.
- Authority: operator.
- Ruled: 2026-09-16 (first ruling and revision).
- History (superseded): this map first recommended A — identity
unchanged,
sweep(permits)taking Dungeon's single pool. The first ruling put the lens into the command identity as well as splitting the pool; the revision took the lens back out of the identity for the rationale above, which also dissolved L1-Q8. The deficit-parallelism limit noted under A (one deficit session per jurisdiction per ancestry) still holds and is stated in Cut 4.
L1-Q5 How the ordered emphasis is expressed without reordering PATCH_TOOLS
- Asked: 2026-09-16.
- Context:
PATCH_TOOLSis one const (patch.rs:5586-6112) rendered as both the tool schemas and the prompt'sTools:line by two functions with one owner (:6114-6146, comment at:6135: "cannot drift"); counts (7, 30, 39) are pinned (:6837,:6981), order is not; the sidecar fixture carries names and parameters only (sdk_inference.rs:1874-1913). - Options: A: each
Lenscarries a list of existingPATCH_TOOLSnames in emphasis order plus "reaches for" prose, rendered as one prompt paragraph;PATCH_TOOLS,patch_tools(),patch_tool_signatures(), tool descriptions and the sidecar fixture do not change; a test pins every listed name to aPATCH_TOOLSentry. B: render theTools:line in lens order. C: per-lens tool descriptions. - Recommendation: A.
- Depends on it: Cut 1 (the table), Cut 3 (the prompt).
- Ruling: A. The operator: "A, dear Lord, we don't need even more machinery." A lens expresses its emphasis only as prompt text naming the operations it leads with; no per-lens catalog, no reordered tool line, no new type, rendering path, or fixture change beyond that list.
- Authority: operator.
- Ruled: 2026-09-16.
L1-Q6 What Dungeon passes at creation in L1
- Asked: 2026-09-16.
- Context:
CreatePayloadisdeny_unknown_fieldsand "a payload that omits it is refused, which is whatworld_create.v3means" (runtime.rs:156-179); the descriptor advertises seven bindings (eve.rs:49-57); the smoke harness creates throughCreateWorldIntentdirectly (runtime.rs:3141). - Options: A: Dungeon names uniform weights in its handler;
world_create.v3unchanged. B: the library requires explicit weights at creation and holds no default;CreatePayloadgains a requiredlens_weightsandworld_createbecomesv4; Dungeon's create surface supplies uniform weights as Dungeon policy. C: an optional payload field under thev3name. - Ruling: B. The operator: "B." The library requires explicit lens
weights at world creation and has no default weights; Dungeon's create
handler supplies uniform weights as Dungeon policy for now;
world_createbecomesv4; the smoke harness and the Eve create path (bindings andoperation_schema) are updated. The library keeps nouniform()constructor;LensWeightsderivesDefaultonly as the empty map thatWorldState::emptyneeds before genesis writes (it never draws and never persists —verify_state_shaperefuses it). The two places that need a way to build uniform weights each own their own: Dungeon'suniform_lens_weights()(Dungeon policy, used by the create surface's default value and the smoke harness) and the library test module'sstock_weights()(test fixture). - Authority: operator.
- Ruled: 2026-09-16.
- History (superseded): this map first recommended A, keeping
world_create.v3and namingLensWeights::uniform()from the library atruntime.rs:1457, on the grounds that a payload field without its slider belongs to D1/D2. Cut 2 is written to B.
L1-Q7 Where the lens text lives: per-lens instructions or the user turn
- Asked: 2026-09-16; reposed the same day after the operator asked why per-lens instruction strings cannot be versioned when a checkpoint references them. Probed (see "Probe Q7" above).
- Context: the checkpoint persists
agent_promptand the wholePreparedInference(elaboration.rs:77-84);integrity_is_validrebuilds the request from the code constant and demands equality (:134-170); an edit to that constant refuses every store holding an in-flight row (probe, base). The sidecar placesinstructionsas the system prompt (main.ts:242). Row size ≈ 58 KB, dominated by tool schemas. - Options:
- (a) Per-lens instructions persisted on the session.
ElaboratorSession.instructions: Stringis filled once fromlens.instructions()(the constant's sentence plus the lens clause) when the session is built;elaboration_requesttakes the text;step,persist_repairandintegrity_is_validread it from the session. Probed: open-time integrity, resume and the repair path all work, and the lens clause reaches the wire on every round.provider_request_idstays stable across resume (it hashes the stored text) and becomes a stable per-lens prefix across sessions of one lens (same text, so the connector's cache prefix is shared per lens rather than per world). What is lost: the stored instructions are no longer proven equal to current code; a row whose text was written by an older build, or forged, validates as long as its stored invocation agrees with its stored text. What is kept: the stored invocation is proven to equal a request rebuilt from the stored text and the stored conversation (request id, conversation id, tools, model, shape). Cost: about 250 bytes per row against ≈ 58 KB (< 0.5 %); no version table; a lens-text edit needs no row-version bump and strands no store. - (b) A version id with every historical string retained in code.
ElaboratorSession.instructions_version: u32(orlens_text.vN) and a tableLENS_INSTRUCTIONS: &[(u32, [&str; 8])]; integrity rebuilds from the table entry the row names. Keeps "stored text equals code" for every version ever shipped, at the cost of the table growing by eight strings per edit forever, and a review question ("which version is live?") the code must answer twice. - (c) A version id, rows naming a retired version refused at open. The same field, one live entry; a row from a retired version fails integrity at open. Behaviourally this is today's rule with a named error, so it buys nothing over the existing row-version bump except the version field.
- (d) User turn. The lens paragraph rides in
build_prompt→agent_prompt, already persisted and never rebuilt;ELABORATION_INSTRUCTIONSstays one static; nothing about integrity changes; the constant keeps refusing stores when edited (the base hazard stays); steering is weaker than the system prompt and the connector's cache prefix stays one for every lens.
- (a) Per-lens instructions persisted on the session.
- Recommendation: (a). The probe did not falsify it: every path the
question named works, and the guarantee it gives up (stored text equals
code) was in practice the store-refusing hazard the operator was asking
about, with the pass discipline already making it moot by bumping the row
version. The row keeps carrying what the model actually saw, as
agent_promptalready does, which is the property a resumed conversation needs. (b) grows code per edit; (c) is the present behaviour with a field; (d) is the fallback if the operator wants the instruction text provably equal to code, at the cost of weaker steering and no per-lens cache prefix. Cut 3 is written for (a). - Depends on it: Cut 3.
- Ruling: (a). Per-lens instructions, with the instruction text persisted in the checkpoint and integrity comparing against the stored text.
- Authority: operator.
- Ruled: 2026-09-16.
L1-Q8 How a session is resumed after a weight change moves its draw
- Asked: 2026-09-16 (from L1-Q4's first ruling meeting L1-Q3's).
- Context: with the lens in the command id, a weight change could move a session's key and strand its row.
- Options (history): A: probe the eight candidate ids per entry. B: a store listing method. C: accept the stranding.
- Ruling: dissolved by L1-Q4's revision. With the lens out of the id, a weight change cannot move a session's key; the row is found by the same id and Cut 3's adoption rule keeps the row's lens. The eight-candidate probing is deleted from the cuts. The general stranding of keys by ancestry, which the probe then found, is L1-Q9.
- Authority: operator.
- Ruled: 2026-09-16.
L1-Q9 How an in-flight session is rediscovered after the world moves
- Asked: 2026-09-16, from the operator's challenge ("Surely an active Elaborator session is recorded? Are you relying on some deterministic code outputting the same id rather than just checking the state?") and probe 3 above.
- Context: yes:
steprecomputes the command id from world, jurisdiction and answer digest and looks the store up by that id (elaboration.rs:383-412); there is no listing query onControllerWorkStore(controllers.rs:1541region:lookup,persist,custody_probe). Two consequences, both pre-existing (L1.f10): a deficit session's key contains the ancestry (:669), so any commit strands its row and the next sweep repeats the inference against a new row; a boundary session's key survives, butancestryis a session field and the equality at:404-405reportsSupersededforever. On the road, where the clock commits every tick, noRejectedsession of either kind has ever been repaired on a later sweep. - Is this required for L1? Yes, for the boundary half: Cut 3's promise P3.2 (a resumed session keeps its recorded lens and text across a weight change, which is a commit) is unprovable at base behaviour, and Cut 4's concurrency multiplies commits between sweeps. Cut 3 therefore carries the equality fix (option C below) as part of its adoption rule. The deficit half — rediscovery when the key itself moved — is not required for L1's concurrency to be correct (each sweep's claim set is consistent within itself, and a stranded deficit row costs a repeated inference and an orphan row, not a wrong commit) and is this question's operator fork.
- Options:
- A: resume reads state. Add
ControllerWorkStore::elaboration_in_flight(&self) -> Result<Vec<(CommandId, ElaboratorSession)>, ControllerWorkStoreError>(rows inElaboratorInFlightorReadyToSubmit; notNoPatch).demand_entriesmatches each entry to a row by (world, jurisdiction, answer) ignoring ancestry, lens and text, adopts the row's session and its command id, and otherwise builds a fresh session. The command id stays the kernel's idempotency key and stops being the only way to rediscover work. Cost: one trait method;CultCacheControllerWorkStoreanswers it by scanning its in-memoryjournal.workmap (controllers.rs:1662-1667shape; O(rows), rows are tens),RecordingWorkStore(:8339) the same over its map, and Dungeon's test stores (runtime.rs:3194family) return an empty vector; no index, no schema, no new row. A stranded deficit row is then resumed under its old id with its old ancestry:require_answerre-checks the deficit at commit (lib.rs:1706-1712), so the old ancestry is informational, and the repair prompt still names the refusal the model saw. - B (history, superseded by the ruling): exclude ancestry from the
deficit key. The deficit id becomes
(world, jurisdiction, "deficit"). Then a deficit session thatCommittedleaves aReadyToSubmitrow under the one id every later deficit session on that jurisdiction derives; the next session's initialElaboratorInFlightfails progression (:1701-1705) and the loop never advances — the exact resubmit-forever the ancestry term was added to prevent (:667-668). At the kernel, a secondAdmitPatchunder the same id with a different body isCommandIdConflict(lib.rs:1438-1447), and with the same bodyAlreadyApplied. B needs a different disambiguator, which is a session counter in disguise; not viable alone. - C (history as a competitor; live as A's boundary half): equality
only. Compare identity fields (world, jurisdiction, answer, answer
digest) at
:404and adopt the row's ancestry, lens and text. Fixes the boundary stall; alone, deficit rows stay stranded and orphans accrue one per interrupted deficit session per commit.
- A: resume reads state. Add
- Recommendation: A, with C inside Cut 3 (it is A's adoption rule
applied to the one row
lookupalready returns) and A's listing inside Cut 4 wheredemand_entriesis written. The probe supports it: the only way to find a moved key is to read the rows. Orphan rows already in a store are a separate hygiene question (a terminal state for abandoned rows, or a scan at open) and are not posed here. - Depends on it: Cut 3 (the adoption rule, boundary half); Cut 4 (the listing, deficit half).
- Ruling: A. The operator: "A, of course". Resume reads state: the in-flight listing rediscovers work by what it answers; the command id stays the kernel's idempotency key and stops being the only way to rediscover work. Cut 3's adoption rule is part of A's design, not a competitor.
- Authority: operator.
- Ruled: 2026-09-16.
Cut 0. Captures
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpat817c9f4. No commit; output lives in the session scratchpad. A detached scratch worktree is acceptable here because nothing comes back;git ls-files --eol cratesshowsw/crlfundercore.autocrlf=trueand it does not affect these captures. - First:
- Test census: recorded above (this map ran it; Hands need not rerun).
Compare post-cut with
-- --listand the same per-module tally. base-session-id.txt: in the scratch worktree, add a temporary test besidea_session_identity_is_derived_from_its_answer(elaboration.rs:2549) that printssession_command_id(&session("sha256:one")).unwrap().to_string()for that test's session (nil_for_testworld,Uncovered, deficit answer, ancestrysha256:ancestry). Record the UUID text. Cut 3 pins that the derivation is byte-equal to it after the lens and text join the session: identity is unchanged by L1.base-catalog.txt: printpatch_tool_signatures()andsha256(serde_json::to_vec(&patch_tools()))from a temporary test inpatch.rs. Record both. Soul compares them after Cut 3 with the same method; the permanent proof is by signature (Q5).base-mismatches.json: in the scratch worktree, printserde_json::to_string(&refusals[0].mismatches)fromsoul_an_elaboration_session_resumes_and_repairs_from_its_mismatch_set(controllers.rs:9579). Record it. Cut 3's lens-invariance test asserts the same JSON under every lens.Get-ChildItem target -Recurse | Measure-Object Length -Sum: record the repo target size before Cut 1 (L0 recorded 7.5 GiB; not re-measured here).
- Test census: recorded above (this map ran it; Hands need not rerun).
Compare post-cut with
- Captured: at
ff766e8(source identical to817c9f4) by Hands, stored in the session scratchpad undercut0\, not as repo artifacts: session id56dbcdb2-9337-ac07-f322-37376b58cbcb; catalog digestsha256:285e9fa3…c5e8b; the mismatch JSON; target size 14,484,808,937 bytes; the distinct warning messages from a forced rebuild. Census by-- --list: library 420 (1 ignored), doc 10, external_admission 8, Dungeon 51 on Windows (1 ignored; 55 on Linux), build_provenance 1, persona-projection 13.
Cut 1. The lens module
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfrom817c9f4. One commit; builds alone; nothing reads it yet except its tests. Depends on Cut 0 and rulings L1-Q1, L1-Q5. - First:
git statusclean; working in the main checkout (LF). - Deletes first: none. (L1's deletions are in Cut 4; this cut is the smallest surface that Cut 2 and Cut 3 can consume.)
- Keeps and moves: none.
- Adds:
crates/ghostlight/src/lens.rs(about 130 lines plus tests):pub enum Lens { Patina, Charter, Ledger, Hearth, Tangle, Veil, Ember, Numen }withClone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize,#[serde(rename_all = "snake_case")].pub const ALL: [Lens; 8]in declaration order;pub fn name(self) -> &'static str.pub(crate) fn reaches_for(self) -> &'static str: the "Reaches for" column of the target table, verbatim.pub(crate) fn leads_with(self) -> &'static [&'static str]: existingPATCH_TOOLSnames in emphasis order, from the "Leads with" column. Initial table (Hands may reorder within a lens; every name must be aPATCH_TOOLSentry, pinned by test): Patinaset_persona_material, declare_affordance, declare_resource, declare_place; Chartergrant_authority, open_office, install_incumbent, open_forum, declare_subject; Ledgertransfer, bind, declare_resource, alter_cost, declare_route; Hearthcreate_commitment, set_persona_material, declare_subject; Tangleadvance_pressure, create_commitment, grant_authority, declare_subject, bind; Veilacquire_knowledge, communicate, declare_channel, set_reach, declare_fact, forget; Emberadvance_pressure, create_commitment, close_route, consume; Numendeclare_fact, declare_affordance, set_persona_material, witness.pub(crate) fn instructions(self) -> String(Q7 (a)):ELABORATION_INSTRUCTIONS(moved here fromelaboration.rs:52, still one sentence) followed by" Lens: {name}. Reach for {reaches_for}. Lead with {leads_with joined by ", "}; every supplied tool remains available."Under Q7 (d) this function renders the same text as a prompt paragraph instead and the constant stays where it is.pub struct LensWeights(BTreeMap<Lens, u32>)withClone, Debug, Default, PartialEq, Eq, Serialize, Deserialize,#[serde(transparent)];pub fn new(BTreeMap<Lens, u32>) -> Self;pub fn get(&self, Lens) -> u32;pub fn iter(&self);pub(crate) fn draws(&self) -> bool(some weight is nonzero). Nouniform(), no default weights (Q6):Defaultis the empty map, used only byWorldState::empty. Validity is decided at admission (Cut 2), as it is forWorldScaleIntentRef. An unknown lens name cannot be represented; serde refuses it at every deserialization boundary.#[derive(Serialize)] struct LensPreimage { world_id: WorldId, command_id: CommandId }andpub(crate) fn draw(weights: &LensWeights, world_id: WorldId, command_id: CommandId) -> Result<Lens, KernelError>:super::digest(&LensPreimage{..}),strip_prefix("sha256:"), first 16 hex →u64,u128position modulo the total, cumulative walk overLens::ALLskipping zero weights;Err(KernelError::Invariant("lens weights never draw"))when the total is zero. Same shape asselect_band(action.rs:780-818); the bias bound is the same and is stated in the doc comment.crates/ghostlight/src/lib.rs:mod lens;beside the other modules andpub use lens::{Lens, LensWeights};in the public boundary list.crates/ghostlight/src/lib.rstests module:pub(crate) fn stock_weights() -> LensWeights(every lens at 1) besidecreation()(:4997), for the literals Cut 2 touches. Library tests only.
- Per-file changes:
lib.rs:77-116region: themodandpub uselines above;elaboration.rs:52: the constant moves tolens.rs(Q7 (a)) or stays (Q7 (d)) — Cut 1 leaves it in place and Cut 3 moves it, so this cut does not depend on Q7. - Authority map: no ownership change.
lens.rsowns the stock table, the per-lens text, and the draw recipe; it reads nothing and writes nothing. - Verification (Windows; proves Windows only):
- builds:
cargo check -p ghostlight;cargo check -p ghostlight-dungeon --bin ghostlight-dungeon; no new warnings (measure from a forced rebuild:cargo clean -p ghostlightfirst, compare distinct messages bycmpagainst Cut 0's capture). - tests (
cargo test -p ghostlight --lib lens::):every_lead_names_a_patch_toolpinsleads_with()⊆PATCH_TOOLSnames for all eight, each list nonempty and duplicate-free;the_draw_is_a_function_of_world_and_sessionpinsdrawequal on repeated calls and over 200 idsCommandId::derived("l1-probe", &[&i])records the exact multiset of lenses drawn understock_weights()as a literal (computed at the cut and pinned; the literal is the replay proof);a_zero_weight_never_drawspins that with{patina:0, charter:3, ledger:1}over the same 200 digestsPatinais drawn 0 times and the charter:ledger split equals a pinned literal (near 3:1; the exact counts are the assertion);all_zero_weights_are_an_errorpinsErr(Invariant)forLensWeights::default()and for{patina:0, …, numen:0}(all eight named, all zero — a real-shaped value, not an empty map);an_unknown_lens_name_does_not_deserializepinsserde_json::from_str::<LensWeights>refusing{"Patina":1},{"patina ":1},{"patinaa":1}, and{"patina":1,"tribunal":1}, and accepting{"patina":1};rmp_serderound-tripsstock_weights()byte-equal throughto_vec_named/from_slice;each_lens_text_names_its_own_leadspinsinstructions()contains the lens name and everyleads_withname, and all eight texts differ. - negative:
rg -n '\brand\b' crates/ghostlight/Cargo.toml= 0;cargo tree -p ghostlight -e normal | rg -n '\brand\b'= 0 (checked at base: the library's tree has norand; Dungeon's does);rg -n 'lens' crates/ghostlight-dungeon/src= 0 after this cut (Dungeon touches lenses only in Cut 2);rg -n 'fn uniform' crates/ghostlight/src= 0;rg -n '\bDungeon\b|Session Zero|slider|player' crates/ghostlight/src/lens.rs= 0 (collision check: the L0playerhit isconsumer.rs:966, outside this file, so the bare pattern is safe scoped tolens.rs). - mutations: M1.1
lens.rsdraw:position < weight→position <= weight(an off-by-one that lets a zero weight draw):a_zero_weight_never_drawsmust fail. M1.2lens.rsdraw: replacecommand_idin the preimage with a constant:the_draw_is_a_function_of_world_and_session's pinned multiset must fail. M1.3lens.rsdraws():any(|w| *w > 0)→!is_empty():all_zero_weights_are_an_error(the all-eight-zero value) must fail.
- builds:
- Promises:
- P1.1
Lenshas exactly eight variants named as the target table and serializes as snake_case strings. - P1.2 Every
leads_withname is aPATCH_TOOLSentry;patch_tools(),patch_tool_signatures(), tool descriptions andsidecar/claude-sdk/test/schemas.jsonare not edited in this cut (diff shows no change inpatch.rsor the fixture). - P1.3
drawis deterministic over (world, command id, weights), never returns a zero-weight lens, and errors on an all-zero set. - P1.4 An unknown lens name is refused by deserialization with values shaped like real ones (case, whitespace, near-miss).
- P1.5 The library's dependency tree gains nothing; no
rand; nouniform()or default weights in the library.
- P1.1
- Landed:
835ea4d. - Verdicts: Soul pass 1, all mutations against
835ea4d.
| Promise | Verdict | Evidence | Mutations |
|---|---|---|---|
| P1.1 | HOLDS | Eight variants in the target's order; snake_case pinned; PATINA, Patina, 0 refused |
M1.4; Soul MS3 (reorder fails the serialize test) |
| P1.2 | HOLDS | Lead test green; catalog digest recomputed at 835ea4d equals the Cut 0 capture; patch.rs, schemas.json, Cargo.toml, Cargo.lock diff 0 |
M1.5 |
| P1.3 | HOLDS | Draw depends only on {world_id, command_id} and weights; BTreeMap order is stable; u128 total; all-u32::MAX and single-max weights draw; Default and eight zeros refuse |
M1.1, M1.2, M1.3 (caught by a divide-by-zero panic, see c1.s1.f2); Soul MS1 reversed walk, MS2 digest slice 16..32 both fail; MS4 walking iter() passes because it is the same order |
| P1.4 | HOLDS | Case, whitespace, near-miss, tribunal, numeric names refused; negative, float, over-width and non-integer weights refused in JSON and msgpack; rmp_serde round-trip byte-equal. Duplicate keys are last-wins (c1.s1.f1) |
Soul probes |
| P1.5 | HOLDS | rand 0 in manifest and cargo tree -e normal; fn uniform 0; lens 0 in Dungeon source; no Dungeon vocabulary in lens.rs; distinct warnings identical to base; draw and draws unreachable from an external crate (E0603, E0624) |
MS5, MS6, external-reach probes |
- Soul findings, pass 1:
- c1.s1.f1 (introduced, low, recorded):
LensWeightsisserde(transparent)overBTreeMap, so{"patina":1,"patina":5}deserializes toPatina = 5in JSON and msgpack. Cut 2's admission judges the parsed value and cannot see a doubled key. Same behaviour as everyBTreeMapfield in the crate. - c1.s1.f2 (introduced, low, fix in Cut 3): the all-zero guard
(
lens.rs:164, over the map's values) and the divisor (lens.rs:201-205, a sum overLens::ALL) are different computations. They agree today, but changing the guard alone panics at:205. Guard the divisor directly, asselect_banddoes (action.rs:802). Cut 3 wires the draw and owns this. - c1.s1.f3 (introduced, info, recorded): the
cfg_attr(not(test), expect(dead_code))markers produce an unfulfilled lint expectation warning, not a compile error, when their items gain a caller; the workspace has nodeny(warnings). Cut 3 must remove them, and its Soul pass must catch a leftover by the distinct-warning comparison. This corrects Hands' claim that the compiler would refuse. - c1.s1.f4 (info): external code can hold an all-zero
LensWeightsthroughnew,DefaultandDeserialize, and cannot reach the draw, since thelensmodule anddrawsare private. No crash path exists at Cut 1, consistent with L0's Q1-9.
- c1.s1.f1 (introduced, low, recorded):
Cut 2. Lens weights as world data, the owner command, and world_create.v4
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfrom Cut 1's commit. One commit: the state field, the command, the effect, the two schema bumps, the Dungeon create path and every construction site move together, because the crate graph does not build withCreateWorldhalf-changed and a schema bump without its shape change is a lie. Depends on Cut 1 and rulings L1-Q2, L1-Q3, L1-Q6. - First: Cut 1 pushed;
cargo test -p ghostlightgreen; the baseconsumer.rs:1771length trick requiresconsumer.v5to be the same length asconsumer.v0(it is). - Deletes first: none in code.
soul_the_scale_intent_is_written_once_by_genesiskeeps its name and gains no lens assertion; the lens twin is a new test. - Keeps and moves: none.
- Adds (library):
lib.rs:845region:WorldState.lens_weights: LensWeightsdirectly afterscale_intent, doc: "Written by genesis and replaced only bySetLensWeights; read by the elaborator's draw and by nothing that admits." It entersstate_digest(whole-struct digest,lib.rs:4903) and noScopePreimage.lib.rs:400-411:CreateWorld.lens_weights: LensWeights.lib.rs:416-432:CreateWorldIntent.lens_weights: LensWeights(pub, required; doc: "Required. The library holds no default weights; a consumer states the world's flavor or is refused.").mailbox.rs:171-191: pass it through.patch.rs:1903region:ResolvedPatch.lens_weights: Option<LensWeights>with the same "Someon the genesis lane and nowhere else" doc.patch.rs:2941-2946:resolve_patch(state, command_id, patch, scale_intent, lens_weights: Option<&LensWeights>).patch.rs:4597-4615region:if let Some(weights) = lens_weights { if !weights.draws() { mismatches.push(Mismatch::LensWeightsNeverDraw) } }and carrylens_weights: lens_weights.cloned()into the resolved value at:5271region.patch.rs:1549-1554region:Mismatch::LensWeightsNeverDraw(unit variant, serde tag as the others). Call sites:lib.rs:1314-1319(Some(&input.lens_weights)),:1808-1813(Some(&command.lens_weights)),:1641(None),:14368(None), plus everyresolve_patchcall inpatch.rstests (the compiler names them).lib.rs:2045-2047region:if let Some(weights) = &resolved.lens_weights { state.lens_weights = weights.clone(); }.lib.rs:1743-1778WorldState::empty:lens_weights: LensWeights::default(); genesis overwrites it andverify_state_shaperefuses a persisted all-zero set, so no state on disk ever holds the empty value.lib.rs:651-673:CommandBody::SetLensWeights { weights: LensWeights }with doc: owner only, any phase, replaces the whole set; a session that already drew keeps its recorded lens.lib.rs:860-897:WorldEffect::LensWeightsReplaced { weights: LensWeights }.lib.rs:1542-1652reduce: armCommandBody::SetLensWeights { weights } => { require_owner(state, &command.caller)?; if !weights.draws() { return Err(KernelError::PatchRejected(vec![Mismatch::LensWeightsNeverDraw])); } Ok(WorldEffect::LensWeightsReplaced { weights: weights.clone() }) }. History: this spec said identical weights are still a commit, likening the owner's act to an empty-motion tick. Superseded by c2.s1.f1: an identical set changes nothing canonical and is refused withNoCanonicalChange, while a tick moves fictional time.lib.rs:4708-4894apply_effect: armWorldEffect::LensWeightsReplaced { weights }re-decidingrequire_owneranddraws()(the same re-decide shape asWorldActivated,:4788-4798) thenstate.lens_weights = weights.clone().require_system_capability(:1656-1673) and its twin (:4716-4728) need no clause: the new pair is not listed, so a system caller isUnauthorizedon both sides.lib.rs:3694-3721snapshot:lens_weights: state.lens_weights.clone();lib.rs:1088-1116:WorldSnapshot.lens_weights: LensWeights(pub).journal.rs:722-738region: after the scale-intent check,if !state.lens_weights.draws() { return Err(JournalError::Corrupt("the lens weights never draw".into())); }.lib.rs:172-173:ghostlight.world_state.consumer.v5,ghostlight.world_commit.consumer.v5.consumer.rs:2237: the literal becomesconsumer.v5;:1771unchanged (same length).CreateWorldliterals gainlens_weights: stock_weights()(library tests) atmailbox.rs:180(production:input.lens_weights),:935,:1356;journal.rs:1064,:1146,:1497;lib.rs:4998;controllers.rs:8417,:9012,:9415,:9705,:10252,:10697,:11609,:13137,:13636.crates/ghostlight/tests/external_admission.rs:46builds its ownLensWeights::new(BTreeMap::from([(Lens::Patina, 1)]))(an external crate has no fixture). The compiler names any site this list missed.
- Adds (Dungeon, Q6 B):
runtime.rs:158-179CreatePayload.lens_weights: LensWeights(required; doc: "Required, and must draw: a payload that omits it is refused, which is whatworld_create.v4means. An unknown lens name is refused by deserialization before any handler runs.").:1457-1474: passlens_weights: payload.lens_weights.runtime.rs(production, besideconfigured_cover_budget):pub(crate) fn uniform_lens_weights() -> LensWeights— every stock lens at 1 — with doc: "Dungeon policy for a world created before Session Zero's sliders exist (D2). Not a library default; the library requires the weights to be stated." Used byeve.rsfor the create surface's default value and by the smoke harness.eve.rs:49-57:CREATE_BINDINGS: [&str; 8]adds"lens_weights";:295-301region: aworld.create.lens_weightscontrol.input.textareabound aslocal_draft("lens_weights", "json")whoseprops.valueisserde_json::to_string(&uniform_lens_weights())(the policy default, editable) and whose placeholder shows the same JSON;:312and:614:ghostlight.world_create.v4.runtime.rs:3122-3154titled_two_cell_world:lens_weights: uniform_lens_weights();:2886,:2967:ghostlight.world_create.v4with"lens_weights":{"patina":1,…}in the payload (all eight);:4017-4045: the stale case namesv3and is denied (thev2case becomes history and is replaced, not kept beside it); a new case posts av4payload with"lens_weights":{"patina":1,"tribunal":1}and assertsdeniedwith no world created, and another posts every lens at zero and assertsdenied(the resolver'sLensWeightsNeverDrawsurfaces as the payload error) with no world created.
- Tests (library,
lib.rstests module unless said):genesis_writes_the_lens_weights_it_was_given(create with{patina:2, numen:1}, snapshot carries it, replay throughWorldKernel::openequal);a_genesis_lens_set_that_never_draws_is_refused(all eight named at zero →PatchRejectedcontaining exactlyLensWeightsNeverDraw, no world file written);soul_the_lens_weights_are_replaced_only_by_the_owner_command: the lens twin oflib.rs:14330— an ActiveAdmitPatchresolves withlens_weights: None;SetLensWeightsfrom the owner in Draft and again in Active replaces the set and moves the revision; the same body from a non-owner principal isUnauthorized; fromCallerId::System(SystemCapability::Elaborator{..})isUnauthorized; fromClockisUnauthorized; a set with every lens at zero isPatchRejected([LensWeightsNeverDraw]); a set with a single nonzero lens is admitted (a zero weight is admitted, it just never draws); a journal row forged with a non-owner caller and aLensWeightsReplacedeffect fails replay (thejournal.rs:1130forgery shape);a_store_written_before_the_lens_schema_is_refused: theconsumer.v4strings for state and commit rows refused at open, beside the existing v1 test (journal.rs:1245), same shape;lens_weights_enter_the_state_digest_and_no_scope_digest: two states differing only in weights have differentstate_digest, and every subject's scope digest (bound_scope_digest) is equal before and after aSetLensWeightscommit;external_admission.rs:set_lens_weights_from_a_non_owner_is_refused_and_commits_nothingthroughsubmit_principalwith a secondVerifiedPrincipalEvidence(revision, state digest, last commit digest, operator log length unchanged, same shape as the file's other rejections), andset_lens_weights_with_an_unknown_lens_does_not_decodepinningserde_json::from_value::<CommandBody>(json!({"type":"set_lens_weights", "weights":{"patina":1,"veil ":1}}))isErr— a serde limit, stated as such, not a kernel admission proof. - Per-file changes: as listed under Adds; additionally
docs/architecture/ghostlight-world-ontology.md:260and:307-308nameworld_create.v4andconsumer.v5;ghostlight-world-consumer-api.md:182-183namesconsumer.v5[Hands];notes/local-live-smoke.md:276is history and stays;notes/fresh-workspace-handoff.md:241andstate/map.yaml:378,385[steward]. - Authority map:
- Owner: the reducer owns lens weights. Genesis writes them through
ResolvedPatch.lens_weights;SetLensWeightsreplaces them throughreduce→apply_effect; replay re-derives both. - Inputs:
CreateWorldIntent.lens_weightsfrom the consumer (Dungeon's from itsv4payload, defaulted on the surface by Dungeon policy);CommandBody::SetLensWeightsfrom the owner principal. - Outputs:
WorldSnapshot.lens_weights(read by the elaborator's draw in Cut 3 and by any projection); the effect in the commit row. - Derived state: the Eve create surface's default value (Dungeon policy, display until submitted). The drawn lens (Cut 3) is derived from the weights at draw time and then recorded; it is not re-derived.
- Forbidden writers:
AdmitPatch(resolves withNone, pinned); any system capability (require_system_capabilitytable, pinned); any consumer or elaborator lane; the library (no default weights). - Shared paths: genesis and
SetLensWeightsshareLensWeights::drawsandMismatch::LensWeightsNeverDraw; replay and live commits sharereduce/apply_effect;verify_state_shapeis the third statement of validity, as it is forscale_intent; the Eve button and the smoke harness both reachCreateWorldIntentwith weights Dungeon stated. - Deletion line: nothing deleted; three schema strings are replaced and the old ones become refused, not read.
- Owner: the reducer owns lens weights. Genesis writes them through
- Verification:
- builds:
cargo check -p ghostlight,cargo check -p ghostlight --tests,cargo check -p ghostlight-dungeon --tests; warning set unchanged (forced rebuild,cmp). - tests:
cargo test -p ghostlight= 420 + new (-- --listtally: every base name present);cargo test -p ghostlight --test external_admission= 8 + 2;cargo test -p ghostlight-dungeon --bin ghostlight-dungeon= 51- 2 (same base names;
every_operation_the_panel_emits_has_a_schemaruntime.rs:4065passes with the eighth binding);cargo test -p ghostlight --doc= 10 (with--all-featurestoo: the standing seal check).
- 2 (same base names;
- negative:
rg -n 'consumer\.v4' crates docs notes state --glob '!state/evidence*'lists only history lines (L0 map and postmortem,docs/architecture/ghostlight-library-extraction*.md; ontology:255names v2 as history and stays);rg -n 'world_create\.v3' crates= 1, the stale-payload denial test;rg -n 'fn uniform' crates/ghostlight/src= 0 andrg -n 'uniform_lens_weights' crates/ghostlight-dungeon/src≥ 3 (definition, Eve default, smoke harness);rg -n 'lens' crates/ghostlight-dungeon/src/mesh.rs crates/ghostlight-dungeon/src/idunn_health.rs= 0. - mutations: M2.1
lib.rsreduceSetLensWeights arm: delete therequire_ownercall:soul_the_lens_weights_are_replaced_only_by_the_owner_command(non-owner principal) must fail. M2.2lib.rsapply_effectLensWeightsReplaced arm: delete its owner re-check only: the forged journal row half of the same test must fail. M2.3patch.rsgenesis check:!weights.draws()→weights.0.is_empty():a_genesis_lens_set_that_never_draws_is_refused(all eight named at zero) must fail. M2.4journal.rslens check deleted: a state row with an all-zero set written by hand must open; the refusal test must fail. M2.5lib.rs:172schema string reverted tov4:a_store_written_before_the_lens_schema_is_refusedmust fail. M2.6runtime.rsCreatePayload.lens_weightsgiven#[serde(default)]: the Dungeon test posting av4payload withoutlens_weights(add it) must fail to be denied. - operator: none in this cut; the Linux proof is the recipe run and is listed under findings.
- builds:
- Promises:
- P2.1 A created world carries the weights it was given; replay reproduces them digest-for-digest.
- P2.2 An all-zero set is refused at genesis, by the command, and at the
Dungeon payload boundary with
Mismatch::LensWeightsNeverDraw; a single zero weight is admitted. - P2.3 Only the owner principal can replace weights; every system
capability and every non-owner principal is
Unauthorized, from inside the crate and from the external crate; a forged owner row fails replay. - P2.4
AdmitPatchcannot carry or change weights (resolvesNone). - P2.5
consumer.v4stores are refused at open; no migration path exists (rg -n 'v4' crates/ghostlight/src/journal.rsshows only the refusal test's literal). - P2.6 The library requires explicit weights and holds none;
world_create.v4carries them; Dungeon's surface defaults them by its ownuniform_lens_weights(); av3invocation is denied. - P2.7 Weights enter
state_digestand no scope digest.
- Landed:
d06fd7e(code),10be98c(docs). - Verdicts: Soul pass 1; Hands' mutations against
10be98c, Soul's own against the same tree.
| Promise | Verdict | Evidence | Mutations |
|---|---|---|---|
| P2.1 | HOLDS | Genesis and replay tests; Soul's replay probe across two weight commits | MH.2; Soul MS.2 |
| P2.2 | HOLDS | Refused at genesis, the command, the Dungeon payload and the stored state row; a zero weight among real ones is admitted. The stored-row check is a redundant third layer (c2.s1.f3) | M2.3, M2.4, MH.4; Soul MS.4 (one shared draws() owner), MS.5 |
| P2.3 | HOLDS | Non-owner principal, approver, elaborator, clock and consumer refused in-crate and from an external crate; one state.owner source read by both require_owner and the effect arm; CommandEnvelope and WorldKernel private; only submit_principal accepts a body, with the caller derived from verified evidence. The forged all-zero row test catches through the digest, not the draw rule (c2.s1.f4) |
M2.1, M2.2; Soul MS.1 |
| P2.4 | HOLDS | An Active AdmitPatch resolves with lens_weights: None and leaves weights unchanged |
none isolates it; asserted by test |
| P2.5 | HOLDS | consumer.v4 stores refused, rerun by Soul; no migration read path |
M2.5 |
| P2.6 | HOLDS in the library and the create payload; UNPROVEN on the browser path | Payload refusals, uniform Dungeon default pinned, harness passes weights explicitly. The browser form's bindings never reach the payload fields (L1.f11) | M2.6, MH.3; Soul MS.3 |
| P2.7 | HOLDS | ScopePreimage carries no weights; three scope digests identical across two weight commits. No session draws yet, so "a session keeps its lens" is untested here and owned by Cut 3 |
MH.1 |
- Soul findings, pass 1:
- c2.s1.f1 (introduced, medium, fix):
SetLensWeightswith weights equal to the current ones commits: revision advances and the digest moves. Nothing canonical changed, so this breaks the kernel invariant that a no-effect command leaves revision, digests and journal unchanged. The clock tick is not a precedent, because it moves fictional time. Fix: the command returnsNoEffectwhen the weights equal the current weights. - c2.s1.f2 (pre-existing, info): replay, the commit count, and
verify_state_shapeall refuse a stored all-zero state; see c2.s1.f3. - c2.s1.f3 (introduced, low, recorded): the
verify_state_shapelens clause is not load-bearing. With it removed, replay ("head state does not equal replayed history") and the commit-count check still refuse the row. It is a third layer, as the spec intends. - c2.s1.f4 (introduced, low, fix): the all-zero forgery in
a_forged_lens_weights_row_fails_replay(journal.rs:1411-1421) is refused by the resulting-state-digest mismatch, so the test still passes withdraws()weakened. Fix: build the forgery so its digests are consistent and only the draw rule can refuse it, then mutatedraws()to prove it.
- c2.s1.f1 (introduced, medium, fix):
- Fix batch landed:
afca403(c2.s1.f1) andacb9b33(c2.s1.f4).reduce'sSetLensWeightsarm refuses a set equal to the current weights withPatchRejected([NoCanonicalChange]), after the capability, owner and draw checks. The kernel has noNoEffectvariant; the existing "valid but changes nothing" refusal is used, and the implementation plan's wording is corrected to match.- The forged-row test now builds self-consistent forgeries. A control set
rebuilt the same way replays, so only the draw rule refuses the all-zero
row, at
verify_state_shape. - Mutations: MF1.1 (the equality check deleted) fails the external and
in-crate tests; MF4.1 (
draws()changed to!is_empty()) fails the forged-row test. - Counts: library 435, doc 10, external_admission 11, Dungeon 53, build_provenance 1, persona-projection 13. Warnings identical.
- Soul findings, pass 2 (all against
acb9b33; promises 1 and 3–7 of the batch held):- c2.s2.f1 (introduced, low, fix in Cut 3): the no-op check compares
raw maps, but a missing lens reads as weight zero.
{charter:3}→{patina:0, charter:3}commits (revision 3 → 4), and changing back commits again. Both sets draw identically. Fix in Cut 3, beside c1.s1.f2: equality compares every lens's effective weight, not the map's spelling. - c2.s2.f2 (introduced, low, recorded): only the in-crate test pins that the no-op check comes after the draw rule (mutation SO.2). The external test cannot observe it. One pin is sufficient.
- c2.s2.f3 (introduced, low, fixed here): this map's Cut 2 spec still said identical weights commit. It is now marked as history above.
- c2.s2.f1 (introduced, low, fix in Cut 3): the no-op check compares
raw maps, but a missing lens reads as weight zero.
Cut 3. The lens and its text on the session, in the store, and the adoption rule
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfrom Cut 2's commit. One commit. Depends on Cuts 1–2 and rulings L1-Q1, L1-Q4 (revised: identity unchanged), L1-Q5, L1-Q7 (a), and carries L1-Q9's option C (the adoption rule) because P3.2 is unprovable without it. - First: Cut 0's
base-session-id.txtandbase-mismatches.jsonin hand; Cut 2 pushed and green; probe 3's boundary stall reproduced once as a temporary test at Cut 2 (it must still saySuperseded; that is the before-state the adoption rule removes). - Deletes first:
elaboration.rs:52ELABORATION_INSTRUCTIONSas a bare constant referenced byelaboration_request(it moves intolens::instructions());elaboration.rs:404-405, the whole-session equalitycheckpoint.session() != &sessionas the supersession test (it is replaced by the identity comparison below). - Keeps and moves:
session_command_id(elaboration.rs:1271-1277) is untouched: the lens is not in the identity.select_answerkeeps its name and its two arms; it gains the draw and the text. - Adds:
elaboration.rs:57-66:ElaboratorSession.lens: LensandElaboratorSession.instructions: Stringafterancestry, docs: "Drawn once when the session is first built from its command id, recorded here, and never redrawn; a resumed session reads it back." and "The instruction text this session was built with, persisted asagent_promptis; integrity binds the stored invocation to this text, not to the code constant."deny_unknown_fieldsstays.elaboration.rs:642-677select_answer: after building the identity fields,let command_id = session_command_id(..)?; let lens = lens::draw(&snapshot.lens_weights, snapshot.world_id, command_id)?; instructions: lens.instructions()in both arms (theKernelErrormaps toControllerError::Serializationasdigest_ofdoes).stepat:386then reuses that id rather than deriving it twice.elaboration.rs:400-412lookup, the adoption rule (L1-Q9 C):if !checkpoint.session().same_answer(&session) { return Ok(Superseded) } let session = checkpoint.session().clone();wheresame_answercomparesworld_id,jurisdiction,answerandanswer_digestonly.ancestry,lensandinstructionsare the row's: ancestry because the world moving is not the answer moving (probe 3), lens and text because a resume never redraws (L1-Q3). Doc: "The row is the recorded session. Identity decides whether it is this answer's row; everything else about the session is read from it."elaboration.rs:1233-1254elaboration_request(command_id, round, model, instructions: &str, input); callers:445,:584, and:153pass&session.instructions(theElaboratorInFlightarm ofintegrity_is_validdestructuressession).elaboration.rs:201-247valid_elaboration_progression: unchanged; it compares whole sessions, so a checkpoint that changes the lens, the text or the ancestry is an illegal transition. Pin it. (Progression compares rows to rows; adoption compares a fresh derivation to a row. The two rules differ on purpose and the docs on both say so.)controllers.rs:77-78:controller_work.v16/ghostlight.controller_work.v16.- Tests (
elaboration.rstests unless said): the fourElaboratorSessionliterals at:2399,:2428,:2550,:2574gainlens: Lens::Patina, instructions: Lens::Patina.instructions();a_session_identity_is_derived_from_its_answer(:2549) additionally assertsfirst.to_string() == "<base-session-id.txt>"and that changinglensorinstructionsleaves the id equal;soul_the_session_command_id_derivation_moved_under_the_refactor(:2398) is unchanged;a_resumed_session_keeps_its_recorded_lens_when_the_weights_change(controllers tests, beside:9497): world created with{patina:1}only; round one is refused and persisted; the owner submitsSetLensWeights{{numen:1}}(a commit, so ancestry moves too); a fresh runner over the same store resumes (same id; adoption keeps the row's session) and commits under the same command id with the checkpoint'ssession.lens == Patinaand the second invocation'sinstructionsstill naming Patina and its input carrying the first refusal; then a new boundary (a second dead-end route declared by the owner) starts a new session whose lens isNumen;a_boundary_session_resumes_after_an_unrelated_commit(controllers tests; probe 3's boundary half as a permanent test):Rejected, thensubmit_clock(60), then a fresh runner's step isCommittedunder the same id and its input carries the refusal; (probe 3's deficit half needs the listing and is Cut 4'sa_stranded_deficit_session_is_adopted_with_its_refusal_intact);a_checkpoint_that_changes_the_lens_or_its_text_is_an_illegal_transition: from a persistedElaboratorInFlight, a next checkpoint identical exceptlensis refused by the real store with the "illegal checkpoint transition" error; likewise exceptinstructions, likewise exceptancestry;a_row_whose_text_and_invocation_disagree_is_refused_at_open(controllers tests, the Q7 probe as a permanent test): a raw row whose storedinstructionsis"STORED TEXT A"and whose invocation was prepared under"REQUEST TEXT B"fails its checkpoint binding at open, and the same row with both texts equal to a string that is not the currentLens::Patina.instructions()opens (the property (a) buys, stated as such);soul_the_same_patch_admits_the_same_under_every_lens(controllers tests): for each of the eight lenses, a world created with that lens at 1 and every other at 0, the round-one bad shed patch of:9497yieldsrefusals[0].mismatchesJSON equal tobase-mismatches.json, and the repaired patch commits; the eightagent_prompts are byte-equal (the prompt carries no lens text) and the eightinstructionsdiffer only in the lens clause;the_catalog_takes_no_lens:patch_tools()andpatch_tool_signatures()are called with no argument (proof by signature; the test asserts theTools:line of a lensed prompt equalspatch_tool_signatures()byte-for-byte);a_controller_work_row_from_v15_is_refused_at_open(controllers tests): a real lensedElaboratorInFlightpayload under av15envelope is refused at open (the shape of:11343), beside the v10/v9 loop.
- Per-file changes: as listed;
docs/architecture/ghostlight-world-ontology.md:308namescontroller_work.v16[Hands];notes/fresh-workspace-handoff.md:227[steward]. - Authority map:
- Owner:
select_answerowns the draw and the text for a new session; the checkpoint row owns the whole session once it exists, and the adoption rule reads it. - Inputs:
WorldSnapshot.lens_weights, the session's command id, the store'slookup. - Outputs:
ElaboratorSession.{lens, instructions}in every checkpoint stage; the text on the wire as the system prompt. - Derived state: the fresh draw and text are derived and then discarded
whenever a row exists (
X is no longer an owner; the row's session is). - Forbidden writers: a resume path that redraws or re-authors the text
(structurally absent: after
lookupreturns a row, the fresh session value is dropped); a checkpoint transition that changes the lens, the text or the ancestry (refused by row-to-row session equality); the code constant (no longer consulted by integrity for this lane; the seed, narrative and operational lanes keep theirs — L1.f9); a supersession test that reads ancestry (deleted). - Shared paths: first run and resume share
step'smatch existing; the real store andRecordingWorkStoresharevalid_controller_work_progression; the connector and the SDK sidecar both receiverequest.instructions. - Deletion line:
ELABORATION_INSTRUCTIONSas the integrity reference and the whole-session supersession equality are gone before the new fields are read;controller_work.v15rows become refused.
- Owner:
- Verification:
- builds: as Cut 2.
- tests:
cargo test -p ghostlight= Cut 2 count + new;sdk_inference::tests::schema_fixtures_match_the_checked_in_sidecar_grammarpasses without regenerating the fixture (the diff showssidecar/claude-sdk/test/schemas.jsonunchanged); Dungeon 53 unchanged. - negative:
rg -n 'controller_work\.v15' crates= 0 outside the new refusal test;git diff Cut2..Cut3 -- crates/ghostlight/src/patch.rs sidecaris empty;rg -n 'ELABORATION_INSTRUCTIONS' crates/ghostlight/src= 1 (its definition inlens.rs);rg -n 'lens' crates/ghostlight/src/controllers.rsmatches only tests and the two constants' doc lines;rg -n 'session\(\) != &session' crates/ghostlight/src/elaboration.rs= 0. - captures compared:
patch_tool_signatures()and thepatch_tools()digest equalbase-catalog.txt(same method). - mutations: M3.1
elaboration.rsadoption rule: restore whole-session equality:a_resumed_session_keeps_its_recorded_lens_when_the_weights_changeanda_boundary_session_resumes_after_an_unrelated_commitmust fail (Superseded). M3.2elaboration.rsadoption rule: keep the fresh session instead of the row's: the same test must fail on the checkpoint's lens or on the illegal transition. M3.3elaboration.rsselect_answer: draw fromstock_weights()-shaped uniform weights instead of the snapshot: the eight-lens test (each world with one nonzero lens) must fail. M3.4elaboration.rs:205existing.session() != next.session()→ compare identity fields only:a_checkpoint_that_changes_the_lens_or_its_text_is_an_illegal_transitionmust fail. M3.5integrity_is_valid: passLens::Patina.instructions()instead ofsession.instructions:a_row_whose_text_and_invocation_disagree_is_refused_at_open's second half (a non-current text opens) must fail. M3.6session_command_id: appendsession.lens.name()as a part:a_session_identity_is_derived_from_its_answer's base-UUID pin must fail.
- Promises:
- P3.1 The lens is drawn once, when no row exists, from the snapshot's weights and the session's command id; the command id derivation is byte-identical to base (the captured UUID is reproduced).
- P3.2 A resumed session keeps its recorded lens, text and ancestry
across a weight change, an unrelated commit, a fresh runner, and a
store reopen; a row-to-row checkpoint that changes any of them is
refused; a boundary session is no longer reported
Supersededby the world merely moving. - P3.3 The same patch admits the same under every lens (pinned against the base mismatch set).
- P3.4 The catalog is lens-independent by signature; the sidecar fixture
and
patch.rsare untouched. - P3.5
controller_work.v15rows are refused at open; no migration. - P3.6 Integrity binds the stored invocation to the stored text; a row whose two disagree is refused, and a row whose text is not the current code's still opens (the (a) trade, stated).
- P3.7 Deficit rediscovery after an unrelated commit is Cut 4's promise (P4.6), not this cut's; no test in this cut is ignored.
- Landed:
dfb3c52(c1.s1.f2, the draw's divisor guarded directly),4334dd7(c2.s2.f1, lens sets compared by effective weight),18b1098(Cut 3 proper; carries two unfulfilled-expectation warnings that the next commit removes),4457fde(c1.s1.f3, markers removed),2bf8164(non-adoption across world or jurisdiction).session_command_idnow takes(world_id, jurisdiction, &answer_digest), so the lens is absent by signature; the derivation bytes are unchanged. - Verdicts: Soul pass 1 against
2bf8164.
| Promise | Verdict | Evidence | Mutations |
|---|---|---|---|
| P3.1 | HOLDS for identity; UNPROVEN that the call-site draw reads the command id (c3.s1.f2) | The UUID pin equals Cut 0's 56dbcdb2…; session_command_id takes no session |
M3.6a, M3.6b kill; Soul S3 (draw with CommandId::new()) survives |
| P3.2 | HOLDS; its illegal-transition pin is flaky (c3.s1.f1) | At 1a402e1 the boundary test failed as Superseded; it now commits through a store reopen with the refusal intact. The weights test keeps the recorded lens across reopen. Lens, text and ancestry transitions are each observed accepted under M3.4 and refused without it |
M3.1, M3.2, M3.4; Soul S1 kills |
| P3.3 | HOLDS | Eight-lens admission equals base-mismatches.json; prompts byte-equal |
M3.3 |
| P3.4 | HOLDS | Catalog signatures and digest rerun, equal to Cut 0; no patch.rs or sidecar diff |
signature proof |
| P3.5 | HOLDS | v15 row refused at open; the same payload under v16 opens | none |
| P3.6 | HOLDS | Disagreeing stored text and invocation refused; agreeing arbitrary text opens. Nothing pins that resume uses the stored text (c3.s1.f3) | M3.5 kills; Soul S5 survives committed tests |
| P3.7 | HOLDS | Deficit orphan reproduced as base behaviour; no ignores added | none |
| c1.s1.f2 | HOLDS | Divisor guarded (lens.rs:195-203); no panic with draws() weakened |
MF2.1 |
| c2.s2.f1 | HOLDS | weighs_the_same_as over Lens::ALL; padded twins refused in both directions through the mailbox |
MF21.1 |
| c1.s1.f3 | HOLDS | Markers gone; forced-rebuild warnings identical to Cut 2 | none |
- Soul findings, pass 1:
- c3.s1.f1 (introduced, medium, fix): flaky pin.
controllers.rs:10221rewritessession.lens = Lens::Numen, butrefused_checkpoint()draws under uniform weights with a random world id. About one run in eight the recorded lens is already Numen, andassert_ne!(next, checkpoint)(:10230) fails. Soul observed 2 failures in 9 runs. - c3.s1.f2 (introduced, low, fix): every lens-observing test uses a
single-lens world, so the draw is forced. A call site that draws with an
unrelated command id (S3) survives. Only
lens.rsunit tests pin the recipe. - c3.s1.f3 (introduced, low, fix; the untested Q7 ruling): mutation S5,
which rebuilds the resumed text from
session.lens.instructions()(:476), survives every committed test. No test proves that a session resumes with its stored text after the lens's text changes in code, which was the purpose of L1-Q7 (a). Recorded cost within Q7: nothing ties a row's stored text to its recorded lens. A row with arbitrary text or another lens's text, invocation prepared to match, opens and drives inference with that text. Only the local store file can write it (pub(super)fields). - c3.s1.f4 (pre-existing, low-medium, recorded): see L1.f13 (seed lane).
- c3.s1.f5 (pre-existing orphaning, lens re-roll introduced, low,
recorded): the boundary's scope preimage includes the route record
(
lib.rs:3892-3899). A caller with patch authority who alters a lane's cost moves the digest while the boundary survives. The next session re-rolls its lens and the in-flight row is orphaned. Containment, occupant or incident changes remove the boundary outright (lib.rs:3878-3884). A fresh session after a real structural change is arguably correct; the orphan row adds to orphan hygiene. - c3.s1.f6 (info): dropping
answer_digestfromsame_answer(S2) is an equivalent mutant, because the id already carries the digest.
- c3.s1.f1 (introduced, medium, fix): flaky pin.
- Test-only fix batch landed:
f63dfd1(c3.s1.f1),b3b5053(c3.s1.f2),2c3b513(c3.s1.f3). Production diff againstef64008is empty; all hunks are insidecontrollers.rs's test module.- c3.s1.f1: at
ef64008the illegal-transition test failed 3 of 40 looped runs. The lens rewrite now always differs from the recorded lens, and 120 of 120 runs passed. - c3.s1.f2:
a_fresh_session_draws_its_lens_from_its_own_command_idchecks eight worlds under stock weights through the real call site, asserting the premise that an unrelated id draws differently. S3 (draw withCommandId::new(),elaboration.rs:713) now fails it, againstb3b5053. - c3.s1.f3:
a_resumed_session_keeps_its_stored_text_when_the_lens_text_changesresumes a real-store row whose stored text differs from the lens's current text and asserts every later inference carries the stored text. S5 (elaboration.rs:476, the text rebuilt from the lens) now fails against2c3b513. It is caught first by the store refusing the mutant's checkpoint; the text assertion is a second guard. - Counts: library 445 (444 + 1 ignored), doc 10, external_admission 12, Dungeon 53, build_provenance 1, persona-projection 13. Warnings identical to Cut 3.
- No separate Soul pass on this batch. It is test-only with an empty production diff and defined, killed mutations. Cut 4's Soul pass reruns S3 and S5 independently.
- c3.s1.f1: at
Cut 4. Concurrent sessions over a per-sweep claim set, under the elaboration ceiling
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfrom Cut 3's commit. One commit (library and Dungeon driver together: thesweepsignature changes and the second pool is born). Depends on Cut 3 and ruling L1-Q4. - First: Cut 3 pushed and green; probe 1's collision reproduced once
more at Cut 3 as a temporary test through two direct
step_sessioncalls (it must still collide there; that is the before-state this cut makes unreachable). - Deletes first:
crates/ghostlight/src/elaboration.rs:603-632: the sequentialsweeploop and its comment about eight tasks and a capacity-32 mailbox (30 lines).elaboration.rs:328-342:ElaborationOutcome::Inactiveif no arm produces it after the phase check moves tosweep(the compiler decides; delete, do notallow(dead_code)).crates/ghostlight-dungeon/src/runtime.rs:1821-1822: the "One sequential sweep per wake" doc lines;:1080-1081"There is no second concurrency owner" becomes "Two pools, one per lane; neither lane draws from the other's."
- Keeps and moves:
step(jurisdiction)becomesstep_session(session: ElaboratorSession, snapshot: &WorldSnapshot)with the body from:386on; the phase check moves tosweep. - Adds (library):
elaboration.rs:fn demand_entries(snapshot) -> Result<Vec<ElaboratorSession>, ControllerError>: for each jurisdiction ofscale_deficitplusUncovered(the list:609-617builds), every boundaryboundary_inadmits in snapshot order, then the deficit entry when the row is nonzero, each through Cut 3'sselect_answershape (pure over the snapshot); a boundary under nested roots appears under each covering root, so the list is deduped by command id keeping first occurrence. The claim set is thisVec, alive for one sweep and never persisted. Rediscovery (L1-Q9 A):sweepcallsself.work.elaboration_in_flight()once per sweep, before drawing anything, anddemand_entriestakes that list: for each demand entry, if exactly one listed row has the sameworld_id,jurisdictionandanswer(ancestry, lens and text ignored), the entry is that row — its session and its command id are adopted and no draw happens; if none, a fresh session is built as above; if more than one (which the dedup and one-sweep-at-a-time make impossible from this code, but a store can hold anything), the oldest bystored_atis adopted and the rest are logged atwarnas orphans. A deficit entry adopted this way keeps its old ancestry and old id;require_answerre-checks the deficit at commit (lib.rs:1706-1712), so the ancestry is informational, and the repair prompt still carries the refusal the model saw. The command id stays the kernel's idempotency key and stops being the only way to rediscover work;step_session'slookupby id and Cut 3's adoption rule remain the second line for the boundary path.controllers.rs:1541region:ControllerWorkStore::elaboration_in_flight(&self) -> Result<Vec<(CommandId, ElaboratorSession)>, ControllerWorkStoreError>as a required trait method (no default body: a store that cannot list must say so at compile time).CultCacheControllerWorkStoreanswers it from the in-memoryjournal.workmap (:1662-1667shape): one pass over the rows, filteringControllerWork::ElaborationinElaboratorInFlightorReadyToSubmit(notNoPatch), afterverify_journal_custodyaslookupdoes. Cost O(rows) over a map of tens to hundreds of entries, run once per sweep (every 300 s), never per entry and never per step; no index, no schema, no new row.RecordingWorkStore(:8339) implements it the same way over itsworkmap. Dungeon's test stores (AlwaysFreshWorkStoreruntime.rs:3194and its siblings) returnOk(Vec::new()), which is true of them.elaboration.rs:pub async fn sweep(&self, permits: Arc<tokio::sync::Semaphore>) -> Result<(), ControllerError>: snapshot; returnOk(())unless Active;demand_entries; atokio::task::JoinSet; for each entrylet permit = permits.clone().acquire_owned().await(a closed semaphore ends the sweep withOk(())), spawn a task that holds the permit acrossstep_session(the runner derivesClone; every field isArcorClone); collect; arequires_quarantineerror is returned after every task has finished (so no task is orphaned), others aretracing::debug!as today. Doc: "One permit per session for its whole step, from the ceiling the caller owns. The library holds no concurrency number of its own."
- Adds (Dungeon):
runtime.rs:68-96AppState.elaboration_permits: Arc<Semaphore>besidecontroller_permits, doc: "The elaboration ceiling.controller_permitsis the simulation budget: speak turns and cover cells, and nothing else, draw from it.";:355region:Arc::new(Semaphore::new(configured_elaboration_ceiling()));:1866-1872region:fn configured_elaboration_ceiling() -> usizereadingGHOSTLIGHT_ELABORATION_MAX_CONCURRENT,>= 1, default 2, with the doc: "A ceiling, not a budget: the most sessions elaboration may run at once. Nothing reserves connector capacity for it; a connector capacity refusal is a retryable fault the next sweep retries.":1837:runner.sweep(state.elaboration_permits.clone());:1817-1822doc: sweeps still never overlap (the loop awaits the sweep), so one sweep's claim set is the only set of sessions alive. Test fixtures at:2602gain the second semaphore (TEST_ELABORATION_CEILING = 2).docs/architecture/ghostlight-dungeon-mvp.md:478names both variables [Hands].
- Tests:
- Library (controllers tests):
distinct_entries_run_at_once_under_the_ceiling: a world with two boundaries (two dead-end routes from the commons; the fixture at:9402plus one route), a counting port that records the maximum simultaneousinfercalls and yields insideinfer, pool of 2 → maximum 2, two distinct rows, bothCommitted, two distinct provider request ids;the_sweep_never_exceeds_its_ceiling: same world, pool of 1 → maximum 1;a_sweep_holds_a_permit_while_it_infers: pool of 1 already held by the test → noinfercall until the permit is released (release after a timeout; zero calls before, one after);one_answer_is_one_session_per_sweep: with one boundary and pool 2 the sweep runs exactly one session (custody elaboration_commands == 1, oneinfer);a_boundary_under_nested_roots_is_claimed_once: the two-root world of:11605with a boundary inside the inner root runs one session for it;a_deficit_entry_is_one_per_jurisdiction_per_ancestry: a world with a deficit and no boundary runs one session per sweep and a second sweep after aCommittedsession runs a new id (a finished row is not in flight and is not adopted). - Library, rediscovery (controllers tests, probe 3 as permanent tests
through
sweepwith a pool of 1):a_stranded_deficit_session_is_adopted_with_its_refusal_intact: the deficit world of probe 3; sweep one endsRejected(one row, one refusal);submit_clock(60); sweep two endsCommittedunder the first command id, the second invocation's input carries the first refusal,inferwas called exactly twice across both sweeps (once per sweep: no repeated round), andcustody elaboration_commands == 1;a_boundary_session_is_repaired_after_a_commit_and_a_tick: the boundary world; sweep oneRejected; the owner admits an unrelated operations-only patch, thensubmit_clock(60); sweep twoCommittedunder the same id with the refusal in its input, one row;the_store_gains_no_orphan_per_commit: the deficit world; after sweep-Rejected, five clock ticks each followed by a sweep whose script keeps refusing (bad shed every round, budget permitting), the store holds one elaboration row andinferwas called once per sweep;a_row_for_another_answer_is_not_adopted: rows shaped like real ones that must not match — a realElaboratorInFlightrow for the same deficit answer under a different jurisdiction (the two-root world of:11605, deficit under root B, sweep for root A), a real row whoseworld_iddiffers (a second world file's row copied into the first store through the raw backing store, with a valid envelope and canonical bytes), and a realNoPatchrow for the same answer — the sweep builds a fresh session for the entry in each case, and the foreign-world and other-jurisdiction rows are left untouched (their bytes equal before and after). - Dungeon (
runtime.rstests):saturating_one_pool_never_delays_the_otheras specified under L1-Q4: hold all elaboration permits, runrun_cover_tickonactive_two_cell_worldwith a counting port, both cells run within a bounded wall time; hold all simulation permits, runelaborator().sweep(state.elaboration_permits.clone())on a world with one boundary, oneinfercompletes.the_tick_driver_never_exceeds_its_controller_permit_pool(:3269) is unchanged and still passes on the simulation pool.
- Library (controllers tests):
- What makes probe 1's path unreachable after this cut. The loser died
at
persiston the_ => falsearm because two sessions shared one command id and raced on one row. After this cut every session alive in the process is one entry of one sweep's claim set, deduped by id, started bysweepalone (step_sessionispub(super); the seed lane has its own runner), and sweeps do not overlap (runtime.rs:1827-1839awaits one before ticking the next). Two sessions with one id would need two entries with one id in one claim set, which the dedup forbids, or two overlapping sweeps, which the driver forbids and the library does not guard (stated under Forbidden writers). The_ => falsearm stays as the store's refusal of any such row, andone_answer_is_one_session_per_sweepis the positive form of the deleted probe. - Per-file changes:
elaboration.rs:603-632replaced;:375-386split;runtime.rs:68-96,:355,:1080-1081,:1817-1841,:1866-1872,:2602;docs/architecture/ghostlight-world-ontology.md:668rewritten as the live rule: "Sessions run concurrently over distinct demand entries — every open boundary and one deficit per jurisdiction — each drawing its lens by the world's weights and recording it, each holding one permit of the elaboration ceiling; a sweep first reads the store's in-flight sessions and resumes any that answer a current demand entry; the sweep is one at a time." [Hands];ghostlight-world-ontology.md:773-775"Sessions" bullet: the "in Draft" clause stays target (L3) [Hands];ghostlight-dungeon-mvp.md:473-479names the two pools [Hands];notes/fresh-workspace-handoff.md:284-290[steward]. - Authority map:
- Owner:
sweepowns which sessions exist in a wake (the claim set); the caller's elaborationSemaphoreowns how many infer at once; the simulationSemaphoreowns speak turns and cover cells; the mailbox owns commit order. - Inputs: one snapshot per sweep; the elaboration pool; the store's
in-flight listing once per sweep (L1-Q9 A) and its
lookupby id inside eachstep_session(Cut 3's adoption rule). - Outputs: one
step_sessionper distinct entry. - Derived state: the claim set (never stored).
- Forbidden writers: any second
sweepconcurrent with the first (the runtime loop awaits; the library does not guard it — stated); any caller startingstep_sessiondirectly (pub(super)); any library-side concurrency number; any lane acquiring the other lane's pool; a fresh draw or a fresh id for an answer that has an in-flight row (the listing is consulted before any draw); the command id as the sole rediscovery path (deleted as such). - Shared paths: every session takes the same permit path and the same
step_session; a test port and the production port see the samePreparedInference; both pools are read at open by the same shape of function. - Deletion line: the sequential loop is gone before
JoinSetis written.
- Owner:
- Verification:
- builds:
cargo check -p ghostlight-dungeon --bin ghostlight-dungeon(the signature change and the second pool are the Dungeon edits). - tests:
cargo test -p ghostlight= Cut 3 count − any deleted probe + new; Dungeon 53 + 1 with the same base names. - negative:
rg -n 'for jurisdiction in jurisdictions' crates/ghostlight/src= 0;rg -n 'fn step\(' crates/ghostlight/src/elaboration.rs= 0 (onlystep_session);rg -n '\.sweep\(\)' crates= 0 (checked at base: the onlysweep()calls areruntime.rs:1837and:3934, the ignored road test, which must also pass the elaboration pool; the seed lane'ssweep(1)at:1809is a different function and does not match);rg -n 'Semaphore' crates/ghostlight/src= thesweepsignature and its doc only;rg -n 'controller_permits' crates/ghostlight-dungeon/srclists no line insideelaborate_world;rg -n 'elaboration_permits' crates/ghostlight-dungeon/srclists no line insiderun_cover_tickor the speak handler. - mutations: M4.1
elaboration.rssweep: drop theacquire_owned(spawn without a permit):the_sweep_never_exceeds_its_ceilinganda_sweep_holds_a_permit_while_it_infersmust fail. M4.2demand_entries: remove the dedup by command id:a_boundary_under_nested_roots_is_claimed_oncemust fail. M4.3sweep: return on the first error instead of after the JoinSet drains:distinct_entries_run_at_once_under_the_ceilingwith one scriptedRetryablefault must fail on the orphaned task's missing commit. M4.4runtime.rs:1837: passstate.controller_permitsinstead ofelaboration_permits:saturating_one_pool_never_delays_the_other's second half must fail. M4.5demand_entries: skip the listing (always build fresh):a_stranded_deficit_session_is_adopted_with_its_refusal_intactmust fail (Committedunder a new id, threeinfercalls, two rows) andthe_store_gains_no_orphan_per_commitmust fail (six rows). M4.6demand_entries: match onworld_idandansweronly (dropjurisdiction):a_row_for_another_answer_is_not_adopted's other-jurisdiction case must fail. M4.7demand_entries: match onjurisdictionandansweronly (dropworld_id): its foreign-world case must fail. M4.8CultCacheControllerWorkStore::elaboration_in_flight: includeNoPatchrows: itsNoPatchcase must fail. M4.9elaboration.rsadoption rule (Cut 3'ssame_answer) restored to whole-session equality while the listing stays:a_boundary_session_is_repaired_after_a_commit_and_a_tickmust fail (Superseded), which proves the two halves are separately necessary. - operator: one
GHOSTLIGHT_SMOKE_TRACEroad run (runtime.rs:3738, ignored) after this cut withGHOSTLIGHT_ELABORATION_MAX_CONCURRENT=2: the trace shows two elaboration sessions in one sweep when the seeded world has several boundaries, never more than two, and cover ticks proceeding while they run.
- builds:
- Promises:
- P4.1 Two sessions in one sweep never share a command id, a store row,
or a provider request id; probe 1's collision cannot be reproduced
through
sweep. - P4.2 Sessions in one sweep run concurrently up to the elaboration ceiling and never beyond it; a sweep with no permit available makes no inference.
- P4.3 Saturating either pool never delays the other lane.
- P4.4 The sequential loop is deleted; no library-side concurrency number exists; the two pools are configured by two named variables with the stated defaults.
- P4.5 A quarantine-class error still ends the sweep with
Err, after every spawned session has finished. - P4.6 A stranded deficit session is adopted by what it answers: it resumes under its first command id with its refusal in the next invocation and no repeated round.
- P4.7 A boundary session is repaired after an unrelated commit and a clock tick, under its id, with its refusal in the next invocation.
- P4.8 The store gains no orphan elaboration row per commit; rows for
another jurisdiction, another world, or a finished (
NoPatch) session are never adopted and never touched. - P4.9
elaboration_in_flightruns once per sweep and everyControllerWorkStoreimplements it (no default body).
- P4.1 Two sessions in one sweep never share a command id, a store row,
or a provider request id; probe 1's collision cannot be reproduced
through
- Landed:
8538fab(store listing method),6150bd7(pool split; one field-never-read warning that the next commit removes),b3963f9(concurrentsweep,demand_entrieswith rediscovery,step_session; the sequential loop,step,CleanandInactivedeleted),bc31d11(run_elaboration_sweepextracted; no session starts after a quarantine error),3e35b3d(ReadyToSubmit boundary test; permit recording). Before the cut, Hands reproduced probe 1 atd9b71c4: one commit, one illegal-transition death. - Verdicts: Soul pass 1 against
3e35b3d.
| Promise | Verdict | Evidence | Mutations |
|---|---|---|---|
| P4.1 | HOLDS | One session per answer per sweep; distinct entries run at once; loops 30/30 | MD1, M4.2b kill; M4.2a equivalent (the answer dedup makes the id guard dead) |
| P4.2 | HOLDS | Permit held while inferring; high water equals ceiling; no leak on retryable error or panic (Soul probes D, E) | M4.1 |
| P4.3 | HOLDS for cover cells and the sweep; UNPROVEN for player speak turns (c4.s1.f2) | Two Semaphore::new at runtime.rs:364-365; speak :1092 and cover :2009 on simulation; sweep :1855 on elaboration |
M4.4, MC1, MC2 kill; Soul MC3 (speak on elaboration) survives |
| P4.4 | HOLDS | Sequential loop gone; defaults 2 (minimum 1) and 4 read at runtime.rs:1894, :1905 |
none |
| P4.5 | HOLDS on error paths; FALSIFIED on the panic path (c4.s1.f4) | Quarantine error returned after started sessions finish; none start after one. A panicking task unwinds the sweep, aborts its sibling, and ends the runtime driver | M4.3, M4.3b, MQ kill; Soul MS3 survives (c4.s1.f5) |
| P4.6 | HOLDS | Stranded deficit adopted under its first id with its refusal and no repeated round; Soul probe C1 | M4.5 |
| P4.7 | HOLDS with the substitute (SetLensWeights plus a clock tick for the operations-only patch) | Boundary repaired. The id-only resume path is pinned by the ReadyToSubmit test | M4.9 survives this test (c4.s1.f1) |
| P4.8 | HOLDS as stated; see c4.s1.f8 for long-run growth | One row across five ticks; no adoption across jurisdiction, world, or a NoPatch row; foreign bytes unchanged | M4.5–M4.8 |
| P4.9 | HOLDS | Listing read once per sweep; required method with no default | MP |
-
Departure measured, now L1-Q10. The listing returns only
ElaboratorInFlightrows, notReadyToSubmit. Soul's probes:- Including them (MR1): a committed session's row is adopted every later
sweep and resubmitted (
AlreadyApplied), with no inference, and the deficit is stuck forever. - Excluding them, crash window with no commit (C1): the row is found by id, submitted, and the deficit advances.
- Excluding them, crash window with a commit (C2): a new id and a fresh session, one repeated round, and the authored row orphaned. The deficit is not stalled.
Hands' stated cost is accurate.
- Including them (MR1): a committed session's row is adopted every later
sweep and resubmitted (
-
Soul findings, pass 1:
- c4.s1.f1 (introduced, medium, fix): Cut 3's adoption rule now
depends on one test. M3.1 and M4.9 are the same text
(
elaboration.rs:425), and over the full suite onlya_boundary_row_ready_to_submit_is_submitted_after_a_tickfails. The sweep passes the listed row's own session tostep_session, sosame_answeris trivially true on every adopted path, and Cut 3's two former killers no longer reach the rule. - c4.s1.f2 (introduced, medium, fix): player speak turns drawing from
elaboration_permits(runtime.rs:1092, MC3) survive all Dungeon tests. Pool independence is unproven for the speak lane. - c4.s1.f3 (pre-existing gap, moved by this cut, low-medium, fix):
deleting the
phase != Activereturn insweep(elaboration.rs:645, MS5) survives all 458 tests. A Draft or Archived world would list, draw, infer and be refused every 300 seconds. - c4.s1.f4 (pre-existing in effect, medium, fix, Authority
self-under-standing-go): a panic inside one session task
resume-unwinds out of
sweep(elaboration.rs:695) and aborts the sibling mid-inference, leaving its rowElaboratorInFlight. It ends the driver task spawned atruntime.rs:410, whose handle is dropped, so elaboration stops silently until restart. No permit leaks, and the next healthy sweep would adopt both rows. Fix: a task panic becomes an error returned after started siblings finish, and the driver keeps running and logs it. Whether that error quarantines stays with L1.f1; existing log-only handling is kept. - c4.s1.f5 (introduced, low, recorded): swapping the quarantine stop flag and the permit release (MS3) is unobservable on the current-thread test runtime; P4.5's ordering holds by code order only.
- c4.s1.f6 (introduced, low, recorded): adopting the newest orphan or listing newest-first (MS1, MS4) survives; the spec calls multiple rows per answer unreachable from this code.
- c4.s1.f7 (pre-existing, moved, low-medium, fix): the
Uncoveredjurisdiction is never exercised through the sweep; dropping its push (MS2,elaboration.rs:733) survives. - c4.s1.f8 (pre-existing, recorded as L1.f14): stored rows are never retired.
- Cut 3's pins after the rerouting: S3 is killed only by
a_fresh_session_draws_its_lens_from_its_own_command_id; S5 only bya_resumed_session_keeps_its_stored_text_when_the_lens_text_changes. - Counts: library 459 (458 + 1 ignored), doc 10, external_admission 12, Dungeon 54 (53 + 1 ignored), build_provenance 1, persona-projection 13. Forced-rebuild warnings identical to Cut 3.
- c4.s1.f1 (introduced, medium, fix): Cut 3's adoption rule now
depends on one test. M3.1 and M4.9 are the same text
(
-
Panic handling ruled: a session-task panic becomes an error returned after already-started siblings finish, no new session starts after it, and the runtime driver keeps running and logs it. Whether it quarantines stays with L1.f1. Authority: operator (agreed to c4.s1.f4's stated fix). Ruled: 2026-09-16.
-
Fix batch landed:
6f35229(c4.s1.f1),c90b5a0(c4.s1.f3),a3d109b(c4.s1.f7),4b50130(c4.s1.f2),0764842(c4.s1.f4).- c4.s1.f1:
a_finished_boundary_session_stays_finished_after_the_world_movesjoins the ReadyToSubmit test in killing M3.1. Reachability, traced by Hands and attacked by Soul: through the sweep, the adoption rule changes behaviour only forReadyToSubmitboundary rows found by id. Listed rows receive their own session. A changed answer moves the id, because the id hashes the scope digest. Deficit ids carry ancestry. Otherwise only a digest collision reaches it. - c4.s1.f3:
a_draft_world_is_not_sweptchecks no listing read, no inference, no row, a whole pool, and an unchanged revision.WorldPhasehas no Archived case. MS5 is killed. - c4.s1.f7:
the_sweep_claims_work_no_root_coverssweeps aMissingStructureboundary on an unpositioned debtor underUncovered. MS2 is killed. - c4.s1.f2:
a_speak_turn_and_a_sweep_draw_only_from_their_own_poolsdrives a speak turn through the production HTTP router and a sweep, reads both pools inside the provider boundary, and exhausts each pool in turn. MC3 and M4.4 are killed; 30/30. - c4.s1.f4: a
SessionPermitguard's Drop sets the per-sweep stop flag before releasing the permit, unless the session returned normally without a quarantine-class error. A task that did not return becomesControllerError::Serialization("an elaboration session did not return: …"), quarantine-class and returned after every started sibling finishes.elaborate_worldtakes its interval. Tests:a_panicking_session_lets_its_sibling_finish,no_session_starts_after_a_panic,the_elaboration_driver_survives_a_panicking_sweep. R1 (restoreresume_unwind), R2 and RQ are killed; 30/30. - Counts: library 464 (463 + 1 ignored), Dungeon 56 (55 + 1 ignored), doc
10, external_admission 12, build_provenance 1, persona-projection 13.
Distinct warnings identical to
21edeca.
- c4.s1.f1:
-
Soul findings, pass 2 (promises 1–6 of the batch held; the guard releases its permit exactly once on normal return, retryable error, quarantine, panic, and cancellation of the whole sweep; a panicked session is adopted next sweep without duplicating its refusal; R1 fails the driver test by the driver ending, not a timeout):
- c4.s2.f1 (pre-existing gap, low-medium, fix): the guard's
"a retryable error does not raise stop" leg is unpinned. Mutation
held.stop = outcome.is_err()(elaboration.rs:677) survives, because the retryable test uses a pool of 2. A pool-of-1 probe with a retryable first call kills it. A regression would end every sweep at the first connector-capacity fault. - c4.s2.f2 (pre-existing gap, low-medium, fix):
Uncoveredis pinned only when no deficit row exists. Pushing it only in that case (elaboration.rs:759) survives. A world with a root in deficit and an unrooted debtor would never sweep the debtor'sMissingStructure. - c4.s2.f3 (pre-existing, low, fix by deletion):
same_answer'sanswer_digestcomparison (elaboration.rs:86) never decides, because the id already binds the digest. Equivalent under two Soul passes (c3.s1.f6, this pass). - c4.s2.f4 (introduced by design, low, L1.f1): a panic inside
persistpoisons the journal lock (controllers.rs:1694maps poison toWorkPersistence). Every later sweep then errors, and the driver logs it only atdebug(runtime.rs:1856), so an operator would not see a wedged elaboration lane. Evidence for the L1.f1 ruling, not a fix here.
- c4.s2.f1 (pre-existing gap, low-medium, fix): the guard's
"a retryable error does not raise stop" leg is unpinned. Mutation
-
Second fix batch landed:
635123f(c4.s2.f2),2b4b833(c4.s2.f1),872ba35(c4.s2.f3, the deletion in its own commit).- c4.s2.f1:
a_retryable_fault_does_not_stop_the_sweepkillsheld.stop = outcome.is_err(). It uses a pool of 1, so the second session exists only after the first faults; 30/30. - c4.s2.f2:
the_sweep_claims_uncovered_work_beside_a_root_in_deficitkills the mutation that pushesUncoveredonly when there is no deficit. - c4.s2.f3:
&& self.answer_digest == other.answer_digestremoved fromsame_answer. Counts unchanged;session_command_idstill hashes the digest, and two tests fail if it stops.
- c4.s2.f1:
-
Soul's final pass (against
b15ade4; all three code items sound):- The retryable-fault test cannot pass through overlap: the only permit is
held through
step_session. - The deletion is safe:
same_answer's single caller compares a session whose id already binds the digest. One behaviour change: a forged row under a derived id with a different digest is now adopted instead of Superseded. Row integrity never bound id to digest, and the foreign-row test already accepts adoption of copied rows. - The Uncovered gap remaining is L1.f15.
- Doc findings: the ontology loop claimed seed requests and Vault evidence
for the Active sweep, the handoff said "title weights", and
map.yamldid not name L2. All three fixed at close-out. - Soul's forced rebuild left an empty untracked
crates/ghostlight-dungeon/src/lib.rs. It was verified empty and untracked, then removed.
- The retryable-fault test cannot pass through overlap: the only permit is
held through
L1-Q10 Whether the in-flight listing excludes rows ready to submit
- Asked: 2026-09-16, from Hands' departure on Cut 4, measured by Soul.
- Context: see "Departure measured" above.
- Options: A, exclude
ReadyToSubmitrows: no stall, and a crash between persist and submit followed by a commit costs one repeated round and one orphan row. B, include them: every committed deficit stalls permanently. C, include them and retire a row when resubmission answersAlreadyApplied: closes the crash window, but needs a row-retirement path that does not exist yet (L1.f14). - Recommendation: A now, with the crash window and C recorded under L1.f14, which owns row retirement.
- Depends on it: nothing else in L1.
- Ruling: A. The listing excludes
ReadyToSubmitrows. The crash window and option C are recorded under L1.f14. Authority: operator. Ruled: 2026-09-16.
Cut 5. Reconcile the target and the maps
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfrom Cut 4's commit. Text only; one commit; may be folded into Cut 4's landing commit by the root agent. - First: Cuts 1–4 pushed; Soul verdicts recorded here.
- Deletes first:
docs/architecture/ghostlight-stock-lenses.md:92-105("Questions for Imagination to bring back") — the rulings live here. - Keeps and moves: none.
- Adds:
ghostlight-stock-lenses.md:3-8status paragraph rewritten to the derived rule ("open until the cut map's cuts are closed"); its "Known constraints" section rewritten as the live design (identity unchanged, lens and text on the session,v16,consumer.v5,world_create.v4,sweep(ceiling), two pools, the adoption rule); the target's invariant 3 gains "the lens is recorded on the session and is not part of its identity", invariant 4 namesSetLensWeightsas the second writer, invariant 5 names the two pools, and invariant 6 gains "the world moving does not supersede a session; only its answer moving does". The target's "Out of scope" keeps D1–D3 but notesworld_create.v4landed here by ruling L1-Q6.notes/ghostlight-implementation-plan.md:878: L1 marked landed with the commit range [Hands].notes/fresh-workspace-handoff.md,notes/ghostlight-current-system-map.md,state/map.yaml[steward]. - Verification:
rg -n 'Shipped: the sweep runs one sequential' docs notes= 0;rg -n 'consumer\.v4|controller_work\.v15|world_create\.v3' docs notes state/map.yamlmatches only the L0 history documents,notes/local-live-smoke.md, and evidence. - Promises: P5.1 No document describes the sequential unlensed sweep
as the live system. P5.2 Every schema string in the live docs matches
lib.rs:172-173,controllers.rs:77-78andeve.rs:614. - Landed:
39b2af4(ontology),04fd004(plan, handoff,map.yaml),b15ade4(MVP doc), and close-out fixes by the root agent. The source anchors in P5.2 have moved tolib.rs:174-175,controllers.rs:78-79andeve.rs:627. - Verdicts: Soul's final pass against
b15ade4, plus the close-out fixes.
| Promise | Verdict | Evidence | Mutations |
|---|---|---|---|
| P5.1 | HOLDS after close-out | No live doc describes the sequential sweep; the target doc was rewritten at close-out. Soul found the ontology loop claiming seed requests and Vault evidence for the Active sweep; fixed | none; doc claims checked against source |
| P5.2 | HOLDS | consumer.v5, controller_work.v16 and world_create.v4 in the live docs match source. The remaining older names are marked history (L0 docs, plan steps 13 and 14, smoke runs, map step 13) |
none |
Subtraction ledger
| Cut | Removed (estimate) | Added (estimate) | Deps / formats / targets | Actual |
|---|---|---|---|---|
| 0 | — | — | scratch captures only | scratch captures only, no repo change |
| 1 | 0 | lens.rs ~150 + tests ~130; lib.rs 2 lines + test helper ~6 |
0 deps; 0 targets | lens.rs +372 (217 code, 155 tests; the tool tables are one name per line under rustfmt); lib.rs +7; elaboration.rs 1 line changed; 0 deps; 0 targets |
| 2 | ~6 (doc lines replaced, the v2 denial case) | library: state field, command, effect, two reducer arms, resolve param, mismatch variant, snapshot field, replay check ~90; 19 literal sites × 1 line; tests ~220; Dungeon: payload field, policy fn, Eve control and binding, three schema strings, harness ~40; tests ~60; docs ~8 | 0 deps; consumer.v4 → v5; world_create.v3 → v4 |
12 files, +825 / −40: production ~130 across lib.rs, patch.rs, journal.rs, mailbox.rs, action.rs, runtime.rs, eve.rs plus 20 construction sites; tests ~650 (refusal matrix, direct apply_effect half, forged rows, state rows, replay). 0 deps; the two schema bumps as estimated |
| 3 | ~4 (the constant as integrity reference, the whole-session supersession equality) | session fields, draw and text in select_answer, adoption rule, request param ~60; tests ~200; docs ~3 |
controller_work.v15 → v16 |
6 files, +1071 / −113: production about +100 / −60 (elaboration.rs session fields, same_answer, adoption, draw in select_answer, request parameter, id signature, the constant deleted; lens.rs the constant moved in, the divisor guard, weighs_the_same_as, markers removed; lib.rs one call; controllers.rs two constants); tests about +890 (real-store tests, fixture generalization, two added tests); docs 1 line. controller_work.v15 → v16 as estimated |
| 4 | ~35 (sequential sweep, Inactive, doc lines) |
sweep + demand_entries with rediscovery ~110; trait method + three store impls ~45; second pool and its config ~25; tests ~360; docs ~14 |
public sweep signature gains a Semaphore; ControllerWorkStore gains one required method; one new env variable |
elaboration.rs production +220 / −82 (including the test-only step_in); controllers.rs production +56 / −2; runtime.rs production +41 / −18; tests about +1,430 / −194 (fixtures, gated ports, three real-store non-adoption cases); docs about +21. 0 deps; one env variable; one required trait method; one new public re-export (ElaboratorSession); sweep signature change |
| 5 | ~14 | ~25 | 0 | Code (second Cut 4 fix batch): +107 / −12, two tests and one deleted comparison. Docs: +70 / −39 across the ontology, plan, handoff, map.yaml and MVP doc. 0 deps |
Net for L1: about +1,300 lines, of which about two thirds are tests, no new dependency, no new crate, no new binary, four schema strings replaced, one environment variable added, one required method on the store trait. The growth buys the capabilities the target names (lenses, world-owned weights and their owner command, a replayable draw recorded on the session, concurrent sessions under a ceiling that cannot starve simulation, an explicit weights payload) and retires one liability: a sweep whose only protection against a second session on one answer was that nobody wrote one.
Actual for L1, reconciled 2026-09-16 against 817c9f4: 12 crate files,
+4,907 / −266 (controllers.rs +2,807, mostly tests; runtime.rs +571;
elaboration.rs +467; lib.rs +414; lens.rs +379 new; journal.rs +223;
external_admission.rs +237). Docs, notes and map +1,957 / −46, most of it
this cut map. The estimate was about +1,300; the overrun is overwhelmingly
test code, the same shape as L0. The tests bought real catches: a flaky
illegal-transition pin (3 of 40 runs), the untested Q7 resume rule, the
untested retryable-no-stop guard leg, a no-op revision under two spellings,
and a forged row caught by the wrong check. Four schema strings replaced as
estimated, one environment variable, one required trait method, one new
production type (SessionPermit), no dependency, crate or binary. Liabilities
retired beyond the estimate: the elaborator repair loop that never worked
across sweeps (L1.f10), and a background driver that a single task panic
killed silently.
Findings not assigned to a cut
-
L1.f11 (pre-existing, medium, operator): the browser create form is not wired end to end for any binding.
eve-browser-loweringcaptures textarea drafts as strings underpayload.bindings(index.ts:2034,2059-2076). Nothing in the repo liftsbindingsto top-level fields or parsesjson-typed values, andexecute_worlddeserializesinvocation.payloadstraight intoCreatePayload(crates/ghostlight-dungeon/src/runtime.rs:1446). Only tests and the smoke harness exerciseworld.create, and Cut 2's eighth binding inherits the same gap. It bears directly on the playtest gate (Dungeon pass D2).- Ruling: fix in Dungeon pass D2, which rebuilds the create path anyway. Authority: operator. Ruled: 2026-09-16.
-
L1.f12 (pre-existing shape widened by Cut 2, design, operator): Draft approvals are bound to nothing.
draft_approvals(lib.rs:806) is only inserted (lib.rs:4827) and read (lib.rs:1594,4837), never cleared. Soul's probe: a member approves, the owner commitsSetLensWeights, then a DraftAdmitPatch, and activation still succeeds on the original approval. An approval therefore covers any flavor or structure change made after it. No spec decided this.- Correction: lens weights are not part of this problem. They shape
what elaboration adds later, not the world an approver sees, and the
owner may change them in any phase (L1-Q3). The substance is structure:
a Draft
AdmitPatchafter an approval. - Ruling: deferred until multi-player membership is rebuilt. Today approvals are effectively the owner approving their own world. If approvals are bound then, bind them to the world's structure, excluding lens weights. Authority: operator. Ruled: 2026-09-16.
- Correction: lens weights are not part of this problem. They shape
what elaboration adds later, not the world an approver sees, and the
owner may change them in any phase (L1-Q3). The substance is structure:
a Draft
-
L1.f13 (pre-existing, low-medium, operator): the seed lane has the deficit-shaped rediscovery defect.
seed_command_id(elaboration.rs:1381-1386) hashes ancestry, so an owner Draft commit after a refused seed round moves the key. The next seed session misses the row, repeats the inference without the refusal it earned, and orphans the old row (Soul's probe: rows = 2, no refusal carried). The whole-session comparison at:1650can only be reached for same-ancestry rows and is effectively inert. L1-Q9 (A) fixes the elaborator lane only; the seed lane is outside L1. -
L1.f15 (pre-existing behaviour, low, recorded):
Uncoveredwork is pinned only for worlds with at most one named root. The mutationif jurisdictions.len() < 2survives the whole suite: a world whose deficit names two roots and notUncoveredwould never sweep uncovered boundaries. The behaviour is correct today; the case is untested. -
L1.f16 (capability, operator): the ontology once said consumers "may use or replace" the stock lenses.
Lensis a closed enum of eight, so consumers choose weights only. Cut 5 made the doc match the code. Whether a consumer-supplied lens set is still wanted is the operator's decision; recommendation is to defer until a consumer needs one, likely Delvehold. -
L1.f14 (pre-existing, medium, operator): stored controller-work rows are never retired. Soul's probe B: every committed elaborator session leaves a permanent
ReadyToSubmitrow. Probe A: a session refused on its last budgeted round fails with a quarantine-classSerialization("elaboration evidence exceeded its round budget")instead of endingNoPatch, leaving its rowReadyToSubmit. With a commit between sweeps, a fresh row opens, so a model that never succeeds abandons one row per six refused rounds, without bound. Without a commit, the same id is resubmitted every sweep with no inference. Row count is bounded only by the world's lifetime. L1-Q10's crash window and its option C (retire a row onAlreadyApplied) belong here. -
L1.f1 (pre-existing, medium, operator-triaged, not blocking L1): a sweep error whose
requires_quarantine()is true reachesruntime.rs:1837-1838and is logged atdebug;controller_quarantinedis never set by the elaboration lane, unlike a speak turn (:1102-1105) or a cover cell. Cut 4 changes the call's argument and keeps the call shape; it does not touch this path, so the operator's triage stands: whether elaboration faults quarantine cognition is a Dungeon behaviour change with its own reason, outside L1. -
L1.f2 (introduced by Cut 3, low, recorded): integrity cannot check that the persisted text is the text current code would author for the session's lens (Q7 (a) gives that up by design); a hand-forged row with
lens: Numenand Patina's text passes integrity as long as its invocation agrees with its text. Acontainscheck would be a text tripwire with the limits L0 recorded; not added. (The earlier note that the lens sits inside the command id is history; it does not.) -
L1.f3 (pre-existing, low, recorded): probe 1 showed two invocations under one command id carry one
provider_request_id, so the connector's replay record for the first attempt would answer the second. Cut 3 and Cut 4 make it unreachable throughsweep; the request-id recipe itself is unchanged. -
L1.f4 (pre-existing, cosmetic, recorded): the substrate map's Dungeon count (50 + 1) is the Windows count; on Linux the bin carries four more tests (
cfg(target_os = "linux")), so the recipe'stest-dungeonstep runs 54 + 1 at base. Any "Dungeon count unchanged" claim must say which host. -
L1.f5 (pre-existing, low, recorded):
deployment/idunn/recipe.tomlstate slots still declareworld_state.foundation.v0andcontroller_work.v3(L0's F6); Cut 2 and Cut 3 make the drift one version wider and change nothing about it. Deployment gate owns it. -
L1.f6 (introduced by Cut 2, low, recorded):
SetLensWeightshas no Dungeon route or Eve control in L1; its live consumers are the library and the external-admission tests. The route is D2's, withworld.set_lens_weights→ghostlight.world_set_lens_weights.v0ineve.rs:609-623and aruntime.rs:1530arm when the slider exists. -
L1.f7 (pre-existing, low, recorded): the Linux release remains unproven by anything here; the recipe's
test-world-libraryandtest-dungeonsteps are the proof and run only through Idunn. -
L1.f8 (introduced by Cut 4's design, medium, recorded): the split pools remove process-local starvation only. Both lanes reach the connector under one caller id and one quota (
runtime.rs:1863-1865), so under connector capacity pressure the connector, not Dungeon, decides who is refused; elaboration's refusal is retried next sweep and simulation's is the retryable fault it is today. Making simulation win at the connector needs connector-side priority or two caller ids, either of which is outside L1. -
L1.f10 (pre-existing, high, fix — resolved by L1-Q9 A: the deficit half in Cut 4's listing, the boundary half in Cut 3's adoption rule): an in-flight elaboration session is rediscovered only by re-deriving its command id and looking that id up; there is no listing query. Probe 3: after any unrelated commit, a deficit session's key moves (ancestry is in its digest,
elaboration.rs:669), the next sweep starts a fresh session, repeats the inference without the refusal it earned, and leaves the old row as an orphan; a boundary session's key survives but its row is reportedSupersededforever becauseancestryis in the session equality (:404-405). On the road the clock commits every tick, so noRejectedsession of either kind has been repaired on a later sweep. Cut 3 fixes the boundary half (adoption by identity); Cut 4 fixes the deficit half (rediscovery by answer throughelaboration_in_flight) and stops new orphans. Orphan rows already on disk from before L1 are not cleaned by either cut. -
L1.f9 (pre-existing, low, recorded): under Q7 (a) only the elaboration lane binds integrity to stored text.
SEED_INSTRUCTIONS(elaboration.rs:1299),PERSONA_PROVIDER_INSTRUCTIONSand the operational and interpreter constants still feedintegrity_is_validfrom code, so an edit to any of them still refuses a store holding that lane's in-flight row until the row version is bumped (probe Q7, base behaviour). Whether those lanes should follow (a) is a question for the pass that next edits them.