Commit 5bfc2f5fbe
Verified · cmc
Layout: unified · split
docs/superpowers/plans/2026-10-19-fold.md +11 −11
| @@ -28,7 +28,7 @@ | ||
| 28 | 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 | 29 | - Paper is rigid flat facets hinged at straight creases. No bending, stiffness, self-collision response or crumpling. |
| 30 | 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 | 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 | 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 | 34 | - The app never advances the fold parameter on its own. |
| @@ -103,7 +103,7 @@ Done once, before Task 0. | ||
| 103 | 103 | | D | 7–8 — `foldc`, `foldlint`, the cup | `compiler-and-cup` | |
| 104 | 104 | | E | 9–10 — diagram, renderer | `diagram-and-renderer` | |
| 105 | 105 | | F | 11–14 — the app | `app` | |
| 106 | | G | 15 — crane, boat, box | `models` | | |
| 106 | | G | 15 — crane, sampan, box | `models` | | |
| 107 | 107 | |
| 108 | 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`. |
| 109 | 109 | 4. 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 | 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 | 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 | 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 | 1699 | **Files:** |
| 1700 | 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 | 1702 | - 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` | |
| 1705 | 1705 | - Modify: `Packages/FoldKit/Tests/ModelsTests/CatalogueTests.swift` — delete `theCatalogueContainsTheCup`; `theCatalogueContainsFourModels` below replaces it |
| 1706 | 1706 | - Modify: `Packages/FoldKit/Tests/NotationTests/DiagramTests.swift` — golden images for every step of the three new models |
| 1707 | 1707 | - Test: `Packages/FoldKit/Tests/ModelsTests/FourModelTests.swift` |
| @@ -1709,7 +1709,7 @@ git commit -m "Orbit and zoom, accessibility pass and release assets" | ||
| 1709 | 1709 | **Interfaces:** |
| 1710 | 1710 | - Consumes: everything from Tasks 0–14. No new API. |
| 1711 | 1711 | |
| 1712 | Authoring, 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. | |
| 1712 | Authoring, 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 | |
| 1714 | 1714 | The 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 | 1720 | ```swift |
| 1721 | 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 | 1725 | @Test func theCraneContainsAMultiAxisStep() throws { |
| @@ -1758,7 +1758,7 @@ Expected: FAIL — only the cup is in the catalogue. | ||
| 1758 | 1758 | |
| 1759 | 1759 | - [ ] **Step 3: Author the three models** |
| 1760 | 1760 | |
| 1761 | Box 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. | |
| 1761 | Box 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 | 1763 | - [ ] **Step 4: Run tests to verify they pass** |
| 1764 | 1764 | |
| @@ -1769,7 +1769,7 @@ Expected: PASS. | ||
| 1769 | 1769 | |
| 1770 | 1770 | ```bash |
| 1771 | 1771 | git add Models Packages/FoldKit docs/authoring |
| 1772 | git commit -m "The crane, the boat and the box" | |
| 1772 | git 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 | ||
| 75 | 75 | predating any individual claim. Each model's `file_author` is |
| 76 | 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 | |
| 79 | masu. 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 | |
| 79 | the masu. The sampan was chosen over the paper boat folded from a hat: it | |
| 80 | starts from a square, its middle steps are plain folds, and its one hard | |
| 81 | step — turning the model inside out — comes last, the same kind of 3D | |
| 82 | opening as the masu's. The paper boat needs a rectangle and two collapses | |
| 83 | mid-sequence. Published sampan sequences differ in their middle steps; the | |
| 84 | one authored is recorded in `docs/authoring/sampan.md`. The frog base, | |
| 80 | 85 | fish base, flapping bird and preliminary base are the same kind of thing |
| 81 | 86 | and come afterwards, cheaply, because the compiler will exist. Four is thin |
| 82 | 87 | for 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 | ||
| 500 | 505 | third that makes every model after the first cheap. |
| 501 | 506 | |
| 502 | 507 | **Model-level tests need the same precision.** Assertions about the cup, |
| 503 | crane, boat and box need the same exact coordinates as a shipped model, so | |
| 508 | crane, sampan and box need the same exact coordinates as a shipped model, so | |
| 504 | 509 | they run on compiled models and live with the catalogue (Tasks 8 and 15). |
| 505 | 510 | The unit tests written before the compiler exists use small synthetic |
| 506 | 511 | sheets whose folded coordinates are integers or halves and can be typed |
| @@ -571,12 +576,9 @@ The headline bars get mechanical checks rather than judgement: | ||
| 571 | 576 | 2. **Authoring tooling, and how many models.** Settled: build the |
| 572 | 577 | compiler, cup first, four models for v1. The plan is 16 tasks: the |
| 573 | 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. | |
| 575 | 580 | 3. **The interpolation model for coupled steps.** Task 0 measures the |
| 576 | 581 | candidates and recommends one. If no rigid model covers a v1 step, the |
| 577 | 582 | choice between splitting the step, dropping it and relaxing the |
| 578 | 583 | isometry rule for it is the author's. |
| 579 | 4. **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. | |
| 584 | 4. **Which boat.** Settled: the sampan (see *Rights*). | |