Tests only; no file under src/ changes, so records 14 stay current, and
no pin is regenerated. Three pinned walks that named any runtime value
by its JavaScript constructor now go through test/r0-wire.mjs, whose
arms (test/r0-wire-recorded.mjs, -verdict, -search, -library; accessors
in -fields) match each constructor by class against the injected
build’s module and read its fields explicitly. They are meant to write
today’s bytes, and any other constructor throws naming itself and its
path (no arm for constructor Ff at flexEff/0/EffFresh[1]), as does a
value holding more fields than its arm reads.
effectsEncoder (test/r0-effects-canonical.mjs
encoderFor(load), now async; effects.json, the live side of
t2-annotation-row-before.json): 104 constructors of 21 types, from
Domain.Recorded.Effect (EVar, ERole, Fixed, Position, MarkRef, MTy,
SiteKind, UnsupportedKind, Obligation, Provenance, RecordTable,
SiteRole), Origin (PathRoot, Step), Rule (RuleId), Atom (Var, Role,
Base), Domain.Row (EffectRef), Maybe and Tuple; Data.Map as pairs.decisionText (test/r0-t2-online-checks.mjs’s pinned
comparison against t2-online-decisions.json): 211 constructors of 50
types, the whole closure of Either InternalFault Decision: Either,
Maybe, Tuple, the Map tree (Leaf, Node), Domain.Verdict’s 16 types,
Internal Valid, Theorem.Internal TheoremRef, Unsound, Witness
Binding, Counter (CXGround, RefuteRefusal), Search (SearchHint,
CheckRefusal, Limitation, PackageKey, MalformedReason, Applied), Atom
(Var, Role, Base, RTExpr, Head, OutsideKind), Origin, Rule, Effect’s
eight types that Provenance, PackageKey and Unsupport reach, and
EffectRef. The live-vs-live comparisons (now lines 88 and 98-100) and
describe’s against the inline decisions (115) keep shape; the
wire encoding is computed first (114), for every fixture, so a
missing arm throws even where the inline description differs.refusalTextOf (test/r0-t2-honest-report.mjs; t2-honest.json,
quoted in t2-gap-verdicts.json): 133 constructors of 24 types: the
closure of CheckRefusal, MalformedReason and ReadFault (Search’s five
types, ReadFault, Trace’s TraceKey and TraceFault, the same Effect,
Origin, Rule, Atom Var/Role and EffectRef types, Maybe, Tuple). No Map
arm: a Map fails loudly. The module-level refusalText export is now
built inside honestReport(load); nothing else imported it.Census: taken statically, from each walk’s root type and the data
declarations in src, cross-checked against the constructor names in
t2-online-decisions.json and t2-honest.json. The .build/ census
script (.build/wire-census.mjs) was written but could not be run in
the implement session (its sandbox allowed only the build, width and
purs-tidy commands), nor could any test. The coordinator then ran it
(read-only) to completion; observed against the arms:
| Walk | Census saw | Arms |
|---|---|---|
| 1 | 90 tagged constructors over 3,072 declarations, plus the Map tree classes Leaf and Node | 104 over 21 types |
| 2 | 35 constructors over the pinned decision fixtures | 211 over 50 types |
| 3 | 17 constructors over 22 refusals | 133 over 24 types |
The remaining arms cover constructors of the same types that the healthy corpus does not show, for the regression rows.
Unsupported is
refused where Effect’s is accepted, and a grown value is refused.On the implement step’s tree (b0fb210e-dirty); log
~/Desktop/waxwing-checks/20261130-081855. Parallel 3661/3661, serial
246/246, regression proofs 556/556 (jobs 1), the rows that render
values the healthy corpus never shows included; no file under
test/fixtures changed. The brief’s test list plus test/r0-wire.test.mjs:
50/50. The census script ran (read-only) to completion. Missing arm, in
an isolated copy, each a pinned comparison failing with the named
error: walk 1 without Just (no arm for constructor Just at
obligations/0/value/Equal[0]/MRecord[0]/0/Tuple[1]/MArrow[1]/tail),
walk 2 without the Map tree’s Node (… Node at decision/Right[0]/
verdict/Solved[0]/compilation/Witnessed[0]/bindings), walk 3 without
ForcedTail (… ForcedTail at refusal/NotCertifiable[0]); restored,
0 failures.
After correction 1 (F1: the online check encodes each decision before the inline comparison; F2: census counts recorded), test/r0-t2-online and test/r0-wire 9/9, and the six online regression rows (r0-t2-online-dropped, -fault-refuses, -second-read, -validates, -takes-validate, -certified-reads) 6/6 (jobs 1). The full verify, rerun on this tree (b0fb210e-dirty, after correction 1; log ~/Desktop/waxwing-checks/20261130-093310): parallel 3661/3661, serial 246/246, regression proofs 556/556 (jobs 1); no file under test/fixtures changed.
After correction 3 (F4: walk 1 walks the Map tree itself, classifying every node against the build’s Leaf and Node arms, so a stray child names its path), test/r0-wire 5/5, including the new stray-Map-child case; the effects-pin tests (r0-effects-pin.serial, r0-effects-pin-keys, r0-t2-annotation-row, r0-t2-annotation-repin.serial) 15/15. The full verify on this tree (b0fb210e-dirty, after correction 3; log ~/Desktop/waxwing-checks/20261130-112758): parallel 3662/3662, serial 246/246, regression proofs 556/556 (jobs 1), the effect-pin row included; no file under test/fixtures changed, so effects.json is byte-identical.
After correction 4 (the reopened F4: armOf refuses a null, undefined
or other non-object value with the ruling-4 error and its path, e.g.
no arm for null at table/0/Node[5], for every walk; the Map-child
test gains a null right child and an undefined left child),
test/r0-wire 5/5 and the same four effects-pin tests 15/15. The full
verify on this tree (b0fb210e-dirty, after correction 4; log
~/Desktop/waxwing-checks/20261130-123309): parallel 3662/3662, serial
246/246, regression proofs 556/556 (jobs 1), the effect-pin row
included; no file under test/fixtures changed.
Tests only; no file under src/ changes, so records 14 stay current.
+, -, * and
unary minus with an operand whose type is unknown when the entry is
recorded (an unannotated lambda parameter, ⟨p, param k⟩). The
expected entries are recorder-rules.md’s E7 rows, eq τ_l Int,
eq τ_r Int (eq τ_e Int for Neg), the operand first; the unknown
operand is both (+), left (-), right (*) and the only one (-y).cases gain an over-applied
inc(1, 2) at Sub/left, Mul/right and Neg/operand, each
E_ARITY today, so the walk passes through Static/Rules.purs’s new
arms; the accepted-program test also checks
-(inc(1) - 2) * 3.On the implement step’s tree (23b18b77-dirty); log
~/Desktop/waxwing-checks/20261129-224726. Parallel 3657/3657, serial
246/246, regression proofs 556/556 (jobs 1); no pin moved. The two
changed files alone: 23/23, so the compiler’s entries match the spec’s
E7 rows. Restored defects, each in an isolated copy rebuilt per
mutant, each caught by the new tests: the E7 entry’s sides swapped for
the binary operators (Operator.purs; 3 failures) and for unary minus
(Expr.purs negation; 1); Static/Walk.purs not descending into Sub,
Mul or Neg (1 each); Static/Rules.purs’s Minus arm refusing (2).
With the defects removed, 0 failures. No pre-session review (owner,
2026-11-29: test-only task, these checks in its place).
no home for undefined (2026-11-28)research/open-row-merge/solver-solve.mjs examine named the first
constant of the left side whenever a residue had a side with no home,
so when only the right side had constants and neither side a meta it
printed no home for undefined. It now names the first constant of
the homeless side. Verdicts are unaffected. Check: every small run in
the prototype’s README (the perm, programs, shared, both, chain,
growth, sat13, switch, switch2, removal, annotation, determinate,
odd-cycle, unresolved, fixtures, diag, exhaustive.mjs B and STATE
runs) before and after the fix; only diag.mjs changed, in the eight
lines that printed undefined (now v, z or x), and chain and
growth in their timings. The README’s diag.mjs row records the
change; the diagnostics plan’s Appendix A stays as the 2026-10-17 run.
Records 13 went stale with the arithmetic, R020 and the rule-name src changes; repeated once, before landing (author, 2026-11-28).
inline:r020#main moved, in its today message; n4’s #main is
new. research/r0-scope-a/movement-check.mjs and comparison11.mjs
refused both as unlisted. By the author’s ruling (2026-11-29) they
are listed in research/r0-scope-a/later-movements.json, each with its
ruling and its whole dump row before and after; the scripts accept a
later movement only on an exact match and report them apart.
Negative checks: a tampered row, a missing entry, a listed entry that
did not move, and no allowlist each fail with their own message.
Result: minting 16, Scope A 593 (as records 13), later 2, no
violation; test/fixtures/r0/t2-minting-comparison14.json equals
comparison 13 but for its commit and the later section.The new module src/Domain/Recorded/Rule.purs holds RuleId (SigRule
SigNumber | ExprRule ExprNumber | PatternRule PatternNumber), three
newtypes over Int whose constructors it does not export, and the 45
named values of T-R0b §3 (Sig1-Sig10, E1-E28, P1-P7). Each value’s
definition is the only place in src/ where its number appears.
Domain.Recorded.Origin re-exports RuleId(..) as module Exports
(PureScript rejects re-exporting the type by name; docs/findings.md), and
the compiled Origin carries export { ExprRule, PatternRule, SigRule }
from "../Domain.Recorded.Rule/index.js". Newtypes erase, so the compiled
values are unchanged and no JavaScript file, pin or fixture changes
except the ones listed here. Every SigRule n, ExprRule n and
PatternRule n in src/ became a named value, and the rule numbers passed
around as Int became RuleId: Signature sigAt, Operator arithmetic
and applied, and PatternLeaf restShape. Expr’s private
arithmeticRule and RecordCompanions’ private rule constants are gone.
Signature.purs imports the module qualified (Rule.) to stay under
the line cap. No export list outside Origin changed.
test/r0-verdict.test.mjs lists the reachable module (authorized);
test/fixtures/r0/elab-scope/Common.purs.txt uses literalRule. Nine
regression rows’ needles and replacements follow the new source text. The new
test/r0-rule-ids.test.mjs checks the table against the spec and the
export list. BACKLOG PIN001 records the encoder and pin coupling. The
build, width and purs-tidy checks pass; the coordinator’s runs are
pending.
On the implement step’s tree (28d083da-dirty), load1 about 3; log
~/Desktop/waxwing-checks/20261128-235023. Parallel 3651/3653, only the
two activation-gate src-freshness tests (records 13, deferred); the
trusted-surface check passed with no re-pin. Serial 246/246: no pin
moved. Regression phase 556/556 (jobs 1), every changed needle
included. Only file under test/fixtures changed: elab-scope’s
Common.purs.txt (ruling 5). Test first, in an rsync copy rebuilt each
time: with localRule given E1’s number, test/r0-rule-ids.test.mjs
failed 3 of 6 (distinct ids, the family sets, spec numbers); with
ExprNumber(..) exported, it failed 1 of 6 (the export list). The
initial session for this task (mx1cerid-18k32) stopped at the 250-line
cap and was closed abandoned; this session’s task places the table in
Domain.Recorded.Rule.
Owner ruling (option (a)): Check/Record.purs select renders Refused
refusal with refusedAt env state.subst label.span refusal, as
Require does, so field access, update and removal report a broken row
fact with its call text at the label (D2 for r disjoint s, D1 for a
written lack) instead of MissingField. test/r0-classify.test.mjs’s
pinned R020 test flips to the whole D2 diagnostic; new tests cover D1 at
an access and D2 at an update and a removal. The MissingField citation
in test/r0-static-problem.test.mjs moves to Record.purs:186. The
known-defect entry inline:r020#main stays as its probe’s label, with
today the D2 text; window.json’s row is the coordinator’s re-pin. New
regression row r020-selection-refused (scripts/regression-r005.mjs).
On the implement step’s tree (34631ea9-dirty), load1 about 14-19; log
~/Desktop/waxwing-checks/20261128-221030. Parallel 3645/3647, only the
two activation-gate src-freshness tests (records 13, deferred). Serial
245/246: the one failure was the window table, whose inline:r020#main
row records today’s message. The coordinator re-pinned it with
node scripts/r0-shadow-pin.mjs; the diff is that row alone, its
three fields moving: today.text and the embedded defect.today, from
x is not a field of { ..._ } to Field x is in both records: r
disjoint s, and defect.findings, which gained ruling 5’s note that
R020 is fixed and the entry kept as the probe’s label;
test/r0-shadow.serial.test.mjs then passed 13/13. Regression phase
556/556 (jobs 1), r020-selection-refused included. Test first: on a
build of 34631ea9’s src, test/r0-classify.test.mjs ran 12 tests; the
four new or flipped R020 tests failed for the right reason (the old
x is not a field of text), the other eight passed.
After correction 1 (a stale line removed; the select comment
qualified; comments and docs only), log
~/Desktop/waxwing-checks/20261128-231744. Parallel 3645/3647, only the
two activation-gate src-freshness tests (records 13, deferred);
r020-selection-refused 1/1. The serial and full regression phases were
not rerun: no code or test changed since round 1 (245/246 with the
window re-pinned, then 13/13; regression 556/556).
Rulings and records for landing the arithmetic (Tasks 3 to 7) on main.
amended record and nothing checked one (the header now
states the rule, and a new test requires each amended origin to be
pinned, unique, and its record to name a base commit and a ruling;
shown failing with a reason edited to omit the ruling); the n4
re-pin comments said “each count +1” where the compat skipped set
fell and several fields did not move (reworded); and Task 3’s re-pin
cited a ruling whose text was recorded nowhere (below). Left as
follow-ups: the activation-gate spec’s “Measured” text, which records
13 will rewrite; generate-expr rows with an unannotated operand, which
would pin eq τ_e Int exactly for Sub, Mul and Neg; and a test
reaching Static/Rules’s new arms. The trace-inert pin and the second
amended record name branch commits (4e4bdfc4, fcc25e82), so the
landing is a fast-forward, with records 13 committed on top first.walk(whole, left, n - 1)), pinned at E_SYNTAX “Expected ‘)’” and
expected to stop at E_ENTRY “Expected fn main()” once - parses; the
coordinator re-pins that entry after checking it is the only one that
moved. It was (D001 Task 3, above).Authorized 2026-11-28. Step 1’s differential departs from the plan in
its baseline, by the coordinator: the plan names Task 1’s baseline
copy, but since Tasks 1 and 2 main has taken in Scope A and FX033’s
repair, so that baseline would show many unrelated differences. The
whole arithmetic change (Tasks 3 to 5) is main’s 2e21c93b against
d001-negate’s 017d9d9b; both trees have the Arith node, so no
withoutArith projection is needed.
Command, from the d001-negate worktree with a built copy of 2e21c93b
(git archive, .spago copied, node scripts/build.mjs):
node scripts/differential.mjs --baseline <copy> --corpus all
--regenerate, then twice more without --regenerate and with every
difference written out (a scratch copy of the script printing each
difference in full; the script’s --show truncates sources at 200
characters).
* was E_LEX), 117 at parse.- or * (checked
mechanically, strings stripped). The baseline rejected all but one;
the candidate accepts 547 and rejects 48, never crashing.with h -1 break (ADR 016),
harvested from test/int-minus.test.mjs:
effect Log { fn log(n: Int): Unit; }; fn main(): Int = { let h =
handler Log { log(n) => () }; with h -1 };, which now is E_SYNTAX.
It is the only with case in the corpora.Handler(…)
types, no - or *); see docs/findings.md. Run 2 had none.Step 2’s docs: BACKLOG D001 (operators done, division pending), G003
and O001 (chains of - and * share their problems); findings for the
differential and the stack-depth flake (the with break’s finding and
ADR 016 are Task 3’s). The final tree’s verify is Task 5’s round 3
(parallel 3642/3644, the two activation-gate src-freshness tests;
serial 245/245; regression 555/555); this task changes docs only.
Authorized 2026-11-28 as plan Task 5 with its R0 steps
(docs/plans/2026-10-24-int-arithmetic-plan.md); implemented for
d001-negate from bc97a889, not landed. Arithmetic gains a second
shape, Negate e, and every case over it names it (operands,
checkArithmetic, Go’s IR.Arith, Format.Go.Usage, and the R0 sites).
The parser’s new unary level sits between multiplicative and
atom: on - followed by decimal digits it reads atom, so
-2147483648 and - 2147483648 stay the literal INT_MIN (design 4);
any other - there is unary minus, whose operand is one nesting level
and a nested unary, so a postfix operation binds tighter (-f(x) is
-(f(x))). The checker requires the operand to be Int (-true is
E_TYPE at true). Go emits waxwingNeg(a), and the helper only when
the program negates (usesNegate, beside usesOperator, both over
one walk taking a predicate), so programs without unary minus keep
their Go. R0: unary minus is E7’s one-operand row Neg e (eq τ_e
Int, result base Int; recorder-rules.md gains the row), generated
by a private negation in Generate.Expr at Neg/operand; the static
walk, the static rules and the read-back name it, and the four
JavaScript mirrors accept Negate under Neg and still throw on
anything else.
The characterization row test/diagnostics.test.mjs for Expected
digits after minus moved, by plan, from -true (now E_TYPE) to
match 1 { -x => 1 }, the span the x (28 to 29); code and message
are unchanged. mul-precedence’s last two needles follow the level
it swaps: the multiplicative item is now ` (unary inner)`.
Tests: test/int-negate.test.mjs (values, folding and INT_MIN through
--2147483648 and -(-2147483648), wrap through a parameter,
binding against +, * and postfix operations, evaluation order
-p(1) * p(2), the helper on use, -(2147483648) E_INTEGER, E_TYPE,
-; E_SYNTAX, the pattern row, spans), test/int-negate-r0.test.mjs
(the generator’s checked -x holds Negate, read through
test/int-negate-generated.mjs; the read-back and the static walk at
Neg/operand), test/int-negate-mirrors.test.mjs (the translator’s E7
at Neg equal to the generator’s, the census walk, the path resolver,
the elaboration mirror at Neg and its refusal of Negate beside a
Binary), a row in test/r0-generate-expr.test.mjs, the oracle’s unary
- (below the root; -(n) over a literal), and the depth form
negation-chain. Regression rows in scripts/regression-arith.mjs:
neg-binding, neg-fold, neg-inline, neg-check and
neg-generated-as-plus.
Verification by the implementing session: node scripts/build.mjs,
node scripts/width.mjs and purs-tidy check src tools/style/src (see
the handoff). The test phases, the regression rows, strict rebuild and
structure checks were not run in that session; the coordinator runs
them and records the results here.
Correction 1 (review 1), four fixes: F1, test/compiler.test.mjs:71’s
stale refusal rows now use - and 2 * - (both E_SYNTAX Expected an
expression); F2, test/r0-static-problem.test.mjs cites
Parse/Literal.purs:62 for IntegerOutOfRange; F3, the elaboration
mirror’s arithStep takes Neg only for a Negate constructor and a
Binary’s step only for Plus, Minus or Times; F4, the grammar copy
in docs/language.md repeats the literal-folding note.
Correction 2 (review 2), F5: Generate/Expr.purs names E7’s rule number
in a private constant, arithmeticRule = 7, used by the binary Arith
arm and the unary-minus case (rule ID unchanged; no export added).
Run by the coordinator outside the sandbox on the implement step’s tree (bc97a889-dirty), load1 about 4; log ~/Desktop/waxwing-checks/20261128-131922.
program('-true') expects E_SYNTAX
and now gets E_TYPE (the plan’s Step 1 makes -true E_TYPE), and
the row program('--1') expects E_SYNTAX but --1 now reads
-(-1) and is accepted.Parse/Literal.purs:49 as
IntegerOutOfRange’s raise line; the new export list and
decimalToken moved that line to 62.*.serial.test.mjs, concurrency 1): 245/245. No
pin moved, as ruling 9 expected.neg-* rows and
the updated mul-precedence included.src/ replaced by bc97a889’s and
rebuilt, the new int-negate test files ran 33 tests: 29 failed for
the right reason (E_SYNTAX “Expected digits after minus” at the
unary -; Negate undefined for the R0 tests), and 4 passed, the
ones meant to hold on the base too (-2 - 3, the folded
-2147483648 and - 2147483648, patterns unchanged).After correction 1 (the two refusal rows, the Literal.purs citation,
the elaboration mirror’s operator check, the grammar copy’s note),
load1 18 to 31 from other work; log
~/Desktop/waxwing-checks/20261128-143356. Parallel 3642/3644, only the
two activation-gate src-freshness tests (records 13, held); both
failures of round 1 are fixed. Serial 245/245. Regression phase
555/555 (jobs 1).
After correction 2 (arithmeticRule names E7’s number in both arms),
load1 5 to 11; log ~/Desktop/waxwing-checks/20261128-155252. Parallel
3642/3644, only the two activation-gate src-freshness tests (records
13, held). Serial 245/245. Regression phase 555/555 (jobs 1).
sub-* probes and the design’s migration (2026-11-28)The sub-* regression rows (Task 3) now pass only on their own
defect’s outcome, as review 2 of Task 4 required of the mul-* rows:
sub-operands the printed "3\n", sub-inline Go’s constant
overflow, sub-helper-missing Go’s undefined: waxwingSub, and
sub-check-right an accepted program (another diagnostic code now
fails with its own message). Needles and replacements are unchanged.
The five rows: 5/5 “fixed compiler passes; restored defect fails”.
The design note’s ruling on with H B gains a dated correction:
with h (-1) reads h(-1) as the handler, so with h { -1 } is the
only migration (ADR 016).
* on Int (2026-11-28)Authorized 2026-11-27 as plan Task 4 with its R0 steps
(docs/plans/2026-10-24-int-arithmetic-plan.md); implemented on
d001-times from Task 3’s fcc25e82, not landed. * is a new
single-character token (Format.Lex.Chars punctuation); no pair table
names it, so ** lexes as two * tokens. BinaryOp gains Times.
The parser’s new multiplicative level (chainLeftAny [ "*" ] over
atom, until Task 5 adds unary) sits beneath additive, so *
binds tighter than +, - and ++ and groups left; comparison and
its right operand reach it through additive. Go emits
waxwingMul(a, b), and the helper only when the program multiplies
(usesOperator Times), so programs without * keep their Go. R0: E7
covers Mul l r with +’s entries (recorder-rules.md amended); the
generator, the static walk, the static rules and the read-back name
Times with the path step Mul, and the four JavaScript mirrors
accept Times under Mul and still throw on anything else.
The pinned corpus program
docs/plans/2026-10-21-c001-explicit/baseline/n4-multiplication.wxw
(fn main(): Int = 2 * 3;), E_LEX before, now compiles, resolves and
is checked, adding one program and one declaration to every
corpus-wide R0 count. The owner ruled this admission expected
(2026-11-27); the coordinator re-pins the affected pins in a separate
commit, each checked against n4’s own contribution. The implementing
session moved no pin.
Tests: test/int-times.test.mjs (values, wrap with literals and
parameters, precedence against +, -, ++ and comparison,
evaluation order p(1) - p(2) * p(3), the helper on use, ** lexing
and E_SYNTAX, 2 * E_SYNTAX, E_TYPE and E_INTEGER rows),
test/int-times-r0.test.mjs (the generator’s checked x * 2 holds
Binary Times, read through test/int-times-generated.mjs; the
read-back and the static walk at Mul),
test/int-times-mirrors.test.mjs (the translator’s E7 at Mul equal to
the generator’s, the census walk’s operands, the elaboration mirror at
Mul and its refusal of Times beside Plus or Minus), a row in
test/r0-generate-expr.test.mjs, the oracle’s * (level 2, left), and
the depth forms times-chain and sum-of-products. Regression rows
in scripts/regression-arith.mjs: mul-precedence, mul-inline,
mul-check-right and mul-generated-as-plus.
Left as they were: the editor grammar
(scripts/editor-grammar-generate.mjs) names no * operator, so * is
not highlighted; it was outside the task’s files. The '*' in
scripts/differential-corpus.mjs atoms is data the soups draw from;
it stays (only its comment changed), because moving it would change
every seeded corpus, and the list’s comment covers punctuation too.
Verified in the implementing session: node scripts/build.mjs,
purs-tidy check src tools/style/src and node scripts/width.mjs
exit 0. No test, verify, regression row or npm run perf ran in the
session (the sandbox allows only those three commands); the
coordinator’s results go here before review.
operands (Domain.Arithmetic) now names each operator (review 1, F1).
The mul-precedence, mul-inline and mul-check-right probes now
require their own defect’s outcome (review 2, F2).
By the author’s ruling of 2026-11-27 (waxwing-3 ruling 8), in a commit after Task 4’s (4e4bdfc4). The prediction was written before any Task 4 run: every count of resolving programs, declarations, candidates or packages +1, key sets gaining exactly n4 or n4#main, the compat skipped set losing n4. Observed: exactly that, in the 21 serial tests of round
pinnedEntries) did not move.Re-pinned with each pin’s script (problems, effects, census, rt8,
shadow window, trace-inert, r0-t2-honest-pin.mjs --repin), by hand
with an amended record (first-diagnostic: n4 E_LEX to its Go
digest), or by hand with a comment naming the ruling (record-corpus,
cx-corpus, elab-corpus, images-corpus, package-corpus, differential,
compat). The activation gate’s status cites dossier §18.204, which
names the new figures; criterion 1 reads met. No pin outside the
prediction moved.
Checks on the re-pinned tree: parallel 3598/3600 (the two activation-gate src-freshness tests, which wait for records 13), serial 245/245, regression proofs 550/550 (jobs 1).
Run by the coordinator outside the sandbox on the implement step’s tree (fcc25e82-dirty), load1 4 to 9. Logs: ~/Desktop/waxwing-checks/20261128-063501 (verify).
node --test --test-concurrency=1 over every
*.serial.test.mjs): 224/245. All 21 failures are pin moves from
n4-multiplication.wxw’s admission (ruling 8), each +1 or a key set
gaining exactly n4: first-diagnostic (n4 moved); problems and
effects pins (n4 and n4#main added); census (resolved 995, accepted
752, declarations 3062, compiling 2824, inAccepted 2444, one order
class 107); cx-corpus (3062, 3062); record-corpus (3072); elab-corpus
Sc 3062, T1 2591, T2 compared 2591 exact 2546; RT8 (3068, agree
Solved 2486, Witnessed 2812); window (all 3072, compiling 755,
withDeclarations 999, agree Solved 2477) and its two reconciliations
(752; agree Solved 2486); compat skipped 143, drift packages
2813/2821 with effectHoles and g0Both +1 each; differential 2813;
images and package corpus candidates 2824; t2-honest observation
“candidates 2824, pinned 2823”; trace-inert gains n4#main. No
JavaScript mirror threw and no test failed on anything but a pinned
count or key set. The coordinator re-pins these after the commit
(ruling 8), checking each aggregate against n4’s own tally.WAXWING_REGRESSION_JOBS=1 node
scripts/regression.mjs): 549/550, the four mul-* rows included.
r001-record-order failed with no proof result: its isolated copy’s
PureScript build was killed by a signal (status null) while
compiling an unrelated module, under load from other work. Rerun
alone: “fixed compiler passes; restored defect fails”. So 550/550.src/ replaced by fcc25e82’s and
rebuilt, int-times.test.mjs, int-times-r0.test.mjs and
int-times-mirrors.test.mjs ran 25 tests, all failing for the right
reason (E_LEX at the *; Times undefined for the R0 tests).After correction 1 (operands names each operator), on the corrected
tree, load1 5 to 7; log ~/Desktop/waxwing-checks/20261128-080222.
Parallel 3598/3600, the same two activation-gate src-freshness tests
as round 1. Serial 224/245, the same 21 failing tests as round 1, all
n4 pin moves (compared by name). Regression phase 550/550 (jobs 1), no
rerun needed.
After correction 2 (the three mul-* probes require their own
defect’s outcome; no src change since round 2), log
~/Desktop/waxwing-checks/20261128-090330. Parallel 3598/3600, the same
two activation-gate src-freshness tests. Regression phase 550/550
(jobs 1): mul-precedence, mul-inline and mul-check-right each
“fixed compiler passes; restored defect fails” with the tightened
messages (the defect’s output "20\n"; Go’s int32 overflow; the
program accepted). The serial phase was not rerun: no src or serial
test changed since round 2’s 224/245 (the 21 n4 pin moves).
- on Int (2026-11-26)Authorized 2026-11-26 as plan Task 3 with its R0 steps
(docs/plans/2026-10-24-int-arithmetic-plan.md); implemented on a branch
from main 2e21c93b, not landed. BinaryOp gains Minus. The parser
reads a - after an operand as binary at +’s level, grouping left,
and keeps - with digits as one literal where an operand is expected.
Go emits waxwingSub(a, b), and the helper only when the program
subtracts (Format.Go.Usage usesOperator), so programs without -
keep their Go; waxwingAdd is unchanged. R0: E7 covers Sub l r with
+’s entries (recorder-rules.md amended). The generator, the static
walk, the static rules and the read-back name each operator, with the
path step Sub for -; the four JavaScript mirrors accept Minus
under Sub, and r0-elab-walk compares the operator in both trees.
with h -1 breaks (ADR 016; migration with h { -1 }).
Tests: test/int-minus.test.mjs (values, wrap, grouping, evaluation
order, the helper on use, rejections and spans, the with break),
test/int-minus-r0.test.mjs (the generator’s checked -, the read-back
and the static walk at Sub), test/int-minus-mirrors.test.mjs (the
translator’s E7 at Sub equal to the generator’s, the census walk’s
operands, the elaboration mirror at Sub and its refusal of differing
operators; added in correction 1), two rows in
test/r0-generate-expr.test.mjs, the oracle’s -, and the depth form
minus-chain. Regression rows in scripts/regression-arith.mjs:
sub-operands, sub-inline, sub-helper-missing, sub-check-right
and sub-generated-as-plus.
Verified in the implementing session: node scripts/build.mjs,
purs-tidy check and node scripts/width.mjs exit 0. npm run perf
was not run.
The coordinator’s checks, outside the sandbox, on round 1’s tree:
WAXWING_VERIFY_TEST_CONCURRENCY=2 WAXWING_REGRESSION_JOBS=1
node scripts/verify.mjs) at 2e21c93b-dirty, load1 about 89 from
other work: parallel 3559/3559 passed; serial 244/245, the one
failure test/r0-first-diagnostic.serial.test.mjs with exactly one
moved origin,
research/division-campaign/split-irrelevance/statements.md#1, as
expected. Verify stopped before its regression phase.compile and
compileReport agreeing, and an amended record in
test/fixtures/r0/first-diagnostic.json naming the origin, base
2e21c93b and reason. The test then passed (1/1).WAXWING_REGRESSION_JOBS=1 node
scripts/regression.mjs, after the re-pin): 546 of 546 passed,
including sub-operands, sub-inline, sub-helper-missing,
sub-check-right and sub-generated-as-plus, each “fixed compiler
passes; restored defect fails” (each row restores its defect in an
isolated copy).src/ replaced by
2e21c93b’s and rebuilt, node --test test/int-minus.test.mjs
test/int-minus-r0.test.mjs ran 23 tests: 22 failed (parse refused
or “Expected ‘;’” at the -, E_SYNTAX where E_TYPE was expected,
and Minus undefined for the generator test), and 1 passed, the
with h { -1 } migration test, which holds on the base too.Verify of the corrected tree (correction 1 added
test/int-minus-mirrors.test.mjs, the three JavaScript mirrors on -),
run by the coordinator at 2e21c93b-dirty, load1 2 to 5, log
~/Desktop/waxwing-checks/20261126-162151: parallel 3563/3563, serial
245/245, regression proofs 546/546 (jobs 1), partialfirst-growth
included; exit 0. Also run alone: test/int-minus-mirrors.test.mjs 4/4;
test/depth.test.mjs’s minus-chain, depth 128 builds and runs (2.6 s),
129 is E_NESTING.
Records 12 went stale with the integration’s src change. Repeated at
257f0bee (fe58eb0b): the results dump is byte-identical to Scope A’s
final dump, so the minting comparison equals records 12 but for its
commit (t2-minting-comparison13.json), and the performance run gives
read-back CPU x2.36, RSS x1.11 and validator CPU x2.06, RSS x0.96, all
within the section 18.168 budgets (t2-performance-13.json). The gate
reads as before: shadow minting met, live replacement not met (2).
trace-inert re-pinned at fe58eb0b (e4c4abba): exactly the 326
declarations with + moved, the key set is unchanged.
The final verify (log ~/Desktop/waxwing-checks/20261124-200209/)
passed 3,528 of 3,528 parallel and 245 of 245 serial tests, and 540 of
541 regression proofs. partialfirst-growth failed: its restored
defect measured a growth ratio of 2.995 against a threshold of 3, with
load1 between 27 and 48 from another session’s heavy checker running
at the same time. No src in this integration touches what it measures.
The author accepted the result without a rerun (2026-11-24). This is a
timing proof under contention, not a fixed or explained failure; rerun
it on a quiet machine before relying on it.
Arith (2026-11-24)On integrate/scope-a, main’s Arith (Binary Plus left right)
replaced Add in four Scope A sites: Generate/Expr.purs (rule 7, a
where helper builds the checked node), Generate/Static/Walk.purs,
Generate/Static/Rules.purs and Strategy/ReadBack/Walk.purs (a total
arithChildren, since its groups end in _ →). Each matches Binary
Plus, so adding Minus fails to compile there; the generator keeps
rule 7 and the label Add, and the two walkers keep the path step
Add with left and right. Six test helpers mirror the
constructors by name. Four readers (r0-translator-exprs,
r0-census-walk, r0-generate-paths, r0-elab-walk) read Arith from the
compiled output and throw at run time on another operator; the three
that build paths keep the step Add, and the translator, the
generator’s mirror, keeps rule E7. r0-holes-gen constructs Arith
(Binary Plus …), and RT5’s list names the constructor Arith; these
two reject nothing at run time. node scripts/build.mjs,
purs-tidy and width pass; verify is the owner’s, after this step.
Expected stale until re-pinned: the activation-gate records (two
tests) and the trace-inert pins.
The merge also moved two cited raise lines and widened the read-back’s
reach (ruling 6, amended): citations of Failure.purs:102 now name
:103 (r0-static-sites, the three fail-needs-concrete-check audit
records; effects-coverage.json keeps :102, the row name of the
statements record r0-amin-statements.md), Printable.purs:57 in
r0-static-problem names :58, and readback-termination.json has a row
for the derived Domain.Arithmetic.{traversableArithmetic} cycle.
Resumed under dossier §18.157. Task 13 (abc0260, b0d20c1, d375ffc):
the re-pin rule refuses a lower floor or candidate count, or a dropped
denominator, whatever --explain says; the honest-package pin
(test/fixtures/r0/t2-honest.json) is written from a fresh run with the
four ForcedTail refusals listed by identity apart from the three
RequirementUnjudged: corpus loader 2823 candidates, floor 2805, 11 read
faults; effect pin 2832, 2813, 12. The serial gate
(test/r0-t2-honest.serial.test.mjs, reworked from d78874c) is green;
on the corpus no stage is marked “consumption unchecked” (no refused
package has a dropped stage), and the mark is shown on the inline
fixture by its own probe and two restored-defect rows. Records
(7d9122c): H2 as observed (ten refusals with the defect restored, none
at E1), ForcedTail as dependency, BACKLOG R035 (performance).
Task 16 (850de13..0563207, b647706): the activation gate,
docs/plans/2026-11-03-a2-activation-gate.md, and its report,
node scripts/r0-t2-activation-gate.mjs, which reads files in the
working tree and exits 1 while any criterion is unmet. Today: not
met (2, 3, 4, 5, 6, 7); criterion 1 (the pin as approved) is met. A
cited ruling counts only if numbered after §18.157. 48 cases (47
must-fail, 1 must-hold); 8 regression rows, 8 of 8 proved. Nothing is
activated; A2’s Task 16 (minting) stays held.
Two whole-branch reviews (semantics; gates, pins, live), ready with
fixes; fix wave 66fb0d5..12d5e00 (a partial call’s arrow result,
data-owner and annotation shape checks, §18.157’s figures enforced,
ForcedTail by whole name, repeated declarations, compat skips by
identity), re-review approved. Routine verify at cb54ed5 failed
(3380/3385: four moved citations, one test’s hand-built null state;
fixed in tests, b727b22, 16a7865). Routine verify at 7e0492b passed:
parallel 3385/3385, serial 230/230, regression proofs 437/437, growth
ratio 2.140 against 3.0 (logs .build/evidence/2026-11-03-t2-verify/).
npm run perf not run (R035). Dossier §18.158.
Landing: branch landing-2026-10-25 (FX033, arithmetic Tasks 1-2, the
charter scoping records, FX030-FX032 rows) verified as one tree,
npm run verify exit 0 (2385 + 59 tests, 177 regression proofs; log
.build/evidence/2026-10-25-landed/landing/landing-verify.log in the
main checkout); local main fast-forwarded; the integrate worktree’s
two uncommitted files stashed, restored and checked line for line;
pushed to origin/main at 6b4be77 on the author’s yes. FX033 carried
here: verify exit 0 (2912 + 136, 210 proofs;
.build/evidence/fx033-carry-verify.log).
R0 closure checklist: critical path and a bounded tranche (f6b2289).
a-min revision 3.6 (ffb2b33), one approval review (§R7, 9b7f54d: no
S1, four S2), the fix pass (cade64f) and two consistency repairs
(bc665cd). Oracle reruns: node run.mjs in research/amin-mark-oracle
exit 0, “no disagreement” (k1.mjs prints nothing; it is a case
module). Docs only; no verify needed. Approval pending.
§R7b (dossier §18.94): the author’s inspection of bc665cd found E4′ specifying blanket refusal of recorded fresh tails while the stand-in forced R’s tail and checked; E4′, §0e item 2 and two table rows now specify forcing, with blanket refusal labelled a stricter, unruled, unmeasured alternative. Percent estimates dropped from reporting. Width 0 over 80. Approval still pending; no implementation.
Approved as a representation by the author at 535b780 (dossier §18.95); recorded in the statements’ status, checklist 1g, 2a and A1. Tranche 1 proposal written (docs/plans/2026-10-25-amin-tranche-1- proposal.md), awaiting authorization. Docs only.
Tranche 1 scope accepted with conditions (dossier §18.96). Plan (docs/plans/2026-10-25-amin-tranche-1-plan.md) and A2 options note (docs/plans/2026-10-25-amin-a2-options.md) written for review; the proposal’s import claim corrected. Docs only; width 0 over 80.
Plan and A2 note corrected per the author’s review (§18.97: per- occurrence annotation tails, E4′ forcing order, Task 1 test, boundary test in Checkpoint A, coverage classes, duplicate-minting checks). Checkpoint A (Tasks 1-6) authorized: subagents, 1.6-2.4M tokens.
Stopped after Task 5 at the author’s instruction (it supersedes the
plan’s stop after Task 6); Task 6 (R031) waits. Commits c94e20d to
87420d8 on r0-t2-d1, unpushed. npm run verify at 87420d8 exit 0:
2948/2948 parallel, 142/142 serial, 210/210 regression proofs (log
.build/evidence/2026-10-26-checkpointA/ in the main checkout). The
problem pin is unchanged throughout: G0’s atoms are byte-identical.
Delivered: effects record (Task 1); marked translation (Task 2);
every node’s marked type, checked corpus-wide against types by
erasure and by a fixture of what erasure drops (Task 3); instances
with H′’s ResultC, annotation Cs per handler occurrence, lambda and
handler-literal rows, minting checked both ways corpus-wide (Task 4);
the blocking boundary: 276 handler declarations, none Solved, all
marked (Task 5).
Gate changes, each named in its commit: Domain.Recorded.Effect joins
r0-verdict’s allowlist with an imports-only-Data/Domain assertion
(author); Gen exports effected and refVar, structure-elab pin
(author); new Generate modules join structure-surface’s trusted list
(Marked, HandlerClause, PatternLeaf, Owned, Minted); trusted-surface
re-pins. Test adaptations to type changes: r0-recorded’s Fields
fixture, r0-online-faults’s fault list (MarkShape), r0-marked’s
vehicles (Fail to Log). Defects found and fixed in later tasks: Fail
labels are N, Plain in an annotation is a position (Task 2’s); a
partial application reuses its instance’s stages (Task 3’s); an
undeclared lists dependency and an over-long comment (caught by
verify).
Regression proofs: every new test was shown failing with its defect restored, in isolated copies, deleted afterwards; outcomes are in the plan ledger (.superpowers/sdd/2026-10-25-amin-tranche-1-plan/), not registered as scripts/regression rows (question for the author). Parked: duplicate keyed effect items at one path are not detected (NodeAt and AnnotationAt are covered indirectly by DuplicateSite).
Registered regression rows (Checkpoint B): the author ruled that the
isolated demonstrations above become rows before Task 7, one per
invariant or defect (scripts/regression-r0-amin.mjs; probes in
test/regression-r0-amin*.mjs; node scripts/regression.mjs <name>).
Each restores the defect in a compiling form; its probe runs a small
program through the compiled output and shows it. The original logs are
the plan ledger’s task reports,
.superpowers/sdd/2026-10-25-amin-tranche-1-plan/task-{1,2,3,4,5,15,17}-
report.md; that ledger is git-ignored, local evidence only.
three(1) (Tasks 3, 4).Task 15 (DuplicateEffect, 3da2198, style fix e6868b8), Task 17
(source-derived boundary scope, af980fa), Task 16 (ten regression rows,
f20725e). Task 6 (R031) not done: deferred to the effect-row-binding
tranche (§18.100). npm run verify at e6868b8 exit 0: 2953/2953
parallel, 144/144 serial, 221/221 regression proofs (log and the plan
ledger’s demonstration logs in .build/evidence/2026-10-27-checkpointB/
in the main checkout). An earlier run at f20725e failed the style gate
on Assemble.purs (case on Maybe); fixed in e6868b8.
Controller rulings in the boundary test, for the author: fail-only
declarations (19 observed, 3 Solved) are treated as outside the
handler boundary (a perform, under the interim policy); this narrows
plan Task 17’s “none is Solved” and is open for the author. A handler
type written only in a declaration’s own signature (17 observed) is
checked by its HandlerType marker and verdict alone, because that
signature is not recorded in effects (BACKLOG R032).
Whole-checkpoint review (Opus, fresh): no Critical; ready for the
author’s Task 7 decision with conditions. Important: I1, instance and
reference last-stage rows are recorded as written where the live
checker opens a closed callee row with a fresh tail (DeclarationUse
openedRow); I2, the fail-only ruling above; I3, the missing
signature record (R032); I4, handled labels at function uses are
recorded fixed where the live checker opens them (openHandlers),
and Opened Path has one position per use where live opens one per
handler-typed parameter plus the result (R033); I5, the handler-marker
row’s description (corrected above). I1 and I4 change what Task 7’s E1
equations would record and need rulings before Task 7.
R033 fixed (42181ee: opened rows ⟨p, opened⟩ at function, constructor
and operation uses, not constructor patterns; indexed Opened p i for
handled labels written M in top-level parameters and N in the result;
identities reused across instance, reference and partial stages). R032
fixed (c9fbc31: the declaration’s own Declared signature recorded as
SignatureAt, in duplicate detection and minting accounting; the
boundary checks the recorded signature’s MHandler). I2 amended
(2643df3: the fail-only cohort, 19 declarations, 3 Solved and 16
Unresolved, pinned in test/fixtures/r0/effects-fail-only.json; no
assurance that their effects were validated). Six regression rows
added. npm run verify at 2643df3 exit 0: 2959/2959 parallel, 144/144
serial, 227/227 regression proofs. One targeted review (Opus): the
corrections are sound, R033 matches the live checker; open Important
items: a missing signature write is undetectable (the “main” test is
vacuous), the cohort pin has an in-test re-pin mode
(WXW_PIN_FAIL_ONLY=1) where the repository’s convention is a separate
pin script, and the signature’s rigids are not checked against
effectRigids/rigidMarks. Minor: existence-only representation check,
cohort filtered by source only, no row for the cohort pin itself, no
constructor-pattern/field separating tests, cohort “preserved” rests on
counts. Not fixed: the 3.5M ceiling is spent. This establishes no
effect soundness.
Task 21 (0a4bbd8): assembly rejects a missing SignatureAt with the
new fault MissingSignature, never comparing against the placeholder.
Task 22 (69b0180): the fail-only cohort pin is written only by
scripts/r0-fail-only-pin.mjs (refuses to pin when generation refused
any declaration); the test compares through test/r0-fail-only-compare.mjs
whatever the environment. Task 23 (3265fbd): every rigid the recorded
signature names, nested handler types included, is in effectRigids
and rigidMarks; rigidMarks matches exactly; effectRigids may also
list the declaration’s implicit ambient row variable (53 declarations;
statements §2), asserted as the only allowed gap. The targeted review
(Opus) found two Critical regressions the implementer’s test list missed
(hand-built seal users without a signature; the duplicate-effect
row’s dead needle) and a false premise (a with pure row is closed, so
fn g(): Unit with pure = () records exactly the placeholder); fixed in
7d1d668 with an end-to-end row and a handler-nested rigid case; scoped
re-review: all addressed. npm run verify at 7d1d668 exit 0: 2961/2961
parallel, 146/146 serial, 231/231 regression proofs. Open: Task 22’s
proof is not a registered row (the harness clones only src and
.spago); the end-to-end row restores the placeholder-comparison defect,
since deleting the write is not observable from outside.
Overnight run (dossier §18.135-18.137; ledger
docs/plans/2026-10-30-overnight-ledger.md). Task 9 (ff736de, bdd9f14):
generation records HandlerLit at each handler literal (rule E20,
role LiteralSite) with each clause row consumed into R
(ClauseIntoR k, marks ignored) and into C (ClauseIntoC k, marks,
bare), and Install at each with (E21, InstallSite) with R into ρ
(InstallR) and the installed-C site (AtInstalledC) over an
MHandler; a with over any other type records Install and keeps
Unsupported UnframedInstall, with no consumption. No literal-node
E1: the literal’s marked type reaches its uses by identity (let and
locals, a with’s handler, block results, record-literal fields,
lambda results, all checked corpus-wide with marks) or through the
moving rule’s E1. Re-pin: Generate.Literal (new, split from Effect),
Obligation’s Consumption, consumedAt, siteAt; SiteRole
LiteralSite, InstallSite. Task 14 (efcc231, 7eb388e, 4dad5d0,
f20d6ec): effect pin test/fixtures/r0/effects.json (3071 declarations
of 998 programs, written only by scripts/r0-effects-pin.mjs), taken
after Task 9; 225 declarations moved against the provisional pin,
exactly those recording HandlerLit or Install
(docs/plans/2026-10-31-effect-pin-moves.txt); efcc231 and 7eb388e
carry the provisional pre-Task-9 pin and fail their own pin test.
Census, window and RT8 rerun through scripts/r0-results-moved.mjs:
0 STOP rows, 0 moved rows, 0 moved aggregates; no fixture changed.
Coverage: 31 rows, 18 fixture, 13 unfinished (was 13 and 18).
Two fresh reviews (semantics; coverage, gates, pins): review 1’s P1
(the block-result identity route untested) and review 2’s P0 (the
settling-step row over-claimed) fixed with the P2s and most P3s
(bdad600..d898691). Regression rows added: r0-amin-literal-reaches-use,
-literal-block-route, -handler-lit, -handler-lit-clauses, -install-r,
-install-r-marks, -coverage-installed-c, -coverage-install,
-effects-pin-obligation. This records obligations; no validator exists
and no effect soundness is established. Routine verify passed at
4ca1097 after two failed, repaired runs (dossier §18.137); performance
qualification not run. Accepted by the author with Tasks 8 and 10-13
(§18.138); the run’s wording questions were settled there and applied
to the statements.
The author authorized only this repair. On branch fx033-resultc-tail
(from origin/main a82d064), ResultClauses occurs gains a third
disjunct: a foldHoles over the result handler with its inference
row’s tail dropped. A function’s result clause row now takes R’s tail
whenever that variable occurs in the result type outside R’s own tail.
The comment above ownClauses states H′ as an argued candidate and
cites docs/plans/r0-amin-resultc-tail.md (on r0-t2-d1). RC′, O-SUB and
effect soundness are not established. Blocking nine shapes is not
soundness.
Test first: test/fx033-result-tail.test.mjs, programs in
test/fx033-probes/ as .wxw.txt. On the unrepaired build 11 of 12
tests failed, because all nine channel programs and c1 and x1z compiled
(.build/evidence/fx033-test-before.log). After the change all 12 pass.
CLI runs on the repaired build refuse the nine with the pinned E_EFFECT
text. The controls k2f, x1d and x1n still print 1, 99 and 7. The
ten refused controls keep their exact text. c1 and x1z are now refused.
That is a temporary conservative precision limitation the author
accepted, not final policy. Regression row fx033-result-type was
proved together with the three fx008-result-* rows, and the
fx008-result-own-row needle was updated. BACKLOG FX033 has been added
with the dated history. a-min’s E4′ text lives on r0-t2-d1 and was not
edited.
npm run verify exited 0 (.build/evidence/fx033-verify.log in the
worktree): 2378 of 2378 parallel tests and 59 of 59 serial tests
passed, and 177 regression proofs ran, including the four rows above.
Charter and contributor guidance are committed locally on main as
19f49c7. The README update puts the mission and structural bridge first,
then covers the effect-language lineage, platform composition, schemas,
instrumentation and inspectable trust after the first service example.
It corrects the provider-construction example and keeps typed FFI, HKTs,
stronger effect contracts and other future facilities labelled as plans.
The writing-loop record includes the independent review, which found no substantive issue and requested line wrapping. Those repairs are applied. All 14 README code blocks are unchanged; local links, whitespace and width checks pass. No npm task or compiler test was run. The author approved the README, including the linked first mention of Effect, and requested committing and pushing the charter-related work and README. Separate local effect research and the Claude handoff remain outside the publication scope.
The author approved the charter and requested its
commitment to main, followed by a prominent README update. The charter
records Effect’s business practicality and functional foundations,
Haskell/PureScript abstraction, rows as the structural bridge, and the
Koka/Unison/Effekt lineage. Claude’s review and all 17 dispositions are in
the prose record.
Contributor and engineering guidance now require consulting the charter for substantive designs, with links from language/tooling/schema direction. The adoption record tracks status. README alignment follows in the next commit. No compiler rules, proofs or R0/a-min gates changed. Documentation checks only; no npm task was run. No push was requested.
The author requested a broad prior-art spike before choosing stronger purity guarantees or an extensible effect-kind design. Findings and the open-question ledger are in the research note. Two read-only readers covered Effekt and library extensibility; a bounded Effekt source review found no material issue in the synthesis. The note separates caller requirements, captures, external interaction, failure, state, divergence and lifetime. It records 16 proposed separating cases and a bounded route from promises to reviewed statements.
Source reading and document checks only: no examples, compiler, oracle or
proofs were run. No language rule or implementation scope was selected.
The existing R0/a-min gates remain unchanged. The note and its editorial
record stayed uncommitted in the integrate worktree until 2026-11-24,
when they were committed to main with the landing (§18.203); the
reports built on it are in research/effect-kinds/.
Branch d001-arith (main 2af6e40 plus the design and plan, 7ca2a07). Authorized: plan Tasks 1 and 2 only. Rulings recorded in design section 9 and the plan header.
Baseline npm run verify at 7ca2a07 (under the verify lock) exited 0:
2366 parallel tests and 59 serial tests passed, 0 failed, 0 skipped;
176 regression proofs “fixed compiler passes; restored defect fails”.
Task 1 (Arith refactor of +), done after Task 2. Add became
Arith (Arithmetic e) in Syntax, Resolved, Checked and IR, with
data Arithmetic e = Binary BinaryOp e e and BinaryOp = Plus in the
new src/Domain/Arithmetic.purs (derived Functor, Foldable, Traversable;
operands). Each walk has one case over the operands; the checker’s
checkArithmetic keeps checkAddition’s order (infer left, right,
then require Int left, right); Go still emits waxwingAdd everywhere.
New test/arithmetic.test.mjs (operands and derived foldr are left then
right) failed first with module not found, then passed. Existing tests
that pinned the Add constructor (plan, Task 1) were rewritten to the
Arith(Binary(Plus, …)) shape. scripts/differential-project.mjs gained
withoutArith (the candidate’s Arith (Binary Plus l r) hashed as the
baseline’s Add).
Differential against a git archive build of 3672c77 (the commit before
Task 1): node scripts/differential.mjs --baseline <copy> --corpus all
--regenerate exited 0 in 17.5 min. Harvest test runs exited 0, 0.
harvested 9139 sources, fuzz 1029, isName 1085 probes, matches 1000,
mutations 1000: 0 differences in each. Phases reached (harvested): lex
9139, parse 9058, resolve 8860, check 8309, specialize 5781, emit 5738,
compile 5738. The copy was deleted afterwards. Emitted-Go equality
covers only the sources that reached emit (harvested 5738, fuzz 8,
matches 305, mutations 43), not every source or isName probe.
Task 1 verification, recorded 2026-10-25 (author’s closure). Command:
npm run verify, run by the implementing agent on the working tree at
3672c77 plus the uncommitted Task 1 changes, before the comment-only
oracle corrections that were then committed with it as 0633480.
Totals: 2372 parallel tests and 59 serial tests passed, 0 failed, 0
skipped; 176 regression proofs “restored defect fails”; exit 0. The
log and the differential’s summary were retained by copying them from
job scratch to .build/evidence/d001-task1-verify.log and
.build/evidence/d001-task1-differential.log in this worktree (ignored
by git, local only); the baseline verify at 7ca2a07 is
.build/evidence/d001-task1-verify-baseline.log. Reported, not
retained: the agent’s red run of test/arithmetic.test.mjs (module not
found). Not rerun since: the full verify and the differential.
Closure (author, 2026-10-25): test/fn-syntax.test.mjs gains “+ chains
group left; parentheses group right”, asserting a + b + c is
(a + b) + c on the tree, with a + (b + c) as the parenthesized
control; printed values cannot distinguish the groupings. Passes at
this commit. Shown failing: in an rsync copy without .build, the
parser’s plus in src/Format/Parse/Expression.purs re-associated a
left + operand to the right; after node scripts/build.mjs the test
failed with actual Arith(Binary(Plus, Variable(a), Arith(Binary(Plus,
Variable(b), Variable(c))))). The copy was deleted. Tasks 3-7 stay
held pending a scoped authorization.
Task 2: test/int-arith-oracle.mjs (BigInt model with
BigInt.asIntN(32, ·) at every node, printer with full or minimal
parentheses from an operator table, boundary values 0, ±1, ±2147483647,
-2147483648, 2147483646, ±2^k for k = 1..30, and a seeded LCG) and
test/int-arith-oracle.test.mjs. Seed 1 gives 200 literal trees of
depth at most 6 (3390 leaves; 144 trees wrap at some node), each built
fully parenthesized and minimally parenthesized; seed 2 gives 50 trees
over parameters a, b, c of fn g called with boundary
arguments. All 450 programs are built once by runGoBatch and every
printed value equals the model’s: node --test
test/int-arith-oracle.test.mjs, 5 tests passed (20.8 s).
Shown failing: in an rsync copy without .build, src/Format/Go.purs:42
changed to return a - b, node scripts/build.mjs, then the same
command: 3 passed, 2 failed, first failures full 0 (expected
-877450654, printed -307606134) and parameter 0 (expected 151000832,
printed -16776192). The copy was deleted.
Corrected 2026-10-24 (dossier §18.87): independent code can still share
a conceptual defect with the compiler, and with only + the printed
values cannot establish parser grouping (addition is associative).
No test pins an unparenthesized + chain’s grouping structurally: the
parse-shape tests cover + beside |>, access and comparison, and
test/properties.test.mjs prints fully parenthesized trees. Codex’s
earlier review read the source and ran a model-only sanity check, not
Go or a full verify.
npm run verify with Task 2 and these docs (under the lock) exited 0:
2371 parallel tests (the baseline’s 2366 plus the oracle’s 5) and 59
serial tests passed, 0 failed, 0 skipped; 176 regression proofs as
before.
Branch t013-incremental, commit f5a06bf (docs in the commit after it).
scripts/regression.mjs compiles one plain-purs baseline (src, .spago,
output) per run, clones it per row (scripts/regression-clone.mjs: cp
-cR, else an ordinary copy; never hard links), applies the row’s edits,
compiles incrementally and runs the unchanged probes. Each row directory is
removed in finally; a failing row’s error is saved to
.build/regression-failed/<row>.log first.
test/regression-incremental.test.mjs is the permanent equivalence check:
Domain.Ids TypeId newtype to data changes 25 dependents’ compiled JS,
and the incremental result equals a clean compile (all files and bytes
except cache-db.json). It also covers the fallback and clone
independence. Red logs: .build/evidence/t013-red.log (helper absent,
hard-linking fallback, non-propagating mutation, corrupted incremental
output). Measured: regression 449 s (was 1,039.5 s), full verify 728.7 s
(was 1,320.5 s), 142/142 proofs, 2123 plus 59 tests passing
(.build/evidence/t013-regression.log, t013-verify.log). Details:
docs/plans/2026-10-17-verify-profile.md “Adopted (2026-10-17)”.
Characterization test only (test/r0-r019-probe.test.mjs, 14 fixtures in test/fixtures/r0/r019/, helpers in test/r0-probe-support.mjs); no source or diagnostic changed. Result recorded in docs/findings.md “R019 compatibility probe”: no probed called program compiled; calls to multi-tail functions stop at the Task 8 placeholder, uncalled definitions compile. G-R019 stays open.
Exhausted settled (2026-10-22)Evidence task; no compiler source changed.
test/r0-exhausted.serial.test.mjs measures every re-examination
rescan, on a patched copy of output/, against its bound
P · (|Λ| + 1) + 1: 50,000 generator runs (five families, seeds
1-2000, five orders) and the 1,006 programs of the R0 corpus. None
reached it (largest found.passes / bound 2/3), so Exhausted is a
broken invariant, mapped to a fault in Task 2.1 (docs/findings.md
“Exhausted is not a budget”). New test/r0-corpus.mjs: the corpus
rules of stream 7b’s measure/corpus.mjs (refactored to export
corpusOf, output unchanged) over git ls-files, pinned by
test/fixtures/r0/corpus-manifest.json; re-pin with
node scripts/r0-corpus-pin.mjs. measure/instrument.mjs exports its
copy-and-patch as patchedCopy (patched copies unchanged).
Design only; no compiler change. docs/plans/r0-generation-continuation.md
specifies the generation continuation with tracked requests: an
applicative Elab s (static uses beside a reader over bindings,
Pottier 2014 §4.3; no Bind), handles minted only by fresh with
their vars entry, rank-2 problem scope (adopted: Vars are
path-relative, so a value check alone cannot tell declarations apart),
a hidden-constructor Elaborating, untracked run after generate
and before decide, covDomain = requests ∪ (flex ∖ Recon),
ElabFault after Cov as BrokenInvariant (stops the run), Free as
today’s renumbered hole, and Task 7.1’s tests T1-T11 with four
regression rows. Open for the gate: effect rows are erased by the
recorder yet present in the checked IR, so no witness read can produce
them (§12.1; E-a recommended; blocks Task 4.6); T-R0b position
amendments for E28’s rest and P4’s inst i (§12.2). Fix round 1
applied the task review and the G-D1 adversarial review (findings
1-19): import rules E1-E5 (no smuggling via map from checker
modules), Judged pairing problem and solution from decide, nominal
type roles against coerce, untracked as elaborate’s first step,
build reachable only from Elaborate, Internal orFault, sorts by
position (slots by declared sort; effect-row tails rejected), slot
images as today’s TVar form, DuplicateFresh and AuxiliarySite,
covDomain faulting on Recon ∩ requests, nodeType recording every
elaborated type, T5b and T11b, row r0-elab-phantom-role. The
effect-row gap is routed to Task 0.7; G-D1 cannot close until it is
settled there. Fix round 2 (re-review N1-N6): every
Features.Check.Generate.* module Generate*-only and
Features.Check.Generate exporting only generate, re-exports of
restricted modules forbidden except named types from the own
.Internal (rule E6, checked from export lists), corrected E2/E5
importers, types and instances declared in .Internal, positioned
keyed per CheckedName site with a site table and DuplicateSite,
public Ref, Gen’s constructor hidden, covDomain before the
witness steps, T10’s allowlist stated. Fix round 3 (re-review 2,
NB1-NB9): Use/UseSort/ElabFault/SealFault in an unrestricted
Domain.Elaborating.Types and Ref in Generate.Elab.Internal
(re-exported as a stated E6 exception) to remove two module cycles;
Judged in its own Domain.Verdict.Judged.Internal, leaving plan
Task 1.1’s Domain.Verdict.Internal untouched;
Features.Check.Generate exporting the allowlist generate,
staticRules, Tables, Signatures (no emptyProblem, ruling
R2); an emit primitive and Parts as append-only logs, so
DuplicateSite is detectable; E6 alias resolution, pinned export
lists, and tests T3a/T3b/T6/T7/T12. Fix round 4 (re-review 3,
NB10): Sc again rejects a use whose site is Auxiliary or
RigidName, so a direct readType/readRow there is reported;
GenEntry(..) declared in Generate.Gen; Generate.Elab and
Generate.Gen export lists pinned.
ValidR probe and draft (2026-10-22)Characterization and design only; no compiler source or diagnostic
changed. test/r0-requirements-probe.test.mjs (inline sources,
no fixture files, so no corpus re-pin) pins today’s printability and
comparability: holder types (Box(Int), F, Outer) refused at
every argument; other declared types judged by their arguments, a
phantom one included; main E_ENTRY exactly where show is refused;
at a rigid variable printing is deferred to each key (E017 at
specialize) and comparison refused at check; at a hole printing passes
and comparison is AmbiguousType. Shown failing on two scratch mutants
of a copy of output/ (first run, 7 grouped tests: holders ignored, 4
failed; rigid variables treated as possible functions, all 7 failed).
Draft for G-ValidR:
docs/plans/r0-validr-draft.md (policy options H, F, Pr, Q with a
recommended default each; ReqG and ValidR under the defaults;
checks for VR-sub, VR-agree, VR-CX). Findings in docs/findings.md
“ValidR sketch and today’s printability”. Stopped at G-ValidR;
T-R0b §5.4 unedited.
Fix round 1 (task review): the probe is one test per case (16), with
the generic p only in the cases that call it; both mutant runs
re-run and recorded in docs/findings.md (8 and 5 of 16 fail); finding
labels corrected (the ¬ ValidR half of finding 1 argued); the
holder-set source is policy point §3.5 (K-a recommended); CX §4.1
condition 4 named for the same post-gate edit; RC3 point stated as
conditional.
Fix round 1’s first full verify exited 1 on one timing bound only:
test/fn-linear-timing.serial partialFirst took 938 ms (bound 930;
2389/2389 parallel tests passed, 64/65 serial) under load average 7-8
from other sessions; alone it then took 944, 880 and 933 ms. No
compiler source changed in Task 0.4 (diff from d861957: three docs
and the probe), and the round’s first verify of the same output passed.
The second run exited 1 on another timing bound only (test/match-lift
a five-thousand-arm integer match compiles, 6.59 s; 2388/2389). The
third, with no change between runs, exited 0 (2389/2389, 65/65, every
regression proof). The known class is BACKLOG T003 (earlier records:
R005 B5, INF001); no bound changed, and the two failures stand as
observed.
Evidence task; no compiler source or diagnostic changed. The table
and its reading are in docs/findings.md, “Effect and coverage audit”.
test/r0-audit.test.mjs runs 52 fixtures in test/fixtures/r0/audit/,
each a program with its record part inferred, pinned by annotation,
or a control. Results for G-effects: every check-time effect refusal
is class f; HandlerMissing, HandlerDuplicate, HandlerOperation and
the Resolve-time FailNeedsConcrete are class a. Results for
G-coverage: RedundantArm, NonExhaustive, AmbiguousType and arity at
functionLike are semantic, arity at fixedResult is structural,
and today’s coverage has no structural part at a raise site.
Recommended reason for AmbiguousType: Unsupported
RequirementAtoms. test/r0-probe-support.mjs gained refusalOf
(phaseOf plus the span’s text and the notes). The fixtures carry a
source, so the corpus was re-pinned. Five mutant runs are recorded
in findings. Found on the way: a new FX010 reproducer (E_INTERNAL
from a user program), recorded in BACKLOG FX010 and not fixed.
Stopped at G-effects and G-coverage.
Fix round 1 (task review and gate re-derivation): 79 fixtures with a
role; a semantic row is checked only by a selected or
pinned-selection variant that differs from its base in stage or code
(pinned against inferred alone is not evidence, an amendment recorded
in findings). The gate’s selected variants added; Require.purs:123
now checked (reachable through a nested record); arity split into
structural Pipe.purs:33 and Call.purs:144 and semantic Pipe.purs:36
and Call.purs:148; rows added for ExpectedHandler (f), NofailOnFail
and MarkVariableOutsideSignature (a); RowEquality cited at
Argument.purs:70 and RowName.purs:96 (the latter argued). The reason
for AmbiguousType is re-derived through rule 3 and left to the
author (options with consequences, none chosen). New BACKLOG FX030
for two misleading effect diagnostics. Corpus re-pinned.
Fix round 2 (re-review N1): the selected variants of Require.purs:123
and HandlerMayFail now change text outside the refusal span (details
in findings); both rows stay checked; 78 fixtures; corpus re-pinned.
Design task; no compiler source or diagnostic changed. The note is
docs/plans/r0-erased-rows.md; its runs are in docs/findings.md,
“Erased effect rows”. It treats the erased obligations and D1’s
effect-row values (§12.1, routed here) together, sorting the dropped
obligations into record obligations hidden in label arguments and
effect-only ones. It states the marker ErasedRow and its syntactic
criterion C-erased (seven label sources; record-capable arguments),
the check at the accepted witness with its argument by kind, and the
census category for Task 3.5. Recommended default, for the author:
the marker for record obligations, today’s joint solve for the
effect-only part (online witness only), and E-a with a clarification
(rows inside witness images are unchecked too). test/r0-erased.test.mjs
pins 23 fixtures in test/fixtures/r0/erased/: three refused/control
pairs, one of them a record obligation that reaches a callee only
through a label argument and that no T-R0b marker covers, and 17
compiling form fixtures carrying the criterion’s predicted answers.
Four mutant runs are recorded in findings. Found on the way: BACKLOG
FX031 (Expected Unit -> Unit, found Unit -> Unit). Corpus re-pinned
(new fixtures with a source). Stopped at G-erased.
Fix round 1 (task review Important 1-2; G-erased gate findings 1-7):
the operation source split into perform and clause, types read
as declared, Fail precedence stated; the part (ii) trigger P-ii
defined (it holds for pure declarations too) and added to the census;
the unmarked-declaration argument restated (K1 there binds only
effect-row variables) and K1g widened to K1e; K3 corrected (handler
and crash rows; instantiations hold no row slots); E-a given names
and stated as dependent on (b-joint), with a note in D1 §12.1; the
demoted non-online Solved gets a reason distinct from ClassF; the
online effect part labelled Pending assurance; the author’s ruling
points listed. 27 fixtures (new: obligation-rowvar, obligation-data
pairs), hand-derived sources/inferredRow checked against a
reference reading (test/r0-erased-criterion.mjs); mutants M1 (re-run)
and M5-M7 recorded. BACKLOG FX032 (an operation’s with row is
ignored; gate P6). Corpus re-pinned.
Fix round 2 (re-review N1, gate finding 2): fresh effect-row sites in
Features.Check enumerated by grep into note §2.1 (file:line, whether
the row reaches the checked IR, probed where unclear, P-ii trigger,
E-a slot); P-ii and the reference inferredRow now cover bare
show, any apply or pipe, partial applications and constructor
patterns; seven fixtures (34 in all) and mutants M8-M12 recorded.
Corpus re-pinned.
First PureScript of the tranche; unused by compile (a test checks that
no module reachable from Program.Main imports them), so acceptance and
diagnostics cannot move. New: Domain.Verdict (outcomes, verdicts,
reasons, faults, attempts; T-R0a §3.2-§3.5, §4.1, §5.1),
Domain.Verdict.Admission (§6), Domain.Verdict.Internal (Valid,
Refuted, NonForced, ForcednessEvidence and CX),
Domain.Verdict.Open, Domain.Recorded and Domain.Recorded.Internal
(opaque RecordedProblem, no fields yet). Two structure rules and a
source check of re-exports (docs/engineering.md); compile probes,
RED runs and five mutants in docs/findings.md, “The verdict token
boundary”. Choices, each argued:
SearchFault.SearchBroke (G-Q13,
confirmed by dossier §18.71 item 2; plan §8.1’s row still to edit
T-R0a) and SearchEnd.Broke String (ruling R10).Derivation.rule is a RuleName, not the SoundRule: the registry
entry is a Features value Domain cannot name, so checkDerivation
looks the name up in the injected rules (ruling R7).Path, AtomId,
CallSite, OutsideKind in Domain.Recorded (Task 3.1 moves them);
the rest in Domain.Verdict.Open, each naming its owner; StaticCode
and PolicyCode in Domain.Verdict (Task 2.3; ruling R5).
TheoremRef is one: Domain’s Assurance names it, so plan Task
5.1’s placement (type and constructor in
Features.Check.Refute.Theorems) cannot stand as written; 5.1 must
keep the type in Domain and hide its constructor there.EmissionFault’s Key is a new Domain synonym of the test-facing
key (ruling R11); Features.Specialize is untouched.DeclReport or Report here: their shadow-phase slot (ruling
R2) holds today’s checker state, a Features type, so they are Task
1.2’s, in Features.Check.Outcomes (plan §1). No
Features.Check.Generate stub: with no emptyProblem (R2) it would
hold nothing.Judged (D1 §6.2) is not added: no type here needs it. It gets
Domain.Verdict.Judged.Internal in Task 7.1, separate from these
tokens.StrategyName has only OnlineSolver; each strategy adds its own.
ForcednessEvidence is a nullary token until G-forced gives it a
payload.Tests: test/r0-verdict.test.mjs (compiled exports, each constructor
at its arity, reachability) and test/structure-r0.test.mjs (both
rules in both directions, the re-export form). No corpus re-pin: no
tracked source, fixture or fenced block changed.
Fix round 1 (review I1): exportFindings now removes comments before
matching, accepts dotted aliases, and outside the public module reports
any alias on an import of a restricted Internal module and any export
of it by name. Nine new cases cover the reviewer’s three shapes and
their variants; the RED run and two mutants are in findings. The
Generate stub stays out (controller ruling: Task 3.2 creates it).
Fix round 2 (re-review 1, I1): the source check still missed forms
purs accepts (comments, layout, CRLF), so it is replaced by
reexportFindings, which reads the built output/
First commit: Task 1.1’s breaker ruling (forgery rule on the
primitives; see Task 1.1 above). Then checkProgram and the Report
and DeclReport types in Features.Check.Outcomes: every body is
checked whatever happened to the others, in today’s order (entry,
bodies by declaration, then the instantiation rule and coverage only
when all passed). DeclReport holds today’s checker result and an
empty problem slot (ruling R2); nothing adapts a diagnostic into a
verdict. check and compile are the first of checkProgram and the
new compileReport. The CLI, README, Command.purs and Main.purs are
unchanged (Step 6 held back, §18.71); no Checking or strategy wiring
(R6). A corpus-wide snapshot taken at the parent commit shows no
change in acceptance, Go or first diagnostic; no fixture changed; no
corpus re-pin (no tracked program added). Task 1.1’s reachability
test is narrowed to the driver. Regression row r0-first-left-hides.
Evidence in findings, “The collecting driver”.
Unresolved joins the ErrorCode ADT (Domain.Syntax.Core) with wire name
E_UNRESOLVED (proposed; the author confirms it). It is unrendered: no
Problem maps to it and nothing emits it, since Task 2.2 is held back
(§18.71). docs/language.md’s list of codes is unchanged because it names
emitted codes. test/r0-codes.test.mjs checks the wire string only.
Acceptance, codes, texts and first diagnostics are unchanged (the
first-diagnostic snapshot stays green). No corpus re-pin.
Features.Check.Classify’s classify (AT16’s first half), built on
RowOutcome’s classified, the one match over Failure by name, with
no catch-all; each of the 15 constructors is injected directly in
test/r0-classify.test.mjs. Exhausted is now a fault (Task 0.2).
Internal carries an unrendered kind (ruling R3: LaterWork,
RuleBroken, BoundPassed, BodyState, Unrendered, TableLookup,
InputShape, PassInvariant), assigned at every site and tested per
kind. The catch-alls in EndReport, Reject and Record and UnifyRecord’s
open became named arms with the same results; today’s renderers are
not routed through Classified (findings say why). Texts, codes,
acceptance and first diagnostics are unchanged (the first-diagnostic
snapshot stays green). The review found R020 (a broken disjointness at
a selection reads as a missing field; pinned, not fixed) and FX010’s
constructor (RowOccurs). 20 audit fixtures’ cited line numbers
moved; no corpus re-pin. Regression row r0-classify-catchall.
Evidence in findings, “No catch-all at the end of a body”.
Features.Check.Generate.Static (AT10; ruling R5) classifies 48 raise
sites, constructors of Generate.Static.Site, as StaticRule (class
a), Policy (class b′: SameDisjoint, RepeatedTail, staying in
Resolve) or semantic, with no wildcard arm. Domain.Verdict’s
StaticCode and PolicyCode now have constructors (trusted surface
re-pinned, adding the two new modules). Classes follow the closed
gates: effect refusals raised by check, coverage and AmbiguousType
are semantic; arity is static at fixedResult and Call.purs:144 and
the count sites, semantic at functionLike; every Resolve-raised
refusal is static, FieldArity, FunctionNeedsCall and TypeArguments
included (examined by probe). Every check keeps its place, so the
first diagnostic is unchanged; staticRules is Task 3.2’s. Tests
(test/r0-static.test.mjs) inject every site, pin each cited line and
every raise site of a classified refusal, and agree with the audit’s
fixtures. No raise site edited, no fixture changed, no corpus re-pin.
Evidence in findings, “Static rules beside the verdict”. Fix round 1:
the no-catch-all test reads the syntax tree (new Style.Arms), after
three forms evaded the regex test.
Domain.Recorded.Internal’s RecordedProblem now wraps T-R0b §10’s
record (Fields: decl, rigidTy, rigidRow, flexTy, flexRow,
d, q, b, bq, outside, adm, split, vars, types) and
derives Eq, so two declarations’ problems differ by decl alone (D1
spec §6.2). The vocabulary is plain data in Domain.Recorded.Atom
(Var, roles, RTExpr, atoms, OutsideKind, CallSite, VarInfo,
CheckedName) and Domain.Recorded.Origin (Path, AtomId, Origin,
Entry, rule and row ids). Domain.Recorded exports fields, a
read-only view (ruling R4); construction stays Generate*-only. One
labelled amendment: a variable’s origin role is a Maybe, since
§2.3 gives a rigid variable no role. Trusted surface re-pinned
(Domain.Recorded: fields added, the four type names now re-exported
from the new modules). Nothing builds a problem in production; problem
stays Nothing. No fixture changed, no corpus re-pin. Evidence in
findings, “The recorded problem’s fields”. Fix round 1: Eq RTExpr
walks arrow spines by a loop (the derived one overflowed at 20,000
arrows; tested at 80,000), and OriginKind’s Inst is InstOrigin.
test/r0-rt1.serial.test.mjs compares the generator (Task 3.2) and RT1’s
translator over the pinned corpus (973 programs, 2,958 declarations):
generate is Right everywhere; the (Origin.atom, entry) multisets
agree after recorder-spec §5.3’s normalization; vars agree; the
whole problems agree, origins and spans included, with recorded-order
arrays sorted; every rule id occurs on both sides but the seven that
emit nothing; every marker kind but LocalGeneralization (exempt, R11)
has a fixture. No disagreement. A generator mutant (one path step)
and a translator mutant (spread numbering) each fail three tests.
B13 settled on the generation side: P5-P7 agree on every
record-pattern atom with no growth marker; whether the online growth
rule matches ValidR stays open (RT8/CX). Evidence in findings, “RT1’s
comparison and B13”. No fixture changed, no corpus re-pin.
Characterization tests of the generator, all green with no generator
change: RT2 = AT1 with AT4 (11 refusing fixtures in
test/fixtures/r0/rt2: each refused declaration’s whole problem equals
RT1’s translation, entries after the refusal and the pr/cmp sites
are present, a later and a statically refused declaration have their
problems); RT4 (35 of translation.md §5’s examples equal their hand
translations after eliminating defining equations; nine stop at
Resolve); RT9 (one fixture per Outside kind, a refutable atom
beside it, Slot positions for E17/E20); RT10 (the review’s probes
rebuilt, each meeting today’s checker as recorded; bq kinds per
T-R0b §6); AT13 (four body-change pairs leave g’s problem
byte-equal). B9 settled on the generation side (RT1 and RT2 agree on
E28/P7 over several tails, no marker). Author-facing: submit is
refused by D4, not rule H; E26’s Placeholder is unreachable today;
RT10’s “same atom” for cmp-c/cmp-cf holds for the origin only, and
recorder-spec T10’s contract kind for peek yields to T-R0b §6. RT7’s
determination is Task 4.3’s; the brief has no RT8 step. Six generator
mutants each fail the new tests. Corpus re-pinned (11 added); their
outcomes appended to the first-diagnostic snapshot under extended, no
entry changed; compile unchanged (src/ untouched). Evidence in
findings, “RT2, RT4, RT9, RT10, AT13 and B9”.
toSig, trustedRefuter (2026-10-23)toSig (Features.Check.Refute.Project, over Refute.Sig’s
SigProblem) keeps every D and B atom with its id, is undefined
when D or q leaves TExpr, drops bq, gives each app
occurrence its own flexible variable, and walks arrow spines by a loop
(20,000 parameters). checkDerivation (Refute.Rules) takes the
injected rule set (ruling R7) and refuses an unregistered rule, an
unprojectable problem, a D premise, a premise outside the recorded
B, and a rule that does not fire again on withBody (toSig P)
premises with the whole D. registry and theorems are empty;
TheoremRef’s constructor is in Domain.Verdict.Theorem.Internal
(importers: Domain.Verdict, Refute.Theorems) and SoundRule’s in
Refute.Rules.Internal (importer: Refute.Rules); only Rules imports
Theorems, naming the type without constructors (a new source scan).
trustedRefuter wraps only what a spec’s check accepts. AT5 is checked
by brute force (sig-oracle bounded.mjs), AT6 per refusal; a corpus test
shows toSig total on 3,011 problems with D and B ids disjoint.
Five mutants and regression row r0-d-premise fail as expected.
test/r0-stubs.mjs mints the test tokens. Trusted surface re-pinned
(Rules, Theorems added). Nothing reachable from compile changed
behaviour; no fixture changed. Evidence and twelve labelled readings in
findings, “Rules and the projection”. Verify: the first run failed on
the trusted-surface importer list (fixed) and on the five-thousand-arm
timing bound (5.66 s; 2.87-3.38 s alone; recorded under BACKLOG T004);
the final run exited 0 (2656/2656, 83/83 serial, 179 regression
proofs).
checkSubstitution (Features.Check.Strategy.Substitution, trusted)
checks every B atom under a generic substitution against D
(equations up to record equality, definedness of every composition,
lacks/disjoint entailed by D) and every BQ atom outside
§3.2(a)’s open set by the three-valued ground rule
(Features.Check.GroundRule). g0Guard declines, as
OutOfScope RequirementAtoms, the atoms G0 cannot judge (a rigid
variable after reduction, or outside the one-tail fragment);
openRequirements (Decide.Open, no Strategy* import) is the open set
before G-ValidR. entailedGround (Features.Check.Entailed, outside
Strategy* by ruling) reduces through the most general unifier of the
original equations, per docs/plans/r0-entailed-ground.md, whose
argument was written, committed and reviewed first (530e276, review
corrections f0146ce). The holder set is the problem’s own field
(holders, ruling K-a, author 2026-10-23, fix round 2), computed by
generation and independently by RT1’s translator. Reason’s
classifiers moved to Decide.Reading with every constructor named.
AT19’s three cases, a G0 limit is local to G0, the detectors’
disjointness, G0 leaves open atoms to
§3.2(a), d02’s definedness, main’s printability agreement (984
corpus programs) and EG-oracle (10,100 problems, no counterexample)
pass; five mutants and two regression rows (r0-definedness-dropped,
r0-g0-limit-global) fail as expected. Trusted surface re-pinned
(Strategy.Substitution added). Nothing reachable from compile changed
behaviour; no fixture changed; no corpus re-pin. Evidence and readings
in findings, “G0, entailedGround and the two detectors”.
G-switch evidence, no acceptance change, exemption or policy. Over the
pinned corpus (1,128 programs; 743 compile; 2,773 declarations whose
body checks today), each declaration is classified by the landed
detectors (outside kinds, second spreads, openRequirements,
g0Guard) and a test-only erased-row detector for C-erased (ruling
R11; an explicit walk of resolved syntax, written apart from Task
0.7’s reference reading). 251 of the 743 programs that compile today
would be rejected (245 without ErasedRow; 251 of 343 without the 400
generated record programs, none of which is blocked). Largest:
DataApplication (587 declarations, 138 programs, 115 blocked by it
alone), HandlerType (170, 102, 35). BQPendingValidR, SecondSpread,
LocalGeneralization: 0; BQAtTypeVariable, §3.2(b): 3 declarations, one
program (examples/records.wxw). P-ii, informational: 591 declarations,
192 programs. Counts pinned in test/fixtures/r0/census.json
(scripts/r0-census-pin.mjs), asserted by r0-census.serial.test.mjs,
which also checks the detector against the reference reading on all
3,011 declarations and times generation on ten scale programs within
their suites’ bounds. Detector checks against existing fixtures (the
34 erased ones and one per category); the author’s g
counterexample pinned inline (test/r0-erased-challenge.test.mjs;
r0-erased-rows.md §7.1 now “checked”). Found: the BQ detectors’
unifier is super-quadratic (BACKLOG R021). Seven mutants, one
equivalent. Reading in docs/plans/r0-census.md; evidence in findings,
“The census”. No fixture changed; no corpus re-pin. Verify exited 0
(2721/2721, 100/100 serial, 185 regression proofs).
onlineSearch, read-back, RT7 and RT8 (2026-10-23)Shadow only, no acceptance change. online (Features.Check.Strategy.
Online) runs today’s recheck as an untrusted search guarded and
checked by G0; its candidate is read back to problem variables
(Strategy.ReadBack: positions read directly, auxiliaries completed by
unification). Decide.Shadow assembles the shadow run’s Checking with
the production detector fixed (shadowChecking, shadowDecisions),
which the author’s required test pins on the real assembly path; a
substituted detector, or an accepting strategy added, is caught. Ruling
R3’s routing is enforced in Online.Ending, each kind named and
injected: confined kinds are SearchBroke and the next strategy still
decides; stopping kinds, a generation fault and a problem the program
does not record stop the run. RT8 over the pinned corpus (3,011
declarations; test/fixtures/r0/rt8.json, scripts/r0-rt8-pin.mjs): no
defect and no position finding after two fixes found by its first run,
a recorder defect (E17 typed a partial perform as its result; amended
to E5’s cases in generator and translator) and a read-back defect (P4’s
constructor-pattern slots); every other disagreement or decline with
today’s checker is an expected class, labelled. RT7: determination
reproduces all 48 auxiliary read-back values (E25, E26, E27, E28, P6).
Carries: holes are bound as today’s lowering binds them, so the
RequirementUnjudged backstop is not reached; zero fuel documented (a
question for the author); SearchHint and Question confirmed; Mgu’s
tailOf explicit. Ten mutants and six regression rows fail as
expected. Readings and evidence in findings, “The online strategy and
its read-back”. No fixture changed; no corpus re-pin; trusted-surface
pin unchanged. Fix round 1 (review I-1, I-2): the hole binding is
labelled provisional, pending the author’s ambiguity ruling; the
certificate lists the holes it bound and RT8 counts a Solved resting on
one as its own class (4 declarations; 118 bound a hole, listed in
rt8.json); RT8 tests RequirementUnjudged before the claim; the E17
and P4-slot amendments are marked pending the spec owner.
Shadow only, no acceptance change. substitutionWitness
(Features.Check.Strategy.Witness) turns a checked substitution into W
§1.6’s witness: every flexible variable bound, auxiliaries included,
each Inline (unchanged) or Free (a hole left to its default); the
online strategy witnesses σ before the read-back’s hole defaults, so a
default is judged, not taken as a binding. coverage is Cov: a
missing variable is NoWitness (Uncovered v), then W §1.5’s syntactic
hole contract (Strategy.HoleContract) gives NoWitness (HoleContract
v); route’s u defaulted to {} is refused, as W’s example says.
Domain.Verdict.Witness holds the types (amendments labelled in
findings). Seven tests seen failing first against a stub; eight
mutants and two regression rows (r0-cov-skipped,
r0-hole-contract-skipped) fail as expected. RT8 re-pinned: of 2,770
accepted candidates, 2,769 are witnessed and none misses coverage; one
Solved, r005b/render-quiet-annotated main, has no witness because the
check refuses a hole under a disjoint atom where {} would do (its
own class, listed). A read-back defect found on the way (row slot hole
read as a type) is BACKLOG R022, not fixed. Trusted-surface pin:
Domain.Verdict’s compiled exports gain Uncovered and HoleContract.
No corpus re-pin. Evidence in findings, “The substitution witness, Cov
and the hole contract”.
Shadow only, no acceptance change; follow-up to Tasks 4.3/4.4 on the
author’s ruling. The online read-back reads a row-sorted variable’s
bare hole as a row tail, { ...hole n }, as specialization reads an
unsolved record-sorted argument (Specialize/Values.purs slotType), so
R022’s probes (disjoint and lacks, inline in test/r0-r022-probes.mjs)
are no longer refused NotGeneric. Four production-path tests seen
failing first; the lacks/disjoint witness test now uses the read-back’s
σ. Under W §1.5’s literal check both probes are Solved with NoWitness
HoleContract. RT8 gains the probes as inline rows (3,017
declarations), re-pinned; no corpus row changed. Mutant and regression
row r0-readback-sort-blind fail as expected; r0-cov-skipped now
disables coverage alone. Review notes recorded: the author’s W §1.5
question (ruled), the Free-numbering risk (BACKLOG R023, open), the
contract’s rigid-as-Unjudged claim labelled argued, amendment 6’s
count. No corpus re-pin. Evidence in findings, “R022: the read-back
respects a variable’s sort”.
Shadow only, no acceptance change; the author’s ruling, as the reviewed
note docs/plans/r0-hole-contract-amendment.md states it. A lacks or
disjoint atom mentioning a hole is admitted when G0’s atom check
(Strategy.Atoms atomUnder, D’s listed facts, definedness) establishes
it at the defaults; otherwise NoWitness (HoleContract v), never a
contradiction. Equations and BQ unchanged. The note’s E1-E19 are
tests (11 seen failing first); seven mutants fail as expected; rows
r0-hole-equation-defaulted and r0-hole-arm-defaults-skipped. RT8
re-pinned: render-quiet-annotated main and R022’s probes are now
witnessed (bound-hole class 3 → 6), and no RT8 witness is refused.
Follow-ups R023 (an obligation for Task 6’s lowering) and R024 (Cov
has no genericity check). Evidence in findings, “The hole contract’s
lacks/disjoint amendment”.
Shadow only, no acceptance change; G-switch evidence that decides
nothing. test/r0-shadow.serial.test.mjs reads RT8’s run and pins, in
test/fixtures/r0/window.json, a row for each declaration whose class
today differs from R0’s as decided in shadow (1,024 of 3,021), with
today’s code and text, R0’s verdict, the window class, its §3.2 label,
Review Focus 1 class, target and dependency, and a summary in
declarations and programs: 245 compiling programs a live R0 verdict
would stop (251 with the erased-row boundary, 256 with the bound-hole
experiment). It reconciles with census.json and rt8.json exactly
(asserted). Option C’s list: the six D6 rows. Defect rows: FX030,
FX031, FX010, R005B placeholders, R020, FX032 (two inline probes).
Found on the way and fixed (test-only): the census walk reversed a
program’s arguments in place. No corpus re-pin (window.json has no
source). Evidence in findings, “The window table”. Fix round 1 (the
author’s rulings R-a, R-b1-4 and the task review): three stop
scenarios kept apart (245; +6 with the erased-row boundary; +5 if bound
holes were rejected); no refusal targets Contradiction by default
(undetermined pending classification); a known-valid class with cited
evidence (9 rows after fix round 2, c21, p10, p12, c22s, walk W1; f03
back to undetermined); option C lists 15 rows; section sources and
readings flagged; the online search’s no-candidate hint carries today’s
text as an untrusted hint (injected renderer); the pattern-slot arm
tested; FX032’s blind spot disclosed; BACKLOG R025 (double corpus
run).
Shadow only, no acceptance change; second shadow tranche. cxSpec
(Features.Check.Refute.Counter): an untrusted search over T-R0c §2’s
single-label instances, seeded by hints, shrinking a refuted sub-body
by one-at-a-time deletion; a check deciding CXChecked (withBody (toSig
P) body) rho through a port of Lean’s decideCall, minting nothing.
Registered as shadowRefuter cxStatement cxSpec in shadowChecking
(the controller’s ruling: not Program.Compile, R6). CX’s types in the
new Domain.Verdict.Counter. On T-R0c’s probes, 12 certificates, each
re-evaluated true by an independent bounded brute force; none on b03
or c01 (valid in §7.2). AT17: the window test re-run with the shadow,
7/7, no class moved. CX question 2: every corpus D is scoped (3,011
declarations, 444 with D). Question 3: a check enumerates 2^pairs
patterns; probes 0-3 pairs, under 0.2 ms; the corpus’s widest 13
pairs, about 220 ms. Corpus: 72 certificates, none on a declaration
today accepts. Mutants M1-M12 and (review fix round: both halves of
each key conjunct, backticked hint seeding) N1-N4 caught; regression row
r0-cx-hypothesis-skipped. refute/statements.md §8.1 holds the
evidence as a proposal pending its owner. No corpus re-pin. Evidence
in findings, “The CX refuter in shadow”.
Shadow only, no acceptance change (ruling R6). D1’s mechanism without
the generator port: Elab (applicative, no Bind) and Gen with
hidden constructors and nominal roles, seal, the Elaborating
newtype with requests, positionsOf and the seal check, Judged
minted by judgedDecision, and elaborate with covDomain; Task
4.4’s coverage takes its domain. Rules E1-E6 and S10 in
scripts/structure-modules.mjs and scripts/structure-elab.mjs, with
pinned export lists; holes moved to Features.Check.Holes. Effect rows
follow §12.1’s fallback (provisional controller ruling; options in
docs/plans/r0-ea-representation.md); Task 4.6 stays blocked. Tests
T3a, T3b, T3c (real purs), T4, T6, T7, T9, T10, T11, T11b; ten mutants
and five regression rows fail as expected. No pin changed (RT1, RT8,
window, census). 7.1b: the generator port and T1, T2, T5, T5b, T8,
T12. Evidence in findings, “D1’s generation continuation, part a”.
Shadow only; touches the trusted surface (Features.Check.Entailed).
Ill-sorted problems gave unsafe readings (re-review B-1, cases A1 and
A2), so Entailed exports wellSorted. reduction and the read-back’s
completion treat an ill-sorted problem as outside the fragment.
Fixtures A1 and A2 failed with the guard disabled. The differential
asserts every ill-sorted problem is refused. The guard fires on none
of 3,017 generated problems. Pins unchanged. Evidence in findings,
“R021 fix round 2”.
Shadow only; touches the trusted surface (Triangular, Mgu’s header). After the token review: Triangular keeps a monotone place counter, so a variable bound twice gets a later place (review I-1, test seen failing first). The equivalence claim now carries its precondition (well-sorted problems) in Mgu’s header, findings and an amendment to docs/plans/r0-entailed-ground.md “Binding”. It is checked by the committed differential test/r0-mgu-eager.test.mjs against a port of the eager unifier: 35,104 well-sorted fragment problems, 0 differences. The scale bound is 2,500 ms; a spine-arity test was added. Evidence in findings, “R021 fix round 1”.
Shadow only, no acceptance change. Features.Check.Entailed.Mgu keeps θ
in triangular form (Baader and Snyder’s dag solved form), reads each
equation through it when taken, compresses read images (as union-find
does) and takes R2 over a whole arrow spine. The new trusted module
Features.Check.Entailed.Triangular is listed in AGENTS.md,
docs/engineering.md and test/structure-trusted.test.mjs; Mentions gains
mentioned. openRequirements on generic(1000) 5,648 → 75 ms. The
answers are identical to the old unifier’s on 17,585 fragment problems
(scratch differential). test/r0-mgu-scale.serial.test.mjs was seen
failing on the old unifier; test/r0-mgu.test.mjs catches mutants
M1-M5. No pin changed; no corpus re-pin. Evidence in findings, “R021:
a triangular unifier for the BQ detectors”.
Test-only. test/r0-census-walk.mjs lists Ty’s leaf constructors and
throws on any other, as its expression walk does; a test seen failing
first injects every leaf and an unknown constructor. Census pin
unchanged. Evidence in findings, “The census type walk fails closed”.
Test-only. test/r0-shadow.serial.test.mjs decides the corpus once
(shadowRun) and registers RT8’s and the window’s assertions on it
from test/r0-rt8-checks.mjs and test/r0-shadow-checks.mjs; the RT8
serial file is removed. Pins, test names and messages unchanged; both
pin scripts reproduce their files byte for byte. Serial time for the
pair 105-107 s before, 57-62 s after. Evidence in findings, “R025: RT8
and the window share one run”.
Shadow only, no acceptance change (ruling R6). Task 3.2’s generator
runs over D1’s Gen and GenTy and builds, in each rule, a checked
declaration equal to today’s on the effect-erased projection only
(option c; corrected 2026-10-24, review P3-4: not effect-correct
checked IR): generate is seal of generateIn
(Generate.Body), and the recorded problem, problem of it, is
byte-identical on every corpus declaration (a digest pin taken before
the port). The shadow harness runs the seal check before decide
(shadowDecision). ClauseParamType joins CheckedName; two
generation faults (BinderShape, VariableSort). Effect positions
follow §12.1’s fallback; Task 4.6 and S7 (E-a) wait for the author.
T1: 1,989 Solved declarations elaborate. T2, effect-erased: build’s
IR equals the online certificate’s at all 1,989 and at 781 more
witnessed certificates (45 compared by site, 159 Amb sites
excluded). T5 (only §12.2’s two rows), T5b, T8 (118 hole-bearing),
T12, T3a’s harness half, T3c (vi). 18 mutants run, one survivor
(recorded); three regression rows. No pin moved (RT1, RT8, window,
census); trusted surface re-pinned. Evidence in findings, “D1’s
generation continuation, part b”.
Task 7.1b rebased onto the shadow hardening (r0-t2-hard): the docs
sections kept in date order; r0-shadow-run.mjs merged cleanly (hard’s
one decision pass with 7.1b’s problem in guardOf); hard’s guard and
scale tests read generate’s Elaborating. The review’s seven minors:
the problem pin covers RT8’s and the window’s inline probes (corpus
digests unchanged), N20 is killed by T4b, a builtin of another arity is
refused and never elaborated, T2’s by-site mode compares the signature,
the site walk fails closed, a rows-last property over Resolve, D1’s
families in the shadow-only check, and Shadow’s header. Evidence in
findings, “D1 part b: the 7.1b review’s minors”.
A fixture for the read-back’s own well-sortedness guard (m-4, seen
failing with the guard deleted); the corpus assertion covers BQ atom
types too (m-5: 3,017 problems, 7,607 atoms, 0 ill-sorted); the stale
Assemble.purs sentence reworded (m-6). Evidence in findings, “R021
follow-ups: hardening re-review 2’s minors”.
Authorized in dossier §18.74. R031’s two defects pinned as they stand (test/r0-r031.test.mjs). a-min statements written (docs/plans/r0-amin-statements.md) and adversarially reviewed: not ready (F1-F17, recorded in its §8; S1: marks unjudgeable, K2 row equations unjudged, no completeness claim for the effect obligations, coupling not tied to the problem or witness). Revision waits on the author’s rulings. No implementation. Verify at 2a94b33 (after the C001 pins): EXIT 0, 2,891/136/209. Verify at d7f30b0 (with R031’s pins; .build/verify-d7f30b0.log): EXIT 0; 2,893/2,893 parallel, 136/136 serial, 209/209 regression proofs.
Authorized in dossier §18.73. The eight C001 commits of branch c001-rulings-2026-10-23 (9da5fc7..391cb81, base 0710fa6) were cherry-picked onto r0-t2-d1 in order (d78d442..52f92d8; no conflicts, no merge commit); they bring the C001 rulings, arguments and the ten new baseline sources (a5, n7a, n7b, n7c, q1, q4, q7, r1, r2, s1) with their corpus-manifest and first-diagnostic entries. The existing 24 C001 sources stay. Every pin re-taken, each change only an addition from the ten (no existing program’s problem digest, window row, census entry or first diagnostic moved):
| Pin | Before | After |
|---|---|---|
| corpus programs (problems.json) | 988 programs, 3,021 problems | 998, 3,071 |
| census (census.json) | 1,128 programs, 984 resolved, 743 accepted, 3,011 declarations, 2,773 compiling | 1,138, 994, 751, 3,061, 2,823 |
| census: blocked accepted programs | 251 (245 without ErasedRow) | 256 (250) |
| RT8 (rt8.json) | 3,017 declarations; agree Solved 1,989; Outside DataApplication 563; Witnessed 2,776 | 3,067; 2,030; 572; 2,826 |
| window (window.json) | 3,021 declarations, 1,024 rows; agree Solved 1,980 | 3,071, 1,033, 2,021 |
| CX corpus (r0-cx-corpus) | 3,011 declarations projected | 3,061 (withD 444 and 1,393 D atoms unchanged) |
| T1/T2 (R028) | 3,011 generated; 1,989 judged; 14,775 images; Solved 1,989 compared, 1,944 exact; beyond 781 | 3,061; 2,030; 14,867; 2,030, 1,985; 790 |
Unchanged: T2’s by-site comparisons (45 declarations, 153 sites, 159
excluded), 118 hole-bearing declarations, and the corpus C2 check (5
Free bindings). All nine new window rows (n7a f, n7b f, q1
foldFrom and main, q4 both and main, r1, r2 and s1 main) are
one class: compiles today, R0 Unsupported Outside DataApplication.
All corpus comparisons stay effect-erased (G-effect-rows).
certify’s argument (2026-10-24)Authorized in dossier §18.73. The nine helpers the generator reads
(Features.Check.Holes, Walk, Implied, Tables, Functional, Nested,
NestedArguments, Components and Features.Resolve.Builtin) each have
hand-written logic a check or build rests on; they carry the marker
and join the lowering-boundary list. checkSubstitution is no longer
exported, so certify is the only way to a Valid; the online
strategy’s assurance is Pending certifySound, defined in
docs/plans/r0-certify-argument.md: C1 settle’s defaults are lowering’s
(Int; no tail), C2 the witness read with those defaults is the judged
σ, C3 unbound variables are the hole contract’s. New checks:
test/r0-certify.test.mjs (4) and a corpus C2 test (1,989 Solved
witnesses agree; 5 Free bindings, 2 row-sorted, so thin). The corpus
check’s first version read every Free n as a type hole and reported
the two row-sorted bindings; W §1.6 reads Free n at its variable’s
sort, and the helper now does. Trusted-surface pin moved
(checkSubstitution out, certifySound in), reviewed here.
First full verify at baa0f91 (.build/verify-baa0f91.log): 2,885/2,885
parallel; serial 134/135, the T003 timing test partialFirst at 937 ms
against 930 ms under external load (three quiet re-runs passed: 806,
871, 886 ms); verify stopped before the regression proofs. Second run
(.build/verify-baa0f91-2.log): 2,885/2,885 parallel, 135/135 serial,
208 of 209 regression proofs. The failure was R026’s: row
r0-hole-unbound mutated ReadBack’s settledBinding, which R026
removed when the hole defaults moved into certify, so its needle had
no target. The row now restores the same defect in certify (holes
judged unbound); it and r0-certified-split prove. R026’s own check
ran only the new row, not the whole suite, which is how this was
missed. Third run at d6ac71c (.build/verify-d6ac71c.log): EXIT 0;
2,885/2,885 parallel, 135/135 serial, 209/209 regression proofs.
After the repair review’s fixes (a1e591c, .build/verify-a1e591c.log):
EXIT 0; 2,887/2,887 parallel, 135/135 serial, 209/209 regression
proofs.
test/r0-elab-corpus.serial.test.mjs replaces its lower bounds with exact
pins, exclusions included: 3,011 generated declarations; 1,989 judged
Solved; 14,775 Inline images; Solved comparisons 1,989 (1,944 exact, 45
by site: 153 sites compared, 159 excluded for Amb); beyond Solved 781,
all exact; 118 hole-bearing. Every by-site declaration must compare at
least one site. The figures are unchanged by R026 and R029 (the run at
7a9fcc0 printed them). A re-pin needs the owner’s approval. These are
effect-erased comparisons: they do not establish effect-correct
checked IR (G-effect-rows).
E6’s re-export scan (scripts/structure-elab.mjs) removes block comments
before parsing imports and module headers, and reports any import it
still cannot read instead of skipping it; the real tree has none. The
FFI token scan (scripts/trusted-surface.mjs) builds its pattern from
tokenModules, so it covers all seven token modules, not two. The
effect-erased projection (test/r0-elab-erase.mjs) throws on an unknown
type constructor. Each part’s new test failed before its fix (E6: one
test, four near misses; FFI: Theorem.Internal unreported; erase:
undefined returned). structure, r0-elab- tests: 86 pass.
Elaboration sealed (2026-10-24)The review-required list now also names what certify rests on
(Strategy.Witness, Strategy.HoleContract, Strategy.ReadBack.Type,
Domain.Verdict.Certified and its Internal). A second list, the lowering
boundary, names the code that turns a Judged solution into checked
IR: Features.Check.Elaborate, Domain.Elaborating and its Internal,
Build and Types, Domain.Verdict.Judged and its Internal,
Domain.Verdict.Witness, and every Features.Check.Generate module. The
50 modules this adds carry the header marker; the pin test reads both
lists from AGENTS.md and docs/engineering.md and checks the marker in
every generator module from the source tree (a removed marker fails
it). Elaboration exports no constructor, so only elaborate makes an
Elaborated; foldElaboration reads it, its success case named
effectErased. Build clean; all 2,881 parallel tests pass.
Option A, ratified by the author. The whole-stack review showed the
online strategy’s check judged the certificate’s settled σ while the
witness was built from its pre-default σ, paired only by the untrusted
read-back; a forged pre-default σ for id2 was Solved and build gave
a Bool body under an Int result (.build/evidence/r026-before.log).
Now G0’s certify settles the pre-default σ, judges it and builds the
witness from the same σ, minting Certified (new token module
Domain.Verdict.Certified.Internal, importers: Domain.Verdict.Certified
and Strategy.Substitution). StrategySpec loses witness; check
returns Certified, so no strategy can pair a Valid with a witness
built elsewhere. The read-back and certificate no longer carry a
settled σ; tests derive it with the production settled
(r0-online-support.mjs settledOf). Holes stay Free.
New: test/r0-forged-witness.test.mjs (5 tests; the two forged-refusal
tests failed against the unfixed build, 2 of 4 at the time), a
Certified importer test in test/structure-r0.test.mjs, regression row
r0-certified-split (restored split detected: “id2 forged to Bool was
Solved”). Trusted-surface pin re-pinned: Domain.Verdict.Certified added,
Strategy.Substitution exports certify (reviewed here). Focused run:
all R0, structure and regression-runner unit tests pass.
An external review found that scripts/regression-pool.mjs marked success
as error: undefined, so a row whose prover rejected with no reason
(Promise.reject(), throw undefined) was counted as passed by
scripts/regression-run.mjs. Results now carry ok; the runner filters on
it. New tests: every kind of rejection (none, undefined, null, Error)
with a success before and after (test/regression-pool.test.mjs), and a
runner test where one row rejects without a reason
(test/regression-run.test.mjs). Both, and the updated order test,
failed against the old pool (3 of 9), and pass after the fix (9 of 9).
The real prover throws assertion errors, which carry a reason, so this
does not show that any earlier regression proof failed unnoticed.
Shadow only, no acceptance change; Task 4.4b’s review carry. The online
read-back applies a variable’s sort (R022’s readSorted) only at an
expression’s instantiation slot, where specialization applies it
(slotType); a named rest, a pattern’s slot and the other kinds read a
bare hole as a type, as lowering does. One test seen failing first (a
hole planted at a row-sorted rest); regression row
r0-readback-sort-everywhere. RT8 unchanged. No corpus re-pin.
Evidence in findings, “The read-back’s sort only at an expression
slot”.
decide (2026-10-23)strategy (Features.Check.Strategy) composes a spec’s guard, untrusted
search, trusted check and witness in that order; decide
(Features.Check.Decide, with Decide.Reason and Decide.Refuters) applies
T-R0a §5.3: rules 1 and 1′ (markers, a second spread, an injected
§3.2(a) detector) block Solved and make everything run; rules, then
strategies, then trusted refuters seeded with each hint alone, then
shadows; rule 3’s reason in the proposed order; BothVerdicts in
production under a block; rule 5’s test-only Checking differs by its
injected ends. A refused candidate, a RequirementOpen refusal and a
search’s own broken invariant never stop the run; a refused derivation,
two rules of one name and an Inconsistent search do (ruling R10).
Blame is derived from the premises’ paths. Budget, SearchHint and
CheckRefusal are defined (Domain.Verdict.Search), and
NoWitnessReason = NonConstructive …. AT7 holds over a fixed grammar
of 400 random worlds per property (its first run found a generator bug,
corrected); AT8, AT9, AT11, AT12, AT16 and AT17 pass; RT3 holds over
the corpus. Six mutants and four regression rows (r0-refused-stops,
r0-limit-hidden, r0-marker-ignored, r0-shadow-decides) fail as
expected. Trusted surface re-pinned (Domain.Verdict, Refute.Rules).
Nothing reachable from compile changed behaviour; no fixture changed;
no corpus re-pin. Evidence and fourteen labelled readings in findings,
“Strategies and decide”.
RT1’s independent translator (T-R0b §9 item 1), written from T-R0b
alone before the generator (Task 3.2) exists: test/r0-translator.mjs
and its modules (-context, -types, -signature, -calls, -exprs,
-effects, -records) read resolved syntax from the compiled output and
return each declaration’s problem in canonical form. Test-only code;
the compiler is unchanged. Ruling R9: test/r0-canonical.mjs (with
-decode) is the one canonical serialization (canonicalOf,
encodeProblem, entryMultiset, compareVar, outOfOrder), with
the canonical order of record fields and tails, vars and types
stated in it. Rule-level tests (r0-translator-signature, -calls,
-forms, -records, r0-canonical: 40 tests) cover Sig1-Sig10, E1-E28 and
P1-P7; a serial corpus test checks totality, vars closure,
canonical order, rule coverage and marker kinds (LocalGeneralization
exempt, R11). Ten mutants, each killed. The comparison (steps 4-5)
and B13 wait for Task 3.2. T-R0b’s open choices are fixed as stated
readings and recorded as findings, “RT1’s translator”. No fixture
changed, no corpus re-pin. Fix round 1: the reading list (the shared spec
reading for Task 3.2) now matches the code: E5/E6 markers after their
equations, E16’s item path, P4’s Slot gap, every row and origin
kind; every Domain.Recorded constructor injected in the canonical
test; strict record order.
Features.Check.Generate (new) records each resolved declaration’s
problem, syntax-directed: T-R0b’s Sig1-Sig10, E1-E28 and P1-P7 in
Generate.Signature, .Call, .Expr, .Operator, .Control, .Record,
.Builtin, .Effect, .Failure and .Pattern, over a builder
(Generate.Inputs generationInputs) of the tables and signatures.
Test-only: compile does not call it, and today’s diagnostics are
unchanged. Its export list is generate, staticRules, Tables,
Signatures (ruling R2). The applicative invariant holds by
construction (a rule reads only the context and its children’s
results) and by a tested import rule (no checker state is reachable).
The shared readings of “RT1’s translator” are followed; the path-step
vocabulary and the choices they leave open are stated in findings.
HandlerHead takes an EffectRef, so Handler(Console) has a head.
staticRules (Generate.Static.Rules; amendment: it also takes
Signatures) finds the class-a sites check raises and agrees with
today’s checker on each; every Problem constructor has a typed
disposition (Generate.Static.Problem), StaticCode gaining four
Resolve codes after Domain.Verdict’s static types moved to
Domain.Verdict.Static. Trusted surface re-pinned (Domain.Verdict’s
moved exports; 22 new Generate modules). Tests: rule-level fixtures
for every rule, RT5-RT7 on each, and a serial corpus test (973
programs, 2,958 declarations). Twelve mutants, each killed. No fixture
changed, no corpus re-pin. Evidence in findings, “Generation rules”.
Fix round 1: the fail payload’s step is Fail/payload; a missing
lookup, unbound local, payload-less clause or result syntax is a
GenerationFault (generate and staticRules return Either,
mapped to Internal TableLookup/InputShape; amendment); entries at
result carry the written result type’s span; the import-invariant
sentence corrected. Trusted surface re-pinned (Generate.Fault).
User review revisions: FN001 is scheduled after P001 before C001/R001/ FX001; C001/R001 require joint design review of ordinary record instances. Documented row-specialization key/code growth and dictionary/accessor passing as an option needing an ADR, not a chosen fallback. Lowered IR’s default to test is after specialization, above layouts. D001 records text, numeric and collection foundations; M001 remains required for shared modules. Rust pragmatics are explicit; FX001 compares ZIO-like computations and Koka-like effect rows/handlers. All five review points addressed in the direction document and backlog/handoff. Current P001 worktree untouched.
Fresh npm run verify on main exited 0: 162 tests, zero failures/skips,
zero build warnings/errors, gates, strict rebuild proof and eight isolated
regression proofs. Raw log: .build/language-direction-review-verify.log.
Documentation only; these milestones remain unimplemented.
User requested a local commit of the current language/backend/effect discussion using the planning guidance. Read brainstorming/writing-plans; recorded docs/plans/2026-10-08-language-direction.md as direction and hypotheses, not an implementation spec. Goals, early-release deferrals, row/service scenarios, effect-design questions, inspectable IR and future targets are separated from assistant recommendations and open decisions. Backlog follow-ups FX001 (effect design), L001 (lowered IR direction) and J001 (JavaScript evaluation direction); P001’s approved scope/order intact. README, bootstrap index, next-session, findings and provenance linked. Self-review checked scope, status, references and distinction between proposed acceptance scenarios and implemented behavior. Documentation only.
Fresh npm run verify on main exited 0: 162 tests, zero failures/skips,
zero build warnings/errors, formatting/style/layer gates, strict rebuild
proof and eight isolated regression proofs passed. Raw evidence:
.build/language-direction-verify.log. Existing .vscode/settings.json edit
excluded from this change. No feature implemented and no push authorized.
2026-10-07. The language is renamed from Sprig to Bumpus (A003 Task 3a). Dated
evidence below keeps literal historical identifiers (old module names such as
Sprig.Check, sprigCmpN-style Go helpers, old command lines, .sprig paths
and log names) verbatim because they name artifacts that existed; the prose
language name changes.
2026-10-07. The completed documentation/style audit is merged into main through 1f760af. Fresh review found no blockers; merged verification passed. Baseline 9624bec is preserved in history. Audit branch/worktree removed after retaining their evidence. Task 1 commit: 4410609. No publishing or push. The audit plan is docs/plans/2026-10-07-bootstrap-audit.md.
The following evidence was recorded before skill installation/execution; new worktree evidence follows below. Earlier raw logs are in the original checkout, not assumed to exist in the isolated worktree.
node scripts/verify.mjs (same implementation as npm run verify) completed
with zero source warnings/errors, strict/pedantic workspace builds, 19 passing
Node tests, no skipped tests, and a successful isolated regression proof.
Recent raw output is in ignored .build/verify.log; this summary survives it.
42.A clean-output npm run verify passed, followed by a final successful run
after the formatter-version, cache-portability, unsafe-import, and malformed
negative-literal fixes. Final log: .build/verification-final.log (exit 0).
The MileAhead patch passed git apply --check against the read-only reference.
Online installation and cross-platform execution remain unverified.
PureScript compiler: src/{Domain,Features,Format,Program}/*/.purs and src/Domain/IR/Internal.purs. Boundary: src/Runtime/Node.purs and Node.js. Style tooling: tools/style/src/Style/Check.purs (separate package). Tests: test/*.test.mjs and the regression witness/script. Example, three negative files, and bootstrap/answer.go (example snapshot). Documentation: README, AGENTS/CLAUDE, plan, findings, architecture, language, provenance, ADRs, engineering guidance, bootstrap roadmap, and local backlog.
Local integration is complete; proceed to a separate bounded ADT design/plan. Closed ADTs/exhaustive matching require a separate later design and plan. F001 (fresh compiler-tool setup), F002 (unapplied external patch), E001/E002 and E003 remain explicit.
Historical installation steering: install skills, migrate, then plan the run. 15 skills installed project-locally via bunx at the revision in skills-lock.json; list command confirmed Codex/project scope. The unfinished audit is migrated to docs/plans/2026-10-07-bootstrap-audit.md with a durable historical ledger. At migration, no audit task or feature had run and Git had no HEAD. User subsequently approved inline execution/checkpoint/worktree. W001 is resolved; prior compiler evidence above is preserved.
Fresh migration validation: npm run verify on 2026-10-07 exited 0.
Strict/pedantic build reported zero source/library warnings and errors;
formatting and architecture/CST gates passed; 19 tests passed, zero failures
and skips; isolated restored branch-check defect failed as required while
the fixed compiler passed. Output was read from this session’s command output,
not saved to a new raw log. This validates the preserved compiler after the
installation/migration; it does not complete the pending documentation/style
audit or represent a clean-output rebuild in this session.
User approved checkpoint, isolated worktree, inline execution and final fresh review. Checkpoint 9624bec is on main; audit/bootstrap-docs runs in .worktrees/bootstrap-audit. Clean-output baseline compiled 269 modules with zero source/library warnings/errors, then passed 19 tests and the isolated regression proof. Raw evidence: worktree .build/audit-baseline.log.
| Review focus | Source and evidence | Result/limit |
|---|---|---|
| Setup claims | README; scripts/build.mjs/cache.mjs; baseline log | Cached dependency build verified from clean compiler output. Fresh PATH-tool install/cross-platform setup remains F001. |
| IR boundary | Check/IR.Internal/Go; structure.mjs; layer test | Only checking/lowering imports internal IR in source. Checker validates encountered local/call indices; forged entry/table structure is trusted and documented. |
| Automated vs manual style | Style.Check; structure.mjs; style/structure tests | Essential CST/import/format/line gates pass. Manual fallback/callback/branch issues corrected; ten-arm (now twelve; see BACKLOG E003) tag mapping target exception recorded as E003. Full lint automation stays E001. |
| Snapshot/seed | bootstrap/answer.go; compiler snapshot assertion; docs/bootstrap.md | Example bytes match canonical emission; Stage 1 compiler seed remains proposed. Stage 0 source and locks preserved in baseline. |
| Handoff/external edit | patch; planning-skills; backlog; migration ledger | Skills installed and real BASE created. MileAhead patch remains unapplied (F002); current execution status is synchronized in Task 2. |
Style-only refactors preserve the existing public source-language contract. The passing pre-change suite is the baseline; post-change verification and existing isolated mutation establish continued behavior. No synthetic RED history is asserted for documentation or helper extraction. ADRs 001/002 are unchanged: no semantic/representation decision changed in this audit.
Task 1 post-change npm run verify exited 0: strict/pedantic build with zero
warnings/errors, all gates, 19/19 tests and isolated branch mutation proof
passed. Raw evidence: .build/audit-task-1-green.log. The earlier accidental
IR alias edit failed the same build; its copied defect also failed compile
in isolation. docs/findings.md retains the complete failed-attempt account.
Handoff files now identify the real baseline, audit branch, completed tasks and final fresh review. Historical no-HEAD/no-commit statements are labeled as historical. Review is complete; final completion verification is recorded below. No ADT source or plan was added.
Task 2 pre-review npm run verify exited 0 on 2026-10-07: zero strict-build
warnings/errors, 19/19 tests with no skips, style/layer gates and regression
proof passed. Raw log: .build/audit-task-2-pre-review.log in the audit worktree.
Fresh reviewer inspected 9624bec..56cbde1 read-only: no Critical/Important findings. Two pre-existing test-title inaccuracies are deferred as E004; no assertions were changed. Full review and exhaustive scope rulings are saved in docs/plans/bootstrap-audit-review.md and bootstrap-audit-ledger.md. The server restart interrupted delivery; the same reviewer resumed, avoiding a second review or repeated implementation.
Two separate actual CLI emit invocations produced byte-identical output, also equal to bootstrap/answer.go (cmp checks succeeded). The preserved MileAhead patch again passed git apply –check without being applied. Stage 0, locks, tests, example bytes and pure boundaries remain preserved. ADR 001/002 remain unchanged. At audit closure no language feature, merge, push or publication had occurred.
Raw failure evidence retained outside executor scratch: .build/audit-task-1-failed-alias.log, .build/alias-regression/failure.log, and .build/audit-task-1-fixed.log (the failed reproduction-helper attempt). Successful raw evidence: .build/audit-baseline.log, audit-task-1-green.log, audit-task-1-completion.log, and audit-task-2-pre-review.log in .build.
Final closure npm run verify exited 0 on 2026-10-07: strict/pedantic build
zero warnings/errors; 19/19 tests, zero skips; format/CST/layer gates and
isolated branch mutation proof passed. Raw final log: .build/audit-final.log.
Tasks 1/2 and original bootstrap tasks 7/8 are complete; no blocking review
finding remains. E004 minor titles are intentionally deferred. Integration into
main was still pending at that checkpoint; it is now
complete as recorded below.
The installed task-done helper also verified Task 2 after commit f27b499: 19/19 tests, zero skips, strict build/gates/regression proof passed; commit range 4410609..f27b499 is recorded in the durable ledger. Raw completion log: .build/audit-task-2-completion.log. Executor scratch was copied in full to .build/audit-executor-evidence before cleanup; durable ledger/review remain committed in docs/plans. Only local branch integration is pending.
User explicitly approved merge. Main fast-forwarded 9624bec..1f760af;
npm run verify on the merged checkout exited 0 on 2026-10-07: zero strict
warnings/errors, 19/19 tests, zero skips, formatting/CST/import gates and
isolated regression proof passed. Raw log: .build/merge-verification.log.
Audit raw logs, emitted files, isolated rename-defect copy and executor artifacts were preserved under .build/merged-audit-evidence before removing the merged audit worktree and branch. Historical worktree .build paths above now resolve under that archive. Original checkout logs were not overwritten. Durable ledger/review remain in docs/plans and all audit commits stay in main. The pre-existing .vscode/settings.json spell-check additions are preserved uncommitted. No push or publication occurred.
2026-10-07: brainstorming for closed ADTs and exhaustive matching. User chose recursive types, nested patterns with Maranget usefulness, type/match brace syntax, tagged value-struct representation and sequential first-match lowering. User review added CtorId identity, nil-guarded projections, inhabitedness, canonical witnesses and two-pass type resolution. Approved spec: docs/plans/2026-10-07-closed-adts-design.md. Documentation only; no compiler source changed, so no verification run is claimed for this step.
2026-10-07: spec approved and committed (1d71f2f). writing-plans produced docs/plans/2026-10-07-closed-adts-plan.md: five tasks (syntax; types and construction; patterns and match; coverage; docs and review). Plan-time spec amendments: E_DUPLICATE at the first duplicate (Stage 0 rule), depth-named match parameters, and the Float row moving from E_SYNTAX to E_UNBOUND. Documentation only; no compiler source changed.
2026-10-07: closed-ADT Task 1 (syntax) done. Added |{} and => tokens,
reserved type/match/_, TypeRef, Parse.Declaration and Program dispatch;
Resolve maps NamedRef to E_UNBOUND transitionally. New test/adt-syntax.test.mjs
(7 tests) failed against pre-change source, then passed. npm run verify
exit 0 (26 tests, regression proof, answer.go unchanged).
2026-10-07: closed-ADT Task 2 (types and construction) done. Ty moved to
Resolved
with TData; two-pass type table, shared global table, Construct through Check
and Go (Go.Data). test/adt-types.test.mjs (6 tests) failed before the change
(unbound-type errors), then passed. npm run verify exit 0 (32 tests,
regression
proof, answer.go unchanged).
2026-10-07: closed-ADT Task 3 (patterns and match, no coverage) done.
Parse.Literal
and Parse.Pattern, Resolve.Pattern with pre-order LocalIds, Check.Match,
Go.Match
(depth-named IIFE, nil-guarded projections); examples/shapes.sprig with snapshot
bootstrap/shapes.go. test/adt-match (12) and test/adt-properties (1) failed
before
the change (match was E_SYNTAX), then passed. Regression proof is a table:
branch
and new nil-guard both fail on their mutants. npm run verify exit 0.
Fix round 1: pattern-constructor arity moved from Check.Match into
Resolve.Pattern (E_ARITY in pattern pre-order, before body and later-function
errors); two new rejection rows failed before (E_UNBOUND) and pass after.
npm run verify exit 0.
2026-10-07: closed-ADT Task 4 (coverage) done. Check.Usefulness (inhabitation
fixed point, U(P,q), algorithm I) and Check.Coverage (E_REDUNDANT,
E_NON_EXHAUSTIVE with canonical witness) run after checking; test/adt-coverage
(6) and test/coverage (300-case oracle) failed before (non-exhaustive programs
compiled), then passed; regression row exhaustive fails on its mutant. No
existing test program changed. npm run verify exit 0 (52 tests, three
regression proofs).
2026-10-07: closed-ADT Task 5 (five layers) done. Modules moved to
Domain/Features/Format/Runtime/Program with git mv; Token, isUpper ->
Format.Lex, codeName -> Format.Diagnostic; scripts/structure.mjs per-module
table replaced by layer rules, four new structure cases failed before the gate.
bootstrap/answer.go and shapes.go cmp identical, no stale Sprig./Shell. names.
npm run verify exit 0 (52 tests, three regression proofs).
2026-10-07: closed-ADT Task 6 (structured diagnostics) done. Domain.Problem
holds Problem/TypeName/Witness data; Features build no text; Format.Diagnostic
code/message/wire render it, Program.Main uses wire. test/diagnostics
characterization (39 families) passed at HEAD and unchanged after; its
message/wire assertions failed before (no Domain.Problem); the R5 invalid-TypeId
case compiled at HEAD returned Right (vacuously complete) and is now E_INTERNAL.
Coverage table lookups split into Features.Check.Signature. bootstrap/answer.go
and shapes.go cmp identical. npm run verify exit 0 (55 tests, three regression
proofs; exhaustive mutant now const (const (Right Nothing))).
2026-10-07: closed-ADT Task 7 (capability ports) done. Domain.Host ports over
abstract m; Format.Arguments (argv, usage text) and Format.Wire
(plain/source/tool wire shapes); Program.Command over any Host; Runtime.Node is
port implementations plus argv/stdout/stderr/exit and JSON only.
test/program.test (9 fake-host cases) failed before (no Program.Command), then
passed; two new structure rows (Program.Command importing Effect/Runtime) failed
before the gate. Old/new CLI stdout, stderr and status byte-identical on 15
probes (usage, E_IO read/write, E_TYPE, E_TOOL with PATH=’’ and bad -o,
emit/build/run); no temp dir leaked. bootstrap/answer.go and shapes.go cmp
identical. Clean rm -rf output && npm run verify exit 0 (64 tests, three
regression proofs).
2026-10-07: closed-ADT Task 8 (documentation and closure) done, review step
excluded by controller ruling R6. Wrote ADRs 003 and 004; rewrote
docs/language.md and docs/architecture.md; updated engineering, provenance
(Maranget JFP 2007; MileAhead layers, conceptual only), README, BACKLOG (A001
Done; A002-A005, F005 added; E003 and F004 current), plan index and
next-session. Clean rm -rf output && npm run verify (.build/a001-final.log):
exit 0, 64 tests, 0 skips, regression proofs branch, nil-guard and exhaustive
all passed. Two CLI emits of examples/shapes.sprig byte-equal each other and
bootstrap/shapes.go; examples/answer.sprig emit equals bootstrap/answer.go
(cmp). $TMPDIR still holds the same four stale sprig-regression-* directories
after the run (F005). Final whole-branch review is run by the controller.
2026-10-07: A001 final whole-branch review findings fixed (record
docs/plans/closed-adts-review.md). Function/constructor clashes report at the
earliest declaration by source offset (new adt-types case failed before the fix
at offset 26, passed after; .build/a001-review-minor3-red.log, -green.log).
specialize and checkCtor return E_INTERNAL on field-count mismatch; the new
diagnostics test fails with either change reverted in an isolated copy
(.build/a001-review-isolated-red.log). Coverage oracle now requires witnesses to
cover only unmatched values and checks brute-forced inhabitedness over 120
generated type systems (an inhabitedness mutant fails it:
.build/a001-review-inhabited-mutation.log); 8 generated flat 3-5-arm matches run
in Go (an arm-reordering mutant fails them:
.build/a001-review-flat-mutation.log). verify.mjs runs every test/*.test.mjs (an
unlisted failing dummy made verify exit 1:
.build/a001-review-unlisted-probe.log). Clean rm -rf output && npm run verify
(.build/a001-review-fix.log): exit 0, 0 warnings, 13 test files, 68 tests, 0
skips, regression proofs branch, nil-guard and exhaustive passed. CLI emits of
examples/answer.sprig and examples/shapes.sprig equal bootstrap/answer.go and
bootstrap/shapes.go (cmp). $TMPDIR still holds four stale sprig-regression-*
directories (F005).
Reproduced in an isolated copy: with a shadowed name added to Domain.Host, the
first node scripts/build.mjs failed with ShadowedName and the second exited
rm -rf output && npm run verify (.build/f004-verify.log) and the following
incremental npm run verify (.build/f004-verify-incremental.log) both exit 0:
0 warnings, 68 tests, 0 skips, strict rebuild proof and regression proofs
branch, nil-guard and exhaustive passed. The main item of the milestone is
not yet chosen.User chose A003 with print, equality and ordering. Design direction approved with five clarifications (E_ENTRY keeps missing-main and parameters; round trip recompiles with original declarations and checks structural equality via the interpreter; ordering mutations must fail an oracle or explicit-order assertion, with separately built equal values; nil-field panic rule scoped to visited fields; Bool helper only when needed). Written spec: docs/plans/2026-10-07-adt-printing-design.md, approved by the user. Plan: docs/plans/2026-10-07-adt-printing-plan.md (4 tasks), awaiting review. Documentation only; no compiler source changed.
Operator/Compare through lexer, parser (non-chaining, looser than +),
resolver, checker, coverage and Go lowering; Bool ordering lowers through
sprigCmpBool, emitted only when used. New test/compare.test.mjs (6 tests:
runs, positions, rejections, left-to-right evaluation trace, helper
presence, answer.go unchanged); the old “lone > is E_LEX” test now pins a
lone !, and the branch regression needle gained context so it stays
unique. npm run verify exit 0; bootstrap/answer.go and shapes.go
unchanged.sprigCmpN helper per declared type (tag range check, constructor order,
fields left to right, nil check before a declared field), emitted in
TypeId order; declared comparisons lower to (sprigCmpN(L, R) op 0);
sprigCmpBool is also emitted for any Bool constructor field. New
test/value-oracle.mjs (reference order, printer, parser, alternate
expressions) and test/adt-order.test.mjs (7 tests, all red before the
change: hand cases, structural equality, 8192-element lists, uninhabited
type, malformed values, evaluation trace, 8-seed oracle agreement with
order laws and coverage assertions). Regression rows ctor-order and
first-field fail with their defects restored; their probes run Go under
.build/regression. bootstrap/shapes.go gains only sprigCmp0; answer.go
unchanged. The compiler’s ~3500-character stack limit was recorded under
E002. npm run verify exit 0.main): EntryResult is
gone and a missing entry reads Expected fn main(); main may return any
type. New Format.Go.Show emits one sprigShowN(out []byte, v sprigTyN)
per declared type in TypeId order (cases built from the constructor
table, fmt.Append for Int/Bool fields, nil check before declared
fields, unknown tag panics bumpus: malformed value); a declared main
prints string(sprigShowN(nil, sprigFnK())). The shared panic text moved
to Format.Go.Data. New test/adt-print.test.mjs (7 tests, all red before
the change: hand prints, Int/Bool unchanged, entry rules, 8192-element
list print, malformed panics, 8-seed print round trip, tree snapshot);
diagnostics and adt-types E_ENTRY rows updated per Global Constraints.
Regression row show-fields fails with its defect restored (printed
value lost fields: Cons(1)). New examples/tree.sprig and
bootstrap/tree.go; shapes.go gains only sprigShow0; answer.go
byte-identical. npm run verify exit 0.npm run build rewrote spago.lock (packages
bumpus, bumpus-style); bootstrap/answer.go, shapes.go and tree.go regenerated
by the CLI each equal the old bytes under
sed s/sprig/bumpus/g;s/Sprig/Bumpus/g (cmp, exit 0). New
docs/assets/bumpus.svg. npm run verify exit 0.tailRecM loop (Control.Monad.Rec.Class, tailrec
now a direct dependency; spago.lock gains it), Format.Parse.declarations
is a tailRecM loop, Format.Parse.Core reads tokens by index, and
Format.Stack makes accumulation linear. Two quadratic resolver costs the
20,000-declaration test exposed were fixed: globals are built once, and
function-name duplicates use a sort (Features.Resolve.Repeated). New
test/large-source.test.mjs (5 tests: megabyte padding, 20,000
declarations run in Go, E_LEX at offset 1,000,020, megabyte lex under 5 s,
duplicate among 20,000) all failed on the old code with heap exhaustion
(.build/task3b-red.log); now 0.09 s, 2.2 s, 0.26 s, 0.07 s, 0.08 s. The
structure allowlist admits exactly Control.Monad.Rec.Class (new structure
test red first). Coverage-oracle choose reads the LCG’s high 16 bits (a
new test showed 80 two-way draws alternating 0101…); seed-dependent
preconditions then failed (adt-order seed 22: one T0 constructor,
adt-print nested), so seeds were reselected, assertions unchanged.
Dropping the backward neighbour check in Repeated fails the diagnostics
and large-source duplicate tests in an isolated copy. bootstrap/*.go
unchanged. npm run verify exit 0, 17 files, 96 tests, 0 skips
(.build/task3b-verify.log).
2026-10-07: logo. The README shows assets/branding/bumpus-logo.png (1254 ×
1254 PNG with alpha, a bluetick coonhound with the stolen turkey above the
wordmark), chosen by the user from image-generator candidates; provenance and
final prompt in assets/branding/README.md. The Task 3a SVG icon was removed at
the user’s request; no earlier image versions are kept. Documentation and
assets only.uniqueTypes/uniqueCtors, new T001), findings and
next-session updated; each claim was checked against src/ and test/.
rm -rf output && npm run verify exit 0, 0 warnings, 17 files, 96 tests,
0 skips, strict rebuild proof, six regression proofs (branch, nil-guard,
exhaustive, ctor-order, first-field, show-fields)
(.build/a003-final-verify.log). CLI emits compared with cmp (exit 0):
examples/answer.bumpus to bootstrap/answer.go, shapes.bumpus to shapes.go,
tree.bumpus to tree.go, and tree.bumpus a second time to tree.go. A003 is
In review; Done follows the final whole-branch review.cmp of the CLI emits of examples/answer,
shapes and tree against bootstrap/*.go (exit 0) and 504 programs emitted
identically by b5dde4e and the fix. Tag-3 compare case fails under an
emitted .tag > count+1 mutant. adt-order runs one Go program per seed.
E002, language.md, ADR 005 and architecture.md corrected (I1, I2); G001
added; A003 Done. rm -rf output && npm run verify exit 0, 0 warnings,
17 files, 98 tests, 0 skips, six regression proofs
(.build/a003-review-fix-verify.log).
Follow-up: the final test/large-source.test.mjs run against a b5dde4e
build fails both new tests on their 5 s bounds (types 25.9 s, duplicates
21.8 s). Remaining per-reference name scans (resolveType, findGlobal)
measured at 1.7 s for 20,000 references and recorded in E002 for G001.User approved the merge. main fast-forwarded 74e5c2a..4b5ce2e. Clean
rm -rf output && npm run verify on main exited 0: zero warnings, 98 tests,
zero failures/skips, strict rebuild proof and six regression proofs
(branch, nil-guard, exhaustive, ctor-order, first-field, show-fields). Raw
log: .build/a003-merge-verify.log. Worktree .build logs and the SDD ledger
were archived under .build/merged-a003-evidence before the a003 worktree
and branch were removed. No push. Next: G001 (design first).
User chose an applicative-only parser (no Monad instance) and a depth limit with a structured diagnostic for deep nesting (over a larger Node stack or heap-based phases). Written spec: docs/plans/2026-10-07-applicative-parser-design.md, approved as written with clarifications (section 7). Documentation only; no compiler source changed. Plan: docs/plans/2026-10-07-applicative-parser-plan.md (5 tasks), awaiting user review.
npm run verify exit 0, 101 tests, 0 failures/skips
(.build/g001-task1-verify.log); emits of answer, shapes, tree cmp-identical
to bootstrap/*.go.spanned
is an empty span when nothing is consumed; Functor map is direct. New CST
rule: no do, >>= or =<< in Format.Parse and
Format.Parse.{Literal, Pattern, Expression, Declaration} (Grammar, Cursor
exempt). RED: 1,536 constructors, 1,536 fields and 1,793 arguments
RangeError (.build/g001-task2-red.log), style fixture failing
(.build/g001-task2-style-red.log), empty spanned failing in an isolated
copy (.build/g001-task2-spanned-red.log); GREEN 15 ms, 7 ms, 56 ms
(.build/g001-task2-green.log). fn main(): Int = (1 keeps E_SYNTAX
“Expected ‘)’” at 19-19. Parser lines 889 -> 685 (no module grew).
npm run verify exit 0, 112 tests, 0 failures/skips
(.build/g001-task2-verify.log); answer, shapes, tree emits cmp-identical
to bootstrap/*.go. Cold-CLI nesting depth moved (BACKLOG E002).nested,
infixed, rooted and nestingLimit in Format.Parse.Grammar, depth and
peak in the Cursor state; operators count the depth of the tree they
build, so a deep left operand counts in full; Grammar foldAt runs the
first item directly. Probe (scripts/depth-probe.mjs, limit disabled):
smallest overflow 304 (Cons(1, ), no anomalies after classifying V8’s
regex Stack overflow SyntaxError as an overflow; limit = largest power
of two ≤ 152. RED: test/depth.test.mjs 14 of 26 failing, no E_NESTING
(and go build killed on 128 nested match arms, BACKLOG E005)
(.build/g001-task3-red.log); diagnostics E_NESTING row failing with the
limit disabled; GREEN 26/26 (.build/g001-task3-green.log). npm run
verify exit 0, 138 tests, 0 failures/skips (.build/g001-task3-verify.log);
answer, shapes, tree emits cmp-identical to bootstrap/*.go.fresh,
failure, liftEither, runFresh); arms, arguments and pattern fields
via balanced traverse; Numbered dropped from Domain.Resolved.
Characterization (test/adt-match.test.mjs LocalIds row) recorded from and
passing on the old compiler, failing when arms are numbered before the
scrutinee in an isolated mutant. New: 10,000 binding arguments compile in
about 1 s (test/large-source.test.mjs; RED RangeError on the old resolver,
.build/g001-task4-red.log). Differential over 1,327 distinct sources
compiled by the suite: all identical Go or diagnostics except that row.
npm run verify exit 0, 140 tests, 0 failures/skips
(.build/g001-task4-verify.log); answer, shapes, tree emits cmp-identical
to bootstrap/*.go.tailRecM); specialize checks arity
once, then mapMaybe; parameter duplicates use Repeated. Corrected
thresholds: the coverage overflow was about 1,929 arms (not 3,000), the
pre-G001 resolver overflowed near 1,700 arms or arguments (not 5,000).
RED on the pre-fix compiler (.build/g001-task4b-red.log): 5,000 integer
arms and 3,000 constructors RangeError, 20,000 parameters 3.07 s;
per-site mutants (each foldM restored alone, quadratic uniqueParameter,
reversed Fresh apply for the strengthened 10,000-argument order test)
each fail. GREEN (.build/g001-task4b-green.log): 5,000 arms 1.3 s,
3,000 constructors 1.3 s, 20,000 parameters 0.17 s; still quadratic in
arms (10,000 arms 5.2 s, BACKLOG E002). npm run verify exit 0, 144
tests, 0 failures/skips (.build/g001-task4b-verify.log); exhaustive
regression row holds; answer, shapes, tree emits cmp-identical to
bootstrap/*.go.state-thread
(scripts/regression.mjs, probe in test/regression.mjs): Grammar’s apply
running the second parser from the original state makes
examples/answer.bumpus fail with parser state not threaded (E_SYNTAX
“Expected an identifier” at 1:1; .build/g001-t5-state-thread-mutant.log);
the healthy compiler emits bootstrap/answer.go. CST gate closed
(tools/style/src/Style/Parser.purs): productions also reject bind,
join, discard (plain, qualified, backticked), >=> and <=<, and
only Format.Parse (and Grammar) may import run/initialState; open,
as-only and hiding imports of Grammar or Cursor are rejected. RED: 2 of
8 style tests failing (.build/g001-t5-style-red.log); the positive
fixture fails with the importer exemption removed, in an isolated copy
(.build/g001-t5-style-positive-mutant.log); GREEN 8/8
(.build/g001-t5-style-green.log). Measured at the CLI: a 129-operand flat
sum compiles and 130 is E_NESTING; a 128-element printed list compiles
and 129 is E_NESTING. Docs: language.md (nesting rule, E_NESTING), ADR
005 and 006, architecture.md, engineering.md, findings, README,
next-session; BACKLOG G001 In review, E002 restated, E005 options left to
the user, new O001, H001, F006 (stale output of deleted modules,
recorded, not fixed). rm -rf output && npm run verify exit 0, 20 files,
147 tests, 0 failures/skips, seven regression proofs
(.build/g001-task5-verify.log); answer, shapes, tree emits cmp-identical
to bootstrap/*.go. Final whole-branch review pending.Stack in tailRecM;
I2: inhabitation is a worklist (new Features.Check.Inhabited, lookups in
Features.Check.Tables), and Array.modifyAtIndices is chunked after the
20,000-type test overflowed in it. RED on the pre-fix compiler: all four
test/coverage-scale.test.mjs cases RangeError (5,000-field exhaustive,
non-exhaustive witness and redundant arm; 10,000-type chain after 9.9 s)
(.build/g001-final-fix-red.log); GREEN 0.27-0.36 s, 0.08 s, 0.05 s,
0.64-0.69 s. Remaining cliffs measured and recorded in BACKLOG E002 (4),
(5). M1: the Bind gate also rejects ap, ifM, whenM, unlessM, liftM1,
bindFlipped, composeKleisli, composeKleisliFlipped (style fixture failed
first on ap); M2: test/depth.test.mjs imports nestingLimit; M4: ADR
006 gives the exact uncommitted probe steps; M5: O001 notes. M3: accepted
that src/Format/Parse/Literal.purs grew 51 -> 55 lines, all of it the
purs-tidy one-per-line Grammar import list (spec section 6 “no parser
module grows” is otherwise met). rm -rf output && npm run verify exit 0,
21 files, 151 tests, 0 failures/skips, seven regression proofs (the
exhaustive needle still matches once and its mutant fails)
(.build/g001-final-fix-verify.log); answer, shapes, tree emits
cmp-identical to bootstrap/*.go. G001 Done, pending the controller’s
scoped re-review.User approved the merge and kept the externally rewritten history. main
fast-forwarded to 44a735b. Clean rm -rf output && npm run verify on main
exited 0: zero warnings, 151 tests, zero failures/skips, strict rebuild
proof and seven regression proofs (branch, nil-guard, exhaustive,
ctor-order, first-field, show-fields, state-thread). Raw log:
.build/g001-merge-verify.log. Scoped re-review of the final fixes found all
findings addressed (116,000+ differential coverage cases identical to the
pre-fix build); remaining wording nits fixed here (engineering test count)
or parked (coverage-scale comment, Inhabited complexity formula). The
re-review’s out-of-scope allowlist gap is BACKLOG F007. Worktree evidence and
the SDD ledger are archived under .build/merged-g001-evidence; the g001
worktree and branch are removed.
bumpusFn{f}Match{k} (k in
per-function pre-order, scrutinee before arms), taking its captured
locals in LocalId order and then bumpusScrutinee; lifted functions
follow their function in number order (ADR 003 item 6). New modules
Format.Go.Lowered (counter threading), Format.Go.Expression (moved out of
Format.Go) and Format.Go.Capture; Format.Go.Compare’s comparison now
takes lowered operand code.bumpusFn0Match* functions; .build/e005-red-lift.log);
its capture test passed, as expected for closures, and its RED is the
capture mutant. The 128-deep timing test hit its 10 s spawn timeout
(.build/e005-red-timing.log). The full-limit match-arm and
compare-matches runs were not executed on the closure compiler (prior
record: killed at 128).capture row) and capturing nothing both make the probe
fail with captured local lost and Go’s undefined: bumpusLocal3 /
bumpusLocal1 (.build/e005-mutants.log).go build, Go 1.26.4): closures 0.31 s
at d = 16, 1.26 s / 596 MB at 20, 7.99 s / 2.7 GB at 22; named functions
0.13-0.15 s and about 67 MB at every d from 8 to 128.LocalIds in emitted Go follow source pre-order
pinned the emitted text of one closure-form body; its expected sequence
now covers bumpusFn0 and its four lifted matches (same binder numbering,
plus capture parameters and arguments).bumpusFn0Match0/Match1 functions).rm -rf output && npm run verify exit 0: zero warnings, 22 files, 155
tests, zero failures/skips, eight regression proofs including capture
(.build/e005-verify.log).free;
Format.Go.Capture union/armFree), so captures come from one bottom-up
pass: 0.31 s at 127. New test a deep, wide match ladder compiles in under
1.5 s failed first at 3,028 ms (.build/e005-fix1-red-ladder.log). Generated
Go is byte-identical to the pre-fix head on 21 programs (the three
examples, the match-lift, LocalId and capture programs, an if/match mix,
ladders at 32 and 127, and every depth form at 128) and cmp-identical to
bootstrap/*.go (.build/e005-fix1-identical.log). The capture row now
drops a match’s scrutinee from its free set (Format.Go.Match); its mutant
fails with undefined: bumpusLocal3 (.build/e005-fix1-mutant.log).
(2) The 128-deep timing test emits Go, then runs go build detached in
its own process group, killed as a group on timeout, and removes its temp
directory in finally. Against the closure compiler it failed with go
build killed at 10000 ms and left no go/compile process or temp
directory (.build/e005-fix1-groupkill.log). (3) Its comment now says the
build cache may supply the binary and why the bound stays honest.
rm -rf output && npm run verify exit 0: zero warnings, 22 files, 156
tests, zero failures/skips, eight regression proofs
(.build/e005-fix1-verify.log).User approved. main fast-forwarded to 09f3071 (E005 c928d93 plus review fix
round 09f3071). Clean rm -rf output && npm run verify on main exited 0:
zero warnings, 156 tests, zero failures/skips, eight regression proofs. Raw
log: .build/e005-merge-verify.log. Review: 430-program base/head
differential identical (values and call traces) and malformed-value panics
identical; fix round re-review addressed all three findings. Parked: one
82-column JS test line (rule binds PureScript only), the stale
Format.Go.Capture header comment (fixed with T001), wall-clock budgets with
~5x headroom. Evidence archived under .build/merged-e005-evidence; worktree
and branch removed. Next: T001, then P001 (user order 2026-10-07).
Branch t001 (.worktrees/t001) from 62f8192. Brief: .superpowers/sdd/t001/brief.md (approved with eight binding amendments).
docs: refresh Format.Go.Capture header: the header now
describes bottom-up free-local sets (parked from the E005 review).rm -rf output && npm run verify 76.4 s wall, its node –test phase
33.0 s (duration_ms 33,026; .build/t001-before-verify.log); node --test
alone 27.0 s (.build/t001-before-tests.log); 156 tests. Serial per-file:
large-source 12.4 s, adt-order 8.8, adt-print 8.5, depth 8.0, compare 7.0,
adt-properties 6.3, adt-match 4.7, properties 3.8, compiler 3.1, adt-types
1.7, match-lift 1.5, adt-coverage 0.5.runGoBatch (design and failure contract in
docs/engineering.md). Self-tests (test/go-batch.test.mjs, five tests) were
first run against a stub that throws: 5/5 failed
(.build/t001-selftest-red.log), then passed against the implementation
(.build/t001-selftest-green.log). Each also kills a mutant of the harness
in an isolated copy (.build/t001-mutants.log): a rejection failing the
whole batch, no blame in the compile diagnostic, a disabled shape guard,
clearing the go-batches root, and a lost exit status each fail exactly
the matching self-test; the healthy copy passes 5/5.run), so large-source’s timed
checked() of the 20,000-declaration program is still the first compile
of that source. Its 5,000-arm timed compile now follows the batch’s
compile of the same source (JIT-warm); the 5 s bound still fails a
quadratic regression by far, and a cold-compile stack overflow would
still surface through the batch’s own first compile, rethrown by that
case’s run.rm -rf output && npm run verify exit 0, 60.7 s wall, node –test
phase 19.2 s (duration_ms 19,167; .build/t001-after-verify.log), 23 files,
161 tests, zero failures/skips, eight regression proofs; node --test
alone 15.5 s (.build/t001-after-tests.log). Serial per-file: large-source
10.7 s, adt-order 6.3 (rest is goTest), adt-print 2.4, depth 8.0
(unchanged, out of scope), compare 2.1, adt-properties 0.5, adt-match 2.0,
properties 0.5, compiler 1.6, adt-types 0.4, match-lift 1.2, adt-coverage
0.5, go-batch 1.4.T001 review fix round 1 (2026-10-08; review: ready to merge, six cheap items).
(1) large-source: the 5,000-arm case has its own batch (label arms),
declared inside its test after the timed compile, so that timed compile is
cold again. (2) The guard self-test gains package main followed by
package other, and a second multi-line func main() {; the two guard
clauses that no self-test bound (the package \w+ count and the func main
count), each replaced by true, now fail that test. (3) runGoBatch takes
an array of [name, spec] pairs and refuses a duplicate name (compared as
strings, as run looks names up) at declaration; every caller passes pairs.
New self-test failed first with Missing expected exception
(.build/t001-fix1-dup-red.log). (4) The directory self-test removes its
neighbour marker in finally. (5) docs/engineering.md: batch directories
persist (rm -rf .build/go-batches reclaims them), concurrent test runs in
one checkout race on them, and the 300 s build timeout does not group-kill
(noted rather than changed: spawnSync cannot kill a group). (6) Only the
shape guard’s refusal becomes “generated Go was refused”; filesystem errors
propagate as themselves. Mutants in an isolated copy
(.build/t001-fix1-mutants.log): all eight (the five earlier, both guard
clauses, no duplicate check) fail exactly their self-test; healthy 6/6.
rm -rf output && npm run verify exit 0: 162 tests, zero failures/skips,
eight regression proofs, test phase 19.9 s, 61.8 s wall
(.build/t001-fix1-verify.log).
User approved. main fast-forwarded to 4230eb9 (T001 7cbf2dd, c4e5cd0 and
review fix round 4230eb9). Clean rm -rf output && npm run verify on main
exited 0: zero warnings, 162 tests, zero failures/skips, test phase 19.4 s,
eight regression proofs. Raw log: .build/t001-merge-verify.log. Evidence
and brief archived under .build/merged-t001-evidence; worktree and branch
removed. main pushed to origin at the user’s request. Next: P001.
Plan: docs/plans/2026-10-08-polymorphism-plan.md (spec
docs/plans/2026-10-08-polymorphism-design.md). Branch p001 in
.worktrees/p001; baseline npm run verify exit 0, 162 tests, eight
regression proofs (.build/p001-baseline-verify.log).
Behavior-preserving refactor; no language change. Pipeline is now Parse →
Resolve → Check → Specialize → Go (Program.Compile parse >=> resolve >=>
check >=> specialize, then emit).
TypeId (moved from Domain.Resolved, re-exported
there), VarId, data Ty v = TInt | TBool | TData TypeId (Array (Ty v))
| TVar v with Eq, Ord, Functor, Apply, Applicative, Bind (substitution),
Monad, and ground ∷ Ty v → Maybe (Ty Void). Domain.Resolved re-exports
it; resolved types are Ty VarId. Nothing produces TVar or a type
argument yet.Ty Open, data
Open = Rigid VarId | Hole Int; Call and Construct carry an
Instantiation (always empty now); rigid ∷ Ty VarId → Ty Open.
Features.Check* produce and cover it; check returns Checked.Program
(the CheckedProgram alias is gone).Ty, TypeInfo, CtorInfo,
Tables (ruling R1). Format.Go* change only imports.specialize ∷ Checked.Program → Either
Diagnostic IR.Program, a copy that converts ground TData id []; any
variable, type argument or non-empty instantiation is E_INTERNAL
unspecialized type at the holding span (unreachable until Task 2).candidates) and Match typeName report E_INTERNAL
on a TVar instead of guessing; Task 6 and Task 3/4 replace those arms.{ module, importers } rules in scripts/structure.mjs
internalModules. AGENTS.md, docs/engineering.md, docs/architecture.md
updated. Regression row branch needle follows the rename
(Checked.typeOf); still one target, same defect.specialize is the identity on monomorphic
programs over examples/*.bumpus and the 232 generated programs of the
two property files. Their generators moved to test/generators.mjs
(importing a test file would register its tests and build its Go batch);
draw order and seeds unchanged. test/diagnostics.test.mjs: the two
white-box coverage tests now build their input from
Domain.Checked.Internal and pass TData its (empty) argument array;
their assertions are unchanged.node --test test/structure.test.mjs failed the new gate test
(actual: [], expected [ 'Features.Check imports Domain.IR.Internal' ];
.build/p001-task1-red-structure.log). node --test
test/specialize.test.mjs failed with ERR_MODULE_NOT_FOUND for
output/Features.Specialize (.build/p001-task1-red-specialize.log).rm -rf output && npm run verify exit 0, 85.5 s wall, zero
warnings, 164 tests (162 + 2), zero failures/skips, eight regression
proofs, bootstrap snapshots unchanged (.build/p001-task1-verify.log).Language change: type List(a) = Nil | Cons(a, List(a));, lowercase type
variables, parenthesized application. Status: done.
TypeRef gains VarRef Span String; NamedRef carries
its arguments and spans head through ); TypeDecl.parameters ∷ Array
TypeParameter ({ name, span }); typeRefSpan.(lower, …) after a type name
(type T() = A; is E_SYNTAX Expected a type parameter at )); a type
is Int, Bool, a lowercase name, or an upper name with optional arguments,
each argument one nested level (ADR 006), so 129 deep is E_NESTING at
the 129th argument. List() fails at ); Int(a)/a(Int) at (.TypeArguments (E_ARITY Wrong
number of type arguments for <name>), UnboundTypeVariable,
DuplicateTypeParameter, EntryPolymorphic; TypeName gains
AppliedName, VariableName, HoleName (rendered List(Pair(Int, a)),
a, _). Witness and type argument lists share one listed helper.TypeInfo.parameters, CtorInfo.fieldSyntax (the
field’s source TypeRef, for Task 5’s nested spans), FunctionDecl.variables.laterRepeat, sort-based), then field types. In a declaration
VarId i is its i-th parameter; an unknown lowercase field type is
E_UNBOUND. A function’s variables are every lowercase name in its
signature, first occurrence, parameters then result
(Features.Resolve.Variables signatureVariables). Arity is checked at the
whole reference before its arguments. main with a non-ground result is
E_ENTRY EntryPolymorphic, beside EntryParameters.TypeInfo and CtorInfo explicitly, since
the monomorphic IR does not carry parameters or field syntax.resolved, resolveRejectedAt, checkedPoly,
checkRejectedAt); test/poly-syntax.test.mjs, 21 tests. test/specialize
identical now asserts each checked type has no parameters and each
constructor one syntax reference per field, then drops both before the
identity comparison (they are resolution data the IR does not hold).node --test test/poly-syntax.test.mjs: 19 of 20 failed (the one
pass, Int(a) at (, already held) (.build/p001-task2-red.log). GREEN:
20 of 20 (.build/p001-task2-green.log).fn main(): int = 1; is now a
polymorphic main (E_ENTRY EntryPolymorphic, span 0–19), as design §1
requires, not E_SYNTAX at int. Only the inputs of two characterization
rows changed, each keeping its code, span and text:
test/diagnostics.test.mjs now uses fn main(): 100 = 1; (E_SYNTAX
Expected a type, 11–14) and test/adt-syntax.test.mjs
fn main(): 1 = 1;. poly-syntax pins the new int behavior (21 tests).
The specialize identity-helper edit above was accepted (adds assertions,
removes none).rm -rf output && npm run verify exit 0, 185 tests (164 + 21),
zero failures/skips, zero warnings, eight regression proofs
(.build/p001-task2-verify.log).compile). The CLI does not compile polymorphic
programs until Task 7: a use of a type variable or applied type stops in
Check (E_INTERNAL Unnamed type variable) or Specialize (E_INTERNAL
unspecialized type). A declaration whose parameters no field or
signature uses still compiles, as a monomorphic type.No language change; nothing calls the unifier until Task 4. Status: done.
Flex = Rigid VarId | Meta Int; triangular
Subst (a Map from meta to Ty Flex), empty; substitute (one pass,
Ty’s bind; defined on every substitution) and compose (law
substitute (compose s2 s1) = substitute s2 ∘ substitute s1);
resolve (full normalization, acyclic substitutions only); Failure =
Mismatch | Occurs; unify (rigid only with the same rigid; a meta binds
to its walked partner unless the resolved partner properly contains it;
TData argument-wise, left to right, stopping at the first failure). A
Mismatch carries the first differing subterm pair, an Occurs the meta and
the containing type, both resolved under the substitution reached at the
failure. Meta-to-meta chains are followed by a tailRec loop (walk);
recursion is over type structure only (see E006).InfiniteType TypeName TypeName,
E_TYPE Infinite type: <a> occurs in <b> (raised from Task 4).coreLibraries admits exactly Data.Map, Data.Set and Data.Tuple;
docs/engineering.md records the rule.pure layers may use Data.Map, Data.Set
and Data.Tuple only (rejects Data.List, Data.Map.Internal, Data.MapX,
Data.Tuple.Nested, Data.Set.NonEmpty). test/unify.test.mjs, 9 tests: the
brief’s pairs; left-to-right stop; substitute versus resolve on
{m0 ↦ List(m1), m1 ↦ Int}; 500-case properties (substitute equals a
one-pass reading and obeys the composition law over arbitrary, possibly
cyclic substitutions; resolve idempotent with no bound meta left over
acyclic ones; unify results acyclic, sound, most general for
ground-range σ pairs, and in agreement with test/unify-oracle.mjs, an
independent union-find unifier, on success and on the unified types up
to renaming of metas, for single pairs and for pairs threaded after a
σ pair: 268 of 1,000 sequences succeed); stack safety at 128-deep types
and a 10,000-meta chain; the InfiniteType wire rendering (code and text).resolve that stops after one link passed the resolve
property; the binding is now drawn first.occurs and rigid): occurs check removed,
rigid unifying with any rigid, resolve stopping after one link, no walk
in unify, compose with reversed union bias, arguments right to left: each
fails at least one unify test.node --test test/structure.test.mjs failed the new gate test
([ 'pure module Features.Check.Unify imports Data.Map' ],
.build/p001-task3-red-structure.log); node --test test/unify.test.mjs
failed with ERR_MODULE_NOT_FOUND for output/Features.Check.Unify
(.build/p001-task3-red-unify.log). GREEN: 9 of 9
(.build/p001-task3-green-unify.log).rm -rf output && npm run verify exit 0, 71.2 s wall, zero
warnings, 195 tests (185 + 10), zero failures/skips, eight regression
proofs (.build/p001-task3-verify.log).Language change: rank-1 polymorphic functions and constructors type-check. Status: done.
check, checkFunction), Check.Infer (expressions), Check.Call (calls
and constructions), Check.Arms (checkMatch), Check.Match (patterns;
checkPattern keeps its old signature, from a fresh state),
Check.Require (require/expectType by unification, typeName),
Check.Scheme (state, instantiation, holes), Check.Walk (IR type
traversal), Check.Comparable (comparison groundness).{ subst, next } threaded explicitly through infer in Either;
arrays are threaded by a private applicative (threadAll), whose
traverse is balanced, so 5,000 arms and 10,000 arguments stay linear and
stack-safe. During checking a checked-IR Hole m is the meta m.if else against then; arms against the first);
the result unifies; the resolved body’s comparisons must be ground (rigid
variable: E_TYPE Type <t> is not comparable; otherwise a hole: E_TYPE
Ambiguous type <t> in comparison; pre-order, at the left operand); then
unsolved metas are renumbered Hole 0, 1, … per function in
foldTypes pre-order. Each use of a function instantiates its
variables, each constructor its owner’s parameters; Call and
Construct record the resolved instantiation in that order.Expected <t>, found <u> names both whole operands
resolved under the substitution before the failing unification (not
Unify’s innermost pair); InfiniteType names the meta (_) and the
resolved containing type. Domain.Problem gains NotComparable and
AmbiguousType (E_TYPE). The constructor-pattern arity guard (an
internal error) now runs before the owner lookup and unification.branch now targets Features.Check.Infer’s
checkConditional (still one target, same defect); docs/engineering.md
and docs/architecture.md updated.a and List(a), ambiguous
Nil == Nil and Proxy == Proxy, literal pattern on a), plus a
constructor pattern on a, whole-type messages (Pair(Int, Int) versus
Pair(Int, Bool), Maybe(List(_))), rigid beside a hole; checked-IR
rows: pair(id(1), id(true)) records [Int, Bool] (and [Int],
[Bool], rigid [a, b] inside pair), length(Nil) [Hole 0], dense
per-function hole numbering, and a pattern’s instantiated type.
test/diagnostics.test.mjs and every adt-* test pass untouched.node --test test/poly-check.test.mjs on the pre-change build: 16
of 16 failed (.build/p001-task4-red.log; the final file, rerun against
HEAD c6e87bc in an isolated copy: 16 of 16 failed,
.build/p001-task4-red-final.log). GREEN: 16 of 16.rm -rf output && npm run verify exit 0, 96.3 s wall, zero
warnings, 211
tests (195 + 16), zero failures/skips, eight regression proofs
(.build/p001-task4-verify.log).id nested 128: 1; wrap(x: a): L(a) nested 127: 128; deep(x: a):
L^127(a) nested k: checks at k = 40 (5,081 deep), RangeError in
Unify resolve from k = 44 — within every source limit (now E_NESTING
after fix round 1, below; BACKLOG E006,
.build/p001-task4-measure-depth.log). dup(x: a): Pair(a, a) nested
12/16/20: 21 ms / 208 ms / 3.2 s, doubling per level (BACKLOG E007,
.build/p001-task4-measure-dup.log).inferredTypeLimit = 1000 in Features.Check.Unify. A
type deeper than that is E_NESTING Inferred type nesting exceeds 1000
levels (Problem TypeTooDeep Int). The decision is exceedsLimit, a
stack-safe explicit-stack walk that stops past the limit. It runs on each
expression’s type when it is built (Infer infer, at that expression),
on both operands before each unification and on each binding before the
occurs check (Unify Failure TooDeep), and on every type of a finished
body before it is resolved (Scheme firstTooDeep, at the holder’s span).
Also two tests: one constructor at two types in one function, and the
left-to-right first error g(1, true). matchCtor and checkMatch are
split to stay within the declaration budget (fieldsAgainst,
checkArms, laterArm). Comments now explain the two Infer rows and
mark the checkPattern test seam. Walk’s foldTypes passes spans.deep
from the inside; deep(x: a): L^127(a) nested 44 and 127 deep are
E_NESTING at the same call (each under 5 s, about 2 ms); a type that
deepens after it is built is caught by the final bound at sink’s call.
test/poly-check.test.mjs gains 2 tests (18).rm -rf output && npm run verify exit 0, 77.2 s wall, 219
tests (211 + 8), zero failures/skips, eight regression proofs
(.build/p001-task4-fix1-verify.log). Re-measured: deep nested 8 to 127
is E_NESTING in 2–3 ms. dup nested 12/16/20 now takes 42 ms / 441 ms /
6.8 s (BACKLOG E006, E007 updated).unifyAt, one level per applied type, which equals resolved depth) and
fails with TooDeep past inferredTypeLimit. A Mismatch whose pair is
too deep to resolve also fails with TooDeep. The span is the expression
whose unification failed (Require expectType, the actual operand).
Tests:
same’s second argument.TooDeep) is E_NESTING at same’s second argument.TooDeep.Z,
not at the failed unification.rm -rf output && npm run verify exit 0, 65.9 s wall, 223
tests (219 + 4), zero failures/skips, eight regression proofs
(.build/p001-task4-fix2-verify.log).bindMeta’s strict where resolved the
binding before exceedsLimit ran. Six or more L^997 links chained in one
unification threw a RangeError in that resolve. The resolve and occurs
check now live in bindBounded, which runs only after the bound.
six chained links of L^997 are E_NESTING, not a
crash, at same’s second argument.resolve (.build/p001-task4-fix3-red.log).variables,
Check settled, bindBounded resolved).inferredTypeLimit comment now names unify as the binding
limit.rm -rf output && npm run verify exit 0, 64.7 s wall, 224
tests, zero failures/skips, eight regression proofs
(.build/p001-task4-fix3-verify.log).match m { Just(n) => n, Nothing => 0 } over Maybe(Int))
is E_INTERNAL Coverage of a type variable until Task 6.checkedPoly,
checkRejectedAt). The CLI still rejects polymorphic programs until
Task 7 (Specialize: E_INTERNAL unspecialized type).Language change: polymorphic recursion and nested datatypes that would make specialization infinite are rejected (design §4.1). Status: done.
instantiationRule ∷ Checked.Program → Either Diagnostic Unit
(Features.Check.Instantiation) judges types first, in declaration order
(Features.Check.Nested), then each function’s calls in pre-order. Inside
a strongly connected component of the call graph or of the type
reference graph (an edge for every declared type a field mentions, at any
depth), each type argument must be a bare variable of the referrer or
mention no variable; a hole counts as ground.SpecializationError (wire E_SPECIALIZATION).
PolymorphicRecursion f → Recursive call to <f> changes its type
arguments, at the call; NestedDatatype t → Recursive use of <t>
changes its type arguments, at the offending nested reference, found
by walking the resolved field alongside CtorInfo.fieldSyntax.components ∷ Array (Array Int) → Array Int,
iterative Tarjan (explicit frame stack, self tail calls, Data.Map and
Data.Set state), numbered in closing order.FunctionDecl gain name (Specialize copies it so the identity test
still compares checked and monomorphic IR unchanged; Go ignores it).length(t), mutual even/odd, swapping, dropping, ground
substitution, Rose/Forest, T(b, a)) plus a hole as ground and wrapping
into another component (functions and types); rejected rows with exact
code, span and text (self and mutual List(a) calls, §4.3’s
conservative case, Pair(x, 1), first offence in pre-order, Nest,
the nested W(Pair(Int, a)) reference, mutual types, types before
functions); generator coverage; 200 generated components accepted and
each wrapped variant rejected at its call; components against a
brute-force reachability oracle (300 graphs); 20,000-node chain and
cycle under 5 s each (about 0.23 s for both). test/poly-components.mjs
exports the generator (ruling R3): per component its functions,
arities, calls (variable or ground arguments) and groundTypes, plus
render and wrapped, for Task 8’s bound.W row and the generated test
(.build/p001-task5-mutant-components.log); treating holes as variables
fails the hole row and the generated test
(.build/p001-task5-mutant-hole.log).rm -rf output && npm run verify exit 0, 66.4 s wall, 247 tests
(224 + 23), zero failures/skips, eight regression proofs
(.build/p001-task5-verify.log).length(t) and even/odd match on List(a), which still
ends in E_INTERNAL Coverage of a type variable until Task 6; the test
accepts exactly that diagnostic for those two rows (coverage runs after
the rule, so reaching it proves the rule accepted). Task 6 should make
them plain acceptances.checkRejectedAt,
check). The CLI still rejects polymorphic programs until Task 7.Language change: matches over applied types (List(a), Maybe(Void),
List(List(Int))) and over type variables are checked for exhaustiveness
and redundancy (design §5); the E_INTERNAL Coverage of a type variable
gap is gone. Status: done.
expand ∷ Array TypeInfo → Array CtorInfo →
Array (Ty Open) → Lookup Expansion numbers every application reachable
from the roots by unfolding constructor fields (finite by Task 5),
keyed with variables forgotten (rigid variables and holes are one
abstract type), and builds monomorphic-shaped types/ctors tables
over those numbers: application fields as TData (TypeId n) [], the
abstract type as Int (inhabited, no data). Discovery is a tailRecM
loop of one round per frontier, so it is stack-safe. Roots: every data
type the bodies carry (Features.Check.Walk foldTypes, deduplicated in
a Set) plus every declared type whose constructors mention no variable,
so inhabitation still settles over every monomorphic declaration.buildSignature runs the unchanged inhabitation fixpoint
on the expanded tables; candidates maps an application’s inhabited
expanded constructors back to the declared ones (declaration order) and
gives rigid variables and holes no heads; fieldTypes ∷ Signature →
Ty Open → Head → … substitutes the column’s type arguments. Matrix
complete treats a variable column like Int (never complete). Witness
format unchanged (constructor names only).Nil/Cons(_, _) over List(a), a binder over a,
binders under constructors over a, Nothing alone over Maybe(Void),
Maybe(Maybe(Void)), a hole column, nested heads through
List(List(a)); E_TYPE for Nothing over a (Task 4 guard); exact
witnesses Cons(_, Cons(_, _)) and Cons(Cons(_, _), _) through
List(List(Int)), Pair(_, false), Nothing, Just(_), Cons(_, _)
over a hole; redundant _ after a binder and after Nothing over
Maybe(Void); a generic function with a non-exhaustive match called at
two types reports one diagnostic at the match span; five arm sets over
Maybe(Void) give the same verdict as monomorphic type MV = N |
J(Void) (ADR 003); a 3,000-type parameterized chain where Dead needs
an arm only for U(Int) and U(a), not U(Void), each under 5 s
(about 1.1 s for the test).length(t) and even/odd rows
now require plain acceptance; no poly-* test tolerates E_INTERNAL.Coverage of a type variable; the
Maybe(Void) rows and the chain because inhabitation was per declaration,
not per application) (.build/p001-task6-red.log). The five that passed
pin behavior the old code already had (the E_TYPE guard and witnesses
whose types need no variable column).rm -rf output && npm run verify exit 0, 266 tests (247 + 19),
zero failures/skips, eight regression proofs; coverage.test.mjs,
coverage-scale.test.mjs and adt-coverage.test.mjs unchanged and passing
(10,000-type chain 1.10 s, was 0.89 s in Task 5’s log)
(.build/p001-task6-verify.log).checkedPoly,
checkRejectedAt, check). The CLI still rejects polymorphic programs
until Task 7.Language change: polymorphic programs now compile and run end to end
through the CLI (npm run bumpus -- run examples/lists.bumpus prints
Pair(Cons(Pair(3, true), Cons(Pair(2, false), Nil)), Just(6))).
Status: done.
specialize = specializeWith
TInt; specializeWith ∷ Ty Void → … (hole representative, for tests);
specializationKeys returns { declaration, function, arguments }, types
then functions, each in output-id order. Design §6 worklist: seeds are
every monomorphic type (its fields may reference applications) then every
monomorphic function, in id order; a single first-in first-out list of
work items, filled by a tailRecM loop; each body is copied in pre-order
(signature, then an expression’s type, a call’s instantiation, its
callee, its arguments; a pattern’s type before its fields), and a key is
created on first reference. Monomorphic declarations keep their order and
take the first output ids, so monomorphic programs come out unchanged.
A polymorphic declaration never reached is not emitted.Map (Tuple Int (Array IR.Ty)) Int; IR.Ty gains Ord), so
a key compares in time linear in its arity; specializationKeys
rebuilds Ty Void arguments from those numbers.specializationLimit = 10000 counts only keys of polymorphic
declarations (function instantiations and parameterized type
applications); the reference that would create key 10,001 is
E_SPECIALIZATION More than 10000 specializations (Problem
SpecializationLimit Int). A key found in a constructor field is
reported at its own nested reference (field syntax walked alongside, as
Check.Nested does).traverse keeps wide bodies in shallow stack). Copy
is a sixth module beyond the plan’s Keys and Body. Format.Go needed no
change: specialized constructors carry source names, so values print and
re-read (Cons(Pair(1, true), Nil)).main; Review
Focus 1–5 (namespaces a(5) → 5; loop() fixed by context → 1; zip
value printed and re-read → Cons(Pair(1, true), Nil) both ways; an
8,192-element list from generic append, counted by generic length →
8192; xs < Cons(2, Nil) inside a generic function → true); length at
List(Int) and List(Bool) in one program → Pair(1, 2); length(Nil)
→ 0 with a single length key at Int; exact key order for a small
program; an uninstantiated polymorphic function and type are not
emitted; the limit (compile only): 6,000 function keys + 4,000 type keys
gx(1) and QX(1).
test/large-source.test.mjs: 3,000 distinct instantiations (3,000
function and 3,000 type keys) compile in about 0.6 s (bound 5 s); the
20,000-declaration programs are unchanged and pass.
test/compiler.test.mjs: bootstrap/lists.go snapshot and CLI run.
test/specialize.test.mjs: identity now skips the one polymorphic example
by name (its count assertion is unchanged).npm run bumpus -- emit
examples/lists.bumpus bootstrap/lists.go and reviewed (types numbered in
discovery order, Pair(Int, Bool) first from main’s signature;
constructors in contiguous blocks; one compare and show helper per
specialized type; Bool helper emitted). answer.go, shapes.go and tree.go
are byte-identical (CLI re-emit cmp, and their snapshot assertions).specializationKeys not
exported); with that import stubbed, all 27 tests failed (the Go cases
with E_INTERNAL unspecialized type, the key tests on the stub); the
limit test first failed on its own syntax (match as a + operand, now
parenthesized), then with unspecialized type; the 3,000-instantiation
test failed with unspecialized type (.build/p001-task7-red.log,
.build/p001-task7-red-limit.log).rm -rf output && npm run verify exit 0, 295 tests (266 + 29),
zero failures/skips, eight regression proofs
(.build/p001-task7-verify.log).compile, the CLI and
Go). Task 8 adds the specialization properties.Language change: none (tests only). Status: done.
specializationKeys are equal (normalized keys
such as fn f0[List(List(Int))]), and every program has polymorphic
keys;compile twice gives equal Go; the reversed program
prints the same and has the same normalized key set (sorted arrays,
declaration and type ids replaced by source names);specializeWith TBool and specialize
emit different Go for every program (the holes reach specialization)
and both print the same;main at a random function and random ground arguments
(Task 5’s four plus List(List(Bool)) and List(List(_))); keys per
component ≤ Σ_{d∈C} |T|^arity(d) with T = the entry’s arguments ∪ G_C,
holes normalized to their representative Int (Task 5’s List(_)
reads List(Int)), and every key’s arguments lie in T. outside’s
keys are not counted (its own component). The bound is often reached
exactly. Component programs are only counted, never run (R13);main instantiations at List(List(Int)) beside
List(List(Bool)) and Pair(Int, Bool) beside Pair(Bool, Int) of
the same function.+, strict left-to-right, ADR 005 order), sharing no compiler
code; test/poly-types.mjs, test/poly-expressions.mjs and
test/poly-programs.mjs, the type-directed generator (List, Pair and a
generated G whose recursive fields keep or swap its parameters; four
generic functions calling only earlier ones, with self calls only on a
part of the recursion parameter, so every program terminates);
test/poly-keys.mjs, keys by source name. test/poly-components.mjs:
render takes an optional entry in place of main. The brief named
one helper file; it is split to respect the size target.specialized stubbed to return Left (temporary edit,
reverted), the five properties failed and the two self-checks passed
(.build/p001-task8-red.log). A second temporary mutant, function keys
looked up with every applied-type argument treated as equal, failed the
execution oracle, determinism and representative tests (the batch’s Go
no longer compiled) (.build/p001-task8-mutant-key.log); uniqueness and
the bound do not catch that mutant, because it reuses keys rather than
duplicating them.rm -rf output && npm run verify exit 0, 302 tests (295 + 7),
zero failures/skips, eight regression proofs
(.build/p001-task8-verify.log).compile, specializeWith,
specializationKeys) and Go for the generated programs; the
components through Specialize only.Language change: none (regression rows and documentation). Status: done.
occurs: Features.Check.Unify bindBounded, if mentions meta
resolved then → if false then. Healthy: E_TYPE Infinite type: _
occurs in List(_). Mutant: the cyclic binding is caught later by the
depth bound, E_NESTING Inferred type nesting exceeds 1000 levels, so
the probe fails occurs check missing.rigid: Unify unifyHeads, the rigid-with-same-rigid arm →
TVar (Rigid _), _ → Right subst plus _, TVar (Rigid _) → Right
subst. Healthy: fn f(x: a): Int = x; is E_TYPE Expected Int, found
a. Mutant: accepted (rigid variable unified with Int: null).instantiate: Features.Check.Scheme instantiate no longer advances
the meta counter (, state: state { next = … } → , state: state), so
later uses reuse the same metas. Healthy: pair(id(1), id(true))
prints Pair(1, true). Mutant: rejected (scheme metas shared across
uses: probe program was rejected).spec-key: Features.Specialize.Keys applied keys each data-type
argument as TData (TypeId 0) (Int and Bool kept). Healthy: the
length program over List(List(Int)) and List(List(Bool)) prints
Pair(1, 2). Mutant: Go build fails (cannot use … (value of struct
type bumpusTy1) as bumpusTy0 value), probe fails nested
specialization keys collided.
Evidence: .build/p001-task9-mutants.log (each probe exit 0 on the healthy
build, exit 1 with its message on its mutant).node scripts/regression.mjs: twelve Regression proof (…)
lines, 43.5 s wall.int is
a variable); docs/architecture.md (final pipeline and phase list, depth
bound, P001 test files, new rows); docs/engineering.md (test count, the
four rows); BACKLOG.md (P001 Done on p001; E006 and E007 updated; new
E008 Expand keys, E009 did you mean Int? hint, E010 _ in mismatch
messages, E011 near-limit diagnostic elision); docs/findings.md (P001
observations); README.md (ADR 007 link); docs/next-session.md.rm -rf output && npm run verify exit 0, 85.3 s wall, zero
warnings, 32 test files, 302 tests, zero failures/skips, twelve
regression proofs (.build/p001-task9-verify.log).Rank-1 polymorphism is implemented on branch p001 (Tasks 1-9, commits 959a7d1 onward). Parameterized types and generic functions type-check with rigid signature variables, fresh metas per use and occurs-checked unification; comparisons need ground operand types; unsolved metas are holes that Specialize fills with Int; the instantiation rule makes the set of specializations finite; coverage works over applied types; inferred types are bounded at 1,000 levels (E_NESTING, never a crash); a pure Specialize phase produces the variable-free monomorphic IR with hash-consed keys and a 10,000-key limit. Monomorphic programs emit byte-identical Go. Tests grew from 162 to 302 and regression proofs from eight to twelve. ADR 007 records the decisions (rulings R1-R20 in the plan’s ledger). Open follow-ups: BACKLOG E006-E011. Pending: final whole-branch review and the user’s approval to merge; FN001’s currying direction is to be discussed with the user before its design.
The final whole-branch review (verdict: with fixes) found one Important issue and several minors; all were fixed in one commit on p001.
unifyHeads bound the left (older) of
two unbound metas to the right (newer), so sibling metas joined in turn
formed one chain as long as the siblings, which every later walk
followed: quadratic. Now the newer (larger id) is bound to the older;
self-binding, the depth bound and the occurs check are unchanged
(bindMeta still decides the bound before bindBounded resolves). New
tests in test/large-source.test.mjs, 5 s bound: 5,000 match arms of
Nothing (then _ => Just(0)) and 4,000 Nil arguments to
f(x0: b, …). RED (before the fix, built output): 15.8 s and 8.5 s;
GREEN: 1.55 s and 0.15 s. A first Nothing followed by Just arms grows
no chain (1.6 s before the fix too), so the test uses all-Nothing arms.actual false, expected true. Reproduced
by running the eight P001 test files three at once: it is the 5 s timing
bound of poly-depth an inferred type exactly 1000 deep checks, which
took 2.9 s alone and 7.0-9.0 s under that load. It does not depend on
binding direction (2.8 s with either). Profiling showed nearly all of
that time in Ord (Ty Unit) comparisons of Features.Check.Expand’s
whole-type map keys, 1,000 applications nested up to 1,000 deep. Expand
now keys its numbering by a canonical string spelling of the key (one
native string comparison) and keeps number-to-key in a second map:
2.8 s to 0.35 s alone, 1.9 s under the same triple load, where it no
longer fails; the 3,000-application coverage chain is 0.72 s to 0.65 s.
This is a constant-factor fix; hash-consed keys (BACKLOG E008) remain
the asymptotic one. The same triple load also failed Go batches,
because concurrent runs of one test file in one checkout share
.build/go-batches/compile (support.mjs
rejectedAt), asserting the same code, span and text (design §8,
“through the CLI”); the Check-level rows stay.open maps each open node to
its order, so no lookup can miss; an edge to a node outside the graph,
a component root missing from the stack and an unnumbered node stop the
search with E_INTERNAL (components returns Either Diagnostic). New
test: an edge to a missing node is E_INTERNAL; the reachability and
20,000-node tests pass unchanged in substance.t.Verification: rm -rf output && npm run verify exits 0 in 90 s wall
(97 s on an earlier run) with 318 tests (302 + 2 timing + 1 E_INTERNAL +
13 compile twins), zero warnings and twelve regression proofs
(.build/p001-final-fix-verify.log). The eight files (node --test
test/unify.test.mjs test/poly-*.test.mjs
test/diagnostics.test.mjs, 153 tests) passed three sequential runs
(.build/p001-final-fix-run{1,2,3}.log).
User approved the merge (no push). main fast-forwarded from 79c2327 to
dcb40fb (P001 Tasks 1-9, the final-review fix wave, and the merged main
direction commits). Clean rm -rf output && npm run verify on main exited
0: zero warnings, 318 tests, zero failures/skips, twelve regression
proofs. Raw log: .build/p001-merge-verify.log. Per-task logs, briefs,
reports, review packages and the ledger (rulings R1-R20) archived under
.build/merged-p001-evidence; worktree and branch removed. Next: FN001,
starting with the currying discussion recorded in BACKLOG.
Discussed with the user before any design decision, as BACKLOG required.
Settled: curried semantics with Algol-like multi-argument syntax as
proposed (partial application, over-application, under-application
becomes a function-typed value with a missing N argument(s) hint
replacing today’s under-application E_ARITY); lambdas fn(x) => body
reusing fn and =>, parameter annotations optional and inferred
locally; |> included in FN001 (left-associative, below comparison),
>>/<< wait for a Prelude; no local binding form in FN001 (separate
item), so closures capture parameters and pattern variables by value.
Design draft written the same day:
docs/plans/2026-10-08-functions-design.md (syntax, names, typing, declared
arity, evaluation, instantiation rule, canonical uncurried Go
representation with adapters, tests and regression probes, deliberate
diagnostic changes, four open questions). Not reviewed or approved; no
plan, no code. Next: the user’s review of the draft.
The user’s review of the first draft: revise before approving. The
canonical uncurried representation (A -> B -> C as func(A, B) C with
adapters) lost declared-arity timing: with fn stuck(n: Int): Int -> Int
= stuck(n); and use(f) = drop1(f(1)), use(stuck) must diverge but
the adapter made f(1) a partial application returning 0; lambda
eta-expansion delayed bodies the same way, and the draft’s “delays
nothing observable” claim was wrong. Revision: nested Go function values
func(A) func(B) C, staged wrappers for named functions and constructors
used as values, direct saturated calls unchanged; declared arity is a
stage boundary; pipe evaluates its left operand first (kept as a Pipe
IR node); constructors are curried values; _ discards lambda
arguments; the under-application hint is narrow with provenance rules;
timing tests use instrumented bounded panics, never stack exhaustion;
arrow spines are depth-flat, traversed iteratively, named Go function
types keep text linear, scale tests at 5,000 parameters. Section 12 of
the design maps each finding. Not yet approved; no plan, no code.
The user approved the revised design and asked for the plan. While
writing it, the section 8 go build question was measured on
hand-written Go (scratchpad, Go 1.26.4): nested-closure staged wrappers
took 1.3 s at 50 parameters, 2.6 s at 100, 13.9 s at 200, 221 s at 300,
and did not finish within 10 minutes at 1,000; an environment struct
copied per stage took 1.1 s at 300 and 1,000 and 12.8 s at 5,000. A
parameter bound is not viable (large-source already checks a
20,000-parameter declaration). Recorded as design Amendment A1 (section
13, proposed): no nested Go closures; staged wrappers and every lambda
lifted to top-level stage chains over linked environments; meaning and
types unchanged. Plan: docs/plans/2026-10-08-functions-plan.md (nine
tasks; Task 1 re-measures the linked environment before any lowering
code). Awaiting the user’s confirmation of A1 and review of the plan.
No code.
Verify for this docs change: first run failed one timing test (match
ladder 1,830 ms over its 1.5 s bound under external load, 471 ms alone;
.build/fn001-plan-verify.log), recorded as BACKLOG T003 before
re-running; second run exit 0, 318 tests, twelve regression proofs, the
ladder at 752 ms (.build/fn001-plan-verify-2.log).
The user approved A1’s architecture (top-level stages, immutable
environments) and the nine-task structure with three changes, applied to
the plan: Task 1 has no quadratic fallback (if the linked environment
fails its linearity thresholds, stop and reconsider with the user) and
benchmarks runtime with repeated applications, every argument consumed,
explicit build/run timeouts; equality, ordering and type interning are in
the scale work (hand-written spine-iterative Eq/Ord for both Tys in
Tasks 2 and 5, arrows hash-consed in Specialize.Keys, Go function type
names numbered from interned suffixes in Task 6, a 5,000-parameter
function type as a generic argument in Tasks 5 and 8); the core timing
probes move into Task 6’s first step, Task 7 keeps the interpreter and
generated comparisons. Accepted diagnostic adjustments now in the design
(§2, §4, §9): over-application past a non-function and f() keep
E_ARITY Wrong number of arguments; x() and N() keep E_NOT_CALLABLE.
Task 1 (measurement only) authorized in .worktrees/fn001.
Branch fn001 (.worktrees/fn001). Added scripts/stage-shapes.mjs (Go
generator: linked, copied, nested; attribution baselines direct, bare,
idle, chain; remedy candidates shared, packed) and
scripts/stage-probe.mjs (explicit build/run timeouts, repeated
applications with every argument consumed, checksums recomputed in
JavaScript, growth-exponent verdict). Every run’s checksum matched. The
first verdict line (“linear”) was wrong: its ratio bound admitted a 16×
build for 4× n; replaced by the exponent bound before any decision. Result
(design §13 “A1 measurement”): the linked environment fails the build
bound (k = 1.92 with the statement driver, 1.74 without applying it);
run time is linear. Attribution: the last stage’s n-local unpack and
n-argument call; a packed calling convention fixes the staged value
(k = 1.23 including a k = 1.52 floor of types and f). Applying a value
to n arguments in one Go function is k ≈ 2 in every shape. Stopped per
the user’s ruling: no representation adopted; decision returned to the
user. No compiler change.
User authorized a second measurement round only. Added scripts/stage-baselines.mjs (types, signature, body, call), scripts/stage-mixed.mjs (mixed Int/Bool/pointer parameters, each read twice out of order; today’s n-ary convention, packed per-type arrays, packed struct), scripts/stage-blocks.mjs (block-split application, arguments evaluated in place), scripts/stage-order.mjs (order, body-entry and shared-partial checks with expected output computed from the semantics); probe reports total build times and an exponent per program. All checksums matched; four order cases matched; a hoisting mutant of the helpers failed the order check (scratchpad, not committed). Results in design §13 “round 2”: Go’s growth is confirmed in large bodies (today’s convention, mixed body: 1.51 s / 33.6 s at 5,000 / 20,000); packed arrays plus blocks of 64: 2.45 s / 19.2 s; homogeneous packed, blocks of 64: 2.08 s / 13.1 s; runtime linear. Nothing adopted; proposed Go bounds returned to the user. No compiler change.
The user approved the scale rule (Bumpus phases linear and stack-safe; Go builds at most 10 s per program at 5,000 parameters in verify and 100 s at 20,000 in the milestone probe) and one final round, adoption conditional on the shared-body bound and type-diversity allocation. Added scripts/stage-shared.mjs. Round 3 (.build/fn001-task1/run5-*.log): shared body with direct call, packed entry and a shared partial, total build 3.4 s / 5.1 s at 5,000 (3 / 1,000 types) and 52.1 s / 80.0 s at 20,000; 49.3 / 52.0 bytes per stage; checksums matched. Both conditions hold; convention adopted and written as design §13 rules 1-8; plan Task 6 interfaces and tests updated; conclusions narrowed (“tested large bodies”, not “no representation”). The 20,000 / 1,000-type build uses 80% of its bound. Next: Task 2.
Branch fn001. Behavior-preserving: no syntax produces an arrow yet.
Domain.Type.Ty gains TFun (Ty v) (Ty v) with spine
helpers (spine, spineThrough, arrows, children; a loop each, in
Domain.Type itself since the instances need them). Eq, Ord and Functor
are hand-written: arrow spines are walked in step by a loop, applications
compare inline (the first version, through helpers, overflowed
test/poly-depth an inferred type exactly 1000 deep checks in verify;
fixed. Headroom figures are approximate (JIT variance): my probe gave
compare the derived instance’s spare frames at 1,000 levels and ==
about 8,700; the review measured compare at 8,592 spare frames in
most runs but 6,249 in 2 of 10, and the pipeline’s minimum stack for
the poly-depth 1,000-deep case at about 559 KB both before and after).
Bind (substitution) and ground walk spines by a loop. Unify: arrow
against arrow unifies parameters at level + 1 and results at the same
level in a tailRec loop entered only when both heads are arrows (list
nesting stack headroom unchanged, measured); resolve, exceedsLimit
and the occurs check follow the same measure. Problem.FunctionName,
rendered right-associatively by a loop with function parameters
parenthesized. Comparable: rigid, then hole, then a new function check
through the new Features.Check.Functional (declared types whose fields
reach an arrow, settled once per program over the reverse reference
graph; a program with no arrow field builds no graph). Signature and
Matrix treat an arrow column as abstract; Inhabited and Expand treat
every arrow as inhabited and never unfold it; Expand spells arrows
f(…); Nested’s reference graph enters arrows, and a resolved arrow
field is an Internal field-syntax mismatch until Task 3 adds the
syntax. Specialize.Lower: Internal "unlowered function".TFun before
the code): test/unify-arrow.test.mjs (7 tests: arrow against arrow;
mismatch inside a parameter and a result; meta against an arrow and
occurs through one; rigid against an arrow; a 5,000-long spine unifies
and resolves; 1,001-deep parameter nesting is TooDeep while a 5,000-long
spine is not; a meta bound through a spine), test/type-order.test.mjs (5
tests: Eq/compare on equal and last-parameter-differing 20,000-long
spines; substitution and ground on one; agreement with the derived
order on 2,000 generated arrow-free pairs, whose reference was first run
against the old derived instance and passed; arrow name rendering; a
20,000-long name). test/unify.test.mjs and the independent oracle
test/unify-oracle.mjs generate arrows; shared helpers moved to
test/unify-support.mjs.exceedsLimit; parameters unified at the same level;
recursive arrow equality; recursive, unparenthesized name rendering.
Each fails at least one new test.rm -rf output && npm run verify exit 0, 330 tests (318 + 12),
zero failures/skips, twelve regression proofs; bootstrap snapshots
unchanged.containsFunction; a 50,000-type chain under 5 s), seen failing on an
isolated no-fixed-point mutant (seeds only: 2 of 3 fail); spineThrough
can no longer file a result as a parameter (its unreachable arm adds
none); a redundant Inhabited arm removed; a unify-arrow test renamed;
headroom figures above reworded as approximate.Branch fn001. No existing row changes; bare names and calls of locals keep their P001 resolution until Task 4.
-> and |> longest first. Domain.Syntax
gains FunRef, Lambda, Apply, Pipe, LambdaParam and
typeRefSpine (a loop). The type parser moved to the new
Format.Parse.Type: an arrow chain is read as a list (Grammar
chainRight, Cursor rightAt, a tailRecM loop) and folded right;
(A, B) -> C flattens to A -> B -> C; a list of two or more types not
followed by -> is Expected ->, () is Expected a type at ).
Nesting follows design §1 (parameter side +1, checked at its ->;
result side +0); type parentheses are one level while parsed (Cursor
groupedAt) and none once closed, recorded in ADR 006’s new FN001
section. Format.Parse.Lambda parses fn(x, _: T) => body (Expected a
parameter); Format.Parse.Expression adds |> (a chainLeft1 over
comparisons) and postfix application (Grammar manyOn; flattened by
the review fixes below); a name call stays Call. Domain.Resolved
gains Lambda (with Param = { local, ty, span }), Apply and Pipe;
Features.Resolve.Lambda resolves parameters (E_DUPLICATE Duplicate
parameter x at the first occurrence of the earliest repeated name,
fn(b, a, a, b) at the first b, as for functions; _ gets no
LocalId; annotations against the signature’s variables, E_UNBOUND
Unbound type variable b); resolveType and occurrences walk
written spines by loops. Check.Infer returns Internal "unchecked
function" for the three new nodes. Check.Nested replaces Task 2’s
placeholder: an arrow field is judged beside its written spine
(parameters and final result, paired by a loop), so a nested reference
inside an arrow is reported at its own span. test/poly-parse.mjs (the
oracle’s own parser) reads arrow types, lambdas, postfix application and
pipes, independently. Style gate: Format.Parse.Type and
Format.Parse.Lambda join the applicative production modules. BACKLOG
E003 notes two dispatches now over the branch target.FunctionRef/CtorRef expression constructors.
Domain.Resolved’s GlobalRef already has constructors of those names,
so adding them needs that rename, which belongs with Task 4’s bare-name
resolution.1 +
fn(y) => y is Expected an expression at fn before and after, kept
as a characterization row); test/fn-oracle-syntax.test.mjs, 2 tests,
both failing. Added after the code, each shown to bite by an isolated
mutant (scratchpad copy, not committed): a parameter inside a
parameter counts both levels (mutant: a parameter contributes no level
in rightAt), the (Int -> L^127(Int)) -> Int row (mutant: a result
contributes a level), 127 further applications parse; one more is
E_NESTING (mutant: postfix application without infixed). Further
mutants, each failing the named rows: type parentheses keeping their
level (128 nested parameter positions resolve); no lambda duplicate
check (both E_DUPLICATE rows); Nested arrow arm restored to a mismatch
(all four arrow-field rows); no Expected -> lookahead (both rows)._, duplicates, rigid and unbound annotations). The rows for bare
function and constructor names and calls of locals change in Task 4
(plan Global Constraints), so no interim outcome is pinned here.checkRejectedAt, checkedPoly), whose programs contain no
lambda, application or pipe.rm -rf output && npm run verify exit 0, 380 tests (333 + 47),
zero failures/skips, twelve regression proofs; bootstrap snapshots
unchanged. Log .build/fn001-task3-verify.log.Apply of every group’s arguments in order (g(1)(2)(3) is Apply
(Call g [1]) [2, 3], exact under design §5), the callee one level
deeper once per chain, replacing the per-group level, which made plan
Task 8’s 1,000-application chain E_NESTING. Seen failing first: the new
row a chain of 1000 postfix groups resolves to one Apply failed with
E_NESTING (NestingTooDeep 128 at the 129th group’s (; log
.build/fn001-task3-i1-red.log), as did the flattened shape and span
rows; the 128-application E_NESTING row is removed. M1, ADR 006 states
that a parenthesized type raises its contents’ depth while parsed, with
the four L^127((Int -> Int))/L^128((Int)) rows in the new
test/fn-depth.test.mjs (passing on arrival: they pin behavior). M2,
design §1 clarifies empty value applications. M3, five FN001 forms in
scripts/depth-forms.mjs (functionForms, named-only in
depth-probe.mjs), checked at the limit and one past it through Resolve
by test/fn-depth.test.mjs; the review’s lifted-limit figures in ADR 006;
plan Task 6 Step 3a re-measures them. M4, BACKLOG E003 trigger
reworded. M5, the duplicate wording above, with a fn(b, a, a, b) row.
GREEN: rm -rf output && npm run verify exit 0, 387 tests (380 - 1 + 8),
zero failures/skips, twelve regression proofs, snapshots unchanged (log
.build/fn001-task3-fix-verify.log).Branch fn001. Reach: Parse → Resolve → Check (test/phases.mjs,
test/fn-checked.mjs); one CLI row asserts that checked function programs
reach Specialize as Internal "unlowered function".
GlobalRef constructors are
renamed GlobalFunction FunctionId Int (with the declared parameter
count) and GlobalCtor CtorId, freeing FunctionRef Span FunctionId
and CtorRef Span CtorId for expressions. A bare name is a local, else a
function with parameters (FunctionRef), else a zero-parameter function
(Resolve: E_ARITY Expected f(), new Problem.FunctionNeedsCall), else
a constructor (Construct with none if nullary, CtorRef otherwise),
else E_UNBOUND. A local called with arguments is Apply (Local …), the
local spanning the name; x() stays E_NOT_CALLABLE. CtorNeedsArguments
is removed (no longer produced).FunctionRef, CtorRef, Apply, Lambda (Array Param),
Pipe; Call/Construct hold 1..n arguments (partial when fewer).f() with parameters E_ARITY before arguments; j > n: E_ARITY
before any argument if the declared result can never be a function
(Int, Bool, declared type), else check n, E_ARITY at the call if the
instantiated result is not an arrow or unbound meta, else apply the rest
as Apply (Call f a1…an) rest), Apply (one argument at a time, the type
threaded with the state by Scheme’s threadAll, now generic in its
state; an unbound meta is bound to α -> β; anything else is E_TYPE
Expected a function, found T at that argument), Pipe, Lambda (fresh
metas or rigid annotations), Hint, Context (shared env rows). require
wraps a TypeMismatch in Hinted problem (MissingArguments f k) per §4’s
provenance rules (the found expression’s own node a partial Call or
Construct; expected type’s head, under the state before the failure,
neither an arrow nor an unbound meta). Walk, Comparable, Coverage cover
the new nodes; a function scrutinee admits only _ and binders (by
unification, unchanged Match). Check judges a printable main before any
body: E_ENTRY Expected fn main() with a printable result type when the
result contains an arrow directly or through declared fields
(Functional). Instantiation’s foldCalls enters Apply and Pipe
(calls there are ordinary edges); value references and lambda bodies are
Task 5’s. Specialize.Body returns Internal "unlowered function" for
each new node.a |> g(b1…bk) with k = n is
the over-application g(b1…bk, a): E_ARITY at the right operand’s span
when g’s result is not a function; any other right side is applied to
a (NotAFunction at a). a |> f() keeps f()’s own E_ARITY. (2) The
over-application E_ARITY is checked before arguments when the declared
result is Int, Bool or a declared type, so those wrong counts keep their
pre-FN001 order of errors. (Corrected by the review: a result type
variable cannot keep it; see the review fixes below.) (3) Only a TypeMismatch
is hinted (an occurs
failure never has a non-meta expected head). (4) The printable-entry
check lives in Features.Check (it needs Functional), not
Check.Signature, which is the coverage signature.fn f(): P = Pair;: E_ARITY 37-41 Pair
Constructor Pair needs arguments → E_TYPE 37-41 Pair
Expected P, found Int -> Int -> P.fn main(): Int = Cons;: E_ARITY at Cons
(58-62) Constructor Cons needs arguments → E_TYPE 58-62
Expected Int, found Int -> IntList -> IntList.fn main(): Int = Cons(1);: E_ARITY at Cons(1) (58-65) Wrong number
of arguments → E_TYPE 58-65 Expected Int, found IntList -> IntList;
missing 1 argument to Cons?.fn helper(): Int = 1; fn main(): Int = helper;: E_UNBOUND at the
second helper (80-86) Unbound local helper → E_ARITY 80-86
Expected helper().Cons(f, _) => f(1): E_NOT_CALLABLE at f(1)
Local is not callable: f → E_TYPE at 1 (128-129)
Expected a function, found Int.
The adt-types rows now also assert these messages. No other existing
assertion changed.Int -> Int and
Box(Int), three patterns on a function scrutinee and a redundant arm
after _, which Task 2’s type passes already gave; kept as
characterization). Two markers were then corrected in the tests (an
earlier = x in the prelude) and one unhinted row rewritten to g + 1
so the found expression is the binder, not the match.Apply (add3(1)(2)), over-application always E_ARITY (4
rows), partial application typed as the result (63), a non-function
bound to an arrow instead of NotAFunction (6).node --test test/*.test.mjs run failed
match-lift’s 1.5 s ladder at 1,780 ms (load); evidence added to BACKLOG
T003. BACKLOG E003 counts updated.rm -rf output && npm run verify exit 0, 468 tests (387 + 81),
zero failures/skips, twelve regression proofs, bootstrap snapshots
unchanged; twenty thousand parameters are checked in linear time
passes unchanged (258 ms). Log .build/fn001-task4-verify.log.id(true + 1, 2),
fst(1, true + 1, 3), loop(true, 2) E_ARITY → E_TYPE at true;
id(id(1, 2), 3) keeps E_ARITY at the inner id(1, 2); loop(1, 2)
(loop: Int → a) is accepted by Check (each confirmed). Recorded in
design §9; the first two pinned in test/fn-check.test.mjs (they pass on
0a49dfd, pinning behavior). I2: the Specialize row was vacuous (its
prelude’s k failed first); it now uses its own two-function program and
asserts each node’s own span for (fn(x) => x)(1), 1 |> add(2),
id(add)(1, 2), add(1)(2). Isolated mutants: Specialize copying
Apply’s callee and Pipe’s left operand, and Apply alone, each make
it fail (invalid program compiled). M1: a pipe into a saturated call
whose declared result is Int, Bool or a declared type is E_ARITY right
after the left operand, before the call’s arguments (design §9);
1 |> add(true, 2) failed on 0a49dfd (E_TYPE at true). M2:
Format.Parse.Expression’s primary reports where it starts, so an
application of a parenthesized callee spans from its (; Task 3’s
(g)(x) row in test/fn-syntax.test.mjs moves from g)(x) to (g)(x)
(with ((g))(x)(y) and a bare (g) rows), the hint row
(fn(x) => add(x))(1) likewise, and (add)(1) is a new no-hint row; on
0a49dfd the three span rows and the Specialize row failed (5 failures,
test log in the scratchpad). M3: plan Task 4 Files list corrected. M4:
docs/language.md Names paragraph points to the design as superseding,
pending Task 9. Perf: supplied builds the arrow only for a partial
application. Match ladder alone, six alternating runs before/after the
change: 519/518, 525/519, 524/527, 514/514, 508/535, 578/1,641 ms (the
last pair under an external load spike), then four more under load
average 7.4: 686/642, 741/715, 715/713, 700/705 ms: no measurable
difference (the ladder makes no calls on that path; 0a49dfd’s parent was
508-516 ms against 523-562 ms at 0a49dfd).
GREEN: rm -rf output && npm run verify exit 0, 472 tests (468 + 4),
zero failures/skips, twelve regression proofs, snapshots unchanged;
the ladder took 1,393 ms inside it under external load (BACKLOG T003),
twenty thousand parameters 286 ms (log .build/fn001-task4-fix-verify.log).Branch fn001. Reach: Parse → Resolve → Check → Specialize (specialize,
specializeWith and specializationKeys called directly); the CLI stops
every function program at the temporary guard after Specialize.
foldCalls makes a bare
FunctionRef an edge with its instantiation and enters lambda bodies,
so references at any depth (match arms, lambdas, Apply, Pipe) are
judged and form components (design §6); Components needed no change.
Domain.IR.Internal gains TFun Ty Ty with hand-written Eq/Ord (one
spine loop, the derived order), spine (two loops), and FunctionRef,
CtorRef, Apply, Lambda (Array Param), Pipe. The new
Features.Specialize.Intern hash-conses arrows: a key part is
KInt | KBool | KData n | KFun n, an arrow is numbered by its
(parameter, result) numbers, and Lower interns a spine’s suffixes from
its final result outwards while lowering it (parameters by a balanced
traverse, the interning by Array.foldr), so every suffix is numbered
once and no key is found by walking or spelling a type. Lower returns a
Lowered = { ty, key }; Keys’ Key is Tuple Int (Array Interned),
Work.arguments are Lowered, the state holds the arrow table; arrow
fields are lowered beside their written spine (as Check.Nested pairs
them). Body copies the new nodes through the new Specialize.Values
(callee for calls and bare references, ownerCtor: a partial
construction or constructor value names its owner’s copy, the final
result of its arrow, lambda). specializationKeys rebuilds arrow
arguments by a loop. The new Features.Specialize.Unlowered reject is
called by Program.Compile after specialize. Format.Go: goType
spells TFun inline as func(A) func(B) R along the spine; the field
comparison of an arrow field emits malformed; Usage walks the new
nodes; Expression lowers them to func() T { panic("bumpus: unlowered
function") }(). All unreachable behind the guard; Task 6 replaces them.Proxy(Int ->
Int)) is neither, and a generic function never instantiated is not
emitted, so such programs reach Go (worded so by the review, M1). (2)
Constructors, called or bare, are no edges: they have no body, so they
are in no component with a function. (3) A bare reference keeps the
existing text Recursive call to f changes its type arguments (no new
text is listed). (4) IR’s TFun carries no number: plan and design say
TFun Ty Ty. Task 6’s named Go types (design §13 rule 8) must reach the
numbers through Features.Specialize.Intern or carry them into the IR;
left to Task 6. (Superseded by the review fixes below: the numbers are
in the IR.) (5) The generator’s edge kinds come from a seeded stream
of their own, so P001’s components are unchanged. (6) Representative
independence is checked on the IR as a bisimulation: from both entries,
the bodies agree node for node ignoring types and spans, constructors by
name, and each pair of referenced functions is compared once.checked function programs reach
Specialize as Internal becomes ... stop at the unlowered guard; its
four rows keep code (E_INTERNAL), span (each node’s own) and text
(unlowered function), now reported by the guard; three rows added
(partial call at add(1), arrow field at T(Int -> Int), arrow
parameter at the declaration). The spec-key regression row’s needle
is now key = Tuple declaration (map keyOf arguments) and its mutant
collapses a data argument to dataType 0; still one target, still
fails. No other existing assertion changed.walk, bare step joining a component, bare walk
inside a lambda, and wrapping an intra-component argument over the
generator’s value and lambda edges); the arrow type row and the two
accepted rows passed on arrival (the arrow row since Task 3’s Nested),
kept as characterization. test/fn-specialize.test.mjs (map(id) twice,
constructor values’ owners, the 5,000-parameter keys) 3 of 3 failed;
test/fn-representative.test.mjs failed; poly-properties’ §4.2 bound
failed (each unlowered function from Specialize); the guard row failed
on the arrow-field span.fn id[…] keys merged, the distinctness row
fails; no FunctionRef edge: 3 rejected rows and the wrapped generator
test fail; no lambda edge: 2 rows and the wrapped test fail; owner taken
as the arrow itself: the owner row fails; no guard: the CLI row fails;
a lambda parameter dropping its local when lowered at Bool: the IR
independence property fails, but only after its third wrapper (a
lambda never applied, so its unused parameters are bare holes) was
added: the first version, whose parameters were List(_), let it
survive. The §4.2 bound itself passes on both rule mutants: accepted
generated components use bare variables or ground types only, so it
cannot distinguish them; the wrapped-variant test does.twenty thousand
parameters 310 ms and three thousand distinct instantiations 747 ms
inside verify. Specializing the 5,000-parameter program takes 0.23 s
alone.rm -rf output && npm run verify exit 0, 483 tests (472 + 11),
zero failures/skips, twelve regression proofs; bootstrap snapshots
unchanged. Log .build/fn001-task5-verify.log.The user approved (a) fixing BACKLOG T003 (match-ladder timing margin: 1,480, 1,393 and 1,441 ms against 1,500 inside the last three verifies) on fn001 after the Task 5 review and before Task 6, by reducing the workload, not raising the bound; (b) durability additions: Task 8 Step 1b commits the Task 4 review’s linear-cost table as bounded tests (test/fn-linear.test.mjs), Task 8 Step 4 uses a committed scripts/fn-milestone.mjs for the 20,000 tier, and Task 9 Step 1b promotes four scratchpad mutants to regression rows (block-order, value-edge, functional-fixpoint, arrow-key; 22 proofs); (c) the design §9 documentation of over-application diagnostic changes (Task 4 review).
IR.Ty is TInt | TBool | TData TypeId | TFun
FunTypeId with derived constant-time Eq/Ord (the hand-written spine
instances are gone), and IR.Program carries funTypes ∷ Array {
parameter, result } in interned-number order, from Intern’s table
(numbers for lookup, entries by number). The review measured about
40,050,000 arrow nodes in the expression types of the 5,000-parameter
test’s IR, which any pass re-walking them in Format would visit. With
numbered types the Lowered pair is gone (a lowered type is its own key
part), so Keys’ Key is again Tuple Int (Array IR.Ty) and the
spec-key row is back to its P001 needle and mutant (one target; the
proof passes). IR.spine reads the table by two loops;
specializationKeys rebuilds arrows through it (tests only). A
construction’s or constructor value’s owner is now the owner type at
its instantiation (applied), not the end of its type’s spine. Format.Go
already emits the named types: type bumpusFun<N> func(P) R per entry,
after the data types, and goType (TFun n) is bumpusFun<N> (no
re-walking); a program without arrows emits none, so snapshots are
unchanged. Design §7 and plan Task 5 Interfaces and Task 6 (number
order, not first-use order) are amended as Task 5 review
clarifications. M1: plan Global Constraints and decision (1) above say
the guard judges the monomorphic IR; a phantom arrow argument compiles
and runs pins Proxy(Int -> Int) printing 0 and its unused
bumpusFun0 declaration (written after the code; not run against
5874482, where the guard already let it through by reading). M2:
plan Task 6 Step 3 replaces the two temporary catch-all arms. M3:
docs/architecture.md names Intern, Values, Unlowered and the numbered
TFun; the full FN001 update stays Task 9’s. M4: test/phases.mjs (and
support.mjs, poly-keys.mjs and the two new test files) build failure
messages only on failure; checkedPoly succeeds on a 20,000-parameter
function value failed first with a RangeError from JSON.stringify
(.build/fn001-task5-fix-red.log; a plain 20,000-parameter program did
not reproduce it, since only a value reference puts the long arrow in
the checked IR). Design §9 notes that the Recursive call text covers
value references. New test arrow types in the IR are interned table
entries (different ids for the two 5,000-parameter types, equal ids
for equal types, each spine read through the table, at most 2 × 5,000
entries); a parameter-blind interning mutant (scratchpad) fails it and
the distinctness row. Timing of the 5,000-parameter specialization
(specializationKeys, alone): 0.23 s before, 0.26 s after (three runs
each). test/specialize.test.mjs now checks that a monomorphic program’s
funTypes is empty before comparing the rest; the first verify of
these fixes failed it on the new field, and the match ladder at
1,732 ms (BACKLOG T003). GREEN on the next run: rm -rf output && npm
run verify exit 0, 486 tests (483 + 3), zero failures/skips, twelve
regression proofs, snapshots unchanged; the ladder 1,497 ms, 3 ms
under its bound (T003); twenty thousand parameters 241 ms (logs
.build/fn001-task5-fix-verify.log, .build/fn001-task5-fix-verify2.log).Goal (approved by the user before FN001 Task 6): make the 127-deep, 50-arm ladder in test/match-lift.test.mjs substantially cheaper so its 1.5 s bound has headroom inside verify’s parallel run; the bound, the workload and the test’s place in verify are unchanged. Acceptance was a 2× drop in the isolated median, or, if that needs a design change, the profile and the options.
Profile (c120d48, built in an isolated copy). The measurement is
committed as scripts/ladder-profile.mjs (node scripts/ladder-profile.mjs
--rounds 7 --baseline DIR: cold compiles in fresh processes alternating
with a built baseline tree, steady per-phase medians, load average); the
CPU and allocation profiles below used node --cpu-prof and V8
allocation sampling on the same source. Steady state per phase (median of 15,
in-process): parse
137 ms (lex 55), resolve 22, check 134 (infer 61, coverage 36,
firstTooDeep 9, holes 8, instantiation rule 9, retype 7, comparable 5),
specialize 24, Go emission 46. One cold compile (fresh process, the
test file’s small program first, as in the test) was ~500 ms: about
1.4× the steady sum, from JIT warm-up and GC. The compile allocates about
2.8 GB for the 150 KB source (--trace-gc: 149 scavenges, ~110 ms of
GC). Hot spots: Format.Lex (per-character tailRecM steps over a copied
character array, Array.elem, a fresh slice per two-character-token
probe); isName/decimalToken copying each token into a character
array; Format.Go.Capture’s union (concat, sort, then Array.nubBy,
which sorts again) at 26% of emission; coverage’s per-arm redundancy
query re-simplifying every earlier arm and uncons-copying every row a
specialization drops (quadratic in arms by design, so the constant
matters); tooDeep/walk entering their loops for Int, Bool and rigid
types; retype/holes rebuilding a body that has no bound meta or
hole. Everything else is a flat spread of combinator, Either and record
overhead (no single function above 4% after these fixes).
Changes (each keeps its semantics; no public formula is new):
String.charAt/slice),
skips a whitespace run in one step, tries two-character tokens only
after their first characters, and tests punctuation and reserved
words with case instead of Array.elem; isName and Literal’s
decimalToken count in place.upcoming, the next token’s text, set
once per token consumed, so peekText is a field read.useful takes simplified
rows; Matrix’s specialize/defaults judge a row by Array.head
before copying its rest.tooDeep answers Int, Bool and rigid variables without converting;
Unify’s walk enters its loop only for a meta.retype (resolved subst) when the substitution is empty,
and holes keeps a body with no hole.union/armFree keep the first of each id in one fold over
the sorted array instead of Array.nubBy.
Tried and reverted: a loop in place of Array.find in Grammar’s
dispatch (no measurable gain, and Grammar would pass 250 lines); a
tailRecM threadAll in place of the Thread applicative (no measurable
gain; needed a new Foldable instance).After (steady, median of 15, load average 9-11, alternating with the
baseline): parse 124 → 92, resolve 19 → 19, check 125 → 78 (infer
53 → 35, coverage 31 → 26), specialize 21 → 21, emission 43 → 27;
sum 332 → 237. Allocation (V8 total_allocated_bytes, per phase
summed) 3.3 → 2.4 GB. Isolated cold compile, nine alternating rounds
at load average 5.7 (18:29): baseline 543 504 507 517 502 495 514 512
495, median 507 ms; T003 379 368 363 385 379 376 370 362 366, median
370 ms: 1.37×, short of the 2× target. Cold phases: parse 176 → 125,
check 193 → 131, emission 61 → 42.
Verify (three consecutive npm run verify, every run reported): all
exit 0, 486 tests, zero failures, twelve regression proofs, snapshots
byte-identical. Ladder: 942 ms (load 8.9 after), 968 ms (14.7), 852 ms
(12.0); logs .build/t003-verify{1,2,3}.log. Before T003 the same test
took 1,345-1,732 ms inside verify. Two direct node --test runs during
the work, while other projects’ builds pushed the load average to
16-30, failed it at 1,659 ms and 2,573 ms (.build/t003-tests1.log,
.build/t003-tests2.log); the second also failed coverage-scale’s
5,000-field pattern (5.1 s) and fn-specialize’s 5,000-parameter keys
(2.7 s). Both pass alone (0.80 s and 3.2 s wall under load 27; baseline
0.70 s and 2.7 s in the same minute) and neither path’s timing changed
in kind; these are T003’s external-load symptom in other timing tests.
Why not 2×: what remains is spread over the combinator parser (each argument passes about a dozen Either-threaded combinator layers), monadic threading in Infer, Resolve and Specialize, coverage’s quadratic redundancy query, and GC. Options that would reach 2×, each a design change: (1) a direct token-level parser for expressions in place of the layered combinators (parse is now 35% of the cold compile); (2) redundancy for literal-only columns without one usefulness query per earlier arm; (3) fusing the checker’s remaining whole-body passes (firstTooDeep, comparable, coverage roots, instantiation’s two call folds) into one; (4) an allocation-light State/Parsed representation. BACKLOG T003 stays Open with these.
Re-run with the committed script (18:37, load average 7.03 before, 6.40
after; 7 alternating rounds against the c120d48 copy): cold baseline
513 539 504 494 520 500 501, median 504 ms; current 396 373 392 382 373
368 368, median 373 ms. Steady medians baseline → current: lex 61 → 31,
parse 136 → 96, resolve 21 → 21, check 136 → 86, specialize 22 → 21,
emit 46 → 26 ms. npm run verify with the script committed: exit 0,
486 tests, twelve regression proofs, ladder 748 ms (load average 6.05
before, 19.82 after; .build/t003-script-verify.log).
Review follow-up (2026-10-08): the independent review approved 7c6c0f5
(50,453 differential cases, 0 differences). Minors fixed: Usefulness’s
comment (once per arm, against all earlier arms); Lex spaceEnd reads
each character once (spaceStep); Check’s settle uses a new
Unify.isEmpty (test isEmpty holds exactly until a meta is bound)
instead of Subst(..); Coverage’s import order. The reviewer’s harness
is now scripts/differential.mjs (+ differential-corpus.mjs,
differential-hook.mjs; docs/engineering.md). Against the c120d48 copy,
seed 7, count 1000, harvest regenerated (3,419 parses → 2,355 distinct
sources; load average 11.6 at 18:49): harvested 2,355, fuzz 1,029 plus
1,085 isName probes, matches 1,000, mutations 1,000, 0 differences
(.build/t003-differential.log). Against a copy whose lexer no longer
treats tab as whitespace: 148 of 329 fuzz sources differ at lex, exit 1
(.build/t003-differential-broken.log). npm run verify: exit 0, 487
tests, twelve regression proofs, ladder 811 ms (load average 6.95
before, 12.03 after; .build/t003-review-verify.log).
The user chose to accept the 1.37× isolated gain (7c6c0f5; script scripts/ladder-profile.mjs, 6d0906c) and continue to FN001 Task 6. T003 stays Open with its five recorded design options; ladder in verify now 748-968 ms against 1,500. Task 6 starts after the T003 review.
Branch fn001. Reach: the whole CLI; programs with function types, lambdas, function values, partial and over-application and pipes now compile, build and run. Design §13 rules 1-8 as adopted.
Scope carries the
program’s Shape (signatures and constructors as Wrappers, the
funTypes table, and a (parameter, result) → number map); Lowered
gains wrappers, the staged wrappers its values need. New modules:
Format.Go.Value (a saturated call or construction is today’s n-ary call,
rule 1; a partial one is {f}Value(a1)…(aj); a bare reference of arity
1 is the Go function, of arity n ≥ 2 {f}Value; any other application
and over-application apply the value), .Apply (rule 6: inline up to 64
arguments, else bumpusFn{f}Apply{k} helpers of at most 64 stages
taking the value so far and their arguments’ free locals, each argument
evaluated in place), .Lambda (rule 5: bumpusFn{f}Lambda{k} of its free
locals, ascending, then its parameters, _ for a discard; the value is
the wrapper applied to the free locals through .Apply, or the function
itself with no free local and one parameter), .Pipe (rule 7), .Stage
(rules 2-3: one bumpusNode{N} per distinct argument type of all
wrappers, {f}Value, {f}Stage{k}) and .Entry (rule 4: package-level
{f}Kinds/{f}Slots, one array per distinct type, one loop, one n-ary
call). Capture gains lambdaFree (a lambda’s named parameters are bound
in its body; a set, so a wide lambda is not quadratic) and without.
Expression dispatches every node by an explicit arm (the temporary
wildcard is gone); Compare’s TFun arm and a new explicit Show TFun
arm emit malformed for a function field (never compared or printed,
design §3, but every declared type gets both helpers). Emit order: node
types after the function types, wrappers after the functions. A program
with no function value emits no node, stage, entry or table: the four
bootstrap snapshots are byte-identical (compiler, shapes, tree and
lists tests). Usage and Layout needed no change.{f}Arrow{k} type; every other stage uses the
interned bumpusFun{N}, found by number, so uses and the wrapper agree.
(2) The pipe’s temporary is the parameter bumpusPipe of a lifted
bumpusFn{f}Pipe{k} (free locals, then the operand), not an
immediately invoked closure, so pipe chains nest no closure; a literal
or local left operand is spliced in as the last argument. In both
cases a right side g(b1…bk) with k < n becomes g(b1…bk, v), so
xs |> take(3) is a direct call. (3) Matches, lambdas, pipes and
helpers share one pre-order counter per function. (4) Entries’ tables
are int32, not uint16 (no 65,536-type ceiling). (5) Helper bodies
are one chained expression, not one statement per stage as in Task 1’s
prototype. (6) Wrappers are emitted once each by name, in first-request
order; node types are numbered in first-appearance order. (7)
test/fn-lambdas.mjs now holds Task 5’s lambda wrappers, shared by
test/fn-representative.test.mjs and test/fn-run.test.mjs (moved, not
changed).checked
function programs stop at the unlowered guard), each E_INTERNAL
unlowered function at the span shown, now compiling and printing:
(fn(x) => x)(1) (1), 1 |> add(2) (3), id(add)(1, 2) (3),
add(1)(2) (3), match add(1) { _ => 0 } at add(1) (0), type T =
T(Int -> Int); fn main(): Int = 0; at T(Int -> Int) (0), fn f(g:
Int -> Int): Int = 0; fn main(): Int = 0; at the declaration (0).
test/specialize.test.mjs’s monomorphic-identity set excludes the new
polymorphic examples/functions.bumpus, as it excludes lists.bumpus (its
first verify run failed on the new example’s arrow table,
.build/fn001-task6-verify1.log). No other existing assertion changed.unlowered
function): test/fn-timing.test.mjs, 6 of 6
(.build/fn001-task6-red-timing.log): named value use(stuck), lambda
use(fn(x) => stuck(x)), partial strictness ignore(k3(probe(1))),
pipe order probe1(1) |> g(probe2(2)), helper order (a 65-argument
application of w, whose body is entered at its second stage, before a
third argument’s probe) and sharing (twice(k3(probe(10))) prints 30
with probe entered once in the trace); test/fn-run.test.mjs, 22 of 22
(.build/fn001-task6-red-run.log); test/fn-scale.test.mjs, 1 of 1
(.build/fn001-task6-red-scale.log). After implementing, two structural
rows in fn-run failed because the test assumed declaration-order ids
(a generic length is numbered after the monomorphic functions); the
ids in the tests were corrected, not the assertions.func(x) … { return
func(y) … { return F(x)(y) } }): named value fails (exit 0); a
hoisting application helper (each block’s arguments bound before its
stages): helper order fails (probe2 entered first); lazy partial
arguments (a partial call as nested closures around the saturated call):
partial strictness fails (exit 0) and sharing fails (trace
[3 2 0 1 0 1], probe twice); a rewritten pipe (left operand spliced in
place, no temporary): pipe order fails (probe2 first). Every other
probe passed under each mutant.go build
4.0 s against the 10 s bound (2.8 s for the same program with the
direct call only); the test logs its build time. A first body with
if terms (3,333 immediately invoked closures) built in 5.8 s (4.5 s
direct only); replaced before any verify.forms and test/depth.test.mjs. Re-measured in an isolated copy with
the limit lifted, every form, and the old forms also on an isolated
build of 97740c6: FN001 forms 1,507 / 812 / 607 / 607 / 343; old forms
unchanged by the lowering (within 5); minimum 276
(constructor-argument; 274 at 97740c6), limit 128 unchanged, no
anomalies. The drops since ADR 006’s G001 table (e.g. plus-chain
2,928 → 1,564, constructor-argument 304 → 274) predate Task 6.rm -rf output && npm run verify exit 0, 526 tests (487 at 97740c6,
minus the guard test with its 7 rows, plus 6 timing probes, 22 run
tests, 1 scale, 1 snapshot and 10 CLI depth tests), zero failures or skips,
twelve
regression proofs, the four bootstrap snapshots unchanged; the match
ladder 542 ms; twenty thousand parameters 220 ms; the 5,000-parameter
go build 6,799 ms against its 10 s bound (4.0 s alone; BACKLOG T003
records the margin); load average 1.79 before, 6.71 after
(.build/fn001-task6-verify3.log; earlier green run
.build/fn001-task6-verify2.log). Usage and Layout unchanged.bare <$> named inner map layer, P001 for plus-chain). Fix: named
builds its Primary itself (Format.Parse.Expression; productions stay
applicative). Isolated copies, limit lifted, two alternating rounds:
constructor-argument 275 → 283, call-argument 315 → 326, parens 522 →
522; minimum 283. Differential, d2cf616 plus only the parser change
against d2cf616 (seed 6, count 10,000): 32,403 sources and 10,085
probes, 0 differences (.build/fn001-task6-fix-differential-parser.log).
BACKLOG G002 tracks recovering Task 3’s ~24 levels. Minors: Stage no
longer declares {f}Arrow1, which no stage names (only a helper’s
signature can; it now spells func(A1) <next>); bootstrap/functions.go
loses its one unused bumpusFn6Lambda0Arrow1 line. The full
differential against d2cf616 shows that change alone: harvested 235 of
2,374 sources differ, all at emit, and a scratch check finds every
candidate emission equal to the baseline’s with the Arrow1
declarations removed and their uses spelled out (1,287 compiled, 0
unexplained); fuzz and matches 0 differences; mutations 4 (seed 1) and
32 (seed 6), the shown ones all at emit (.build/fn001-task6-fix-
differential{,-10k}.log). The --regenerate harvest’s own test run
exited 1; differential.mjs discards its output, so the failing test is
unknown (it ran the full suite in parallel under the hook). Apply’s
blocks push their lifted functions, frees and wrappers onto a stack and
concatenate once (was O(blocks × lifted)). test/fn-specialize’s stale
guard comment and support.mjs’s goTest =( spacing are fixed.go build 10584 ms, bound 10000, at
load average 18.3 with only verify’s own runner. The same mixed-body
program builds in 1.8 s at 2,500 parameters, 4.4 s at 5,000 (direct
call only 3.0 s), 17.9 s at 10,000 (direct only 11.2 s); at 20,000 the
Go compiler was killed at 7.4 GB RSS, with the direct call only too.
The cause is the n-ary body’s 2n-term bumpusAdd tree in one Go
expression (the existing lowering of +), not Task 6’s staging.
Recorded in BACKLOG T003.rm -rf output && npm run verify exit 0,
526 tests, zero failures or skips, twelve regression proofs; the
5,000-parameter go build 7,467 ms against 10 s; the match ladder
1,030 ms; load average 3.15 before, 5.34 after
(.build/fn001-task6-fix-verify.log). Run once.During the Task 6 review fixes, scripts/differential.mjs --regenerate
ran the full test suite under its harvest hook and that run exited 1;
the tool discarded the run’s output, so the failing test is unknown
(likeliest a load-sensitive timing test, BACKLOG T003, unconfirmed). The
tool now writes the run’s output to <harvest>.jsonl.log and prints the
failing test names. One rerun afterwards (load 3.3 before, 9.1 after)
exited 0: 2,374 harvested sources, 0 differences against itself.
User decisions (2026-10-09): (A) the 5,000-parameter go build test
failed once at 10,584 ms against 10 s under verify’s own parallel load
(4.0-4.4 s alone); bound and workload stay, and go build-timing scale
tests now run in a separate serial phase: scripts/verify.mjs runs
test/*.serial.test.mjs after the parallel node --test run with
--test-concurrency=1, still discovered by pattern (docs/engineering.md).
(B) At 20,000 parameters the mixed body’s 2n-term bumpusAdd tree in one
Go expression kills the Go compiler (7.4 GB) even for direct calls only,
pre-existing lowering, not FN001 staging (BACKLOG G003, new). The
milestone therefore tests FN001’s machinery at full width with bodies
that read six parameters (first and last three, mixed kinds).
go build timer moved out of fn-scale),
test/fn-linear-forms.mjs, test/fn-linear.test.mjs (20,000, parallel),
test/fn-linear.serial.test.mjs (80,000, serial, about 11.5 s),
scripts/fn-milestone.mjs, scripts/verify.mjs.go build bound 10 s):
5,000-parameter mixed body, direct and value, phases 1,240-1,260 ms,
build 4.0-4.3 s; f(1)(2)…(1000) 74-85 ms, 0.40-0.45 s; a written
Int -> … -> Int of 1,000 parameters 65-77 ms, 0.41-0.44 s; a
5,000-parameter function type through id and Box(a), whole and as
a half partial, 529-581 ms, 2.4-2.5 s. The shared partial (completed
twice) is in the milestone’s wide program; the 5,000-parameter
mixed-body test keeps its workload, so its partial is covered at
5,000 by the generic program’s partial instead. The existing
20,000-parameter and 4,000-Nil tests are unchanged.f(1) (E_TYPE) 175/525, f(1) 310/930,
f(1…n-1) 225/675, (f)(1…n) 370/1,110, pipe 250/750. At 80,000 all
eight finish with the expected outcome, about four times as long.spineThrough as recursion with Array.cons):
6 of 8 forms at 20,000 fail with RangeError (stack); spelling-based
arrow keys (Specialize.Intern keyed by the expanded spelling of each
suffix): 5 of 8 fail with RangeError; derived Eq/Ord on Domain.Type
Ty restored: survives all Task 8 tests (fn-linear at 20,000 and
80,000, fn-scale.serial, large-source, fn-specialize, fn-check), so
no Task 8 form compares long source arrows with Eq/Ord (the
specializer compares interned IR numbers). Not pursued further (user
limited Step 2 to three mutants); open for Task 9’s review. Nested
closures were not rerun.node scripts/fn-milestone.mjs, 20,000
parameters, CLI emit then go build with a 100 s timeout; load 3.1
before, 5.4 after; .build/fn001-task8-milestone.log), all ok: wide
(direct, value, shared partial) emit 2.4 s, build 13.7 s; chain 0.7,
7.6; curried 0.8, 7.5; generic 2.0, 12.1; value 0.7, 6.8; over 0.8,
7.0; lambda 0.8, 6.6; f(1) 0.7, 6.1; f(1…n-1) 0.5, 7.0;
(f)(1…n) 0.7, 6.8; pipe 0.4, 0.3 (the pipe is a direct call: no
staged wrapper is emitted).rm -rf output && npm run verify exit 0 in 1:53 (load average
3.69 before, 4.97 after; .build/fn001-task8-verify.log): parallel phase
533 tests, serial phase 12, zero failures or skips; serial
5,000-parameter build 4,733 ms; match ladder 735 ms; twenty thousand
parameters 221 ms._ parameters), staged application one argument at a time
(a body runs exactly when its stage boundary completes), strict
partial application, over-application, |> with the left operand
first, then the callee and its explicit arguments, and an enters
trace (declaration positions) with optional probes that stop the run
on entry. test/poly-parse.mjs now records constructor field counts.30 [3 0 2 1 1]); the
generated property failed._, capturing match binders), partial and
over-application of functions, constructors and lambdas, constructor
values (flip(Cons), Pair(n)(b), compose(adder, f)) and pipes.
test/fn-oracle.test.mjs runs them in one Go batch against the
interpreter (failures print seed and source) and checks every form
occurs. All 30 agree; no compiler bug found.interpreter agrees: pipe order (and Task 6’s
Go probe). The generated comparison does not see it: generated
programs terminate and have no effects, so pipe order is not
observable in their values; timing stays the probes’ job.rm -rf output && npm run verify exit 0 (load average 3.01 before,
5.77 after; .build/fn001-task7-verify.log): parallel phase 541 tests,
serial phase 12, zero failures
or skips.printed now runs through a shared ran):
stage-value (Format.Go.Expression: a bare arity-1 function whose type
has two or more parameters lowered as a two-level eta adapter; probe
use(stuck) must panic in stuck), stage-lambda (Format.Go.Lambda:
the same adapter around a one-parameter lambda’s lifted function),
partial-strict (Format.Go.Value: a partial application wrapped in a
closure awaiting its next argument, so its arguments run late),
pipe-order (Format.Go.Pipe: every pipe spliced as the call),
lambda-capture (Format.Go.Capture lambdaFree keeps parameters),
fun-compare (Check.Comparable drops the function test),
block-order (Format.Go.Apply: a helper binds its block’s arguments to
variables before applying), value-edge (Check.Instantiation: bare
references and lambda bodies are no edges; mutant outcome More than
10000 specializations), functional-fixpoint (Check.Functional
returns its seeds), arrow-key (Specialize.Intern keys an arrow by
TInt and its result). Timing probes use test/support.mjs
panicOnEntry. Deviation: as built there is no uncurried value
representation, so stage-value/stage-lambda restore the defect’s
effect (eta expansion to the type’s arity) instead. The lowering
mutants’ Go builds, so those probes fail on behavior (0 printed, or
the wrong probe label); lambda-capture and arrow-key fail at Go
build, inherent to those defects. node scripts/regression.mjs
name… now proves only the named rows.Eq/Ord on Domain.Type Ty): rebuilt in
a scratchpad copy with both instances derived; test/type-order.test.mjs
(Task 2) fails 2 of 5 (RangeError on 20,000-long spines), so verify
already catches it; Task 8 had run five other files only. No pipeline
phase compares long source arrows with Eq/Ord: the same mutant
compiles a program unifying two 20,000-parameter written arrows with a
20,000-parameter function (and same(h, h)) correctly. No new test
added, since no pipeline test can observe that defect.wrapperCode emitting the
wrapper as nested Go closures, no nodes or entry) against
test/fn-scale.serial.test.mjs, once (load 2.5 before, 2.9 after): the
5,000-parameter value and the 5,000-parameter generic function type
fail, go build killed at the 120 s timeout (bound 10 s); the
1,000-partial chain (9,315 ms) and the 1,000-long arrow (6,325 ms)
pass, against 542 and 575 ms healthy in the verify below.rm -rf output && npm run verify exit 0 in 150 s (load average 2.39
before, 8.44 after; .build/fn001-task9-verify.log): parallel phase 541
tests, serial phase 12, zero failures or skips; twenty-two Regression
proof (…) lines; serial 5,000-parameter build 4,423 ms; match ladder
640 ms.Fresh reviewer, whole diff 2a61a2b..e2a6735: ready to merge, no Critical or Important findings. Verify in an isolated copy: exit 0, 541 + 12 tests, 22 proofs. Six adversarial cross-task programs matched the interpreter including entry order; 2,300 extra generator seeds matched; ~46,000 sources against a main build: 0 Go differences among sources main accepts, none newly rejected, every non-syntax diagnostic change a design §9 row. Minors fixed: language.md hint condition (M1), generator label (M3), ADR 008 note on syntax diagnostics of invalid sources (M6), BACKLOG T005 for the unidentified harvest failure (M5; renumbered at the merge because main had added its own T004); deferred to BACKLOG FN006: interpreter zero-argument calls (M2), splitting the value-edge row (M4), fn-linear bounds in the parallel phase (M7). Awaiting the user’s merge decision.
At the user’s request, language-direction records proposed do notation
as an expression elaborated into bind and lambdas, with an illustrative
block and its expansion. Result binding, discarded results, final
computation and the distinction between constructing and running deferred
effects are explained. Service/error inference is a goal; bind/pure
selection, binding rules and monadic versus algebraic effects stay open.
This is direction only, with no compiler change or implementation
authorization. Next-session and the FX001 backlog row point to the proposal.
Verification: npm run verify exited 0 with 318 tests, no failures or
skips, and all twelve regression proofs; evidence:
.build/fx001-do-docs-verify.log. The proposed notation is not implemented
or behaviorally verified by this suite.
The user asked to preserve the algebraic-effect/open-row discussion and
defer explicit effect-row constraint syntax to a future feature. The
language-direction document now records direct-style handler evaluation,
candidate Log + ...effects notation, inferred higher-order effect
relationships and proposed implicit universal row quantification. It
distinguishes record rows and R001’s lacks constraints from effect rows.
Outer syntax, quantifier scope and handler semantics remain design work;
no compiler change or implementation authorization. BACKLOG and the
next-session handoff record the future constraint-syntax scope.
Verification: npm run verify exited 0 with 318 tests, no failures or
skips, and twelve regression proofs; evidence:
.build/fx001-row-direction-verify.log. This verifies the existing
compiler, not the proposed effects or notation.
The user’s error-widening question revealed that earlier direction only
mentioned extensible errors generically. Read-only inspection of MileAhead
(../trailmapper, as recorded in provenance) confirmed open error-family
rows, caller composition without conversion wrappers, context-only
wrapping, and closure at handling/test boundaries. Language-direction now
records this brief and independent Bumpus syntax candidates hiding Variant
and injection plumbing. FX001/R001 must resolve error-sum support against
the current general-variant deferral; no feature scope or code changed.
Provenance, BACKLOG and the next-session handoff track the design work.
Clarified after the user’s follow-up: errors is an ordinary implicitly
universally quantified row-variable name, not reserved or existential;
only the spread punctuation is special syntax in the proposal.
Verification: npm run verify exited 0 with 318 tests, no failures or
skips, and twelve regression proofs; evidence:
.build/fx001-error-rows-verify.log. Proposed error sums remain unimplemented.
The user requested planning for common PureScript/Haskell FP helpers with
approachable Rust-informed names. Added STD001 and a dedicated direction
document covering optional/result eliminators, defaults, transformations,
functions, sequences, text, maps/sets and generic collection operations.
Candidate names distinguish getOrElse from full branch elimination and
make eager/lazy evaluation explicit. Delivery follows FN001 and stages
other APIs by their prerequisites; no compiler or helper implementation.
Acceptance requires an upstream coverage matrix, readable examples,
behavioral/law tests and explicit deferrals. Handoff and language-direction
link the brief; exact public names still need reviewed API designs.
Verification: npm run verify exited 0 with 318 tests, no failures or
skips, and twelve regression proofs; evidence:
.build/std001-direction-verify.log. Helpers are planned, not implemented.
The user clarified that approachable naming must preserve theoretical
rigor and HKT-based shared operations. STD001 now pins generic bimap over
any lawful Bifunctor, shared Functor/Applicative/Monad contracts, required
constructor kinds and partial type application, and coherent instance
evidence under the current rank-1/specialization constraints. Concrete
helpers are incremental delivery, not completion of the generic library.
Acceptance includes generic clients, user-defined product/sum instances,
algebraic law properties and cross-operation coherence; pure callback laws
remain distinct from FX001 effectful sequencing. BACKLOG and handoff track
the clarification. No language or library implementation changed.
Verification: npm run verify exited 0 with 318 tests, no failures or
skips, and twelve regression proofs; evidence:
.build/std001-generic-rigor-verify.log. Generic APIs and laws above are
future acceptance requirements, not implemented or proven by this run.
The user asked for a structured audit of leading language specifications
and library/runtime designs. Existing STD001 only audited helper coverage;
there was no broader systematic plan. Added LA001 covering all twelve
named references, a versioned primary-source/section ledger, comparative
briefs, decision and interaction matrices, practical application scenarios,
independent review and durable scope decisions. Primary landing pages were
checked to assemble the roster; detailed reading/audit is not complete.
Relevant findings feed upcoming designs without expanding FN001 or revoking
existing advanced-feature deferrals. BACKLOG and handoff track the plan.
Verification: npm run verify exited 1 with 316 of 318 tests passing,
no skips, and two large-source timing failures (6.572 s and 5.633 s against
5 s bounds). Regression proofs were not reached. Evidence is
.build/la001-plan-verify.log; BACKLOG T004 records the cases, unconfirmed
cause and diagnostic next action. No checks or assertions were changed,
and no rerun concealed the failures. The audit itself remains planned.
The user requested highlighting/IDE support, first-class doctests,
property-based testing, possible literate capabilities, and LLM
skills/discoverability. Added distinct IDE001, DOC001, PBT001, LIT001 and
AI001 entries with docs/plans/2026-10-08-tooling-direction.md. The brief
records outcomes, proposed acceptance and dependencies without selecting
syntax, tool protocols or implementations; literate capabilities remain
exploratory. LA001 now includes these concerns in its comparison axes and
application scenarios. Updated language direction and next-session handoff.
No language/compiler code changed and FN001’s delivery is unchanged.
Verification: npm run verify exited 0 with 318 tests passing, no failures
or skips, and all twelve isolated regression proofs passing; evidence:
.build/tooling-direction-verify.log. This checks the existing compiler,
not the proposed tooling. T004’s earlier timing failures remain recorded
and unresolved; this successful run does not establish their cause.
The user requested distinguishing Bumpus libraries compiled to the host
target, FFI bindings and dependency-inverted services implemented through
host-language libraries, then added package management. Recorded PKG001
in the tooling brief and backlog; updated LA001, language direction and
handoff. Planning includes source packages/host-callable export assessment,
service contract/provider substitution, combined host/Bumpus dependency
resolution, manifests/locks, identity, compatibility and target/runtime
availability. Effect Platform’s primary introduction was checked as a
conceptual precedent; its mechanisms are not adopted. No compiler code,
package manager, binary ABI or provider mechanism is implemented/selected,
and FN001 scope is unchanged.
Verification: npm run verify exited 0 with 318 tests passing, no failures
or skips, and twelve isolated regression proofs passing; evidence:
.build/pkg001-direction-verify.log. This validates existing behavior,
not the proposed package/interop features. T003/T004 remain open.
User approved merge and push. main had gained eight docs-only planning
commits (2190c8f..340953a: FX001 do notation, error rows, STD001, LA001,
tooling, PKG001); they were merged into fn001 (9527233). Conflicts: the
T003 row (fn001’s extends main’s; kept fn001’s) and two different T004
items (main’s large-source timing item kept as T004; fn001’s unidentified
harvest failure renumbered T005); progress kept both sides. Clean rm -rf
output && npm run verify on the merged tree: exit 0, 541 + 12 tests,
twenty-two proofs (.build/fn001-merge-verify.log). main fast-forwarded to
fn001 and pushed to origin; worktree and branch removed.
Branch fx001. No compiler change. Added scripts/effect-probe.mjs (driver:
explicit build 300 s / run 120 s timeouts, five repetitions, checksums
verified, load averages before and after each batch),
scripts/effect-runtime.mjs (Go prelude: bumpusCtx list, non-zero-sized
bumpusMarker, bumpusAbort, lifted bumpusHandle returning
(result, abort), bumpusCleanup, defect report and main wrapper),
scripts/effect-semantics.mjs (Step 2 programs and independently written
expected output) and scripts/effect-programs.mjs (Step 3 loops and the
generated lifted-helper program). Semantic checks: all 7 modes pass (clause
reaches the outer handler; aborts cross unrelated and same-key inner
handles to their target; clause failures after the helper returns reach
the outer handle; nested blocks unwind LIFO; cleanup that handles a
failure internally lets the abort continue; two cleanup failures print the
three confirmed report lines in order, exit 1; normal-exit cleanup
failures; crash not caught by handle with cleanup run; guard line; 1,000
markers distinct). A first run of abort failed on my own expected output
(two nested blocks give d2 d1 d2 d1, I had written one pair); corrected
the expectation, not the program. Two mutants (handle catching every
abort; clause run in its own context) each fail their check (scratchpad,
not committed). A second full run reused Go’s build cache (identical seed
per repetition; 0.2-0.4 s builds) and was discarded; the seed now varies
per run. Measurements (.build/fx001-task1/run3.log): median go build 0.83 s
/ 1.53 s / 2.91 s at 1,000 / 2,000 / 4,000 helpers (bound 10 s). Decision:
ADOPT the shapes. Details in findings “FX001 Task 1”.
Branch fx001. No existing test assertion changes; the five bootstrap snapshots are byte-identical (verify’s snapshot tests).
effect handler handle with let defer
Unit ctl resume at once (controller ruling; pure stays a name).
Domain.Syntax gains UnitRef, UnitValue, Block and Item (Let,
Discard); the new Format.Parse.Block parses {} (Unit), items
separated by ; (a trailing ; makes the value UnitValue at the
closing }, which marks the block trailing; { let x = 1 } is E_SYNTAX
Expected ; at }) and (); { joins the loosest expression dispatch,
every item nested (128 nested blocks parse, 129 are E_NESTING). Domain.Type
and the IR gain TUnit (Go struct{}, value struct{}{}); Resolved,
Checked and IR gain UnitValue, Block and Item. Features.Resolve.Block
threads the scope through the items (new Fresh thread, a balanced
traverse); a let is in scope for later items only, shadowing as a match
binder, its LocalId taken before its expression’s binders. The resolver’s
scope and the checker’s locals became maps (by name, by LocalId) so a
20,000-let block costs no scan per lookup. Features.Check.Block: let is
monomorphic, discards may have any type, the block’s type is its value’s.
Check.Hint adds TrailingSemicolon (rendered ; remove the trailing ;?)
on a mismatch whose found expression is a trailing block. Unit is
comparable (always equal; ordering lowered through an inline
func(struct{}, struct{}) int so both operands still run) and prints
(). Format.Go.Block lifts each block to bumpusFn{f}Block{k} (pre-order,
counter shared with Match/Lambda/Pipe/Apply), captures in LocalId order
(Capture withoutAll), each let a typed var plus _ = x (typed
because an arity-one function value is a lifted Go func of unnamed type;
the brief’s x := would leave it unnamed), _ = e for let _ and
discards, return the value. A Unit main emits func main() {
bumpusFn<n>() } and prints nothing; import "fmt" is emitted only when
main prints or a printer appends an Int/Bool field. The style gate’s
applicative-module list adds Format.Parse.Block. The interpreter
(test/poly-parse.mjs, test/poly-oracle.mjs) reads and runs blocks, let,
(), {} and f() calls.1 + { 2 } was already Expected an
expression at {, kept as a characterization row); log
.build/fx001-task2-red.log. One test-construction slip fixed after GREEN
(the () and f() rows pointed at the first occurrence, inside main()
and fn f()). The 20,000-let timing test moved to
test/fx-block.serial.test.mjs after the first verify: under the parallel
run it took 999 ms against its 1,500 ms bound (load about 5).{ 1; () } row); a let never entering scope (2 run rows); Unit
ordering returning 1 (the two boxed <=/> rows); Unit main printing
(both silent-entry rows).rm -rf output && npm run verify exit 0: 626 parallel tests and
13 serial (was 541 + 12; +85 and +1), zero failures/skips, twenty-two
regression proofs, load 3.6-6.1; the serial 20,000-let test 535 ms of
1,500 (log .build/fx001-task2-verify2.log; the first run, before the
serial split, .build/fx001-task2-verify.log, also exit 0).Branch fx001. Behavior-preserving: no syntax writes a row yet; every
existing TFun carries the closed empty row and every TData empty row
arguments. No existing assertion changes; the five bootstrap snapshots are
byte-identical (verify’s snapshot tests).
TypeId, moved and re-exported by
Domain.Type; EffectId) and Domain.Row (Row t v, Label t,
EffectRef, LabelKey, TypeHead, labelKey, closedRow, openRow,
isPure; parameterized over the argument type, so Domain.Type imports
it; Row hides Prim’s). Domain.Type: TFun (Ty v) (TyRow v) (Ty v),
TData TypeId (Array (Ty v)) (Array (TyRow v)), THandler (Label (Ty
v)) (TyRow v); the Monad/Bind instance is gone, replaced by sort-aware
substitute/substituteRow over Substitution v w = { types, rows }
(a row tail splices its image: labels appended, its tail the new tail);
Functor is substitute with TVar/openRow. Spines are walked as
arrow nodes (stagesThrough, foldStages: no record per arrow);
spine, arrows, ground, children, rowsOf, rowArguments and
typeHead moved to the new Domain.Type.Parts (250-line limit). The
checker’s substitution moved to Features.Check.Subst (Subst { types,
rows, fresh }: fresh row metas count down from -1, apart from the
checker’s, which count up; walkRow, resolveRow), binding and the
depth bound to Features.Check.Binding (bindType, extendRow,
bindTail, exceedsLimit counting label arguments one level deeper),
both re-exported by Features.Check.Unify, whose TFun, TData and
THandler cases unify rows through the new Features.Check.UnifyRow
(Leijen 2005 §7, a tailRec loop over labels, first occurrence by key,
the side condition tail(r1) ∉ dom(θ) in both the rewrite and the
left-over-entry cases; unifyRowsTraced also returns RowEvents by
OccurrenceId, Features.Check.Occurrence; Features.Check.RowSide holds
the operand walk). Failure gains RowMissing, RowExtra,
RowSharedTail and RowMismatch (tails alone differ: not in the brief,
needed for closed against rigid); Require reports each as the existing
whole-type E_TYPE mismatch. Specialize erases rows; THandler is an
Internal error in Lower and Require and abstract to coverage until Tasks
5 and 6. Scheme numbers row holes with type holes. Regression row
occurs now mutates Features.Check.Binding.Clock + ...r/Log + ...r and for a left-over
entry, both in a child process with a 20 s timeout (the generated test
then refuses to run if it failed), RowMissing/RowExtra/
RowMismatch, 1,500 generated pairs (959 unify; 54 RowSharedTail)
against the independent recursive oracle test/row-oracle.mjs (same
acceptance, symmetric acceptance, scoped-label equality, acyclicity,
equal normal forms up to renaming), 1,000-label rows, arrow rows in
unify (occurs and depth through label arguments), traced events, and
five substitution laws. Test support only changed elsewhere: value
construction gains row arguments, two renderers (test/fn-shape.mjs,
test/fn-checked.mjs) leave out pure rows, and imports follow the moved
names.findLastIndex): three tests fail.where binding resolving both
types on every expectType (the mismatch message) made the occurs
regression mutant overflow instead of reporting, and cost about 2x in
Require; it is a function now. A helper frame per applied level in
unify overflowed test/unify-arrow at 1,000 levels; the fold is back in
unifyHeads. compare on applications compares row arguments before
type arguments so the recursive comparison stays last.compare change) against an
isolated build of e110526 (ms, medians): value 415/403, over 605/534, lambda
542/539, mismatch
181/161, partialFirst 423/396, partialAll 300/289, parenthesized
397/400, pipe 289/309. Minimum --stack-size for test/poly-depth’s
1,000-deep check: 575 KB (was 559).rm -rf output && npm run verify exit 0: 640 parallel tests
and 13 serial (was 626 + 13; +14), zero failures/skips, twenty-two
regression proofs, load 2.0-5.9 (log .build/fx001-task3-verify2.log; an
earlier run, .build/fx001-task3-verify.log, failed only the occurs
proof above).User approved the Bumpus -> Waxwing / .wxw migration and subagent help.
Work uses the existing isolated FX001 tree at 3481468 (Tasks 1-3), with
main and its pre-existing editor setting untouched. Separate agents handled
current documentation and test identity edits; a fresh read-only reviewer
found only a stale Provisional name sentence, which was corrected.
CLI is scripts/waxwing.mjs, npm script waxwing; packages are waxwing, waxwing-style and waxwing-bootstrap. Renamed nine example/negative sources; updated Go names/panics, temporary prefixes, harvest instrumentation, current documentation, active FX001 documents, backlog and handoff. Historical plans/progress/findings, prior naming evidence and branding provenance remain. ADR 009 records the decision. No semantics, verbs, aliases, extension-based rejection or final artwork were added.
Evidence so far:
npm run verify exited 1: 638/640 parallel tests
passed; fn-linear lambda 1604.135291 ms > 1545 ms and mismatch
819.499333 ms > 525 ms. Serial tests/proofs not reached; FN006 owns the
recorded failure/next action. Log .build/waxwing-baseline-verify.log.npm run build then passed with zero
warnings/errors, .build/waxwing-build.log.npm run --silent waxwing -- run: outputs saved in
.build/waxwing-examples.json. Program/compiler/shell tests: 21 passed,
no failures/skips, .build/waxwing-cli-green.log.npm run verify exited 1: 639/640 parallel tests passed;
twenty thousand declarations compile and run took 5.106579416 s > 5 s.
Serial tests/proofs not reached. Log .build/waxwing-verify.log; T004
records the timing failure rather than concealing it with a rerun.No whole-suite success, merge, commit or push is claimed by this entry.
The user confirmed the other worker paused. Its eight changed source files remain byte-identical to .build/waxwing-paused-files.json; no worker edit was reverted or folded into the rename’s semantic claims.
npm run verify builds with zero warnings/errors,
passes strict-rebuild/structural gates and 634/640 parallel tests. Five
fn-linear bounds fail (exact timings in FN006); unify-row’s deferred-Fail
assertion expects RowMissing but receives Subst. R003 records the worker’s
remaining test/settlement next action, without changing its assertion.
Log .build/waxwing-paused-verify.log. Serial tests/proofs not reached.npm run verify builds with
zero warnings/errors, passes strict-rebuild/structural gates and 639/640
parallel tests. Only pipe at 20,000 parameters exceeds its unchanged
750 ms bound (942.893 ms); .build/waxwing-isolated-verify.log. FN006 owns
this existing parallel-timing exposure. No whole-suite green is claimed.The original 3481468 compiler was rebuilt in .build/waxwing-baseline-compiled for a differential comparison. Its first scratch build failed because the copy omitted tools/style/src (.build/waxwing-original-build.log); supplying that unchanged directory fixed the setup, and the next build passed with zero warnings/errors (.build/waxwing-original-build-fixed.log).
A scratch copy of scripts/differential.mjs normalizes only Bumpus/Waxwing and bumpus/waxwing in emitted-Go hashes; all seven phase comparisons and diagnostic comparisons remain. The full harvested corpus comparison was interrupted (status 130) after several minutes without a report; T006 owns the investigation. The bounded comparison used sources up to 20,000 characters (2,433 captured sources, 53 stress sources outside this optional comparison only). It exited 0: 2,433 harvested, 1,029 fuzz, 1,000 match and 1,000 mutation sources, plus 1,085 isName probes; zero differences. Log .build/waxwing-differential.log; scope .build/waxwing-differential-scope.json. The bounded run had already completed when an interrupt was requested. A redundant memoized-hash scratch experiment was then stopped (status 130) and is not validation evidence; the final scratch checker was restored to the successful version. No maintained differential check was weakened.
Final smoke: live npm waxwing run examples/answer.wxw prints 42; all eight paused worker files still match their saved hashes; current branding assets match the user-supplied originals (.build/waxwing-final-smoke.log). The user confirmed the visible logo files are right. Read the supplied Claude continuation prompt and the local SDD ledger; they corroborate the paused Task 3 review-fix state. No further effects implementation was started by this rename task.
Rename implementation is complete on fx001. Full verification is not green: the isolated rename tree has the recorded pipe timing failure, and the live combined tree also contains the unfinished deferred-row test mismatch plus timing failures. Serial continuation (13) and all twenty-two regression proofs pass; earlier failures remain recorded. The rename and eight preserved FX001 worker files remain uncommitted; main is unchanged. For the continuation, commit the rename separately from Task 3 review fixes; finish those fixes/tests and re-review before Task 4. No merge or push.
The user resumed FX001 after the rename’s separate commit 40cf312. Preserved and completed the eight paused source files: deferred Fail keys postpone the whole original row equation with type/row/fresh/event rollback; settleRows retries after other constraints and preserves undecidable pairs; groundErased is used only for Seeds/Resolve monomorphism while strict ground remains strict. RowOccurs distinguishes a row’s occurs failure. The left-over-right path also needed a deferred-key guard: new tests first failed 9/10 with RowExtra, then passed after that guard. Exact closed/open reflexivity, one-Fail settling, closed deferred right, never-skip-first, rollback, retry, arrow continuation and erased grounding cases are covered.
The independent transactional oracle now models rollback, postponement and settling. Generators include deferred Fail arguments, same-family Error(Int)/Error(Bool), arrow label arguments and nonempty starting type/row substitutions. Original 1,500-pair solved laws (including symmetric acceptance and scoped equality) remain; 2,000 further pairs in both directions distinguish pending acceptance from solved equality and compare settling after ordinary constraints. Focused run: 44/44 pass, no skips (.build/fx001-task3-fix-focused.log). Seven isolated source mutants all compiled successfully then failed intended assertions; full logs/results in .build/fx001-task3-fix-mutants, summarized in the local Task 3 report.
Verification history retained:
The row fix is verified through direct semantic tests/oracles; no syntax can create nonempty effect rows yet. Task 5 must settle after body constraints and diagnose remaining unknown families. Deferred equations currently carry no spans/provenance; Task 9 must preserve/recover origins when integrating traced retries. UnifyRow is 249 lines. Both are explicit handoff concerns, not claims of completed later tasks. Active effects ADR references now use 010 (009 is naming). Ready for independent review before Task 4; no merge or push. Local report/ledger: .superpowers/sdd/2026-10-09-effects-plan/{task-3-report,progress}.md.
Implemented sorted signature variables with one rigid ambient row, explicit rows, declared operations, stage consumption, Console print and Unit entry output. Rows erase from specialization arguments. Field and operation arrows default to pure, with declared effect names available; lambda annotation omissions share the lambda’s own fresh ambient row. Program.Compile explicitly rejects user effects before specialization; handlers and user effect execution remain later tasks. Wire diagnostics carry related: [] with existing messages and spans preserved.
Clean-output npm run verify exited 0 (.build/fx001-task4-verify.log): zero build warnings/errors, formatting/structure/strict-rebuild gates, 672 parallel tests, 22 serial tests, no failures or skips, and all 22 existing actual-source regression proofs. Four additional isolated actual source mutants built and failed their named regressions: lambda annotation omission, 20,000-arrow row collection, row argument erasure and effect names in field types (.build/fx001-task4-sensitivity/{results.json,*-test.log}). Earlier failed runs remain documented in the local Task 4 report; no unchanged rerun hid a failure. Concrete malformed-input validation gaps are BACKLOG FX004, with reproductions and the Task 5 next action. No merge or push. Implementation/evidence: .superpowers/sdd/2026-10-09-effects-plan/task-4-report.md.
Implemented handler values, with, handle, and fail through Parse,
Resolve, and Check. Handler clauses are checked against declared operations;
with consumes the handler capability while preserving the outside row;
handle settles concrete Fail(E) keys and forwards unhandled error
families. Deferred retries preserve the original semantic failure category
and fail span. Nested failures are traversed through their payloads.
Row-parameterized ADTs support interleaved, multiple type/row parameters,
bare effect labels, and pure; source sorts are retained while VarIds stay
canonical (type slots first). The parser remains Applicative-only; Handler
type syntax is isolated in Format.Parse.HandlerType. A declared ADT named
Handler wins for Handler(Foo), while Handler(Clock) resolves as a handler
type when no such ADT exists. Duplicate effects, operations, effect/type
parameters and function/handler binders use the existing duplicate
diagnostics. Both written row forms reject repeated or nonfinal tails.
Program.Compile rejects checked Handler/HandlerValue, With, Handle and Fail nodes, plus Handler types in signatures, expressions and every constructor field, before Specialize. The iterative type walk stays stack-safe at a 20,000-arrow signature. This is Check-only support: specialization/lowering, runtime behavior, and Go emission remain later FX001 tasks.
Root audit findings 1–13 are fixed and recorded with reproductions in .superpowers/sdd/2026-10-09-effects-plan/task-5-root-audit.md. The previous FX004 validation gaps are closed. Focused handler tests pass 81/81; the large-source suite passes 15/15, with 20,000-type duplicate rejection at 475 ms against its unchanged five-second bound. Eleven new isolated source mutations prove the nested Fail, duplicate validation, deferred diagnostic, metadata guard and duplicate-scan timing regressions.
Clean-output npm run verify exited 0 in
.build/fx-handler-task5-verify5.log: zero build warnings/errors, pinned
formatting, strict rebuild and structural gates, 722 parallel tests and 22
serial tests with no failures or skips, and all 33 actual-source regression
proofs. Earlier real failures remain preserved: verify2 exposed duplicate
and resolver-metadata compatibility issues; verify4 exposed eager
when-argument evaluation in duplicate scanning (6.92 s against the
unchanged five-second limit). Those defects were fixed and their regression
proofs added before verify5. Full interfaces, evidence and the remaining
Task 9 origin-provenance handoff are in
.superpowers/sdd/2026-10-09-effects-plan/task-5-report.md. No runtime or
specialization behavior is claimed for this task.
Resumed in a Claude Code cloud session on branch claude/vibrant-cerf-3km61i (fast-forwarded to fx001 at 9a6befd; no .worktrees, ruling recorded in the SDD ledger). The local SDD ledger of Tasks 1-5 was never committed; it was recreated from git and this file. Task 6 was implemented inline by the controller before the superpowers skills were linked into .claude/skills (32ee2d2); it then received an independent task review.
Implemented: effect keys (EffectRef, ground type arguments) in the one
specialization worklist, created on first reference; user effect keys fill
their operations’ types beside their source (Resolved.OperationInfo gains
syntax), so they reach type keys and the effect keys of handler types;
Handler(L …) lowers to L’s key in bodies and constructor fields; rows are
erased everywhere. The IR gains THandler EffectKey, an effects table and
nodes OperationRef, Perform, HandlerValue, Install, Handle and Abort (fail;
handle clauses and aborts carry the payload’s declared family). Check.Nested
judges one reference graph over type and effect declarations (constructor
fields, operation parameters and results, Handler(L …) edges); Grow, the
mutual pair and the data/effect cycle are E_SPECIALIZATION at the nested
reference, their bare-parameter versions compile. A function whose type
variable appears only in its own row’s labels is polymorphic (it crashed
specialization before). Features.Check.Unlowered is replaced by
Features.Specialize.Unlowered over the emitted IR: effect layouts or effect
nodes stop at E_INTERNAL “unlowered effect”; unused effect declarations reach
Go unchanged. Only keys with type arguments count toward the 10,000 limit.
Tests reach Specialize directly (test/fx-specialize.test.mjs, 18 tests);
executable probes wait for Task 7.
A Task 5 parser defect surfaced: with R inside Handler(L with R) was
silently dropped (and rows after non-arrow types elsewhere). Fixed by a
Sonnet implementer in 5da7865 and 3aa1217 (round 2 pending at this entry),
reviewed by Opus; meaningless rows are now E_SYNTAX “Unexpected effect row”.
Evidence: RED 15/18 (.build/fx001-task6-red.log; three characterization
tests passed before). Clean npm run verify at 85c5867
(.build/fx001-task6-verify.log): zero build warnings, gates pass, 752/752
parallel tests; serial phase 13/22 — the 9 failures are fixed timing bounds
that fail identically on the pre-Task-6 baseline 9a6befd on this container
(BACKLOG T007); regression proofs, run explicitly: 33/33 (.build/fx001-
task6-regression{,2,3}.log; four duplicate-declaration rows now expect an
accepted program because the old guard no longer masks them). Test-helper
defect fixed: test/poly-keys.mjs built a 5,000-deep JSON message eagerly
(stack overflow here). Task review (Opus): spec ✅, quality Approved, no
Critical/Important; Minor items deferred in the ledger.
defer must not fail (2026-10-09)Before Task 8, the user was asked how a cleanup failure during an abort
should behave (abort-to-defect conversion as specified, drop, replace, or
suppressed causes). The user chose the static rule, after Swift’s defer:
a deferred expression that performs an unhandled Fail is E_EFFECT
defer must not fail, but it performs <L>; cleanup that can fail handles
its failure inside the deferred expression. Only defects can fail cleanup,
so a pending typed abort reaches its handle unless a cleanup on the way
raises a defect (the abort then heads the report) or diverges (corrected
per CF001 §11). Spec §2 (defer
rule), §3 (“Cleanup failures”, with rejected alternatives), §5 (report
example, probes 6 and 11), plan Global Constraints and Tasks 8, 10 and 12,
findings and the handoff were updated. Docs only; no code changed.
Subagent-driven: Sonnet implementer (e9a613f, fix round 4b80bd1), Opus task
review and scoped re-review. Effect programs now build and run. ctx mode is
chosen over the emitted IR (any effect layout or effect node); in it every
function, stage, lambda, constructor, lifted helper and function type takes
ctx *waxwingCtx first; otherwise Go output is unchanged (bootstrap
snapshots byte-identical, Console-only programs without ctx). Runtime (Task
1’s adopted shapes, emitted only when used): immutable context list,
non-zero-sized markers, targeted aborts recovered only by their own lifted
handle helper. Keys: user effect EffectId+1, Fail families by declared
head (negative keys); missing handler is panic("no handler for L").
Handler structs per layout (empty for Console/Fail layouts), perform
functions call clauses with the frame’s outer context (intercept-and-
forward), clauses lifted like lambdas. Features.Specialize.Unlowered is
deleted; every ‘unlowered effect’ assertion was replaced by an executable
assertion (test/fx-run.test.mjs, 24 programs with exact stdout).
Two checker defects found and fixed: constructor patterns dropped row
arguments (Check.Match/Tables), and consumption did not resolve a bound row
tail (Check.Consume); Check-level tests in test/fx-check-fixes.test.mjs,
each failing with its fix reverted. Review found one Critical: the clauses
of one handle were installed in reverse (runtime panic for Error(Int) vs
Error(Bool) clauses); fixed with probes. Regression rows: block-order needle
updated; handler-metadata replaced by effect-free-ctx.
Evidence: rm -rf output && npm run verify (.build/fx001-task7-verify.log):
build, gates, 786/786 parallel tests; serial 12/22, the 10 failures are the
BACKLOG T007 environment bounds (same set on pre-change baselines);
regression proofs 33/33 (.build/fx001-task7-regression.log). The
fx-block.serial 20,000-let test sits at its 1,500 ms bound on this
container: 49717bc 1,533-1,574 ms vs Task 7 1,386-1,505 ms, alternating.
defer, crash, cleanup and the defect report (2026-10-09)Subagent-driven: Sonnet implementer (041cb31; fix round d5bfa8d, resumed
after a container restart), Opus task review and scoped re-review.
defer e (block item) and crash(value: a): b (built-in, printable
argument, no effect, uncatchable) run through every phase. Cleanup runs
LIFO, exactly once per exiting activation, in the registration context;
the defect report follows spec §5 (exit status 1, first line the original
cause, later lines cleanup failed: ; <not printable> decided
statically). Runtime pieces (Format.Go.Cleanup, Format.Go.Report) are
emitted only when used; defer and crash do not force ctx; blocks without
defer emit no Go defer. Conventions recorded: with no pending cause the
first cleanup crash is the unprefixed first line; Go runtime panics print
as panic: <text>.
The user’s rule that defer must not fail is enforced soundly after
review: the first implementation checked only labels, so five programs
(callback parameters with ambient or named rows, unsettled closures,
lambdas decided later) let a typed failure escape cleanup and become a
fatal report. Ruling (controller, pending user confirmation of strict over
a lacks-Fail constraint): the deferred expression has its own row; after
the function’s constraints settle, a remaining Fail label or a tail
resolved to a rigid row variable is E_EFFECT (defer must not fail, but it
performs <L> / ... but it may perform any effect of <r>). Accepted
limitations (spec §2, BACKLOG FX007): the bracket idiom needs with pure
callbacks; a local lambda also called outside the defer in a non-main
function is rejected in it. Report.payloadName now walks arrow spines by a
loop (a 5,000-arrow payload crashed the compiler).
Evidence: fx-cleanup 32/32 (RED 24/26 before, then 7 new failing tests
for the fix round; seven isolated mutants caught). npm run verify
(.build/fx001-task8-verify.log): build, gates, 818/818 parallel tests;
serial 12/22, the 10 failures are BACKLOG T007 timing bounds; regression
proofs 33/33 (.build/fx001-task8-regression.log). Re-review probes:
legitimate defers (defer log(1), defer print(x), monomorphic helpers)
accepted; the check is linear (1k-8k defers).
Subagent-driven: Sonnet implementer (2fc7a02; fix rounds 04ab898, cee8542,
b80cc17), Opus task review and two Opus re-reviews, Sonnet re-review of the
last one-line fix. (A first dispatch was lost to a container restart; the
second was briefly stopped by a controller misreading of a user message and
resumed with its work intact.) Effect errors now carry origin, boundary and
path notes (spec §6): occurrence links live in the substitution and are
recorded on every unification path (nested arrow rows, settleRows retries,
consumption); deferred-row origins are kept apart from the function row;
note texts follow ruling R4 and the wire carries related: [{ span,
message }]. Resolved gains rowSpan on functions and parameters so
boundary notes point at the written with (or the parameter name when the
concerned row is nested or not the only pure row). Path hops, note count
and characters are abbreviated (visibleLabels 4, pathHops 2, maxNotes
4, maxCharacters 2000 for notes); labels over 120 characters print
Effect(…) in headlines. Pre-FX001 diagnostics are unchanged (related:
[] by construction; wire JSON identical); 20,000-parameter signatures
check in about 1.5 s.
Known limits recorded: maxCharacters bounds notes only — a headline with a
very long type or effect name can exceed 2,000 characters (BACKLOG E011);
the late-Fail-key defer note follows let-bound locals only and otherwise
gives no note (never a wrong one; ~20 probes); origin notes may point
outside the deferred expression.
Evidence: fx-diagnostics, fx-diagnostic-origins, fx-signature 46/46; the fix-round tests were each seen failing (the round-2 tests by the controller against 04ab898 in an isolated worktree). Final verify (.build/fx001-task9-fix3-verify.log): build, gates, parallel 847/848 — the one failure is large-source “three-thousand-constructor match” timing (BACKLOG T004; passes alone); serial phase failures are the T007 set; regression proofs 33/33 (.build/fx001-task9-fix3-regression.log).
Subagent-driven: Sonnet implementer (50f84ae; fix round 9365db3), Opus task
review, Sonnet scoped re-review. Test-side only: no compiler source
changed (git diff 89de11c -- src scripts is empty). New files:
test/fx-oracle.mjs (independent lexer, parser, values, frames, cleanup and
interpreter; no compiler import), test/fx-gen-.mjs and fx-programs.mjs
(generator), fx-census.mjs, fx-shrink.mjs, fx-diff-support.mjs,
fx-oracle.test.mjs (parallel) and fx-differential.serial.test.mjs (serial,
ruling F11). Executable probes moved unchanged into importable modules and
imported back: fx-cleanup-programs, fx-console-programs, fx-task7-programs
(Task 7’s eight inline run probes from fx-specialize and fx-handler-check).
docs/engineering.md documents the corpus and the knobs WAXWING_FX_SEED
and WAXWING_FX_PROGRAMS.
The interpreter models the shipped semantics: handler frames keyed by effect
identity, Fail by the payload’s declared head, the first clause innermost,
clauses in their with’s outer context, defer LIFO in its registration
context, the pending abort heading a cleanup-crash report, cleanup
failed: lines in execution order. It is validated against every
executable probe of Tasks 2, 4, 7 and 8 (fx-oracle.test.mjs 86/86); the
fx-cleanup injected cases and fx-block orders probes (Go transformed
after emission) are excluded by name. Ruled deviations: the oracle parser
re-implements the grammar rather than extending poly-parse.mjs (a closed
closure that may not be edited); only the first three differences per run
are shrunk (every difference’s seed and source are written first); the
sensitivity check compares the interpreter with its inner-clause-context
flag (50 programs, at least one difference), Go-vs-interpreter equality
being the serial run’s job.
Default run: 500 programs, seed 20261010 (program i uses seed 20261010+i),
five go-batches of 100, 0 differences, 0 rejections, 0 interpreter errors,
12.9 s (.build/fx001-task10-fix-default.log). Census (minimum): nested
same-key 225 (50), intercept-and-forward 68 (50), aborts crossing an
unrelated handle 109 (50), stage order with over-application 90 (50),
escaped callbacks 109 (50); cleanup normal 267, abort 363, defect 119,
crash on normal exit 65, crash while abort pending 38, several crashes 38,
own failure during abort 193, registration context 74, unreached defer 143
(25 each). 25 rejection variants give E_EFFECT with the Task 8 texts at the
defer span. Extra run: seed 7, 2,000 programs, 0 differences
(.build/fx001-task10-large.log). Mutation witnesses (isolated copies):
inner clause context, first clause outermost, FIFO cleanup, abort not
heading the report, eager argument evaluation each fail the hand traces;
disabling item removal or literal replacement fails the shrinker tests.
Finding: the interpreter exposed a hole in the strict defer rule — a
deferred operation whose handler clause fails ends cleanup in a typed abort
(BACKLOG FX008). The generator emits only fail-free random clauses until it
is fixed.
Verify (.build/fx001-task10-fix-verify.log): build, gates, parallel 933/934 — the one failure is large-source “three-thousand-constructor match” (T004; passes alone). Serial phase run directly (.build/fx001-task10-fix-serial.log): the new differential tests pass; failures are timing bounds only — the T007 set, fn-scale 1,000-long arrow (also failed in Task 9’s serial log), the match ladder (T003, also failed in Task 9’s), and fn-scale “chain of 1,000 partial applications” (phases 253 ms; new in this log, and failing alone three times at 310-341 ms with compiler, scripts and that test unchanged since 89de11c — the container’s bound, recorded under T007). Regression proofs 33/33 (.build/fx001-task10-fix-regression.log).
Branch fx008 (from claude/vibrant-cerf-3km61i at fdd375a), on the user’s
machine. Baseline rm -rf output && npm run verify
(.build/fx008-baseline-verify.log): exit 0; build, gates, 934/934
parallel tests, 29/29 serial tests (the T003/T004/T007 timing bounds all
passed here), 33/33 regression proofs. The user ran verify on main in the
same checkout about the same time, and this session had just switched the
checkout to fx008; overlap was not established, and this run passed.
Design only, no code: docs/plans/2026-10-10-abort-tracking-design.md.
Recommended approach A: a nofail mark on each non-Fail label occurrence;
with h gives the body’s label h’s mark; handler clauses get own rows
(the R0 technique), and clause labels relate to the handler by ⊑, not
unification; defer demands N on every label it performs; signatures
write nofail L to rely on a handler not failing; a per-declaration
two-point propagation, linear, with no scheme constraints; marks erased
before specialization, so Go is unchanged. Alternatives B (totality per
effect) and C (inferred marks) are recorded. Newly rejected: one pinned
acceptance (fx-cleanup-programs a defer performing a non-Fail effect,
migrated with with nofail Log), plus the pinned oracle hole. Independent
Opus review dispatched; user decisions D1-D5 pending.
Review (Opus, review-fx008-design-result.md): Accept with fixes. Critical:
C1, the solve was seeded only from defer demands, so a handler mark made N
by a callee’s nofail signature was never checked (the cross-function
hole stayed open); C2, separate clause rows need late consumption that
keeps Fail, to a fixpoint, or the base effect system becomes unsound
(the reviewer’s late-Fail program is Unhandled Fail(E) in main today).
Important: equality merges through monomorphic locals (I1), no mark
polymorphism for forwarding helpers (I2), an understated migration (I3),
and a soundness argument to restate (I4). The reviewer ran the hole and
the I1/I2 programs on the current compiler (accepted; I1/I2 run
correctly). Revision 1 of the note applies every finding: a fixed settle
order, seeding from every N mark, limitations L4/L5 with decisions D6/D7,
the D0 interpretation decision, and minors M1-M10.
Re-review (rereview-fx008-design-result.md): C1, C2, I3, I4 and M1-M10
addressed; new Critical N1: the late-consumption fixpoint does not
terminate when a restricted row shares its tail with its target (the
reviewer’s programs: a never-called lambda with a Console-only cleanup,
accepted today; a no-defer clause form, rejected today, which would
hang). Revision 2 adds a shared-suffix rule, the full settle order (N2)
and N3-N5. Round 3 judged the rule sound but the termination measure
unsound as written (it used provenance links, which may cycle and must
not influence typing); revision 3 uses a copy map local to that step.
Revision 3 is not re-reviewed. Stopped for the user’s decisions D0-D7.
Verify at afedaec (docs only; .build/fx008-design-verify.log): rm -rf output
&& npm run verify exit 0; 934/934 parallel, 29/29 serial, 33/33 proofs.
At the user’s request, documented module-system comparisons and fp-ts-style selection/construction of instances without mandatory newtypes in docs/plans/2026-10-10-modules-and-instance-selection-direction.md. Linked from language direction and C001/M001 backlog entries. Separates user preferences, recommendations and open decisions; covers abstraction/type identity, coherence, collection consistency and evidence for algebraic laws. No implementation or syntax approved. Active FX008 documents left untouched. Documentation inspection only; verification not run, preserving the user’s instruction not to run checks for this discussion.
Outside advice, shared by the user 2026-10-10 and treated as advice only (note §12; D0-D7 open), asked for a focused termination review. Revision 4 rewrote §3.5 steps 1-3. The fresh Opus review (review-fx008-termination-result.md) found:
Revision 5 adopts the corrected procedure:
The procedure is the reviewer’s and has had no second check.
Probes are copied to .build/fx008-probes/. The controller reproduced two defects in today’s checker:
run panics with no handler for
Fail;Effect row consumption
failed.Both are new BACKLOG rows.
Verify at 9b47e4b (docs only; .build/fx008-rev5-verify.log): exit 0; 934/934 parallel, 29/29 serial, 33/33 proofs.
User decisions 2026-10-10 (interview; note §11): D0-D5 as recommended;
D6 mark variables (nofail(k) L) and D7 directional checking are
included in FX008. Revision 6 of the note adds them. Including D7 needed
two structural changes, which remove the merge and forwarding limitations
(L4 mostly, L5):
with consumes the handler’s clause row as a restricted row instead of
unifying it with the context;Mark solving becomes a path check over a two-point lattice with rigid mark variables. One Opus review of the whole note is in progress. FX009 is being fixed test-first in parallel, on branch fx009 in a worktree.
FX009 review (Opus, review-fx009-result.md): Needs fixes.
settleKeys as well, and rejected a
program accepted today.Fail whose payload head is a type
variable is E_TYPE at the written annotation.FX008 revision 6 review (Opus, review-fx008-rev6-result.md): no Critical findings and no unsound acceptance found. The path check is correct, and the revision 5 loop holds with installation entries.
with lost type inference. meta2.wxw,
accepted today, would be rejected, and hole2c.wxw’s Go output would
change.handler Console gives E_INTERNAL.Revision 7 is unreviewed.
FX008 revision 7 check (Opus, review-fx008-rev7-result.md): soundness
established. The two-row split restores meta2 and hole2c, but not all of
today’s inference: late1 and late2, without defer, would be rejected.
User decision: a one-way hook keeps R in step with the clause rows
(revision 8). The other findings are applied as text:
A narrow review of the hook is in progress.
FX009 re-review (Opus, rereview-fx009-result.md):
Fail(Int -> Int), which reproduces the original panic.handle clause payloads give E_INTERNAL.User decision: every written Fail payload without a family key is
E_TYPE at the label, in signatures and in handle clauses. Round 2 is in
progress.
FX008 revision 9 applies the hook review (review-fx008-rev8-hook-result.md; no Critical findings, soundness unaffected):
defer and are accepted today,
would be rejected, and two2’s Go would change.F1 and F2 are unreviewed. A probe gate, which re-runs every review probe (kept in .build/fx008-probes/), is now the first plan task.
FX009’s round 2 was approved by the re-review, and the branch’s docs are
committed (3518678 on fx009). Verify at 3518678: exit 0, 958/958
parallel, 29/29 serial, 36 proofs. It awaits the user’s merge decision.
New BACKLOG FX012: firstUnkeyed runs before deferred rows settle.
Fail payloads rejected (2026-10-10)Branch fx009, from fx008 at 531e438. Sonnet implementer (c445bac; review rounds 33a3a62 and f6cb6d0), Opus review and two re-reviews (docs/sdd/2026-10-09-effects-plan/review-fx009-result.md and rereview-fx009-result.md).
Defect: leftover deferred-key pairs were dropped silently, so a
Fail(a) parameter row let a failure escape at run time (no handler
for Fail).
User decisions:
Fail payloads without a family key (a type variable, a
function type or a handler type) are E_TYPE Fail needs a concrete
error family at the label, in signatures and handle clauses, with a
hint.Fail(Error(a)) and Fail(Unit) are allowed.The reviews found no program that reaches that guard (about 50 probes compared against a build without it), so it is a 3-line rejection. Mutants of the written-label checks are caught by the guard at the wrong span.
Evidence:
rm -rf output && npm run verify: exit 0, 958/958 parallel, 29/29
serial, 36 proofs.Spec §2 “Label keys” updated. Pre-existing and recorded separately: a
handle whose failure key is decided only after deferred rows are
settled is rejected early (firstUnkeyed runs in the first settle).
FX009 merged into fx008 (26fefe3, user decision 2026-10-10). Verify on the merged tree (.build/fx009-merge-verify.log): exit 0, 958/958 parallel, 29/29 serial, 36 proofs. The user asked for one focused review of FX008 revision 9’s F1/F2 procedure (termination, inference compatibility, scheduling). On no substantive issue, the user approves the written spec and the implementation plan follows, starting with the probe gate.
Recorded the user’s requested Schema foundation as SCH001 in docs/plans/2026-10-10-schema-direction.md and the backlog, with links from language/tooling direction and a targeted LA001 comparison. Consulted Effect v4 Schema documentation and the supplied rae-hill/schemata-ts README/interface docs. Covers parse-into-domain boundaries, codecs, selectable interpreters, generators/shrinkers and independent properties. Library/compiler mechanism and v1 subset remain open. No implementation, tests, commit or verification run; preserves the user’s request not to run checks during design discussion.
SCH001 follow-up (2026-10-10): expanded schema-direction with capability overlap versus Effect, the direct io-ts Schema/Schemable precedent, tagless-final research and ZIO Schema’s different representation. No major required capability exclusive to schemata established; interpreter encoding versus AST remains open. Documentation inspection only; no checks run.
Focused F1/F2 review (review-fx008-rev9-f1f2-result.md): a substantive issue. Termination, inference compatibility and scheduling each failed as written (cyc1, ov1, set1, all accepted today). It found no unsound acceptance. Revision 10 applies the corrections:
sync to
a fixpoint;FX008 revision 10 re-check (review-fx008-rev10-result.md): no substantive issue.
The wording fixes are applied. By the user’s condition (2026-10-10), the written spec is approved. The implementation plan is next, starting with the probe gate. Probes are kept in .build/fx008-probes/ (rev6-rev10).
Docs only, from a review of the draft Waxwing article outline. BACKLOG
gains FX006 (general resume) ahead of FX001 Task 12, carrying the plan’s
scope plus the user’s constraints: multiplicity decided on language terms,
one-shot by default and declared per operation so multi-shot stays an
additive, row-visible extension, reserved spelling, at-most-once assumptions
stated in defer/FX003/CF001, and a double-resume regression. FX008
records an unverified hole in defer must not fail through a failing
handler clause. (Merged 2026-10-10 into branch fx008, which already
tracked and verified this hole as FX008: the duplicate row was folded into
that record. See “FX008 merge with the article-outline branch” below.)
language-direction.md records the user’s direction that the
language (frontend, syntax, type system) outranks the Go target. No code
changed; no build or verify ran (a parallel worktree was active).
Branch claude/optimistic-dijkstra-6i21jy (81990d6, 2b42574; docs only,
from main 234d115) is merged into fx008 with a merge commit. Its FX006
row and the language-direction section “Language before target” are kept
unchanged. The FX008 work does not contradict FX006’s constraints:
design §4.6 makes any ctl clause’s handler may-fail until general
resume. Its Task 12 change to the effects plan is kept.
Its FX008 row duplicated this branch’s FX008, recorded there as an unverified hypothesis. It is folded into this branch’s row and removed. The folded-in facts:
Established on the current compiler (probes in .build/fx008-probes/facts/):
fail(E) skips the enclosing
handle for E: exit 1, stderr fail(E): E;fail(F), F never reaches its handle: exit 1, stderr
fail(F): F then cleanup failed: fail(E): E.docs/writing/article-outline.md Part 3 §5 now states:
§4 (the Task 8 case study) was checked against review-task8-result.md: the five programs and the 25/25 tests match. It is unchanged.
Verify at the outline merge (3e24e21; .build/fx008-merge-outline-verify.log):
rm -rf output && GOTOOLCHAIN=go1.26.4 npm run verify exit 0; 958/958
parallel, 29/29 serial (timing bounds included), 36 regression proofs.
History tidied before publication (2026-10-10, user-authorized):
The tree differs from the verified 207474b only in docs.
FX008 implementation plan (docs/plans/2026-10-10-abort-tracking-plan.md, revision 3, 1,228 lines, 12 tasks plus setup). Drafted by an Opus planner and reviewed twice by an independent Opus reviewer (review-fx008-plan-result.md): round 1 “ready with fixes” (8 Important), round 2 “ready with fixes” (one Important, the ec1 expected text). All fixes are applied. The reviewer ran 102 probes, and the plan’s recorded outcomes match. The plan awaits the user’s approval and sign-off on the P3, P5, P6, P7, P10 and P11 decisions. Nothing is implemented.
User approval 2026-10-10: the FX008 plan (at 0d7cc27) is approved, with sign-off on P3, P5, P6, P7, P10 and P11 and P13 accepted. The user added:
Setup and Task 1 are authorized.
Worktree /Users/ethan/Desktop/waxwing-fx008-impl, branch fx008-impl, from 8fe4218. Sonnet implementer (58c3d61; fix round 71d6263), Opus task review and scoped re-review (review-fx008-task1-result.md): Spec ✅, Quality Approved.
test/fx008-probes/ holds 104 programs: 102 review probes, deduplicated, plus the witnesses ec1 and tp1. The table pins each probe’s outcome today:
It also records each probe’s FX008 outcome. 17 entries flip, each with a task, a reason and an exact outcome or a pattern with report-before-pin. 14 slow probes run in child processes with a 20 s timeout. A tamper hash covers the table, and invariant tests check flips; a flipped accepted entry must pin its Go hash.
Rulings:
2 before its abort: the plan’s “empty stdout”
was a transcription error, corrected.The reviewer re-ran all 104 probes independently (0 mismatches), checked the timeout path (fails at 20,006 ms, no orphan process) and nine mutation kinds, each caught. Verify at 71d6263 (.build/task1-fix-verify.log in the worktree): exit 0, 1065/1065 parallel, 29/29 serial, 36 regression proofs. Stopped before Task 2, as authorized.
Sonnet implementer (66e4f5d; fix rounds c6af69f and 5ed5b0e). Opus task review and re-review (review-fx008-task2-result.md): Spec ✅, Quality Approved after the fixes. The second fix round (a test bound and plan text) was checked by the controller.
What it adds:
Mark on every Label;HandlerRows on THandler;mapMarks, stripMarks, markVariables);instantiationRule.Behaviour is preserved: the gate is green, and the Go text and bootstrap snapshots are unchanged.
Review C1 (Critical): two handler rows doubled at every nested handler
type. Depth 22 ran out of memory, where base accepts to 124.
Ruling: clauses ∷ Maybe Row, where Nothing means the same as R.
Passes visit C only when it is Just. Plan P2, P4 and the interfaces of
Tasks 2, 4, 7 and 8 are updated. Timings now match base to depth 124,
with identical Go.
Guards:
The strip test now covers bodies, operations and constructor fields,
with four mutants caught. Plan updates for later tasks: Task 3’s
localMarks gives a Just C only to handler types that are not nested
in a handler row, with a guard. Task 7 gets a 30-literal guard and a note
on unequal derived Eq.
Verify at 5ed5b0e (.build/task2-fix2-verify.log in the worktree): exit 0, 1070/1070 parallel, 31/31 serial, 36 proofs. New BACKLOG G004 (pre-existing): a depth-125 handler type ends in a RangeError instead of E_NESTING.
nofail syntax, resolution and printing (2026-10-10)Sonnet implementer (f16c6b5; fix rounds 1f9f257 and e0580a4). Opus task review and re-review (review-fx008-task3-result.md): Spec ✅, Quality Approved. The second fix round was checked by the controller.
What it adds:
nofail and nofail(k) parsing, contextual through a one-token
lookahead;fail clauses;instantiateMarks and localMarks: nested handler types keep no clause
row (the c1 rule, with a nesting guard);nofail L; once one arrow of a spine prints its row, every
arrow does;The reviewer compared whole-compile outcomes between base and candidate
on 3,371 harvested sources plus 23,029 mutated ones: 0 differences for
programs without nofail. 45 adversarial grammar programs confirm
nofail stays an ordinary name elsewhere.
Rulings:
New BACKLOG E012 (pre-existing): closed and ambient rows print alike. Verify at e0580a4 (.build/task3-fix2-verify.log in the worktree): exit 0, 1105/1105 parallel, 33/33 serial, 36 proofs; gate 107/107.
User decision 2026-10-10 (FX008 Task 4): mismatch texts are symmetric.
When either side of an E_TYPE mismatch shows a handler clause row or an
arrow row, both sides show theirs. An empty handler row prints with
pure, and ambient tails stay omitted. This amends the approved P3
callback text to Expected Unit -> Unit with nofail Log, found Unit ->
Unit with Log.
Sonnet implementer (3b0dd3e; fix rounds aa8db84, a43f56c, 84b684e). Opus task review and re-review (review-fx008-task4-result.md): Spec ✅, Quality Approved. Rounds 2 and 3 were checked by the controller.
What it adds:
RowMode: equal, ignore marks, or directional;consumeLabels);Review fixes:
Evidence:
scripts/differential.mjs --corpus all against e0580a4: 0 differences
in every phase (3,421 harvested, plus fuzz, isName, matches and
mutations).nofail.User decisions 2026-10-10 (FX008 Task 5 probe gate):
defer span, the same cycle as n1. The plan had wrongly predicted it
unchanged.Sonnet implementer (d9a0576; fix round dd45b58; comment b5fab7c). Opus task review and re-review (review-fx008-task5-result.md): Spec ✅, Quality Approved.
The corrected §3.5 loop (Features.Check.Settle, Feed, FeedOrder, Cycle):
settleKeys runs inside each round;settleFinal, and the defer judgement runs after
the loop.Probe gate, with the user’s decisions: dup, n1 and r5 flip as planned, and design-review/r4 (wrongly predicted unchanged) is a fourth flip. All four texts are pinned exactly. The differential against 84b684e shows only those programs differ. A 60,000-graph brute-force check confirms cycle detection.
The review found the settle order quadratic: an eager maybe fallback
took 8,000 defers to 6.4 s against base’s 0.8 s. It is fixed with
maybe'. Now linear, at about 1.3x base. Guards:
Recorded:
Fail in a defer plus n1’s
cycle now reports the cycle.Verify at dd45b58 (.build/task5-fix-verify.log in the worktree): exit 0, 1142/1142 parallel, 34/34 serial, 38 proofs; gate 107/107.
2026-10-10, at the user’s request:
Sonnet implementer (01cbe77 refactor, 418cd38; fix round c8503f9). Opus review (review-fx008-task6-result.md): Spec ✅, Quality Needs fixes; the fix round was checked by the controller.
What it adds, with no behaviour change:
handleFailure and failureClause moved out of
Handler.purs (241 → 184 lines);entries
(deferrals only until Task 7 registers clauses); Site.purs split out.Review fixes: I1, the revert test could not fail (a mutant keeping the
progressed watch passed); it now watches both tails and fails on that
mutant. M1 compose keeps the later watch. M2/M3 comment the invariants
Task 7 relies on. The reviewer killed the other three mutants (one per
test).
Evidence:
Sonnet implementer (wip 8dd22be; 9358d79; fix rounds 95eac9e, 66f1eca). Opus design pre-review (review-fx008-task7-design-result.md, A1-A7, two Critical design defects fixed before code), gate diagnosis (review-fx008-task7-gate-diagnosis.md), code review and re-review (review-fx008-task7-result.md); round 2 checked by the controller.
User decisions 2026-10-11:
Controller ruling: F1′ also runs at the start of each settling round (a plan gap, not a workaround), skipping the rigid branch (the tail pass binds ϱ after the loop), reporting at the handler literal.
Evidence:
Open: no probe distinguishes F1′’s join-group from a new group (cost
only); Task 8 must build env.current labels from R and pair C by key.
User requested a project milestone for automatic requirement inference, then explicitly required error composition during service assembly and business logic. Recorded A1-A10, design alternatives, current named-function inference gap, generic error-family questions, FX008 compatibility and completion evidence in the milestone. Status: requirements defined; language design and implementation plan remain. No compiler changes; active FX008 delivery is unchanged.
Documentation checks: A1-A10 present, tracking links resolve, and
git diff --check passed. Fresh npm run verify exited 1:
958/958 parallel tests and 28/29 serial tests passed; partialFirst at
20,000 parameters took 973.142 ms against its 930 ms bound (T007).
Build, strict rebuild proof and structural gates passed. Regression proofs
were not reached. No retry or assertion change. Evidence:
.build/inf001-definition-verify.log. This run verifies no INF001 behavior.
Sonnet implementer (b30b8b8; fix round ff0c6d1). Opus review (review-fx008-task8-result.md): Spec ✅ given the deviation, Quality Needs fixes; the fix round was checked by the controller.
What it adds, with no probe change: each with registers an
installation with a frame mark (NoFail for Console, else a fresh mark
meta); settling pairs the handler’s clause row C with the installing row
by key and position (Lend.assume), taking arguments from R, and records
the frame ⊑ C edges; the tail pass gains an installation rule (a guard,
unreachable while R ≡ current).
Deviation, accepted by the controller: install does not consume C, as
the plan said; consumption renamed row tails (442-449 check-phase IR
differences, nothing later). The reviewer swapped the plan’s consumption
back in and found identical mark-edge sets over 3,151 sources (570 with
installations), with the fallback never taken. The plan now describes
assume.
Review fixes: I1, 1,000 installations went from 3.97 s (base) to 11.6 s;
now 5.2-6.3 s (eager where bindings recomputed pairing every round);
serial guard 9.5 s. I2, edge endpoints and direction asserted (a
reversed-edge mutant fails 2 of 6), plus a nested duplicate-key case.
Evidence: gate 110/110, no change; differential 0 differences against 66f1eca and b30b8b8; verify at ff0c6d1 (.build/task8-fix-verify.log in the worktree): exit 0, 1182/1182 parallel, 37/37 serial, 49 proof lines.
Sonnet implementer (1649218; fix rounds 360f13e, 889ca99). Opus review and re-review (review-fx008-task9-result.md); round 2 checked by the controller.
What it adds: after settling, markConstraints records frame, own-abort
and defer-demand edges; violation searches paths from Plain and the
declaration’s mark variables to a fail-free atom (P7), and
reportViolation chooses the headline by the last edge (P6), with the
approved P10 texts. The pinned FX008 program is rejected with defer must
not fail, but it performs Log, whose handler may fail. Exactly the 8
listed probes flipped (lexical, hole, c1, cross, pending, l4b, merge2,
q1). The fx-cleanup program and the generator were migrated (§6).
Review findings and user decisions:
fail(E): E; interpreter “typed abort escaped cleanup”). User
decision: a function result’s handler type gets its own C at each use,
keeping R’s tail only when that variable occurs in a parameter or the
own row. New limitation (plan, beside L1, L4, P5): a handler passed
through a generic function and installed from its result gives an M
frame when the context’s rest is M or rigid.Evidence:
Sonnet implementer (d85a791; fix round 52b9df8). Opus review (review-fx008-task10-result.md): Approved, 4 Minor; the fix round was checked by the controller.
Mark rejections now carry the approved P10 notes, from the demand back
to the source: <L> is handled here, `this handler’s clauses perform