@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
package/README.md
CHANGED
|
@@ -18,8 +18,9 @@ pnpm check
|
|
|
18
18
|
virtual environment is active. Otherwise they use `python3` from your PATH.
|
|
19
19
|
|
|
20
20
|
`pnpm check:fast [file…]` is the fast gate: the type check, then the given
|
|
21
|
-
test files (default: `IMPLEMENT_SPEC_LOCKED`), each
|
|
22
|
-
and the
|
|
21
|
+
test files (default: `IMPLEMENT_SPEC_LOCKED`), each `test_*.py` or `*_test.py` in its own
|
|
22
|
+
pytest run and the `*.test.ts` files in one vitest run; other files, such as fixtures, are
|
|
23
|
+
skipped. implement-spec takes it as `--fast-gate`.
|
|
23
24
|
|
|
24
25
|
## Install skills
|
|
25
26
|
|
package/package.json
CHANGED
|
@@ -13,12 +13,14 @@ A comment in the code is for a line that looks wrong or removable without it.
|
|
|
13
13
|
| `driver.py` | The command line, the checks before the first agent, the walk of the ticket graph, one ticket from its phase to merged or blocked, the landing on the PR branch, the exit code |
|
|
14
14
|
| `driver_run.py` | `Run` (what all ticket threads share), one agent with its one rerun, the gate call, the ledger, `Blocked` |
|
|
15
15
|
| `driver_fixloop.py` | A gated ticket tip in, a reviewed tip out: review, test-writer correction, fix rounds |
|
|
16
|
+
| `driver_dispute.py` | A disputed locked test: the arbitration, its correction, the once-per-file record, `spec-ambiguous` |
|
|
16
17
|
| `driver_final.py` | The end of run: tidy, rebase, gate, final review, one fix batch, push |
|
|
17
18
|
| `driver_tickets.py`, `driver_graph.py` | Ticket files in, tickets or errors out; which tickets can start now |
|
|
18
19
|
| `driver_agents.py` | Model entries, the CLI command of each provider, prompt templates, the blocking launch |
|
|
19
20
|
| `driver_report.py` | Validation of one agent report against its schema, git and the agent's log |
|
|
20
|
-
| `
|
|
21
|
-
| `
|
|
21
|
+
| `driver_locked.py` | The one locked-file rule: which files are locked, the baseline of each agent and of the landing, the diff that finds a change |
|
|
22
|
+
| `driver_review.py` | The routing of findings; the slot and the shared git config that a read-only role must leave as they were |
|
|
23
|
+
| `driver_merge.py` | Merges by git plumbing, the move of the PR ref |
|
|
22
24
|
| `driver_gate.py` | One gate of a commit: the command, once more when a signal ended it, and its record |
|
|
23
25
|
| `driver_slots.py` | The worktrees that tickets run in, and the `git` helper |
|
|
24
26
|
| `driver_state.py` | `state.json` (the resume contract) and the kernel lock |
|
|
@@ -27,8 +29,8 @@ A comment in the code is for a line that looks wrong or removable without it.
|
|
|
27
29
|
| `driver_decisions.py`, `driver_answers.py`, `driver_review_page.py` | Operator questions, their answers, the page that shows them |
|
|
28
30
|
| `driver_tidy.py`, `driver_summary.py` | The history with one commit per ticket; `summary.md` |
|
|
29
31
|
|
|
30
|
-
`driver.py`, `driver_fixloop.py` and `driver_final.py` decide what comes next. The other modules do one thing
|
|
31
|
-
and do not know about the run, except `driver_run.py`, which the
|
|
32
|
+
`driver.py`, `driver_fixloop.py`, `driver_dispute.py` and `driver_final.py` decide what comes next. The other modules do one thing
|
|
33
|
+
and do not know about the run, except `driver_run.py`, which the deciding modules share.
|
|
32
34
|
|
|
33
35
|
## Conventions
|
|
34
36
|
|
|
@@ -55,36 +57,40 @@ and do not know about the run, except `driver_run.py`, which the three deciding
|
|
|
55
57
|
- The driver writes no prose of its own into a prompt: a prompt is a template with its pointers filled. The same
|
|
56
58
|
holds for each title, question and ruling in `driver_decisions.py`.
|
|
57
59
|
- The ledger is written only by the driver, and the driver reads no fact from it.
|
|
58
|
-
- A check that git cannot do is a failed check, never a passed one (`
|
|
60
|
+
- A check that git cannot do is a failed check, never a passed one (`driver_locked.errors`).
|
|
59
61
|
|
|
60
62
|
### Locked tests
|
|
61
63
|
|
|
62
|
-
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
(`
|
|
87
|
-
|
|
64
|
+
- `driver_locked` is the one place of the locked-file rule: which files are locked (`every`, `others`), the
|
|
65
|
+
baseline of each agent (`for_ticket`, `for_end_of_run`, `landing_errors`) and the diff. `driver_report.validate`
|
|
66
|
+
calls `driver_locked.errors` once, with the `Locked` check that `_attempts` reads when the agent ends: the
|
|
67
|
+
`Call`'s own `locked`, else that of a ticket agent.
|
|
68
|
+
- Only the test-writer changes a locked file, and it lists each one it changes in `locked`, of its own ticket or of
|
|
69
|
+
another (`driver_locked._unlisted_errors`, `driver_report._correction_errors`). A correction may change only the
|
|
70
|
+
files it lists. Its commit becomes the baseline of the ticket's own locked files (`driver_locked.written`).
|
|
71
|
+
- After the implementer, a fixer and the ticket conflict agent, the driver checks the locked files with a diff
|
|
72
|
+
(`driver_locked._own_errors`, `_others_errors`): the ticket's own
|
|
73
|
+
against its last test-writer commit, every other ticket's whose test-writer has run, merged or not, against the
|
|
74
|
+
merge base of the ticket branch and the PR tip. Another ticket's file as the PR tip has it is no change; the
|
|
75
|
+
ticket's own when it is the clean three-way merge (`git merge-file`) of its test-writer's version and the PR tip's,
|
|
76
|
+
from their merge base, so a conflict merge takes in what landed and keeps the test-writer's tests, and no role can
|
|
77
|
+
put the file back to the PR tip's version. The baseline is stateless, so a breach left on the tip by a rejected rerun is found again after a `retry`. A changed locked file
|
|
78
|
+
rejects the report naming the file, so the rerun on the next entry and `ticket-blocked` apply as to any rejection.
|
|
79
|
+
- At landing, under the merge lock and before the full gate, `driver._refuse_breach` compares the commit that
|
|
80
|
+
would land with the PR tip on every other ticket's locked files (but those the ticket lists as its own,
|
|
81
|
+
`driver_locked.landing_errors`): a change, or a git error, blocks the ticket with one `ticket-blocked` question
|
|
82
|
+
and the PR branch does not move. Its `retry` resumes at `implement`, whose check then names the file.
|
|
83
|
+
- The reviewer gets the diff of each locked file of another ticket that the ticket changed
|
|
84
|
+
(`driver_locked.changed_elsewhere`, `prompts/elsewhere.md`): only the test-writer can have made it, and the
|
|
85
|
+
reviewer judges it against the spec. A review finding on such a file goes to a correction, since a fixer may not
|
|
86
|
+
change it (issue #116).
|
|
87
|
+
- The final fixer and the rebase conflict agent get the same check over every ticket's locked files
|
|
88
|
+
(`driver_locked.for_end_of_run`): against the tidied tip, or for the rebase that makes it, the recovery point. When
|
|
89
|
+
the rebase conflict agent ends, the driver goes on with the rebase it left open (`driver_final._rebase_check`, the
|
|
90
|
+
`locked` of its `Call`), so the check reads the
|
|
91
|
+
rebased tip, and a rejected agent's rerun amends that tip. A `git rebase --continue` that fails at the same stop
|
|
92
|
+
rejects the report with git's error, so the agent reruns on the open rebase. A rebase that stops at a later conflict is checked by
|
|
93
|
+
nobody, as the driver aborts it. The final review has no locked-file findings of the driver.
|
|
88
94
|
|
|
89
95
|
### The PR branch
|
|
90
96
|
|
|
@@ -103,7 +109,7 @@ and do not know about the run, except `driver_run.py`, which the three deciding
|
|
|
103
109
|
### Work is never dropped
|
|
104
110
|
|
|
105
111
|
- A role that commits keeps its tree after a timeout or an interrupt; its rerun continues from it.
|
|
106
|
-
- A read-only role (reviewer,
|
|
112
|
+
- A read-only role (reviewer, final-reviewer, the final lenses, pr-writer) has no work to keep. When it changes its slot or
|
|
107
113
|
the shared git config, the driver restores them and runs the review one more time (`Run.read_only`). The config is
|
|
108
114
|
the keys of that file before the role (`driver_review.shared_config`): every worktree reads that one file, so a key a
|
|
109
115
|
role writes there, such as a `core.worktree` on a temp directory, breaks git in all of them. Other sessions write
|
|
@@ -133,43 +139,85 @@ and do not know about the run, except `driver_run.py`, which the three deciding
|
|
|
133
139
|
an agent is reaped, the run stops. No group gets a signal after its leader is reaped.
|
|
134
140
|
- A role gets one rerun. The rerun prompt is the first prompt, the rejection, then the same ending again.
|
|
135
141
|
A timeout doubles the time of the rerun.
|
|
136
|
-
- Fix rounds stop at 2, and round 2 goes to the next implementer entry.
|
|
137
|
-
|
|
142
|
+
- Fix rounds stop at 2, and round 2 goes to the next implementer entry.
|
|
143
|
+
- A ticket review runs one agent, the reviewer. Its prompt carries the ticket's Risk line as one more criterion
|
|
144
|
+
(`driver._risk`), so a risk that the diff does not handle is an unmet criterion under the usual round and cap rules.
|
|
145
|
+
- A `--models` file may name only the roles of the skill's `models.json` (`driver_agents.load_models`): a removed
|
|
146
|
+
role (`correctness`, `explorer`) or an unknown one stops the run before the preflight.
|
|
147
|
+
- The full final review is three lens roles, `final-spec`, `final-correctness` and `final-structure`, with no model
|
|
148
|
+
list. `driver_agents.LENSES` is the one table of a lens: the `source` of its findings, the method file it follows,
|
|
149
|
+
whether its lines of the one lens prompt `prompts/final-lens.md` inline that file, and whether it runs on another
|
|
150
|
+
provider. Its lines are `prompts/lens-<source>.md`, with `prompts/lens-copy.md` as `{copy}`. The entry, the
|
|
151
|
+
prompt values (`driver_final._lens_values`), the precondition errors and the source tags read it, and `TIMEOUTS` and
|
|
152
|
+
`READ_ONLY` take its roles. `driver_agents.lens_entries` takes the entries from `final-reviewer`, and
|
|
153
|
+
`other_provider_entries` keeps a lens, its rerun too, on another provider than the first implementer entry;
|
|
154
|
+
`load_models` refuses a list with none. `driver_final._run_lenses` runs them at the same time in slot 1 inside one
|
|
155
|
+
`Run.read_only`, so a lens that changes the slot makes all three run again. A lens that stops or is rejected
|
|
156
|
+
twice stops the round only after every lens has ended, with one `final-ticket-blocked` question for each such lens
|
|
157
|
+
(`Run.ask` adds them to one stop); an accepted lens report is kept in `run.final.lenses` with
|
|
158
|
+
its tip and reused for that tip only. `driver_final._merged` makes the (file, line, title) of a finding unique,
|
|
159
|
+
keeping the more severe one, then the earlier lens; must-fix matching keeps its own (file, title) key. The
|
|
160
|
+
findings of the scoped review get the source `final-reviewer`; a findings file of an older driver, with no
|
|
161
|
+
`source`, is read only by the scoped review agent. The lens reports go to
|
|
162
|
+
`run.final.lenses` only once `Run.read_only` returns, so a report of a slot that a lens changed is never kept.
|
|
163
|
+
- The scoped review after the fix batch is one `final-reviewer` agent on `other_provider_entries`, never the three
|
|
164
|
+
lenses again. Each finding it leaves open asks one `final-ticket-blocked` question (`driver_final._settle_review`);
|
|
165
|
+
only a `retry` runs another fix batch and scoped review, and `edit` keeps the end of run BLOCKED
|
|
166
|
+
(`driver_final._parked`).
|
|
138
167
|
- A red gate on the implementer's or a fixer's commit is a finding of the next round (`driver_fixloop._gate`), so
|
|
139
168
|
it blocks after round 2. A red gate on a test-writer correction blocks.
|
|
140
169
|
- The implementer and each fixer get the `--gate` command and run it before they report. The gate of the driver
|
|
141
170
|
stays the source of truth: an agent's run of the gate counts for nothing.
|
|
142
171
|
- A finding that a correction reports in `not_addressed` goes to the fixer of the same round as kind `code`
|
|
143
|
-
(`driver_fixloop.
|
|
172
|
+
(`driver_fixloop._uncorrected` rewrites it in the findings file): the test needs a production change first, so a
|
|
144
173
|
second correction could not close it.
|
|
174
|
+
- Every test-writer correction, after a `test-wrong` ruling, a review finding or a `correct-test` answer, is one
|
|
175
|
+
`driver_dispute.correct`: it runs the test-writer on the findings it is given, makes its commit the baseline,
|
|
176
|
+
keeps the reading of each file it corrected in `corrected` (none after an answer) and logs one line per finding.
|
|
177
|
+
The callers differ only by the findings and the readings they pass.
|
|
145
178
|
- No test-writer correction runs after round 2 (`driver_fixloop._act_on`): a red gate or an unmet criterion blocks
|
|
146
179
|
the ticket. Other open findings go to the final must-fix list when the gate is green. A correction at the cap
|
|
147
180
|
would add locked tests that no fix round could make green.
|
|
148
|
-
- A
|
|
149
|
-
|
|
150
|
-
`
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
-
|
|
159
|
-
|
|
160
|
-
|
|
181
|
+
- A locked file is arbitrated once and corrected once per ticket. The ticket record keeps them in `disputes` and
|
|
182
|
+
`corrected`, keyed by the file (the part of a test id before `::`, resolved against the ticket's `locked` by
|
|
183
|
+
`driver_report._locked_file`), so a renamed or parametrized test cannot dodge the rule. Only `driver_dispute._settle`
|
|
184
|
+
and `driver_dispute.correct` write them; no answer does, so no answer resets them. A second dispute or a second
|
|
185
|
+
correction asks `spec-ambiguous` (`driver_dispute.ambiguous`); its evidence file is the findings file a
|
|
186
|
+
`correct-test` correction reads (`driver_dispute.correct_as_answered`), and its files are the ones `keep-test` closes for later
|
|
187
|
+
reviews (`driver_dispute.kept_files`, `driver_fixloop._still_to_correct`).
|
|
188
|
+
- `driver_run._attempts` treats a stop (BLOCKED or NEEDS_CONTEXT, not a dispute of a locked test) of any agent
|
|
189
|
+
as a rejected attempt: the rerun runs on the next entry of the role's list (`_rerun_entry`; the ticket fixer's list
|
|
190
|
+
is the implementer's), with the concerns or the driver's error in its prompt. A second stop or rejection asks a
|
|
191
|
+
`ticket-blocked` question (`_ask_blocked`); its `retry` sets the `resume` the question holds (`retry_point`), and the
|
|
192
|
+
stop of a fixer sets the round back by one, so the same round runs again after a review. The end of run asks the
|
|
193
|
+
same kind with the ticket `final` (`final-ticket-blocked-<n>`), whose `resume` is the phase `pending` of `run.final`;
|
|
194
|
+
the end of run goes on from its state once that phase is `pending` again. An agent that runs for another
|
|
195
|
+
role (an arbitration, a dispute's correction, a review correction) passes that role as `retry`: its `retry` runs that
|
|
196
|
+
role again from the commit the agent started on, so its own work is not kept.
|
|
197
|
+
- A dispute (an implementer or a fixer that reports BLOCKED with `locked test contradicts spec: <file>::<test>:
|
|
198
|
+
<reason>`) is the one stop that `driver_run._stop` accepts, and only from a `Call` with `may_dispute`, which only
|
|
199
|
+
`driver_dispute.agent` sets: it runs the implementer and each ticket fixer and reads the accepted report's
|
|
200
|
+
disputes (`driver_report.disputes`). The reviewer arbitrates with `prompts/arbitration.md` in `Run.read_only` (not a fix round), a test ruled
|
|
201
|
+
`test-wrong` gets one correction, and the role runs again from the tip in the same round, with the ticket's rulings
|
|
202
|
+
in `prompts/ruled.md`. `driver_report._dispute_errors` rejects a dispute that names no locked file of the ticket or
|
|
203
|
+
leaves uncommitted changes: the arbitration is read-only and the correction commits.
|
|
161
204
|
- An implementer or a fixer with nothing to change reports DONE with no commit (`driver_report._unchanged_errors`):
|
|
162
205
|
the branch did not move, the tree is clean, and a concern says why. The driver gates and reviews that tip as it
|
|
163
206
|
would a new one.
|
|
164
|
-
- The correctness prompt carries the checks of `review-diff` (`driver_review.checks`): the pass reads files only
|
|
165
|
-
from git at the tip and from `.agent/`, and a project-local install sits in an ignored directory.
|
|
166
207
|
|
|
167
208
|
### Questions
|
|
168
209
|
|
|
169
|
-
- A stop is a bounded question in `state.json`. Only `driver_decisions.stop` adds one
|
|
170
|
-
|
|
210
|
+
- A stop is a bounded question in `state.json`. Only `driver_decisions.stop` adds one, through `Run.block`, the one
|
|
211
|
+
path that blocks a ticket or the end of run: it makes the record (`driver_run.record_of`, a ticket's or `run.final`)
|
|
212
|
+
BLOCKED, gives it the tip and the round of the question's `Resume`, and adds the questions. An answer that goes on
|
|
213
|
+
sets the record's fields in one write: the whole `resume` for `retry` and `keep-test`, the option's own fields for
|
|
214
|
+
`correct-test`. The end of run is recorded BLOCKED only at a question; with none, the next run tries it again.
|
|
215
|
+
An answered question is never open again.
|
|
171
216
|
- An open question of a merged ticket is dropped (`driver_decisions.drop_merged`), at the start of a run and after
|
|
172
217
|
each landing, with a ledger line: a ticket the operator set to `merge` by hand leaves its stop behind.
|
|
173
218
|
- An answers file counts only when it is bound to the revision of the current `decisions.json`.
|
|
174
|
-
-
|
|
175
|
-
|
|
219
|
+
- An answered question keeps its ruling sentence in `ruling`, so the PR body never looks up the kind of an answered
|
|
220
|
+
question. `driver_legacy.resume` stops a run before schema 4 that has an open question of a removed kind (exit 3),
|
|
221
|
+
and gives each answered question of such a run its `ruling`.
|
|
222
|
+
- An open question gives exit 2. A third round of the final review starts only after a `retry` of
|
|
223
|
+
a `final-ticket-blocked` question of an open finding.
|