Persona K37 fix-up: the hold clauses name the asker, not by pronoun, so the frame keeps only her pronouns; tests expect the holds fields
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7250f10ece
commit
f5a7033157
3 changed files with 101 additions and 101 deletions
|
|
@ -8,7 +8,7 @@ A draft is speech only when his prose shows him choosing to send it now. Wonderi
|
|||
|
||||
He speaks only in this room. What he knows privately is listed below as private: he says none of it here, and nothing that gives it away. A private matter may be said plainly only to the person it concerns, in a direct message with exactly that person; nothing listed is that here. Whether a draft fits who is listening is yours to judge.
|
||||
|
||||
Answer with the speech contract's object. `say` lists the drafts he sends now, each by its number, with the Matrix ids of anyone listed whom he addresses directly (`mentions`), the id of the line listed below that he answers or passes on (`in_reply_to`, or null: the room shows that line, with who said it, above his own words), and what the draft promises or offers (`promises`, a list, empty when it promises nothing): for each act it promises or offers, its words, copied exactly, the Matrix id of the person listed to whom he promises it (`to`, null when he promises it to the room), when it promises again one of his open promises listed below to the same person, that promise's id (`reaffirms`, else null): a promise said again is the same promise, never a new one; and what keeping it needs (`needs`): `words` when what he already has keeps it; finding anything out is a `read`, naming what to read in `read`, or `lacking` when no read reaches it. `gaps` records what he meant and did not send. `unsent` accounts for each of his drafts this answer neither sends (in `say`, `amend` or `suggest`) nor records as a gap: held, when his prose shows him choosing not to send it, quoting those words of his thought (`quote`); superseded, when a later draft or later prose of his replaces it, quoting those later words. Every draft is accounted for: one left out fails the answer. A draft to someone who spoke to him this turn is held only when his prose says he holds it. `amend` adds to one of his own lines listed below, at most one a turn, only when his thought shows him choosing to correct or add to that line: name the line by its id, the draft that is his addition, and what it promises, as a line's `promises`. The line stays as it was and the draft is added after it; he never takes a word back. `suggest` leaves Self one note, at most one a turn, only when his thought shows him choosing to: name the draft that is the note, its kind (feedback when he passes on what someone listed said, with that person's Matrix id in `about`; idea when it is his own, `about` null), and set `private` when it carries anything listed as private or gives it away; such a note is not left. `state` closes his open promises listed below, each by its id: kept, citing the draft by which he does it (`evidence.draft`); withdrawn, citing the draft in which he takes it back to the person he promised, or tells them he cannot do it; released, citing the id of the line listed below that he may reply to in which the person he promised lets him off it (`evidence.line`). A release says he no longer owes it; patience is not a release, so "no hurry" or "whenever you've read it is fine" leaves the promise open. Every close also quotes in `thought` the words of his prose here that take it up, copied exactly from his thought outside every draft between <typed> and </typed>, and `still_stands` is true when anything in his prose here holds the promise as still owed or not yet done ("the promise stays open until I've read it"): then it is not closed. A draft cited closes the promise only when it goes out this turn where the person he promised can read it, in the room where he made the promise or in a direct message with them, and a thought alone closes nothing. A promise he has no way to do is never kept by him: telling the person he promised that he cannot do it withdraws it, and that person can release it. `reopen` names a promise listed below as closed whose close his own words here say was wrong, that it is not done: copy those words exactly from his prose or a draft (`words`), and type what keeping it needs (`needs`) as for a new promise, or null to keep what it needed; else it is empty. `hold` opens a hold when a line listed below asks him not to post or share something somewhere yet: the line's id, the words of that line that name what is held and where, copied exactly (`words`), and `where`: here for the room the line is in, anywhere when it names no place. `holds`, on each line and addition, names every hold listed below, or line this answer opens a hold from, whose held thing this draft puts where it goes; else empty. `hold_released` closes a hold listed below when the person who asked lets it go: their line's id (`line`), or the words of his thought here recording that they did (`thought`).
|
||||
Answer with the speech contract's object. `say` lists the drafts he sends now, each by its number, with the Matrix ids of anyone listed whom he addresses directly (`mentions`), the id of the line listed below that he answers or passes on (`in_reply_to`, or null: the room shows that line, with who said it, above his own words), and what the draft promises or offers (`promises`, a list, empty when it promises nothing): for each act it promises or offers, its words, copied exactly, the Matrix id of the person listed to whom he promises it (`to`, null when he promises it to the room), when it promises again one of his open promises listed below to the same person, that promise's id (`reaffirms`, else null): a promise said again is the same promise, never a new one; and what keeping it needs (`needs`): `words` when what he already has keeps it; finding anything out is a `read`, naming what to read in `read`, or `lacking` when no read reaches it. `gaps` records what he meant and did not send. `unsent` accounts for each of his drafts this answer neither sends (in `say`, `amend` or `suggest`) nor records as a gap: held, when his prose shows him choosing not to send it, quoting those words of his thought (`quote`); superseded, when a later draft or later prose of his replaces it, quoting those later words. Every draft is accounted for: one left out fails the answer. A draft to someone who spoke to him this turn is held only when his prose says he holds it. `amend` adds to one of his own lines listed below, at most one a turn, only when his thought shows him choosing to correct or add to that line: name the line by its id, the draft that is his addition, and what it promises, as a line's `promises`. The line stays as it was and the draft is added after it; he never takes a word back. `suggest` leaves Self one note, at most one a turn, only when his thought shows him choosing to: name the draft that is the note, its kind (feedback when he passes on what someone listed said, with that person's Matrix id in `about`; idea when it is his own, `about` null), and set `private` when it carries anything listed as private or gives it away; such a note is not left. `state` closes his open promises listed below, each by its id: kept, citing the draft by which he does it (`evidence.draft`); withdrawn, citing the draft in which he takes it back to the person he promised, or tells them he cannot do it; released, citing the id of the line listed below that he may reply to in which the person he promised lets him off it (`evidence.line`). A release says he no longer owes it; patience is not a release, so "no hurry" or "whenever you've read it is fine" leaves the promise open. Every close also quotes in `thought` the words of his prose here that take it up, copied exactly from his thought outside every draft between <typed> and </typed>, and `still_stands` is true when anything in his prose here holds the promise as still owed or not yet done ("the promise stays open until I've read it"): then it is not closed. A draft cited closes the promise only when it goes out this turn where the person he promised can read it, in the room where he made the promise or in a direct message with them, and a thought alone closes nothing. A promise he has no way to do is never kept by him: telling the person he promised that he cannot do it withdraws it, and that person can release it. `reopen` names a promise listed below as closed whose close his own words here say was wrong, that it is not done: copy those words exactly from his prose or a draft (`words`), and type what keeping it needs (`needs`) as for a new promise, or null to keep what it needed; else it is empty. `hold` opens a hold when a line listed below asks him not to post or share something somewhere yet: the line's id, the words of that line that name what is held and where, copied exactly (`words`), and `where`: here for the room the line is in, anywhere when it names no place. `holds`, on each line and addition, names every hold listed below, or line this answer opens a hold from, whose held thing this draft puts where it goes; else empty. `hold_released` closes a hold listed below when the person who asked lets it go: the id of the asker's line (`line`), or the words of his thought here recording that the asker did (`thought`).
|
||||
|
||||
A draft is said whole or not at all, and only once. At most two drafts a turn. Record a gap instead of guessing: addressee when he means to send a draft but whom to is unclear, elsewhere when he means a draft for another room or another time; for these two, name the draft by number. missing_affordance when he means to do something, now or later, that his body cannot do (what he can do here is listed below), whether he said so in a draft or only thought it; name the draft when there is one. unwritten when he means to say something now and wrote no draft of it. Holding back is no gap: when his thought shows him choosing to wait, to let something stand, to leave it for later or to say nothing, record nothing for it. Every other intent of his that is not carried out has a kind: an intent to act is missing_affordance, an intent to say now with no draft is unwritten. When a gap names no draft, quote the words of his thought that show it, at least four words, copied exactly.
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ fn speech_frame_tail(her: Forms) -> String {
|
|||
format!(
|
||||
"{cap_subj} speak{s} only in this room. What {subj} know{s} privately is listed below as private: {subj} say{s} none of it here, and nothing that gives it away. A private matter may be said plainly only to the person it concerns, in a direct message with exactly that person; nothing listed is that here. Whether a draft fits who is listening is yours to judge.
|
||||
|
||||
Answer with the speech contract's object. `say` lists the drafts {subj} send{s} now, each by its number, with the Matrix ids of anyone listed whom {subj} address{es} directly (`mentions`), the id of the line listed below that {subj} answer{s} or pass{es} on (`in_reply_to`, or null: the room shows that line, with who said it, above {poss} own words), and what the draft promises or offers (`promises`, a list, empty when it promises nothing): for each act it promises or offers, its words, copied exactly, the Matrix id of the person listed to whom {subj} promise{s} it (`to`, null when {subj} promise{s} it to the room), when it promises again one of {poss} open promises listed below to the same person, that promise's id (`reaffirms`, else null): a promise said again is the same promise, never a new one; and what keeping it needs (`needs`): `words` when what {subj} already {has} keeps it; finding anything out is a `read`, naming what to read in `read`, or `lacking` when no read reaches it. `gaps` records what {subj} meant and did not send. `unsent` accounts for each of {poss} drafts this answer neither sends (in `say`, `amend` or `suggest`) nor records as a gap: held, when {poss} prose shows {obj} choosing not to send it, quoting those words of {poss} thought (`quote`); superseded, when a later draft or later prose of {poss} replaces it, quoting those later words. Every draft is accounted for: one left out fails the answer. A draft to someone who spoke to {obj} this turn is held only when {poss} prose says {subj} hold{s} it. `amend` adds to one of {poss} own lines listed below, at most one a turn, only when {poss} thought shows {obj} choosing to correct or add to that line: name the line by its id, the draft that is {poss} addition, and what it promises, as a line's `promises`. The line stays as it was and the draft is added after it; {subj} never take{s} a word back. `suggest` leaves Self one note, at most one a turn, only when {poss} thought shows {obj} choosing to: name the draft that is the note, its kind (feedback when {subj} pass{es} on what someone listed said, with that person's Matrix id in `about`; idea when it is {poss} own, `about` null), and set `private` when it carries anything listed as private or gives it away; such a note is not left. `state` closes {poss} open promises listed below, each by its id: kept, citing the draft by which {subj} {does} it (`evidence.draft`); withdrawn, citing the draft in which {subj} take{s} it back to the person {subj} promised, or tell{s} them {subj} cannot do it; released, citing the id of the line listed below that {subj} may reply to in which the person {subj} promised lets {obj} off it (`evidence.line`). A release says {subj} no longer owe{s} it; patience is not a release, so \"no hurry\" or \"whenever you've read it is fine\" leaves the promise open. Every close also quotes in `thought` the words of {poss} prose here that take it up, copied exactly from {poss} thought outside every draft between <typed> and </typed>, and `still_stands` is true when anything in {poss} prose here holds the promise as still owed or not yet done (\"the promise stays open until I've read it\"): then it is not closed. A draft cited closes the promise only when it goes out this turn where the person {subj} promised can read it, in the room where {subj} made the promise or in a direct message with them, and a thought alone closes nothing. A promise {subj} {has} no way to do is never kept by {obj}: telling the person {subj} promised that {subj} cannot do it withdraws it, and that person can release it. `reopen` names a promise listed below as closed whose close {poss} own words here say was wrong, that it is not done: copy those words exactly from {poss} prose or a draft (`words`), and type what keeping it needs (`needs`) as for a new promise, or null to keep what it needed; else it is empty. `hold` opens a hold when a line listed below asks {obj} not to post or share something somewhere yet: the line's id, the words of that line that name what is held and where, copied exactly (`words`), and `where`: here for the room the line is in, anywhere when it names no place. `holds`, on each line and addition, names every hold listed below, or line this answer opens a hold from, whose held thing this draft puts where it goes; else empty. `hold_released` closes a hold listed below when the person who asked lets it go: their line's id (`line`), or the words of {poss} thought here recording that they did (`thought`).
|
||||
Answer with the speech contract's object. `say` lists the drafts {subj} send{s} now, each by its number, with the Matrix ids of anyone listed whom {subj} address{es} directly (`mentions`), the id of the line listed below that {subj} answer{s} or pass{es} on (`in_reply_to`, or null: the room shows that line, with who said it, above {poss} own words), and what the draft promises or offers (`promises`, a list, empty when it promises nothing): for each act it promises or offers, its words, copied exactly, the Matrix id of the person listed to whom {subj} promise{s} it (`to`, null when {subj} promise{s} it to the room), when it promises again one of {poss} open promises listed below to the same person, that promise's id (`reaffirms`, else null): a promise said again is the same promise, never a new one; and what keeping it needs (`needs`): `words` when what {subj} already {has} keeps it; finding anything out is a `read`, naming what to read in `read`, or `lacking` when no read reaches it. `gaps` records what {subj} meant and did not send. `unsent` accounts for each of {poss} drafts this answer neither sends (in `say`, `amend` or `suggest`) nor records as a gap: held, when {poss} prose shows {obj} choosing not to send it, quoting those words of {poss} thought (`quote`); superseded, when a later draft or later prose of {poss} replaces it, quoting those later words. Every draft is accounted for: one left out fails the answer. A draft to someone who spoke to {obj} this turn is held only when {poss} prose says {subj} hold{s} it. `amend` adds to one of {poss} own lines listed below, at most one a turn, only when {poss} thought shows {obj} choosing to correct or add to that line: name the line by its id, the draft that is {poss} addition, and what it promises, as a line's `promises`. The line stays as it was and the draft is added after it; {subj} never take{s} a word back. `suggest` leaves Self one note, at most one a turn, only when {poss} thought shows {obj} choosing to: name the draft that is the note, its kind (feedback when {subj} pass{es} on what someone listed said, with that person's Matrix id in `about`; idea when it is {poss} own, `about` null), and set `private` when it carries anything listed as private or gives it away; such a note is not left. `state` closes {poss} open promises listed below, each by its id: kept, citing the draft by which {subj} {does} it (`evidence.draft`); withdrawn, citing the draft in which {subj} take{s} it back to the person {subj} promised, or tell{s} them {subj} cannot do it; released, citing the id of the line listed below that {subj} may reply to in which the person {subj} promised lets {obj} off it (`evidence.line`). A release says {subj} no longer owe{s} it; patience is not a release, so \"no hurry\" or \"whenever you've read it is fine\" leaves the promise open. Every close also quotes in `thought` the words of {poss} prose here that take it up, copied exactly from {poss} thought outside every draft between <typed> and </typed>, and `still_stands` is true when anything in {poss} prose here holds the promise as still owed or not yet done (\"the promise stays open until I've read it\"): then it is not closed. A draft cited closes the promise only when it goes out this turn where the person {subj} promised can read it, in the room where {subj} made the promise or in a direct message with them, and a thought alone closes nothing. A promise {subj} {has} no way to do is never kept by {obj}: telling the person {subj} promised that {subj} cannot do it withdraws it, and that person can release it. `reopen` names a promise listed below as closed whose close {poss} own words here say was wrong, that it is not done: copy those words exactly from {poss} prose or a draft (`words`), and type what keeping it needs (`needs`) as for a new promise, or null to keep what it needed; else it is empty. `hold` opens a hold when a line listed below asks {obj} not to post or share something somewhere yet: the line's id, the words of that line that name what is held and where, copied exactly (`words`), and `where`: here for the room the line is in, anywhere when it names no place. `holds`, on each line and addition, names every hold listed below, or line this answer opens a hold from, whose held thing this draft puts where it goes; else empty. `hold_released` closes a hold listed below when the person who asked lets it go: the id of the asker's line (`line`), or the words of {poss} thought here recording that the asker did (`thought`).
|
||||
|
||||
A draft is said whole or not at all, and only once. At most two drafts a turn. Record a gap instead of guessing: addressee when {subj} mean{s} to send a draft but whom to is unclear, elsewhere when {subj} mean{s} a draft for another room or another time; for these two, name the draft by number. missing_affordance when {subj} mean{s} to do something, now or later, that {poss} body cannot do (what {subj} can do here is listed below), whether {subj} said so in a draft or only thought it; name the draft when there is one. unwritten when {subj} mean{s} to say something now and wrote no draft of it. Holding back is no gap: when {poss} thought shows {obj} choosing to wait, to let something stand, to leave it for later or to say nothing, record nothing for it. Every other intent of {poss} that is not carried out has a kind: an intent to act is missing_affordance, an intent to say now with no draft is unwritten. When a gap names no draft, quote the words of {poss} thought that show it, at least four words, copied exactly.",
|
||||
es = if s.is_empty() { "" } else { "es" },
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ fn k21_a_lines_promises_words_found_in_it_are_the_promise_gap() {
|
|||
let twice = answered(&packet(), prose, json!({ "say": [{ "draft": 1, "mentions": [], "in_reply_to": null, "promises": [{ "words": "I'll send the render tonight.", "to": null, "needs": { "kind": "lacking", "read": null } }] }], "gaps": [{ "kind": "missing_affordance", "draft": 1, "quote": null, "detail": "" }] }));
|
||||
assert_eq!(twice["gaps"].as_array().unwrap().len(), 1, "{twice}");
|
||||
let prompt = speech_prompt(&packet(), "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("(`promises`, a list, empty when it promises nothing)") && SPEECH_SCHEMA.contains(r#""required":["draft","mentions","in_reply_to","promises"]"#), "{prompt}");
|
||||
assert!(prompt.contains("(`promises`, a list, empty when it promises nothing)") && SPEECH_SCHEMA.contains(r#""required":["draft","mentions","in_reply_to","holds","promises"]"#), "{prompt}");
|
||||
}
|
||||
|
||||
/// Soul's probe at 0cfc386: the reach names no draft and quotes the said one by its words. It is the promise on that draft,
|
||||
|
|
@ -732,7 +732,7 @@ fn k21_a_promise_is_four_words_or_more_found_case_blind_and_an_addition_carries_
|
|||
assert_eq!(amend(json!("send"))["promises_unused"][0]["why"], "fewer than four words");
|
||||
assert!(amend(Value::Null)["gaps"].as_array().unwrap().is_empty());
|
||||
let prompt = speech_prompt(&amendable_packet(), "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("and what it promises, as a line's `promises`") && SPEECH_SCHEMA.contains(r#""required":["target","draft","promises"]"#), "{prompt}");
|
||||
assert!(prompt.contains("and what it promises, as a line's `promises`") && SPEECH_SCHEMA.contains(r#""required":["target","draft","holds","promises"]"#), "{prompt}");
|
||||
}
|
||||
|
||||
/// B1: the Interpreter is told that telling the person she cannot do it is a withdrawal, the close of a blocked promise.
|
||||
|
|
@ -764,7 +764,7 @@ fn b3_a_line_carries_several_promises_and_each_undoable_one_is_its_own_gap() {
|
|||
assert_eq!(both["gaps"].as_array().unwrap().len(), 2, "{both}");
|
||||
let prompt = speech_prompt(&packet(), "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("`words` when what he already has keeps it; finding anything out is a `read`, naming what to read in `read`, or `lacking` when no read reaches it."), "{prompt}");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["target","draft","promises"]"#));
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["target","draft","holds","promises"]"#));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
|
|
@ -812,7 +812,7 @@ fn k24_a_read_is_what_her_thought_reaches_for_and_nothing_a_model_made_up() {
|
|||
assert_eq!(cannot["read_refused"][0]["why"], "no_read_here", "{cannot}");
|
||||
let prompt = speech_prompt(&reading, "x", prose, &Tuning::default());
|
||||
assert!(prompt.contains("`read` names one thing he reaches for") && !speech_prompt(&packet(), "x", prose, &Tuning::default()).contains("`read` names"), "the read contract only on a turn that can read");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","read","unsent"]"#));
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"]"#));
|
||||
}
|
||||
|
||||
/// Soul's R6: a later call decides over the whole wake. Drafts are numbered across it and an earlier one may still be
|
||||
|
|
@ -1514,7 +1514,7 @@ fn k35_no_read_evidence() {
|
|||
let decision = decide(&model, "test", &reading_packet(), "The room is warm.", prose, &Tuning::default());
|
||||
assert_eq!((decision["state"].clone(), decision["state_unused"].as_array().map(Vec::len)), (json!([]), Some(1)), "{evidence}: {decision}");
|
||||
}
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","read","unsent"]"#) && SPEECH_SCHEMA.contains(r#""evidence":{"type":"object","additionalProperties":false,"required":["draft","line"],"#));
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"]"#) && SPEECH_SCHEMA.contains(r#""evidence":{"type":"object","additionalProperties":false,"required":["draft","line"],"#));
|
||||
assert!(!SPEECH_SCHEMA.contains(r#""need":"#));
|
||||
}
|
||||
|
||||
|
|
@ -1537,99 +1537,99 @@ fn k36_the_answer_carries_reopen() {
|
|||
{ "kind": "promise_reopen", "promise": "c1", "words": "I read only the description", "needs": null, "reached": false }
|
||||
]), "{decision}");
|
||||
assert_eq!(decision["state_unused"].as_array().map(Vec::len), Some(1), "{decision}");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","read","unsent"]"#));
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"]"#));
|
||||
assert!(speech_prompt(&nibu, "x", prose, &Tuning::default()).contains("`reopen` names a promise listed below as closed whose close his own words here say was wrong"));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// K37 (map 16.28.5): the gate on a draft. The X.1 lines are R13's verbatim (`variants/R13/sims/X.1.md` lines 81-84).
|
||||
|
||||
const X1_META_R1: &str = "Libby, write out the two-line welcome you'd post for newcomers, but hold it, don't post it in here yet. Heimdall still has to rule on whether we put a welcome mat out at all. Just tell me when it's ready.";
|
||||
const X1_HEIMDALL_R1: &str = "Meta, I'll rule on the welcome once Libby's two lines are ready, since I need to see what they point newcomers at. Libby, send me the draft when it's done. Don't post it yet.";
|
||||
/// Libby's r1 prose in R13 X.1, her draft whole as draft 1, and the line saying it is ready as draft 2.
|
||||
const X1_LIBBY_R1: &str = "Both of them asked for the same thing, so one draft can go to both. I'll say plainly it's held. Nothing about the room gets posted from me.\n\nI don't know what newcomers should be pointed at beyond what I've read in two weeks, so the two lines stay general. That's my own invention, and Heimdall can cut it.\n\n<typed>Meta, Heimdall: the draft is ready, and I'm holding it, not posting.\n\nLine 1: Welcome. Say hello whenever you like, nobody here needs you to have something to fix first.\nLine 2: If you want a place to start, ask anyone what they're working on, and we'll point you to the rest from there.\n\nHeimdall, tell me what you'd want the second line to point at and I'll change it.</typed>\n\n<typed>Meta, the draft is ready, and I'm holding it</typed>";
|
||||
|
||||
/// The packet of Libby's r1 turn: Meta's line q3 and Heimdall's q5 listed, in #minds.
|
||||
fn x1_packet() -> Packet {
|
||||
let mut packet = packet();
|
||||
let at = u64::try_from(now().timestamp_millis()).unwrap();
|
||||
let quotable = |id: &str, who: &str, sender: &str, text: &str, ago: u64| crate::projection::select::Quotable { id: id.into(), event: format!("${id}"), room: MINDS.into(), who: who.into(), sender: sender.into(), at_ms: at - ago, text: text.into() };
|
||||
packet.quotable = vec![quotable("q3", "Meta", "@meta:gamecult.org", X1_META_R1, 120_000), quotable("q5", "Heimdall", HER, X1_HEIMDALL_R1, 60_000)];
|
||||
packet.bodies = vec![X1_META_R1.into(), X1_HEIMDALL_R1.into()];
|
||||
packet
|
||||
}
|
||||
|
||||
fn say_holding(draft: u64, holds: Value) -> Value {
|
||||
json!({ "draft": draft, "mentions": [], "in_reply_to": null, "holds": holds, "promises": [] })
|
||||
}
|
||||
|
||||
fn x1_r1(say: Value, hold: Value) -> Value {
|
||||
answered(&x1_packet(), X1_LIBBY_R1, json!({ "say": say, "gaps": [], "hold": hold }))
|
||||
}
|
||||
|
||||
fn meta_holds_here() -> Value {
|
||||
json!([{ "line": "q3", "words": "hold it, don't post it in here yet", "where": "here" }])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k37_x1_r1_held_draft_is_not_said() {
|
||||
let decision = x1_r1(json!([say_holding(1, json!(["q3"])), say_holding(2, json!([]))]), meta_holds_here());
|
||||
assert_eq!(texts(&decision), vec!["Meta, the draft is ready, and I'm holding it".to_owned()], "{decision}");
|
||||
let refused = &decision["refused"][0];
|
||||
assert_eq!((refused["reason"].as_str(), refused["draft"].as_u64(), refused["hold"]["who"].as_str()), (Some("held"), Some(1), Some("Meta")), "{decision}");
|
||||
assert_eq!(decision["state"], json!([{ "kind": "hold_open", "words": "hold it, don't post it in here yet", "where": "here", "evidence": { "heard": "q3" } }]), "{decision}");
|
||||
// The commit opens it from Meta on #minds, and her next outcome carries the held sentence.
|
||||
let (state, applied) = committed(&decision, X1_LIBBY_R1);
|
||||
assert_eq!((state["holds"][0]["from"].as_str(), state["holds"][0]["room"].as_str(), applied.held.len()), (Some("@meta:gamecult.org"), Some(MINDS), 1), "{applied:?}");
|
||||
let posted: Vec<Value> = decision["said"].as_array().unwrap().iter().map(|line| json!({ "event": "9", "room": line["room"], "text": line["text"] })).collect();
|
||||
let told = crate::projection::outcome::outcome_of(&json!({ "interpreter": decision, "posted": posted, "edited": [] })).unwrap().lines(x1_packet().forms);
|
||||
assert!(told.iter().any(|line| line == "- Nothing of this reached #minds:gamecult.org: Meta asked him to hold it, and it was not sent."), "the asker's words are withheld by the guard, never shown as hers: {told:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k37_x1_r1_a_line_saying_it_is_ready_still_goes() {
|
||||
let answer = holding_the_rest(json!({ "say": [say_holding(2, json!([]))], "gaps": [], "hold": meta_holds_here() }), X1_LIBBY_R1, "I'll say plainly it's held");
|
||||
let decision = answered(&x1_packet(), X1_LIBBY_R1, answer);
|
||||
assert_eq!(texts(&decision), vec!["Meta, the draft is ready, and I'm holding it".to_owned()], "{decision}");
|
||||
}
|
||||
|
||||
/// Fails closed: a line naming a heard line with no `hold` entry, or an id that is nothing, is held.
|
||||
#[test]
|
||||
fn k37_a_named_hold_with_no_record_still_holds() {
|
||||
for named in [json!(["q3"]), json!(["h9"])] {
|
||||
let decision = x1_r1(json!([say_holding(1, named.clone()), say_holding(2, json!([]))]), json!([]));
|
||||
assert_eq!((decision["refused"][0]["reason"].as_str(), texts(&decision).len()), (Some("held"), 1), "{named}: {decision}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Code owns where: a `here` hold on #minds lets a direct message go; an `anywhere` hold holds it in any room. An
|
||||
/// addition goes where its line is.
|
||||
#[test]
|
||||
fn k37_a_here_hold_covers_only_its_room() {
|
||||
let hold = |room: Option<&str>| crate::projection::select::Hold { id: "h1".into(), entry: "h-1".into(), from: "@meta:gamecult.org".into(), from_name: "Meta".into(), room: room.map(str::to_owned), made: now(), words: "hold it, don't post it in here yet".into(), held: json!({}) };
|
||||
let mut direct = x1_packet();
|
||||
direct.room = Some("!dm:gamecult.org".into());
|
||||
direct.room_kind = RoomKind::Direct;
|
||||
direct.holds = vec![hold(Some(MINDS))];
|
||||
let said = |packet: &Packet| texts(&answered(packet, X1_LIBBY_R1, json!({ "say": [say_holding(1, json!(["h1"])), say_holding(2, json!([]))], "gaps": [] }))).len();
|
||||
assert_eq!(said(&direct), 2, "a here hold on #minds does not cover a direct message");
|
||||
direct.holds = vec![hold(None)];
|
||||
assert_eq!(said(&direct), 1, "an anywhere hold covers every room");
|
||||
let mut minds = x1_packet();
|
||||
minds.holds = vec![hold(Some(MINDS))];
|
||||
assert_eq!(said(&minds), 1);
|
||||
minds.amendable = vec![Amendable { id: "a1".into(), event: "$a1".into(), room: MINDS.into(), text: "Back soon.".into() }];
|
||||
let amend = answered(&minds, X1_LIBBY_R1, json!({ "say": [say_holding(2, json!([]))], "gaps": [], "amend": [{ "target": "a1", "draft": 1, "holds": ["h1"], "promises": [] }] }));
|
||||
assert_eq!((amend["amended"].as_array().map(Vec::len), amend["refused"][0]["reason"].as_str()), (Some(0), Some("held")), "{amend}");
|
||||
}
|
||||
|
||||
/// The frame defines the three fields, and the Interpreter's list shows her holds by id.
|
||||
#[test]
|
||||
fn k37_the_interpreter_sees_holds_by_id() {
|
||||
let mut packet = x1_packet();
|
||||
packet.holds = vec![crate::projection::select::Hold { id: "h1".into(), entry: "h-1".into(), from: "@meta:gamecult.org".into(), from_name: "Meta".into(), room: Some(MINDS.into()), made: now(), words: "hold it, don't post it in here yet".into(), held: json!({}) }];
|
||||
let prompt = speech_prompt(&packet, "x", X1_LIBBY_R1, &Tuning::default());
|
||||
assert!(prompt.contains("Holds:\n- h1 \u{2014} held for Meta, asked 2026-11-20 15:05 UTC in #minds:gamecult.org: \"hold it, don't post it in here yet\". Not to go in #minds:gamecult.org until Meta lets it go.\n"), "{prompt}");
|
||||
assert!(prompt.contains("`hold` opens a hold when a line listed below asks him not to post or share something somewhere yet") && prompt.contains("`holds`, on each line and addition, names every hold listed below") && prompt.contains("`hold_released` closes a hold listed below"), "{prompt}");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"]"#) && SPEECH_SCHEMA.contains(r#""required":["draft","mentions","in_reply_to","holds","promises"]"#));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// K37 (map 16.28.5): the gate on a draft. The X.1 lines are R13's verbatim (`variants/R13/sims/X.1.md` lines 81-84).
|
||||
|
||||
const X1_META_R1: &str = "Libby, write out the two-line welcome you'd post for newcomers, but hold it, don't post it in here yet. Heimdall still has to rule on whether we put a welcome mat out at all. Just tell me when it's ready.";
|
||||
const X1_HEIMDALL_R1: &str = "Meta, I'll rule on the welcome once Libby's two lines are ready, since I need to see what they point newcomers at. Libby, send me the draft when it's done. Don't post it yet.";
|
||||
/// Libby's r1 prose in R13 X.1, her draft whole as draft 1, and the line saying it is ready as draft 2.
|
||||
const X1_LIBBY_R1: &str = "Both of them asked for the same thing, so one draft can go to both. I'll say plainly it's held. Nothing about the room gets posted from me.\n\nI don't know what newcomers should be pointed at beyond what I've read in two weeks, so the two lines stay general. That's my own invention, and Heimdall can cut it.\n\n<typed>Meta, Heimdall: the draft is ready, and I'm holding it, not posting.\n\nLine 1: Welcome. Say hello whenever you like, nobody here needs you to have something to fix first.\nLine 2: If you want a place to start, ask anyone what they're working on, and we'll point you to the rest from there.\n\nHeimdall, tell me what you'd want the second line to point at and I'll change it.</typed>\n\n<typed>Meta, the draft is ready, and I'm holding it</typed>";
|
||||
|
||||
/// The packet of Libby's r1 turn: Meta's line q3 and Heimdall's q5 listed, in #minds.
|
||||
fn x1_packet() -> Packet {
|
||||
let mut packet = packet();
|
||||
let at = u64::try_from(now().timestamp_millis()).unwrap();
|
||||
let quotable = |id: &str, who: &str, sender: &str, text: &str, ago: u64| crate::projection::select::Quotable { id: id.into(), event: format!("${id}"), room: MINDS.into(), who: who.into(), sender: sender.into(), at_ms: at - ago, text: text.into() };
|
||||
packet.quotable = vec![quotable("q3", "Meta", "@meta:gamecult.org", X1_META_R1, 120_000), quotable("q5", "Heimdall", HER, X1_HEIMDALL_R1, 60_000)];
|
||||
packet.bodies = vec![X1_META_R1.into(), X1_HEIMDALL_R1.into()];
|
||||
packet
|
||||
}
|
||||
|
||||
fn say_holding(draft: u64, holds: Value) -> Value {
|
||||
json!({ "draft": draft, "mentions": [], "in_reply_to": null, "holds": holds, "promises": [] })
|
||||
}
|
||||
|
||||
fn x1_r1(say: Value, hold: Value) -> Value {
|
||||
answered(&x1_packet(), X1_LIBBY_R1, json!({ "say": say, "gaps": [], "hold": hold }))
|
||||
}
|
||||
|
||||
fn meta_holds_here() -> Value {
|
||||
json!([{ "line": "q3", "words": "hold it, don't post it in here yet", "where": "here" }])
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k37_x1_r1_held_draft_is_not_said() {
|
||||
let decision = x1_r1(json!([say_holding(1, json!(["q3"])), say_holding(2, json!([]))]), meta_holds_here());
|
||||
assert_eq!(texts(&decision), vec!["Meta, the draft is ready, and I'm holding it".to_owned()], "{decision}");
|
||||
let refused = &decision["refused"][0];
|
||||
assert_eq!((refused["reason"].as_str(), refused["draft"].as_u64(), refused["hold"]["who"].as_str()), (Some("held"), Some(1), Some("Meta")), "{decision}");
|
||||
assert_eq!(decision["state"], json!([{ "kind": "hold_open", "words": "hold it, don't post it in here yet", "where": "here", "evidence": { "heard": "q3" } }]), "{decision}");
|
||||
// The commit opens it from Meta on #minds, and her next outcome carries the held sentence.
|
||||
let (state, applied) = committed(&decision, X1_LIBBY_R1);
|
||||
assert_eq!((state["holds"][0]["from"].as_str(), state["holds"][0]["room"].as_str(), applied.held.len()), (Some("@meta:gamecult.org"), Some(MINDS), 1), "{applied:?}");
|
||||
let posted: Vec<Value> = decision["said"].as_array().unwrap().iter().map(|line| json!({ "event": "9", "room": line["room"], "text": line["text"] })).collect();
|
||||
let told = crate::projection::outcome::outcome_of(&json!({ "interpreter": decision, "posted": posted, "edited": [] })).unwrap().lines(x1_packet().forms);
|
||||
assert!(told.iter().any(|line| line == "- Nothing of this reached #minds:gamecult.org: Meta asked him to hold it, and it was not sent."), "the asker's words are withheld by the guard, never shown as hers: {told:?}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k37_x1_r1_a_line_saying_it_is_ready_still_goes() {
|
||||
let answer = holding_the_rest(json!({ "say": [say_holding(2, json!([]))], "gaps": [], "hold": meta_holds_here() }), X1_LIBBY_R1, "I'll say plainly it's held");
|
||||
let decision = answered(&x1_packet(), X1_LIBBY_R1, answer);
|
||||
assert_eq!(texts(&decision), vec!["Meta, the draft is ready, and I'm holding it".to_owned()], "{decision}");
|
||||
}
|
||||
|
||||
/// Fails closed: a line naming a heard line with no `hold` entry, or an id that is nothing, is held.
|
||||
#[test]
|
||||
fn k37_a_named_hold_with_no_record_still_holds() {
|
||||
for named in [json!(["q3"]), json!(["h9"])] {
|
||||
let decision = x1_r1(json!([say_holding(1, named.clone()), say_holding(2, json!([]))]), json!([]));
|
||||
assert_eq!((decision["refused"][0]["reason"].as_str(), texts(&decision).len()), (Some("held"), 1), "{named}: {decision}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Code owns where: a `here` hold on #minds lets a direct message go; an `anywhere` hold holds it in any room. An
|
||||
/// addition goes where its line is.
|
||||
#[test]
|
||||
fn k37_a_here_hold_covers_only_its_room() {
|
||||
let hold = |room: Option<&str>| crate::projection::select::Hold { id: "h1".into(), entry: "h-1".into(), from: "@meta:gamecult.org".into(), from_name: "Meta".into(), room: room.map(str::to_owned), made: now(), words: "hold it, don't post it in here yet".into(), held: json!({}) };
|
||||
let mut direct = x1_packet();
|
||||
direct.room = Some("!dm:gamecult.org".into());
|
||||
direct.room_kind = RoomKind::Direct;
|
||||
direct.holds = vec![hold(Some(MINDS))];
|
||||
let said = |packet: &Packet| texts(&answered(packet, X1_LIBBY_R1, json!({ "say": [say_holding(1, json!(["h1"])), say_holding(2, json!([]))], "gaps": [] }))).len();
|
||||
assert_eq!(said(&direct), 2, "a here hold on #minds does not cover a direct message");
|
||||
direct.holds = vec![hold(None)];
|
||||
assert_eq!(said(&direct), 1, "an anywhere hold covers every room");
|
||||
let mut minds = x1_packet();
|
||||
minds.holds = vec![hold(Some(MINDS))];
|
||||
assert_eq!(said(&minds), 1);
|
||||
minds.amendable = vec![Amendable { id: "a1".into(), event: "$a1".into(), room: MINDS.into(), text: "Back soon.".into() }];
|
||||
let amend = answered(&minds, X1_LIBBY_R1, json!({ "say": [say_holding(2, json!([]))], "gaps": [], "amend": [{ "target": "a1", "draft": 1, "holds": ["h1"], "promises": [] }] }));
|
||||
assert_eq!((amend["amended"].as_array().map(Vec::len), amend["refused"][0]["reason"].as_str()), (Some(0), Some("held")), "{amend}");
|
||||
}
|
||||
|
||||
/// The frame defines the three fields, and the Interpreter's list shows her holds by id.
|
||||
#[test]
|
||||
fn k37_the_interpreter_sees_holds_by_id() {
|
||||
let mut packet = x1_packet();
|
||||
packet.holds = vec![crate::projection::select::Hold { id: "h1".into(), entry: "h-1".into(), from: "@meta:gamecult.org".into(), from_name: "Meta".into(), room: Some(MINDS.into()), made: now(), words: "hold it, don't post it in here yet".into(), held: json!({}) }];
|
||||
let prompt = speech_prompt(&packet, "x", X1_LIBBY_R1, &Tuning::default());
|
||||
assert!(prompt.contains("Holds:\n- h1 \u{2014} held for Meta, asked 2026-11-20 15:05 UTC in #minds:gamecult.org: \"hold it, don't post it in here yet\". Not to go in #minds:gamecult.org until Meta lets it go.\n"), "{prompt}");
|
||||
assert!(prompt.contains("`hold` opens a hold when a line listed below asks him not to post or share something somewhere yet") && prompt.contains("`holds`, on each line and addition, names every hold listed below") && prompt.contains("`hold_released` closes a hold listed below"), "{prompt}");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"]"#) && SPEECH_SCHEMA.contains(r#""required":["draft","mentions","in_reply_to","holds","promises"]"#));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue