@jesdi/skills 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/README.md +5 -0
  2. package/package.json +2 -1
  3. package/skills/implement-spec/ARCHITECTURE.md +102 -54
  4. package/skills/implement-spec/README.md +53 -51
  5. package/skills/implement-spec/SKILL.md +5 -6
  6. package/skills/implement-spec/driver.py +67 -153
  7. package/skills/implement-spec/driver_agents.py +75 -25
  8. package/skills/implement-spec/driver_decisions.py +92 -199
  9. package/skills/implement-spec/driver_dispute.py +189 -0
  10. package/skills/implement-spec/driver_final.py +196 -97
  11. package/skills/implement-spec/driver_fixloop.py +102 -192
  12. package/skills/implement-spec/driver_legacy.py +73 -5
  13. package/skills/implement-spec/driver_locked.py +186 -0
  14. package/skills/implement-spec/driver_merge.py +3 -48
  15. package/skills/implement-spec/driver_report.py +84 -64
  16. package/skills/implement-spec/driver_review.py +12 -119
  17. package/skills/implement-spec/driver_run.py +167 -130
  18. package/skills/implement-spec/driver_state.py +11 -9
  19. package/skills/implement-spec/models.json +0 -2
  20. package/skills/implement-spec/prompts/arbitration.md +34 -0
  21. package/skills/implement-spec/prompts/conflict.md +1 -0
  22. package/skills/implement-spec/prompts/correction.md +7 -4
  23. package/skills/implement-spec/prompts/elsewhere.md +6 -0
  24. package/skills/implement-spec/prompts/final-fixer.md +1 -1
  25. package/skills/implement-spec/prompts/final-lens.md +40 -0
  26. package/skills/implement-spec/prompts/final-reviewer.md +7 -7
  27. package/skills/implement-spec/prompts/fixer.md +2 -2
  28. package/skills/implement-spec/prompts/implementer.md +1 -1
  29. package/skills/implement-spec/prompts/lens-copy.md +1 -0
  30. package/skills/implement-spec/prompts/lens-correctness.md +8 -0
  31. package/skills/implement-spec/prompts/lens-spec.md +2 -0
  32. package/skills/implement-spec/prompts/lens-structure.md +2 -0
  33. package/skills/implement-spec/prompts/rebase-conflict.md +1 -0
  34. package/skills/implement-spec/prompts/rereview.md +0 -1
  35. package/skills/implement-spec/prompts/rerun.md +1 -1
  36. package/skills/implement-spec/prompts/reviewer.md +3 -6
  37. package/skills/implement-spec/prompts/ruled.md +3 -0
  38. package/skills/implement-spec/prompts/test-writer.md +4 -5
  39. package/skills/implement-spec/tests/test_agents.py +23 -22
  40. package/skills/implement-spec/tests/test_amendments.py +6 -48
  41. package/skills/implement-spec/tests/test_arbitration.py +314 -0
  42. package/skills/implement-spec/tests/test_cli.py +3 -3
  43. package/skills/implement-spec/tests/test_decisions.py +251 -374
  44. package/skills/implement-spec/tests/test_driver.py +22 -50
  45. package/skills/implement-spec/tests/test_final.py +45 -77
  46. package/skills/implement-spec/tests/test_fixloop.py +400 -633
  47. package/skills/implement-spec/tests/test_landing.py +23 -126
  48. package/skills/implement-spec/tests/test_lenses.py +217 -0
  49. package/skills/implement-spec/tests/test_merge.py +0 -43
  50. package/skills/implement-spec/tests/test_models.py +50 -1
  51. package/skills/implement-spec/tests/test_report.py +9 -23
  52. package/skills/implement-spec/tests/test_review.py +15 -153
  53. package/skills/implement-spec/tests/test_review_page.py +7 -3
  54. package/skills/implement-spec/tests/test_scoped.py +125 -0
  55. package/skills/implement-spec/tests/test_state.py +8 -3
  56. package/skills/implement-spec/tests/test_stops.py +43 -61
  57. package/skills/implement-spec/tests/test_tidy.py +77 -98
  58. package/skills/implement-spec/tests/test_walk.py +7 -6
  59. package/skills/review-page/SKILL.md +1 -1
  60. package/skills/test-prune/SKILL.md +10 -4
  61. package/skills/test-prune/prune.py +5 -4
  62. package/skills/test-prune/prune_repo.py +5 -0
  63. package/skills/test-prune/prune_strengthen.py +36 -5
  64. package/skills/test-prune/tests/test_prune_strengthen.py +144 -0
  65. package/skills/to-tickets/SKILL.md +1 -1
  66. package/skills-manifest.json +9 -9
  67. package/skills/implement-spec/prompts/corrected.md +0 -3
  68. package/skills/implement-spec/prompts/correctness.md +0 -42
  69. package/skills/implement-spec/prompts/final-scoped.md +0 -1
  70. package/skills/implement-spec/prompts/full-review.md +0 -2
  71. package/skills/implement-spec/prompts/overruled.md +0 -7
  72. package/skills/implement-spec/prompts/rejected.md +0 -1
  73. package/skills/implement-spec/prompts/restored-red.md +0 -3
  74. package/skills/implement-spec/prompts/restored.md +0 -3
  75. package/skills/implement-spec/prompts/stands.md +0 -2
