ENGINEERING PROOF 022 / A COUNTEREXAMPLE THAT IMPROVED THE CONTRACT

One action.
Two hashes. Fixed.

The first JavaScript ↔ Python proof passed 13 published cases. An adversarial object with keys "10" and "2" exposed a real mismatch: each language hashed different JSON bytes for the same proposed action. We reproduced it, aligned the Python wire order, and kept the failing baseline visible.

This is a project-maintained regression test of a bounded JSON subset, not an outside witness, a formal proof of all JSON, or evidence of real tool execution.

The illustration shows the core counterexample; the actual proposal bytes and SHA-256 digests appear below.

PUBLISHED CHALLENGE13 / 13Existing cases still pass.
PRIOR PYTHON ORDER—mismatches in this deliberately adversarial corpus.
FIXED PYTHON ORDER—mismatches in the same cases.

See the mismatch in bytes.

Select a nested case, a numeric boundary, or a control where the original implementation already agreed.

07 / INSPECTABLE CASES

Loading…
SELECTED CASE / —

Loading…

Reading report.

BEFORE / OLD PYTHON ORDER

—

PROPOSAL SHA-256
—
AFTER / FIXED PYTHON + JS

—

PROPOSAL SHA-256
—

OLD PYTHON WIRE BYTES

—

JAVASCRIPT WIRE BYTES

—

FIXED PYTHON WIRE BYTES

—
The digest difference comes from byte order, not a change in intended recipient or policy.

Re-run the corpus

One deterministic seed generates 512 proposals alongside seven named edge cases. The script runs a separate Python process, compares exact JSON and plan hashes to JavaScript, and checks this published report.

node scripts/build-action-key-order-report.mjs --check

Fixture SHA-256: Loading…

Why this happens

The JavaScript reference sorts keys, rebuilds an ordinary object, then stringifies it. ECMAScript enumerates array-index keys numerically before other strings. The former Python code preserved a simple lexical sort. Keys such as "01" and "4294967295" are not array indices.

Read the ECMAScript property-order rule and Python JSON encoder behavior. ĀML follows its existing JavaScript wire bytes for this restricted contract; it does not claim a universal canonical JSON standard.