8698d897b6
Boss-dispatched fieldtest at milestone close. Agent authored 4 .ail fixtures (factorial smoke + Show user-ADT + user-class Describe with two instances + two-module workspace) from DESIGN.md + form_a.md only (no compiler-source reads, no spec-of-milestone reads). All four fixtures `ail check` ok and `ail run` produces expected stdout. Findings (1 bug, 1 friction, 2 spec_gaps, 3 working): - [bug] instance-method-body unbound-var bypasses `ail check` — forma_3 first attempt called `str_concat` inside the instance method body; `ail check` returned ok, `ail build` died with the monomorphise_workspace "unknown identifier" diagnostic. Same shape at fn-body level correctly fires `[unbound-var]` at check time. Next: debug skill, RED-first against `ail check`. - [friction] no `str_concat` primitive. Every realistic Show MyType body wants string concatenation; the absence forced the agent to shape examples around bare int_to_str / ctor-arity-1 patterns. Next: small planner tidy iter wiring `str_concat` symmetric to `str_clone` and `int_to_str`. - [spec_gap] form_a.md has zero references to class, instance, constraint, or method productions — pre-22 surface only. The form-a-default-authoring milestone made .ail the authoring form, but the form_a spec doc remains pre-typeclass. - [spec_gap] form_a.md leaves the class-qualifier ambiguity in `(instance (class X))` unspecified — bare-class-name vs canonical- form rule from mq.1 is not documented at the surface level. The agent picked the bare-name reading from the corpus; the canonical- form reading is equally plausible from the schema. Boss-side cleanup at commit time: - Deleted 8 stale .ail.json sidecars in examples/fieldtest/ (4 forma_* derived by the fieldtester per old dual-form workflow + 4 pre-existing floats_* from the prior fieldtest milestone that iter form-a.1 T8 missed because the bash deletion loop globbed only examples/*.ail.json direct children). - Updated skills/fieldtest/agents/ailang-fieldtester.md to remove the now-obsolete "generate canonical JSON sidecar" step (Phase 3 rewritten + Iron Law + Reading list + Common Rationalisations + Red Flags all aligned to the post-form-a single-form doctrine). cargo test --workspace: 557 passed, 0 failed, 3 ignored (unchanged from audit-form-a — the fieldtest fixtures are standalone, not referenced by any test). Findings deferred to follow-up iters; the milestone close itself is still clean.
59 lines
1.4 KiB
Plaintext
59 lines
1.4 KiB
Plaintext
(module forma_3_user_class_describe
|
|
|
|
(class Describe
|
|
(doc "A user-defined typeclass: produce a short Str describing a value.")
|
|
(param a)
|
|
(method describe
|
|
(type (fn-type (params (borrow a)) (ret (con Str))))))
|
|
|
|
(data Shape
|
|
(ctor Circle (con Int))
|
|
(ctor Square (con Int)))
|
|
|
|
(instance
|
|
(class Describe)
|
|
(type (con Int))
|
|
(method describe
|
|
(body
|
|
(lam
|
|
(params (typed n (con Int)))
|
|
(ret (con Str))
|
|
(body (app int_to_str n))))))
|
|
|
|
(instance
|
|
(class Describe)
|
|
(type (con Shape))
|
|
(method describe
|
|
(body
|
|
(lam
|
|
(params (typed s (con Shape)))
|
|
(ret (con Str))
|
|
(body
|
|
(match s
|
|
(case (pat-ctor Circle r)
|
|
(app int_to_str r))
|
|
(case (pat-ctor Square w)
|
|
(app int_to_str w))))))))
|
|
|
|
(fn announce
|
|
(doc "Polymorphic announcer: describe a value then print the result.")
|
|
(type
|
|
(forall (vars a)
|
|
(constraints (constraint Describe a))
|
|
(fn-type
|
|
(params (borrow a))
|
|
(ret (con Unit))
|
|
(effects IO))))
|
|
(params x)
|
|
(body (do io/print_str (app describe x))))
|
|
|
|
(fn main
|
|
(type (fn-type (params) (ret (con Unit)) (effects IO)))
|
|
(params)
|
|
(body
|
|
(seq
|
|
(seq
|
|
(app announce 42)
|
|
(app announce (term-ctor Shape Circle 3)))
|
|
(app announce (term-ctor Shape Square 5))))))
|