Ghostlight/crates
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens 7aba2b4191 Cover the tick driver's permit gate, quarantine edge, and ordering
Pass 9 follow-ups 1-3 from Soul's review:

- Widen ControllerRunner::with_test_ports, InferencePort, and
  ControllerWorkStore to pub(crate) (still cfg(test)), plus the small
  cfg(test) seam needed to implement them outside world::controllers
  (fixture_prepared_inference, fixture_inference_output,
  InferenceFault::fixture_integrity_violation, and cfg(test) pub(crate)
  re-exports from world::mod). Two new runtime spec tests drive a real
  ControllerRunner over a counting/quarantining InferencePort and an
  in-memory ControllerWorkStore, proving the controller-permit semaphore
  never admits more concurrent run_cell calls than its pool, and that an
  integrity-violating fault quarantines the organ so no later tick's
  cells ever reach the port again.

- Extract drive_one_tick out of drive_cover_tick's loop body, narrowed
  the same way submit_clock_tick narrows the clock port: run_cover and
  submit_clock are opaque closures, never run_cover_tick or
  WorldMailbox::submit_clock by name. A new test drives it with a fake
  cover-runner over a real three-cell Cover (via a new cfg(test)
  fixture_controller_opportunities in world::mod) and a fake clock
  submitter, proving the clock is always submitted after every cell has
  run and that every cell in the tick carries the cover's one tick index.

- Delete cover.rs's merges_are_deterministic_in_subject_order: its name
  overclaimed determinism the test never checked. Its coverage-survives-
  a-permutation assertion was already proven by
  soul_b_the_cover_is_pure_and_the_attention_order_is_a_real_input; its
  other assertion (cell count is stable under permutation) was not, so
  that one assertion moved into soul_b's test instead of surviving under
  a misleading name.

Deviations from the literal brief, both load-bearing:

- Ruling 1 asked for "a cover of several cells" with
  GHOSTLIGHT_CONTROLLER_MAX_CONCURRENT = 2. The production world-create
  intent caps a genesis world at exactly two controller-bearing subjects
  (one narrative persona, one operational agent), so the real cover this
  test can derive tops out at two cells. Reusing that production ceiling
  meant not widening the kernel's private command types (CreateWorld,
  CallerId, CommandEnvelope) past what this pass already opens, which
  seemed like the more coherent boundary to hold. The permit pool is set
  to one instead of two so the cap is still load-bearing: with two cells
  and a pool of two, the assertion would be vacuously true.

- Ruling 1's second scenario wanted "the remaining cells are skipped"
  within one tick. Tracing run_cover_tick's per-cell task shows the
  quarantine check runs once, before a cell ever contends for its
  permit; every cell in one JoinSet is spawned and gets that check
  before any of them can reach the port and set the flag, so no cell of
  the *same* tick is ever actually skipped by it — only a cell of a
  *later* tick is, via run_cover_tick's own top-of-function guard. The
  test proves that real mechanism (a second tick makes zero further
  calls) rather than an intra-tick race the driver does not resolve,
  which would have been flaky either way it landed.

world:: 281 passed (baseline 282, minus the one deleted test).
Full crate 320 passed (baseline 318, minus one deleted plus three new).
cargo fmt -p ghostlight-dungeon -- --check is clean.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-05 03:20:19 +02:00
..
ghostlight-dungeon Cover the tick driver's permit gate, quarantine edge, and ordering 2026-09-05 03:20:19 +02:00
ghostlight-persona-projection Give the world a tick 2026-09-05 02:23:00 +02:00