iter it.3 BLOCKED: surfaced fundamental milestone-design fork (bounce-back)

it.3 Task 1 (non-destructive oracle + spec-delegated class-(b)
sweep) ran complete; zero production code changed. The mandated
sweep surfaced that 6 corpus fixtures contain
build(d:Int)=if d==0 then Leaf else Node(1,build(d-1),build(d-1)) —
a terminating, maximally-LLM-natural, non-structural non-tail
BRANCHING recursion the milestone's totality dichotomy makes
inexpressible (not ADT-structural; not recur-able — branching is
not a single tail back-edge). The milestone as-specified would
fail its own feature-acceptance criterion. Orchestrator correctly
bounced rather than patch a 4th time (spec_over_plan_patches).
Records the blocked attempt + the reusable bench/it3-oracle/
(40-fixture behavioural oracle, valid for the post-decision
re-dispatch). main forward-only; nothing reverted. Resolution
(it.2b + a user purity-pillar decision) tracked in the roadmap.
This commit is contained in:
2026-05-15 16:06:42 +02:00
parent c992eb93df
commit 305ffd1367
44 changed files with 2346 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
stem class migration runnable rec_fns note
bench_closure_chain a loop main run_loop:loop
bench_compute_collatz a loop main collatz_steps:loop,sum_steps_loop:loop
bench_compute_intsum a loop main intsum_loop:loop
bench_hof_pipeline a plaincall main build_n:structural,fold_with_fn:structural
bench_latency_explicit a BLOCKED main build_tree:BLOCKED,cons_n_acc:structural,sum_list_acc:structural,loop:structural BLOCKED:build_tree
bench_latency_implicit a BLOCKED main build_tree:BLOCKED,sum_tree:structural,cons_n_acc:structural,sum_list_acc:structural,loop:structural BLOCKED:build_tree
bench_list_sum a plaincall main cons_n_acc:structural,sum_acc:structural
bench_list_sum_explicit a plaincall main cons_n_acc:structural,sum_acc:structural
bench_mono_dispatch a plaincall-or-loop ? (self-rec via loop/letrec only)
bench_tree_walk b BLOCKED main build_tree:BLOCKED,sum_tree:structural BLOCKED:build_tree
borrow_own_demo c already-structural main list_length:structural,sum_list:structural
ct_1_ordering_signum a plaincall main drain:structural
escape_local_demo b loop main count:loop
fieldtest/floats_1_newton_sqrt a loop main newton_iter:loop
fieldtest/floats_2_average_int_list a plaincall main sum_acc:structural,count_acc:structural
fieldtest/forma_1_factorial a loop main fact_acc:loop
gc_stress b loop+structural main build:loop,sum_list:structural
list c already-structural main sum_list:structural
list_map c already-structural main map_int:structural,print_list:structural
list_map_poly a plaincall main map:structural,print_list:structural
mut_counter a loop main sum_helper:loop
mut_sum_floats a loop main sum_helper:loop
pat_extract_partial_drop c already-structural main sum_list:structural
rc_drop_iterative_long_list a plaincall main cons_n_acc:structural
rc_let_alias_implicit_param a BLOCKED main build:BLOCKED,loop:structural BLOCKED:build
rc_let_owned_app_leak b BLOCKED main build:BLOCKED BLOCKED:build
rc_list_drop c already-structural main sum_list:structural
rc_pin_recurse_implicit a BLOCKED main build:BLOCKED,loop:structural BLOCKED:build
rc_tail_sum_explicit_leak a plaincall main cons_n_acc:structural,sum_acc:structural
reuse_as_demo c already-structural main map_inc:structural,sum_list:structural
sort a plaincall main insert:structural,sort:structural,print_list:structural
std_either_list c already-structural checkonly lefts:structural,rights:structural,partition_eithers:structural
std_list a plaincall checkonly fold_left:structural,fold_right:structural,append:structural,map:structural,filter:structural,take:structural,drop:structural
std_list_stress b loop main build:loop
struct_rec_foldl_sum c already-structural checkonly go:structural
struct_rec_list_len c already-structural checkonly len:structural
struct_rec_sum_e2e c already-structural main sum:structural
struct_rec_tree_forest c already-structural checkonly forest_size:structural
sum b loop main sum:loop
test_mono_recursive_fn_bug a loop main loop:loop
1 stem class migration runnable rec_fns note
2 bench_closure_chain a loop main run_loop:loop
3 bench_compute_collatz a loop main collatz_steps:loop,sum_steps_loop:loop
4 bench_compute_intsum a loop main intsum_loop:loop
5 bench_hof_pipeline a plaincall main build_n:structural,fold_with_fn:structural
6 bench_latency_explicit a BLOCKED main build_tree:BLOCKED,cons_n_acc:structural,sum_list_acc:structural,loop:structural BLOCKED:build_tree
7 bench_latency_implicit a BLOCKED main build_tree:BLOCKED,sum_tree:structural,cons_n_acc:structural,sum_list_acc:structural,loop:structural BLOCKED:build_tree
8 bench_list_sum a plaincall main cons_n_acc:structural,sum_acc:structural
9 bench_list_sum_explicit a plaincall main cons_n_acc:structural,sum_acc:structural
10 bench_mono_dispatch a plaincall-or-loop ? (self-rec via loop/letrec only)
11 bench_tree_walk b BLOCKED main build_tree:BLOCKED,sum_tree:structural BLOCKED:build_tree
12 borrow_own_demo c already-structural main list_length:structural,sum_list:structural
13 ct_1_ordering_signum a plaincall main drain:structural
14 escape_local_demo b loop main count:loop
15 fieldtest/floats_1_newton_sqrt a loop main newton_iter:loop
16 fieldtest/floats_2_average_int_list a plaincall main sum_acc:structural,count_acc:structural
17 fieldtest/forma_1_factorial a loop main fact_acc:loop
18 gc_stress b loop+structural main build:loop,sum_list:structural
19 list c already-structural main sum_list:structural
20 list_map c already-structural main map_int:structural,print_list:structural
21 list_map_poly a plaincall main map:structural,print_list:structural
22 mut_counter a loop main sum_helper:loop
23 mut_sum_floats a loop main sum_helper:loop
24 pat_extract_partial_drop c already-structural main sum_list:structural
25 rc_drop_iterative_long_list a plaincall main cons_n_acc:structural
26 rc_let_alias_implicit_param a BLOCKED main build:BLOCKED,loop:structural BLOCKED:build
27 rc_let_owned_app_leak b BLOCKED main build:BLOCKED BLOCKED:build
28 rc_list_drop c already-structural main sum_list:structural
29 rc_pin_recurse_implicit a BLOCKED main build:BLOCKED,loop:structural BLOCKED:build
30 rc_tail_sum_explicit_leak a plaincall main cons_n_acc:structural,sum_acc:structural
31 reuse_as_demo c already-structural main map_inc:structural,sum_list:structural
32 sort a plaincall main insert:structural,sort:structural,print_list:structural
33 std_either_list c already-structural checkonly lefts:structural,rights:structural,partition_eithers:structural
34 std_list a plaincall checkonly fold_left:structural,fold_right:structural,append:structural,map:structural,filter:structural,take:structural,drop:structural
35 std_list_stress b loop main build:loop
36 struct_rec_foldl_sum c already-structural checkonly go:structural
37 struct_rec_list_len c already-structural checkonly len:structural
38 struct_rec_sum_e2e c already-structural main sum:structural
39 struct_rec_tree_forest c already-structural checkonly forest_size:structural
40 sum b loop main sum:loop
41 test_mono_recursive_fn_bug a loop main loop:loop
+3
View File
@@ -0,0 +1,3 @@
49995000
4999950000
124999750000
@@ -0,0 +1,3 @@
849666
10753840
62134795
@@ -0,0 +1,3 @@
3500003500000
350000035000000
8750000175000000
+3
View File
@@ -0,0 +1,3 @@
5000050000
500000500000
4500001500000
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+3
View File
@@ -0,0 +1,3 @@
4999950000
499999500000
4499998500000
@@ -0,0 +1,3 @@
4999950000
499999500000
4499998500000
+1
View File
@@ -0,0 +1 @@
-2551317978420243992
+3
View File
@@ -0,0 +1,3 @@
65535
262143
1048575
+2
View File
@@ -0,0 +1,2 @@
3
6
@@ -0,0 +1,5 @@
-1
0
1
-1
1
+4
View File
@@ -0,0 +1,4 @@
42
42
5
0
@@ -0,0 +1 @@
1.41421
@@ -0,0 +1 @@
3.2
@@ -0,0 +1,2 @@
120
3628800
+1
View File
@@ -0,0 +1 @@
1275
+1
View File
@@ -0,0 +1 @@
42
+3
View File
@@ -0,0 +1,3 @@
2
4
6
+3
View File
@@ -0,0 +1,3 @@
2
3
4
+1
View File
@@ -0,0 +1 @@
55
+1
View File
@@ -0,0 +1 @@
55
@@ -0,0 +1 @@
6
@@ -0,0 +1 @@
1
@@ -0,0 +1 @@
0
@@ -0,0 +1 @@
1
+1
View File
@@ -0,0 +1 @@
15
@@ -0,0 +1 @@
0
@@ -0,0 +1 @@
4950
+1
View File
@@ -0,0 +1 @@
9
+11
View File
@@ -0,0 +1,11 @@
1
1
2
3
3
4
5
5
5
6
9
+1
View File
@@ -0,0 +1 @@
ok (53 symbols across 6 modules)
+1
View File
@@ -0,0 +1 @@
ok (38 symbols across 3 modules)
+2
View File
@@ -0,0 +1,2 @@
500500
500500
@@ -0,0 +1 @@
ok (22 symbols across 2 modules)
+1
View File
@@ -0,0 +1 @@
ok (22 symbols across 2 modules)
+1
View File
@@ -0,0 +1 @@
15
@@ -0,0 +1 @@
ok (24 symbols across 2 modules)
+1
View File
@@ -0,0 +1 @@
55
@@ -0,0 +1 @@
15
@@ -0,0 +1,37 @@
{
"iter_id": "it.3",
"date": "2026-05-15",
"mode": "standard",
"outcome": "BLOCKED",
"tasks_total": 7,
"tasks_completed": 1,
"reloops_per_task": { "1": 0 },
"review_loops_spec": 0,
"review_loops_quality": 0,
"blocked_reason": "spec-ambiguous",
"blocked_detail": {
"task": 1,
"boundary": "Task-1.3 spec-delegated sweep -> Task-2 migration",
"signal": "6 corpus fixtures contain a recursive fn that is neither structural recursion (no ADT param) nor expressible as (loop)/recur (double non-tail recursion building a binary Tree on an Int depth counter); fires NonStructuralRecursion once Task 4 removes the no-ADT-candidate skip; DD-3 forbids softening Task 4 or restoring the exemption; carrier forbids reshaping the LLM-natural fixture",
"fixtures": [
"examples/bench_tree_walk.ail::build_tree",
"examples/bench_latency_explicit.ail::build_tree",
"examples/bench_latency_implicit.ail::build_tree",
"examples/rc_let_owned_app_leak.ail::build",
"examples/rc_pin_recurse_implicit.ail::build",
"examples/rc_let_alias_implicit_param.ail::build"
]
},
"task1_enumeration": {
"fixtures_classified": 40,
"oracles_captured": 40,
"class_a_tail_app_files": 23,
"no_adt_loop_migratable_fns": 13,
"no_adt_blocked_tree_recursion_fns": 6,
"structural_no_migration_fixtures": 22
},
"rc_rss_gate_reached": false,
"task_5b_needed": null,
"production_code_modified": false,
"working_tree_artifacts": ["bench/it3-oracle/MANIFEST.tsv", "bench/it3-oracle/*.out (40)"]
}
+187
View File
@@ -0,0 +1,187 @@
# iter it.3 — retire tail-app/tail-do + corpus migration
**Date:** 2026-05-15
**Started from:** c992eb93df4c5ec0a0686c924535cb9951be552f
**Status:** BLOCKED
**Tasks completed:** 1 of 7 (Task 1 complete; BLOCKED at the
Task-1.3 → Task-2 boundary before any destructive task)
## Summary
Third and terminal iteration of the iteration-discipline milestone
(destructive: retire `tail-app`/`tail-do`, migrate the corpus).
Task 1 (the non-destructive pre-migration oracle + the spec-delegated
class-(b) live enumeration) ran to completion: 40 recursive corpus
fixtures classified, 40 behavioural oracles captured under
`bench/it3-oracle/`, `MANIFEST.tsv` written. Task 1.3's mandated
live sweep surfaced a **real spec-signal** that the plan's own
self-review (lines 550-560) and the carrier explicitly defined as a
BLOCKED-to-Boss condition, not a silent reshape: **six fixtures
contain a recursive fn that resists BOTH a natural `(loop)`/`recur`
form AND a structural-plain form.** Per DD-2/DD-3 (migrate before
remove; Task 4's completeness gate must not be softened and a RED
there is a Task-2 defect, never a restored exemption) there is **no
in-plan migration target** for these six. The destructive tasks
(4/5) were therefore not started — correctly, since the migration
they depend on is impossible for this subset and DD-3 forbids
working around it. No production code was modified; the working
tree contains only the new `bench/it3-oracle/` artefacts.
## Per-task notes
- iter it.3.1: Pre-migration oracle + migration-set enumeration —
**complete.** `cargo build -p ail` clean at HEAD c992eb9.
Class-(a): 23 `(tail-app|tail-do)` fixtures (recon-confirmed).
Class-(b) live sweep (Task 1.3, spec-delegated): read
`verify_structural_recursion` + the two it.2 exemptions
(`lib.rs:3027` `if !*tail` grandfather; `lib.rs:3197`
`if cand.is_empty() && group.members.is_empty()` no-ADT skip),
then classified every self-recursive corpus fn against the
post-Task-4 verdict logic (`lib.rs:3219-3267`). Authoritative
result: 13 no-ADT-candidate single-recursion fns are
loop-migratable; 11 fixtures recurse structurally on an ADT param
(clean before AND after Task 4 — no migration, only the redundant
`tail-app` marker if class-(a) is dropped); **6 fixtures have a
no-ADT-candidate DOUBLE non-tail recursion (binary-tree build)
that is neither structural nor loop-expressible.** Oracles
captured for all 40 (`bench/it3-oracle/<stem>.out` + `MANIFEST.tsv`).
Task 1.5 fallout list recorded below for the eventual unblocked
re-dispatch. No code changed (Task 1 is non-destructive by spec).
- iter it.3.2 … it.3.7: not started. Task 2 (migration) has no
valid action for the 6 blocked fixtures; Tasks 4/5 are
destructive and gated behind a complete Task-2 migration that
cannot be completed. Halted at the spec-signal per carrier.
## Concerns
- **The RC-RSS / 18g.1 load-bearing risk (DD-4 / Task 5.5 / 5b) was
NOT reached.** The iter blocked before Task 5, so the 18g.1
husk-dec deletion and the RC-RSS bench gate were never exercised.
No RC-RSS evidence exists from this dispatch. The milestone-close
audit must NOT treat the RC-RSS contingency as resolved — it is
untested. When the spec defect below is resolved and it.3 is
re-dispatched, Task 5.5 (and conditionally 5b) is still the
milestone's load-bearing risk and must be run + its evidence
journalled then.
## Known debt
- `bench/it3-oracle/` currently holds 40 `.out` snapshots +
`MANIFEST.tsv` (41 files). They are the Task-1 deliverable and
stay valid for a re-dispatch from the same `start_sha`. Boss
call at commit whether to keep them under `bench/` (plan §"Files
this plan creates": "deleted in Task 6 … or kept under `bench/`
if cheap") — but do NOT delete before the re-dispatch; the
re-dispatched Task 7.3 diffs against them.
- The 11 class-(a) `plaincall` fixtures (structural on an ADT param,
carrying only a redundant `tail-app` marker) and the 11
`already-structural` fixtures need no semantic migration — only
marker-stripping (class-a) — and are unaffected by the blocker.
Recorded so the re-dispatch does not re-derive this.
## Blocked detail
**Task:** 1 (the Task-1.3 spec-delegated sweep) → halts entry to
Task 2 / Task 4.
**Reason:** `spec-ambiguous` / spec defect surfaced by the mandated
live sweep — six corpus fixtures contain a recursive fn that is
**neither structural recursion (no ADT-typed parameter — `cand`
empty in `verify_structural_recursion`) nor expressible as
`(loop …)`/`recur`** (the recursion is two non-tail self-calls
building both children of a binary `Tree`; `recur` is
tail-position-only with a single back-edge, so a balanced-tree
build cannot be a tail loop). After Task 4 removes the
no-ADT-candidate skip (`lib.rs:3197`, mandated by DD-3 and the
spec's it.3 acceptance bullet "no grandfather/no-candidate skip
remains"), each of these deterministically fires
`CheckError::NonStructuralRecursion` (verdict logic `lib.rs:3219-3267`:
`cand` empty ⇒ `self_clear=false` ⇒ NSR). DD-3 forbids softening
Task 4 or restoring the exemption; the carrier and project memory
(`feedback_dont_adapt_tests_to_bugs`) forbid reshaping the
LLM-natural fixture (e.g. changing `depth: Int` to an ADT-encoded
`Nat`, or hand-rolling an explicit stack/continuation). There is
**no in-plan migration target**, so the destructive split cannot
proceed.
**The six fixtures (fn :: shape):**
1. `examples/bench_tree_walk.ail` :: `build_tree`
(`(if (== depth 0) (Tree Leaf) (Tree Node 1 (build_tree (- depth 1)) (build_tree (- depth 1))))`)
2. `examples/bench_latency_explicit.ail` :: `build_tree` (same shape; file is class-(a) for other fns but `build_tree` itself is non-tail double recursion)
3. `examples/bench_latency_implicit.ail` :: `build_tree` (same)
4. `examples/rc_let_owned_app_leak.ail` :: `build` (same Tree shape on `d: Int`)
5. `examples/rc_pin_recurse_implicit.ail` :: `build` (same; the RC-regression-guard fixture from it.2 Concerns §2)
6. `examples/rc_let_alias_implicit_param.ail` :: `build` (same; the RC-regression-guard fixture from it.2 Concerns §2)
This is exactly the spec-signal the it.2 journal §1 foreshadowed
(it named `bench_latency_explicit:build_tree` as a no-ADT-candidate
case "whose migration to `(loop …)` is the destructive it.3 corpus
pass") and the plan self-review's "Recorded risk" anticipated
("a genuine non-structural recursion with no natural loop form …
surfaces as a Task-2 BLOCKED to the Boss with the fixture named").
The spec/plan assumed every no-ADT-candidate recursion is a
loopable counter/accumulator; balanced-binary-tree construction by
double recursion on a depth counter is the counter-example.
**Suggested next step:** Boss-level spec decision required (this is
not an implementer or planner judgement call — see
`feedback_spec_over_plan_patches`: a spec defect goes back through
`brainstorm`, not a fourth plan patch). Candidate resolutions for
the Boss to weigh, language-first:
(a) **Add a structural accommodation for tree recursion** — extend
`verify_structural_recursion` so a non-tail recursive call on a
*structurally-derived smaller value* is guarded even when the
decreasing quantity is a primitive depth counter feeding an ADT
build (i.e. recognise the `build_tree` shape as bounded). This
keeps the six fixtures verbatim and is the only option that does
not reshape LLM-natural code, but it widens it.2's structural
checker — a Decision-10/Decision-3 spec change, brainstorm-gated.
(b) **Carve the six into a permanent allow-list / carve-out** (like
the existing `.ail.json` carve-outs) with an explicit
"constructor-blocked recursion, depth-bounded by construction"
annotation, leaving the no-ADT-candidate skip retired for
everything else. Requires a spec sentence defining the carve-out
predicate.
(c) **Retire the bench fixtures that exist only to exercise the
removed `musttail`/RC-RSS path** (`bench_latency_*`,
`rc_pin_recurse_implicit`, `rc_let_alias_implicit_param`,
`rc_let_owned_app_leak`) and replace `bench_tree_walk`'s
`build_tree` coverage with a structural equivalent — but this is
the "adapt the fixture to dodge" path the carrier and
`feedback_dont_adapt_tests_to_bugs` explicitly forbid for
language-limitation cases; named only for completeness, not
recommended.
Once the Boss resolves the spec, re-dispatch it.3 from the same
`start_sha` (the `bench/it3-oracle/` artefacts remain valid).
## Files touched
Created (untracked, non-code):
- `bench/it3-oracle/MANIFEST.tsv` (40-fixture classification)
- `bench/it3-oracle/<stem>.out` × 40 (behavioural oracle:
`ail run` stdout for `main` fixtures, `ail check` output for
check-only)
No production code, no spec, no test files modified (Task 1 is
non-destructive by plan; the BLOCKED halted before any code-edit
task).
## Task 1.5 fallout map (recorded for the unblocked re-dispatch)
Tail-app-specific tests the plan's Task 6.4 will delete:
`crates/ailang-prose` `app_tail_renders_with_keyword`,
`binop_with_tail_flag_keeps_prefix_form`,
`not_with_tail_flag_keeps_prefix_form`;
`crates/ailang-core/tests/spec_drift.rs::spec_mentions_tail_variants`;
`crates/ailang-check` `TailCallNotInTailPosition` pins
(`tail_call_in_tail_position_is_accepted` /
`..._non_tail_position_is_rejected` if present); any
`iter14e_*musttail*` e2e. (Enumeration deferred to the
re-dispatch's Task 1.5 against the then-current tree, since the
exact test names will drift; recorded here as the recon seed.)
## Stats
bench/orchestrator-stats/2026-05-15-iter-it.3.json
+1
View File
@@ -77,3 +77,4 @@
- 2026-05-15 — bugfix mut-diag-double-code: fieldtest F2 — the four mut-local `CheckError` variants embedded `[<code>]` in their `#[error]` Display body while the non-JSON CLI formatter also prepends `[code]`, doubling it in human stderr; dropped the embedded prefix from the four strings, bringing them in line with all non-mut variants; RED-first via `debug` (`ct1_check_cli.rs::check_human_mode_renders_mut_diagnostic_code_exactly_once`), GREEN applied inline as a trivial mechanical edit; tests 598 → 599 → 2026-05-15-bugfix-mut-diag-double-code.md - 2026-05-15 — bugfix mut-diag-double-code: fieldtest F2 — the four mut-local `CheckError` variants embedded `[<code>]` in their `#[error]` Display body while the non-JSON CLI formatter also prepends `[code]`, doubling it in human stderr; dropped the embedded prefix from the four strings, bringing them in line with all non-mut variants; RED-first via `debug` (`ct1_check_cli.rs::check_human_mode_renders_mut_diagnostic_code_exactly_once`), GREEN applied inline as a trivial mechanical edit; tests 598 → 599 → 2026-05-15-bugfix-mut-diag-double-code.md
- 2026-05-15 — iter it.1: iteration-discipline milestone (1 of 3) — `Term::Loop` / `Term::Recur` / `LoopBinder` added as strictly-additive first-class AST nodes end-to-end: Form-A `parse_loop`/`parse_recur` + print + prose render/free-var/subst lockstep + canonical-JSON serde/round-trip + schema/spec-drift/schema-coverage/carve-out lockstep (13→17) + typecheck (binder typing + recur arity/type unification via `loop_stack: &mut Vec<Vec<Type>>` threaded exactly as mut.2's `mut_scope_stack`; recur-tail-position via a new private `verify_loop_body`, `verify_tail_positions` public signature unchanged) + codegen (loop-header block, one phi per binder, recur back-edge `br` with a NEW parallel `block_terminated` setter, lambda-boundary `loop_frames` save/restore mirroring mut.3). Four new `CheckError` variants `Recur{OutsideLoop,ArityMismatch,TypeMismatch,NotInTailPosition}` (bracket-`[code]`-free Display per the F2 convention). Strictly additive verified — zero deletions touch `tail-app`/`tail-do`, `verify_tail_positions`' tail-app role, or the seven existing codegen `block_terminated` sites (the 32 within-iter deletions are exclusively DD-3 stub-then-fill replacements). `Term::Recur` synth returns a fresh metavar (resolves the plan's flagged `Type::unit()` open risk: recur appears in `if` branches that must unify with the sibling type). `loop_counter.ail``55`, `loop_in_lambda_e2e.ail``49`, four negatives fire exact codes, `tail-app` fixtures byte-identical, zero IR/prose snapshot drift; `cargo test --workspace` green. Two mut.1-class plan-pseudo-vs-reality substitutions recorded (prose round-trip asserting AST-equality is impossible — no Form-B parser by design; the diagnostic.rs doc-list premise was false) → 2026-05-15-iter-it.1.md - 2026-05-15 — iter it.1: iteration-discipline milestone (1 of 3) — `Term::Loop` / `Term::Recur` / `LoopBinder` added as strictly-additive first-class AST nodes end-to-end: Form-A `parse_loop`/`parse_recur` + print + prose render/free-var/subst lockstep + canonical-JSON serde/round-trip + schema/spec-drift/schema-coverage/carve-out lockstep (13→17) + typecheck (binder typing + recur arity/type unification via `loop_stack: &mut Vec<Vec<Type>>` threaded exactly as mut.2's `mut_scope_stack`; recur-tail-position via a new private `verify_loop_body`, `verify_tail_positions` public signature unchanged) + codegen (loop-header block, one phi per binder, recur back-edge `br` with a NEW parallel `block_terminated` setter, lambda-boundary `loop_frames` save/restore mirroring mut.3). Four new `CheckError` variants `Recur{OutsideLoop,ArityMismatch,TypeMismatch,NotInTailPosition}` (bracket-`[code]`-free Display per the F2 convention). Strictly additive verified — zero deletions touch `tail-app`/`tail-do`, `verify_tail_positions`' tail-app role, or the seven existing codegen `block_terminated` sites (the 32 within-iter deletions are exclusively DD-3 stub-then-fill replacements). `Term::Recur` synth returns a fresh metavar (resolves the plan's flagged `Type::unit()` open risk: recur appears in `if` branches that must unify with the sibling type). `loop_counter.ail``55`, `loop_in_lambda_e2e.ail``49`, four negatives fire exact codes, `tail-app` fixtures byte-identical, zero IR/prose snapshot drift; `cargo test --workspace` green. Two mut.1-class plan-pseudo-vs-reality substitutions recorded (prose round-trip asserting AST-equality is impossible — no Form-B parser by design; the diagnostic.rs doc-list premise was false) → 2026-05-15-iter-it.1.md
- 2026-05-15 — iter it.2: iteration-discipline milestone (2 of 3) — structural-recursion guardedness checker + first real `Diverge` effect, strictly additive (nothing `tail`-related removed; that is it.3). New whole-body pass `verify_structural_recursion` runs as a sibling of `verify_tail_positions` in `check_fn`'s post-synth region (DD-1): the `smaller`-set algorithm with implicit candidate-position inference + unconstrained accumulator positions (DD-2 — foldl-shape accumulator classifies as structural recursion, pure+total), self/mutual identification with an inline ADT-family connected-components union-find (DD-3), and the it.2-only `tail==false` grandfather. `CheckError::NonStructuralRecursion {callee,arg}` (bracket-`[code]`-free Display per F2). `term_contains_loop` (stops at `Term::Lam` boundaries, DD-4) injects `"Diverge"` into the raised effect set so the existing `UndeclaredEffect` machinery enforces it with no new diagnostic variant; lam-arrow + `Term::LetRec` sub-effect sites wired (loop behind a lam edge carries `!Diverge` on the lam's arrow, propagating via the free callee-effect path, not leaking to the enclosing fn — exactly as `!IO` scopes). DESIGN.md Decision 3 + §Data-model hook synced present-tense. Four it.1 loop fixtures gained `!Diverge`. Two spec-premise boundary defects surfaced and resolved inside the task's invariants (corpus clean, check not weakened): (§1) the spec's "21 tail-app fixtures" grandfather premise under-counts the corpus — no-ADT-candidate counter recursions (~18, e.g. `build_tree(depth:Int)`) have no structural position to verify and are deferred to it.3 migration; (§2) two RC-regression fixtures (`rc_pin_recurse_implicit`, `rc_let_alias_implicit_param`) hold an ADT param constant while decrementing an Int — genuinely non-structural, joined the spec's transitional `tail-app` grandfather exactly as the other 20 corpus fixtures do (their RC==GC regression guards verified still green; the regression lives in the unchanged `pin`/`pin_aliased` bodies). Both recorded as corrected it.3 corpus-migration scope. `cargo test --workspace` 622 green / 0 red; all 9 acceptance pins non-vacuous (negatives `.contains(code)`); struct_rec_sum→15, loop_needs_diverge→55, the it.1 55/49 e2e still green → 2026-05-15-iter-it.2.md - 2026-05-15 — iter it.2: iteration-discipline milestone (2 of 3) — structural-recursion guardedness checker + first real `Diverge` effect, strictly additive (nothing `tail`-related removed; that is it.3). New whole-body pass `verify_structural_recursion` runs as a sibling of `verify_tail_positions` in `check_fn`'s post-synth region (DD-1): the `smaller`-set algorithm with implicit candidate-position inference + unconstrained accumulator positions (DD-2 — foldl-shape accumulator classifies as structural recursion, pure+total), self/mutual identification with an inline ADT-family connected-components union-find (DD-3), and the it.2-only `tail==false` grandfather. `CheckError::NonStructuralRecursion {callee,arg}` (bracket-`[code]`-free Display per F2). `term_contains_loop` (stops at `Term::Lam` boundaries, DD-4) injects `"Diverge"` into the raised effect set so the existing `UndeclaredEffect` machinery enforces it with no new diagnostic variant; lam-arrow + `Term::LetRec` sub-effect sites wired (loop behind a lam edge carries `!Diverge` on the lam's arrow, propagating via the free callee-effect path, not leaking to the enclosing fn — exactly as `!IO` scopes). DESIGN.md Decision 3 + §Data-model hook synced present-tense. Four it.1 loop fixtures gained `!Diverge`. Two spec-premise boundary defects surfaced and resolved inside the task's invariants (corpus clean, check not weakened): (§1) the spec's "21 tail-app fixtures" grandfather premise under-counts the corpus — no-ADT-candidate counter recursions (~18, e.g. `build_tree(depth:Int)`) have no structural position to verify and are deferred to it.3 migration; (§2) two RC-regression fixtures (`rc_pin_recurse_implicit`, `rc_let_alias_implicit_param`) hold an ADT param constant while decrementing an Int — genuinely non-structural, joined the spec's transitional `tail-app` grandfather exactly as the other 20 corpus fixtures do (their RC==GC regression guards verified still green; the regression lives in the unchanged `pin`/`pin_aliased` bodies). Both recorded as corrected it.3 corpus-migration scope. `cargo test --workspace` 622 green / 0 red; all 9 acceptance pins non-vacuous (negatives `.contains(code)`); struct_rec_sum→15, loop_needs_diverge→55, the it.1 55/49 e2e still green → 2026-05-15-iter-it.2.md
- 2026-05-15 — iter it.3 (BLOCKED, bounce-back): destructive terminal iteration of iteration-discipline. Task 1 (non-destructive: pre-migration oracle + the spec-delegated class-(b) live sweep) ran complete — 40 recursive corpus fixtures classified + oracled under `bench/it3-oracle/`; zero production code changed; HEAD clean at c992eb9. The mandated Task-1.3 sweep surfaced a **fundamental milestone-design flaw**, not a migration nuisance: 6 fixtures contain `build(d: Int) = if d==0 then Leaf else Node(1, build(d-1), build(d-1))` — a terminating, maximally-LLM-natural, **non-structural (Int param, no ADT-candidate) non-tail BRANCHING (double) recursion** that the milestone's totality dichotomy ("structural-over-ADT OR loop/recur, else error") makes **inexpressible**: not ADT-structural, and not `recur`-able (branching ≠ single tail back-edge). Post-it.3 it is a hard `NonStructuralRecursion` with no expressible alternative — the milestone as-specified would fail its own feature-acceptance criterion (clause 1: the LLM reaches for `build(d-1),build(d-1)`; clause 2: the milestone would *remove* expressivity). The orchestrator correctly refused a 4th plan-patch and bounced (`feedback_spec_over_plan_patches`). Boss verdict: the totality story overlooked a second canonical total-by-construction scheme — well-founded recursion on a strictly-decreasing non-negative Int measure. Resolution requires a new additive iteration **it.2b** (widen the it.2 guardedness checker to accept Int-bounded recursion incl. branching) BEFORE it.3 re-dispatches; the purity sub-fork (Int≠Nat: total only for non-negative entry) touches the user-co-designed purity pillar → user design decision, recommended option A1 (accept with a documented non-negative-entry obligation, analogous to array-bounds). Notify sent; loop stopped. The RC-RSS/18g.1 load-bearing risk (it.3 Task 5.5/5b) was NOT reached and must NOT be treated as resolved by the milestone-close audit → 2026-05-15-iter-it.3.md