From a6b5833cdc62917a7592d3c286049e18e33d6901 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 22 Aug 2026 21:25:34 +0200 Subject: [PATCH] Demote payloadless legacy Session Zero questions --- crates/ghostlight-dungeon/src/session_zero.rs | 28 +++++++++---------- .../ghostlight-dungeon-session-zero.md | 10 ++++--- notes/ghostlight-current-system-map.md | 9 +++--- 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/crates/ghostlight-dungeon/src/session_zero.rs b/crates/ghostlight-dungeon/src/session_zero.rs index 17d8141..9b512e3 100644 --- a/crates/ghostlight-dungeon/src/session_zero.rs +++ b/crates/ghostlight-dungeon/src/session_zero.rs @@ -1119,7 +1119,7 @@ impl SessionZeroRegistry { let (row, mut state) = store .load::("session_zero.v1", &id.to_string())? .ok_or_else(|| anyhow!("session zero state vanished during load"))?; - if demote_legacy_optional_opening_suggestions(&mut state) { + if demote_legacy_nonmaterial_decisions(&mut state) { store.replace(&row, "ghostlight.session_zero.v1", &state)?; } found.insert( @@ -3264,7 +3264,7 @@ fn decision_has_typed_payload(decision: &SessionZeroDecision) -> bool { .is_some_and(|patch| patch != &CharacterDraftPatch::default()) } -fn demote_legacy_optional_opening_suggestions(state: &mut SessionZeroState) -> bool { +fn demote_legacy_nonmaterial_decisions(state: &mut SessionZeroState) -> bool { let mut changed = false; for decision in state.decisions.values_mut() { let generated_opening = decision.id.starts_with("opening:") @@ -3274,7 +3274,8 @@ fn demote_legacy_optional_opening_suggestions(state: &mut SessionZeroState) -> b && decision .prompt .ends_with("' as the starting frame for further Session Zero discussion?"); - if generated_opening && decision.material { + let payloadless_question = !decision_has_typed_payload(decision); + if decision.material && (generated_opening || payloadless_question) { decision.material = false; changed = true; } @@ -4277,32 +4278,29 @@ mod tests { }, ); - assert!(demote_legacy_optional_opening_suggestions(&mut draft)); + assert!(demote_legacy_nonmaterial_decisions(&mut draft)); assert!(!draft.decisions["opening:legacy"].material); assert_eq!(draft.revision, revision); assert_eq!(draft.shared_epoch, shared_epoch); - assert!(!demote_legacy_optional_opening_suggestions(&mut draft)); + assert!(!demote_legacy_nonmaterial_decisions(&mut draft)); } #[tokio::test] - async fn registry_load_persists_the_legacy_opening_demotion() { + async fn registry_load_persists_the_payloadless_question_demotion() { let root = tempdir().unwrap(); let mut draft = state(); let id = draft.id; let revision = draft.revision; draft.decisions.insert( - "opening:persisted-legacy".into(), + "decision:persisted-legacy-question".into(), SessionZeroDecision { schema: "ghostlight.session_zero_decision.v1".into(), - id: "opening:persisted-legacy".into(), + id: "decision:persisted-legacy-question".into(), owner_member_id: None, - prompt: "Use 'Persisted Legacy' as the starting frame for further Session Zero discussion?".into(), - proposed_resolution: "An old optional suggestion.".into(), + prompt: "Which campaign aspiration should lead?".into(), + proposed_resolution: "Choose one of two discussion prompts.".into(), proposed_extraordinary_permission: None, - proposed_contract_patch: Some(CampaignContractPatch { - premise: Some("An opening the player may ignore".into()), - ..Default::default() - }), + proposed_contract_patch: None, proposed_character_patch: None, evidence_receipt_ids: vec![], pending_counter: None, @@ -4319,7 +4317,7 @@ mod tests { let registry = SessionZeroRegistry::new(root.path()).unwrap(); registry.load_existing().await.unwrap(); let loaded = registry.snapshot(id).await.unwrap(); - assert!(!loaded.decisions["opening:persisted-legacy"].material); + assert!(!loaded.decisions["decision:persisted-legacy-question"].material); assert_eq!(loaded.revision, revision); } diff --git a/docs/architecture/ghostlight-dungeon-session-zero.md b/docs/architecture/ghostlight-dungeon-session-zero.md index f74d0b8..39663a0 100644 --- a/docs/architecture/ghostlight-dungeon-session-zero.md +++ b/docs/architecture/ghostlight-dungeon-session-zero.md @@ -79,10 +79,12 @@ receipts unchanged. Generated opening and role suggestions are non-material decisions: the player may accept, counter, discuss, or ignore them without blocking a fully custom -draft. On daemon load, the registry demotes pre-cut generated opening records -whose old `material` flag would otherwise veto a custom draft; this migration -uses an exact CultCache replacement and does not advance the Session Zero -revision or shared epoch. Material decisions preserve the distinction between discussion and consent. +draft. On daemon load, the registry demotes pre-cut payloadless questions and +generated opening records whose old `material` flags would otherwise veto a +custom draft. A payloadless question cannot own compilation readiness because +it has no typed change to accept. This migration uses an exact CultCache +replacement and does not advance the Session Zero revision or shared epoch. +Material decisions preserve the distinction between discussion and consent. Every acceptable decision carries at least one non-empty typed contract, character, or extraordinary-permission payload. A question or a prose promise without an exact state change remains DM speech or a suggested reply; it cannot diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index b5311cb..ec9a12d 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -575,10 +575,11 @@ assumptions, public party cards, and only the current viewer's private ledger. Generated openings are optional shared typed decisions; accepting one amends the draft for discussion and triggers three optional grounded role decisions in each private DM channel. Ignoring them cannot block a custom start or character. -At registry load, exact legacy `opening:*` suggestion records from the pre-cut -runtime are demoted from material to optional with a CultCache compare-and-swap; -fictional revision and shared epoch do not move. The persisted typed draft, -not stale suggestion materiality, owns compilation readiness. +At registry load, exact legacy `opening:*` suggestions and payloadless question +records from the pre-cut runtime are demoted from material to optional with a +CultCache compare-and-swap; fictional revision and shared epoch do not move. +Payloadless prose cannot own compilation readiness. The persisted typed draft, +not stale suggestion materiality, owns that gate. Custom starts and characters use the same draft. The browser returns only decision commands and cannot echo a rewritten candidate into compilation. Candidate IDs, text, list sizes, and evidence references receive local