Commit graph Ghostlight/crates
Author SHA1 Message Date
Meta Vens
2a8cec6b0a Falsify the clock, commitments, pressure, boundaries, and scale
Twenty-two tests over the pass-7 surface: the tick's three stages and its
re-derivation at apply and at replay, the clock capability's single admitted
body, every commitment shape check as one complete sorted set, the attention
order's totality and its refusal to filter, boundary derivation and the
answer-must-be-satisfied rule, and the scale deficit that only admitted
subjects reduce.

Two defects the tests found and this commit fixes: PressureSource mixed struct
and newtype variants under an internal tag, which cannot serialize a scalar
newtype, so it is adjacently tagged; and Motion carried an is_empty no caller
outside a test used.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 00:07:49 +02:00
Meta Vens
d7fba90c71 Give the world a clock, commitments, pressure, boundaries, and scale
Ontology widening pass 7. The world acquires a fictional clock advanced by
exactly one command body; promises acquire a due date; an unmet promise becomes
stored pressure; pressure orders whose turn it is without deciding whether a
turn exists; and the places the world has not grown into become derivable
rather than noticed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 23:54:50 +02:00
Meta Vens
54e9d39113 Close the six pass-6 Soul follow-ups
- audience() no longer folds a channel's controller into its own
  audience: a controller may still can_broadcast() from outside its
  reach, but it gains no fan-out knowledge and is not a CanReach target
  unless it actually stands inside the declared reach.
- Correct the "one home" doc claims: the statement lives in
  facts[fact].statement (the readable home) and is duplicated inside
  the committed AssertClaim effect as a replay witness only; no
  projection reads the event copy.
- ControllerRunner now holds a narrow ControllerPort instead of a whole
  WorldMailbox, forwarding exactly the five requests a controller lane
  makes. operator_log has no method on that type, so it is a compile-time
  boundary rather than a pub(crate) convention.
- Document why resolve_patch's candidate knowledge map safely skips
  modeling Communicate's fan-out (AuthoredSource has no Told variant),
  and pin that invariant with a test on the one ComponentOpKind lowering
  site that could otherwise drift.
- Add a test proving a stale controller_work.v4 row is refused at open.
- Length-prefix derive_id's discriminator so Some("") and None (and any
  other handle/discriminator split) cannot collide; derived IDs change
  as a result, which the v5 schema bump already requires callers to
  accept.

Baseline 178 world / 213 crate; now 181 world / 216 crate, cargo fmt
clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 23:50:47 +02:00
Meta Vens
cb6a126025 Soul pass 6: falsify knowledge, channels, and speech fan-out
Nine test-only additions in world::soul_knowledge_tests. Two pin behaviour
that differs from the specified shape rather than endorsing it:

- a channel's controller is folded into `audience` itself, so it receives
  every telling on its own channel even when standing outside the declared
  reach;
- the utterance is stored twice, in `facts[fact].statement` and again in the
  committed event's own `AssertClaim` effect.

The rest confirm the gates: every speech precondition rejects at `exercise`
with the whole state byte-identical, a forged wider audience or appended
telling dies in `apply_effect`, an unheard utterance moves no scope digest
including the speaker's, the same-patch telling-then-forget asymmetry is
fail-closed only, an orphan claim is a Draft shape unreachable in Active,
replay is exact across all six new arms twice over, and `operator_log` is
unscoped by construction.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 23:19:10 +02:00
Meta Vens
b8ff18282e Give the world Knowledge, Channels, and Fact standing
Speech stops being a broadcast event everyone can read and becomes a typed
claim that some subjects hold. Three partitions carry it: `facts` (one row per
`EntityKind::Fact`, write-once), `channels` (one row per `EntityKind::Channel`),
and `knowledge`, which is the sole owner of who-heard-what.

`state.events` is demoted from perception surface to causal record. The events
log records what was done; the knowledge partition decides what a subject may
act on and what its projection may contain. `WorldSnapshot.events` is deleted
outright, so `controllers.rs` structurally cannot read an unscoped log; the
human operator's story feed moves to `WorldKernel::operator_log`, reached
through its own mailbox request and passed to `eve::authenticated_surface`
beside the snapshot.

