Commit Graph

162 Commits

Author SHA1 Message Date
Brummel e21f264b93 design-md-consolidation 3.4 nit: drop task-ref doc-comment prefix + align def-kind list with lowercase tags 2026-05-10 12:57:11 +02:00
Brummel 934a6e18e6 design-md-consolidation 3.4 fixup: align DESIGN.md ClassDef/InstanceDef JSON tags with ast.rs lowercase serde rename 2026-05-10 12:53:36 +02:00
Brummel 4651fed5b7 design-md-consolidation 3.4: add design_schema_drift.rs — exhaustive-match drift test for ast.rs vs DESIGN.md §Data-model 2026-05-10 12:51:39 +02:00
Brummel e5d1c1e33b design-md-consolidation 3.3: ast.rs doc-comment names DESIGN.md §Data-model as canonical schema, drift test as enforcement 2026-05-10 12:48:21 +02:00
Brummel dafdf17f72 iter 22-tidy.7: extract duplicate_clause_err helper, retire 17 inline blocks 2026-05-10 05:14:53 +02:00
Brummel 51011511b4 iter 22-tidy.6.2: write_fn_def renders forall class constraints 2026-05-10 04:58:01 +02:00
Brummel 788c9808dd iter 22-tidy.6.1 fixup: cover abstract-method + instance-override branches; doc + fallback comments 2026-05-10 04:54:22 +02:00
Brummel d1c992d49a iter 22-tidy.6.1: write_class_def + write_instance_def — full Form-B projection 2026-05-10 04:47:50 +02:00
Brummel 4cb69f85f7 iter 22-tidy.5.3: parse_data rejects duplicate doc clause 2026-05-10 04:35:49 +02:00
Brummel 9097b88625 iter 22-tidy.5.2: drop transient iter-tags from parse_fn duplicate-clause tests 2026-05-10 04:33:59 +02:00
Brummel 3fd17827bf iter 22-tidy.5.2: parse_const rejects duplicate doc/type/body clauses 2026-05-10 04:31:08 +02:00
Brummel 9592478971 iter 22-tidy.5.1: parse_fn rejects duplicate doc/type/params/body clauses 2026-05-10 04:27:19 +02:00
Brummel 557bf57cdb iter 22-tidy.4: mono::primitive_surface_name delegates to ailang-core 2026-05-10 04:18:46 +02:00
Brummel 5fd95e4e9f iter 22-tidy.4: route 4 matches! sites through is_primitive_name 2026-05-10 04:15:47 +02:00
Brummel 9523a1cd63 iter 22-tidy.4: pin lockstep invariant + tighten module doc 2026-05-10 04:13:41 +02:00
Brummel bbfadb2d72 iter 22-tidy.4: ailang-core::primitives — single home for the primitive-name set 2026-05-10 04:11:29 +02:00
Brummel c3fd1c08a3 iter env-unify.audit: tidy stale Env docs, pin-test docstring; queue types/ctor_index shape 2026-05-10 02:36:27 +02:00
Brummel d7e333fdf7 iter env-unify.2: drop redundant overlay comments 2026-05-10 02:28:54 +02:00
Brummel 2ab9d77113 iter env-unify.2: check_in_workspace consumes build_check_env 2026-05-10 02:26:24 +02:00
Brummel 92b94afa2a iter env-unify.1: rustdoc fixup (re-anchor check_in_workspace doc, drop transient task tag) 2026-05-10 02:19:24 +02:00
Brummel d6870d7a62 iter env-unify.1: extract build_check_env, mono uses it 2026-05-10 02:16:21 +02:00
Brummel cd08f53315 test: fix env-pin globals assertion (builtins seed operators workspace-flat) 2026-05-10 02:14:38 +02:00
Brummel 42a7ed7673 test: clean red signal for env-construction pin (inline module_types) 2026-05-10 02:06:46 +02:00
Brummel d7706dc3ed test: red for env-construction drift-shape pin 2026-05-10 02:03:09 +02:00
Brummel a9c685ded8 fix: mono pass seeds env.imports for qualified cross-module refs in class workspace 2026-05-10 01:23:07 +02:00
Brummel 2bf827f600 test: red for mono-pass unknown module prefix on qualified xmod reference in class workspace 2026-05-10 01:19:45 +02:00
Brummel 13b36ccb0f fix: mono pass seeds env.globals for recursive top-level fn in class workspace 2026-05-10 01:10:31 +02:00
Brummel 3b0bcf3f65 test: red for mono-pass unknown identifier on recursive fn in class workspace 2026-05-10 01:06:18 +02:00
Brummel c8fc33fb86 iter 22-tidy.3: prose-lib — drop 22b.4 reference from class/instance placeholder 2026-05-09 22:52:17 +02:00
Brummel 5c5180fc48 fix: mono pass seeds env.types and env.ctor_index for user ADTs 2026-05-09 22:43:54 +02:00
Brummel 59e86b3805 test: red for monomorphise_workspace unknown type on user ADT 2026-05-09 22:41:18 +02:00
Brummel 9584d1dada iter 22b.4a.5: retire round-trip skip-list for class/instance fixtures 2026-05-09 22:25:32 +02:00
Brummel 2a2e6b9817 iter 22b.4a.4.5: form-a printer+parser arms for Type::Forall constraints 2026-05-09 22:23:10 +02:00
Brummel 9784fe95fe iter 22b.4a.4: form-a printer arm for InstanceDef 2026-05-09 22:14:59 +02:00
Brummel 0456393b85 iter 22b.4a.3.fix: drop unused InstanceMethod import + indent stub + dedup test imports 2026-05-09 22:13:23 +02:00
Brummel dd9614cae9 iter 22b.4a.3: form-a printer arm for ClassDef 2026-05-09 22:10:35 +02:00
Brummel da1746229d iter 22b.4a.2: form-a parser arm for InstanceDef 2026-05-09 22:05:49 +02:00
Brummel a1b4cd0063 iter 22b.4a.1.fix: drop test comments narrating plan deviations 2026-05-09 22:03:27 +02:00
Brummel fefaa03c76 iter 22b.4a.1: form-a parser arm for ClassDef 2026-05-09 21:59:29 +02:00
Brummel 090f082215 iter 22b.3.tester: e2e for coherence, default-keyword, cross-module mono
Adds three end-to-end tests for the 22b.3 mono pass, each with a
matching one-property fixture under examples/. Defends mono-pass
invariants 3, 4, and 6 from docs/specs/2026-05-09-22-typeclasses.md
at the binary level (stdout-asserting, not AST-asserting):

