@pilotspace/add 1.16.1 → 1.17.0

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.
@@ -1,12 +1,17 @@
1
1
  # Phase 4 — Tests (failing-first suite)
2
2
 
3
- Goal: turn scenarios + contract into automated tests and confirm they FAIL before any code exists — red now, green only after Build. Fill **§4 TESTS** and write the suite into `.add/tasks/<slug>/tests/`.
3
+ Goal: tests from scenarios + contract that FAIL before any code exists. Fill **§4 TESTS**; the suite lives in `.add/tasks/<slug>/tests/`.
4
4
 
5
5
  ## The must-fail principle
6
6
 
7
- Run the suite now, with no implementation — it must be **red for the right
8
- reason** (missing implementation, not a broken harness). A test that passes
9
- before code exists is testing nothing and will wave bad code through later.
7
+ Run the suite now, with no implementation — **red for the right reason**
8
+ (missing implementation, not a broken harness). A test green before code
9
+ exists is testing nothing.
10
+
11
+ **A test is any machine-checkable assertion**, not only xUnit code —
12
+ a metric threshold (ML/data), a reconciliation query (data integrity),
13
+ a plan-diff (infra/IaC), a rendered-screen diff (UI). Red-first holds
14
+ for each: the assertion must FAIL before the change exists.
10
15
 
11
16
  ## Produce
12
17
 
@@ -15,29 +20,26 @@ before code exists is testing nothing and will wave bad code through later.
15
20
  - Contract-conformance tests (shapes + error responses from §3).
16
21
  - Side-effect assertions on rejection paths (`assert balance unchanged`).
17
22
  - A recorded coverage target in §4.
23
+ - §6 **Build expectations** filled now, BEFORE build — observable outcomes from §2 + §3.
18
24
  </output_format>
19
25
 
20
26
  ## Declaring where tests live
21
27
 
22
28
  §4's `Tests live in:` line is machine-read: with no local `tests/`, `add.py report`
23
- counts test functions at the declared backticked paths instead (FIRST `Tests live in:`
24
- line only). Resolution: `./…` → this task's dir · a token with `/` → the project root
25
- (parent of `.add/`) · a bare name → a sibling of the previous token's dir (else the
26
- task dir). A directory token counts the `*.py` files directly inside it (non-recursive); a `.py`
27
- file counts itself; else ignored. Resolved files dedupe; declared counts marked `†`. Paths
28
- are confined: anything resolving outside the project root counts 0 — `..` traversal, absolute
29
- paths, and symlink escapes are never read.
29
+ counts test functions at the declared backticked paths (FIRST such line only).
30
+ `./…` → this task dir · a token with `/` → the project root · a bare name → a
31
+ sibling of the previous token's dir. A directory counts its `*.py` files
32
+ (non-recursive); a `.py` file counts itself. Resolved files dedupe; declared counts
33
+ marked `†`. Paths are confined: outside the project root counts 0 `..` traversal,
34
+ absolute paths, and symlink escapes are never read.
30
35
 
31
36
  ## AI prompt
32
37
 
33
38
  <prompt>
34
39
  Role: a test author who writes tests before code.
35
40
  Read first: §2 · §3.
36
- Objective: a red suite that fails for the right reason — behavior, not internals.
37
- Steps:
38
- 1. Turn each scenario into an executable test.
39
- 2. Add contract-conformance and edge-case tests.
40
- 3. Run the suite and confirm it fails for the right reason; record a coverage target.
41
+ Steps: turn each scenario into an executable test; add contract-conformance and
42
+ edge cases; run the suite red for the right reason; record a coverage target.
41
43
  Never: implement the feature, or assert on internals.
42
44
  </prompt>
43
45
 
@@ -51,7 +53,7 @@ Never: implement the feature, or assert on internals.
51
53
  </exit_gate>
52
54
 
53
55
  > **Persona** — let the fit persona's `## Success Metrics` shape the red suite (advisory).
54
- > **Advisor · Confidence** — spawn a test-author for a broad red suite (advisor.md); score Completeness one test per scenario, every rejection covered (confidence.md).
56
+ > **Advisor · Confidence** — spawn a test-author for a broad red suite (advisor.md); score Completeness honestly (confidence.md).
55
57
 
56
58
  ## Next
57
59
 
@@ -4,10 +4,10 @@ Goal: release deliberately, watch reality, turn what you learn into the next spe
4
4
 
5
5
  ## Do
6
6
 
