Skip to content

Check native adjustment ranges before dispatch, using measured bounds - #60

Merged
kiri11 merged 7 commits into
mainfrom
native-bounds
Oct 16, 2026
Merged

kiri11 merged 7 commits into
mainfrom
native-bounds

Conversation

@kiri11

@kiri11 kiri11 commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Closes #47.

native_set now rejects an out-of-range numeric value with invalidRequest naming the range, for example Native level highlight rgb must be within 0...255., before any read, dispatch or journal entry. Before this change only opacity, distortion and the tonal FieldSpec fields were checked; everything else reached Capture One, whose own messages name the wrong limit (256 fails with "above 1") and which silently clamps color balance hue 361 to 360.

What changed

  • sdef/16.8.5.30.native-bounds.json holds 70 bounds with their source and build: 68 adjustments fields from byjustinjones/capture-one-mcp's bisection (cfb4e42, MIT), rounded to the intended limits, plus layer.opacity and lens.distortion.
  • scripts/generate-native-editing.py copies them into NativeEditing.json as minimum / maximum. It fails on a build mismatch, a name that is not a writable real/integer field, non-integral integer bounds, or an empty range.
  • NativeEditing.validate reads the field's own bounds. The hard-coded opacity / distortion map and the FieldRegistry loop are gone. patchSchema publishes minimum / maximum.
  • scripts/probe-native-bounds.py confirms the table live on an owned disposable Session through direct AppleScript, at each bound and one step past it.
  • docs/reference/native-editing.md has a "Numeric bounds" table.

Behavior changes to review

  • opacity widens from 1...100 to 0...100, and distortion from 0...100 to 0...120. Both were measured live: 0 opacity and 120 distortion read back exactly, while 101 / -1 and 121 / -1 are rejected. The old ranges had no recorded rationale.
  • Recipe settings reuse patchSchema, so an out-of-range recipe value now fails schema validation with the generic "Expected number" message. RecipeFake now reports each field's minimum instead of 0, since 0 is out of range for sharpening radius and moire pattern.

Live verification (Capture One 16.8.5.30, owned disposable fixtures)

  • probe-native-bounds.py on the final table: 0 mismatched of 70. Every past-bound write errors and leaves the bound in place, except the four color balance * hue fields, which accept -1 and 361 silently and read back 360 (confirmed-clamped). c1 now rejects those values before dispatch. Temperature reads back 13999.999 at 14000 and tint 49.99999 at 50, inside the 0.1 / 0.01 readback tolerances. The first probe run found the table's original opacity [1, 100] and distortion [0, 100] wrong; both were corrected and reconfirmed.
  • make qualify QUALIFY_SUITES=native: passed (1267 s).
  • make check: passed.

Fault cases were not run: the check runs before the journal write and dispatch, so recovery behavior is unchanged.

🤖 Generated with Claude Code

kiri11 and others added 7 commits October 15, 2026 21:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The generator fails when the table's build differs from the sdef build,
names a field that is not a writable real or integer field in its scope,
or gives an integer field non-integral bounds.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
native_set rejects a value outside a field's measured range with
invalidRequest before any read, dispatch or journal entry, and the patch
schema publishes the same minimum and maximum. This replaces the
hard-coded opacity and distortion map and the tonal registry loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The live probe on the qualification fixture accepts layer opacity 0 and
lens distortion 120, and rejects -1, 101 and 120.01.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
scripts/probe-native-bounds.py writes each bound and just past it through
guarded direct AppleScript on an owned Session's variant, restores the
original, classifies each bound, and keeps JSON evidence. The offline
test covers the classification and runs in make check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kiri11
kiri11 merged commit 9765a41 into main Oct 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Check native adjustment ranges before dispatch, using measured bounds

1 participant