Commit Graph

60 Commits

Author SHA1 Message Date
Brummel 90075715d9 plan: mq.3 — MethodNameCollision retirement + multi-class E2E + DESIGN.md sync, 9 tasks
Three out-of-band corrections precede the retirement (from mq.2
known debt):

- T1: Env.active_declared_constraints field populated by check_fn
  pre-synth — enables resolve_method_dispatch's constraint-driven
  filter at synth time for rigid-var fallback.
- T2: class_methods re-keyed to (QualifiedClassName, MethodName)
  tuple — post-retirement multiple classes can declare same-named
  methods. Mono's presence-check switches to
  method_to_candidate_classes (method-keyed natively).
- T3: synth(...) signature extended with warnings: &mut Vec<Diagnostic>
  out-parameter; resolution ladder reordered so fn wins precedence
  matches spec §Class-fn collisions; class-method-shadowed-by-fn
  warning fires when both branches would have matched.

Retirement (T4-T5):
- Delete MethodNameCollision variant + Origin enum + pre-pass +
  Display arm.
- Relocate the two pin tests to crates/ailang-check/tests/method_collision_pin.rs
  (cross-crate needed for Env.method_to_candidate_classes access);
  invert assertions to "loads clean + candidates populated".

E2E (T6) — three new positive fixtures:
- mq3_two_show_ambiguous: two Show classes both with Show Int →
  AmbiguousMethodResolution.
- mq3_two_show_qualified: same workspace + explicit qualifier →
  clean resolve.
- mq3_class_eq_vs_fn_eq: class MyEq + fn myeq → fn wins + shadow warning.

Docs (T7-T8):
- DESIGN.md: strike MethodNameCollision; reword AmbiguousInstance
  paragraph (per-class coherence stays; cross-class ambiguity is new);
  new §Method dispatch subsection anchors the 5-step rule.
- Roadmap: P2 entry → [x]; milestone 24 depends-on cleared.

WhatsNew is milestone-close (after audit), NOT mq.3.

Boss decisions on recon's 6 open questions:
- class_methods shape: tuple key (a).
- Warning channel: synth out-parameter (a).
- declared_constraints: post-superclass-expansion on Env.
- Pin test location: relocate to ailang-check tests.
- AmbiguousInstance paragraph: reword, don't delete.
- Operator-=/< corner: out of scope (prelude ne/lt are free fns).
2026-05-13 01:51:39 +02:00
Brummel e9e45c77af plan: mq.2 — Type-driven dispatch mechanism, 9 tasks
Installs the dispatch infrastructure without retiring
MethodNameCollision yet:

- 2 new CheckError variants (AmbiguousMethodResolution, UnknownClass)
- NoInstance gains optional candidate_classes field
- ResidualConstraint gains optional candidates: BTreeSet<String>
- Env gains workspace-flat method_to_candidate_classes index
- New resolve_method_dispatch helper implementing the 5-step rule
- Synth Var-arm rewritten to route through the helper
- Constraint-discharge refines multi-candidate residuals
  (concrete-type path → registry filter; rigid-var path →
  declared-constraint filter)
- Mono's residual-to-target mapping mirrors the discharge refinement

End-to-end multi-class fixtures still gated by MethodNameCollision
(iter mq.3); new path exercised in this iter only by 6 unit-test
cases on resolve_method_dispatch + 3 each on refine and mono
resolver.

Boss decisions on recon open questions: residual extension via
Option<BTreeSet<String>> field; index lives workspace-flat on Env;
NoInstance.candidate_classes wired through to_diagnostic this iter;
qualify_class_ref_in_check consolidation deferred per mq.1
known-debt.
2026-05-13 01:22:27 +02:00
Brummel 1a5f8289b7 plan: mq.1 — Canonical-form extension for class-ref fields, 7 tasks
Iter mq.1 plan: move InstanceDef.class / Constraint.class /
SuperclassRef.class from bare-only to canonical form per ct.1's
existing rule, extend validate_canonical_type_names with three new
field walks, narrow check_class_name_fields to ClassDef.name-only,
qualify build_registry's class_def_module + class_by_name + entries
+ four lookup sites, qualify ClassMethodEntry.class_name +
class_superclasses, update affected test-assertion strings.

Pre-flight recon flagged that the spec's '14 fixtures migrated' cost
claim is over-stated: all existing fixture class refs are intra-module
under the canonical-form rule. Plan does not add migration work that
does not need doing; Task 7 Step 3 verifies zero existing-fixture
diff.
2026-05-13 00:40:30 +02:00
Brummel 8bfa09adc7 plan: 24.1 — bool_to_str + str_clone runtime + codegen wiring, 6 tasks
Six tasks: (1) runtime C functions in runtime/str.c, (2) builtin
install lockstep across builtins.rs + synth.rs + list() row + 2
unit tests, (3) codegen IR wiring (2 declares + 2 lower_app arms +
is_static_callee whitelist), (4) 2 IR-shape unit pins, (5) regen
5 IR snapshots, (6) 4 fixtures + 5 E2E tests + acceptance gate.

Mechanical mirror of hs.4's int_to_str/float_to_str pattern. Plan
captures every Edit verbatim (old_string + new_string) per planner
Iron Law. Pre-existing drift fix included inline: int_to_str row
missing from builtins.rs::list() since hs.4 — adding it adjacent
to the two new rows. Three open questions from plan-recon resolved
by Boss judgement (C uses bool from <stdbool.h>; tests live in
crates/ail/tests/e2e.rs as the existing real path; int_to_str
list() row drift fixed inline).
2026-05-12 23:33:46 +02:00
Brummel 0e556f085c plan: ctt.3 — KindMismatch retire, 2 tasks 2026-05-12 22:27:33 +02:00
Brummel 548ebf8d51 plan: ctt.2 — Registry.type_def_module re-key, 3 tasks 2026-05-12 22:16:22 +02:00
Brummel 0a36294e61 plan: ctt.1 — env-overlay shape ratification, 3 tasks 2026-05-12 22:02:58 +02:00
Brummel b5b0c2d7dc plan: eob.1 — Effect-op arguments borrow, 7 tasks
Single iter closes the milestone: language rule at three check-time
sites (uniqueness.rs + linearity.rs + linearity.rs doc-comment),
four lockstep ret_mode-Own edits (builtins.rs + synth.rs for
int_to_str and float_to_str), one Str carve-out in
drop_symbol_for_binder's App arm, RED→GREEN verification of the
two existing pinning tests, two new positive tests (Int-arg
primitive non-leak, repeated Str-arg borrow), DESIGN.md anchor
under Decision 10 covering BOTH arg-position rules (Ctor=Consume,
Do=Borrow), WhatsNew entry, roadmap close of the heap-Str ABI P1
milestone.

Plan-recon DONE: lint-side-effect surface (over-strict-mode on
(own T) params used solely via effect-ops) is empty for the
current corpus, so no follow-up sweep iter needed. IR-snapshot
regen confirmed no-op. Two inline IR-shape tests at
codegen/src/lib.rs:4127-4205 stay green (ret_mode flip does not
change their emitted-call assertions).
2026-05-12 21:20:11 +02:00
Brummel 1f832c028a plan: hs.4 — IR + checker + linker wiring, 4 tasks
Wires the hs.3 runtime symbols (ailang_int_to_str, ailang_float_to_str)
into live AILang builtins. Four layers, one iter: checker install +
synth.rs lockstep partner; IR-header declares + Emitter::lower_app
arms (float arm replaces CodegenError::Internal, new int arm); rc.c
hoisted to unconditional link (weak attr on str.c's extern becomes
permanent no-op, retained intentionally); two new IR-shape pins + four
new E2E (two stdout-smoke, two RC-stats discipline) + drop.rs comment
refresh. Spec line refs were stale (hs.1+hs.2+hs.3 commits shifted
them); plan anchors to recon-verified positions lib.rs:1890-1903 and
:486-535. Edge cases (0, -1, i64::MAX, ±Inf, NaN) deferred to
follow-up tidy iter if regression sweep does not surface need.
2026-05-12 18:10:25 +02:00
Brummel 187d04814d plan: hs.3 — heap-Str runtime additions, 2 tasks
Pure runtime/str.c addition: str_alloc helper + ailang_int_to_str +
ailang_float_to_str. No codegen, checker, or build-pipeline changes
in this iter — the IR-side wiring (declare lines, lowering, checker
install, rc.c always-linked) all batch into hs.4. Acceptance gate:
runtime continues to build and link with the new symbols present but
unreferenced (clang -O2 dead-strips them until hs.4 wires a caller).
Two tasks: (1) append three functions + includes + extern decl to
str.c, verify via clang -c + nm; (2) full workspace + cross_lang +
compile_check + check sweep stays green.
2026-05-12 17:56:03 +02:00
Brummel 51a096cf83 plan: hs.2 — rewrite for static-Str sentinel-slot retrofit, 3 tasks
Supersedes the defunct hs.2 plan at 8ca602d (runtime-sentinel +
Str-in-ADT drop safety). After the spec amendment at 2a72a4a dropped
the sentinel-rc-header story, the iter scope is now a surgical retrofit
of hs.1's emission: drop the leading i64 sentinel slot from static-Str
globals, land the IR-Str pointer on the (now first) len-field via
GEP (i32 0, i32 0). The four +8 consumer GEPs are invariant across the
switch. Three tasks: (1) update the two IR-shape tests to the new
layout (RED); (2) flip three format-string sites + two doc-comments
in lib.rs (GREEN); (3) regenerate hello.ll snapshot + workspace +
cross_lang + compile_check + check.
2026-05-12 17:45:23 +02:00
Brummel 8ca602dc1f plan: hs.2 — runtime sentinel + Str-in-ADT drop safety, 3 tasks
Second iter of the heap-Str ABI milestone. Adds the UINT64_MAX sentinel-header short-circuit to ailang_rc_inc / ailang_rc_dec so the hs.1 packed-struct globals (whose first slot is i64 -1) flow safely through generic RC paths. Tasks: (1) author rc_str_field_in_adt_static.ail.json + confirm builds; (2) TDD cycle for the safety test + runtime guards; (3) full regression sweep.
2026-05-12 16:53:36 +02:00
Brummel 69bb5f9952 plan: hs.1 — Static-Str layout migration, 5 tasks
First iter of the heap-Str ABI milestone (docs/specs/2026-05-12-heap-str-abi.md). Carrier reversed by Boss judgement: original carrier said runtime+checker first, but the spec's no-intermediate-state clause forbids installing int_to_str without its codegen arm, and the runtime/str.c additions can't be tested in isolation. Layout migration is the natural prerequisite that everything else builds on.

