T-009/T-010: Requirement mapping and blueprint update logic in revise

Add Step 3 to revise.md: map changed files to blueprint requirements by
tracing through build site tasks. Handle cross-blueprint requirement
moves with cross-references. Only affected requirements are modified;
unaffected ones remain untouched.

Blueprint: spec-sync R1

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Julius Brussee
2026-03-20 13:17:38 +01:00
parent aab811dd98
commit 6dd942ee42
3 changed files with 32 additions and 3 deletions
+21 -2
View File
@@ -40,13 +40,32 @@ For each commit classified as a manual fix, determine:
- **Prompt gap**: the plan existed but the prompt didn't guide the agent to it
- **Validation gap**: everything existed but no test caught the regression
## Step 3: Discover Governing Plan Files
## Step 3: Map Changes to Blueprint Requirements
For each manual fix, identify which blueprint requirements are affected:
1. **Read all blueprints** in `context/blueprints/` to build a requirement index (blueprint file → R-numbers → descriptions)
2. **Read the build site** in `context/sites/` to map tasks → requirements → blueprints
3. **Match changed files** to tasks in the build site (check task titles, impl tracking files, and git blame for task-ID references in commit messages)
4. **Identify affected requirements** by tracing: changed file → task → requirement → blueprint
For each affected requirement, record:
| Blueprint | Requirement | Current Description | What Changed | Needs Update? |
**Unaffected requirements remain untouched.** Only modify requirements where the code change reveals a gap, ambiguity, or behavioral shift.
**Cross-blueprint moves:** If a fix reveals that a requirement belongs in a different domain:
1. Move the requirement to the correct blueprint (assign the next available R-number)
2. Add a cross-reference in the original blueprint: "R{n} moved to blueprint-{domain}.md R{m}"
3. Update both blueprints' `## Cross-References` sections
## Step 3b: Discover Governing Plan Files
For each changed source file, determine which plan file governs it:
- Search `context/plans/` for plan files that reference the changed paths
- If no plan covers the file, flag it as an **untracked file** (potential blueprint gap)
## Step 4: Update Context Files
## Step 4: Update Blueprints and Context Files
For each manual fix, update the appropriate context files:
+2
View File
@@ -8,3 +8,5 @@ last_edited: "2026-03-20T00:00:00Z"
| T-001 | DONE | Added ## Changelog to blueprint template in draft.md |
| T-002 | DONE | Draft command now generates blueprints with empty ## Changelog section |
| T-003 | DONE | Changelog append logic added to revise.md (format, append-only rules, since-last-revision range) |
| T-009 | DONE | Added Step 3 to revise.md: map changes to blueprint requirements via build site tracing, cross-blueprint moves |
| T-010 | DONE | Blueprint requirement updates already covered by Step 4; T-009's mapping ensures only affected reqs are modified |
+9 -1
View File
@@ -21,4 +21,12 @@
- **Status:** DONE
- **Files:** commands/draft.md, commands/revise.md
- **Validation:** Build P, Acceptance: template has ## Changelog P, revise appends entries P, since-last-revision from changelog P, append-only P
- **Next:** T-009 — Scan commits since last revision
- **Next:** T-009, T-010
### Iteration 4 — 2026-03-20
- **Task:** T-009 (scan commits + map to requirements), T-010 (update blueprint requirements)
- **Tier:** 1
- **Status:** DONE
- **Files:** commands/revise.md
- **Validation:** Build P, Acceptance: requirement mapping via build site tracing P, unaffected reqs untouched P, cross-blueprint moves P, since-last-revision from changelog P
- **Next:** T-011 — Present recovery options on build failure