# Settings, presets and checks

## Settings

A design's `settings` are what a person can change. Every setting has a type, a default, a label and a level; numbers also have a `min`, a `max`, a `step` and a `unit` ("mm" for lengths, "°" for angles). The defaults must build.

Levels:

- `simple`: what a person changes on the design's page: width, reach, how many. At most 6.
- `advanced`: tuning a person can open up. Put everything else here.
- `expert`: the print-tested lock tuning inside the cam-lock bricks. Never give your own settings this level, and change a brick's expert setting only when an engagement fix names it.

Keep the simple settings to the few that matter, at most 6, counting the brick settings you expose as simple. Pick ranges you mean: the full check builds both ends of every simple setting.

## Presets are versions

Sizes and options are `presets` of one design, not separate designs. Each preset sets some settings by name ("width", or "instance.setting" for a brick's). The catalog lists every preset as a version of the design. Make a new design only for a different shape or mechanism.

## What each check builds

The quick check runs after every `create_draft` and `update_draft`: the rules that need no build, then one build of the defaults on the draft's wall. The change report shows its result.

The full check, `validate_draft` with scope "full", runs before you finish. On every wall the design claims it builds the defaults, then:

- every brick state (unlocked and locked), for motion (R8);
- the min and the max of every simple setting, one at a time: a toggle's other value and a choice's other options count too. An issue found there has `corner` `{ "setting": "width", "value": 15 }`;
- every preset, built like a corner, and its calculated load: an issue found there has `corner` with the setting `"preset"` and the preset's name as the value;
- for the load only, every simple setting at its weaker end together (the weakest combination): its reading names it in `weakest_at`.

Every one of those must pass R5, R2, R8 and the fit check, so pick ranges and presets you mean. The load is calculated at all of them too, as information.

That is many builds, so run it once the quick checks pass, not after every change. Checking content that hasn't changed since its last check reuses that report. If it answers "checking", call it again with the same arguments: joining the running check is free.

Send the studio's calls one after another, and wait for each answer before the next. The local studio builds one thing at a time: a call sent while another builds answers that the studio is busy, and nothing runs.

A draft keeps its last 50 revisions; `get_draft_history` lists them with what changed.

## Tolerance walls

A real wall is never exactly its listed sizes. On every claimed wall the full check also judges the defaults' parts, as built for that wall, against two walls just off it: the slot 0.2 mm narrower and the lip 0.3 mm thicker, then the slot 0.2 mm wider and the lip 0.3 mm thinner (0.05 mm for a field that was measured on a real panel). What fails there is never an error: it is a warning to print the slot gauge on the person's wall.

The change report and `validate_draft` give one warning per wall for them, code `wall-tolerance`, listing what was found. A cam-lock hook gets one on most walls, because the hook's top L sits close to a lip that may be thicker. The `multi-slot-lock` example on VEVOR PVC slatwall gives:

```json
{
  "rule": "R4",
  "code": "wall-tolerance",
  "level": "warn",
  "path": "uses.lock",
  "wall": "vevor",
  "message": "Tolerance, 1 finding (cuts-into-slat): On VEVOR PVC slatwall (slot 0.05 mm narrower, lip 0.3 mm thicker) \"lock.column\" cuts 25 mm³ into the slat above the slot: it sits up to 0.3 mm in front of the lip's back face (lip_thickness 7 mm, assumed) and reaches 4.5 mm past the slot's top edge (lip). This rests on lip_thickness 7 mm (assumed), not measured or published. A real wall can be this far off its listed sizes, so this may not fit yours.",
  "fix": {
    "say": "Print the slot gauge on your wall to check lip_thickness 7 mm (assumed). A tolerance warning alone is no reason to change a print-tested brick setting. Only if the gauge shows your wall is this far off: cuts-into-slat: Keep it behind the lip's back face, at least 0.3 mm further back, or within 1 mm of the slot's edge."
  }
}
```

Nothing in the design fixes these; they say to check the wall. Don't change a print-tested number because of one.

## The load codes

The load is calculated on every build the check reads; the weakest reading sets the weakest figure, and the defaults and presets set the catalog's class. Every load code is a warning, never an error: information for improving the design. They are:

- `load-under-light`: the calculated figure is under 2 kg, light's top. Fix: If the part should hold more, strengthen what the load's limiting names (thicker, shorter, or a brick rated for it) and check again.
- `load-rough-estimate`: the design's own shapes or load_point carry the load, so the figure is rough; the catalog lists it as light. Fix: Nothing to do unless holding matters; a print report can confirm more later.
- `load-unestimated`: the design's own shapes carry the load but couldn't be calculated: a loose piece, a gap, or a shape too complex. Fix: If the figure matters, join every piece to the mount as one solid; the message names what couldn't be calculated.
- `load-point-invalid`: the load_point isn't on the part that carries the item, or sits on the mount's face. The load is calculated at the worst point of the part instead. Fix: Put the load_point where the item really hangs, on the part, or leave it out.
- `load-no-estimate`: nothing calculates what the part carries; the catalog lists it as light. Fix: Nothing to do unless holding matters; the message says why nothing calculates it.
- `load-bad-estimate`: a brick reports a capacity that isn't a number: a fault in the brick, not the design. Fix: Report it to the Slatfinity team.
- `load-over-estimate`: the design's own `load` says more than its weakest figure at the defaults or a preset. Fix: Make the part that sets the figure stronger if holding matters; the catalog's class follows the calculation either way.

A design whose own shapes carry the load (an arm or a peg you drew) is calculated with the item at the worst point of those shapes. Such a figure is rough: "This figure comes from the shape itself, so it's rough, and the catalog lists the design as light. A print report can confirm more later."