Tasks: (1) intern_str_literal table + function + emission loop + Literal::Str callsite switch; (2-4) +8 GEPs at io/print_str, eq__Str, compare__Str callsites; (5) snapshot regen + cross_lang.py regression check. Acceptance: every existing program byte-identical.
2026-05-12 16:36:29 +02:00
Brummel efecbaa3e6 plan: ext-cli.1 — CLI accepts .ail extension, 4 tasks
Boss-direct plan (no parent spec — this is a P2-roadmap-todo, not a
milestone iter). Option 1 picked from the roadmap fork: auto-parse
.ail internally so `ail check foo.ail` works the same as
`ail check foo.ail.json` (modulo the surface-parse step). Option 2
(hint-only) was a workaround that would have forced LLM-authors to
prepend `ail parse` before every check/build/run.

Architecture: extension dispatch lives in ailang-surface (which
already depends on core); core gains a `load_workspace_with` injection
point so the dispatch reaches transitive imports; surface parse
errors get a new WorkspaceLoadError::SurfaceParse variant so
`workspace_error_to_diagnostic` can route them in --json mode.

Tasks:
  1. core::load_workspace_with + WorkspaceLoadError::SurfaceParse
     + .ail-first import resolution
  2. surface::load_module + surface::load_workspace
  3. crates/ail/src/main.rs rewire (~17 callsites) + 2 e2e tests
  4. workspace_error_to_diagnostic SurfaceParse arm + DESIGN.md
     §Decision-6 CLI addendum + ct1_check_cli diagnostic test
2026-05-12 14:28:28 +02:00
Brummel 5858377c99 plan: ms.2 — multi-subject run + DESIGN.md addendum extension, 6 tasks (Qwen re-run + CodeLlama run + per-cell metrics + addendum + roadmap close + acceptance sweep) 2026-05-12 13:28:55 +02:00
Brummel 2efaee07f0 plan: ms.1 — pipeline anyhow-chain preservation, 3 tasks (RED→GREEN pin + 2-char fix + full harness sweep) 2026-05-12 13:28:31 +02:00
Brummel 21c2d2cfaa plan: cma.2 — harness binary + 4 task definitions + 3 integration tests, 13 tasks, 46 steps
Walks the implementer from a fresh harness/ Cargo project to a green
test sweep across strip_locations (5 unit + 5 integration on real
captured stderr), verify_references (4 reference solutions run
through the live ail+clang pipeline locally), mock_full_run (eight
canned-cohort-task pairs end-to-end), and budget_abort (tiny budget
exhaustion). Six modules: strip_locations, pipeline, ionos
(reqwest blocking + retry per spec §Error handling), mock, scoring,
tasks. Captures five real stderr samples (recon-collected) as
fixtures; strip_locations regex calibrated to the actual diagnostic
shape (handles `at byte N`, anyhow `Caused by:` chains).

