@gonrocca/zero-pi 0.1.5 → 0.1.7

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 CHANGED
@@ -46,6 +46,16 @@ Run it with the `/forge <feature>` prompt. The orchestrator drives phase order
46
46
  and enforces a hard build/veredicto iteration cap. Each phase has its own prompt
47
47
  under `prompts/phases/` so it can be delegated to a dedicated sub-agent.
48
48
 
49
+ **Review Workload Forecast** — the plan phase keeps tasks reviewable. Every
50
+ planned task carries a `review: ~N changed lines` estimate, and `tasks.md` gains
51
+ a `## Review Workload` section with the per-task estimates and a bold run total.
52
+ Tasks are sized against a fixed budget of **400 changed lines per task** — an
53
+ internal, non-configurable default (borrowed from gentle-ai), so "small task"
54
+ means the same number on every run. A task whose estimate exceeds the budget is
55
+ split into smaller, individually verifiable tasks; one that genuinely cannot be
56
+ split stays whole and is recorded as an over-budget exception with a reason. The
57
+ orchestrator's plan-phase summary reports the run total and any exceptions.
58
+
49
59
  ### Per-phase models (`/zero-models`)
50
60
 
51
61
  `/zero-models` is a real pi command — a code handler, not an LLM prompt — for
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gonrocca/zero-pi",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "zero-pi — an installable layer for pi (pi.dev): the zero spec-driven development workflow, skill auto-learning, and an animated ZERO startup banner. Adds capability to pi without modifying pi.",
5
5
  "type": "module",
