@jesdi/skills 0.0.55 → 0.0.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jesdi/skills",
3
- "version": "0.0.55",
3
+ "version": "0.0.57",
4
4
  "description": "jesdi's agent skills (content package consumed by @jesdi/skills-cli)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -78,7 +78,8 @@ and do not know about the run, except `driver_run.py`, which the three deciding
78
78
  - The locked files of merged tickets are checked before each review (`driver_review.merged_changes`): a change is a
79
79
  `fixture` finding, so it goes to a correction, where the restore and its gate decide. They are checked again when
80
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.
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).
82
83
  - A conflict resolution, of a merge or of the rebase, may not change a locked file.
83
84
 
84
85
  ### The PR branch
@@ -97,7 +97,7 @@ Everything is under `.agent/`, which is never committed.
97
97
 
98
98
  A ticket is ready when each ticket in its **Blocked by** line is merged and no running ticket touches the same place. The places are the backticked entries of the **Touches** lines: `file` or `file: function`. Two entries are the same place when they name the same file and the same function, or when one of them names the whole file. Each ready ticket takes the lowest free slot.
99
99
 
100
- 1. **test-writer** (`prompts/test-writer.md`). It writes one black-box test for each criterion through the Seam and commits them red. Those files are locked. Its prompt names the locked tests of merged tickets: each fixture must set up the precondition of its scenario under the spec rules and those tests. A ticket with Seam `none — refactor` has no test-writer.
100
+ 1. **test-writer** (`prompts/test-writer.md`). It writes one black-box test for each criterion through the Seam and commits them red. Those files are locked. Its prompt names the locked tests of merged tickets: each fixture must set up the precondition of its scenario under the spec rules and those tests. When the ticket must change one of those files, the test-writer changes it and lists it in `locked`. A ticket with Seam `none — refactor` has no test-writer.
101
101
  2. **implementer** (`prompts/implementer.md`). It starts from that commit and makes the locked tests green. It makes the gate (`--gate`) green on its final commit before it reports DONE or DONE_WITH_CONCERNS.
102
102
  3. **Gate.** The driver runs `--gate` on the ticket tip.
103
103
  4. **Review.** The driver compares each locked file of the ticket with the test-writer commit. A file that differs is a critical finding `locked file changed: <path>`. A locked file of a merged ticket that the ticket changed since its merge base with the PR branch is a critical `fixture` finding `the ticket changed the locked file of a merged ticket: <path>`, so it goes to a correction (see **Before a correction**). Then the **reviewer** (`prompts/reviewer.md`) runs, and for a ticket with a **Risk** line the **correctness** pass (`prompts/correctness.md`) runs at the same time in the same slot. A read-only role (reviewer, correctness, final-reviewer, pr-writer) leaves its slot and the git config as it found them: all worktrees share one config, and one key written there, such as a `core.worktree` on a temp directory, breaks git in each of them. To run a check off the slot, a reviewer reads the driver's gate record or makes its own `git worktree add --detach` copy and removes it. After read-only roles, the driver checks the slot and the shared config (`git rev-parse --git-common-dir`, then `config`) against what they were before. When one of them changed, the driver restores it, writes `a read-only role broke its rule: ...` to the ledger, and runs the review one more time; a second change blocks the ticket.
@@ -118,11 +118,11 @@ Rules for each agent:
118
118
 
119
119
  | Finding | What the driver does |
120
120
  |---|---|
121
- | kind `fixture`, any severity, or kind `test`, `critical` or `important`, on a locked file of the ticket | One test-writer correction, outside the fix rounds. The fixer may not edit a locked file, so a fix round cannot close a `test` finding there. The corrected files are the new locked versions, and the next review is a full review. A finding that the correction reports in `not_addressed` (it needs a production change first) becomes a finding of kind `code`, with the reason as its evidence, and goes to a fix round at once; the ledger says it was not corrected. A finding of this kind that is open in the review after the correction, or a correction that the driver rejects, blocks the ticket with a `locked-test-again` question. No correction runs after round 4. |
121
+ | kind `fixture`, any severity; kind `test`, `critical` or `important`, on a locked file of the ticket; or any kind, `critical` or `important`, on a locked file of a merged ticket | One test-writer correction, outside the fix rounds. The fixer may not edit a locked file, so a fix round cannot close a `test` finding there. Only a correction may change a locked file of a merged ticket, and it lists the file in `locked`: a ticket whose Touches line names such a file gets its change this way, where a fixer's change would be put back (issue #116). The corrected files are the new locked versions, and the next review is a full review. A finding that the correction reports in `not_addressed` (it needs a production change first) becomes a finding of kind `code`, with the reason as its evidence, and goes to a fix round at once; the ledger says it was not corrected. A finding of this kind that is open in the review after the correction, or a correction that the driver rejects, blocks the ticket with a `locked-test-again` question. No correction runs after round 4. |
122
122
  | `critical` or `important` | One fix round. |
123
123
  | `minor` | It stays in the ledger and in the findings file. The final reviewer gets the list. |
124
124
 
125
- A fix round has three steps: the **fixer** (`prompts/fixer.md`) makes the gate green on its final commit, as the implementer does; the driver runs the gate on the new tip; a re-review reads the range of the fix. A mutation proof is repeated only when the fix changed its production line.
125
+ A fix round has three steps: the **fixer** (`prompts/fixer.md`) makes the gate green on its final commit, as the implementer does; the driver runs the gate on the new tip; a re-review reads the range of the fix. A mutation proof is repeated only when the fix changed its production line. A fixer whose findings need no change, for example because a test-writer correction before it already resolved them, makes no commit and gives in `concerns` a reason for each finding; the round still counts, and the re-review of the same tip checks each reason.
126
126
 
127
127
  A red gate on the commit of the implementer or of a fixer is a critical finding with source `gate`. Its file is the gate record, and the record holds the output. No review runs on that tip, and the next round starts: a red gate on the commit of the implementer starts round 1. The review after that round covers each fix since the last review and repeats each proof that one of them made due. Two red gates block the ticket: one after round 4, and one on the commit of a test-writer correction, because the correction is outside the fix rounds and a fixer may not edit the locked files.
128
128
 
@@ -181,7 +181,7 @@ Every report has `status` (`DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCK
181
181
  | implementer | `prompts/implementer.md` | `green` | With DONE: one commit or more. |
182
182
  | reviewer | `prompts/reviewer.md` | `findings` (`severity`, `file`, `line`, `title`, `evidence`, `kind`), `mutations` (`test`, `file`, `line`, `red`); `commits` is empty | In a full review (one with no fix range: round 1, and the review after a test-writer correction): `mutations` is required, with a proof for each locked test file (`test` is `<locked file>::<test name>`). Each `red` is in the log. |
183
183
  | correctness | `prompts/correctness.md` | the same as the reviewer; `commits` is empty | `mutations` is optional. |
184
- | fixer | `prompts/fixer.md` | `green`, `ticket` | With DONE: one commit or more. |
184
+ | fixer | `prompts/fixer.md` | `green`, `ticket` | With DONE and no commit: no new commit on the branch, no uncommitted change, a gate that is green on the start, and a concern that names each finding of the round. |
185
185
  | final-reviewer | `prompts/final-reviewer.md` | `findings` | None. |
186
186
  | pr-writer | `prompts/pr-writer.md` | `body`; `commits` is empty | None. |
187
187
  | fixer of the final review | `prompts/final-fixer.md` | `green`; `commits` is a list of (`sha`, `ticket`) | Each new commit on the branch is in `commits`, with a ticket of the run. |
@@ -67,6 +67,7 @@ def _run_reviewers(job: Job, cast: list[tuple[str, str]], locked: list[str]) ->
67
67
  earlier stop of that role lets the review go on with its report."""
68
68
  number = job.ticket.number
69
69
  values, running = job.pointers(job.round - 1), [role for role, _ in cast]
70
+ values["fixer_report"] = os.path.relpath(OUT / number / f"fixer-{job.round}.json", job.slot)
70
71
  errors, stops = {}, {}
71
72
  accepted = driver_decisions.accepted(job.run.state.read()["run"]["questions"], number, "review-stopped")
72
73
 
@@ -74,6 +75,7 @@ def _run_reviewers(job: Job, cast: list[tuple[str, str]], locked: list[str]) ->
74
75
  # A full review (no fix range) must give a mutation proof for each locked test file; the prompt names them.
75
76
  full = not job.previous and role == "reviewer"
76
77
  notes = ["rereview"] if job.previous else ["full-review"] if full else []
78
+ notes += ["unchanged"] * (job.previous == job.tip) # a fixer with no commit: its reasons need a check
77
79
  try:
78
80
  return job.run.agent(role, job.ticket.number, job.slot, values, entry=entry, fix_round=job.round,
79
81
  notes=notes, check={"full": True, "locked": locked} if full else {},
@@ -177,8 +179,9 @@ def _uncorrected(job: Job, findings: list[dict], not_addressed: list[dict]) -> l
177
179
  return list(code.values())
178
180
 
179
181
 
180
- def _fix(job: Job) -> None:
181
- """Run the next fix round: a fixer on the implementer's list."""
182
+ def _fix(job: Job, findings: list[dict]) -> None:
183
+ """Run the next fix round: a fixer on the implementer's list, for `findings`. A fixer that makes no commit gives
184
+ a reason per finding, and the review of the same tip checks them (issue #123)."""
182
185
  run, number = job.run, job.ticket.number
183
186
  job.round += 1
184
187
  on = entry(run.models, job.round)
@@ -188,7 +191,8 @@ def _fix(job: Job) -> None:
188
191
  elif job.round == 3:
189
192
  ledger(f"Ticket {number} round 3: the implementer has no next entry, so the round stays on {on}.")
190
193
  with during(f"fix round {job.round}"):
191
- run.agent("fixer", number, job.slot, job.pointers(job.round - 1), entry=on, fix_round=job.round)
194
+ run.agent("fixer", number, job.slot, job.pointers(job.round - 1), entry=on, fix_round=job.round,
195
+ check={"fix": [finding["title"] for finding in findings], "red": job.red})
192
196
  before, job.tip = job.tip, driver_slots.head(job.slot)
193
197
  run.state.ticket(number, tip=job.tip)
194
198
  followed = driver_review.follow(job.slot, before, job.tip, job.proofs)
@@ -218,7 +222,8 @@ def _unaccepted(job: Job, state: dict, to_correct: list[dict]) -> list[dict]:
218
222
  def _act_on(job: Job, found: list[dict]) -> bool:
219
223
  """Do what the findings of a review ask for: a correction, a fix round, or a stop. True: none is open."""
220
224
  state = job.run.state.read()
221
- to_correct, to_fix = driver_review.route(found, state["tickets"][job.ticket.number]["locked"])
225
+ to_correct, to_fix = driver_review.route(found, state["tickets"][job.ticket.number]["locked"],
226
+ driver_merge.protected(state["tickets"], job.ticket.number))
222
227
  to_correct = _unaccepted(job, state, to_correct)
223
228
  if job.round == ROUNDS:
224
229
  # No correction after round 4: no fix round could make its new locked tests green, so `accept` could not merge.
@@ -236,7 +241,7 @@ def _act_on(job: Job, found: list[dict]) -> bool:
236
241
  evidence = OUT / job.ticket.number / f"findings-{ROUNDS}.json"
237
242
  job.run.ask(job.ticket.number, "finding", titles, str(evidence))
238
243
  raise Blocked(f"the review: after round {ROUNDS} these findings are open: {'; '.join(titles)}")
239
- _fix(job)
244
+ _fix(job, to_fix)
240
245
  return False
241
246
 
242
247
 
@@ -3,7 +3,8 @@
3
3
  context: repo (slot path), branch, start (HEAD when the role started), log, full (a full review: no fix range), locked,
4
4
  correction (a test-writer corrects locked tests), restored (locked files the driver put back before it),
5
5
  restore_red (the gate is red on the commit of that restore), findings (the titles a correction gets),
6
- owners (ticket numbers, for the final fix batch), merged (locked files of merged tickets, not its own), pr (tip)."""
6
+ owners (ticket numbers, for the final fix batch), merged (locked files of merged tickets, not its own), pr (tip),
7
+ fix (the titles of the findings a fixer gets), red (the gate is red on `start`)."""
7
8
  from __future__ import annotations
8
9
 
9
10
  import json
@@ -68,6 +69,28 @@ def _commit_errors(report: dict, context: dict) -> list[str]:
68
69
  return errors
69
70
 
70
71
 
72
+ def _unchanged_errors(report: dict, context: dict) -> list[str]:
73
+ """A DONE fixer with no commit (issue #123): the branch did not move, no change is left uncommitted, the gate of
74
+ the start is green, and a concern names each finding, with why it needs no change."""
75
+ if "fix" not in context or report["commits"] or report["status"] not in ("DONE", "DONE_WITH_CONCERNS"):
76
+ return []
77
+ return _moved_errors(context) + [
78
+ f"no commit, and no concern names the finding {title}: give each finding a concern that says why it needs no "
79
+ "change" for title in context["fix"] if not any(title in concern for concern in report["concerns"])]
80
+
81
+
82
+ def _moved_errors(context: dict) -> list[str]:
83
+ """What a report with no commit leaves out: a commit on the branch, a change in the tree, a red gate."""
84
+ repo, branch = context["repo"], context["branch"]
85
+ errors = [f"commit {sha[:7]} is on {branch} and not in `commits`: list each commit you made"
86
+ for sha in _git(repo, "rev-list", f"{context['start']}..{branch}")]
87
+ if _git(repo, "status", "--porcelain", "--untracked-files=no"):
88
+ errors.append("no commit, and the tree has uncommitted changes: commit the fix and list the commit")
89
+ if context.get("red"):
90
+ errors.append(f"no commit, and the gate is red on {context['start'][:7]}: a fix of a red gate is a commit")
91
+ return errors
92
+
93
+
71
94
  def _correction_errors(report: dict, context: dict) -> list[str]:
72
95
  """A correction changes only the files it lists in `locked` and the files the driver `restored`."""
73
96
  if not context.get("correction"):
@@ -134,5 +157,6 @@ def validate(role: str, path: str, context: dict) -> list[str]:
134
157
  report = {name: value for name, value in report.items() if name in rules["properties"]}
135
158
  if "locked" in report:
136
159
  report["locked"] = locked_files(report["locked"])
137
- return (_commit_errors(report, context) + _owner_errors(report, context) + _correction_errors(report, context)
138
- + _merged_errors(report, context) + _proof_errors(report, context) + _locked_errors(report, context))
160
+ return (_commit_errors(report, context) + _owner_errors(report, context) + _unchanged_errors(report, context)
161
+ + _correction_errors(report, context) + _merged_errors(report, context) + _proof_errors(report, context)
162
+ + _locked_errors(report, context))
@@ -93,12 +93,13 @@ def written(slot: str, entry: dict, listed: list[str], tip: str) -> dict:
93
93
  return {"test_writer_sha": tip, "locked": list(dict.fromkeys(entry["locked"] + listed)), "held": held}
94
94
 
95
95
 
96
- def route(findings: list[dict], locked: list[str]) -> tuple[list[dict], list[dict]]:
96
+ def route(findings: list[dict], locked: list[str], protected: list[str]) -> tuple[list[dict], list[dict]]:
97
97
  """(the findings for a test-writer correction; the other findings that are severe enough for a fix round).
98
- A correction gets each fixture finding, whatever its severity, and each severe test finding on a `locked` file:
99
- the fixer may not edit a locked file, so a fix round cannot close it."""
100
- correct = [finding for finding in findings if finding["kind"] == "fixture"
101
- or (finding["kind"] == "test" and finding["file"] in locked and finding["severity"] in OPEN)]
98
+ A correction gets each fixture finding, whatever its severity, each severe test finding on a `locked` file, and
99
+ each severe finding on a `protected` file (a locked file of a merged ticket): the fixer may not edit those files,
100
+ so a fix round cannot close it. Only a correction can take a protected file into the ticket's `locked` (#116)."""
101
+ correct = [finding for finding in findings if finding["kind"] == "fixture" or finding["severity"] in OPEN and (
102
+ finding["file"] in protected or finding["kind"] == "test" and finding["file"] in locked)]
102
103
  return correct, [finding for finding in findings if finding not in correct and finding["severity"] in OPEN]
103
104
 
104
105
 
@@ -1,7 +1,8 @@
1
1
 
2
- This call is a correction of the locked tests, not a new test set. Read in {findings} each finding of kind `fixture` and each critical or important finding of kind `test` on a locked file.
2
+ This call is a correction of the locked tests, not a new test set. Read in {findings} each finding of kind `fixture`, each critical or important finding of kind `test` on a locked file, and each critical or important finding on a locked file of a merged ticket ({protected}).
3
3
  A `fixture` finding: a locked test encodes a stale path, format, fixture layout or setup detail. Correct only that detail and keep what each test asserts.
4
4
  A `test` finding: a locked test is too weak, for example it stays green when the production line it protects is broken. Make the test assert the behavior of its criterion so that it fails on that break. Do not remove an assertion.
5
+ A finding on a locked file of a merged ticket, of any kind: only this correction may change that file. When the ticket must change it, as one that its Touches line names, make the change, keep what each test of the merged ticket asserts, and list the file in `locked`.
5
6
  For this you may read the implementation.
6
7
  When a finding needs a production change first, so that no correct test can be green, leave the test as it is and add the finding to `not_addressed`: `finding` is its `title` as the findings file gives it, `reason` is the production change it needs. The driver sends it to the fixer as a finding of kind `code`. A correction whose findings are all in `not_addressed` may report DONE with no commit.
7
8
  The implementation exists, so a corrected test is green: for `red`, break the production line that the test protects, run the test, print its failing output, then revert the edit. In `locked`, list each test file you corrected: test file paths only, not test node ids. Unlike `mutations[].test` of the reviewer, `locked` takes no `::<test name>`.
@@ -14,6 +14,7 @@ Use targeted tests while you work.
14
14
  Before you report DONE or DONE_WITH_CONCERNS, make the gate green on your final commit: run `{gate}` with IMPLEMENT_SPEC_BASE={pr_branch} in the environment, then fix, commit, and run it again until it passes. The driver runs the gate again on that commit, and a re-review reads the lines you changed.
15
15
  A finding from the `gate` is a red gate: its file is the gate record. Read the output there and make the gate green.
16
16
  Commit your work on the checked-out ticket branch. Do not dispatch subagents.
17
+ When a finding needs no change, for example because a correction before you already resolved it, change nothing for it. When no finding needs a change, make no commit: report DONE_WITH_CONCERNS, list no commit in `commits`, and give one concern per finding to fix that starts with its title and says why it needs no change. A re-review checks each reason. This is not for a red gate: a fix of a red gate is a commit.
17
18
  In `ticket`, give the number of the ticket that owns your commits. In `green`, give the summary lines of the passing test output.
18
19
 
19
20
  Write one JSON report at {report} that matches this schema:
@@ -24,14 +25,12 @@ Write one JSON report at {report} that matches this schema:
24
25
  "required": ["status", "commits", "files", "concerns", "green", "ticket"],
25
26
  "properties": {
26
27
  "status": {"enum": ["DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED"]},
27
- "commits": {"type": "array", "items": {"type": "string", "pattern": "^[0-9a-f]{7,40}$"}},
28
+ "commits": {"description": "Only the commits you made, so empty when you changed nothing: never list a commit that was on the branch at your start.", "type": "array", "items": {"type": "string", "pattern": "^[0-9a-f]{7,40}$"}},
28
29
  "files": {"type": "array", "items": {"type": "string"}},
29
30
  "concerns": {"type": "array", "items": {"type": "string"}},
30
31
  "green": {"type": "array", "items": {"type": "string"}},
31
32
  "ticket": {"type": "string", "pattern": "^[0-9]+$"}
32
- },
33
- "if": {"properties": {"status": {"enum": ["DONE", "DONE_WITH_CONCERNS"]}}},
34
- "then": {"properties": {"commits": {"minItems": 1}}}
33
+ }
35
34
  }
36
35
  ```
37
36
 
@@ -8,7 +8,7 @@ Locked files: {locked}
8
8
 
9
9
  Make the locked tests green and meet each criterion of the ticket. For internal code, work in vertical test-first slices: one failing test, the smallest code that passes it, then the next slice.
10
10
  Never edit a locked file. If a locked test contradicts the spec or the ticket, stop and report BLOCKED with a concern that starts with `locked test contradicts spec:`, then the test and the evidence.
11
- Commit your work on the checked-out ticket branch. Do not dispatch subagents.
11
+ Commit your work on the checked-out ticket branch. Do not dispatch subagents. In `commits`, list only the commits you made: the start commit and each commit before it are not yours.
12
12
  Use targeted tests while you work.
13
13
  Before you report DONE or DONE_WITH_CONCERNS, make the gate green on your final commit: run `{gate}` with IMPLEMENT_SPEC_BASE={pr_branch} in the environment, then fix, commit, and run it again until it passes. The driver runs the gate again on that commit.
14
14
  In `green`, give the summary lines of the passing test output.
@@ -11,7 +11,8 @@ Each fixture sets up exactly the precondition of its scenario. Check it against
11
11
  Run each test and confirm that it fails because the behavior is missing, not because of an import error or a syntax error. Print that failing output.
12
12
  A test that is green before any implementation is not a proof. Rewrite it until it fails, or name in `concerns` the production-code mutation that turns it red.
13
13
  Commit the tests red on the checked-out branch. Do not write implementation code and do not dispatch subagents.
14
- In `locked`, list each test file of your commit: test file paths only, not test node ids (`tests/x.py`, not `tests/x.py::test_a`). In `red`, give for each test one failure line, copied exactly from the output you printed.
14
+ When the ticket must change a locked file of a merged ticket, as one that its Touches line names, change it in your commit: a later agent may not.
15
+ In `locked`, list each test file of your commit and each locked file of a merged ticket that it changes: file paths only, not test node ids (`tests/x.py`, not `tests/x.py::test_a`). In `red`, give for each test one failure line, copied exactly from the output you printed.
15
16
 
16
17
  Write one JSON report at {report} that matches this schema:
17
18
 
@@ -0,0 +1 @@
1
+ The fixer of round {round} changed nothing: its report {fixer_report} gives in `concerns` why each finding needs no change. Check each reason at {start_sha}, and report again each finding that still holds.
@@ -233,7 +233,7 @@ def test_a_test_finding_on_a_locked_file_gets_the_test_writer_correction_not_a_f
233
233
  assert rig.led("correction in tests/test_01.py, outside the fix rounds: VACUOUS: VACUOUS.")
234
234
  # Only a severe finding of kind `test` on a locked file goes to the test-writer.
235
235
  minor, elsewhere = finding("M", "minor", kind="test", file="tests/test_01.py"), finding("E", kind="test")
236
- assert driver_review.route([vacuous, minor, elsewhere], ["tests/test_01.py"]) == ([vacuous], [elsewhere])
236
+ assert driver_review.route([vacuous, minor, elsewhere], ["tests/test_01.py"], []) == ([vacuous], [elsewhere])
237
237
 
238
238
 
239
239
  NEEDS_CODE = "needs production code: the code has no multi-PR view"
@@ -455,6 +455,27 @@ def test_a_fixture_correction_starts_from_the_locked_file_of_the_merged_ticket(t
455
455
  assert rig.led("Ticket 02:", "restored") == [RESTORED_01] and rig.code == 0
456
456
 
457
457
 
458
+ def test_a_finding_in_the_locked_file_of_a_merged_ticket_goes_to_the_correction_not_the_fixer(tmp_path):
459
+ """Issue #116: ticket 02 must change the locked file of merged ticket 01. The implementer changes it, and the
460
+ restore closes the driver's finding. The next review reports the missing change there: a fixer may only make it
461
+ the forbidden way, so the correction makes it and lists the file."""
462
+ missing = finding("MISSING", file="tests/test_01.py", line=2)
463
+ correction = appending(tmp_path, files={})
464
+ correction["report"]["locked"] = ["tests/test_01.py"]
465
+ rig = Inside(tmp_path, three()).run(plan(**{
466
+ "02/implementer": [CHEAT], "02/test-writer": [tw("02"), correction],
467
+ "02/reviewer": [review("02"), review("02", [missing]), proves("02", "tests/test_01.py")]}))
468
+ assert rig.code == 0, rig.ledger()
469
+ assert rig.led("Ticket 02:", "the restore closes it") and not rig.calls("02", "fixer")
470
+ assert rig.led("Ticket 02: code correction in tests/test_01.py, outside the fix rounds: MISSING")
471
+ assert on_pr(rig, "tests/test_01.py") == CORRECTED_01
472
+ assert "tests/test_01.py" in rig.state()["tickets"]["02"]["locked"]
473
+ first, corrected = rig.prompt("test-writer-0", "02"), rig.prompt("test-writer-1", "02")
474
+ assert "When the ticket must change a locked file of a merged ticket" in first
475
+ assert "on a locked file of a merged ticket (tests/test_01.py" in corrected
476
+ assert "only this correction may change that file" in corrected
477
+
478
+
458
479
  def test_the_test_writer_checks_fixture_preconditions_and_a_correction_keeps_shared_fixtures_and_runs_the_locked_files(tmp_path):
459
480
  """Issue #97: a fixture misses the precondition of its scenario or a rule that a merged ticket locks, and a
460
481
  correction adds a requirement that the shared fakes of other locked tests do not satisfy."""
@@ -561,6 +582,24 @@ def test_four_rounds_then_blocked_with_the_escalation_at_round_3(tmp_path):
561
582
  assert rig.state()["tickets"]["03"]["phase"] == "merged"
562
583
 
563
584
 
585
+ def test_a_fixer_with_nothing_to_change_is_accepted_and_the_same_tip_is_reviewed_again(tmp_path):
586
+ """Issue 123: a fixer whose finding needs no change reports no commit. That is no rerun: the round counts, the
587
+ gate of the tip stands, and the re-review weighs the fixer's reason."""
588
+ rig = Inside(tmp_path)
589
+ nothing = {"report": {"status": "DONE_WITH_CONCERNS", "commits": [], "files": [], "green": ["1 passed"],
590
+ "ticket": "01", "concerns": ["STUCK: the code already handles it"]}}
591
+ rig.run(plan(**{"01/reviewer": [review("01", [STUCK]), review("01")], "01/fixer": [nothing]}))
592
+ assert rig.code == 0, rig.ledger()
593
+ assert len(rig.calls("01", "fixer")) == 1 and rig.led("fixer ran on", "report accepted")
594
+ assert rig.state()["tickets"]["01"]["round"] == 1 and rig.state()["tickets"]["01"]["phase"] == "merged"
595
+ tip = rig.sha("01", "implementer")
596
+ assert [gate["commit"] for gate in rig.gates()].count(tip) == 1
597
+ again = rig.prompt("reviewer-1")
598
+ assert f"The fix is {tip}..{tip}" in again and "The fixer of round 1 changed nothing" in again
599
+ assert ".agent/implement/01/fixer-1.json" in again and "no concern names" not in rig.prompt("fixer-1")
600
+ assert "list no commit" in rig.prompt("fixer-1")
601
+
602
+
564
603
  def test_a_red_gate_on_a_fixer_commit_starts_the_next_round_with_the_record_as_evidence(tmp_path):
565
604
  """Issue 64: the gate of a fix round is red. That is a finding for the next round, not a BLOCKED ticket."""
566
605
  rig = Inside(tmp_path, gate={"subjects": ["fix: 01 round 1"]})
@@ -134,6 +134,26 @@ def test_implementer_without_a_new_commit_is_a_violation(world):
134
134
  assert check("implementer", implementer(shas), start=shas["impl"]) # its only commit is not new
135
135
 
136
136
 
137
+ def test_a_fixer_with_nothing_to_change_reports_no_commit_and_a_reason_per_finding(world):
138
+ """Issue 123: a fixer whose findings need no change has a report the driver accepts: no commit, a concern each."""
139
+ shas, check, tmp = world
140
+ fixer = lambda **changes: implementer(shas, **{"commits": [], "ticket": "01", **changes})
141
+ fix = {"start": shas["impl"], "fix": ["STUCK", "LOOSE"]}
142
+ reasons = ["STUCK: the correction at abc1234 resolved it", "LOOSE: the code already handles it"]
143
+ assert check("fixer", fixer(status="DONE_WITH_CONCERNS", concerns=reasons), **fix) == []
144
+ assert check("fixer", fixer(concerns=reasons[:1]), **fix) == [
145
+ "no commit, and no concern names the finding LOOSE: give each finding a concern that says why it needs no change"]
146
+ assert check("fixer", fixer(concerns=reasons), **fix, red=True) == [
147
+ f"no commit, and the gate is red on {shas['impl'][:7]}: a fix of a red gate is a commit"]
148
+ # A commit that predates the fixer is still refused, and a commit it made is in `commits`.
149
+ assert check("fixer", fixer(commits=[shas["impl"]], concerns=reasons), **fix)
150
+ assert check("fixer", fixer(concerns=reasons), **{**fix, "start": shas["tests"]}) == [
151
+ f"commit {shas['impl'][:7]} is on ticket/01 and not in `commits`: list each commit you made"]
152
+ (tmp / "slot" / "demo/export.py").write_text("changed\n")
153
+ assert check("fixer", fixer(concerns=reasons), **fix) == [
154
+ "no commit, and the tree has uncommitted changes: commit the fix and list the commit"]
155
+
156
+
137
157
  def test_locked_path_absent_from_the_commit_is_a_violation(world):
138
158
  shas, check, _ = world
139
159
  assert check("test-writer", writer(shas), start=shas["base"]) == []
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "generatedAt": "2026-10-20T09:33:22.965Z",
3
+ "generatedAt": "2026-10-20T15:11:42.597Z",
4
4
  "skills": [
5
5
  {
6
6
  "name": "backlog",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  {
48
48
  "name": "implement-spec",
49
- "version": "0.1.30",
50
- "hash": "sha256-90d82ac9c1a617819e45d91c0a5cd79ed53f982ea60bd35ef7e668d6bfc46e1b",
49
+ "version": "0.1.32",
50
+ "hash": "sha256-65312a2ea436f3f7c99c5b53fced3118d07c4c90602f46cfb8037ed2e5c4eb9b",
51
51
  "description": "Implement a specification in code."
52
52
  },
53
53
  {