Close omniscient player pressure leak
This commit is contained in:
parent
815f3dc510
commit
c4a3d6f38b
4 changed files with 98 additions and 19 deletions
|
|
@ -21,31 +21,50 @@ pub fn player_surface(campaign: &Campaign, narrations: &[NarrationProjection]) -
|
|||
let story = story_nodes(campaign, narrations);
|
||||
let player = &campaign.actors[&campaign.player_actor_id];
|
||||
let location = &campaign.locations[&player.location_id];
|
||||
let relationships = if player.relationships.is_empty() {
|
||||
"none".into()
|
||||
} else {
|
||||
player
|
||||
.relationships
|
||||
.iter()
|
||||
.map(|(subject_id, relationship)| {
|
||||
let display_name = campaign
|
||||
.actors
|
||||
.get(subject_id)
|
||||
.map(|actor| actor.name.as_str())
|
||||
.or_else(|| {
|
||||
campaign
|
||||
.institutions
|
||||
.get(subject_id)
|
||||
.map(|institution| institution.name.as_str())
|
||||
})
|
||||
.or_else(|| {
|
||||
campaign
|
||||
.gestalts
|
||||
.get(subject_id)
|
||||
.map(|gestalt| gestalt.name.as_str())
|
||||
})
|
||||
.or_else(|| {
|
||||
subject_id
|
||||
.strip_prefix("member:")
|
||||
.and_then(|member_id| campaign.gestalt_members.get(member_id))
|
||||
.map(|member| member.name.as_str())
|
||||
})
|
||||
.unwrap_or(subject_id);
|
||||
format!("{display_name}: {relationship}")
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join(", ")
|
||||
};
|
||||
let ledger = format!(
|
||||
"Capabilities: {}\nEquipment: {}\nConditions: {}\nObligations: {}\nKnown facts: {}",
|
||||
"Capabilities: {}\nEquipment: {}\nConditions: {}\nObligations: {}\nRelationships: {}\nKnown facts: {}",
|
||||
join(&player.capabilities),
|
||||
join(&player.equipment),
|
||||
join(&player.conditions),
|
||||
join(&player.obligations),
|
||||
relationships,
|
||||
join(&player.knowledge)
|
||||
);
|
||||
let pressures = campaign
|
||||
.clocks
|
||||
.values()
|
||||
.map(|clock| {
|
||||
format!(
|
||||
"{} {}/{} — {}",
|
||||
clock.label, clock.progress, clock.threshold, clock.consequence
|
||||
)
|
||||
})
|
||||
.chain(
|
||||
campaign
|
||||
.institutions
|
||||
.values()
|
||||
.map(|x| format!("{} — {}", x.name, x.posture)),
|
||||
)
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n");
|
||||
let news=campaign.news.iter().map(|item|json!({"id":item.id,"kind":"text","props":{"value":format!("[{}] {}",item.channel,item.headline)},"children":[]})).collect::<Vec<_>>();
|
||||
let effective_budget = campaign
|
||||
.resolution_cover
|
||||
|
|
@ -67,7 +86,7 @@ pub fn player_surface(campaign: &Campaign, narrations: &[NarrationProjection]) -
|
|||
},
|
||||
"surface":{"id":format!("ghostlight.campaign.{}",campaign.id),"root":{"id":"dungeon.root","kind":"surface","props":{},"children":[
|
||||
{"id":"dungeon.status","kind":"card","props":{"title":format!("{} · revision {} · {}",campaign.name,campaign.revision,campaign.world_time)},"children":[]},
|
||||
{"id":"dungeon.location","kind":"card","props":{"title":format!("{} · {}",location.name,player.name)},"children":[{"id":"dungeon.pressures","kind":"text","props":{"value":pressures},"children":[]}]},
|
||||
{"id":"dungeon.location","kind":"card","props":{"title":format!("{} · {}",location.name,player.name)},"children":[]},
|
||||
{"id":"dungeon.ledger","kind":"card","props":{"title":"Character ledger"},"children":[{"id":"dungeon.ledger.text","kind":"text","props":{"value":ledger},"children":[]}]},
|
||||
{"id":"dungeon.resolution","kind":"card","props":{"title":format!("World resolution · {} configured / {} effective",campaign.resolution_policy.active_cell_budget,effective_budget)},"children":[{"id":"dungeon.resolution.text","kind":"text","props":{"value":format!("Resolution epoch {} · {} pins · {} temporary overage",campaign.resolution_policy.resolution_epoch,campaign.resolution_pins.len(),campaign.resolution_cover.as_ref().map(|cover| cover.mandatory_overage).unwrap_or(0))},"children":[]}]},
|
||||
{"id":"dungeon.news","kind":"card","props":{"title":"Accessible news and rumors"},"children":news},
|
||||
|
|
@ -303,6 +322,9 @@ mod tests {
|
|||
let mut campaign = crate::resolution::tests::campaign(1, 1);
|
||||
let mut player = campaign.actors.remove("player").unwrap();
|
||||
player.id = "pilot-nyx".into();
|
||||
player
|
||||
.relationships
|
||||
.insert("faction-0000".into(), "owes me safe passage".into());
|
||||
campaign.player_actor_id = player.id.clone();
|
||||
campaign.actors.insert(player.id.clone(), player);
|
||||
|
||||
|
|
@ -310,5 +332,45 @@ mod tests {
|
|||
|
||||
assert_eq!(surface["player_actor_id"], "pilot-nyx");
|
||||
assert_eq!(surface["player_location_id"], "center");
|
||||
assert!(
|
||||
serde_json::to_string(&surface)
|
||||
.unwrap()
|
||||
.contains("Relationships: Faction 0: owes me safe passage")
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn player_surface_cannot_leak_canonical_remote_pressure() {
|
||||
let mut campaign = crate::resolution::tests::campaign(1, 1);
|
||||
campaign
|
||||
.institutions
|
||||
.get_mut("faction-0000")
|
||||
.unwrap()
|
||||
.posture = "SECRET_REMOTE_COUP_POSTURE".into();
|
||||
campaign.clocks.insert(
|
||||
"sealed-investigation".into(),
|
||||
crate::domain::WorldClock {
|
||||
id: "sealed-investigation".into(),
|
||||
label: "SECRET_INVESTIGATION_CLOCK".into(),
|
||||
progress: 3,
|
||||
threshold: 4,
|
||||
consequence: "SECRET_ARREST_PLAN".into(),
|
||||
},
|
||||
);
|
||||
campaign.news.push(crate::domain::NewsIssue {
|
||||
id: "news:public".into(),
|
||||
at: Utc::now(),
|
||||
channel: "public bulletin".into(),
|
||||
headline: "The public ferry is delayed.".into(),
|
||||
event_ids: vec!["event:public".into()],
|
||||
reliability: "direct institutional channel".into(),
|
||||
});
|
||||
|
||||
let encoded = serde_json::to_string(&player_surface(&campaign, &[])).unwrap();
|
||||
|
||||
assert!(!encoded.contains("SECRET_REMOTE_COUP_POSTURE"));
|
||||
assert!(!encoded.contains("SECRET_INVESTIGATION_CLOCK"));
|
||||
assert!(!encoded.contains("SECRET_ARREST_PLAN"));
|
||||
assert!(encoded.contains("The public ferry is delayed."));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -813,6 +813,14 @@ transcribe an internal location ID: the canonical current ID is projected by
|
|||
the server and bound read-only, while destination and fission receipts expose
|
||||
the topology or child leaves being approved.
|
||||
|
||||
The next surface audit found canonical institution postures and every raw world
|
||||
clock concatenated into the player location card. That bypassed the otherwise
|
||||
channel-aware news path. The omniscient aggregation is deleted: world time and
|
||||
location remain public, developments arrive through player-local narration or
|
||||
admitted news, and raw pressures remain in the operator surface. The character
|
||||
ledger now includes the player actor's own relationships, which it had promised
|
||||
but omitted.
|
||||
|
||||
## Warnings
|
||||
|
||||
- Keep persistent state small. Git history and artifacts own chronology.
|
||||
|
|
|
|||
|
|
@ -324,6 +324,14 @@ before generation. Only direct-seed source text enters causal world compilation;
|
|||
background and excluded sources remain coverage provenance and cannot donate
|
||||
story incidents or cast.
|
||||
|
||||
The player Eve surface follows the same membrane. It renders the player-owned
|
||||
ledger—including that actor's own relationships—and already filtered news, but
|
||||
does not enumerate canonical institution postures or raw world clocks. Those
|
||||
remain operator state until narration or an exact information channel makes a
|
||||
development available to the character. A negative regression plants a remote
|
||||
coup posture and sealed investigation clock, proves all three secret strings
|
||||
absent from the player surface, and proves an admitted public headline remains.
|
||||
|
||||
Global strategic context has a separate non-causal lane. Two stable broad Vault
|
||||
queries run alongside local retrieval, and a Flash extraction stage proposes at
|
||||
most 32 remote institution names with one short durable mandate each. Local code
|
||||
|
|
|
|||
|
|
@ -99,4 +99,5 @@
|
|||
{"ts":"2026-08-18T19:14:00Z","type":"implementation","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"The world-seed preview now renders the full public approval surface—player capabilities/equipment/conditions/obligations, stable topology and routes, cast, institutions, populations, clocks, and exact evidence-use rationales—in compact expandable sections. A browser-local request lock disables only previously enabled controls during compilation or commands and restores those exact controls afterward, preventing accidental duplicate inference while leaving mailbox/revision authority server-side. Vite production build succeeded."}
|
||||
{"ts":"2026-08-18T19:18:00Z","type":"implementation","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"The player surface now projects the canonical current location ID beside the canonical actor ID. The destination form binds that ID read-only rather than asking the player to transcribe internal state, and its approval receipt shows proposed containment, routes, persistent features, and material gaps. Fission approval shows each child leaf, partition value including other/unknown, and home location. Focused surface regression and Vite production build passed."}
|
||||
{"ts":"2026-08-18T19:24:30Z","type":"deployment","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Starfire activated immutable release 5e198dfa872a710d31e581dcf2cd0851bef01966 with executable SHA-256 d511629d9a05ef5210edc7dedf38bd842b4dc15cb3e8b43467a6ac54d2d26646 and rollback f9b0ffb90e6a8b3e1505d81995e81e09a9c58cd7. Typed health, manifest, active junction, PID 1888, four persisted campaigns, DeepSeek readiness, and served assets index-DbDnq-RC.js / index-B7Qh0xAi.css agree. The unauthenticated rendered browser gate remained coherent. Publication did not rotate or consume invitations."}
|
||||
{"ts":"2026-08-18T19:29:00Z","type":"security","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Cut an omniscient player-surface leak: the location card no longer enumerates every canonical institution posture and raw world clock. Remote developments remain operator state until player-local narration or an admitted information-channel NewsIssue exposes them. The player-owned ledger now includes the actor's own relationships. A negative regression plants secret remote posture/clock/consequence strings, proves all absent from the serialized player Eve surface, and proves an accessible public headline remains."}
|
||||
{"ts":"2026-08-18T18:52:00Z","type":"verification","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Exact release 7916ab04936ba962720cfbf4af1b83f9aa8d8b24 made every selected named member exception a mandatory Projector perspective owner, closing the seam where aggregation could erase an actionable individual before Persona choice. The strict provider-backed budget-one golden placed 24 rivals in one arena, attributed migration to member:mira-venn, moved her between depth-two population lineages, produced nine sustained material consequences including seven typed outcomes across six other background subjects, preserved her delta and the player, and automatically promoted the same Mira on return with zero rejected pulses. Witness: F:\\GameCult\\GhostlightDungeon\\acceptance\\gestalt-dynamics-7916ab0-strict\\result.json."}
|
||||
|
|
|
|||
Loading…
Reference in a new issue