@jesdi/skills 0.0.64 → 0.0.65
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 +1 -1
- package/skills/babysit-pr/judge-prompt.md +0 -1
- package/skills/implement-spec/README.md +2 -2
- package/skills/implement-spec/driver.py +27 -4
- package/skills/implement-spec/prompts/overruled.md +3 -1
- package/skills/implement-spec/tests/test_decisions.py +36 -2
- package/skills-manifest.json +5 -5
package/package.json
CHANGED
|
@@ -177,7 +177,7 @@ Every report has `status` (`DONE`, `DONE_WITH_CONCERNS`, `NEEDS_CONTEXT`, `BLOCK
|
|
|
177
177
|
|
|
178
178
|
| Role | Template | More fields | Checks after the schema |
|
|
179
179
|
|---|---|---|---|
|
|
180
|
-
| test-writer | `prompts/test-writer.md` | `locked` (test file paths), `red` (`test`, `line`), optional `fixtures` (each locked file that holds no test, as a fake `gh`) | The driver reads a test node id `<file>::<test>` in `locked` as its file. Each fixture is in `locked`; the ticket record keeps it a fixture until a later correction lists the file again. With DONE: one commit, one locked file and one red line or more. Each locked path is in a commit that the role made
|
|
180
|
+
| test-writer | `prompts/test-writer.md` | `locked` (test file paths), `red` (`test`, `line`), optional `fixtures` (each locked file that holds no test, as a fake `gh`) | The driver reads a test node id `<file>::<test>` in `locked` as its file. Each fixture is in `locked`; the ticket record keeps it a fixture until a later correction lists the file again. With DONE: one commit, one locked file and one red line or more. A correction's test can be green on the implementer's code, so its red line comes from a production edit that the correction makes and reverts. Each locked path is in a commit that the role made and is a file at the tip: a correction that deletes a locked file leaves it out of `locked`. Each `line` is in the log. A locked file of a merged ticket that the role changed is in `locked`. A correction (after `overrule-test`, or for a review finding) changes only the files that it lists in `locked` and the files that the driver restored before it. When the gate is red on the restore commit, a DONE correction lists a restored file in `locked`. Each `not_addressed[].finding` is the title of a finding of the correction, or after `overrule-test` an overruled concern as its prompt lists it (the driver logs its reason, and the implementer runs again); a DONE correction with each of its findings there needs no commit. |
|
|
181
181
|
| implementer | `prompts/implementer.md` | `green` | With DONE and no commit: no new commit on the branch, no uncommitted change, and a concern that says why the start needs no change. The driver then gates and reviews the start commit. |
|
|
182
182
|
| reviewer | `prompts/reviewer.md` | `findings` (`severity`, `file`, `line`, `title`, `evidence`, `kind`), `mutations` (`test`, `file`, `line`, `red`) | 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>`). A locked fixture needs no proof: it holds no test that a proof could name, and the locked-file check protects it. Neither does a locked file that is not at the reviewed tip. Each `red` is in the log. |
|
|
183
183
|
| correctness | `prompts/correctness.md` | the same as the reviewer | `mutations` is optional. |
|
|
@@ -195,7 +195,7 @@ A question is a bounded choice for the operator. `driver_decisions.py` `KINDS` h
|
|
|
195
195
|
|
|
196
196
|
| Kind | Question id | Asked when | Run exit | Options |
|
|
197
197
|
|---|---|---|---|---|
|
|
198
|
-
| `locked-test` | `<NN>-locked-test-<n>` | An implementer or a fixer reports BLOCKED with a concern that starts with `locked test contradicts spec:`. | 2 | `overrule-test`: the test-writer corrects the test from that report, then the implementer runs again, and the fix rounds count from 0: the corrected tests are a new contract. `overrule-implementer` (recommended): the implementer runs again. |
|
|
198
|
+
| `locked-test` | `<NN>-locked-test-<n>` | An implementer or a fixer reports BLOCKED with a concern that starts with `locked test contradicts spec:`. Asked again on the same test, from the same report, when the driver refuses the report of the correction after `overrule-test` and its rerun, or the correction reports BLOCKED. | 2 | `overrule-test`: the test-writer corrects the test from that report, then the implementer runs again, and the fix rounds count from 0: the corrected tests are a new contract. `overrule-implementer` (recommended): the implementer runs again. |
|
|
199
199
|
| `finding` | `<NN>-finding-<n>` | A finding is open after fix round 4. One question for each finding. | 1 | `accept`: close the finding; the ticket merges when each of its findings is accepted. `split` (recommended) and `redesign`: the ticket stays BLOCKED, with the ruling in the ledger. |
|
|
200
200
|
| `locked-test-again` | `<NN>-locked-test-again-<n>` | A finding for a test-writer correction is open in the review right after a correction, or the driver rejects the correction's report (for example, it changes a file that it does not list in `locked`). One question for each finding. | 2 | `correct-again` (recommended): the ticket resumes from the review, and that review's findings get one more correction. `accept`: no more correction runs for the ticket, its locked tests stay as they are, and the ticket goes on to its fix rounds with its other findings; a changed locked file is still restored. `redesign`: the ticket stays BLOCKED, with the ruling in the ledger. After two `correct-again` stops on a ticket, its next question offers only `accept` (recommended) and `redesign`, so a test-writer and a reviewer that never agree cannot loop. |
|
|
201
201
|
| `review-stopped` | `<NN>-review-stopped-<n>` | The reviewer or the correctness pass reports `BLOCKED` or `NEEDS_CONTEXT`. One question for each agent that stopped. | 2 | `retry` (recommended): the ticket resumes from the review, and each agent of the review runs again. `accept`: the same, and for the rest of the ticket a `BLOCKED` or `NEEDS_CONTEXT` report of that agent does not stop it: the review goes on with that report's findings and those of the other reports. `redesign`: the ticket stays BLOCKED, with the ruling in the ledger. |
|
|
@@ -75,11 +75,22 @@ def _check_out_ticket(ticket: Ticket, slot_number: int, entry: dict, run: Run) -
|
|
|
75
75
|
return driver_slots.head(slot)
|
|
76
76
|
|
|
77
77
|
|
|
78
|
+
def _locked_test_stop(number: str, run: Run) -> dict:
|
|
79
|
+
"""The last `locked-test` question of the ticket; {} when it has none."""
|
|
80
|
+
asked = [q for q in run.state.read()["run"]["questions"] if (q["ticket"], q["kind"]) == (number, "locked-test")]
|
|
81
|
+
return asked[-1] if asked else {}
|
|
82
|
+
|
|
83
|
+
|
|
78
84
|
def _blocked_report(number: str, run: Run) -> str:
|
|
79
85
|
"""The report of the last `locked-test` stop of the ticket: an implementer's or a fixer's."""
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
return _locked_test_stop(number, run).get("evidence", [str(OUT / number / "implementer-0.json")])[0]
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _overruled(number: str, run: Run) -> list[str]:
|
|
90
|
+
"""The concerns of that report that the operator overruled: what an overrule correction names in
|
|
91
|
+
`not_addressed` (issue #134)."""
|
|
92
|
+
concerns = json.loads(Path(_blocked_report(number, run)).read_text())["concerns"]
|
|
93
|
+
return [concern for concern in concerns if concern.startswith(driver_decisions.CONTRADICTS)]
|
|
83
94
|
|
|
84
95
|
|
|
85
96
|
def _prompt_values(ticket: Ticket, slot: str, run: Run) -> dict[str, str]:
|
|
@@ -114,11 +125,23 @@ def _run_roles(ticket: Ticket, slot_number: int, run: Run) -> None:
|
|
|
114
125
|
values.update(start_sha=start, gate_record=os.path.relpath(driver_gate.record_path(OUT / number, start), slot))
|
|
115
126
|
# A test-writer on a ticket that has locked tests is the correction after a ruling.
|
|
116
127
|
check = {"correction": role == "test-writer" and bool(entry["test_writer_sha"])}
|
|
128
|
+
if check["correction"]:
|
|
129
|
+
check["findings"] = _overruled(number, run)
|
|
130
|
+
values["overruled"] = "".join(f"- {concern}\n" for concern in check["findings"])
|
|
117
131
|
if check["correction"] and (restored := run.restore_locked_files(number, slot)):
|
|
118
132
|
values.update(start_sha=driver_slots.head(slot), restored=" ".join(restored))
|
|
119
133
|
notes, check["restored"] = [*notes, "restored"], restored
|
|
120
134
|
with during(f"the {role}"):
|
|
121
|
-
|
|
135
|
+
try:
|
|
136
|
+
report = run.agent(role, number, slot, values, notes=notes, check=check)
|
|
137
|
+
except Blocked:
|
|
138
|
+
if check["correction"]:
|
|
139
|
+
# The ruling did not take: the operator rules on the same locked test again (issue #134).
|
|
140
|
+
run.ask(number, "locked-test", [_locked_test_stop(number, run)["subject"]],
|
|
141
|
+
_blocked_report(number, run))
|
|
142
|
+
raise
|
|
143
|
+
for item in report.get("not_addressed", []):
|
|
144
|
+
ledger(f"Ticket {number}: the test-writer correction did not correct {item['finding']}: {item['reason']}.")
|
|
122
145
|
facts = {"tip": driver_slots.head(slot)}
|
|
123
146
|
if role == "test-writer":
|
|
124
147
|
facts.update(driver_review.written(slot, entry, report["locked"], report.get("fixtures", []),
|
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
This call is a correction after a ruling, not a new test set. The implementer or the fixer reported that a locked test contradicts the spec or the ticket, and the operator ruled that the test is wrong: read `concerns` in {blocked_report}.
|
|
3
3
|
Correct only the tests that those concerns name, so that they state what the spec and the ticket require. Keep each other test as it is.
|
|
4
4
|
The branch can hold commits of the implementer, and the tree can hold its uncommitted work: change neither, and commit only the test files you correct.
|
|
5
|
-
A corrected test fails because the behavior is missing: run it and
|
|
5
|
+
A corrected test fails because the behavior is missing: run it, print that failing output, and give its failure line in `red`. A corrected test can be green, because the implementer's code is there: then break the production line that the test protects, run the test, print its failing output, give that line in `red`, and revert the edit. In `locked`, list each test file you corrected.
|
|
6
|
+
When a concern needs no test change, leave the test as it is and add the concern to `not_addressed`: `finding` is its text, copied exactly from this list, and `reason` is why the test stands:
|
|
7
|
+
{overruled}
|
|
@@ -15,7 +15,7 @@ from test_fixloop import Inside, inside # noqa: F401 (the autouse fixture puts
|
|
|
15
15
|
from test_tidy import Inside as Pushing, tools # noqa: F401 (an unattended run pushes: the rig with an origin and a fake gh)
|
|
16
16
|
from test_review import ONE, STUCK, finding, fix, review
|
|
17
17
|
from test_stops import CONTRA, NEW_TEST, Q1, UNATTENDED, blocked, correction, decisions, stage, steps, write_answers
|
|
18
|
-
from test_walk import impl, plan, tw
|
|
18
|
+
from test_walk import COST, impl, plan, tw
|
|
19
19
|
|
|
20
20
|
PAGE = ".agent/implement-review.html"
|
|
21
21
|
|
|
@@ -218,15 +218,49 @@ def test_a_correction_that_commits_more_than_the_files_it_lists_is_rejected(tmp_
|
|
|
218
218
|
scenario = plan(**{"01/test-writer": [two_locked(), correction(), correction()], "01/implementer": [dirty, impl("01")]})
|
|
219
219
|
rig = Inside(tmp_path, ONE).run(scenario)
|
|
220
220
|
rig.run(scenario, "--answer", f"{Q1}=overrule-test")
|
|
221
|
-
assert rig.code ==
|
|
221
|
+
assert rig.code == 2, rig.ledger()
|
|
222
222
|
assert rig.led("Ticket 01: BLOCKED at the test-writer: a correction may change only the files it lists in "
|
|
223
223
|
"`locked`: its commits also change demo/export.py.")
|
|
224
|
+
# Issue #134: the refused correction asks the locked-test question again, from the same blocked report.
|
|
225
|
+
(again,) = decisions(rig)["questions"]
|
|
226
|
+
asked_again = rig.state()["run"]["questions"][-1]
|
|
227
|
+
assert again["id"] == "01-locked-test-2" and asked_again["subject"] == "tests/test_01.py::test_x"
|
|
228
|
+
assert asked_again["evidence"][0] == ".agent/implement/01/implementer-0.json"
|
|
224
229
|
assert rig.led(restored(OTHER)) and git(rig.repo, "show", f"ticket/feat%2Fcsv/01:{OTHER}") == OTHER_TEST
|
|
225
230
|
assert len(rig.calls("01", "test-writer")) == 3 and len(rig.calls("01", "implementer")) == 1, "one rerun, no implementer"
|
|
226
231
|
assert "its commits also change demo/export.py" in rig.prompt("test-writer-0")
|
|
227
232
|
assert "feat: 01 rows" not in rig.pr_subjects() and rig.state()["tickets"]["01"]["held"] == {}
|
|
228
233
|
|
|
229
234
|
|
|
235
|
+
MUTATION = "FAILED tests/test_01.py::test_x - AssertionError: fn_01 deleted"
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
def test_an_overrule_correction_whose_test_is_green_against_the_tip_reaches_the_review(tmp_path, capsys):
|
|
239
|
+
# Issue #134: the corrected test is green on the implementer's code, so its red line comes from a reverted mutation.
|
|
240
|
+
green = {**correction(), "stdout": MUTATION + "\n" + COST}
|
|
241
|
+
green["report"] = {**green["report"], "red": [{"test": "tests/test_01.py::test_x", "line": MUTATION}]}
|
|
242
|
+
scenario = plan(**{"01/test-writer": [tw("01"), green, green], "01/implementer": [partial(), impl("01")]})
|
|
243
|
+
rig = Inside(tmp_path, ONE).run(scenario)
|
|
244
|
+
rig.run(scenario, "--answer", f"{Q1}=overrule-test")
|
|
245
|
+
assert rig.code == 0, rig.ledger()
|
|
246
|
+
assert len(rig.calls("01", "test-writer")) == 2, "the green correction is accepted with no rerun"
|
|
247
|
+
assert "break the production line that the test protects" in rig.prompt("test-writer-0")
|
|
248
|
+
assert rig.state()["tickets"]["01"]["phase"] == "merged"
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
def test_an_overrule_correction_may_leave_the_overruled_concern_not_addressed(tmp_path, capsys):
|
|
252
|
+
keeps = {**correction(), "files": {}, "commit": None, "stdout": COST}
|
|
253
|
+
del keeps["files"], keeps["commit"]
|
|
254
|
+
keeps["report"] = {**keeps["report"], "commits": [], "files": [], "locked": [], "red": [],
|
|
255
|
+
"not_addressed": [{"finding": CONTRA, "reason": "the test is right"}]}
|
|
256
|
+
scenario = plan(**{"01/test-writer": [tw("01"), keeps, keeps], "01/implementer": [blocked(), impl("01")]})
|
|
257
|
+
rig = Inside(tmp_path, ONE).run(scenario)
|
|
258
|
+
rig.run(scenario, "--answer", f"{Q1}=overrule-test")
|
|
259
|
+
assert rig.code == 0, rig.ledger()
|
|
260
|
+
assert len(rig.calls("01", "test-writer")) == 2, "the concern is a target the correction can name"
|
|
261
|
+
assert f"- {CONTRA}" in rig.prompt("test-writer-0")
|
|
262
|
+
assert rig.led(f"Ticket 01: the test-writer correction did not correct {CONTRA}: the test is right.")
|
|
263
|
+
|
|
230
264
|
def test_a_correction_of_its_own_file_leaves_the_work_in_the_tree_to_the_implementer(tmp_path, capsys):
|
|
231
265
|
dirty = {**blocked(), "files": {"demo/export.py": "half = 1\n"}}
|
|
232
266
|
# This correction commits only its test file: the implementer's file is out of the reach of `git add -A`.
|
package/skills-manifest.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-23T16:52:23.003Z",
|
|
4
4
|
"skills": [
|
|
5
5
|
{
|
|
6
6
|
"name": "babysit-pr",
|
|
7
|
-
"version": "0.1.
|
|
8
|
-
"hash": "sha256-
|
|
7
|
+
"version": "0.1.1",
|
|
8
|
+
"hash": "sha256-bf09318dcaf40422f9c2433698b4f1c6f8e10b8893f84b1e81ee9f04f7d6cad9",
|
|
9
9
|
"description": "Babysit an open pull request until it is merged or handed to a human. Started by the PostToolUse hook after `gh pr create`, or by hand with `/babysit-pr <pr-url>`."
|
|
10
10
|
},
|
|
11
11
|
{
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
"name": "implement-spec",
|
|
55
|
-
"version": "0.1.
|
|
56
|
-
"hash": "sha256-
|
|
55
|
+
"version": "0.1.40",
|
|
56
|
+
"hash": "sha256-b55e19f156025a0a30d2a6ba6a28eb66c0d890163a29b3a813e49c3eb8be7ca4",
|
|
57
57
|
"description": "Implement a specification in code."
|
|
58
58
|
},
|
|
59
59
|
{
|