K17: the promise gap (map 16.20.6)
- missing_affordance widened to "she means to do something, now or later,
that no affordance of hers does": it may name a draft, said or not, or quote
her thought. Only unwritten never names a draft.
- The acted exception: a missing_affordance gap naming a draft she said is kept
(the promise row, K16), every other gap naming an acted draft stays acted.
- The speech frame's gap sentence is 16.20.6's, and says every intent not
carried out has a kind: an intent to act is missing_affordance, an intent to
say with no draft is unwritten.
Verification: a recorded answer that says draft 1 ("I'll send the render
tonight") with missing_affordance on draft 1 keeps the gap (from draft) and its
outcome is the promise row; a thought-only "I'll look into it." is kept as a
reach; a conditional gap on a said draft and a reach naming a draft left for
Self are acted; the frame carries the new sentence.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
17f735227a
commit
85505c8710
2 changed files with 42 additions and 9 deletions
|
|
@ -74,7 +74,7 @@ fn speech_frame_tail(her: Forms) -> String {
|
|||
|
||||
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`) and the Matrix id of the person whose message {subj} answer{s} (`reply_to`, or null). `gaps` records what {subj} meant and did not send. `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, and the draft that is {poss} addition. 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.
|
||||
|
||||
A draft is said whole or not at all, and only once. At most two drafts a turn. Record a gap instead of guessing: conditional when {subj} {has} drafted something {subj} might say but {has} not chosen to, 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 three, name the draft by number. missing_affordance when {poss} thought reaches for something {poss} body cannot do this turn (what {subj} can do here is listed below), unwritten when {subj} mean{s} to say something and wrote no draft of it; for these two, quote the words of {poss} thought that show it, at least four words, copied exactly.",
|
||||
A draft is said whole or not at all, and only once. At most two drafts a turn. Record a gap instead of guessing: conditional when {subj} {has} drafted something {subj} might say but {has} not chosen to, 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 three, 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 and wrote no draft of it. Every intent of {poss} that is not carried out has a kind: an intent to act is missing_affordance, an intent to say 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" },
|
||||
)
|
||||
}
|
||||
|
|
@ -219,7 +219,8 @@ pub(crate) enum GapKind {
|
|||
Addressee,
|
||||
/// She means a draft for another room or another time.
|
||||
Elsewhere,
|
||||
/// Her thought reaches for something her body cannot do this turn: a tool request in waiting (section 4.2).
|
||||
/// She means to do something, now or later, that no affordance of hers does (map 16.20.6): a reach in her thought, or a
|
||||
/// promise in a draft, said or not. A tool request in waiting (section 4.2).
|
||||
MissingAffordance,
|
||||
/// She means to say something and wrote no draft of it, so nothing went out.
|
||||
Unwritten,
|
||||
|
|
@ -248,10 +249,12 @@ impl GapKind {
|
|||
/// - `unlocated`: neither; the model's quote is kept for the trace and never shown to her.
|
||||
///
|
||||
/// - `acted`: it names, or quotes from, a draft that went somewhere this turn (said, added to a line, left for Self), so it
|
||||
/// contradicts what happened and is not shown to her (`decide` sets it).
|
||||
/// contradicts what happened and is not shown to her (`decide` sets it). One exception: a `missing_affordance` gap that
|
||||
/// names a draft she said is a promise of an act she cannot do, and is kept and shown (map 16.20.6).
|
||||
///
|
||||
/// Only the draft kinds (conditional, addressee, elsewhere) name a draft: a reach or an unwritten line is about words she
|
||||
/// did not set down, so it is always a passage of her thought, whatever draft the model names.
|
||||
/// Every kind but `unwritten` may name a draft: an unwritten line is about words she did not set down, so it is always a
|
||||
/// passage of her thought, whatever draft the model names. A reach (`missing_affordance`) names the draft that promises
|
||||
/// it when there is one, said or not (map 16.20.6), and otherwise quotes her thought.
|
||||
///
|
||||
/// The model's `detail` is kept for the trace and is never what she is told.
|
||||
fn gap(prose: &str, found: &Drafts, raw: &Value) -> Value {
|
||||
|
|
@ -260,7 +263,7 @@ fn gap(prose: &str, found: &Drafts, raw: &Value) -> Value {
|
|||
if kind == GapKind::Unresolved {
|
||||
gap["declared"] = raw.get("kind").cloned().unwrap_or_else(|| raw.clone());
|
||||
}
|
||||
let names_a_draft = !matches!(kind, GapKind::MissingAffordance | GapKind::Unwritten);
|
||||
let names_a_draft = kind != GapKind::Unwritten;
|
||||
if let Some(draft) = raw.get("draft").and_then(Value::as_i64).and_then(|n| found.numbered(n)).filter(|_| names_a_draft) {
|
||||
gap["from"] = json!("draft");
|
||||
gap["draft"] = json!(draft.n);
|
||||
|
|
@ -413,6 +416,7 @@ pub(crate) fn decide(model: &dyn Model, request_id: &str, packet: &Packet, narra
|
|||
// are one. `went` holds the drafts that went somewhere.
|
||||
let mut used: Vec<&str> = Vec::new();
|
||||
let mut went: Vec<&Draft> = Vec::new();
|
||||
let mut said_drafts: Vec<usize> = Vec::new();
|
||||
for line in parsed.say {
|
||||
let Some(draft) = line.draft.and_then(|n| found.numbered(n)) else {
|
||||
refusals.push(refused(Act::Say, None, line.draft, Refusal::NoDraft));
|
||||
|
|
@ -440,6 +444,7 @@ pub(crate) fn decide(model: &dyn Model, request_id: &str, packet: &Packet, narra
|
|||
Some(id) => (None, Some(id)),
|
||||
None => (None, None),
|
||||
};
|
||||
said_drafts.push(draft.n);
|
||||
went.push(draft);
|
||||
said.push(json!({ "room": room, "text": draft.text, "mentions": mentions, "reply_to": reply_to, "rests_on": { "draft": draft.n, "start_byte": draft.start, "end_byte": draft.end }, "dropped": { "mentions": unknown, "reply_to": unknown_reply } }));
|
||||
}
|
||||
|
|
@ -501,9 +506,10 @@ pub(crate) fn decide(model: &dyn Model, request_id: &str, packet: &Packet, narra
|
|||
suggestions.push(json!({ "kind": proposed.kind, "about": about, "room": room, "text": draft.text, "draft": draft.n, "dropped": { "about": dropped } }));
|
||||
}
|
||||
// A gap about a draft that went somewhere, or quoting from one, contradicts what happened: it is kept for the trace as
|
||||
// `acted` and never shown to her.
|
||||
// `acted` and never shown to her. A reach naming a draft she said is a promise she cannot keep, and is kept (16.20.6).
|
||||
for gap in decision["gaps"].as_array_mut().into_iter().flatten() {
|
||||
let named = gap["draft"].as_u64().is_some_and(|n| went.iter().any(|draft| draft.n as u64 == n)) && gap["from"] == "draft";
|
||||
let promise = gap["kind"] == json!(GapKind::MissingAffordance) && gap["from"] == "draft" && gap["draft"].as_u64().is_some_and(|n| said_drafts.iter().any(|said| *said as u64 == n));
|
||||
let named = !promise && gap["draft"].as_u64().is_some_and(|n| went.iter().any(|draft| draft.n as u64 == n)) && gap["from"] == "draft";
|
||||
let quoted = gap["from"] == "unlocated" && gap["quote"].as_str().is_some_and(|quote| !quote.is_empty() && went.iter().any(|draft| draft.text.contains(quote)));
|
||||
if named || quoted {
|
||||
gap["from"] = json!("acted");
|
||||
|
|
|
|||
|
|
@ -367,7 +367,7 @@ fn an_unknown_gap_kind_is_kept_as_unresolved() {
|
|||
fn the_interpreter_is_told_what_he_can_do_here_from_the_packets_affordances() {
|
||||
let prompt = speech_prompt(&packet(), "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("What he can do here:\nThis turn the room reaches him as typed lines, and he can answer in the turn's room by typing lines of his own; nothing he does here builds, changes or ships anything.\n\nThe room:"), "{prompt}");
|
||||
assert!(prompt.contains("missing_affordance when his thought reaches for something his body cannot do this turn"), "{prompt}");
|
||||
assert!(prompt.contains("missing_affordance when he means to do something, now or later, that his body cannot do (what he can do here is listed below)"), "{prompt}");
|
||||
let mut listening = packet();
|
||||
listening.affordances = vec![Affordance::Perceive];
|
||||
assert!(speech_prompt(&listening, "x", "y", &Tuning::default()).contains("What he can do here:\nThis turn the room reaches him as typed lines, and he can say nothing; nothing"), "derived from the affordances, not a constant");
|
||||
|
|
@ -533,3 +533,30 @@ fn soul_a_gap_never_contradicts_what_went_out() {
|
|||
let from: Vec<&str> = decision["gaps"].as_array().unwrap().iter().map(|gap| gap["from"].as_str().unwrap()).collect();
|
||||
assert_eq!(from, ["acted", "acted", "thought"], "a gap on the sent draft, an unwritten quote from it, and an unwritten line of his thought whatever draft it names: {decision}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k17_a_said_promise_of_an_act_he_cannot_do_is_kept_as_a_gap_and_told_as_a_promise() {
|
||||
let prose = "She'll want to see it. <typed>I'll send the render tonight.</typed>";
|
||||
let decision = answered(&packet(), prose, json!({ "say": [{ "draft": 1 }], "gaps": [{ "kind": "missing_affordance", "draft": 1, "quote": null, "detail": "" }] }));
|
||||
assert_eq!(texts(&decision), ["I'll send the render tonight."], "{decision}");
|
||||
let gap = &decision["gaps"][0];
|
||||
assert_eq!((gap["kind"].as_str(), gap["from"].as_str(), gap["draft"].as_u64(), gap["words"].as_str()), (Some("missing_affordance"), Some("draft"), Some(1), Some("I'll send the render tonight.")), "kept, not acted: {gap}");
|
||||
let record = json!({ "interpreter": decision, "posted": [{ "event": "40", "room": MINDS, "text": "I'll send the render tonight." }] });
|
||||
let told = crate::projection::outcome::outcome_of(&record).unwrap().lines(packet().forms);
|
||||
assert_eq!(told, ["- #minds:gamecult.org has, from him: \"I'll send the render tonight.\". It promises something he has no way to do, now or later, and it will not happen by itself. The line stands as he wrote it; he can add to it."]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k17_a_thought_only_intent_is_a_reach_and_any_other_gap_on_an_acted_draft_is_acted() {
|
||||
let prose = "Meta's question is a good one. I'll look into it. <typed>Good question.</typed> <typed>Note: look into it.</typed>";
|
||||
let decision = answered(&packet(), prose, json!({ "say": [{ "draft": 1 }], "gaps": [
|
||||
{ "kind": "missing_affordance", "draft": null, "quote": "I'll look into it.", "detail": "" },
|
||||
{ "kind": "conditional", "draft": 1, "quote": null, "detail": "" },
|
||||
{ "kind": "missing_affordance", "draft": 2, "quote": null, "detail": "" },
|
||||
], "suggest": [{ "kind": "idea", "draft": 2, "about": null, "private": false }] }));
|
||||
let from: Vec<&str> = decision["gaps"].as_array().unwrap().iter().map(|gap| gap["from"].as_str().unwrap()).collect();
|
||||
assert_eq!(from, ["thought", "acted", "acted"], "a reach in his thought; a conditional on the said draft; a reach naming the draft left for Self: {decision}");
|
||||
assert_eq!(decision["gaps"][0]["words"], "I'll look into it.");
|
||||
let prompt = speech_prompt(&packet(), "x", "y", &Tuning::default());
|
||||
assert!(prompt.contains("missing_affordance when he means to do something, now or later, that his body cannot do") && prompt.contains("an intent to act is missing_affordance, an intent to say with no draft is unwritten"), "{prompt}");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue