The Imagination pass maps plan step 15 L0 against d83534c:
- Cut 0: base captures (469 bin tests, and a world.cc written at base).
- Cut 1: a single Ghostlight commit that moves world/ into a library
crate with the exact public boundary (compile_fail doc tests prove the
sealed items) and a test-support feature for cross-boundary fixtures.
- Cut 2: the gamecult-ops cargo invocations.
The map was probed with scratch cargo checks on the Windows workstation,
so it proves Windows only. Six operator questions are open. No code has
moved.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
34 KiB
Ghostlight library extraction — cut map (plan step 15, L0)
Status: cut map. Ends are owned by ghostlight-library-extraction.md; this
document owns the means. Written 2026-09-15 against d83534c on
codex/ghostlight-dungeon-mvp. Nothing landed.
Rulings (operator, 2026-09-15, carried from the target):
- Dungeon is a consumer of the library; no Dungeon concept, type, route, or dependency enters it.
- Kernel first; lenses, detail rules, evidence binding and Draft sessions are L1+.
- L0 moves code and changes no behavior, schema string, digest preimage, or store layout.
- Delete before adding; no re-export facade preserving old paths unless the map names the external contract it protects.
Open: Q1-1 through Q1-6 below. Q2-1 (gamecult-ops) waits on Q1-6. Follow-ups outside this migration: see "Findings not assigned to a cut".
What the probes established (scratch worktree at d83534c, removed)
Every mechanism claim below comes from one of these runs. Logs are in the
session scratchpad (probe1*-check.log, probe3*-visibility.log,
base-test-list.log); they are not repo artifacts.
- Base test census (
cargo test -p ghostlight-dungeon --bin ghostlight-dungeon -- --list, repo target dir): 469 unit tests in the bin, of which 420 are underworld::(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) and 49 are Dungeon's own (app_session 7, eve 5, heimdall 5, idunn_health 4, mesh 4, runtime 24).tests/build_provenance.rshas 1.ghostlight-persona- projectionhas 13 unit, 0 doc. Two tests are#[ignore]:world::controllers::tests::real_codex_connector_cognition_modes_commit_speechandruntime::tests::live_smoke_seeds_then_ticks_a_world_against_the_connector. - Base warning:
mod.rs:28re-exports nine names nobody in the crate uses (ControllerOpenError,NarrativeCapture,NarrativeDecision,NarrativePending,OperationalCapture,OperationalDecision,OperationalPending,SourceRange,TranslationGapSummary). - The move compiles. Moving
src/world/*to a new lib crate (mod.rs→lib.rs), rewritingcrate::world::→crate::inside it andcrate::world::→<lib>::in Dungeon, and movingVerifiedPrincipalEvidenceinto the library root:cargo checkon the library, the library's tests, the Dungeon bin, and the Dungeon tests all pass (probe 1d). Two mechanical faults were needed: the 94pub(super)sites in the formermod.rsare illegal at a crate root (becomepub(crate)), andconsumer.rs:62needsserde_bytesin the library manifest. - What Dungeon needs public (probe 3, four compiler rounds starting from
every item
pub(crate)): 54 production items, 22 test-only items, 38 fields on 10 structs, 36 methods, the 3 opaque IDsAffordanceId/CommandId/SubjectId, and theFictionalMinutes(u64)tuple constructor (one Dungeon test). Listed under Cut 1 "Adds". Nothing in the list is sealed:WorldKernel,WorldState,reduce,apply_effect,CommandEnvelope,AuthenticatedCaller, the journal,*::issue()andScopeDigest::fixturenever appear. Under the narrowed librarycargo check -p <lib>emits 646 dead-code warnings: a second, independent enumeration of the same boundary (an item used only by Dungeon is dead inside the library until it ispub). - Cross-boundary test fixtures: Dungeon's
runtime.rstests need exactly the#[cfg(test)]re-export block atmod.rs:66-72plusfixture_controller_opportunities(mod.rs:490),TracingInferencePort(controllers.rs:278),InferenceFault::fixture_integrity_violation/fixture_recovery_required(controllers.rs:225,234), and the IDissue()impls those fixtures call (mod.rs:200-226,ScopeDigest::fixturemod.rs:448). Gating all of them behind#[cfg(any(test, feature = "test-support"))]with the feature enabled only from Dungeon's[dev-dependencies]compiles (probe 1d). No Dungeon test reaches a sealed constructor: the only::fixture(calls outsideworld/are Heimdall's (runtime.rs:2552,2611,4126,app_session.rs:560) andVerifiedPrincipalEvidence::fixture(runtime.rs:4313). - Compile-fail proof: eight
compile_faildoc-tests on the library root (use <lib>::WorldKernel,reduce,WorldState,CommandEnvelope,AuthenticatedCaller,journal::WorldJournal,SubjectId::issue(),fixture_controller_opportunitieswithout the feature) all pass undercargo test -p <lib> --doc(probe 4). Doc-tests compile as an external crate, which is exactly the boundary; notrybuild, no scratch crate. - Negative-grep collisions checked in
src/world/:axum,tower_http,jwt/jsonwebtoken,heimdall,eve::,idunn_health,Session Zerohave zero legitimate hits.Dungeoncollides with the vault fixture pathSpoilers/Dungeons/Provenance.md(vault.rs:489,581): use\bDungeon\b.playercollides withtests::player()(consumer.rs:966): do not publish it.app_sessionhas 5 hits, all the principal seam, and must reach 0. - Line endings: index and working tree are LF (
git ls-files --eol);core.autocrlf=truerewrote a fresh worktree checkout to CRLF. Hands edits inF:\Projects\Ghostlightitself, not a new worktree, or verifies--eolafter the move.sdk_inference.rs:1831normalizes\r\n. - Build host: every probe ran on the Windows workstation with
cargo check/cargo test --doc; it proves the crate graph and visibility on Windows only. The Linux proof is Idunn's recipe run on Yggdrasil.
Cut 0. Captures
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpatd83534c. No commit; output lives in the session scratchpad. - First:
- Test census:
cargo test -p ghostlight-dungeon --bin ghostlight-dungeon -- --list > base-tests.txt(PowerShell>writes UTF-8 BOM + CRLF; compare post-cut with the same redirection andCompare-Objecton trimmed lines after stripping theworld::prefix). Expected 469. - A
world.ccwritten at base. There is no existing store on disk (F:\Projects\Ghostlight-smoke\ghostlightholds noworld.cc), so produce one: in a scratch copy atd83534c, add an ignored test besidemailbox.rs:966 fixture()that opensWorldMailbox::open(<capture>/world.cc), creates throughcreate_fixture, approves, activates, and ticks three times throughsubmit_clock; recordsnapshot().revision, thestate_digest, and the lastcommit_digestfromoperator_logtocapture.txt. Copyworld.ccandcapture.txtto the scratchpad. After Cut 1 the same test body, in the library'smailboxtests, reopens that file and asserts the three values are equal. Thecontroller-work.cclayout is pinned by the untouchedCONTROLLER_WORK_SCHEMA/CONTROLLER_WORK_ROWconstants (controllers.rs:75-76) and the existing v7/v8 refusal tests (controllers.rs:6487,10654); no separate capture. Get-ChildItem target -Recurse | Measure-Object Length -Sum: 7.5 GiB at the start of this pass.
- Test census:
Cut 1. Extract the library crate
- Repo/branch: Ghostlight
codex/ghostlight-dungeon-mvpfromd83534c. One commit; the crate graph does not build half-moved. Depends on Cut 0 and rulings Q1-1..Q1-5. - First: Cut 0 captures in hand;
git statusclean. - Deletes first:
crates/ghostlight-dungeon/src/world/mod.rs:28-32— the nine unused re-exported names above (leaveCellRun,ConnectorBinding,ControllerError,ControllerModels,ControllerPendingReason,ControllerRunner,ControllerWorkCustody,NarrativeRun,OperationalRun,SubmissionDisposition,open_controller_work,open_inference).crates/ghostlight-dungeon/src/world/mod.rs:61-72— the#[cfg(test)]re-export block (12 lines); it returns as the gatedpub useunder Adds.crates/ghostlight-dungeon/src/app_session.rs:54-91— theVerifiedPrincipalEvidencestruct, accessors, andfixture(38 lines).crates/ghostlight-dungeon/src/main.rs:7—mod world;.crates/ghostlight-dungeon/Cargo.toml:27— the directghostlight-persona-projectiondependency (Dungeon no longer names the crate;controllers.rs:35is the only importer and it moves).
- Keeps and moves:
git mv crates/ghostlight-dungeon/src/world/{action,clock,consumer, controllers,cover,elaboration,journal,mailbox,patch,sdk_inference, tool_schema,vault}.rs crates/<lib>/src/andgit mv .../world/mod.rs crates/<lib>/src/lib.rs. Verify withgit diff --cached -M --statthat all 13 show as renames.- Inside the moved files:
crate::world::→crate::(199 sites;super::super::paths need no change, tests are one module below the root as before);pub(super)→pub(crate)inlib.rsonly (94 sites; the submodules keep theirs);crate::app_session::VerifiedPrincipalEvidence→crate::VerifiedPrincipalEvidence(mailbox.rs:10,controllers.rs:10714,10790,10988,11473). build.rs,tests/build_provenance.rs,runtime.rs:375(web/dist) stay in Dungeon; theirCARGO_MANIFEST_DIR/../..still resolves.sdk_inference.rs:1900,1983move with the file and still resolve fromcrates/<lib>(same depth).
- Adds:
Cargo.toml(workspace): membercrates/<lib>.crates/<lib>/Cargo.toml: package<lib>;[features] test-support = []; dependenciesasync-trait,chrono,codex-connector,cultcache-rs,ghostlight-persona-projection = { path = "../ghostlight-persona-projection" },rmp-serde,serde,serde_bytes = "0.11",serde_json,sha2,thiserror,tokio,tracing,uuid,zeroize(all.workspace = trueexceptserde_bytes, which the workspace does not declare); devtempfile = "3". Every one is already inCargo.lock; no new package.crates/ghostlight-dungeon/Cargo.toml:<lib> = { path = "../<lib>" }in dependencies;<lib> = { path = "../<lib>", features = ["test-support"] }in dev-dependencies.Cargo.lock: the new[[package]] name = "<lib>"entry. Commit it; Idunn builds--locked.crates/<lib>/src/lib.rs, root:pub struct VerifiedPrincipalEvidence { account_subject_hash: String, valid_until: DateTime<Utc> }withpub fn new,pub fn account_subject_hash,pub fn valid_until, and#[cfg(test)] fn fixturedelegating tonew(per Q1-3 A). Doc comment: the consumer verifies; the library bounds byvalid_untilatmailbox.rs:231.crates/<lib>/src/lib.rs, the public boundary. Productionpub use:clock::{FictionalMinutes, TickMinutes};consumer::{CONSUMER_BODY_LIMIT, CONSUMER_CREDENTIALS_ENVIRONMENT, CONSUMER_PATCH_SCHEMA, CONSUMER_RECEIPT_SCHEMA, ConsumerRegistry, admit_document, encode_receipt};controllers::{CellRun, ConnectorBinding, ControllerError, ControllerModels, ControllerPendingReason, ControllerRunner, ControllerWorkCustody, NarrativeRun, OperationalRun, SubmissionDisposition, open_controller_work, open_inference};cover::{AgencyGraph, Cell, Cover, CoverBudget, TickIndex, derive_cover};elaboration::{SeedOutcome, select_row};mailbox::{ConsumerPort, ControllerPort, MailboxError, SeedPort, WorldMailbox};patch::{JurisdictionKey, Statement};sdk_inference::{DEFAULT_SDK_MODEL_PREFIX, SdkBinding};vault::VaultEvidenceSource. Root items madepub:STATE_SCHEMA,state_schema_compatibility_tag,AffordanceId,CommandId,SubjectId(theopaque_uuid!macro atmod.rs:98-106emitspub(crate) struct; make the macro take a visibility or emitpubfor these three only),PrincipalId,WorldPhase,SubjectKind,ControllerMode,CreateWorldIntent,CreateJurisdictionIntent,DecisionOpportunity,DecisionInvocation,PrincipalCommandIntent,CommandBody,WorldSnapshot,OperatorEvent,CommitReceipt,SubmitReceipt,KernelError,ScaleDeficitRow, and the snapshot row types Dungeon reads throughWorldSnapshotfields (SubjectSnapshot,PlaceSnapshot,AffordanceSnapshot, and whichever others the compiler names; probe 3 stopped at theWorldSnapshotfield layer).GroupedRun(controllers.rs) is reached throughControllerRunnerreturn values and needspubwith its five fields.- Gated
#[cfg(any(test, feature = "test-support"))] pub use controllers::{ControllerWork, ControllerWorkLookup, ControllerWorkStore, ControllerWorkStoreError, ControllerWorkWrite, InferenceEvent, InferenceFault, InferenceOutput, InferencePort, InferencePurpose, InferenceRequest, PreparedInference, TracingInferencePort, fixture_inference_events, fixture_inference_output, fixture_prepared_inference}and the same gate onfixture_controller_opportunitiesand on the seven#[cfg(test)]sites it andTracingInferencePortdepend on (mod.rs:200,207,214,221ID issuance impls,mod.rs:448ScopeDigest::fixture,controllers.rs:225,234,277,283,344,377,412,423).InferencePortandControllerWorkStoreare ports; if Q1-4 rules them production API, move those two traits and their request/output types to the ungated list and leave only thefixture_*functions andTracingInferencePortgated. - Fields that become
pub(38, from probe 3):CommitReceipt.{command_id, commit_digest, resulting_revision, resulting_state_digest},Constituent.subject,Cover.{cells, oversubscribed, tick},CoverBudget.{cells, constituent_cap, urgency_slots},DecisionOpportunity.{controller_mode, world_id},GroupedRun.{cell, needs, pending, resolution, submissions},OperatorEvent.{revision, speech},PreparedInference.purpose,ScaleDeficitRow.{deficit, jurisdiction, kind, target},WorldSnapshot.{affordances, draft_approvals, now, opportunities, owner, phase, places, required_approvers, revision, scale_deficit, subjects, title, world_id}, plusFictionalMinutes.0or apub const fn new(u64)forruntime.rs:3579. Fields of the row structs reached throughWorldSnapshotfollow in the next compiler round. - Methods that become
pub(36, from probe 3, by definition site):WorldMailbox::{open, create, submit_principal, submit_clock, agency_graph, operator_log, snapshot}(mailbox.rs:93,105,226,355,448, 461,474),ConsumerPort::new(:552),SeedPort::new(:594),ElaborationPort::new(:660),ControllerPort::{new, snapshot, submit_controller}(:692,696,721),ControllerRunner::{open, elaborator, seeder, custody_probe, run_narrative, run_operational, run_cell}(controllers.rs:2691,2712,2728,2744,2748,2838,3057), the receipt/pending accessors atcontrollers.rs:2397,2413,2421,2453, 2457,2461,2465,2469,2515,2519,2523,2543,2591,2595(persona_turn,re_lowering,into_parts,subject,bound_scope_digest,fresh_scope_digest,gap,mode,reason,persona_prose),TracingInferencePort::new(:285, gated),sweep(elaboration.rs:607,1746),name(elaboration.rs:1511),Cover::{singletons, groups, validated}(cover.rs:163,170,198),ConsumerRegistry::{empty, from_secret_file}(consumer.rs:168,176),TickMinutes::{new, minutes}(clock.rs:45,51),CommandId::new(mod.rs:122),PrincipalId::new(mod.rs:239),Statement::new(patch.rs:281). crates/<lib>/src/lib.rscrate docs: the eightcompile_faildoc-tests from probe 4, each pinned to its error code (E0603for the six private paths,E0599forSubjectId::issue(), unpinned for the feature-gated fixture whose code differs by feature).crates/ghostlight-dungeon/src/runtime.rs(tests): a ~25-line copy ofsoul_no_credential_name_appears_in_the_ports_own_sourcescanningruntime.rsonly, because the library test cannot read another crate's source (see per-filesdk_inference.rs:1824-1828).crates/ghostlight-dungeon/src/app_session.rs(tests): one test assertingVerifiedPrincipalEvidence::new(occurs exactly once in the crate's production source, ataccount_for_cookie(same shape as thefrom_secret_filecount atsdk_inference.rs:1860). This is the single-minter rule the deleted private fields used to enforce.
- Per-file changes (against
d83534c):Cargo.toml:3-5: add member.crates/ghostlight-dungeon/Cargo.toml:27: replace with the library path dep;:43-45: add the dev-dep withtest-support.crates/ghostlight-dungeon/src/main.rs:7: delete.crates/ghostlight-dungeon/src/runtime.rs:3-22: split theuse crate::{}block;world::{…}becomesuse <lib>::{…}(probe edit);:4: importVerifiedPrincipalEvidencefrom<lib>, notapp_session.:518,519,535,1084,1088,1092,1201,1325,1621,2492,2493,2581,2582,3081, 3501,3568,3658,3666,3675,3677,3777,3782,4267:crate::world::→<lib>::.:4313:::fixture(→::new(.:987,1040,1189,1431,1777, 2110: type paths follow the import.:504,2673doc comments nameworld::consumer; reword to the crate.crates/ghostlight-dungeon/src/eve.rs:3-6and:182,335,338,354,386, 405,449,494: same rewrite.crates/ghostlight-dungeon/src/mesh.rs:6-9: same.crates/ghostlight-dungeon/src/idunn_health.rs:8: same.crates/ghostlight-dungeon/src/app_session.rs:54-91: delete;:6: adduse <lib>::VerifiedPrincipalEvidence;;:232-235: struct literal →VerifiedPrincipalEvidence::new(session.account_subject_hash.clone(), session.access_expires_at).crates/<lib>/src/sdk_inference.rs:1824-1828: the scanned file list becomes["sdk_inference.rs", "controllers.rs"](paths are now crate-root relative);:1860sources[1]still indexescontrollers.rs. Theruntime.rshalf moves to Dungeon (Adds).deployment/idunn/recipe.toml:14-17:test-world-ownerbecomes two steps —test-world-library:["cargo","test","--locked","-p","<lib>"](runs the 420 unit tests and the 8 doc-tests) andtest-dungeon: the existing-p ghostlight-dungeon --bin ghostlight-dungeonline.:51-53: acceptance argv becomes-p <lib> --lib controllers::tests::real_codex_connector_cognition_modes_commit_speech(theworld::prefix is gone;--exactstill matches).package.json:9(dungeon:run): unchanged;:7-8use--workspaceand pick the crate up.notes/local-live-smoke.md:64: unchanged; the ignored smoke stays inruntime.rs:3697.- Docs that name the old path (owner in brackets):
README.md:165-166[Hands] add the library line;docs/public-architecture/index.md:46[Hands];docs/architecture/ghostlight-session-zero.md:21-23[Hands] rewrite "Source does not yet match" as the current rule;docs/architecture/ghostlight-world-ontology.md:939-941[Hands] the build-budget sentence now names the library crate;notes/ghostlight-current-system-map.md:18,28,289[Mind steward];notes/fresh-workspace-handoff.md:284-286[steward];state/map.yaml:57,389-390[steward].
- Authority map:
- Owner: the library crate
<lib>owns the world kernel, its ontology, reducer, journal, mailbox, controllers, elaboration, cover, clock, consumer admission, inference ports, and evidence sources. Its public surface is the list under Adds and nothing else. - Inputs:
VerifiedPrincipalEvidencevalues Dungeon constructs fromAppSessionOwner::account_for_cookie;CreateWorldIntent,PrincipalCommandIntent,DecisionInvocation; consumer patch bytes viaadmit_document; store paths viaWorldMailbox::openandopen_controller_work; connector and SDK bindings viaopen_inference. - Outputs: immutable
WorldSnapshot,OperatorEvent,AgencyGraph, typed receipts (SubmitReceipt,CommitReceipt,CreationReceiptthroughMailboxError/KernelError), controller runs, cover partitions, encoded consumer receipts. - Derived state: Dungeon's Eve projection, mesh documents, Idunn health
(which reads
STATE_SCHEMAandstate_schema_compatibility_tagand derives, never restates), HTTP responses. - Forbidden writers: any path in Dungeon naming
WorldKernel,WorldState,reduce,apply_effect,CommandEnvelope,AuthenticatedCaller, the journal, or anissue()— enforced by visibility, proven by the doc-tests. Any second minter ofVerifiedPrincipalEvidence— enforced by the Dungeon count test.test-supportin a production build — checked below. - Shared paths: Dungeon production and Dungeon tests reach the kernel
through the same
pubitems; tests additionally see the gated fixture set. Library-internal tests keeppub(crate)/super::access as today. Consumers other than Dungeon: none yet; Epiphany consumes onlyghostlight-persona-projection, which is unchanged. - Deletion line:
mod world;, the nine unused re-exports, the#[cfg(test)]re-export block, and Dungeon's private principal struct are gone before the firstpubis written.
- Owner: the library crate
- Verification (Windows workstation; proves Windows only):
- builds:
cargo check -p <lib>(no new warnings; the 396–646 dead-code warnings of an under-opened boundary must be 0),cargo check -p ghostlight-dungeon --bin ghostlight-dungeon,cargo check -p ghostlight-dungeon --tests,cargo build --locked -p ghostlight-dungeon --bin ghostlight-dungeon(provesCargo.lock). Expected target-dir delta: one extra lib crate in debug; the scratch probe's check-only target was 2.3 GiB from empty, so expect well under 1 GiB incremental on the repo's 7.5 GiB. - tests:
cargo test -p <lib>= 420 unit + 8 doc (the 420 names equal the baseworld::list with the prefix stripped);cargo test -p ghostlight-dungeon --bin ghostlight-dungeon= 49;cargo test -p ghostlight-dungeon --test build_provenance= 1;cargo test -p ghostlight-persona-projection= 13. Ignored counts unchanged (1 + 1). The reopen test from Cut 0 pins invariant 2 (world.ccwritten at base reopens with equal revision and digests). The doc-tests pin invariant 1. TheVerifiedPrincipalEvidence::newcount pins the single minter. The split credential-name test pins "no credential name in the port's source" on both sides. - negative:
rg -n 'crate::world::' crates= 0;rg -n '^mod world;' crates= 0;rg -n 'app_session|heimdall|eve::|idunn_health|axum|tower_http|jsonwebtoken|\bDungeon\b|Session Zero' crates/<lib>/src= 0 (collisions checked:Dungeonsinvault.rsis excluded by\b; do not addplayer);rg -n 'pub\(super\)' crates/<lib>/src/lib.rs= 0;rg -n 'VerifiedPrincipalEvidence::new\(' crates/ghostlight-dungeon/src= 1 outside#[cfg(test)];cargo check -p ghostlight-dungeon --bin ghostlight-dungeon -v 2>&1 | rg 'feature="test-support"'= 0 (resolver 2 keeps dev-dep features out of the bin build);cargo tree -p ghostlight-dungeon -i axumshows no path through<lib>;cargo tree -p <lib>names noaxum,tower-http,jsonwebtoken,cultnet-rs,cultmesh-rs,reqwest,aes-gcm,hmac,rand,base64,libc.git diff -M --stat d83534c..HEAD -- cratesshows 13 renames. - operator: Idunn recipe run on Yggdrasil (Linux proof): the
test-world-library,test-dungeon,build-daemonsteps and the acceptance step resolve;/srv/…/ghostlight-dungeon --state-rootreopens the liveworld.cc; health reportsconsumer-v4.
- builds:
- Operator questions:
- Q1-1 Library crate name. A:
ghostlight(crates/ghostlight,use ghostlight::WorldMailbox); B:ghostlight-world(the probe name); C:ghostlight-core. Recommended: A. The target, the map, and the operator ruling all say "the Ghostlight library"; the crate should be what the prose calls it. The siblingghostlight-persona-projectionis a membrane published for Epiphany, not the library. The repo, workspace, andpackage.jsonnames do not collide with a Cargo package name. Mechanically A and B are identical (probes used B). - Q1-2
vault.rsandsdk_inference.rs. A: both in the library; B: both in Dungeon behind theEvidenceSource/InferencePorttraits; C: vault in the library, SDK port in Dungeon. Recommended: A.open_inference(controllers.rs:2314) constructs the SDK route itself, so B and C change how the port is built — a structure change L0 forbids. Neither file names a Dungeon concept: the vault takes a root and a scope, the port takes a sidecar entry. Both are named in the target's own library list (evidence sources, inference ports). The sidecar fixture writes (sdk_inference.rs:1900,1983) resolve from the library's manifest dir at the same depth. Revisit when a second consumer needs a different evidence source or transport. - Q1-3 Principal evidence seam. A: library-owned
VerifiedPrincipalEvidencewith a publicnew; Dungeon'saccount_for_cookieis the single production caller, proven by a count test. B: library traitPrincipalEvidence { account_subject_hash, valid_until }; Dungeon keeps its private-field struct and implements it;SeedPort(mailbox.rs:590) storesArc<dyn PrincipalEvidence>and the controllers' seed tests gain a fixture impl. Recommended: A. It is what invariant 3 of the target says ("a library-owned type that Dungeon constructs"), it is four edit sites, and the probe is green. The minter seal was module privacy inside one crate; across a crate boundary the library cannot know who a principal is, so the rule lives with its owner (Dungeon) as a test, not as a trait the library carries for one consumer. - Q1-4 Cross-boundary fixtures. A:
test-supportcargo feature on the library gating the 22 items and the fixture-onlyissue()impls, enabled only by Dungeon's dev-dependency. B: move the runtime tests into the library — not possible, they driverun_cover_tickanddrive_one_tick, which are Dungeon. C: make the fourfixture_*functions ungatedpub— puts fixture-shapedDecisionOpportunityminting in the production API. Recommended: A, with the port traits (InferencePort,ControllerWorkStore) and their request/output types in the ungated production API rather than behind the feature: they are the "runner and port entry points" invariant 1 names,open_inferencealready returnsArc<dyn InferencePort>, and hiding a trait a public function returns is aprivate_interfacessmell. Gate onlyfixture_inference_*,fixture_prepared_inference,fixture_controller_opportunities,InferenceFault::fixture_*,TracingInferencePort, and theissue()/ScopeDigest::fixtureimpls. Invariant 7 admits exactly this feature. - Q1-5
ghostlight-persona-projection. A: stays a separate crate, the library depends on it by path as Dungeon does today. B: fold into the library. Recommended: A. Epiphany pins it by git rev22281891withpackage = "ghostlight-persona-projection", which resolves against that revision regardless of HEAD, so either option keeps the pin today; but folding would make Epiphany's next bump pull the world library (tokio, cultcache, codex-connector) for three prompt builders. Wrong dependency direction; its own recipe test step stays. - Q1-6
gamecult-opsdeploy scripts — see Cut 2.
- Q1-1 Library crate name. A:
Cut 2. Build and deploy references in gamecult-ops
- Repo/branch: gamecult-ops, current default branch; one commit after Cut 1 is pushed. Depends on Q1-1 (the crate name) and Q1-6.
- First:
git -C F:\Projects\gamecult-ops statusclean;bash scripts/test-ghostlight-yggdrasil-wiring.shpasses at base. - Deletes first: per Q1-6 B only:
scripts/deploy-ghostlight-yggdrasil.sh(1300+ lines) andscripts/test-ghostlight-yggdrasil-wiring.sh(:276-278,282,343are the only Ghostlight cargo assertions). - Keeps and moves: none.
- Adds: none.
- Per-file changes:
runbooks/ghostlight-dungeon-yggdrasil.md:249-251: insertcargo test --locked -p <lib>before the Dungeon test line;:257"one explicit Rust binary" stays true.- Per Q1-6 A:
scripts/deploy-ghostlight-yggdrasil.sh:964-970add the library test invocation in the same container run;:1308acceptance becomes-p <lib> --lib controllers::tests::real_codex_connector_cognition_modes_commit_speech;scripts/test-ghostlight-yggdrasil-wiring.sh:276-278addrequire_text "${deploy}" 'cargo test --locked -p <lib>'. idunn/yggdrasil/bindings/ghostlight.toml.in: unchanged; it names the recipe path, and the recipe carries the commands.
- Authority map:
- Owner:
deployment/idunn/recipe.tomlin Ghostlight owns the build and test commands (binding:11 recipe_path). The runbook describes; the scripts either actuate (A) or are retired (B). - Inputs: the admitted ref and the recipe.
- Outputs: the same one binary plus
web/. - Derived state: runbook text, wiring-test assertions.
- Forbidden writers: no second list of cargo commands that can drift from the recipe — under A the wiring test pins the script to the recipe's strings; under B there is no second list.
- Shared paths: n/a.
- Deletion line: under B, both scripts before the runbook edit.
- Owner:
- Verification:
- builds: none (shell and Markdown).
- tests:
bash scripts/test-ghostlight-yggdrasil-wiring.sh(A) passes with the newrequire_text; (B) the script is gone and nothing references it (rg -n 'test-ghostlight-yggdrasil-wiring|deploy-ghostlight-yggdrasil' F:\Projects\gamecult-ops= 0 outsidedocs/repo-census-2026-09, which is an archive). - negative:
rg -n 'ghostlight-dungeon --bin ghostlight-dungeon' F:\Projects\gamecult-ops --glob '!docs/**'lists only lines that also sit beside a-p <lib>line. - operator: the next Idunn deploy of a post-Cut-1 commit runs the
library step; before that, the operator confirms which actuator is live
on Yggdrasil (
systemctl cat ghostlight-dungeon.servicenames the unit's origin; the v2 binding lives under/var/lib/gamecult/idunn-v2).
- Operator questions:
- Q2-1 (= Q1-6) Edit or retire the scripts. A: edit both (five lines);
B: delete both and point the runbook at the recipe; C: leave them.
Recommended: A. The Body is ambiguous: the runbook (
:243-251) still saysrequest-idunn-bounded-redeploy-yggdrasilruns those exact cargo lines, the Idunn v2 binding template points at the recipe instead, and the Ghostlight handoff (notes/fresh-workspace-handoff.md:133) says Yggdrasil still serves legacy releasea4080d4. No Ghostlight doc calls the scripts legacy helpers (rgfinds no mention of either script name in the Ghostlight repo), so that claim is unverified. Retiring a deploy actuator is a deployment-authority decision outside L0; an edited dead script costs five lines, an unedited live script would test only Dungeon's 49 tests and silently skip the 420 kernel tests. C is the one option that leaves the release path able to lie.
- Q2-1 (= Q1-6) Edit or retire the scripts. A: edit both (five lines);
B: delete both and point the runbook at the recipe; C: leave them.
Recommended: A. The Body is ambiguous: the runbook (
Subtraction ledger (estimate)
| Cut | Removed | Added | Deps / formats / targets |
|---|---|---|---|
| 0 | — | — | scratch captures only |
| 1 | mod world; (1), 9 unused re-exports (~3 lines), cfg(test) re-export block (12), Dungeon principal struct (38), Dungeon's direct persona-projection dep (1); ~55 lines |
lib manifest (~30), workspace member (1), Dungeon deps (2), lock entry (~20), principal type in lib (~30), pub use boundary (~20), doc-tests (~25), runtime credential test (~25), minter count test (~15), recipe step (~6); ~175 lines. Visibility edits: 94 pub(super)→pub(crate), ~130 pub(crate)→pub (items, fields, methods), 199 crate::world::→crate::, 32 crate::world::→<lib>:: |
+1 lib crate, +1 feature (test-support), 0 binaries, 0 new packages in Cargo.lock; 13 files renamed (~52k lines) |
| 2 | (B) ~1600 lines of shell | (A) ~5 lines | 0 |
Net for L0: about +120 source lines, one crate, one feature. The line
growth is boundary declaration (what was implicit pub(crate) becomes an
explicit pub list plus its compile-fail proofs); the liability it retires
is the convention "Dungeon does not touch kernel internals", which becomes a
compile error.
Findings not assigned to a cut
deployment/idunn/recipe.toml:142-146,169-171declare the world slot and provided capability asghostlight.world_state.foundation.v0/foundation-v0, and:150-154the controller-work slot asghostlight.controller_work.v3; source isconsumer.v4(mod.rs:84-85, tagconsumer-v4) andcontroller_work.v15(controllers.rs:75-76). Pre-existing drift; L0 changes no schema string, so it stays. The census flagged the v3/v4 half already.tests/build_provenance.rsis never run by the recipe or the scripts:--bin ghostlight-dungeonselects the bin's unit tests only. Acargo test --locked -p ghostlight-dungeon --test build_provenancestep would be a recipe change with its own reason.notes/ghostlight-current-system-map.md:18-19still names the state owner asghostlight.world_state.foundation.v0;:28says "the privateworld::WorldKernel". Both are stale before this cut; the steward owns the rewrite.runtime.rs:2492is aCommitReceiptliteral in Dungeon tests; after the cut it needs the fourpubfields listed, which is whyCommitReceiptis in the boundary at all. If Hands prefers not to expose receipt fields for one test, the alternative is a library fixture behindtest-support; either is behavior-neutral.web/references nothing incrates/;sidecar/claude-sdk/test/*is written by library tests underGHOSTLIGHT_WRITE_SIDECAR_FIXTURESand read otherwise — path depth unchanged, nothing to do.