42%

Intelligence Reconnaissance

Queries run 2026-04-23 (Phase 2 research):

  • scripts/intel-query.sh --human file-symbols "registry/traits" --repo ori — inventory TraitRegistry surface. Result: lookup_method + lookup_method_checked are the single entry points for trait-method lookup; impls_by_type: FxHashMap<Idx, Vec<ImplEntry>> is the keying structure.
  • scripts/intel-query.sh --human callers "lookup_method_checked" --repo oriinfer/expr/calls/impl_lookup.rs:35 is the sole caller from inference paths.
  • scripts/intel-query.sh --human callers "lookup_method" --repo oriinfer/expr/operators.rs:708,759 + registry/methods/mod.rs:36 (thin wrapper lookup_trait_method).
  • scripts/intel-query.sh --human similar "bound_chain_dispatch" --repo rust,swift --limit 5 — Rust’s assemble_inherent_candidates_from_param at probe.rs:958 scans self.param_env.caller_bounds() for ClauseKind::Trait predicates.
  • scripts/intel-query.sh --human file-symbols "FunctionSig" --repo oriFunctionSig.type_params: Vec<Name>, FunctionSig.type_param_bounds: Vec<Vec<Name>>, FunctionSig.scheme_var_ids: Vec<u32> — parallel arrays. Bounds are stored HERE, not in TraitRegistry.

Results summary [ori]:

  • File-size baseline pre-§10.0 split: registry/traits/mod.rs 765 lines; method_call.rs 524 lines (both over impl-hygiene.md §File Organization 500-line cap → §10.0 prerequisite).
  • lookup_method_checked keys on receiver Idx; Tag::RigidVar Idx is never registered as an impl’s self_type, so dispatch misses on rigid-receiver bound-chain.
  • Bounds live on FunctionSig.type_param_bounds: Vec<Vec<Name>> parallel to type_params: Vec<Name> / scheme_var_ids: Vec<u32> — three parallel arrays per the §FunctionSig query result above (NOT in TraitRegistry).
  • §10.1’s bound-chain walk consumes FunctionSig + TraitRegistry jointly: retrieve current function’s sig via engine.signatures(); scan type_param_bounds[idx_of_rigid_var] for trait names; call TraitRegistry::get_trait_by_name for each; check that trait’s collected_methods for method_name.
  • §10.2 capability gap: infer_with_capability (compiler_repo/compiler/ori_types/src/infer/expr/constructors.rs:178-201) binds provider type in env without trait-shape validation — §10.2.2 extends to surface registered trait methods of the capability + validate handler conformance.

Section 10: Dispatch-on-Rigid-Receiver Gaps

Goal: Close method-dispatch-on-rigid-receiver gaps that block tests/spec/declarations/traits.ori (§10.1) and tests/spec/capabilities/propagation.ori (§10.2). Prerequisite §10.0 splits over-500-line files to satisfy impl-hygiene.md §File Organization before §10.1/§10.2 edit them.

Depends on: §03 (bodies-pass + validator), §04 (codegen assertions), §06 (overview Phase 1 predecessor for Phase 2/3/4 per §10.R-026 cited-section-drift cure), §09 (especially §09.2 def-impl Self — same impl_self_type infrastructure; landing §09.2 first ensures §10.1 RigidVar dispatch doesn’t interact with un-scoped Self fabrication).

Sequencing rule: §10.0 MUST complete before §10.1 or §10.2 touch their target files. §10.1 before §10.2 (Codex 2.6B: capability dispatch wires through the same lookup policy as bound-chain dispatch; §10.1 establishes the policy). Mirrored in subsection_depends_on: frontmatter per routing.md §5.

Banned Patterns (§10 execution discipline; per §10.R-027)

Per skill-control-contract.md §Banned phrases (autopilot mode), §10 execution forbids these shapes regardless of autopilot vs interactive mode:

  • AskUserQuestion on ambiguous generic bounds during §10.1.3 / §10.2.3 implementation dispatch. Ambiguity (e.g., multiple bound-chain candidates) MUST emit E2023 diagnostic per typeck.md §DI-1, NEVER prompt the user inline. Cure: TDD matrix test_method_dispatch_on_rigid_var_ambiguous_bounds_reports_ambiguity per §10.1.1.
  • AskUserQuestion on TraitMethodDef.has_self classification edge cases (§10.2.0). Classification flows from registration-time syntactic source (params.first().name == checker.well_known().self_kw, interned-Name SSOT per §10.R-028); no judgment call at dispatch time.
  • Permission-asking hedges + pause-rationalization phrases per skill-vocabulary.md §2 Banned Phrases — Autopilot Context (Critical) — banned in all §10 execution-step output (full enumeration lives at SSOT; cite, do not duplicate). Reviewer enforcement: STRUCTURE:autopilot-pause-leak Critical via scripts/prose-lint.py autopilot-pause-leak label family.
  • Mid-loop AskUserQuestion between TDD cells, between subsection close-outs, between §10.R finding resolutions. The plan-execution authorization covers the whole arc.
  • Deferral language (“nice-to-have”, “out of scope”, “future improvement” without anchor, “covered by existing tests”) per impl-hygiene.md §Findings Disposition.

Reviewer enforcement: STRUCTURE:autopilot-pause-leak Critical when banned shapes appear in §10 execution output; blocks §10.N close-out.


10.0 Prerequisite file splits

Goal: Reduce compiler_repo/compiler/ori_types/src/registry/traits/mod.rs from 765 lines to ≤500 lines AND compiler_repo/compiler/ori_types/src/infer/expr/calls/method_call.rs from 524 to ≤400 lines. Extract cohesive submodules; keep mod.rs as a dispatch hub. Mechanical split — zero semantic change.

10.0.1 Discovery

  • Run wc -l compiler_repo/compiler/ori_types/src/registry/traits/mod.rs — verify 765 lines baseline.
  • Run wc -l compiler_repo/compiler/ori_types/src/infer/expr/calls/method_call.rs — verify 524 lines baseline.
  • Re-read both files end-to-end to identify cohesive extraction boundaries:
    • registry/traits/mod.rs: public TraitRegistry struct + inherent methods; separate lookup_method* paths (lookup) from register_impl* + register_trait* paths (registration). Candidate split: registry/traits/lookup.rs (lookup paths) + registry/traits/registration.rs (registration paths) + registry/traits/mod.rs (struct definition + dispatch hub).
    • method_call.rs: infer_method_call + infer_method_call_named are the public entry points; resolve_receiver_and_builtin, check_positional_args, unify_higher_order_constraints, unify_closure_param_with_iterator_elem, check_range_float_iteration, check_infinite_iterator_consumed, find_infinite_source are private helpers. Candidate split: method_call/receiver_dispatch.rs (receiver/builtin resolution + closure-param unification) + method_call/mod.rs (public entry points).

10.0.2 Design

Fix shape (mechanical):

  1. Create new files with extracted content:
    • registry/traits/lookup.rsimpl TraitRegistry { pub fn lookup_method(...) { ... } pub fn lookup_method_checked(...) { ... } pub fn impls_for_type(...) { ... } } + helper private functions.
    • registry/traits/registration.rsimpl TraitRegistry { pub fn register_impl(...) { ... } pub fn register_trait(...) { ... } } + helper private functions (coherence checks, specificity, conflicting-defaults etc.).
    • registry/traits/mod.rs — struct definition + mod lookup; mod registration; + re-exports.
    • method_call/receiver_dispatch.rsresolve_receiver_and_builtin, unify_higher_order_constraints, unify_closure_param_with_iterator_elem, check_range_float_iteration, check_infinite_iterator_consumed, find_infinite_source. Keep them pub(crate) so method_call/mod.rs can call them.
    • method_call/mod.rsinfer_method_call + infer_method_call_named + check_positional_args.
  2. Update use statements in dependents (none should need changes if re-exports are preserved).

No semantic change: the split is git mv-like at function granularity. Existing behavior preserved; all existing tests pass unchanged.

10.0.3 Implementation

  • Create registry/traits/lookup.rs with extracted content.
  • Create registry/traits/registration.rs with extracted content.
  • Trim registry/traits/mod.rs to struct + module declarations + re-exports. (Final post-split: 450 lines per HISTORY note line 84; ≤500 cap met, 300-target follow-up filed as §10.R-008.)
  • Create method_call/receiver_dispatch.rs with extracted content. (Shipped as closure_unify.rs per HISTORY; equivalent surface.)
  • Trim method_call/mod.rs (or rename to method_call.rs). (Final post-split: 503 lines; ≤400 target unmet, follow-up filed as §10.R-009.)
  • Run cargo build — compiles clean.
  • Run cargo test -p ori_types — all existing tests pass unchanged.
  • Run cargo clippy -p ori_types — clean.
  • Commit the split as ONE atomic commit (per compiler.md §Multi-commit sequences). Commit a20bc41b1.
  • Post-split file counts: registry/traits/mod.rs=450 (split target met, ≤500 cap satisfied); registry/traits/lookup.rs=513, infer/expr/calls/method_call.rs=503, infer/expr/calls/impl_lookup.rs=522 exceed 500-line cap and carry follow-up cures anchored under §10.R-007 (extract find_conflicting_defaultsregistry/traits/conflicts.rs) / §10.R-009 (extract check_positional_argsmethod_call/arg_check.rs) / §10.R-010 (extract LookupOutcome construction → impl_lookup/outcome.rs). The split’s primary goal (mod.rs hub trim) met; residual cap breach on three sibling files owned by the three §10.R cures gating §10.N close-gate.

10.0.4 Close §10.0

  • All §10.0.3 checkboxes marked [x].
  • cargo t + cargo clippy + cargo fmt all green post-split.
  • /tpr-review on §10.0 diff → deferred to §10.R aggregate close-gate (mechanical split, low-finding; per §10.R-016 cure option (a) — defers but acknowledges intent; aggregate close-gate satisfies the per-subsection-gate contract).
  • /impl-hygiene-review on §10.0 diff → deferred to §10.R aggregate close-gate (BLOAT 500-line follow-ups filed under §10.R-007/§10.R-009/§10.R-010 — three files still over cap; cures anchored; per §10.R-016 cure option (a)).
  • Frontmatter 10.0 status: complete.

10.1 Generic-param method dispatch via bound-chain walk

Goal: Extend TraitRegistry::lookup_method_checked to consult FunctionSig.type_param_bounds when receiver is Tag::RigidVar (generic type parameter). The current behavior keys impls_by_type by concrete Idx, so RigidVar receivers always miss. @f<T: Clone>(val: T) -> str = val.clone() fails E2003 method-not-found despite the declared bound.

Guards (both reviewers 2.6B): visited-set keyed on (rigid_var_idx, trait_idx) to prevent infinite loops on cyclic bounds A: B, B: C, C: A; recursion depth limit 256 per impl-hygiene.md §Panic & Assertion.

Priority (Rust + Swift consensus): bound-chain candidates are inherent-priority — they win over extension-method lookup when receiver is a rigid var. This matches Rust’s WhereClauseCandidate in probe.rs:958.

10.1.1 Discovery + root cause verification

  • Re-read registry/traits/lookup.rs (after §10.0 split) — confirmed: find_trait_method_via_bound_chain at lookup.rs:429 returns BoundChainLookup::NotFound (0 candidates), Found (1), Ambiguous (2+); visited-set dedup on trait_idx via seen_traits; supertrait flattening via collected_methods. 2026-06-07.
  • Re-read infer/expr/calls/method_call.rs (post-§10.0) + impl_lookup.rs — confirmed dispatch path: impl_lookup.rs:370 gates Tag::RigidVar | Tag::Var receivers, calls reg.find_trait_method_via_bound_chain(method, &bounds) at :378, builds LookupOutcome::Found at :381 with Tag::SelfType → receiver_ty substitution. 2026-06-07.
  • Re-read FunctionSigtype_params / type_param_bounds / scheme_var_ids parallel arrays; bounds-for-var aggregated caller-side and passed to the helper as flat &[Name] (shipped wiring). 2026-06-07.
  • Confirm engine access — bounds aggregation is shipped caller-side at the impl_lookup.rs:370 dispatch site (the helper consumes a pre-aggregated &[Name] slice). 2026-06-07.
  • TDD matrix authored as Rust unit tests in registry/traits/tests.rs (test_bound_chain_*, 7 cells): single-bound Found, multi-bound each-Found, no-matching-bound NotFound, empty-bounds NotFound, ambiguous-two-bounds Ambiguous, supertrait-inherited Found, duplicate-bound dedup (cyclic guard) Found-not-Ambiguous. All 7 green; 1079 ori_types lib pass; clippy clean. 2026-06-07.
    • Positive test_method_dispatch_on_rigid_var_with_single_bound@f<T: Clone>(val: T) -> T = val.clone() compiles clean; val.clone() resolves to Clone::clone(val).
    • Positive test_method_dispatch_on_rigid_var_with_multiple_bounds_different_methods@f<T: Clone + Debug>(val: T) with val.clone() and val.debug() both resolve.
    • Negative test_method_dispatch_on_rigid_var_without_bound_reports_missing@f<T>(val: T) -> T = val.clone() reports E2003 (or equivalent) with suggestion “add T: Clone bound”.
      • RESOLVED 2026-06-07 (later): the unified §06.5 unknown-method diagnostic now fires for this case. emit_unknown_method (impl_lookup.rs) emits E2001 “no method m on generic type parameter — add a trait bound” for a NotFound on a Tag::RigidVar OR a NAMED unbounded Tag::Var (generic param via fresh_named_var); method_call.rs:313 no longer defers a named-generic no-bounds receiver (only anonymous inference vars defer). Pinned by test_unknown_method_on_unbounded_rigid_receiver_reports_error + test_method_on_bounded_rigid_receiver_resolves_clean (positive boundary) in check/bodies/tests.rs; 1082 ori_types lib pass, clippy clean. Full spec-suite + dual-exec verification is cross-scope-blocked (parallel-session ori_arc BurdenAnalysisCtx mid-edit does not compile); completes when that tree settles.
      • (historical) VERIFIED-OPEN 2026-06-07: end-to-end @f<T>(a: T, b: T) -> T = a + b; AND @f<T>(x: T) -> str = x.hello(); (no bound) BOTH compile clean (silent-accept) when they MUST report E2003. Root cause UNIFIED with BUG-02-044 + §06.5: lookup_impl_method correctly returns NotFound, but the caller (method_call.rs:110,213) calls emit_into_not_implemented (impl_lookup.rs:575) which is INTO-ONLY (emits only when method == into); every other unknown method pushes NO diagnostic → caller returns Idx::ERROR → silent poison. SSOT cure = the §06.5 general unknown-method diagnostic (covers concrete + rigid receivers; suppresses follow-on E2005; defers ONLY for unresolved Tag::Var). The bound-chain helper itself is pinned green by the 7 test_bound_chain_* cells; this negative case is gated on §06.5’s general-method-not-found emit replacing the into-only path. The positive cells (with-bound) work; the negative cell closes when §06.5 lands.
    • Negative test_method_dispatch_on_rigid_var_ambiguous_bounds_reports_ambiguity@f<T: Foo + Bar>(val: T) where both Foo and Bar have method() reports E2023 ambiguous method.
    • Cyclic guard test_method_dispatch_cyclic_bounds_does_not_infinite_loop — construct cyclic-bound scenario (if possible within Ori’s surface syntax; else test via direct TraitRegistry fixture) and verify visited-set prevents loop. Test MUST have a bounded timeout (timeout: 5000 ms or similar in the harness).
    • Depth guard test_method_dispatch_deep_supertrait_chain_respects_depth_limit — construct supertrait chain of ≥256 levels (via fixture), verify error instead of stack overflow.

10.1.2 Design

RigidVar origin scope (resolves §10.R-001 — gemini convergent): Bound resolution MUST cover ALL Tag::RigidVar origin sources, not just current_fn_sig.scheme_var_ids. Per the TDD matrix in §10.1.1, the matrix mandates:

  • Tag::RigidVar from @f<T: Bound> — top-level function generic. Sourced from current_fn_sig.type_params + type_param_bounds.
  • Tag::RigidVar from impl<T: Bound> Type<T> — impl-level generic. Sourced from ImplEntry.type_params + type_param_bounds (registered at compiler_repo/compiler/ori_types/src/check/registration/impls.rs).
  • Tag::SelfType in trait default method — synthetic receiver placeholder. Sourced from enclosing TraitEntry.method_bounds for Self.

Keying lookup solely off current_fn_sig.scheme_var_ids (per the prior draft) misses impl-level and trait-default-method origins. The unified resolution surface uses an analog of Rust’s param_env.caller_bounds() — gather every bound visible at the call site from (a) current function scope, (b) enclosing impl scope (via engine.current_impl_self() per typeck.md §SG-2), (c) enclosing trait scope (for default methods).

Fix shape:

  1. In lookup.rs (post-§10.0), the shipped helper find_trait_method_via_bound_chain(method_name: Name, type_param_bounds_for_var: &[Name]) -> BoundChainLookup at compiler_repo/compiler/ori_types/src/registry/traits/lookup.rs:429 is the SSOT bound-chain walker. Signature accepts a flat bounds slice (&[Name]) — NOT a ParamEnv struct (no ParamEnv type exists in the shipped code; the conceptual param_env::caller_bounds() notion from earlier drafts is realized by passing the pre-aggregated &[Name] slice directly):
    • Caller-side responsibility: aggregate bounds visible at the call site from (a) current FunctionSig.type_param_bounds_for_var(var_id) (shipped per compiler_repo/compiler/ori_types/src/registry/traits/types.rs FunctionSig API), (b) enclosing impl<T: Bound> impl bounds (via engine.current_impl_self() per typeck.md §SG-2), (c) enclosing trait default-method bounds. Single SSOT aggregation per receiver-Idx per impl-hygiene.md §SSOT.
    • For each trait name in the bounds slice:
      • Call self.get_trait_by_name(trait_name)Option<&TraitEntry>. None skips the bound (trait not in registry); does NOT crash.
      • Check trait_entry.collected_methods for method_name (covers supertrait-inherited methods).
      • If found: record as BoundCandidate(trait_idx, method_item).
    • Deduplicate candidates. 0: BoundChainLookup::NotFound. 1: BoundChainLookup::Found { trait_idx, method }. 2+: BoundChainLookup::Ambiguous { candidates }.
    • Guard with visited-set keyed on (rigid_var_idx, trait_idx). Max recursion depth 256 per impl-hygiene.md §Panic & Assertion.
  2. MANDATORY: share find_trait_method_via_bound_chain across both lookup entry points (resolves §10.R-020):
    • lookup_method_checked (called from impl_lookup.rs::lookup_impl_method for receiver.method(...) dispatch): SHIPPED — sole call site at compiler_repo/compiler/ori_types/src/infer/expr/calls/impl_lookup.rs:337 invokes reg.find_trait_method_via_bound_chain(method, &bounds) when receiver_idx’s tag is Tag::RigidVar OR Tag::SelfType (under enclosing trait default-method scope), BEFORE returning NotFound.
    • lookup_method (called from operators.rs:708 resolve_binary_op_via_trait AND operators.rs:759 resolve_unary_op_via_trait for operator-dispatch): SAME bound-chain consultation MUST occur on Tag::RigidVar receiver. Operator dispatch cannot rely on lookup_method_checked’s inherent-shadowing path — operator dispatch path historically uses lookup_method directly. Either (a) route both lookups through a shared lookup_method_with_bounds primitive that performs the bound-chain walk, OR (b) inline the bound-chain consultation in lookup_method mirroring lookup_method_checked. Cure (a) preferred per impl-hygiene.md §Algorithmic DRY (single SSOT for bound-chain dispatch). Operator-dispatch cell in TDD matrix (§10.1.1) verifies val + other where val: T, T: Add works.
    • Priority: bound-chain candidates are inherent-priority (Rust + Swift consensus per inspired_by cites) — they win over extension-method lookup at both entry points.
  3. In infer/expr/calls/method_call.rs (or receiver_dispatch.rs post-§10.0), when resolve_receiver_and_builtin encounters Tag::RigidVar receiver, fall through to lookup_impl_method (unchanged); the new bound-chain walk runs inside lookup_method_checked and returns the right method.

10.1.3 Implementation

  • find_trait_method_via_bound_chain helper SHIPPED in registry/traits/lookup.rs:429 with signature (method_name: Name, type_param_bounds_for_var: &[Name]) -> BoundChainLookup.
  • Wired into lookup_method_checked for Tag::RigidVar receivers — sole call site at infer/expr/calls/impl_lookup.rs:337.
  • TDD matrix authored FIRST (7 test_bound_chain_* cells in registry/traits/tests.rs); pins the shipped find_trait_method_via_bound_chain contract. 2026-06-07.
  • Visited-set (seen_traits on trait_idx) shipped in find_trait_method_via_bound_chain; supertrait-depth guarded inside collected_methods; duplicate-bound cell pins dedup-not-Ambiguous. 2026-06-07.
  • Run unit tests — 7/7 bound-chain cells + 1079 ori_types lib pass; duplicate-bound (cyclic) + supertrait-chain cells green. 2026-06-07.
  • cargo run -- test tests/spec/declarations/traits.ori — 30/30 passed, zero E2005 sites. 2026-06-07.
  • Verify operator dispatch overlap: test @f<T: Add>(val: T, other: T) -> T = val + other works (§10.R-020 shared-primitive cure verified at both lookup_method_checked AND lookup_method entry points; cure (a) shared lookup_method_with_bounds primitive both call OR cure (b) inline find_trait_method_via_bound_chain in lookup_method mirroring lookup_method_checked).
  • Matrix: receiver × bound × method:
    • Receivers: Tag::RigidVar from @f<T>, Tag::RigidVar from impl<T: Bound> Type<T>, Tag::SelfType in trait default method.
    • Bounds: single bound, multi-bound (A + B), supertrait chain (A: B: C), bound on trait method’s generic param.
    • Methods: trait-required method, trait-default method, supertrait-inherited method, operator (+, -, ==, <).
  • Verify cargo st tests/ green, debug + release parity.
  • Run timeout 150 diagnostics/dual-exec-verify.sh on §10.1-touched files — zero divergences (§10.R-022 success_criteria SC line 89).

10.1.4 Close §10.1

  • All §10.1.3 checkboxes marked [x].
  • /tpr-review on §10.1 diff → clean.
  • /impl-hygiene-review on §10.1 diff → clean.
  • /improve-tooling retrospective (cyclic-guard pattern may generalize to other compiler recursion paths).
  • /sync-claude retrospective — update typeck.md §TR-4 bound-satisfaction discussion with bound-chain walk specifics.
  • Frontmatter 10.1 status: complete.

10.2 Capability-method dispatch — trait-method surface for bound handler value

Goal: Extend infer_with_capability at constructors.rs:99-122 to surface the capability trait’s methods for dispatch on the bound handler value. When body calls Http.get(url: "..."), the Http identifier resolves to the handler’s type, and method lookup must find get via the capability trait’s method set (not only via the handler type’s own impls).

Composition with §10.1: §10.1’s bound-chain walk generalizes — §10.2 uses the same TraitRegistry::lookup_method_checked extension plus a capability-specific surface that registers the capability trait’s methods as candidates when the receiver is a capability-bound name.

10.2.0 Capability-method dispatch fork (has_self detection via TraitMethodDef persistence)

Goal: Eliminate the design contradiction between §10.2’s “reuses the same TraitRegistry::lookup_method_checked extension” claim and impl_lookup.rs:371-377’s hardcoded has_self: true. Capability methods (Http.get(url: str) -> str) lack a self receiver; receiver-method dispatch (val.clone()) requires has_self: true. The two cannot share the same has_self value; the existing path conflates them. Design citation per routing.md §6 decision artifact: this subsection resolves §10.R-002 (codex + opencode convergent) AND §10.R-021 (TraitMethodDef.has_self persistence — strengthens prior signature-shape heuristic per Step 4 codex BS-10-B) AND §10.R-028 (interner-SSOT discipline for self parameter detection per Round 0 gemini TPR-10-R0-002 — checker.well_known().self_kw mandatory; string-literal comparison BANNED in non-test code).

Fix shape (resolves §10.R-021 — TraitMethodDef.has_self persistence; supersedes signature-shape heuristic):

The prior signature-shape heuristic (pool.tag(sig) == Tag::Function AND first param Idx equals receiver_ty post-substitution) is structurally weak: it misclassifies associated functions whose first parameter coincidentally matches receiver_ty. The existing ImplMethodDef at registry/traits/mod.rs:241,249 already persists has_self: bool computed from the parameter NAME at check/registration/impls.rs:503 — a stronger syntactic source. Capability traits go through TraitMethodDef (registry/traits/mod.rs:144) which currently lacks the field. Cure: mirror the has_self field on TraitMethodDef, populate at trait-method registration in check/registration/traits.rs from parameter syntactic shape, consume at bound-chain dispatch site.

  1. TraitMethodDef extension — Add has_self: bool field to TraitMethodDef struct at compiler_repo/compiler/ori_types/src/registry/traits/mod.rs:144. Populate at check/registration/traits.rs trait-method registration: has_self = method_decl.params.first().is_some_and(|p| p.name == checker.well_known().self_kw) — mirrors ImplMethodDef.has_self computation pattern at check/registration/impls.rs:506 (interned-Name SSOT via WellKnownNames; per types.md §TI-2 interning discipline + impl-hygiene.md §Interning Discipline ban on == "identifier_name" in non-test code).
  2. Bound-chain dispatch consumption — At compiler_repo/compiler/ori_types/src/infer/expr/calls/impl_lookup.rs:371-382 (current LookupOutcome::Found construction), replace hardcoded has_self: true with has_self: trait_method_def.has_self — read from TraitMethodDef persisted in step 1. No signature-shape introspection; no Pool::children traversal required for this decision.
  3. Strip task #11 comment at impl_lookup.rs:373-376 as part of has_self refactor (resolves §10.R-004 + §10.R-013 line-range refresh + per impl-hygiene.md §Comments C-B11 / routing.md §6). Current TODO text: // TODO(typeck): capability methods without self need has_self: false dispatch path. — strip in same commit as §10.2.0 implementation.
  4. Canon arena panic bisection owned by BUG anchor from §10.R-003/§10.R-011 (separate bug-plan); Pool::children / extra-array accessor discipline applies to any other signature traversal sites but is not invoked by the TraitMethodDef.has_self consumption path.

