Skip to content

Commit 9d4222e

Browse files
committed
fix(product): v1.5.5 enforce PDR lifecycle - mandatory memory promotion, 9-check gate
Root cause: AI agents executing /product.implement skipped Step 3.4 (PDR Lifecycle Management), leaving Accepted PDRs only in drafts with no copy in memory/. The Final Completion Verification was too weak to catch this. Fixes: - Step 3.4: Added DO NOT SKIP warning with gate failure consequences - Step 3.4: Added Step 4 (update state.json) and Step 5 (report) - State schema: Added pdr_lifecycle object (pdrs_promoted, memory_pdr_written, memory_pdr_location, drafts_retained, drafts_reason) - State schema version: 1.1.0 -> 1.2.0 (DAG includes business section slugs) - Final gate: 7 -> 9 checks (self-contained, memory written, lifecycle object) - Check 6 flagged as most commonly skipped
1 parent d4ca1ed commit 9d4222e

6 files changed

Lines changed: 87 additions & 26 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
All notable changes to the Specify CLI and templates are documented here.
44

5+
# [0.8.12+adlc13] - 2026-05-19
6+
7+
### Fixed
8+
9+
- **Product extension v1.5.5**: PDR lifecycle management enforcement
10+
- Step 3.4 hardened with DO NOT SKIP warning and gate failure explanation
11+
- `pdr_lifecycle` object added to state.json schema (pdrs_promoted, memory_pdr_written, etc.)
12+
- Final Completion Verification: 7 → 9 checks (self-contained check, memory written check, lifecycle object check)
13+
- State schema version 1.2.0 with business section slugs in DAG
14+
515
# [0.8.12+adlc12] - 2026-05-19
616

717
### Fixed

FORK.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ Use `agentic-sdlc-v<version>` with plus:
3939

4040
| Version | Date | Base Upstream | Changes |
4141
|---------|------|---------------|---------|
42+
| 0.8.12+adlc13 | 2026-05-19 | 0.8.12 | Product extension v1.5.5: PDR lifecycle enforcement - mandatory memory promotion, state schema lifecycle fields, 9-check final gate |
4243
| 0.8.12+adlc12 | 2026-05-19 | 0.8.12 | Product extension v1.5.4: Fix self-contained PRD enforcement - Step 3.3 structure, embedding rules, prd-template .specify/ references |
4344
| 0.8.12+adlc11 | 2026-05-19 | 0.8.12 | Product extension v1.5.3: Business stakeholder sections (Executive Summary, Market Opportunity, Investment, GTM), self-contained PRD generation, enhanced validation |
4445
| 0.8.12+adlc10 | 2026-05-19 | 0.8.12 | Product extension v1.5.2: Hardened implement command with compliance checklist, validation scripts, strict template enforcement, ASCII→Mermaid conversion |

extensions/product/CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,22 @@
22

33
All notable changes to the Product extension will be documented in this file.
44

5+
## [1.5.5] - 2026-05-19
6+
7+
### Fixed
8+
9+
- **PDR Lifecycle Management Enforcement**: Step 3.4 was being skipped by AI agents
10+
- Added `⚠️ MANDATORY — DO NOT SKIP` warning with explanation of gate consequences
11+
- Added Step 4 (Update state.json with lifecycle fields) and Step 5 (Report)
12+
- Added `pdr_lifecycle` object to state.json schema: `pdrs_promoted`, `memory_pdr_written`, `memory_pdr_location`, `drafts_retained`, `drafts_reason`
13+
- State schema version bumped to 1.2.0 with updated DAG slugs including business sections
14+
15+
- **Final Completion Verification Hardened**: 7 checks → 9 checks
16+
- Added Check 5: PRD.md is self-contained (0 `.specify/` links)
17+
- Added Check 7: `pdr_lifecycle.memory_pdr_written === true`
18+
- Added Check 8: `pdr_lifecycle` object exists in state.json
19+
- Added note: "Check 6 is the most commonly skipped"
20+
521
## [1.5.4] - 2026-05-19
622

723
### Fixed

extensions/product/commands/implement.md

Lines changed: 58 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Generate full Product Requirements Document (PRD) from PDRs using multi-agent DAG orchestration with mandatory checkpoint after Requirements
3-
version: 1.5.4
3+
version: 1.5.5
44
compliance: strict
55
scripts:
66
sh: .specify/extensions/product/scripts/bash/setup-product.sh "implement {ARGS}"
@@ -9,7 +9,7 @@ scripts:
99

1010
---
1111

12-
## ⚠️ CRITICAL COMPLIANCE CHECKLIST (v1.5.4)
12+
## ⚠️ CRITICAL COMPLIANCE CHECKLIST (v1.5.5)
1313

1414
**READ THIS FIRST - MANDATORY REQUIREMENTS**
1515

@@ -781,28 +781,48 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
781781
- Constitution references: "as defined in the project constitution" (NOT `[constitution](.specify/memory/constitution.md)`)
782782
- Section cross-refs: `See [Section 8](#8-functional-requirements)` (in-document anchors only)
783783

784-
### Step 3.4: PDR Lifecycle Management (MANDATORY)
784+
### Step 3.4: PDR Lifecycle Management (MANDATORY — DO NOT SKIP)
785+
786+
> **⚠️ THIS STEP IS MANDATORY.** The implement command CANNOT be marked "completed" without executing PDR lifecycle management. Skipping this step means the Final Completion Verification (checks 5 and 6) will FAIL, and `state.json` phase MUST NOT be set to "completed".
785787
786788
**Step 1: Filter Accepted PDRs**
787-
- Identify PDRs with status "Accepted"
788-
- Skip Discovered/Proposed PDRs
789+
- Read `{REPO_ROOT}/.specify/drafts/pdr.md`
790+
- Count PDRs with status "Accepted"
791+
- Count PDRs with status "Proposed" or "Discovered"
789792

790-
**Step 2: Copy to Canonical Location**
793+
**Step 2: Copy Accepted PDRs to Memory (MANDATORY)**
791794
- Write Accepted PDRs to `{REPO_ROOT}/.specify/memory/pdr.md`
792-
- Merge with existing content
795+
- If `memory/pdr.md` already exists, merge (append new PDRs, update existing)
796+
- **Verify file was written**: `ls -la {REPO_ROOT}/.specify/memory/pdr.md`
797+
- **If write fails → STOP and report error**
793798

794799
**Step 3: Clean Up Drafts**
795-
- Remove promoted PDRs from drafts
796-
- If no PDRs remain → DELETE drafts file
800+
- If ALL PDRs are Accepted → drafts file may be retained for cross-reference analysis
801+
- If some PDRs remain Proposed/Discovered → keep only those in drafts
802+
- Set `pdr_lifecycle.drafts_retained` and `pdr_lifecycle.drafts_reason` in state.json
803+
804+
**Step 4: Update state.json with Lifecycle Fields**
805+
```json
806+
"pdr_lifecycle": {
807+
"pdrs_promoted": [N],
808+
"memory_pdr_written": true,
809+
"memory_pdr_location": ".specify/memory/pdr.md",
810+
"drafts_retained": true|false,
811+
"drafts_reason": "[reason if retained]"
812+
}
813+
```
797814

798-
**Step 4: Report Lifecycle Changes**
815+
**Step 5: Report Lifecycle Changes**
799816
```
800817
📋 PDR Lifecycle Summary:
801818
├── Promoted to memory: [N] Accepted PDRs
819+
├── Memory file: .specify/memory/pdr.md ✓
802820
├── Remaining in drafts: [M] PDRs (Proposed/Discovered)
803821
└── Cleanup verified: ✓
804822
```
805823

824+
**Failure Mode**: If Step 2 (copy to memory) is not executed, the Final Completion Verification checks 5 and 6 will fail, blocking the "completed" state.
825+
806826
### Step 3.5: Generate Final Report
807827

808828
```markdown
@@ -842,31 +862,36 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
842862
4. Begin feature development with `/spec.specify`
843863
```
844864

845-
## Final Completion Verification (MANDATORY)
865+
## Final Completion Verification (MANDATORY — ALL CHECKS MUST PASS)
866+
867+
> **⚠️ DO NOT set `phase: "completed"` until ALL checks pass.** This is a hard gate.
846868
847869
**Before marking state.json phase as "completed", verify:**
848870

849-
| Check | Expected | Verification | Status |
850-
|-------|----------|--------------|--------|
851-
| 1. Section files on disk | N files | List sections directory ||
852-
| 2. PRD.md exists | Yes | Check file existence ||
853-
| 3. PRD.md content size | >200 lines | Count lines ||
854-
| 4. PRD.md has all sections | N headers | Parse headers ||
855-
| 5. Memory PDRs promoted | N Accepted | Count in memory ||
856-
| 6. Drafts cleaned | No duplicates | Compare drafts vs memory ||
857-
| 7. state.json consistent | All sections "completed" | Verify progress ||
871+
| # | Check | Expected | Verification | Status |
872+
|---|-------|----------|--------------|--------|
873+
| 1 | Section files on disk | N files | `ls .specify/product/sections/` ||
874+
| 2 | PRD.md exists | Yes | `ls PRD.md` ||
875+
| 3 | PRD.md content size | >200 lines | `wc -l PRD.md` ||
876+
| 4 | PRD.md has all sections | Sections 1-13 + sub-sections | `grep "^## " PRD.md` ||
877+
| 5 | PRD.md is self-contained | 0 `.specify/` links | `grep -c '](.specify/' PRD.md` = 0 ||
878+
| 6 | **Memory PDRs written** | `memory/pdr.md` exists | `ls .specify/memory/pdr.md` ||
879+
| 7 | **`pdr_lifecycle.memory_pdr_written`** | `true` | Check state.json ||
880+
| 8 | Drafts status documented | `pdr_lifecycle` in state.json | Check state.json has `pdr_lifecycle` object ||
881+
| 9 | state.json consistent | All sections "completed" | Verify progress ||
858882

859883
**Gate Rule:**
860-
- If **ALL checks pass**: Mark phase as "completed"
861-
- If **ANY check fails**: Do NOT mark as completed
884+
- If **ALL 9 checks pass**: Mark `phase: "completed"` and `pdr_lifecycle.memory_pdr_written: true`
885+
- If **ANY check fails**: Do NOT mark as completed. Report which check(s) failed.
886+
- **Check 6 is the most commonly skipped** — verify `memory/pdr.md` actually exists on disk.
862887

863888
## State File Schema
864889

865890
**Location**: `{REPO_ROOT}/.specify/product/state.json`
866891

867892
```json
868893
{
869-
"version": "1.1.0",
894+
"version": "1.2.0",
870895
"created_at": "ISO8601 timestamp",
871896
"updated_at": "ISO8601 timestamp",
872897
"phase": "planning | plan_approved | executing | summarizing | completed",
@@ -882,7 +907,7 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
882907
"name": "Core",
883908
"pdrs": ["PDR-001"],
884909
"characteristics": ["b2b", "saas"],
885-
"dag": ["overview", "problem", "goals", "metrics", "personas", "requirements", "nfrs", "out-of-scope", "risks", "roadmap", "pdr-summary"],
910+
"dag": ["overview", "problem", "market-opportunity", "goals", "metrics", "personas", "executive-summary", "requirements", "nfrs", "out-of-scope", "risks", "investment", "roadmap", "gtm", "pdr-summary"],
886911
"progress": {
887912
"overview": "completed",
888913
"problem": "completed",
@@ -891,12 +916,21 @@ If Mermaid rendering fails, ASCII diagrams are available in the full visual file
891916
}
892917
}
893918
],
919+
"pdr_lifecycle": {
920+
"pdrs_promoted": 0,
921+
"memory_pdr_written": false,
922+
"memory_pdr_location": ".specify/memory/pdr.md",
923+
"drafts_retained": false,
924+
"drafts_reason": ""
925+
},
894926
"conflicts_detected": [],
895927
"conflicts_resolved": [],
896928
"output_file": "PRD.md"
897929
}
898930
```
899931

932+
> **IMPORTANT**: The `pdr_lifecycle` object is MANDATORY. The Final Completion Verification checks `memory_pdr_written === true` before allowing phase "completed". If this field is `false`, the gate MUST fail.
933+
900934
## Key Rules
901935

902936
### PDR Traceability

extensions/product/extension.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ schema_version: "1.0"
33
extension:
44
id: "product"
55
name: "Product - PRD & PDR Management"
6-
version: "1.5.4"
6+
version: "1.5.5"
77
description: "Create and manage Product Requirements Documents (PRD) and Product Decision Records (PDR) using multi-agent feature-area analysis with cross-area pattern detection, business stakeholder sections (Executive Summary, Market Opportunity, Investment, GTM), and self-contained PRD generation"
88
author: "Agentic SDLC Team"
99
repository: "https://github.com/tikalk/agentic-sdlc-spec-kit"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "agentic-sdlc-specify-cli"
3-
version = "0.8.12+adlc12"
3+
version = "0.8.12+adlc13"
44
description = "Specify CLI (tikalk fork). Agentic SDLC toolkit for Spec-Driven Development with pre-installed extensions and AI integrations."
55
requires-python = ">=3.11"
66
dependencies = [

0 commit comments

Comments
 (0)