Skip to content

Fix: error codes and validation (F1 F5 F6 F11 F12 F15 F16 F20) - #41

Merged
guijacquemet merged 7 commits into
mainfrom
claude/fix-error-codes
Oct 8, 2026
Merged

guijacquemet merged 7 commits into
mainfrom
claude/fix-error-codes

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes the first theme of the round-trip findings. Every case that the matrix skipped for these findings now runs as a normal test; the findings are removed from tests/roundtrip_known_failures.py.

Before -> after

  • Numbers (F1): an integer or float given text, a list, an object, NaN, infinity or a huge int failed with the Python exception name as code; now invalid_parameter ('N' must be an integer, got <what>). 3.0 is still accepted for an integer; the text "3" is refused for a number (hosts must send a JSON number).
  • Paths (F12): a non-text file, folder or image value is invalid_parameter.
  • Shared memory (F11): a stale or malformed descriptor is unreadable_image with a message saying what the host must do.
  • Wrong returns (F5): a wrong kind of returned value is bad_return naming the output and what was expected; a message output that is not text, a file output that is not a path, a values output that is not a mapping, and several outputs given a bare array are refused too (before: str() of whatever came back, or a numpy truth-value error).
  • Affine (F6): NaN or infinity is bad_return (was delivered as null).
  • Image outputs (F15, F20): empty arrays are bad_return; complex, object, text and bytes arrays are unsupported_dtype; uint64 beyond float32 is refused with unsupported_dtype on every machine (the float32 exactness check no longer uses an out-of-range cast, which stored 264-1 as 264 on ARM).
  • Hint misuse (F16): Min/Max on a non-number, a non-finite bound, Min above Max, PixelSizeOf on a non-float, Axes on a non-image, Name/Replace/ApplyTo on an input, and two outputs with the same Name are now a DeclarationError at registration (they were silently accepted or renamed). An app that carried one of these mistakes will stop registering: I described the tools of VLab4Mic, Playground, GuessTheCondition and NucleiSky (bridge-test) with this branch and all register; CellTracksColab was not checked.

Test edits (exceptions to "no existing test edited"): tests/test_sabotage.py: four break patches changed text because the lines they patch moved (same breaks). test_roundtrip_known_failures.py::test_the_skip_is_exactly_the_list used an F1 id as a sentinel; replaced by a check independent of any one id. No existing test encoded the buggy behaviour.

Docs: PROTOCOL.md (value rules, returns, image outputs, uint64), MANIFEST.md (refused hint misuse), REGRESSION_LEDGER.md.

Host follow-ups (not in this PR): mirror the messages above where a host validates before sending, send numbers as numbers and paths as text, send the full shared-memory descriptor and keep the block alive until the task ends. Tracked in the host parity work.

Verified by the author: black, ruff, mypy, vulture; the full suite has only the two environmental failures of this sandbox. Not verified: Windows, macOS, ARM, the coverage gate (CI runs it).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN


Generated by Claude Code

claude added 4 commits October 8, 2026 13:05
…-text paths, bad_return for wrong returns, refuse unusable images, refuse hint misuse (F1 F5 F6 F11 F12 F15 F16 F20)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
…ze-proof shared-memory test

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
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y2SN8SuEakTdiWy3F2WUqN
@guijacquemet
guijacquemet merged commit d939db8 into main Oct 8, 2026
14 checks passed
@guijacquemet
guijacquemet deleted the claude/fix-error-codes branch October 14, 2026 16:08
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