Repository navigation
Port legacy statement byte transport (3f-2b-1) - #130
Draft
schickling-assistant wants to merge 1 commit into
Draft
schickling-assistant wants to merge 1 commit into
schickling-assistant wants to merge 1 commit into
Conversation
Contributor
Author
|
CI Manager (agent/dotfiles/ci-manager) source review of #130 at e400fca: GO.
Posted on behalf of @schickling
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
3f-2b-1 ports Python json.loads' byte transport into statement_bytes::decode_json_bytes: BOM priority, first-two/four-byte NUL encoding detection, UTF-8/16/32 endianness, strict malformed/overlong/truncated encoding refusal and surrogatepass semantics. Output is Python code points, including lone surrogates; no lossy replacement or invalid Rust String is used. Empty decoded text is distinct from an encoding failure. The structural statement test again explicitly asserts that an empty command argument survives.
Python source lines ported
Pinned oracle v0.6.0 cff667c, scripts/evidence-verify:636 (json.loads byte-to-text phase), with pinned Python 3.14.7's json.detect_encoding and surrogatepass codecs. The unchanged oracle supplies both decoded code points and statement_of verdicts for every fixture.
Split plan
This is the first bounded slice of 3f-2b, not a completed byte-to-statement entrypoint. Remaining 3f-2b-2: JSON grammar and lossless values/keys, NaN/Infinity, integer limits, duplicate keys, nesting and the source exception behavior at 635-636/666-667; then integration with the structural guard. The current legacy Value's Rust String values and BTreeMap<String,...> keys cannot preserve Python's accepted lone-surrogate values/keys. Correctly migrating that representation plus a JSON parser and its differential tests does not fit the remaining 280-line allowance. The README, PROVENANCE and tmp/statement-bytes/plan.txt record this boundary. No narrower shared decoder has been silently substituted and no CLI/native caller changes.
After byte-to-statement integration: 3f-3 Git layout/parent/subject checks and cache, signature integration, 3g selection, 3h require_all and caller cutover. Projection OID/end-of-options and input_git output bounds remain independent hardening before wiring.
Differential tests
legacy_statement_bytes_match_python_transport builds 62 named fixtures and compares the Rust decoder's exact code-point vectors (or encoding refusal) with the pinned Python json.loads transport. It includes valid full statements in UTF-8/signature and both byte orders of UTF-16/32, BOM and no-BOM forms, scalar and surrogate boundaries, surrogate values/keys, nonfinite JSON extensions, malformed/overlong/truncated encodings, isolated and paired surrogates, BOM-only/double-BOM inputs, short NUL heuristics, integer conversion limits and depth. Statement verdicts are recorded separately: successful text decoding alone is never claimed as statement acceptance.
Evidence
Pinned rustfmt 1.9.0 from nixpkgs 4ba99f3209788ed04f01af38f77ddb803ad6ec63 formatted the changed Rust files locally on dev3; direct rustfmt --check with rustfmt.toml passed.
The complete Python half was executed locally on dev3 with /nix/store/6cg92xlgwwwl88fiwrid0l924fmy8slp-python3-3.14.7-env/bin/python3, extracting the actual inline script from statement_bytes_tests.rs and running it against /nix/store/bbj5s0bmhsv4a9mjqb97x80r8dvkas45-source. All 62 fixture verdicts are below. This is not a Rust test execution claim.
The current Fractal fixture pin 787e8ed592dff34d2bdc2a2b0b584482da567e7f was transferred as an exact Git archive to dev5:/var/tmp/mergemaster-byte-fractal. Remote verification reuses the prepared pinned toolchain environment (same nixpkgs and oracle pins), overriding only MERGEMASTER_FRACTAL_FIXTURE to this current archive. Source is /var/tmp/mergemaster-statement-bytes-source; target /var/tmp/mergemaster-statement-bytes-target. No target under ~/.megarepo.
Local Python verdict table
name | byte-to-text | statement_of
valid-utf-8 | ok | true
valid-utf-8-sig | ok | true
valid-utf-16 | ok | true
valid-utf-16-le | ok | true
valid-utf-16-be | ok | true
valid-utf-32 | ok | true
valid-utf-32-le | ok | true
valid-utf-32-be | ok | true
valid-bom-utf-16-be | ok | true
valid-bom-utf-32-be | ok | true
boundaries-utf-8 | ok | false
boundaries-utf-16-le | ok | false
boundaries-utf-16-be | ok | false
boundaries-utf-32-le | ok | false
boundaries-utf-32-be | ok | false
surrogate-value-utf-8 | ok | true
surrogate-value-utf-16-le | ok | true
surrogate-value-utf-32-be | ok | true
surrogate-key-utf-8 | ok | true
surrogate-key-utf-16-le | ok | true
surrogate-key-utf-32-be | ok | true
nan-utf-8 | ok | true
nan-utf-16-le | ok | true
nan-utf-32-be | ok | true
infinity-utf-8 | ok | true
infinity-utf-16-le | ok | true
infinity-utf-32-be | ok | true
negative-infinity-utf-8 | ok | true
negative-infinity-utf-16-le | ok | true
negative-infinity-utf-32-be | ok | true
empty | ok | false
utf8-bom-only | ok | false
utf16-bom-only | ok | false
utf32-bom-only | ok | false
short-be | ok | false
short-le | ok | false
three-byte-nul | ok | false
four-byte-nul | ok | false
odd-utf16 | UnicodeError | false
truncated-utf32 | UnicodeError | false
utf32-too-large | UnicodeError | false
utf8-overlong | UnicodeError | false
utf8-overlong-three | UnicodeError | false
utf8-overlong-four | UnicodeError | false
utf8-too-large | UnicodeError | false
utf8-truncated | UnicodeError | false
utf8-continuation | UnicodeError | false
utf8-high-surrogate | ok | false
utf8-low-surrogate | ok | false
utf8-surrogate-pair | ok | false
utf16-high-surrogate | ok | false
utf16-low-surrogate | ok | false
utf16-pair | ok | false
utf16-unpaired-then-ascii | ok | false
utf32-surrogate | ok | false
utf8-double-bom | ok | false
utf16-double-bom | ok | false
utf32-double-bom | ok | false
integer-4300 | ok | true
integer-4301 | ok | false
depth-100 | ok | true
depth-2000 | ok | true
Remote admission / NOT RUN
Attempted dev5:
gate-slot --lane build --profile disk=cargo-cold --max-wait 1800 -- python3 /var/tmp/mergemaster-statement-bytes-verify.py
No admission. Initially 33 ahead; the heavy lane was subsequently fenced by
Fleet Load. Withdrew at 2026-11-10T22:21:25Z after 1800s, exit 94.
No Cargo command executed. Stopped at the required 30-minute admission ceiling.
Temporary runner removed after the attempt.
NOT RUN:
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimeagent_modelworktree