package/README.md CHANGED
@@ -17,6 +17,11 @@ pnpm check
17
17
  `pnpm test:python` and `pnpm check` use `.venv` automatically when no other
18
18
  virtual environment is active. Otherwise they use `python3` from your PATH.
19
19
 
20
+ `pnpm check:fast [file…]` is the fast gate: the type check, then the given
21
+ test files (default: `IMPLEMENT_SPEC_LOCKED`), each `test_*.py` or `*_test.py` in its own
22
+ pytest run and the `*.test.ts` files in one vitest run; other files, such as fixtures, are
23
+ skipped. implement-spec takes it as `--fast-gate`.
24
+
20
25
  ## Install skills
21
26
 
22
27
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jesdi/skills",
3
- "version": "0.0.76",
3
+ "version": "0.0.78",
4
4
  "description": "jesdi's agent skills (content package consumed by @jesdi/skills-cli)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -32,6 +32,7 @@
32
32
  "test:python": "sh scripts/test-python.sh",
33
33
  "crap-gate": "sh skills/crap-gate/run.sh",
34
34
  "check": "sh scripts/check.sh",
35
+ "check:fast": "sh scripts/check-fast.sh",
35
36
  "generate-manifest": "tsx scripts/generate-manifest.ts"
36
37
  }
37
38
  }
@@ -13,12 +13,14 @@ A comment in the code is for a line that looks wrong or removable without it.
13
13
  | `driver.py` | The command line, the checks before the first agent, the walk of the ticket graph, one ticket from its phase to merged or blocked, the landing on the PR branch, the exit code |
14
14
  | `driver_run.py` | `Run` (what all ticket threads share), one agent with its one rerun, the gate call, the ledger, `Blocked` |
15
15
  | `driver_fixloop.py` | A gated ticket tip in, a reviewed tip out: review, test-writer correction, fix rounds |
16
+ | `driver_dispute.py` | A disputed locked test: the arbitration, its correction, the once-per-file record, `spec-ambiguous` |
16
17
  | `driver_final.py` | The end of run: tidy, rebase, gate, final review, one fix batch, push |
17
18
  | `driver_tickets.py`, `driver_graph.py` | Ticket files in, tickets or errors out; which tickets can start now |
18
19
  | `driver_agents.py` | Model entries, the CLI command of each provider, prompt templates, the blocking launch |
19
20
  | `driver_report.py` | Validation of one agent report against its schema, git and the agent's log |
20
- | `driver_review.py` | The locked-file check of a ticket's own tests, the routing of findings, mutation proofs |
21
- | `driver_merge.py` | Merges by git plumbing, the locked-file check of a landing, the move of the PR ref |
21
+ | `driver_locked.py` | The one locked-file rule: which files are locked, the baseline of each agent and of the landing, the diff that finds a change |
22
+ | `driver_review.py` | The routing of findings; the slot and the shared git config that a read-only role must leave as they were |
23
+ | `driver_merge.py` | Merges by git plumbing, the move of the PR ref |
22
24
  | `driver_gate.py` | One gate of a commit: the command, once more when a signal ended it, and its record |
23
25
  | `driver_slots.py` | The worktrees that tickets run in, and the `git` helper |
24
26
  | `driver_state.py` | `state.json` (the resume contract) and the kernel lock |
@@ -27,8 +29,8 @@ A comment in the code is for a line that looks wrong or removable without it.
27
29
  | `driver_decisions.py`, `driver_answers.py`, `driver_review_page.py` | Operator questions, their answers, the page that shows them |
28
30
  | `driver_tidy.py`, `driver_summary.py` | The history with one commit per ticket; `summary.md` |
29
31
 
