Repository navigation
Give the CLI one JSON refusal shape, and thread commands coded refusals - #2710
Merged
Merged
Conversation
Every gate at the append door now returns a `Finding` (`findings.py`): a stable code and the values it read, among them the refused event's `kind` and the identity or field it concerns, with what was offered and what would have been admitted where a value was refused. `EventRefused` and `AttemptConflict` carry that one finding; the words for every code live in `findings._TEXT` beside the check findings, so they are written once. Schema refusals carry the JSON pointer of the `field` and the schema `rule` it breaks. The layer-protocol refusals (`foreign-layer`, `foreign-revision`) are findings too, so serving and admission share them. The event door's refusal answer (HTTP 400/409) carries `findings` beside `error`, the words the browser shows; `refusals.Refusal`'s separate user words become a `_USER` entry per code (`stale-move`, `stale-edit`). `Refused.json()` is the one JSON shape of a refusal. A failed thread title records the refusal's code. No user-visible behaviour changed: every refusal reads as it did, in the browser and on the command line. Tests that matched admission refusal text in-process or in the door's answer now read the code and fields (`refused_on`); those that read the CLI's printed text follow with the command line's `--json` refusals. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A custom detail key such as a/b named a nested b; ~ and / now escape as RFC 6901 says. No user-visible behaviour changed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/scripts/leaf/event_contracts.py # skills/leaf/scripts/leaf/findings.py # skills/leaf/scripts/leaf/layer.py # skills/leaf/scripts/leaf/todos.py # skills/leaf/scripts/leaf/work.py # tests/model/test_asks.py
# Conflicts: # skills/leaf/scripts/leaf/findings.py
# Conflicts: # skills/leaf/scripts/leaf/findings.py # tests/model/test_interact_contract.py
`LeafGroup`, the command line's one translation of a refusal, prints it as one JSON object on stdout (`Refused.json`: `error` and the `findings` it rests on) where the command was given `--json`, and its words on stderr otherwise. It exits 1 either way. A command's `--json` comes from `json_option`, which records the request where `LeafGroup` reads it, so `page check`, `package check` and `page interactions` refuse in JSON under their own flag. Every write that prints its records (the `thread`, `response` and `task` groups' commands, `page stamp` and `page report`) takes `--json` from its command class (`RecordsCommand`), with no per-command flag. The thread and task commands' own refusals (`thread`, `tasks.cmd_open`) become findings with stable codes, worded in `findings._TEXT` beside the append door's. An attempt reused for another reply shares the door's `attempt-conflict` code. User-visible: `--json` on those commands prints a refusal as JSON. An anchored comment on an invalid saved source now reads "cannot anchor while index.html is invalid", as a reply's "cannot reply while ..." does. Every other refusal reads as before. Tests that matched these commands' refusal text now read codes. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # skills/leaf/scripts/leaf/findings.py # skills/leaf/scripts/leaf/refusals.py # skills/leaf/scripts/leaf/todos.py
leaf-agent
approved these changes
Oct 13, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 13, 2026
#2710 moved thread.py's owed-response refusal into a coded finding; the sweep's `owed` rename now targets that call. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This follows #2697, which made the append door refuse on
Findingrecords. Here the command line gets one JSON shape for a refusal, and the thread and task commands' own refusals get stable codes, so tests and scripts read the code instead of parsing text.LeafGroup, the command line's one translation of a refusal, printsRefused.json()(error, plus thefindingswith each code and its fields) on stdout when the command was given--json. Otherwise it prints the words on stderr, as before. Either way the command exits 1. The HTTP event door's refusal answer has the sameerror/findingsshape.--jsoncomes from:json_optionrecords the request whereLeafGroupreads it. Sopage check,package checkandpage interactionsrefuse in JSON under the flag they already had. Every write that prints its records (thethread,responseandtaskgroups' commands,page stampandpage report) gets--jsonfrom its command class (RecordsCommand, set once onRecordsGroup), with no per-command flag.thread.pyandtodos.cmd_openbecome findings worded infindings._TEXT. An attempt reused for another reply shares the door'sattempt-conflictcode.command_refusal(from Report registry problems as findings #2698, which now takes any argument type) or through--jsonandrefused_on. A heuristic count of assertions matching refusal words from the append door or the thread commands fell from 97 before Refuse events on findings with stable codes, not sentences #2697 to 28. What remains is the stop guard's reason, the user-facing words ofstale-move/stale-edit, the re-vendor remedy thatpage init/server start/waitprint, and a thread refusal's guidance about which command to use. All of that is wording the reader acts on.User-visible:
--jsonon those commands prints a refusal as JSON. An anchored comment on an invalid saved source now reads "cannot anchor while index.html is invalid", worded like a reply's "cannot reply while …". Every other refusal reads as before. The help snapshot gains the--jsonlines.