Workspace-table and .gitignore included in Task 1 from the outset
(learned from cma.1 surfaced concerns; not repeated as
post-hoc journal items). Out-of-workspace pattern matches render/
verbatim. AIL_BIN env var with PATH fallback for `ail` resolution;
clang preflight check added since `ail build` shells to clang.

Two explicit deferrals to implementer named in the plan:
ParamMode names (lifted from cma.1) and prelude function symbols
(from crates/ailang-check/src/builtins.rs); both stable from cma.1
authoring, no re-derivation needed.
2026-05-12 11:52:42 +02:00
Brummel fd6efdbcf6 plan: cma.1 — master mini-spec + render binary + tests, 9 tasks, 49 steps
Walks the implementer from a fresh directory to a green test sweep
(splitter_unit, spec_completeness, example_roundtrip, token_balance)
plus two checked-in rendered/*.md files. Visitor borrowed verbatim
from schema_coverage; master/examples authored fresh as a curated 13-
fixture set (one per AST variant cluster); master/spec.md authored in
13 sections with form-only blocks balanced by the ±5% gate.

Open authoring deferrals to the implementer (named at the planner
level, intentional): exact ParamMode enum names and the canonical
prelude function names — both retrieved from current source by
reading ailang-core/src/ast.rs and the prelude module at authoring
time, rather than pinned in the plan against a possibly-stale recall.
2026-05-12 11:31:19 +02:00
Brummel a99a39b65e plan: boss — three-section move + symlink + README row + repoints + journal 2026-05-12 10:09:45 +02:00
Brummel 10ccd1406c plan: rt.1 — three new tests (ailx pair cross-check dynamic + schema_coverage + CLI roundtrip via BLAKE3) 2026-05-12 09:24:50 +02:00
Brummel 35c6eb5736 plan: iter 23.5 prelude free fns + E2E — 8 tasks 2026-05-12 00:16:23 +02:00
Brummel fab1685336 plan: iter 23.4 mono-pass unification — 11 tasks, no per-task commits
Plan for the corrected iter 23.4: restructure mono.rs into a single
specialiser for every Type::Forall-quantified Def::Fn (class methods
+ polymorphic free fns) in one fixpoint pass, and remove the codegen-
time specialiser (lower_polymorphic_call + module_polymorphic_fns +
mono_queue) entirely.

11 tasks, 4-step TDD template per task (write-failing-test →
verify-fail → write-impl → verify-pass), no per-task commit step
under the new disc.1 discipline.

Parent spec: docs/specs/2026-05-11-23-eq-ord-prelude.md (re-grounded
2026-05-11 against main HEAD 51da9fa, PASS, 10 load-bearing
assumptions verified).

Open commitments resolved:
- N-ary mono-symbol naming: spec default <name>__<t1>__<t2>__...
- Target-collector: extension of existing collect_mono_targets
  (lockstep with collect_residuals_ordered)
- Original poly Def::Fn retention: kept parallel to Def::Class/
  Def::Instance

Float-NoInstance diagnostic wording remains deferred to iter 23.5.
2026-05-11 23:14:23 +02:00
Brummel c3e8044361 plan: iter 23.4-prep — checker prerequisites for prelude free fns 2026-05-11 22:01:52 +02:00
Brummel 4bbcb947a3 plan: drop 23.4 — design assumption broke at branch verification
The 23.4 mono-unification plan (ea0285b) assumed prep1 + prep2 +
prep3 were on main. They never were — they sit only on iter/23.4.
Spec component table was factually wrong. Plan Task 10 (revert prep
commits) was impossible on main. Discarding the plan; the spec is
next revised against the actual main state.
2026-05-11 22:01:31 +02:00
Brummel ea0285b85f plan: 23.4 — mono-pass unification + prep2/prep3 rollback
Eleven tasks plus final regression smoke. Tasks 1-6 build the
unified mono pass incrementally (MonoTarget shape, N-ary naming,
free-fn synth, target collection, call-site rewrite, fixpoint
dispatch). Task 7 verifies poly_id/poly_apply/poly_rec_capture
regress green. Task 8 pins mono-symbol hashes. Task 9 removes
codegen-time lower_polymorphic_call + module_polymorphic_fns +
mono_queue. Task 10 reverts prep2 (a06159d) + prep3 (c42a0f5).
Task 11 amends DESIGN.md §Resolution-and-monomorphisation to
cover all Type::Forall Defs.

Implementer open commitments deferred per spec: MonoTarget shape
(enum vs Option), collector mechanism (synth-residual extension
vs separate walker), polymorphic Def::Fn retention post-mono,
subst.rs dead-code handling. Plan calls each out with a default
and NEEDS_CONTEXT permission for alternatives.
2026-05-11 21:42:14 +02:00
Brummel 606a2ebe6d plan: gc.1 — grounding-check agent + brainstorm Step 7.5 wiring 2026-05-11 19:42:39 +02:00
Brummel 7505af04a1 iter cadence.4-fix: address quality-review importants + German-loanword sweep (English-only in-tree) 2026-05-11 14:07:44 +02:00
Brummel 34238388a1 spec+plan: audit/fieldtest/docwriter cadence restructure 2026-05-11 13:52:41 +02:00
Brummel 14ac4ae7c3 plan: pr.1 plan-recon subagent 2026-05-11 12:27:04 +02:00
Brummel 1891030253 plan: orchestrator-refactor (or.1) — 7 tasks toward Boss-context offload + per-iter journals + branch isolation 2026-05-11 11:12:14 +02:00
Brummel 4845f913b6 plan: ct.4 milestone close 2026-05-11 09:46:11 +02:00
Brummel d4927b2297 plan: ct.3 codegen + mono cleanup 2026-05-11 09:29:21 +02:00
Brummel e9aae3e9fb plan: ct.2 typechecker cleanup 2026-05-11 08:55:48 +02:00
Brummel 7ee4300ae2 plan: ct.1 canonical type names — validator + migration 2026-05-11 00:53:07 +02:00
Brummel 2c974e3c7e plan: 23.3 Ord class + primitive instances (compare__Int/Bool/Str) 2026-05-10 22:57:54 +02:00
Brummel c6c3c21013 plan: 23.2 Eq class + primitive instances (eq__Int/Bool/Str) 2026-05-10 21:47:49 +02:00
Brummel 9cf616a593 plan: 23.1 — Ordering ADT + prelude skeleton + auto-load 2026-05-10 21:10:27 +02:00
Brummel 1f5689a952 plan: architect-iron-law extension — sweep script + lockstep-checklist 2026-05-10 20:00:40 +02:00
Brummel fd287c9740 plan: floats iter 5 — prose + DESIGN.md + milestone close 2026-05-10 16:33:35 +02:00
Brummel 0c514e034b plan: floats iter 4 — codegen + runtime (Float lowering paths + E2E fixture) 2026-05-10 15:51:20 +02:00
Brummel 00a1c5f0e7 plan: floats iter 3 — typecheck + builtins (widen + install + Pattern::Lit::Float reject) 2026-05-10 15:20:09 +02:00
Brummel 6664af4995 plan: floats iter 2 — surface lex + parse + print (round-trip property) 2026-05-10 14:57:34 +02:00
Brummel cdc9d64169 plan: floats iter 1 — schema layer (Literal::Float + canonical hex serde + primitive registration) 2026-05-10 14:26:17 +02:00
Brummel 9185014022 plan: design-md-consolidation 4 (workflow / cross-reference cleanup — final sweep) 2026-05-10 13:03:01 +02:00
Brummel 500aafb307 plan: design-md-consolidation 3 (schema SoT inversion + data-model hardening + drift test) 2026-05-10 12:42:35 +02:00
Brummel c352de8117 plan: design-md-consolidation 2 (REVERTED + migration + correction-history + future speculations) 2026-05-10 12:22:30 +02:00
Brummel b2a0b05215 plan: design-md-consolidation 1 (history anchors) 2026-05-10 11:38:12 +02:00
Brummel bf8ac31d63 plan: 22-tidy.7 strict-clause helper consolidation 2026-05-10 05:11:24 +02:00
Brummel e7af79183d plan: 22-tidy.6 Form-B prose printer arms for ClassDef + InstanceDef 2026-05-10 04:43:38 +02:00
Brummel 2506180023 plan: 22-tidy.5 strict duplicate-clause detection 2026-05-10 04:25:11 +02:00