Implementation Plan: Technical Debt Resolution

Phase 0 Artifact — Clears specification debt before feature work per ENGINEERING.SOP.md.

EXECUTED 2025-12-31 — All 47 issues resolved. Verification: node scripts/spec-cross-check.js → 0 errors.

Purpose

Systematically resolve 47 identified issues across plans and specs: superseded references, missing specifications, broken traceability, and naming inconsistencies. This plan ensures the specification layer is clean before proceeding with implementation plans.


Debt Summary

Severity Count Category
🔴 Critical 14 Superseded specs referenced, missing PRD/SDS
🟠 High 12 Traceability breaks, naming conflicts
🟡 Medium 15 Stale references, numbering gaps
🟢 Low 6 Status fields, version consistency

Supersession Registry (Authoritative)

MUST use this table when updating references.

Old Spec New Spec Reason
SDS-004 SDS-051 Context Analyzer → Universal Context Service
SDS-014 SDS-045 VibesPro™ Adapter → VibesPro™ Foundation
SDS-017 SDS-050 Identity & Addressing → Semantic Identity & Provenance
SDS-034 SDS-050 IFL Federated Ledger → Merged into SDS-050
SDS-035 REF-012 §10 Governance Invariants → Invariant Regime
SDS-037 SDS-051 Project Context Analyzer → Universal Context Service
SDS-041 SDS-052 Ultimate LSP Hover → Semantic Tooling & IDE Integration
SDS-042 SDS-047 Policy Gateway → GovernedSpeed™ Governance Runtime
SDS-043 SDS-047 Risk & Evidence → GovernedSpeed™ Governance Runtime
ADR-020 ADR-030 VibesPro™ Integration → VibesPro™ Foundation Integration

Proposed Cycles (Worktree-First)

Cycle Worktree Branch Wave Implements
D1A ../SEA-debt-d1A debt/d1A-superseded-refs 1 Global superseded reference cleanup
D1B ../SEA-debt-d1B debt/d1B-traceability-matrix 1 Update traceability matrix
D1C ../SEA-debt-d1C debt/d1C-context-map 1 Update system context map
D2A ../SEA-debt-d2A debt/d2A-missing-prd-simulation 2 Create PRD/SDS for Simulation & Replay
D2B ../SEA-debt-d2B debt/d2B-missing-prd-workbench 2 Create PRD/SDS for Workbench UI
D2C ../SEA-debt-d2C debt/d2C-missing-prd-casemanagement 2 Create PRD for Case Management
D3A ../SEA-debt-d3A debt/d3A-plan-naming 3 Align plan file numbering with plan_ids
D3B ../SEA-debt-d3B debt/d3B-internal-consolidation 3 Consolidate .internal/ duplicates
D4A ../SEA-debt-d4A debt/d4A-tooling-updates 4 Update spec-cross-check.js
D4B ../SEA-debt-d4B debt/d4B-cleanup 4 Open questions cleanup, version consistency

Task Breakdown

Wave 1: Critical Reference Cleanup (Parallel)

Goal: Eliminate all references to superseded specifications.

D1A: Global Superseded Reference Cleanup

File Find Replace
docs/plans/7_ProtocolGateway.plan.md SDS-017 SDS-050
docs/plans/7_ProtocolGateway.plan.md SDS-042 SDS-047
docs/plans/17_SimulationAndReplay.plan.md SDS-043 SDS-047
docs/plans/21_WorkbenchUI.plan.md SDS-043 SDS-047
docs/plans/26_VibesPro™Integration.plan.md SDS-014 SDS-045
docs/plans/26_VibesPro™Integration.plan.md ADR-020 ADR-030
docs/PRODUCTION_READINESS.md SDS-017 SDS-050
docs/specs/cognitive-extension/reference/002-identity-token-specification.md SDS-017 SDS-050
docs/specs/shared/sds/036-documentation-orchestrator-service.md Project Context Analyzer Universal Context Service (SDS-051)

D1B: Update Traceability Matrix

Actions:

  1. Remove rows for superseded SDS (004, 014, 017, 034, 035, 037, 041, 042, 043)
  2. Add rows for new SDS (045, 047, 050, 051, 052)
  3. Update PRD → SDS mappings:
  4. Mark superseded specs in “Notes” column

D1C: Update System Context Map

Actions:

  1. Update SDS-017 row: Add “→ SUPERSEDED by SDS-050”
  2. Update SDS-037 row: Add “→ SUPERSEDED by SDS-051”
  3. Add rows for SDS-050, SDS-051, SDS-052
  4. Verify all 52+ active SDS are listed
  5. Mark Context Analyzer entries as superseded

Wave 2: Missing Specifications (Parallel, depends on Wave 1)

Goal: Create missing PRD/SDS for plans without spec coverage.

D2A: Create Simulation & Replay Specs

PRD-024 Skeleton:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# PRD-024: Simulation & Replay Platform

Satisfies: ADR-036

## Requirements

### REQ-SIM-001 (functional)
When a user requests a simulation, the system shall create a deterministic
snapshot and execute the scenario without affecting production state.

### REQ-SIM-002 (functional)
When a simulation completes, the system shall compare results against
historical patterns from the Pattern Oracle.

### REQ-SIM-003 (nonfunctional)
Simulation replay shall be deterministic: identical inputs yield identical outputs.

D2B: Create Workbench UI Specs

PRD-025 Skeleton:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# PRD-025: Workbench UI

Satisfies: ADR-007

## Requirements

### REQ-WB-001 (functional)
The Workbench shall provide a Knowledge Graph explorer for navigating
semantic relationships.

### REQ-WB-002 (functional)
The Workbench shall display manifest inspection for generated artifacts.

### REQ-WB-003 (functional)
The Workbench shall integrate the Governance Console for policy management.

D2C: Create Case Management PRD

PRD-010-CE Skeleton:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
# PRD-010: Case Management Platform

Satisfies: ADR-021

## Requirements

### REQ-CM-001 (functional)
The system shall support CMMN-based case lifecycle management.

### REQ-CM-002 (functional)
Cases shall integrate with the Artifact Pipeline for document generation.

### REQ-CM-003 (functional)
PM-Agent shall orchestrate task assignments within case contexts.

Wave 3: Structural Cleanup (Parallel, depends on Wave 2)

Goal: Fix naming conventions and consolidate duplicates.

D3A: Align Plan File Numbering

Option A (Recommended): Rename files to match plan_ids

1
2
3
4
# Example renames
mv docs/plans/17_SimulationAndReplay.plan.md docs/plans/11_SimulationAndReplay.plan.md
mv docs/plans/21_WorkbenchUI.plan.md docs/plans/14_WorkbenchUI.plan.md
# ... etc

Option B: Update NFO.md with explicit mapping table

1
2
3
4
| File Number | plan_id | Title |
|-------------|---------|-------|
| 17 | P011 | Simulation & Replay |
| 21 | P014 | Workbench UI |

Decision: Choose Option A for consistency.

New Mapping: | Current File | plan_id | New File | |————–|———|———-| | 17_SimulationAndReplay | P011 | 11b_SimulationAndReplay | | 18_SemanticDebtAndIncidents | P022 | 22_SemanticDebtAndIncidents | | 19_DocumentationSystem | P023 | 23_DocumentationSystem | | 20_PlatformUIIntegration | P024 | 24_PlatformUIIntegration | | 21_WorkbenchUI | P014 | 14b_WorkbenchUI | | 22_PetTrainingApp | P025 | 25_PetTrainingApp | | 23_CaseManagement | P027 | 27_CaseManagement | | 24_UserFeedbackLoop | P028 | 28_UserFeedbackLoop | | 25_MeceQuadrantIntegration | P026 | 26_MeceQuadrantIntegration | | 26_VibesPro™Integration | P029 | 29_VibesPro™Integration |


D3B: Consolidate .internal/ Duplicates

Actions:

  1. Remove duplicate 050-semantic-identity-provenance.md from .internal/ (keep shared/sds/050-*)
  2. Move 012-invariant-regime.md to docs/specs/shared/reference/012-invariant-regime.md
  3. Remove duplicate 035-governance-invariants.md from .internal/
  4. Update all references to use canonical paths:
    1
    
    find docs -name "*.md" -exec sed -i 's|.internal/012-invariant-regime|shared/reference/012-invariant-regime|g' {} \;
    

Wave 4: Tooling & Cleanup (Depends on Wave 3)

Goal: Update automated tooling and clean up minor issues.

D4A: Update spec-cross-check.js

Actions:

  1. Add supersession chain handling:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    const SUPERSEDED_SPECS = {
      'SDS-004': 'SDS-051',
      'SDS-014': 'SDS-045',
      'SDS-017': 'SDS-050',
      'SDS-034': 'SDS-050',
      'SDS-035': 'REF-012',
      'SDS-037': 'SDS-051',
      'SDS-041': 'SDS-052',
      'SDS-042': 'SDS-047',
      'SDS-043': 'SDS-047',
      'ADR-020': 'ADR-030',
    };
    
  2. Add check for superseded references
  3. Update exclude lists to remove superseded specs
  4. Add warning when superseded spec is referenced

D4B: Minor Cleanup

Actions:

  1. Clean up answered Open Questions in:
  2. Add consistent version fields to all plans:
    1
    
    version: 1.0.0
    
  3. Update Architecture Container Diagram:
  4. Fill cognitive-extension SDS numbering gap:

Validation & Verification

After Wave 1

1
2
3
4
5
6
# No superseded references in plans
grep -rE "SDS-0(04|14|17|34|35|37|41|42|43)|ADR-020" docs/plans/ | grep -v "SUPERSEDED"
# Expected: empty

# Context map is current
just spec-check

After Wave 2

1
2
3
4
# All plans have spec coverage
for plan in docs/plans/*.plan.md; do
  grep -q "PRD-" "$plan" && grep -q "SDS-" "$plan" || echo "Missing specs: $plan"
done

After Wave 3

1
2
3
4
5
6
# No duplicates in .internal/
ls docs/specs/.internal/
# Expected: Only files not in shared/

# Plan files match plan_ids
grep -h "^plan_id:" docs/plans/*.plan.md | sort -u

After Wave 4

1
2
3
4
5
6
# spec-cross-check passes
node scripts/spec-cross-check.js --mode staging --dir docs/specs
# Expected: Exit 0

# No open questions with inline answers
grep -B2 "Resolved\|Answer:" docs/plans/*.plan.md

Acceptance Criteria


Risks & Mitigation

Risk Likelihood Impact Mitigation
Bulk sed breaks unrelated content Medium Medium Review diffs before commit; use specific patterns
New specs diverge from existing patterns Low Medium Use existing SDS as templates
References in generated code Low High Only specs are in scope; code uses manifests

Timeline

Wave Duration Dependencies Deliverables
Wave 1 4 hours None Clean references
Wave 2 6.5 hours Wave 1 3 new PRDs, 2 new SDS, 1 new ADR
Wave 3 2 hours Wave 2 Aligned naming, no duplicates
Wave 4 2 hours Wave 3 Updated tooling, minor fixes
Total 14.5 hours Zero debt

Type ID Document
Template plan-template.md
Report broken_references_report.md
Matrix REF-009 009-traceability-matrix.md
Index 00_system_context_map.md
Tool spec-cross-check.js