ratify: design model — replace unit literal with canonical no-op idiom (refs F9)
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user