Cross-dispatch invariant (§10.R-020 alignment): Both lookup_method_checked AND lookup_method entry points (per §10.1.2 Fix shape step 2) consume the same shared bound-chain primitive; has_self from TraitMethodDef flows through the shared primitive uniformly for both receiver-method and operator-dispatch paths. No parallel has_self resolution at operator sites.

Sequencing per DAG (§10.R-025): §10.1 (bound-chain + operator routing) ships before §10.2 per declared depends_on; within §10.2, §10.2.0 ships BEFORE §10.2.2 trait-shape validation so dispatch reaches the eval/codegen path with correct has_self classification before §10.2.2 validates conformance, closing the phase-gap surface.

10.2.1 Discovery + root cause verification

  • Re-read constructors.rs:178-201 (infer_with_capability) — confirms env binding capability → provider_ty (line 192) + provided-capability mark (lines 196-197), zero trait-shape validation. Anchor: §10.R-005 missing-validation finding. Symbol-anchored ref; line range refreshed Round 0 TPR-10-R0-004 from pre-§09.3 :99-122 after check_ok/check_err/check_some additions shifted file +79 lines.
  • Trace Http.get(url: "...") path through infer_method_callresolve_receiver_and_builtinlookup_impl_methodlookup_method_checked → §10.1 bound-chain (via capability-bound registration in check_function).
  • Confirm built-in capability traits (Http, Logger, Env, FileSystem, Print, Clock, Random, Crypto, Cache) registered in TraitRegistry via register_builtin_traits pass (or document the gap as discovery output). Anchor: compiler_repo/compiler/ori_types/src/check/registration/builtin_types.rs + compiler_repo/compiler/ori_types/src/check/registration/traits.rs.
  • TDD matrix BEFORE implementation:
    • Positive (with-impl handler) test_capability_method_dispatch_via_handler_implwith Http = RealHttp in { Http.get(url: "foo") } resolves via RealHttp’s registered impl Http (handler-side conformance).
    • Positive (stateful handler) test_capability_method_dispatch_via_capability_trait_surfacewith Cap = handler(state: S) { get: (s, url:) -> (s', val) } in ... provides every trait method shape (stateful-handler form per ori-syntax.md §Capabilities).
    • Negative (missing method) test_capability_method_missing_on_handler_reports_error — handler lacks get → clean error at with ... = handler site naming missing capability trait method (§10.2.2 mandatory validation).
    • Negative (wrong arity) test_capability_method_arity_mismatch_reports_error — handler’s get declared with wrong parameter count → diagnostic at with site, NOT at dispatch site.
    • Negative (wrong return) test_capability_method_return_type_mismatch_reports_error — handler’s get returns wrong type → diagnostic at with site.
    • Phase-gap regression pin test_capability_method_missing_does_not_crash_eval — handler missing get MUST NOT crash eval or codegen with internal panic; typeck rejects the with ... = handler form with a clean diagnostic.
    • has_self regression pin (§10.R-021) test_bound_chain_associated_function_reports_has_self_false — capability trait method declared without self first param (e.g., @new (cfg: Config) -> Self on a capability Foo { ... }) MUST dispatch with has_self: false per TraitMethodDef persistence; signature-shape coincidence (first param Idx == receiver_ty) MUST NOT misclassify it as receiver-method.
    • has_self regression pin (§10.R-021) test_has_self_misclassification_does_not_crash_eval — TraitMethodDef.has_self mismatch (synthetic test fixture forcing wrong classification) MUST NOT crash eval or codegen with internal panic; downstream consumers (eval method dispatch, codegen ABI) handle the disagreement gracefully via diagnostic, not via panic.
    • Built-in capability registration pin (§10.R-023) test_capability_dispatch_when_trait_not_registered_reports_clean_error — when TraitRegistry::get_trait_by_name(capability) returns None (built-in capability trait not yet registered), §10.2.2 validation MUST emit a clean diagnostic at the with ... = handler site naming the unregistered capability — MUST NOT unwrap() and panic.

10.2.2 Design — MANDATORY trait-shape validation

Goal: Validate handler conformance to the capability trait’s method set at the with Cap = handler in expr site. Failure produces a clean diagnostic at the with site naming the missing/mismatched method, NOT a crash downstream when dispatch reaches eval/codegen.

Rule (per CLAUDE.md §The One Rule + §Correctness Above All): Trait-shape validation is MANDATORY, not optional. Typeck-passes-but-eval/codegen-crashes on non-conformant handler IS a phase-gap defect per impl-hygiene.md §Cross-Phase Invariant Contracts (Type Checker → Eval / Codegen rows); the cure is enforcement at typeck, not downstream symptom suppression.

Fix shape:

  1. At infer_with_capability (compiler_repo/compiler/ori_types/src/infer/expr/constructors.rs:178-201), after resolving capability to a registered trait:
    • Look up the trait’s method set via TraitRegistry::get_trait_by_name(capability). Returns Option<&TraitEntry> per compiler_repo/compiler/ori_types/src/registry/traits/lookup.rs:22.
    • MANDATORY None-handling (§10.R-023): On None (built-in capability trait not registered in TraitRegistry — e.g., Http, Logger, FileSystem if register_builtin_traits gap surfaces): emit a CLEAN diagnostic at the with ... = handler span naming the unregistered capability. NEVER unwrap()None-on-built-in-capability is a registration gap to file as bug, NOT an internal panic. Cite §10.2.1 discovery checkbox confirming built-in capability trait registration.
    • On Some(trait_entry): iterate trait_entry.collected_methods.
    • For each trait method, look up the corresponding method on the handler’s provider type (via TraitRegistry::lookup_method with the handler’s provider_ty as receiver).
    • Verify signature shape match: parameter count, parameter types (post-Self-substitution to provider_ty), return type.
  2. On missing method: emit a new diagnostic (E2014 reuse OR new code E2043 — bound at §10.2.2 ship time per .claude/rules/typeck.md §DI-1 Error Code Table) at the with ... = handler span naming the missing capability trait method.
  3. On signature mismatch: same diagnostic family, including diff between expected (trait method) and actual (handler method) signatures.
  4. Wire the bound identifier in scope to surface the trait’s method set (per the existing capability-bound registration in check_function, already shipped per compiler_repo/compiler/ori_types/src/check/bodies/functions.rs:152).
  5. For method lookup on a capability-bound identifier: try capability-trait method set first; fall back to regular dispatch on provider_ty if not found. Routing handled by §10.2.0’s has_self fork.

Spec citation (§10.R-024 anchor requirement): Pre-implementation MUST trace exact sub-clause in compiler_repo/docs/ori_lang/v2026/spec/ mandating which handler shape properties must be validated. Clause 20 (Capabilities) covers with Cap = handler in expr requiring handler to implement every method of the capability trait at the conceptual level; trait-shape validation rules currently surface as typeck.md §CP-3 (target-only with...in semantics including stateful handler form with Cap = handler(state: init) { op: (s) -> (s', val), ... } in expr with errors E1204-E1207). Implementer SHALL:

  • Trace exact spec sub-clause(s) defining (a) trait method enumeration, (b) handler method matching rule, (c) signature shape equivalence (param count + types + return), (d) stateful-handler form vs static-handler form. Citable at Clause 20.N.M or Annex E §X granularity, NOT bare Clause 20.
  • If sub-clause does NOT exist at required granularity: file /add-bug subsystem spec severity medium title “spec gap: handler trait-shape validation rules under Clause 20” with concrete proposal pointer; derive validation shape from spec’s stated handler semantics; record bug ID in §10.R-024 anchor checkbox.
  • Add canonical spec-anchored rule to typeck.md §CP-3 as new CP-N (Clause 20-anchored) when spec sub-clause exists, removing the target-only marker from §CP-3.

Banned (per impl-hygiene.md §INVERTED-TDD): Marking validation “optional”, deferring as “future improvement”, “skip when handler.impl exists” gates, #[cfg(strict_caps)] flags. Validation runs on every with ... = handler in ... form.

10.2.3 Implementation

  • Write failing tests FIRST per §10.2.1 TDD matrix (positive + negative + phase-gap-regression + has_self-regression + None-handling cells per §10.R-021/§10.R-023).
  • §10.R-024 spec-anchor trace (BEFORE §10.2.2 implementation): Trace exact sub-clause(s) in compiler_repo/docs/ori_lang/v2026/spec/ defining handler trait-shape validation rules under Clause 20. Cite at Clause 20.N.M granularity. If gap exists, file /add-bug and record BUG-XX-NNN in §10.R-024.
  • §10.2.0 — Implement has_self detection via TraitMethodDef.has_self persistence per §10.R-021:
    • Add has_self: bool field to TraitMethodDef at registry/traits/mod.rs:144.
    • Populate at trait-method registration in check/registration/traits.rs via params.first().is_some_and(|p| p.name == checker.well_known().self_kw) (interned-Name SSOT via WellKnownNames; mirrors ImplMethodDef.has_self at check/registration/impls.rs:506; per types.md §TI-2 + impl-hygiene.md §Interning Discipline — string-literal comparison BANNED in non-test code).
    • At impl_lookup.rs:371-377 LookupOutcome::Found construction: replace hardcoded has_self: true with has_self: trait_method_def.has_self (no signature-shape introspection).
    • Strip // TODO(typeck): capability methods without self need has_self: false dispatch path. comment at impl_lookup.rs:373-376 (resolves §10.R-004 + §10.R-013).
  • §10.2.2 — Implement MANDATORY trait-shape validation at constructors.rs:178-201:
    • Look up capability trait’s method set via TraitRegistry::get_trait_by_name(capability)Option<&TraitEntry>.
    • None-handling per §10.R-023: On None, emit clean diagnostic naming unregistered capability at with ... = handler span. NEVER unwrap(). File built-in capability registration bug if gap surfaces in discovery step.
    • On Some(entry): iterate entry.collected_methods; for each trait method, verify handler provides matching method shape (param count, types, return).
    • On missing/mismatched: emit clean diagnostic at with ... = handler site.
  • Extend method lookup path to consult capability-trait methods before falling through to NotFound (already shipped via §10.1 bound-chain + capability-bound registration; verify integration).
  • Run unit tests — all pass.
  • Run timeout 150 cargo stf tests/spec/capabilities/propagation.ori — green (no [CAPABILITY-METHOD-DISPATCH] sites; 7 tests gated on §10.2.0 + §10.2.2 unblocked).
  • Matrix: capability × handler-shape × method:
    • Capabilities: Http, Logger, FileSystem, user-defined capability Foo { ... }.
    • Handler shapes: concrete struct with impl Http, stateful handler with Cap = handler(state: S) { op: (s, ...) -> (s', val) } in ..., default impl.
    • Methods: required methods, default methods, cross-trait method calls, missing methods (negative).
  • Verify cargo st tests/ green, debug + release parity.
  • Run timeout 150 diagnostics/dual-exec-verify.sh on §10.2-touched files — zero divergences (§10.R-022 success_criteria SC line 89).

10.2.4 Close §10.2

  • All §10.2.3 checkboxes marked [x].
  • /tpr-review on §10.2 diff → clean.
  • /impl-hygiene-review on §10.2 diff → clean.
  • /improve-tooling retrospective.
  • /sync-claude retrospective — update typeck.md §CP-2/CP-3 with capability-method-dispatch specifics.
  • Frontmatter 10.2 status: complete.

10.R Third Party Review Findings

Step 4 /tp-help blind-spot envelopes (codex + gemini + opencode, 2026-05-15). Concrete - [ ] items below carry implementation anchors; each MUST resolve before §10.N close.

  • §10.R-006 — Subsection status frontmatter drift fixed (opencode) — Pre-edit: §10.0/§10.1/§10.2 all carried status: not-started while RESUME POINTER and commits indicated otherwise. Post-edit: §10.0=complete, §10.1=in-progress, §10.2=in-progress, §10.R=in-progress; section-level status: in-progress (from in-review); prior_status: in-review added for abort recovery per .claude/rules/state-discipline.md §4. 00-overview.md:393 Quick Reference flipped from “NEW — Not Started” to “In Progress — §10.0 complete; §10.1/§10.2 production code complete, TDD matrix + close-out pending”. §10.1 status flip completed atomically with §10.R-028 cure (Round 0 TPR-10-R0-001 inline).

  • §10.R-012 — §10.N close-gate range expanded to §10.R-001..§10.R-019 (codex TPR R2) — Original §10.N checklist named §10.R-001..§10.R-006 but R1 + R2 added §10.R-007 through §10.R-019. Anchor: §10.N checklist row updated at line 475 (range now §10.R-001..§10.R-028 post-Step 4 BS additions + Round 0 TPR appended §10.R-028 for interner-SSOT discipline). RESOLVED inline by /review-plan Step 5 editor 2026-05-16 + /tpr-review Round 0 fix-and-commit + Round 5 close-gate range cure.

  • §10.R-016 — /tpr-review per-subsection-gate fidelity at §10.0.4 (gemini TPR R3, Critical)/tpr-review checkbox at section-10:196 was flipped [x] with body “Covered by §10.R aggregate close-gate” — defers but does not satisfy per-subsection-gate as authored. Per skill-control-contract.md §Caller Foreground Dispatch Contract: foreground-dispatch the skill, consume structured exit state, then flip [x]. Cure options: (a) reword §10.0.4 checkbox to “deferred to §10.R aggregate” (acknowledges intent); (b) run /tpr-review on §10.0 diff specifically and record SHA + finding count. RESOLVED inline by /tpr-review Round 2 fix-and-commit via cure option (a) — §10.0.4 lines 251-252 reworded to “deferred to §10.R aggregate close-gate (per §10.R-016 cure option (a))” for both /tpr-review and /impl-hygiene-review checkboxes.

  • §10.R-017 — Adopt subsection_depends_on: ordering primitives (gemini TPR R3, Major) — §10’s authoring carries sequencing rule in prose at section-10:150 (“§10.0 MUST complete before §10.1 or §10.2 touch their target files. §10.1 before §10.2”) without subsection_depends_on: / blocks_section_close: frontmatter primitives. Per routing.md §5 Ordering Primitives. Cure: subsection_depends_on: {"10.1": ["10.0"], "10.2": ["10.0", "10.1"]} added to section frontmatter at lines 95-97; prose statement preserved as cross-reference. RESOLVED inline by /review-plan Step 5 editor 2026-05-16.

  • §10.R-019 — Resume-pointer state drift: “7/7 green” asserts end-state as fact (codex TPR R3, High) — section-10:27 RESUME POINTER comment line asserts “propagation.ori 7/7 green” but §10.2 is status: in-progress with §10.2.0 + §10.2.2 implementation pending; the 7/7 is end-state target, not current. Per state-discipline.md §3. Cure: reword line 27 to “propagation.ori GATED on §10.2.0+§10.2.2 (target: 7/7 green at §10.2.4 close)”. RESOLVED inline by /review-plan Step 5 editor 2026-05-16 — RESUME POINTER rewritten with explicit GATED-on language.

  • §10.R-022 — Test-coverage checklist gap: dual-exec-verify missing from §10.1.3 + §10.2.3 (Step 4 gemini BS-10-D, Medium) — success_criteria SC at section-10:89 requires timeout 150 diagnostics/dual-exec-verify.sh zero divergences on §10-touched files; §10.1.3 implementation checklist (line 267 pre-edit) and §10.2.3 (line 332 pre-edit) lacked the verification step. Anchor: §10.1.3 + §10.2.3 each gain a - [ ] Run timeout 150 diagnostics/dual-exec-verify.sh on §10.{1,2}-touched files — zero divergences (§10.R-022) checkbox. RESOLVED inline by /review-plan Step 5 editor 2026-05-16.

  • §10.R-025 — Resume-order vs declared-dependency inversion (Step 4 opencode BS-10-G, Critical) — Pre-edit RESUME POINTER at section-10:33-44 ordered §10.2.0 → §10.2.2 → §10.1.1 → §10.1.3 → §10.2.3, driven by §10.R-002 has_self hardcode discovery rather than DAG. Plan prose at line 159 declared §10.1 before §10.2 (capability dispatch wires through bound-chain lookup policy §10.1 establishes). §10.R-017 recorded missing subsection_depends_on: but resume order actively inverted declared dependency. Anchor: (a) RESUME POINTER reordered to put §10.1.1 (TDD matrix) FIRST, §10.1.3 + §10.1.4 close §10.1 before §10.2 begins; (b) subsection_depends_on: {"10.1": ["10.0"], "10.2": ["10.0", "10.1"]} added to section frontmatter making DAG explicit per routing.md §5 (cure for §10.R-017). RESOLVED inline by /review-plan Step 5 editor 2026-05-16 (both halves shipped).

  • §10.R-027 — Banned-patterns list for §10 execution discipline (Step 4 gemini BS-10-F, Low) — Pre-edit §10 omitted banned-patterns list preventing STRUCTURE:autopilot-pause-leak failure modes during implementation dispatch. Anchor: “Banned Patterns” subsection added BEFORE §10.0 forbidding AskUserQuestion on ambiguous generic bounds (cure: E2023 diagnostic per typeck.md §DI-1), on TraitMethodDef.has_self classification edge cases (cure: syntactic registration-time source), and on mid-loop pacing prompts during TDD cell execution / subsection close-outs / §10.R finding resolutions. Reviewer enforcement: STRUCTURE:autopilot-pause-leak Critical blocks §10.N close-out. RESOLVED inline by /review-plan Step 5 editor 2026-05-16.

  • §10.R-010 — BLOAT cure: impl_lookup.rs (opencode TPR R2) — RESOLVED 2026-06-07: the §06.5 unknown-method emit grew the file to 670; split into siblings to 436 (under cap). Extracted resolve_impl_signatureinfer/expr/calls/impl_signature.rs (147) + the two diagnostic emitters (emit_into_not_implemented + emit_unknown_method) → infer/expr/calls/method_diagnostics.rs (113). method_call.rs 447, all under 500. 1082 ori_types lib pass, clippy clean. (Note: sibling flat modules in calls/ rather than the anchor’s impl_lookup/outcome.rs dir form — same SRP outcome, lower churn.)

  • §10.R-001 — RigidVar origin scope expansion (gemini) — §10.1.2 design keyed lookup off current_fn_sig.scheme_var_ids only, missing Tag::RigidVar from impl<T: Bound> and Tag::SelfType in trait default methods. Anchor: §10.1.2 Design ParamEnv aggregation across function + impl + trait scopes; §10.1.1 TDD matrix cells for all three origins.

  • §10.R-002 — has_self hardcode resolves §10.2 reuse contradiction (codex + opencode convergent)compiler_repo/compiler/ori_types/src/infer/expr/calls/impl_lookup.rs:371-377 hardcodes has_self: true while plan claimed §10.2 reuses the same lookup path. Anchor: SUPERSEDED at Round 0 §10.2.0 redesign by §10.R-021 (TraitMethodDef.has_self persistence — stronger syntactic source via parameter NAME at registration, replacing the prior signature-tag + first-param-is-receiver heuristic). Cure path now: implement §10.R-021 (add has_self: bool to TraitMethodDef at registry/traits/mod.rs:144; populate at check/registration/traits.rs via interned checker.well_known().self_kw per §10.R-028; consume at impl_lookup.rs:371-377 via has_self: trait_method_def.has_self); strip “task #11” comment at impl_lookup.rs:373-376 in the same commit. See §10.R-021 + §10.R-028 for full design.

  • §10.R-003 — Canon arena panic at u32::MAX promoted to bug (gemini autopilot-risk) — Inline bisection of “canon arena panic” in resume pointer creates autopilot self-halt risk per routing.md §3 case (a) (blocker on current subsection close). Anchor: /add-bug --inline filing a BUG-XX-NNN tracker entry for “canon arena panic at u32::MAX during has_self detection in §10.2”; bug-plan carries the bisection work (which spec test panics; what receiver_ty / sig shape produces u32::MAX; root cause in compiler_repo/compiler/ori_canon/src/arena.rs:108). Once filed, record the bug-pointer in this section’s frontmatter as an inline YAML comment per the plans/typeck-inference-completeness/section-11-inference-fallback.md §11.R-R1-001 cure pattern (# blocker: BUG-XX-NNN (canon arena panic at u32::MAX during §10.2.0 has_self detection) — gates §10.2.0). Gate §10.2.0 implementation on resolution by checking the comment + bug-tracker status at §10.2.0 entry. blocked_by: is NOT a PlanSectionSchema field (only FixBugSchema carries it for bug-bug chains per scripts/plan_corpus/schemas.py:361); attempting to add blocked_by: here would fail python -m scripts.plan_corpus check validation. Until filed, the bug-anchor lives at this checkbox; implementing §10.2.0 MUST file the bug FIRST per CLAUDE.md §Tests That Expose Bugs.

  • §10.R-004 — “task #11” deferral has no anchor (opencode)compiler_repo/compiler/ori_types/src/infer/expr/calls/impl_lookup.rs:376 cites “task #11” with no plan checkbox or BUG-XX-NNN. Per impl-hygiene.md §Comments C-B11 (non-spec-pointer ban) + CLAUDE.md §“Future Improvement” MUST Be Concretely Tracked. Anchor: §10.2.0 implementation strips the comment as part of has_self detection fix.

  • §10.R-005 — §10.2 trait-shape validation MANDATORY (codex + gemini convergent, Critical) — Original §10.2.2 design listed validation as “optional for §10.2 core, filed-if-not-done”. Per CLAUDE.md §The One Rule + §Correctness Above All + impl-hygiene.md §Cross-Phase Invariant Contracts (Type Checker → Eval / Codegen): typeck-passes-but-eval/codegen-crashes on non-conformant handler IS a phase-gap defect; cure is enforcement at typeck. Anchor: §10.2.2 redesigned with MANDATORY validation; §10.2.1 TDD matrix adds test_capability_method_missing_on_handler_reports_error + test_capability_method_arity_mismatch_reports_error + test_capability_method_return_type_mismatch_reports_error + test_capability_method_missing_does_not_crash_eval (phase-gap regression pin); §10.2.3 implementation step authors the validation pass at constructors.rs:99-122.

  • §10.R-007 — BLOAT cure: registry/traits/lookup.rs 513 lines (opencode, TPR R1) — File exceeds impl-hygiene.md §File Organization 500-line cap by 13 lines. Anchor: extract find_conflicting_defaults (lines 142-189) into sibling submodule compiler/ori_types/src/registry/traits/conflicts.rs; parent lookup.rs drops below 500. Resolve as part of §10.0 file-split sweep close (companion to existing §10.0 splits at mod.rs/lookup.rs/tests.rs).

  • §10.R-008 — Stretch target: registry/traits/mod.rs ≤300 lines hub (opencode + codex TPR R2) — §10.0 SC stretch goal was 300-line hub; actual final is 450 lines. Above the 500-line BLOAT cap but above stretch target. Anchor: factor coherence + specificity helpers out of mod.rs into compiler/ori_types/src/registry/traits/coherence.rs after §10.R-007 lands. Optional — passing 500-cap is the hard requirement.

  • §10.R-009 — BLOAT cure: method_call.rs 503 lines (opencode TPR R2) — File exceeds 500-line cap by 3 lines AND §10.0 stretch target was ≤400. Anchor: extract check_positional_args (private helper, single-purpose) into sibling compiler/ori_types/src/infer/expr/calls/method_call/arg_check.rs; parent drops below 500 + closer to 400 stretch.

  • §10.R-011 — Canon arena panic concrete bug filing (codex + opencode TPR R2 convergent)BUG-XX-NNN placeholders at section-10:29 + §10.R-003 body never resolved to concrete tracker entry. Anchor: foreground-dispatch /add-bug --inline for “canon arena panic at u32::MAX during §10.2.0 has_self detection” surfacing under aims-burden parallel-session adjacency; receive concrete BUG-XX-NNN; replace placeholders at section-10:29 + §10.R-003 body. Until filed, both placeholders are LEAK:placeholder-bug-id Critical findings per CLAUDE.md §“Future Improvement” MUST Be Concretely Tracked.

  • §10.R-013 — Stale plan anchor: §10.2.0 line range cite (gemini TPR R2) — §10.2.0 design body at section-10:332 cites impl_lookup.rs:371-382 for has_self detection; current hardcode lives at lines 371-377 with TODO at 373-376. Anchor: amend §10.2.0 body to cite current impl_lookup.rs:371-377 + quote current TODO text verbatim.

  • §10.R-014 — Section-10 work-order-violation (codex + gemini TPR R2 convergent, Critical) — §10 frontmatter depends_on extended at /review-plan Round 4 Step 4 (per §10.R-026 cure) to ["03", "04", "06", "09"]; current predecessor state: §03 complete + reviewed:true; §04 status: in-progress (cross-scope blocked on aims-burden-tracking §06 parallel session); §06 status: in-progress (Phase 1 §06 rewrite per 00-overview.md); §09 status: in-progress + reviewed:false (post-§09 production-code landing; TPR + close-out pending). Per impl-hygiene.md §STRUCTURE:work-order-violation (Critical, ABSOLUTE): “Consumer status: in-progress ONLY when every depends_on: predecessor satisfies status: complete AND reviewed: true”. Anchor: gate §10.N close on EVERY predecessor (§04 AND §06 AND §09) reaching status: complete + reviewed: true (§03 already satisfies); §10 may legitimately carry status:in-progress mid-pipeline per state-discipline.md §4 (TPR-exit terminal flip) but cannot reach §10.N close-gate until all four predecessors close. Pull-into-scope for §04/§06/§09 cures is BANNED in autopilot per cross-scope parallel-session adjacency (user FYI 2026-05-15); §04 + §09 cures landed/landing in parallel autopilot sessions; §06 cure tracked under §06 rewrite Phase 1 close.

  • §10.R-015 — 00-overview.md table sync at §10.N close (deferred from drift-cure agent) — Cohesion-edit at /review-plan §1.7D bounded scope: when §10.N close completes, verify 00-overview.md:393 Quick Reference reflects final §10 state. Anchor: §10.N close-gate touches 00-overview.md Quick Reference row.

  • §10.R-018 — Decision-in-implementation: §10.2.0 inline Decision block (gemini TPR R3, Critical) — section-10:285 carries “Decision (resolves §10.R-002, convergent codex + opencode): Detect has_self at the bound-chain LookupOutcome::Found construction site by examining the resolved method signature shape.” Per routing.md §6 + skill-vocabulary.md §3 rationale-prose: design decisions live in decisions/<NN>-<topic>.md OR absorbed into §10.R-002 finding body. Cure: lift to plans/typeck-inference-completeness/decisions/<NN>-has-self-detection.md OR expand §10.R-002 body; replace inline at section-10:285 with citation pointer.

  • §10.R-020 — Operator-dispatch routing gap: lookup_method vs lookup_method_checked (Step 4 codex BS-10-A, High) — §10.1 success criterion at section-10:59 claims lookup_method_checked fix covers resolve_binary_op_via_trait (operators.rs:708) and resolve_unary_op_via_trait (operators.rs:759), but those paths call lookup_method (NOT lookup_method_checked). Implementation checklist wires find_trait_method_via_bound_chain only into lookup_method_checked. Anchor: §10.1.2 Fix shape step 2 MANDATES shared bound-chain primitive across BOTH lookup entry points per impl-hygiene.md §Algorithmic DRY (cure (a) preferred: lookup_method_with_bounds primitive both call invoking find_trait_method_via_bound_chain); operator-dispatch cell in §10.1.1 TDD matrix verifies val + other where val: T, T: Add works at the lookup_method entry point. §10.1.3 implementation checkbox cites §10.R-020 cure verification.

  • §10.R-021 — has_self detection via TraitMethodDef.has_self persistence (Step 4 codex + opencode BS-10-B, High) — Prior §10.2.0 design used signature-shape heuristic (pool.tag(sig) == Tag::Function AND first param Idx == receiver_ty) which silently misclassifies associated functions whose first param coincidentally matches receiver_ty. Stronger syntactic source exists: ImplMethodDef.has_self at registry/traits/mod.rs:249 computed from parameter NAME at check/registration/impls.rs:503. TraitMethodDef at registry/traits/mod.rs:144 lacks the field. Anchor: §10.2.0 redesigned with TraitMethodDef.has_self persistence — add field; populate at trait-method registration in check/registration/traits.rs via params.first().is_some_and(|p| p.name == "self"); consume at impl_lookup.rs:371-377 LookupOutcome::Found via has_self: trait_method_def.has_self. §10.2.1 TDD matrix adds negative-pin cells test_bound_chain_associated_function_reports_has_self_false + test_has_self_misclassification_does_not_crash_eval. §10.2.3 implementation checklist mandates the persistence path.

  • §10.R-023 — Built-in capability trait registration None handling (Step 4 gemini BS-10-E, Medium) — §10.2.2 design at section-10:321 (pre-edit) mandates TraitRegistry::get_trait_by_name(capability).collected_methods chain; §10.2.1 discovery at section-10:299 (pre-edit) notes potential gap in built-in capability trait registration (Http/Logger/Env/FileSystem/Print/Clock/Random/Crypto/Cache). get_trait_by_name returns Option<&TraitEntry> (per registry/traits/lookup.rs:22); unregistered built-in causes unwrap() panic, NOT clean diagnostic. Per CLAUDE.md §The One Rule: phase-gap-defect cure is enforcement, NOT silent panic. Anchor: §10.2.2 Fix shape step 1 mandates None-handling emitting clean diagnostic at with ... = handler span; §10.2.1 TDD matrix adds test_capability_dispatch_when_trait_not_registered_reports_clean_error cell; §10.2.3 implementation checkbox cites §10.R-023.

  • §10.R-024 — Spec-anchor gap for §10.2.2 trait-shape validation surface (Step 4 opencode BS-10-H, Medium) — §10.2.2 design body at section-10:334 (pre-edit) cited bare “Clause 20 (capabilities)” — Clause 20 is entire chapter; typeck.md §CP-3 line 683 lists trait-shape validation as Target-only with no formal rule number or spec sub-clause mapping. Validation shape derived from first principles, not spec sub-clause. Anchor: §10.2.2 Spec citation block rewritten to MANDATE pre-implementation trace of exact sub-clause(s) defining (a) trait method enumeration, (b) handler method matching rule, (c) signature shape equivalence, (d) stateful-handler vs static-handler form. If sub-clause missing at required granularity, file /add-bug subsystem spec severity medium and derive from spec’s stated handler semantics. Add canonical spec-anchored rule to typeck.md §CP-3 removing target-only marker when spec sub-clause exists. §10.2.3 implementation gains pre-validation spec-anchor trace checkbox.

  • §10.R-026 — Close-gate routing drift: Boolean TPR-clean → exit_reason-to-next_action mapping (Step 4 codex BS-10-C, Medium) — Pre-edit §10.N close-gate at section-10:406 was a Boolean “/tpr-review on §10 aggregate diff returns clean across codex + gemini + opencode” — does NOT model dispatched-skill exit-state classification per skill-control-contract.md §Continuation Contract. Anchor: (a) section-10:89 success_criteria adds exit_reason-to-next_action mapping declaration (“clean closes; substantive findings append §10.R; predecessor/structural drift pivots through orchestrator; transport/tool failure logs and redispatches per canonical handler table”); (b) §10.N close-gate body cites exit_reason mapping. Also addresses §06 in depends_on (informational drift from audit cited-section-drift finding — overview makes §06 rewrite a Phase 1 predecessor for Phase 2/3/4): depends_on: ["03", "04", "06", "09"] per frontmatter edit.

  • §10.R-028 — Interner-SSOT discipline for self parameter detection (Round 0 TPR gemini TPR-10-R0-002, High) — Pre-cure §10.2.0 prose at lines 346 + 402 instructed authors to compute has_self = params.first().is_some_and(|p| p.name == "self") using string literal "self". Shipped sibling pattern at compiler_repo/compiler/ori_types/src/check/registration/impls.rs:506 uses p.name == checker.well_known().self_kw (interned-Name SSOT via WellKnownNames). String-literal comparison in non-test code is BANNED per types.md §TI-2 (interning discipline) + impl-hygiene.md §Interning Discipline (== "identifier_name" ban). RESOLVED inline by Round 0 fix-and-commit: both §10.2.0 sites rewritten to cite checker.well_known().self_kw mirroring impls.rs:506 verbatim; §10.2.0 Goal block updated to cite §10.R-028 anchor.

§10.R aggregate /tpr-review (runs at §10.N close)

  • /tpr-review on §10 aggregate diff returns clean across codex + gemini + opencode.
  • Any new findings appended below as §10.R-NNN entries with concrete anchors.

10.N Completion Checklist

  • 10.0 complete — file splits landed; registry/traits/mod.rs dropped to 450 lines (split target met, ≤500 cap satisfied); three sibling files exceed 500-line cap (lookup.rs=513, method_call.rs=503, impl_lookup.rs=522) and carry follow-up cures anchored under §10.R-007 / §10.R-009 / §10.R-010 (gated on §10.N close-gate via those [x] flips). All existing tests pass unchanged. Commit a20bc41b1.
  • 10.1 complete — bound-chain dispatch on Tag::RigidVar; cyclic + depth guards; traits.ori 30/30 green; operator dispatch overlap verified; §10.R-001 RigidVar origin scope expansion shipped; §10.1.1 TDD matrix authored; §10.1.3 unit tests pass.
  • 10.2 complete — capability-method dispatch; §10.R-002 has_self fork shipped; §10.R-005 MANDATORY trait-shape validation shipped; §10.R-003 canon arena panic bug closed; §10.R-004 “task #11” comment stripped; propagation.ori 7/7 green.
  • §10.R all findings resolved — §10.R-001 through §10.R-028 each [x] (range expanded per §10.R-020..§10.R-027 added at /review-plan Round 4 Step 4 blind-spots; §10.R-028 appended at /tpr-review Round 0 fix-and-commit for interner-SSOT discipline per TPR-10-R0-002). Atomic discipline: §10.N close-gate range cite MUST be updated whenever new §10.R-NNN entries land.
  • §10 aggregate /tpr-review on full §10 diff → clean (codex + gemini + opencode). Exit-reason mapping per §10.R-026: clean exit closes §10.N; substantive findings append §10.R-NNN entries with concrete anchors; predecessor/structural drift pivots through orchestrator per routing.md §6; transport/tool failure logs disposition + redispatches per skill-control-contract.md §Caller Foreground Dispatch Contract.
  • §10 aggregate /impl-hygiene-review → clean.
  • /improve-tooling section-close sweep — cyclic-guard pattern generalization; ParamEnv builder canonicalization.
  • /sync-claude section-close doc synctypeck.md §TR-4 (bound-chain walk specifics + ParamEnv) + typeck.md §CP-2/CP-3 (MANDATORY trait-shape validation no longer target-only) updates.
  • Plan sync — §10 frontmatter status: complete + reviewed: true; 00-overview.md Quick Reference updates; index.md section 10 status updated.

Exit criteria: All 3 subsections complete with TPR + hygiene clean; all §10.R findings resolved with concrete anchors; §10-touched test files green (traits.ori, propagation.ori); dual-exec parity preserved. §11 may begin.

HISTORY

  • 2026-06-07 (later) — §10.R-010 impl_lookup.rs BLOAT split (litter-pickup owned by the §06.5 edit): the §06.5 emit_unknown_method addition grew impl_lookup.rs 522→670 (well over the 500 cap), making the split a §Scope-Expansion litter-pickup. Extracted two responsibilities into calls/ siblings: impl_signature.rs (147, resolve_impl_signature + impl-binder substitution / arity check) + method_diagnostics.rs (113, the into-not-implemented + general method-not-found emitters). impl_lookup.rs → 436, method_call.rs 447 — all under cap. Mechanical split, zero semantic change; 1082 ori_types lib pass, clippy clean. §10.R-007 (lookup.rs 513) untouched this iteration (not in the edited set). compiler_repo changes remain uncommitted pending the parallel-session ori_arc build settling (full spec-suite + dual-exec verification blocked).

  • 2026-06-07 (later) — §06.5 unified unknown-method diagnostic IMPLEMENTED; exposed + fixed §09.2 def-impl latent bug: Implemented the SSOT cure at emit_unknown_method (impl_lookup.rs) wired into both method_call.rs NotFound sites — closes the silent-poison class across receiver kinds: concrete (BUG-02-044 {str:int}.map(...) now emits E2001) + rigid (§10.1 @f<T>(x)=x.hello() now emits). Named-vs-anonymous Tag::Var distinction (VarState::Unbound{name}) separates an unbounded generic param (error) from an inference var (defer); placeholder tags (SelfType/BoundVar/Projection/Infer/Error) defer. The cure EXPOSED a real §09.2 latent bug: def-impl self.method() dispatch never truly resolved (relied on the silent poison) — the def-impl Self RigidVar had no trait bound registered. Fixed by binding def_impl.trait_name on self_rigid in check_def_impl_method (def_impls.rs) so self.m() resolves via the §10.1 bound-chain. 1082 ori_types lib pass (was 1079 + 3 new §06.5 pins), clippy clean. Remaining: follow-on E2005 cascade suppression (the real diagnostic now fires alongside the lambda-param E2005s); §10.R-020 operator-dispatch path (operators.rs lookup_method — separate, also silently accepts unbounded). Full spec-suite + dual-exec cross-scope-blocked by parallel ori_arc build break; compiler_repo changes uncommitted pending that.

  • 2026-06-07 — §10.1.1 TDD matrix authored + §10.1-negative-case root cause UNIFIED with BUG-02-044/§06.5: After the orchestrator route-past fix (8e6ed1f5) unblocked the picker to §10, authored the §10.1.1 bound-chain TDD matrix as 7 Rust cells in registry/traits/tests.rs (test_bound_chain_*: single/multi-bound Found, no-match/empty NotFound, ambiguous, supertrait-inherited, duplicate-bound dedup) — all green; 1079 ori_types lib pass; clippy clean; traits.ori 30/30. Verified the shipped bound-chain POSITIVE path works end-to-end (x.hello() with T: Greet, a + b with T: Add compile clean). DISCOVERED the §10.1 negative-case soundness gap: unbounded-rigid @f<T>(x) = x.hello() + @f<T>(a,b) = a + b silently ACCEPT (must be E2003). Root cause traced + UNIFIED: emit_into_not_implemented (impl_lookup.rs:575) is into-only; non-into unknown methods on ANY receiver (concrete per BUG-02-044, rigid per §10.1) push no diagnostic → Idx::ERROR silent poison. SSOT cure = §06.5 general unknown-method diagnostic (one site, all receiver kinds, E2005 suppression, Var-defer). §10.1-negative is gated on §06.5; §10.1-positive + §10.1.1 matrix complete. compiler_repo test additions uncommitted (cross-scope parallel-session ori_llvm tree; commit consolidates when that lands or via user-typed /commit-push —bypass).

  • 2026-05-17 — /review-plan SIGNIFICANT REWORK APPLIED + /tpr-review 5-round-cap close on §10: /continue-roadmap plans/typeck-inference-completeness --autopilot routed past recurring §04 anchored-elsewhere terminus to §10 via explicit section-arg dispatch. Orchestrator auto-dispatched /review-plan section-10 --autopilot --called-by-orchestrator for reviewed: false flip. Workflow arc: Step 1 precheck clean → Step 1.7 integrity audit clean → Step 2/3 audit (5 findings, 0 halt-gating) → Step 4 /tp-help blind-spots (3-of-3 reviewers, 8 blind spots BS-10-A..H) → Step 5 editor (8 new §10.R-020..§10.R-027 finding entries with inline cures: DAG-conformant RESUME POINTER rewrite, subsection_depends_on + blocks_section_close ordering primitives, §10.2.0 redesign around TraitMethodDef.has_self persistence, §10.2.2 hardened with mandatory None-handling + spec-anchor trace, banned-patterns subsection, dual-exec-verify wiring, depends_on extension to [03, 04, 06, 09], close-gate exit_reason-to-next_action mapping) → Step 6 /tpr-review —skill review-plan —autonomous 5-round cap exit_reason cap_reached_max_rounds (Round 0: 4 actionable cured incl. §10.R-028 interner-SSOT discipline; Round 1: 3 cured + 5 META; Round 2: 3 cured + 3 META + 3 dropped; Round 3: 4 cured; Round 4: 2 cured + 3 META + 3 dropped; Round 5: 3 cured + 8 META re-verifications + 2 dropped; total: 19 actionable cures + 11 META re-verifications confirming §10.R catalog comprehensive + 8 Tier-3 confabulations dropped) → Step 7 verify clean → Step 8 status report → Step 9 verdict SIGNIFICANT REWORK APPLIED. Atomic flip executed via flip_from_in_review_to_in_progress: status: in-review → in-progress; third_party_review.status: cap_reached_with_substantive; reviewed: false → true per Step 9 verdict reviewed_flag_action=flip-to-true. Remaining work owned by 16 OPEN §10.R-NNN items (§10.R-001..§10.R-028 range) anchored to subsection cures; §10 close-gate (§10.N) gates on §04+§06+§09 reaching status: complete + reviewed: true per §10.R-014 + §10.R-026 depends_on extension. Next session: §10.2.0 has_self detection implementation per §10.R-021 (TraitMethodDef.has_self persistence + impl_lookup.rs:371-377 consumption + “task #11” strip + §10.R-028 interner-SSOT discipline at checker.well_known().self_kw); blocks 7 spec tests in capabilities/propagation.ori. Cross-scope blockers unchanged: §04.S.4 + §10.R-014 still gate on aims-burden §06 burden-lowering parallel-session work. /commit-push skipped per ongoing cross-scope dirty tree (autopilot dirty-tree-skip cure landed 1778976564-b3f85e3b); plan-file edits persisted to disk; user-typed /commit-push --bypass in a future session consolidates all parallel work.