@mjasnikovs/pi-task 0.16.1 → 0.16.3
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 +6 -5
- package/dist/task/verify-work.js +41 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
[](https://www.npmjs.com/package/@mjasnikovs/pi-task)
|
|
10
10
|
[](./LICENSE)
|
|
11
11
|
[](https://www.npmjs.com/package/@earendil-works/pi-coding-agent)
|
|
12
|
-
[](#development)
|
|
13
13
|
[](./tsconfig.json)
|
|
14
14
|
|
|
15
15
|
</div>
|
|
@@ -36,7 +36,7 @@ Every phase boundary is written to `.pi-tasks/TASK_NNNN.md`, so a task survives
|
|
|
36
36
|
pi install npm:@mjasnikovs/pi-task
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
> Requires [`pi`](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) (the Earendil coding agent) ≥ 0.
|
|
39
|
+
> Requires [`pi`](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) (the Earendil coding agent) ≥ 0.80.
|
|
40
40
|
|
|
41
41
|
## Slash commands
|
|
42
42
|
|
|
@@ -49,7 +49,7 @@ pi install npm:@mjasnikovs/pi-task
|
|
|
49
49
|
| `/task-auto <feature>` | Plan a feature into a task list and run each title through `/task` in order (resumable). |
|
|
50
50
|
| `/task-auto-resume` | Resume the active `/task-auto` run at the next unfinished task. |
|
|
51
51
|
| `/task-auto-cancel` | Stop the `/task-auto` loop after the current task (still resumable). |
|
|
52
|
-
| `/task-config` | Toggle pi-task settings in an editor dialog: remote server, compress reasoning, auto-commit, orientation, and enforce guidelines. |
|
|
52
|
+
| `/task-config` | Toggle pi-task settings in an editor dialog: remote server, compress reasoning, auto-commit, orientation, verify work, and enforce guidelines. |
|
|
53
53
|
| `/remote` | Show the QR code & URLs for the web view (`/remote stop` to stop). Answer grill questions, start tasks, and watch progress from your phone. |
|
|
54
54
|
|
|
55
55
|
## The pipeline
|
|
@@ -148,7 +148,8 @@ Run `/task-config` to toggle pi-task's behavior in an editor dialog. Settings pe
|
|
|
148
148
|
| **compress reasoning** | After each message, compresses the model's `<think>` blocks down to the decisions/constraints/facts that matter later — keeping long local-model runs from drowning their own context in self-talk. |
|
|
149
149
|
| **auto-commit** | Snapshots the working tree into one git commit per `/task-auto` sub-task (see above). |
|
|
150
150
|
| **orientation** | Pre-reads the project's core files (manifest, config, domain types, schema, entrypoints, API surface) once and hands the contents to the read-heavy research workers, so they skip re-discovering the same files cold. Bounded by a hard byte budget; applied only where it helps (FILES/APIS workers). |
|
|
151
|
-
| **
|
|
151
|
+
| **verify work** _(off by default)_ | After a `/task-auto` task implements — but **before** it's checked off or committed — actually **runs** the spec's own `VERIFY` block in the real workspace. pi-task otherwise only _authors_ a VERIFY block and never executes it, so a task that doesn't build is indistinguishable from one that works. A fresh `read` + `bash` child of the same local model runs the declared check, observes the real output, and reports **PASS/FAIL** (a legitimately no-op VERIFY is a PASS). On FAIL the run doesn't dead-stop: you get a boxed picker — **Autofix** (re-run the implementation turn against the failure, then re-verify; no attempt cap) or **Accept** (override a misjudged artifact) — and dismissing it pauses the run, resumable. A genuine clean pass is also the behavioral signal that lets **enforce guidelines** fix in place (see below). Adds one extra local-model pass per task, so it's opt-in. |
|
|
152
|
+
| **enforce guidelines** _(off by default)_ | After each `/task-auto` task is committed, re-checks that commit's work against the project's `AGENTS.md` / `CLAUDE.md` (in the working directory). A bare fix-in-place pass trashes working code (A/B-proven), so enforcement is gated on the **verify work** signal. **With** a genuine verify pass: a fresh `read` + `edit` child of the same local model reads the **last commit's** diff and fixes violations in place; its fixes are committed **separately** as an `ENFORCE GUIDELINES` commit, then the verify signal is re-run against the enforced tree — a regression **reverts** the enforce commit and keeps the verified work. **Without** that signal (verify off, no spec, or an accept-override): the pass runs read-only and only **reports** violations, never rewrites logic. Either way a violation it can't clear (or a pass that can't run) only **warns** — the task commit already landed, so the run continues. Skipped when nothing was committed for the task. |
|
|
152
153
|
|
|
153
154
|
## Configuration
|
|
154
155
|
|
|
@@ -167,7 +168,7 @@ Tasks are persisted to `<cwd>/.pi-tasks/TASK_NNNN.md`. Add `.pi-tasks/` to your
|
|
|
167
168
|
|
|
168
169
|
```sh
|
|
169
170
|
bun install
|
|
170
|
-
bun test src/ #
|
|
171
|
+
bun test src/ # 916 tests across 65 files
|
|
171
172
|
bun run lint # prettier + eslint + tsc --noEmit
|
|
172
173
|
bun run build # tsc → dist/
|
|
173
174
|
```
|
package/dist/task/verify-work.js
CHANGED
|
@@ -17,6 +17,18 @@
|
|
|
17
17
|
* PASS / FAIL verdict. If the spec's VERIFY is legitimately a no-op (config-only
|
|
18
18
|
* change, re-read of a file), the model says so and that is a PASS.
|
|
19
19
|
*
|
|
20
|
+
* It must verify the REAL deliverable, not a stand-in. The spec's VERIFY block is
|
|
21
|
+
* authored by the same weak model that did the work, so it frequently grades a
|
|
22
|
+
* SIMULATION it controls: it reconstructs the build in a scratch dir, compiles with
|
|
23
|
+
* options the project does not ship, or only greps the SOURCE for a string — all of
|
|
24
|
+
* which pass while the project's own build ships broken output. The prompt therefore
|
|
25
|
+
* anchors the child to the project's OWN build/run command and the artifact it SHIPS,
|
|
26
|
+
* treats source-text presence as insufficient (a build artifact that still contains an
|
|
27
|
+
* un-processed source directive means the build never ran), and treats "I had to add a
|
|
28
|
+
* dependency/flag/config the project lacks to make it pass" as the defect itself.
|
|
29
|
+
* A/B-proven on the live local model: the old prompt false-passed 3/3 on a
|
|
30
|
+
* broken-pipeline fixture; the anchored prompt caught it 3/3, naming the real defect.
|
|
31
|
+
*
|
|
20
32
|
* It runs as a GATE right after the implementation turn, BEFORE the task is
|
|
21
33
|
* checked off or committed. A FAIL stops the /task-auto run exactly like an
|
|
22
34
|
* implementation failure: the task is left unchecked and uncommitted so
|
|
@@ -94,24 +106,37 @@ export function buildVerifyPrompt(spec) {
|
|
|
94
106
|
'THE TASK SPEC (its ACCEPTANCE criteria and VERIFY block are the contract):',
|
|
95
107
|
spec.trim(),
|
|
96
108
|
'',
|
|
97
|
-
'How to verify:',
|
|
98
|
-
"1. Run the
|
|
99
|
-
'
|
|
100
|
-
'
|
|
101
|
-
'
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
105
|
-
'
|
|
106
|
-
|
|
107
|
-
'
|
|
108
|
-
'
|
|
109
|
-
' that
|
|
110
|
-
'
|
|
109
|
+
'How to verify — verify the REAL deliverable, not a stand-in:',
|
|
110
|
+
"1. Run the project's OWN build/run/serve command — the one it actually ships",
|
|
111
|
+
' (the scripts in package.json, the command the spec names). Run it exactly as',
|
|
112
|
+
' the project defines it, then inspect the artifact it PRODUCES. Also run the',
|
|
113
|
+
" spec's VERIFY block — but the project's real build/output is the bar.",
|
|
114
|
+
'2. NEVER substitute your own build, compile step, plugin, flag, scratch transform,',
|
|
115
|
+
' or config to make a check pass. If the VERIFY block reconstructs the output in',
|
|
116
|
+
' a temp/scratch dir, builds with options the project does not use, or only greps',
|
|
117
|
+
' the SOURCE for a string, that is INSUFFICIENT — it proves the code *could* work,',
|
|
118
|
+
" not that the shipping pipeline *does*. You must still run the project's real",
|
|
119
|
+
' build and judge its real output.',
|
|
120
|
+
'3. If, to make any check pass, you find you must add an import, plugin, flag, or',
|
|
121
|
+
' config the project itself does not have, STOP: that missing piece IS the defect.',
|
|
122
|
+
' Report FAIL and name exactly what the project is missing.',
|
|
123
|
+
'4. Presence of a token/directive/string in a SOURCE file is NOT verification. Judge',
|
|
124
|
+
' the produced/shipped artifact and the actual runtime behavior. (A build directive',
|
|
125
|
+
' belongs in the source; if that same raw directive SURVIVES into the built output,',
|
|
126
|
+
' the build did not run — that is a FAIL, not a PASS.)',
|
|
127
|
+
'5. Treat the ACCEPTANCE criteria as the bar. If a VERIFY command fails, or its',
|
|
128
|
+
' output (or the real build output) contradicts an ACCEPTANCE criterion, the work',
|
|
129
|
+
' has NOT verified.',
|
|
130
|
+
'6. If a check depends on something this environment genuinely lacks (a service, a',
|
|
131
|
+
' network resource) and that is clearly an environment gap rather than a defect in',
|
|
132
|
+
' the code, note it and judge the rest. Do not fail for a missing external service.',
|
|
133
|
+
'7. If the spec legitimately has no runnable verification (a pure docs/config change',
|
|
134
|
+
' with nothing to build or run), validating it cleanly is a PASS.',
|
|
135
|
+
'8. Do NOT edit anything to make a check pass. Report what you actually saw.',
|
|
111
136
|
'',
|
|
112
137
|
'When you are done, output EXACTLY ONE of these as the final line:',
|
|
113
|
-
' WORK-VERIFIED: PASS (
|
|
114
|
-
' WORK-VERIFIED: FAIL <text> (
|
|
138
|
+
' WORK-VERIFIED: PASS (the real build/run produced an artifact that meets the spec)',
|
|
139
|
+
' WORK-VERIFIED: FAIL <text> (the real build/output failed or does not meet the spec; say what failed)',
|
|
115
140
|
'Output the verdict line verbatim — it is parsed mechanically.'
|
|
116
141
|
].join('\n');
|
|
117
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mjasnikovs/pi-task",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.3",
|
|
4
4
|
"description": "Deterministic spec-orchestration for local models, with a bundled real-time remote web view and web/docs/fetch/worker subagent tools.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|