cfsa-antigravity 6.0.0 → 6.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 (47) hide show
  1. package/package.json +1 -1
  2. package/template/.agents/skills/implement-slice-tdd/SKILL.md +30 -6
  3. package/template/.agents/skills/plan-phase-write/SKILL.md +17 -6
  4. package/template/.agents/skills/prd-templates/references/shard-boundary-analysis.md +3 -3
  5. package/template/.agents/skills/prd-templates/references/slice-completion-gates.md +8 -0
  6. package/template/.agents/skills/prd-templates/references/slice-depth-floor.md +96 -0
  7. package/template/.agents/skills/session-continuity/protocols/01-session-resumption.md +26 -1
  8. package/template/.agents/skills/session-continuity/protocols/03-progress-update.md +46 -0
  9. package/template/.agents/skills/write-be-spec-write/SKILL.md +62 -10
  10. package/template/.agents/skills/write-fe-spec-write/SKILL.md +51 -10
  11. package/template/.claude/instructions/workflow.md +1 -1
  12. package/template/.claude/skills/implement-slice-tdd/SKILL.md +18 -5
  13. package/template/.claude/skills/plan-phase-write/SKILL.md +11 -3
  14. package/template/.claude/skills/prd-templates/references/shard-boundary-analysis.md +3 -3
  15. package/template/.claude/skills/prd-templates/references/slice-completion-gates.md +8 -0
  16. package/template/.claude/skills/prd-templates/references/slice-depth-floor.md +96 -0
  17. package/template/.claude/skills/session-continuity/SKILL.md +9 -9
  18. package/template/.claude/skills/session-continuity/protocols/01-session-resumption.md +28 -3
  19. package/template/.claude/skills/session-continuity/protocols/03-progress-update.md +47 -1
  20. package/template/.claude/skills/session-continuity/protocols/04-pattern-extraction.md +2 -2
  21. package/template/.claude/skills/session-continuity/protocols/06-decision-analysis.md +1 -1
  22. package/template/.claude/skills/write-be-spec-write/SKILL.md +10 -7
  23. package/template/.claude/skills/write-fe-spec-write/SKILL.md +9 -7
  24. package/template/.codex/instructions/workflow.md +1 -1
  25. package/template/.codex/skills/implement-slice-tdd/SKILL.md +18 -5
  26. package/template/.codex/skills/plan-phase-write/SKILL.md +11 -3
  27. package/template/.codex/skills/prd-templates/references/shard-boundary-analysis.md +3 -3
  28. package/template/.codex/skills/prd-templates/references/slice-completion-gates.md +8 -0
  29. package/template/.codex/skills/prd-templates/references/slice-depth-floor.md +96 -0
  30. package/template/.codex/skills/session-continuity/SKILL.md +9 -9
  31. package/template/.codex/skills/session-continuity/protocols/01-session-resumption.md +28 -3
  32. package/template/.codex/skills/session-continuity/protocols/03-progress-update.md +47 -1
  33. package/template/.codex/skills/session-continuity/protocols/04-pattern-extraction.md +2 -2
  34. package/template/.codex/skills/session-continuity/protocols/06-decision-analysis.md +1 -1
  35. package/template/.codex/skills/write-be-spec-write/SKILL.md +10 -7
  36. package/template/.codex/skills/write-fe-spec-write/SKILL.md +9 -7
  37. package/template/.factory/skills/implement-slice-tdd/SKILL.md +18 -5
  38. package/template/.factory/skills/plan-phase-write/SKILL.md +11 -3
  39. package/template/.factory/skills/prd-templates/references/shard-boundary-analysis.md +3 -3
  40. package/template/.factory/skills/prd-templates/references/slice-completion-gates.md +8 -0
  41. package/template/.factory/skills/prd-templates/references/slice-depth-floor.md +96 -0
  42. package/template/.factory/skills/session-continuity/protocols/01-session-resumption.md +26 -1
  43. package/template/.factory/skills/session-continuity/protocols/03-progress-update.md +46 -0
  44. package/template/.factory/skills/write-be-spec-write/SKILL.md +10 -7
  45. package/template/.factory/skills/write-fe-spec-write/SKILL.md +9 -7
  46. package/template/.memory/pipeline/kit-sync.md +3 -3
  47. package/template/scripts/check-progress-consistency.mjs +304 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cfsa-antigravity",
3
- "version": "6.0.0",
3
+ "version": "6.1.0",
4
4
  "description": "CFSA Pipeline — Constraint-First Specification Architecture for AI agents. Production-grade from line one.",
