Restore operator ownership of resolution pins
This commit is contained in:
parent
c1ee8daf77
commit
c509d2a95b
10 changed files with 236 additions and 195 deletions
|
|
@ -1412,8 +1412,7 @@ fn player_http_command_allowed(command: &WorldCommand, player_actor_id: &str) ->
|
|||
} => intent.actor_id == player_actor_id && proposal.is_none(),
|
||||
WorldCommand::Attempt { .. }
|
||||
| WorldCommand::Wait { .. }
|
||||
| WorldCommand::SetResolutionBudget { .. }
|
||||
| WorldCommand::ReplaceResolutionPins { .. } => true,
|
||||
| WorldCommand::SetResolutionBudget { .. } => true,
|
||||
WorldCommand::CreateCampaign { .. }
|
||||
| WorldCommand::AdvanceStrategicTick { .. }
|
||||
| WorldCommand::ExpandRegion { .. }
|
||||
|
|
@ -1424,6 +1423,7 @@ fn player_http_command_allowed(command: &WorldCommand, player_actor_id: &str) ->
|
|||
| WorldCommand::ResolveReactionWave { .. }
|
||||
| WorldCommand::ResolveNpcAction { .. }
|
||||
| WorldCommand::SetProviderParallelism { .. }
|
||||
| WorldCommand::ReplaceResolutionPins { .. }
|
||||
| WorldCommand::FissionGestalt { .. } => false,
|
||||
}
|
||||
}
|
||||
|
|
@ -2386,6 +2386,22 @@ mod tests {
|
|||
},
|
||||
"player",
|
||||
));
|
||||
assert!(player_http_command_allowed(
|
||||
&WorldCommand::SetResolutionBudget {
|
||||
expected_revision: 4,
|
||||
expected_resolution_epoch: 2,
|
||||
active_cell_budget: 8,
|
||||
},
|
||||
"player",
|
||||
));
|
||||
assert!(!player_http_command_allowed(
|
||||
&WorldCommand::ReplaceResolutionPins {
|
||||
expected_revision: 4,
|
||||
expected_resolution_epoch: 2,
|
||||
pins: vec![],
|
||||
},
|
||||
"player",
|
||||
));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ pub fn player_surface(campaign: &Campaign, narrations: &[NarrationProjection]) -
|
|||
"policy":campaign.resolution_policy,
|
||||
"effective_budget":effective_budget,
|
||||
"mandatory_overage":campaign.resolution_cover.as_ref().map(|cover| cover.mandatory_overage).unwrap_or(0),
|
||||
"pins":campaign.resolution_pins.values().collect::<Vec<_>>(),
|
||||
"fission_targets":campaign.agency_profiles.values().filter(|profile| profile.active_leaf && profile.subject_kind == crate::domain::AgencySubjectKind::Gestalt).filter_map(|profile| campaign.gestalts.get(&profile.subject_id).map(|gestalt| json!({"id":gestalt.id,"name":gestalt.name}))).collect::<Vec<_>>()
|
||||
"pin_count":campaign.resolution_pins.len(),
|
||||
"fission_targets":campaign.agency_profiles.values().filter(|profile| profile.active_leaf && profile.subject_kind == crate::domain::AgencySubjectKind::Gestalt).filter_map(|profile| campaign.gestalts.get(&profile.subject_id)).filter(|gestalt|gestalt.home_location_id==player.location_id).map(|gestalt| json!({"id":gestalt.id,"name":gestalt.name})).collect::<Vec<_>>()
|
||||
},
|
||||
"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":[]},
|
||||
|
|
@ -365,12 +365,58 @@ mod tests {
|
|||
event_ids: vec!["event:public".into()],
|
||||
reliability: "direct institutional channel".into(),
|
||||
});
|
||||
campaign.resolution_pins.insert(
|
||||
"secret-pin".into(),
|
||||
crate::domain::ResolutionPin {
|
||||
schema: "ghostlight.resolution_pin.v1".into(),
|
||||
id: "secret-pin".into(),
|
||||
kind: crate::domain::ResolutionPinKind::KeepSeparate,
|
||||
subject_ids: std::collections::BTreeSet::from(["SECRET_REMOTE_SUBJECT".into()]),
|
||||
reason: "SECRET_OPERATOR_REASON".into(),
|
||||
created_world_revision: 0,
|
||||
},
|
||||
);
|
||||
|
||||
let encoded = serde_json::to_string(&player_surface(&campaign, &[])).unwrap();
|
||||
let surface = player_surface(&campaign, &[]);
|
||||
let encoded = serde_json::to_string(&surface).unwrap();
|
||||
|
||||
assert!(!encoded.contains("SECRET_REMOTE_COUP_POSTURE"));
|
||||
assert!(!encoded.contains("SECRET_INVESTIGATION_CLOCK"));
|
||||
assert!(!encoded.contains("SECRET_ARREST_PLAN"));
|
||||
assert!(!encoded.contains("SECRET_REMOTE_SUBJECT"));
|
||||
assert!(!encoded.contains("SECRET_OPERATOR_REASON"));
|
||||
assert_eq!(surface["resolution"]["pin_count"], 1);
|
||||
assert!(encoded.contains("The public ferry is delayed."));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn player_surface_offers_only_local_population_fission_targets() {
|
||||
let mut campaign = crate::resolution::tests::campaign(1, 1);
|
||||
for (id, name, location) in [
|
||||
("local-neighbors", "Local neighbors", "center"),
|
||||
("remote-cell", "SECRET_REMOTE_POPULATION", "far-district"),
|
||||
] {
|
||||
campaign.gestalts.insert(
|
||||
id.into(),
|
||||
crate::domain::GestaltPersonaState {
|
||||
schema: "ghostlight.gestalt_persona_state.v1".into(),
|
||||
id: id.into(),
|
||||
name: name.into(),
|
||||
version: 0,
|
||||
home_location_id: location.into(),
|
||||
shared_capabilities: Default::default(),
|
||||
shared_knowledge: Default::default(),
|
||||
resources: Default::default(),
|
||||
goals: vec![],
|
||||
pressures: vec![],
|
||||
},
|
||||
);
|
||||
}
|
||||
crate::resolution::ensure_agency_profiles(&mut campaign);
|
||||
|
||||
let encoded = serde_json::to_string(&player_surface(&campaign, &[])).unwrap();
|
||||
|
||||
assert!(encoded.contains("Local neighbors"));
|
||||
assert!(!encoded.contains("SECRET_REMOTE_POPULATION"));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -821,6 +821,13 @@ 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.
|
||||
|
||||
The adjacent pin/fission surface had the same authority smell. Player HTTP now
|
||||
owns only active-cell budget, not resolution pins. The browser pin editor is
|
||||
deleted, the surface publishes only `pin_count`, and the command boundary
|
||||
rejects `ReplaceResolutionPins`. Fission candidates are restricted to active
|
||||
population leaves at the player's canonical current location; remote population
|
||||
names remain in the operator surface.
|
||||
|
||||
## Warnings
|
||||
|
||||
- Keep persistent state small. Git history and artifacts own chronology.
|
||||
|
|
|
|||
|
|
@ -299,15 +299,15 @@ order is no longer a fictional owner: a migration earlier in the apply loop
|
|||
cannot invalidate another subject's same-snapshot communication, and a late
|
||||
invalid action cannot leave earlier in-memory mutations behind.
|
||||
|
||||
The active cell budget and provider concurrency limit are separate controls.
|
||||
Budget and pins increment `resolution_epoch` without advancing world revision or
|
||||
fictional time. Provider concurrency increments only
|
||||
The active cell budget, operator-owned pins, and provider concurrency limit are
|
||||
separate controls. Budget and pins increment `resolution_epoch` without
|
||||
advancing world revision or fictional time. Provider concurrency increments only
|
||||
`provider_configuration_epoch`; it batches the same cover and cannot repartition
|
||||
the world. See `docs/architecture/ghostlight-multiresolution-agency.md`.
|
||||
|
||||
The browser command boundary is deliberately smaller than `WorldCommand`.
|
||||
Authenticated HTTP admits only player-owned Speak, unfilled Assess, Attempt,
|
||||
and Wait requests. Actor identity must match the campaign player. Compiler
|
||||
Wait, and active-cell-budget requests. Actor identity must match the campaign player. Compiler
|
||||
approval has its own route. Strategic ticks, region commits, gestalt presence,
|
||||
reaction waves, NPC initiative, and campaign creation are internal mailbox
|
||||
commands and cannot be invoked through `/api/command`.
|
||||
|
|
@ -331,6 +331,9 @@ 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.
|
||||
It likewise exposes only the number of operator pins and local active
|
||||
population leaves eligible for a fission preview. Pin bodies, remote population
|
||||
names, and `ReplaceResolutionPins` remain outside the player boundary.
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -101,4 +101,5 @@
|
|||
{"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-18T19:33:00Z","type":"deployment","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Starfire activated immutable release c4a3d6f38bc6f95a94404a52cbb3401f24a89aab with executable SHA-256 7a6fe39503cf62b9e6a496cda4e92f1d552f6c7f79a91e2b69e41c9d729ada61 and rollback 5e198dfa872a710d31e581dcf2cd0851bef01966. Typed health, manifest, active junction, PID 12164, four persisted campaigns, and DeepSeek readiness agree. Publication did not rotate or consume invitations."}
|
||||
{"ts":"2026-08-18T19:37:00Z","type":"security","status":"ok","branch":"codex/ghostlight-dungeon-mvp","note":"Restored resolution-control ownership at the player membrane. Players retain active_cell_budget control; ReplaceResolutionPins is rejected by the player HTTP boundary, the browser pin editor is deleted, and player projection exposes only pin_count rather than operator pin subjects/reasons. Player fission targets now contain only active population leaves at the canonical current location. Regressions prove remote pin bodies and a secret remote population name are absent while a local population remains available."}
|
||||
{"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."}
|
||||
|
|
|
|||
153
web/dist/assets/index-CXe_foJ-.js
vendored
Normal file
153
web/dist/assets/index-CXe_foJ-.js
vendored
Normal file
File diff suppressed because one or more lines are too long
153
web/dist/assets/index-DbDnq-RC.js
vendored
153
web/dist/assets/index-DbDnq-RC.js
vendored
File diff suppressed because one or more lines are too long
3
web/dist/index.html
vendored
3
web/dist/index.html
vendored
|
|
@ -1,5 +1,5 @@
|
|||
<!doctype html>
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-DbDnq-RC.js"></script>
|
||||
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>GhostlightDungeon</title> <script type="module" crossorigin src="/assets/index-CXe_foJ-.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-B7Qh0xAi.css">
|
||||
</head>
|
||||
<body><header><p class="eyebrow">STARFIRE / PRIVATE VERSE</p><h1>GhostlightDungeon</h1><p id="status" role="status" aria-live="polite">Reading the world…</p></header><main>
|
||||
|
|
@ -11,7 +11,6 @@
|
|||
<form id="destination-form"><p class="form-heading">Compile a destination without moving there</p><label for="destination-origin">Current location id</label><input id="destination-origin" name="origin_location_id" readonly required><label for="destination-request">Where do you want the world to extend?</label><input id="destination-request" name="destination" required><button type="submit">Retrieve destination</button></form>
|
||||
<section id="campaign-lab" hidden><h2>Campaign laboratory</h2><div id="campaign-list"></div>
|
||||
<form id="resolution-form"><label for="active-cell-budget">Active Persona-cell budget: <output id="active-cell-budget-value">8</output></label><input id="active-cell-budget" name="active_cell_budget" type="range" min="1" max="32" value="8"><p id="resolution-status"></p><button type="submit">Apply at safe boundary</button></form>
|
||||
<form id="pin-form"><label for="pin-kind">Resolution pin</label><select id="pin-kind" name="kind"><option value="minimum_individual_detail">Keep one subject individual</option><option value="keep_separate">Keep subjects separate</option><option value="keep_together">Keep subjects together</option></select><label for="pin-subjects">Exact subject IDs, comma separated</label><input id="pin-subjects" name="subject_ids" required><label for="pin-reason">Why preserve this cut?</label><input id="pin-reason" name="reason" required><button type="submit">Add pin</button><div id="pin-list"></div></form>
|
||||
<form id="fission-form"><p class="form-heading">Approval-gated population fission</p><label for="fission-parent">Population</label><select name="parent_gestalt_id" id="fission-parent" required></select><label for="fission-axis">Partition axis</label><select id="fission-axis" name="partition_axis"><option value="geography">Geography</option><option value="ideology">Ideology</option><option value="authority">Authority</option><option value="economy_role">Economic role</option><option value="species_body">Species/body</option><option value="information">Information</option></select><label for="fission-values">Named cuts, comma separated</label><input id="fission-values" name="requested_partition_values" required><label for="fission-reason">Why does this population need canonical leaves?</label><input id="fission-reason" name="reason" required><button type="submit">Compile fission preview</button></form>
|
||||
<form id="fork-form"><label for="fork-name">Fork name</label><input id="fork-name" name="name" required><button type="submit">Fork selected campaign</button></form><form id="reset-form"><label for="reset-name">Reset branch name</label><input id="reset-name" name="name" required><button type="submit">Reset from selected branch seed</button></form><a href="/api/campaigns/export" download>Export selected CultCache .cc</a> <a href="/api/campaigns/canon-candidates.md" download>Export canon candidates Markdown</a><details><summary>Operator inspector</summary><form id="provider-parallelism-form"><label for="provider-parallelism">Provider request parallelism: <output id="provider-parallelism-value">8</output></label><input id="provider-parallelism" type="range" min="1" max="32" value="8"><button type="submit">Apply operator limit</button></form><button type="button" id="load-operator">Load private state and receipts</button><div id="operator-output"></div></details></section>
|
||||
</main></body></html>
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
<form id="destination-form"><p class="form-heading">Compile a destination without moving there</p><label for="destination-origin">Current location id</label><input id="destination-origin" name="origin_location_id" readonly required><label for="destination-request">Where do you want the world to extend?</label><input id="destination-request" name="destination" required><button type="submit">Retrieve destination</button></form>
|
||||
<section id="campaign-lab" hidden><h2>Campaign laboratory</h2><div id="campaign-list"></div>
|
||||
<form id="resolution-form"><label for="active-cell-budget">Active Persona-cell budget: <output id="active-cell-budget-value">8</output></label><input id="active-cell-budget" name="active_cell_budget" type="range" min="1" max="32" value="8"><p id="resolution-status"></p><button type="submit">Apply at safe boundary</button></form>
|
||||
<form id="pin-form"><label for="pin-kind">Resolution pin</label><select id="pin-kind" name="kind"><option value="minimum_individual_detail">Keep one subject individual</option><option value="keep_separate">Keep subjects separate</option><option value="keep_together">Keep subjects together</option></select><label for="pin-subjects">Exact subject IDs, comma separated</label><input id="pin-subjects" name="subject_ids" required><label for="pin-reason">Why preserve this cut?</label><input id="pin-reason" name="reason" required><button type="submit">Add pin</button><div id="pin-list"></div></form>
|
||||
<form id="fission-form"><p class="form-heading">Approval-gated population fission</p><label for="fission-parent">Population</label><select name="parent_gestalt_id" id="fission-parent" required></select><label for="fission-axis">Partition axis</label><select id="fission-axis" name="partition_axis"><option value="geography">Geography</option><option value="ideology">Ideology</option><option value="authority">Authority</option><option value="economy_role">Economic role</option><option value="species_body">Species/body</option><option value="information">Information</option></select><label for="fission-values">Named cuts, comma separated</label><input id="fission-values" name="requested_partition_values" required><label for="fission-reason">Why does this population need canonical leaves?</label><input id="fission-reason" name="reason" required><button type="submit">Compile fission preview</button></form>
|
||||
<form id="fork-form"><label for="fork-name">Fork name</label><input id="fork-name" name="name" required><button type="submit">Fork selected campaign</button></form><form id="reset-form"><label for="reset-name">Reset branch name</label><input id="reset-name" name="name" required><button type="submit">Reset from selected branch seed</button></form><a href="/api/campaigns/export" download>Export selected CultCache .cc</a> <a href="/api/campaigns/canon-candidates.md" download>Export canon candidates Markdown</a><details><summary>Operator inspector</summary><form id="provider-parallelism-form"><label for="provider-parallelism">Provider request parallelism: <output id="provider-parallelism-value">8</output></label><input id="provider-parallelism" type="range" min="1" max="32" value="8"><button type="submit">Apply operator limit</button></form><button type="button" id="load-operator">Load private state and receipts</button><div id="operator-output"></div></details></section>
|
||||
</main><script type="module" src="/src/main.ts"></script></body></html>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ let revision = 0;
|
|||
let playerActorId = "";
|
||||
let resolutionEpoch = 0;
|
||||
let providerConfigurationEpoch = 0;
|
||||
let resolutionPins: any[] = [];
|
||||
let requestInFlight = false;
|
||||
const controlsDisabledByRequest = new Set<HTMLButtonElement | HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>();
|
||||
|
||||
|
|
@ -132,7 +131,6 @@ async function refresh() {
|
|||
document.querySelector<HTMLInputElement>("#destination-origin")!.value = playerLocationId;
|
||||
resolutionEpoch = Number(surface.resolution?.policy?.resolution_epoch ?? 0);
|
||||
providerConfigurationEpoch = Number(surface.resolution?.policy?.provider_configuration_epoch ?? 0);
|
||||
resolutionPins = surface.resolution?.pins ?? [];
|
||||
const budget = Number(surface.resolution?.policy?.active_cell_budget ?? 8);
|
||||
const budgetInput = document.querySelector<HTMLInputElement>("#active-cell-budget")!;
|
||||
budgetInput.value = String(budget);
|
||||
|
|
@ -141,20 +139,6 @@ async function refresh() {
|
|||
const providerParallelism = Number(surface.resolution?.policy?.provider_parallelism ?? 8);
|
||||
document.querySelector<HTMLInputElement>("#provider-parallelism")!.value = String(providerParallelism);
|
||||
document.querySelector<HTMLOutputElement>("#provider-parallelism-value")!.value = String(providerParallelism);
|
||||
const pinList = document.querySelector<HTMLElement>("#pin-list")!;
|
||||
pinList.replaceChildren();
|
||||
if (resolutionPins.length === 0) pinList.append(node("p", "No persistent pins."));
|
||||
for (const pin of resolutionPins) {
|
||||
const row = node("p");
|
||||
row.append(node("code", String(pin.kind)), document.createTextNode(` ${[...pin.subject_ids].join(", ")} — ${pin.reason} `));
|
||||
const remove = node("button", "Remove");
|
||||
remove.type = "button";
|
||||
remove.addEventListener("click", async () => {
|
||||
await send({ type: "replace_resolution_pins", expected_revision: revision, expected_resolution_epoch: resolutionEpoch, pins: resolutionPins.filter(candidate => candidate.id !== pin.id) });
|
||||
});
|
||||
row.append(remove);
|
||||
pinList.append(row);
|
||||
}
|
||||
const fissionParent = document.querySelector<HTMLSelectElement>("#fission-parent")!;
|
||||
fissionParent.replaceChildren(...(surface.resolution?.fission_targets ?? []).map((target: any) => {
|
||||
const option = node("option", `${target.name} · ${target.id}`);
|
||||
|
|
@ -332,20 +316,6 @@ document.querySelector<HTMLFormElement>("#provider-parallelism-form")!.addEventL
|
|||
await refresh();
|
||||
});
|
||||
});
|
||||
document.querySelector<HTMLFormElement>("#pin-form")!.addEventListener("submit", async event => {
|
||||
event.preventDefault();
|
||||
const data = new FormData(event.currentTarget as HTMLFormElement);
|
||||
const subjectIds = String(data.get("subject_ids") ?? "").split(",").map(value => value.trim()).filter(Boolean);
|
||||
const pin = {
|
||||
schema: "ghostlight.resolution_pin.v1",
|
||||
id: `pin:${crypto.randomUUID()}`,
|
||||
kind: String(data.get("kind")),
|
||||
subject_ids: subjectIds,
|
||||
reason: String(data.get("reason") ?? "").trim(),
|
||||
created_world_revision: revision,
|
||||
};
|
||||
await send({ type: "replace_resolution_pins", expected_revision: revision, expected_resolution_epoch: resolutionEpoch, pins: [...resolutionPins, pin] });
|
||||
});
|
||||
destinationForm.addEventListener("submit", async event => {
|
||||
event.preventDefault();
|
||||
const result = await compilerPost("/api/compiler/destination", Object.fromEntries(new FormData(destinationForm)));
|
||||
|
|
|
|||
Loading…
Reference in a new issue