@pilotspace/add 1.17.0 → 2.1.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 (120) hide show
  1. package/CHANGELOG.md +193 -0
  2. package/GETTING-STARTED.md +20 -64
  3. package/README.md +138 -158
  4. package/agents/add-advisor.md +66 -21
  5. package/agents/add-worker.md +102 -0
  6. package/bin/cli.js +88 -21
  7. package/package.json +2 -3
  8. package/personas-teacher/VENDOR.md +6 -0
  9. package/skill/add/SKILL.md +100 -144
  10. package/skill/add/adopt.md +28 -0
  11. package/skill/add/beyond.md +37 -0
  12. package/skill/add/deltas.md +25 -2
  13. package/skill/add/design.md +56 -74
  14. package/skill/add/{report-template.md → gate-udd.md} +28 -38
  15. package/skill/add/intake.md +56 -25
  16. package/skill/add/loop.md +32 -19
  17. package/skill/add/persona-author/SKILL.md +116 -0
  18. package/skill/add/persona-author/assets/example-design-persona.md +55 -0
  19. package/skill/add/persona-author/assets/example-persona.md +57 -0
  20. package/skill/add/persona-author/references/contract.md +69 -0
  21. package/skill/add/persona-author/references/patterns.md +122 -0
  22. package/skill/add/persona-author/references/seeding.md +79 -0
  23. package/skill/add/phases/build.md +79 -0
  24. package/skill/add/phases/direction.md +287 -0
  25. package/skill/add/phases/verify.md +161 -0
  26. package/skill/add/run.md +16 -18
  27. package/skill/add/terms.md +18 -0
  28. package/tooling/add.py +2421 -3258
  29. package/tooling/add_engine/autonomy.py +2 -37
  30. package/tooling/add_engine/components.py +4 -87
  31. package/tooling/add_engine/constants.py +148 -93
  32. package/tooling/add_engine/guidelines.py +10 -11
  33. package/tooling/add_engine/io_state.py +72 -5
  34. package/tooling/add_engine/predicates.py +90 -2
  35. package/tooling/add_engine/search.py +6 -6
  36. package/tooling/add_engine/taskdoc.py +15 -10
  37. package/tooling/templates/CONVENTIONS.md.tmpl +1 -1
  38. package/tooling/templates/GLOSSARY.md.tmpl +10 -4
  39. package/tooling/templates/MILESTONE.md.tmpl +20 -16
  40. package/tooling/templates/PLAN.md.tmpl +129 -0
  41. package/tooling/templates/PROJECT.md.tmpl +6 -1
  42. package/tooling/templates/PROMPT.persona.md.tmpl +17 -21
  43. package/tooling/templates/personas/build-engineer.md.tmpl +45 -0
  44. package/tooling/templates/personas/data-steward.md.tmpl +45 -0
  45. package/tooling/templates/personas/evidence-verifier.md.tmpl +45 -0
  46. package/tooling/templates/personas/platform-engineer.md.tmpl +45 -0
  47. package/tooling/templates/personas/product-lead.md.tmpl +51 -0
  48. package/tooling/templates/personas/quality-auditor.md.tmpl +47 -0
  49. package/tooling/templates/personas/release-manager.md.tmpl +52 -0
  50. package/tooling/templates/personas/security-gatekeeper.md.tmpl +45 -0
  51. package/tooling/templates/personas/software-architect.md.tmpl +45 -0
  52. package/tooling/templates/personas/stream-orchestrator.md.tmpl +44 -0
  53. package/tooling/templates/personas/technical-writer.md.tmpl +49 -0
  54. package/tooling/templates/personas/ux-experience-lead.md.tmpl +48 -0
  55. package/tooling/templates/specs/SPEC.md.tmpl +18 -0
  56. package/tooling/templates/udd-wireframe.md +1 -1
  57. package/agents/add-build.md +0 -29
  58. package/agents/add-design.md +0 -32
  59. package/agents/add-persona.md +0 -33
  60. package/agents/add-verify.md +0 -36
  61. package/docs/00-introduction.md +0 -46
  62. package/docs/01-principles.md +0 -71
  63. package/docs/02-the-flow.md +0 -113
  64. package/docs/03-step-1-specify.md +0 -123
  65. package/docs/04-step-2-scenarios.md +0 -90
  66. package/docs/05-step-3-contract.md +0 -80
  67. package/docs/06-step-4-tests.md +0 -85
  68. package/docs/07-step-5-build.md +0 -82
  69. package/docs/08-step-6-verify.md +0 -105
  70. package/docs/09-the-loop.md +0 -75
  71. package/docs/10-setup-and-stages.md +0 -118
  72. package/docs/11-governance.md +0 -91
  73. package/docs/12-roles.md +0 -99
  74. package/docs/13-adoption.md +0 -67
  75. package/docs/14-foundation.md +0 -142
  76. package/docs/15-foundations-and-lineage.md +0 -106
  77. package/docs/16-releasing.md +0 -182
  78. package/docs/17-components.md +0 -143
  79. package/docs/18-personas.md +0 -80
  80. package/docs/README.md +0 -77
  81. package/docs/add-competencies.png +0 -0
  82. package/docs/add-flow.png +0 -0
  83. package/docs/add-foundation.png +0 -0
  84. package/docs/add-hierarchy.png +0 -0
  85. package/docs/add-milestone-task-lifecycle.png +0 -0
  86. package/docs/add-task-growth-wheel.png +0 -0
  87. package/docs/appendix-a-templates.md +0 -88
  88. package/docs/appendix-b-prompts.md +0 -154
  89. package/docs/appendix-c-glossary.md +0 -176
  90. package/docs/appendix-d-worked-example.md +0 -231
  91. package/docs/appendix-e-checklists.md +0 -92
  92. package/docs/appendix-f-requirements-matrix.md +0 -171
  93. package/docs/appendix-g-references.md +0 -106
  94. package/skill/add/advisor.md +0 -81
  95. package/skill/add/compact-foundation.md +0 -40
  96. package/skill/add/components.md +0 -52
  97. package/skill/add/confidence.md +0 -32
  98. package/skill/add/fold.md +0 -63
  99. package/skill/add/graduate.md +0 -39
  100. package/skill/add/phases/0-ground.md +0 -64
  101. package/skill/add/phases/0-setup.md +0 -103
  102. package/skill/add/phases/1-specify.md +0 -61
  103. package/skill/add/phases/2-scenarios.md +0 -48
  104. package/skill/add/phases/3-contract.md +0 -60
  105. package/skill/add/phases/4-tests.md +0 -61
  106. package/skill/add/phases/5-build.md +0 -62
  107. package/skill/add/phases/6-verify.md +0 -69
  108. package/skill/add/phases/7-observe.md +0 -45
  109. package/skill/add/phases/fast-lane.md +0 -34
  110. package/skill/add/release.md +0 -61
  111. package/skill/add/scope.md +0 -72
  112. package/skill/add/self-improve.md +0 -20
  113. package/skill/add/sensitivity.md +0 -51
  114. package/skill/add/setup-review.md +0 -48
  115. package/skill/add/soul.md +0 -58
  116. package/skill/add/streams.md +0 -269
  117. package/tooling/add_engine/release.py +0 -86
  118. package/tooling/templates/TASK.fast.md.tmpl +0 -78
  119. package/tooling/templates/TASK.md.tmpl +0 -181
  120. package/tooling/templates/personas/_template.md.tmpl +0 -82
@@ -1,92 +0,0 @@
1
- # Appendix E · Checklists
2
-
3
- [← Appendix D Worked example](./appendix-d-worked-example.md) · [Contents](./README.md) · Next: [Appendix F Requirements matrix →](./appendix-f-requirements-matrix.md)
4
-
5
- Every exit check in the book, collected for quick use. Print this page.
6
-
7
- ---
8
-
9
- ## Setup (once per project)
10
-
11
- - [ ] Pipeline runs and is green on the empty skeleton.
12
- - [ ] AI model pinned in `MODEL_REGISTRY.md`.
13
- - [ ] Dependency allow-list exists; pipeline fails on anything outside it.
14
- - [ ] `playbook/` contains the six prompts.
15
-
16
- ## Step 1 — Specify
17
-
18
- - [ ] Every required behavior stated explicitly.
19
- - [ ] Every rejection has a named error code.
20
- - [ ] Success state-change described.
21
- - [ ] Assumptions ranked lowest-confidence first; the 1–2 most-likely-wrong ⚠-flagged with why + cost (or an honest "none material" that still names the single biggest risk).
22
- - [ ] "Existing behavior" assumptions carry grep/line citations; wiring claims name the production caller chain.
23
-
24
- ## Step 2 — Scenarios
25
-
26
- - [ ] Every "Must" rule has a scenario.
27
- - [ ] Every "Reject" rule has a scenario.
28
- - [ ] Each result is a specific, observable fact.
29
- - [ ] Rejections assert what must stay unchanged.
30
-
31
- ## Step 3 — Contract
32
-
33
- - [ ] Contract versioned and `FROZEN`.
34
- - [ ] Contract tests pass against the mock.
35
- - [ ] Names match the glossary.
36
- - [ ] Every spec rejection has a contracted response.
37
-
38
- ## Step 4 — Tests
39
-
40
- - [ ] One test per scenario.
41
- - [ ] Suite runs in the pipeline and is red for the right reason.
42
- - [ ] Tests assert behavior, not internals.
43
- - [ ] Coverage target recorded.
44
- - [ ] No `should_panic` lying reds — unimplemented paths use `todo!()` so they fail.
45
- - [ ] Collateral tests for globally-enumerated things listed by exact name.
46
- - [ ] Arithmetic checked: fixtures can reach green against frozen constants.
47
-
48
- ## Step 5 — Build
49
-
50
- - [ ] All tests pass.
51
- - [ ] Coverage did not decrease.
52
- - [ ] No test or contract modified by the AI.
53
- - [ ] No package outside the allow-list added.
54
- - [ ] Change is small enough to review in full.
55
-
56
- ## Step 6 — Verify
57
-
58
- - [ ] All tests pass (the evidence).
59
- - [ ] Concurrency/timing of the risky operation is safe.
60
- - [ ] No exposed secrets, injection, or unexpected dependencies.
61
- - [ ] Layering and dependencies follow `CONVENTIONS.md`.
62
- - [ ] Deep check: wiring trace recorded (every new symbol reachable from production entry point) and no dead code introduced.
63
- - [ ] Was the green earned? Adversarial refute-read on the unchanged suite (no overfit, no vacuous asserts, no stubbed logic).
64
- - [ ] Full-suite rerun by orchestrator (not only the agent's scoped run).
65
- - [ ] A person reviewed and approved, **or** auto-resolved by the run (under `autonomy: auto`, no residue).
66
- - [ ] Outcome recorded (`PASS` / `RISK-ACCEPTED` / `HARD-STOP`).
67
-
68
- ## The loop
69
-
70
- - [ ] Released behind a flag or gradual rollout.
71
- - [ ] Scenarios reused as production monitors.
72
- - [ ] Learnings written back as a `SPEC.md` delta.
73
-
74
- ---
75
-
76
- ## Master shippable checklist
77
-
78
- A feature is shippable only when all are true:
79
-
80
- - [ ] Spec complete: behavior stated, rejections named, assumptions ranked lowest-confidence first with the biggest risk flagged.
81
- - [ ] Wiring and "existing behavior" assumptions carry grep/line citations; wiring claims name the production caller chain.
82
- - [ ] Every rule has a scenario.
83
- - [ ] Contract frozen; contract tests green.
84
- - [ ] A test per scenario; suite was red before the build (no `should_panic` lying reds).
85
- - [ ] Collateral tests listed by exact name; arithmetic checked against frozen constants.
86
- - [ ] All tests green; coverage held; tests and contract untouched by the AI.
87
- - [ ] Wiring trace recorded: every new symbol reachable from production entry point.
88
- - [ ] Adversarial refute-read confirms the green was earned (no overfit, no vacuous asserts, no stubbed logic).
89
- - [ ] Full-suite rerun by orchestrator; not just the agent's scoped run.
90
- - [ ] Concurrency, security, and architecture checked by a person.
91
- - [ ] Gate outcome recorded with an accountable owner.
92
- - [ ] Released behind a flag, with monitors in place.
@@ -1,171 +0,0 @@
1
- # Appendix F · Document requirements matrix (Project → Milestone → Task)
2
-
3
- [← Appendix E Checklists](./appendix-e-checklists.md) · [Contents](./README.md)
4
-
5
- This appendix maps every AIDD document to a three-level project hierarchy, so that at any level a team can answer three questions: **which documents must exist, who owns them, and what proves the level is complete.** It is the traceability backbone of the method — read it alongside the stage-depth matrix in [10 Setup and stages](./10-setup-and-stages.md), which covers *step* depth; this appendix covers *document* requirements.
6
-
7
- ---
8
-
9
- ## The three levels
10
-
11
- | Level | What it is | AIDD meaning | Spans |
12
- |-------|-----------|--------------|-------|
13
- | **Project** | the whole product or engagement | the living documentation — documents created once and kept for the life of the product | all milestones |
14
- | **Milestone** | a stage or release | one pass of the flow at a chosen depth: Prototype, POC, MVP, or Production-Ready; groups many tasks | many tasks |
15
- | **Task** | one feature through the flow | a single pass of Specify → … → Verify → Observe; the smallest unit with its own gate records | the seven steps |
16
-
17
- A **project** sets up the living documentation once. A **milestone** is a depth-bounded goal that groups tasks and has its own entry and exit document gates. A **task** is one feature, and it produces the per-feature artifacts.
18
-
19
- ## How the hierarchy decomposes
20
-
21
- ```mermaid
22
- flowchart TD
23
- P["PROJECT — the product<br/>PROJECT.md (foundation) · CONVENTIONS · GLOSSARY · MODEL_REGISTRY · allowlist · playbook"]
24
- P --> M1["MILESTONE · Prototype"]
25
- P --> M2["MILESTONE · POC"]
26
- P --> M3["MILESTONE · MVP"]
27
- P --> M4["MILESTONE · Production-Ready"]
28
- M3 --> T1["TASK · Transfer between accounts<br/>SPEC · feature · contract · tests · code · gate records"]
29
- M3 --> T2["TASK · View balance"]
30
- M3 --> T3["TASK · Transaction history"]
31
- classDef p fill:#F1EFE8,stroke:#5F5E5A,color:#2C2C2A;
32
- classDef m fill:#FAEEDA,stroke:#BA7517,color:#633806;
33
- classDef t fill:#E6F1FB,stroke:#185FA5,color:#042C53;
34
- class P p; class M1,M2,M3,M4 m; class T1,T2,T3 t;
35
- ```
36
-
37
- ---
38
-
39
- ## Matrix 1 — Documents by level (ownership and lifespan)
40
-
41
- Which document lives at which level, who is accountable for it, and how long it lasts.
42
-
43
- | Document | Level | Created | Lifespan | Accountable owner |
44
- |----------|:-----:|---------|----------|-------------------|
45
- | `PROJECT.md` (foundation: domain · spec · UI/UX) | Project | setup, grows | whole project | Product / Architect |
46
- | `CONVENTIONS.md` | Project | setup | whole project | Architect / Lead |
47
- | `GLOSSARY.md` | Project | setup, grows | whole project | Product / Domain |
48
- | `MODEL_REGISTRY.md` | Project | setup | whole project | Architect / Lead |
49
- | `dependencies.allowlist` | Project | setup | whole project | Security |
50
- | `playbook/*.md` (prompts) | Project | setup, versioned | whole project | Eng Lead |
51
- | Stage plan / roadmap | Milestone | per milestone | the milestone | EM / Delivery |
52
- | Milestone exit report | Milestone | milestone end | the milestone | EM / Delivery |
53
- | `SLO.md` (objectives) | Milestone (MVP+) | from MVP | from MVP onward | DevOps / SRE |
54
- | `SPEC.md` | Task | per feature | living | Product / Domain |
55
- | `features/*.feature` | Task | per feature | living | QA / Test |
56
- | `contracts/*.md` | Task → **Project** | per feature, then frozen | living doc (promoted to project) | Architect / Lead |
57
- | `tests/*` | Task | per feature | living | QA / Engineer |
58
- | Source code | Task | per feature | **disposable** | Engineer |
59
- | Gate outcome records | Task | per step | kept for audit | the reviewer |
60
-
61
- > Note the one promotion: a **contract** is authored at task level but, once frozen, becomes part of the project's living documentation — other tasks depend on it. That promotion is why a contract change is a project-level change request, not a task-local edit.
62
-
63
- ---
64
-
65
- ## Matrix 2 — Documents required by milestone
66
-
67
- Which documents must exist, and at what depth, to **exit** each milestone. Depth: **Deep** · **Core** · **Light** · **—** (not required).
68
-
69
- | Document | Prototype | POC | MVP | Production-Ready |
70
- |----------|:---------:|:---:|:---:|:----------------:|
71
- | `CONVENTIONS.md` | Light | Core | Required | Required |
72
- | `GLOSSARY.md` | seed | Core | Required | Required |
73
- | `MODEL_REGISTRY.md` | Required | Required | Required | Required |
74
- | `dependencies.allowlist` | optional | Required | Required | Required |
75
- | `playbook/*.md` | Required | Required | Required | Required |
76
- | `SPEC.md` | Light | Deep (risky slice) | Required (full) | Required (full) |
77
- | Design: flows + screen states | **Deep** | Light | Core | Deep |
78
- | `features/*.feature` | — | Core | Required | Exhaustive |
79
- | `contracts/*.md` (frozen) | — | Core (risky slice) | Required (frozen) | Required (versioned) |
80
- | `tests/*` | — | Core | Core | Full coverage |
81
- | `SLO.md` | — | — | Light | Required |
82
- | Gate outcome records | — | Core | Required | Required (all `HARD-STOP`) |
83
- | Operate / observe report | — | — | Light | Required |
84
- | Milestone exit report | Light | Core | Required | Required |
85
-
86
- **Reading it:** a Prototype exits on a deep design and little else; a POC adds a deep spec, core scenarios/contract/tests on the risky slice; an MVP requires the full per-feature document set plus light operations; Production requires everything at full depth with operations and audit-grade gate records.
87
-
88
- ---
89
-
90
- ## Matrix 3 — Documents required per task (the seven steps)
91
-
92
- Every task, regardless of milestone, produces this artifact chain. The depth varies by milestone (Matrix 2); the *sequence and exit gate* do not.
93
-
94
- | Step | Required document | Exit gate (the proof) | Detail |
95
- |------|-------------------|------------------------|--------|
96
- | 1 Specify | `SPEC.md` | rules + named rejections, assumptions ranked lowest-confidence first (biggest risk ⚠-flagged) | [03](./03-step-1-specify.md) |
97
- | 2 Scenarios | `features/<task>.feature` | one scenario per rule | [04](./04-step-2-scenarios.md) |
98
- | 3 Contract | `contracts/<task>.md` | frozen + contract tests green | [05](./05-step-3-contract.md) |
99
- | 4 Tests | `tests/<task>_*` | one test per scenario, red first | [06](./06-step-4-tests.md) |
100
- | 5 Build | source code + evidence bundle | all tests green, nothing weakened | [07](./07-step-5-build.md) |
101
- | 6 Verify | gate outcome record | `PASS` / `RISK-ACCEPTED` / `HARD-STOP` (auto-resolved on evidence under `autonomy: auto`; security always escalates) | [08](./08-step-6-verify.md) |
102
- | 7 Observe | `TASK.md` §7 OBSERVE block | released behind a flag; scenario-monitors live; spec delta + lessons learned captured | [09](./09-the-loop.md) |
103
-
104
- A task is **done** when the build's documents exist and the Verify record reads `PASS` (or a signed `RISK-ACCEPTED`); the seventh step — **Observe** (§7) — then runs in production and feeds the next loop's Specify. See the master shippable checklist in [Appendix E](./appendix-e-checklists.md).
105
-
106
- ---
107
-
108
- ## Matrix 4 — Executable proofs (the claims the engine enforces)
109
-
110
- The rows above are the method's *promises*. A promise a tool quietly breaks is worse than none — so the `add` engine ships a proof-harness: each invariant below is pinned by an automated test that fails loudly if the **Story** (this book) and the **State** (the engine) drift apart. This table is the coverage *so far*, not a completeness claim — but the minimalism-and-coverage audit has now run once over Matrices 1–3 (see **Sweep findings** below); what it could cheaply prove, it added; what it deliberately left unenforced, it recorded.
111
-
112
- | Claim (where it lives) | The engine enforces | Proof test |
113
- |------------------------|---------------------|------------|
114
- | No silent skips (principle 7) · "done only when Verify reads `PASS`" (Matrix 3) | `gate PASS` is **refused** unless the task has reached `verify` | `test_gate_pass_refused_before_verify` |
115
- | A passed task is genuinely done | `gate PASS` at `verify` advances to `done` | `test_gate_pass_at_verify_reaches_done` |
116
- | Deliberate ≠ silent | the explicit `phase` command is a logged escape hatch the guardrail does not block | `test_phase_override_escape_hatch` |
117
- | "A security finding is ALWAYS `HARD-STOP`" | `HARD-STOP` is recordable from any phase and never forces `done` | `test_hardstop_recordable_mid_build` |
118
- | "done … or a signed `RISK-ACCEPTED`" (Matrix 3) | `gate RISK-ACCEPTED` at `verify` advances to `done` (same guard as `PASS`) | `test_risk_accepted_complete_reaches_done` |
119
- | A waived task **can complete its milestone** (the point of the waiver) | the completeness predicate counts a signed `RISK-ACCEPTED` as done, so `milestone-done` / `ready` / `check` / `archive` accept it — it does not silently block | `test_milestone_done_accepts_a_waived_task` · `test_check_tolerates_a_recorded_waiver` |
120
- | A waiver is **signed** (owner · ticket · expiry) | `gate RISK-ACCEPTED` is refused without all three; they are stored in state | `test_risk_accepted_requires_waiver` · `test_risk_accepted_partial_waiver_refused` |
121
- | A waiver can **expire** — a lapsed one is caught, not trusted forever | `check` **FAILS** a `RISK-ACCEPTED` task whose stored `expires` is before today; fail-closed on a missing/unparseable date (`waiver_expired`) | `test_check_flags_expired_waiver` · `test_check_passes_unexpired_waiver` · `test_check_failclosed_on_unparseable_expires` |
122
- | **The Story is never auto-loaded** (principle 9, the *Minimal* pillar) | **no** command reads a `docs/` chapter at runtime — and the spy runs *every* subcommand the parser exposes, so "no command" is universal, not a subset; a project with **no** `docs/` runs the whole lifecycle | `test_full_lifecycle_runs_with_no_story` · `test_no_command_reads_a_docs_chapter` · `test_every_subcommand_is_covered` |
123
- | The book's gate outcomes are the engine's | `PASS` · `RISK-ACCEPTED` · `HARD-STOP` exist in both prose and `GATES` | `test_book_gate_outcomes_match_engine` |
124
-
125
- The tests are the source of truth; this table is their index. If a row here is ever unproven, that is a gap in the method, not a detail — the proof-harness exists to make such gaps fail loudly. (Tests: `add-method/tooling/test_proof_harness.py`, `test_waiver.py`.)
126
-
127
- **Now closed:** an earlier version of this table flagged a `RISK-ACCEPTED` gap — the engine advanced only `PASS` to `done`, so a waived task could not complete its milestone, and the waiver fields were uncaptured. The `RISK-ACCEPTED` rows above close it: a signed waiver (owner · ticket · expiry) now completes a verify-phase task and is stored in state for a later `check` to expire. Closing it took *two* edits, not one — advancing the gate to `done` was necessary but not sufficient, because the shared completeness predicate (`milestone-done` / `ready` / `check` / `archive` all read it) still counted only `PASS`; a waived task reached `done` yet silently blocked its milestone until that predicate was taught to count a signed `RISK-ACCEPTED` too. The end-to-end row above is what catches that class of half-fix — proving the *task* completes is not proving the *milestone* can. The pattern that found it — book-claim → engine-enforces → named test — is the standing way to audit the remaining rows.
128
-
129
- **Sweep findings (minimalism-and-coverage audit, v2):** the audit walked Matrices 1–3 for claims the engine *could* enforce but did not yet prove.
130
-
131
- - **Proved and added** (rows above): the *Minimal* pillar's headline — "the Story is never auto-loaded" (principle 9) — was written but unproven; it is now pinned behaviorally (the engine runs the whole lifecycle with no `docs/` present, and a read-spy over *every* subcommand confirms none reads a chapter at runtime). And waiver **expiry**, which Matrix 4 already promised the state captured "for a later `check` to expire," is now enforced.
132
- - **Recorded, deliberately *not* enforced:** Matrix 3 says a task is done only when "all six documents exist." The engine checks that `TASK.md` *exists* and that its phase marker matches state — it does **not** parse the file to confirm each of the seven sections is filled. Teaching it to grade section completeness would push the engine toward reading and judging the Story it is supposed to keep off the runtime path — an anti-minimal move. The reviewer owns section completeness at the Verify gate (the human-led half of the method); the engine owns the cheap structural invariants. This is a chosen boundary, not an oversight.
133
- - **Lean check:** the audit confirmed `state.json` carries no redundant per-task fields — `title`, `phase`, `gate`, `milestone`, `depends_on`, the two timestamps, and a `waiver` only once one is signed; nothing to trim. A clean bill is a finding too.
134
-
135
- ---
136
-
137
- ## Worked example — the hierarchy filled in
138
-
139
- - **Project:** *Mobile Banking App.* Living documentation: `CONVENTIONS.md`, `GLOSSARY.md` (defines *account*, *balance*, *transfer*), `MODEL_REGISTRY.md`, `dependencies.allowlist`, `playbook/`.
140
- - **Milestone:** *MVP — core money movement.* Exit requires the full per-feature document set for each task below, plus a light `SLO.md` and a milestone exit report.
141
- - **Task:** *Transfer between own accounts* → `SPEC.md`, `features/transfer.feature`, `contracts/transfer.md` (frozen at v1), `tests/transfer_test.py`, code, and a `PASS` gate record. (The full set is in [Appendix D](./appendix-d-worked-example.md).)
142
- - **Task:** *View balance* → its own SPEC, feature, contract, tests, code, record.
143
- - **Task:** *Transaction history* → its own set.
144
-
145
- When all three tasks read `PASS` and the milestone documents exist, the MVP milestone exits — and the frozen `transfer` contract is now a project-level living-documentation artifact the next milestone builds on.
146
-
147
- ---
148
-
149
- ## Traceability chain
150
-
151
- The hierarchy gives a clean line of evidence from a business goal down to a passing test — which is what makes an AIDD project auditable:
152
-
153
- ```
154
- PROJECT goal "let customers move their own money safely"
155
- └─ MILESTONE (MVP) "core money movement"
156
- └─ TASK "transfer between own accounts"
157
- └─ SPEC rule "source must have enough balance"
158
- └─ SCENARIO "insufficient funds -> rejected, no change"
159
- └─ TEST test_insufficient_funds (was red, now green)
160
- └─ VERIFY record PASS (atomicity checked)
161
- ```
162
-
163
- Every level points down to the evidence beneath it and up to the goal above it. To audit any claim — "we handle insufficient funds correctly" — you follow the chain to a specific test and a specific gate record. Nothing rests on assertion.
164
-
165
- ---
166
-
167
- *This matrix is the requirements view of the method. The flow ([Part II](./02-the-flow.md)) tells you the order; the stages ([10](./10-setup-and-stages.md)) tell you the depth; this appendix tells you, at each level of the project, exactly which documents must exist and who owns them.*
168
-
169
- ---
170
-
171
- *End of book. AIDD is one repeatable loop — Specify → Scenarios → Contract → Tests → Build → Verify → observe, then repeat. People own direction and verification; the AI owns the build; the artifacts are the asset and the code is disposable.*
@@ -1,106 +0,0 @@
1
- # Appendix G — References & Lineage
2
-
3
- ADD did not appear from nowhere. It sits at the meeting point of three currents:
4
- the **recursive self-improvement** thesis (AI that helps build the next AI), the
5
- **spec-driven development** movement (the specification, not the code, is the
6
- source of truth), and a decade of **agentic + tests-first** research showing that
7
- a generate→check→refine loop, constrained by executable tests, turns fluent model
8
- output into trustworthy software. This appendix is the curated, verified grounding
9
- for that lineage — every source below is reachable and annotated with a `↔ ADD:`
10
- line saying exactly how it relates to the method.
11
-
12
- **The frame — "closing the loop."** Anthropic's recursive-self-improvement picture
13
- runs from autonomous agents delegating to workers *today* toward a future where
14
- Claude improves Claude. ADD is a deliberately **human-gated, evidence-trusted**
15
- instance of that loop: the AI drives spec→build→verify→observe, but a human owns the
16
- frozen contract and the verify gate, and trust comes from passing tests and
17
- re-resolved evidence — never from a plausible-looking diff. The sources here are
18
- the shoulders that posture stands on.
19
-
20
- The four sections below are the four currents. The comparison table places ADD next
21
- to its two closest peers — GitHub's **spec-kit** and **GSD (Get Shit Done)** — and
22
- names where ADD diverges. Read "How to cite" first; the rest of the book cites into
23
- the keys defined here.
24
-
25
- ## How to cite
26
-
27
- The book uses one inline citation form — **author-year** — and every entry's lead
28
- `(Author Year)` *is* its cite-key. Resolve any inline `[…]` to the matching entry below.
29
-
30
- | Authors | Inline form | Example |
31
- |---|---|---|
32
- | one author | `[Surname Year]` | `[Schmidhuber 2003]` |
33
- | two authors | `[Surname & Surname Year]` | `[Mathews & Nagappan 2024]` |
34
- | three or more | `[Surname et al. Year]` | `[Zelikman et al. 2023]` |
35
- | an organisation | `[Org Year]` | `[Anthropic 2026a]` · `[GitHub 2025]` |
36
- | several at once | joined by `; ` | `[Schmidhuber 2003; Zelikman et al. 2023]` |
37
- | same author, same year | add a `Year`-letter suffix | `[Anthropic 2025a]` / `[Anthropic 2025b]` |
38
-
39
- The 3+-author rule becomes **et al.**; an organisation stands in as the author
40
- when no individual is credited; and when two org-authored sources collide on a year
41
- (several Anthropic 2025/2026 items do, below) a trailing letter disambiguates them.
42
- There is exactly one entry per cite-key.
43
-
44
- ## spec-kit ↔ ADD (and GSD)
45
-
46
- ADD shares the spec-first DNA of GitHub's **spec-kit** and the Claude-Code,
47
- context-rot-fighting niche of **GSD**. The phase models line up closely:
48
-
49
- | ADD phase | spec-kit command | GSD phase |
50
- |---|---|---|
51
- | foundation · principles | `/speckit.constitution` → `constitution.md` | (project setup / `CLAUDE.md`-level) |
52
- | §1 specify (what / why) | `/speckit.specify` → `spec.md` | **discuss** — capture decisions before planning |
53
- | §3 contract (how, frozen) | `/speckit.plan` → `plan.md`, `contracts/` | **plan** — research, decompose, fit fresh context |
54
- | milestone tasks / waves | `/speckit.tasks` → `tasks.md` | (phases → parallel waves) |
55
- | §5 build | `/speckit.implement` | **execute** — parallel waves, fresh 200k-token context each |
56
- | §6 verify | `/speckit.analyze` + `/speckit.checklist` | **verify** — walk what was built, fix before declaring done |
57
-
58
- **Where ADD diverges.** spec-kit stops at `implement`; GSD ends at verify (GSD Core
59
- adds a fifth *ship* phase). ADD closes the loop past both by adding three things
60
- neither has as a first-class gate: a **failing-tests-first** gate (§4 — no build
61
- starts until the tests are red for the right reason), an **observe→`fold`**
62
- self-improvement step (§7 — confirmed learnings consolidate into a versioned foundation),
63
- and an engine-tracked **dynamic goal-loop** that will hold a milestone open and
64
- reopen tasks until its exit criteria are met. ADD also deliberately targets **less
65
- doc-time than GSD** — a lean foundation and one human approval per task, rather than
66
- a document per phase. The shared lineage is real; the tests-first gate, the `fold`,
67
- and the goal-loop are ADD's contribution.
68
-
69
- ## 1. Recursive self-improvement
70
-
71
- - **When AI builds itself** (Favaro & Clark 2026) — https://www.anthropic.com/institute/recursive-self-improvement — essay. The RSI thesis: by 2026 >80% of code merged at Anthropic was Claude-authored and the 50%-task time-horizon keeps doubling; recursive self-improvement would shift humans from builders to validators. ↔ ADD: the seed source — ADD is the human-gated, evidence-trusted way to run a spec→build→verify→observe loop while the human stays the validator.
72
- - **Automated Alignment Researchers** (Anthropic 2026a) — https://www.anthropic.com/research/automated-alignment-researchers — research. Nine parallel Claude agents recovered ~97% of the human-expert gap on an alignment task in 5 days versus 7 for the human team. ↔ ADD: the strongest evidence the recursive loop is not speculative — parallel agents under review are exactly ADD's wave-plus-verify shape.
73
- - **Machines of Loving Grace** (Amodei 2024) — https://www.darioamodei.com/essay/machines-of-loving-grace — essay. A "country of geniuses in a datacenter," argued with a measured, bounded position on recursive self-improvement. ↔ ADD: the intent framing behind milestoning — bound the loop with human direction rather than let it run open.
74
- - **Gödel Machines: Self-Referential Universal Problem Solvers** (Schmidhuber 2003) — https://arxiv.org/abs/cs/0309048 — paper. A provably-optimal self-modifying agent that rewrites itself only when it can prove the rewrite helps. ↔ ADD: the mathematical anchor of the lineage — and a precedent for "only change on proof," which ADD enforces socially via the never-weaken-a-test rule.
75
- - **STOP: Self-Taught Optimizer** (Zelikman et al. 2023) — https://arxiv.org/abs/2310.02304 — paper. A scaffolding program recursively improves the code that improves code. ↔ ADD: the algorithmic kin of the `fold` step — consolidate confirmed learnings back into the method that produced them.
76
- - **Self-Refine: Iterative Refinement with Self-Feedback** (Madaan et al. 2023) — https://arxiv.org/abs/2303.17651 — paper. Generate→critique→refine with the same model lifts quality ~20% with no extra training. ↔ ADD: the micro-loop inside build→verify — produce, check against the contract, refine.
77
- - **Self-Rewarding Language Models** (Yuan et al. 2024) — https://arxiv.org/abs/2401.10020 — paper. A model acts as its own reward judge to improve across iterations. ↔ ADD: the risk ADD answers — a self-judging loop needs an external gate; ADD makes tests and a human the reward signal, not the model's own opinion.
78
- - **Reflexion: Language Agents with Verbal Reinforcement Learning** (Shinn et al. 2023) — https://arxiv.org/abs/2303.11366 — paper. Agents keep verbal reflections in episodic memory and retry, reaching 91% on HumanEval. ↔ ADD: the principle behind "reopen the task if criteria are unmet" — a failed check becomes feedback for the next attempt, not a dead end.
79
- - **Voyager: An Open-Ended Embodied Agent with LLMs** (Wang et al. 2023) — https://arxiv.org/abs/2305.16291 — paper. An auto-curriculum agent that grows a reusable skill library over time. ↔ ADD: the growing foundation — each milestone's consolidated deltas are ADD's accumulating skill library.
80
- - **AlphaEvolve: A Coding Agent for Scientific and Algorithmic Discovery** (Novikov et al. 2025) — https://arxiv.org/abs/2506.13131 — paper. An evolutionary coding agent that beat a long-standing matrix-multiplication record and shipped a production scheduler improvement. ↔ ADD: the end-state evidence — a generate-and-verify loop can exceed human baselines when every candidate is checked.
81
-
82
- ## 2. Autonomous & agentic workflows
83
-
84
- - **Building Effective Agents** (Schluntz & Zhang 2024) — https://www.anthropic.com/research/building-effective-agents — blog. The canonical taxonomy: prompt-chaining, routing, orchestrator-workers, and the evaluator-optimizer loop. ↔ ADD: the architecture cite — evaluator-optimizer is build→verify→refine; orchestrator-workers is ADD's wave parallelism.
85
- - **Enabling Claude Code to work more autonomously** (Anthropic 2025a) — https://www.anthropic.com/news/enabling-claude-code-to-work-more-autonomously — news. Checkpoints, subagents, hooks, background tasks, and `/rewind` rollback. ↔ ADD: checkpoint/rewind is the rollback strategy behind phase gates; hooks are where the engine enforces them.
86
- - **How we built our multi-agent research system** (Anthropic 2025b) — https://www.anthropic.com/engineering/multi-agent-research-system — blog. An Opus lead orchestrating Sonnet subagents, with an LLM acting as judge, lifting task performance ~90%. ↔ ADD: the lead-plus-subagents-plus-judge pattern is exactly ADD's wave execution under a verify gate.
87
- - **ReAct: Synergizing Reasoning and Acting in Language Models** (Yao et al. 2022) — https://arxiv.org/abs/2210.03629 — paper. Interleaving think→act→observe turns a model into an agent. ↔ ADD: the base loop every ADD phase runs on.
88
- - **Toolformer: Language Models Can Teach Themselves to Use Tools** (Schick et al. 2023) — https://arxiv.org/abs/2302.04761 — paper. Self-supervised learning of when and how to call external tools. ↔ ADD: the capability that lets an agent run its own tests, linters, and builds — the evidence ADD trusts.
89
- - **SWE-agent: Agent–Computer Interfaces Enable Automated Software Engineering** (Yang et al. 2024) — https://arxiv.org/abs/2405.15793 — paper. A designed agent–computer interface materially improves autonomous issue resolution. ↔ ADD: the structured agent↔environment contract — ADD's `add.py` engine is that interface for the method.
90
- - **The AI Scientist: Towards Fully Automated Open-Ended Scientific Discovery** (Lu et al. 2024) — https://arxiv.org/abs/2408.06292 — paper. A full idea→experiment→write→review research loop at ~$15 per paper. ↔ ADD: the research analog of ADD's loop — and a reminder that an automated reviewer is the weak link a human gate protects.
91
-
92
- ## 3. Spec-driven development & spec-kit
93
-
94
- - **GitHub Spec Kit** (GitHub 2025) — https://github.com/github/spec-kit — repo. The reference SDD toolkit: the phase model is `constitution` → `specify` → `plan` → `tasks` → `implement`, with the spec as the executable source of truth. ↔ ADD: the closest spec-first sibling — ADD's specify and contract phases map onto specify and plan; see the comparison table for the divergence.
95
- - **Spec-driven development with AI: get started with a new open-source toolkit** (Delimarsky 2025) — https://github.blog/ai-and-ml/generative-ai/spec-driven-development-with-ai-get-started-with-a-new-open-source-toolkit/ — blog. The spec-kit launch post; frames `tasks` as "TDD for your AI agent." ↔ ADD: independent articulation of why decomposing a spec into checkable units beats one big prompt.
96
- - **Spec-driven development: using Markdown as a programming language when building with AI** (Vesely 2025) — https://github.blog/ai-and-ml/generative-ai/spec-driven-development-using-markdown-as-a-programming-language-when-building-with-ai/ — blog. Spec-as-source, with context-rot named as the failure SDD exists to solve. ↔ ADD: the rationale for the frozen contract — a stable written spec is what survives when the model's context degrades.
97
- - **Get Shit Done (GSD)** (GSD 2025) — https://github.com/open-gsd/gsd-core — repo. A meta-prompting, context-engineering, spec-driven system for Claude Code; its `discuss` → `plan` → `execute` → `verify` cycle runs each phase in a fresh subagent context to fight context-rot (originally `gsd-build/get-shit-done`, now continued as GSD Core). ↔ ADD: ADD's closest peer — same Claude-Code, context-rot niche; ADD diverges with the tests-first gate, the observe→`fold` step, and the dynamic goal-loop, and aims for less doc-time than GSD.
98
- - **Beyond Vibe Coding: Amazon Introduces Kiro, the Spec-Driven Agentic IDE** (InfoQ 2025) — https://www.infoq.com/news/2025/08/aws-kiro-spec-driven-agent/ — blog. Kiro structures work as requirements→design→tasks with execution hooks. ↔ ADD: cross-vendor confirmation that spec-first is converging across the industry, not a single-tool idea.
99
- - **Spec-Driven Development: From Code to Contract in the Age of AI Coding Assistants** (Piskala 2026) — https://arxiv.org/abs/2602.00180 — paper. A taxonomy of SDD rigor — Spec-First, Spec-Anchored, Spec-as-Source — reporting human-refined specs can cut LLM code errors substantially, with BDD as SDD's ancestor. ↔ ADD: places ADD as "Spec-Anchored" and gives the academic vocabulary for the contract-freeze decision.
100
-
101
- ## 4. Tests-first & verification
102
-
103
- - **Test-Driven Development for Code Generation** (Mathews & Nagappan 2024) — https://arxiv.org/abs/2402.13521 — paper. Supplying tests alongside the prompt measurably lifts pass rates on MBPP and HumanEval. ↔ ADD: the empirical backbone of the failing-tests-first gate — tests as the constraint that makes generation verifiable.
104
- - **SWE-bench: Can Language Models Resolve Real-World GitHub Issues?** (Jimenez et al. 2023) — https://arxiv.org/abs/2310.06770 — paper. 2,294 real issues judged by whether the project's own tests pass; <2% solved at release. ↔ ADD: the yardstick that proves the point — "done" means the tests pass, which is exactly how ADD gates a feature.
105
- - **Our framework for developing safe and trustworthy agents** (Anthropic 2025c) — https://www.anthropic.com/news/our-framework-for-developing-safe-and-trustworthy-agents — news. Five principles: human control, transparency, alignment, privacy, and security. ↔ ADD: the frozen-contract gate and never-weaken-a-test rule are human control and transparency made concrete; the security HARD-STOP is the security principle.
106
- - **Responsible Scaling Policy v3.0** (Anthropic 2026b) — https://www.anthropic.com/news/responsible-scaling-policy-v3 — policy. The AI Safety Level framework; ASL-3 governs autonomous R&D capability. ↔ ADD: the governance ceiling that makes ADD's discipline necessary — as the loop gets more capable, the gates and the human-owned verify matter more, not less.
@@ -1,81 +0,0 @@
1
- # Advisor — spawning one subagent to follow your plan
2
-
3
- The **advisor** strategy: spawn a *single* subagent to execute one piece of your plan, then merge
4
- its verdict back. It is the single-subagent companion to `streams.md` (which pipelines *many* tasks
5
- in parallel worktrees) — you delegate *one* well-scoped piece and stay in the loop. The engine never
6
- spawns; this is your call per step.
7
-
8
- ## When to spawn — and when not
9
-
10
- Spawn when the piece is **separable and worth the round-trip**: a broad sweep; an independent adversarial review (the `6-verify` refute-read — fresh context, not graded by the author); a well-scoped batch; or context-offload to a small verdict.
11
-
12
- Do **not** spawn for narrow, cheap work — pay the round-trip only when the piece is big or independent enough. When in doubt, do it in-context.
13
-
14
- **Prefer the named roster.** Check first whether the piece fits one of ADD's five phase specialists — `add-design` (setup–contract) · `add-build` (tests·build) · `add-verify` (verify·observe) · `add-persona` (fit-persona selection) · `add-advisor` (a consultative second opinion) — before an ad-hoc spawn; each already carries the worker contract below.
15
-
16
- ## The 3-lens sequential checklist at verify
17
-
18
- At Verify, sweep security → concurrency → architecture in order. **Security HARD-STOP ends the checklist** (leave the rest blank). Each lens returns: **CLEAR** · **HARD-STOP** (security only) · **RESIDUE** (concurrency/architecture).
19
-
20
- Record it in §6 `### Advisor 3-lens verdict`: **Verdict** (PASS/HARD-STOP) · **Residue** (none or brief) · **Binding** (`yes` for `sensitivity: mechanical` — the engine reads it for `advisor-gate-relax`; `advisory` otherwise).
21
-
22
- **Persona for the refute-read.** When the piece is the earned-green refute-read, select a **Code-Reviewer** persona; its findings carry severity markers — 🔴 blocker · 🟡 concern · 💭 note. A persona is advisory: it never lowers a gate (a security finding still HARD-STOPs).
23
-
24
- ## The plan-following prompt template
25
-
26
- Give the subagent the *piece it owns* and a fixed return shape. This reuses `streams.md`'s
27
- worker-contract tags — identical on any runner; only the spawn adapter (see `streams.md`) changes.
28
- The `<strategy>` block mirrors the task's §5 as the subagent's PREFERRED path — it self-improves on that plan and reports the strategy it actually used.
29
-
30
- ```xml
31
- <objective>
32
- Execute THIS piece of the orchestrator's plan: {{PIECE}}. You own only this piece — not the
33
- surrounding decisions. Return a verdict; do not record state.
34
- </objective>
35
-
36
- <persona>
37
- SELECT the persona by frontmatter — flow: match first, then domain; read ONE body —
38
- and load `.add/personas/{{PERSONA_SLUG}}.md` —
39
- Identity→your stance · Critical Rules→constraints · Success Metrics→done-bar (streams.md's worker
40
- contract). No match → a {{DOMAIN}} engineer, correctness over speed; never blocks.
41
- Work step by step, following the plan:
42
- 1. Load the context files + the persona; confirm you understand the piece you own.
43
- 2. Do the work in small steps, honoring the orchestrator's plan and constraints.
44
- 3. Self-score your result with confidence.md; if any dimension < 0.9, refine before returning.
45
- </persona>
46
-
47
- <strategy>
48
- The task's §5 plan — the Strategy (ordered batches) order and the Known-problem fixes — is
49
- your PREFERRED starting path, not a hard rule. Improve on it when a better strategy emerges
50
- as you build; on done, report the strategy you ACTUALLY used so the orchestrator can update
51
- §5 for the audit trail.
52
- </strategy>
53
-
54
- <context_files>
55
- the plan / task files the piece needs (read-only unless the piece says otherwise)
56
- </context_files>
57
-
58
- <return>
59
- End with a structured verdict the orchestrator parses and RECORDS:
60
- { piece, persona, result, evidence, confidence: {per-dimension 0–1}, open_questions }.
61
- `persona` names the slug you adopted (or `generic`) — the orchestrator records which persona did the work.
62
- Do NOT run add.py or write any shared state — you propose, the orchestrator records.
63
- </return>
64
- ```
65
-
66
- ## Choosing the model — vendor-neutral tiers
67
-
68
- Pick the tier from `streams.md`: **mid** for an ordinary piece; **top** for a complex/ambiguous/
69
- cross-cutting one. The tier→model-id mapping + spawn adapter live there. A stronger model never buys
70
- back a gate: high-risk scope still escalates.
71
-
72
- ## The hard rule — delegate, don't abdicate
73
-
74
- <constraints>
75
- The engine never spawns — it's the orchestrating agent's choice. And:
76
- - the subagent PROPOSES; the orchestrator RECORDS — a worker never runs add.py or writes shared state;
77
- - delegation never lowers a gate — a SECURITY finding still HARD-STOPs and high-risk scope still escalates, whoever did the work;
78
- - the subagent returns its confidence.md self-score; a low score means refine or re-spawn, never a pass.
79
- </constraints>
80
-
81
- > Used per step: each phase guide's Advisor hook points here (the per-step hooks).
@@ -1,40 +0,0 @@
1
- # Foundation compaction — collapse the stable tail
2
-
3
- `fold.md` PREPENDS new learnings (newest-first); foundation compaction COLLAPSES the stable tail of each foundation spec into a rolled-up settled line — keeping PROJECT.md, CONVENTIONS.md, GLOSSARY.md, and MODEL_REGISTRY.md to one screen as the project grows.
4
-
5
- You **gather and propose**; the **human confirms**; you then write the settled line. This is a **convention**, not a command — there is no `add.py compact-foundation`. It is DISTINCT from engine `add.py compact <slug>` (the archive recovery-bundle move).
6
-
7
- ## When
8
-
9
- At **milestone close** (after `fold.md`) or **on demand** when a spec has grown past one screen. Always a SEPARATE step from `fold.md`.
10
-
11
- ## Eligibility
12
-
13
- An entry is compaction-eligible **IFF** its milestone is **shipped** (done/archived) **AND** it carries **zero open residues**/deltas. Unshipped or open-residue entries are NOT eligible (`open-residue-version`).
14
-
15
- ## The ritual
16
-
17
- 1. **Gather** — collect the stable, shipped, zero-residue tail of the target spec.
18
- 2. **Propose** — draft the per-spec rolled-up settled line and show the human.
19
- 3. **Confirm** — no write happens without confirmation.
20
- 4. **Write** — replace the collapsed tail with ONE settled line at the BOTTOM (newest-first: live records stay on top, settled line anchors at the tail), carrying a git/archive pointer.
21
-
22
- ## Per-spec rolled-line shapes
23
-
24
- - **PROJECT.md §Spec** — `[folded fv N..M]` bullets → `settled fvN–fvM — <theme> (see git)`.
25
- - **PROJECT.md §Key-Decisions** — shipped rows → `| settled <dateA>–<dateB> | <N> decisions rolled | … | see git |` at the tail.
26
- - **CONVENTIONS.md** — `(TAG)` learnings → `- settled conventions <range> — <N> rules (see git)`.
27
- - **GLOSSARY.md** — verbose stable definition → terse canonical line + `(rationale: see git)`.
28
- - **MODEL_REGISTRY.md** — superseded model rows → `Prior models: <list> (see git)`.
29
-
30
- ## Preservation
31
-
32
- - **Never delete** — summarize and point; a settled line is lossy on prose, lossless on traceability.
33
- - A git/archive pointer is mandatory (`trail-loss` if dropped).
34
- - OPEN residues stay live.
35
-
36
- ## Reject codes
37
-
38
- - `open-residue-version` — entry is unshipped or has ≥1 open delta/residue; leave it live.
39
- - `trail-loss` — the collapse would drop the git/archive pointer or audit summary.
40
- - `wrong-order` — a record is not newest-first, or the settled line is not at the tail.
@@ -1,52 +0,0 @@
1
- # Components — monorepo and multi-repo slices
2
-
3
- Opt-in pillar for a milestone spanning **more than one green bar** — a BE + its
4
- FE, a shared lib + two apps, services across repos. No components declared =
5
- byte-identical to a single-codebase project. Full narrative: `17-components.md`.
6
-
7
- ## Declare (never inferred)
8
-
9
- `.add/components.toml`:
10
-
11
- ```toml
12
- [component.gateway]
13
- root = "apps/gateway"
14
- green_bar = "pytest + pyright"
15
- [component.dashboard]
16
- root = "apps/web"
17
- green_bar = "vitest + a11y"
18
- ```
19
-
20
- A task binds with a `component: <name>` header → that root joins its §5 Scope,
21
- and verify holds it to that component's green-bar.
22
-
23
- ## The loop
24
-
25
- 1. **Per-component verify.** A bound task must CITE its green-bar in §6 evidence
26
- or the gate refuses `component_green_bar_uncited`. The engine never runs the
27
- suite — it **surfaces** the component's `verify` command (and records it in §6);
28
- you run it (NO-EXEC). The fast lane carries the same `component:` affordance.
29
- 2. **Freeze a cross-component contract.** Declare `[contract.<id>]`
30
- (producer + consumers). A task names its role `produces: <id>` / `consumes: <id>`.
31
- The producer's freeze (contract→tests) writes the immutable snapshot
32
- `.add/contracts/<id>.json`; the consumer pins its hash. A changed re-freeze
33
- flags consumers `contract_consumer_stale`; a missing/malformed snapshot
34
- HARD-STOPS — never build against an unfrozen shape.
35
- 3. **One milestone, full slice.** A `consumes:` task is HELD from advancing
36
- scenarios→contract (`producer_contract_unfrozen`) until the producer's snapshot
37
- exists — and `producer_contract_stale` if a live producer re-opened/drifted its
38
- §3 (freeze-recency). The FE stays downstream of the frozen BE, in one milestone.
39
- 4. **Across repos — federate.** A consumer repo declares `[federation.<id>]`
40
- (`source` + optional `pin`); `add.py federate pull <id>` validates and lands a
41
- byte-for-byte copy of the producer's snapshot locally. Fail-loud:
42
- unknown id / unreadable source / a `source` escaping the repo's allowlist
43
- (`federation_source_escapes`, confined to a repo-root sibling) / invalid
44
- snapshot / version mismatch each HARD-STOPS and lands nothing.
45
-
46
- ## Hold the line
47
-
48
- - **Declared, not inferred** — no scanning `apps/*`.
49
- - **No central server / no shared mutable state** — federation copies an immutable
50
- snapshot; each repo keeps its own `state.json`.
51
- - **No new approval** — engine-enforced gates on the six-step flow, not extra human
52
- checkpoints. Per-component ownership/autonomy is the identity story (`streams.md`).
@@ -1,32 +0,0 @@
1
- # Confidence — the self-score that aims attention
2
-
3
- The **confidence self-score** is an *advisory* check an agent runs on its own drafted artifact — a spec, a contract, a build, or a subagent verdict — *before* presenting it. It sharpens the draft and aims the reader's eye at the soft spots; it is never a gate.
4
-
5
- ## The six dimensions
6
-
7
- Score each 0–1 honestly on the artifact you are about to hand over:
8
-
9
- - **Completeness** — did it cover every rule, scenario, and rejection the task asked for?
10
- - **Clarity** — would the next reader understand it without you in the room?
11
- - **Practicality** — is it feasible and implementable as written, against the real code?
12
- - **Optimization** — does it balance correctness, simplicity, and cost — no gold-plating, no corner cut?
13
- - **Edge cases** — did it name the failure modes, the concurrency, the empty/oversized inputs?
14
- - **Self-evaluation** — does it carry its own refine step — a way to catch its own mistakes?
15
-
16
- If **any** dimension scores **< 0.9**, refine the artifact before presenting, then re-score.
17
-
18
- ## Where it plugs in
19
-
20
- - It **feeds the lowest-confidence flag** (run.md · 1-specify.md): the lowest-scoring dimension is what you surface ⚠-first at the contract freeze.
21
- - A persistently low score on a risky scope is a signal to **recommend** lowering the autonomy level (auto → conservative / manual; run.md) — the level stays the human's call.
22
-
23
- ## The hard rule — advisory, never a gate
24
-
25
- <constraints>
26
- The confidence self-score is advisory only — never a gate. It never:
27
- - auto-pass a verify or block a run — the verify outcome rests on evidence (passing tests, the non-functional review), not a self-assigned number;
28
- - substitutes for evidence or for the human decision point;
29
- - is recorded as a score the human "agreed to" — a self-asserted score that gated would only move an unread approval one level up (run.md).
30
-
31
- What it MAY do: aim the lowest-confidence flag, trigger a refine pass, and recommend an autonomy adjustment. The gate itself stays evidence-based and human-owned.
32
- </constraints>