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 @@
2828- **`turnOver` and `rotate` change the coordinates.** Frame n is frame n − 1 rotated about its bounding-box centre; the camera does not move.
2929- Paper is rigid flat facets hinged at straight creases. No bending, stiffness, self-collision response or crumpling.
3030- 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.
3232- 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.
3333- 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.
3434- The app never advances the fold parameter on its own.
@@ -103,7 +103,7 @@ Done once, before Task 0.
103103 | D | 7–8 — `foldc`, `foldlint`, the cup | `compiler-and-cup` |
104104 | E | 9–10 — diagram, renderer | `diagram-and-renderer` |
105105 | F | 11–14 — the app | `app` |
106 | G | 15 — crane, boat, box | `models` |
106 | G | 15 — crane, sampan, box | `models` |
107107
108108 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`.
1091094. 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.
139139
140140**Also record:**
141141
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.
143143- 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.
144144
145145**Exit criteria:**
@@ -1694,14 +1694,14 @@ git commit -m "Orbit and zoom, accessibility pass and release assets"
16941694
16951695---
16961696
1697### Task 15: The crane, the boat and the box
1697### Task 15: The crane, the sampan and the box
16981698
16991699**Files:**
17001700- 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`
17021702- Create: `Models/box.foldscript`, `Models/box-cp.fold`
1703- Create: `Packages/FoldKit/Sources/Models/Resources/{crane,boat,box}.fold`
1704- Create: `docs/authoring/{crane,boat,box}.md`
1703- Create: `Packages/FoldKit/Sources/Models/Resources/{crane,sampan,box}.fold`
1704- Create: `docs/authoring/{crane,sampan,box}.md`
17051705- Modify: `Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift` — delete `theCatalogueContainsTheCup`; `theCatalogueContainsFourModels` below replaces it
17061706- Modify: `Packages/FoldKit/Tests/NotationTests/DiagramTests.swift` — golden images for every step of the three new models
17071707- Test: `Packages/FoldKit/Tests/ModelsTests/FourModelTests.swift`
@@ -1709,7 +1709,7 @@ git commit -m "Orbit and zoom, accessibility pass and release assets"
17091709**Interfaces:**
17101710- Consumes: everything from Tasks 0–14. No new API.
17111711
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.
17131713
17141714The 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.
17151715
@@ -1719,7 +1719,7 @@ Each `docs/authoring/*.md` records the crease pattern's provenance, which guesse
17191719
17201720```swift
17211721@Test func theCatalogueContainsFourModels() throws {
1722 #expect(try Set(ModelLibrary.names()) == ["cup", "crane", "boat", "box"])
1722 #expect(try Set(ModelLibrary.names()) == ["cup", "crane", "sampan", "box"])
17231723}
17241724
17251725@Test func theCraneContainsAMultiAxisStep() throws {
@@ -1758,7 +1758,7 @@ Expected: FAIL — only the cup is in the catalogue.
17581758
17591759- [ ] **Step 3: Author the three models**
17601760
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.
17621762
17631763- [ ] **Step 4: Run tests to verify they pass**
17641764
@@ -1769,7 +1769,7 @@ Expected: PASS.
17691769
17701770```bash
17711771git 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"
17731773```
17741774
17751775---
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
7575predating any individual claim. Each model's `file_author` is
7676`"Traditional"` and the validator enforces it.
7777
78**v1 ships four: the cup, the crane, the boat and the box.** The box is the
79masu. Which traditional boat is open (see *Open decisions*). The frog base,
78**v1 ships four: the cup, the crane, the sampan and the box.** The box is
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,
8085fish base, flapping bird and preliminary base are the same kind of thing
8186and come afterwards, cheaply, because the compiler will exist. Four is thin
8287for 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
500505third that makes every model after the first cheap.
501506
502507**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
504509they run on compiled models and live with the catalogue (Tasks 8 and 15).
505510The unit tests written before the compiler exists use small synthetic
506511sheets whose folded coordinates are integers or halves and can be typed
@@ -571,12 +576,9 @@ The headline bars get mechanical checks rather than judgement:
5715762. **Authoring tooling, and how many models.** Settled: build the
572577 compiler, cup first, four models for v1. The plan is 16 tasks: the
573578 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.
5755803. **The interpolation model for coupled steps.** Task 0 measures the
576581 candidates and recommends one. If no rigid model covers a v1 step, the
577582 choice between splitting the step, dropping it and relaxing the
578583 isometry rule for it is the author's.
5794. **Which boat.** Candidates include the paper boat folded from the hat
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.
5844. **Which boat.** Settled: the sampan (see *Rights*).