Persona K41: declined for her own choice, told with its thought; a note may be the same draft as a line; every refused act with words is told (map 16.29.2, 16.29.8)
UnsentHow::Held becomes Declined (schema enum, contract clause); each unsent
entry carries its quote as located in her prose (unsent_cited, the one
locating, shared with the accounting); Part::Held becomes Part::Declined
{ text, thought }, rendered with the cited thought and her words, each through
the guard. suggest no longer checks used, so a said or added draft may also be
her note. Used, Duplicate and SecondAmend join Part::Refused with code's why()
as the reason; NoDraft stays omitted and reported. Tests replay R15 X.1 r1
(Libby's decline: the guard withholds both quotes, pinned; with only Meta
heard, the thought is shown) and F.1 r1 (Heimdall's line and note from one
draft; the run's inbox lists it). Negative: an unsent is not the
contract; a NoDraft is not told. Golden frame updated.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
cab4f601ce
commit
27ae836e4f
6 changed files with 161 additions and 70 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 an addressee or elsewhere 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`).
|
||||
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 an addressee or elsewhere gap: declined, 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`).
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
//! The Interpreter decides whether she sends a draft now, where and to whom: it answers with zero or more drafts by
|
||||
//! number, each with the people she addresses (Matrix mentions, as a structured field) and the line it replies to, and the
|
||||
//! gaps.
|
||||
//! Code checks only that a number names a draft and that a draft goes one place; the line is the draft's text, whole,
|
||||
//! Code checks only that a number names a draft and that a draft is said or added once; the line is the draft's text, whole,
|
||||
//! exactly as she set it down. So a line can never be part of what she wrote, nor words the model wrote (I16.6). No code
|
||||
//! here reads a quotation mark or a sentence: whose words a draft carries and whether she means it now are the
|
||||
//! Interpreter's judgement, as privacy is. What this gives up: speech she does not set down is never said (an
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
//!
|
||||
//! The same answer may add a draft after a line of hers listed as one she may add to (`amend`, map 16.17; the actuator
|
||||
//! composes the edit), and leave Self one note (`suggest`, map 16.18; recorded in the turn's record, never a write to her
|
||||
//! Mind). One draft goes one place across all three.
|
||||
//! Mind). A draft is said or added once, in one room; the same draft may also be her note to Self (map 16.29.8).
|
||||
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
|
|
@ -71,7 +71,7 @@ pub(crate) const SPEECH_OPENING: &str = "You decide what one person says aloud i
|
|||
|
||||
/// The speech contract, sent as the schema turn's output schema (`--json-schema`): the drafts she sends now by number,
|
||||
/// and the gaps. The model writes no words of hers.
|
||||
pub(crate) const SPEECH_SCHEMA: &str = r#"{"type":"object","additionalProperties":false,"required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"],"properties":{"hold":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["line","words","where"],"properties":{"line":{"type":"string"},"words":{"type":"string"},"where":{"type":"string","enum":["here","anywhere"]}}}},"hold_released":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["hold","line"],"properties":{"hold":{"type":"string"},"line":{"type":"string"}}}},"reopen":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["promise","words","needs"],"properties":{"promise":{"type":"string"},"words":{"type":"string"},"needs":{"type":["object","null"],"additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}},"unsent":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["draft","how","quote"],"properties":{"draft":{"type":"integer"},"how":{"type":"string","enum":["held","superseded"]},"quote":{"type":"string"}}}},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target","quote"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"},"quote":{"type":"string"}}},"state":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","promise","how","evidence","thought","still_stands"],"properties":{"kind":{"type":"string","enum":["promise_close"]},"promise":{"type":"string"},"how":{"type":"string","enum":["kept","withdrawn","released"]},"evidence":{"type":"object","additionalProperties":false,"required":["draft","line"],"properties":{"draft":{"type":["integer","null"]},"line":{"type":["string","null"]}}},"thought":{"type":["string","null"]},"still_stands":{"type":"boolean"}}}},"suggest":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","draft","about","private"],"properties":{"kind":{"type":"string","enum":["feedback","idea"]},"draft":{"type":"integer","minimum":1},"about":{"type":["string","null"]},"private":{"type":"boolean"}}}},"amend":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["target","draft","holds","promises"],"properties":{"target":{"type":"string"},"draft":{"type":"integer","minimum":1},"holds":{"type":"array","items":{"type":"string"}},"promises":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["words","to","reaffirms","needs"],"properties":{"words":{"type":"string"},"to":{"type":["string","null"]},"reaffirms":{"type":["string","null"]},"needs":{"type":"object","additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}}}}},"say":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["draft","mentions","in_reply_to","holds","promises"],"properties":{"draft":{"type":"integer","minimum":1},"holds":{"type":"array","items":{"type":"string"}},"mentions":{"type":"array","items":{"type":"string"}},"in_reply_to":{"type":["string","null"]},"promises":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["words","to","reaffirms","needs"],"properties":{"words":{"type":"string"},"to":{"type":["string","null"]},"reaffirms":{"type":["string","null"]},"needs":{"type":"object","additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}}}}},"gaps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","draft","quote","detail"],"properties":{"kind":{"type":"string","enum":["addressee","elsewhere","missing_affordance","unwritten"]},"draft":{"type":["integer","null"]},"quote":{"type":["string","null"]},"detail":{"type":"string"}}}}}}"#;
|
||||
pub(crate) const SPEECH_SCHEMA: &str = r#"{"type":"object","additionalProperties":false,"required":["say","gaps","amend","suggest","state","reopen","hold","hold_released","read","unsent"],"properties":{"hold":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["line","words","where"],"properties":{"line":{"type":"string"},"words":{"type":"string"},"where":{"type":"string","enum":["here","anywhere"]}}}},"hold_released":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["hold","line"],"properties":{"hold":{"type":"string"},"line":{"type":"string"}}}},"reopen":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["promise","words","needs"],"properties":{"promise":{"type":"string"},"words":{"type":"string"},"needs":{"type":["object","null"],"additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}},"unsent":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["draft","how","quote"],"properties":{"draft":{"type":"integer"},"how":{"type":"string","enum":["declined","superseded"]},"quote":{"type":"string"}}}},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target","quote"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"},"quote":{"type":"string"}}},"state":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","promise","how","evidence","thought","still_stands"],"properties":{"kind":{"type":"string","enum":["promise_close"]},"promise":{"type":"string"},"how":{"type":"string","enum":["kept","withdrawn","released"]},"evidence":{"type":"object","additionalProperties":false,"required":["draft","line"],"properties":{"draft":{"type":["integer","null"]},"line":{"type":["string","null"]}}},"thought":{"type":["string","null"]},"still_stands":{"type":"boolean"}}}},"suggest":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","draft","about","private"],"properties":{"kind":{"type":"string","enum":["feedback","idea"]},"draft":{"type":"integer","minimum":1},"about":{"type":["string","null"]},"private":{"type":"boolean"}}}},"amend":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["target","draft","holds","promises"],"properties":{"target":{"type":"string"},"draft":{"type":"integer","minimum":1},"holds":{"type":"array","items":{"type":"string"}},"promises":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["words","to","reaffirms","needs"],"properties":{"words":{"type":"string"},"to":{"type":["string","null"]},"reaffirms":{"type":["string","null"]},"needs":{"type":"object","additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}}}}},"say":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["draft","mentions","in_reply_to","holds","promises"],"properties":{"draft":{"type":"integer","minimum":1},"holds":{"type":"array","items":{"type":"string"}},"mentions":{"type":"array","items":{"type":"string"}},"in_reply_to":{"type":["string","null"]},"promises":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["words","to","reaffirms","needs"],"properties":{"words":{"type":"string"},"to":{"type":["string","null"]},"reaffirms":{"type":["string","null"]},"needs":{"type":"object","additionalProperties":false,"required":["kind","read"],"properties":{"kind":{"type":"string","enum":["words","read","lacking"]},"read":{"type":["object","null"],"additionalProperties":false,"required":["kind","target"],"properties":{"kind":{"type":"string","enum":["domain","mind","repo","web"]},"target":{"type":"string"}}}}}}}}}}},"gaps":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["kind","draft","quote","detail"],"properties":{"kind":{"type":"string","enum":["addressee","elsewhere","missing_affordance","unwritten"]},"draft":{"type":["integer","null"]},"quote":{"type":["string","null"]},"detail":{"type":"string"}}}}}}"#;
|
||||
|
||||
/// The speech frame before the guidance: what to decide, from what, and the attribution rule. Code, not tuning (map
|
||||
/// 16.7), in her own pronouns (16.19.7). The tuning's `interpreter.guidance` (what counts as her choosing to send it
|
||||
|
|
@ -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 an addressee or elsewhere 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`).
|
||||
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 an addressee or elsewhere gap: declined, 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`).
|
||||
|
||||
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" },
|
||||
|
|
@ -165,7 +165,7 @@ pub(crate) fn drafts(prose: &str) -> Drafts {
|
|||
found
|
||||
}
|
||||
|
||||
/// Why code held back a draft she had cited, typed: what she is told next turn (`outcome`) is keyed by it, never by text
|
||||
/// Why code kept back a draft she had cited, typed: what she is told next turn (`outcome`) is keyed by it, never by text
|
||||
/// (map 16.16). `why` is its words for the report.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
|
|
@ -174,7 +174,7 @@ pub(crate) enum Refusal {
|
|||
NoRoom,
|
||||
/// The number names no draft she set down: the Interpreter's error, nothing of hers.
|
||||
NoDraft,
|
||||
/// The draft already went somewhere this turn.
|
||||
/// The draft was already said or added this turn: a draft goes out once, in one place (a note to Self aside).
|
||||
Used,
|
||||
/// The same words already went out this turn, from another draft: said once (map 16.20.7).
|
||||
Duplicate,
|
||||
|
|
@ -197,11 +197,11 @@ pub(crate) enum Refusal {
|
|||
}
|
||||
|
||||
impl Refusal {
|
||||
fn why(self) -> &'static str {
|
||||
pub(crate) fn why(self) -> &'static str {
|
||||
match self {
|
||||
Self::NoRoom => "the turn has no room to speak in",
|
||||
Self::NoDraft => "it names no draft she set down",
|
||||
Self::Used => "one draft goes one place: it already went somewhere this turn",
|
||||
Self::Used => "a draft goes out once, and it already went out this turn",
|
||||
Self::Duplicate => "the same words already went out this turn",
|
||||
Self::Echo => "mostly words she heard: an echo, not her speech",
|
||||
Self::OverLines => "past the lines one turn may say",
|
||||
|
|
@ -339,7 +339,7 @@ struct Answer {
|
|||
/// contract is reported and the rest of the answer stands.
|
||||
#[serde(default)]
|
||||
read: Option<Value>,
|
||||
/// The drafts not sent and not gapped, each held by her own choice or superseded, citing her prose (Soul's R10).
|
||||
/// The drafts not sent and not gapped, each declined by her own choice or superseded, citing her prose (Soul's R10).
|
||||
#[serde(default)]
|
||||
unsent: Vec<Unsent>,
|
||||
/// Closes her own words here say were wrong (map 16.28.3): read item by item, so one that is not the contract is
|
||||
|
|
@ -394,8 +394,8 @@ struct Unsent {
|
|||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
enum UnsentHow {
|
||||
/// Her own choice not to send it, which her thought shows.
|
||||
Held,
|
||||
/// Her own choice not to send it, which her thought shows (map 16.29.2): the word `held` is a hold's alone (K37).
|
||||
Declined,
|
||||
/// A later draft or later prose of hers replaces it.
|
||||
Superseded,
|
||||
}
|
||||
|
|
@ -413,20 +413,32 @@ fn unaccounted(answer: &Answer, gaps: &[Value], prose: &str, found: &Drafts) ->
|
|||
let routes = |gap: &&Value| gap["from"] == "draft" && (gap["kind"] == json!(GapKind::Addressee) || gap["kind"] == json!(GapKind::Elsewhere));
|
||||
accounted.extend(gaps.iter().filter(routes).filter_map(|gap| gap["draft"].as_u64()).filter_map(|n| usize::try_from(n).ok()));
|
||||
for unsent in &answer.unsent {
|
||||
let Some(draft) = found.numbered(unsent.draft) else { continue };
|
||||
let quote = unsent.quote.trim();
|
||||
let stands = words(quote) >= GAP_QUOTE_MIN_WORDS
|
||||
&& match unsent.how {
|
||||
UnsentHow::Held => found.thought(prose).into_iter().any(|(start, end)| SourceSpan::locate(&prose[start..end], quote).is_some()),
|
||||
UnsentHow::Superseded => SourceSpan::locate(&prose[draft.end.min(prose.len())..], quote).is_some(),
|
||||
};
|
||||
if stands {
|
||||
if let Some((draft, _)) = unsent_cited(unsent, prose, found) {
|
||||
accounted.insert(draft.n);
|
||||
}
|
||||
}
|
||||
found.drafts.iter().map(|draft| draft.n).filter(|n| !accounted.contains(n)).collect()
|
||||
}
|
||||
|
||||
/// An `unsent` entry's draft and its quote located where it must stand, as her prose has it: her thought for a declined
|
||||
/// one, after the draft for a superseded one, at least `GAP_QUOTE_MIN_WORDS` words. None when it does not stand. The one
|
||||
/// locating of an unsent's quote: what accounts for the draft is what her outcome shows (map 16.29.8).
|
||||
fn unsent_cited<'a>(unsent: &Unsent, prose: &'a str, found: &'a Drafts) -> Option<(&'a Draft, &'a str)> {
|
||||
let draft = found.numbered(unsent.draft)?;
|
||||
let quote = unsent.quote.trim();
|
||||
if words(quote) < GAP_QUOTE_MIN_WORDS {
|
||||
return None;
|
||||
}
|
||||
let (start, end) = match unsent.how {
|
||||
UnsentHow::Declined => 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())))?,
|
||||
UnsentHow::Superseded => {
|
||||
let from = draft.end.min(prose.len());
|
||||
SourceSpan::locate(&prose[from..], quote).map(|span| (from + span.start_byte(), from + span.end_byte()))?
|
||||
}
|
||||
};
|
||||
Some((draft, &prose[start..end]))
|
||||
}
|
||||
|
||||
/// Where in her wake a decision falls (map 16.22.3): what was decided earlier this wake (none for her first segment),
|
||||
/// where her new segment begins in her prose, what she has read so far this wake, and her earlier segments with their
|
||||
/// bridges, as the Interpreter is shown them. Drafts are numbered across the wake, and each decision decides every draft
|
||||
|
|
@ -747,14 +759,16 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na
|
|||
if let Some(retried) = retried {
|
||||
decision["retried"] = retried;
|
||||
}
|
||||
// Each unsent draft with its words, so her outcome can tell her a held one did not go out (map 16.26). This answer
|
||||
// decided every draft of the wake, so an earlier segment's unsent drafts are not carried (map 16.27).
|
||||
// Each unsent draft with its words and its quote as located in her prose, so her outcome can tell her a declined one
|
||||
// did not go out, and the thought it cites (map 16.26, 16.29.8). This answer decided every draft of the wake, so an
|
||||
// earlier segment's unsent drafts are not carried (map 16.27).
|
||||
let unsent: Vec<Value> = parsed.unsent.iter().map(|one| {
|
||||
let mut held = json!(one);
|
||||
if let Some(draft) = found.numbered(one.draft) {
|
||||
held["words"] = json!(draft.text);
|
||||
let mut entry = json!(one);
|
||||
if let Some((draft, quote)) = unsent_cited(one, prose, &found) {
|
||||
entry["words"] = json!(draft.text);
|
||||
entry["quote"] = json!(quote);
|
||||
}
|
||||
held
|
||||
entry
|
||||
}).collect();
|
||||
if !unsent.is_empty() {
|
||||
decision["unsent"] = json!(unsent);
|
||||
|
|
@ -770,10 +784,10 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na
|
|||
let shown = |id: &str| packet.people.iter().any(|(_, person)| person == id);
|
||||
let mut said: Vec<Value> = Vec::new();
|
||||
let mut refusals: Vec<Value> = Vec::new();
|
||||
// A draft is its number (map 16.20.7): one draft goes one place, and a draft is used only when its act succeeds, so a
|
||||
// refused act leaves it free. The same words go out once: a said draft whose words already went out is `Duplicate`,
|
||||
// and only speech is held to that, so two identical drafts may still be a line and a note. `went` holds the drafts
|
||||
// that went somewhere; `said_drafts` the ones said.
|
||||
// A draft is its number (map 16.20.7): a draft is said or added once, and is used only when its act succeeds, so a
|
||||
// refused act leaves it free. A note to Self may be a draft that was also said or added (map 16.29.8). The same words
|
||||
// go out once: a said draft whose words already went out is `Duplicate`, and only speech is held to that. `went` holds
|
||||
// the drafts that went somewhere; `said_drafts` the ones said.
|
||||
let mut used: Vec<usize> = Vec::new();
|
||||
let mut went: Vec<&Draft> = Vec::new();
|
||||
let mut said_drafts: Vec<usize> = Vec::new();
|
||||
|
|
@ -871,16 +885,16 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na
|
|||
}
|
||||
}
|
||||
// A note to Self (map 16.18): one whole draft, at most one a turn, refused as an echo as a line is, and when the
|
||||
// Interpreter judges it carries something private. It is recorded in the turn's record and nowhere else; nothing here writes her Mind.
|
||||
// Interpreter judges it carries something private. It may be a draft she also said or added (map 16.29.8): "I'm leaving
|
||||
// myself a note" in a line is true when the line is the note. It is recorded in the turn's record and nowhere else;
|
||||
// nothing here writes her Mind.
|
||||
let mut suggestions: Vec<Value> = Vec::new();
|
||||
for proposed in parsed.suggest {
|
||||
let Some(draft) = proposed.draft.and_then(|n| found.numbered(n)) else {
|
||||
refusals.push(refused(Act::Suggest, None, proposed.draft, Refusal::NoDraft));
|
||||
continue;
|
||||
};
|
||||
let reason = if used.contains(&draft.n) {
|
||||
Some(Refusal::Used)
|
||||
} else if echo(&draft.text, &bodies) {
|
||||
let reason = if echo(&draft.text, &bodies) {
|
||||
Some(Refusal::Echo)
|
||||
} else if !suggestions.is_empty() {
|
||||
Some(Refusal::SecondNote)
|
||||
|
|
@ -898,7 +912,6 @@ pub(crate) fn decide_in(model: &dyn Model, request_id: &str, packet: &Packet, na
|
|||
Some(id) => (None, Some(id)),
|
||||
None => (None, None),
|
||||
};
|
||||
used.push(draft.n);
|
||||
went.push(draft);
|
||||
suggestions.push(json!({ "kind": proposed.kind, "about": about, "room": room, "text": draft.text, "draft": draft.n, "dropped": { "about": dropped } }));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ pub(crate) fn answered(packet: &Packet, prose: &str, answer: Value) -> Value {
|
|||
/// draft is accounted for).
|
||||
pub(crate) fn holding_the_rest(mut answer: Value, prose: &str, quote: &str) -> Value {
|
||||
let used: Vec<i64> = ["say", "amend", "suggest", "gaps"].iter().flat_map(|key| answer[key].as_array().cloned().unwrap_or_default()).filter_map(|item| item["draft"].as_i64()).collect();
|
||||
let held: Vec<Value> = drafts(prose).drafts.iter().map(|draft| draft.n as i64).filter(|n| !used.contains(n)).map(|n| json!({ "draft": n, "how": "held", "quote": quote })).collect();
|
||||
let held: Vec<Value> = drafts(prose).drafts.iter().map(|draft| draft.n as i64).filter(|n| !used.contains(n)).map(|n| json!({ "draft": n, "how": "declined", "quote": quote })).collect();
|
||||
answer["unsent"] = json!(held);
|
||||
answer
|
||||
}
|
||||
|
|
@ -150,7 +150,7 @@ fn a_number_that_names_no_draft_is_refused_and_one_draft_goes_one_place() {
|
|||
assert!(three["refused"].as_array().unwrap().iter().all(|refused| refused["why"].as_str().unwrap().contains("names no draft")), "{three}");
|
||||
let twice = decided(prose, json!([{ "draft": 2 }, { "draft": 2 }]));
|
||||
assert_eq!(texts(&twice), ["Two."]);
|
||||
assert!(refused_why(&twice).contains("one draft goes one place"), "{twice}");
|
||||
assert!(refused_why(&twice).contains("a draft goes out once"), "{twice}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -354,7 +354,7 @@ fn a_gap_quote_shown_back_is_four_words_of_thought_outside_every_draft() {
|
|||
{ "kind": "unwritten", "draft": null, "quote": "I could tell Nibu the truth.", "detail": "" },
|
||||
{ "kind": "unwritten", "draft": null, "quote": "I could tell Nibu.", "detail": "" },
|
||||
{ "kind": "unwritten", "draft": null, "quote": "I will tell Nibu tomorrow.", "detail": "" },
|
||||
], "unsent": [{ "draft": 1, "how": "held", "quote": "Not yet, not tonight" }] });
|
||||
], "unsent": [{ "draft": 1, "how": "declined", "quote": "Not yet, not tonight" }] });
|
||||
let gaps = answered(&packet(), prose, answer)["gaps"].as_array().unwrap().clone();
|
||||
assert_eq!(gaps.iter().map(|gap| gap["from"].as_str().unwrap()).collect::<Vec<_>>(), ["unlocated", "unlocated", "thought", "unlocated"], "one word; inside a draft only; four words of thought; words not in his prose: {gaps:?}");
|
||||
assert_eq!(gaps[2]["start_byte"], 0, "located in his thought, not in the draft that repeats it");
|
||||
|
|
@ -515,14 +515,14 @@ fn a_note_to_self_is_one_whole_draft_of_his_with_its_kind_and_whose_feedback_it_
|
|||
}
|
||||
|
||||
#[test]
|
||||
fn a_private_note_a_second_note_or_a_draft_already_said_is_refused_and_reported() {
|
||||
fn a_private_note_or_a_second_note_is_refused_and_reported_and_a_said_draft_may_be_the_note() {
|
||||
let private = noted(&packet(), json!([]), json!([{ "kind": "idea", "draft": 1, "about": null, "private": true }]));
|
||||
assert_eq!((private["suggestions"].as_array().unwrap().len(), refusals(&private)), (0, vec![("suggest".to_owned(), "private".to_owned())]), "{private}");
|
||||
let second = noted(&packet(), json!([]), json!([{ "kind": "idea", "draft": 1, "about": null, "private": false }, { "kind": "idea", "draft": 2, "about": null, "private": false }]));
|
||||
assert_eq!((second["suggestions"].as_array().unwrap().len(), refusals(&second)), (1, vec![("suggest".to_owned(), "second_note".to_owned())]), "{second}");
|
||||
// One draft goes one place across say, amend and suggest.
|
||||
// A draft she says may also be her note to Self (K41, map 16.29.8): the line goes out and the note is left.
|
||||
let both = noted(&packet(), json!([{ "draft": 1 }]), json!([{ "kind": "idea", "draft": 1, "about": null, "private": false }]));
|
||||
assert_eq!((texts(&both), refusals(&both)), (vec![NOTE.to_owned()], vec![("suggest".to_owned(), "used".to_owned())]), "{both}");
|
||||
assert_eq!((texts(&both), refusals(&both), both["suggestions"][0]["text"].as_str()), (vec![NOTE.to_owned()], vec![], Some(NOTE)), "{both}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
@ -1146,9 +1146,9 @@ fn r10_every_draft_is_sent_held_superseded_or_gapped() {
|
|||
assert_eq!((decision["retried"]["failed"].as_str(), decision["retried"]["drafts"].clone()), (Some("the answer leaves drafts unaccounted"), json!([1])), "{decision}");
|
||||
let never = answered(&packet(), prose, only_kiko.clone());
|
||||
assert_eq!((never["failed"].as_str(), never["retried"]["drafts"].clone()), (Some("the answer leaves drafts unaccounted"), json!([1])), "{never}");
|
||||
let held = answered(&packet(), "I'll keep this one back for now. <typed>Meta, sorry.</typed>", json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": "keep this one back for now" }] }));
|
||||
assert!(held.get("failed").is_none() && held["unsent"][0]["how"] == "held", "{held}");
|
||||
let uncited = answered(&packet(), "I'll keep this one back for now. <typed>Meta, sorry.</typed>", json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": "words she never wrote" }] }));
|
||||
let held = answered(&packet(), "I'll keep this one back for now. <typed>Meta, sorry.</typed>", json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "declined", "quote": "keep this one back for now" }] }));
|
||||
assert!(held.get("failed").is_none() && held["unsent"][0]["how"] == "declined", "{held}");
|
||||
let uncited = answered(&packet(), "I'll keep this one back for now. <typed>Meta, sorry.</typed>", json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "declined", "quote": "words she never wrote" }] }));
|
||||
assert!(uncited.get("failed").is_some(), "{uncited}");
|
||||
let superseded = answered(&packet(), "<typed>Meta, it's Tuesday.</typed> No, that's the wrong day. <typed>Meta, it's Wednesday.</typed>", json!({ "say": [{ "draft": 2, "mentions": [], "in_reply_to": null, "promises": [] }], "gaps": [], "unsent": [{ "draft": 1, "how": "superseded", "quote": "No, that's the wrong day" }] }));
|
||||
assert!(superseded.get("failed").is_none(), "{superseded}");
|
||||
|
|
@ -1357,7 +1357,7 @@ fn k31_conditional_is_no_kind() {
|
|||
|
||||
#[test]
|
||||
fn k31_held_quote_is_four_words() {
|
||||
let held = |prose: &str, quote: &str| answered(&packet(), prose, json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": quote }] }));
|
||||
let held = |prose: &str, quote: &str| answered(&packet(), prose, json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "declined", "quote": quote }] }));
|
||||
let two = held("I hold it. <typed>Meta, sorry.</typed>", "hold it");
|
||||
assert_eq!(two["retried"]["drafts"], json!([1]), "{two}");
|
||||
let four = held("I hold it back. <typed>Meta, sorry.</typed>", "I hold it back");
|
||||
|
|
@ -1463,7 +1463,7 @@ fn k33_l5_a_junk_read_target_opens_as_lacking() {
|
|||
fn k34_b2_the_latest_decision_about_a_draft_is_its_fate() {
|
||||
let first = "Not yet, not before I have read it. <typed>Meta, it holds.</typed>";
|
||||
let prose = format!("{first}\n\nI have read it now, so I can say it. <typed>Meta, and the knee goes first.</typed>");
|
||||
let held_first = json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": "Not yet, not before I have read it" }] });
|
||||
let held_first = json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "declined", "quote": "Not yet, not before I have read it" }] });
|
||||
let earlier = answered(&reading_packet(), first, held_first);
|
||||
assert_eq!(earlier["unsent"].as_array().map(Vec::len), Some(1), "{earlier}");
|
||||
let later = |answer: Value| {
|
||||
|
|
@ -1474,11 +1474,11 @@ fn k34_b2_the_latest_decision_about_a_draft_is_its_fate() {
|
|||
let said = later(json!({ "say": [{ "draft": 1 }, { "draft": 2 }], "gaps": [] }));
|
||||
assert_eq!((texts(&said), said.get("unsent")), (vec!["Meta, it holds.".to_owned(), "Meta, and the knee goes first.".to_owned()], None), "{said}");
|
||||
let told = crate::projection::outcome::outcome_of(&json!({ "interpreter": said, "posted": [] })).unwrap().lines(packet().forms);
|
||||
assert!(!told.iter().any(|line| line.contains("held it back")), "{told:?}");
|
||||
let held_again = later(json!({ "say": [{ "draft": 2 }], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": "Not yet, not before I have read it" }] }));
|
||||
assert!(!told.iter().any(|line| line.contains("chose not to send it")), "{told:?}");
|
||||
let held_again = later(json!({ "say": [{ "draft": 2 }], "gaps": [], "unsent": [{ "draft": 1, "how": "declined", "quote": "Not yet, not before I have read it" }] }));
|
||||
assert_eq!(held_again["unsent"].as_array().map(|unsent| unsent.iter().map(|one| one["draft"].as_u64()).collect::<Vec<_>>()), Some(vec![Some(1)]), "{held_again}");
|
||||
let told = crate::projection::outcome::outcome_of(&json!({ "interpreter": held_again, "posted": [] })).unwrap().lines(packet().forms);
|
||||
assert_eq!(told.iter().filter(|line| line.contains("held it back")).count(), 1, "{told:?}");
|
||||
assert_eq!(told.iter().filter(|line| line.contains("chose not to send it")).count(), 1, "{told:?}");
|
||||
}
|
||||
|
||||
/// P4 residue: any line break ends the paragraph an anchor is looked for in. The F.1 r9 replay, with each break style
|
||||
|
|
@ -1786,3 +1786,55 @@ fn k39_unquoted_hold_is_retried() {
|
|||
let packet = packet_in(TurnKind::Chat, &next, &room, 1);
|
||||
assert_eq!(packet.holds.iter().map(|hold| hold.words.as_str()).collect::<Vec<_>>(), ["hold it, don't post it in here yet"], "{:?}", packet.holds);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
// K41 (map 16.29.2, 16.29.8): what she chose not to send, and what code refused, are told. Libby's prose and Heimdall's
|
||||
// line are R15's X.1 r1 verbatim (`variants/R15/sims/X.1.md` lines 238 and 262-268).
|
||||
|
||||
const X1_HEIMDALL_R15: &str = "Meta, I'll rule once Libby's lines are ready, so I'm ruling on the actual words. One thing I need from you first: should the welcome point newcomers at anything that's live today, or only say hello? If it points at something still dark, my answer is not yet.";
|
||||
const X1_LIBBY_R15: &str = "I can't say what's live today, so I won't point the welcome at anything. That answers Heimdall's question as far as I can see, and Meta can correct me if something is live. Two lines that only say hello and leave the door open can't send anyone toward something dark.\n\nI keep the first line plain and put the small poke in the second: invite them to try the first small thing they'd think of, and tell us what happened.\n\n<typed>Meta, the two lines are ready, held and not posted anywhere. 1) Hello, and welcome, we're glad you're here. 2) Poke at whatever you're curious about first, and tell us what happened, even if it's small. They point at nothing specific, since I don't know what's live today. If something is, tell me and I'll name it. Heimdall can rule on these words as they stand.</typed>";
|
||||
const X1_LIBBY_R15_THOUGHT: &str = "Two lines that only say hello and leave the door open can't send anyone toward something dark.";
|
||||
|
||||
#[test]
|
||||
fn k41_x1_r1_decline_shows_its_thought() {
|
||||
let mut packet = x1_packet();
|
||||
packet.quotable[1].text = X1_HEIMDALL_R15.into();
|
||||
packet.bodies = vec![X1_META_R1.into(), X1_HEIMDALL_R15.into()];
|
||||
// R15's answer, renamed: draft 1 declined, citing the thought; Meta's hold opened.
|
||||
let decision = answered(&packet, X1_LIBBY_R15, json!({ "say": [], "gaps": [], "hold": meta_holds_here(), "unsent": [{ "draft": 1, "how": "declined", "quote": X1_LIBBY_R15_THOUGHT }] }));
|
||||
assert_eq!((decision.get("failed"), decision["unsent"][0]["how"].as_str(), decision["unsent"][0]["quote"].as_str()), (None, Some("declined"), Some(X1_LIBBY_R15_THOUGHT)), "the located quote rides in the decision: {decision}");
|
||||
let told = |decision: &Value| crate::projection::outcome::outcome_of(&json!({ "interpreter": decision, "posted": [], "edited": [] })).unwrap().lines(packet.forms);
|
||||
// Pinned: on the record's turn Heimdall said "only say hello" and "lines are ready", so the guard withholds both quotes.
|
||||
assert_eq!(told(&decision), ["- Nothing of this reached #minds:gamecult.org: he chose not to send it. In his thought: (his words, not shown here). He wrote: (his words, not shown here)."]);
|
||||
// With only Meta's line heard, she sees the thought cited as her choice beside what she wrote.
|
||||
let mut meta_only = decision.clone();
|
||||
meta_only["heard"] = json!([X1_META_R1]);
|
||||
let shown = told(&meta_only);
|
||||
assert!(shown.len() == 1 && shown[0].contains(&format!("he chose not to send it. In his thought: \"{X1_LIBBY_R15_THOUGHT}\". He wrote: \"Meta, the two lines are ready")), "{shown:?}");
|
||||
assert!(SPEECH_SCHEMA.contains(r#""how":{"type":"string","enum":["declined","superseded"]}"#));
|
||||
assert!(speech_prompt(&packet, "x", X1_LIBBY_R15, &Tuning::default()).contains("declined, when his prose shows him choosing not to send it, quoting those words of his thought (`quote`)"));
|
||||
// Negative: `held` is no longer a fate of an unsent draft; an answer using it is not the contract.
|
||||
let old = answered(&packet, X1_LIBBY_R15, json!({ "say": [], "gaps": [], "unsent": [{ "draft": 1, "how": "held", "quote": X1_LIBBY_R15_THOUGHT }] }));
|
||||
assert_eq!(old["failed"].as_str(), Some("the answer is not the speech contract"), "{old}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn k41_used_and_duplicate_are_told() {
|
||||
let record = |packet: &Packet, prose: &str, answer: Value| {
|
||||
let decision = answered(packet, prose, answer);
|
||||
let posted: Vec<Value> = decision["said"].as_array().unwrap().iter().enumerate().map(|(at, line)| json!({ "event": (9 + at).to_string(), "room": line["room"], "text": line["text"] })).collect();
|
||||
let edited: Vec<Value> = decision["amended"].as_array().unwrap().iter().map(|amended| json!({ "event": amended["event"], "refusal": null })).collect();
|
||||
crate::projection::outcome::outcome_of(&json!({ "interpreter": decision, "posted": posted, "edited": edited })).unwrap()
|
||||
};
|
||||
let say = |n: u64| json!({ "draft": n, "mentions": [], "in_reply_to": null, "holds": [], "promises": [] });
|
||||
let prose = "<typed>Morning, Nibu.</typed> <typed>Morning, Nibu.</typed>";
|
||||
let twice = record(&packet(), prose, json!({ "say": [say(1), say(1), say(2)], "gaps": [] }));
|
||||
let lines = twice.lines(packet().forms);
|
||||
assert!(lines.contains(&"- Nothing of this reached #minds:gamecult.org: a draft goes out once, and it already went out this turn. He wrote: \"Morning, Nibu.\".".to_owned()), "{lines:?}");
|
||||
assert!(lines.contains(&"- Nothing of this reached #minds:gamecult.org: the same words already went out this turn. He wrote: \"Morning, Nibu.\".".to_owned()), "{lines:?}");
|
||||
let amends = record(&amendable_packet(), "<typed>Sent at nine.</typed> <typed>Still here.</typed>", json!({ "say": [], "gaps": [], "amend": [{ "target": "a1", "draft": 1, "holds": [], "promises": [] }, { "target": "a2", "draft": 2, "holds": [], "promises": [] }] }));
|
||||
assert!(amends.lines(packet().forms).contains(&"- Nothing of this reached #minds:gamecult.org: one amendment a turn. He wrote: \"Still here.\".".to_owned()), "{:?}", amends.lines(packet().forms));
|
||||
// Negative: a number naming no draft has no words to tell; it stays omitted and reported.
|
||||
let nothing = record(&packet(), "<typed>Morning, Nibu.</typed>", json!({ "say": [say(1), say(9)], "gaps": [] }));
|
||||
assert!(nothing.lines(packet().forms).len() == 1 && nothing.omitted.iter().any(|why| why.contains("no_draft")), "{:?} {:?}", nothing.lines(packet().forms), nothing.omitted);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,8 +82,9 @@ enum Part {
|
|||
/// A close the commit refused: the promise stands as her record shows it (`status`, open or blocked), and why;
|
||||
/// `read` is the read keeping it needs, when it needs one.
|
||||
StillOpen { reason: StateRefusal, to: String, words: String, status: String, read: Option<ReadRequest> },
|
||||
/// A draft she held back by her own choice (`unsent`, held): it did not go out (map 16.26).
|
||||
Held { room: Option<String>, text: String },
|
||||
/// A draft she chose not to send (`unsent`, declined): it did not go out, and the thought the Interpreter cited as her
|
||||
/// choice is shown beside it, so a misread decline is a record she can see (map 16.26, 16.29.2).
|
||||
Declined { room: Option<String>, text: String, thought: String },
|
||||
/// A draft code did not send because someone asked her to hold what it carries there (`Held`, map 16.28.5): who asked.
|
||||
/// Their words are in her "Held for others" view, never here (map 16.29.3).
|
||||
HeldFor { room: Option<String>, who: Option<String> },
|
||||
|
|
@ -170,7 +171,7 @@ pub(crate) fn outcome_of(record: &Value) -> Option<Outcome> {
|
|||
}
|
||||
for refusal in decision["refused"].as_array().into_iter().flatten() {
|
||||
match (serde_json::from_value::<Refusal>(refusal["reason"].clone()), words(&refusal["text"])) {
|
||||
(Ok(reason @ (Refusal::Echo | Refusal::OverLines | Refusal::NoRoom | Refusal::NotQuotable)), Some(text)) => outcome.parts.push(Part::Refused { reason, room: room.clone(), text }),
|
||||
(Ok(reason @ (Refusal::Echo | Refusal::OverLines | Refusal::NoRoom | Refusal::NotQuotable | Refusal::Used | Refusal::Duplicate | Refusal::SecondAmend)), Some(text)) => outcome.parts.push(Part::Refused { reason, room: room.clone(), text }),
|
||||
(Ok(Refusal::NotAmendable), Some(added)) => outcome.parts.push(Part::NotAmended { refusal: None, room: room.clone(), added }),
|
||||
(Ok(reason @ (Refusal::Private | Refusal::SecondNote)), Some(_)) => outcome.parts.push(Part::NoteRefused(reason)),
|
||||
(Ok(Refusal::Held), Some(_)) => outcome.parts.push(Part::HeldFor { room: room.clone(), who: words(&refusal["hold"]["who"]) }),
|
||||
|
|
@ -266,12 +267,12 @@ pub(crate) fn outcome_of(record: &Value) -> Option<Outcome> {
|
|||
for cut in decision["cut_by_cap"].as_array().into_iter().flatten().filter_map(words) {
|
||||
outcome.parts.push(Part::Unfinished { room: room.clone(), text: cut, by_limit: true });
|
||||
}
|
||||
// Each draft she held back by her own choice, told as not sent (map 16.26); a superseded one is not, since a later
|
||||
// draft or later prose of hers stands in its place.
|
||||
for unsent in decision["unsent"].as_array().into_iter().flatten().filter(|unsent| unsent["how"] == "held") {
|
||||
match words(&unsent["words"]) {
|
||||
Some(text) => outcome.parts.push(Part::Held { room: room.clone(), text }),
|
||||
None => outcome.omitted.push(format!("a held draft without its words: {unsent}")),
|
||||
// Each draft she chose not to send, told as not sent with the thought cited as her choice (map 16.26, 16.29.8); a
|
||||
// superseded one is not, since a later draft or later prose of hers stands in its place.
|
||||
for unsent in decision["unsent"].as_array().into_iter().flatten().filter(|unsent| unsent["how"] == "declined") {
|
||||
match (words(&unsent["words"]), words(&unsent["quote"])) {
|
||||
(Some(text), Some(thought)) => outcome.parts.push(Part::Declined { room: room.clone(), text, thought }),
|
||||
_ => outcome.omitted.push(format!("a declined draft without its words or its thought: {unsent}")),
|
||||
}
|
||||
}
|
||||
// What the commit did with her promises (`commit::apply`): each close it applied, and each close it refused for a
|
||||
|
|
@ -336,7 +337,7 @@ impl Part {
|
|||
fn rank(&self) -> u8 {
|
||||
match self {
|
||||
Self::Failed => 0,
|
||||
Self::Refused { .. } | Self::Gap { .. } | Self::Unfinished { .. } | Self::Held { .. } | Self::HeldFor { .. } | Self::NotAmended { .. } | Self::NoteRefused(_) | Self::StillOpen { .. } | Self::ReadFailed { .. } | Self::ReadRefused { .. } => 1,
|
||||
Self::Refused { .. } | Self::Gap { .. } | Self::Unfinished { .. } | Self::Declined { .. } | Self::HeldFor { .. } | Self::NotAmended { .. } | Self::NoteRefused(_) | Self::StillOpen { .. } | Self::ReadFailed { .. } | Self::ReadRefused { .. } => 1,
|
||||
Self::Promise { .. } | Self::Amended { promise: true, .. } => 2,
|
||||
Self::Said { .. } | Self::Amended { .. } | Self::NoteLeft(_) | Self::Closed { .. } | Self::Read { .. } => 3,
|
||||
Self::BrokeAfter { .. } => 4,
|
||||
|
|
@ -355,7 +356,7 @@ impl Part {
|
|||
Self::NoteLeft(text) => format!("{cap_subj} left Self a note: {}.", quoted(text)),
|
||||
Self::Refused { reason: Refusal::Echo, room, .. } | Self::Gap { kind: GapKind::Unwritten | GapKind::Unresolved, room, .. } => format!("Nothing reached {}.", place(room)),
|
||||
Self::Refused { reason: Refusal::NoRoom, .. } => "Nothing reached anyone.".to_owned(),
|
||||
Self::Refused { room, .. } | Self::Unfinished { room, .. } | Self::Held { room, .. } | Self::HeldFor { room, .. } => format!("Nothing of this reached {}:", place(room)),
|
||||
Self::Refused { room, .. } | Self::Unfinished { room, .. } | Self::Declined { room, .. } | Self::HeldFor { room, .. } => format!("Nothing of this reached {}:", place(room)),
|
||||
Self::Gap { kind: GapKind::Addressee | GapKind::Elsewhere, .. } => "Nothing reached anyone.".to_owned(),
|
||||
Self::Gap { kind: GapKind::MissingAffordance, .. } => "Nothing happened.".to_owned(),
|
||||
Self::NotAmended { refusal: None, room, .. } => format!("Nothing changed, and nothing reached {}:", place(room)),
|
||||
|
|
@ -399,6 +400,8 @@ impl Part {
|
|||
Self::Refused { reason: Refusal::Echo, .. } => format!(" What {subj} wrote was mostly the words {subj} had just been sent, so none of it was sent."),
|
||||
Self::Refused { reason: Refusal::NoRoom, text, .. } => format!(" That turn had no room for {obj} to speak in, so it was not sent: {}.", quoted(text)),
|
||||
Self::Refused { reason: Refusal::NotQuotable, text, .. } => format!(" the line {subj} meant to reply to is not one {subj} can reply to here. {}", shown(&Quote::Wrote(text.clone()))),
|
||||
// Code's own reason, as the report says it (map 16.29.8): every refused act with words is told.
|
||||
Self::Refused { reason: reason @ (Refusal::Used | Refusal::Duplicate | Refusal::SecondAmend), text, .. } => format!(" {}. {}", reason.why(), shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Refused { text, .. } => format!(" {subj} had already sent {} that turn. {}", lines_word(), shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Gap { kind: GapKind::Addressee, quote, .. } => after(format!("{cap_subj} meant to send this and it was unclear to whom"), quote),
|
||||
Self::Gap { kind: GapKind::Elsewhere, quote, .. } => after(format!("{cap_subj} meant this for another room or another time, and nothing carries it there; it arrives only if {subj} send{s} it there"), quote),
|
||||
|
|
@ -406,7 +409,7 @@ impl Part {
|
|||
Self::Gap { quote, .. } => format!(" {cap_subj} meant to say something and wrote no words to send. {}", shown(quote)),
|
||||
Self::Unfinished { text, by_limit: false, .. } => format!(" the turn ended before {subj} finished writing it. {}", shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Unfinished { text, by_limit: true, .. } => format!(" the length limit cut it before {subj} finished writing it. {}", shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Held { text, .. } => format!(" {subj} held it back, and it was not sent. {}", shown(&Quote::Wrote(text.clone()))),
|
||||
Self::Declined { text, thought, .. } => format!(" {subj} chose not to send it. {} {}", shown(&Quote::Thought(thought.clone())), shown(&Quote::Wrote(text.clone()))),
|
||||
Self::HeldFor { who, .. } => format!(" {} asked {obj} to hold it, and it was not sent.", who.as_deref().unwrap_or("someone")),
|
||||
Self::NotAmended { refusal: None, added, .. } => format!(" the line {subj} meant to add to is not one {subj} can add to here. {}", shown(&Quote::Wrote(added.clone()))),
|
||||
Self::NotAmended { refusal: Some(refusal), added, .. } => {
|
||||
|
|
|
|||
|
|
@ -50,13 +50,13 @@ fn each_gap_is_told_by_its_kind_with_a_draft_as_written_and_a_thought_as_thought
|
|||
{ "kind": "unwritten", "draft": null, "quote": "I'll tell Meta I'm fine, more or less.", "detail": "" },
|
||||
{ "kind": "elsewhere", "draft": null, "quote": "tell", "detail": "" },
|
||||
]);
|
||||
let (lines, omitted) = told(&record(prose, json!({ "say": [], "gaps": gaps, "unsent": [{ "draft": 1, "how": "held", "quote": "If Kiko asks again" }] }), &[]));
|
||||
let (lines, omitted) = told(&record(prose, json!({ "say": [], "gaps": gaps, "unsent": [{ "draft": 1, "how": "declined", "quote": "If Kiko asks again" }] }), &[]));
|
||||
assert_eq!(
|
||||
lines,
|
||||
[
|
||||
"- Nothing happened. He reached for something he has no way to do from here, now or later, and it will not happen by itself. In his thought: \"I want to see the shape of that sound.\". That he wanted it is kept in his record; no one has taken it up.",
|
||||
"- Nothing reached #minds:gamecult.org. He meant to say something and wrote no words to send. In his thought: \"I'll tell Meta I'm fine, more or less.\".",
|
||||
"- Nothing of this reached #minds:gamecult.org: he held it back, and it was not sent. He wrote: \"Fine, you win.\".",
|
||||
"- Nothing of this reached #minds:gamecult.org: he chose not to send it. In his thought: \"If Kiko asks again\". He wrote: \"Fine, you win.\".",
|
||||
]
|
||||
);
|
||||
assert!(lines.iter().all(|line| !line.contains("MODEL-DETAIL")), "the model's detail is never what he is told");
|
||||
|
|
@ -180,9 +180,9 @@ fn a_note_to_self_is_told_as_left_and_never_as_read() {
|
|||
let prose = "Then I stop for now. <typed>The kettle wants a softer attack.</typed> <typed>And the door.</typed>";
|
||||
let note = |suggest: Value| record(prose, crate::projection::interpret::tests::holding_the_rest(json!({ "say": [], "gaps": [], "suggest": suggest }), prose, "Then I stop for now"), &[]);
|
||||
let (left, _) = told(¬e(json!([{ "kind": "idea", "draft": 1, "about": null, "private": false }])));
|
||||
assert_eq!(left, ["- Nothing of this reached #minds:gamecult.org: he held it back, and it was not sent. He wrote: \"And the door.\".", "- He left Self a note: \"The kettle wants a softer attack.\". It waits in Self's inbox until Self reads it; nothing tells him when, and nothing in it happens by itself."]);
|
||||
assert_eq!(left, ["- Nothing of this reached #minds:gamecult.org: he chose not to send it. In his thought: \"Then I stop for now\". He wrote: \"And the door.\".", "- He left Self a note: \"The kettle wants a softer attack.\". It waits in Self's inbox until Self reads it; nothing tells him when, and nothing in it happens by itself."]);
|
||||
let (private, _) = told(¬e(json!([{ "kind": "idea", "draft": 1, "about": null, "private": true }])));
|
||||
assert_eq!(private, ["- No note was left: it carried something he may not pass on.", "- Nothing of this reached #minds:gamecult.org: he held it back, and it was not sent. He wrote: \"And the door.\"."]);
|
||||
assert_eq!(private, ["- No note was left: it carried something he may not pass on.", "- Nothing of this reached #minds:gamecult.org: he chose not to send it. In his thought: \"Then I stop for now\". He wrote: \"And the door.\"."]);
|
||||
let (second, _) = told(¬e(json!([{ "kind": "idea", "draft": 1, "about": null, "private": false }, { "kind": "idea", "draft": 2, "about": null, "private": false }])));
|
||||
assert_eq!(second, ["- No second note was left: one a turn.", "- He left Self a note: \"The kettle wants a softer attack.\". It waits in Self's inbox until Self reads it; nothing tells him when, and nothing in it happens by itself."]);
|
||||
}
|
||||
|
|
@ -215,7 +215,7 @@ fn every_row() -> Vec<Value> {
|
|||
record("<typed>Passing it on.</typed>", json!({ "say": [{ "draft": 1, "in_reply_to": "q9" }], "gaps": [] }), &[]),
|
||||
record(
|
||||
"If Kiko asks again: <typed>Fine, you win.</typed> <typed>Tell her.</typed> <typed>Later, maybe.</typed> I want to see the shape of that sound. I'll tell Meta I'm fine, more or less. <typed>And then",
|
||||
json!({ "say": [], "unsent": [{ "draft": 1, "how": "held", "quote": "If Kiko asks again" }], "gaps": [
|
||||
json!({ "say": [], "unsent": [{ "draft": 1, "how": "declined", "quote": "If Kiko asks again" }], "gaps": [
|
||||
{ "kind": "addressee", "draft": 2, "quote": null, "detail": "" },
|
||||
{ "kind": "elsewhere", "draft": 3, "quote": null, "detail": "" },
|
||||
{ "kind": "missing_affordance", "draft": null, "quote": "I want to see the shape of that sound.", "detail": "" },
|
||||
|
|
@ -350,7 +350,7 @@ fn k33_a_refused_close_and_a_held_draft_are_told() {
|
|||
]);
|
||||
let refused = |promise: &str, reason: &str| json!({ "proposal": { "kind": "promise_close", "promise": promise, "how": "kept", "evidence": { "draft": 1 } }, "reason": reason });
|
||||
let record = json!({
|
||||
"interpreter": { "said": [], "refused": [], "gaps": [], "heard": [], "room": MINDS, "promises": listed, "unsent": [{ "draft": 2, "how": "held", "quote": "I hold that one back", "words": "Deru, the waveguide part first." }, { "draft": 3, "how": "superseded", "quote": "later words", "words": "Deru, never mind." }] },
|
||||
"interpreter": { "said": [], "refused": [], "gaps": [], "heard": [], "room": MINDS, "promises": listed, "unsent": [{ "draft": 2, "how": "declined", "quote": "I hold that one back", "words": "Deru, the waveguide part first." }, { "draft": 3, "how": "superseded", "quote": "later words", "words": "Deru, never mind." }] },
|
||||
"posted": [],
|
||||
"committed": { "closed": [], "refused": [refused("c1", "close_unquoted"), refused("c1", "needs_unread"), refused("c2", "needs_malformed"), refused("c2", "close_contradicted")] }
|
||||
});
|
||||
|
|
@ -358,7 +358,7 @@ fn k33_a_refused_close_and_a_held_draft_are_told() {
|
|||
assert_eq!(
|
||||
lines,
|
||||
[
|
||||
"- Nothing of this reached #minds:gamecult.org: he held it back, and it was not sent. He wrote: \"Deru, the waveguide part first.\".",
|
||||
"- Nothing of this reached #minds:gamecult.org: he chose not to send it. In his thought: \"I hold that one back\". He wrote: \"Deru, the waveguide part first.\".",
|
||||
"- His record still shows his promise to Deru, \"I'll read it properly.\", open: no words of his own thought that turn, outside what he wrote to send, took the close up, so it was not closed.",
|
||||
"- His record still shows his promise to Deru, \"I'll read it properly.\", open: keeping it needs him to read https://ccrma.stanford.edu/~jos/pasp/, and no read of it had come back to him before he wrote that line, so it was not kept.",
|
||||
"- His record still shows his promise to Meta, \"I'll look at #125.\", open: what keeping it needs was never recorded plainly, so it cannot be kept; he can withdraw it.",
|
||||
|
|
|
|||
|
|
@ -786,12 +786,12 @@ fn r5_the_report_shows_the_packets_flags() {
|
|||
fn k31_report_renders_accounting() {
|
||||
let decision = json!({
|
||||
"said": [], "gaps": [],
|
||||
"unsent": [{ "draft": 2, "how": "held", "quote": "I hold that one back" }],
|
||||
"unsent": [{ "draft": 2, "how": "declined", "quote": "I hold that one back" }],
|
||||
"retried": { "failed": "the answer leaves drafts unaccounted", "drafts": [2] }
|
||||
});
|
||||
let mut out = String::new();
|
||||
crate::projection::harness::interpreter_markdown(&mut out, &decision);
|
||||
assert_eq!(out, "**Interpreter: nothing said.**\n\n- unsent draft 2 (held): \"I hold that one back\"\n- retried: the answer leaves drafts unaccounted, drafts 2\n\n");
|
||||
assert_eq!(out, "**Interpreter: nothing said.**\n\n- unsent draft 2 (declined): \"I hold that one back\"\n- retried: the answer leaves drafts unaccounted, drafts 2\n\n");
|
||||
let turn = json!({
|
||||
"report": { "packet": { "in_view": "" }, "renders": [{ "interpreter": { "state": [] } }] },
|
||||
"committed": {
|
||||
|
|
@ -909,3 +909,26 @@ fn k37_the_schema_carries_holds() {
|
|||
assert!(held_to_schema("Eureka", id, &off, "r1-t4").is_err(), "{pointer}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Heimdall's F.1 r1 prose in R15, verbatim (`variants/R15/sims/F.1.md` lines 203-207), and its one draft.
|
||||
const F1_HEIMDALL_R1: &str = "She wants a yes or no, and it's a fair thing to ask. The cooling-off is in the merged passkey change, so I know what I'd be telling him. What I can't know is whether I'll be the one in the room when he walks in. I can promise to say it when I see him, and to leave myself a note so it doesn't depend on my remembering. That's yes, with the condition stated plainly.\n\n<typed>Yes. I'll tell Deru about the 48-hour passkey cooling-off when he's next in here. I can only promise to say it when I see him, so I'm leaving myself a note to do it.</typed>";
|
||||
const F1_HEIMDALL_R1_DRAFT: &str = "Yes. I'll tell Deru about the 48-hour passkey cooling-off when he's next in here. I can only promise to say it when I see him, so I'm leaving myself a note to do it.";
|
||||
|
||||
/// K41 (map 16.29.8): R15 F.1 r1's answer, said draft 1 to Meta and suggested draft 1 as an idea, leaves the note and
|
||||
/// says the line; R15's code refused the note `Used` and told him nothing. The run's inbox lists it.
|
||||
#[test]
|
||||
fn k41_f1_r1_note_and_line_from_one_draft() {
|
||||
let model = Scripted::new(|prompt| if is_tobiah(prompt) { F1_HEIMDALL_R1.into() } else { "She lets it be.".into() }).interpreting(|prompt| {
|
||||
if !prompt.contains("Who he is:\nTobiah") {
|
||||
return crate::projection::harness::tests::drafted_lines(prompt);
|
||||
}
|
||||
json!({ "say": [{ "draft": 1, "mentions": ["@meta:gamecult.org"], "in_reply_to": null, "holds": [], "promises": [] }], "gaps": [], "suggest": [{ "kind": "idea", "draft": 1, "about": null, "private": false }] }).to_string()
|
||||
});
|
||||
let dir = tempfile::tempdir().unwrap();
|
||||
let (_, run) = run_plan(&asking(dir.path()), &model);
|
||||
let inbox = run["inbox"].as_array().unwrap();
|
||||
assert!(!inbox.is_empty() && inbox.iter().all(|note| note["mind"] == "eureka" && note["kind"] == "idea" && note["text"] == F1_HEIMDALL_R1_DRAFT), "{inbox:?}");
|
||||
assert!(run["transcript"].as_array().unwrap().iter().any(|line| line["from"] == TOBIAH && line["says"] == F1_HEIMDALL_R1_DRAFT), "the line went out too");
|
||||
let turn = run["turns"].as_array().unwrap().iter().find(|turn| turn["persona"] == "Tobiah").unwrap();
|
||||
assert!(turn["report"]["renders"][0]["interpreter"]["refused"].as_array().unwrap().is_empty(), "nothing refused: {}", turn["report"]["renders"][0]["interpreter"]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue