@jesdi/skills 0.0.55 → 0.0.56
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/implement-spec/ARCHITECTURE.md +2 -1
- package/skills/implement-spec/README.md +2 -2
- package/skills/implement-spec/driver_fixloop.py +2 -1
- package/skills/implement-spec/driver_review.py +6 -5
- package/skills/implement-spec/prompts/correction.md +2 -1
- package/skills/implement-spec/prompts/test-writer.md +2 -1
- package/skills/implement-spec/tests/test_fixloop.py +22 -1
- package/skills-manifest.json +3 -3
package/package.json
CHANGED
|
@@ -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,7 +118,7 @@ Rules for each agent:
|
|
|
118
118
|
|
|
119
119
|
| Finding | What the driver does |
|
|
120
120
|
|---|---|
|
|
121
|
-
| kind `fixture`, any severity
|
|
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
|
|
|
@@ -218,7 +218,8 @@ def _unaccepted(job: Job, state: dict, to_correct: list[dict]) -> list[dict]:
|
|
|
218
218
|
def _act_on(job: Job, found: list[dict]) -> bool:
|
|
219
219
|
"""Do what the findings of a review ask for: a correction, a fix round, or a stop. True: none is open."""
|
|
220
220
|
state = job.run.state.read()
|
|
221
|
-
to_correct, to_fix = driver_review.route(found, state["tickets"][job.ticket.number]["locked"]
|
|
221
|
+
to_correct, to_fix = driver_review.route(found, state["tickets"][job.ticket.number]["locked"],
|
|
222
|
+
driver_merge.protected(state["tickets"], job.ticket.number))
|
|
222
223
|
to_correct = _unaccepted(job, state, to_correct)
|
|
223
224
|
if job.round == ROUNDS:
|
|
224
225
|
# No correction after round 4: no fix round could make its new locked tests green, so `accept` could not merge.
|
|
@@ -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,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
|
|
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>`.
|
|
@@ -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
|
-
|
|
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
|
|
|
@@ -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."""
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-10-
|
|
3
|
+
"generatedAt": "2026-10-20T15:09:12.275Z",
|
|
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.
|
|
50
|
-
"hash": "sha256-
|
|
49
|
+
"version": "0.1.31",
|
|
50
|
+
"hash": "sha256-122fcb172321462eacb9a527a876c568c687bbf315b6fce67cdca7a5a6445ba8",
|
|
51
51
|
"description": "Implement a specification in code."
|
|
52
52
|
},
|
|
53
53
|
{
|