interpreter: tests count the two halves

This commit is contained in:
Meta Vens 2026-12-01 20:19:11 +01:00
commit af612d3f36
2 changed files with 6 additions and 6 deletions

View file

@ -360,7 +360,7 @@ fn t_p1_one_projector_one_persona() {
let tally = Tally::default();
assert_eq!(rig.run(tally.clone()), Outcome::Drained { wakes: 1, acked_through: Some(3) });
let prompts = tally.0.borrow();
assert_eq!(prompts.len(), 3, "a wake with waking lines in three rooms makes exactly three model calls: the Projector, the Persona and the Interpreter");
assert_eq!(prompts.len(), 4, "a wake with waking lines in three rooms makes exactly four model calls: the Projector, the Persona and the Interpreter's two halves");
assert!(prompts[2].starts_with(INTERPRETER));
assert!(prompts[0].starts_with("You are a private Projector."));
let records = rig.records();
@ -928,7 +928,7 @@ fn t_h3_rollover_wakes_held_lines() {
rig.ticks.set(43_200 + 60);
rig.agent.answers.borrow_mut().push_back(says(&room(1), "good morning"));
assert_eq!(rig.run(Tally::default()), Outcome::Drained { wakes: 1, acked_through: Some(1) });
assert_eq!(organ_calls(&rig), ["projector", "persona", "agent", "agent", "interpreter"].map(str::to_owned), "the day's spend counts from nothing");
assert_eq!(organ_calls(&rig), ["projector", "persona", "agent", "agent", "interpreter", "interpreter"].map(str::to_owned), "the day's spend counts from nothing");
assert_eq!(rig.mouth.sent.borrow().len(), 1, "she answered it");
assert_eq!(rig.records().len(), 1);
}

View file

@ -27,11 +27,11 @@ fn state() -> Value {
#[test]
fn each_half_schema_names_its_sections_and_closes_every_object() {
for half in 0..2 {
for (half, sections) in HALVES.iter().enumerate() {
let schema: Value = serde_json::from_str(&schema(half)).unwrap();
let mut families: Vec<&str> = schema["properties"].as_object().unwrap().keys().map(String::as_str).collect();
families.sort_unstable();
let mut wanted = HALVES[half].to_vec();
let mut wanted = sections.to_vec();
wanted.sort_unstable();
assert_eq!(families, wanted);
assert!(closed(&schema));
@ -47,7 +47,7 @@ fn closed(value: &Value) -> bool {
}
#[test]
fn the_call_is_one_schema_turn_and_the_index_gives_ids_and_words_never_numbers() {
fn the_calls_are_schema_turns_and_the_index_gives_ids_and_words_never_numbers() {
let model = Answers(r#"{"people":{"bonds":[{"person":"deru","trust":"up"}]}}"#, RefCell::default());
let mut heard = heard();
heard.people = people(&state(), &heard, "Deru is on her mind.", "She thinks of him.");
@ -55,7 +55,7 @@ fn the_call_is_one_schema_turn_and_the_index_gives_ids_and_words_never_numbers()
let (deltas, _) = super::deltas(&model, "claude-haiku-5-5", "r1", &state(), &heard, "Deru is on her mind.", "He thinks of the heron.").unwrap();
assert_eq!(deltas.people.bonds[0].trust.as_deref(), Some("up"));
let calls = model.1.borrow();
assert_eq!(calls.len(), 1);
assert_eq!(calls.len(), 2, "two halves");
let (prompt, schema) = &calls[0];
assert!(schema.is_some());
let index = prompt.split("INDEX\n").nth(1).unwrap().split("NARRATION").next().unwrap();