Two pure functions state reach and nothing else does: `audience` (who is in
earshot) and `fan_out` (who gains knowledge from one telling). Co-location is
the actor's exact place; a channel's `Reach::Place` is the subtree, through the
same `covers_place` walk a jurisdiction uses. A telling never overwrites a
holder and `Believed` is fixed by the kernel, so no speaker owns another
subject's credence.

The kernel Speak entry gains its real shape: one `CanBroadcast` precondition, so
an unplaced subject fails with `NoAudience` rather than being heard by everyone.
A `carries_speech` entry must name exactly one audience, and `exercise` prepends
two kernel-owned operations no slot or band can influence: `AssertClaim` mints
the fact, `Communicate` fans it out. That makes `action::exercise` the second
`derive_id` call site; the "only `admit_resolved` allocates" rule is rewritten
rather than amended.

The kernel does not compare two statements. There is no dedup, no interning, no
contradiction check, and no similarity. Deception is a `Claimed` fact standing
beside its asserter's own knowledge of a different one, and the meaning of that
gap belongs to a reader.

`STATE_SCHEMA`/`COMMIT_SCHEMA` become `.knowledge.v1` and the controller work
schema moves to v5; a pre-pass store is refused with no migration path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 23:02:53 +02:00
Meta Vens
65ee2be41a Soul pass-5 follow-ups: overlap admission, revoke envelope, deploy coverage
Adds an admission-time check in GrantAuthority resolution that rejects a
Subject grant nested inside a same-kind PlaceSubtree grant the holder
already has, and the reverse, using the live covering predicate. This is
admission-only: targets_overlap and verify_state_shape stay structural and
position-independent, and a later Relocate that creates the same nesting
is never re-derived as a violation.

Extends the action lane's check_delegation to gate RevokeAuthority slots
by the same monotonicity envelope it already applies to GrantAuthority:
an actor may not strip authority it does not itself hold. Adds a fixture
"revoke" affordance to exercise both the covering and non-covering cases.

Adds an end-to-end test for the fixture's "deploy" affordance (Relocate
lowering) plus its precondition's negative case.

Updates the two existing tests whose assumptions depended on the old gap
(a Subject grant silently nesting inside a PlaceSubtree grant) to assert
the new rejection instead.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 22:21:22 +02:00
Meta Vens
dbe176d58b Soul: falsify the pass-5 civic gates
Seven tests, no production change. Each one asks whether a claim fails at
the gate the spec names rather than somewhere downstream that happens to
catch it.

`DelegationNotMonotone` now has a test that walks `submit`, not the
`draw_once` bench, and asserts the refused act moved no revision, no
grant, and no event. The `Restricted` rule is exercised at
`apply_operations` with a forged `ResolvedOp` that skipped the resolver,
which is the only lane the existing test did not cover. The rebind
requirement is asserted at the layer an operator sees it: a revocation on
the granter refuses the incumbent's already-bound proposal with
`ScopeChanged`, at the current revision, so nothing but the stale scope
digest can be doing the refusing. `reduce` is shown pure across every new
civic arm and equal to what the commit stored.

Two tests pin decisions the spec did not make. Structural overlap cannot
be decayed by a `Relocate`, and the store survives one; but it also does
not see a `Subject` grant sitting inside a `PlaceSubtree` grant of the
same kind, so one subject can hold two sources of one permission and
revoking the wider one leaves the act standing through the narrower. A
destination declared in the same patch as the restricted route into it is
covered by no grant, so a genesis patch cannot declare a room and walk
anyone into it in one batch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-04 22:03:15 +02:00
Meta Vens
fa3d95dca9 Give the world an Authority, Selection, and Redress subgraph
A subject stops being able to do anything to anyone it can name, and starts
needing a jurisdiction that covers the target: held directly, or lent to it
by an institution through an office it occupies.

Three partitions on `WorldState`, written only by `apply_operation` and
validated only by `resolve_patch`: `authority` maps a subject to grants of a
world-declared kind over a subject or a place subtree, `selection` maps an
institution to its offices and their incumbents, and `redress` maps a
grievance kind to a forum and its standing. Eight `ComponentOp` variants
reach them through the existing `AdmitPatch` lane, and four
payload-carrying `ComponentOpKind` variants reach them from an affordance's
effect slots.

One covering predicate, `covers`, answers every jurisdictional question:
`Precondition::Authorized`, `Precondition::HasStanding`, the delegation
monotonicity rule, `route_admits`, and the snapshot's redress projection.
`AccessKind::Restricted` now names the authority kind that opens the route,
so a restricted route admits exactly the subject holding that kind over its
destination — checked identically by `resolve_patch`'s `Relocate` arm, by
`apply_operation`'s, and by `Reachable`'s edge admission.

An office's delegated grants are copied into its incumbent's
`ScopeComponents`, so one scope digest covers the grant, the office, and the
institution's jurisdiction: revocation, reconstitution, installation, and
vacancy are all rebinds. What the actor reaches stays out, so a target that
walks out of a jurisdiction fails at `Authorized` instead.

`OverlappingJurisdiction` makes it impossible for one subject to hold two
grants of one kind over overlapping ground, so nothing ever arbitrates
between two sources of one permission; overlap between subjects is layered
government and stays legal. The reserved `actor` role binds the acting
subject, which is what makes a levy's payee unforgeable.

Six world-authored fixture entries — levy, delegate, deploy, sanction,
appoint, petition — are the worked examples. No decree and no contract:
their effect is `Commitment`, and without it either lowers to speech in an
institution's coat.

Schema moves to `ghostlight.world_state.authority.v1`; a previous store is
refused with no migration adapter.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 22:03:15 +02:00
Meta Vens
40e4efcc18 Make the affordance grant structural in exercise
`action::exercise` read `invocation.affordance` and looked the entry up
itself, with the grant check standing beside it in each caller. Pass 5 adds
a third caller, so the check becomes the type: `require_granted` now returns
a `GrantedAffordance` carrying the verified id and its catalog entry, and
`exercise` takes that instead of the raw id. Nothing in the pipeline reads
`invocation.affordance`, and no caller can reach it ungated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 22:03:15 +02:00
Meta Vens
0f21a4900c Soul: falsify pass-4 bands, the shared catalog id, and journal-side forgery
Four test-only additions, plus one two-slot fixture entry:

- `soul_only_the_selected_bands_effects_are_committed` closes verification
  contract 10's discriminating case. The existing tests prove an empty band
  commits nothing and a one-slot entry lowers what it declares; neither
  separates a slot the proposer offered from a slot the draw admitted. The new
  `carry_split` entry declares two slots on disjoint bands, both proposed
  within ceiling, and each band is reached by searching for a command id
  before the envelope is built rather than by retrying commits.
- `soul_a_forged_band_or_effect_in_the_journal_dies_at_replay` names the layer.
  `verify_state_shape` bounds a band index and refuses effects under an empty
  band; it does not re-derive the draw. The forgery is re-digested into a
  contiguous chain and dies at `apply_committed_command`'s effect equality.
- `soul_a_shared_catalog_id_is_gated_by_the_scope_grant` pins that an
  affordance id names a catalog entry every grantee shares, so grant
  membership per scope is what gates: the same `convene` id commits for its
  grantee and is denied for a controller-driven scope that does not hold it.
- `soul_a_stored_role_spec_over_an_optional_subject_kind_round_trips` proves
  the adjacently tagged `RefKind` survives the `to_vec_named` path that a
  stored `RoleSpec { kind: Subject(None) }` writes through.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:40:41 +02:00
Meta Vens
f9cd0177e7 Affordances become world-authored catalog entries with preconditions, ceilings, and bands
An action stops being an enum the kernel understands and becomes a lookup into
world-authored data: preconditions over live state, magnitudes under declared
ceilings, one deterministic band, lowered into the same ResolvedOps the patch
path already applies.