7
- 1. **Release behind a scope-of-impact limit** — a flag and/or gradual rollout.
7
+ 1. **Release behind a scope-of-impact limit** — a flag and/or gradual rollout
8
8
  2. **Reuse scenarios as monitors** — the §2 scenarios that defined "correct" now
9
9
  define what you alert on: overall error rate, each rejection's rate (a spike is a
10
- signal), latency of the risky op under load.
10
+ signal), latency of the risky op.
11
11
  3. **Draft the next spec delta** — every defect, surprise, or new need becomes a
12
12
  change that re-enters the flow at Specify (a new task).
13
13
  4. **Propose a voice delta** — note where your voice diverged from the human's (wordings +
@@ -22,11 +22,8 @@ Goal: release deliberately, watch reality, turn what you learn into the next spe
22
22
  <prompt>
23
23
  Role: a reliability analyst feeding the next cycle.
24
24
  Read first: telemetry · objectives · incidents.
25
- Objective: turn what production shows into the next SPEC delta.
26
- Steps:
27
- 1. Report error-budget burn.
28
- 2. Cluster errors and surface the top real-world failures.
29
- 3. Draft a SPEC delta with evidence links.
25
+ Steps: 1. report error-budget burn · 2. cluster errors, surface the top real failures ·
26
+ 3. draft a SPEC delta with evidence links.
30
27
  Never: auto-roll-back — recommend; a human owns the production decision.
31
28
  </prompt>
32
29
 
@@ -38,10 +35,11 @@ Never: auto-roll-back — recommend; a human owns the production decision.
38
35
  - [ ] A reviewed spec delta captured (becomes the next `new-task`).
39
36
  </exit_gate>
40
37
 
41
- > **Persona** — tag a lesson `· persona:<slug> ·` so `add.py fold` grows the persona.
38
+ > **Persona** — tag `· persona:<slug> · critical-rule|success-metric|anti-pattern|ability`;
39
+ > `fold` grows that section — a HOW-an-agent-behaves lesson belongs in a persona, not the shared pile.
42
40
  > **Advisor · Confidence** — spawn a reviewer to mine the run for lessons (advisor.md); score Self-evaluation — did this loop teach the foundation? (confidence.md).
43
41
 
44
42
  ## Next
45
43
 
46
- Loop. The artifacts you built are living docs the next cycle refines.
47
- Book: `docs/09-the-loop.md`.
44
+ Loop the artifacts are living docs the next cycle refines.
45
+ Map: `self-improve.md` · book: `docs/09-the-loop.md`
@@ -20,6 +20,9 @@ cross-cutting, or anything you are not yet sure is small. In doubt, run the full
20
20
  3. Write a **red** test (§4), run it failing for the right reason.
21
21
  4. Build (§5) to green, then record the **verify gate** (§6).
22
22
 
23
+ Both human gates (freeze, verify) render `report-template.md` too — the fast lane collapses
24
+ sections, never the report.
25
+
23
26
  ## Floor kept, only collapsed
24
27
 
25
28
  Three things never move, on either lane: a **frozen** §3 before build · a **red** test before build ·
