Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/execution-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ descriptions, and commit messages*
- [x] **Unit 6: macros.** Landed 2026-08-16 (PR 52) as `defmacro` with `qq` and `unquote`, classic Chialisp semantics stated in `docs/lang/macros.md`. Decisions by Evan, 2026-08-16: macros only, includes split to their own unit below (skeleton change under ground rule 6). `if` and `list` stay compiler forms, so macros cannot shadow built-ins. Expansion is depth-capped and cost-budgeted, a recorded deviation from Chialisp's unbounded expansion. No `function` or `com` reflection form, the laziness expressiveness gap recorded in the language doc. No refactor rode along, the shared emission-primitives cleanup stays a candidate for a standalone PR. Expansion runs as a source pre-pass before reachability, macro bodies compile at declaration against earlier macros only, and read-back diverges from clvm_tools by one hop only (decision by Evan, 2026-08-16, steelmanned both ways, then narrowed twice as four review rounds showed every wider evidence scheme unsound on post-reader bytes): names the caller writes in a call's own arguments error when unresolved, REPL def spellings are barred resolution-side, and capture plus stale template spellings stay as Chialisp has them, documented sharp edges. The three new reserved words are a deliberate source and symbol-file compatibility break for earlier programs that used them as names, pinned by a loader test. Compiled representatives pinned in `vectors/vm/macro-programs.json`. Kept after the 2026-08-16 public-record review (decision by Evan): the fixed special forms and capped expansion avoid the macro-built-language failure mode on that record, and re-evaluation stays open at unit 7. Reversed by unit 6c the same day.
- [x] **Unit 6b: includes and the compile-time forms.** Split from unit 6 (decision by Evan, 2026-08-16): an include mechanism needs its own recorded decision against the self-containment rule, a program compiling identically pasted into the REPL. Scope expanded and resequenced ahead of unit 7 (decision by Evan, 2026-08-16, on a two-corpus census of tibetswap and chia-gaming): source-level include of shared constants and functions, computed compile-time constants, and inline functions. Every production puzzle file in both corpora imports shared definitions, and tibetswap defines nine of every ten functions inline. The census corrected the earlier deferral's premise: chia-gaming never abandoned source-level import, its compiled-sibling hash plumbing lives in its build layer outside the language, and that import stays deferred with `bitlisp-compile -T` covering the need manually in v0. `let` stays out, two uses across both corpora, both in tests. `assign` stays held on unit 7 evidence with a pre-registered trigger: benchmark-puzzle helpers that exist only to name intermediate values. Landed 2026-08-16 as `include`, computed `defconstant`, and `defun-inline`, stated in `docs/lang/language.md`. Decisions by Evan, 2026-08-16, via the approved unit plan: the self-containment rule is amended to the form plus its include files resolved through the same explicit search path everywhere, a repeat include dedupes by resolved file and a cycle errors where the classic reference dies on the collision or recurses without bound, `defconstant` evaluates its value on the reference VM under the default budget (a pinned break with unit 4's verbatim semantics, the modern defconst behavior under the classic keyword), and `defun-inline` keeps call-by-name laziness while closing classic's probe-verified sharp edges: arity checked, quoted content untouched, shadowing impossible, expansion depth-capped. Compiled representatives joined `compiled-programs.json`.
- [x] **Unit 6c: the macro reversal.** Landed 2026-08-16 as the removal of `defmacro`, `qq`, and `unquote` and the addition of `assert`, `and`, and `or` as fixed compiler forms with classic utility_macros semantics, reversing unit 6 (decision by Evan, 2026-08-16, both sides steelmanned under ground rule 3). The evidence: three usage surveys (Chia's canonical 91-puzzle corpus, the corpora vendored in references/, and chia-gaming) found no novel macro in any deployed puzzle, short-circuit assert, and, and or the entire production vocabulary, and chia-gaming's production referee choosing built-in destructuring over the structural macro sitting unbuilt beside it. The reserved-word set change breaks compatibility in both directions, pinned by the loader test. Compiled representatives joined `vectors/vm/compiled-programs.json`, and `macro-programs.json` left with the feature.
- [ ] **Unit 7: the four benchmark puzzles, written in the language, as the acceptance artifact:** payment pool, async offer, vault, singleton wrapper. This phase makes them exist and run, Phase 4 measures them. One PR per puzzle where size warrants. Style constraint (decision by Evan, 2026-08-16, simplified by unit 6c, widened by unit 6b's resequencing): the puzzles are plain functions, the fixed forms, and the unit 6b surfaces, there being no macro system, and the authoring experience feeds the typed v1 gate's ledger note on whether unit 6c's cut ever binds.
- [ ] **Unit 7: the four benchmark puzzles, written in the language, as the acceptance artifact:** vault, payment pool, async offer, singleton wrapper. This phase makes them exist and run, Phase 4 measures them. One PR per puzzle where size warrants. Style constraint (decision by Evan, 2026-08-16, simplified by unit 6c, widened by unit 6b's resequencing): the puzzles are plain functions, the fixed forms, and the unit 6b surfaces, there being no macro system, and the authoring experience feeds the typed v1 gate's ledger note on whether unit 6c's cut ever binds. Vault first, resequenced ahead of the pool (decision by Evan, 2026-08-16): core semantics match BIP-345, one PR, plus the keyless leader/follower consolidation path over the message ledger with its theft vectors, the evaluation doc's section 3.2 benchmark. Recovery posture is a curried per-instance choice, keyless or keyed (decision by Evan, 2026-08-16). The vault's dispatch helpers exist only to name a reconstructed root once, the pre-registered assign trigger firing, evidence for the unit 7 ledger note.

**Standing constraints:**

Expand Down
9 changes: 9 additions & 0 deletions docs/glossary.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,12 @@ A term enters this table in the same PR that introduces it.
| curry, uncurry | compare filling the placeholder keys of a script template before deriving its address | curry, uncurry (clvm_tools, chia_rs) | fixing values into a program to make a new committed program and reading them back out, the shape and the strict uncurry contract in docs/lang/curry.md, landed 2026-08-16 |
| include | no script equivalent, script has no authoring language | include (clvm_tools stage 2), import (clvm_tools_rs) | the declaration-file splice form, one declaration list per file resolved through the -I search path, files deduplicated and cycles rejected where classic errors or recurses (docs/lang/language.md deviations), landed 2026-08-16 |
| defun-inline | no script equivalent, script has no authoring language | defun-inline (Chialisp) | the inline function declaration, call-by-name splicing at each call site with arity checked and quoted content untouched where classic substitutes blindly (docs/lang/language.md deviations), landed 2026-08-16 |
| mod hash | compare the script inside a P2WSH or tapleaf commitment, identified by its hash | MOD_HASH, the curried-in hash of a puzzle's own uncurried source | the tree hash of an uncurried program, curried into instances so a program can recompute its own curried identity (docs/puzzles/vault.md), glossed 2026-08-16 with the vault |
| vault | BIP-345 vault, OP_VAULT plus OP_VAULT_RECOVER | the clawback and custody puzzles are the nearest relatives | the first benchmark puzzle, delayed sends with an always-available recovery path (docs/puzzles/vault.md), landed 2026-08-16 |
| trigger spend | the OP_VAULT trigger transaction | no direct equivalent | the authorized vault spend committing a withdrawal target chosen at spend time and creating the triggered coin |
| triggered coin | the OP_VAULT trigger output carrying the substituted leaf | no direct equivalent | the delayed state between trigger and withdrawal, the triggered program curried with the target hash |
| withdrawal | the OP_VAULT withdrawal transaction under CSV plus CTV | no direct equivalent | the triggered coin's matured spend into exactly the committed output set, ASSERT_SEQUENCE_HEIGHT plus SEAL_OUTPUTS |
| revault | the OP_VAULT revault output | no direct equivalent | the trigger's remainder claim re-encumbering value under the byte-exact original vault scriptPubKey |
| recovery scriptPubKey | the OP_VAULT_RECOVER recovery path, pinned by hash in the BIP | compare the clawback destination | the fixed destination every recovery pays, curried as literal bytes here (docs/puzzles/vault.md divergences) |
| consolidation leader | no script equivalent | no direct equivalent | the one input of a keyless consolidation that lists the follower amounts, receives their messages, and claims the merged output (docs/puzzles/vault.md) |
| consolidation follower | no script equivalent | no direct equivalent | a keyless consolidation input sending one message that commits its own scriptPubKey and amount to the ledger the leader must balance |
Loading