- coherence_two_instances_pick_correct_body_at_runtime — class R
  with instances at Int and Bool, both reachable from one main.
  Stdout `11\n22` proves both mono fns are synthesised AND each
  call site picks the matching body (no collapse).

- class_default_method_runs_and_prints_default_value — empty
  instance body + class-level `default` clause must lower, link,
  and print the default value (`99`). Promotes the existing
  synthesise_mono_fn unit test to a binary-level guarantee.

- cross_module_class_method_runs_and_prints_correct_value —
  class+instance in module A, called from module B's main. The
  qualified-name rewrite + cross-module synth-def placement was
  AST-tested in 22b.3.6; this pins down the emit-and-link path.

All 18 typeclass_22b3 tests pass; full workspace green; 3 bench
gates 0/0/0.
2026-05-09 21:36:15 +02:00
Brummel b59820b737 iter 22b.3.7: synthetic fixture — class+instance compiles, runs, prints 5 2026-05-09 21:28:41 +02:00
Brummel 7f260b82ad iter 22b.3.6: fix — quality-review (shadow-aware walker, cross-mod test, Option-typed targets, const helper) 2026-05-09 21:21:33 +02:00
Brummel d1b590ceab iter 22b.3.6: call-site rewrite — same/cross module qualified names 2026-05-09 21:07:58 +02:00
Brummel e8018d48b6 iter 22b.3.5: fix — quality-review (chained-call test, hoist class_index, drop noise comments) 2026-05-09 20:59:43 +02:00
Brummel dd87b36e00 iter 22b.3.5: workspace fixpoint loop — dedup + synth-append 2026-05-09 20:52:07 +02:00
Brummel d2954010ea iter 22b.3.4: fix — quality-review (zero-arg test, drop what-comments + param-name pin) 2026-05-09 20:45:56 +02:00
Brummel d6084a71fb iter 22b.3.4: synthesise_mono_fn — instance body + class default fallback 2026-05-09 20:41:45 +02:00
Brummel 9f86c072dc iter 22b.3.3: fix — revert dead pub(crate), reuse build_module_types, drop defensive unwrap
Quality-review follow-up to 89311ee:

- Revert `substitute_rigids` to private. Task 3 does not call it; the
  visibility bump was forward-looking for Task 4 (synthesise_mono_fn).
  Task 4 will re-bump it in the same diff that uses it.
- Promote `build_module_types` to pub(crate); drop the inline
  reimplementation in `mono::build_workspace_env`. Removes drift risk
  between the two paths.
- Replace defensive `unwrap_or_default()` on `build_module_globals`
  with `expect(...)` naming the pre-condition. Silent default violated
  CLAUDE.md "no defensive validation in internal code paths".
- Add a one-line drift-risk reminder at the top of `build_workspace_env`
  flagging that it and `check_in_workspace` both populate `Env`.

Build clean; all 5 typeclass_22b3 tests green; no workspace regressions.
2026-05-09 20:36:52 +02:00
Brummel 89311ee20b iter 22b.3.3: collect_mono_targets — synth-replay residual gathering 2026-05-09 20:31:12 +02:00
Brummel c77fd1b85e iter 22b.3.2: fix — drop speculative Float (plan-text overreach)
Float is referenced nowhere else in the codebase; the plan-text
listed it aspirationally. Restored parity with the four other
primitive enumerations across the crate. When Float lands as a
real type (post-22b.4 Prelude work, if at all), the arm gets
re-added in the same iter that introduces Type::float().

Deferred (not part of this fix):
- Shared-constant extraction across the four primitive enumeration
  sites (linearity.rs:143, lib.rs:1232/2214, mono.rs) — workspace-
  level cleanup belonging to the milestone-22 audit phase.
- pub mod mono vs sibling pub use lift::lift_letrecs style — plan
  prescribed pub mod for 22b.3 because Tasks 3-7 add multiple pub
  items reached by integration tests; per-item pub use would
  proliferate.
2026-05-09 20:25:51 +02:00