@@ -39,8 +39,8 @@ Its facts are engine-sourced (goal = `m-goal` · done = exit-criteria + tasks do
39
39
 
40
40
  ### Per-gate examples
41
41
 
42
- - **verify** — `goal:` ship the decision arc · `done:` report-arc tests 6/6 green · `plan:` PASS → wire the arc into every gate → goal.
43
- - **contract-freeze** — `goal:` … · `done:` bundle drafted, lowest-confidence flag surfaced · `plan:` freeze §3 → build → goal.
42
+ - **verify** — `goal:` ship the arc · `done:` tests 6/6 green · `plan:` PASS → every gate → goal.
43
+ - **contract-freeze** — `done:` bundle drafted, flag surfaced · `plan:` freeze §3 → build → goal.
44
44
 
45
45
  ## PLAN / SHAPE — when there's more than one step, or a shape to freeze
46
46
 
@@ -62,10 +62,10 @@ SHAPE <task title, bold> — v<N> (DRAFT — not yet frozen)
62
62
  <error case / reject token> <what triggers it>
63
63
  ```
64
64
 
65
- - **Collapse done to a count.** Never enumerate finished tasks by name — the human already trusts what's shipped; re-listing it is noise.
66
- - **Cap live items at ~5–7**, in dependency order; footer `+N more queued` rather than listing everything.
65
+ - **Collapse done to a count.** Never enumerate finished tasks by name.
66
+ - **Cap live items at ~5–7**, dependency-ordered; footer `+N more queued`.
67
67
  - **One line per item** — slug + what it does or blocks on; never restate the whole TASK.md.
68
- - **Glyphs are fixed** — ✅ done · 🔄 active/in-progress · ⬜ pending · ⚠ blocked or flagged. Do not invent new glyphs.
68
+ - **Glyphs are fixed** — ✅ done · 🔄 active · ⬜ pending · ⚠ blocked/flagged; never invent new ones.
69
69
  - **Sourced from the engine, summarized by you** — pull from `add.py status`'s `tasks:`/`streams:` output; never paste it verbatim into chat.
70
70
  - **SHAPE is freeze-only** — the concrete thing being locked, so the human reviews the actual shape, not just commentary about it.
71
71
 
@@ -105,7 +105,7 @@ APPROVE <the question>
105
105
  ```
106
106
 
107
107
  - **Exactly one** option carries `▶ … (recommended)`. `confidence.md` self-score informs which; the human overrides freely.
108
- - **1–3 real alternatives** only — no strawmen; if there is genuinely one path, show one — never invent filler to reach three.
108
+ - **1–3 real alternatives** only — no strawmen, no filler; one genuine path show one.
109
109
  - **Every option is described** — pick and each alternative carry a one-line description.
110
110
  - **Human gates only** — render at `[human gate]` points; not at `[you drive]` steps.
111
111
 
@@ -121,6 +121,7 @@ APPROVE <the question>
121
121
  - **Never pre-stamp a human decision point.** Freeze / gate / lock fields stay DRAFT or blank until the answer returns: show → ask → stamp → advance.
122
122
  - **Never dump raw engine output as the plan.** Summarize `add.py status`/`report` through PLAN/SHAPE (or prose) — the engine's full verbosity is for `add.py` itself, not the chat message wrapped around it.
123
123
  - **One report per decision point.** After an approval, point at the frozen artifact — do not re-render the bundle.
124
+ - **Batch, don't serialize.** N same-gate decisions ready together (intake items · ready-to-freeze contracts) render as ONE report: PLAN lists each item with its own lowest-confidence flag; APPROVE covers the batch in one ask, and any item can be held back by name.
124
125
  - **Honest scope.** "Done" means the request, not the last task: report "task 2/3", never "done" while approved scope remains.
125
126
  - **The question is a summary, never the artifact.** A compact SUMMARY · FLAGS block sits in chat immediately before the ask; the question text itself is two lines at most — intent + what "yes" means + flag count — pointing at the report above.
126
127
  - **NEXT is not a second gate.** The single decision stays in APPROVE; NEXT is ranked recommendations only.
package/skill/add/run.md CHANGED
@@ -7,23 +7,13 @@ Scenarios · Contract) still owns *direction*. The engine stays judgment-free: t
7
7
 
8
8
  ## The specification bundle (v7)
9
9
 
10
- v7 compresses the old three-approval flow to **one**. The AI **drafts the whole specification
11
- bundle in one pass** Spec, Scenarios, Contract, and failing Tests — and presents it together.
12
- The human gives **one approval, at the frozen contract** (the decision point).
13
-
14
- Why one and not zero: the decision point **stays human**. The AI *drafts* the contract but never
15
- *freezes its own* a person approves the frozen shape before any auto-run touches code: that the
16
- Spec captures real intent, the Scenarios cover the cases that matter, and the Contract shape is the
17
- one to freeze. Reject any part → back to draft (backward-correction, principle 4, not failure). The
18
- decision-point guide (`phases/3-contract.md`) carries the **freeze review checklist** — seven lines,
19
- ⚠-first.
20
-
21
- **The lowest-confidence flag.** The AI presents the bundle **lowest-confidence first**: the
22
- **1–2 points most likely to be wrong**, tagged by part
23
- (`⚠ [spec|scenario|contract|test] … — because …; if wrong: …`) — `because` names the §1
24
- assumption behind the doubt, `if wrong` its cost. If nothing is materially uncertain, the AI still
25
- names the single biggest risk — never a blank "none". This flag is honor-system: the lint cannot
26
- force engagement — closing that gap is a CI checker's job, not prose.
10
+ v7 compresses the old three-approval flow to **one**: the AI drafts Spec · Scenarios ·
11
+ Contract · failing Tests in one pass; the human gives **one approval, at the frozen
12
+ contract** the decision point stays human (the AI never freezes its own shape; a
13
+ rejected part goes back to draft, backward-correction not failure). The freeze
14
+ presentation the bundle led **lowest-confidence first** by its flag, the
15
+ freeze review checklist (seven lines, ⚠-first) lives in `phases/3-contract.md`,
16
+ its one home; this rubric owns what happens AFTER the freeze.
27
17
 
