Ten test-only additions, no production source touched.
- mailbox: the end-to-end proof the kernel-level test does not give — a
controller turn bound at revision N commits through the mailbox after an
unrelated commit at N+1, and a stamped body still fails closed on a
foreign scope.
- world: the scope preimage excludes revision, phase, a place declared
elsewhere, a non-incident route, and another subject's Position, across
real commits; a forged affordance list cannot widen authority.
- patch: RouteSelfLoop, UnplacedSubject, and NoOperationEffect are each
reachable; a forged relocate effect dies at apply time on all three
preconditions; RefKind is not a serializable shape.
- journal: forged store rows carrying a self-loop, an out-of-range cost, a
non-place endpoint, or a stray position are refused by recover, and a
pre-topology row type is refused outright.
- controllers: the typed view carries only the actor's own place and the
routes incident to it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cut: SubjectDeclaration.authority_scope and SubjectState.authority_scope with
their four production readers; DecisionOpportunity.state_digest and every reader
of it, including the kernel's whole-world gate, ControllerRunner::select's
struct-equality filter, PersonaTurnBinding.state_digest, the two runtime.rs
surface-freshness comparisons, and the caller-supplied envelope revision for
opportunity-bearing commands; EdgeKind's Relation, Commitment, and Pressure arms.
Add: a positions partition and Position, EntityRecord.container with containment
acyclicity over the complete candidate graph, Route written into the existing
edges partition with AccessKind, Cost, and an open flag, the four inhabited
ComponentOp variants, and resolve_patch as the one owner of declarations,
references, topology admission, and operation preconditions, closing the complete
mismatch set before the first ID mints. A proposal now binds the digest of the
components its verification reads -- controller assignment, grants, Position, and
incident routes -- so an unchanged scope commits at a later revision and a changed
one is refused with KernelError::ScopeChanged. Schema bumps to topology.v1.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Promote world::STATE_SCHEMA/COMMIT_SCHEMA to pub(crate) and add
state_schema_compatibility_tag(), derived from STATE_SCHEMA, so mesh.rs and
idunn_health.rs stop hand-copying "ghostlight.world_state.foundation.v0" and
"foundation-v0" as second literals that had already drifted from the v1
kernel schema.
- A CreateWorld patch that declares only entities now fails inside
resolve_declarations with Mismatch::NoDecisionSubject instead of surviving
admission and dying in journal::verify_state_shape as a
CorruptJournal(requires_owner_restart) fault. Collapse the two hardcoded
admits_human literals in prepare_creation and WorldState::genesis onto the
same admits_human predicate the AdmitPatch lane uses (reshaped to take
revision/subjects directly, since the genesis lane resolves before any
WorldState exists).
- Mismatch::UnresolvedDraft and the draft-branch WrongKind now name their
DraftHandle field referent; Mismatch::UnknownCanonical and the
canonical-branch WrongKind now name theirs referrer. WrongKind carries both
referrer: DraftHandle and referent: Ref<EntityId> so every construction site
states which end each field names instead of overloading one `handle`
field with two different meanings.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Two falsification tests the pass-1 suite did not carry.
a_rejected_patch_leaves_no_row_and_no_id_in_the_store checks the durable
store, not the in-memory head: after the Run 115 rejection it scans the
.cc bytes for the three IDs the patch would have derived, then reopens
the world and re-asserts the snapshot, commit count, and empty entity
partition.
apply_effect_rejects_a_forged_stale_unauthorized_or_active_patch_effect
drives the PatchAdmitted arm directly. journal::a_forged_patch_effect_
does_not_apply dies earlier, at apply_committed_command's reduce
equality ("committed effect is not the deterministic reduction of its
command"), so nothing exercised admit_resolved's own re-validation. This
does: a jurisdiction naming an absent place, the honest effect replayed,
a non-owner caller, and the Active phase each return Invariant with the
candidate state untouched.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cut: DraftSubjectHandle, validate_handle, NewDecisionSubject,
GenesisSubjectBinding, canonicalize_subjects, issue_genesis,
normalize_label, assignment_matches_new, the 116-line zip-and-compare
body of WorldState::genesis, the non-test SubjectId/ControllerId/
AffordanceId::issue bodies, and the KernelError variants NoSubjects,
EmptySubjectHandle, EmptySubjectLabel, DuplicateSubjectHandle, and
NoAffordances.
Add world/patch.rs: typed EntityId/EdgeId namespaces beside SubjectId,
Ref<Id> with draft handles, WorldPatch declarations, uninhabited
ComponentOp and PatchAnswer, and resolve_declarations as the one owner
of handle indexing, kind checking, reference resolution, and allocation
for both admission lanes. It returns the complete deterministic
Vec<Mismatch> and allocates only after that set is empty, so a rejected
patch mints nothing. IDs derive from sha256 over namespace, world ID,
command ID, and handle, which is what lets journal replay recompute
reduce() and require effect equality.
CommandBody::AdmitPatch and WorldEffect::PatchAdmitted join the reducer;
WorldCreated now carries the same ResolvedPatch payload, and both lanes
mutate through one admit_resolved. WorldState gains entities and edges
partitions, SubjectState gains authority_scope, and the state and commit
schema strings move to foundation.v1 and foundation.v2, which refuses a
pre-pass store rather than migrating it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The daemon declared its own GHOSTLIGHT_RUNTIME_ID, GHOSTLIGHT_DUNGEON_BIND,
and GHOSTLIGHT_DUNGEON_ROOT. Under the managed contract Idunn owns all three:
the runtime id arrives inside the activation bundle, the bind is a candidate
socket Idunn hands down, and the state root is an admitted workload path.
A service that also names them from its own environment is a second opinion
about facts it does not own.
runtime.rs already resolved the runtime id from the admission and kept
GHOSTLIGHT_RUNTIME_ID only as the unmanaged fallback. This is the caller side
catching up: main.rs accepts --state-root and passes it through, and the recipe
declares the state_root argument binding plus the three GAMECULT_IDUNN_*
variables while dropping the three the daemon no longer reads.
The binding is required, not cosmetic. Idunn refuses a stateful workload with
no state_root argument binding and refuses one whose binding disagrees with
the admitted root, so the recipe could not have deployed without it.
The acceptance harness kept its own GHOSTLIGHT_RUNTIME_ID; it is renamed to
GHOSTLIGHT_ACCEPTANCE_RUNTIME_ID so a test-supplied identity cannot be mistaken
for the managed one.
The mesh surface test compared the published record against a freshly built
surface, including updatedAtUtc, which is a live timestamp. It now asserts the
structural fields, parses the timestamp, and compares surface and commands.
cargo test --workspace: 89 passed, 0 failed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>