Commit 78de347
refactor(manhattan-recovery): scope recovery + complete grammar refactor + rip dependent-type creep (#19)
* refactor(manhattan-recovery): scope recovery + complete grammar refactor + rip dependent-type creep
Major realignment of AffineScript scope back to user intent after accumulated
bot scope creep. This commit contains the full 2026-04-10 Manhattan Recovery
session work.
Scope changes (authoritative thesis now in .machine_readable/anchors/ANCHOR.a2ml
and Desktop Frontier Programming Practices guides v2.0):
IN SCOPE (8 features — copied-from-family + affine headline):
phantom, immutable-by-default, row polymorphism, full type inference,
sound type system, effect tracking, affine types, decidable refinements (soft)
OUT OF SCOPE (removed or deferred):
linear strict types (subsumed by affine — was bot creep)
full dependent types (deferred to sibling Typed WASM project)
tropical types (deferred to Typed WASM)
algebraic effect handlers (extension point — declarations only for now)
unbounded refinement (decidability boundary)
Code changes:
- Complete in-progress grammar refactor: CONST keyword, PLUSPLUS (++) concat,
DOTDOT+lower_ident row-tail, trailing commas in records,
upper_ident as ExprVar for bare variant constructors
- Fix broken build (restore ROW_VAR token wiring after refactor delete)
- Rip dependent-type creep: TDepArrow, TNat, KNat, nat_expr, TRefined,
predicate, constraint.ml (entire file), TyDepArrow, TyRefined, NatArg,
UnsafeAssume, ConstraintPred, ctx.store, lower_nat_expr, lower_predicate,
Constraint.* references. ~500 LOC removed across 14 files.
Documentation:
- ANCHOR.a2ml first write (retroactive — repo predates the ANCHOR convention)
- META.a2ml: ADR-001 (split-Gamma canonical), ADR-002 (scaled Let rule),
ADR-003 (left-to-right evaluation order)
- STATE.a2ml: honest [features] block, BUG-001..BUG-005 logged,
[deferred-upgrade] block noting missing 6a2-suite machinery
- README.adoc and COMPILER-CAPABILITIES.md: v2.0 honest scope qualifications
- docs/spec.md: honest-status header note; large dependent-type and
refinement-type sections removed; scattered inline mentions flagged for
a future full spec rewrite
- Desktop Frontier Programming Practices guides rewritten v2.0
(AI.a2ml + Human_Programming_Guide.adoc) replacing defensive v1.0 drafts
- docs/history/TYPECHECKER-COMPLETION-2026-01-23.md (demoted — the 100%
claim was measured by dune build passing, not behavioural tests)
- Legacy STATE.scm / META.scm / ECOSYSTEM.scm deleted (fresh A2ML
counterparts already exist in .machine_readable/6a2/)
Formal verification (Track F1):
- Idris2 Solo-core formalisation under docs/academic/formal-verification/
solo-core/: Quantity.idr (27 semiring lemmas proven by Refl), Syntax.idr,
Context.idr, Typing.idr, Soundness.idr (declared progress + preservation
+ affinePreservation goals with explicit holes), README.adoc with
weekly-check hook against the OCaml implementation
Estate-wide feedback memories saved (apply to all language projects):
- feedback_bot_scope_creep_free_variant.md -- the "since we already have X,
we can trivially add Y" anti-pattern (linear-because-affine,
dependent-because-refinement, handlers-because-effects)
- feedback_language_scope_in_thesis.md -- scope lives in a written thesis,
not in the code. "I don't see my project in the code" is the alarm signal
- feedback_completion_vs_behavioural_coverage.md -- "dune build passes"
does not equal behavioural test coverage; split rules-vs-wiring metrics
Soundness bugs discovered during the audit (fixes in Phase 1+):
BUG-001 (high): omega-let smuggles linear values (unscaled Let rule)
BUG-002 (medium): :0-let does not erase its RHS
BUG-003 (medium): eval_list evaluates right-to-left via List.fold_right
BUG-004 (medium): lambda-body usage not tracked against outer captures
BUG-005 (medium): WasmGC backend silently drops unknown function calls
Phase 0 complete. Phase 1 is wiring the affine quantity checker into the CLI
check/compile/eval paths (see STATE.a2ml [track-a-manhattan]). Not yet started.
Build: green (dune build).
Tests: 22 failures (identical count to pre-rip baseline — zero new regressions).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(manhattan-recovery): update TyArrow arity to 4-args in parser + julia backend
The Manhattan Recovery commit bundled the pre-existing grammar refactor
that added a quantity field to TyArrow (3-arg -> 4-arg). Two call sites
in parser.mly (type_expr_arrow productions) and julia_codegen.ml
(type_expr_to_julia_string) were at line locations where the auto-merge
with origin/main took upstream's 3-arg version without conflict markers.
Post-cherry-pick build fix — adds the missing quantity argument (None)
in all three call sites. No semantic change.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent fec4db0 commit 78de347
43 files changed
Lines changed: 1702 additions & 1234 deletions
File tree
- .machine_readable
- 6a2
- anchors
- docs
- academic/formal-verification/solo-core
- history
- examples
- lib
- test/e2e/fixtures
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
18 | 19 | | |
19 | | - | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
0 commit comments