28
18
  ## When the run begins — the scope-lock trigger
29
19
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  Before drafting the goal sentence, position the request in what already exists — distinct from intake's classification, not redundant with it.
21
21
 
22
- 1. **Ground in current assets.** Read the goal against what exists — the goal must reflect what the project already is. Ground as rigorously as a task's §0 (`phases/0-ground.md`), using the **same four fields** at milestone scope: **Touches** (the subsystems/files the milestone spans) · **Context** (the docs · todos · config · data it works against) · **Honors** (the `PROJECT.md` / `CONVENTIONS.md` invariants it must respect) · **Anchors** (the existing contracts/symbols its tasks will cite). Grounding is complete when each is named from real assets, not assumed.
22
+ 1. **Ground in current assets.** Read the goal against what exists — the goal must reflect what the project already is. Ground as rigorously as a task's §0 (`phases/0-ground.md`), using the **same four fields** at milestone scope: **Touches** (the subsystems/files the milestone spans) · **Context** (the docs · todos · config · data it works against) · **Honors** (the `PROJECT.md` / `CONVENTIONS.md` invariants it must respect) · **Anchors** (the existing contracts/symbols its tasks will cite). Grounding is complete when each is named from real assets, not assumed. Touches spanning >1 app root (BE+FE, or multiple independently-testable dirs)? weigh `.add/components.toml` (`components.md`) now — before tasks decompose with flat cross-app paths.
23
23
  2. **Relate to the milestone map.** Run `add.py search <keyword> [<keyword> ...]` first — then read every existing goal — `.add/milestones/*/MILESTONE.md` and `.add/archive/*` — and name THIS request's relationship: *extends* X · *depends-on* Y · *overlaps* Z. Record in the `rationale` line.
24
24
  3. **If the goal is already delivered** by an existing milestone, reject `duplicate_goal` and route as `task` or `change-request`.
25
25
 
@@ -0,0 +1,20 @@
1
+ # Self-improving ADD — the one map
2
+
3
+ Every loop improves four artifacts. You emit `open`; the human confirms; the engine
4
+ transcribes — nothing self-approves. Emission lives in observe (§7); every earlier step
5
+ feeds it: ground surprises → §1 · the freeze's ⚠ flag → the next spec · a red-suite gap →
6
+ a TDD lesson · build's strategy-actually-used → the ADR block · verify residue → a SPEC delta.
7
+
8
+ | what improves | grammar (closes `(evidence: …)`) | consolidator |
9
+ |---|---|---|
10
+ | foundation — `PROJECT.md`/`CONVENTIONS.md` | `[DDD\|SDD\|UDD\|TDD\|ADD · open] lesson` | `add.py fold` → `fold.md` |
11
+ | personas — the agents' stances | `… · persona:<slug> · critical-rule\|success-metric\|anti-pattern\|ability` | same `fold` run |
12
+ | `SOUL.md` — your voice | a voice delta, `open` | human rewrite → `soul.md` |
13
+ | the next scope | `[SPEC · open]` → seeded · dropped · carried | `loop.md` → `new-task` |
14
+
15
+ Routing: `DDD`→§Domain · `SDD`→§Spec · `UDD`→§Users · `TDD`/`ADD`→§Method learnings
16
+ (grammar: `deltas.md`). A HOW-an-agent-behaves lesson → a persona, not the shared pile.
17
+
18
+ Convergence: `fold` prepends newest-first; the settled tail rolls via
19
+ `compact-foundation.md`; `status` counts the debt — `carried:` · `compaction:`.
20
+ Self-score before emitting — `confidence.md` (six dimensions; < 0.9 → refine).
@@ -1,11 +1,11 @@
1
1
  # Parallel streams — pipelining independent tasks
2
2
 
3
3
  Load this when a milestone has more than one task and you want to run them concurrently.
