Locality Representation Unification — SSOT for Escape Classification
6 sections
Overview
Establish single-source-of-truth for escape-scope classification in AIMS by extending the existing ori_arc::Locality ordered lattice with one new variant (ArgEscaping, sitting between FunctionLocal and HeapEscaping), defining the ori_repr::EscapeInfo per-function storage shape that consumes the unified type, replacing the hardcoded ReprPlan::escapes() query body, eliminating the ParamContract::may_escape LEAK:scattered-knowledge, and coordinating the cross-plan text in repr-opt §08, §09, §10, 00-overview.md, and index.md. Thread-sharing stays in RcStrategy::NonAtomic per the existing repr-opt §10 design; owner-rooted regions stay in BorrowSource (the current home for projection-aware tracking). The plan preserves the ordered escape-scope chain that Locality::join, cross-block widening, and canonicalize Rules 4/6/8 depend on.
Planned
6 sections
Hygiene Foundation
Restructure five BLOAT files (lattice/mod.rs 552, transfer/mod.rs 524, interprocedural/extract.rs 517, intraprocedural/state_map.rs 646, interprocedural/mod.rs 536) to live below the 450-line proactive-split threshold and eliminate 99 stale Section 09.x plan annotations across the AIMS subtree, with zero semantic change to any analysis behavior
Representation Decision
Lock the architectural decisions for the unified Locality representation: chain ordering, Rule 6 firing, EscapeInfo API shape, and the 5 soundness conditions — with zero code changes. Section 02 implements against this locked decision.
ori_arc Implementation
Implement the locked decisions from Section 01 in ori_arc: add the ArgEscaping variant, verify canonicalize rules fire identically, audit 13 predicate sites across 7 files (no exhaustive matches exist; semantic per-site decisions), convert ParamContract::may_escape to a derived method (deleting field + 7 struct literal sites), update CHAIN_HEIGHT, extend the lattice test matrix, add the Lean 4 inversion comment to dimensions.rs
ori_repr EscapeInfo Storage + Query Plumbing
Replace the ori_repr::escape::EscapeInfo placeholder ZST with the concrete per-function FxHashMap<ArcVarId, Locality> storage shape locked in Section 01.3, and replace the hardcoded `let result = true;` body of ReprPlan::escapes() at plan/query.rs:111 with a lookup mirroring the rc_strategy() pattern at plan/query.rs:124-134
Plan Corpus Coordination
Update the 5 cross-plan coordination targets in the repr-opt plan corpus so they reference the unified ori_arc::Locality type and the new EscapeInfo API instead of inventing parallel enums. Transfer soundness conditions 2 and 4 from this plan's Section 01 into repr-opt §08's plan text as future-producer obligations.
Verification & Documentation
Verify the unified Locality representation works end-to-end across all 5 prior sections, run the plan annotation cleanup scan, update the lattice/mod.rs module documentation with the unified description and prior art citations, and gate completion behind /tpr-review, /impl-hygiene-review, and /improve-tooling retrospective