Goal
R9 + R10 + R13 (presence half of the unified heal):
- Generate one package PER SECTION.
- Gate it as REQUIRED READING at execution:
/fix-bugPhase 1,/continue-roadmapStep 3, plus/review-planaudit,/add-bugrelatedness,/tpr-reviewgrounding. - 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_packageentry the staleness half (query-selfheal/s-fa1f33bc) calls — both the/create-planscaffold generation AND on-demand execution generation invoke this single SSOT entry, never a parallel stage+persist path. This presence half routes themissing -> generatearm; the staleness half routes thestale-past-TTL -> refresharm._persist_scaffold_intel_package(scripts/create_plan_runtime/__main__.py) is rewired to callheal_section_packagerather than callingstage_for_target+persist_packagedirectly, so scaffold-time and execution-time generation share one path.heal_section_package(plan_dir, section_id, ...)takessection_idas 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 bysection_idviastorage.v7_intel_sidecar_stem(plan_dir, section_id)+persist_package(plan_dir, section_id, ...). Placement is ori_lang-side per theintel_repoone-way data-flow boundary (intel_repo/CLAUDE.md). - Required-reading gates:
/fix-bugPhase 1 (RCA recon) +/continue-roadmapStep 3 (roadmap.pyrecon) callheal_section_package(generate-if-missing) then read the section package viaconsume.py:load_package. - Remaining consumers consume via the same
consume.py:load_packageat their documented call sites:/review-planaudit,/add-bugrelatedness,/tpr-reviewgrounding. - Degraded package (R8) does not block execution — every consumer treats a
degraded: trueenvelope as non-fatal.
Spec References
scripts/intel_package_runtime/heal.py:heal_section_package(the SINGLE unified heal wrapper shared with the staleness halfquery-selfheal/s-fa1f33bc; ori_lang-side per theintel_repoone-way boundary; this presence half routes themissing -> generatearm)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 throughheal_section_package)scripts/intel_package_runtime/stage.py:target_for_plan_name(plan-level targetplan-section:<plan>) +scripts/intel_package_runtime/storage.py:v7_intel_sidecar_stem(per-section sidecar resolution bysection_id)intel-package-rebuild-notes.mdR9, R10, R13
Work Items
- Per-section generation routes through the single
scripts/intel_package_runtime/heal.py:heal_section_packageentry (generate-if-missing) at BOTH/create-planscaffold (_persist_scaffold_intel_packagerewired) AND on-demand execution;section_idis a separateheal_section_packageparameter (plan-level targetplan-section:<plan>; per-section sidecar viav7_intel_sidecar_stem). - Required-reading gates:
/fix-bugPhase 1 (RCA recon) +/continue-roadmapStep 3 (scripts/plan_orchestrator/roadmap.pyrecon) callheal_section_packagethen read viascripts/intel_package_runtime/consume.py:load_package; degraded envelope never blocks. - Wire the remaining consumers via
scripts/intel_package_runtime/consume.py:load_packageat their call sites:/review-planaudit,/add-bugrelatedness,/tpr-reviewgrounding.
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_packagegenerates on read, thenload_packagereturns a non-degraded envelope; (b) degraded package (R8) ->load_packagereturnsdegraded: trueand the consumer proceeds WITHOUT blocking (non-blocking gate); (c) per-consumer call-site coverage — one pin each proving/fix-bugPhase 1,/continue-roadmapStep 3 (roadmap.pyrecon),/review-planaudit,/add-bugrelatedness, and/tpr-reviewgrounding consume viaload_package; (d) scaffold-time AND execution-time generation both resolve through the SAMEheal_section_packageentry (SSOT — no second generate path), the plan-level target beingplan-section:<plan>and the per-section sidecar resolving bysection_idviav7_intel_sidecar_stem.