@pilotspace/add 1.17.0 → 2.0.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.
Files changed (114) hide show
  1. package/CHANGELOG.md +144 -0
  2. package/GETTING-STARTED.md +20 -64
  3. package/README.md +128 -56
  4. package/agents/add.md +68 -0
  5. package/bin/cli.js +86 -21
  6. package/package.json +2 -3
  7. package/personas-teacher/VENDOR.md +6 -0
  8. package/skill/add/SKILL.md +100 -134
  9. package/skill/add/adopt.md +28 -0
  10. package/skill/add/beyond.md +36 -0
  11. package/skill/add/deltas.md +25 -2
  12. package/skill/add/design.md +56 -74
  13. package/skill/add/{report-template.md → gate-udd.md} +28 -38
  14. package/skill/add/intake.md +56 -25
  15. package/skill/add/loop.md +32 -19
  16. package/skill/add/phases/build.md +78 -0
  17. package/skill/add/phases/direction.md +280 -0
  18. package/skill/add/phases/verify.md +160 -0
  19. package/skill/add/run.md +11 -18
  20. package/skill/add/terms.md +18 -0
  21. package/tooling/add.py +2383 -3261
  22. package/tooling/add_engine/autonomy.py +2 -37
  23. package/tooling/add_engine/components.py +4 -87
  24. package/tooling/add_engine/constants.py +145 -91
  25. package/tooling/add_engine/guidelines.py +9 -11
  26. package/tooling/add_engine/io_state.py +69 -2
  27. package/tooling/add_engine/predicates.py +90 -2
  28. package/tooling/add_engine/search.py +6 -6
  29. package/tooling/add_engine/taskdoc.py +15 -10
  30. package/tooling/templates/CONVENTIONS.md.tmpl +1 -1
  31. package/tooling/templates/GLOSSARY.md.tmpl +10 -4
  32. package/tooling/templates/MILESTONE.md.tmpl +20 -16
  33. package/tooling/templates/PLAN.md.tmpl +128 -0
  34. package/tooling/templates/PROJECT.md.tmpl +6 -1
  35. package/tooling/templates/PROMPT.persona.md.tmpl +17 -21
  36. package/tooling/templates/personas/_template.md.tmpl +33 -29
  37. package/tooling/templates/personas/build-engineer.md.tmpl +45 -0
  38. package/tooling/templates/personas/data-steward.md.tmpl +45 -0
  39. package/tooling/templates/personas/evidence-verifier.md.tmpl +45 -0
  40. package/tooling/templates/personas/platform-engineer.md.tmpl +45 -0
  41. package/tooling/templates/personas/product-lead.md.tmpl +51 -0
  42. package/tooling/templates/personas/quality-auditor.md.tmpl +47 -0
  43. package/tooling/templates/personas/release-manager.md.tmpl +52 -0
  44. package/tooling/templates/personas/security-gatekeeper.md.tmpl +45 -0
  45. package/tooling/templates/personas/software-architect.md.tmpl +45 -0
  46. package/tooling/templates/personas/stream-orchestrator.md.tmpl +44 -0
  47. package/tooling/templates/personas/technical-writer.md.tmpl +49 -0
  48. package/tooling/templates/personas/ux-experience-lead.md.tmpl +48 -0
  49. package/tooling/templates/specs/SPEC.md.tmpl +18 -0
  50. package/tooling/templates/udd-wireframe.md +1 -1
  51. package/agents/add-advisor.md +0 -31
  52. package/agents/add-build.md +0 -29
  53. package/agents/add-design.md +0 -32
  54. package/agents/add-persona.md +0 -33
  55. package/agents/add-verify.md +0 -36
  56. package/docs/00-introduction.md +0 -46
  57. package/docs/01-principles.md +0 -71
  58. package/docs/02-the-flow.md +0 -113
  59. package/docs/03-step-1-specify.md +0 -123
  60. package/docs/04-step-2-scenarios.md +0 -90
  61. package/docs/05-step-3-contract.md +0 -80
  62. package/docs/06-step-4-tests.md +0 -85
  63. package/docs/07-step-5-build.md +0 -82
  64. package/docs/08-step-6-verify.md +0 -105
  65. package/docs/09-the-loop.md +0 -75
  66. package/docs/10-setup-and-stages.md +0 -118
  67. package/docs/11-governance.md +0 -91
  68. package/docs/12-roles.md +0 -99
  69. package/docs/13-adoption.md +0 -67
  70. package/docs/14-foundation.md +0 -142
  71. package/docs/15-foundations-and-lineage.md +0 -106
  72. package/docs/16-releasing.md +0 -182
  73. package/docs/17-components.md +0 -143
  74. package/docs/18-personas.md +0 -80
  75. package/docs/README.md +0 -77
  76. package/docs/add-competencies.png +0 -0
  77. package/docs/add-flow.png +0 -0
  78. package/docs/add-foundation.png +0 -0
  79. package/docs/add-hierarchy.png +0 -0
  80. package/docs/add-milestone-task-lifecycle.png +0 -0
  81. package/docs/add-task-growth-wheel.png +0 -0
  82. package/docs/appendix-a-templates.md +0 -88
  83. package/docs/appendix-b-prompts.md +0 -154
  84. package/docs/appendix-c-glossary.md +0 -176
  85. package/docs/appendix-d-worked-example.md +0 -231
  86. package/docs/appendix-e-checklists.md +0 -92
  87. package/docs/appendix-f-requirements-matrix.md +0 -171
  88. package/docs/appendix-g-references.md +0 -106
  89. package/skill/add/advisor.md +0 -81
  90. package/skill/add/compact-foundation.md +0 -40
  91. package/skill/add/components.md +0 -52
  92. package/skill/add/confidence.md +0 -32
  93. package/skill/add/fold.md +0 -63
  94. package/skill/add/graduate.md +0 -39
  95. package/skill/add/phases/0-ground.md +0 -64
  96. package/skill/add/phases/0-setup.md +0 -103
  97. package/skill/add/phases/1-specify.md +0 -61
  98. package/skill/add/phases/2-scenarios.md +0 -48
  99. package/skill/add/phases/3-contract.md +0 -60
  100. package/skill/add/phases/4-tests.md +0 -61
  101. package/skill/add/phases/5-build.md +0 -62
  102. package/skill/add/phases/6-verify.md +0 -69
  103. package/skill/add/phases/7-observe.md +0 -45
  104. package/skill/add/phases/fast-lane.md +0 -34
  105. package/skill/add/release.md +0 -61
  106. package/skill/add/scope.md +0 -72
  107. package/skill/add/self-improve.md +0 -20
  108. package/skill/add/sensitivity.md +0 -51
  109. package/skill/add/setup-review.md +0 -48
  110. package/skill/add/soul.md +0 -58
  111. package/skill/add/streams.md +0 -269
  112. package/tooling/add_engine/release.py +0 -86
  113. package/tooling/templates/TASK.fast.md.tmpl +0 -78
  114. package/tooling/templates/TASK.md.tmpl +0 -181
@@ -1,60 +0,0 @@
1
- # Phase 3 — Contract (freeze the shape)
2
-
3
- Goal: fix the external shape — interfaces, data, names, error cases — and FREEZE it. The decision point that makes the AI-led build safe: below it code is disposable; above it the shape does not move. Fill **§3 CONTRACT** in TASK.md.
4
-
5
- ## Produce (in TASK.md §3)
6
-
7
- <output_format>
8
- - Interfaces (endpoints/functions/messages) with inputs/outputs.
9
- - Request/response shapes + persistent schema (note transactional needs).
10
- - Names drawn from `GLOSSARY.md` (same concept = same name everywhere).
11
- - A response for **every** Reject error code from §1.
12
-
13
- Then mark `Status: FROZEN @ v1`. Generate a mock + contract tests so dependent
14
- work can start before the real code exists.
15
- </output_format>
16
-
17
- **The freeze is the one approval.** Present the bundle **lowest-confidence first**: the 1–2 points most likely wrong (`⚠ [spec|scenario|contract|test] … — because …; if wrong: …`). Open with the ARC per `report-template.md`, rendering SHAPE then the freeze APPROVE as a guided choice (recommended pick + alternatives) — **render before `FROZEN`, then record `Reported: yes` in §3; never on a timeout.** See `run.md`. The approval also freezes §5 **Scope (may touch)** + Strategy.
18
-
19
- ## The freeze review checklist
20
-
21
- The human's one minute, aimed. Walk these seven before saying yes:
22
-
23
- - **⚠ flags first** — read the lowest-confidence flags; accept each knowing its cost if wrong. The engine refuses an unflagged freeze before build (`unflagged_freeze`); `audit` re-checks it on every record that crossed.
24
- - **Intent** — does §1 say what you actually want built?
25
- - **Cases** — does every Must and Reject have an observable §2 scenario?
26
- - **Shape** — glossary names, error codes, additive vs breaking: is THIS the shape to freeze?
27
- - **Grounded** — does §3 cite anchors that exist in the §0 GROUND map? `status`/`check` surface this.
28
- - **Risk** — high-risk or method-defining? Require `risk: high · autonomy: conservative` in the TASK.md header.
29
- - **Tests** — will §4 go red for the right reason, asserting behavior rather than internals?
30
-
31
- Reject any line and the bundle goes back to draft; the freeze stays the only gate.
32
-
33
- ## AI prompt
34
-
35
- <prompt>
36
- Role: an interface architect; frozen contracts are immutable.
37
- Read first: §1 · §2 · GLOSSARY.
38
- Objective: produce §3 — the frozen external shape, nothing more.
39
- Steps:
40
- 1. Define interfaces, shapes, and schema named from the glossary, with a response for every Reject code.
41
- 2. Generate a mock returning the contracted shapes and contract tests pinning them.
42
- 3. Mark FROZEN. No business logic.
43
- Never: change a frozen contract — a change reopens Specify.
44
- </prompt>
45
-
46
- ## Exit gate
47
-
48
- <exit_gate>
49
- - [ ] Versioned and marked `FROZEN`.
50
- - [ ] Contract tests pass against the mock.
51
- - [ ] Every name matches the glossary.
52
- - [ ] Every spec rejection has a contracted response.
53
- </exit_gate>
54
-
55
- > **Advisor · Confidence** — a second opinion on a risky shape is worth a spawn (advisor.md); a low self-score is your cue to lower autonomy before you freeze (confidence.md).
56
-
57
- ## Next
58
-
59
- `python3 .add/tooling/add.py advance` → read `phases/4-tests.md`.
60
- Book: `docs/05-step-3-contract.md`.
@@ -1,61 +0,0 @@
1
- # Phase 4 — Tests (failing-first suite)
2
-
3
- Goal: tests from scenarios + contract that FAIL before any code exists. Fill **§4 TESTS**; the suite lives in `.add/tasks/<slug>/tests/`.
4
-
5
- ## The must-fail principle
6
-
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.
15
-
16
- ## Produce
17
-
18
- <output_format>
19
- - One executable test per scenario (§2), asserting **behavior, not internals**.
20
- - Contract-conformance tests (shapes + error responses from §3).
21
- - Side-effect assertions on rejection paths (`assert balance unchanged`).
22
- - A recorded coverage target in §4.
23
- - §6 **Build expectations** filled now, BEFORE build — observable outcomes from §2 + §3.
24
- </output_format>
25
-
26
- ## Declaring where tests live
27
-
28
- §4's `Tests live in:` line is machine-read: with no local `tests/`, `add.py report`
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.
35
-
36
- ## AI prompt
37
-
38
- <prompt>
39
- Role: a test author who writes tests before code.
40
- Read first: §2 · §3.
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.
43
- Never: implement the feature, or assert on internals.
44
- </prompt>
45
-
46
- ## Exit gate
47
-
48
- <exit_gate>
49
- - [ ] One test per scenario.
50
- - [ ] Suite runs and is **red for the right reason**.
51
- - [ ] Tests assert observable behavior.
52
- - [ ] Coverage target recorded.
53
- </exit_gate>
54
-
55
- > **Persona** — let the fit persona's `## Success Metrics` shape the red suite (advisory).
56
- > **Advisor · Confidence** — spawn a test-author for a broad red suite (advisor.md); score Completeness honestly (confidence.md).
57
-
58
- ## Next
59
-
60
- `python3 .add/tooling/add.py advance` → read `phases/5-build.md`.
61
- Book: `docs/06-step-4-tests.md`.
@@ -1,62 +0,0 @@
1
- # Phase 5 — Build (AI writes the code)
2
-
3
- Goal: implement the feature so EVERY failing test passes — without changing any
4
- test or the contract. This is the only phase the AI leads; §1–§4 removed all
5
- ambiguity. Write code into `.add/tasks/<slug>/src/`.
6
-
7
- ## Work in small batches
8
-
9
- Pick ONE task-sized slice, restate its tests, implement, iterate to green.
10
- Keep each batch small enough to review in full.
11
-
12
- ## Declaring the scope of impact (Scope + Strategy)
13
-
14
- §5 opens with two declarations, drafted with the bundle and frozen by the §3 approval — never invented mid-build:
15
-
16
- - **Scope (may touch)** — the allowlist of files the build may write (backticked tokens). A file outside it is a **STOP → change request** back to Specify, never improvisation.
17
- - **Strategy (ordered batches)** — the planned build order; guidance, not enforced.
18
-
19
- Enforced: a completing verify gate refuses an out-of-scope build (`scope_violation` → self-heal).
20
-
21
- ## Persona overlay (optional)
22
-
23
- You may load the active `.add/personas/<slug>.md` as a domain **overlay** atop `SOUL.md` (SOUL = voice/trust; persona = domain **stance**) — name it in §5. SOUL.md is **human-owned**: the overlay never rewrites it (`soul.md`). Advisory — it never lowers a gate; security still **HARD-STOPs**.
24
-
25
- ## The cardinal rule
26
-
27
- **Never weaken or delete a test to make it pass, and never edit the frozen
28
- contract.** A genuine need to change either is a change request back to Specify. Honor the §5 safety rule (e.g. atomic balance update).
29
-
30
- ## AI prompt
31
-
32
- <prompt>
33
- Role: implement the feature so EVERY failing test passes — the build phase.
34
- Read first: §1 · §3 · §4 · CONVENTIONS.
35
- Objective: every §4 test green, one small batch at a time.
36
- Steps:
37
- 1. Make EVERY failing test pass, honoring the §5 safety rule.
38
- 2. Report which tests pass and exactly what changed.
39
- Never: change a test or the contract; use a package off the allow-list; or push past unclear instead of asking.
40
- </prompt>
41
-
42
- ## Exit gate
43
-
44
- <exit_gate>
45
- - [ ] All tests pass.
46
- - [ ] Coverage did not decrease.
47
- - [ ] No test and no contract modified by the AI.
48
- - [ ] No dependency outside the allow-list.
49
- - [ ] No file outside the declared §5 Scope was touched.
50
- - [ ] Change small enough to review in full.
51
- </exit_gate>
52
-
53
- > **Advisor · Confidence** — delegate a well-scoped batch (advisor.md); self-score before presenting green, refine while cheap (confidence.md).
54
-
55
- ## Next
56
-
57
- `python3 .add/tooling/add.py advance` → read `phases/6-verify.md`.
58
- Book: `docs/07-step-5-build.md`.
59
-
60
- > Under `autonomy: auto` Build and Verify run together as one evidence-auto-gated run. See `run.md`.
61
- >
62
- > **Honest redo.** A confirmed cheat returns the task HERE — revert the tampered file or de-overfit src, then advance again (the bounded self-heal loop, `run.md`; capped, then HARD-STOPs to the human). Never weaken a test or edit the frozen contract to pass.
@@ -1,69 +0,0 @@
1
- # Phase 6 — Verify (evidence + non-functional review)
2
-
3
- Goal: establish trust and record an outcome. Passing tests are necessary, not
4
- sufficient. Fill **§6** in TASK.md including the GATE RECORD.
5
-
6
- > **Who resolves this gate depends on the `autonomy:` header.** Under `autonomy: auto` (the default)
7
- > a run auto-PASSes on complete evidence with **no residue** (security · concurrency · architecture),
8
- > recorded *auto-resolved* with the named run as owner;
9
- > **security is always a HARD-STOP and is never auto-passed**. Under `conservative`, or whenever
10
- > residue is found, this phase is **human-led** (auto-PASS conditions: `run.md`).
11
-
12
- ## Before you build — declare the build expectations
13
-
14
- Fill the §6 **Build expectations** block BEFORE Build: OBSERVABLE outcomes derived from §2 + §3. At this gate, confirm each against real evidence (the `confirmed by` column) — one with no evidence isn't yet verified.
15
-
16
- ## Part one — confirm the evidence
17
-
18
- - [ ] All tests pass.
19
- - [ ] Coverage did not decrease.
20
- - [ ] No test or contract was altered during build.
21
- - [ ] Every §6 Build expectation is confirmed by real evidence (not just a green test).
22
- - [ ] §1 rules trace to §2/§4 — an untraced rule is a coverage gap (`add.py audit`'s `rule_coverage_gap`; `check` has detail).
23
- - [ ] every §3-cited symbol still resolves in the CURRENT tree, not just Ground SHA (§6 Live-verify evidence catches a stale/moved anchor here, not later).
24
-
25
- If any is false, stop and return to Build.
26
-
27
- ## Part two — check what tests miss
28
-
29
- - **Concurrency/timing** — correct when two run at once? (Tests run serially and miss races.)
30
- - **Security** — exposed secrets, injection openings, unexpected dependencies. A security finding is always `HARD-STOP`, never a waiver. ANY note here escalates to the human — start it with `NOTE` or `⚠` so `add.py audit` can see it (`unescalated_security_note`). **But that check sees only what you wrote down:** it fires on a *marked* note auto-gated to PASS — a finding you never marked is **invisible**, escalated to no one. Under `auto`, a human **spot-audit** (reading the diff) is the only backstop for a *missed* security finding.
31
- - **Architecture** — respects layering/dependency rules in CONVENTIONS.md?
32
-
33
- Run the three lenses in order — a Security `HARD-STOP` ends the checklist (leave the rest blank). Record in §6 `### Advisor 3-lens verdict` (Verdict · Residue · Binding): `sensitivity: mechanical` → Binding `yes` (engine reads it for `advisor-gate-relax`), every other class → Binding `advisory`. `add.py audit` flags an unfilled block `advisor_verdict_unrecorded`, a companion to `refute_unrecorded`.
34
-
35
- ## Part three — the deep check (do not skim)
36
-
37
- If the task produced code, record that every new symbol is referenced (wiring) and that no new dead/unused code was introduced. If it produced prose or non-code, record a semantic read — what you read in full and what it confirmed. The resolver judges which path; the engine never classifies.
38
-
39
- Record in the §6 **Deep checks** block — an unfilled one is a **shallow verify**, not a PASS.
40
-
41
- ## Part four — was the green earned?
42
-
43
- A green suite proves tests pass — not that the build EARNED them. Three judgment cheats pass the unchanged suite: src overfit to the test fixtures (special-cased to literal inputs), vacuous asserts (green against an empty implementation), and real logic stubbed away — all invisible to the mechanical tamper tripwire. Score them with an adversarial refute-read: an independent reviewer — the engine never spawns one — prompted to argue the green was NOT earned. A confirmed earned-green failure is HARD-STOP-class: never auto-passed, never RISK-ACCEPTED — a first cheat enters the bounded self-heal loop (run.md). Under `auto`, **record the verdict** in §6's `### Refute-read verdict` block — `add.py audit` flags an unrecorded `refute_unrecorded`, one of three measure-not-block shape lints it surfaces (also `shallow_deep_check` + `risk_unset`).
44
-
45
- ## Record exactly one outcome (no silent pass)
46
-
47
- Present this gate via `report-template.md`'s ARC, render APPROVE, and reconcile FLAGS with `add.py report --decide`'s open-item count. **Human-led: render before `gate` and record `Reported: yes` in §6, never self-stamp.**
48
-
49
- | Outcome | When |
50
- |---------|------|
51
- | `PASS` | all checks met |
52
- | `RISK-ACCEPTED` | a **non-security** gap, with signed owner + ticket + expiry |
53
- | `HARD-STOP` | any failing test or any security finding |
54
-
55
- ## Exit gate / Next
56
-
57
- <exit_gate>
58
- - [ ] Evidence confirmed, non-functional risks checked, outcome recorded — a person approved, or
59
- (under `autonomy: auto`, no residue) the run auto-resolved as accountable owner.
60
- </exit_gate>
61
-
62
- > **Persona** — run the refute-read under the fit persona / Code-Reviewer lens (advisory; security still HARD-STOPs).
63
- > **Advisor · Confidence** — the earned-green refute-read is the canonical adversarial spawn (advisor.md); score it before recording the gate (confidence.md).
64
-
65
- ```bash
66
- python3 .add/tooling/add.py gate PASS # marks the task done
67
- # or: add.py gate RISK-ACCEPTED | add.py gate HARD-STOP (return to Build)
68
- ```
69
- Then read `phases/7-observe.md`. Book: `docs/08-step-6-verify.md`.
@@ -1,45 +0,0 @@
1
- # Phase 7 — Observe (feed the next loop)
2
-
3
- Goal: release deliberately, watch reality, turn what you learn into the next spec. Fill **§7** in TASK.md.
4
-
5
- ## Do
6
-
7
- 1. **Release behind a scope-of-impact limit** — a flag and/or gradual rollout
8
- 2. **Reuse scenarios as monitors** — the §2 scenarios that defined "correct" now
9
- define what you alert on: overall error rate, each rejection's rate (a spike is a
10
- signal), latency of the risky op.
11
- 3. **Draft the next spec delta** — every defect, surprise, or new need becomes a
12
- change that re-enters the flow at Specify (a new task).
13
- 4. **Propose a voice delta** — note where your voice diverged from the human's (wordings +
14
- flow); propose a confirmable **voice delta** tuning `SOUL.md`, emitted `open`. The human
15
- confirms, then you rewrite the routed section. Read `soul.md` (grammar, routing,
16
- human-is-only-writer).
17
-
18
- > **Decisions (ADR)** — at the gate the engine harvests §7's ADR block (§1/§3/§5/§6); `add.py audit` flags one never harvested.
19
-
20
- ## AI prompt
21
-
22
- <prompt>
23
- Role: a reliability analyst feeding the next cycle.
24
- Read first: telemetry · objectives · incidents.
25
- Steps: 1. report error-budget burn · 2. cluster errors, surface the top real failures ·
26
- 3. draft a SPEC delta with evidence links.
27
- Never: auto-roll-back — recommend; a human owns the production decision.
28
- </prompt>
29
-
30
- ## Exit gate
31
-
32
- <exit_gate>
33
- - [ ] Released behind a flag/rollout.
34
- - [ ] Scenario-based monitors live.
35
- - [ ] A reviewed spec delta captured (becomes the next `new-task`).
36
- </exit_gate>
37
-
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.
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).
41
-
42
- ## Next
43
-
44
- Loop — the artifacts are living docs the next cycle refines.
45
- Map: `self-improve.md` · book: `docs/09-the-loop.md`
@@ -1,34 +0,0 @@
1
- # Fast lane — less ceremony, same floor
2
-
3
- The fast lane is the **collapsed, opt-in task path for small work**. Same flow — ground → specify →
4
- contract → tests → build → verify — with fewer sections and the bundle approved in one pass. It
5
- **collapses** the ceremony; it never drops the floor. The human opts in (`--fast`); the engine never
6
- guesses that a task is small.
7
-
8
- ## When
9
-
10
- Pick it for a **small, low-risk, roughly single-file change**. Stay on the full lane when the work
11
- wants its scenarios enumerated — a milestone or release, an architecture or security change, anything
12
- cross-cutting, or anything you are not yet sure is small. In doubt, run the full lane.
13
-
14
- ## How
15
-
16
- 1. `add.py new-task <slug> --fast` scaffolds the minimal `TASK.fast.md` (sections {0,1,3,4,5,6};
17
- §2 SCENARIOS and §7 OBSERVE dropped — §1's Accept line carries the behavior a scenario would).
18
- 2. Ground, draft §1 + §3, and **freeze the contract as one batched approval** — the single decision
19
- point, led by the lowest-confidence flag.
20
- 3. Write a **red** test (§4), run it failing for the right reason.
21
- 4. Build (§5) to green, then record the **verify gate** (§6).
22
-
23
- Both human gates (freeze, verify) render `report-template.md` too — the fast lane collapses
24
- sections, never the report.
25
-
26
- ## Floor kept, only collapsed
27
-
28
- Three things never move, on either lane: a **frozen** §3 before build · a **red** test before build ·
29
- a recorded **verify gate** at the end (a security finding is always HARD-STOP). A `--fast` task is
30
- freeze-gated under ANY milestone — `advance` refuses `contract_not_frozen` while §3 is a draft. Speed
31
- comes from **fewer sections + auto-gating**, not from cutting any of the three.
32
-
33
- Not a way around the contract, the red test, or the gate; not for milestones or releases; not
34
- engine-chosen — ceremony is human-owned.
@@ -1,61 +0,0 @@
1
- # Release — cut a versioned ship, never an unwatched flip
2
-
3
- A project releases when ≥1 **closed milestones** are bundled into a versioned cut whose notes are evidence-backed, risk is disclosed, and behaviour is then watched. This is the **5th scope level** — distinct from milestone (feature-complete), graduation (rigor shift), and stage (mvp→prod).
4
-
5
- - **milestone** = feature-complete and consolidated; **release** = shipped + watched.
6
- - **graduation** changes *rigor*; a **release** ships a *version*. Orthogonal axes.
7
-
8
- You **gather and propose**; the **human confirms and ships**; the engine records the cut and enforces a floor — it **never tags, publishes, or deploys**.
9
-
10
- ## The cue
11
-
12
- When ≥1 milestone is `done` AND archived AND not yet attributed to a release, `add.py status` prints:
13
-
14
- ```
15
- → releasable: N milestone(s) closed since last release
16
- ```
17
-
18
- That line is a tally over unreleased-but-archived milestones — never a readiness judgment.
19
-
20
- ## The flow
21
-
22
- One arc, seven steps: **cue → gather → draft notes → readiness floor → human confirms → cut → watch.**
23
-
24
- 1. **Gather** — run `add.py release-report` (`--json` to branch on it). It clusters the cut's evidence: closed milestones since last release · consolidated deltas · open RISK-ACCEPTED waivers · open security HARD-STOP (blocker) · §2 scenarios to take live as monitors. Gathers, never judges.
25
- 2. **Draft notes** — write a [Keep a Changelog](https://keepachangelog.com/) entry from the consolidated deltas + each milestone's goal. Group Added / Changed / Fixed. Propose the **semver bump** (breaking→MAJOR, feature→MINOR, fix-only→PATCH) for human confirmation.
26
- 3. **Readiness floor** — the engine enforces: suite green, zero open security HARD-STOP, every RISK-ACCEPTED waiver signed and disclosed in the notes.
27
- 4. **Human confirms** — present via `report-template.md`, opening with the ARC (goal · done · plan). Render as a guided choice (per `report-template.md`). Never pre-stamp; show-before-ask.
28
- 5. **Cut** — only now run `add.py release <version> --notes <file>`. The engine records: CHANGELOG entry, append-only `RELEASES.md` row (newest-first: date · version · milestones · waivers · evidence), milestone attribution.
29
- 6. **Ship** — the **human** runs the tag / publish / deploy (`git tag`, `npm publish`, deploy pipeline). Engine never performs it.
30
- 7. **Watch** — §2 scenarios become live monitors. A regression re-enters at Specify as a **change request** → PATCH hotfix release.
31
-
32
- ## The floor
33
-
34
- `add.py release <version>` is **guarded** — refuses (non-zero exit, state byte-unchanged) on:
35
-
36
- <reject_codes>
37
- - `release_security_open` — open security HARD-STOP exists. Never shipped. `--force` does NOT override this.
38
- - `release_build_in_flight` — a build is in flight, ungated.
39
- - `release_no_closed_milestone` — nothing new since last release.
40
- - `release_undisclosed_waiver` — a RISK-ACCEPTED waiver rides into the release but is absent from the notes.
41
- </reject_codes>
42
-
43
- `--force` preserves human authority for grandfathered / edge cases (e.g. brownfield first cut) — never overrides `release_security_open`.
44
-
45
- ## Invariants
46
-
47
- - **Engine records; human ships.** `add.py release` writes CHANGELOG + ledger + attribution; never tags, publishes, or deploys.
48
- - **Security is a HARD-STOP at the cut**, not just at verify. No `--force`, no waiver, no exception.
49
- - **Notes draw from consolidated deltas** — release after `fold.md` has run. Lifecycle order: `milestone-done → fold → compact → archive → (repeat ≥1×) → release → watch`.
50
- - **Ledger is append-only (newest-first)** — a release row is never rewritten; a yanked version gets a new row.
51
- - **A release bundles, it does not equal.** One version may attribute several milestones.
52
-
53
- ## Depth by stage
54
-
55
- - **prototype/poc** — one-line preview note + tag; no deploy ceremony.
56
- - **mvp** — full notes + tag + guarded publish; watch headline scenarios.
57
- - **production** — full rigor: notes + tag + deploy behind rollback-tested pipeline + live monitors + error-budget watch. Hotfix path (step 7) is first-class.
58
-
59
- ## Worked example
60
-
61
- The `udd-design-loop` milestone closed (4/4), consolidated into `foundation-version 33`; the human drafted `## [1.5.0]` from those deltas, bumped version sources in lockstep, and `test_release_1_5_0.py` asserted readiness. The `git tag` stayed human-gated; live-registry confirmation gathered *after* the tag as verify evidence, never a unit test.
@@ -1,72 +0,0 @@
1
- # Scope drafting — turn a classified request into a versioned MILESTONE.md
2
-
3
- `intake.md` CLASSIFIES a request into a bucket; scope drafting turns that into a confirmed, well-formed, versioned `MILESTONE.md` through discussion. The MILESTONE.md template is the SHAPE; this rubric is HOW to fill it well.
4
-
5
- ## What to do per intake outcome
6
-
7
- | intake outcome | scope-loop action | creates (after confirm) |
8
- |----------------|-------------------|-------------------------|
9
- | `new-major` / `sub-milestone` | draft ONE MILESTONE.md (fill the template via discussion) | 1 milestone |
10
- | `task` | route to `add.py new-task <slug>` (fits the active milestone) | 0 milestones |
11
- | `change-request` | route to SPECIFY/CONTRACT of the affected task | 0 milestones |
12
- | `split_required` | draft ALL N items as a batch in ONE pass | N milestones/tasks |
13
-
14
- **Confirm before create is the convention.** "One pass" means one drafting pass, NOT auto-creation — nothing is written until the human confirms; enforced only by the opt-in `--await-confirm` (below).
15
-
16
- **Confirm the milestone before detailing tasks.** `new-milestone <slug> --await-confirm` seeds it *unconfirmed* — `new-task` is HELD (`milestone_unconfirmed`) until you show the filled `MILESTONE.md`, get the human's go, and run `milestone-confirm <slug>`. Keeps you from digging into task §0–§5 before the parent is agreed. (Omit the flag: no gate.)
17
-
18
- ## Position the goal — ground in assets, relate to the milestone map (do this FIRST)
19
-
20
- Before drafting the goal sentence, position the request in what already exists — distinct from intake's classification, not redundant with it.
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. 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
- 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
- 3. **If the goal is already delivered** by an existing milestone, reject `duplicate_goal` and route as `task` or `change-request`.
25
-
26
- ## Brainstorm before you draft — co-specify at milestone level
27
-
28
- Don't draft from thin input. Run the three-move co-specify (`phases/1-specify.md`) — Diverge → Converge → Validate — raised to milestone scope. Ask only what moves the goal, the In/Out line, or the task list.
29
-
30
- Diverge seeds (pick the live ones):
31
- - **Outcome** — done means a user can do *what* they can't today?
32
- - **Edge of scope** — nearest thing assumed IN that you want OUT?
33
- - **Riskiest decision point** — which contract, if wrong, costs the most rework?
34
- - **Done-looks-like** — how do we SEE each outcome without reading code?
35
- - **First slice** — which task unblocks the rest?
36
-
37
- Rank assumptions lowest-confidence first; top 1–2 get the flag: `⚠ <assumption> — lowest confidence because <why>; if wrong: <cost>`. Present via `report-template.md` — open with the ARC (goal · done · plan), render as a guided choice.
38
-
39
- ## Drafting a good MILESTONE.md (section by section)
40
-
41
- - **goal** — ONE outcome sentence (no "and" — that is two milestones).
42
- - **rationale** — intake bucket + WHY, AND the milestone relationship from "Position the goal". Never in state.json.
43
- - **Scope In/Out** — explicit anti-creep deferral list. An empty Out list means scope is not yet thought through. UI/UX scope? use the template's Scope hint vocabulary, not generic prose.
44
- - **Shared decisions & glossary deltas** — cross-cutting rules every task must honor. New terms get a glossary entry.
45
- - **Shared / risky contracts to freeze first** — decision points between tasks; name the owning task.
46
- - **Tasks (breadth-first)** — `slug · depends-on · one line` each. Decompose by deliverable; keep each task one-file-sized.
47
- - **Exit criteria** — observable; **every exit criterion maps to a declared task slug** (no dangling criterion).
48
- - **Close — ship review** + **Release steps** — **drafted-blank** here; filled LATER (`milestone-done` and `release.md`). Named so you know the full 9-section shape.
49
-
50
- ## Draft well-formedness gate
51
-
52
- A scope draft is well-formed only when:
53
- - [ ] goal is ONE outcome sentence (no "and")
54
- - [ ] every exit criterion maps to a declared task slug (no dangling criterion)
55
- - [ ] `rationale` records the bucket + milestone relationship from "Position the goal"
56
- - [ ] `Close — ship review` and `Release steps` are left as the template (drafted-blank)
57
- - [ ] the In/Out list names what is deferred
58
-
59
- Propose only a well-formed draft — an incomplete one lets a milestone reach task breakdown half-formed.
60
-
61
- ## Reject codes
62
-
63
- <reject_codes>
64
- - `not_classified` — the request has not been through intake. Classify it first.
65
- - `dangling_criterion` — a drafted MILESTONE.md has an exit criterion that maps to no declared task slug. FIX the draft before proposing.
66
- - `no_milestone` — intake routed to `task` or `change-request`; create NO milestone.
67
- - `duplicate_goal` — the goal is already delivered by an existing milestone (live or in `.add/archive/`). Route as `task` or `change-request`, create nothing.
68
- </reject_codes>
69
-
70
- ## Worked example
71
-
72
- Request: *"open the Interface & Intake milestone"* → intake classified it `sub-milestone` of v4 → scope drafting produced **`.add/milestones/v4-1/MILESTONE.md`**: goal *make ADD harness-drivable and self-scoping*; tasks (breadth-first) `machine-state-json` · `versioning-policy` · `scope-loop`; each exit criterion maps to its slug.
@@ -1,20 +0,0 @@
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,51 +0,0 @@
1
- # Sensitivity — the project's risk-class vocabulary
2
-
3
- A task declares its risk-CLASS with a `sensitivity:` line in the TASK header — *what
4
- kind* of risk it carries, distinct from `risk:` (*how much*). The engine validates +
5
- surfaces the human's declaration; it **never classifies**. Read live by freeze/status/check.
6
-
7
- ## The base four (method-universal — always apply)
8
-
9
- - **security** — authn/authz, secrets, crypto, attack surface. A finding here is HARD-STOP;
10
- the human is in the loop in EVERY tier (never advisor-gated, never auto-passed).
11
- - **data** — persistence, migrations, privacy of stored records, data loss.
12
- - **architecture** — module boundaries, contracts, cross-cutting structure.
13
- - **mechanical** — rote, low-impact change (rename, move, format, doc). The only class
14
- a recorded advisor verdict (three §6 fields: Verdict · Residue · Binding) can gate for
15
- auto-completion (`advisor-gate-relax`).
16
-
17
- These four can't be removed — a project only EXTENDS them.
18
-
19
- ## Extend per project (you maintain this)
20
-
21
- Domain risk-classes live in `.add/GLOSSARY.md` under a `## Sensitivity classes` section,
22
- one `- <token>: <definition>` bullet per line:
23
-
24
- ```markdown
25
- ## Sensitivity classes
26
- Base (always apply): security · data · architecture · mechanical
27
- - pii: personally identifiable information; any task touching it escalates to human review
28
- - payments: money movement; reconciliation + an audit trail are required
29
- ```
30
-
31
- `freeze` then accepts a header `sensitivity:` value from **base ∪ your domain classes**;
32
- a token in neither is refused `sensitivity_invalid`. `status` prints the active task's
33
- class; `check` nudges (`sensitivity_classes_unset`, never red) until you declare some.
34
-
35
- ## The AI's job — keep it current
36
-
37
- - When a milestone or task reveals a **new kind of risk** this project carries (a regulated
38
- data category, a payment rail, a tenancy boundary), ADD it as a class with a one-line
39
- definition — propose it, the human confirms (it is foundation, like a glossary term).
40
- - **Re-read the section each session** (it rides `GLOSSARY.md`); pick the tightest class
41
- when you declare a task's `sensitivity:` at freeze.
42
- - **Map domain → base behavior** in the definition so downstream gating is unambiguous —
43
- e.g. "pii … escalates to human review" pins it as human-floor, not advisor-gatable.
44
-
45
- ## Hold the line
46
-
47
- - **Declared, never inferred** — the engine reads your token; it does not guess a class.
48
- - **Base four are universal** — domain classes add to them, never replace them; security
49
- stays a human floor in every tier.
50
- - **A comment is never a declaration** — commented-out example bullets don't count; only a
51
- real `- <token>:` line under the section is a class.
@@ -1,48 +0,0 @@
1
- # Setup review — the one page the human signs
2
-
3
- Autonomous setup ends at a single human gate: the **baseline approval** (`add.py lock`). `SETUP-REVIEW.md` is that page: every decision you made while drafting the foundation, first-scope, and the first contract, **ordered lowest-confidence-first** so the riskiest guesses meet the human's eye first.
4
-
5
- The engine never reads this file — `add.py lock` is judgment-free, the signature *is* the gate. The human **reading** this page is the review.
6
-
7
- ## Where it lives
8
-
9
- Write **one** artifact at `.add/SETUP-REVIEW.md`. **Never clobber a human-edited one** — if it already exists with hand edits, append/update, don't overwrite. It sits beside `PROJECT.md`, not under a task.
10
-
11
- ## The template
12
-
13
- ```markdown
14
- # SETUP REVIEW — <project>
15
-
16
- <stage> · <brownfield | greenfield> · drafted by <model> @ <date>
17
-
18
- | # | Decision | Lands in | Tag | Why / Evidence |
19
- |---|----------|----------|-----|----------------|
20
- | 1 | <the drafted decision> | PROJECT.md \| scope \| first-contract | `guessed` | <the inference + why you had to guess> |
21
- | 2 | <…> | <…> | `evidence-grounded` | <cite the source file/line you read it from> |
22
-
23
- Sign: confirm in chat → the agent runs `add.py lock --by "<name>"` (typing it yourself works too)
24
- ```
25
-
26
- Rows are numbered for reference at the gate ("row 1 is where my confidence is lowest").
27
-
28
- ## The two rules that make it honest
29
-
30
- <constraints>
31
- 1. **Lowest-confidence-first.** Order rows by confidence **ascending**. A `guessed` row always floats above an `evidence-grounded` one. The top of the table is the part the human actually needs to challenge.
32
-
33
- 2. **Every row is tagged — `guessed` or `evidence-grounded`.**
34
- - `evidence-grounded` — you read it from the code/repo. **Cite the file** (e.g. `pyproject.toml`). Brownfield onboarding (see `adopt.md`) is mostly these.
35
- - `guessed` — the repo was silent, so you inferred it. **State the inference and why.** Thin-greenfield onboarding produces these. These are what the human must check; that is why they sit on top.
36
-
37
- The tag vocabulary is shared with `adopt.md` — brownfield map tags flow straight into this table.
38
- </constraints>
39
-
40
- ## Where it ends
41
-
42
- `SETUP-REVIEW.md` is read-only context for the baseline approval — present it lowest-confidence-first, not field-by-field; the human confirms in conversation; you run the lock:
43
-
44
- ```bash
45
- python3 .add/tooling/add.py lock --by "<name>"
46
- ```
47
-
48
- `lock` records the lock layers and opens the build — it does **not** parse or validate this file. Make the top of the table the truth they most need.