@jesdi/skills 0.0.57 → 0.0.58
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/README.md +3 -3
- package/skills/implement-spec/driver.py +2 -1
- package/skills/implement-spec/driver_fixloop.py +11 -4
- package/skills/implement-spec/driver_report.py +9 -2
- package/skills/implement-spec/driver_review.py +6 -5
- package/skills/implement-spec/driver_state.py +6 -2
- package/skills/implement-spec/prompts/corrected.md +1 -1
- package/skills/implement-spec/prompts/full-review.md +1 -1
- package/skills/implement-spec/prompts/reviewer.md +1 -1
- package/skills/implement-spec/prompts/test-writer.md +1 -0
- package/skills/implement-spec/tests/test_decisions.py +7 -6
- package/skills/implement-spec/tests/test_fixloop.py +21 -0
- package/skills/implement-spec/tests/test_state.py +4 -2
- package/skills-manifest.json +3 -3
package/package.json
CHANGED
|
@@ -177,9 +177,9 @@ 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`) | The driver reads a test node id `<file>::<test>` in `locked` as its file. With DONE: one commit, one locked file and one red line or more. Each locked path is in a commit that the role made. 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; a DONE correction with each of its findings there needs no commit. |
|
|
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. 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; a DONE correction with each of its findings there needs no commit. |
|
|
181
181
|
| implementer | `prompts/implementer.md` | `green` | With DONE: one commit or more. |
|
|
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. |
|
|
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>`). A locked fixture needs no proof: it holds no test that a proof could name, and the locked-file check protects it. Each `red` is in the log. |
|
|
183
183
|
| correctness | `prompts/correctness.md` | the same as the reviewer; `commits` is empty | `mutations` is optional. |
|
|
184
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. |
|
|
@@ -210,7 +210,7 @@ Answer with `--answer <question id>=<option id>` on the next run, or through the
|
|
|
210
210
|
| Check | Where it lives |
|
|
211
211
|
|---|---|
|
|
212
212
|
| Locked tests with a demonstrated red | `driver_report.py` `_proof_errors`: each red line of the test-writer report must be in its log. `driver_review.py` `locked_findings`: a locked file of the ticket that differs from the test-writer commit is a critical finding, before each review. `driver_review.py` `merged_changes`: a locked file of a merged ticket that the ticket changed is a critical `fixture` finding, before each review. `driver_merge.py` `refused`, called from `driver.py` `_checked_landing` under the merge lock: a locked file of a merged ticket that differs between the PR tip and the tree that is about to land refuses the landing, so a later ticket cannot change the locked test of an earlier one. `driver_report.py` `_merged_errors` rejects a test-writer report that changes such a file and does not list it. |
|
|
213
|
-
| One mutation proof for each locked test | `prompts/full-review.md`, the note of each full review, names the locked test files that need a proof. `driver_report.py` `_locked_errors` and `_proof_errors` reject a full review with no proof for a locked test file, or with a red line that is not in the log. `driver_review.py` `follow` finds the proofs that a fix makes due again. |
|
|
213
|
+
| One mutation proof for each locked test | `prompts/full-review.md`, the note of each full review, names the locked test files that need a proof: each locked file that is not a fixture. `driver_report.py` `_locked_errors` and `_proof_errors` reject a full review with no proof for a locked test file, or with a red line that is not in the log. `driver_review.py` `follow` finds the proofs that a fix makes due again. |
|
|
214
214
|
| One independent correctness pass for each risky ticket | `driver_fixloop.py` `_review` adds the pass for a ticket with a **Risk** line. `driver_agents.py` `correctness_entry` picks the entry of another provider, and `load_models` stops the run when there is none or its CLI is not on PATH. |
|
|
215
215
|
| One full gate for each candidate | `driver_gate.py` `run`, called from `driver_run.py` `Run.gate`: one record for each commit the driver is about to trust. Green is exit 0 on a tree that is clean before and after, with HEAD not moved. |
|
|
216
216
|
| Post-merge check on the PR branch | `driver.py` `_checked_landing`: a merge commit is gated before the PR branch moves to it. A fast-forward of a gated tip uses the record of that tip. `driver_final.py` `_review_until_reviewed` gates the tip again after the tidy and after the fix batch. |
|
|
@@ -120,7 +120,8 @@ def _run_roles(ticket: Ticket, slot_number: int, run: Run) -> None:
|
|
|
120
120
|
report = run.agent(role, number, slot, values, notes=notes, check=check)
|
|
121
121
|
facts = {"tip": driver_slots.head(slot)}
|
|
122
122
|
if role == "test-writer":
|
|
123
|
-
facts.update(driver_review.written(slot, entry, report["locked"],
|
|
123
|
+
facts.update(driver_review.written(slot, entry, report["locked"], report.get("fixtures", []),
|
|
124
|
+
facts["tip"]))
|
|
124
125
|
values["locked"] = " ".join(facts["locked"])
|
|
125
126
|
run.state.ticket(number, phase=AFTER.get(role, "review"), note="", **facts)
|
|
126
127
|
start, notes = facts["tip"], []
|
|
@@ -43,11 +43,16 @@ class Job:
|
|
|
43
43
|
findings = os.path.relpath(OUT / self.ticket.number / f"findings-{review}.json", self.slot)
|
|
44
44
|
gate = os.path.relpath(driver_gate.record_path(OUT / self.ticket.number, self.tip), self.slot)
|
|
45
45
|
return {**self.values, "start_sha": self.tip, "from_sha": self.previous, "round": str(self.round),
|
|
46
|
-
"locked": " ".join(entry["locked"]), "test_writer_sha": str(entry["test_writer_sha"] or ""),
|
|
46
|
+
"locked": " ".join(entry["locked"]), "locked_tests": " ".join(tested(entry)), "test_writer_sha": str(entry["test_writer_sha"] or ""),
|
|
47
47
|
"findings": findings, "gate_record": gate,
|
|
48
48
|
"proofs": " ".join(f"{file}:{line}" for file, line in sorted(self.again))}
|
|
49
49
|
|
|
50
50
|
|
|
51
|
+
def tested(entry: dict) -> list[str]:
|
|
52
|
+
"""The locked files of the ticket record that hold tests: each one needs a mutation proof in a full review."""
|
|
53
|
+
return [path for path in entry["locked"] if path not in entry["fixtures"]]
|
|
54
|
+
|
|
55
|
+
|
|
51
56
|
def entry(models: dict[str, list[str]], round: int) -> str:
|
|
52
57
|
"""The implementer entry of a fix round: the second one from round 3, when the list has one."""
|
|
53
58
|
entries = models["implementer"]
|
|
@@ -72,7 +77,8 @@ def _run_reviewers(job: Job, cast: list[tuple[str, str]], locked: list[str]) ->
|
|
|
72
77
|
accepted = driver_decisions.accepted(job.run.state.read()["run"]["questions"], number, "review-stopped")
|
|
73
78
|
|
|
74
79
|
def call(role: str, entry: str) -> dict:
|
|
75
|
-
# A full review (no fix range) must give a mutation proof for each locked test file
|
|
80
|
+
# A full review (no fix range) must give a mutation proof for each locked test file, not for a locked fixture
|
|
81
|
+
# (#118); the prompt names them.
|
|
76
82
|
full = not job.previous and role == "reviewer"
|
|
77
83
|
notes = ["rereview"] if job.previous else ["full-review"] if full else []
|
|
78
84
|
notes += ["unchanged"] * (job.previous == job.tip) # a fixer with no commit: its reasons need a check
|
|
@@ -114,7 +120,7 @@ def _review(job: Job) -> list[dict]:
|
|
|
114
120
|
if job.ticket.risk:
|
|
115
121
|
cast.append(("correctness", driver_agents.correctness_entry(run.models)))
|
|
116
122
|
reports = run.read_only(number, job.slot, job.values["branch"], job.tip,
|
|
117
|
-
lambda: _run_reviewers(job, cast, state
|
|
123
|
+
lambda: _run_reviewers(job, cast, tested(state)))
|
|
118
124
|
for (role, _), report in zip(cast, reports):
|
|
119
125
|
found += _log_findings(job, [{**finding, "source": role} for finding in report["findings"]])
|
|
120
126
|
job.proofs |= {(proof["file"], proof["line"]) for proof in report.get("mutations", [])}
|
|
@@ -154,7 +160,8 @@ def _correct(job: Job, findings: list[dict]) -> list[dict]:
|
|
|
154
160
|
raise
|
|
155
161
|
job.tip, job.previous, job.corrected = driver_slots.head(job.slot), "", True
|
|
156
162
|
entry = run.state.read()["tickets"][number]
|
|
157
|
-
run.state.ticket(number, tip=job.tip, **driver_review.written(job.slot, entry, report["locked"],
|
|
163
|
+
run.state.ticket(number, tip=job.tip, **driver_review.written(job.slot, entry, report["locked"],
|
|
164
|
+
report.get("fixtures", []), job.tip))
|
|
158
165
|
return _uncorrected(job, findings, report.get("not_addressed", []))
|
|
159
166
|
|
|
160
167
|
|
|
@@ -131,7 +131,8 @@ def _proof_errors(report: dict, context: dict) -> list[str]:
|
|
|
131
131
|
|
|
132
132
|
|
|
133
133
|
def _locked_errors(report: dict, context: dict) -> list[str]:
|
|
134
|
-
"""In a full review, each locked test file has a mutation proof (`mutations[].test` is `<file>::<test>`).
|
|
134
|
+
"""In a full review, each locked test file has a mutation proof (`mutations[].test` is `<file>::<test>`).
|
|
135
|
+
`locked` names no fixture of the ticket: a fixture holds no test that a proof could name (#118)."""
|
|
135
136
|
if not context.get("full") or "findings" not in report:
|
|
136
137
|
return []
|
|
137
138
|
tests = [proof["test"] for proof in report.get("mutations", [])]
|
|
@@ -139,6 +140,12 @@ def _locked_errors(report: dict, context: dict) -> list[str]:
|
|
|
139
140
|
if not any(test.startswith(path) for test in tests)]
|
|
140
141
|
|
|
141
142
|
|
|
143
|
+
def _fixture_errors(report: dict) -> list[str]:
|
|
144
|
+
"""Each fixture of a test-writer report (a locked file that holds no test) is in its `locked`."""
|
|
145
|
+
return [f"fixtures: {path} is not in `locked`" for path in report.get("fixtures", [])
|
|
146
|
+
if path not in report.get("locked", [])]
|
|
147
|
+
|
|
148
|
+
|
|
142
149
|
def locked_files(listed: list[str]) -> list[str]:
|
|
143
150
|
"""The files of a `locked` list: a test node id `<file>::<test>` names its file. In order, each file once."""
|
|
144
151
|
return list(dict.fromkeys(entry.partition("::")[0] for entry in listed))
|
|
@@ -159,4 +166,4 @@ def validate(role: str, path: str, context: dict) -> list[str]:
|
|
|
159
166
|
report["locked"] = locked_files(report["locked"])
|
|
160
167
|
return (_commit_errors(report, context) + _owner_errors(report, context) + _unchanged_errors(report, context)
|
|
161
168
|
+ _correction_errors(report, context) + _merged_errors(report, context) + _proof_errors(report, context)
|
|
162
|
-
+ _locked_errors(report, context))
|
|
169
|
+
+ _locked_errors(report, context) + _fixture_errors(report))
|
|
@@ -80,17 +80,18 @@ def restore_locked(slot: str, entry: dict) -> list[str]:
|
|
|
80
80
|
return restored
|
|
81
81
|
|
|
82
82
|
|
|
83
|
-
def written(slot: str, entry: dict, listed: list[str], tip: str) -> dict:
|
|
84
|
-
"""The locked-file fields of the ticket record after a test-writer commit at `tip` that lists `listed
|
|
85
|
-
`tip` is the new reference. A locked file that a correction does not list and that differs
|
|
86
|
-
reference keeps the old one in `held`, so a change the implementer made before stays a finding."""
|
|
83
|
+
def written(slot: str, entry: dict, listed: list[str], fixtures: list[str], tip: str) -> dict:
|
|
84
|
+
"""The locked-file fields of the ticket record after a test-writer commit at `tip` that lists `listed`, of which
|
|
85
|
+
`fixtures` hold no test. `tip` is the new reference. A locked file that a correction does not list and that differs
|
|
86
|
+
from the old reference keeps the old one in `held`, so a change the implementer made before stays a finding."""
|
|
87
87
|
held = {path: sha for path, sha in entry["held"].items() if path not in listed}
|
|
88
88
|
others = [path for path in entry["locked"] if path not in listed and path not in held]
|
|
89
89
|
if entry["test_writer_sha"] and others:
|
|
90
90
|
diff = git(slot, "diff", "--name-only", "-z", entry["test_writer_sha"], tip, "--", *others)
|
|
91
91
|
# A diff that git cannot make holds each file.
|
|
92
92
|
held.update(dict.fromkeys(names(diff.stdout) if diff.returncode == 0 else others, entry["test_writer_sha"]))
|
|
93
|
-
return {"test_writer_sha": tip, "locked": list(dict.fromkeys(entry["locked"] + listed)), "held": held
|
|
93
|
+
return {"test_writer_sha": tip, "locked": list(dict.fromkeys(entry["locked"] + listed)), "held": held,
|
|
94
|
+
"fixtures": [path for path in entry["fixtures"] if path not in listed] + fixtures}
|
|
94
95
|
|
|
95
96
|
|
|
96
97
|
def route(findings: list[dict], locked: list[str], protected: list[str]) -> tuple[list[dict], list[dict]]:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
{"run": {revision, pr_branch, schema, gates, stops, agents: [{ticket, role, entry, seconds, cost}], questions, start,
|
|
4
4
|
landed: [[ticket, the PR tip its merge made]], final},
|
|
5
|
-
"tickets": {"NN": {phase, round, tip, test_writer_sha, locked, green_gates, slot, note, held}}}"""
|
|
5
|
+
"tickets": {"NN": {phase, round, tip, test_writer_sha, locked, fixtures, green_gates, slot, note, held}}}"""
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import fcntl
|
|
@@ -22,7 +22,8 @@ PHASES = ("pending", "test-writer", "implement", "gate", "review", "fix", "merge
|
|
|
22
22
|
|
|
23
23
|
def _ticket() -> dict:
|
|
24
24
|
return {"phase": "pending", "round": 0, "tip": None, "test_writer_sha": None, "locked": [], "green_gates": [],
|
|
25
|
-
"slot": None, "note": "", "held": {}
|
|
25
|
+
"slot": None, "note": "", "held": {},
|
|
26
|
+
"fixtures": []}
|
|
26
27
|
|
|
27
28
|
|
|
28
29
|
def _final() -> dict:
|
|
@@ -52,6 +53,9 @@ class State:
|
|
|
52
53
|
tickets = state.setdefault("tickets", {})
|
|
53
54
|
for number in numbers:
|
|
54
55
|
tickets.setdefault(number, _ticket())
|
|
56
|
+
for entry in tickets.values(): # a run of an older driver lacks the newer keys
|
|
57
|
+
for key, value in _ticket().items():
|
|
58
|
+
entry.setdefault(key, value)
|
|
55
59
|
return self.update(change)
|
|
56
60
|
|
|
57
61
|
def update(self, change) -> dict:
|
|
@@ -1,3 +1,3 @@
|
|
|
1
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.
|
|
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
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,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
This is a full review of {start_sha}: give one mutation proof or more for each of these locked test files: {
|
|
2
|
+
This is a full review of {start_sha}: give one mutation proof or more for each of these locked test files: {locked_tests}
|
|
@@ -26,7 +26,7 @@ Write one JSON report at {report}. When your sandbox is read-only, give the JSON
|
|
|
26
26
|
"files": {"type": "array", "items": {"type": "string"}},
|
|
27
27
|
"concerns": {"type": "array", "items": {"type": "string"}},
|
|
28
28
|
"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"]}}}},
|
|
29
|
-
"mutations": {"description": "Required in a full review: one proof or more for each locked test file, with `test` as `<locked file>::<test name>`. A review scoped to a fix gives the proofs that it names.", "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}}}}
|
|
29
|
+
"mutations": {"description": "Required in a full review: one proof or more for each locked test file that the end of this prompt names (a locked fixture holds no test and needs none), with `test` as `<locked file>::<test name>`. A review scoped to a fix gives the proofs that it names.", "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}}}}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
32
|
```
|
|
@@ -26,6 +26,7 @@ Write one JSON report at {report} that matches this schema:
|
|
|
26
26
|
"files": {"type": "array", "items": {"type": "string"}},
|
|
27
27
|
"concerns": {"type": "array", "items": {"type": "string"}},
|
|
28
28
|
"locked": {"type": "array", "items": {"type": "string"}},
|
|
29
|
+
"fixtures": {"description": "Each file of `locked` that holds no test, as a fake, a fixture or a helper: a review needs no mutation proof for it.", "type": "array", "items": {"type": "string"}},
|
|
29
30
|
"red": {"type": "array", "items": {"type": "object", "required": ["test", "line"], "properties": {"test": {"type": "string", "minLength": 1}, "line": {"type": "string", "minLength": 1}}}},
|
|
30
31
|
"not_addressed": {"type": "array", "items": {"type": "object", "required": ["finding", "reason"], "properties": {"finding": {"type": "string", "minLength": 1}, "reason": {"type": "string", "minLength": 1}}}}
|
|
31
32
|
},
|
|
@@ -293,15 +293,16 @@ def test_a_locked_file_keeps_its_old_reference_until_a_test_writer_lists_it(repo
|
|
|
293
293
|
old = commit("b.py", "1\n")
|
|
294
294
|
commit("b.py", "the implementer changed it\n")
|
|
295
295
|
tip = commit("a.py", "the correction\n")
|
|
296
|
-
first = driver_review.written(".", {"test_writer_sha": None, "locked": [], "held": {}
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
296
|
+
first = driver_review.written(".", {"test_writer_sha": None, "locked": [], "held": {}, "fixtures": []},
|
|
297
|
+
["a.py", "b.py", "c.py"], [], old)
|
|
298
|
+
assert first == {"test_writer_sha": old, "locked": ["a.py", "b.py", "c.py"], "held": {}, "fixtures": []}
|
|
299
|
+
after = driver_review.written(".", first, ["a.py"], [], tip)
|
|
300
|
+
assert after == {"test_writer_sha": tip, "locked": ["a.py", "b.py", "c.py"], "held": {"b.py": old}, "fixtures": []}
|
|
300
301
|
(finding,) = driver_review.locked_findings(".", after)
|
|
301
302
|
assert (finding["title"], finding["evidence"]) == ("locked file changed: b.py", f"git diff {old}..HEAD -- b.py")
|
|
302
|
-
assert driver_review.written(".", after, ["b.py"], tip)["held"] == {}, "the test-writer corrected it: a new reference"
|
|
303
|
+
assert driver_review.written(".", after, ["b.py"], [], tip)["held"] == {}, "the test-writer corrected it: a new reference"
|
|
303
304
|
# A diff that git cannot make holds each other file, and then the check of the review fails in the open.
|
|
304
|
-
lost = driver_review.written(".", {**first, "test_writer_sha": "0" * 40}, ["a.py"], tip)
|
|
305
|
+
lost = driver_review.written(".", {**first, "test_writer_sha": "0" * 40}, ["a.py"], [], tip)
|
|
305
306
|
assert lost["held"] == {"b.py": "0" * 40, "c.py": "0" * 40}
|
|
306
307
|
assert [f["title"].split(":")[0] for f in driver_review.locked_findings(".", lost)] == ["locked file check failed"]
|
|
307
308
|
|
|
@@ -767,6 +767,27 @@ def test_a_full_review_after_a_correction_names_each_locked_file_that_needs_a_pr
|
|
|
767
767
|
assert "In round 1" not in full and due not in again
|
|
768
768
|
|
|
769
769
|
|
|
770
|
+
def test_a_full_review_needs_no_proof_for_a_locked_fixture_that_holds_no_test(tmp_path):
|
|
771
|
+
"""Issue #118: a fake `gh` the test-writer locks holds no test, so no `<locked file>::<test name>` can name it."""
|
|
772
|
+
first = {**tw("01"), "files": {"tests/test_01.py": "def test_x():\n assert 0\n", "tests/fakes/gh": "exit 0\n"}}
|
|
773
|
+
first["report"] = {**first["report"], "files": ["tests/test_01.py", "tests/fakes/gh"],
|
|
774
|
+
"locked": ["tests/test_01.py", "tests/fakes/gh"], "fixtures": ["tests/fakes/gh"]}
|
|
775
|
+
rig = Inside(tmp_path).run(plan(**{"01/test-writer": [first], "01/reviewer": [review("01")]}))
|
|
776
|
+
assert rig.code == 0 and len(rig.calls("01", "reviewer")) == 1, rig.ledger()
|
|
777
|
+
assert rig.state()["tickets"]["01"]["fixtures"] == ["tests/fakes/gh"]
|
|
778
|
+
assert "for each of these locked test files: tests/test_01.py\n" in rig.calls("01", "reviewer")[0]["prompt"]
|
|
779
|
+
|
|
780
|
+
|
|
781
|
+
def test_a_fixture_must_be_a_locked_file_and_a_correction_that_relists_it_decides_again(tmp_path):
|
|
782
|
+
report = dict(status="NEEDS_CONTEXT", commits=[], files=[], concerns=[], locked=["a"], red=[], fixtures=["gh"])
|
|
783
|
+
path = tmp_path / "test-writer-0.json"
|
|
784
|
+
path.write_text(json.dumps(report))
|
|
785
|
+
context = {"repo": ".", "branch": "HEAD", "start": "HEAD", "log": str(path)}
|
|
786
|
+
assert "fixtures: gh is not in `locked`" in driver_report.validate("test-writer", str(path), context)
|
|
787
|
+
entry = {"test_writer_sha": None, "locked": ["tests/a.py", "gh", "fake"], "held": {}, "fixtures": ["gh", "fake"]}
|
|
788
|
+
assert driver_review.written(".", entry, ["gh"], [], "tip")["fixtures"] == ["fake"]
|
|
789
|
+
|
|
790
|
+
|
|
770
791
|
def test_the_locked_file_rule_is_for_the_first_review_only(tmp_path):
|
|
771
792
|
report = dict(status="DONE", commits=[], files=[], concerns=[], findings=[], mutations=[])
|
|
772
793
|
path = tmp_path / "reviewer-0.json"
|
|
@@ -30,12 +30,14 @@ def test_updates_from_many_threads_are_all_kept_and_no_scratch_file_stays(tmp_pa
|
|
|
30
30
|
def test_start_keeps_a_recorded_run_and_adds_only_the_new_tickets(tmp_path):
|
|
31
31
|
state = driver_state.State(tmp_path / "state.json")
|
|
32
32
|
revision = state.start("feat/x", ["01"])["run"]["revision"]
|
|
33
|
+
state.update(lambda record: record["tickets"]["01"].pop("fixtures")) # a run of an older driver
|
|
33
34
|
state.ticket("01", phase="merged")
|
|
34
35
|
again = state.start("other", ["01", "02"])
|
|
35
36
|
assert (again["run"]["revision"], again["run"]["pr_branch"]) == (revision, "feat/x")
|
|
36
|
-
assert again["tickets"]["01"]["phase"] == "merged" and again["tickets"]["
|
|
37
|
+
assert again["tickets"]["01"]["phase"] == "merged" and again["tickets"]["01"]["fixtures"] == []
|
|
38
|
+
assert again["tickets"]["02"] == {
|
|
37
39
|
"phase": "pending", "round": 0, "tip": None, "test_writer_sha": None, "locked": [], "green_gates": [], "slot": None,
|
|
38
|
-
"note": "", "held": {}}
|
|
40
|
+
"note": "", "held": {}, "fixtures": []}
|
|
39
41
|
|
|
40
42
|
|
|
41
43
|
def test_verified_trusts_a_tip_only_while_it_is_on_the_ticket_branch(repo, tmp_path):
|
package/skills-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"generatedAt": "2026-10-20T15:
|
|
3
|
+
"generatedAt": "2026-10-20T15:57:25.481Z",
|
|
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.33",
|
|
50
|
+
"hash": "sha256-f5d4bb64baedc840c40253138ece3c8781424ebf7619447b2e10858888a93c7c",
|
|
51
51
|
"description": "Implement a specification in code."
|
|
52
52
|
},
|
|
53
53
|
{
|