{
  "schema_version": "0.1",
  "id": "IMP-001",
  "title": "Implementation Plan: PRD Plugin Downstream System Test Harness",
  "status": "implemented",
  "source_prd_id": "PRD-001",
  "source_architecture_id": "ARCH-001",
  "source_request_id": "REQ-028",
  "created_at": "2026-06-17",
  "updated_at": "2026-06-17",
  "completed_at": "2026-06-17",
  "summary": "Build the harness in four phases: design, core components, scenario implementation, and CI integration. Each phase contains tasks with validation checks and evidence expectations.",
  "phases": [
    {
      "id": "IMP-PHASE-001",
      "name": "Design and bootstrap",
      "order": 1,
      "tasks": [
        "IMP-TASK-001",
        "IMP-TASK-002",
        "IMP-TASK-003"
      ],
      "exit_criteria": "PRD, architecture, and implementation plan artifacts are reviewed and traceability is consistent."
    },
    {
      "id": "IMP-PHASE-002",
      "name": "Core harness components",
      "order": 2,
      "tasks": [
        "IMP-TASK-004",
        "IMP-TASK-005",
        "IMP-TASK-006",
        "IMP-TASK-007",
        "IMP-TASK-008"
      ],
      "exit_criteria": "A single scenario can run end-to-end and produce a pass/fail report."
    },
    {
      "id": "IMP-PHASE-003",
      "name": "Scenario library",
      "order": 3,
      "tasks": [
        "IMP-TASK-009",
        "IMP-TASK-010",
        "IMP-TASK-011",
        "IMP-TASK-012",
        "IMP-TASK-013"
      ],
      "exit_criteria": "All five scenarios run and assert expected state/artifact signatures."
    },
    {
      "id": "IMP-PHASE-004",
      "name": "CI and release integration",
      "order": 4,
      "tasks": [
        "IMP-TASK-014",
        "IMP-TASK-015",
        "IMP-TASK-016"
      ],
      "exit_criteria": "System tests run in CI with budget controls and do not block unit-test jobs on failure."
    }
  ],
  "tasks": [
    {
      "id": "IMP-TASK-001",
      "phase": "IMP-PHASE-001",
      "summary": "Finalize PRD-001, ARCH-001, and IMP-001 artifacts",
      "sources": [
        "PRD-001",
        "ARCH-001"
      ],
      "validation": "IMP-VAL-001"
    },
    {
      "id": "IMP-TASK-002",
      "phase": "IMP-PHASE-001",
      "summary": "Run project-traceability-sync and project-traceability-review",
      "sources": [
        "PRD-001",
        "ARCH-001",
        "IMP-001"
      ],
      "validation": "IMP-VAL-002"
    },
    {
      "id": "IMP-TASK-003",
      "phase": "IMP-PHASE-001",
      "summary": "Choose LLM provider/model and API key strategy for CI",
      "sources": [
        "ARCH-DEC-001",
        "PRD-NFR-002"
      ],
      "validation": "IMP-VAL-003"
    },
    {
      "id": "IMP-TASK-004",
      "phase": "IMP-PHASE-002",
      "summary": "Implement DownstreamFixture with local source install and canary .env",
      "sources": [
        "PRD-REQ-001",
        "PRD-REQ-006",
        "ARCH-COMP-001"
      ],
      "validation": "IMP-VAL-004"
    },
    {
      "id": "IMP-TASK-005",
      "phase": "IMP-PHASE-002",
      "summary": "Implement LLMAgentDriver with PRD Plugin system prompt and tool dispatcher",
      "sources": [
        "PRD-REQ-002",
        "ARCH-COMP-002"
      ],
      "validation": "IMP-VAL-005"
    },
    {
      "id": "IMP-TASK-006",
      "phase": "IMP-PHASE-002",
      "summary": "Implement ScenarioOrchestrator",
      "sources": [
        "PRD-REQ-002",
        "ARCH-COMP-003"
      ],
      "validation": "IMP-VAL-006"
    },
    {
      "id": "IMP-TASK-007",
      "phase": "IMP-PHASE-002",
      "summary": "Implement StateAssertionLibrary",
      "sources": [
        "PRD-REQ-003",
        "PRD-REQ-004",
        "ARCH-COMP-004"
      ],
      "validation": "IMP-VAL-007"
    },
    {
      "id": "IMP-TASK-008",
      "phase": "IMP-PHASE-002",
      "summary": "Implement GitBoundaryChecker, SecretsMonitor, and HubBoundaryMonitor",
      "sources": [
        "PRD-REQ-005",
        "PRD-REQ-006",
        "PRD-REQ-007",
        "ARCH-COMP-005",
        "ARCH-COMP-006",
        "ARCH-COMP-007"
      ],
      "validation": "IMP-VAL-008"
    },
    {
      "id": "IMP-TASK-009",
      "phase": "IMP-PHASE-003",
      "summary": "Scenario: new feature from idea to plan",
      "status": "implemented",
      "sources": [
        "PRD-REQ-002",
        "PRD-REQ-003",
        "PRD-REQ-004"
      ],
      "validation": "IMP-VAL-009"
    },
    {
      "id": "IMP-TASK-010",
      "phase": "IMP-PHASE-003",
      "summary": "Scenario: bug report and fix",
      "status": "implemented",
      "sources": [
        "PRD-REQ-002",
        "PRD-REQ-003",
        "PRD-REQ-005"
      ],
      "validation": "IMP-VAL-010"
    },
    {
      "id": "IMP-TASK-011",
      "phase": "IMP-PHASE-003",
      "summary": "Scenario: session close and memory promotion",
      "status": "implemented",
      "sources": [
        "PRD-REQ-003",
        "PRD-REQ-004"
      ],
      "validation": "IMP-VAL-011"
    },
    {
      "id": "IMP-TASK-012",
      "phase": "IMP-PHASE-003",
      "summary": "Scenario: downstream upstream bug report",
      "status": "implemented",
      "sources": [
        "PRD-REQ-007",
        "PRD-REQ-008"
      ],
      "validation": "IMP-VAL-012"
    },
    {
      "id": "IMP-TASK-013",
      "phase": "IMP-PHASE-003",
      "summary": "Scenario: health check and stale refresh",
      "status": "implemented",
      "sources": [
        "PRD-REQ-003",
        "PRD-REQ-004"
      ],
      "validation": "IMP-VAL-013"
    },
    {
      "id": "IMP-TASK-014",
      "phase": "IMP-PHASE-004",
      "summary": "Add GitHub Actions workflow for system tests",
      "sources": [
        "PRD-NFR-002",
        "ARCH-DEC-003"
      ],
      "validation": "IMP-VAL-014"
    },
    {
      "id": "IMP-TASK-015",
      "phase": "IMP-PHASE-004",
      "summary": "Document run instructions and CI budget",
      "sources": [
        "PRD-NFR-004"
      ],
      "validation": "IMP-VAL-015"
    },
    {
      "id": "IMP-TASK-016",
      "phase": "IMP-PHASE-004",
      "summary": "Add version bump and release note entry",
      "sources": [
        "REQ-028"
      ],
      "validation": "IMP-VAL-016"
    }
  ],
  "validations": [
    {
      "id": "IMP-VAL-001",
      "method": "Peer review of PRD/ARCH/IMP artifacts",
      "evidence": "Review comments or PR approval"
    },
    {
      "id": "IMP-VAL-002",
      "method": "Run project-traceability-review",
      "evidence": "Traceability report with no critical gaps"
    },
    {
      "id": "IMP-VAL-003",
      "method": "Document model choice and cost budget",
      "evidence": "docs/decisions/DEC-001.json"
    },
    {
      "id": "IMP-VAL-004",
      "method": "Unit test for fixture creation and canary injection",
      "evidence": "tests/test_downstream_fixture.py passes"
    },
    {
      "id": "IMP-VAL-005",
      "method": "Unit test for LLM driver tool dispatch",
      "evidence": "tests/test_llm_agent_driver.py passes"
    },
    {
      "id": "IMP-VAL-006",
      "method": "Run a minimal scenario end-to-end",
      "evidence": "pytest output"
    },
    {
      "id": "IMP-VAL-007",
      "method": "Run assertions against sample state",
      "evidence": "pytest output"
    },
    {
      "id": "IMP-VAL-008",
      "method": "Boundary tests for git, secrets, and hub separation",
      "evidence": "pytest output"
    },
    {
      "id": "IMP-VAL-009",
      "method": "Run scenario five times, check artifacts",
      "evidence": "pytest output and artifact JSON"
    },
    {
      "id": "IMP-VAL-010",
      "method": "Run scenario with and without consent",
      "evidence": "pytest output and git log"
    },
    {
      "id": "IMP-VAL-011",
      "method": "Run session-close scenario and inspect state",
      "evidence": "state files and retrospective if applicable"
    },
    {
      "id": "IMP-VAL-012",
      "method": "Run bug-report scenario and inspect outbox",
      "evidence": "sanitized outbox package"
    },
    {
      "id": "IMP-VAL-013",
      "method": "Run health scenario with stale records",
      "evidence": "health.json findings"
    },
    {
      "id": "IMP-VAL-014",
      "method": "Trigger CI workflow on PR",
      "evidence": "GitHub Actions green"
    },
    {
      "id": "IMP-VAL-015",
      "method": "README/docs update",
      "evidence": "docs/ or README section"
    },
    {
      "id": "IMP-VAL-016",
      "method": "Release metadata updated",
      "evidence": "releases.json entry and version markers"
    }
  ]
}
