; Fieldtest kem.3 (Axis 3, kernel-tier modules + auto-import) — a ; consumer that references `kernel_stub`'s TypeDef without an ; `(import kernel_stub)` declaration. Per spec § "Iteration prep.3": ; ; - The module's top-level defs are accessible bare in every other ; module of the workspace, with no `(import ...)` declaration ; required. ; - The module's types are accessible bare in type position. ; ; Outcome: `ail check` fails with ; ; [unknown-module] unwrap_int: unknown module prefix ; `kernel_stub` in qualified reference ; ; The workspace pre-pass rewrites bare `StubT` to qualified ; `kernel_stub.StubT` (correct per prep.1's `qualify_workspace_term`); ; but the resolver does not accept `kernel_stub` as a valid module ; prefix because the consumer has no explicit `(import kernel_stub)`. ; That is, the qualification pre-pass and the auto-import scope are ; not cooperating — the auto-import does NOT add the kernel module ; to the resolver's known-prefixes set. ; ; Workarounds attempted: ; ; - Adding `(import kernel_stub)`: fails earlier with ; [module-not-found] expected at /kernel_stub.ail.json ; — the kernel stub has no on-disk file, it is built into the ; compiler binary. ; - Bare `StubT` everywhere: same outcome as above (the pre-pass ; qualifies it before the resolver sees it). ; ; Prelude's bare fns (`print`, `lt`, etc.) DO work — prelude_free_fns ; ratifies that. So the bug is specifically about TypeDefs in type ; position for kernel-tier modules other than prelude. The shipped ; kernel_stub TypeDef appears unreachable from any consumer in ; practice. (module kem_3_stub_consumer (fn unwrap_int (doc "Project the Int back out of a StubT. Bare `StubT` in the type slot exercises the kernel-tier auto-import — and currently fails to resolve.") (type (fn-type (params (con StubT (con Int))) (ret (con Int)))) (params s) (body (match s (case (pat-ctor Stub x) x)))) (fn main (type (fn-type (params) (ret (con Unit)) (effects IO))) (params) (body (let s (term-ctor StubT Stub 7) (seq (app print (app unwrap_int s)) (do io/print_str "\n"))))))