Drop-glue consumer attribution
Goal
Add the CONSUMER edge: attribute each _ori_drop$N walk in ori_llvm drop-synthesis back to the Idx chain that produced it, so an RC-on-scalar emission (ori_rc_dec(i64 7, @_ori_drop$141)) points at its provenance in the DAG.
Implementation Sketch
Drop-synthesis already walks Idx field chains to emit _ori_drop$<idx>. Record (read-only, gated by ORI_TRACE_IDX) the root Idx + field chain per emitted drop glue; surface as a ConsumerEdge into the DAG. No change to emission behavior — observation only.
Spec / Rule References
compiler/ori_llvm/src/codegen/arc_emitter/drop_gen.rs; ori_arc::drop::compute_drop_info (compiler/ori_arc/src/drop/mod.rs); .claude/rules/diagnostic-ux.md (regression pin); read-only-diagnostic discipline (never alter codegen).
Test Strategy
On the BUG-04-234 fixture, assert _ori_drop$<param-idx> attributes via a ConsumerEdge back to the #217{T#141} generic-leaf chain — the scalar-as-heap-pointer emission’s provenance is legible in the DAG.
Work Items
- In
ori_llvmdrop-synthesis (compiler/ori_llvm/src/codegen/arc_emitter/drop_gen.rs+ori_arc::drop::compute_drop_info), record (gated byORI_TRACE_IDX, read-only) which rootIdx+ field chain each generated_ori_drop$<idx>corresponds to — the consumer attribution map. - Surface consumer edges into the DAG:
ConsumerEdge { type_idx, drop_glue_symbol, walked_chain }so an RC-on-scalar emission (ori_rc_dec(i64 7, @_ori_drop$141)) points at the offending generic-leaf chain. - Test: on the BUG-04-234 fixture, assert
_ori_drop$<param-idx>attributes back via aConsumerEdgeto the#217{T#141}chain (the scalar-as-heap-pointer emission’s provenance).
Fresh intel (regenerated)
{ “schema_version”: 1, “target”: { “kind”: “plan-section”, “ref”: “idx-provenance-diagnostic/s-5112c386” }, “generated_at”: “2026-06-28T07:09:50.901738+00:00”, “graph_state”: { “head_sha”: “8340d7a0”, “last_code_import_at”: “2026-06-28T07:05:54.292Z”, “embedding_stale”: false, “insights_stale”: false, “cpg_stale”: false }, “surfaces”: {}, “summary”: “intel-package[plan-section:idx-provenance-diagnostic/s-5112c386] agent-authored dossier”, “degraded”: false, “dossier”: { “objective_symbols”: [], “tiers”: {}, “agent_authored”: true, “constrained_symbols”: [], “difficulty”: { “class”: “routine”, “research_online”: false, “research_mode”: “auto”, “signals”: [], “plan_dir”: “/home/eric/projects/ori_lang/plans/idx-provenance-diagnostic” } } }
(full dossier: drop-glue-attribution—s-5112c386.intel.json)