Section 03: Inherent-Method Mono on Generic Type (BUG-04-091)
Status: In Progress
Goal: Close the inherent-method-on-generic-type gap. impl<T> Box<T> { @unwrap (self) -> T } resolves at codegen for every monomorphized Box<int> / Box<str> / etc., across LOCAL-module receivers (§03.1-§03.3) AND cross-module imported-method receivers (§03.4-§03.5 per Decision 02).
Context: Per §01.3 BUG-04-091 entry, the parser side closed when BUG-01-002 landed (2026-04-29); codegen side remains. The reduced shape (@unwrap with no method-level generics, just inherent on Box<T>) is the canonical repro at compiler/ori_llvm/tests/aot/generics.rs::test_generic_method_on_generic_type (currently #[ignore]). Distinct from §02’s cross-module TOP-LEVEL gap: §03 owns the inherent-method registration gap for both local AND imported receivers per Decision 02 §03.4/§03.5 scope expansion. Distinct from §04’s complex-generic-arg dispatch: this section’s receivers are simple Box<T> shapes where T is a single type parameter.
Reference implementations:
- Rust
rustc_trait_selection::traits::project::find_inherent_impls_for_generic— inherent impls onimpl<T> Type<T>enumerated separately from trait impls; mono dispatch discriminates byType<concrete_args>. - Swift
SIL::SILModule::lookUpFunctionInModule— specialization-aware lookup; inherent methods registered with full generic context.
Depends on: §01 (cite §01.3 BUG-04-091), §02 (collect_mono_functions signature now stable after §02.1).
Intelligence Reconnaissance
Queries planned:
scripts/intel-query.sh --human callers "impl_sigs" --repo ori— every site constructing or consuming the impl-sig table.scripts/intel-query.sh --human file-symbols "compiler/ori_arc/src/codegen/arc_emitter" --repo ori— apply.rs surface for codegen-side method dispatch.scripts/intel-query.sh --human similar "find_inherent_impls" --repo rust,swift --limit 3— cross-language inherent-impl lookup patterns.scripts/intel-query.sh --human callers "MonoInstance::receiver_type" --repo ori— how upstream code discriminates method receivers.
Results summary (≤500 chars, recorded 2026-05-14) [ori]: TO BE POPULATED at section start by running the queries above. Scaffold authored 2026-05-14 — queries deferred to execution time when impl_sigs dispatch surface is current.
03.1 MonoInstance emission for inherent methods on generic receivers
File(s): compiler_repo/compiler/ori_types/src/infer/expr/calls/method_call.rs (infer_method_call at line 23, infer_method_call_named at line 105 — per §01.2 F4 supersession); compiler_repo/compiler/ori_types/src/check/mod.rs maybe_record_mono_instance site (parallel emission hook).
03.1.0 Line-coordinate refresh + §02 prerequisite-output gate (REQUIRED first task)
Before authoring any code change in §03.1-§03.5, refresh every monomorphize/mod.rs / multi.rs / compile_common.rs / method_call.rs line citation in this section against current HEAD:
-
git rev-parse HEAD— record the verification SHA in §03 HISTORY (one-line entry:YYYY-MM-DD §03 line-coordinate refresh — HEAD <sha>). - Verify
monomorphize/mod.rssignatures:pub fn collect_mono_functions(should be at line ~71 (signature at HEADf5a37d327);impl_sig_by_nameconstruction at ~86-90;import_sig_by_nameat ~94-97; per-instance dispatch loop at ~107-118 (receiver.is_some branch at ~112-113); silent-skip at ~119-128. If drift >5 lines from §03.2/§03.5 body citations, update body line numbers BEFORE authoring code. - Verify
multi.rs::CompiledModuleInfostruct at ~line 203;public_functionsfield at ~line 212;extract_public_function_typescall site at ~line 346;extract_public_function_typesdefinition at ~line 444; pub-function loop body at ~line 475. If drift >5 lines from §03.4 body citations, update §03.4 BEFORE authoring code. - Verify
ori_arc/src/lower/calls/mod.rs::lower_method_callat line 297 (per §03.2 cite); update §03.2 body if drifted. - Verify
compile_common.rs::run_codegen_pipelinecall site at ~lines 236-253;import_sigsconstruction at ~lines 217-234;imported_mono_fnsparameter at ~line 206. If drifted, update §03.5 §03.4 body wiring instructions. - §02 prerequisite-output gate (per frontmatter success_criteria §02-prerequisite-output-gate row): confirm §02.1 status
completeinsection-02-import-sigs-traversal.mdfrontmattersections:array ANDcollect_mono_functionssignature atmonomorphize/mod.rs:71includesimport_sigs: &[(Name, FunctionSig)]parameter (delivered by commit3bb8aa725per §02 success_criteria row 2). If §02.1 incomplete OR signature missing the parameter → STOP §03.1 work, surface gate failure to §02.N close-out path. §03.1-§03.3 may proceed under partial §02.N close (per gate rule). §03.4 + §03.5 BLOCKED until §02.3 + §02.4 statuscompleteAND §02.N close-out unchecked items resolved.
03.1.1 Typeck emission cure (§01.2 F4 supersession)
- Locate the typeck emission site that produces
MonoInstancerecords for inherent method calls (per §01.2 mapping atmethod_call.rs:23/method_call.rs:105). Identify whyimpl<T> Box<T> { @unwrap }called asb.unwrap()forBox<int>does not produce aMonoInstance { fn_name: unwrap, receiver_type: Some(Box<int>), generic_args: [int], impl_args: [int], method_args: [], concrete_param_types, concrete_return_type, body_type_map }(per frontmatter unified-MonoInstance-tuple-shape success_criteria row). - Fix the typeck pass: ensure inherent methods on generic types emit a
MonoInstancediscriminated by the concrete instantiation of the receiver’s generic args. Theimpl_argsfield carries the receiver-side substitution; thereceiver_type: Some(Idx)field carries the FULL concrete receiver type (e.g.,IdxofBox<int>, NOT just the generic shellBox<_>). - Verify
MonoInstancededup logic: two calls toBox<int>.unwrapshare one instance;Box<int>.unwrapandBox<str>.unwrapare distinct. - Subsection close-out (03.1) — MANDATORY before §03.2:
-
cargo build --releasesucceeds. - Manual repro:
Box<int> { inner: 42 }.unwrap()produces aMonoInstancewithreceiver_type = Some(Box<int>). Verified viaORI_LOG=ori_types=trace ori check fixture.ori. - Run
/improve-toolingretrospectively on §03.1. - Run
/sync-claudeon §03.1 — typeck emission semantics changed; checktypeck.md§EX-* +types.md§RG-3. - Run
compiler_repo/diagnostics/repo-hygiene.sh --check.
-
03.2 collect_mono_functions impl_sigs dispatch — discriminate by generic_self_type
File(s): compiler_repo/compiler/ori_llvm/src/monomorphize/mod.rs:86-90 (impl_sig_by_name construction at HEAD f5a37d327); compiler_repo/compiler/ori_llvm/src/monomorphize/mod.rs:107-118 (per-instance dispatch loop, receiver-bearing branch at lines 112-113); compiler_repo/compiler/ori_arc/src/lower/calls/mod.rs:297 (lower_method_call per scripts/intel-query.sh symbols lower_method_call --repo ori; the arc_emitter/apply.rs path referenced in earlier drafts does not exist at HEAD).
The current first-match dedup in monomorphize/mod.rs:86-90:
let mut impl_sig_by_name: FxHashMap<Name, &FunctionSig> =
FxHashMap::with_capacity_and_hasher(impl_sigs.len(), FxBuildHasher);
for (name, sig) in impl_sigs {
impl_sig_by_name.entry(*name).or_insert(sig); // first match wins
}
This drops the generic-self-type discrimination — if multiple impl<T> Type<T> blocks register the same method name, only the first registers, and per-receiver mono dispatch fails.
03.2.1 Keyed-lookup conversion
- Change
impl_sig_by_namefromFxHashMap<Name, &FunctionSig>toFxHashMap<(Name, Option<Idx>), &FunctionSig>keyed by(method_name, receiver_generic_pattern). Thereceiver_generic_patternis the generic shellBox<_>(internedIdxof the shell type with type parameters as fresh vars, NOT the instantiatedBox<int>). TheOption<Idx>shell aligns withMonoInstance.receiver_type: Option<Idx>(None = top-level fallback, Some = method-receiver discrimination); §03.5 extends the SAME key shape across host + imported sources, NOT a parallel parameter shape. - Helper: add
Pool::generic_shell(idx: Idx) -> Idx(or equivalent) onori_types::Poolthat maps a concrete instantiationBox<int>to its generic shellBox<_>by replacing every concrete type argument in the receiverTag::Namedwith freshTag::BoundVars (depth-first traversal — nested generic argsBox<Option<int>>shell toBox<Option<_>>thenBox<_>-at-top via outer shell; concrete primitives in arg positions become BoundVars; existing BoundVars unchanged); shell construction MUST round-trip throughori_types::canonper.claude/rules/types.md §TY-3(canonical-pattern equality) +§TF-2(free-var substitution invariants) so two different instantiations of the same impl block produce byte-identical shellIdx. If a free function already exists at HEAD (searchPool::symbols viascripts/intel-query.sh symbols Pool --repo ori), reuse it; do not add a parallel. - Update the lookup site at
monomorphize/mod.rs:113(receiver-bearing branch) to consult(instance.fn_name, instance.receiver_type.map(|r| pool.generic_shell(r)))instead of(instance.fn_name)alone. Keepinstance.receiver_type.is_some()as the branch discriminator (unchanged from §02.1 shape). - In
ori_arc/src/lower/calls/mod.rs::lower_method_call(line 297 at HEAD), fix the apply lowering to resolve inherent methods on generic types through the new keyed lookup. The lowering consumes the resolved mono instance fromcollect_mono_functions; no parallel lookup table at the lower site.
03.2.2 Un-ignore + parity
- Un-ignore
compiler/ori_llvm/tests/aot/generics.rs::test_generic_method_on_generic_type. - Verify
MonoFunctionmangled-name collision audit:Box<int>.unwrapandBox<str>.unwrapproduce DISTINCT mangled names (permonomorphize/mod.rs:130-138mangle_mono_nameconsumesinstance.impl_argswhich now carry post-substitution receiver type per §03.1 emission cure).
03.2.3 Subsection close-out (03.2) — MANDATORY before §03.3
-
cargo test --release -p ori_llvm --test aot generics::test_generic_method_on_generic_typepasses. - No regression in
cargo test --release -p ori_llvm --test aot generics. - Run
/improve-toolingretrospectively on §03.2. - Run
/sync-claudeon §03.2 —collect_mono_functionsinternal dedup key changed; checkllvm.md§Type-Qualified Mangling +repr.md§RP-6 declaration-order ↔ memory-order. - Run
compiler_repo/diagnostics/repo-hygiene.sh --check.
03.3 Matrix tests — generic-receiver inherent methods
File(s): compiler_repo/compiler/ori_llvm/tests/aot/generics.rs
Matrix:
| Receiver shape | Inner type T | Method shape | Test name |
|---|---|---|---|
Box<T> | int | @unwrap (self) -> T | test_box_int_unwrap |
Box<T> | str | @unwrap (self) -> T | test_box_str_unwrap |
Box<T> | [int] | @unwrap (self) -> T | test_box_list_int_unwrap |
Box<T> | struct | @unwrap (self) -> T | test_box_struct_unwrap |
Wrapper<T> (nested) | Box<int> | @inner (self) -> T | test_wrapper_box_int_inner |
Holder<T> | int | @map (self, f: T -> T) -> T (method body has internal let) | test_holder_int_map_int |
- Author all 6 matrix tests + corresponding
.orifixtures. - Each test pins both Ok behavior + semantic pin (regression guard if §03.2 dedup change reverted).
- Negative pin:
test_box_method_with_drifted_args_emits_typeck_error— method-args/impl-args drift produces clean E2xxx, not E5001 codegen crash. - Subsection close-out (03.3) —
status: complete:- All 6 matrix tests + 1 negative pin pass.
-
timeout 150 diagnostics/dual-exec-verify.sh tests/aot/generics.rs— interpreter/LLVM parity holds. - Run
/improve-toolingretrospectively on §03.3. - Run
compiler_repo/diagnostics/repo-hygiene.sh --check.
03.4 AOT export surface — multi.rs::public_methods + extract_public_method_types (per Decision 02)
Files (line coordinates verified at HEAD f5a37d327; refresh per §03.1.0 before authoring code if drift detected):
compiler_repo/compiler/oric/src/commands/build/multi.rs:346—extract_public_function_typescall site (top-level only today)compiler_repo/compiler/oric/src/commands/build/multi.rs:203-238—CompiledModuleInfostruct decl;public_functions: Vec<(String, Vec<ori_types::Idx>, ori_types::Idx)>field at line 212compiler_repo/compiler/oric/src/commands/build/multi.rs:426-435—CompiledModuleInfoconstruction (post-extraction)compiler_repo/compiler/oric/src/commands/build/multi.rs:444—extract_public_function_typesdefinition (helper §03.4’sextract_public_method_typesmirrors); pub-function loop body at line 475compiler_repo/compiler/oric/src/commands/compile_common.rs:206—imported_mono_fns: &[super::ImportedMonoFn]param;compile_common.rs:217-234—import_sigsconstruction (Decision 02 scope = AOT side); call torun_codegen_pipelineatcompile_common.rs:236-253
03.4.1 ImplMethodInfo carrier shape (RECEIVER-BEARING — load-bearing)
The public_methods exporter MUST carry the receiver Idx (the FULL concrete or generic-shell receiver type), NOT just the receiver type’s string name. Stripping the Idx shell to (receiver_type_name: String, method_name: String, FunctionSig) loses the discrimination data §03.2’s (Name, Option<Idx>)-keyed impl_sig_by_name lookup is built against — this is the data-shape contract per frontmatter’s unified-MonoInstance-tuple-shape success_criteria row.
Verbatim carrier shape:
pub(super) struct ImplMethodInfo {
/// Receiver type's Idx in the source module's type pool — generic shell
/// (e.g., Idx of `Box<_>` with type params as Tag::BoundVar) so post-
/// re-interning at the host module gives a stable lookup key for
/// `impl_sig_by_name` per §03.5's keyed dispatch.
pub(super) receiver_type_idx: ori_types::Idx,
/// Interned method name on the host's interner (post-re-intern).
pub(super) method_name: ori_ir::Name,
/// Method signature with Self placeholder substituted; param/return Idx
/// values in source-module pool coordinates (re-interned at host).
pub(super) sig: ori_types::FunctionSig,
}
03.4.2 multi.rs public_methods exporter wiring
- Add
public_methods: Vec<ImplMethodInfo>field toCompiledModuleInfoatmulti.rs:212(alongside existingpublic_functions). Populate at construction sitemulti.rs:426-435via newextract_public_method_typescall parallelingextract_public_function_typesat line 346. - Add
extract_public_method_typeshelper inmulti.rsmirroringextract_public_function_typesat line 444. WalksTypeCheckResult.impl_registryfor the source module, filters topubimpl methods (perimpl<T> Box<T> { @method }where the enclosingimplblock OR the method declaration carriespub), returnsVec<ImplMethodInfo>with receiverIdxset to the impl’sreceiver_type_idx(post-substitution withTag::BoundVarfor type params, i.e., the generic shell). Per impl block: enumerate each pub method, construct oneImplMethodInfocarrying(receiver_type_idx, method_name, sig). - Extend
compile_common.rsconsumer wiring: atcompile_common.rs:206-234, afterimport_sigsis constructed (lines 217-234), construct a parallelimported_impl_sigs: Vec<(Name, Option<Idx>, FunctionSig)>from each importedCompiledModuleInfo.public_methodsVec. Re-intern method names + re-map receiverIdxinto the host’s merged pool (mirrors §02.3’sbuild_imported_mono_statere-interning path atmulti.rs:382-386). TheOption<Idx>shell carriesSome(receiver_type_idx_in_host_pool)for every method (None reserved for top-level/no-receiver, matching the §03.5imported_impl_sigsparameter shape; see §03.5 Data-Shape Contract block). - Thread through codegen pipeline: pass
&imported_impl_sigsalongside existing&import_sigsin the call torun_codegen_pipelineatcompile_common.rs:236-253; downstreamrun_codegen_pipeline → run_borrow_inference → collect_mono_functionschain accepts the new parameter (wired at §03.5). - Update
multi.rsunit tests to coverpublic_methodsenumeration: positive (pub impl method exported with correctreceiver_type_idx), negative (private impl method NOT exported), edge (impl block where the impl ispubbut a contained method is not, AND inverse — impl is not pub but a method ispub).
03.4.3 Subsection close-out (03.4) — status: complete
-
cargo build --release && cargo buildboth succeed. -
cargo test --release -p oric --test buildreports same pass count plus the newpublic_methodsexporter tests. - Manual end-to-end repro: 2-module fixture under
tests/aot/fixtures/imported_methods/(a sibling module definespub impl<T> Box<T> { @unwrap (self) -> T }; host imports + callsb.unwrap()forBox<int>) — verifyextract_public_method_typespopulatespublic_methodswithImplMethodInfo { receiver_type_idx: Idx(Box<_>), method_name: unwrap, sig: ... }viaORI_LOG=oric=debugcapture. - Run
compiler_repo/diagnostics/repo-hygiene.sh --check.
03.5 Cross-module impl_sig_by_name dispatch — consult imported method sigs (per Decision 02)
Files (line coordinates verified at HEAD f5a37d327; refresh per §03.1.0 if drift detected):
compiler_repo/compiler/ori_llvm/src/monomorphize/mod.rs:71(collect_mono_functionssignature)compiler_repo/compiler/ori_llvm/src/monomorphize/mod.rs:86-90(impl_sig_by_nameconstruction; §03.2 converts to(Name, Option<Idx>)key)compiler_repo/compiler/ori_llvm/src/monomorphize/mod.rs:107-118(per-instance dispatch loop; receiver-bearing branch at lines 112-113; silent-skip at lines 119-128)compiler_repo/compiler/oric/src/test/runner/arc_lowering.rs:39(test-runner symmetric wiring per §02.2 precedent)compiler_repo/compiler/ori_llvm/src/evaluator/compile.rs:230(JIT call site — passes&[]for bothimport_sigsandimported_impl_sigsper JIT-single-module carve-out)
03.5.1 Data-Shape Contract (load-bearing — codex + gemini convergence cure)
collect_mono_functions parameter shape MUST be:
pub fn collect_mono_functions(
mono_instances: &[MonoInstance],
function_sigs: &[FunctionSig],
impl_sigs: &[(Name, FunctionSig)], // host-module methods (§02 unchanged)
import_sigs: &[(Name, FunctionSig)], // cross-module top-level (§02 landed)
imported_impl_sigs: &[(Name, Option<Idx>, FunctionSig)], // §03.5 NEW — RECEIVER-BEARING
interner: &StringInterner,
pool: &Pool,
) -> Vec<MonoFunction>
The Option<Idx> slot in imported_impl_sigs carries the generic-shell receiver Idx for every entry (Some(generic_shell)); the None discriminant is reserved for future top-level-from-method-table cases and is currently unused by §03.4’s exporter (which always emits Some(receiver_type_idx)). Stripping the Option<Idx> to &[(Name, FunctionSig)] (top-level shape) loses the per-receiver discrimination §03.2’s impl_sig_by_name lookup is keyed against, collapsing Box<int>.unwrap and Box<str>.unwrap back to the first-match failure mode this section cures. The shape MUST match §03.4’s extract_public_method_types output projection (after host-pool re-interning) and §03.2’s (Name, Option<Idx>) lookup key — single data shape across emit / export / consume per impl-hygiene.md §SSOT.
03.5.2 Lookup-chain extension
- Extend
collect_mono_functionssignature atmonomorphize/mod.rs:71to acceptimported_impl_sigs: &[(Name, Option<Idx>, FunctionSig)]after the existingimport_sigsparameter. Parameter order matches §02’simport_sigsprecedent (top-level extension first, then method extension); shared key shape per §03.2/§03.5.1. - Populate unified
impl_sig_by_nameatmonomorphize/mod.rs:86-90from BOTHimpl_sigs(host module — re-keyed by §03.2 to(name, receiver_generic_pattern)) ANDimported_impl_sigs(cross-module — already carries(name, Option<Idx>, sig)). Host-wins-on-collision: iterate hostimpl_sigsfirst, thenimported_impl_sigswithentry.or_insertsemantics (first-match preserved per §02.1’simport_sig_by_nameshape). ReceiverIdxes fromimported_impl_sigsmust be re-interned into the merged host pool BEFORE insertion (re-interning landed at §03.4 incompile_common.rs:217-234extension). - Verify per-instance dispatch at
monomorphize/mod.rs:107-118: wheninstance.receiver_type.is_some(), the receiver-bearing branch at line 112-113 consults the unifiedimpl_sig_by_name. With imported method sigs registered, BUG-04-091 fixtures (Box<int>.unwrap,Box<str>.unwrap) lookup non-empty → no silent skip at lines 119-128 → no E5001 at LLVM verification. - Wire
imported_impl_sigsthrough codegen pipeline: fromcompile_common.rs:236-253run_codegen_pipelinecall (which §03.4 extends to forward the new parameter), throughcodegen_pipeline/mod.rs→run_borrow_inference(whichcollect_mono_functionsis called from), into the test runner atarc_lowering.rs:39symmetrically (passes&[]empty slice when no imported_impl_sigs available for the test scope). The JIT call site atevaluator/compile.rs:230passes&[]forimported_impl_sigs(mirror §02’s&[]forimport_sigs) — cross-module imported-method dispatch is AOT-only per JIT single-module carve-out (per frontmatter dual-exec-parity carve-out + 00-overview.md Extension-Surface Map §03 row).
03.5.3 Named imported-method matrix (cures codex blind-spot 2026-05-16 finding 3)
Per Decision 02 frontmatter row, the specific imported-method matrix Option<int>.unwrap(), Result<int,str>.ok(), [int].first() MUST land as explicit AOT test fixtures in §03.5 (NOT deferred to §06). Tests + fixtures:
| Test name | Receiver shape | Method | Fixture path |
|---|---|---|---|
test_imported_method_option_int_unwrap | Option<int> (imported) | unwrap | tests/aot/fixtures/imported_methods/option_int_unwrap/{lib.ori,main.ori} |
test_imported_method_result_int_str_ok | Result<int, str> (imported) | ok | tests/aot/fixtures/imported_methods/result_int_str_ok/{lib.ori,main.ori} |
test_imported_method_list_int_first | [int] (imported) | first | tests/aot/fixtures/imported_methods/list_int_first/{lib.ori,main.ori} |
Each fixture: lib.ori defines pub impl<T> X<T> { @method ... }; main.ori imports and invokes for the concrete T. Driver wiring follows §02.4’s compile_to_llvm_with_imported_monos pattern at commit 3bb8aa725; per-test assertion follows tests/aot/poly_lambda_mono.rs shape (verify cargo test --release -p ori_llvm --test aot returns the expected runtime value AND ORI_LOG=ori_llvm::monomorphize=debug shows zero silent-skip firings on the matrix fixtures per frontmatter MONO-REG invariant row).
- Author the 3 fixtures + 3 tests above.
- Each test pins both Ok behavior (returns expected unwrapped/ok/first value) AND semantic-pin (regression guard if §03.5 wiring reverted — test name asserts the cross-module dispatch path was exercised).
- Negative pin:
test_imported_method_box_int_method_receiver_mismatch— invoke imported method on receiver whose concrete type does NOT match any registered impl produces clean E2xxx typeck error (NOT E5001 codegen crash).
03.5.4 collect_mono_functions unit tests
- Add to
monomorphize/tests.rs: positive (test_collect_mono_imported_impl_method_resolves) —imported_impl_sigspopulated with(unwrap, Some(Idx(Box<_>)), sig); instance carriesreceiver_type: Some(Idx(Box<int>)); verify resolution non-empty + correct sig. Negative (test_collect_mono_top_level_does_not_consult_imported_impl_sigs) — top-level instance withreceiver_type: NoneAND name matching animported_impl_sigsentry: must NOT resolve via the imported_impl path (top-level chain only). Matrix coverage parallel to §03.3 (6 receiver-type × method shapes) under cross-module fixture topology.
03.5.5 Subsection close-out (03.5) — status: complete
-
test_generic_method_on_generic_typeun-ignored AND passes (#[ignore]reason removed; un-ignore landed at §03.2.2). - All 6 §03.3 matrix tests + 3 §03.5.3 imported-method matrix tests + new
monomorphize/tests.rsunit tests pass. -
timeout 150 diagnostics/dual-exec-verify.sh tests/aot/generics.rs— interpreter/LLVM parity holds (JIT-eligible tests; AOT-only cross-module imports are exempt per frontmatter dual-exec carve-out, tagged with// AOT-only: cross-module imported-method; JIT scope is single-module per evaluator/compile.rs:230). - Run
compiler_repo/diagnostics/repo-hygiene.sh --check.
03.R Third Party Review Findings
Populated by /tpr-review at §03.N.
03.N Completion Checklist
- All 03.1, 03.2, 03.3, 03.4, 03.5 subsections
status: complete(verify against frontmatterblocks_section_close:array). - §02 prerequisite-output gate (frontmatter success_criteria row) satisfied: §02.N close-out unchecked items resolved OR §03.4 / §03.5 gating documented as deferred until §02.N close (per gate rule — local §03.1-§03.3 may complete under partial §02.N close).
- §03.5.3 named imported-method matrix shipped:
test_imported_method_option_int_unwrap+test_imported_method_result_int_str_ok+test_imported_method_list_int_firstpass viacargo test --release -p ori_llvm --test aot. -
/tpr-reviewclean across reviewer set. -
/impl-hygiene-reviewclean after TPR. -
python -m scripts.plan_corpus check plans/aot-mono-completeness/section-03-inherent-method-mono.mdexit 0. -
cargo stgreen fortests/spec/traits/+tests/spec/generics/corpus (inherent-method mono on generic receivers — both JIT and AOT consumeimpl_siglookup-chain semantics §03.5 hardens; per overview Mission Success Criteriacargo stregression-guard row + section frontmattersuccess_criteriarow 13cargo stregression-guard). - BUG-04-091 tracker entry annotated
<!-- delivered-by: plans/aot-mono-completeness/section-03-inherent-method-mono.md -->(retirement at §07). - Section frontmatter flipped to
status: complete,reviewed: true.
HISTORY
- 2026-05-17 — /review-plan editor pass on
section-03-inherent-method-mono.md(Step 5 single-section mode, run_id wa1): integrity audit reported 1 Minor status-text-drift (body Status: Not Started vs frontmatterin-review) + 3 informational findings (cited-subsection-resolution / depends-on-vs-citation-drift forward-references / depends-on-closure §02 in-progress); blind-spots from codex + gemini + opencode surfaced 6 substantive items, all addressed. Edits landed:- (1) Line-coordinate refresh + §02 prerequisite-output gate (cures opencode + gemini blind spots): added §03.1.0 prerequisite task requiring
git rev-parse HEADSHA record + verification ofmonomorphize/mod.rs/multi.rs/compile_common.rs/method_call.rsline citations against HEAD before code authoring. Refreshed all body line numbers to current HEADf5a37d327(monomorphize/mod.rs:71for signature;:86-90for impl_sig_by_name construction;:107-118for dispatch loop;multi.rs:203-238for CompiledModuleInfo;:346for extract call;:444for definition;compile_common.rs:206-253for run_codegen_pipeline wiring). Encoded §02 prerequisite gate in frontmatter success_criteria + §03.1.0 task block — §03.4/§03.5 BLOCKED until §02.3+§02.4+§02.N resolved; §03.1-§03.3 may proceed under partial §02.N close (cures gemini blind-spot 2026-05-17 finding 4). - (2) Data-shape contract unification (cures codex + gemini convergence): added §03.4.1 ImplMethodInfo carrier struct definition carrying
receiver_type_idx: Idx(NOTreceiver_type_name: String); added §03.5.1 Data-Shape Contract block with verbatimcollect_mono_functionssignature carryingimported_impl_sigs: &[(Name, Option<Idx>, FunctionSig)](NOT&[(Name, FunctionSig)]). Encoded the unified tuple shape in frontmatter unified-MonoInstance-tuple-shape success_criteria row — single data shape across emit (§03.1) / export (§03.4) / consume (§03.5) perimpl-hygiene.md §SSOT. - (3) Named imported-method matrix added inline (cures codex blind-spot 2026-05-16 §2): added §03.5.3 block with 3 explicit AOT tests (
test_imported_method_option_int_unwrap/..._result_int_str_ok/..._list_int_first) + fixture paths undertests/aot/fixtures/imported_methods/mirroring §02.4’simported_generics/layout. Removed deferral to §06; matrix is part of §03.5 deliverables. - (4) Ordering primitives added to frontmatter (cures opencode blind-spot finding 6):
subsection_depends_on: {"03.2": ["03.1"], "03.3": ["03.2"], "03.4": ["03.1"], "03.5": ["03.2", "03.4"], "03.R": ["03.5"], "03.N": ["03.R"]}+blocks_section_close: ["03.1", "03.2", "03.3", "03.4", "03.5", "03.R", "03.N"]— mirrors §02 frontmatter pattern atsection-02-import-sigs-traversal.md:23-35. §03.5 explicitly depends on both §03.2 (lookup key shape) AND §03.4 (exporter forimported_impl_sigssource). - (5) Section restructure: split §03.1 into §03.1.0 (prerequisite verification) + §03.1.1 (typeck emission cure); split §03.2 into §03.2.1 (keyed-lookup conversion) + §03.2.2 (un-ignore + parity) + §03.2.3 (close-out); split §03.4 into §03.4.1 (carrier shape) + §03.4.2 (exporter wiring) + §03.4.3 (close-out); split §03.5 into §03.5.1 (data-shape contract) + §03.5.2 (lookup-chain extension) + §03.5.3 (named matrix) + §03.5.4 (unit tests) + §03.5.5 (close-out). Restructure preserves subsection-id stability (frontmatter
sections:array unchanged); §03.1.0/§03.2.1/etc are sub-tasks within parent subsection scope. - (6) Status-text drift cohesion fix (cures Step 1.7 INTEGRITY:status-text-drift Minor): body Status: line at line 52 updated from
Not Started→In Reviewmatching frontmatterstatus: in-review; status semantics annotated with flip rule referencing the §02 prerequisite gate. - (7) Updated §03.N completion checklist to reference frontmatter
blocks_section_close:array + §03.5.3 named matrix + §02 prerequisite gate. No structural promotion / splits / new sibling sections required — restructure stayed within §03 subsection scope perrouting.md §4budget thresholds (§03 body line count remains under default 300-line budget cap perrouting.md §5).
- (1) Line-coordinate refresh + §02 prerequisite-output gate (cures opencode + gemini blind spots): added §03.1.0 prerequisite task requiring
- 2026-05-17 — /tpr-review round 1 cures (Step 6 round 1, run_id uuuxx4cd; codex + gemini + opencode reviewer set; fork-context Opus adjudicator): round verdict: 6 actionable findings (1 High agreement-cluster codex+opencode + 5 singletons); 3 false positives rejected by adjudicator (gemini misread intentional host-vs-cross-module shape asymmetry: host
impl_sigsre-keyed at lookup site per §03.2.1, cross-moduleimported_impl_sigsserializes receiver_idx in the parameter because impl block resides in another module). Cures applied:- (1) [High]
00-overview.md:118Extension-Surface Map row for §03:imported_impl_sigs: &[(Name, FunctionSig)]→&[(Name, Option<Idx>, FunctionSig)]matching §03.5.1 Data-Shape Contract; added inline rationale referencing the receiver-discrimination invariant. - (2) [Medium]
section-03:309ordinal drift:success_criteria row 4 cargo st regression-guard→row 13 cargo st regression-guard(row 4 istest_generic_method_on_generic_type passes; row 13 is the cargo st regression-guard entry). - (3) [Minor]
section-03:69status-line parenthetical strip:**Status:** In Review (per frontmatter...flipped to in-progress...)→**Status:** In Review— the flip semantics live in success_criteria + §03.1.0, duplicating in status line was rationale-prose perskill-vocabulary.md §3. - (4) [Minor]
section-03:142Pool::generic_shell algorithm spec: amended the citation block with explicit depth-first traversal rule for nested generic args, byte-identical-Idx round-trip invariant viaori_types::canon, andscripts/intel-query.sh symbols Poolreuse-search directive pertypes.md §TY-3/§TF-2. - (5) [informational]
section-05:20depends_on: ["01", "02", "04"]→["01", "02", "03", "04"]— adds §03 as predecessor since both §03.5 and §05 extendcollect_mono_functionsparameter list (parameter-composition safety for DAG traversal). - (6) [informational]
section-03:22TPR-session provenance citation in success_criteria body: stripped(per gemini blind-spot 2026-05-16 finding 4)from the §02 prerequisite-output gate criterion — provenance now lives in this HISTORY entry vs the prescriptive success_criteria text perstate-discipline.md §7. Round-loop state-machine note:record-verdictaccepted 6 actionable findings then nextround-stepemittedexit_cleanwithrounds_completed: 0instead ofapply_cures— script-state-machine inconsistency between verdict-acceptance and round-step transition. Findings cured inline per /tpr-review §7 “Fix NOW” disposition; script gap filed via/add-bugfor future-runs preservation. Round exit:clean(no actionable findings remain post-cure).
- (1) [High]
- 2026-05-17 — /commit-push halt skipped — halt_reason: extended_check_fail, failing repo: /home/eric/projects/ori_lang/compiler_repo, scope: cross-scope (parallel-session AIMS burden-lower work failing compiler_repo pre-commit full-check; this session’s cures land entirely in plan-body .md files under plans/aot-mono-completeness/, /home/eric/projects/ori_lang wrapper repo only): per
skill-control-contract.md §Autopilot Modeunified hook-failure clause, autopilot proceeds without committing this round’s cures; whoever owns the parallel-session compiler_repo work clears the dirty tree via user-typed/commit-push --bypass(Claude NEVER initiates bypass perfeedback_commit_push_bypass_flag.md). Working-tree cures preserved for next user touchpoint or downstream /commit-push run.