Skip to content

Conformance: conformance.json (packaged), validating loader, host loaders documented (phase 0.3, PR B) - #113

Merged
guijacquemet merged 2 commits into
mainfrom
claude/conformance-loader
Oct 12, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/conformance-loader

Conversation

@guijacquemet

@guijacquemet guijacquemet commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Roadmap phase 0.3 part B ("87a"): the cross-host rules as data, plus the loader.

  • labconstrictor_tools/conformance.json, packaged with the wheel ([tool.setuptools.package-data]; a test builds the wheel and checks it contains the file).
  • labconstrictor_tools/conformance.py: load() (validated, cached), validate() (hand-written schema, stdlib only, returns every problem), path(), and python -m labconstrictor_tools.conformance --path | --validate for hosts that are not Python.
  • docs/CONFORMANCE.md: layout of the file, how each host's test loads it (Tools, Napari, Fiji via LC_CONFORMANCE, QuPath), the rules for a host test, and the gaps. HOST_PARITY.md section 2, PROTOCOL.md and the spec header now point to it.
  • Contents, only what is already decided in SPEC_WRONG_SCIENCE (or carried by Tools code): limits (number limits 2^53-1 and 1e15, results_kept 20, run_records_kept 50, lookup timings; each with status: decided|default), host_internal_codes (the four new ones), messages (templates), compat vectors, and wrong_science: coordinate frame (rule, placement formula, CF-01..CF-14), calibration (unit table, micro-sign and damaged-sign rule, anisotropy, default-dpi rule, _calibration shape, CAL-01..CAL-18, CAL-T1..T9), retention (marker names; RET-01..09, 12, 13 as structured fixtures, HRET and RET-10/11/14 as host fixtures), run identity RUN-01..06, async ASY-01..08, number limits NUM-01..05.

Tests (tests/test_conformance.py)

  • Schema: 28 kinds of damage are each named (missing key, wrong status, duplicate id, positional placeholder, unordered versions, ...); validate never raises on odd data; a malformed file makes load() raise listing all problems.
  • Data against the code: limits vs notebook.MAX_FORM_INTEGER and retention.RESULTS_KEPT/RUN_RECORDS_KEPT; every compat vector through compat.check_schema; every message template is a sentence of the spec; host-internal codes match the spec text.
  • Data against plain-Python oracles: world coordinates of CF-01..06 (scale/translate/affine/shear), the rectangle mask by an even-odd rasteriser, the CF-09 crop arithmetic, c = x0 + (x + 0.5) * d for every CF-14 variant, unit conversions (CAL-03, 05, 15, 16, 17, 18), the default-dpi tolerance.
  • Retention fixtures RET-01..09, 12, 13 are built from the JSON and run against retention.prune and the real CLI (4 concurrent processes, lock held by another process, symlink).
  • Sabotage: 9 new rows (conformance:*) in tests/test_sabotage.py, all caught. Ledger row added in a different place from PR A's.
  • black, ruff, mypy, vulture clean; full suite under coverage run as a non-root user on the merge result (main merged in, after PR A was merged).

Gaps found in the spec (not invented; full list in docs/CONFORMANCE.md "Gaps")

  1. HOST_PARITY sketch keys with no decision in SPEC_WRONG_SCIENCE are left out: max_shapes, table_rows_shown, region_max_objects, max_export_bytes, max_display_bytes, cancel_grace_s, worker_orphan_grace_s, worker_idle_s, log limits, error_codes, notice_codes, worker_exit_hints, number_text (the Tools CLI itself diverges, TOOLS-7), quoting/command_vectors (Windows trailing backslash is "TO DECIDE"; tests/quote_vectors.json stays the shared source), results_text, trust_vectors, host_error.
  2. The axis order of rect is not stated (the mask shows it is [y, x], while protocol shapes are [x, y]); CF-09/CF-14 mix [width, height] and [rows, cols].
  3. CF-07, 08, 10..13, RUN, ASY, HRET and RET-10/11/14 are prose sequences; there is no machine-executable vocabulary, so hosts interpret them.
  4. Length units: CAL-03 uses millimeter, but the spec lists only mm; long forms of the other units, case sensitivity, plurals and spaces are unspecified (only millimeter/millimetre were added).
  5. Number limits: only the integer refusal sentence is given (the >= form is from HOST_PARITY I06); float wording and the case of a GUI box that cannot hold the number are unspecified; the spec writes the key as limits.form_integer_max = N, the file uses limits.form_integer_max.value.
  6. A Tools divergence: the notebook form's refusal of an integer beyond 2^53-1 does not use the 'L' must be <= 9007199254740991 template of 6.2 (NUM-02/03). Not fixed here.
  7. Lookup limits (5.4) and the other SPEC 8 working decisions are default, not confirmed; N-D, downsample d != 1 and TimeIntervalOf/ZStepOf fixtures wait for Wave 2.

Notes

  • The wheel-content test needs a recent setuptools (it skips with the reason otherwise; it passed here with setuptools 79).
  • Hosts (Napari, Fiji, QuPath) are not changed; their loaders are documented only.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN

…a validation

labconstrictor_tools/conformance.json holds the rules that are already decided
in docs/SPEC_WRONG_SCIENCE.md as data: named limits (number limits, retention
quotas, lookup timings), host-internal codes, message templates, the
compatibility vectors, and the wrong_science fixtures (coordinate frame CF-01..14,
calibration CAL-01..18 and transitions, retention RET/HRET, run identity,
asynchronous lookups, number limits NUM-01..05). It ships with the wheel
(package-data). labconstrictor_tools.conformance loads and validates it
(load, validate, path, python -m labconstrictor_tools.conformance).

docs/CONFORMANCE.md documents the layout, how each host's test loads the file,
and the gaps the spec leaves open (not invented in the file).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN

# Conflicts:
#	docs/TESTING.md
#	tests/README.md
#	tests/test_sabotage.py
@guijacquemet
guijacquemet merged commit f947fe9 into main Oct 12, 2026
6 checks passed
@guijacquemet
guijacquemet deleted the claude/conformance-loader branch October 14, 2026 16:10
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.

2 participants