B4: the simulation report shows her open promises as her packet showed them, the state proposed, and what the commit opened and refused; the stale 'state does not evolve' banner and its pin are gone
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
22dc495647
commit
f3e9c5258f
2 changed files with 61 additions and 2 deletions
|
|
@ -680,10 +680,40 @@ fn transcript_line(line: &Value) -> String {
|
|||
format!("- r{} {} **{who}**{woke}: {}", line["round"], line["room"].as_str().unwrap_or_default(), one_line(line["says"].as_str().unwrap_or_default()))
|
||||
}
|
||||
|
||||
/// What a turn did to her promises, as the report shows it (B4): the open-promises section her packet showed her, the
|
||||
/// state changes the Interpreter proposed, and what the commit opened and refused.
|
||||
fn promises_markdown(out: &mut String, turn: &Value) {
|
||||
let context = turn["report"]["packet"]["context"].as_str().unwrap_or_default();
|
||||
let section: Vec<&str> = context.lines().skip_while(|line| !line.ends_with(" open promises:")).take_while(|line| line.ends_with(" open promises:") || line.starts_with("- ")).collect();
|
||||
if !section.is_empty() {
|
||||
let _ = writeln!(out, "Open promises, as her packet showed them:\n\n````text\n{}\n````\n", section.join("\n"));
|
||||
}
|
||||
let proposed = turn["report"]["renders"][0]["interpreter"]["state"].as_array().cloned().unwrap_or_default();
|
||||
if !proposed.is_empty() {
|
||||
let _ = writeln!(out, "State proposed:\n");
|
||||
for proposal in &proposed {
|
||||
let _ = writeln!(out, "- `{proposal}`");
|
||||
}
|
||||
out.push('\n');
|
||||
}
|
||||
let committed = &turn["committed"];
|
||||
let opened = committed["opened"].as_array().cloned().unwrap_or_default();
|
||||
let refused = committed["refused"].as_array().cloned().unwrap_or_default();
|
||||
if !opened.is_empty() || !refused.is_empty() {
|
||||
let _ = writeln!(out, "Committed:\n");
|
||||
for entry in &opened {
|
||||
let _ = writeln!(out, "- opened `{}` ({}, to {}): {}", entry["id"].as_str().unwrap_or_default(), entry["status"].as_str().unwrap_or_default(), entry["to"].as_str().unwrap_or("the room"), entry["words"].as_str().unwrap_or_default());
|
||||
}
|
||||
for one in &refused {
|
||||
let _ = writeln!(out, "- refused ({}): `{}`", one["reason"].as_str().unwrap_or_default(), one["proposal"]);
|
||||
}
|
||||
out.push('\n');
|
||||
}
|
||||
}
|
||||
|
||||
fn markdown(plan_path: &Path, plan: &SimFile, members: &[Member], group_state: Option<bool>, runs: &[Value]) -> String {
|
||||
let mut out = String::new();
|
||||
let _ = writeln!(out, "# Swarm simulation\n");
|
||||
let _ = writeln!(out, "> **State does not evolve during a run.** The Interpreter (C3b) and the commit (C3c) are not built, so every persona starts each turn from the state the plan gave her. `state_after_turn` in `projection/simulate.rs` is the seam where they will move it between rounds. Freshness carries over: each persona's earlier packets in the run count against repeating an item.\n");
|
||||
let _ = writeln!(out, "> **What came of her last turn opens her next packet.** Each persona's turn record (the Interpreter's decision and the lines the room appended for her) is carried to her next turn, as the commit's trace will carry it live; a turn's details show what she was told of it.\n");
|
||||
let _ = writeln!(out, "> **Speech is the Interpreter's.** What she says is decided from her prose by the Interpreter's speech step (C3b, one tool-less structured call), which chooses among the drafts she set down between `<typed>` marks: each line is one whole draft of hers, exactly as she typed it, in the one room she may speak in; whose words a draft carries is the Interpreter's judgement. Its structured mentions and reply target are the only explicit addressees; an `@` in the text tags no one.\n");
|
||||
let _ = writeln!(out, "- plan: `{}`", plan_path.display());
|
||||
|
|
@ -771,6 +801,7 @@ fn markdown(plan_path: &Path, plan: &SimFile, members: &[Member], group_state: O
|
|||
}
|
||||
let _ = writeln!(out, "Stimulus:\n\n````text\n{}\n````\n", report["packet"]["stimulus"].as_str().unwrap_or_default());
|
||||
turn_markdown(&mut out, &report["renders"][0]);
|
||||
promises_markdown(&mut out, turn);
|
||||
}
|
||||
let _ = writeln!(out, "</details>\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ fn the_report_names_its_gaps_and_carries_representative_lines_and_usage() {
|
|||
let model = chatty();
|
||||
let harness = Harness { instance: "eureka".into(), persona: None, model: Some(&model), tuning: dir.path().join("persona-tuning.toml") };
|
||||
let report = simulate(&harness, &plan(dir.path(), "\"ruled\"", 3, "")).unwrap();
|
||||
for part in ["# Swarm simulation", "State does not evolve during a run", "Speech is the Interpreter's", "group state in the Projector's packet: on", "### Representative lines", "**Meta (human)**: good afternoon, everyone", "**Tobiah** _(woke: human)_: what a day", "### Wakes by round", "| 1 | 0 | 2 | 0 | 0 | 0 |", "## Total usage", "| claude-sonnet-5-5 | 6 |"] {
|
||||
for part in ["# Swarm simulation", "Speech is the Interpreter's", "group state in the Projector's packet: on", "### Representative lines", "**Meta (human)**: good afternoon, everyone", "**Tobiah** _(woke: human)_: what a day", "### Wakes by round", "| 1 | 0 | 2 | 0 | 0 | 0 |", "## Total usage", "| claude-sonnet-5-5 | 6 |"] {
|
||||
assert!(report.contains(part), "{part}\n{report}");
|
||||
}
|
||||
}
|
||||
|
|
@ -688,3 +688,31 @@ says = "good afternoon, everyone"
|
|||
assert!(!with.is_empty() && with.len() < projector.len(), "{} of {}", with.len(), projector.len());
|
||||
assert!(with.iter().all(|prompt| !prompt.contains("Libby Test")), "only his packets carry his domain");
|
||||
}
|
||||
|
||||
/// B4: the report shows what is verified: her open promises as her packet showed them, the state proposed, and what the
|
||||
/// commit opened and refused. The stale banner that said state does not evolve is gone.
|
||||
#[test]
|
||||
fn b4_a_turns_details_show_her_promises_the_proposals_and_the_commit() {
|
||||
let turn = json!({
|
||||
"report": {
|
||||
"packet": { "context": "What came of his last turn:\n- x.\nHis open promises:\n- to Meta, 2 h ago, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\nHere and now:\n- now: Friday" },
|
||||
"renders": [{ "interpreter": { "state": [{ "kind": "promise_close", "promise": "c1", "how": "withdrawn", "evidence": { "draft": 1 } }] } }]
|
||||
},
|
||||
"committed": {
|
||||
"opened": [{ "id": "c-r1-t2-1", "status": "blocked", "to": "@meta:gamecult.org", "words": "send the render tonight" }],
|
||||
"refused": [{ "proposal": { "kind": "promise_close", "promise": "c1", "how": "kept" }, "reason": "blocked_not_keepable" }]
|
||||
}
|
||||
});
|
||||
let mut out = String::new();
|
||||
promises_markdown(&mut out, &turn);
|
||||
for part in [
|
||||
"Open promises, as her packet showed them:\n\n````text\nHis open promises:\n- to Meta, 2 h ago, in #minds:gamecult.org, his promise: \"I'll send the render tonight.\". He has no way to do it yet.\n````",
|
||||
"State proposed:\n\n- `{",
|
||||
"\"how\":\"withdrawn\"",
|
||||
"- opened `c-r1-t2-1` (blocked, to @meta:gamecult.org): send the render tonight",
|
||||
"- refused (blocked_not_keepable):",
|
||||
] {
|
||||
assert!(out.contains(part), "{part}\n---\n{out}");
|
||||
}
|
||||
assert!(!include_str!("../simulate.rs").contains(concat!("State does not ", "evolve")), "the stale banner is gone");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue