From 139b8a69bc297e406ed5aea45574ea5e5724c685 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 30 Aug 2026 07:42:06 +0200 Subject: [PATCH] Bound newsroom context and resume accepted filings --- crates/ghostlight-dungeon/src/agent.rs | 64 +- crates/ghostlight-dungeon/src/newspaper.rs | 878 +++++++++++++++++++-- notes/fresh-workspace-handoff.md | 40 +- notes/ghostlight-current-system-map.md | 141 +++- state/evidence.jsonl | 3 +- state/ghostlight-state.cultcache.jsonl | 1 + state/map.yaml | 8 +- 7 files changed, 1032 insertions(+), 103 deletions(-) diff --git a/crates/ghostlight-dungeon/src/agent.rs b/crates/ghostlight-dungeon/src/agent.rs index f29d72f..dfe0ac0 100644 --- a/crates/ghostlight-dungeon/src/agent.rs +++ b/crates/ghostlight-dungeon/src/agent.rs @@ -116,6 +116,15 @@ pub trait ModelAgentTool: Send { /// rejected action can narrow the next call to the exact repair surface. fn action_schema(&self) -> std::result::Result; + /// Projects the private workbench state needed for the next semantic step. + /// Tools that return a snapshot replace accumulated model chatter and old + /// observations with this bounded state. The harness preserves the stable + /// instruction prefix, while the tool remains the owner of what working + /// memory the agent actually needs. + fn context_snapshot(&self) -> Option { + None + } + async fn invoke( &mut self, action: Self::Action, @@ -147,10 +156,20 @@ pub async fn run_model_agent_progress( } let mut receipts = Vec::new(); - let mut input = vec![ModelInputItem::user(format!( - "{}\n\nAGENT STEP: 1 of {}. Choose one typed tool action admitted by the current output schema. The harness will execute it against the frozen state and return the real tool observation. Do not claim success yourself; only an accepted tool result can end the task.", - spec.instructions, spec.max_steps - ))]; + let mut input = if tool.context_snapshot().is_some() { + vec![ + ModelInputItem::user(spec.instructions.clone()), + ModelInputItem::user(format!( + "AGENT STEP: 1 of {}. Choose one typed tool action admitted by the current output schema. The harness will execute it against the frozen state and return the real tool observation. Do not claim success yourself; only an accepted tool result can end the task.", + spec.max_steps + )), + ] + } else { + vec![ModelInputItem::user(format!( + "{}\n\nAGENT STEP: 1 of {}. Choose one typed tool action admitted by the current output schema. The harness will execute it against the frozen state and return the real tool observation. Do not claim success yourself; only an accepted tool result can end the task.", + spec.instructions, spec.max_steps + ))] + }; let mut last_observation = None; for step in 0..spec.max_steps { let action_schema = match tool.action_schema() { @@ -259,13 +278,14 @@ pub async fn run_model_agent_progress( return Err(ModelAgentFailure { message, receipts }); } }; - append_agent_observation( + update_agent_context( &mut input, &stage.narrative, step, spec.max_steps, "continued", &observation, + tool.context_snapshot(), ); last_observation = Some(observation); receipts.push(stage.receipt); @@ -300,13 +320,14 @@ pub async fn run_model_agent_progress( } }; mark_model_receipt_semantic_invalid(&mut stage.receipt, &finding); - append_agent_observation( + update_agent_context( &mut input, &stage.narrative, step, spec.max_steps, "rejected", &finding, + tool.context_snapshot(), ); last_observation = Some(finding); receipts.push(stage.receipt); @@ -367,6 +388,37 @@ fn append_agent_observation( } } +fn update_agent_context( + input: &mut Vec, + assistant_output: &str, + step: usize, + max_steps: usize, + status: &str, + observation: &serde_json::Value, + context_snapshot: Option, +) { + match context_snapshot { + Some(snapshot) if step + 1 < max_steps => { + input.truncate(1); + input.push(ModelInputItem::user(format!( + "AGENT STEP: {} of {max_steps}. Return the next complete typed tool action. The private workbench has replaced prior model chatter with its current bounded state. Preserve frozen identity and useful admitted work; change only what the latest observation actually rejects or requests.\n\nCURRENT WORKBENCH STATE:\n{}\n\nLATEST TOOL OBSERVATION AFTER AGENT STEP {} ({status}):\n{}", + step + 2, + serde_json::to_string(&snapshot).unwrap_or_else(|_| "null".into()), + step + 1, + serde_json::to_string(observation).unwrap_or_else(|_| "null".into()), + ))); + } + _ => append_agent_observation( + input, + assistant_output, + step, + max_steps, + status, + observation, + ), + } +} + #[cfg(test)] mod tests { use super::*; diff --git a/crates/ghostlight-dungeon/src/newspaper.rs b/crates/ghostlight-dungeon/src/newspaper.rs index 89143f0..78c5e7a 100644 --- a/crates/ghostlight-dungeon/src/newspaper.rs +++ b/crates/ghostlight-dungeon/src/newspaper.rs @@ -27,7 +27,7 @@ use std::{ const MAX_FRONT_PAGE_ARTICLES: usize = 6; const MAX_PUBLIC_RECORD_QUERY_RESULTS: usize = 24; const MAX_NARRATIVE_SELECTION_STEPS: usize = 12; -const NEWSROOM_CONTRACT_VERSION: &str = "character-newsroom.v9"; +const NEWSROOM_CONTRACT_VERSION: &str = "character-newsroom.v10"; const EDITION_LABEL: &str = "Current Edition"; const ALLOWED_SECTIONS: [&str; 6] = [ "Front Page", @@ -300,6 +300,34 @@ struct WorldNewspaperCloseCheckpoint { receipt_chain_digest: String, } +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(tag = "stage", rename_all = "snake_case", deny_unknown_fields)] +enum WorldNewspaperProductionContent { + EditorialAgenda { + editorial_agenda: WorldNewspaperEditorialAgenda, + }, + FiledArticle { + agenda_checkpoint_id: String, + article_index: u16, + assignment_digest: String, + journalist_id: String, + article: EditorialArticleDraft, + }, +} + +#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] +#[serde(deny_unknown_fields)] +struct WorldNewspaperProductionCheckpoint { + schema: String, + id: String, + publication_task_binding: String, + editorial_binding: String, + content: WorldNewspaperProductionContent, + model_receipt_ids: Vec, + receipt_chain_digest: String, + content_digest: String, +} + #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] #[serde(deny_unknown_fields)] struct PersistedWorldNewspaperComposition { @@ -390,6 +418,10 @@ enum NarrativeSelectionCommand { #[schemars(range(min = 1, max = 24))] limit: u8, }, + FetchPublicRecords { + #[schemars(length(min = 1, max = 24))] + record_ids: Vec, + }, ProposeAgenda { #[schemars(length(min = 1, max = 500))] dominant_throughline: String, @@ -472,6 +504,23 @@ struct EditorialSupportingRecord { headline: String, } +#[derive(Clone, Debug, Serialize, PartialEq, Eq)] +struct EditorialRecordIndexEntry { + record_id: String, + at: DateTime, + channel: String, + headline: String, + named_entities: Vec, +} + +#[derive(Clone, Debug, Serialize, PartialEq, Eq)] +struct NarrativeSelectionContextSnapshot { + inspected_record_count: usize, + completed_query_count: usize, + inspected_records: Vec, + pending_agenda_token: Option, +} + struct NarrativeSelectionWorkbench<'a> { records: &'a [PublicRecordProjection], newsroom: &'a WorldNewspaperNewsroom, @@ -539,6 +588,7 @@ impl NarrativeSelectionWorkbench<'_> { .collect::>(); self.visible_record_ids .extend(records.iter().map(|record| record.record_id.clone())); + self.pending_agenda = None; let next_cursor = (matching.len() > records.len()) .then(|| records.last().map(|record| record.record_id.clone())) .flatten(); @@ -548,6 +598,88 @@ impl NarrativeSelectionWorkbench<'_> { }) } + fn fetch_records(&mut self, mut record_ids: Vec) -> Result { + for record_id in &mut record_ids { + *record_id = record_id.trim().to_owned(); + if record_id.is_empty() + || record_id.chars().count() > 240 + || record_id.chars().any(char::is_control) + { + return Err(anyhow!("public record ID is malformed")); + } + } + record_ids.sort(); + record_ids.dedup(); + if record_ids.is_empty() || record_ids.len() > MAX_PUBLIC_RECORD_QUERY_RESULTS { + return Err(anyhow!( + "exact public-record fetch is outside the bounded response" + )); + } + let known = self + .records + .iter() + .map(|record| (record.record_id.as_str(), record)) + .collect::>(); + let records = record_ids + .iter() + .map(|record_id| { + known + .get(record_id.as_str()) + .map(|record| (*record).clone()) + .ok_or_else(|| { + anyhow!("exact public-record fetch names unknown record {record_id}") + }) + }) + .collect::>>()?; + self.visible_record_ids + .extend(records.iter().map(|record| record.record_id.clone())); + self.pending_agenda = None; + Ok(NarrativeSelectionFinding::QueryResult { + records, + next_cursor: None, + }) + } + + fn context(&self) -> NarrativeSelectionContextSnapshot { + let inspected_records = self + .records + .iter() + .filter(|record| self.visible_record_ids.contains(&record.record_id)) + .map(|record| { + let named_entities = record + .facts + .iter() + .flat_map(|fact| { + fact.named_people + .iter() + .map(|person| person.name.clone()) + .chain(fact.institutions.iter().cloned()) + .chain(fact.populations.iter().cloned()) + .chain(fact.places.iter().cloned()) + }) + .collect::>() + .into_iter() + .collect(); + EditorialRecordIndexEntry { + record_id: record.record_id.clone(), + at: record.at, + channel: record.channel.clone(), + headline: record.headline.clone(), + named_entities, + } + }) + .collect(); + NarrativeSelectionContextSnapshot { + inspected_record_count: self.visible_record_ids.len(), + completed_query_count: self.completed_queries.len(), + inspected_records, + pending_agenda_token: self + .pending_agenda + .as_ref() + .map(|(digest, _)| digest.clone()), + } + } + fn propose_agenda( &mut self, agenda: WorldNewspaperEditorialAgenda, @@ -806,6 +938,21 @@ impl ModelAgentTool for NarrativeSelectionWorkbench<'_> { }); let commands = vec![ query_schema, + serde_json::json!({ + "type":"object", + "additionalProperties":false, + "required":["tool","record_ids"], + "properties":{ + "tool":{"const":"fetch_public_records"}, + "record_ids":{ + "type":"array", + "minItems":1, + "maxItems":MAX_PUBLIC_RECORD_QUERY_RESULTS, + "uniqueItems":true, + "items":{"type":"string","minLength":1,"maxLength":240} + } + } + }), propose_schema, serde_json::json!({ "type":"object", @@ -829,6 +976,10 @@ impl ModelAgentTool for NarrativeSelectionWorkbench<'_> { Ok(schema) } + fn context_snapshot(&self) -> Option { + serde_json::to_value(self.context()).ok() + } + async fn invoke( &mut self, action: Self::Action, @@ -865,6 +1016,20 @@ impl ModelAgentTool for NarrativeSelectionWorkbench<'_> { receipts: Vec::new(), }, }, + NarrativeSelectionCommand::FetchPublicRecords { record_ids } => { + match self.fetch_records(record_ids) { + Ok(observation) => ModelAgentToolOutcome::Continue { + observation, + receipts: Vec::new(), + }, + Err(error) => ModelAgentToolOutcome::Rejected { + finding: NarrativeSelectionFinding::QueryRejected { + reason: error.to_string().chars().take(500).collect(), + }, + receipts: Vec::new(), + }, + } + } NarrativeSelectionCommand::ProposeAgenda { dominant_throughline, reader_stake, @@ -1149,6 +1314,18 @@ impl ModelAgentTool for JournalistWorkbench<'_> { type Finding = JournalistFinding; fn action_schema(&self) -> std::result::Result { + let mut datelines = self + .records + .iter() + .filter(|record| self.citations.contains(&record.record_id)) + .flat_map(|record| record.facts.iter()) + .flat_map(|fact| fact.places.iter().cloned()) + .collect::>() + .into_iter() + .collect::>(); + if self.article_index > 0 || datelines.is_empty() { + datelines.insert(0, String::new()); + } let mut schema = serde_json::json!({ "type":"object", "additionalProperties":false, @@ -1157,7 +1334,7 @@ impl ModelAgentTool for JournalistWorkbench<'_> { "tool":{"const":"file_story"}, "headline":{"type":"string","minLength":1,"maxLength":100}, "deck":{"type":"string","minLength":1,"maxLength":220}, - "dateline":{"type":"string","maxLength":100}, + "dateline":{"type":"string","enum":datelines}, "paragraphs":{ "type":"array", "minItems":2, @@ -1337,7 +1514,7 @@ async fn select_editorial_agenda( "journalists": &prepared.newsroom.journalists, }); let instructions = format!( - "You are {editor}, assignment editor of `{title}`. Investigate its frozen public ledger with query_public_records, then assign a page. An empty query browses; terms, exact entity names, status, channel, and an inspected cursor narrow or page. Cite only returned record IDs. Search backward when procedure hides the rupture and sideways for opposition, countermoves, reaction, scandal, and lived cost.\n\nChoose one dominant throughline, then only stories that sharpen or complicate it. The first pitch is the Front Page lead; later pitches use another allowed section. For every pitch choose the staff journalist whose biases and preferences will produce the strongest treatment. Give that journalist the exact record grouping, one focus record that the lede cannot bury, a pointed narrative claim, the live tension, and the public question. A routine update to a vivid continuing incident should cite both and say what changed. Remembering, filing, warning, and planning are context unless they themselves produce a public consequence. Editorial frames may insinuate and judge but cannot invent concrete facts. The copy editor, not you or the reporters, owns fact checking.\n\nPropose before committing. The workbench returns the lead beside what it would bury; revise or query again if the proof exposes a stronger page.\n\nPUBLICATION VOICE:\n{voice}\n\nSTAFF BOOK:\n{staff}", + "You are {editor}, assignment editor of `{title}`. Investigate its frozen public ledger with query_public_records, then assign a page. An empty query browses; terms, exact entity names, status, channel, and an inspected cursor narrow or page. The workbench keeps a compact index of inspected records instead of replaying old query pages; use fetch_public_records with exact IDs when you need their full facts again. Cite only returned record IDs. Search backward when procedure hides the rupture and sideways for opposition, countermoves, reaction, scandal, and lived cost.\n\nChoose one dominant throughline, then only stories that sharpen or complicate it. The first pitch is the Front Page lead; later pitches use another allowed section. For every pitch choose the staff journalist whose biases and preferences will produce the strongest treatment. Give that journalist the exact record grouping, one focus record that the lede cannot bury, a pointed narrative claim, the live tension, and the public question. A routine update to a vivid continuing incident should cite both and say what changed. Remembering, filing, warning, and planning are context unless they themselves produce a public consequence. Editorial frames may insinuate and judge but cannot invent concrete facts. The copy editor, not you or the reporters, owns fact checking.\n\nPropose before committing. The workbench returns the lead beside what it would bury; revise or query again if the proof exposes a stronger page.\n\nPUBLICATION VOICE:\n{voice}\n\nSTAFF BOOK:\n{staff}", editor = prepared.newsroom.assignment_editor.name, title = prepared.title, voice = prepared.editorial_voice, @@ -1378,11 +1555,357 @@ fn editorial_page_digest(draft: &EditorialPageDraft) -> Result { )) } +fn production_agenda_checkpoint_id(prepared: &PreparedNewspaper) -> Result { + Ok(format!( + "newspaper-production-agenda:sha256:{:x}", + Sha256::digest(rmp_serde::to_vec_named(&( + "editorial_agenda", + &prepared.publication_task_binding, + &prepared.binding, + ))?) + )) +} + +fn reporter_assignment_digest( + prepared: &PreparedNewspaper, + agenda_checkpoint_id: &str, + article_index: usize, + pitch: &WorldNewspaperStoryPitch, + journalist: &WorldNewspaperJournalist, +) -> Result { + Ok(format!( + "sha256:{:x}", + Sha256::digest(rmp_serde::to_vec_named(&( + &prepared.publication_task_binding, + &prepared.binding, + agenda_checkpoint_id, + article_index, + pitch, + journalist, + ))?) + )) +} + +fn production_article_checkpoint_id( + prepared: &PreparedNewspaper, + agenda_checkpoint_id: &str, + article_index: usize, + assignment_digest: &str, +) -> Result { + Ok(format!( + "newspaper-production-article:sha256:{:x}", + Sha256::digest(rmp_serde::to_vec_named(&( + &prepared.publication_task_binding, + &prepared.binding, + agenda_checkpoint_id, + article_index, + assignment_digest, + ))?) + )) +} + +fn load_model_receipts( + store: &CampaignStore, + receipt_ids: &[String], + owner: &str, +) -> Result> { + receipt_ids + .iter() + .map(|receipt_id| { + store + .load::("persona_stage_receipt.v1", receipt_id)? + .map(|(_, receipt)| receipt) + .ok_or_else(|| anyhow!("{owner} lost model receipt {receipt_id}")) + }) + .collect() +} + +fn validate_production_receipts( + checkpoint: &WorldNewspaperProductionCheckpoint, + receipts: &[ModelStageReceipt], + expected_stage: &str, + expected_snapshot_binding: &str, +) -> Result<()> { + let receipt_ids = receipts + .iter() + .map(|receipt| receipt.storage_key().to_owned()) + .collect::>(); + if receipts.is_empty() + || receipt_ids != checkpoint.model_receipt_ids + || receipt_ids.iter().collect::>().len() != receipt_ids.len() + || checkpoint_receipt_chain_digest(&receipt_ids)? != checkpoint.receipt_chain_digest + || production_checkpoint_content_digest( + &checkpoint.publication_task_binding, + &checkpoint.editorial_binding, + &checkpoint.content, + &checkpoint.model_receipt_ids, + &checkpoint.receipt_chain_digest, + )? != checkpoint.content_digest + || receipts.iter().any(|receipt| { + receipt.stage != expected_stage || receipt.snapshot_binding != expected_snapshot_binding + }) + || receipts + .last() + .is_none_or(|receipt| receipt.validation_result != "valid") + { + return Err(anyhow!( + "newspaper production checkpoint receipt binding is invalid" + )); + } + Ok(()) +} + +fn production_checkpoint_content_digest( + publication_task_binding: &str, + editorial_binding: &str, + content: &WorldNewspaperProductionContent, + model_receipt_ids: &[String], + receipt_chain_digest: &str, +) -> Result { + Ok(format!( + "sha256:{:x}", + Sha256::digest(rmp_serde::to_vec_named(&( + publication_task_binding, + editorial_binding, + content, + model_receipt_ids, + receipt_chain_digest, + ))?) + )) +} + +fn persist_production_checkpoint( + store: &CampaignStore, + checkpoint: &WorldNewspaperProductionCheckpoint, + receipts: &[ModelStageReceipt], +) -> Result<()> { + store.persist_model_stage_receipts(receipts)?; + store.insert( + "world_newspaper_production_checkpoint.v1", + "ghostlight.world_newspaper_production_checkpoint.v1", + &checkpoint.id, + checkpoint, + )?; + Ok(()) +} + +fn new_agenda_checkpoint( + prepared: &PreparedNewspaper, + agenda: WorldNewspaperEditorialAgenda, + receipts: &[ModelStageReceipt], +) -> Result { + let model_receipt_ids = receipts + .iter() + .map(|receipt| receipt.storage_key().to_owned()) + .collect::>(); + let content = WorldNewspaperProductionContent::EditorialAgenda { + editorial_agenda: agenda, + }; + let receipt_chain_digest = checkpoint_receipt_chain_digest(&model_receipt_ids)?; + let content_digest = production_checkpoint_content_digest( + &prepared.publication_task_binding, + &prepared.binding, + &content, + &model_receipt_ids, + &receipt_chain_digest, + )?; + Ok(WorldNewspaperProductionCheckpoint { + schema: "ghostlight.world_newspaper_production_checkpoint.v1".into(), + id: production_agenda_checkpoint_id(prepared)?, + publication_task_binding: prepared.publication_task_binding.clone(), + editorial_binding: prepared.binding.clone(), + content, + receipt_chain_digest, + model_receipt_ids, + content_digest, + }) +} + +fn load_agenda_checkpoint( + store: &CampaignStore, + prepared: &PreparedNewspaper, + max_articles: usize, +) -> Result< + Option<( + String, + WorldNewspaperEditorialAgenda, + Vec, + )>, +> { + let id = production_agenda_checkpoint_id(prepared)?; + let Some((_, checkpoint)) = store.load::( + "world_newspaper_production_checkpoint.v1", + &id, + )? + else { + return Ok(None); + }; + let receipts = load_model_receipts(store, &checkpoint.model_receipt_ids, "agenda checkpoint")?; + let WorldNewspaperProductionContent::EditorialAgenda { editorial_agenda } = &checkpoint.content + else { + return Err(anyhow!( + "agenda checkpoint occupies the wrong production slot" + )); + }; + if checkpoint.schema != "ghostlight.world_newspaper_production_checkpoint.v1" + || checkpoint.id != id + || checkpoint.publication_task_binding != prepared.publication_task_binding + || checkpoint.editorial_binding != prepared.binding + { + return Err(anyhow!("newspaper agenda checkpoint identity is invalid")); + } + validate_production_receipts( + &checkpoint, + &receipts, + "newspaper_narrative_selection_agent_action", + &prepared.binding, + )?; + validate_editorial_agenda( + &prepared.records, + &prepared.newsroom, + editorial_agenda, + max_articles, + )?; + Ok(Some((id, editorial_agenda.clone(), receipts))) +} + +fn new_article_checkpoint( + prepared: &PreparedNewspaper, + agenda_checkpoint_id: &str, + article_index: usize, + pitch: &WorldNewspaperStoryPitch, + journalist: &WorldNewspaperJournalist, + article: EditorialArticleDraft, + receipts: &[ModelStageReceipt], +) -> Result { + let assignment_digest = reporter_assignment_digest( + prepared, + agenda_checkpoint_id, + article_index, + pitch, + journalist, + )?; + let model_receipt_ids = receipts + .iter() + .map(|receipt| receipt.storage_key().to_owned()) + .collect::>(); + let id = production_article_checkpoint_id( + prepared, + agenda_checkpoint_id, + article_index, + &assignment_digest, + )?; + let content = WorldNewspaperProductionContent::FiledArticle { + agenda_checkpoint_id: agenda_checkpoint_id.into(), + article_index: article_index + .try_into() + .map_err(|_| anyhow!("newspaper article index overflow"))?, + assignment_digest, + journalist_id: journalist.staff.id.clone(), + article, + }; + let receipt_chain_digest = checkpoint_receipt_chain_digest(&model_receipt_ids)?; + let content_digest = production_checkpoint_content_digest( + &prepared.publication_task_binding, + &prepared.binding, + &content, + &model_receipt_ids, + &receipt_chain_digest, + )?; + Ok(WorldNewspaperProductionCheckpoint { + schema: "ghostlight.world_newspaper_production_checkpoint.v1".into(), + id, + publication_task_binding: prepared.publication_task_binding.clone(), + editorial_binding: prepared.binding.clone(), + content, + receipt_chain_digest, + model_receipt_ids, + content_digest, + }) +} + +fn load_article_checkpoint( + store: &CampaignStore, + prepared: &PreparedNewspaper, + agenda_checkpoint_id: &str, + article_index: usize, + pitch: &WorldNewspaperStoryPitch, + journalist: &WorldNewspaperJournalist, +) -> Result)>> { + let assignment_digest = reporter_assignment_digest( + prepared, + agenda_checkpoint_id, + article_index, + pitch, + journalist, + )?; + let id = production_article_checkpoint_id( + prepared, + agenda_checkpoint_id, + article_index, + &assignment_digest, + )?; + let Some((_, checkpoint)) = store.load::( + "world_newspaper_production_checkpoint.v1", + &id, + )? + else { + return Ok(None); + }; + let receipts = load_model_receipts(store, &checkpoint.model_receipt_ids, "article checkpoint")?; + let WorldNewspaperProductionContent::FiledArticle { + agenda_checkpoint_id: stored_agenda_checkpoint_id, + article_index: stored_article_index, + assignment_digest: stored_assignment_digest, + journalist_id, + article, + } = &checkpoint.content + else { + return Err(anyhow!( + "article checkpoint occupies the wrong production slot" + )); + }; + let snapshot_binding = format!( + "{}:journalist:{}:article:{}", + prepared.binding, journalist.staff.id, article_index + ); + if checkpoint.schema != "ghostlight.world_newspaper_production_checkpoint.v1" + || checkpoint.id != id + || checkpoint.publication_task_binding != prepared.publication_task_binding + || checkpoint.editorial_binding != prepared.binding + || stored_agenda_checkpoint_id != agenda_checkpoint_id + || usize::from(*stored_article_index) != article_index + || stored_assignment_digest != &assignment_digest + || journalist_id != &journalist.staff.id + { + return Err(anyhow!("newspaper article checkpoint identity is invalid")); + } + validate_production_receipts( + &checkpoint, + &receipts, + "newspaper_journalist_agent_action", + &snapshot_binding, + )?; + validate_editorial_article(&prepared.records, article, article_index)?; + if article.section != pitch.section + || article.byline != journalist.byline + || article.citations.iter().collect::>() + != pitch.citations.iter().collect::>() + { + return Err(anyhow!( + "newspaper article checkpoint changed its exact assignment" + )); + } + Ok(Some((article.clone(), receipts))) +} + async fn run_assigned_journalists( model: &dyn ModelPort, prepared: &PreparedNewspaper, agenda: &WorldNewspaperEditorialAgenda, + agenda_checkpoint_id: &str, selection_receipts: &[ModelStageReceipt], + store: &CampaignStore, ) -> std::result::Result< (EditorialPageDraft, Vec), crate::agent::ModelAgentFailure, @@ -1399,6 +1922,27 @@ async fn run_assigned_journalists( }); } }; + match load_article_checkpoint( + store, + prepared, + agenda_checkpoint_id, + index, + pitch, + journalist, + ) { + Ok(Some((article, article_receipts))) => { + articles.push(article); + receipts.extend(article_receipts); + continue; + } + Ok(None) => {} + Err(error) => { + return Err(crate::agent::ModelAgentFailure { + message: error.to_string(), + receipts, + }); + } + } let selected = pitch.citations.iter().cloned().collect::>(); let source_json = serde_json::to_string(&public_records_for_ids(&prepared.records, &selected)) @@ -1453,13 +1997,50 @@ async fn run_assigned_journalists( }; match crate::agent::run_model_agent(model, &spec, &mut workbench).await { Ok(run) => { + let checkpoint = match new_article_checkpoint( + prepared, + agenda_checkpoint_id, + index, + pitch, + journalist, + run.output.clone(), + &run.receipts, + ) { + Ok(checkpoint) => checkpoint, + Err(error) => { + let mut failed_receipts = receipts; + failed_receipts.extend(run.receipts); + return Err(crate::agent::ModelAgentFailure { + message: error.to_string(), + receipts: failed_receipts, + }); + } + }; + if let Err(error) = persist_production_checkpoint(store, &checkpoint, &run.receipts) + { + let mut failed_receipts = receipts; + failed_receipts.extend(run.receipts); + return Err(crate::agent::ModelAgentFailure { + message: error.to_string(), + receipts: failed_receipts, + }); + } articles.push(run.output); receipts.extend(run.receipts); } Err(mut failure) => { + let persistence_error = store + .persist_model_stage_receipts(&failure.receipts) + .err() + .map(|error| error.to_string()); receipts.append(&mut failure.receipts); return Err(crate::agent::ModelAgentFailure { - message: failure.message, + message: persistence_error.map_or(failure.message.clone(), |error| { + format!( + "{}; failed to persist rejected journalist receipts: {error}", + failure.message + ) + }), receipts, }); } @@ -1699,16 +2280,7 @@ fn load_close_checkpoint( )); } let checkpoint = checkpoints.into_iter().next().expect("one checkpoint"); - let receipts = checkpoint - .model_receipt_ids - .iter() - .map(|receipt_id| { - store - .load::("persona_stage_receipt.v1", receipt_id)? - .map(|(_, receipt)| receipt) - .ok_or_else(|| anyhow!("newspaper close lost model receipt {receipt_id}")) - }) - .collect::>>()?; + let receipts = load_model_receipts(store, &checkpoint.model_receipt_ids, "newspaper close")?; validate_close_checkpoint(&checkpoint, prepared, max_articles, &receipts)?; Ok(Some((checkpoint, receipts))) } @@ -1799,16 +2371,8 @@ fn validate_persisted_composition( )? .map(|(_, checkpoint)| checkpoint) .ok_or_else(|| anyhow!("persisted newspaper close checkpoint is missing"))?; - let checkpoint_receipts = checkpoint - .model_receipt_ids - .iter() - .map(|receipt_id| { - store - .load::("persona_stage_receipt.v1", receipt_id)? - .map(|(_, receipt)| receipt) - .ok_or_else(|| anyhow!("persisted newspaper lost model receipt {receipt_id}")) - }) - .collect::>>()?; + let checkpoint_receipts = + load_model_receipts(store, &checkpoint.model_receipt_ids, "persisted newspaper")?; validate_close_checkpoint(&checkpoint, prepared, max_articles, &checkpoint_receipts)?; if composition.model_receipts.len() != checkpoint_receipts.len() + 1 || !composition.model_receipts.starts_with(&checkpoint_receipts) @@ -2083,20 +2647,37 @@ pub async fn advance_world_newspaper( )?; return Ok(composition); } - let agenda_run = select_editorial_agenda(model, &prepared, max_articles) - .await - .map_err(|failure| composition_failure(failure.message, failure.receipts))?; - let agenda = agenda_run.output; + let (agenda_checkpoint_id, agenda, mut receipts) = + if let Some(checkpoint) = load_agenda_checkpoint(store, &prepared, max_articles)? { + checkpoint + } else { + let agenda_run = match select_editorial_agenda(model, &prepared, max_articles).await { + Ok(run) => run, + Err(failure) => { + store.persist_model_stage_receipts(&failure.receipts)?; + return Err(composition_failure(failure.message, failure.receipts)); + } + }; + let checkpoint = + new_agenda_checkpoint(&prepared, agenda_run.output.clone(), &agenda_run.receipts)?; + persist_production_checkpoint(store, &checkpoint, &agenda_run.receipts)?; + (checkpoint.id, agenda_run.output, agenda_run.receipts) + }; let selected_source_json = source_json_for_agenda(&prepared.records, Some(&agenda))?; - let mut receipts = agenda_run.receipts; - let (draft, journalist_receipts) = - run_assigned_journalists(model, &prepared, &agenda, &receipts) - .await - .map_err(|failure| { - let mut all_receipts = receipts.clone(); - all_receipts.extend(failure.receipts); - composition_failure(failure.message, all_receipts) - })?; + let (draft, journalist_receipts) = run_assigned_journalists( + model, + &prepared, + &agenda, + &agenda_checkpoint_id, + &receipts, + store, + ) + .await + .map_err(|failure| { + let mut all_receipts = receipts.clone(); + all_receipts.extend(failure.receipts); + composition_failure(failure.message, all_receipts) + })?; receipts.extend(journalist_receipts); validate_editorial_draft(&prepared.records, &draft, max_articles)?; validate_editorial_alignment(&draft, &prepared.newsroom, &agenda)?; @@ -3455,6 +4036,8 @@ mod tests { const ONE_STORY_AGENDA: &str = r#"{"command":{"tool":"propose_agenda","dominant_throughline":"The court made its private gambling debt a public crisis of custody and punished the official who exposed it.","reader_stake":"Readers must decide whether dismissal protects the seal or merely the court from its own confession.","story_pitches":[{"lead":true,"section":"Front Page","journalist_id":"aven-tarl","citations":["news:seal-scandal"],"focus_citation":"news:seal-scandal","narrative_claim":"The pawned royal seal and the treasurer's dismissal are one scandal.","tension":"The court admits the loss while directing the immediate consequence at the bearer of that admission.","public_question":"Who is being held accountable for the missing seal?"}]}}"#; const TWO_STORY_AGENDA: &str = r#"{"command":{"tool":"propose_agenda","dominant_throughline":"Court custody fails at both the royal seal and the western gate.","reader_stake":"Readers depend on institutions that announce damage only after access or authority has already been compromised.","story_pitches":[{"lead":true,"section":"Front Page","journalist_id":"aven-tarl","citations":["news:seal-scandal"],"focus_citation":"news:seal-scandal","narrative_claim":"The pawned seal and dismissal are the court's crisis of custody.","tension":"The confession exposes the loss while the treasurer absorbs the immediate institutional consequence.","public_question":"Who is being held accountable for the missing seal?"},{"lead":false,"section":"Dispatches","journalist_id":"lysa-fen","citations":["news:west-gate"],"focus_citation":"news:west-gate","narrative_claim":"The gate closure is a practical echo of neglected custody.","tension":"A cracked hinge will close a route at moonrise while travellers wait for a reopening time.","public_question":"How long will the western route remain closed?"}]}}"#; const ACCEPTED_STORY_ACTION: &str = r#"{"tool":"file_story","headline":"Court Sells the Crown's Seal, Then the Treasurer","deck":"A gambling debt reaches the throne room and leaves one official carrying the blame.","dateline":"Room","paragraphs":["The Thorn Court has admitted that its royal seal was pawned to cover a dragon's gambling debt, a confession that turns private embarrassment into a public question of custody.","The treasurer who delivered that admission in open court was dismissed soon afterward. The court has explained the firing; it has not made the seal any less pawned."]}"#; + const MALFORMED_LYSA_STORY_ACTION: &str = r#"{"tool":"file_story","headline":"Gate Trouble","deck":"The western route will close at moonrise.","dateline":"Yard","paragraphs":["Too short.","Still short."]}"#; + const ACCEPTED_LYSA_STORY_ACTION: &str = r#"{"tool":"file_story","headline":"West Gate to Close at Moonrise","deck":"Masons will replace a cracked hinge after the palace bell keeper's warning.","dateline":"Yard","paragraphs":["Officials warn the west gate is unsafe, and the palace bell keeper says it will close at moonrise while masons replace its cracked hinge.","Travellers using the gate have been told when it will close, though no reopening hour was included in the announcement."]}"#; const ACCEPTED_PAGE: &str = r#"{"articles":[{"section":"Front Page","headline":"Court Sells the Crown's Seal, Then the Treasurer","deck":"A gambling debt reaches the throne room and leaves one official carrying the blame.","byline":"Aven Tarl","dateline":"Room","citations":["news:seal-scandal"],"paragraphs":["The Thorn Court has admitted that its royal seal was pawned to cover a dragon's gambling debt, a confession that turns private embarrassment into a public question of custody.","The treasurer who delivered that admission in open court was dismissed soon afterward. The court has explained the firing; it has not made the seal any less pawned."]}]}"#; const TWO_ARTICLE_PAGE: &str = r#"{"articles":[{"section":"Front Page","headline":"Court Sells the Crown's Seal, Then the Treasurer","deck":"A gambling debt reaches the throne room and leaves one official carrying the blame.","byline":"Aven Tarl","dateline":"Room","citations":["news:seal-scandal"],"paragraphs":["The Thorn Court has admitted that its royal seal was pawned to cover a dragon's gambling debt, a confession that turns private embarrassment into a public question of custody.","The treasurer who delivered that admission in open court was dismissed soon afterward. The court has explained the firing; it has not made the seal any less pawned."]},{"section":"Dispatches","headline":"West Gate to Close at Moonrise","deck":"Masons will replace a cracked hinge after the palace bell keeper's warning.","byline":"Lysa Fen","dateline":"Yard","citations":["news:west-gate"],"paragraphs":["Officials warn the west gate is unsafe, and the palace bell keeper says it will close at moonrise while masons replace its cracked hinge.","Travellers using the gate have been told when it will close, though no reopening hour was included in the announcement."]}]}"#; const UNCHANGED_NIGHT_CLOSE: &str = @@ -3616,6 +4199,7 @@ mod tests { let initial_schema = tool.action_schema().unwrap().to_string(); assert!(initial_schema.contains("propose_agenda")); assert!(initial_schema.contains("commit_agenda")); + assert!(initial_schema.contains("fetch_public_records")); let retrieval = tool .invoke( @@ -3652,6 +4236,19 @@ mod tests { assert!(found[0].facts[0].account.contains("speaking child")); assert!(next_cursor.is_none()); assert_eq!(tool.action_schema().unwrap().to_string(), initial_schema); + let bounded_context = serde_json::to_string(&tool.context()).unwrap(); + assert!(bounded_context.contains("news:archive:00")); + assert!(!bounded_context.contains("\"facts\"")); + assert!(!bounded_context.contains("\"assertion_status\"")); + + let exact_fetch = tool.fetch_records(vec!["news:archive:00".into()]).unwrap(); + assert!(matches!( + exact_fetch, + NarrativeSelectionFinding::QueryResult { records, next_cursor } + if records.len() == 1 + && records[0].facts[0].account.contains("speaking child") + && next_cursor.is_none() + )); let ModelAgentToolOutcome::Rejected { finding, .. } = tool .invoke( @@ -3724,6 +4321,29 @@ mod tests { .contains("commit_agenda") ); + tool.fetch_records(vec!["news:archive:00".into()]).unwrap(); + let ModelAgentToolOutcome::Rejected { finding, .. } = tool + .invoke( + NarrativeSelectionAction { + command: NarrativeSelectionCommand::CommitAgenda { + candidate_digest: candidate_digest.clone(), + }, + }, + &ModelAgentToolContext { + source_receipt_ids: Vec::new(), + current_model_receipt: None, + }, + ) + .await + else { + panic!("new research must retire the previously reviewed agenda") + }; + assert!(matches!( + finding, + NarrativeSelectionFinding::AgendaRejected { reason } + if reason.contains("requires one reviewed proposal") + )); + let revised_action = NarrativeSelectionAction { command: NarrativeSelectionCommand::ProposeAgenda { dominant_throughline: @@ -3880,6 +4500,38 @@ mod tests { assert!(requests[1].lived_stream.contains("news:archive:00")); } + #[tokio::test] + async fn assignment_editor_keeps_a_stable_prefix_without_replaying_old_record_bodies() { + let prepared = prepare_newspaper( + &campaign_with_two_news(), + "The Canopy Ledger", + "Independent and pointed.", + &canopy_ledger_newsroom(), + 3, + ) + .unwrap(); + let model = ScriptedNewspaperModel::new([QUERY_ALL_RECORDS, ONE_STORY_AGENDA]); + + select_editorial_agenda(&model, &prepared, 3).await.unwrap(); + + let requests = model.requests(); + assert_eq!(requests.len(), 3); + let stable_prefix = requests[0] + .lived_stream + .split("\n\nUSER:\nAGENT STEP") + .next() + .unwrap(); + assert!(stable_prefix.contains("STAFF BOOK")); + assert!( + requests[1..] + .iter() + .all(|request| request.lived_stream.starts_with(stable_prefix)) + ); + assert!(requests[1].lived_stream.contains("cracked hinge")); + assert!(requests[2].lived_stream.contains("news:west-gate")); + assert!(!requests[2].lived_stream.contains("cracked hinge")); + } + #[test] fn narrative_workbench_has_no_source_count_hole_and_reads_legacy_agendas() { let records = public_news_records(&campaign_with_archive_news()).unwrap(); @@ -3920,6 +4572,36 @@ mod tests { assert_eq!(legacy.narrative_claim, "A legacy framing field."); } + #[test] + fn journalist_action_schema_compiles_exact_cited_datelines() { + let records = public_news_records(&campaign_with_two_news()).unwrap(); + let lead_citations = vec!["news:seal-scandal".to_owned()]; + let lead = JournalistWorkbench { + records: &records, + article_index: 0, + section: "Front Page", + byline: "Aven Tarl", + citations: &lead_citations, + }; + assert_eq!( + lead.action_schema().unwrap()["properties"]["dateline"]["enum"], + serde_json::json!(["Room"]) + ); + + let dispatch_citations = vec!["news:west-gate".to_owned()]; + let dispatch = JournalistWorkbench { + records: &records, + article_index: 1, + section: "Dispatches", + byline: "Lysa Fen", + citations: &dispatch_citations, + }; + assert_eq!( + dispatch.action_schema().unwrap()["properties"]["dateline"]["enum"], + serde_json::json!(["", "Yard"]) + ); + } + #[test] fn night_editor_close_owns_complete_query_disposition_and_frozen_fields() { let draft: EditorialPageDraft = serde_json::from_str(TWO_ARTICLE_PAGE).unwrap(); @@ -4134,13 +4816,15 @@ mod tests { assert!(requests[4].lived_stream.contains("Dalen Marr")); assert!(requests[5].lived_stream.contains("Meret Sorn")); assert!(!requests[5].lived_stream.contains("recover drama")); + let stable_selector_prefix = requests[0] + .lived_stream + .split("\n\nUSER:\nAGENT STEP") + .next() + .unwrap(); + assert!(requests[1].lived_stream.starts_with(stable_selector_prefix)); + assert!(requests[2].lived_stream.starts_with(stable_selector_prefix)); assert!( - requests[1] - .lived_stream - .starts_with(&requests[0].lived_stream) - ); - assert!( - requests[2] + !requests[2] .lived_stream .starts_with(&requests[1].lived_stream) ); @@ -4513,6 +5197,110 @@ mod tests { ); } + #[tokio::test] + async fn production_checkpoints_resume_at_the_failed_reporter() { + let campaign = campaign_with_two_news(); + let directory = tempfile::tempdir().unwrap(); + let store = CampaignStore::open(directory.path().join("campaign.cc")).unwrap(); + let first_model = ScriptedNewspaperModel::new([ + QUERY_ALL_RECORDS, + TWO_STORY_AGENDA, + ACCEPTED_STORY_ACTION, + MALFORMED_LYSA_STORY_ACTION, + MALFORMED_LYSA_STORY_ACTION, + ]); + let error = advance_world_newspaper( + &first_model, + &campaign, + "The Underdeep Clarion", + "A skeptical court broadsheet with dry restraint.", + &canopy_ledger_newsroom(), + 4, + &store, + ) + .await + .unwrap_err(); + assert!(error.to_string().contains("malformed paragraph")); + assert_eq!( + store + .keys("world_newspaper_production_checkpoint.v1") + .unwrap() + .len(), + 2, + "the admitted agenda and Aven's accepted filing must survive Lysa's failure" + ); + let mut filed_checkpoint = store + .load_all::( + "world_newspaper_production_checkpoint.v1", + ) + .unwrap() + .into_iter() + .find(|checkpoint| { + matches!( + &checkpoint.content, + WorldNewspaperProductionContent::FiledArticle { .. } + ) + }) + .unwrap(); + let filed_receipts = load_model_receipts( + &store, + &filed_checkpoint.model_receipt_ids, + "tamper fixture", + ) + .unwrap(); + if let WorldNewspaperProductionContent::FiledArticle { article, .. } = + &mut filed_checkpoint.content + { + article.deck = "Tampered after filing.".into(); + } + assert!( + validate_production_receipts( + &filed_checkpoint, + &filed_receipts, + "newspaper_journalist_agent_action", + &filed_receipts[0].snapshot_binding, + ) + .unwrap_err() + .to_string() + .contains("receipt binding") + ); + + let resume_model = ScriptedNewspaperModel::new([ + ACCEPTED_LYSA_STORY_ACTION, + ACCEPTING_COPY_DESK, + UNCHANGED_NIGHT_CLOSE, + ]); + let composition = advance_world_newspaper( + &resume_model, + &campaign, + "The Underdeep Clarion", + "A skeptical court broadsheet with dry restraint.", + &canopy_ledger_newsroom(), + 4, + &store, + ) + .await + .unwrap(); + let requests = resume_model.requests(); + assert_eq!(requests.len(), 3); + assert_eq!(requests[0].stage, "newspaper_journalist_agent_action"); + assert!(requests[0].lived_stream.contains("Lysa Fen")); + assert!(!requests[0].lived_stream.contains("Aven Tarl")); + assert_eq!(requests[1].stage, "newspaper_copy_desk"); + assert_eq!( + requests[2].stage, + "newspaper_night_editor_close_agent_action" + ); + assert_eq!(composition.issue.articles.len(), 2); + assert_eq!( + store + .keys("world_newspaper_production_checkpoint.v1") + .unwrap() + .len(), + 3 + ); + } + #[tokio::test] async fn legacy_close_checkpoint_decodes_as_inert_history() { let campaign = campaign_with_news(); @@ -4537,9 +5325,7 @@ mod tests { .await .unwrap_err(); let mut legacy = source_store - .load_all::( - "world_newspaper_close_checkpoint.v1", - ) + .load_all::("world_newspaper_close_checkpoint.v1") .unwrap() .into_iter() .next() diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index bff713f..2b08e42 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1409,8 +1409,34 @@ Live cache evidence is mixed, not acceptance: all work used 208,480 prompt tokens, with 79,616 hits and 128,864 misses. The selector alone used 189,548 tokens across ten calls, with 77,824 hits, 111,724 misses, and 714,366 serialized input characters. Stable prefixes eventually hit, but selector context remains -too large and needs a later ownership cut. No v9 front page or reverse-Turing -result is accepted yet. +too large. Run 60 attempt 5 then passed the same-phrase checklist boundary but +failed deterministic dateline validation on Mera Quill's article. No pre-copy +stage output was durable, so the attempt replayed the selector instead of +resuming the admitted agenda and accepted reporter work. No world or per-wave +work replayed, but no v9 front page or reverse-Turing result is accepted. + +The live `character-newsroom.v10` cut owns that boundary. The generic agent +harness now lets a tool project one bounded current workbench snapshot while +preserving the stable instruction prefix. Veyra uses that seam for a compact +inspected-record index and bounded exact-ID fetch instead of accumulated full +tool chatter. Any query or fetch retires a pending agenda, so retrieval can +never leave an old proof eligible for delayed commit. + +One exact task/editorial-bound production checkpoint persists the admitted +agenda before any reporter runs. Each accepted article then persists its own +checkpoint with article slot, assignment, complete embodied reporter profile, +and receipt chain. Deterministic cited-place enums own dateline admission. The +context membranes remain person-shaped and bounded: Veyra sees her own profile +and the journalist roster; each reporter sees only their profile, assignment, +and cited facts; Dalen owns the factual page desk; Meret sees only the queried +articles, affected assignments/reporters, cited facts, and one checklist. + +The affected +`newspaper::tests::narrative_workbench_queries_foundational_context_by_stable_record_id` +rerun passes. A fresh full library run passes 479/479, strategic-smoke passes +16/16, and all-target checks pass with only the pre-existing native-client +unused `path` warning. Provider cache efficiency and reverse-Turing acceptance +remain unproven. Run 54 exposed one separate upstream publicity defect: a public strategic activity propagates its channel to private `MemberMemory` outcomes, which is @@ -1421,11 +1447,11 @@ materializing a `NewsIssue`. 1. Preserve immutable Run 59 and its later-publication correction debt; do not rewrite or resimulate it. -2. Commit and push the verified checklist-admission fix. Resume the same Run 60 root as attempt 5 - without simulation or per-wave replay; do not launch a fresh campaign. - Freeze the resulting reader-facing v9 front page. Keep selector context - reduction as a later ownership cut; partial cache hits do not close it. -3. Dispatch an independent blind reviewer with only that fantasy newspaper and +2. Commit and push the verified v10 cut, then resume the same Run 60 root + without world or per-wave replay. Its exact agenda and accepted-article + checkpoints must prevent selector or completed reporter replay. +3. Freeze the resulting reader-facing v10 front page, then dispatch an + independent blind reviewer with only that fantasy newspaper and a request for its journalistic opinion. Do not expose generation mechanics, prompts, receipts, provenance, or the acceptance hypothesis. Pass only if the reviewer is not immediately tipped that the page is procedurally diff --git a/notes/ghostlight-current-system-map.md b/notes/ghostlight-current-system-map.md index d901608..a30a702 100644 --- a/notes/ghostlight-current-system-map.md +++ b/notes/ghostlight-current-system-map.md @@ -1292,8 +1292,12 @@ The deliberative newsroom boundary is live under this authority map: journalist, focal record, exact citation grouping, throughline, tension, and reader question. Its deterministic workbench owns query admission, inspected-record membership, - agenda validation, focus-record dereferencing, candidate identity, and exact - commit admission. Each assigned in-world journalist owns one reader-facing + the bounded working-context projection, exact-ID fetch, agenda validation, + focus-record dereferencing, candidate identity, and exact commit admission. + The production-checkpoint validator owns whether an admitted agenda or + accepted reporter filing is exact enough to resume; `CampaignStore` owns its + immutable storage, not its editorial judgment. Each assigned in-world + journalist owns one reader-facing story and receives only that pitch, its exact records, and that journalist's character, biases, and preferences. The copy editor owns one complete factual query report over the assembled page; it neither rewrites nor accepts @@ -1302,17 +1306,20 @@ The deliberative newsroom boundary is live under this authority map: press witness owns structural admission, lineage, and exact before/after evidence for what printed; it does not judge prose. Errors discovered after close belong to a later edition's correction memory, not a same-edition - repair loop. V9 defines that ownership boundary but does not yet persist a + repair loop. V10 defines that ownership boundary but does not yet persist a typed correction record. Publication employees are not world actors or event writers. `WorldKernel` remains the only world-event writer. - **Inputs:** one exact campaign revision, publication title and voice, article budget, a validated embodied newsroom roster, source-receipt ancestry, and - `character-newsroom.v9` contract. Through the + `character-newsroom.v10` contract. The assignment editor receives its own + staff profile plus the complete journalist roster; it does not receive the + copy editor or Night Editor profiles. Through the existing generic agent harness, the selector issues deterministic bounded queries over stable `NewsIssue` IDs using literal terms, exact asserted public entity names, assertion statuses, channels, newest/oldest ordering, - and an already-inspected cursor. An empty query browses. Each response returns - at most 24 exact projections and the agent has at most twelve semantic steps; + and an already-inspected cursor. An empty query browses. It may also fetch at + most 24 complete records by exact stable ID. Each response returns at most 24 + exact projections and the agent has at most twelve semantic steps; the complete immutable ledger remains queryable rather than being split into privileged recent and foundational windows. - **Outputs:** an agenda proposal does not finish selection. It yields one exact @@ -1322,7 +1329,8 @@ The deliberative newsroom boundary is live under this authority map: tensions and public questions, and explicit comparison questions. The agent may query again or replace the candidate. Selection finishes only when it submits `commit_agenda` with the exact digest of the current reviewed - candidate. The committed agenda carries one dominant throughline, reader + candidate. The committed agenda is immediately stored as one immutable + production checkpoint before any reporter runs. It carries one dominant throughline, reader stake, and ordered story pitches. Every pitch names stable public-record IDs, chooses one focus record, section, and journalist, and supplies bounded narrative claim, tension, and public question. Article count plus bounded paragraphs and output tokens @@ -1330,7 +1338,12 @@ The deliberative newsroom boundary is live under this authority map: record may support several continuing stories when each pitch uses it for a distinct throughline. One journalist agent files each assigned story and the page is assembled deterministically from assignment-owned section, byline, - and citations plus journalist-owned prose. The copy desk emits one + and citations plus journalist-owned prose. Every accepted filing is stored as + its own immutable production checkpoint before the next reporter runs. Its + dateline comes from a deterministic action-schema enum compiled from places + asserted by that filing's cited records: the lead must choose a cited place + when one exists, while a later article may choose a cited place or remain + blank. The copy desk emits one assessment plus the complete bounded set of exact factual query passages; the Night Editor emits one close action; and accepted composition v3 carries the printed issue, copy report, press-close witness, and exact receipt chain. @@ -1340,7 +1353,14 @@ The deliberative newsroom boundary is live under this authority map: institutions, populations, places, and identity attributes asserted by the account. Query pages, the visible-ID set, pending agenda, candidate digest, front-page proof, review questions, and late reader-facing citation numbers - are transparent derived views. The query-index set, query-bearing article + are transparent derived views. After each nonterminal selector step, the + workbench derives a compact inspected-record index containing only record ID, + time, channel, headline, and asserted named entities, plus query/record counts + and the pending candidate token; full fact bodies return only through the + bounded query or exact-ID fetch. Production checkpoint IDs, reporter-assignment + digests, receipt-chain and complete checkpoint-content digests, and cited-place + dateline enums are also derived. + The query-index set, query-bearing article set, changed-article set, source-page digest, printed-page digest, and receipt-chain digest are also derived. None is a persisted world subject, fact bundle, relevance authority, prose judge, or event writer. @@ -1352,11 +1372,15 @@ The deliberative newsroom boundary is live under this authority map: would bury, and returns the exact candidate digest. This is an observation, not acceptance. The agent must reconsider the actual consequences in that proof and explicitly commit the current digest; a replacement proposal - retires the prior candidate as commit authority. Each assigned journalist + retires the prior candidate as commit authority. Once committed, the exact + task/editorial-bound agenda checkpoint is the sole reporter-assignment source + on retry. Each assigned journalist sees only the publication voice, shared reporting contract, their own character, the page throughline, one pitch, and that pitch's exact records. They center their story on its focus record and may not widen or regroup the - selection. Record bookkeeping, memory retention, maintained + selection. Each accepted filing is bound to that agenda checkpoint, article + index, exact pitch, journalist identity and profile, and local reporter + snapshot binding before it becomes reusable. Record bookkeeping, memory retention, maintained warnings, and procedure are not automatically the lede merely because they are recent. The copy editor sees the assembled page and selected facts. The Night Editor sees only queried articles, their assignments and cited facts, @@ -1379,18 +1403,26 @@ The deliberative newsroom boundary is live under this authority map: membership, not whether the final language is true or compelling. A structurally invalid close exhausts the one action and prints the checkpointed journalist page with an explicit non-applied close witness. There is no post-close model reread. -- **Agent context and cache path:** the generic harness sends typed append-only - user/assistant items instead of flattening every turn into one new user - transcript. Selector query, proposal, and commit share one stable structured - action schema, so each later provider request preserves the exact previous - prefix. The Night close schema is likewise stable across checklist contents; - its private workbench enforces the exact queried set. Tool schemas stay in the - provider output contract rather than being duplicated in prompt text. +- **Agent context and cache path:** the generic harness keeps the stable + instruction item as the first prefix. A tool may own a bounded current + context snapshot; after each nonterminal action the harness then discards old + model chatter and observations and sends only that snapshot plus the latest + finding. Tools that publish no snapshot retain the ordinary append-only + conversation path. The assignment workbench uses this seam for its compact + inspected-record index and pending candidate token, while exact-ID fetch + restores only the requested full records. Selector query, fetch, proposal, and + commit share one stable structured action schema. The Night close schema is + likewise stable across checklist contents; its private workbench enforces the + exact queried set. Tool schemas stay in the provider output contract rather + than being duplicated in prompt text. Prompt-cache routing binds stage, model class, and exact output schema; changing world context does not mint another routing key, while changing the - contract does. Each journalist receives only one pitch and its records. Copy - receives the complete selected desk because it alone checks the page; Night - receives only the subset named by Copy's checklist. + contract does. Each journalist receives only its own embodied profile, one + pitch, and that pitch's records; it does not receive other reporters or desk + staff. Copy receives its own embodied profile plus the complete selected fact + desk and assembled page because it alone checks the page. Night receives its + own embodied profile plus only the queried articles, affected assignments and + facts, numbered checklist, and affected reporter profiles. - **Invariants:** private events do not enter the query surface; every selected stable ID resolves at the bound revision; story order, selection, citation grouping, focus, section, and journalist remain agenda-owned; no proposal reaches the journalists @@ -1402,7 +1434,10 @@ The deliberative newsroom boundary is live under this authority map: and no external evaluation can reopen an immutable edition. The witness must preserve exact source and printed page digests, receipt ancestry, every query disposition, every changed article index, and deterministic re-derivation of - the printed issue. + the printed issue. Admitted agenda and accepted filing checkpoints survive a + later reporter or copy failure without becoming printed truth; reuse requires + exact current task, editorial, assignment, stage, snapshot, and receipt + bindings. - **Forbidden writers:** the selector and query workbench cannot create, mutate, deduplicate, summarize into, or reclassify `NewsIssue` or `Event` state. The deterministic proof cannot rank stories or commit an agenda; it @@ -1419,6 +1454,13 @@ The deliberative newsroom boundary is live under this authority map: The press witness cannot certify factual or editorial quality; it can only prove the exact admitted process and bytes. + A context snapshot cannot create or summarize facts into authority, and an + exact-ID fetch cannot mutate the ledger. A production checkpoint cannot change + the roster, agenda, pitch, reporter, article slot, section, byline, citations, + source campaign, or receipt ancestry; a checkpoint from another contract, + task, or editorial binding cannot resume current production. The dateline + schema cannot admit an uncited place, and blank cannot evade an available + cited place on the lead. Renderers, strategic smoke, Registry, external blind reviewers, and grounding reviewers cannot write the page, desk report, close, correction, world state, or acceptance state. Caches cannot decide record equivalence, assertion @@ -1430,15 +1472,25 @@ The deliberative newsroom boundary is live under this authority map: pitch, deterministic page assembly, copy report, immutable close checkpoint, one Night Editor action, deterministic press witness, lowering, persistence. Registry, live per-wave composition, missing-issue recovery, and final digest - all delegate to `advance_world_newspaper`. Resume begins from the immutable - close checkpoint and does not rerun assignment, journalists, or copy desk. A + all delegate to `advance_world_newspaper`. Resume checks, in order, an accepted + composition, an exact-current close checkpoint, the exact agenda production + checkpoint, and each reporter filing checkpoint. It reruns only the first + missing stage: an interrupted reporter pass resumes at that reporter; a later + copy failure reuses assignment and every accepted filing; a close resume does + not rerun assignment, journalists, or copy desk. A persisted composition is revalidated against its close checkpoint and exact stored receipts, then returned without model work. Every caller receives one completed `WorldNewspaperComposition` or an error; there is no pending reconciliation result for a caller to interpret or advance. - **Persistence and compatibility:** the live internal contract is - `character-newsroom.v9`. Public request schema v3 carries the publication - roster and binds it into the task and editorial identities. Close checkpoint + `character-newsroom.v10`. Public request schema v3 carries the publication + roster and binds it into the task and editorial identities. Private production + checkpoint v1 stores either the admitted agenda or one accepted reporter + filing. Agenda identity binds the exact task and editorial identities; filing + identity additionally binds its agenda checkpoint, article index, exact pitch, + complete journalist profile, assignment digest, local reporter snapshot, and + receipt chain. These checkpoints are durable production inputs, not copy-desk + acceptance, press authority, or world facts. Close checkpoint v1 binds the assigned agenda, assembled page, single copy report, task and exact editorial bindings, and immutable receipt chain. Its only valid origin is `InitialCopyDesk`, and its compatibility-shaped `source_checkpoint_id` @@ -1447,17 +1499,17 @@ The deliberative newsroom boundary is live under this authority map: receipt loading, validation, or close authority. Composition v3 stores the printed issue, copy report, press-close witness, and receipts. Public issue - schema v3 remains unchanged. Candidate agendas and front-page proofs remain - ephemeral. Historical v7 reconciliation rows may remain in archived or + schema v3 remains unchanged. Uncommitted candidate agendas and front-page + proofs remain ephemeral. Historical v7 reconciliation rows may remain in archived or resumed stores as inert provenance, but the live newspaper module defines no reconciliation loader, import envelope, or conversion path and does not rebind them. Historical strategic recomposition v1/v2 receipts are a separate acceptance-driver verification surface; their typed validators can prove original artifacts but cannot write newsroom state. Resume authority - belongs only to an exact-current close checkpoint bound to the same v9 task, - newsroom, facts, page, copy report, and receipt prefix. Run 58's v7 tip and Run - 59's printed edition remain immutable evidence in their original artifacts, - not v9 close inputs. + belongs only to exact-current v10 production and close checkpoints bound to + the same task, newsroom, facts, assignment, article slot, and receipt prefix. + Run 58's v7 tip and Run 59's printed edition remain immutable evidence in + their original artifacts, not v10 resume inputs. - **Cut line:** the generic byline list and one-shot whole-page writer are deleted. Assignment-owned section, journalist, byline, citations, and order are no longer regenerated in prose output. Tool schema text and prior-action @@ -1473,13 +1525,16 @@ The deliberative newsroom boundary is live under this authority map: not migrated or erased; nothing in the live path can make them decide a close. The roster, query projection, front-page proof, and article assembly reuse the generic agent harness and existing public-record, agenda, accepted issue, and - audit shapes. No dependency, crate, binary, daemon, persistent schema, - service, cache, event writer, target platform, code-generation path, or - world-simulation pass was added. + audit shapes. One private persistent production-checkpoint schema buys exact + pre-copy resume; no dependency, crate, binary, daemon, service, cache, event + writer, target platform, code-generation path, or world-simulation pass was + added. - **Verification and build budget:** focused newspaper tests retain query admission, exact focus proof, agenda commit, selected-record alignment, and - audit grounding. V9 gates prove stable selector and Night schemas plus - append-only provider prefixes, assignment-aware reporter context isolation, one complete + audit grounding. V10 gates prove the stable selector instruction prefix with + old record bodies absent from later snapshots, the compact inspected-record + index, bounded exact-ID refetch, stable selector and Night schemas, + assignment-aware reporter context isolation, one complete copy report, exact single-occurrence query targets, multiple categorical objections to the same phrase, one Night Editor action over only the queried articles and facts, complete query disposition, preservation of @@ -1487,10 +1542,12 @@ The deliberative newsroom boundary is live under this authority map: stage, deterministic source/printed digests, exact receipt ancestry, close-checkpoint resume without reporter or copy replay, idempotent persisted composition validation, printing the checkpointed page after a structurally - rejected close, and a fresh v9 close in a store containing a matching inert + rejected close, a fresh v10 close in a store containing a matching inert v7 tombstone. The close validator admits only `InitialCopyDesk` checkpoints with no source ancestry, while exact-current resume and idempotence regressions - exercise the only surviving resume path. Strategic recomposition v3 binds the + exercise the close resume path. Dedicated regressions prove cited-place + dateline enums and validation, plus agenda-and-filing checkpoint recovery at + the first failed reporter without replaying accepted production. Strategic recomposition v3 binds the copy report and press witness by digest while v1/v2 remain historical validation inputs. Independent blind editorial and grounding reviews evaluate the resulting artifact for the acceptance experiment only; they are deliberately @@ -1499,6 +1556,12 @@ The deliberative newsroom boundary is live under this authority map: state, and system-map gates. The cut adds no service, crate, dependency, event authority, or simulation pass. +The bounded selector snapshot retains a pending agenda's exact token while its +front-page proof is the latest observation. Any later query or exact-ID fetch +retires that candidate; the assignment editor must propose the page again and +receive a fresh proof before commit. Retrieval cannot leave a proofless agenda +eligible for delayed admission. + Run 54 is immutable mechanically complete evidence at exact source `01581b8576774f370884e331558605e7ef5e1b9b`, implementation `2ac74abf12612b2c38b04acd6fcb604acd1c9d28`, and world revision 27. diff --git a/state/evidence.jsonl b/state/evidence.jsonl index e1e11ca..4343fa5 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -231,4 +231,5 @@ {"note": "Newsroom contract v8 replaces the v7 copy/Night accept-reject tribunal and iterative rewrite loop with one complete copy-desk query report, one max_steps=1 Night Editor close, and a deterministic press witness. Every queried article must be rewritten; unqueried articles may receive optional deadline polish while selection, order, sections, bylines, citations, and agenda stay frozen. Exact v7 copy-tip import resumes Run 58 without replaying narrative selection, writer, copy desk, world, or waves. External reviews are post-press evidence rather than vetoes; typed later-correction memory remains pending. Verified 20/20 newspaper, 475/475 library, and 16/16 strategic-smoke tests.", "status": "ok", "ts": "2026-08-29T19:12:02+00:00", "type": "implementation"} {"note": "Exact-source Run 59 at pushed 161ff2f19021249563e192cce9e6f76f00429d48 printed from immutable Run 58/revision 27 without upstream replay. The press witness binds one copy report with five queries, one applied Night close, three changed articles, and unchanged live services; archive SHA-256 ecb4db41e9a40ee4db8b0f83dce42d74e40f940e5930b1d3c1ced227dfec76b3 matches. Newspaper ee2ce08ceb627d433ac2d4ff7e1ebecb1437bf28b1399d23bfb3d5b066c8ab27 and audit b210d50d4ef1a350315d528f6d37e1e7b618926346713f737c4169c49df26b49 are frozen. A finalizer schema expectation was corrected and finalization resumed without a model call. Post-press editorial and two grounding diagnostics are later publication debt and do not reopen or block delivery of this edition.", "status": "ok", "ts": "2026-08-29T19:50:00+00:00", "type": "verification"} {"note": "Run 59 prompt audit falsifies v8 as the target newsroom/cache architecture: narrative selection made ten provider calls over 1,373,208 input characters and 582,184 prompt tokens with zero cached tokens. The generic agent harness places changing action schema before stable work and replays the accumulated tool transcript; selector, whole-page writer, and Night Editor duplicate editorial doctrine. Operator-authorized owners are story-and-journalist assignment from the frozen ledger, bounded personality-bearing journalist drafting, copy desk as sole semantic factual query owner, one Night Editor checklist repair preserving narrative, and deterministic structural/provenance/query-disposition press admission. Exact schema and cache cuts remain pending bounded source inspection.", "status": "ok", "ts": "2026-08-29T20:29:24+00:00", "type": "research"} -{"ts": "2026-08-29T21:42:15+00:00", "type": "implementation", "status": "ok", "note": "character-newsroom.v9 replaces the monolithic page writer with an embodied assignment editor and one bounded journalist agent per assigned story, preserves exact assignment-owned structure, bounds Night Editor context to copy-queried articles and facts, and makes generic agent requests append-only with stable schemas and cache routing. Verified 475/475 library tests, 16/16 strategic-smoke tests, and ghostlight-dungeon all-target checks; no provider or simulation run was launched."} +{"note": "character-newsroom.v9 replaces the monolithic page writer with an embodied assignment editor and one bounded journalist agent per assigned story, preserves exact assignment-owned structure, bounds Night Editor context to copy-queried articles and facts, and makes generic agent requests append-only with stable schemas and cache routing. Verified 475/475 library tests, 16/16 strategic-smoke tests, and ghostlight-dungeon all-target checks; no provider or simulation run was launched.", "status": "ok", "ts": "2026-08-29T21:42:15+00:00", "type": "implementation"} +{"ts": "2026-08-30T05:37:54+00:00", "type": "implementation", "status": "ok", "note": "character-newsroom.v10 gives the assignment editor a stable-prefix bounded workbench projection with compact inspected-record index and exact-ID refetch; retrieval retires any pending agenda. Exact task/editorial-bound agenda and per-article production checkpoints preserve accepted work before copy, and cited datelines compile into the reporter action schema. Verified 479/479 library tests, 16/16 strategic-smoke tests, and all-target check with only the pre-existing native-client unused-path warning."} diff --git a/state/ghostlight-state.cultcache.jsonl b/state/ghostlight-state.cultcache.jsonl index 30289c7..6de0c30 100644 --- a/state/ghostlight-state.cultcache.jsonl +++ b/state/ghostlight-state.cultcache.jsonl @@ -233,3 +233,4 @@ {"key": "2026-08-29T195000Z0000-0231-c1dcff35845b", "payload": "eyJub3RlIjogIkV4YWN0LXNvdXJjZSBSdW4gNTkgYXQgcHVzaGVkIDE2MWZmMmYxOTAyMTI0OTU2M2UxOTJjY2U5ZTZmNzZmMDA0MjlkNDggcHJpbnRlZCBmcm9tIGltbXV0YWJsZSBSdW4gNTgvcmV2aXNpb24gMjcgd2l0aG91dCB1cHN0cmVhbSByZXBsYXkuIFRoZSBwcmVzcyB3aXRuZXNzIGJpbmRzIG9uZSBjb3B5IHJlcG9ydCB3aXRoIGZpdmUgcXVlcmllcywgb25lIGFwcGxpZWQgTmlnaHQgY2xvc2UsIHRocmVlIGNoYW5nZWQgYXJ0aWNsZXMsIGFuZCB1bmNoYW5nZWQgbGl2ZSBzZXJ2aWNlczsgYXJjaGl2ZSBTSEEtMjU2IGVjYjRkYjQxZTlhNDBlZTRkYjhiMGY4M2RjZTQyZDc0ZTQwZjk0MGU1OTMwYjFkM2MxY2VkMjI3ZGZlYzc2YjMgbWF0Y2hlcy4gTmV3c3BhcGVyIGVlMmNlMDhjZWI2MjdkNDMzYWMyZDRmZjdlMWViZWNiMTQzN2JmMjhiMTM5OWQyM2JmYjNkNWIwNjZjOGFiMjcgYW5kIGF1ZGl0IGIyMTBkNTBkNGVmMWEzNTAzMTVkNTI4ZjZkMzdlMWU3YjYxODkyNjM0NjcxM2Y3MzdjNDE2OWM0OWRmMjZiNDkgYXJlIGZyb3plbi4gQSBmaW5hbGl6ZXIgc2NoZW1hIGV4cGVjdGF0aW9uIHdhcyBjb3JyZWN0ZWQgYW5kIGZpbmFsaXphdGlvbiByZXN1bWVkIHdpdGhvdXQgYSBtb2RlbCBjYWxsLiBQb3N0LXByZXNzIGVkaXRvcmlhbCBhbmQgdHdvIGdyb3VuZGluZyBkaWFnbm9zdGljcyBhcmUgbGF0ZXIgcHVibGljYXRpb24gZGVidCBhbmQgZG8gbm90IHJlb3BlbiBvciBibG9jayBkZWxpdmVyeSBvZiB0aGlzIGVkaXRpb24uIiwgInN0YXR1cyI6ICJvayIsICJ0cyI6ICIyMDI2LTA4LTI5VDE5OjUwOjAwKzAwOjAwIiwgInR5cGUiOiAidmVyaWZpY2F0aW9uIn0=", "stored_at": "2026-08-29T19:50:00.186912+00:00", "type": "ghostlight.evidence_record.v0"} {"key": "2026-08-29T202924Z0000-0232-b61cd79c3dfd", "payload": "eyJub3RlIjogIlJ1biA1OSBwcm9tcHQgYXVkaXQgZmFsc2lmaWVzIHY4IGFzIHRoZSB0YXJnZXQgbmV3c3Jvb20vY2FjaGUgYXJjaGl0ZWN0dXJlOiBuYXJyYXRpdmUgc2VsZWN0aW9uIG1hZGUgdGVuIHByb3ZpZGVyIGNhbGxzIG92ZXIgMSwzNzMsMjA4IGlucHV0IGNoYXJhY3RlcnMgYW5kIDU4MiwxODQgcHJvbXB0IHRva2VucyB3aXRoIHplcm8gY2FjaGVkIHRva2Vucy4gVGhlIGdlbmVyaWMgYWdlbnQgaGFybmVzcyBwbGFjZXMgY2hhbmdpbmcgYWN0aW9uIHNjaGVtYSBiZWZvcmUgc3RhYmxlIHdvcmsgYW5kIHJlcGxheXMgdGhlIGFjY3VtdWxhdGVkIHRvb2wgdHJhbnNjcmlwdDsgc2VsZWN0b3IsIHdob2xlLXBhZ2Ugd3JpdGVyLCBhbmQgTmlnaHQgRWRpdG9yIGR1cGxpY2F0ZSBlZGl0b3JpYWwgZG9jdHJpbmUuIE9wZXJhdG9yLWF1dGhvcml6ZWQgb3duZXJzIGFyZSBzdG9yeS1hbmQtam91cm5hbGlzdCBhc3NpZ25tZW50IGZyb20gdGhlIGZyb3plbiBsZWRnZXIsIGJvdW5kZWQgcGVyc29uYWxpdHktYmVhcmluZyBqb3VybmFsaXN0IGRyYWZ0aW5nLCBjb3B5IGRlc2sgYXMgc29sZSBzZW1hbnRpYyBmYWN0dWFsIHF1ZXJ5IG93bmVyLCBvbmUgTmlnaHQgRWRpdG9yIGNoZWNrbGlzdCByZXBhaXIgcHJlc2VydmluZyBuYXJyYXRpdmUsIGFuZCBkZXRlcm1pbmlzdGljIHN0cnVjdHVyYWwvcHJvdmVuYW5jZS9xdWVyeS1kaXNwb3NpdGlvbiBwcmVzcyBhZG1pc3Npb24uIEV4YWN0IHNjaGVtYSBhbmQgY2FjaGUgY3V0cyByZW1haW4gcGVuZGluZyBib3VuZGVkIHNvdXJjZSBpbnNwZWN0aW9uLiIsICJzdGF0dXMiOiAib2siLCAidHMiOiAiMjAyNi0wOC0yOVQyMDoyOToyNCswMDowMCIsICJ0eXBlIjogInJlc2VhcmNoIn0=", "stored_at": "2026-08-29T20:29:24.348689+00:00", "type": "ghostlight.evidence_record.v0"} {"key": "2026-08-29T214215Z0000-0233-cdea7f28b17e", "payload": "eyJub3RlIjogImNoYXJhY3Rlci1uZXdzcm9vbS52OSByZXBsYWNlcyB0aGUgbW9ub2xpdGhpYyBwYWdlIHdyaXRlciB3aXRoIGFuIGVtYm9kaWVkIGFzc2lnbm1lbnQgZWRpdG9yIGFuZCBvbmUgYm91bmRlZCBqb3VybmFsaXN0IGFnZW50IHBlciBhc3NpZ25lZCBzdG9yeSwgcHJlc2VydmVzIGV4YWN0IGFzc2lnbm1lbnQtb3duZWQgc3RydWN0dXJlLCBib3VuZHMgTmlnaHQgRWRpdG9yIGNvbnRleHQgdG8gY29weS1xdWVyaWVkIGFydGljbGVzIGFuZCBmYWN0cywgYW5kIG1ha2VzIGdlbmVyaWMgYWdlbnQgcmVxdWVzdHMgYXBwZW5kLW9ubHkgd2l0aCBzdGFibGUgc2NoZW1hcyBhbmQgY2FjaGUgcm91dGluZy4gVmVyaWZpZWQgNDc1LzQ3NSBsaWJyYXJ5IHRlc3RzLCAxNi8xNiBzdHJhdGVnaWMtc21va2UgdGVzdHMsIGFuZCBnaG9zdGxpZ2h0LWR1bmdlb24gYWxsLXRhcmdldCBjaGVja3M7IG5vIHByb3ZpZGVyIG9yIHNpbXVsYXRpb24gcnVuIHdhcyBsYXVuY2hlZC4iLCAic3RhdHVzIjogIm9rIiwgInRzIjogIjIwMjYtMDgtMjlUMjE6NDI6MTUrMDA6MDAiLCAidHlwZSI6ICJpbXBsZW1lbnRhdGlvbiJ9", "stored_at": "2026-08-29T21:42:15.490465+00:00", "type": "ghostlight.evidence_record.v0"} +{"key": "2026-08-30T053754Z0000-0234-3f241b6ff6fc", "payload": "eyJub3RlIjogImNoYXJhY3Rlci1uZXdzcm9vbS52MTAgZ2l2ZXMgdGhlIGFzc2lnbm1lbnQgZWRpdG9yIGEgc3RhYmxlLXByZWZpeCBib3VuZGVkIHdvcmtiZW5jaCBwcm9qZWN0aW9uIHdpdGggY29tcGFjdCBpbnNwZWN0ZWQtcmVjb3JkIGluZGV4IGFuZCBleGFjdC1JRCByZWZldGNoOyByZXRyaWV2YWwgcmV0aXJlcyBhbnkgcGVuZGluZyBhZ2VuZGEuIEV4YWN0IHRhc2svZWRpdG9yaWFsLWJvdW5kIGFnZW5kYSBhbmQgcGVyLWFydGljbGUgcHJvZHVjdGlvbiBjaGVja3BvaW50cyBwcmVzZXJ2ZSBhY2NlcHRlZCB3b3JrIGJlZm9yZSBjb3B5LCBhbmQgY2l0ZWQgZGF0ZWxpbmVzIGNvbXBpbGUgaW50byB0aGUgcmVwb3J0ZXIgYWN0aW9uIHNjaGVtYS4gVmVyaWZpZWQgNDc5LzQ3OSBsaWJyYXJ5IHRlc3RzLCAxNi8xNiBzdHJhdGVnaWMtc21va2UgdGVzdHMsIGFuZCBhbGwtdGFyZ2V0IGNoZWNrIHdpdGggb25seSB0aGUgcHJlLWV4aXN0aW5nIG5hdGl2ZS1jbGllbnQgdW51c2VkLXBhdGggd2FybmluZy4iLCAic3RhdHVzIjogIm9rIiwgInRzIjogIjIwMjYtMDgtMzBUMDU6Mzc6NTQrMDA6MDAiLCAidHlwZSI6ICJpbXBsZW1lbnRhdGlvbiJ9", "stored_at": "2026-08-30T05:37:54.505622+00:00", "type": "ghostlight.evidence_record.v0"} diff --git a/state/map.yaml b/state/map.yaml index a5c53e2..e1ae45d 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -194,7 +194,7 @@ live_architecture: - Institution, faction, and consumer decision models active_subgoals: - - Pass the active narrative reverse-Turing acceptance with `character-newsroom.v9`: an independently dispatched reviewer sees only the procedurally generated fantasy front page and journalistically plausible editorializing, receives no generation mechanics or provenance, and does not immediately identify it as procedurally generated. A merely improved or less-bad score is not passage. Preserve Run 59 as closed evidence and later-publication debt; do not replay world simulation. + - Pass the active narrative reverse-Turing acceptance with `character-newsroom.v10`: an independently dispatched reviewer sees only the procedurally generated fantasy front page and journalistically plausible editorializing, receives no generation mechanics or provenance, and does not immediately identify it as procedurally generated. A merely improved or less-bad score is not passage. Preserve Run 59 and Run 60 attempts 1 through 5 as closed evidence; do not replay world simulation or per-wave publications. - Connect a Delvehold-owned adapter to the admitted generic consumer contract: shared compiler/consumer WorldSeed admission, externally authoritative institution-or-Gestalt snapshots, attributed proposal acknowledgement, and committed-event newspaper composition over typed CultNet, without consumer-specific IDs or schemas in Ghostlight. - Extend strategic/offscreen named-person individuation beyond the proven emerge-then-act path so people plot across sustained political waves, acquire relationships, fold, and return without granting a cell, arena, or model commit authority. - Pressure the proven 200-cell dispatcher with authored consumer hierarchies and measure provider cost; the active budget ceiling is 240 while provider concurrency remains separately capped at 32. @@ -325,7 +325,7 @@ data_flow: current_status: summary: Ghostlight's generic consumer boundary admits sparse WorldSeeds, runs the hundreds-class parallel cell machinery used by Dungeon, and projects grounded newspapers from committed public events. Local acceptance proves 1,000 subjects across 200 cells and two-wave durable named-person emergence. Exact-source provider run 38 at `596e50679244b5d42b4cfdf70d723f815751b8ff` resumed the preserved world at revision 8 without replaying compilation or four committed locality elaborations, recovered 51 of 52 strategic-wave cells on pulse three and the final cell on pulse four, then committed all six waves through revision 14. Pushed commit `3a69306f3004e4af2cd57bba612a6ad8d1b8132f` implements the mapped clock-consequence owner and is verified locally: world clocks own declared consequence text and exact observable scope; a bounded agent may propose legacy scope binding, while `WorldKernel` alone admits it and materializes stable threshold-crossing events and public news through the common mutation path. Binding, emitted-event ancestry, mutation receipts, and the next newspaper boundary persist atomically. Exact-source run 39 resumed run 38 without replaying its six committed waves, bound clock consequences, committed six new waves through revision 21, and emitted Issues 7 through 12 plus a final digest. This completes the mechanical provider acceptance path; all inherited wave 1-6 checkpoint hashes match run 38 exactly and live services were unchanged. Independent blind editorial review returns FAIL: only Issue 7 approaches spicy, while Issues 8-12 are dominated by plans, filings, inspections, warnings, and abstract relationship deltas without betrayal, scandal, public reaction, sustained reversal, or material lived cost. That run-39 diagnosis is superseded for the current phase: run 51 closes the world and reconciliation mechanics, and the active defect belongs to newsroom narrative selection and self-contained semantic provenance over immutable facts. Independent grounding review also returns FAIL: Issue 9 inflates a planned expedited agenda into completion, while Issue 8 assigns unsupported feminine pronouns to Sela Venn and Eryn Tal. Other grounding mechanics pass: 208/208 citations resolve, no future events appear, no replay occurred, the player remained unchanged, all 116/116 manifest entries verify, the archive is exact, and root independently confirmed the live service PIDs and invocation IDs remained unchanged. Editorial and grounding acceptance are terminally failed for run 39. Eight titled elaborators use the generic agent harness under deterministic weighted scheduling, bounded parallelism, and Luna/Terra/Sol routing. Workers remain proposal-only; deterministic admission binds exact frozen schedules, dispatch, receipts, conflicts, and semantic verification, and `WorldKernel` alone owns atomic CultCache persistence. Destination reconciliation is a private transactional workbench, provider schema compatibility is lowered once at the shared model-connector boundary, and durable elaboration and strategic-pulse checkpoints bind to their canonical mutation proofs. The generic ModelAgent harness remains consumer-neutral transport. Provider run 23 remains stopped; earlier failed runs and checkpoint archives remain immutable provenance. The live daemons remain outside the acceptance body. Dungeon play remains regression pressure, the Delvehold game-side adapter remains unimplemented, and unpublished Mars and Kalsa destination previews remain unapproved. - provider_acceptance_checkpoint: Run 60 attempt 4 at exact pushed `26d1d87` passed the historical tombstone and reached live `character-newsroom.v9` provider work with no world or per-wave replay. Ten Sol selector actions assigned Mera Quill, Ossan Reed, and Lysa Fen; each reporter needed one semantic correction. The copy-desk inference completed on its second transport attempt after the first timed out at 300 seconds. Deterministic admission then rejected two distinct checklist objections that named the same exact article phrase. Total prompt use was 208,480 tokens: 79,616 cache hits and 128,864 misses. The selector alone used 189,548 tokens across ten calls, with 77,824 hits, 111,724 misses, and 714,366 serialized input characters. Stable prefixes now produce real hits, but selector context remains excessive; no front page or reverse-Turing evidence is accepted yet. - implementation_checkpoint: Exact pushed `26d1d87` owns the inert historical tombstone and exact-current close resume boundary. `character-newsroom.v9` retains its embodied assignment editor, bounded assigned journalists, single factual copy checklist, checklist-bound Night close, typed append-only prompt history, stable action schemas, and deterministic press admission. The current tiny uncommitted fix removes only the false checklist-phrase uniqueness rule while preserving exact single-occurrence target validation: a copy editor may lodge distinct factual or copy objections against the same phrase, and the Night Editor must address every query index once. Verification passes 21/21 focused newspaper tests, 476/476 library tests, 16/16 strategic-smoke tests, and all-target checks. Provider execution and partial cache reuse are proven, but caching and reverse-Turing acceptance are not solved. - next_action: Commit and push the verified checklist-admission fix. Resume the same Run 60 root as attempt 5 without replaying simulation or per-wave publications; capture the immutable v9 front page and dispatch the independent blind journalistic review under the exact reverse-Turing criterion. Preserve attempts 1 through 4. Do not weaken exact phrase occurrence, let one objection erase another, claim caching solved from partial hits, launch a fresh campaign, or redefine a merely less-bad review as passage. Treat selector context size as a later ownership cut after this acceptance boundary. + provider_acceptance_checkpoint: Run 60 attempt 5 passed the same-phrase checklist boundary but failed deterministic dateline validation on Mera Quill's article before a page could close. Because no pre-copy newsroom output was durable, the attempt replayed the expensive selector instead of resuming its admitted agenda and accepted reporter work. No world or per-wave work replayed, but no immutable v9 front page or reverse-Turing evidence exists. Attempt 4's cache evidence remains judgment-changing: 208,480 total prompt tokens with 79,616 hits and 128,864 misses; the selector alone consumed 189,548 tokens across ten calls, 77,824 hits, 111,724 misses, and 714,366 serialized input characters. Stable prefixes hit, but assignment context and resume ownership remain unsolved. + implementation_checkpoint: The uncommitted `character-newsroom.v10` cut implements a generic tool-owned bounded context-snapshot seam: the harness preserves the stable instruction prefix while the tool replaces accumulated chatter with exact current workbench state. Veyra uses it for a compact inspected-record index and bounded exact-ID fetch; any query or fetch retires a pending agenda and requires a fresh proposal and proof. Exact task/editorial-bound production checkpoints persist the admitted agenda before reporters and each accepted article with its assignment, embodied reporter profile, and receipt chain. Reporter datelines are deterministic cited-place enums. Context membranes expose Veyra's own profile plus the journalist roster, each reporter's own profile/assignment/cited facts, Dalen's factual page desk, and Meret's queried subset; roles do not receive one omniscient newsroom packet. The affected `newspaper::tests::narrative_workbench_queries_foundational_context_by_stable_record_id` rerun passes; a fresh full library run passes 479/479, strategic-smoke passes 16/16, and all-target checks pass with only the pre-existing native-client unused `path` warning. Provider cache efficiency and reverse-Turing acceptance remain unproven. + next_action: Commit and push the verified v10 cut, then resume the same Run 60 root without world or per-wave replay. The exact task/editorial-bound agenda and accepted-article checkpoints must prevent replay of Veyra or completed reporters; only a resulting immutable v10 page proceeds to blind reverse-Turing review. Preserve attempts 1 through 5, do not launch a fresh campaign, and do not treat local cache structure or a merely less-bad review as passage. 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.