6
6
  "keywords": [
package/prompts/forge.md CHANGED
@@ -4,6 +4,17 @@ description: Run an automatic spec-driven development pipeline for a feature req
4
4
 
5
5
  Run the zero SDD pipeline for the feature request in the arguments.
6
6
 
7
+ **Parse the arguments first.** If the arguments start with `--continue`, this is
8
+ a **resume** run, not a fresh one:
9
+
10
+ - `--continue` with no slug → resume mode: hand control to the orchestrator's
11
+ `## Resuming a run` section, which scans `.sdd/*/` for an unfinished run.
12
+ - `--continue <slug>` → resume mode targeting `.sdd/<slug>/` directly. If that
13
+ directory does not exist, report "no such run: <slug>" and stop — do **not**
14
+ start a fresh run under that slug.
15
+ - Anything else (a feature request, or no arguments) → a fresh run, exactly
16
+ today's behaviour: the arguments are the feature request.
17
+
7
18
  Follow the zero SDD orchestrator instructions: drive the run through the
8
19
  explore → plan → build → veredicto phases, honour the build/veredicto iteration
9
20
  cap, and use the execution mode (interactive or automatic) the user chose.
@@ -26,6 +26,74 @@ whim. Drive the run through four phases, in order:
26
26
  The orchestrator code controls phase order and the round count. The cap is not
27
27
  optional and the model does not get to extend it.
28
28
 
29
+ ## Resuming a run
30
+
31
+ `/forge --continue` resumes an interrupted run instead of starting fresh. Resume
32
+ is derived purely from the `.sdd/<feature-slug>/` artifacts — `requirements.md`,
33
+ `design.md`, and `tasks.md` with its `[ ]`/`[x]` checklist. There is no separate
34
+ state file; the artifacts are the run's durable state.
35
+
36
+ **Selecting the run.**
37
+
38
+ - `--continue <slug>` — skip the scan and target `.sdd/<slug>/` directly. Never
39
+ disambiguate. (`forge.md` already reports "no such run" and stops if the
40
+ directory is absent.)
41
+ - `--continue` with no slug — scan `.sdd/*/` and classify every run by its
42
+ resume-point state (below). "Unfinished" = state `no-plan`, `building`, or
43
+ `built` (anything except `done`).
44
+ - Exactly one unfinished run → resume it silently.
45
+ - More than one → list each unfinished run with its slug and detected resume
46
+ point, and ask the user which to resume.
47
+ - Zero → state "nothing to resume" and stop. Do **not** start a fresh run.
48
+
49
+ **Resume-point algorithm.** For the selected `<slug>`:
50
+
51
+ 1. If `.sdd/<slug>/requirements.md` is missing → state `no-plan`; resume at
52
+ **explore**, then plan (the run barely started; rebuild the plan artifacts).
53
+ 2. Else if `.sdd/<slug>/design.md` or `.sdd/<slug>/tasks.md` is missing → state
54
+ `no-plan`; resume at **plan** (requirements survived; finish the plan).
55
+ 3. Else (all three plan artifacts exist):
56
+ - If `tasks.md` has at least one `[ ]` task → state `building`; resume at
57
+ **build**, starting at the first `[ ]` task. Already-`[x]` tasks are done —
58
+ do not redo them.
59
+ - Else (every task `[x]`):
60
+ - Look for best-effort proof of a prior `pasa` verdict, in order: the
61
+ Cortex `zero-run/<slug>` trace (`memoria_search` for that `topic_key`)
62
+ reporting a `pasa` final verdict, then a line in `~/.pi/zero-runs.jsonl`
63
+ with `"feature":"<slug>"` and `"verdict":"pasa"`.
64
+ - Proof found → state `done`; report the run already completed
65
+ successfully and do nothing — no re-run, no clobber.
66
+ - No proof (Cortex unreachable, file absent, `--no-mcp`) → state `built`;
67
+ resume at **veredicto** and let it confirm the verdict. An all-`[x]`
68
+ `tasks.md` proves build finished but **never** proves a `pasa` verdict —
69
+ absence of proof always resolves toward re-verification.
70
+
71
+ **Sanity-checking artifacts on resume.** A phase may have been killed
72
+ mid-write, leaving a truncated `design.md` or `tasks.md`. When you brief the
73
+ resumed phase's sub-agent, instruct it to sanity-check the artifacts it depends
74
+ on (plan checks `requirements.md`/`design.md` look complete; build checks
75
+ `tasks.md` parses as a checklist) and rebuild an obviously-incomplete one rather
76
+ than trust it.
77
+
78
+ **Pipeline guarantees on resume.** Resume enters the same loop at a later
79
+ phase — every existing guarantee still holds: phase order proceeds forward from
80
+ the resume phase with no downstream phase skipped; the build/veredicto iteration
81
+ cap still bounds the resumed segment (the spent round count is not recoverable,
82
+ so a resumed `building`/`built` run starts its counter at 1); the veredicto gate
83
+ still stands — `pasa` is reported only on a `pasa` verdict, and the `done`
84
+ short-circuit is the sole exception because it required positive proof of a
85
+ prior `pasa`. Ask for the execution mode (interactive / automatic) at resume
86
+ time exactly as a fresh run does — mode is per-invocation, not persisted — and
87
+ announce the slug, the detected resume phase, and (for `building`) the first
88
+ unchecked task number before entering the pipeline.
89
+
90
+ **Fresh `/forge` against an existing slug.** At the start of a *fresh* run
91
+ (no `--continue`), if `.sdd/<slug>/` already exists and is non-empty, do **not**
92
+ silently clobber it and do **not** silently resume. Ask the user to choose:
93
+ (a) resume it instead, (b) start over — discarding the existing artifacts, which
94
+ the user must explicitly confirm — or (c) pick a different slug. An empty or
95
+ non-existent `.sdd/<slug>/` proceeds as a fresh run with no prompt.
96
+
29
97
  ## Sub-agent delegation
30
98
 
31
99
  Each phase runs as its own sub-agent — `zero-explore`, `zero-plan`,
@@ -55,6 +123,11 @@ At the start of a run, ask the user which mode they want:
55
123
 
56
124
  Cache the mode for the run.
57
125
 
126
+ When summarising the plan phase, report the run's total changed-lines forecast
127
+ from the `## Review Workload` section of `tasks.md`, name each over-budget
128
+ exception with its reason, and — when there are no exceptions — state that all
129
+ tasks are within the per-task budget.
130
+
58
131
  ## Visibility
59
132
 
60
133
  While a phase runs, keep the user informed of progress — never run silently for
@@ -4,6 +4,15 @@ description: SDD build phase — implement the planned tasks, test-first, and ma
4
4
 
5
5
  You run the **build** phase of a zero SDD pipeline.
6
6
 
7
+ **Locating artifacts.** If you are invoked with a feature slug, operate on
8
+ `.sdd/<slug>/`. With no slug and exactly one candidate run on disk, use it; with
9
+ no slug and an ambiguous target, ask which run before acting. Read `tasks.md`
10
+ and continue from the first `[ ]` task — already-`[x]` tasks are done, leave
11
+ them untouched. Update each checkbox to `[x]` as its task completes so a later
12
+ resume sees the progress. Sanity-check that `tasks.md` parses as a checklist
13
+ before trusting it. If `tasks.md` is missing, report the missing prerequisite
14
+ and stop — do **not** fabricate a plan.
15
+
7
16
  Implement the planned tasks in order, test-first where practical. Keep every
8
17
  change within the plan's scope — do not expand it on your own initiative.
9
18
 
@@ -4,6 +4,12 @@ description: SDD explore phase — investigate the codebase read-only and produc
4
4
 
5
5
  You run the **explore** phase of a zero SDD pipeline.
6
6
 
7
+ **Locating artifacts.** If you are invoked with a feature slug, operate on
8
+ `.sdd/<slug>/`. With no slug and exactly one candidate run on disk, use it; with
9
+ no slug and an ambiguous target, ask which run before acting. Explore is
10
+ read-only and may run with no `.sdd/<slug>/` directory yet — a brand-new feature
11
+ is normal; do not treat the missing directory as an error.
12
+
7
13
  Investigate the codebase and the feature request read-only. Do not modify any
8
14
  files. Map the relevant modules, the existing patterns and conventions, the
9
15
  integration points, and the constraints. Identify the risks and the unknowns.
@@ -4,6 +4,15 @@ description: SDD plan phase — turn findings into requirements, design, and an
4
4
 
5
5
  You run the **plan** phase of a zero SDD pipeline.
6
6
 
7
+ **Locating artifacts.** If you are invoked with a feature slug, operate on
8
+ `.sdd/<slug>/`. With no slug and exactly one candidate run on disk, use it; with
9
+ no slug and an ambiguous target, ask which run before acting. You write
10
+ `requirements.md`, `design.md`, and `tasks.md` into that directory. If invoked
11
+ standalone with the explore findings absent, gather the context you need first
12
+ rather than failing. On a resumed run, sanity-check any `requirements.md` or
13
+ `design.md` you depend on — if one is obviously incomplete (truncated
14
+ mid-write), rebuild it instead of trusting it.
15
+
7
16
  Using the explore findings, write the plan: the requirements (what must be
8
17
  true), the design (how it will be built), and an ordered list of small,
9
18
  independently verifiable tasks.
@@ -14,3 +23,23 @@ own.
14
23
 
15
24
  Honour the prior-run lessons carried in the explore findings: when a past run
16
25
  was sent back with `replantear`, do not repeat the plan mistake it recorded.
26
+
27
+ ## Review Workload Forecast
28
+
29
+ Size every task against a fixed budget of **400 changed lines per task** — an
30
+ internal, non-configurable default (borrowed from gentle-ai), so "small task"
31
+ means the same number on every run.
32
+
33
+ - Attach a `review: ~N changed lines` bullet to every task entry. `N` is always
34
+ a whole number (added + modified + deleted), prefixed with `~`. It is never
35
+ blank or non-numeric — if confidence is low, still record your best guess.
36
+ - If a task's estimate exceeds 400, split it into smaller tasks that stay
37
+ ordered and individually verifiable by the build phase, then re-number and
38
+ re-estimate the pieces.
39
+ - If a task genuinely cannot be split, keep it whole, flag it as an over-budget
40
+ exception, and record a concrete reason.
41
+ - Append a `## Review Workload` section to `tasks.md` after the task list: a
42
+ budget line stating `400`, a per-task table/list (one row per task, exactly
43
+ the tasks above it), the **bold total** computed as the literal sum of the
44
+ per-task estimates, and the over-budget exceptions list — state "none" when
45
+ there are no exceptions.
@@ -4,6 +4,15 @@ description: SDD veredicto phase — adversarially review the build and record a
4
4
 
5
5
  You run the **veredicto** phase of a zero SDD pipeline.
6
6
 
7
+ **Locating artifacts.** If you are invoked with a feature slug, operate on
8
+ `.sdd/<slug>/`. With no slug and exactly one candidate run on disk, use it; with
9
+ no slug and an ambiguous target, ask which run before acting. Read the plan
10
+ artifacts and the build result, then record your verdict. So the verdict
11
+ survives for a future resume's proof check, make it recoverable through the
12
+ orchestrator's existing run-trace machinery — the Cortex `zero-run/<slug>` save
13
+ and the `~/.pi/zero-runs.jsonl` append. Do not write a separate verdict file;
14
+ `.sdd/` artifacts stay plan state only.
15
+
7
16
  Review the build adversarially, with a fresh perspective. Check it against the
8
17
  plan's requirements, run the tests yourself, and look for gaps, regressions,
9
18
  and unmet acceptance criteria.