Commit graph Ghostlight/docs/architecture/ghostlight-library-extraction-cut.md
Author SHA1 Message Date
Meta Vens
d86ed9f4a2 Close L0: postmortem, ledger, target and state reconciled
The kernel extraction is finished. The world kernel is the ghostlight
library crate; Dungeon consumes it across a boundary sealed by admission,
proven from outside the crate.

The cut map records the last two fix batches and Q1-10, defaulted: the
minter scanner stays a tripwire, with Clippy recorded as the fix. The
subtraction ledger missed its estimate, +210 net source lines against about
+65. The reasons: the scanner grew chasing evasions, the boundary needed
about 90 more public items than planned, and the rejection tests buy a
ruling made after the estimate.

The postmortem lists what Soul caught, the operator corrections, the
incidents, and the open follow-ups. The target states which invariants
hold and how. The plan, map.yaml and the handoff point at L1. The L0
evidence record is rewritten as its distilled lessons; the previous text is
archived.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 12:24:49 +02:00
Meta Vens
89eb75b6a7 Record the Cut 1 fix batch and Soul's verdict
The fix batch landed at 7c1d1e9..2865ea7: external rejection tests,
the minter check by name, Eve removed from library text, and a narrower
public surface. Soul confirmed the rejection tests drive the real kernel
path from outside the crate, that the unchanged-state assertions are
sound, and that Hands was right about what holds three types public.

Soul also found the digest check is pinned only by forgeries of the wrong
length, so a stale same-length digest from an earlier revision is going to
a fix. The minter scanner is still evadable five ways; since every text
scanner in this migration has lost to a short evasion, Q1-10 asks whether
Clippy's disallowed-methods should replace it.

Recorded, not fixed: rustc on stable does not enforce compile_fail error
codes, the world_id check is redundant by construction, and the decline
path is not reachable from an external test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 11:47:08 +02:00
Meta Vens
7c1d1e96fa Rule Q1-9: sealing means unforgeable admission
External code may hold a syntactically valid ID, digest or opportunity,
because Dungeon's Eve payloads deserialize them. What must hold is that
the kernel rejects every one it did not issue, proven by rejection tests
written from outside the crate. The compile_fail set stays for the
genuinely private items, with its limit stated: it pins a path name and
cannot see constructibility.

The target's first invariant now says that, so the claim matches what the
boundary does.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 10:42:25 +02:00
Meta Vens
af63b0cd13 Record Soul's verdict on the Cut 2 fix batch
The batch holds: whole-invocation pinning survives image swaps, line
swaps, re-indentation, continuation splits and appended flags; the order
checks catch a move into the reuse branch; the runbook is tied in both
directions; and a fail inside a command substitution does abort.

Soul then found the limit of the approach. An exact-line pin proves the
lines exist, not that they run: wrapping the block in `if false`, chaining
it behind `true ||`, or swallowing it in a heredoc keeps every pinned line
intact and the checker green. Abort on failure rests on an unpinned
`set -euo pipefail`, and a duplicated block passes unnoticed.

All three are recorded, not fixed. The script is a legacy actuator under a
do-not-invoke warning, retired at the deployment gate, and the authority
that really runs the tests is Ghostlight's Idunn recipe. Revisit only if
the gate keeps the script.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 02:57:01 +02:00
Meta Vens
8ddc1e86f3 Record the Cut 2 fix batch and its follow-ups
gamecult-ops 803f2c7 pins each of the four cargo steps as a whole
docker invocation, asserts the recipe order, and brings the runbook into
the wiring test. The four mutations that previously passed silently now
fail, and no pre-existing assertion was weakened.

The same defect class survives in three places outside this migration:
the web build container, the Codex Connector's cargo steps, and a fixed
18-line search window. All three are recorded as follow-ups.

Soul has not yet passed on the fix batch.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 02:47:28 +02:00
Meta Vens
e7d21013b9 Record Soul's Cut 2 verdict
The assertions Cut 2 added pin text, not invocations. Deleting the two
lines above the pinned cargo line turns it into trailing arguments on the
previous container: the kernel tests never run and the wiring test still
passes. Nothing pins the order of the four cargo steps, and the wiring
test never reads the runbook.

Those three are going to a fix batch. Two more are recorded, not fixed: a
redeploy of an already-sealed commit runs no cargo steps at all, which is
pre-existing deploy behaviour the operator owns, and the dated census docs
still show the old single-crate paths.

What held: the library step runs in the right branch with the same image
and mounts, its failure aborts the deploy, and the acceptance test path
resolves under the library crate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 02:40:45 +02:00
Meta Vens
1b409b3121 Record Cut 2 and the two spec defects it exposed
Cut 2 landed at gamecult-ops 6aba281: the library test step now runs in
the deploy script, is documented in the runbook, and is asserted by the
wiring test. Without it a deploy would run 50 tests and skip the 420
kernel tests that moved to the library crate.

Two defects in this map's own spec, reported by Hands rather than worked
around:
- the assertion it specified was vacuous, because require_text is a
  substring match and the given string is a substring of the
  persona-projection line;
- the acceptance test path lives in a variable the spec did not list,
  pinned by the wiring test and repeated in the runbook prose.

Changing the acceptance binding means sealed acceptance witnesses from
before this commit will miss and regenerate.

Soul has not passed on Cut 2 yet.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 02:35:06 +02:00
Meta Vens
880c9656ad Record Cut 1 and Soul's verdict; sync the stale surfaces
Cut 1 landed at 108b691..f859d2c. Soul reran the builds, tests, census and
mutations itself and confirmed the behavior-unchanged claim; it found six
defects.

F1 is the one that matters: the seal is name-based. Public ID types,
ScopeDigest and DecisionOpportunity all derive Deserialize, so an external
crate can mint them from JSON and rebuild the fixture path ruling Q1-4
said must be unreachable. The reducer still rejects forged opportunities,
so kernel integrity holds while the invariant's wording does not. Q1-9 asks
the operator whether sealing means unforgeable admission or unconstructible
types.

F2 (bypassable minter count) and F3 (71 unused public items) are queued for
the fix batch. F4 names Eve in library error strings. F5 and F6 are
recorded, not fixed.

The map, map.yaml and the handoff now say the kernel is the ghostlight
crate.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 02:27:09 +02:00
Meta Vens
6ddabcad33 Record the L0 rulings; close the fixture question
Rulings Q1-1 through Q1-6 are in the map's status header. The crate is
`ghostlight`. The Vault reader and the SDK port go in the library. The
library owns the principal evidence type. The persona projection crate
stays separate. The gamecult-ops cargo lines are edited, not retired,
and editing them is not an endorsement to run those helpers.

Ruling Q1-4 asked for the Dungeon tests that need sealed fixtures to move
into the library. Classification found none to move: all five are Dungeon
runtime tests. Two further rulings close it instead:
- Q1-7: the inference port's value constructors become the port's public
  contract and the five fixtures are deleted.
- Q1-8: the cover ordering test derives its cover from a real world, and
  the last fixture reaching a sealed ID constructor is deleted.

The sealed ID issuers and ScopeDigest::fixture stay private under every
configuration, with no feature gate anywhere.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-16 01:27:37 +02:00
Meta Vens
02bbf62eb1 Map the library extraction cuts
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>
2026-09-15 23:27:03 +02:00