5
5
  "scripts": {
6
6
  "changeset": "changeset",
@@ -90,7 +90,23 @@ After GREEN, scan new imports. If any package lacks a corresponding skill direct
90
90
  2. Read `.agents/skills/bootstrap-agents/SKILL.md` and invoke `/bootstrap-agents PIPELINE_STAGE=implement-slice` + the new dependency key
91
91
  3. **HARD GATE**: Follow the bootstrap verification protocol (`.agents/skills/prd-templates/references/bootstrap-verification-protocol.md`). Confirm the matching skill is installed before proceeding to REFACTOR.
92
92
 
93
- No new unregistered dependencies → skip to Step 5.
93
+ No new unregistered dependencies → skip to Step 4.9.
94
+
95
+ ## 4.9. Slice depth ratio gate (mandatory — derived from spec)
96
+
97
+ Read `.agents/skills/prd-templates/references/slice-depth-floor.md` in full. The slice's planned `phase-N.md` entry should already include a computed depth floor and breakdown (added by `/plan-phase-write` § 4.4). If it does not, compute it now from the slice's referenced spec sections.
98
+
99
+ 1. **Count delivered tests** for this slice. A "delivered test" is a test function that:
100
+ - Lives in this slice's test files (or shared test files with explicit slice-tag comments), AND
101
+ - Asserts a concrete behavior tied to a specific spec item (a field, a validation rule, an error code, a role, a state, an edge case)
102
+ - Smoke tests, snapshot tests with no assertions, and "test that it renders" tests do NOT count.
103
+ 2. **Compute ratio**: `delivered_tests / depth_floor`.
104
+ 3. **Hard gate**:
105
+ - `ratio >= 1.0` → proceed to Step 5.
106
+ - `ratio < 1.0` → **STOP**. List every uncovered spec item (per the floor's breakdown). Return to Step 3 (RED), write failing tests for each uncovered item, then proceed through GREEN again. Do not weaken the floor; do not skip uncovered items by claiming they are "implicit." Every floor item must have an explicit test.
107
+ 4. **Anti-cheat**: A test that asserts only `expect(result).toBeTruthy()` or `expect(response.status).toBe(200)` does not satisfy a floor item that requires verifying a specific field, error message, role denial, or state transition. Each floor item must be matched to at least one assertion that exercises that item's specific behavior.
108
+
109
+ Record the ratio and the matched item count in the slice progress file (`.memory/pipeline/progress/slices/<slice-id>.md`) under a `## Depth Ratio` section before proceeding.
94
110
 
95
111
  ## 5. Refactor
96
112
 
@@ -151,7 +167,7 @@ Read `.agents/skills/session-continuity/protocols/11-parallel-synthesis.md` and
151
167
 
152
168
  ## 7. Update progress (Mandatory)
153
169
 
154
- **CRITICAL**: You MUST NOT skip progress updates. Read `.agents/skills/session-continuity/protocols/03-progress-update.md` and follow **every step** — physically edit all four file targets (slice, phase, index, memory).
170
+ **CRITICAL**: You MUST NOT skip progress updates. Read `.agents/skills/session-continuity/protocols/03-progress-update.md` and follow **every step** — including the new step 8 (read-back verification), step 9 (cross-file consistency check), and step 10 (Completion Signature stamp). Physically edit all four file targets (slice, phase, index, memory) and run `node scripts/check-progress-consistency.mjs` before exiting this step.
155
171
 
156
172
  ## 8. Completion Gate
157
173
 
@@ -160,19 +176,27 @@ Read `.agents/skills/verification-before-completion/SKILL.md` and apply its disc
160
176
  Read `.agents/skills/prd-templates/references/slice-completion-gates.md` and verify every applicable checklist passes:
161
177
  - **UI Completeness Check** — FE slices only
162
178
  - **Spec Traceability Gate** — all slices
179
+ - **Spec Depth Floor Gate** — all slices
163
180
 
164
181
  Read `.agents/skills/prd-templates/references/tdd-testing-policy.md` and run the **QA Anti-Cheat Audit** checklist.
165
182
 
166
- You may not call `notify_user` until you have edited all four progress file targets (7a–7d).
183
+ **Cross-runtime progress gate (HARD STOP)**: Run `node scripts/check-progress-consistency.mjs`. If exit code is non-zero, you MAY NOT call `notify_user`. Fix every drift item the script reports, then re-run until exit 0. This gate exists because different agent runtimes (Claude, Antigravity, Codex, Factory) share the same `.memory/pipeline/progress/` tree — a silent partial update here means the next session in any runtime resumes from stale state and may redo or skip work.
184
+
185
+ You may not call `notify_user` until:
186
+ 1. All four progress file targets have been edited (Protocol 3 steps 1–7).
187
+ 2. Read-back verification passed for each (Protocol 3 step 8).
188
+ 3. `node scripts/check-progress-consistency.mjs` returned exit 0 (Protocol 3 step 9).
189
+ 4. Slice file has a `## Completion Signature` block stamped with date, runtime, verifier exit, and depth ratio (Protocol 3 step 10).
167
190
 
168
191
  Verify your edits by reading:
169
- - `.memory/pipeline/progress/slices/phase-NN-slice-NN.md` — Status: complete, [x] criteria
192
+ - `.memory/pipeline/progress/slices/phase-NN-slice-NN.md` — Status: complete, [x] criteria, Depth Ratio >= 1.0, Completion Signature present
170
193
  - `.memory/pipeline/progress/phases/phase-NN.md` — incremented progress fraction
171
194
  - `.memory/pipeline/progress/index.md` — updated overall percentage
172
195
 
173
196
  Your `notify_user` payload **MUST** include:
174
197
  1. Raw output from the three reads above
175
- 2. Updated overall progress (e.g., "Overall progress is now 75% (24/32 slices)")
176
- 3. Explicit next command: Run `/implement-slice` for [next slice name]
198
+ 2. Verifier exit code (must be `0`)
199
+ 3. Updated overall progress (e.g., "Overall progress is now 75% (24/32 slices)")
200
+ 4. Explicit next command: Run `/implement-slice` for [next slice name]
177
201
 
178
202
  **Infrastructure/Auth slice gate**: If this was the `00-infrastructure` or auth slice, the next command is `/verify-infrastructure`, not `/implement-slice`.
@@ -41,14 +41,13 @@ For each FE spec in the phase scope:
41
41
 
42
42
  The resulting list of slices is derived from the spec, not estimated from feature names. Do not aggregate slices by domain name or by "it feels like one feature."
43
43
 
44
- Estimate complexity (S/M/L) per derived slice. Flag any slice estimated L these are candidates for further splitting before ordering begins.
44
+ Estimate complexity (S/M/L) per derived slice as informational metadata only. **Do not split, merge, or drop slices to hit a complexity target.** Slice count is determined by the spec, never by an arbitrary cap.
45
45
 
46
- **L-slice enforcement**: Any slice marked **L** MUST be reviewed for splitting before Step 3. Present L slices to user: "These slices are estimated Large. Split each into 2-3 smaller slices, or confirm L is acceptable?" Wait for confirmation. Do not proceed to ordering with unreviewed L slices.
46
+ **L-slice handling (informational)**: If a slice is estimated L, surface it in the phase plan with the L tag and a one-line note explaining why it is large (e.g., "covers 4 endpoints with shared transaction boundary"). Splitting an L slice is permitted only when the spec itself contains a natural seam (e.g., two independent BE endpoints) — never to satisfy a count target.
47
47
 
48
- **Slice count sanity check**: After splitting, count total slices.
49
- - **1-15 slices** → normal.
50
- - **16-25 slices** warn: "Phase has [N] slices. Consider splitting into two phases if unrelated domains are grouped together."
51
- - **>25 slices** → **STOP**: "Phase has [N] slices — this is too many for one phase. Split into Phase N and Phase N+1, keeping dependency order intact."
48
+ **Slice count is informational**: Report the total slice count in the phase plan header. Do not stop, warn, or restructure based on count alone. A phase has as many slices as the spec produces. If the count feels uncomfortable, the correct response is to verify the spec is correctly scoped to this phase, not to compress slices.
49
+
50
+ **Phase splitting** is justified only by **dependency boundaries** (e.g., "auth must ship before any auth-gated feature"), not by slice count. If two independent domains are grouped in one phase by the architecture's phasing section, that is the architecture's call, not the planner's.
52
51
 
53
52
  **Good slice**: "User can submit an entity claim form" (one named user flow from the FE interaction spec)
54
53
  **Bad slice**: "Implement entity management" (domain name, not a spec-derived user flow)
@@ -129,6 +128,18 @@ Read `.agents/skills/prd-templates/references/operational-templates.md` for the
129
128
  - `QA`: Test writing (RED phase — runs FIRST), test verification (GREEN phase — runs LAST)
130
129
  - No tag: Contract/schema work, shared infra — handled sequentially by orchestrator
131
130
 
131
+ ## 4.4. Slice depth floor (mandatory — derived from spec)
132
+
133
+ Read `.agents/skills/prd-templates/references/slice-depth-floor.md` in full. For every slice, compute the **minimum acceptance-criteria count** using the formula in that file. Annotate the slice in `phase-N-draft.md` with the computed floor and its breakdown.
134
+
135
+ **Hard gate**:
136
+ 1. The acceptance-criteria count written in Step 4 MUST equal or exceed the computed floor for every slice. If it does not, return to Step 4 and add the missing criteria — every missing criterion must trace to a concrete spec item (validation rule, error code, role, state, edge case) that the slice covers.
137
+ 2. Apply the **Spec Thinness Detection** table from `slice-depth-floor.md`. If any slice's referenced spec section produces zero items in a required category, **STOP**. Do not write shallow criteria from a thin spec. Tell the user: "Spec [BE/FE/IA §...] is too thin to produce a meaningful slice. Run `/resolve-ambiguity [path]` before continuing." Wait for the spec to be deepened, then re-run this step.
138
+
139
+ The floor is the **minimum**, not the maximum. Implementers may add criteria beyond the floor; they may not write fewer.
140
+
141
+ This step exists to prevent shallow slices from being green-lit by the criteria-counting gate. Without it, a slice can be planned with 3 criteria when its specs collectively define 18 items that need explicit verification.
142
+
132
143
  ## 4.5. Identify parallel groups (TDD order)
133
144
 
134
145
  Read `.agents/skills/parallel-agents/SKILL.md` and follow its TDD-Order Dispatch methodology for parallel groups and execution order. Flag any tasks that can't be parallelized (shared file dependencies) in the plan.
@@ -88,7 +88,7 @@ The decomposition should produce a shard count proportional to the ideation dept
88
88
  | **Small** | 3–5 | 4–8 | Most domains map 1:1 to shards |
89
89
  | **Medium** | 6–8 | 7–14 | Some multi-domain splits expected |
90
90
  | **Large** | 9–12 | 12–20 | Cross-cutting shards multiply; enforce sub-feature limits aggressively |
91
- | **Deep** | 13+ | 16–25 | Maximum recommended. Beyond 25 → consider surface-level decomposition or domain grouping |
91
+ | **Deep** | 13+ | 16+ | Beyond 25 → review whether each additional shard reflects a true domain boundary or an over-decomposition; do not force a cap if boundaries are real |
92
92
 
93
93
  ### Total Count Thresholds (Post-Skeleton Check)
94
94
 
@@ -98,6 +98,6 @@ After all shard skeletons are created in Step 5, count the total:
98
98
  |--------------|--------|
99
99
  | **≤ 20** | ✅ Proceed |
100
100
  | **21–25** | ⚠️ Warning — "Decomposition produced [N] shards. This will require [N × 3] spec documents (IA + BE + FE) and proportional phase planning. Confirm this is the intended scope or consider grouping related domains." |
101
- | **> 25** | 🛑 **Hard stop** — "Decomposition produced [N] shards. This exceeds the recommended maximum for sequential agent processing. Present a domain grouping proposal that reduces shard count to 25." |
101
+ | **> 25** | ⚠️ Informational — "Decomposition produced [N] shards. This is fine if each shard reflects an independent domain boundary. Review the boundary justification for any shard with strong dependency coupling to a sibling and merge if the coupling indicates the same domain." Proceed after acknowledgment. |
102
102
 
103
- > **Why 25 max**: Each shard produces ~3 spec documents (IA + BE + FE). At 25 shards, that's 75 spec documents. Beyond this, cross-layer consistency checks become unreliable and phase planning produces impractical slice counts.
103
+ > **Why no upper cap**: Shard count must reflect domain boundaries, not an arbitrary processing limit. The justification for splitting or merging shards is **dependency coupling**, not count: shards with high mutual dependency belong together; shards with independent domains belong apart. Spec quality is enforced by the per-shard content-completeness floors in BE/FE, not by limiting total shard count. If 35 shards each represent a distinct domain, 35 shards is correct.
@@ -18,6 +18,14 @@ Non-FE slices skip this block.
18
18
  - [ ] No `// DECISION:` annotations exist for behaviors that are actually specified in the BE spec or IA shard (i.e., no spec-defined behavior was treated as an undocumented implementation decision)
19
19
  - [ ] The {{CONTRACT_LIBRARY}} contract written in Step 2 matches the delivered implementation field-for-field — no fields added, removed, or renamed during implementation without a corresponding contract update
20
20
 
21
+ ## Spec Depth Floor Gate (all slices)
22
+
23
+ - [ ] Slice depth floor was computed from BE/FE/IA spec content during `/plan-phase` and recorded in the phase plan (`.memory/pipeline/progress/phases/phase-N.md`) for this slice
24
+ - [ ] Acceptance criteria count for this slice meets or exceeds the recorded depth floor (slice may not ship with fewer criteria than the floor)
25
+ - [ ] Slice depth ratio (`delivered_tests / depth_floor`) is recorded in `.memory/pipeline/progress/slices/<slice-id>.md` under `## Depth Ratio` and is `≥ 1.0`
26
+ - [ ] Anti-cheat: every floor item has at least one delivered test that asserts the specific spec behavior — no `expect(true).toBeTruthy()`, no bare `expect(res.status).toBe(200)`, no snapshot-only or render-only tests counted toward the floor
27
+ - [ ] Every required category from the spec (validation rules, error codes, authorization rows, idempotency behavior, rate limit behavior, observability hooks for BE; state enumeration, role variants, accessibility inventory, navigation behavior, network-degradation for FE) is represented by ≥1 explicit assertion
28
+
21
29
  ## Resource Cleanup Gate (all slices)
22
30
 
23
31
  - [ ] Every database client or connection created in this slice has a corresponding cleanup call (`disconnect`, `close`, `end`, `dispose`) in a `finally` block or lifecycle hook
@@ -0,0 +1,96 @@
1
+ # Slice Depth Floor
2
+
3
+ **Purpose**: Define the minimum depth a slice must have, derived from the specs it covers. This document is the authoritative source for two gates:
4
+
5
+ 1. **Plan-phase floor** (`/plan-phase-write` Step 4) — minimum acceptance-criteria count per slice, computed from spec breadth. Refuses to plan a shallow slice.
6
+ 2. **Implement-slice floor** (`/implement-slice-tdd` Step 5) — minimum delivered test count per slice, computed from the same formula. Refuses to mark a slice complete if test depth is below the floor.
7
+
8
+ The floor is **derived from the specs the slice references** — not invented, not estimated, not negotiable. If the specs are too thin to produce a meaningful floor, the spec is wrong and must be deepened first (see `write-be-spec-write` § Pass 4 and `write-fe-spec-write` § Pass 5).
9
+
10
+ ---
11
+
12
+ ## The Formula
13
+
14
+ For a single slice, the **expected criteria/test count** is the sum of every item below that the slice's referenced spec sections produce. Count each item exactly once.
15
+
16
+ ### BE-derived items (per BE spec section the slice covers)
17
+
18
+ | Item | What to Count |
19
+ |------|---------------|
20
+ | **Happy-path** | 1 per endpoint covered by the slice |
21
+ | **Field validation** | 1 per validated request field × constraint (e.g., `email` with `required` + `format` + `maxLength` = 3) |
22
+ | **Field validation messages** | 1 per distinct error message a validator can produce |
23
+ | **Error codes** | 1 per error code defined in the BE spec for those endpoints (`4xx`, `5xx` differentiated) |
24
+ | **Authorization** | 1 per role × endpoint combination defined in the BE spec's `## Access Control` (including the deny case for unauthorized roles) |
25
+ | **Ownership / scoping** | 1 per ownership rule (e.g., user can only read their own records) |
26
+ | **Idempotency / concurrency** | 1 per idempotency or race-condition rule from BE Pass 2 (sequencing & concurrency) |
27
+ | **Failure cascade** | 1 per rollback or transaction-boundary rule from BE Pass 3 |
28
+ | **Rate limiting** | 1 per rate-limit rule defined for the endpoint (boundary test that asserts the limit triggers) |
29
+
30
+ ### FE-derived items (per FE spec component/flow the slice covers)
31
+
32
+ | Item | What to Count |
33
+ |------|---------------|
34
+ | **States** | 1 per distinct UI state per data-fetching component: `idle`, `loading`, `error` (per error class), `empty`, `success`, `optimistic-pending`, `optimistic-rollback` (only count states the spec actually defines) |
35
+ | **Role variants** | 1 per non-trivial cell in the component's role × feature matrix (every `hidden`, `locked`, `read-only` cell in addition to `full`) |
36
+ | **Responsive variants** | 1 per breakpoint that changes interaction (not just layout) — e.g., touch swipe replacing drag |
37
+ | **Form fields** | 1 per form field × validation rule (mirrors BE field validation but exercised through the UI) |
38
+ | **Navigation** | 1 per route guard, deep-link entry, browser-back behavior, and multi-tab scenario defined in FE Pass 3 |
39
+ | **Accessibility** | 1 per row in the component's accessibility inventory (WCAG criterion + keyboard binding + screen-reader behavior count as one row) |
40
+ | **Network degradation** | 1 per loading-threshold/retry/timeout rule from FE Pass 2 |
41
+
42
+ ### IA-derived items (per IA shard section the slice's domain references)
43
+
44
+ | Item | What to Count |
45
+ |------|---------------|
46
+ | **Edge cases** | 1 per `## Edge Cases` item in the IA shard relevant to this slice |
47
+ | **Acceptance criteria** | 1 per Given/When/Then in the IA shard's testability section relevant to this slice |
48
+ | **Junior/age-restricted rules** | 1 per content-gating rule that affects this slice |
49
+
50
+ ---
51
+
52
+ ## Computing the Floor
53
+
54
+ ```
55
+ floor(slice) = sum(all items above for every spec section the slice references)
56
+ ```
57
+
58
+ Annotate each slice in the phase plan with its computed floor and the breakdown:
59
+
60
+ ```markdown
61
+ ### Slice 3: Submit entity claim form
62
+ **Spec depth floor**: 18 criteria
63
+ - BE 04-entities §3.2: 1 happy + 4 fields × 2 constraints + 5 error codes + 3 roles + 2 ownership = 19 → adjusted 14 (deny-case overlaps)
64
+ - FE 04-entity-claim §EntityClaimForm: 5 states + 1 role variant + 4 form fields + 2 a11y = 12 → adjusted 4 (form fields overlap with BE)
65
+ - IA 04-entities §Edge Cases: 0 relevant
66
+ **Floor total**: 18
67
+ ```
68
+
69
+ The acceptance criteria written in `/plan-phase-write` Step 4 must equal or exceed this floor. The delivered test count in `/implement-slice-tdd` Step 5 must equal or exceed this floor.
70
+
71
+ ---
72
+
73
+ ## Spec Thinness Detection
74
+
75
+ If any spec section the slice references produces **zero items** in a category where items would be expected for the type of work the slice does, the spec is too thin. Apply the rule:
76
+
77
+ | Slice Type | Required Non-Zero Categories |
78
+ |------------|------------------------------|
79
+ | Any BE endpoint slice | happy-path, field validation, error codes, authorization |
80
+ | Any FE data-fetching slice | states (≥3: loading, error, success), accessibility (≥1) |
81
+ | Any FE form slice | states, form fields × validation, accessibility |
82
+ | Any role-conditional slice | role variants (≥1) |
83
+
84
+ If a required category is zero:
85
+
86
+ > ❌ **STOP** — Slice "[name]" references spec section [BE/FE/IA §...] which produces 0 [category] items. The spec is too thin to produce a meaningful slice. Run `/resolve-ambiguity` on the spec before planning this slice. Do not write acceptance criteria from a thin spec — that produces shallow code.
87
+
88
+ ---
89
+
90
+ ## Rationale
91
+
92
+ Without this floor, slice depth is bounded by the implementer's interpretation of "what's a reasonable test count." Two implementers can read the same FE spec and produce 3 vs 12 tests and both feel justified. The floor turns a subjective bound into a deterministic count derived from spec content.
93
+
94
+ Without this floor, the pipeline can produce passing tests for shallow slices that omit half the spec's validation rules, error cases, or role variants — and the existing "tests pass" gate green-lights it. The floor closes that loophole.
95
+
96
+ The floor is **not a maximum**. Implementers may exceed it. It is the minimum below which a slice is structurally shallow regardless of how many tests pass.
@@ -29,10 +29,35 @@
29
29
 
30
30
  6. **Read `.memory/wiki/decisions.md`** — load key decisions for context.
31
31
 
32
- 7. **Summarize for the current task**:
32
+ 7. **Drift scan (mandatory runtime-agnostic)**
33
+
34
+ Before trusting the resumption point, run the cross-file consistency verifier:
35
+
36
+ ```
37
+ node scripts/check-progress-consistency.mjs
38
+ ```
39
+
40
+ - Exit 0 → progress files agree across slice/phase/index. Trust the resume point and continue to step 8.
41
+ - Exit 1 → drift. A previous session (possibly in a different runtime — Claude, Antigravity, Codex, Factory) committed work but did not finish updating all four progress targets. **DO NOT silently re-do or skip past the affected slice.** Surface the verifier's full output to the user with this exact framing:
42
+
43
+ ```
44
+ Progress drift detected from a previous session. Before resuming, the following must be reconciled:
45
+ <verifier output>
46
+
47
+ Likely cause: another runtime completed work but did not finish updating all progress files (Protocol 3 steps 8–10 were skipped or interrupted).
48
+
49
+ Recommended action: hand-edit the offending files to match the actual completion state on disk (check `git status`, slice's Completion Signature block, and test pass/fail), then re-run this check. I will not advance until the verifier returns 0.
50
+ ```
51
+
52
+ - Exit 2 → malformed progress files. **STOP**: report and ask the user before attempting repair.
53
+
54
+ If `scripts/check-progress-consistency.mjs` does not exist in the project (older installation), note this and recommend `/sync-kit`, then fall back to manually opening `index.md` + the latest in-progress phase file + that phase's slice files and confirming the fractions and checkboxes match before resuming.
55
+
56
+ 8. **Summarize for the current task**:
33
57
  ```
34
58
  Status: Phase 2 in progress — 3/7 slices complete (43%)
35
59
  Last session: Completed auth middleware slice, deferred rate limiting (blocked on Redis)
36
60
  Blockers: 1 active — Redis connection config needed
61
+ Drift scan: clean (verifier exit 0)
37
62
  Resume at: Phase 2, Slice 4 — Rate limiting middleware
38
63
  ```
@@ -68,3 +68,49 @@
68
68
  - **Resolution**: Pinned to v12.0.0, added to package.json overrides
69
69
  - **Resolved**: 2026-02-14
70
70
  ```
71
+
72
+ 8. **Read-back verification (mandatory — runtime-agnostic)**
73
+
74
+ After every write in steps 1–6, immediately read each file back and confirm the change landed. This mirrors Protocol 8 step 6 and is required because different agent runtimes (Claude, Antigravity, Codex, Factory) all write to the same `.memory/pipeline/progress/` tree — a silent partial write here means the next session in any runtime will resume from stale state.
75
+
76
+ For each of the four targets you wrote (slice file, phase file, index.md, plus blockers/decisions/patterns if touched):
77
+
78
+ (a) Re-read the file with a fresh read.
79
+ (b) Confirm the specific bytes you intended to write are present:
80
+ - Slice file: `**Status**: complete` line is present.
81
+ - Phase file: the `**Slice N**` row checkbox is `[x]`, and the `**Progress**: X/Y` header reflects the new count.
82
+ - `index.md`: the phase row's status and `X/Y` cell match the phase file, and `**Overall**: X/Y` is recalculated.
83
+ (c) If any check fails:
84
+ - Log: `"Progress write-back failed for [file]: expected [value], saw [actual]"`
85
+ - Retry the write **once**.
86
+ - Re-read and re-verify.
87
+ - If second attempt fails → **STOP**: `"Unable to update [file] after 2 attempts. Do not call notify_user. Do not advance the slice. Investigate before continuing."`
88
+ (d) On success, log: `"Progress write-back verified: slice/phase/index all consistent."`
89
+
90
+ 9. **Cross-file consistency check (mandatory — runtime-agnostic)**
91
+
92
+ Run the verifier:
93
+
94
+ ```
95
+ node scripts/check-progress-consistency.mjs
96
+ ```
97
+
98
+ (If `scripts/check-progress-consistency.mjs` does not exist in the project — for example, an older installation that has not been synced — fall back to manual cross-checking: open all three files (slice, phase, index) side-by-side and verify the slice's status, the phase's `X/Y`, and the index's overall `X/Y` are all internally consistent. Then `/sync-kit` to pull the verifier in.)
99
+
100
+ - Exit code 0 → consistent. Proceed.
101
+ - Exit code 1 → drift. Read the script's output, fix every reported drift item by editing the affected file(s), and re-run the script until it returns 0. **STOP and do not call `notify_user` until the script returns 0.**
102
+ - Exit code 2 → malformed file. The progress files are unreadable or missing required headers. **STOP**: report the malformed file and the reason; do not attempt repair without user confirmation, since malformed progress files usually indicate a deeper schema mismatch.
103
+
104
+ This check exists because checkbox edits and fraction edits are easy to forget independently. The script catches the four most common drift patterns: phase fraction ≠ checkbox count, slice file status ≠ phase row checkbox, index overall ≠ sum of phases, index per-phase row ≠ phase file. It runs in any runtime with Node available.
105
+
106
+ 10. **Stamp the slice with a completion signature** — append (or update) at the bottom of `slices/phase-NN-slice-NN.md`:
107
+
108
+ ```markdown
109
+ ## Completion Signature
110
+ - Completed: <ISO date>
111
+ - Runtime: <claude | antigravity | codex | factory | other>
112
+ - Verifier: check-progress-consistency.mjs exit 0
113
+ - Depth ratio: <ratio> (>= 1.0 required)
114
+ ```
115
+
116
+ The signature is what lets a different runtime opening the project later trust that the slice is genuinely done — not just that someone ticked a box.
@@ -53,15 +53,27 @@ Read `.agents/skills/prd-templates/references/be-spec-template.md` for the docum
53
53
 
54
54
  Write decision to disk. Continue below.
55
55
 
56
- ### 7.5. Spec complexity gate
56
+ ### 7.5. Spec content completeness floor
57
57
 
58
- Count the total lines in the written BE spec file.
58
+ Spec depth is enforced by **content completeness**, not line count. A short spec that omits validation rules, error codes, or auth coverage is broken; a long spec that enumerates them is correct. There is no upper bound on length.
59
59
 
60
- | Lines | Action |
61
- |-------|--------|
62
- | **≤ 600** | Pass |
63
- | **601–800** | ⚠️ Warning — "This BE spec is [N] lines. Consider splitting if endpoint groups are independently testable." Proceed after acknowledgment. |
64
- | **> 800** | 🛑 **Hard stop** "This BE spec is [N] lines and will degrade implementation quality. Split the parent IA shard or separate endpoint groups into distinct BE specs." Present the largest sections with line counts. |
60
+ For **every endpoint** in this spec, verify all of the following are explicitly present:
61
+
62
+ | Required item | What "present" means |
63
+ |---------------|---------------------|
64
+ | Request schema | Every field with type, constraints (required/optional, min/max, format, enum), and example |
65
+ | Response schema (success) | Full body shape including envelope, pagination metadata, and computed fields |
66
+ | Response schema (each error class) | Body shape for every error code listed below |
67
+ | Validation rules | One row per (field × constraint) with the exact rejection error code and message |
68
+ | Error codes | At minimum: any `4xx` produced by validation, any `4xx` produced by auth/authz, `404` if resource is addressable, `409` if uniqueness or version conflicts apply, `429` if rate-limited, `5xx` for downstream failure cascades |
69
+ | Authorization | One row per role × this endpoint, with allow/deny outcome and any ownership/scoping rule |
70
+ | Idempotency | Explicit statement of behavior on duplicate submission (idempotent / safe-to-retry / not-idempotent + dedupe strategy) |
71
+ | Rate limit | Per-role limit (or "inherits global default" pointing at api-conventions) |
72
+ | Observability | Log fields emitted, metric names incremented, audit-trail entries written |
73
+
74
+ **Hard gate**: If any cell above is missing for any endpoint, the spec is incomplete. Fill it in. Do **not** count missing items as "implicit," "obvious," or "covered by conventions" — every endpoint must surface its full table even when it inherits from a shared convention.
75
+
76
+ **Length is informational**: Report the line count for the spec in the index entry as metadata only. Do not stop, warn, or split based on length. Splitting is justified only by domain boundaries (e.g., two unrelated entity groups in one shard) — not by size.
65
77
 
66
78
  ## 8. Update the BE index
67
79
 
@@ -108,9 +120,49 @@ For each endpoint that mutates data:
108
120
  Add any new transaction boundary requirements, rollback specifications, or consistency guarantees.
109
121
 
110
122
  **Pass loop guard**: Track total pass count.
111
- - Passes 1-3 → mandatory.
112
- - Pass 4-5 → optional, run if prior pass produced significant additions.
113
- - **After pass 5** → **STOP**: "5 deepening passes completed. Present remaining gaps to user: continue deepening or accept current spec depth?"
123
+ - Passes 1-7 → mandatory.
124
+ - Passes 8+ → optional, run if prior pass produced significant additions.
125
+ - **After pass 10** → **STOP**: "10 deepening passes completed. Present remaining gaps to user: continue deepening or accept current spec depth?"
126
+
127
+ ### Pass 4: Authorization completeness
128
+
129
+ Build a role × endpoint matrix for this spec. Every cell must be one of: `allow`, `allow-own-only`, `allow-team-only`, `deny`, or `deny-with-reason-code`. No empty cells, no "tbd," no "see other doc."
130
+
131
+ For every `allow-*-only` cell, the spec must define:
132
+ - The exact ownership predicate (e.g., `record.created_by == auth.user_id`)
133
+ - The error code returned when the predicate fails
134
+ - Whether the predicate is enforced in the application layer, the database layer (RLS / policies), or both
135
+
136
+ For every `deny` cell, the spec must define the error code returned. `404` vs `403` for unauthorized reads of existing records must be an explicit decision, not an oversight.
137
+
138
+ ### Pass 5: Observability and audit trail
139
+
140
+ For every endpoint, enumerate:
141
+ - **Structured log entries** emitted on success, on each error class, and on slow-path / degraded-mode execution
142
+ - **Metrics** incremented: counters (request count, error count per class), histograms (latency, payload size), gauges (in-flight requests if relevant)
143
+ - **Audit-trail entries** for any state-changing endpoint: actor, action verb, target entity ID, timestamp, before/after diff (or pointer to it), correlation ID
144
+ - **Trace span attributes** added to the request span beyond defaults (e.g., `entity.id`, `tenant.id`, `feature.flag.X`)
145
+
146
+ Add any missing observability hook to the endpoint spec, or to the api-conventions spec if it should be cross-cutting.
147
+
148
+ ### Pass 6: Rate-limit and abuse-protection edge cases
149
+
150
+ For every endpoint:
151
+ - Anonymous-vs-authenticated rate limits (anonymous must always be stricter; if endpoint is auth-only, state explicitly that anonymous receives `401` before rate-limit logic runs)
152
+ - Per-IP vs per-user vs per-tenant limit boundaries
153
+ - Burst behavior (token-bucket vs fixed-window)
154
+ - Behavior when limit is exceeded: `429` with `Retry-After` header, log event, metric increment
155
+ - Abuse pattern handling: brute-force detection on auth endpoints, enumeration protection (return same response for "user not found" and "wrong password"), mass-assignment protection (whitelist allowed fields explicitly per endpoint)
156
+
157
+ ### Pass 7: Failure-mode partial-state hygiene
158
+
159
+ For every multi-step endpoint (e.g., create-then-link-then-notify):
160
+ - Identify each external dependency (database, queue, email, third-party API)
161
+ - For each, specify behavior when that dependency fails: rollback, compensate, queue-for-retry, fail-and-surface-to-user
162
+ - Identify which combinations of partial failures are possible
163
+ - Specify the user-facing error code and message for each combination
164
+
165
+ If the endpoint cannot guarantee atomicity, the spec must say so explicitly and define the reconciliation strategy.
114
166
 
115
167
  ## 10. Cross-reference check
116
168
 
@@ -42,15 +42,26 @@ Read `.agents/skills/prd-templates/references/fe-spec-template.md` for the docum
42
42
 
43
43
  Write decision to disk. Continue below.
44
44
 
45
- ### 6.5. Spec complexity gate
45
+ ### 6.5. Spec content completeness floor
46
46
 
47
- Count the total lines in the written FE spec file.
47
+ Spec depth is enforced by **content completeness**, not line count. There is no upper bound on length.
48
48
 
49
- | Lines | Action |
50
- |-------|--------|
51
- | **≤ 600** | Pass |
52
- | **601–800** | ⚠️ Warning — "This FE spec is [N] lines. Consider splitting if component groups are independently testable." Proceed after acknowledgment. |
53
- | **> 800** | 🛑 **Hard stop** "This FE spec is [N] lines and will degrade implementation quality. Split into separate FE specs per component group or page." Present the largest sections with line counts. |
49
+ For **every component, view, and form** in this spec, verify all of the following are explicitly present:
50
+
51
+ | Required item | What "present" means |
52
+ |---------------|---------------------|
53
+ | State enumeration | Every distinct state defined: `idle`, `loading`, `error` (per error class produced by the BE), `empty`, `success`, plus `optimistic-pending` and `optimistic-rollback` for any optimistic mutation. "Loading" is one state per data dependency, not one shared state. |
54
+ | Role variants | Every cell in the role × component matrix explicitly defined: `full`, `read-only`, `partial-hidden` (with which fields hidden), `disabled` (with which actions disabled), `not-rendered`. No empty cells. |
55
+ | Form fields | Every field with type, validation rules, error message text per rule, on-blur vs on-submit behavior, disabled conditions |
56
+ | Empty / loading / error UI | Concrete copy for empty state, loading skeleton structure, error message + retry affordance per error class |
57
+ | Responsive variants | Every breakpoint that changes interaction behavior (not just layout) listed with the specific behavior change |
58
+ | Accessibility inventory | Per interactive element: WCAG criterion satisfied, keyboard binding, focus order, screen-reader announcement text, ARIA attributes |
59
+ | Navigation behavior | Browser back, deep-link entry, bookmarkability, multi-tab, and unsaved-changes guard for every route |
60
+ | Network degradation | Loading-threshold (when does the loading UI promote to a slow-network UI), retry behavior, offline behavior |
61
+
62
+ **Hard gate**: If any cell is missing for any component, the spec is incomplete. Fill it in. Do **not** count missing items as "implicit," "obvious," or "covered by the design system" — every component must surface its full table even when it inherits from a shared pattern.
63
+
64
+ **Length is informational**: Report the line count for the spec in the index entry as metadata only. Splitting is justified only by component-group boundaries (e.g., entirely independent surface areas) — not by size.
54
65
 
55
66
  ## 7. Update the FE index
56
67
 
@@ -105,9 +116,39 @@ For each component with responsive breakpoints defined:
105
116
  Add any new touch interaction specs or mobile-specific behavior.
106
117
 
107
118
  **Pass loop guard**: Track total pass count.
108
- - Passes 1-4 → mandatory.
109
- - Pass 5 → optional, run if prior pass produced significant additions.
110
- - **After pass 5** → **STOP**: "5 deepening passes completed. Present remaining gaps to user: continue deepening or accept current spec depth?"
119
+ - Passes 1-7 → mandatory.
120
+ - Passes 8+ → optional, run if prior pass produced significant additions.
121
+ - **After pass 10** → **STOP**: "10 deepening passes completed. Present remaining gaps to user: continue deepening or accept current spec depth?"
122
+
123
+ ### Pass 5: State enumeration completeness
124
+
125
+ For each component that consumes data:
126
+ - List every distinct state the component can be in. At minimum: `idle`, `loading`, `error` (one per BE error class returned), `empty`, `success`, `optimistic-pending` (if mutating), `optimistic-rollback` (if mutating), `disabled` (if any role removes interaction), `degraded` (if network slowness has a separate UI).
127
+ - For each state, define: visual treatment, available interactions, transition triggers in/out, and whether it persists across navigation.
128
+ - For each error state, define the user-visible message text per error class, the retry affordance, and whether the user must take action to clear the state.
129
+ - Empty states must include the empty copy + the affordance to leave the empty state (e.g., "Create your first entity").
130
+
131
+ Flag any component where states were collapsed (e.g., all errors share one "something went wrong" message). Spec must enumerate per-class behavior unless the spec explicitly states uniform handling is the design choice.
132
+
133
+ ### Pass 6: Role-conditional rendering exhaustion
134
+
135
+ Build a role × component matrix for this spec. Every cell must be one of: `full`, `read-only`, `partial-hidden`, `disabled`, `not-rendered`. No empty cells, no "tbd," no "see other doc."
136
+
137
+ For every `partial-hidden` cell, list which fields/actions are hidden.
138
+ For every `read-only` cell, list which controls become non-interactive.
139
+ For every `disabled` cell, list which actions are disabled and the user-visible explanation (tooltip, badge, inline message).
140
+ For every `not-rendered` cell, specify whether the layout slot collapses or shows a placeholder.
141
+
142
+ ### Pass 7: Accessibility edge-case enumeration
143
+
144
+ For every interactive component:
145
+ - **Keyboard**: Tab order, focus trap behavior in modals, escape behavior, arrow-key navigation in composite widgets (menus, tabs, listboxes), enter/space activation.
146
+ - **Screen reader**: Announcement text for state changes (loading start, loading complete, error appeared, success), live-region usage (`polite` vs `assertive`), label-vs-description distinction.
147
+ - **Focus management**: Where focus moves on modal open/close, on route change, on form submit, on async error.
148
+ - **Color and contrast**: Required contrast ratios per element, behavior under high-contrast mode, behavior when color alone conveys state.
149
+ - **Motion**: Respect for `prefers-reduced-motion`, alternative non-animated affordances for motion-conveyed information.
150
+
151
+ If the spec inherits from a design-system accessibility doc, cite the section explicitly per component — do not leave it implicit.
111
152
 
112
153
  ## 9. Cross-reference check
113
154
 
@@ -37,7 +37,7 @@ Do NOT mark a task complete until all validations pass.
37
37
 
38
38
  After completing a workflow or substantial task:
39
39
 
40
- - **Pattern Extraction**: Read `.claude/skills/session-continuity/protocols/04-pattern-extraction.md` and follow the **Pattern Extraction Protocol**. Reflect on what worked, what didn't, and log reusable patterns to `memory/patterns.md`. Skip only if the task was trivial (routine, nothing new learned).
40
+ - **Pattern Extraction**: Read `.claude/skills/session-continuity/protocols/04-pattern-extraction.md` and follow the **Pattern Extraction Protocol**. Reflect on what worked, what didn't, and log reusable patterns to `.memory/wiki/patterns.md`. Skip only if the task was trivial (routine, nothing new learned).
41
41
  - **Session Close**: Read `.claude/skills/session-continuity/protocols/05-session-close.md` and follow the **Session Close Protocol**. Write a session log to `.memory/pipeline/progress/sessions/` so the next session can resume cleanly.
42
42
 
43
43
  > These steps are **not optional**. They are what differentiate a pipeline that gets
@@ -51,6 +51,14 @@ parameters:
51
51
  - access-control enforcement
52
52
  4. Run query optimization and resource cleanup checks where applicable.
53
53
 
54
+ ### Step 4.5 — Slice depth ratio gate (mandatory)
55
+
56
+ 1. Read `.claude/skills/prd-templates/references/slice-depth-floor.md`.
57
+ 2. Read the slice's depth floor and breakdown from `phase-N.md` (computed in `/plan-phase-write` Step 5.5). If absent, compute it now from referenced spec sections.
58
+ 3. Count delivered tests — only tests asserting concrete spec items count (no smoke, no bare `toBeTruthy`).
59
+ 4. Compute ratio = delivered_tests / depth_floor. Hard gate: `< 1.0` returns to RED with a list of every uncovered floor item. Each floor item must have at least one explicit assertion exercising its specific behavior.
60
+ 5. Record ratio and matched-item count in `.memory/pipeline/progress/slices/<slice-id>.md` under `## Depth Ratio`.
61
+
54
62
  ### Step 5 — Validation and synthesis
55
63
 
56
64
  1. Run full validation command.
@@ -58,18 +66,23 @@ parameters:
58
66
 
59
67
  ### Step 6 — Mandatory progress updates and evidence gate
60
68
 
61
- 1. Update all required progress targets.
62
- 2. Re-read updated files and include raw evidence in completion payload.
63
- 3. Apply slice completion gates and QA anti-cheat audit.
64
- 4. Emit next command with infrastructure/auth gate branching rule.
69
+ 1. Update all required progress targets per Protocol 3 steps 1–7 (slice file, phase file, index.md, blockers/decisions/patterns).
70
+ 2. Apply Protocol 3 step 8 (read-back verification): re-read each written file and confirm the bytes landed; retry once on failure; STOP after second failed attempt.
71
+ 3. Run `node scripts/check-progress-consistency.mjs` (Protocol 3 step 9). Exit 1 → fix every reported drift item and re-run until exit 0. Exit 2 → STOP and surface the malformed-file report. **You may not call `notify_user` until exit is 0.**
72
+ 4. Stamp the slice file with a `## Completion Signature` block (Protocol 3 step 10) recording date, runtime, verifier exit, and depth ratio.
73
+ 5. Apply slice completion gates (`UI Completeness`, `Spec Traceability`, `Spec Depth Floor`) and QA anti-cheat audit.
74
+ 6. Completion payload must include: raw re-reads of slice/phase/index, verifier exit code (`0`), updated overall progress fraction, explicit next command (`/implement-slice` for next slice, or `/verify-infrastructure` if this was the infra/auth slice).
65
75
 
66
76
  ## Completion Checklist
67
77
 
68
78
  - [ ] RED tests authored and failing
69
79
  - [ ] GREEN implementation complete and passing
70
80
  - [ ] refactor and completeness checks complete
81
+ - [ ] slice depth ratio ≥ 1.0 against spec floor
71
82
  - [ ] validation command passes
72
- - [ ] progress files updated + re-verified
83
+ - [ ] progress files updated + re-verified (Protocol 3 step 8)
84
+ - [ ] cross-file consistency verifier returned exit 0 (Protocol 3 step 9)
85
+ - [ ] Completion Signature stamped on slice file (Protocol 3 step 10)
73
86
  - [ ] completion payload includes required evidence
74
87
 
75
88
  ## Next Steps
@@ -28,9 +28,9 @@ parameters:
28
28
  1. Derive candidate slices from FE interaction specification user flows.
29
29
  2. Map each flow to BE endpoints via source map.
30
30
  3. Group only when strict dependency criteria are met.
31
- 4. Size slices (S/M/L).
32
- 5. Enforce L-slice review/split decision before ordering.
33
- 6. Enforce slice count sanity gates (warn at 16–25, hard stop >25).
31
+ 4. Size slices (S/M/L) as informational metadata only.
32
+ 5. Do not split, merge, or drop slices to hit a complexity target. L slices are surfaced with a one-line note; splitting is permitted only when the spec contains a natural seam.
33
+ 6. Slice count is informational only — no warn or hard-stop thresholds. Phase splitting is justified by dependency boundaries, never by count.
34
34
 
35
35
  ### Step 3 — Spec coverage verification gate
36
36
 
@@ -53,6 +53,13 @@ parameters:
53
53
  2. Every criterion must include source citation (`[BE §..]`, `[FE §..]`, `[IA §..]`).
54
54
  3. Append each completed slice progressively to `phase-N-draft.md`.
55
55
 
56
+ ### Step 5.5 — Slice depth floor (mandatory)
57
+
58
+ 1. Read `.claude/skills/prd-templates/references/slice-depth-floor.md` in full.
59
+ 2. For every slice, compute the minimum acceptance-criteria count using its formula and annotate the slice in `phase-N-draft.md` with the floor and breakdown.
60
+ 3. Hard gate: every slice's criteria count MUST equal or exceed the floor. If short, return to Step 5 and add criteria traceable to concrete spec items.
61
+ 4. Apply Spec Thinness Detection: if any slice's referenced spec section produces zero items in a required category, STOP and tell the user to run `/resolve-ambiguity` on the thin spec before continuing.
62
+
56
63
  ### Step 6 — Finalize and generate progress artifacts
57
64
 
58
65
  1. Finalize `phase-N.md` from draft source.
@@ -74,6 +81,7 @@ parameters:
74
81
  - [ ] coverage gate passed
75
82
  - [ ] dependency ordering complete with infra gates
76
83
  - [ ] acceptance criteria written with citations
84
+ - [ ] slice depth floor computed and met for every slice
77
85
  - [ ] phase draft and final plan written
78
86
  - [ ] progress files generated
79
87
  - [ ] spec graph refreshed via `memory_compile`