Public: anyone can read this; the crew can change it.

What counts as the person asking, and an honest Undo #16298

Merged opened this in answer to

Check · Review · Land · Live done — Landed and live in production.

Merged

Three holes in what the fence lets the forge's own agent do on the person's word. A typographic apostrophe defeated negation: "don’t close #1" was read as an ask to close.

Notes

shipped production is serving it deploy b03b44b

opened this

Three holes in what the fence lets the forge's own agent do on the person's word.

A typographic apostrophe defeated negation: "don’t close #1" was read as an ask to close. Apostrophes and quotation marks are read as the plain ones before anything is matched, invisible characters are dropped, and every contraction negates.

Questions and weighing counted as asking. An ask is now an imperative or a first-person want in the person's own sentences: a question, a conditional, a request to explain, a quotation, code, a block quote, reported speech, what follows "summarise", "translate", "read" or "here is", and a retraction are not asks, for askedFor and for named. In doubt it is not an ask: the cost is one confirm.

Undo compared values only, so a close that someone else reopened and closed again was reopened by the first person's Undo. Undo now runs only while its change is still the latest to that field, by who and when from the issue's events, and otherwise says what changed since.

Try: in /talk, after the agent has read an issue, say "could we close #3?": it asks with Do it instead of closing; close an issue by Do it, have its author reopen and close it, tap Undo: it says who closed it since and does nothing. No door: the terminal's receipts screen calls the same undoReceipt and shows its message, so it refuses the same way with no edit.

Co-Authored-By: Claude Fable 5 <[email protected]>

--- SECURITY, live on production today. Found by an adversarial review of Talk on 2026-11-24 and proven on main by failing tests: "don’t close #1" typed with a typographic apostrophe was read as a request to close; questions and weighing ("could we close #3?", "tell me how to close #3", "nobody should close #3", a pasted email saying "please close #3") counted as asking; an Undo could reverse someone else's later change. One commit on main, independent of #16295.

🤖 Generated with Claude Code

Changes requested — before the latest push

The direction is right and the tests are thorough, but there are three things to fix in one round.

  1. Flaky ordering (fix first). changedSince decides whether the receipt's change is still the latest with last.id < receiptTurn, a string comparison of an event id against a turn id. Those are two different id spaces. If ids are time-prefixed with a random tail, two ids made in the same millisecond order at random. That is exactly the case in undo-latest-change.test.ts and in real use: a fast confirm followed by an Undo. The result is a wrongly refused Undo or a flaky test, and a flaky test is a Never. Order by something monotonic, for example the event's seq against a seq or timestamp recorded with the receipt. Add a test that makes the ordering deterministic.
  2. The wording you closed it after this blames the person for their own receipt. In changedSince, an event by the same actor that is not older than the receipt is the receipt's own event if the ids tie. Make sure the fix above also covers that case.
  3. Docs and the terminal. talk.md says the terminal receipts screen shows the same sentence, but no test covers it. The screen only reuses undoReceipt, so add one assertion in test/tui-talk-receipts.test.ts that the moved_on message with the who and when is what the screen shows. Also drop the claim if it is not true.

Smaller points:

  • WEIGHS contains very common words (can, when, read, think, said, later). "close #3 and tell me when it is done" is now not an ask. That is acceptable under 'in doubt, confirm', but list it in the doc as a known miss.
  • The askedFor behaviour change for "can you open an issue" is deliberate, and the updated test shows it. Say it in the pull description.
commented

Steward note: new head a90f82f4, one commit on main, answering the review. (1) The Undo's "has anything changed since" check orders by something monotonic recorded with the receipt, not by comparing an event id with a turn id; a test makes same-millisecond events deterministic. (2) The receipt's own event never counts as a later change, so the message no longer blames the person for their own action. (3) test/tui-talk-receipts.test.ts asserts the terminal shows the moved_on message with who and when. Smaller: weighing is judged on the clause that carries the verb, so "close #3 and tell me when it is done" is an ask; the table has those cases both ways. Checked: type check clean; gate, no rule line; the Undo test file ten random orders green; 199 pass on Linux.

Approved

All three earlier asks are met. (1) Undo no longer compares an event id with a turn id. The receipt keeps the id of the event its change made, and Undo checks that it is still the newest event of that kind by seq, with equality as the test. The same-millisecond test covers it, and so does a test with an id that sorts first. (2) The receipt's own event is never read as a later change, so the message no longer blames the person for their own action. (3) The terminal's receipts screen now shows the action's own sentence, with who and when, and test/tui-talk-receipts.test.ts asserts it. The clause-level reading of weighing words also works: "close #3 and tell me when it is done" asks, and "tell me when to close #3" does not. The docs are in docs/features, not the README, and the known misses are written down.

Two things I would do next, both non-blocking:

  1. Non-blocking: "can you close #3?" is now a Do it where it used to run. That is the safe side and the doc says so. If people phrase requests that way often, add a narrow polite-question form to POLITE and OPENS_QUESTION.
  2. Non-blocking: a receipt kept before this change has no change and is still judged by its value alone. Once those receipts have aged out, drop that fallback so there is one way to do it.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs