@rulecad/cad 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/AGENTS.md +45 -16
  2. package/CHANGELOG.md +724 -0
  3. package/EXAMPLES.md +61 -54
  4. package/README.md +376 -98
  5. package/TUTORIAL.md +2 -2
  6. package/bin/cad.mjs +2664 -541
  7. package/lib/animate.mjs +173 -49
  8. package/lib/assembly.mjs +1883 -435
  9. package/lib/beams.mjs +256 -52
  10. package/lib/belts.mjs +66 -15
  11. package/lib/board-work.mjs +12 -0
  12. package/lib/bought.mjs +309 -53
  13. package/lib/buildpage.mjs +179 -29
  14. package/lib/cache-file.mjs +105 -0
  15. package/lib/carried.mjs +201 -0
  16. package/lib/clone.mjs +194 -42
  17. package/lib/code-text.mjs +28 -0
  18. package/lib/design-imports.mjs +127 -0
  19. package/lib/design.mjs +871 -147
  20. package/lib/designshapes.mjs +142 -0
  21. package/lib/drive.mjs +187 -63
  22. package/lib/edit.mjs +922 -192
  23. package/lib/errors.mjs +16 -3
  24. package/lib/estimates.mjs +51 -0
  25. package/lib/explain.mjs +62 -13
  26. package/lib/fasten.mjs +2708 -507
  27. package/lib/fe-key.mjs +29 -0
  28. package/lib/fittings.mjs +721 -122
  29. package/lib/fixings.mjs +38 -13
  30. package/lib/framebuild.mjs +790 -175
  31. package/lib/framecheck.mjs +1901 -368
  32. package/lib/framegen.mjs +108 -22
  33. package/lib/frameheat.mjs +225 -42
  34. package/lib/frameprint.mjs +513 -108
  35. package/lib/frames.mjs +86 -18
  36. package/lib/framesize.mjs +719 -120
  37. package/lib/frametip.mjs +235 -0
  38. package/lib/gait.mjs +135 -23
  39. package/lib/grip.mjs +62 -13
  40. package/lib/guides.mjs +1403 -230
  41. package/lib/host.mjs +129 -23
  42. package/lib/inplace.mjs +171 -36
  43. package/lib/jigs.mjs +360 -78
  44. package/lib/joins.mjs +697 -118
  45. package/lib/jsonedit.mjs +88 -26
  46. package/lib/kept.mjs +84 -0
  47. package/lib/kit.mjs +439 -69
  48. package/lib/layout.mjs +2 -1
  49. package/lib/links.mjs +149 -42
  50. package/lib/list.mjs +334 -64
  51. package/lib/live-guard.mjs +68 -0
  52. package/lib/live-shape.mjs +96 -24
  53. package/lib/live.mjs +189 -59
  54. package/lib/loads.mjs +597 -136
  55. package/lib/machine.mjs +372 -74
  56. package/lib/magnets.mjs +162 -44
  57. package/lib/measured.mjs +1080 -117
  58. package/lib/mesh.mjs +526 -119
  59. package/lib/meshcmd.mjs +215 -60
  60. package/lib/motors.mjs +1002 -214
  61. package/lib/motorsvg.mjs +114 -32
  62. package/lib/names.mjs +18 -1
  63. package/lib/optimise.mjs +991 -287
  64. package/lib/order.mjs +515 -114
  65. package/lib/panels.mjs +482 -94
  66. package/lib/parts.mjs +81 -23
  67. package/lib/pins.mjs +163 -44
  68. package/lib/plates.mjs +223 -35
  69. package/lib/player.mjs +37 -9
  70. package/lib/power.mjs +64 -13
  71. package/lib/preview.mjs +83 -16
  72. package/lib/profilemeasure.mjs +572 -129
  73. package/lib/rules.mjs +17 -6
  74. package/lib/sandbox-hooks.mjs +179 -27
  75. package/lib/sandbox-lock.mjs +225 -0
  76. package/lib/sandbox-preload.mjs +2 -2
  77. package/lib/sandbox-run.mjs +122 -25
  78. package/lib/sandbox.mjs +667 -75
  79. package/lib/schema.mjs +42 -11
  80. package/lib/seats.mjs +227 -49
  81. package/lib/services.mjs +261 -52
  82. package/lib/sheet.mjs +963 -179
  83. package/lib/slotnuts.mjs +213 -34
  84. package/lib/targets/gist.mjs +4 -1
  85. package/lib/targets.mjs +22 -4
  86. package/lib/task.mjs +376 -79
  87. package/lib/versions.mjs +285 -39
  88. package/lib/wires.mjs +228 -45
  89. package/lib/workspace.mjs +200 -14
  90. package/package.json +19 -19
  91. package/schemas/assembly.schema.json +2 -2
  92. package/schemas/project.schema.json +6 -0
  93. package/templates/coupons/MEASURE.md +109 -0
  94. package/templates/coupons/assemblies/fixings-test.json +20 -0
  95. package/templates/coupons/assemblies/slot-test.json +11 -0
  96. package/templates/coupons/objects/fixings-coupon.js +88 -0
  97. package/templates/coupons/objects/fixings-coupon.json +26 -0
  98. package/templates/coupons/objects/holds-coupon.js +130 -0
  99. package/templates/coupons/objects/holds-coupon.json +42 -0
  100. package/templates/coupons/objects/slot-coupon.js +89 -0
  101. package/templates/coupons/objects/slot-coupon.json +29 -0
  102. package/templates/coupons/project.json +10 -0
package/CHANGELOG.md CHANGED
@@ -5,8 +5,732 @@ print (a hole's diameter, a seat's depth, a part's outline). Each release lists
5
5
  its reason. A **fasten** is an entry in an assembly's `"fasten"` list: one screwed joint, naming the screw by thread
6
6
  and head, the parts it passes through and the part it ends in.
7
7
 
8
+ ## 0.10.0: a build follows the files its design imports; slow caches follow their code and libraries, not their comments; the cache is written whole, and only inside the workspace; cad coupons puts the kit's coupons in your workspace, cad measured takes a coupon's figure with no assembly, and --export sends what you measured to the kit; cut lists name each bar's material where a profile comes in more than one, and short ones may buy less; cad fasten's seat check reads the head's bearing face; clip and link stresses follow every edit; the README says snap_clearance is measured; cad measured lists what truly moved, refuses slips, strikes a ledger row, and tables every unsettled figure; releases work below the git root, recover from a failed commit, and keep cad set working; releases record and rebuild from everything a design reads; a corrected kit rule is offered to workspaces holding an older copy; the sandbox's documents say what a design can do on each Node, and cad warns where the network is open; a design can no longer reach Node's own modules through the CommonJS loader (security); object checks report every estimate, shaft seats included, and a reference's holes get no hole compensation; cad applies --set to assemblies, reads the project's printer for minutes, and keeps text as typed
9
+
10
+ ### Fixed
11
+
12
+ - A design may import files of its own project (the starter template's `lid.js` imports `./box.js`), but the build
13
+ cache knew only the design's own file: after a helper was edited, `cad check`, `cad export` and every other command
14
+ used the part as it was before, from `.cache/builds/`, without a word, until that folder was deleted by hand. A kept
15
+ build now lists the files of the project its design imported (and the files those import), with a hash of each, and
16
+ is used only while each reads the same; an edit to any of them rebuilds the design. A design run in the tool's own
17
+ process (a trusted workspace) is loaded afresh when one of its helpers changes, where a program that keeps running
18
+ and builds again (one using the library, an editor's server say) used to keep the helper as it first read.
19
+ `build()` now returns `imports`: those files, as paths inside the workspace.
20
+ - A trusted design that imports a file the tool cannot read as one of the workspace's (a file outside the workspace,
21
+ or one reached through a link that leads out of it) is built afresh each time rather than kept, so it is never
22
+ served stale.
23
+
24
+ For someone upgrading: the first build of each design after the upgrade is made afresh (the cache's format moved on),
25
+ and designs that share a helper rebuild after it is edited. No printed size moves, except where a part was stale.
26
+
27
+ - A lamina's slow stages (its physics, the flood's probe, its frame's finite elements, kept in `.cache/stages`) were
28
+ kept by the code of `@rulecad/flexures` and `@rulecad/fea` only. An upgrade of manifold-3d or `@jscad/modeling`, or
29
+ a change to `@rulecad/fixings` or `@rulecad/gears`, which flexures calls, read results the old code had made. They
30
+ are now kept by those packages' code too (and `@rulecad/shapes`, which fixings calls), and by the installed versions
31
+ of manifold-3d and `@jscad/modeling`.
32
+ - An optimisation's densities (`.cache/densities`) were kept by topopt's code down to its "shapes from results" line,
33
+ but the virtual temperature, which decides every result with `voids: 'prevented'`, was below that line, so a change
34
+ to it kept the old densities. It is now above the line (in `@rulecad/topopt`), and a test holds every function the
35
+ solver calls above it.
36
+ - The same key was a hash of the code with its comments, so rewording a comment threw away minutes of solving. The
37
+ code is now hashed without its comment lines and blank lines (`lib/code-text.mjs`): a comment edit keeps the
38
+ densities, and any change to the code optimises again.
39
+ - A printed fitting's finite-element results (`.cache/fitting`) are kept by all of `@rulecad/fea`'s code as well as
40
+ by `@rulecad/frames`' own key, which now carries a hash of its code in place of a number written by hand.
41
+
42
+ For someone upgrading: the first build of a lamina, the first optimisation of each problem and the first check of
43
+ each printed fitting work their results out again, once, so they are slower. No printed size moves.
44
+
45
+ - Only the build, stage and route caches checked that a file of the workspace's `.cache/` folder really lay inside the
46
+ workspace before writing it. The rest (the remembered overlaps, the gears' contact, the finite elements' results for
47
+ fittings, clips, links and motor mounts, assembly orders, optimised shapes and their densities, recorded runs,
48
+ `links.json` and the links files, the record of `AGENTS.md`) were written through whatever was there: a workspace
49
+ cloned from someone else with `.cache/overlaps.json` as a link to a file elsewhere on your computer had that file
50
+ overwritten by the first `cad check` that found an overlap. Every cache file is now written only where it, and each
51
+ folder on its way down from the workspace, is a plain file and plain folders; where one is a link the result is
52
+ simply not kept (that work is done again next time). `cad link` prints the links where it can't keep them in
53
+ `.cache/links/`.
54
+ - A cache file was written in place, so a run stopped part way through (Ctrl-C, a time limit, a full disc) left it cut
55
+ short, and every later build of that part failed with "Unexpected end of JSON input" until the file was found and
56
+ deleted by hand. Each is now written to a new file beside it and renamed over it, so it is there whole or not at
57
+ all; and a kept file that does not read as JSON is counted as not kept, removed, and made again.
58
+
59
+ For someone upgrading: nothing to do. A workspace whose `.cache/` holds a file cut short by an earlier version mends
60
+ itself on the next run. Each optimised problem (`cad optimise`) is worked out once again after the upgrade, as the code
61
+ that reads and keeps its results is part of what its densities are kept by. No printed size moves.
62
+
63
+ - Where a frame has one profile in two materials (an aluminium and a steel tube of one section), `@rulecad/frames` now
64
+ lists their bars apart. The buy list, the build page and the frame's build steps name each by its profile and
65
+ material, so the two lines can be told apart.
66
+
67
+ - `cad check`'s `fasten.seat` pressure under a head takes the ring out to the head's bearing face (dw, from its
68
+ thread's rule set) that `@rulecad/fixings`' `seating` reads, not its outline or flats. A metric cap, button or hexagon
69
+ head's seat now takes 25 to 55% less, so the most it may be tightened to falls and some seats that passed warn.
70
+ The shelf in EXAMPLES.md's chapter on fixings now tightens its M3 cap screws to 0.12 N m, where it was 0.16.
71
+
72
+ Upgrading: re-check designs whose screws sit on printed seats near their limit. No printed size moves.
73
+
74
+ - `cad check` keeps the finite-element results for a joint's printed clips and for a bent link in `.cache`, as they
75
+ are slow to work out. They were kept under the part's number of triangles and its first one or four triangles, and
76
+ left out the material's Poisson's ratio, so a clip edited without changing those (a thinner neck, a taller tip) was
77
+ given the old clip's stress: a clip made four times thinner kept its pass, where worked out afresh it fails. Each
78
+ result is now kept under a hash of every triangle of the part, the material (stiffness and Poisson's ratio), the
79
+ loads, the cell size and a version, as a motor mount's already was; the three share one way of naming them
80
+ (`lib/fe-key.mjs`).
81
+
82
+ For someone upgrading: the first `cad check` after the upgrade works out each clip, link and motor mount again, once,
83
+ so it is slower. A clip or link that passed from a stale result may now fail or warn; that is its real margin. No
84
+ printed size moves.
85
+
86
+ - `cad measured` paired the findings before and after a measurement by their code and every one of their refs, and a
87
+ fasten's list of screws comes out in another order once its holes change size. On the starter template,
88
+ `cad measured home/lidded-box x1c.hole_comp=0.15` said "nothing the checks say has moved" while the lid's hole had
89
+ gone from 3.5 to 3.55 mm; and where several findings shared a code (a fasten's hole and its slot), one was compared
90
+ with another, so the joint rig's drop listed seven findings that had not moved. Findings are now paired by their code
91
+ and what they are about (the fasten, the fit's two parts, the join, the beam, one screw of several), in the order
92
+ the checks give them.
93
+ - An empty figure (`x1c.fit=`) was written as 0 mm, measured. It is refused.
94
+
95
+ - In a workspace in a folder below its git repository's root (as `examples/bench` is), every release command after
96
+ the first (`cad status`, `history`, `diff`, `link --md`, `release --dry-run`, `export <ref>@<version>`) failed with
97
+ git's "exists, but not" error, because a release's files were read from the repository's root. They are now read
98
+ from the workspace. The check that stops a release past uncommitted shared code (`lib/`, `bin/`) now works there
99
+ too: it never saw those files before.
100
+ - A release whose commit or tag git refused (a pre-commit hook that fails, a tag that can't be signed) left the bumped
101
+ version and changelog entry behind, and running it again wrote the changelog entry twice. Now the version, the
102
+ changelog, what was staged and any commit already made are put back as they were, and the message says, in plain
103
+ words, that nothing was released and what git said. A changelog entry for the same name and version that was
104
+ never committed (left by such a release) is replaced, never repeated; a committed one (an object named as its
105
+ project, released at the same version as the project) is kept.
106
+ - After `cad release <project>` (or `--all`), `cad set <project>` was refused for ever ("version: not allowed here"):
107
+ the release wrote `version` and `release` into `project.json`, which the project schema did not allow. The schema
108
+ now has both fields, and the release writes them into the file as it is laid out, changing nothing else. `cad set
109
+ <project>` leaves them to `cad release` and says so.
110
+ - On Windows (where git writes files with Windows line endings), every design showed as "changed since" its last
111
+ release straight after it was released, and a project release refused to go ahead ("has changes since"): the
112
+ design's code was compared with the release's line by line, endings included. Line endings are no longer counted
113
+ as a change.
114
+
115
+ - A release could not be rebuilt when its design imports a file of its project: after `cad release home/lid` in the
116
+ starter template, `cad check home/lid@0.1.0` (and export, diff and status) failed with "Cannot find module
117
+ .../box.js". A release's folder in `.versions/` now holds its files at the paths they have in the workspace, with the
118
+ files its code imports, so it builds as it did.
119
+ - A release was rebuilt with today's rule sets: `loadRuleSet(name, dir)` read the workspace's copy whatever folder it
120
+ was given, so `cad values home/box@0.1.0` gave the wall from a line width measured since, and `cad diff` and
121
+ `cad status` never saw a rule change. A release now reads its own rule sets, as its tag holds them, for its "uses",
122
+ for `v.fixings` and for `v.frames`, and the project's material and printer as they were.
123
+ - A changed helper, thread set or object read through "uses" left a released part "up to date". `cad status`,
124
+ `cad diff` and `cad release` now compare every file the release read besides the design's own: an edit to one is a
125
+ patch (`projects/home/objects/box.js changed`, `rules/m3.json changed`, `now reads rules/m3.json`), and an object
126
+ read through "uses" is rebuilt for the release as its tag holds it, so a box released wider since asks the lid for a
127
+ release. A design drawn with `v.fixings` reads every rule set in `rules/` (any of them may hold its threads or
128
+ material) and the project's material and printer, so an edit to any of those asks for its release too.
129
+
130
+ - Security: a CommonJS file in a design's project (a `.cjs` file, or a `.js` file Node reads as CommonJS) could load
131
+ Node's own modules past the sandbox's import hook, through `module.constructor._load` or `require.cache`, on every
132
+ Node: it could read every file of the workspace and, before Node 25, send what it read over the network. A design
133
+ added to your workspace from elsewhere could have read your other designs and sent them away when you ran
134
+ `cad check`. Now:
135
+ - No CommonJS file of a design's project is loaded in the sandbox, on any Node. Such a design stops with `designs
136
+ can't load …: it is a CommonJS file (require and module.exports), and a design's files are ES modules (import and
137
+ export)`. A copy of an allowed package kept in the project's own `node_modules` is held the same way.
138
+ - The sandbox's runner shuts the CommonJS loader to Node's own modules before the design loads: a request from a
139
+ file of the design's project, or from code with no file (`eval`, `new Function`, a callback queued onto the
140
+ loader), is refused whatever parent module it names; the tool's own packages still load what they need.
141
+ `module.register` and `module.registerHooks` are taken away, so no import hook can be added past the sandbox's.
142
+ - Node's own modules that reach the network, other programs or workers (`net`, `http`, `https`, `http2`, `tls`,
143
+ `dns`, `dgram`, `tty`, `child_process`, `worker_threads`, `vm`, `inspector` and the rest outside a short list of
144
+ quiet ones such as `fs`, `path`, `url` and `crypto`) are now refused to every caller in the sandbox, the tool's own
145
+ code included, by the import hook and by the CommonJS loader: a design can take the CommonJS loader from an
146
+ allowed package's own CommonJS code, hand it to a package's function as a callback or compile code under a tool
147
+ file's name, and could then load any of them. What it can still load that way reads only what the permission model
148
+ lets the sandbox read. The hook and the loader's lock also no longer read with `String.prototype.startsWith` and
149
+ the like, which a design can change for everyone where the hook runs in its own thread (Node 22.15 on): changing
150
+ them let a design import `node:net` past the hook.
151
+ - `process.loadEnvFile`, `process.execve`, `process.kill` and `process.openStdin` are taken away too.
152
+ - The design's `process.stdout`, `process.stderr`, `process.stdin` and `console` are plain streams: before Node 25
153
+ the real ones are sockets, whose class could connect anywhere. The runner reads its request and writes its reply
154
+ by file descriptor. What a design prints still comes out as before.
155
+ - The sandbox may now read, of the workspace, only the design's own project, the workspace's `package.json` and the
156
+ design's own cache folders: another project's files are out of its reach under Node's permission model too.
157
+ - Before Node 25 a plain design, with no CommonJS anywhere, could reach the network through Node's own web client:
158
+ touching `Headers`, `FormData`, `WebSocket` and the like loads it, and it leaves an agent on `globalThis` that
159
+ connects anywhere. The runner now holds that agent's place before the design loads, with one that refuses, and
160
+ takes those classes away.
161
+ - Node's permission model follows a link wherever it leads, so a link in a design's project could hand it a file of
162
+ another project or of yours elsewhere (one in the project's `node_modules` was not even looked at). Now a link
163
+ anywhere in the project that leads anywhere the sandbox does not read stops the design before it runs, with
164
+ `workspace.outside` and the link's name; a cache folder that holds a link is not read (each kept stage is made
165
+ afresh), and the workspace's `package.json` is not read where it is a link.
166
+ - Before Node 25, cad's note once a run now reads `designs are kept off the network on Node 24 by rulecad alone, not
167
+ by Node itself: use Node 25 or above for designs you did not write`: no way round the tests know of reaches the
168
+ network, but Node's permission model covers it only from Node 25.
169
+ - The README's Sandbox table says the new truth for each Node, and `test/sandbox-loader.test.mjs` tries each way
170
+ round on the Node it runs on.
171
+
172
+ Upgrading: a design whose project holds a CommonJS helper file must rewrite it with `import` and `export` (a `.mjs`
173
+ file, or a `.js` file in a workspace whose `package.json` says `"type": "module"`, as every workspace `npm create
174
+ rulecad` makes does). Nothing else changes; no printed size moves.
175
+
176
+ - `cad check` (and `preview`, `export`, `show`, `link`) on an assembly ignored `--set` without a word, even for names
177
+ that do not exist, so a size tried in an assembly seemed to pass when the check had used the old one. `--set
178
+ <item>.<variable>=<value>` now builds that object item at the value, held to the variable's tweak range as an
179
+ object's `--set` is, and the title says what was set. A name that is not an object item of the assembly, or not one
180
+ of that object's variables, is refused by name (`--set a.nonsense=1: item a (tray) has no variable "nonsense"`).
181
+ `cad list`, `wires`, `beams` and `animate` take `--set` the same way, and an assembly's link says what was set, as an
182
+ object's does (its downloads are named with it). `cad kit`, `plates`, `order`, `frame`, `machine`, `plot` and
183
+ `measured` build the assembly as its file says: they now refuse `--set` by name instead of passing it over.
184
+ - `cad list` (and the kit's README, the plates' and the motors' grams and minutes) estimated print time from the X1C's
185
+ flow whatever printer the project names. It now reads the `print_flow` of the printer the project names
186
+ (`project.json`'s `printer`, else `cad.config.json`'s), as `cad check` does. The total says whose flow it used,
187
+ and says so when it assumed one (12 mm³/s, for a printer whose rule set gives none) or assumed the material's
188
+ density (PLA's 1.25 g/cm³). `--json` adds `totals.printer`, `totals.flow` and, where assumed, `flowAssumed` and
189
+ `totals.density`.
190
+ - `cad set` turned a text variable's value into a number when it looked like one: a keycap legend `007` was saved as
191
+ `7`, and `1e3` was read as 1000. A text, anchor, layout or problem variable now keeps the text as typed; a choice
192
+ keeps the option named (text for a choice of strings, a number for a choice of numbers). `cad add item --object …
193
+ --set` reads the object's variables the same way.
194
+
195
+ For someone upgrading: print-time minutes change for projects on a printer other than the X1C (and the kit's README
196
+ with them); `--set` on an assembly now changes what is built, or is refused. No printed size moves.
197
+
198
+ ### Added
199
+
200
+ - `cad coupons` adds `projects/coupons` to a workspace: the fixings coupon, the holds coupon and the slot coupon, two
201
+ assemblies that lay them out (`coupons/fixings-test`, `coupons/slot-test`), and a `MEASURE.md` that says how to
202
+ print and read each row and the command that writes the figure back. The coupons lived only in the repository's
203
+ bench example, so the guide's `cad measured benchmarks/fixings-test` failed in a workspace made by
204
+ `npm create rulecad`. A workspace that has `projects/coupons` already keeps it as it is.
205
+ - `cad measured <name>=<value>` with no assembly (`cad measured x1c.pilot_m3=2.9`) writes a figure measured on a
206
+ coupon the same way as with one, into the workspace's copy of the rule set, marked measured with the date. Its row
207
+ goes in the workspace's own ledger, `ledger.jsonl`, with nothing said to have moved, since there are no checks to run
208
+ either side. `cad history` with no argument lists those rows, and `cad measured --strike <date> <name>` takes one out.
209
+ - `cad measured --export` prints every figure measured in the workspace that the kit does not hold yet as a unified
210
+ diff of the kit's rule sets (`packages/rules/<set>.json`), to send to the kit or apply to a copy of the repository;
211
+ `--json` gives the same as data. A set the kit has no file for is listed apart.
212
+
213
+ - A typed figure of the other sign from the one it replaces, or under half or over twice it (a tenth to ten times, for
214
+ an estimate), is refused as a likely slip of the pen before anything is written; `--force` writes it as it is. A fit
215
+ the coupon bounds by what a fit of its kind can be is held to that bound instead, as before, and a 0 for a figure a
216
+ coupon in the kit measures goes in as typed (the fixings coupon's nut slots start at 0).
217
+ - `cad measured <project>/<assembly> --strike <date> <name>` (or `<name>=<figure>`) takes a row out of the ledger,
218
+ and says what the rule set it went into still holds, since that is a file of its own.
219
+ - `--table` lists every rule the assembly reads that is an estimate, a community figure or a default (it listed
220
+ estimates only, so on the starter template it was empty), with the coupon in the kit that measures each, marked
221
+ where this assembly is that coupon, and the figures a coupon in the assembly measures that the rule set has no
222
+ figure for yet. It has a "Measured by" column, and `--json` gives its rows as data. `assumptions(ref)` in
223
+ `lib/measured.mjs` returns them.
224
+
225
+ For someone upgrading: a figure far from the one it replaces now needs `--force`; the moved list and the table are
226
+ longer. No printed size moves.
227
+
228
+ - A release commits, and its tag names (a line `reads: {…}`), what its build read besides the design's own files: the
229
+ files its code imported, whether it drew with `v.fixings` or `v.frames` (then the workspace's own rule sets those
230
+ read, and the project's `project.json`, are committed with it), and the files of the objects it reads.
231
+ - `build()` returns `reads`, that record; `readTexts(d, reads)` gives the text of each of those files; `inRelease()`
232
+ in `lib/versions.mjs` gives another object as a release has it. `framesContext()` and `fixingsContext()` also return
233
+ the files they read. The build cache's format moved on (a build says whether it used `v.frames`).
234
+
235
+ For someone upgrading: `cad status` may report released parts as changed for the first time, where a helper, a rule
236
+ set or an object they read changed since; release them, or put the file back. A release made before this is rebuilt
237
+ with the files its code imports by a path and with its own rule sets, so an old release exports its own geometry,
238
+ not today's: an exported size moves where a rule was measured again since. The first build of each design after the
239
+ upgrade is made afresh. A release's folder in `.versions/` has a new layout: one written by an earlier version, or from a tag since made
240
+ again, is made afresh.
241
+
242
+ - `cad rules update <set>` brings a workspace's copy of a kit rule set (`rules/<set>.json`) up to the kit's: it takes
243
+ each figure the kit checked after the copy's was, the kit's new rules, and the same figure where the kit says more of
244
+ it (a range, a newer source), and keeps every `measured` figure, every figure checked on or after the kit's date and
245
+ every rule the kit has none of. It prints each change (`cutout: 13.8 → 14`) and what it kept; `--dry-run` writes
246
+ nothing, `--json` gives it as data.
247
+ - `cad rules check` notes `rules.changed` where the kit has a different figure, checked after the copy's, for a rule
248
+ whose copy is not `measured` (before, a corrected kit figure never reached a workspace that had used the set, and the
249
+ check said nothing of it), and `rules.same` where a copy is the kit's set word for word. Notes never fail a set.
250
+
251
+ - Before Node 25, cad says once a run, on stderr, as it runs the first design in the sandbox, that designs are kept
252
+ off the network on your Node by rulecad alone, not by Node itself, and to use Node 25 or above for designs you did
253
+ not write (its words are under Fixed above). Node's permission model covers the network only from Node 25. Nothing
254
+ is said from Node 25 on, nor for a trusted workspace, whose designs run in the tool's own process.
255
+
256
+ - `cad check` now reports each seat a design draws with `v.shapes` for a bought part (`shaftBore`, `bearingSeat`,
257
+ `plainBearing`, `pulleyBore`) as it reports `v.fixings`'s holes: a `seat.drawn` finding saying what the seat was
258
+ drawn to, the fit it rests on and how far that fit is trusted (its kind). A press-fit bore for a 5 mm shaft, drawn
259
+ 5.06 mm, rests on `SHAFT_FITS.press`, an estimate nobody has pressed a shaft into yet, and now says so. The findings
260
+ are kept with the build, so a check that reuses a kept build says them too. `@rulecad/shapes` is unchanged.
261
+ - An object's own check now warns when it rests on estimates (`rules.estimate`), as an assembly's check always has:
262
+ the rule-set entries it reads that are estimates, and the seats drawn to an estimated fit. Before, only an assembly
263
+ that held the object said so, although `AGENTS.md` promises that the check flags an estimate. An assembly's warning
264
+ names those seats too: a seat drawn to an estimated printer rule (a bearing pocket on `x1c.press`) is named as that
265
+ rule, to settle with `cad measured`, and one drawn to `SHAFT_FITS.press` by giving the fit that works.
266
+
267
+ ### Changed
268
+
269
+ - The source a coupon's figure is written with names the coupon's `MEASURE.md` in your workspace
270
+ (`the fixings coupon (projects/coupons/MEASURE.md)`), or says how to get it, never the repository's
271
+ `examples/bench/...` path. A pilot or insert hole measured with no project names "the plastic it was printed in"
272
+ where it said "THE PROJECT'S PLASTIC".
273
+
274
+ For someone upgrading: nothing you have changes until you run `cad coupons` or measure with no assembly. No printed
275
+ size moves.
276
+
277
+ - The cut lists of short frames may buy fewer or shorter bars, as `@rulecad/frames` now packs a list of up to 20 beams
278
+ exactly: the worked example's box (EXAMPLES.md) now buys three 1000 mm bars, 3000 mm of metal, where it bought one
279
+ 4000 mm bar.
280
+
281
+ For someone upgrading: bars and their numbering in a cut list may change. No printed size moves.
282
+
283
+ - The README's section on pins and magnets says that `x1c.snap_clearance` is now measured (on the launcher's fit test
284
+ plate) and the other fits remain estimates until the holds coupon measures them. No command changed.
285
+
286
+ For someone upgrading: nothing to do. Snap pin sockets in your checks move with `@rulecad/rules` and
287
+ `@rulecad/fixings`: see their notes.
288
+
289
+ - A release outside a git repository, or where git has no name and email address to commit under, is refused before
290
+ anything is written, saying what to run (`git init`; `git config user.name` and `user.email`), instead of git's own
291
+ error after the version was bumped. `--dry-run` still works without a repository.
292
+ - With `--push`, a push that fails now says the release was made and tagged here and how to push it later.
293
+ - What changes when you upgrade: nothing to do. A project released with an earlier version can be changed with
294
+ `cad set` again. No printed size moves.
295
+
296
+ - The `rules.new` note now points at `cad rules update` rather than at deleting the copy.
297
+
298
+ For someone upgrading: `cad rules check` may show new notes in an older workspace. Run `cad rules update <set>` to take
299
+ the kit's corrections, then check the designs that use the set: a figure the update changes can move a printed size.
300
+ To keep a correction of your own, give it `"kind": "measured"` (or the date you checked it). The kit's own examples
301
+ were brought up to date (their copies identical to the kit's deleted, the rest updated); no printed size in them moved,
302
+ since no figure they share with the kit differed: the bench's printer now has its own `thread_gap`, so its fixings
303
+ coupons no longer note that the X1C's was borrowed.
304
+
305
+ - The README's Sandbox paragraph is now a table of what a design can read, write, import, start and send on Node
306
+ 22.13 to 22.14 (where the import hook runs in a worker, so a CommonJS file's `require()` passes it by), Node 22.15
307
+ to 24, and from Node 25, and what holds each. Each row is tried on the Node the tests run on. It says plainly what
308
+ the old paragraph did not: on every Node, a CommonJS file in a design's project can load Node's own modules past
309
+ the import hook and read any file in the folders the sandbox may read (the workspace among them); only Node's
310
+ permission model stops it writing, starting programs and, from Node 25, sending.
311
+ - The list of packages a design may import is the hook's own, `ALLOWED` in `lib/sandbox-hooks.mjs`, everywhere: the
312
+ README, AGENTS.md (which had left out `@rulecad/frames`) and the sandbox's own list of what it may read follow it,
313
+ and a test holds the documents to it.
314
+
315
+ Upgrading: nothing to change. On Node before 25 you see the one-line note on commands that build a design; use Node
316
+ 25 or above to run designs you did not write. No printed size moves.
317
+
318
+ - An object that is not printed (`"role": "reference"` or `"board"`: a bought circuit board, drilled by its maker) has
319
+ its `v.fixings` holes drawn to the rule's figure as it stands, with no printer hole compensation: a reference
320
+ board's M2.5 holes are now drawn 2.9 mm (`m2_5.clearance`), where they were 3.0 mm (with `x1c.hole_comp`). The
321
+ fasten check holds a reference's holes to the clearance figure as drilled, as it does a board's.
322
+ - The cad README lists `estimate` and `derived` among the kinds a rule carries.
323
+
324
+ For someone upgrading: object checks may now show a new warning, `uses estimates, not measurements`, and seat
325
+ findings; neither fails a check. Each design is built afresh once after the upgrade (the build cache's format moved
326
+ on). No printed part's size moves: only a reference's holes, which are never printed, are drawn smaller.
327
+
328
+ ## 0.9.0: belt spans shared by their lengths; two joins at one end add their springs; generated frames on castors build, with the castors' bolts on the list; unused names and silent error handling tidied, with no change in behaviour; a design that runs for ever or fills memory is stopped, with design.time or design.memory; a fasten fails across air between its parts, warns on thin walls round its far hole, and holds a slot nut's whole length in its slot; feet are checked at the load the frame puts on them; a flat part's analysis reads box, polygon and part supports and loads as cad optimise does; the kit's code is laid out by a formatter, so cached builds are made again once; frame sizing solves each profile it tries on that profile's own join springs; frame.size says which members its stress limit could not check; cad frame --size --write checks the design it would write, and writes nothing that fails; frame.tip, a frame that would tip over; a gear mesh fails when the two gears' teeth sit at different heights along their axes; gear meshes in an assembly are judged where their axes are, with the room under their tips; meshes, zips and board models from elsewhere are limited, and malformed ones refused in plain words; join.drop predicts from the real frame, and skips beams held elsewhere; cad link refuses a model the page would turn away, using model-link's own checks; live views answer only to this computer's own names, and only their own page can stop a run; the motor checks count the weight of the parts a motor moves, and work for slides; needs Node 22.13 or later, the version the kit is tested on; cad check shows printcheck's overhang and hole findings; printed beams are checked for real buckling, sag after creep and softening; what a sandboxed design hands back for the caches is capped, and kept apart from other designs' results; a screw's tightening limit follows one rule with a load and without, a torque given is held against a plastic thread, and screws sharing a load are reckoned at the torque they are all tightened to; strength checks read the stress at a part's surface; links out of the workspace are refused, for designs, rule sets, project files and targets
329
+
330
+ ### Fixed
331
+
332
+ - `belt.tension` shared the carriage's push half and half between the belt's two spans, which holds only with the
333
+ carriage in the middle. The motor holds the pulley, so each span is as stiff as one over its length and the short
334
+ one takes the most: near the travel's start, by the motor, span a takes about 90% of the push. The check now walks
335
+ the travel for the worst place and fails a belt whose slack span falls below its least static tension there,
336
+ saying where the carriage is, which span it is, both lengths and its share. Its findings carry `values.at` (the
337
+ carriage's middle, mm along the beam), `span`, `a`, `b` and `share` beside `slack` and `tight`.
338
+ - What changes when you upgrade: every belt's slack and tight figures move apart (the bench's X axis from 24.2 to
339
+ 25.8 N to 23.46 to 26.54 N), and a fast or heavy belt axis near its limit now fails and asks for more tension or
340
+ less acceleration. No printed size moves.
341
+
342
+ - Where two joins hold one beam end at the same place (a printed brace bracket beside the blind join asked for), the
343
+ frame model put two rigid links between the same points, which left the solve with a freedom nothing held, and
344
+ kept only one of the two springs. It now puts one link and holds that end by both springs side by side, their
345
+ stiffnesses added, in frame checks and in frame sizing alike.
346
+ - A generated frame's `frame.generated` says how many corners are braced: "16 joins (blind), 8 braced with printed
347
+ brackets", or, on printed bracket joins, how many of them are drawn braced.
348
+
349
+ For someone upgrading: a generated frame with `braces` now keeps its asked joins (see @rulecad/frames), so its
350
+ frame.rack figure for a braced side rises instead of falling (the default box braced on all four sides: 68 N/mm, where
351
+ it was 5.34 N/mm and warned); its order, shopping list and cut sheet carry both joins' screws, nuts and holes. No
352
+ printed size moves.
353
+
354
+ - A generated frame with `"feet": "castor"` stopped every build with "holes is the castor's hole spacing ... (got
355
+ nothing)". `"feet"` now takes `{ "kind": "castor", "holes": [100, 40], "thread": "M6" }` (and `"top"`, the castor's
356
+ top plate's thickness), which the castor plates are drawn from; `"castor"` alone is refused, naming holes and thread.
357
+
358
+ - `cad check` judged every printed foot, levelling foot, castor plate and stacking foot at a fixed 250 N, a quarter
359
+ of a 100 kg machine, whatever the frame carried: a box carrying 400 kg passed feet that bend 1.56 times under their
360
+ plastic's strength at their real load, short of the 2 times asked. Each foot under a frame the check solves is now
361
+ judged at the largest downward reaction at its beam's end over the frame's load cases, and its `fitting.margin`
362
+ names it ("the frame's largest reaction at z1.a"); its `refs` carry `support` and `reaction`. A load given in the
363
+ item's fitting is kept where it is the larger. A castor plate drawn for less than its reaction says to give its
364
+ fitting that load, so its thickness is sized for it. Where no frame is solved, the margin says its load is "the
365
+ default 250 N for one foot, not the frame's load".
366
+
367
+ For someone upgrading: feet under heavy frames now fail where they are short of the margin asked; feet under light
368
+ frames are judged at their own, smaller load, and their margins rise. The feet's bearing stresses roughly treble (the
369
+ change to @rulecad/frames). No printed size moves unless you give a foot a larger load.
370
+
371
+ - `cad check`'s analysis of a flat part (an `analysis` entry on a 2D problem) now holds and pushes the part over the
372
+ whole of each support and load region, as `cad optimise` does: a box (`size`), a polygon (`points`) or another
373
+ design's part, each found the same way the optimiser finds it. It used to read every region as a single point and a
374
+ radius, so a box clamping a plate along an edge held it at one point, and the plate came out about nine times too
375
+ soft, with its stress and safety factor wrong too; a polygon or part stopped the check with "Cannot read properties
376
+ of undefined". A support or load given as a point and a radius is read as before.
377
+ - If you upgrade: deflection, stiffness, peak stress and safety factors reported for flat parts held by a box, polygon
378
+ or part region change, by up to ten times, and a part that failed its `max_deflection` or `min_safety` may now pass.
379
+ Point-and-radius supports and loads give the same numbers as before. No printed size moves.
380
+
381
+ - `cad frame --size` (and the `frame.size` finding of `cad check`) solved every profile it tried on the springs of
382
+ the joins as drawn. A join's stiffness grows as the cube of its beam's width, so a cantilever drawn in 4040 sized
383
+ down to 2020 on the 4040's join, eight times too stiff: sizing promised it 1.48 times inside its sag limit, and once
384
+ written in, `cad check` failed its sag. The other way round, a frame drawn in 2020 was refused every heavier
385
+ profile, each solved on the 2020's soft join. Now each join's spring is worked out for each pair of profiles
386
+ tried, as the check works it out: the kind's estimate scaled to the profile, a bought fitting's own figures, or a
387
+ printed fitting drawn again for the new profiles and its stiffness by finite elements. A printed fitting that
388
+ cannot be drawn for a pair of profiles is a join that does not go together, and is said as what set the group.
389
+
390
+ Upgrading: sizing now picks heavier profiles for frames whose sag rests on their joins (most open frames, every
391
+ cantilever), and the margins it prints change; racking, where it is a limit, now also counts the stiffer joins of
392
+ a deeper profile. Size again and write it in with `--size --write` to take up the new choice. A printed size moves
393
+ only where you write a new sizing in.
394
+
395
+ - `frame.size` held the frame's members to the stress limit, but passed over, without a word, those with no strength
396
+ or no section modulus: each join's rigid link, each panel, a beam whose alloy gives no strength. Its finding read as
397
+ if every member's stress had been checked. `cad check` now says them once, as `frame.size.unchecked` (info): "the
398
+ stress limit does not reach 12 join links (no strength and no section modulus): their stress is not checked by the
399
+ sizing". `cad frame --size` prints the same under its limits, and `--json` lists them as `unchecked`, each
400
+ `{ member, why }`.
401
+
402
+ Upgrading: a check of a frame with `frame.size` gives one more information finding; nothing fails or warns that did
403
+ not before, and no printed size moves.
404
+
405
+ - Frame sizing no longer chooses a profile whose blind joins cannot be tightened. A blind join's hex key comes in
406
+ through the access hole across the beam it meets, and the sizing now holds it to reach the head, as
407
+ `fasten.access` does. In OpenBeam's 1515 the slot's floor slants down to a narrow groove past the access hole, so a
408
+ 2 mm key cannot reach an M3 button head there; MakerBeam's 1010 stops it the same way. So an M3 blind join into
409
+ either is no longer chosen. The frames guide's box was sized to 1515 everywhere and then failed
410
+ `fasten.access` and `assembly.order`; it now stays in 2020, each group set by a join.
411
+ - A printed foot written in by `--size --write` takes the new profile's screw and tapped end. Before, a box drawn in
412
+ 2020 and written in 1515 kept its feet's M5 cap screws and M5 taps in the 1515's M3 bore, and `cad check` failed
413
+ `fasten.clearance` and `overlap` at every foot.
414
+ - `--size --write` now checks the design it would write, as `cad check` does, before writing it. Where any check
415
+ would fail, it writes nothing and names the failing checks, the first of them in full (`--dry-run` says the same).
416
+ Where every beam already has the profile chosen for it, it writes nothing and says so, so a generated frame stays
417
+ generated.
418
+
419
+ Upgrading: `cad frame --size --write` refuses some writes it made before, each a design `cad check` would have failed.
420
+ `cad frame --size` may choose a heavier profile than before where a lighter one's blind joins cannot be tightened. No
421
+ printed size moves.
422
+
423
+ - `cad check` measured a spur, internal or rack mesh only across the axes, so a gear anchored at the wrong height (the
424
+ wrong face, a missing spacer, the wrong step of a compound gear) still got a full contact ratio and a clean sweep
425
+ although its teeth never touched the other gear's. It now finds each gear's teeth in its drawn parts (the points on
426
+ its tip circle, or a rack's tip line) and says how much of the faces meet, as `mesh.face`: "faces overlap X of Y mm",
427
+ Y the narrower face. 80 % of the narrower face or more passes, 50 to 80 % warns, less fails. A gear whose teeth are
428
+ not found where its mesh says (drawn with another module, tooth count or shift) gets a warning that the overlap is
429
+ unchecked. Worm, bevel and planetary meshes are unchanged.
430
+
431
+ Upgrading: a drawn gear train whose faces only partly overlap now warns or fails where it passed before: move the gear
432
+ along its axis until the faces line up. No printed size moves.
433
+
434
+ - `cad measure` and `cad match` read STL and 3MF files from anywhere as data, with limits: up to 2,000,000 triangles,
435
+ a 3MF's zip unpacked to at most 512 MB, and its objects placed at most 100,000 times. Past a limit the file is
436
+ refused with the limit named ("the 3MF places 10,000,000 triangles, more than the 2,000,000 cad reads"), before it
437
+ is unpacked or placed. Before, a 3MF of under half a kilobyte whose objects held each other ten times over could
438
+ place millions of triangles and run the command out of memory, and a zip entry could unpack to any size. Build
439
+ items, components and corners are counted as they are read too (corners up to three for each triangle cad reads),
440
+ so a small file naming millions of them is refused before it fills memory, and objects never closed no longer hold
441
+ the reading for minutes.
442
+ - A corner that is not three numbers (a word in an ASCII STL, a binary STL's NaN, a 3MF vertex with a missing or
443
+ non-numeric coordinate), a 3MF triangle that names a corner its object hasn't got, and a 3MF transform that is not
444
+ twelve numbers are refused, naming the corner, as is an object placed so far out (transforms of 1e200 inside one
445
+ another) that its corners are past what a number holds. Before, they gave sizes that were not numbers.
446
+ - `bounds` and `volume` refuse an empty mesh ("no triangles") instead of giving Infinity and NaN. `cad list` counts a
447
+ part drawn empty as no plastic, and `cad match` on a design that draws nothing says so.
448
+ - `cad clone` on a board read from a file no longer follows a `${KIPRJMOD}` model path that leaves the board's folder
449
+ (`../`, a path from the top of the disc, or a link in the folder that leads out of it): it notes "its path leaves
450
+ the board's folder" and copies nothing. Before, a board from elsewhere could have any `.wrl` or `.step` file on
451
+ the computer copied into the workspace. A board from GitHub keeps its paths inside its repository, and a KiCad
452
+ library path inside KiCad's library, however the path is spelt (`%2e%2e` and backslashes are read as a web
453
+ address reads them), so no other repository's file is copied in under the board's or KiCad's licence.
454
+
455
+ Upgrading: a model past the limits, or one with a broken corner, that used to be read is now refused, and names
456
+ what to fix. No printed size moves.
457
+
458
+ - `join.drop` (#365) took the beam a join hangs from as rigid on every frame, so on a real one its drop was out by
459
+ a factor of two or more (an arm on a 400 mm post: 1.517 mm said, 2.933 mm in the frame's own solve), and writing the
460
+ measured drop back stored a wrong join spring, marked measured, that then changed every join of that kind. Where
461
+ the frame is solved on supports it is given, the drop is now the frame's own (the same figure `frame.deflection`
462
+ gives for that load alone), and `cad measured` finds the spring from the same solve, by a bounded search that
463
+ solves the frame again at each step, moving every join whose spring is the same rule (as the figure written back
464
+ moves them all, so the next prediction is the drop read); a reading no spring can give is refused, saying why.
465
+ Where no supports are said, the closed form is kept only where the beam the join hangs from lies along the bench, as on the joint rig,
466
+ and the finding says it takes that beam as held along its length; elsewhere the drop is not predicted, and the
467
+ finding says to give the frame's supports.
468
+ - A beam that something else also holds (a support or a foot on it, or a fasten, a fit or a joint between it and a
469
+ part it does not carry) gets no `join.drop`: it is no cantilever from the join.
470
+
471
+ Upgrading: `join.drop` figures change on frames with supports, and disappear on propped beams and on frames with no
472
+ supports said other than the joint rig. A join spring stored as measured from an earlier write-back on a frame (not
473
+ the joint rig) stays as it was: measure it again. No printed size moves.
474
+
475
+ - The live views (`cad optimise --watch` and `cad preview <project>/problems/<problem> --watch`, and the view of a
476
+ flexure being shaped, `lib/live-shape.mjs`, which the launcher example's shaping scripts open with `--watch`) now
477
+ answer only when they are opened as `localhost`, `127.0.0.1`, `[::1]`, the address they listen on, or any other
478
+ address written out in numbers (a Tailscale address such as `100.101.102.103` included). A web page from another site
479
+ could stop a shaping run, and a page that pointed its own name at this computer could read either view; both are now
480
+ refused. Neither view can be shown inside another page's frame any more, so a page that hid the view under a button
481
+ of its own can't turn the person's click into a stop. No printed size moves.
482
+
483
+ - `motor.torque` and `motor.holds` added up only the loads an assembly declared, so the weight of the arm, lid or leg
484
+ a motor turns was left out: a NEMA 17 turning a 605 g arm passed 14 times over while `motor.accel` in the same report
485
+ said it stalled, and with no `"loads"` nothing was checked at all. They now count the parts as drawn (the printed
486
+ parts by their volume and the project's material, the bought parts, a motor among them, by their rules' mass), the
487
+ declared masses and the task's `payload`, under gravity: down (`-z`) unless the assembly gives `"gravity"`. Both read
488
+ one sum with `motor.accel` (`lib/carried.mjs`), so the three cannot disagree again.
489
+ - `motor.accel` now runs for every driven joint, with or without a `task` or a `"gravity"` key.
490
+ - `motor.accel` read only the motor's own joint, so through gears (a planetary to an arm, a pinion to a reel) it left
491
+ out what the gears turn: the arm's weight, a declared torque and the arm's inertia. It now reads the motor's whole
492
+ train, as `motor.torque` does: each mass's inertia once, at the nearest joint of the train, and its weight at every
493
+ joint of the train it rides beyond, as `motor.torque` counts it. With no task it gives one finding a motor, named for
494
+ the joint at the far end of its gears.
495
+ - `motor.accel` treated a slide (a lead screw or a belt) as a turn: its inertia came out thousands of times too big,
496
+ its weight along the travel counted as nothing, and the result read in °/s². It now reflects the slide's mass
497
+ through the lead's mm per radian (m (lead / 2π)², divided by the drive's efficiency, plus the rotor), holds the
498
+ weight along the travel against the same lever, and gives the acceleration in mm/s². A 1.26 kg block on an 8 mm lead
499
+ vertical screw read 757 °/s² on 31,561 kg mm²; it now reads 42,235 mm/s² on 11.8 kg mm² (2.0 of it the block).
500
+ `task.accel` and `task.time` follow from it.
501
+ - A machine's link (`cad link`) carries the masses the motor checks count in its `task.loads` (the parts, the bought
502
+ parts, the declared masses and the payload, each as a point on its item), not only the declared ones, so the torque
503
+ chip on the machine's page agrees with `motor.torque`.
504
+ - For a slide, `motor.torque`'s `values.available` was the torque at the screw (N m) while `values.needed` was the force
505
+ (N). Both are now in the joint's own unit, given as `values.unit` (`N m` or `N`); `values.shaft` is the torque at the
506
+ motor's shaft.
507
+
508
+ - `beam.printable` (#367) judged a printed beam's buckling by Euler's load with both ends pinned, so a post fixed at
509
+ its foot and free at its top was told it had four times the margin it has (a 2020 post 400 mm tall with 30 kg on
510
+ it, in PLA: 2.13 said, 0.53 true). It now uses the whole frame's buckling solve with the beam printed, as
511
+ `frame.buckling` does, in the case that squeezes the beam most, wanting twice its load (or the frame as drawn, 2%
512
+ less, where that already buckles sooner). Euler's pinned load is still given, in words only. Where the frame's
513
+ buckling cannot be found, the beam is taken free to sway at one end: a quarter of Euler's load.
514
+ - `frame.deflection` held a beam drawn printed only to its sag under a short load. Where any beam is drawn printed,
515
+ the frame is now solved again with each printed beam at its creep share of its modulus
516
+ (`PRINTED_DEFAULTS.creep_modulus`, 0.5, an estimate), and each sag is held to the limit at the worse of the two,
517
+ said as 'after creep (estimate)' (`values.creep`, `refs.creep`). A printed 2020 cantilever 150 mm long with 4 kg at
518
+ its middle: 0.273 mm at first, about 0.546 mm after creep, against 0.417 mm: it now fails.
519
+ - `frame.heat` held printed fittings to their plastic's softening point but not printed beams, and grew every beam by
520
+ aluminium's expansion. Printed beams are now held to their plastic's softening point too, and every beam grows by
521
+ its own material's `expansion` (PLA's is about three times aluminium's); a frame of several materials says how far
522
+ its beams grow apart.
523
+ - `beam.printable`'s words: a sag missed along a beam is no longer said to be `frame.deflection`'s (it checks load
524
+ points, named points and guides, not each beam along its length), and a beam already drawn printed is said to stay
525
+ printed, never told it 'needs pla'.
526
+
527
+ Upgrading: printed posts and shelves that passed may now fail on buckling (`beam.printable`) or on their sag after
528
+ creep (`frame.deflection`); printed beams in warm air may fail `frame.heat`; growth figures for printed beams are about
529
+ three times larger, and those for metal beams move slightly to their alloy's own figure (MISUMI's 6N01 23.3 rather than
530
+ 23.4 x 10⁻⁶ /K). No printed size moves.
531
+
532
+ - A lamina's slow stages (its physics, its flood's probe) are now kept in a folder of each design's own, `.cache/stages/<design>/`, and a design reads only its own. The name of a kept stage is worked out from the stage's inputs and the library's code, so before, a design in a workspace cloned from someone else could hand back a false result under the name another design of the workspace (your own, added to the clone) would read, and that design's next `cad check` could pass a mechanism that would fail.
533
+ - A design in the sandbox may hand back at most 40 stages, 256 MB in all, a build (and a board at most 40 routes, 64 MB in all). The kit's largest launcher makes a handful, its physics about 5 MB and its probe about 9. A design that makes more is built as before, and what is past the cap is not kept (it is made again at its next build); a reply that hands back more (one the design wrote itself) is refused with code `design.sandbox`, and nothing of it is written: before, any number of any size was written, enough to fill the disk or to push every honest result out of the cache.
534
+ - The stages and sandboxed routes kept on disk are capped as a whole too: each design's folder holds at most 512 MB of stages (128 MB of routes), and `.cache/stages/` at most 2 GB in all (`.cache/routes/`'s design folders 512 MB). Past a folder's limit its own least lately used files are removed; past the whole cache's limit, the least lately used of any design's. Without it, the cap on one reply still let many designs, or one design built again and again with other inputs, fill the disk 256 MB at a time. A stage that is removed is only worked out again at its next build.
535
+ - The routes the autorouter finds for a board built in the sandbox are written to the design's own folder, `.cache/routes/<design>/`, and read back by that board alone. Before, they were written to the route cache every board reads, and to `RULECAD_ROUTE_CACHE` when you point it at a folder several workspaces share, so one workspace's board could plant routes for another's. Such a shared folder is still read in the sandbox; only boards built in the tool's own process (trusted) write to it.
536
+ - Upgrading: the first build of each lamina after the upgrade works out its stages again, once, and stages kept the old way, directly in `.cache/stages/`, are removed. A board built in the sandbox routes again once, and no longer adds to a shared `RULECAD_ROUTE_CACHE`. No printed size changes. If you point `RULECAD_ROUTE_CACHE` at a folder several workspaces share and have built boards there from workspaces you did not write, empty that folder once: routes a sandboxed board wrote there before this change are still read.
537
+
538
+ - With no load on a joint, the most torque a screw was said to be tightened to was the whole of what the seat under its
539
+ head takes; as soon as the joint carried any load, however small, it was half that (`fixings.load_margin`). So a 6 g
540
+ load halved the torque `cad order` gave: an M3 cap screw on PLA into a nut was 0.33 N m with no load and 0.16 N m with
541
+ 6 g. It is now half what the seat takes on every joint, within a screw tightened fully (three quarters of its proof
542
+ load), since the clamp a torque gives scatters by a quarter to a third; the same goes for a head on a beam slot's
543
+ lips. `fasten.seat` says the half, and `cad order`, the build page and a frame's tightening by kind of join say "half
544
+ what the seat takes". Where a washer would let the screw be tightened further, `fasten.seat` names the torque it
545
+ would allow.
546
+ - A `torque` given for a steel screw into a thread made in the part itself (a pilot, a tapped or a printed thread) was checked only
547
+ against the pressure under the head, so on a joint with no load 0.5 N m on a washer into a PLA pilot, 69% of what
548
+ the thread is estimated to strip at, passed. `fasten.torque` now holds its clamp against the thread: past half the
549
+ stripping load it warns, past the whole of it it fails, naming the most to tighten to.
550
+ - Where several screws share a load, each was reckoned at the preload of its own best torque, though all are tightened
551
+ to the least of them; by rounding alone an unloaded screw could be named as the one that takes the most. Each is now
552
+ reckoned at the torque they are all tightened to, and where the top margins are the same to the hundredth,
553
+ `fasten.load` says those screws take the most alike (`refs.alike`), naming the one pulled harder.
554
+
555
+ Upgrading: with no `torque` given and no load, the torques `cad check`, `cad order` and the build page give fall by
556
+ about half where the seat sets them (an M3 cap on PLA: 0.16 N m where it was 0.33; an M5 button on a 2020 beam's
557
+ lips: 1.83 N m where it was 3.68); where half what a printed thread strips at was already the less, they do not move.
558
+ A `torque` given past half what a plastic thread strips at now warns, and past the whole of it fails. Under a load,
559
+ a screw that could have taken more than its neighbours now shows the lower preload it really has, so a slip margin can
560
+ fall. No printed size moves.
561
+
562
+ - `analysis` read a part's peak stress at its cells' centres, half a cell inside the surface, so in bending it came out
563
+ 10 to 30% low and `min_safety` passed parts that beam theory fails: a PLA cantilever 100 × 10 × 4 mm with 10 N at
564
+ its tip, 2.6 times under PLA's strength by beam theory, read 12.7 MPa on 2 mm cells and passed `min_safety` 3. The
565
+ analysis now reads `@rulecad/fea`'s surface stress (`fea.strength` and the report), and that cantilever fails.
566
+ - `fea.settled` judged the stiffness alone, so it said settled while the stress was still 15% out. With `min_safety`
567
+ given, the peak stress must now move 5% or less from the cells a quarter bigger too; its text and `values` give
568
+ both changes.
569
+ - A joint's printed clips (`joint.moment`), a link's peak stress where it bends (the rows of `link.deflection`) and the motor mount
570
+ (`motor.mount`) read the surface stress too. The motor mount's hand lift of the centre stress, k / (k − 1) for k
571
+ cells across the plate, is gone, as fea's reading does that properly.
572
+
573
+ Upgrading: reported peak stresses rise, most by 10 to 30% in bending, and more beside a support or load held at a
574
+ few points, where the stress concentrates (give it the face it acts on). Some analyses with `min_safety` that passed
575
+ now fail, and `fea.settled` can now warn where the stress has not settled. The clips' and the mount's margins move the
576
+ same way. No printed size moves: these checks size nothing. The kept results in `.cache/clip`, `.cache/link` and
577
+ `.cache/mount` are worked out again.
578
+
579
+ - A symbolic link inside a workspace that leads to a file or folder outside it is no longer followed. A workspace cloned from someone else could hold `rules/x.json`, a design's `.json` or `.js`, or a folder of a project, the whole project or the whole `rules/` folder that is a link to a private file of yours elsewhere, and a design or the tool read it as the workspace's own, so what was read could end up in a model link or an exported file. Before a design runs in the sandbox, its project and the workspace's `rules/` are looked through once a run; every JSON file of the workspace that rulecad reads (rule sets, projects, designs, assemblies, layouts; `cad rules draw` and `cad rules check`, and the lists of bought parts and plastics, too, which leave such a set out) is read only where it really is inside the workspace; the project's other files (`project.json`, `prints.jsonl`, the ledger, a design's code as `cad check` lints it) are read, and edited by `cad set` and the other edits, only where they really are inside it, and `cad printed` and `cad measured` never append through a link; a kept build or a lamina's kept stage in the workspace's `.cache/` that is a link to a file elsewhere is not read, by the tool or by a design in its sandbox, but made afresh; and a target named in cad.config.json is checked by its real path, after `cad trust` too. Each refusal has the code `workspace.outside` and names the link.
580
+ - Upgrading: a workspace that links a rule set or a project's file in from elsewhere now stops with `workspace.outside`, `CAD_TRUST=1` or not: copy the file into the workspace, or put it in a package and install it (links in the workspace's own `node_modules` are left alone; a project named `node_modules` is held to the rule like any other). A link that stays inside the workspace works as before. No printed size changes.
581
+
582
+ ### Added
583
+
584
+ - A castor plate's four bolts, their nuts and the washers their seat on the plastic needs go on `cad list`, and its
585
+ `fitting.seat` finding gives the torque to tighten them to. Every printed end part's screw into its beam has a
586
+ `fitting.torque` finding too.
587
+ - A castor plate item's `fitting` takes `"top"`, the castor's top plate's thickness, as the generated frame writes it
588
+ out (`cad frame --expand`), so `cad set` and `cad add` accept the expanded assembly.
589
+
590
+ For someone upgrading: no printed size moves on a frame without castors; a generated frame on castors now builds,
591
+ with thicker plates for a rectangular castor than a hand-placed castor plate had before.
592
+
593
+ - A design run in the sandbox now has a time limit (3600 s, an hour) and a memory limit (4096 MB for its
594
+ JavaScript). Past either, its process is stopped and the build fails with a `design.time` or `design.memory` finding that names the
595
+ design and the limit. Before, a design with an endless loop made `cad check`, `cad preview`, `cad link` and
596
+ `cad export` wait for ever with nothing said, and one that filled memory grew until the system stopped it, or
597
+ ended with a few lines of Node's own crash report.
598
+ - `"designTimeout"` (seconds) and `"designMemory"` (megabytes) in cad.config.json change the limits for a workspace;
599
+ `CAD_DESIGN_TIMEOUT` and `CAD_DESIGN_MEMORY` change them for one run, and win. A value that is not a number is
600
+ refused with a `design.limit` message saying where it was, never taken as no limit. A value in cad.config.json
601
+ above the default is used once the workspace is trusted (`cad trust` lists it); until then the default holds.
602
+ - The memory limit covers the design's whole process too: 512 MB more than its JavaScript's limit, for Node itself
603
+ and what lies outside the JavaScript (typed arrays, WebAssembly memory, output not yet sent), looked at four times
604
+ a second. What a design sends back is kept only up to its memory limit and what it prints only its last
605
+ megabyte, so it can't fill the tool's own process instead.
606
+ - A board design's solid, which the tool drills from the holes the design gives back, and the board's checks
607
+ (`cad check`, `cad release`), which the tool makes on the circuit the design gives back, are made within the same
608
+ time and memory limits: both take far longer the more the circuit holds (1000 holes, nearly two minutes to drill;
609
+ 1000 tracks laid over each other, more than a minute to check), so a board of thousands kept the tool busy for
610
+ hours after the design itself had ended.
611
+
612
+ - `fasten.stack`: `cad check` walks the parts a screw holds along its axis and fails where one does not meet the next
613
+ (more than 0.05 mm of air), naming both parts and the gap (a beam's slot lips clamped between them, as under a rail on a strip of nuts, fill it). Before, the screw was lengthened across the gap and every
614
+ check passed, so a part placed wrong was hidden and `cad list` bought too long a screw. A fit between the two parts
615
+ whose range holds the gap declares it: then the finding is a warning that names the fit.
616
+ - `fasten.wall`: the plastic round the far hole is measured side by side halfway along its first full-size stretch, where the thread is. A heat-set insert's
617
+ hole with less wall than its thread set's `insert_wall`, or a pilot, tapped or printed thread with less than a boss
618
+ twice the screw's diameter leaves (`fixings.boss_diameter`, from `@rulecad/fixings`), warns, naming the thin side.
619
+ - `frame.nut` fails two slot nuts whose lengths overlap in one slot, and a nut that runs under the head of a blind join
620
+ in that slot, the head taken at its width across.
621
+
622
+ - `cad check` gives `frame.tip`: whether a frame standing free on its feet (or its lowest ends) tips over, under its
623
+ own weight and under the side push `frame.rack` uses (`"frame": { "rack": { "load" } }`, else 20 N). The solve holds
624
+ every foot down as well as up, so no figure said a frame would fall: a 2020 box 200 x 200 x 940 passed `frame.rack`
625
+ and tips at 2.4 N. It now fails `frame.tip`, naming the feet it tips over and the feet that lift, with the push's
626
+ turn and the weight's hold and the push that tips it (`values.tips`). `frame.rack` gives that push beside its sway.
627
+ - What changes for a design: a tall or narrow frame, or one carrying its load beyond or right over its feet, that
628
+ checked clean now fails `frame.tip`. Widen its base, carry the load nearer the middle or lower, or, where it is
629
+ bolted down, say so with `"frame": { "supports" }`: a frame held there is taken as fixed down both ways and is not
630
+ checked for tipping (`frame.tip` says so). No printed size moves.
631
+ - `frameTip(s, helpers)` in `lib/framecheck.mjs`: `frame.tip` alone, without the other checks.
632
+
633
+ - `cad optimise --watch --allow-host <name>` (and `--allow-host` on the launcher example's `shape-*.mjs` scripts), and
634
+ an `allowHosts` option for `lib/live.mjs`'s `liveView` and `lib/live-shape.mjs`'s `liveShape`: more names to
635
+ open the live view by. If you watch a run from another device by a Tailscale name (`http://my-laptop:8090/`)
636
+ rather than its address, add that name with `--allow-host`; opening it by its Tailscale address needs nothing new.
637
+
638
+ ### Changed
639
+
640
+ - Names the code set and never read are gone, and every place that deliberately ignores a failure (a cache that can't
641
+ be written, a rule set that isn't there) now says in a comment why that is safe. No printed size moves, and nothing
642
+ a design or a check does changes. cad keys its caches on its own code, so the first build after upgrading makes
643
+ cached results once again; they come out the same.
644
+
645
+ - A trusted workspace (`"sandbox": false`, after `cad trust`) runs its designs in the tool's own process as before,
646
+ without either limit.
647
+
648
+ Upgrading: a design that really does take more than an hour to build from nothing, or needs more than 4 GB,
649
+ now stops with `design.time` or `design.memory`: raise `designTimeout` or `designMemory` in cad.config.json. The kit's
650
+ slowest example, the launcher's in-line action, built from nothing in about 37 minutes on a busy small machine. No printed size moves.
651
+
652
+ - `fasten.slot` takes a slot nut's length along the slot, half either side of its screw, and fails a nut that runs past
653
+ either end of the beam, naming the end. Before, each nut was a point.
654
+
655
+ Upgrading: an assembly with a part that floats above the one it is screwed to, a nut hanging off a beam's end or two
656
+ nuts in one place now fails `cad check`; one with thin bosses now warns. Close the gap (move the part), and `cad list`
657
+ may then choose a shorter screw. No printed size moves.
658
+
659
+ - Every module of the kit is now laid out by a formatter (Prettier): long lines are broken up and quotes made the
660
+ same, and nothing the code does has changed. cad keys its caches on the code of the packages it runs, so the first
661
+ build after upgrading makes every cached result once again: each object's build, a lamina's slow stages, an
662
+ optimisation's densities and its analysis, gear meshes and boards. The results are the same as before.
663
+
664
+ Upgrading: the first `cad build`, `cad check` or `cad optimise` in a workspace takes as long as a build from nothing.
665
+ A board released before this version is recorded with the board engine's old code, so `cad versions` may say its
666
+ engine changed. No printed size moves.
667
+
668
+ - `cad check` gives each gear mesh's contact ratio at the axes' real distance, a `mesh.tipClearance` line (the room
669
+ under the tips, which shifted pairs lose), and fails a pair set so far apart that the teeth never touch, or a pinion
670
+ that fouls its ring away from the pitch point (from `@rulecad/gears`). A ring 8 or 9 teeth bigger than its pinion
671
+ that clears is no longer failed by a count of teeth.
672
+
673
+ Upgrading: an assembly whose gear axes are off their nominal distance, or whose shifted gears or close rings were
674
+ passing, may now warn or fail. No printed size moves.
675
+
676
+ - `cad link` and `cad show` print one more line, on stderr, when the workspace names a model page of its own
677
+ (`viewUrl` in cad.config.json, or `CAD_VIEW_URL`): where the links lead. `--md` still prints its one line.
678
+
679
+ - `cad link` and `cad show` check a model once, through `encode()` from `@rulecad/model-link`, which now makes every check the model page makes (the rules card's lines, the build page's form, the length of every piece of text). A design whose link the page would refuse stops with "no link: " and the reason, as before.
680
+ - Upgrading: nothing to do; every design in the kit's examples and templates still makes a link. No printed size changes.
681
+
682
+ - A declared joint `torque` or `force` is added the way that makes the load worse, as a belt's push already was:
683
+ a declared 12 N no longer cancels the weight of what a vertical slide lifts.
684
+ - `motor.accel` holds a joint's declared `torque` or `force` against its motor as well as the weight, as `motor.torque`
685
+ does, so the acceleration it gives falls where loads are declared: the kit's `arm/arm` pen from 5898 to 5088 mm/s²
686
+ on 12 V (`task.time` is unchanged, as the speed sets it).
687
+ - A mass declared at the task's tool is taken to be the task's `payload`, so the two are counted once (the larger).
688
+ - Where one motor drives more than one loaded joint (a gear on its own shaft, then the joint it turns), `motor.torque`
689
+ names the joint that asks most of it, not the first in the train.
690
+ - Each motor finding says what it counted, as `counted: the parts' own 605 g, 10 g of payload, gravity down`, and in
691
+ `values.counted` (`parts`, `payload` in kg, `declared`, `gravity`, `gravityGiven`).
692
+
693
+ The kit's own designs: `examples/bench` `arm/arm-upright` declared its links' masses by hand in `"loads"`; those are
694
+ taken out, as the parts now count themselves (the shoulder 2.58 times over, the elbow 8.18, from 2.22 and 6.88).
695
+ `arm/arm-z` passes 4.85 times over 3.2 N (from 6.32 over 2.45 N: the carriage's own 76 g now counts), and
696
+ `arm/arm-z-belt` now warns at 1.6 times (from 2.08). EXAMPLES.md chapter 13 gives the new figures.
697
+
698
+ Upgrading: motor margins fall for every arm, lid and leg whose parts weigh something, and some designs that passed now
699
+ warn or fail: give the joint more ratio, a stronger motor or a lighter link. Where a design declared the masses of its
700
+ own drawn links in `"loads"` (as the motor checks needed before), they are now counted twice: keep only what the
701
+ drawing leaves out. Slide accelerations change by orders of magnitude and now read in mm/s². A reader of `--json`
702
+ that converted a slide's `values.available` from N m reads it in N now. No printed size moves.
703
+
704
+ - @rulecad/cad now states Node 22.13 or later in its `engines`, the same lowest Node as every rulecad package, and the
705
+ tests run on exactly Node 22.13.0 as well as the newest Node 24. Node 20 reached the end of its support on 30 April
706
+ 2026, and the kit's packages stated five different lowest versions, some of them too low: on Node 20.6 to 20.9 `cad`
707
+ stopped at start-up with "Unexpected token 'with'", and on Node 22.0 to 22.12 every `cad` command that runs a design
708
+ stops, because the sandbox designs run in cannot start there. npm gave no warning at install for either. Boards
709
+ (`"engine": "pcb"`) need `@rulecad/pcb`, which needs Node 24.
710
+
711
+ Upgrading: on a Node older than 22.13, npm now warns at install that this package needs Node 22.13; install Node 22.13
712
+ or later (24 recommended). Nothing else changes, and no printed size moves.
713
+
714
+ - `cad check` and the viewer show printcheck's new findings (#382): a sloped overhang is reported however many bridges
715
+ the part has elsewhere, a counterbore or stepped hole opening on the bed warns as a ledge as wide as its ring, and
716
+ the overhang ticks read "no sloped overhangs past 45°; flat undersides are checked on their own", or become a note
717
+ (`·`) when a ledge, a bridge too wide or an underside in mid-air is found. The tutorial shows the new wording.
718
+ Designs like these that passed may now warn; no printed size moves.
719
+
720
+ ### Already published
721
+
722
+ - The gear-mesh changes listed here (`cad check` judging each gear mesh where its axes are, with a
723
+ `mesh.tipClearance` line) are already in @rulecad/cad 0.8.0 as it went out on npm on 2026-11-29, though that
724
+ version's CHANGELOG did not say so (a line there now does): its publish run took the commit merged just after the
725
+ release (#573) in place of the release itself. A workspace already on 0.8.0 has them; this release only records them.
726
+
8
727
  ## 0.8.0: board designs run in the design sandbox, and a workspace with boards asks for no trust; a design in a workspace held in memory runs in the tool's own process only when the caller trusts it; dot-files are not a package's sources; 'no parts overlap' catches parts that overlap on a shared plane, without manifold-3d; the torque to tighten a screw in a printed thread to is half what strips it, at most; names read from a workspace's files can no longer reach outside it; a sandboxed design can no longer import its way out of an allowed package; a sandboxed design can no longer write files through its reply; every target but the kit's own is asked about
9
728
 
729
+ Also in 0.8.0 as published (added after the release, to put the record straight): the publish run took the commit
730
+ merged just after the release, so 0.8.0 holds #573 too. `cad check` judges each gear mesh where its axes are, with a
731
+ `mesh.tipClearance` line (from @rulecad/gears 0.3.5): an assembly with gears off their nominal distance, or close
732
+ rings, that passed can now warn or fail. No printed size moves. The next release's notes describe it in full.
733
+
10
734
  ### Changed
11
735
 
12
736
  - A board design (an object whose JSON says `"engine": "pcb"`) now runs in the design sandbox, as every other design does: another process that can't write files, start programs or import Node's modules, and that reads only the workspace and the packages designs use, with the board engine (`@rulecad/pcb` and the tscircuit packages it loads) allowed there. The design still reaches the engine as `v.pcb`; `v.pcb.mount` still reads the workspace's own thread sets. It hands back its board's Circuit JSON, which is checked like the rest of a sandbox's reply before the tool makes the board's solid and files from it, and the routes the autorouter found, which the tool keeps in `.cache/routes/` (or the folder `RULECAD_ROUTE_CACHE` names, which the sandbox may then read) under the route cache's own names only. A part's 3D model named in a board is read only from a plain path inside the workspace (`models/…`), and only when the file really is there: a link in `models/` to a file elsewhere is not followed. The board engine's packages the sandbox may read are found from the tool's own copy of `@rulecad/pcb`, never from one in the workspace's `node_modules`, so a workspace can't widen what a design reads by the package files it ships.