Files
AILang/docs
Brummel 8508182f84 plan: raw-buf.3 type-scoped polymorphic intrinsic mechanism (refs #7)
Two tasks. Task 1 threads a TypeDef scope through the free-fn mono path:
a scope: Option<String> field on FreeFnCall + MonoTarget::FreeFn,
populated Some(prefix) only on the type-scoped T.f resolution branch
(lib.rs:3535, gated on type_home.is_some()), None everywhere else;
consumed at the two mono-symbol mint sites via a scoped_base helper
(both read the same MonoTarget → lockstep) and folded into
mono_target_key. Result: StubT.peek @ Int mints StubT_peek__Int, not
the colliding bare peek__Int; existing bare-resolved symbols unchanged
(669-gate is the no-regression backstop).

Task 2 adds the StubT.peek ratifier op to the stub source, extends the
bijection collector to expand a polymorphic type-scoped intrinsic over
its TypeDef's param-in set (building the same T_f__<elem> strings via
mono_symbol_n on Type::Con elems, so collector and mint agree
byte-for-byte), registers StubT_peek__Int/Float entries + emit fns,
updates kernel_stub_module_round_trips, and adds a mono-symbol
integration test (borrow-param calls, no Term::New, no codegen).

plan-recon resolved the make-or-break unknown favourably: the TypeDef
scope is discarded at lib.rs:3535 but fully available there (prefix +
type_home live) — a clean thread-through, not a resolution
re-architecture. Three orchestrator design calls folded in: peek's emit
is a plausible signature-correct stub, unit-ratified only (never
instantiated in .3, no Term::New to build a StubT; RawBuf's emits in .4
are the E2E-verified ones; peek retires in .5); the exact
llvm_type(borrow StubT Int) string is an implementer verify-first step
(eq__Unit precedent); scope-trigger is the call path (not signature,
which would perturb bare-called fns like length), scope-value is the
prefix, collector infers from signature — they agree by construction
for single-TypeDef kernel modules, bijection + 669-gate backstop.

peek Form-A verified to parse+check this session under a probe module
(ok, 32 symbols / 3 modules). Final gate 670 (669 + 1 new mono test);
.ll snapshots stay green (peek polymorphic → no instantiation without a
call site).
2026-05-29 19:25:04 +02:00
..