@jesdi/skills 0.0.77 → 0.0.79
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/README.md +3 -2
- package/package.json +1 -1
- package/skills/implement-spec/ARCHITECTURE.md +102 -54
- package/skills/implement-spec/README.md +53 -51
- package/skills/implement-spec/SKILL.md +5 -6
- package/skills/implement-spec/driver.py +67 -153
- package/skills/implement-spec/driver_agents.py +75 -25
- package/skills/implement-spec/driver_decisions.py +92 -199
- package/skills/implement-spec/driver_dispute.py +189 -0
- package/skills/implement-spec/driver_final.py +196 -97
- package/skills/implement-spec/driver_fixloop.py +102 -192
- package/skills/implement-spec/driver_legacy.py +73 -5
- package/skills/implement-spec/driver_locked.py +186 -0
- package/skills/implement-spec/driver_merge.py +3 -48
- package/skills/implement-spec/driver_report.py +84 -64
- package/skills/implement-spec/driver_review.py +12 -119
- package/skills/implement-spec/driver_run.py +167 -130
- package/skills/implement-spec/driver_state.py +11 -9
- package/skills/implement-spec/models.json +0 -2
- package/skills/implement-spec/prompts/arbitration.md +34 -0
- package/skills/implement-spec/prompts/conflict.md +1 -0
- package/skills/implement-spec/prompts/correction.md +7 -4
- package/skills/implement-spec/prompts/elsewhere.md +6 -0
- package/skills/implement-spec/prompts/final-fixer.md +1 -1
- package/skills/implement-spec/prompts/final-lens.md +40 -0
- package/skills/implement-spec/prompts/final-reviewer.md +7 -7
- package/skills/implement-spec/prompts/fixer.md +2 -2
- package/skills/implement-spec/prompts/implementer.md +1 -1
- package/skills/implement-spec/prompts/lens-copy.md +1 -0
- package/skills/implement-spec/prompts/lens-correctness.md +8 -0
- package/skills/implement-spec/prompts/lens-spec.md +2 -0
- package/skills/implement-spec/prompts/lens-structure.md +2 -0
- package/skills/implement-spec/prompts/rebase-conflict.md +1 -0
- package/skills/implement-spec/prompts/rereview.md +0 -1
- package/skills/implement-spec/prompts/rerun.md +1 -1
- package/skills/implement-spec/prompts/reviewer.md +3 -6
- package/skills/implement-spec/prompts/ruled.md +3 -0
- package/skills/implement-spec/prompts/test-writer.md +4 -5
- package/skills/implement-spec/tests/test_agents.py +23 -22
- package/skills/implement-spec/tests/test_amendments.py +6 -48
- package/skills/implement-spec/tests/test_arbitration.py +314 -0
- package/skills/implement-spec/tests/test_cli.py +3 -3
- package/skills/implement-spec/tests/test_decisions.py +251 -374
- package/skills/implement-spec/tests/test_driver.py +22 -50
- package/skills/implement-spec/tests/test_final.py +45 -77
- package/skills/implement-spec/tests/test_fixloop.py +400 -633
- package/skills/implement-spec/tests/test_landing.py +23 -126
- package/skills/implement-spec/tests/test_lenses.py +217 -0
- package/skills/implement-spec/tests/test_merge.py +0 -43
- package/skills/implement-spec/tests/test_models.py +50 -1
- package/skills/implement-spec/tests/test_report.py +9 -23
- package/skills/implement-spec/tests/test_review.py +15 -153
- package/skills/implement-spec/tests/test_review_page.py +7 -3
- package/skills/implement-spec/tests/test_scoped.py +125 -0
- package/skills/implement-spec/tests/test_state.py +8 -3
- package/skills/implement-spec/tests/test_stops.py +43 -61
- package/skills/implement-spec/tests/test_tidy.py +77 -98
- package/skills/implement-spec/tests/test_walk.py +7 -6
- package/skills/review-page/SKILL.md +1 -1
- package/skills/test-prune/SKILL.md +7 -3
- package/skills/test-prune/prune_source.py +48 -0
- package/skills/test-prune/prune_strengthen.py +87 -2
- package/skills/test-prune/tests/test_prune_strengthen.py +93 -0
- package/skills/to-tickets/SKILL.md +1 -1
- package/skills-manifest.json +9 -9
- package/skills/implement-spec/prompts/corrected.md +0 -3
- package/skills/implement-spec/prompts/correctness.md +0 -42
- package/skills/implement-spec/prompts/final-scoped.md +0 -1
- package/skills/implement-spec/prompts/full-review.md +0 -2
- package/skills/implement-spec/prompts/overruled.md +0 -7
- package/skills/implement-spec/prompts/rejected.md +0 -1
- package/skills/implement-spec/prompts/restored-red.md +0 -3
- package/skills/implement-spec/prompts/restored.md +0 -3
- package/skills/implement-spec/prompts/stands.md +0 -2
|
@@ -134,11 +134,15 @@ when `prune` exited 1 (the status keeps that failure, so the job still goes red)
|
|
|
134
134
|
`python3 <skill-dir>/prune.py strengthen-commit --item <item id>` as soon as its tests are
|
|
135
135
|
written. Never run `git commit` yourself: the command commits every change under
|
|
136
136
|
`backend/tests/` with the item's trailer, one item per call (an item may take several calls),
|
|
137
|
-
and refuses an unknown or closed item, any change outside `backend/tests/`,
|
|
138
|
-
commit
|
|
137
|
+
and refuses an unknown or closed item, any change outside `backend/tests/`, nothing to
|
|
138
|
+
commit, or a change to a function or a created file another open item already changed: each
|
|
139
|
+
test belongs to one item, so write another item's tests as new functions. Leave the tree clean.
|
|
139
140
|
3. `strengthen-verify` rejects commits without a known trailer or outside `backend/tests/`, then
|
|
140
141
|
proves each item on a cold run: every named id survived on the base and is killed on the
|
|
141
|
-
head. Unproven items are reverted and closed: a later commit for a closed item is refused.
|
|
142
|
+
head. Unproven items are reverted and closed: a later commit for a closed item is refused.
|
|
143
|
+
When `git revert` conflicts with a later item's lines, the item's functions are removed or
|
|
144
|
+
restored instead and its created files deleted; an item that changed anything else in a file
|
|
145
|
+
still stops the run with exit 1. It
|
|
142
146
|
writes `<state>/strengthen-proof.json`, including the proven head. On failure HEAD stays
|
|
143
147
|
where the commits are (detached, unattended): fix and rerun. A rejection names the recovery
|
|
144
148
|
that needs no reset: `git checkout <start>`, then commit each item again with
|
|
@@ -220,6 +220,54 @@ def delete_tests(source: str, targets: set[tuple[tuple[str, ...], str]]) -> str:
|
|
|
220
220
|
return "".join(line for number, line in enumerate(lines, 1) if number not in removed)
|
|
221
221
|
|
|
222
222
|
|
|
223
|
+
def _function_nodes(body: list[ast.stmt], scope: tuple[str, ...] = ()):
|
|
224
|
+
"""((classes, name), node) for every function defined at module or class level."""
|
|
225
|
+
for node in body:
|
|
226
|
+
if isinstance(node, FUNCS):
|
|
227
|
+
yield (scope, node.name), node
|
|
228
|
+
elif isinstance(node, ast.ClassDef):
|
|
229
|
+
yield from _function_nodes(node.body, scope + (node.name,))
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
def functions(source: str) -> dict[tuple[tuple[str, ...], str], str]:
|
|
233
|
+
"""(classes, name) → source (decorators included) of every module- or class-level function."""
|
|
234
|
+
lines = source.splitlines()
|
|
235
|
+
return {key: "\n".join(lines[_span(node)[0] - 1:node.end_lineno])
|
|
236
|
+
for key, node in _function_nodes(ast.parse(source).body)}
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def _strip(body: list[ast.stmt]) -> list[ast.stmt]:
|
|
240
|
+
kept = []
|
|
241
|
+
for node in body:
|
|
242
|
+
if isinstance(node, (*FUNCS, ast.Import, ast.ImportFrom)):
|
|
243
|
+
continue
|
|
244
|
+
if isinstance(node, ast.ClassDef):
|
|
245
|
+
node.body = _strip(node.body)
|
|
246
|
+
if not (node.body[1:] if ast.get_docstring(node) is not None else node.body):
|
|
247
|
+
continue
|
|
248
|
+
kept.append(node)
|
|
249
|
+
return kept
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def skeleton(source: str) -> str:
|
|
253
|
+
"""The file without its functions, its imports and the classes that leave only a docstring: equal
|
|
254
|
+
before and after a change confined to functions and imports."""
|
|
255
|
+
tree = ast.parse(source)
|
|
256
|
+
tree.body = _strip(tree.body)
|
|
257
|
+
return ast.dump(tree)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
def restore_functions(source: str, before: str, keys: set) -> str:
|
|
261
|
+
"""source with each function in keys ({(classes, name)}) put back to its text in before."""
|
|
262
|
+
old = functions(before)
|
|
263
|
+
lines = source.splitlines(keepends=True)
|
|
264
|
+
spans = sorted(((_span(node), key) for key, node in _function_nodes(ast.parse(source).body) if key in keys),
|
|
265
|
+
reverse=True)
|
|
266
|
+
for (start, end), key in spans:
|
|
267
|
+
lines[start - 1:end] = [old[key] + "\n"]
|
|
268
|
+
return "".join(lines)
|
|
269
|
+
|
|
270
|
+
|
|
223
271
|
def test_sources(source: str) -> dict[str, str]:
|
|
224
272
|
"""`[Class::]name` → source of every test function in the file."""
|
|
225
273
|
out: dict[str, str] = {}
|
|
@@ -8,7 +8,7 @@ import re
|
|
|
8
8
|
|
|
9
9
|
from prune_repo import KILLED, SURVIVING, BadInput, Fail, Repo, ratchet_lines
|
|
10
10
|
from prune_review import check_reviews, equivalents_section, suggestions_section
|
|
11
|
-
from prune_source import test_sources
|
|
11
|
+
from prune_source import delete_tests, functions, restore_functions, skeleton, test_sources
|
|
12
12
|
|
|
13
13
|
TRAILER = "Test-Prune-Item"
|
|
14
14
|
# Read from the whole message, not git's trailer block: git only takes trailers from the
|
|
@@ -105,6 +105,47 @@ def _commits(repo, st: dict) -> list:
|
|
|
105
105
|
return [(sha, items[0]) for sha, items, _ in history]
|
|
106
106
|
|
|
107
107
|
|
|
108
|
+
def _units(path: str, before: str | None, after: str | None) -> set:
|
|
109
|
+
"""What one file change claims for its item: every function it adds or changes, or the whole file
|
|
110
|
+
when the change creates it, deletes it, or the file is not Python the AST can split. No two items
|
|
111
|
+
may claim the same unit, so closing one item never has to undo another's lines."""
|
|
112
|
+
if before is None or after is None or not path.endswith(".py"):
|
|
113
|
+
return {path}
|
|
114
|
+
try:
|
|
115
|
+
old, new = functions(before), functions(after)
|
|
116
|
+
except SyntaxError:
|
|
117
|
+
return {path}
|
|
118
|
+
return {"::".join((path, *classes, name)) for classes, name in old.keys() | new.keys()
|
|
119
|
+
if old.get((classes, name)) != new.get((classes, name))}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def _paths(repo, sha: str) -> list:
|
|
123
|
+
return repo.git("diff-tree", "--no-commit-id", "--name-only", "-r", sha).split()
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def _owners(repo, st: dict) -> dict:
|
|
127
|
+
"""unit → the still-open item whose commits claimed it first."""
|
|
128
|
+
owners: dict = {}
|
|
129
|
+
for sha, items, paths in _history(repo, st["start"]):
|
|
130
|
+
if len(items) == 1 and st["status"].get(items[0]) in ("open", "proven"):
|
|
131
|
+
for path in paths:
|
|
132
|
+
for unit in _units(path, repo.show(f"{sha}^", path), repo.show(sha, path)):
|
|
133
|
+
owners.setdefault(unit, items[0])
|
|
134
|
+
return owners
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def _require_unowned(repo, st: dict, item_id: str, changed: list) -> None:
|
|
138
|
+
owners = _owners(repo, st)
|
|
139
|
+
for path in changed:
|
|
140
|
+
current = repo.root / path
|
|
141
|
+
after = current.read_text() if current.is_file() else None
|
|
142
|
+
for unit in sorted(_units(path, repo.show("HEAD", path), after) | {path}):
|
|
143
|
+
owner = owners.get(unit, item_id)
|
|
144
|
+
if owner != item_id:
|
|
145
|
+
raise BadInput(f"{unit} is {owner}'s: each test and each created file belongs to one item. "
|
|
146
|
+
f"Discard this change, or write {item_id}'s tests as new functions.")
|
|
147
|
+
|
|
148
|
+
|
|
108
149
|
def strengthen_commit(ctx) -> int:
|
|
109
150
|
"""Commit the working tree's changes under backend/tests/ as one commit for one open item; the
|
|
110
151
|
trailer is written here, so a commit can never name two items."""
|
|
@@ -119,19 +160,63 @@ def strengthen_commit(ctx) -> int:
|
|
|
119
160
|
raise BadInput("changes outside backend/tests/, discard them first:\n" + "\n".join(outside))
|
|
120
161
|
if not changed:
|
|
121
162
|
raise BadInput(f"nothing to commit for {item_id}: write its tests under backend/tests/ first")
|
|
163
|
+
_require_unowned(repo, st, item_id, changed)
|
|
122
164
|
repo.git("add", "-A", "--", "backend/tests/")
|
|
123
165
|
repo.git("commit", "-q", "-m", f"test: strengthen {item_id}", "-m", f"{TRAILER}: {item_id}")
|
|
124
166
|
ctx.state.emit(repo.head())
|
|
125
167
|
return 0
|
|
126
168
|
|
|
127
169
|
|
|
170
|
+
def _confined(repo, item_id: str, shas: list) -> dict:
|
|
171
|
+
"""{path: (text before the item's first commit to it, the item's function keys in it)}; Fail when a
|
|
172
|
+
commit changes anything but functions and imports, or deletes a function."""
|
|
173
|
+
out: dict = {}
|
|
174
|
+
for sha in shas:
|
|
175
|
+
for path in _paths(repo, sha):
|
|
176
|
+
before, after = repo.show(f"{sha}^", path), repo.show(sha, path)
|
|
177
|
+
entry = out.setdefault(path, (before, set()))
|
|
178
|
+
if entry[0] is None:
|
|
179
|
+
continue # the item created the file: removing the file undoes it whole
|
|
180
|
+
keys = _function_change(path, before, after)
|
|
181
|
+
if keys is None:
|
|
182
|
+
raise Fail(f"reverting strengthen item {item_id} conflicts with a later item's commits, and "
|
|
183
|
+
f"{sha[:12]} changes {path} beyond adding or editing functions and imports")
|
|
184
|
+
entry[1].update(keys)
|
|
185
|
+
return out
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
def _function_change(path: str, before: str | None, after: str | None) -> set | None:
|
|
189
|
+
"""The function keys a commit's change to path adds or edits, or None when it changes anything but
|
|
190
|
+
functions and imports, or deletes a function."""
|
|
191
|
+
if before is None or after is None or not path.endswith(".py") or skeleton(before) != skeleton(after):
|
|
192
|
+
return None
|
|
193
|
+
old, new = functions(before), functions(after)
|
|
194
|
+
return None if old.keys() - new.keys() else {k for k in new if old.get(k) != new[k]}
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def _remove(repo, item_id: str, shas: list) -> None:
|
|
198
|
+
"""Undo the item's commits by function instead of by line, when a later item's lines sit next to
|
|
199
|
+
its own and `git revert` conflicts: delete the functions it added, restore the ones it changed, and
|
|
200
|
+
remove the files it created. Every unit is the item's alone (see _units)."""
|
|
201
|
+
for path, (before, keys) in _confined(repo, item_id, shas).items():
|
|
202
|
+
current = repo.show("HEAD", path)
|
|
203
|
+
if before is None:
|
|
204
|
+
if current is not None:
|
|
205
|
+
repo.git("rm", "-q", "--", path)
|
|
206
|
+
continue
|
|
207
|
+
old = functions(before)
|
|
208
|
+
text = restore_functions(current, before, {k for k in keys if k in old})
|
|
209
|
+
(repo.root / path).write_text(delete_tests(text, {k for k in keys if k not in old}))
|
|
210
|
+
repo.git("add", "--", path)
|
|
211
|
+
|
|
212
|
+
|
|
128
213
|
def _revert(repo, item_id: str, commits: list, why: str) -> None:
|
|
129
214
|
shas = [sha for sha, item in reversed(commits) if item == item_id]
|
|
130
215
|
if not shas:
|
|
131
216
|
return
|
|
132
217
|
if repo.run_git("revert", "--no-commit", *shas).returncode:
|
|
133
218
|
repo.run_git("revert", "--abort")
|
|
134
|
-
|
|
219
|
+
_remove(repo, item_id, shas[::-1])
|
|
135
220
|
repo.git("commit", "-q", "--allow-empty", "-m", f"Revert test-prune item {item_id}", "-m", why,
|
|
136
221
|
"-m", f"{TRAILER}: {item_id}")
|
|
137
222
|
|
|
@@ -336,3 +336,96 @@ def test_strengthen_commit_refuses_a_head_off_the_strengthen_start(target):
|
|
|
336
336
|
target.git("commit", "-q", "-m", "unrelated root")
|
|
337
337
|
write_test(target, COMPUTE_TEST)
|
|
338
338
|
refused(target, COMPUTE, "does not descend")
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
# --- closing an item removes its tests, even under a later item's commits ---------------------
|
|
342
|
+
|
|
343
|
+
def test_an_unproven_item_committed_before_a_proven_one_is_removed_without_a_conflict(target):
|
|
344
|
+
# Both items append to the end of one file: `git revert` of the earlier one conflicts.
|
|
345
|
+
two_items(target, drift_ids=("x_apply_drift__mutmut_2", "x_apply_drift__mutmut_4"))
|
|
346
|
+
for item, source in [(DRIFT, DRIFT_TEST), (COMPUTE, COMPUTE_TEST)]:
|
|
347
|
+
write_test(target, source)
|
|
348
|
+
target.ok("strengthen-commit", "--item", item)
|
|
349
|
+
|
|
350
|
+
target.ok("strengthen-verify")
|
|
351
|
+
|
|
352
|
+
assert target.read_state("strengthen.json")["status"] == {COMPUTE: "proven", DRIFT: "reverted"}
|
|
353
|
+
source = (target.root / TESTS_FILE).read_text()
|
|
354
|
+
assert "def test_compute_trades_rounding(targets):" in source
|
|
355
|
+
assert "test_apply_drift_new" not in source
|
|
356
|
+
assert source == target.show(target.base, TESTS_FILE) + "\n\n" + COMPUTE_TEST.strip("\n") + "\n"
|
|
357
|
+
trailers = target.git("log", "-1", "--format=%(trailers:key=Test-Prune-Item,valueonly)").split()
|
|
358
|
+
assert trailers == [DRIFT]
|
|
359
|
+
assert target.git("status", "--porcelain").strip() == ""
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
def test_a_new_file_left_without_tests_by_a_closed_item_is_deleted(target):
|
|
363
|
+
two_items(target, drift_ids=("x_apply_drift__mutmut_2", "x_apply_drift__mutmut_4"))
|
|
364
|
+
new_file = "backend/tests/test_drift_new.py"
|
|
365
|
+
(target.root / new_file).write_text("from services.rebalancer import apply_drift\n" + DRIFT_TEST)
|
|
366
|
+
write_test(target, DRIFT_TEST.replace("_new", "_also")) # the append COMPUTE's append conflicts with
|
|
367
|
+
target.ok("strengthen-commit", "--item", DRIFT)
|
|
368
|
+
(target.root / new_file).write_text((target.root / new_file).read_text() + COMPUTE_TEST)
|
|
369
|
+
refused(target, COMPUTE, new_file) # another item's file
|
|
370
|
+
target.git("checkout", "-q", "--", new_file)
|
|
371
|
+
write_test(target, COMPUTE_TEST)
|
|
372
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
373
|
+
|
|
374
|
+
target.ok("strengthen-verify")
|
|
375
|
+
|
|
376
|
+
assert not (target.root / new_file).exists()
|
|
377
|
+
assert (target.root / TESTS_FILE).read_text() == \
|
|
378
|
+
target.show(target.base, TESTS_FILE) + "\n\n" + COMPUTE_TEST.strip("\n") + "\n"
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
def test_a_test_a_closed_item_changed_is_free_for_another_item(target):
|
|
382
|
+
two_items(target, drift_ids=("x_apply_drift__mutmut_2", "x_apply_drift__mutmut_4"))
|
|
383
|
+
path = target.root / TESTS_FILE
|
|
384
|
+
path.write_text(path.read_text().rstrip("\n") + "\n assert apply_drift(-0.5) == 0\n")
|
|
385
|
+
target.ok("strengthen-commit", "--item", DRIFT)
|
|
386
|
+
write_test(target, COMPUTE_TEST)
|
|
387
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
388
|
+
target.ok("strengthen-verify") # DRIFT leaves _4 alive: reverted, test_drift_scales is back to the base
|
|
389
|
+
scales = " assert apply_drift(base) <= base\n"
|
|
390
|
+
path.write_text(path.read_text().replace(scales, scales + " assert apply_drift(base) >= 0\n"))
|
|
391
|
+
|
|
392
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
393
|
+
|
|
394
|
+
|
|
395
|
+
def test_strengthen_commit_refuses_a_test_another_item_already_changed(target):
|
|
396
|
+
two_items(target)
|
|
397
|
+
write_test(target, COMPUTE_TEST)
|
|
398
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
399
|
+
path = target.root / TESTS_FILE
|
|
400
|
+
path.write_text(path.read_text().replace("== 0.267", "== 0.267 # pinned"))
|
|
401
|
+
write_test(target, DRIFT_TEST)
|
|
402
|
+
|
|
403
|
+
refused(target, DRIFT, f"test_compute_trades_rounding is {COMPUTE}'s")
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
def test_a_test_the_closed_item_changed_is_restored_under_a_later_items_test(target):
|
|
407
|
+
two_items(target, drift_ids=("x_apply_drift__mutmut_2", "x_apply_drift__mutmut_4"))
|
|
408
|
+
path = target.root / TESTS_FILE
|
|
409
|
+
path.write_text(path.read_text().rstrip("\n") + "\n assert apply_drift(-0.5) == 0\n")
|
|
410
|
+
target.ok("strengthen-commit", "--item", DRIFT)
|
|
411
|
+
write_test(target, COMPUTE_TEST)
|
|
412
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
413
|
+
|
|
414
|
+
target.ok("strengthen-verify")
|
|
415
|
+
|
|
416
|
+
assert target.read_state("strengthen.json")["status"] == {COMPUTE: "proven", DRIFT: "reverted"}
|
|
417
|
+
assert path.read_text() == target.show(target.base, TESTS_FILE) + "\n\n" + COMPUTE_TEST.strip("\n") + "\n"
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
def test_a_closed_item_that_changed_more_than_functions_still_stops_the_run_on_a_conflict(target):
|
|
421
|
+
two_items(target, drift_ids=("x_apply_drift__mutmut_2", "x_apply_drift__mutmut_4"))
|
|
422
|
+
write_test(target, "LIMIT = -0.5\n" + DRIFT_TEST)
|
|
423
|
+
target.ok("strengthen-commit", "--item", DRIFT)
|
|
424
|
+
write_test(target, COMPUTE_TEST)
|
|
425
|
+
target.ok("strengthen-commit", "--item", COMPUTE)
|
|
426
|
+
|
|
427
|
+
verify = target.run("strengthen-verify")
|
|
428
|
+
|
|
429
|
+
assert verify.returncode == 1, verify.stdout + verify.stderr
|
|
430
|
+
assert f"changes {TESTS_FILE} beyond adding or editing functions" in verify.stdout + verify.stderr
|
|
431
|
+
assert target.git("status", "--porcelain").strip() == ""
|
|
@@ -123,7 +123,7 @@ The **Touches** line is a best guess, for scheduling: `implement-spec` never run
|
|
|
123
123
|
|
|
124
124
|
<risk-rule>
|
|
125
125
|
|
|
126
|
-
The optional **Risk** line names the shared state, persistence keys or identities, concurrency, money or auth the ticket touches
|
|
126
|
+
The optional **Risk** line names the shared state, persistence keys or identities, concurrency, money or auth the ticket touches. `implement-spec`'s reviewer checks it as one more criterion: a risk that the diff does not handle is an unmet criterion, which starts a fix round and blocks the ticket at the cap. The driver reads any text on the line as a risk, so a ticket with no such risk has no **Risk** line, never `**Risk:** none`.
|
|
127
127
|
|
|
128
128
|
</risk-rule>
|
|
129
129
|
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-
|
|
3
|
+
"generatedAt": "2026-11-02T00:19:48.022Z",
|
|
4
4
|
"skills": [
|
|
5
5
|
{
|
|
6
6
|
"name": "agents-wayfinder",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
},
|
|
59
59
|
{
|
|
60
60
|
"name": "implement-spec",
|
|
61
|
-
"version": "0.1.
|
|
62
|
-
"hash": "sha256-
|
|
61
|
+
"version": "0.1.47",
|
|
62
|
+
"hash": "sha256-0aef522504cc63d918dd8731f9b2fa00e33c7291c680f37c3dfc6a08adc38d93",
|
|
63
63
|
"description": "Implement a specification in code."
|
|
64
64
|
},
|
|
65
65
|
{
|
|
@@ -94,14 +94,14 @@
|
|
|
94
94
|
},
|
|
95
95
|
{
|
|
96
96
|
"name": "review-page",
|
|
97
|
-
"version": "0.1.
|
|
98
|
-
"hash": "sha256-
|
|
97
|
+
"version": "0.1.2",
|
|
98
|
+
"hash": "sha256-12746275595aafc21ea043843ee89a6bbc6f5a82e1e5440af831a1f3384b63d7",
|
|
99
99
|
"description": "One interactive HTML page for a plan review or a questionnaire, built from a fixed template. Use when a pipeline session must deliver a plan review or a questionnaire as an interactive page the console shows."
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "test-prune",
|
|
103
|
-
"version": "0.1.
|
|
104
|
-
"hash": "sha256-
|
|
103
|
+
"version": "0.1.4",
|
|
104
|
+
"hash": "sha256-127f1b28add5b6039a306f3a16d7111bc3d1e196ed076da28565f04d269d4cd4",
|
|
105
105
|
"description": "Mutation-guided test pruning: a fixer proposes deleting redundant tests and strengthening weak ones, an independent reviewer accepts or rejects each proposal, and prune.py applies the accepted batch behind a cold mutation run and the ratchet. Use when the user says \"prune tests\", \"test-prune\", \"mutation test pruning\" or \"strengthen weak tests\", or when a scheduled job runs it with `--unattended`."
|
|
106
106
|
},
|
|
107
107
|
{
|
|
@@ -118,8 +118,8 @@
|
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"name": "to-tickets",
|
|
121
|
-
"version": "0.1.
|
|
122
|
-
"hash": "sha256-
|
|
121
|
+
"version": "0.1.7",
|
|
122
|
+
"hash": "sha256-c67cfed832cad39836bd054f7ca3ce423f4dc51055aa07e14c773c3bafa922f4",
|
|
123
123
|
"description": "Break a spec, plan, or the current conversation into numbered tracer-bullet ticket files under .agent/tickets/, each declaring its blocking edges and acceptance criteria phrased as observable behavior. Use after a spec is approved and before implementation starts."
|
|
124
124
|
},
|
|
125
125
|
{
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
When this correction adds a requirement, update each shared fake or fixture that other locked tests use, so that those tests satisfy the requirement too. List each file you change in `locked`, and each one that holds no test in `fixtures` too.
|
|
3
|
-
Then run each whole file of `locked` and each locked test of merged tickets. In `concerns`, name each red test and why it is expected to be red, or write that all are green.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
# Correctness pass
|
|
2
|
-
|
|
3
|
-
Spec: {spec}
|
|
4
|
-
Ticket: {ticket}
|
|
5
|
-
Seam: {seam}
|
|
6
|
-
Range: {pr_branch}...{branch}, with the ticket tip at {start_sha}
|
|
7
|
-
Locked files: {locked}
|
|
8
|
-
|
|
9
|
-
Apply each check of the review-diff checks below to the diff of the range, with the Risk line of the ticket first: races, idempotency, time, authorization, persistence keys and identities, migrations, error paths.
|
|
10
|
-
The output section of the checks does not apply here: your findings go into the report.
|
|
11
|
-
|
|
12
|
-
<checks>
|
|
13
|
-
{correctness}
|
|
14
|
-
</checks>
|
|
15
|
-
|
|
16
|
-
Read file content from git at {start_sha} (`git diff`, `git show {start_sha}:<path>`), never from the working tree, and run no tests: another agent makes temporary edits in this worktree while you work.
|
|
17
|
-
The one exception is the input of the driver, which git can lack because `.agent/` is ignored: read the spec, the ticket and the findings file from the working tree. The other agent does not edit them.
|
|
18
|
-
Report only a defect that you can show with a concrete sequence of events. Put an unmet ticket criterion or regression of merged-ticket behavior in `findings`; put every other defect in `observations` for final review. Set `basis` on each finding to `criterion` or `regression` accordingly. `mutations` is optional for this pass.
|
|
19
|
-
Give each finding a severity (critical, important or minor), the file and line, a title, the evidence, and a kind: `fixture` when a locked test encodes a stale path, format or setup detail; `test` when a test is weak or missing, as a locked test that stays green when you break the line it protects; `code` for anything else. The test-writer corrects each `fixture` finding and each critical or important `test` finding on a locked file, and the fixer gets the rest.
|
|
20
|
-
Do not commit and do not dispatch subagents. Leave the tree as you found it.
|
|
21
|
-
|
|
22
|
-
Write one JSON report at {report}. When your sandbox is read-only, give the JSON as your whole final message and the driver saves it there. The report matches this schema:
|
|
23
|
-
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"type": "object",
|
|
27
|
-
"required": ["status", "files", "concerns", "findings"],
|
|
28
|
-
"properties": {
|
|
29
|
-
"status": {"enum": ["DONE", "DONE_WITH_CONCERNS", "NEEDS_CONTEXT", "BLOCKED"]},
|
|
30
|
-
"files": {"type": "array", "items": {"type": "string"}},
|
|
31
|
-
"concerns": {"type": "array", "items": {"type": "string"}},
|
|
32
|
-
"findings": {"type": "array", "items": {"type": "object", "required": ["severity", "file", "line", "title", "evidence", "kind"], "properties": {"severity": {"enum": ["critical", "important", "minor"]}, "file": {"type": "string"}, "line": {"type": "integer"}, "title": {"type": "string", "minLength": 1}, "evidence": {"type": "string", "minLength": 1}, "kind": {"enum": ["code", "fixture", "test"]}, "basis": {"enum": ["criterion", "regression"]}}}},
|
|
33
|
-
"observations": {"type": "array", "items": {"type": "object", "required": ["severity", "file", "line", "title", "evidence", "kind"], "properties": {"severity": {"enum": ["critical", "important", "minor"]}, "file": {"type": "string"}, "line": {"type": "integer"}, "title": {"type": "string", "minLength": 1}, "evidence": {"type": "string", "minLength": 1}, "kind": {"enum": ["code", "fixture", "test"]}}}},
|
|
34
|
-
"regressions": {"description": "After a fix: new regressions introduced by that fix. Set basis to criterion when a ticket criterion fails, or regression when merged-ticket behavior fails.", "type": "array", "items": {"type": "object", "required": ["severity", "file", "line", "title", "evidence", "kind"], "properties": {"severity": {"enum": ["critical", "important", "minor"]}, "file": {"type": "string"}, "line": {"type": "integer"}, "title": {"type": "string", "minLength": 1}, "evidence": {"type": "string", "minLength": 1}, "kind": {"enum": ["code", "fixture", "test"]}, "basis": {"enum": ["criterion", "regression"]}}}},
|
|
35
|
-
"mutations": {"description": "Optional for this pass.", "type": "array", "items": {"type": "object", "required": ["test", "file", "line", "red"], "properties": {"test": {"type": "string", "minLength": 1}, "file": {"type": "string", "minLength": 1}, "line": {"type": "integer"}, "red": {"type": "string", "minLength": 1}}}}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Run git as plain `git` in this worktree, and leave the git config as it is: all worktrees read one shared config, and one key written there, such as a `core.worktree`, breaks git in each of them. So never set GIT_DIR or GIT_WORK_TREE, and never write with `git config`.
|
|
41
|
-
The gate record of the driver for {start_sha} is {gate_record}.
|
|
42
|
-
Never run `git stash`, never reset, and never check out another branch: worktrees share one stash and one ref store.
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
This is the scoped review after the fix batch: the range holds only the `fix(NN)` commits, and the commits up to {reviewed} have their review. Check that each critical or important finding in {findings} is fixed, including every must-fix finding, and that the fix commits break nothing else. Put each verified must-fix title in `resolved_must_fix`.
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
|
|
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
|
-
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
|
-
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, 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}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Before the ruling of the operator, the driver rejected two reports of this role in this review: {rejection}. This time, give what the driver asked for.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The driver ran the gate on that commit, {start_sha}, and the gate is red: read the output in {record}. The gate was green before the restore, so a restored file fails with the code of this ticket.
|
|
3
|
-
Update each restored file that fails so that it works with the new interface: keep what each test asserts, and list the file in `locked`. When no such update can keep what a test asserts, report BLOCKED with a concern that starts with `locked test contradicts spec:`, then the test and the evidence.
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The driver put back these files at their locked versions, in a commit before this call, because the implementer or a fixer had changed them: {restored}.
|
|
3
|
-
A fixer may not change a locked file. When a test in one of these files now fails only because this ticket changed an interface that the test uses, update that file so it works with the new interface: keep what each test asserts, and list the file in `locked`. Else leave the file as it is, unless a finding of this correction is on it.
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
The earlier attempt reported that a locked test contradicts the spec, and the operator ruled that the locked tests stand as they are. Your earlier commits are on the branch and your uncommitted work is in the tree: continue from them and make the locked tests green. Do not report that contradiction again.
|