Dump-orchestrator: dumps become (phase,idx) views
Goal
Consolidate ORI_DUMP_TYPE_IDX + the ORI_DUMP_AFTER_* phase dumps into VIEWS of one (phase, idx-filter) dump-orchestrator; ORI_TRACE_IDX becomes the cross-phase view. SSOT — one observation surface with facet renderers behind it, NEVER a parallel system.
Implementation Sketch
Mirror MLIR --print-ir-after=<pass> / rustc -Z dump-mir: one generic knob keyed on (phase, idx), facet renderers behind it; a new phase gets coverage for free. ORI_DUMP_TYPE_IDX stops being a standalone render-bool and becomes the typeck --with-idx view. Default unfiltered output stays byte-identical (backward-compat).
Spec / Rule References
compiler/oric/src/ir_dump/mod.rs; compiler/oric/src/commands/mod.rs (dump dispatch); compiler/oric/src/debug_flags.rs; .claude/rules/impl-hygiene.md §SSOT (no second source of truth / no scattered-knowledge).
Test Strategy
(a) ORI_DUMP_AFTER_TYPECK default output byte-identical to today; (b) typeck view + idx-filter == prior ORI_DUMP_TYPE_IDX output; (c) flag-off path clean (no idx noise).
Work Items
- Introduce a dump-orchestrator in
compiler/oric/src/ir_dump/keyed on(phase, idx-filter); facet renderers (typeck/arc/llvm) behind it reuse existing per-phase renderers — the MLIR--print-ir-after/ rustc-Z dump-mirshape. - Refold
ORI_DUMP_TYPE_IDXinto the orchestrator as the typeck-phase--with-idxview (RETAIN the capability; remove the standalone render-bool that is the rustc--Z-sprawl anti-pattern). - Route the existing
ORI_DUMP_AFTER_*flags through the orchestrator as phase-selected views; default (unfiltered) output BYTE-IDENTICAL to today (backward-compat regression pin). - Tests: (a)
ORI_DUMP_AFTER_TYPECKdefault output unchanged; (b) typeck view + idx-filter == priorORI_DUMP_TYPE_IDXoutput; (c) flag-off path clean.
Items
- BEFORE any refold: capture the default-output (unfiltered) golden baseline for each ORI_DUMP_AFTER_* phase on the nested-generic Wrap<Wrap
>/Holder<Holder > fixture (ground-truth shape #230{inner: Wrap#217{inner: T#141}}). The oric-side dump DRIVERS (ast_dump/ir_dump/arc_dump/llvm_dump) have ZERO test module (intel §3.7, verified on disk: only provenance_trace.rs exists), so this is the first output pin they will ever carry. Capturing it AFTER the orchestrator already restructures the driver surface (w-c4e617f2) would record post-refold output and defeat the mission’s byte-identical backward-compat guarantee. This is intel BLUF decision #1 (‘add it FIRST’) made a discrete ordered step.
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “idx-provenance-diagnostic/s-de09047a” }, “generated_at”: “2026-06-28T08:57:41.425556+00:00”, “graph_state”: { “head_sha”: “8340d7a0”, “last_code_import_at”: “2026-06-28T08:54:08.253Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:idx-provenance-diagnostic/s-de09047a] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “constrained_symbols”: [ “substitute_in_pool”, “set_resolution”, “resolve_fully”, “resolve_fully_guarded” ], “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/idx-provenance-diagnostic” } } }
(full dossier: dump-orchestrator—s-de09047a.intel.json)