From e094a71a3e07f07d95f78e63ac1c4174c56bdd97 Mon Sep 17 00:00:00 2001 From: Brummel Date: Thu, 28 May 2026 19:22:13 +0200 Subject: [PATCH] =?UTF-8?q?ratify:=20design=20model=20=E2=80=94=20replace?= =?UTF-8?q?=20`unit`=20literal=20with=20canonical=20no-op=20idiom=20(refs?= =?UTF-8?q?=20F9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fieldtest F9 surfaced that `design/models/0007-kernel-extensions.md` lines 80 + 89 use `unit` as a value literal of type Unit. The checker has no such literal — it treats the token as a Term::Var lookup and emits `[unbound-var] main: unknown identifier: unit`. An LLM author copy-pasting the worked example from the whitepaper hits a hard wall the second they `ail check` it. Two coherent resolutions: (a) ratify `unit` as the canonical Unit-value literal (a one-line resolver change + a contract update naming the literal), or (b) tighten the model to use the existing canonical idiom. Picking (b) because: - There is no existing language contract pinning `unit` as a literal — the model was speaking aspirationally. - The shipped surface already has a canonical no-op shape (`(do io/print_str "")`); promoting that to the model is cheaper than promoting a new keyword. - The kernel-extension-mechanics milestone is closed — adding a surface literal here would be unmotivated scope creep. Both sites are if/match arms that produce Unit (i.e. they are no-ops on the data side, used for control-flow exhaustiveness). The replacement `(do io/print_str "")` produces Unit and is already known-good per the kem_4_paramin_box_red.ail fieldtest fixture. Future Series-milestone work may reach for a proper unit-value literal; if it does, the brainstorm gate will weigh adding it then. --- design/models/0007-kernel-extensions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/design/models/0007-kernel-extensions.md b/design/models/0007-kernel-extensions.md index 54db9e6..b1e51b9 100644 --- a/design/models/0007-kernel-extensions.md +++ b/design/models/0007-kernel-extensions.md @@ -77,7 +77,7 @@ moving average over a stream of float values, window size 3": (app print (app / (app sum_window_step s n 0 0.0) (app int_to_float n))) - unit))) + (do io/print_str "")))) (fn run_stream (type (fn-type @@ -86,7 +86,7 @@ moving average over a stream of float values, window size 3": (params s n input) (body (match input - (case (pat-ctor FNil) unit) + (case (pat-ctor FNil) (do io/print_str "")) (case (pat-ctor FCons v rest) (let s_new (app Series.push s v) (seq (app emit_if_full s_new n)