30
- `driver.py`, `driver_fixloop.py` and `driver_final.py` decide what comes next. The other modules do one thing
31
- and do not know about the run, except `driver_run.py`, which the three deciding modules share.
32
+ `driver.py`, `driver_fixloop.py`, `driver_dispute.py` and `driver_final.py` decide what comes next. The other modules do one thing
33
+ and do not know about the run, except `driver_run.py`, which the deciding modules share.
32
34
 
33
35
  ## Conventions
34
36
 
@@ -55,36 +57,40 @@ and do not know about the run, except `driver_run.py`, which the three deciding
55
57
  - The driver writes no prose of its own into a prompt: a prompt is a template with its pointers filled. The same
56
58
  holds for each title, question and ruling in `driver_decisions.py`.
57
59
  - The ledger is written only by the driver, and the driver reads no fact from it.
58
- - A check that git cannot do is a failed check, never a passed one (`locked_changes`, `refused`, `written`).
60
+ - A check that git cannot do is a failed check, never a passed one (`driver_locked.errors`).
59
61
 
60
62
  ### Locked tests
61
63
 
62
- - The commit of the test-writer is the reference of the ticket's locked files. Before each review, a locked file
63
- that differs from its reference is a critical finding (`driver_review.locked_findings`).
64
- - A correction of the test-writer is a new reference. For that reason the driver first puts each locked file back
65
- to its locked version and commits that (`Run.restore_locked_files`), and a correction may change only the files it
66
- lists, after `overrule-test` and in the fix loop. Its commit becomes the reference of each file it lists. A locked
67
- file that it does not list and that differs from the old reference keeps the old reference in the ticket's `held`,
68
- so a change of the implementer stays a finding (`driver_review.written`).
69
- - The restore is a commit, not a tree change: an agent commits only its own files, and a gate refuses a tree that
70
- is not clean, so a restore left in the tree would turn the next gate red and use a fix round. The correction's
71
- prompt names the restored files (`prompts/restored.md`): this is the one path for a change of an earlier ticket's
72
- locked test that a later ticket's interface needs.
73
- - The driver, not the correction, decides whether a restored file fails with the ticket's code: in the fix loop it
74
- gates the restore commit, whose parent has a green gate. A red gate goes to the correction as evidence
75
- (`prompts/restored-red.md`), and a DONE correction must then list a restored file. An agent's judgement of
76
- "this test does not fail" missed a red file and led to a refused merge (issue #90). After `overrule-test` the
77
- parent has no green gate, so a red gate proves nothing there: the next review catches the file instead.
78
- - The locked files of merged tickets are checked before each review (`driver_review.merged_changes`): a change is a
79
- `fixture` finding, so it goes to a correction, where the restore and its gate decide. They are checked again when
80
- a ticket lands (`driver_merge.refused`): the tree that lands must have each of them as the PR tip has it. A
81
- ticket's test-writer may change one only when it lists it. So a review finding on such a file goes to a correction
82
- too: a fixer's change there is put back, and the ticket would loop until BLOCKED (issue #116).
83
- - A refused landing asks a `merged-locked-file` question. `driver._rulings` applies its answers at the next landing:
84
- `restore` is a commit of the driver (`Run.restore_merged_files`), and `adopt` adds the file to the ticket's
85
- `locked` only when the ticket lands. A red merge gate after a ruling takes the restore commit back and asks again
86
- (`driver._red_landing`); `driver_decisions.question` leaves out the option that was tried.
87
- - A conflict resolution, of a merge or of the rebase, may not change a locked file.
64
+ - `driver_locked` is the one place of the locked-file rule: which files are locked (`every`, `others`), the
65
+ baseline of each agent (`for_ticket`, `for_end_of_run`, `landing_errors`) and the diff. `driver_report.validate`
66
+ calls `driver_locked.errors` once, with the `Locked` check that `_attempts` reads when the agent ends: the
67
+ `Call`'s own `locked`, else that of a ticket agent.
68
+ - Only the test-writer changes a locked file, and it lists each one it changes in `locked`, of its own ticket or of
69
+ another (`driver_locked._unlisted_errors`, `driver_report._correction_errors`). A correction may change only the
70
+ files it lists. Its commit becomes the baseline of the ticket's own locked files (`driver_locked.written`).
71
+ - After the implementer, a fixer and the ticket conflict agent, the driver checks the locked files with a diff
72
+ (`driver_locked._own_errors`, `_others_errors`): the ticket's own
73
+ against its last test-writer commit, every other ticket's whose test-writer has run, merged or not, against the
74
+ merge base of the ticket branch and the PR tip. Another ticket's file as the PR tip has it is no change; the
75
+ ticket's own when it is the clean three-way merge (`git merge-file`) of its test-writer's version and the PR tip's,
76
+ from their merge base, so a conflict merge takes in what landed and keeps the test-writer's tests, and no role can
77
+ put the file back to the PR tip's version. The baseline is stateless, so a breach left on the tip by a rejected rerun is found again after a `retry`. A changed locked file
78
+ rejects the report naming the file, so the rerun on the next entry and `ticket-blocked` apply as to any rejection.
79
+ - At landing, under the merge lock and before the full gate, `driver._refuse_breach` compares the commit that
80
+ would land with the PR tip on every other ticket's locked files (but those the ticket lists as its own,
81
+ `driver_locked.landing_errors`): a change, or a git error, blocks the ticket with one `ticket-blocked` question
82
+ and the PR branch does not move. Its `retry` resumes at `implement`, whose check then names the file.
83
+ - The reviewer gets the diff of each locked file of another ticket that the ticket changed
84
+ (`driver_locked.changed_elsewhere`, `prompts/elsewhere.md`): only the test-writer can have made it, and the
85
+ reviewer judges it against the spec. A review finding on such a file goes to a correction, since a fixer may not
86
+ change it (issue #116).
87
+ - The final fixer and the rebase conflict agent get the same check over every ticket's locked files
88
+ (`driver_locked.for_end_of_run`): against the tidied tip, or for the rebase that makes it, the recovery point. When
89
+ the rebase conflict agent ends, the driver goes on with the rebase it left open (`driver_final._rebase_check`, the
90
+ `locked` of its `Call`), so the check reads the
91
+ rebased tip, and a rejected agent's rerun amends that tip. A `git rebase --continue` that fails at the same stop
92
+ rejects the report with git's error, so the agent reruns on the open rebase. A rebase that stops at a later conflict is checked by
93
+ nobody, as the driver aborts it. The final review has no locked-file findings of the driver.
88
94
 
89
95
  ### The PR branch
90
96
 
@@ -103,7 +109,7 @@ and do not know about the run, except `driver_run.py`, which the three deciding
103
109
  ### Work is never dropped
104
110
 
105
111
  - A role that commits keeps its tree after a timeout or an interrupt; its rerun continues from it.
106
- - A read-only role (reviewer, correctness, final-reviewer, pr-writer) has no work to keep. When it changes its slot or
112
+ - A read-only role (reviewer, final-reviewer, the final lenses, pr-writer) has no work to keep. When it changes its slot or
107
113
  the shared git config, the driver restores them and runs the review one more time (`Run.read_only`). The config is
108
114
  the keys of that file before the role (`driver_review.shared_config`): every worktree reads that one file, so a key a
109
115
  role writes there, such as a `core.worktree` on a temp directory, breaks git in all of them. Other sessions write
@@ -133,43 +139,85 @@ and do not know about the run, except `driver_run.py`, which the three deciding
133
139
  an agent is reaped, the run stops. No group gets a signal after its leader is reaped.
134
140
  - A role gets one rerun. The rerun prompt is the first prompt, the rejection, then the same ending again.
135
141
  A timeout doubles the time of the rerun.
136
- - Fix rounds stop at 2, and round 2 goes to the next implementer entry. The correctness pass never runs on the
137
- provider of the implementer.
142
+ - Fix rounds stop at 2, and round 2 goes to the next implementer entry.
143
+ - A ticket review runs one agent, the reviewer. Its prompt carries the ticket's Risk line as one more criterion
144
+ (`driver._risk`), so a risk that the diff does not handle is an unmet criterion under the usual round and cap rules.
145
+ - A `--models` file may name only the roles of the skill's `models.json` (`driver_agents.load_models`): a removed
146
+ role (`correctness`, `explorer`) or an unknown one stops the run before the preflight.
147
+ - The full final review is three lens roles, `final-spec`, `final-correctness` and `final-structure`, with no model
148
+ list. `driver_agents.LENSES` is the one table of a lens: the `source` of its findings, the method file it follows,
149
+ whether its lines of the one lens prompt `prompts/final-lens.md` inline that file, and whether it runs on another
150
+ provider. Its lines are `prompts/lens-<source>.md`, with `prompts/lens-copy.md` as `{copy}`. The entry, the
151
+ prompt values (`driver_final._lens_values`), the precondition errors and the source tags read it, and `TIMEOUTS` and
152
+ `READ_ONLY` take its roles. `driver_agents.lens_entries` takes the entries from `final-reviewer`, and
153
+ `other_provider_entries` keeps a lens, its rerun too, on another provider than the first implementer entry;
154
+ `load_models` refuses a list with none. `driver_final._run_lenses` runs them at the same time in slot 1 inside one
155
+ `Run.read_only`, so a lens that changes the slot makes all three run again. A lens that stops or is rejected
156
+ twice stops the round only after every lens has ended, with one `final-ticket-blocked` question for each such lens
157
+ (`Run.ask` adds them to one stop); an accepted lens report is kept in `run.final.lenses` with
158
+ its tip and reused for that tip only. `driver_final._merged` makes the (file, line, title) of a finding unique,
159
+ keeping the more severe one, then the earlier lens; must-fix matching keeps its own (file, title) key. The
160
+ findings of the scoped review get the source `final-reviewer`; a findings file of an older driver, with no
161
+ `source`, is read only by the scoped review agent. The lens reports go to
162
+ `run.final.lenses` only once `Run.read_only` returns, so a report of a slot that a lens changed is never kept.
163
+ - The scoped review after the fix batch is one `final-reviewer` agent on `other_provider_entries`, never the three
164
+ lenses again. Each finding it leaves open asks one `final-ticket-blocked` question (`driver_final._settle_review`);
165
+ only a `retry` runs another fix batch and scoped review, and `edit` keeps the end of run BLOCKED
166
+ (`driver_final._parked`).
138
167
  - A red gate on the implementer's or a fixer's commit is a finding of the next round (`driver_fixloop._gate`), so
139
168
  it blocks after round 2. A red gate on a test-writer correction blocks.
140
169
  - The implementer and each fixer get the `--gate` command and run it before they report. The gate of the driver
141
170
  stays the source of truth: an agent's run of the gate counts for nothing.
142
171
  - A finding that a correction reports in `not_addressed` goes to the fixer of the same round as kind `code`
143
- (`driver_fixloop._correct` rewrites it in the findings file): the test needs a production change first, so a
172
+ (`driver_fixloop._uncorrected` rewrites it in the findings file): the test needs a production change first, so a
144
173
  second correction could not close it.
174
+ - Every test-writer correction, after a `test-wrong` ruling, a review finding or a `correct-test` answer, is one
175
+ `driver_dispute.correct`: it runs the test-writer on the findings it is given, makes its commit the baseline,
176
+ keeps the reading of each file it corrected in `corrected` (none after an answer) and logs one line per finding.
177
+ The callers differ only by the findings and the readings they pass.
145
178
  - No test-writer correction runs after round 2 (`driver_fixloop._act_on`): a red gate or an unmet criterion blocks
146
179
  the ticket. Other open findings go to the final must-fix list when the gate is green. A correction at the cap
147
180
  would add locked tests that no fix round could make green.
148
- - A correction that does not close its findings (the next review finds one again, or the driver rejects its
149
- report) asks a `locked-test-again` question. `correct-again` and `accept` send the ticket back to `review`, and
150
- `driver_decisions.corrections` reads the answers from `state.json`: the count of `correct-again` stops bounds the
151
- extra corrections (`AGAIN`), and an `accept` stop closes the ticket's locked-test findings in `_act_on`.
152
- - A reviewer or a correctness pass that reports BLOCKED or NEEDS_CONTEXT raises `driver_run.Stopped`, which
153
- carries the report. `driver_fixloop._run_reviewers` turns it into a `review-stopped` question, or, after an
154
- `accept` ruling on that role (`driver_decisions.accepted`), uses the report as it is.
155
- - A reviewer or a correctness pass whose report the driver rejects two times asks a `review-rejected` question.
156
- The stop records each rejection in the ticket's `rejected` (role -> why); after `retry`, the role's first prompt
157
- carries it (`prompts/rejected.md`), and the next review that ends clears it.
158
- - An implementer or a fixer that reports BLOCKED or NEEDS_CONTEXT asks a question in `Run._ask_stop`: `locked-test`
159
- for a contradicted locked test, else `implementer-stopped` or `fixer-stopped`. The stop of a fixer sets the round
160
- back by one, so its `retry` (gate and review the tip, then a fixer) runs the same round again.
181
+ - A locked file is arbitrated once and corrected once per ticket. The ticket record keeps them in `disputes` and
182
+ `corrected`, keyed by the file (the part of a test id before `::`, resolved against the ticket's `locked` by
183
+ `driver_report._locked_file`), so a renamed or parametrized test cannot dodge the rule. Only `driver_dispute._settle`
184
+ and `driver_dispute.correct` write them; no answer does, so no answer resets them. A second dispute or a second
185
+ correction asks `spec-ambiguous` (`driver_dispute.ambiguous`); its evidence file is the findings file a
186
+ `correct-test` correction reads (`driver_dispute.correct_as_answered`), and its files are the ones `keep-test` closes for later
187
+ reviews (`driver_dispute.kept_files`, `driver_fixloop._still_to_correct`).
188
+ - `driver_run._attempts` treats a stop (BLOCKED or NEEDS_CONTEXT, not a dispute of a locked test) of any agent
189
+ as a rejected attempt: the rerun runs on the next entry of the role's list (`_rerun_entry`; the ticket fixer's list
190
+ is the implementer's), with the concerns or the driver's error in its prompt. A second stop or rejection asks a
191
+ `ticket-blocked` question (`_ask_blocked`); its `retry` sets the `resume` the question holds (`retry_point`), and the
192
+ stop of a fixer sets the round back by one, so the same round runs again after a review. The end of run asks the
193
+ same kind with the ticket `final` (`final-ticket-blocked-<n>`), whose `resume` is the phase `pending` of `run.final`;
194
+ the end of run goes on from its state once that phase is `pending` again. An agent that runs for another
195
+ role (an arbitration, a dispute's correction, a review correction) passes that role as `retry`: its `retry` runs that
196
+ role again from the commit the agent started on, so its own work is not kept.
197
+ - A dispute (an implementer or a fixer that reports BLOCKED with `locked test contradicts spec: <file>::<test>:
198
+ <reason>`) is the one stop that `driver_run._stop` accepts, and only from a `Call` with `may_dispute`, which only
199
+ `driver_dispute.agent` sets: it runs the implementer and each ticket fixer and reads the accepted report's
200
+ disputes (`driver_report.disputes`). The reviewer arbitrates with `prompts/arbitration.md` in `Run.read_only` (not a fix round), a test ruled
201
+ `test-wrong` gets one correction, and the role runs again from the tip in the same round, with the ticket's rulings
202
+ in `prompts/ruled.md`. `driver_report._dispute_errors` rejects a dispute that names no locked file of the ticket or
203
+ leaves uncommitted changes: the arbitration is read-only and the correction commits.
161
204
  - An implementer or a fixer with nothing to change reports DONE with no commit (`driver_report._unchanged_errors`):
162
205
  the branch did not move, the tree is clean, and a concern says why. The driver gates and reviews that tip as it
163
206
  would a new one.
164
- - The correctness prompt carries the checks of `review-diff` (`driver_review.checks`): the pass reads files only
165
- from git at the tip and from `.agent/`, and a project-local install sits in an ignored directory.
166
207
 
167
208
  ### Questions
168
209
 
169
- - A stop is a bounded question in `state.json`. Only `driver_decisions.stop` adds one. An answered question is
170
- never open again.
210
+ - A stop is a bounded question in `state.json`. Only `driver_decisions.stop` adds one, through `Run.block`, the one
211
+ path that blocks a ticket or the end of run: it makes the record (`driver_run.record_of`, a ticket's or `run.final`)
212
+ BLOCKED, gives it the tip and the round of the question's `Resume`, and adds the questions. An answer that goes on
213
+ sets the record's fields in one write: the whole `resume` for `retry` and `keep-test`, the option's own fields for
214
+ `correct-test`. The end of run is recorded BLOCKED only at a question; with none, the next run tries it again.
215
+ An answered question is never open again.
171
216
  - An open question of a merged ticket is dropped (`driver_decisions.drop_merged`), at the start of a run and after
172
217
  each landing, with a ledger line: a ticket the operator set to `merge` by hand leaves its stop behind.
173
218
  - An answers file counts only when it is bound to the revision of the current `decisions.json`.
174
- - Only a question whose kind parks gives exit 2. A third round of the final review is never started: its open
175
- findings become questions.
219
+ - An answered question keeps its ruling sentence in `ruling`, so the PR body never looks up the kind of an answered
220
+ question. `driver_legacy.resume` stops a run before schema 4 that has an open question of a removed kind (exit 3),
221
+ and gives each answered question of such a run its `ruling`.
222
+ - An open question gives exit 2. A third round of the final review starts only after a `retry` of
223
+ a `final-ticket-blocked` question of an open finding.