K20.3 fix-up: the K20 contract test names its packet passing, not shadowing packet()
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0732aab797
commit
2e22be645f
1 changed files with 6 additions and 6 deletions
|
|
@ -419,23 +419,23 @@ fn pass_on_packet() -> Packet {
|
|||
/// still refuses a draft that is the quoted words.
|
||||
#[test]
|
||||
fn k20_a_line_replies_only_to_a_listed_line_and_the_echo_check_still_holds() {
|
||||
let packet = pass_on_packet();
|
||||
assert_eq!(packet.quotable.iter().map(|line| (line.id.as_str(), line.event.as_str())).collect::<Vec<_>>(), [("q1", "$m1"), ("q2", "$k1")], "earlier lines first, then the new");
|
||||
let prompt = speech_prompt(&packet, "x", "y", &Tuning::default());
|
||||
let passing = pass_on_packet();
|
||||
assert_eq!(passing.quotable.iter().map(|line| (line.id.as_str(), line.event.as_str())).collect::<Vec<_>>(), [("q1", "$m1"), ("q2", "$k1")], "earlier lines first, then the new");
|
||||
let prompt = speech_prompt(&passing, "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("Lines in this room he may reply to, as id \u{2014} who: line:\n- q1 \u{2014} Meta (@meta:gamecult.org): \"Nobody touches the release branch until I'm back. I mean it, all of you.\"\n- q2 \u{2014} Kiko (@kiko:gamecult.org): "), "{prompt}");
|
||||
assert!(!prompt.contains("$m1") && !prompt.contains("$k1"), "the actuator's handle is never shown to a model");
|
||||
assert!(prompt.contains("(`in_reply_to`, or null: the room shows that line, with who said it, above his own words)"), "{prompt}");
|
||||
let prose = "<typed>This is what she said before she left.</typed>";
|
||||
let said = decided_in(&packet, prose, json!([{ "draft": 1, "in_reply_to": "q1" }]));
|
||||
let said = decided_in(&passing, prose, json!([{ "draft": 1, "in_reply_to": "q1" }]));
|
||||
assert_eq!(said["said"][0]["in_reply_to"], json!({ "id": "q1", "event": "$m1", "who": "Meta (@meta:gamecult.org)", "text": "Nobody touches the release branch until I'm back. I mean it, all of you." }), "{said}");
|
||||
assert_eq!(said["said"][0]["text"], "This is what she said before she left.", "his own words, and nothing code wrote");
|
||||
for off in ["q9", "$m1"] {
|
||||
let refused = answered(&packet, prose, json!({ "say": [{ "draft": 1, "in_reply_to": off }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] }));
|
||||
let refused = answered(&passing, prose, json!({ "say": [{ "draft": 1, "in_reply_to": off }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] }));
|
||||
assert_eq!((texts(&refused), refused["refused"][0]["reason"].as_str()), (vec![], Some("not_quotable")), "{off}: {refused}");
|
||||
assert_eq!(refused["suggestions"][0]["draft"], 1, "a refused line leaves its draft free: {refused}");
|
||||
}
|
||||
assert_eq!(decided_in(&pass_on_packet(), prose, json!([{ "draft": 1, "in_reply_to": null }]))["said"][0]["in_reply_to"], Value::Null);
|
||||
let echo = decided_in(&packet, "<typed>Nobody touches the release branch until I'm back. I mean it, all of you.</typed>", json!([{ "draft": 1, "in_reply_to": "q1" }]));
|
||||
let echo = decided_in(&passing, "<typed>Nobody touches the release branch until I'm back. I mean it, all of you.</typed>", json!([{ "draft": 1, "in_reply_to": "q1" }]));
|
||||
assert!(texts(&echo).is_empty() && refused_why(&echo).contains("echo"), "a reply does not skip the echo check: {echo}");
|
||||
assert!(speech_prompt(&packet(), "x", "y", &Tuning::default()).contains("may reply to, as id \u{2014} who: line:\n- none\n"), "lines without an event are not listed");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue