100%

Goal

Runtime pytest across every new surface — tier selectors, verdict heuristics, template-render golden, StrictUndefined positive+negative validation, storage flat-layout round-trip, schema migration, consumer required-reading + generate-if-missing heal, per-target-kind tier matrix, DIG DEEPER command validity, and the sc-0012 no-injection production-path incident-closure gate (L12 production-entry-point per layer-coverage.md) — overlay production path + per-kind CLI probe + heal-path no-injection + production resolver + defect population.

Implementation Sketch

  • Extend scripts/intel_package_runtime/tests/: tier-selector rows+dark; heuristic verdicts incl. the surprise-artifact pin; template-render golden vs the approved example; storage flat-layout round-trip; per-kind tier-selection matrix; DIG DEEPER commands parse as valid intel-query.sh invocations.
  • scripts/plan_corpus/tests/: schema-struct accept/reject + migration round-trip on a fixture plan.
  • Consumer integration: required-reading gate heals-then-reads; missing -> generated; degraded -> non-blocking.
  • Incident-closure production-path gate: drive the REAL CLI entry point (no seam-injected resolver) so the dossier renders with no template-injection — test_production_path_incident.py sc-0012 probes (CLI no-injection, populated-defect, per-kind CLI probe, heal-path no-injection), test_production_resolver.py per-kind + read-only-cypher resolution, test_defect_population.py defect-section population, test_overlay_production_path.py BLUF overlay through the generate entry point.

Spec References

Work items gate already-passing pytest (runnable + green now); they pin each behavior to named files/functions rather than new-authoring from zero.

  • scripts/intel_package_runtime/tests/ (named pins below):
    • tier-selector + per-kind matrix: test_tier_selection.py::test_active_tiers_is_pure_owning_target_kinds_inversion (per-kind parametric), ::test_active_tiers_spot_checks_against_matrix, ::test_active_tiers_diff_set_is_the_definitive_five, ::test_diff_stays_a_kind; test_tiers.py
    • verdict heuristics + surprise-artifact pin: test_verdicts.py::test_surprises_counts_artifacts_vs_genuine, ::test_every_registry_tier_yields_non_empty_verdict
    • template-render golden: test_render.py::test_strict_undefined_positive_full_pkg_renders, ::test_active_tiers_is_per_kind_narrowed_set, ::test_active_tiers_bug_set_renders_every_bug_analytic_guard_true, ::test_bluf_overlay_renders_through_jinja2_entry_point
    • StrictUndefined negative validation: test_render.py::test_strict_undefined_negative_missing_field_raises, ::test_strict_undefined_negative_missing_nested_field_raises
    • incident-closure production-path gate (sc-0012 no-injection, L12 production-entry-point per layer-coverage.md): test_production_path_incident.py::test_sc0012_cli_no_injection_renders_dossier, ::test_sc0012_defect_section_renders_with_content, ::test_sc0012_per_kind_cli_probe (per-kind CLI probe), ::test_sc0012_heal_path_no_injection_dossier (heal-path no-injection); production resolver test_production_resolver.py::test_bug_resolves_via_mentions_code, ::test_plan_section_resolves_via_mentions_code, ::test_diff_resolves_changed_files_to_symbols_in_one_batch, ::test_subsystem_resolves_crate_symbols_in_one_batch, ::test_resolver_cypher_is_read_only; defect population test_defect_population.py::test_build_dossier_populates_defect_for_bug, ::test_build_dossier_no_defect_key_for_non_bug
    • overlay production path (BLUF overlay through the real generate entry point): test_overlay_production_path.py::test_pass1_generate_composes_overlay_prompt, ::test_pass2_splice_overlay_writes_bluf_into_package, ::test_pass2_overlay_miss_retains_deterministic_render, ::test_splice_overlay_rejects_missing_package
    • storage flat-layout round-trip: test_storage.py, test_flat_storage.py, test_persist.py
    • consumer required-reading heal + generate-if-missing: test_consumer_required_reading.py, test_heal.py, test_generate.py, test_degradation_gate.py
    • DIG DEEPER command validity: test_walking_skeleton.py::test_positive_adjacency_verdict_and_dig_deeper, test_render.py
  • scripts/plan_corpus/tests/: intel-package schema-struct accept/reject (the intel-package-specific pin) test_intel_package_struct_schema.py::test_section_intel_package_struct_round_trips, ::test_section_intel_package_null_sha_accepted, ::test_section_bare_string_intel_package_rejected_post_promotion, ::test_plan_root_intel_package_validates_under_closed_object; migration round-trip test_migration_round_trip.py — the GENERIC 006_md_to_json / 006_json_to_md converter substrate the intel-package struct rides, NOT an intel-package-specific migration fixture (the struct-schema pin above is the intel-package-specific coverage).
  • intel-package-rebuild-notes.md (all R*) — verified present at repo root.

Verification

  • Section success_criterion sc-0011 FLAGGED-FOR-EXECUTION: tighten the criterion probe to the named per-surface pytest pins above (per-kind tier matrix + DIG-DEEPER command-validity + StrictUndefined negative validation + the sc-0012 incident-closure production-path gate) via amend-success-criterion, matching the sibling sc-0008/sc-0009/sc-0010 named-pin pattern, so the criterion gates per-surface coverage not just a generic suite pass. Do not flip the criterion verdict until completion runs the pins green.

Work Items

  • Tier-selector + verdict-heuristic + template-render-golden tests.
  • Storage flat-layout round-trip + schema-struct + migration tests.
  • Consumer required-reading + generate-if-missing heal + DIG DEEPER command-validity tests.

HISTORY

  • 2026-06-13 — /review-plan Step 5 editor edits: Fixed stale 6 test files literal in Spec References (dropped the brittle module count); replaced test-directory references with named pytest file/function pins per pinned behavior (tier-selector matrix, verdict heuristics + surprise-artifact pin, template-render golden, storage round-trip, schema-struct + migration, consumer required-reading heal, DIG DEEPER command-validity, per-kind tier matrix). Verified intel-package-rebuild-notes.md present at repo root — reference left as-is. Added Verification note flagging the section success_criterion FLAGGED-FOR-EXECUTION for named-pin tightening (sibling sc-0008/sc-0009/sc-0010 pattern). Body only; plan.json untouched.
  • 2026-06-13 — /review-plan Step 5 stale-pin sync + incident-gate add: Synced 2 stale pin names grep-verified against the runtime suite — test_active_tiers_diff_set_is_non_empty -> test_active_tiers_diff_set_is_the_definitive_five; test_active_tiers_full_set_renders_every_analytic_guard_true -> per-kind test_active_tiers_is_per_kind_narrowed_set + test_active_tiers_bug_set_renders_every_bug_analytic_guard_true. Added the sc-0012 incident-closure production-path gate pins (L12 production-entry-point): test_production_path_incident.py (CLI no-injection, populated-defect, per-kind CLI probe, heal-path no-injection), test_production_resolver.py (per-kind + read-only-cypher), test_defect_population.py, test_overlay_production_path.py. Added StrictUndefined negative validation pins (test_strict_undefined_negative_missing_field_raises, _missing_nested_field_raises). Qualified the test_migration_round_trip.py pin as the GENERIC converter substrate (not intel-package-specific) and named the intel-package-specific test_intel_package_struct_schema.py accept/reject functions. Cohesion-synced the same stale pin names in template-render--s-5254300c.md:42 + target-kind-tiers--s-aa802633.md:24. Body only; plan.json untouched (sc-0011 amend handled by orchestrator via write API).