Cut first, with no compatibility path: DecisionAction and its kind(),
AffordanceKind, the AffordanceGrant struct and the (scope, kind) uniqueness
scan, affordance_slug, validated_invocation and its three call sites,
KernelError::EmptySpeech and ::AffordanceMismatch, the seven-clause equality
chain in apply_effect's DecisionExercised arm, the grant-kind comparison in
replay, speak_invocation's parallel constructor, and all three hand-written
claims about what a subject may do (the available_tools prose, the
operational_tools schemas, and the typed view's speak permission literal).

WorldState gains affordance_catalog, the sole store of what an affordance is,
written only by admit_resolved from a resolved patch and validated only by
resolve_patch. affordance_grants collapses to a set per scope, so a duplicate
grant is unrepresentable rather than checked and derive_opportunities is a map
lookup. Declaration::Affordance authors an entry; a subject grants entries by
reference, so one genesis patch declares a catalog and grants from it
atomically. Speak is the kernel-built entry under an ordinary draft handle:
zero preconditions, zero slots, one empty band, one utterance.

world/action.rs owns the pipeline behind one entry point, exercise(), called
from both reduce and apply_effect so a forged effect is re-derived by the
function that produced the honest one. It binds roles, evaluates Present,
Reachable, and Holds, checks every slot against its ceiling, draws one band
through the existing digest() owner over a named BandPreimage, lowers the
selected band's slots through the bindings, and admits them through the same
resolver. Effects ride on the event and apply through apply_operations, so an
affordance's Transfer meets the same conservation equation as a declaration.
ActionMismatch is a sibling of Mismatch, complete, sorted, and never
serialized; it surfaces as KernelError::ActionRejected.

Binding and admission are two checks, not one. Binding is scope-digest
equality, and the digest now reads the granted entries' definitions. Admission
runs at commit against live state, so a route closing mid-flight is
TargetUnreachable rather than ScopeChanged, and a proposal is not invalidated
by distant traffic.

The OperationalAgent tool catalog, its prose signature line, and the typed
view's permission block are three projections of the granted entries, naming
affordance kinds and role parameters and never an affordance id.

State, commit, and controller-work schemas bump; a pre-pass store is refused.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:40:41 +02:00
Meta Vens
0ca51cf90a Extract apply_operations as the one owner of operation application and conservation
The seed/apply/accumulate/check_ledger sequence was inlined in the tail of
admit_resolved, which made declaration admission the only lane able to prove
custody conservation. Lift it verbatim into apply_operations, taking the
operations and the evidence list; admit_resolved calls it after its declaration
loops. No behaviour change.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 20:40:41 +02:00
Meta Vens
d2805fe70d Soul: falsify pass-3 conservation, the apply-side ledger, overflow, and counterparty scope
Six test-only additions, no source change.

- soul_a_mixed_patch_conserves_every_resource_it_touches: the ledger equation as
  arithmetic over committed totals across transfer + transform + consume in one
  patch, plus the admit-only opening balance. Absence stays absent.
- soul_a_forged_sequence_dies_at_the_per_operation_check_not_the_ledger: answers
  the reachability question for the apply-side check_ledger. A forged
  PatchAdmitted carrying two transfers whose second exceeds what the first left
  dies at apply_operation's own precondition, one operation early. A conserving
  forged sequence applies. from == to and from_resource == into_resource are
  refused by their arms. A forged Admit still needs its receipt.
- soul_a_holding_cannot_overflow_silently: QuantityOverflow had no landed test.
  Two admissions summing past u64::MAX are the complete verdict; nothing mints.
- soul_an_incoming_transfer_changes_only_the_counterpartys_scope: the receiver's
  bound proposal is refused with ScopeChanged; an unrelated subject's commits.
- soul_replay_is_exact_after_every_custody_operation: replay covered only
  transfer. Transform, consume, and both bind targets now ride the same restart.
- soul_a_dependency_on_an_absent_or_wrong_kind_target_is_corrupt: the dependency
  shape clauses refuse a wrong-kind target, an empty target set, and an orphan
  holder key.

cargo test -p ghostlight-dungeon --bin ghostlight-dungeon world::
  97 passed, 0 failed, 1 ignored.
cargo test -p ghostlight-dungeon: 132 passed + 1, 0 failed, 1 ignored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 19:03:59 +02:00
Meta Vens
48de96b0a4 ghostlight-dungeon: cut the duplicated incident-route scan, add Custody, Dependency, conservation, and evidenced admission
The cut first. `controllers.rs::typed_incident_routes` recomputed by hand the
same incident-route set `scope_digest` computed in `mod.rs`, two scans in two
modules held together by a comment. Both are gone. `mod.rs::scope_components`
is now the single owner of "what components does this subject's verification
read"; `scope_digest` and `snapshot` both consume it, and the controller view
reads `SubjectSnapshot.incident_routes` and resolves IDs against the snapshot.
`ScopePreimage`'s `position` and `routes` fields fold into one `components`
field. Three candidate mismatch names are refused before they exist:
`CustodyNotHeld` (absence is zero, so it is the boundary case of
`InsufficientCustody`), `DependencyTargetKind` (a target of the wrong kind is
`WrongKind`), and `DependencyDuplicate` / `DependencyNotBound` (an operation
that changes nothing is `NoOperationEffect`, which pass 2 already owns).

The addition.

- `WorldState` gains `holdings: BTreeMap<SubjectId, BTreeMap<EntityId,
  Quantity>>` and `dependencies: BTreeMap<SubjectId, BTreeSet<
  DependencyTarget>>`: subject-keyed partitions following `positions`, not
  `EdgeRecord` variants. `EdgeRecord`, `EdgeKind`, `ResolvedRoute`, and the
  seven accessors are untouched. Absence is zero at both levels, so no stored
  `Quantity(0)`, no empty inner map, and a duplicate holding is unrepresentable
  because a map key is unique.
- `Quantity(u64)`: unsigned, no unit, no maximum. Subtraction is `checked_sub`
  and fails as `InsufficientCustody`; addition is `checked_add` and fails as
  `QuantityOverflow`. No saturating arithmetic.
- `ComponentOp` and `ResolvedOp` gain `Transfer`, `Transform`, `Consume`,
  `Admit`, `Bind`, `Release`. `Transform` is 1:1 by construction: one `qty`
  spent and gained, so a ratio has nowhere to be written. No `ResolvedOp`
  carries a resulting balance; every arm re-derives its precondition from the
  committed partitions at apply time.
- `Mismatch` gains `InsufficientCustody`, `ZeroQuantity`, `QuantityOverflow`,
  `AdmitWithoutEvidence`, `SelfDependency`, and `CustodyNotConserved`, appended
  after the pass-2 variants so single-item assertions keep their ordering.
- `patch::check_ledger` is the one statement of conservation:
  `after == before + admitted + gained - consumed - spent`, over `u128`
  accumulators. `resolve_patch` seeds a fourth candidate map beside containers,
  routes, and positions, records each admitted operation's terms, and verdicts
  the ledger after the operation loop and before the emptiness gate.
  `admit_resolved` re-derives the same equation over the committed partitions,
  so a forged `PatchAdmitted` that reaches `apply_effect` without passing the
  resolver dies with `Invariant("custody does not conserve")`. `Transfer`
  contributes to no term: the equation proves it.
- Evidenced admission. `EvidenceRef` gains a constructor and crosses the
  facade. An `Admit` is valid when its ref is canonical text and the identical
  ref appears in the same patch's `evidence` list; otherwise
  `AdmitWithoutEvidence`. The kernel checks no store and no digest — retrieval
  and receipt authenticity belong to the retrieval organ — but the ref rides
  inside the digested, hash-chained commit, so it cannot be altered or dropped
  afterwards. There is no holdings declaration field: `Admit` with evidence is
  the only creation path, in every lane including genesis. Evidence is
  Draft-only, so `Admit` is Draft-only in this pass, with no second gate.
- Replay shape. Every `holdings` key names a canonical subject, every inner key
  a `Resource` entity at a nonzero quantity, no inner map empty; every
  `dependencies` key names a canonical subject with a non-empty set of
  canonical, distinct targets.
- Snapshot and typed view. `WorldSnapshot` gains `resources`;
  `SubjectSnapshot` gains `holdings`, `dependencies`, and `incident_routes`,
  all the acting subject's own. `typed_view` gains a `holdings` block with
  labels resolved only for what this subject holds, and a `dependencies` block
  carrying target kind and ID with no label and no target state. The
  hand-written `available_tools` string is unchanged; the derived tool catalog
  is a later pass.
- Schema bump to `ghostlight.world_state.custody.v1` /
  `ghostlight.world_commit.custody.v1` and the matching journal rows. A
  pre-pass store fails `recover` with an unadmitted row type. No migration
  adapter.

Deviations from the Imagination spec, each decided here:

- `resolve_place` generalizes into `resolve_entity(expected_kind)` rather than
  gaining a `resolve_resource` sibling. Two eight-line wrappers around one body
  bought nothing; the four place call sites pass the kind.
- Spec test 1 asks for a forged `Transfer` whose debit and credit differ.
  `ResolvedOp::Transfer` carries one `qty`, so that is unrepresentable — which
  is the outcome the shape was chosen for. The test proves the reachable
  forgery (a transfer the holder cannot cover leaves `holdings` byte-identical)
  and falsifies `check_ledger` directly beside it.
- Spec test 14 asserts against `verify_state_shape` rather than
  `verify_history`. Mutating a committed holding also breaks replay equality,
  so routing through `verify_history` would pass even with the shape clauses
  deleted.
- Spec test 11's visible half lives in `controllers.rs`, where
  `SelectedDecision` is, extending the existing typed-view non-leakage test;
  its kernel half is the world-level test of the same name.
- `EvidenceRef::new` is `#[cfg(test)]`. No `AdmitPatch` ingress exists yet, so
  every caller that builds a patch today is a test; the gate comes off in the
  same commit as the first production patch author. The type itself crosses the
  facade, as `ComponentOp::Admit` requires.

No external-owner field, no unit, rate, or recipe field anywhere, no new crate
or dependency, no compatibility shim.

cargo test -p ghostlight-dungeon --bin ghostlight-dungeon world::
  91 passed, 0 failed, 1 ignored (75 before this commit).
cargo test -p ghostlight-dungeon: 126 passed + 1, 0 failed, 1 ignored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 19:03:59 +02:00
Meta Vens
db8eb0b2a7 Pass-2 follow-ups: dead presence check, RefKind derives, stamped world_id, stale imports and comment
Four cuts Soul named on pass 2, none of them behaviour changes.

- runtime.rs: delete the `source_version` presence check in
  `admit_controller_command`. It called `.ok_or_else(...)?` and discarded the
  value, so it validated nothing. The `expected_revision = source_version - 1`
  computation on the approve/activate path is untouched; that one still needs a
  caller-supplied binding.
- world/patch.rs: drop `Serialize`/`Deserialize` from `RefKind`.
  `RefKind::Subject(Option<SubjectKind>)` is an internally tagged newtype over a
  non-map, which serde refuses at runtime, so the derives were unexercised
  weight. `RefKind` is never persisted: it appears only in `Mismatch` (not
  serializable), the resolution index, and the three kind constants. Soul's
  `soul_ref_kind_is_not_a_serializable_shape` cannot compile as a negative
  without the derives it falsifies, so it is deleted; the doc comment on
  `RefKind` now carries the rule it was proving.
- world/mailbox.rs: document that `submit_stamped` stamps `world_id` as well as
  `revision`, and why — the mailbox owns exactly one world, so there is no other
  world a controller runner could mean. The consequence is that
  `WorldKernel::submit`'s `WorldMismatch` check is unreachable on this path;
  `soul_a_stamped_submission_still_fails_closed_on_a_foreign_scope` stays as the
  proof that scope still fails closed.
- world/mod.rs: `ComponentOp` and `RouteDeclaration` are test-only, so their
  import moves behind `#[cfg(test)]`.
  ghostlight-persona-projection: `opportunity_digest` no longer claims to bind
  "world state as one value"; pass 2 made it bind the scope digest.

cargo test -p ghostlight-dungeon --bin ghostlight-dungeon world::
  75 passed (76 minus the deleted RefKind test), 1 ignored.
cargo test -p ghostlight-dungeon: 110 passed + 1, 1 ignored.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-04 19:03:59 +02:00
Meta Vens
e99af63f9a Soul: falsify the pass-2 scope binding, topology admission, and replay
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>
2026-09-04 18:10:34 +02:00
Meta Vens
24addfb21e ghostlight-dungeon: cut authority_scope and whole-world binding, add topology and scope digests
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>
2026-09-04 18:10:34 +02:00
Meta Vens
5e53beb353 ghostlight-dungeon: one schema owner, genesis mismatch not journal fault, named ref fields
- 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>
2026-09-04 17:13:10 +02:00
Meta Vens
9ddc21f048 Soul: prove the store and apply_effect halves of closed resolution
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>
2026-09-04 17:00:45 +02:00
Meta Vens
d74d6ad3d7 Close patch resolution before any canonical ID allocates
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>
2026-09-04 16:47:15 +02:00
Meta Vens
751b5c4150 Take runtime identity, bind, and state root from Idunn
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>
2026-09-04 01:24:08 +02:00
Meta Vens
6a79cb093a Republish Warming while awaiting a write lease 2026-09-03 10:39:04 +02:00
Meta Vens
92566480bb Expose managed Ghostlight route presence 2026-09-03 09:25:32 +02:00
Meta Vens
a0b16b927b Bind Ghostlight runtime presence to Idunn authority 2026-09-03 06:36:58 +02:00
Meta Vens
13d5136b69 Unify Ghostlight persistence under one CultCache 2026-09-02 15:00:48 +02:00
Meta Vens
06093b00fc Derive projector fixture event identity 2026-09-02 13:52:14 +02:00
Meta Vens
27d72b819f Keep narrative projection free of authority metadata 2026-09-02 13:51:27 +02:00
Meta Vens
6bb6869810 Rebuild Ghostlight around explicit world authority 2026-09-02 07:21:11 +02:00
Meta Vens
66ed2ec167 Complete sealed world authority loop 2026-09-01 19:37:13 +02:00
Meta Vens
12ee9f4622 Remove dead legacy kernel ingresses 2026-09-01 19:32:33 +02:00
Meta Vens
d49b907e83 Make Persona interpretation structurally total 2026-09-01 16:37:41 +02:00
Meta Vens
b53251f94f Seal the replacement world owner 2026-09-01 16:18:15 +02:00
Meta Vens
a144c33661 Make cognition modes explicit and interpretation total 2026-09-01 14:26:47 +02:00
Meta Vens
64f50de596 Delete obsolete pipeline smokes 2026-09-01 14:22:07 +02:00
Meta Vens
8964a92cb4 Route destination drafting to balanced model 2026-09-01 13:27:03 +02:00
Meta Vens
4d330d921e Bound destination generation context 2026-09-01 12:53:27 +02:00
Meta Vens
fc46c3ba61 Bound destination compile latency 2026-09-01 12:06:47 +02:00
Meta Vens
0a830347dc Bound foundation compile latency 2026-09-01 11:08:39 +02:00
Meta Vens
661cfbad9f Rebuild qualified world elaboration 2026-09-01 09:54:04 +02:00
Meta Vens
37b1362860 Add focused campaign world explorer 2026-09-01 04:53:55 +02:00
Meta Vens
b81a9779f1 Make strategic target projection deterministic 2026-09-01 03:56:17 +02:00
Meta Vens
67421ada42 Bound strategic cell agent context 2026-09-01 03:34:25 +02:00
Meta Vens
b61e762c98 Page Nemesis causal attention context 2026-09-01 02:40:45 +02:00
Meta Vens
8dd3147066 Keep compaction journals structurally compact 2026-09-01 02:04:56 +02:00
Meta Vens
8cdbd2e3a0 Expose exact compaction preflight failures 2026-09-01 01:57:59 +02:00
Meta Vens
75d9235352 Supersede duplicate parallel identities 2026-09-01 01:41:15 +02:00
Meta Vens
799be9914b Align elaborator compaction bounds 2026-09-01 01:28:57 +02:00
Meta Vens
f3d5951ac3 Shrink individuation to model-owned fields 2026-09-01 01:10:13 +02:00
Meta Vens
dd7fb98e73 Keep public names out of identity authority 2026-09-01 00:53:08 +02:00
Meta Vens
fa01658686 Expose exact individuation repair findings 2026-09-01 00:37:06 +02:00