Commit 5bfc2f5fbe

5bfc2f5fbeb33474719e8bf1cfa5d9b1c03e86d5

parent: cff9586b02

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-19 19:53 UTC

Choose the sampan as v1's boat

Ref #1

Layout: unified · split

docs/superpowers/plans/2026-10-19-fold.md +11 −11
@@ -28,7 +28,7 @@
28- **`turnOver` and `rotate` change the coordinates.** Frame n is frame n − 1 rotated about its bounding-box centre; the camera does not move. 28- **`turnOver` and `rotate` change the coordinates.** Frame n is frame n − 1 rotated about its bounding-box centre; the camera does not move.
29- Paper is rigid flat facets hinged at straight creases. No bending, stiffness, self-collision response or crumpling. 29- Paper is rigid flat facets hinged at straight creases. No bending, stiffness, self-collision response or crumpling.
30- Layer order is authored, never computed. Corrections to the compiler's guess live in the fold script. 30- Layer order is authored, never computed. Corrections to the compiler's guess live in the fold script.
31- v1 ships **four** traditional models: the cup, the crane, the boat and the box (the masu). Every `file_author` is exactly `"Traditional"`, enforced by the validator. 31- v1 ships **four** traditional models: the cup, the crane, the sampan and the box (the masu). Every `file_author` is exactly `"Traditional"`, enforced by the validator.
32- Every shipped model is produced by `foldc` from a committed crease pattern and fold script, and recompiling them reproduces the shipped file (structurally, coordinates within 1e-12). Hand-edited `.fold` files are not shipped. 32- Every shipped model is produced by `foldc` from a committed crease pattern and fold script, and recompiling them reproduces the shipped file (structurally, coordinates within 1e-12). Hand-edited `.fold` files are not shipped.
33- The **cup is compiled first**, the crane last. Before the cup exists, tests use the synthetic fixtures below; model-level assertions live in Tasks 8 and 15. 33- The **cup is compiled first**, the crane last. Before the cup exists, tests use the synthetic fixtures below; model-level assertions live in Tasks 8 and 15.
34- The app never advances the fold parameter on its own. 34- The app never advances the fold parameter on its own.
@@ -103,7 +103,7 @@ Done once, before Task 0.
103 | D | 7–8 — `foldc`, `foldlint`, the cup | `compiler-and-cup` | 103 | D | 7–8 — `foldc`, `foldlint`, the cup | `compiler-and-cup` |
104 | E | 9–10 — diagram, renderer | `diagram-and-renderer` | 104 | E | 9–10 — diagram, renderer | `diagram-and-renderer` |
105 | F | 11–14 — the app | `app` | 105 | F | 11–14 — the app | `app` |
106 | G | 15 — crane, boat, box | `models` | 106 | G | 15 — crane, sampan, box | `models` |
107 107
108 Batch A merges alone, since Task 0 can stop the plan. Each batch commits task by task on its branch, ends with `gitbay mr create --source <branch> --target main`, merges when `swift test --package-path Packages/FoldKit` (and, from batch F, the `xcodebuild` test) is green, and the branch is then deleted locally and remotely. Commit messages end with `Ref #N` for the batch's issue; the batch's last commit uses `Closes #N`. 108 Batch A merges alone, since Task 0 can stop the plan. Each batch commits task by task on its branch, ends with `gitbay mr create --source <branch> --target main`, merges when `swift test --package-path Packages/FoldKit` (and, from batch F, the `xcodebuild` test) is green, and the branch is then deleted locally and remotely. Commit messages end with `Ref #N` for the batch's issue; the batch's last commit uses `Closes #N`.
1094. If `xcrun metal --version` fails, run `xcodebuild -downloadComponent MetalToolchain`. SwiftPM invokes `metal` for the `.metal` file in Task 10; on 2026-10-19 this machine had no Metal toolchain. 1094. If `xcrun metal --version` fails, run `xcodebuild -downloadComponent MetalToolchain`. SwiftPM invokes `metal` for the `.metal` file in Task 10; on 2026-10-19 this machine had no Metal toolchain.
@@ -139,7 +139,7 @@ Done once, before Task 0.
139 139
140**Also record:** 140**Also record:**
141 141
142- For each v1 model, every step that is not a single independent fold — the crane's preliminary-base collapse or squash folds, its petal folds and its inside reverse folds (neck, tail, head); the masu's wall-raising; the boat's, once the boat is chosen; the cup has none — with the case above that stands in for it and the model that covers it. 142- For each v1 model, every step that is not a single independent fold — the crane's preliminary-base collapse or squash folds, its petal folds and its inside reverse folds (neck, tail, head); the masu's wall-raising; the sampan's final turn inside out; the cup has none — with the case above that stands in for it and the model that covers it.
143- Whether the overlapping-moving-sets rule for `krz:faceOrders_midFold` covers anything the end frame's ordering and the near-coplanar clusters (design, *Rendering*) do not. Case 1 suggests the problem with overlapping moving sets is that they collide, which ordering cannot fix. The key's other use, the peak order of a `foldAndUnfold`, is not in question. If the rule has no remaining consumer, recommend removing it, with the evidence; that changes a settled decision and goes to the author. 143- Whether the overlapping-moving-sets rule for `krz:faceOrders_midFold` covers anything the end frame's ordering and the near-coplanar clusters (design, *Rendering*) do not. Case 1 suggests the problem with overlapping moving sets is that they collide, which ordering cannot fix. The key's other use, the peak order of a `foldAndUnfold`, is not in question. If the rule has no remaining consumer, recommend removing it, with the evidence; that changes a settled decision and goes to the author.
144 144
145**Exit criteria:** 145**Exit criteria:**
@@ -1694,14 +1694,14 @@ git commit -m "Orbit and zoom, accessibility pass and release assets"
1694 1694
1695--- 1695---
1696 1696
1697### Task 15: The crane, the boat and the box 1697### Task 15: The crane, the sampan and the box
1698 1698
1699**Files:** 1699**Files:**
1700- Create: `Models/crane.foldscript`, `Models/crane-cp.fold` 1700- Create: `Models/crane.foldscript`, `Models/crane-cp.fold`
1701- Create: `Models/boat.foldscript`, `Models/boat-cp.fold` 1701- Create: `Models/sampan.foldscript`, `Models/sampan-cp.fold`
1702- Create: `Models/box.foldscript`, `Models/box-cp.fold` 1702- Create: `Models/box.foldscript`, `Models/box-cp.fold`
1703- Create: `Packages/FoldKit/Sources/Models/Resources/{crane,boat,box}.fold` 1703- Create: `Packages/FoldKit/Sources/Models/Resources/{crane,sampan,box}.fold`
1704- Create: `docs/authoring/{crane,boat,box}.md` 1704- Create: `docs/authoring/{crane,sampan,box}.md`
1705- Modify: `Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift` — delete `theCatalogueContainsTheCup`; `theCatalogueContainsFourModels` below replaces it 1705- Modify: `Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift` — delete `theCatalogueContainsTheCup`; `theCatalogueContainsFourModels` below replaces it
1706- Modify: `Packages/FoldKit/Tests/NotationTests/DiagramTests.swift` — golden images for every step of the three new models 1706- Modify: `Packages/FoldKit/Tests/NotationTests/DiagramTests.swift` — golden images for every step of the three new models
1707- Test: `Packages/FoldKit/Tests/ModelsTests/FourModelTests.swift` 1707- Test: `Packages/FoldKit/Tests/ModelsTests/FourModelTests.swift`
@@ -1709,7 +1709,7 @@ git commit -m "Orbit and zoom, accessibility pass and release assets"
1709**Interfaces:** 1709**Interfaces:**
1710- Consumes: everything from Tasks 0–14. No new API. 1710- Consumes: everything from Tasks 0–14. No new API.
1711 1711
1712Authoring, not engineering: three crease patterns, three scripts, and a correction pass over each model's guessed `faceOrders`, made as overrides in the script. Every gate already exists — Task 2's validator, Task 6's interpenetration checker, Task 8's catalogue tests including the isometry sweep — so this task adds no new machinery, only the models and the record of how each was verified. Which boat is the author's choice (design, *Open decisions*); do not start the boat until it is made. 1712Authoring, not engineering: three crease patterns, three scripts, and a correction pass over each model's guessed `faceOrders`, made as overrides in the script. Every gate already exists — Task 2's validator, Task 6's interpenetration checker, Task 8's catalogue tests including the isometry sweep — so this task adds no new machinery, only the models and the record of how each was verified. Published sampan sequences differ in their middle steps; `docs/authoring/sampan.md` records which sequence was authored and its source.
1713 1713
1714The crane is deliberately last. It is the model that proves multi-axis petal folds and eight-deep wing stacks work, and by this point the compiler, the renderer and the gestures are all known-good against the cup, so a failure here is an authoring error rather than an ambiguity about which layer is at fault. 1714The crane is deliberately last. It is the model that proves multi-axis petal folds and eight-deep wing stacks work, and by this point the compiler, the renderer and the gestures are all known-good against the cup, so a failure here is an authoring error rather than an ambiguity about which layer is at fault.
1715 1715
@@ -1719,7 +1719,7 @@ Each `docs/authoring/*.md` records the crease pattern's provenance, which guesse
1719 1719
1720```swift 1720```swift
1721@Test func theCatalogueContainsFourModels() throws { 1721@Test func theCatalogueContainsFourModels() throws {
1722 #expect(try Set(ModelLibrary.names()) == ["cup", "crane", "boat", "box"]) 1722 #expect(try Set(ModelLibrary.names()) == ["cup", "crane", "sampan", "box"])
1723} 1723}
1724 1724
1725@Test func theCraneContainsAMultiAxisStep() throws { 1725@Test func theCraneContainsAMultiAxisStep() throws {
@@ -1758,7 +1758,7 @@ Expected: FAIL — only the cup is in the catalogue.
1758 1758
1759- [ ] **Step 3: Author the three models** 1759- [ ] **Step 3: Author the three models**
1760 1760
1761Box and boat first, then the crane. Neither the box nor the boat is shallow: the masu's wall-raising step is a coupled 3D step, and the boat depends on which one is chosen; both use whatever Task 0 decided for coupled steps. Run `foldc`, then `foldlint`, correcting guessed orderings with script overrides where the interpenetration checker or the validator's layer-order rules object. Check each in the app before committing: the checks prove no facet passes through another and no ordering is impossible, but only your eye tells you the fold reads correctly. 1761Box and sampan first, then the crane. Neither is shallow: the masu's wall-raising and the sampan's final turn inside out are coupled 3D steps, and both use whatever Task 0 decided for coupled steps. Run `foldc`, then `foldlint`, correcting guessed orderings with script overrides where the interpenetration checker or the validator's layer-order rules object. Check each in the app before committing: the checks prove no facet passes through another and no ordering is impossible, but only your eye tells you the fold reads correctly.
1762 1762
1763- [ ] **Step 4: Run tests to verify they pass** 1763- [ ] **Step 4: Run tests to verify they pass**
1764 1764
@@ -1769,7 +1769,7 @@ Expected: PASS.
1769 1769
1770```bash 1770```bash
1771git add Models Packages/FoldKit docs/authoring 1771git add Models Packages/FoldKit docs/authoring
1772git commit -m "The crane, the boat and the box" 1772git commit -m "The crane, the sampan and the box"
1773``` 1773```
1774 1774
1775--- 1775---
docs/superpowers/specs/2026-10-19-fold-design.md +10 −8
@@ -75,8 +75,13 @@ community, a serious breach. Every model here is traditional, long
75predating any individual claim. Each model's `file_author` is 75predating any individual claim. Each model's `file_author` is
76`"Traditional"` and the validator enforces it. 76`"Traditional"` and the validator enforces it.
77 77
78**v1 ships four: the cup, the crane, the boat and the box.** The box is the 78**v1 ships four: the cup, the crane, the sampan and the box.** The box is
79masu. Which traditional boat is open (see *Open decisions*). The frog base, 79the masu. The sampan was chosen over the paper boat folded from a hat: it
80starts from a square, its middle steps are plain folds, and its one hard
81step — turning the model inside out — comes last, the same kind of 3D
82opening as the masu's. The paper boat needs a rectangle and two collapses
83mid-sequence. Published sampan sequences differ in their middle steps; the
84one authored is recorded in `docs/authoring/sampan.md`. The frog base,
80fish base, flapping bird and preliminary base are the same kind of thing 85fish base, flapping bird and preliminary base are the same kind of thing
81and come afterwards, cheaply, because the compiler will exist. Four is thin 86and come afterwards, cheaply, because the compiler will exist. Four is thin
82for a first release but defensible; one is not, and eight is authoring work 87for a first release but defensible; one is not, and eight is authoring work
@@ -500,7 +505,7 @@ overrides, and per-frame validation. Roughly a third of the task, and the
500third that makes every model after the first cheap. 505third that makes every model after the first cheap.
501 506
502**Model-level tests need the same precision.** Assertions about the cup, 507**Model-level tests need the same precision.** Assertions about the cup,
503crane, boat and box need the same exact coordinates as a shipped model, so 508crane, sampan and box need the same exact coordinates as a shipped model, so
504they run on compiled models and live with the catalogue (Tasks 8 and 15). 509they run on compiled models and live with the catalogue (Tasks 8 and 15).
505The unit tests written before the compiler exists use small synthetic 510The unit tests written before the compiler exists use small synthetic
506sheets whose folded coordinates are integers or halves and can be typed 511sheets whose folded coordinates are integers or halves and can be typed
@@ -571,12 +576,9 @@ The headline bars get mechanical checks rather than judgement:
5712. **Authoring tooling, and how many models.** Settled: build the 5762. **Authoring tooling, and how many models.** Settled: build the
572 compiler, cup first, four models for v1. The plan is 16 tasks: the 577 compiler, cup first, four models for v1. The plan is 16 tasks: the
573 interpolation spike (Task 0), the engine, the compiler, the app and the 578 interpolation spike (Task 0), the engine, the compiler, the app and the
574 cup, then the crane, boat and box as one gated authoring task. 579 cup, then the crane, sampan and box as one gated authoring task.
5753. **The interpolation model for coupled steps.** Task 0 measures the 5803. **The interpolation model for coupled steps.** Task 0 measures the
576 candidates and recommends one. If no rigid model covers a v1 step, the 581 candidates and recommends one. If no rigid model covers a v1 step, the
577 choice between splitting the step, dropping it and relaxing the 582 choice between splitting the step, dropping it and relaxing the
578 isometry rule for it is the author's. 583 isometry rule for it is the author's.
5794. **Which boat.** Candidates include the paper boat folded from the hat 5844. **Which boat.** Settled: the sampan (see *Rights*).
580 and the sampan. The common paper boat starts from a rectangle; frame 0
581 does not have to be square, but the crease pattern and the validator's
582 isometry baseline then come from the rectangle.