100%

Goal

R9 + R10 + R13 (presence half of the unified heal):

  • Generate one package PER SECTION.
  • Gate it as REQUIRED READING at execution: /fix-bug Phase 1, /continue-roadmap Step 3, plus /review-plan audit, /add-bug relatedness, /tpr-review grounding.
  • A section executed WITHOUT a package does NOT fail the gate: the gate calls the heal (generate-if-missing), then reads. Absence is a heal trigger, never a block.

Implementation Sketch

  • Per-section generation routes through the SAME scripts/intel_package_runtime/heal.py:heal_section_package entry the staleness half (query-selfheal / s-fa1f33bc) calls — both the /create-plan scaffold generation AND on-demand execution generation invoke this single SSOT entry, never a parallel stage+persist path. This presence half routes the missing -> generate arm; the staleness half routes the stale-past-TTL -> refresh arm. _persist_scaffold_intel_package (scripts/create_plan_runtime/__main__.py) is rewired to call heal_section_package rather than calling stage_for_target + persist_package directly, so scaffold-time and execution-time generation share one path. heal_section_package(plan_dir, section_id, ...) takes section_id as a SEPARATE parameter: the staging target is plan-level (target_for_plan_name(plan_dir.name)plan-section:<plan>), and the per-section sidecar resolves by section_id via storage.v7_intel_sidecar_stem(plan_dir, section_id) + persist_package(plan_dir, section_id, ...). Placement is ori_lang-side per the intel_repo one-way data-flow boundary (intel_repo/CLAUDE.md).
  • Required-reading gates: /fix-bug Phase 1 (RCA recon) + /continue-roadmap Step 3 (roadmap.py recon) call heal_section_package (generate-if-missing) then read the section package via consume.py:load_package.
  • Remaining consumers consume via the same consume.py:load_package at their documented call sites: /review-plan audit, /add-bug relatedness, /tpr-review grounding.
  • Degraded package (R8) does not block execution — every consumer treats a degraded: true envelope as non-fatal.

Spec References

  • scripts/intel_package_runtime/heal.py:heal_section_package (the SINGLE unified heal wrapper shared with the staleness half query-selfheal / s-fa1f33bc; ori_lang-side per the intel_repo one-way boundary; this presence half routes the missing -> generate arm)
  • scripts/intel_package_runtime/consume.py:load_package (single envelope parser, all consumers)
  • scripts/create_plan_runtime/__main__.py:_persist_scaffold_intel_package (rewired to route scaffold-time generation through heal_section_package)
  • scripts/intel_package_runtime/stage.py:target_for_plan_name (plan-level target plan-section:<plan>) + scripts/intel_package_runtime/storage.py:v7_intel_sidecar_stem (per-section sidecar resolution by section_id)
  • intel-package-rebuild-notes.md R9, R10, R13

Work Items

  • Per-section generation routes through the single scripts/intel_package_runtime/heal.py:heal_section_package entry (generate-if-missing) at BOTH /create-plan scaffold (_persist_scaffold_intel_package rewired) AND on-demand execution; section_id is a separate heal_section_package parameter (plan-level target plan-section:<plan>; per-section sidecar via v7_intel_sidecar_stem).
  • Required-reading gates: /fix-bug Phase 1 (RCA recon) + /continue-roadmap Step 3 (scripts/plan_orchestrator/roadmap.py recon) call heal_section_package then read via scripts/intel_package_runtime/consume.py:load_package; degraded envelope never blocks.
  • Wire the remaining consumers via scripts/intel_package_runtime/consume.py:load_package at their call sites: /review-plan audit, /add-bug relatedness, /tpr-review grounding.

Verification

FLAGGED FOR EXECUTION PHASE (plan.json edits — out of editor scope per the route-access ban at plan-read-discipline.md §2.1; same sanctioned pattern as schema-integration (s-e2117453) sc-0007 + query-selfheal (s-fa1f33bc) sc-0008):

  • sc-0009 per-consumer + gate pins: success_criterion sc-0009 currently probes a generic suite bucket. During execution, tighten sc-0009 to NAMED pytest pins via the sanctioned write API (scripts/plan_corpus/write.py:amend-success-criterion), so the criterion asserts each behavior rather than a single bucket: (a) missing section package -> heal_section_package generates on read, then load_package returns a non-degraded envelope; (b) degraded package (R8) -> load_package returns degraded: true and the consumer proceeds WITHOUT blocking (non-blocking gate); (c) per-consumer call-site coverage — one pin each proving /fix-bug Phase 1, /continue-roadmap Step 3 (roadmap.py recon), /review-plan audit, /add-bug relatedness, and /tpr-review grounding consume via load_package; (d) scaffold-time AND execution-time generation both resolve through the SAME heal_section_package entry (SSOT — no second generate path), the plan-level target being plan-section:<plan> and the per-section sidecar resolving by section_id via v7_intel_sidecar_stem.