From b5a747ff5f2ab8016299e34b9b2f1fd5960cea3b Mon Sep 17 00:00:00 2001 From: sanohiro Date: Sat, 1 Aug 2026 09:28:41 +0900 Subject: [PATCH 1/2] docs: record PR 683 delivery retrospective --- CLAUDE.md | 8 +++++ HANDOFF.md | 36 ++++++++++++++++--- .../impl/17-library-boundary-prerequisites.md | 2 +- 3 files changed, 41 insertions(+), 5 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index ca27fe0a..524ccb2a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -339,6 +339,14 @@ formatting churn, or elapsed agent activity. `every`/`exact` acceptance phrase and every named build path into an explicit owner-test closure checklist. Enumerate the Cartesian cells and mutate malformed records one field at a time; representative samples do not close an exact contract. +- Before coding a control-flow/type-inference slice, cross discriminator reachability, + alternative completion kind, expected-type availability, source-order permutations, + and clean versus already-invalid subtrees in the owner matrix. Distinguish runtime joins + from structural type reconciliation: only fallthrough alternatives contribute to a join; + discriminator-unreachable alternatives receive no enclosing expectation but remain + structurally checked; reachable eager-diverging typed wrappers receive any required late + reconciliation without contributing a runtime value. Preserve the same diagnostic guard + for immediate and delayed constraints. - Keep the existing two-hour PR-ready limit. If the checkpoint cannot be made mergeable by then, reduce it to the next smaller correct vertical slice and record the reason in `HANDOFF.md`. diff --git a/HANDOFF.md b/HANDOFF.md index 3b099a74..cb9199c2 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -5,8 +5,8 @@ about the present state, the next decision, and operational facts. The former per-PR journal is preserved in [`docs/archive/HANDOFF-2026-07-25.md`](docs/archive/HANDOFF-2026-07-25.md). -_Last updated: 2026-08-01. `main` includes the shipped wave through #682. The current branch -completes L2b-a2-am-f return completeness; am-w task-wait dominance is next. +_Last updated: 2026-08-01. `main` includes the shipped wave through #683. L2b-a2-am-f +return completeness is complete; am-w task-wait dominance is next. #667 adds the canonical recursive Drop plan and sound `Option` fields; #668 admits one direct recursively Move payload per tagged arm; #669 admits multiple Move payloads; #670 completes nested tagged payload representation and the exact pkg.db L1b acceptance shape. @@ -273,6 +273,34 @@ completed cleanly but put its verdict marker inline; its preserved result was no instead of rerunning the full review. No extra rule is needed for that formatting-only tool failure because the existing bounded-review continuation rule already applies. +### PR #683 delivery retrospective + +PR #683 was squash-merged as `c304512`. The predecessor-merge-to-merge proxy was +3h48m14s; the public PR was open for 53m30s. The independently mergeable am-f vertical +changed 12 files by +884/-89 and closed source completion, HIR publication, MIR/LLVM +termination, whole/per-unit code generation, execution, and object-cache parity together. +It stayed below the 1,000-line split-proof threshold. + +The avoidable delay was an incomplete control-flow/type-inference Cartesian matrix. The +initial implementation treated completion mainly as a body-tail property, while the exact +contract also depended on whether a discriminator falls through, whether each alternative +produces a value or completes directly, whether its expected type is already known or inferred +later, arm source order, and whether a subtree already emitted an error. The broad owner gate +first exposed an eager-termination compatibility gap; post-open review then found unreachable +alternatives receiving an outer expectation and mixed branches typing differently by source +order. The coherent fix delayed only the necessary branch reconciliation, and the focused +closure found and removed one resulting diagnostic cascade on malformed children. + +The durable rule is now in `CLAUDE.md`: before coding a control-flow/type-inference slice, +cross reachability, completion kind, expected-type availability, source-order permutations, +and subtree validity in the owner matrix. Runtime joins use only fallthrough alternatives; +discriminator-unreachable alternatives are structurally checked without an enclosing expectation; +reachable eager-diverging typed wrappers receive required late reconciliation without contributing +a runtime value. Delayed constraints retain the same diagnostic guard as immediate ones. +Required verification was slow but progressing: the final locked all-target Clippy took +11m56s, and several test binaries had their known long startup delay. Those timings do not +justify weakening the gate. + #660's final verification records 48/48 `align_driver` `par_map` tests, including 65,537-element worker-range tests for both materializing chunks and direct chunk reduction, a chunk filter, a cross-worker i8 wrapping fold, and @@ -420,7 +448,7 @@ completed in #678. PR #679 completes am-d with exact producer-valid depth owners stack-safe checked-HIR/type-DAG consumers. PR #681 completes am-e by restricting the entry producer to Unit, signed i32, or exact `Result<(), Error>`, preserving exact whole/per-unit and ThinLTO C entry behavior, and rejecting malformed MIR entry ABI before LLVM construction. -The current branch completes am-f by rejecting bare non-Unit returns and reachable fallthrough +PR #683 completes am-f by rejecting bare non-Unit returns and reachable fallthrough before HIR publication/MIR lowering while preserving typed and proven non-fallthrough paths. Its focused sema, MIR, LLVM, and whole/per-unit driver matrices pass, including raw/optimized IR, execution, and cold/hot object-cache parity. The remaining reviewed order is am-w @@ -620,7 +648,7 @@ SQLite/PostgreSQL driver or add database-named compiler variants before L1a–L7 are complete. The reviewed part of the L2 sequence is L2a parameter-mode and provenance-summary representation plus L2b-a1/a2-s/a2-ac/a2-am-g-t plus the completed am-r design gate, a2-am-d, a2-am-e, and a2-am-f. #679 completes -am-d, #681 completes am-e, and the current branch completes am-f; the remaining sequence is a2-am-w/a2-am-v/a2-am-u/a2-am-p/a2-am-n/a2-am-h/a2-am-b1/a2-am-b2/a2-am-b3/a2-am-b4/a2-am-c/ +am-d, #681 completes am-e, and #683 completes am-f; the remaining sequence is a2-am-w/a2-am-v/a2-am-u/a2-am-p/a2-am-n/a2-am-h/a2-am-b1/a2-am-b2/a2-am-b3/a2-am-b4/a2-am-c/ a2-af/a2-ar/a2-ap/a2-t/b return-provenance slices, L2c cleanup-ABI record plus dynamic Move-return bit, L2d shared borrow, then L2e diff --git a/docs/impl/17-library-boundary-prerequisites.md b/docs/impl/17-library-boundary-prerequisites.md index 4b2a2cd7..b177730a 100644 --- a/docs/impl/17-library-boundary-prerequisites.md +++ b/docs/impl/17-library-boundary-prerequisites.md @@ -2582,7 +2582,7 @@ owners to the shared focused targets. Every implementation slice retains the sco | scope boundary | Indirect calls, closure captures, function-value joins/moves, target-relative capture slots, and direct calls without a settled named/imported summary—including unanalyzed extern targets—retain the documented all-compatible-input fallback. No `borrow`, `borrow mut`, cleanup ABI, resource, region, or database surface is enabled. | existing deferred-function-value and compatibility/extern fixtures plus disabled-mode regressions | L2b-a2-s, L2b-a2-ac, L2b-a2-am-g-t, the am-r design gate, am-d, am-e, and am-f are fixed completed verticals. -PR #679 implements am-d, #681 implements am-e, and this implementation completes am-f. After it, the mandatory remaining sequence is am-w, am-v, +PR #679 implements am-d, #681 implements am-e, and #683 implements am-f. After it, the mandatory remaining sequence is am-w, am-v, am-u, am-p, am-n, am-h, am-b1, am-b2, am-b3, am-b4, am-c, af, ar, ap, and t. The first PR publishes an exact product summary while array, pipeline, and tagged/control forms deliberately retain the shipped flattened result. It must include product construction, reads, partial writes, From 4e6596d26dfa90f1cdf1eda82f663cb1754dde69 Mon Sep 17 00:00:00 2001 From: sanohiro Date: Sat, 1 Aug 2026 09:35:26 +0900 Subject: [PATCH 2/2] docs: make am-f history immutable --- HANDOFF.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/HANDOFF.md b/HANDOFF.md index cb9199c2..5459ecd2 100644 --- a/HANDOFF.md +++ b/HANDOFF.md @@ -471,8 +471,8 @@ change only; the interface already carries the same effect fact. The closing review also found five semantic producer holes that must land before header/body validation. Am-e restricts no-arg `main` to Unit, exact i32, or `Result`: other returns were accepted by sema but emitted an invalid external -C `main` ABI. Am-f rejects bare return and reachable absent tails in non-Unit functions; before the -current branch both reached MIR/LLVM as `ret void` under a value-returning signature. Am-w replaces task +C `main` ABI. Am-f rejects bare return and reachable absent tails in non-Unit functions; before #683 +both reached MIR/LLVM as `ret void` under a value-returning signature. Am-w replaces task wait-state traversal order with generation- and Wait-id-sensitive successful-wait dominance across `if`, direct `match wait()`, direct `wait() else`, every reachable loop break, early exits, nested groups, Spawn reset, infallible Wait, and direct fallible `wait()?`; its