4
- **Default:** when a project confirms `parallel + auto` as its run mode at setup
5
- (`phases/0-setup.md` "Run mode"), parallel streaming is the project default an **opt-out**, not
6
- the opt-in it once was; downgrade in one step (`add.py autonomy set conservative --project`, or
7
- just run tasks one at a time). A project that kept the conservative run mode still treats this
8
- rubric as the opt-in escape hatch.
4
+ **Default:** `sequential + auto` is the project default at setup (`phases/0-setup.md` "Run
5
+ mode") one task at a time, but Verify still auto-PASSes on evidence. Parallel streaming is an
6
+ **opt-in** for a milestone with genuinely independent tasks: `add.py streams set parallel
7
+ --project`, then read on. A project that raised its gate to `conservative`/`manual` still treats
8
+ this rubric as the same opt-in escape hatch.
9
9
 
10
10
  It changes **no `add.py` code and no phase semantics**. It is a way *you, the orchestrator*,
11
11
  drive several tasks at once by reading the dependency DAG `add.py status` already prints and
@@ -49,8 +49,8 @@ tier hint: top → dag-scheduler, setup-run-mode; mid → the rest
49
49
  ```
50
50
 
51
51
  - **Wave = a fan-out batch.** Every task in a wave has all in-milestone deps PASS, so the whole
52
- wave is spawnable at once (`isolation="worktree"`). Finish a wave, gate tasks PASS, then
53
- `add.py waves` again — the next wave is unblocked.
52
+ wave is spawnable at once worktree isolation is the default for any spawn, not just a wave.
53
+ Finish a wave, gate tasks PASS, then `add.py waves` again — the next wave is unblocked.
54
54
  - **Run the widest wave first** to hide the most build latency under human review latency.
55
55
  - **Spend your strongest model on the critical path.** Critical-path tasks gate the most
56
56
  downstream work; off-path tasks take **mid**. The tier hint is advisory — override when you
@@ -85,8 +85,9 @@ floor never drops to zero (`run.md:22`). Do not engineer around it.
85
85
  - **A worker** owns only its own `.add/tasks/<slug>/` — it builds `src/`, drives tests green,
86
86
  gathers evidence, and writes `SUMMARY.md` + OBSERVE deltas. It touches **no sibling stream and
87
87
  no shared file** — never write shared state (state.json, MILESTONE.md, a sibling's files).
88
- - **Isolation**: spawn each worker with `isolation="worktree"` so concurrent builds cannot
89
- collide. The worktree is discarded on failure; the task resets to its last-good phase.
88
+ - **Isolation**: `isolation="worktree"` is the default for any agent-spawned step, not only a
89
+ wave — a shared-tree spawn needs a stated reason. The worktree is discarded on failure; the task
90
+ resets to its last-good phase.
90
91
  </constraints>
91
92
 
92
93
  ## Design for failure (required)
@@ -100,8 +101,8 @@ floor never drops to zero (`run.md:22`). Do not engineer around it.
100
101
  (`wave_ledger_malformed`); `add.py check` is the standing monitor.
101
102
  - **Materialize gitignored engine content** — `git worktree add` checks out TRACKED files only;
102
103
  `.add/tooling` (engine) and `.add/docs` (book) are gitignored and will be ABSENT even when the
103
- worktree's HEAD matches copy them in before the worker's first `add.py` call, or its
104
- `phase`/`advance` commands have no engine to run at all (confirmed 3-for-3 this session).
104
+ worktree's HEAD matches. `add.py worktree-prep <slug>` mechanizes the recipe: cuts the
105
+ worktree, copies both trees in, and echoes the fork base for the ledger — one step.
105
106
  - **Lease + timeout** — record which worker holds which task (wave ledger); a dead worker releases
106
107
  its claim back to READY.
107
108
  - **Failure isolates** — a worker's STOP-and-escalate blocks only its own task; siblings run on, the
@@ -248,8 +249,8 @@ always escalates** — no tier auto-passes it.
248
249
 
249
250
  ## The spawn adapter — one thin mapping per runner
250
251
 
251
- ADD needs six capabilities from any runner. **Isolation ADD owns itself** (a git worktree), so
252
- streams stay portable even without a native sandbox.
252
+ ADD needs six capabilities from any runner. **Isolation ADD owns itself** (a git worktree,
253
+ default for any spawn), so streams stay portable even without a native sandbox.
253
254
 
254
255
  | ADD needs | Abstract | Claude Code (verified reference) | Any CLI agent — Codex · opencode · pi-mono · … |
255
256
  |-----------|----------|----------------------------------|-----------------------------------------------|