Commit 3d64464
preset: expand a test question into an ordinary recipe
The first preset, and the shape every later one follows.
A preset is a function from parameters to a recipe and nothing else.
What it returns is recipe SOURCE rather than a structure, and that is
the decision the rest of this rests on: PR5 says there are no closed
presets, so eject has to give back something editable, and the strongest
way to keep that promise is for eject and a run to be handed the same
bytes. They cannot drift apart when there is only one of them, and the
same parser reads them that reads a file somebody wrote by hand.
size-boundaries answers "is a size limit enforced exactly where it is
declared". It expands into seven targets - three below the limit, one on
it, three above - each with its own size, its own name and its own
expectation. The flip from accept to reject sits exactly on the limit,
which is the one statement the whole preset exists to make.
Not built on the boundary key, and that is worth saying because it looks
like it should be. A boundary target makes three files under one id and
they share one expectation, while these need three different ones - and
the spread reaches seven sizes rather than three. Explicit targets carry
both. It also means expected per target was enough, and nothing about
the contract had to move.
The distances cancel in pairs, so a set comes to exactly seven times the
limit. The format document said about twice, which is the number
somebody would have planned disk space around.
Parameters reuse the format package's Property rather than declaring a
second vocabulary for a name, a kind, a default and a sentence. One
implementation decides what values are allowed and one wording refuses
the rest, so a window drawing a preset field will work like one drawing
a format field.
--format is read rather than redeclared. CLI.md calls a preset parameter
clashing with an existing flag a mistake in the preset, and --format
already names the format of a file - the same thing this preset wanted
it to mean. So the preset supplies a value through the precedence chain,
and Reads is what lets "preset show" still list it, because a setting
nobody knows they can change is a setting that is not there.
A limit too small for the files below it is refused as a whole set
rather than delivered as the part that fits. PR7, and the part that fits
is never the part the run was about - the interesting files are the ones
nearest the limit.
No lock in the registry, deliberately. The format registry beside it
carries the single lock in this tree and a guard names the files allowed
to be concurrent, so widening that surface is a decision. There is
nothing to decide here: registration happens in init and everything
reads after.
Three guards, three mutations.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 5b0b049 commit 3d64464
4 files changed
Lines changed: 606 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
This file was deleted.
0 commit comments