plum

#treesitter#compiler#wasm

git clone https://git.pyrossh.dev/plum

A statically typed, imperative programming language inspired by rust, python


305282b — Peter John 2026-11-01T21:09:49+05:30
docs(plans): union enums Phase B done
docs/plans/2026-11-01-union-enums.incidents.jsonl ADDED
@@ -0,0 +1,15 @@
1
+ {"file": "docs/.DS_Store", "line": 0, "context": "T1: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "18:21:25"}
2
+ {"file": "", "line": 0, "context": "verified: seam T1↔T2", "agent": "pt_review", "kind": "verified", "time": "18:24:09"}
3
+ {"file": "", "line": 0, "context": "verified: seam T2↔T3", "agent": "pt_review", "kind": "verified", "time": "18:28:00"}
4
+ {"file": "", "line": 0, "context": "verified: seam T3↔T4", "agent": "pt_review", "kind": "verified", "time": "20:31:34"}
5
+ {"file": "", "line": 0, "context": "verified: seam T2↔T6", "agent": "pt_review", "kind": "verified", "time": "20:31:34"}
6
+ {"file": "", "line": 0, "context": "verified: seam T4↔T5", "agent": "pt_review", "kind": "verified", "time": "20:34:15"}
7
+ {"file": "", "line": 0, "context": "verified: seam T5↔T7", "agent": "pt_review", "kind": "verified", "time": "20:41:40"}
8
+ {"file": "", "line": 0, "context": "verified: seam T6↔T7", "agent": "pt_review", "kind": "verified", "time": "20:41:40"}
9
+ {"file": "plum-examples/control_flow.plum", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
10
+ {"file": "plum-examples/digit_names.plum", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
11
+ {"file": "plum-examples/dop_visitor.plum", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
12
+ {"file": "plum-examples/error_propagation.plum", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
13
+ {"file": "plum-examples/shapes.plum", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
14
+ {"file": "plum-wasm-codegen/tests/examples_test.rs", "line": 0, "context": "T8: change outside Owns blocked by commit_task; nothing committed", "agent": "commit_task", "kind": "exception", "resolution": "open", "time": "20:52:19"}
15
+ {"file": "", "line": 0, "context": "verified: seam T8↔T9", "agent": "pt_review", "kind": "verified", "time": "21:01:26"}
docs/plans/2026-11-01-union-enums.progress.md ADDED
@@ -0,0 +1,50 @@
1
+ - start 9336364 (branch superlite/union-enums)
2
+ - Ruling: one-line enum form takes no body; multi-line form for methods - keeps one-line simple - cost: two forms
3
+ - Ruling: auto-dispatch excludes operators - scope - cost: a + b on enums still needs explicit methods
4
+ - Ruling: lowering reuses the checker's two-pass TypedInfo::lowered path; codegen unchanged - cost: an extra check pass when unions are used
5
+ - Ruling: plan 20k chars, over the 15k cap - 9 tasks with verbatim error contracts; agents read only their block - cost: larger prime
6
+ - Ruling: skip Wave 0 T0 - Rust workspace, T2 producers committed before consumers run - cost: none
7
+ - unblocked: dispatched T1 at 18:19:15; waiting on fixes: none
8
+ - commit T1 4b2d950a9a grammar + parser
9
+ - Ruling: parseSource also calls resolveMembers (single-file test path); parser.rs added to T2 Owns for that edit - cost: none
10
+ - commit T2 1ecfcf4c4a resolve + plan recorder
11
+ - commit T2 parser.rs follow-up 9568089
12
+ - Ruling: checker test bareTypeEnumVariantSugarWrapsTheSameNamedRecordShapedEnum red until T3/T4 replace the old bare-type variant sugar (lib.rs buildGlobalTables/bareVariantWrapType) with member handling - cost: one red test mid-chain
13
+ - dispatched T3 fresh, T6 to aad0994 at 18:24:50
14
+ - Ruling: old checker bare-type variant sugar (enum Book = | FantasyBook) removed in T3; codegen-side copy cleaned up in T7 - superseded by members - cost: oop_visitor.plum may need T8 migration
15
+ - Ruling: auto-dispatch lowers to a synthesized enum method (match self over members), call sites untouched - Plum has no match expression - cost: method signature copied syntactically from the first member
16
+ - commit T3 7df41646fe checker coercions
17
+ - Ruling: Plum has no local type annotations (x: T = v); review-plan examples 's: Shape = Circle(..)' are illustrative - T9 docs use fn params/returns - cost: none
18
+ - Ruling: joined generic enum typed bare (Tree, not Tree[Int]) accepted for now; T7 tree_generic e2e must prove it compiles, else fixer - cost: possible follow-up
19
+ - dispatched T4 to a21583a, package-reviewer on T3 (report-only for checker src) at 18:28:27
20
+ - commit T4 8a21eddd45 checker patterns + narrowing
21
+ - commit T6 e02a80ac56 applyPlan rewrite
22
+ - commit T4 T6 + follow-up d12d5e1
23
+ - T3 review: finding - unify member<:enum arm fires inside TApp/TFun args (List[Circle] accepted as List[Shape], unsound); ignored test invariant_list_rejected; fix routed to T5 agent first
24
+ - T6: 3 parser_test.rs tests red (union member tests lack member type decls after parseSource resolves) - fixer
25
+ - dispatched: T3-review fix + T5 to a21583a; fixer-sonnet parser tests; package-reviewer on T6 at 20:32:06
26
+ - fix 348b356: parser union tests use parseRaw; plum-core green
27
+ - commit T5 e9976f3ee2 checker auto-dispatch
28
+ - Ruling: member into T? / !T (Shape?, !Shape) must convert (union wrap + err wrap) - routed to T7 with a test - cost: none
29
+ - commit T5 + T6-review ef6dc10: 3 applyPlan fixes
30
+ - Ruling: auto-dispatch of a method with a variadic param is a checker error (no spread-arg AST form) - routed to T7 - cost: such methods need an explicit enum method
31
+ - dispatched T7 fresh (a21583a over 80k) at 20:34:44
32
+ - commit T7 77038a290c pipeline wiring + e2e
33
+ - Ruling: restorePlan keeps first-pass plan inspectable for unit tests - test-only convenience - cost: stale addresses if misused
34
+ - Ruling: codegen bare-type sugar left (T7 couldn't find a codegen-side copy; likely checker-only) - cost: none
35
+ - dispatched: package-reviewer T7 (+Bool member root cause), T8 fresh at 20:42:12
36
+ - commit T7-review a1aafdc: Bool added to BUILTIN_MEMBERS
37
+ - Ruling: legacyErrors exempts a payload-less self-named single variant (enum Array[T] = | Array: opaque builtin handle; record needs >=1 field) - cost: one legacy form survives for builtins
38
+ - commit T8 401e713 (by name: 6 files outside planned Owns needed migration)
39
+ - T8 finding: first-pass exhaustiveness misses member patterns with refutable sub-patterns (Wrap(Present(v)) + Wrap(Absent) reported missing Wrap); 3 catch-all workarounds in match.plum - fixer
40
+ - dispatched: fixer-sonnet-high exhaustiveness, T9 fresh at 20:52:49
41
+ - fix acc2f1f: coverRows recurses into member sub-patterns; match.plum catch-alls removed
42
+ - commit T9 748850d9fe Json + README
43
+ - commit T9; Json API: JsonBool/JsonFloat/JsonStr/JsonList/JsonMap constructors removed (pass bare values)
44
+ - verified: cargo test --workspace 520/0/0; plum test 2625/0 53/53; tree-sitter 100/100
45
+ - tests full passed=520 failed=0 skipped=0 seconds=24.3
46
+ - Ruling: commit-blocker incidents (.DS_Store, 6 T8 files) resolved - .DS_Store in .git/info/exclude, untracked; T8 files landed by name in the T8 commit - cost: none
47
+ - Ruling: member value calling its enum's own method (Circle(..).area() where Shape defines area) falls back via receiver wrap when the member belongs to exactly one enum with that method - final-review finding, restores pre-migration call style - cost: checker work
48
+ - fix b61c94e: dop_visitor header comment
49
+ - fix 4659312: member receiver falls back to its unique enum's method
50
+ - final review findings addressed; verified: cargo 523/0/0; plum test 2625/0 53/53; tree-sitter 100/100