K17 fix-up: a reach quoting a draft by its words is about that draft (Soul at 0cfc386)

- A missing_affordance gap that names no draft and quotes one (at least
  GAP_QUOTE_MIN_WORDS words, found in the draft's words) is read as naming it.
  So a reach quoting a said draft is the promise on that draft (map 16.20.6),
  told as one, not `acted` and silent. Soul's probe gap
  `{missing_affordance, draft: null, quote: "I'll send the render tonight."}`
  was dropped as acted.
- Only missing_affordance: the brief scoped it there. The other draft-naming
  kinds keep the old reading (a quote from a draft that went is `acted`, one
  from a draft that did not is unlocated).

Verification: Soul's probe gap resolves to draft 1 and is told as the promise;
a two-word quote of the same draft is still `acted`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-20 17:19:02 +01:00
commit 02e772acca
2 changed files with 22 additions and 3 deletions

View file

@ -258,7 +258,8 @@ impl GapKind {
///
/// 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.
/// it when there is one, said or not (map 16.20.6), and otherwise quotes her thought; a reach that names no draft and
/// quotes one (at least `GAP_QUOTE_MIN_WORDS` words, found in the draft's words) is about that draft, as if named.
///
/// 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 {
@ -268,13 +269,15 @@ fn gap(prose: &str, found: &Drafts, raw: &Value) -> Value {
gap["declared"] = raw.get("kind").cloned().unwrap_or_else(|| raw.clone());
}
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) {
let quote = raw.get("quote").and_then(Value::as_str).unwrap_or_default().trim();
// A reach that quotes a draft by its words, with no number, is about that draft: a promise in it (map 16.20.6).
let quoted_draft = || (kind == GapKind::MissingAffordance && words(quote) >= GAP_QUOTE_MIN_WORDS).then(|| found.drafts.iter().find(|draft| draft.text.contains(quote))).flatten();
if let Some(draft) = raw.get("draft").and_then(Value::as_i64).and_then(|n| found.numbered(n)).filter(|_| names_a_draft).or_else(quoted_draft) {
gap["from"] = json!("draft");
gap["draft"] = json!(draft.n);
gap["words"] = json!(draft.text);
return gap;
}
let quote = raw.get("quote").and_then(Value::as_str).unwrap_or_default().trim();
let located = (words(quote) >= GAP_QUOTE_MIN_WORDS).then(|| found.thought(prose).into_iter().find_map(|(start, end)| SourceSpan::locate(&prose[start..end], quote).map(|span| (start + span.start_byte(), start + span.end_byte())))).flatten();
match located {
Some((start, end)) => {

View file

@ -546,6 +546,22 @@ fn k17_a_said_promise_of_an_act_he_cannot_do_is_kept_as_a_gap_and_told_as_a_prom
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."]);
}
/// 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,
/// not `acted`.
#[test]
fn a_reach_quoting_a_said_draft_by_its_words_is_a_promise_on_that_draft() {
let prose = "<typed>Missed you too. I'll send the render tonight.</typed>";
let decision = answered(&packet(), prose, json!({ "say": [{ "draft": 1 }], "gaps": [{ "kind": "missing_affordance", "draft": null, "quote": "I'll send the render tonight.", "detail": "" }] }));
let gap = &decision["gaps"][0];
assert_eq!((gap["from"].as_str(), gap["draft"].as_u64(), gap["words"].as_str()), (Some("draft"), Some(1), Some("Missed you too. I'll send the render tonight.")), "{gap}");
let record = json!({ "interpreter": decision, "posted": [{ "event": "40", "room": MINDS, "text": "Missed you too. 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: \"Missed you too. 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."]);
// A quote too short to say which draft is not one.
let short = answered(&packet(), prose, json!({ "say": [{ "draft": 1 }], "gaps": [{ "kind": "missing_affordance", "draft": null, "quote": "the render", "detail": "" }] }));
assert_eq!(short["gaps"][0]["from"], "acted", "{short}");
}
#[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>";