From 5582f61061eed73b32cb759d18424993e960f427 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 31 Aug 2026 22:52:28 +0200 Subject: [PATCH] Compact elaborator sessions concurrently --- .../src/bin/ghostlight-strategic-smoke.rs | 69 +++++++++++++++---- notes/fresh-workspace-handoff.md | 21 +++++- notes/ghostlight-current-system-map.md | 7 ++ state/map.yaml | 4 +- 4 files changed, 83 insertions(+), 18 deletions(-) diff --git a/crates/ghostlight-dungeon/src/bin/ghostlight-strategic-smoke.rs b/crates/ghostlight-dungeon/src/bin/ghostlight-strategic-smoke.rs index 91aa499..9fbcd47 100644 --- a/crates/ghostlight-dungeon/src/bin/ghostlight-strategic-smoke.rs +++ b/crates/ghostlight-dungeon/src/bin/ghostlight-strategic-smoke.rs @@ -2649,6 +2649,8 @@ async fn main() -> anyhow::Result<()> { ); mutation_paths.push(commit_path); } + let compaction_limit = Arc::new(tokio::sync::Semaphore::new(complexity_parallelism)); + let mut compactions = tokio::task::JoinSet::new(); for (session_id, journal) in journals { let (title, location_id) = session_routes .get(&session_id) @@ -2664,26 +2666,63 @@ async fn main() -> anyhow::Result<()> { "complexity-round-{round:03}-session-{}-{session_suffix}.json", title.display_name().to_ascii_lowercase(), )); - let checkpoint = if path.is_file() { - read_checkpoint::(&path)? - } else { - let (checkpoint, receipts) = compact_elaborator_session( + if path.is_file() { + let checkpoint = read_checkpoint::(&path)?; + checkpoint.validate_for(&campaign, location_id, *title)?; + session_checkpoints.insert(session_id, checkpoint); + continue; + } + let model = model.clone(); + let campaign = Arc::new(campaign.clone()); + let title = *title; + let location_id = location_id.clone(); + let previous = session_checkpoints.get(&session_id).cloned(); + let compaction_limit = compaction_limit.clone(); + compactions.spawn(async move { + let _permit = compaction_limit + .acquire_owned() + .await + .map_err(|_| anyhow::anyhow!("complexity compaction limiter closed"))?; + let result = compact_elaborator_session( model.as_ref(), - &campaign, - location_id, - *title, + campaign.as_ref(), + &location_id, + title, &session_id, - session_checkpoints.get(&session_id), + previous.as_ref(), &journal, Vec::new(), ) - .await?; - store.persist_model_stage_receipts(&receipts)?; - publish_immutable_checkpoint(&path, &checkpoint)?; - checkpoint - }; - checkpoint.validate_for(&campaign, location_id, *title)?; - session_checkpoints.insert(session_id, checkpoint); + .await; + Ok::<_, anyhow::Error>((session_id, title, location_id, path, campaign, result)) + }); + } + let mut first_compaction_error = None; + while let Some(joined) = compactions.join_next().await { + match joined { + Err(error) => { + first_compaction_error.get_or_insert_with(|| anyhow::Error::new(error)); + } + Ok(Err(error)) => { + first_compaction_error.get_or_insert(error); + } + Ok(Ok((session_id, title, location_id, path, campaign, result))) => { + match result { + Err(error) => { + first_compaction_error.get_or_insert(error); + } + Ok((checkpoint, receipts)) => { + store.persist_model_stage_receipts(&receipts)?; + publish_immutable_checkpoint(&path, &checkpoint)?; + checkpoint.validate_for(campaign.as_ref(), &location_id, title)?; + session_checkpoints.insert(session_id, checkpoint); + } + } + } + } + } + if let Some(error) = first_compaction_error { + return Err(error); } let actionable_after = canonical_actionable_subject_count(&campaign); if actionable_after <= actionable_before { diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 8725d82..f5a36f5 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1,6 +1,6 @@ # Ghostlight Fresh Workspace Handoff -Updated: 2026-08-29 +Updated: 2026-08-31 This is the compact re-entry packet. It records current authority, deployed truth, proof, and the next decision. Git history owns chronology; the system map @@ -23,6 +23,25 @@ own volatile workspace identity and the release witness owns deployed identity. 5. For deployment, SSH, firewall, Idunn, Odin, Heimdall, or host work, consult `F:\Projects\gamecult-ops` before acting. +## Current full-world pressure test + +Preserve immutable Runs 75 through 87. Run 87 is live on Yggdrasil at exact +pushed source `b4cc3a29aa7e9108a3fab5c61335cd2d340d4f77`, unit +`ghostlight-full-world-b4cc3a2-87.service`. It resumed without replay through +the admitted Hearthcoil fission, deterministic civic reconciliation, titled +elaboration proofs, and the single failed Hearth dispatch. Complexity rounds +1 through 5 are complete, including all 43 round-5 mutations and their session +compactions. The target remains 2,400 meaningful actionable subjects under +240-cell attention, followed by ten strategic waves. + +The current local verified cut makes independent title-by-realm session +compactions parallel under the existing complexity parallelism entitlement. +Commit and push it before the next source-changing resume. The acceptance +launcher now retains one 35 MiB content-addressed strategic-smoke runner per +exact source commit and deletes disposable compiler output; do not restore a +persistent Cargo target tree. Observe Run 87 first and preserve every completed +mutation and session checkpoint. + ## Mission and current product shape Ghostlight Dungeon is a persistent, Vault-grounded narrative simulation. It diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index 2036447..00ca112 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -1429,6 +1429,13 @@ outside this authority. mutation checkpoints suppress replay, title-by-realm compaction checkpoints suppress recompaction, and consecutive completed round checkpoints restore scheduler fairness and session memory before the first unfinished round. + After mutation admission, independent title-by-realm journals compact in + parallel under the same bounded complexity parallelism entitlement. Each + compactor reads the same committed campaign revision and only its own prior + session checkpoint and journal; the runner persists every successful model + receipt and immutable session checkpoint before returning any sibling + failure. Session checkpoints remain independent memory owners rather than a + shared round transcript, and canonical mutation order remains serial. Missing eligible parents, stale or malformed checkpoints, changed parent bindings, zero-growth rounds, and a nonzero deficit at the configured round ceiling are terminal failures. Canonical CultCache state, not the checkpoint diff --git a/state/map.yaml b/state/map.yaml index 34c147d..2d20ff8 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -329,8 +329,8 @@ current_status: provider_acceptance_checkpoint: Exact pushed commit `139b8a6` completed Run 60 under `character-newsroom.v10` without world or per-wave replay. Its acceptance witness and terminal status bind the completed page and exact resume lineage. The independently dispatched blind reviewer, shown only the reader-facing fantasy newspaper, read it as a real left-populist civic broadsheet and did not immediately identify procedural generation, so the narrative reverse-Turing criterion passes. The review's substantive criticism is that the three stories feel like three rewrites of one briefing; accepted Run 60 remains immutable. The run used 96,902 prompt tokens and reported zero cache hits. Its delivered typeset artifact is `output/pdf/canopy-ledger-run-60-front-page.pdf`; frozen-source and visual verification remain accepted. Exact pushed `bc2ca39` then produced frozen-fact newsroom-only Run 61 Issues 13, 15, 16, 17, and 18 without world or wave model replay. Provider output proves `special_issue` convergence in Issues 13 and 15, independent `general_issue` beats in Issues 16 through 18, and assignment-selector cache hits. Blind review of Issues 13, 15, 16, and 17 passes both distinct recurring voices and issue-shape diversity, recognizing Ossan, Mera, Corin, and Lysa's biases plus modest cross-issue evolution. Run 62 exercised v12 without world or wave replay and failed only because two lead articles proposed invalid datelines; recurring reporter calls still recorded zero cache hits. Run 63 used exact pushed v13 `a52d57b`; Issues 17 and 18 completed before root stopped the final weekly recomposition, both repeated bylines again recorded zero cache hits, and live services remained unchanged. Preserve Runs 61 through 63 as stopped or completed immutable evidence. Copy defects remain later deadline-correction work rather than a reason to reopen accepted issue artifacts. implementation_checkpoint: Exact pushed v13 `a52d57b` keeps one stable reporter action schema, places a common stable house charter before recurring identity and dynamic assignment, and projects deterministic `allowed_datelines` from cited records while retaining copy-desk factual authority and deterministic cited-place admission; 480 library tests and the all-target check pass. Run 63 falsifies reporter-cache pursuit as a useful acceptance target for sporadic independent filings. The proposed v14 cache-floor prompt growth was removed. Append-only agent contexts remain the natural cache beneficiary; accepted Run 60 remains immutable. The strategic cut extracts one shared `validate_strategic_individuation_proposals` owner used by resolution validation and by the scheduler before it returns an optional proposal. An invalid optional identity emits a semantic-invalid receipt and produces no individuation instead of aborting the recoverable wave. Focused valid and invalid regressions pass, and exact-source Run 68 exercises the corrected provider path through twelve committed waves; no further validator implementation is pending. The newsroom-only cut adds a navigation-only directory of completed public changes grouped by period and exact source timestamps to new v14 audit citations. The directory derives context from canonical records and gains no fact or world authority. Legacy empty source times are omitted from both rendering and serialization, preserving inherited v13 receipt bytes and digests; new v14 nonempty source times remain rendered and serialized. Exact-source Run 73 proves that compatibility path and final recomposition mechanically. Current source gives the assignment editor bounded full-ledger queries and explicitly asks it to search sideways for opposition and countermoves; Run 73 falsifies the stronger assumption that this access and instruction alone guarantee balanced selection. Exact pushed v15 source `b6787d909bd79b68ed3a4d143b7f6dd438e00fa2` binds accountability, opposition, and counter-narrative pitches to two distinct named parties and selected citations through a typed conflict axis, and preserves canonical ledger order. Run 74 falsifies the stronger v15 assumption: its lone accountability pitch used the same transfer citation for cultivators and a passive Tribunal, while four of five pitches avoided the adversarial axis through lead or consequence functions. Two cited names did not prove two moves. Exact pushed v16 `86fe6ed89d51da26b65ab6a031608075840b1527` binds each adversarial axis to two distinct cited public moves or positions and rejects one record presented as both sides; it adds no event writer, judge, process, dependency, or persistent authority. Formatting, 27 focused newspaper tests, 484 full library tests, and 16 strategic-smoke tests pass. full_world_acceptance_checkpoint: Run 68 at exact source `69c811a2669fc38f19f9199bf57088dc250bfc3e` is mechanically complete at world revision 27 with 12/12 strategic waves, 240 events, 514 public news rows, and a final newspaper. Independent editorial and grounding reviews both fail. Earlier per-wave papers prove the immutable record already contains dramatic completed facts, including an organ breaching the rail capital, a dead pump, and families crossing borders; the final paper failed to make that committed change legible. Preserve Run 68 unchanged. Run 69 at source `84b31e57a462710eb939c4559e0437eb5d6a7a28` failed before any model call when immutable recomposition verification encountered an empty rendered `Source time:` line in inherited v13 per-wave issues. Run 70 at source `ec45952b843e102dc2ebddda3a3bbb4058687175` also failed before any model call because v14 serialization changed the legacy recomposition digest. Exact-source Run 73 `b827d897b9579c2091a67c363d35b8695288ba2f` is terminal complete at `/var/lib/gamecult/ghostlight-dungeon/acceptance/full-world-delvehold-b827d89-73`: world revision 27, 12/12 waves, 240 events, 514 news rows, inherited artifacts byte-identical to Run 68, manifest valid, and archive SHA-256 `090d05f304c8f3d33c9dccd728bffbf3e5dc2969a7aeeffc2f9d7bafe701ac8a`. Exact-source Run 74 `b6787d909bd79b68ed3a4d143b7f6dd438e00fa2` is mechanically complete at `/var/lib/gamecult/ghostlight-dungeon/acceptance/full-world-delvehold-b6787d9-74`: revision 27, 12/12 waves, 240 events, 514 news rows, Run 68 inherited artifacts byte-identical, manifest valid, unchanged live services, and archive SHA-256 `957b11a5d584d27d23bf4d50ed1fbc8d067faf67953b03f80705bfb9587c496d`. Independent editorial review fails: the page has a coherent throughline and sharp prose but no sustained adversarial narrative; opposing decision-makers, motives, responses, and countermoves are largely absent, scandal and public reaction are missing, lived costs remain abstract, and the result reads as polished minutes with conclusions. Its post-press correction notice has two items: `The corridor had begun closing hours earlier` overstates a source that says the prolonged oath-route closure was diverting arrivals six hours before the breach; `no relief or assignment of liability has followed` must narrow to `no tribunal remedy is recorded yet`. Run 75 launched at exact source `86fe6ed89d51da26b65ab6a031608075840b1527` under the superseded 240-cell-only acceptance shape and was stopped cleanly at the operator's scale correction. Preserve `/var/lib/gamecult/ghostlight-dungeon/acceptance/full-world-delvehold-86fe6ed-75` as stopped non-acceptance evidence: preflight, world-region and titled-elaboration checkpoints, a wave-one cell terminal checkpoint, partial pulses 01/02, and two rejected pulse receipts exist. `ghostlight-full-world-run75.service` invocation `86bfe6a3ef504a7d99f579b3d67710ab` is inactive/dead after explicit stop; live services remain unchanged. Do not claim terminal success or failure. Preserve Runs 64 through 75. Mechanical completion of the earlier world is proven, but final newspaper acceptance under the corrected scale target is not. - scale_checkpoint: The active 240-cell entitlement is an attention budget, not the world-size claim. The approximately 2,400 potentially acting entities are a target for causally meaningful latent complexity, not a raw population or roster count. Multiresolution Gestalts compress the unresolved population; repeated admitted elaboration must fission them and promote individuals and institutions whose agency, relationships, resources, pressures, or authority can actually participate in consequences, then remeasure the deficit. Exact pushed `df66ec989c1e44a7a8b21ed159e9589778426238` defines consumer-authored `WorldScaleIntent` and deterministic `WorldElaborationDemand`; at 240 cells and 1,000 cover basis points it derives a numeric 2,400-subject target, current-subject deficit, weighted per-realm shares, and bounded `round_mutation_budget`. Pushed `a017737` owns title-by-realm persistent logical elaborator sessions with agentic bounded compaction, compact mutation drafts, exact failed-dispatch-only resume, both Gestalt fission and grounded named-person promotion, WorldKernel-only commit, and post-round canonical remeasurement. Run 80 proved exact resource custody, and pushed `e7ceb2c` requires exact frozen resource and dormant-member assignment keys. Run 81's first accepted Hearthcoil fission then reached the canonical transition with its civic manifest still naming the removed parent's political relation. The current uncommitted cut makes the same fission transaction rebind resident population IDs and inherited political-relation IDs from the parent to every admitted child, removes the parent relation, and validates the component world atomically. Verification, review, commit/push, and provider resume remain pending. Resolution owns derived cover membership. Nemesis receives an existing cover and assigns bounded causal decision windows among eligible responders; it does not allocate that cover. + scale_checkpoint: The active 240-cell entitlement is an attention budget, not the world-size claim. The approximately 2,400 potentially acting entities are a target for causally meaningful latent complexity, not a raw population or roster count. Multiresolution Gestalts compress the unresolved population; repeated admitted elaboration must fission them and promote individuals and institutions whose agency, relationships, resources, pressures, or authority can actually participate in consequences, then remeasure the deficit. Exact pushed `df66ec989c1e44a7a8b21ed159e9589778426238` defines consumer-authored `WorldScaleIntent` and deterministic `WorldElaborationDemand`; at 240 cells and 1,000 cover basis points it derives a numeric 2,400-subject target, current-subject deficit, weighted per-realm shares, and bounded `round_mutation_budget`. Pushed `a017737` owns title-by-realm persistent logical elaborator sessions with agentic bounded compaction, compact mutation drafts, exact failed-dispatch-only resume, both Gestalt fission and grounded named-person promotion, WorldKernel-only commit, and post-round canonical remeasurement. Pushed `e7ceb2c` requires exact frozen resource and dormant-member assignment keys. Pushed `8a81ea2`, `36bcc84`, `92d6742`, `ca64b9c`, and `b4cc3a2` make fission atomically rebind civic residency and political relations, reconcile the one admitted legacy split, prove historical checkpoints independently from evolved current state, and bound lineage lookup by actual descendant IDs. Run 87 completed complexity rounds 1 through 5, including all 43 round-5 mutations and session checkpoints. Sequential session compaction was the observed scale bottleneck; the verified local cut runs independent compactions concurrently under the existing bounded parallelism while preserving per-session ownership and serial canonical mutation order. Resolution owns derived cover membership. Nemesis receives an existing cover and assigns bounded causal decision windows among eligible responders; it does not allocate that cover. presentation_checkpoint: The historical press-layout and seed-ownership split are complete. `notes/historical-newspaper-layout-grammar.md` remains the durable grammar. Manifest v2 at `output/tex/canopy-ledger-run-61-style-1847-flow-723.manifest.toml` independently binds `style_seed=1847`, `flow_seed=723`, frozen source SHA-256 `8f195140f52a40ba705d6a66987146a1500ae89668e5d82b01d1792eb3afb882`, and the final artifact `output/pdf/canopy-ledger-run-61-style-1847-flow-723.pdf`, SHA-256 `a457f4b1702a7a52480e42fce0039f0dbe677ff32958e98f1c412b346237190c`. An identical seed pair produces byte-identical TeX and PDF; changing only flow preserves the exact style section while materially changing a plausible layout, and changing only style preserves flow topology. Cut-first and cut-midstory templates pass visual inspection; the failed split-card template is deleted. Frozen copy/assets, actual PDF `/BM /Multiply`, and economic-layer advertising authority remain invariant. public_reference_checkpoint: Public architecture reference is complete. Canonical Ghostlight commit `15ea0f0` owns five pages under `docs/public-architecture` covering overview, authority, pipelines, 43 named production stages, and eight titled elaborators. Site commit `ea0b026` publishes exact projections under `F:\Projects\GhostlightDungeon-site\content\Documentation`, adds the sync/check script, explorer and table-of-contents navigation, scoped documentation layout, and homepage Architecture link. Local Quartz build and visual browser QA pass. GitHub Pages workflow `33408004480` succeeded. `https://ghostlight.gamecult.org/Documentation/` and the extensionless `Documentation/Agents-and-model-stages` route are live; the stage page exposes seven tables and 51 rows. Ghostlight remains technical authority; the site repository owns public composition and deployment. - next_action: Preserve Runs 75 through 81. Review and verify both civic-fission paths, run focused/full-package/strategic gates, then commit and push. Future fissions must atomically replace parent civic residency and relations inside the fission transaction. For the admitted Run 81 lineage, clone immutable Run 81 and invoke `ReconcileFissionCivicBindings` exactly once; it must accept only lineage-proven stale civic bindings, commit the deterministic repair with mutation proof and checkpoint, skip Patina `commit0001`, and rebase Charter. Do not replay any model call, fission mutation, admitted region/locality work, or unrelated dispatch. Require the reconciled Hearthcoil civic manifest to contain no parent reference before claiming complexity progress. Preserve title-by-realm logical sessions, bounded agentic compaction, failed-dispatch-only resume, post-round remeasurement, the 2,400-complexity target under 240-cell attention, Resolution cover ownership, Nemesis's bounded causal-window role, both live services, the completed public reference, the two-seed press checkpoint, and the economic-layer advertising boundary. + next_action: Preserve Runs 75 through 87. Run 87 is the live full-world pressure test at pushed `b4cc3a2`; it preserved the Patina fission, deterministic civic reconciliation, Charter commit, and failed-dispatch-only Hearth retry, then completed complexity rounds 1 through 5 including all 43 round-5 mutations and session checkpoints. Observe it without replay. On the next source-changing resume, use bounded parallel title-by-realm session compaction so independent committed journals do not serialize; retain the exact-source 35 MiB runner cache while deleting disposable compiler output. Continue until canonical remeasurement reaches 2,400 meaningful actionable subjects, then require ten strategic waves, publications, archive hashes, and unchanged live-service identities. Preserve Resolution cover ownership, Nemesis's bounded causal-window role, the completed public reference, the two-seed press checkpoint, and the economic-layer advertising boundary. gestalt_population: Gestalt Personas own shared population baselines; persistent member deltas own named individuality; WorldKernel materialization and approval-gated fission preserve lineage and identity. Materialisation/folding changes only representation and the exact member delta, advances resolution epoch, and retires the old cover; it has no Gestalt-wide effect authority. Selected actionable member exceptions are mandatory Projector perspective owners, so aggregation cannot silently erase their decision. Presence projection is limited to nearby active leaves and exact-location dormant members, includes reciprocal player relationship evidence, and may propose an earned cast without committing it. Simulation cells are derived covers only.