Skip to content

fix(snapshot): preserve deep structured values during canonical serialization - #431

Draft
afflom wants to merge 1 commit into
release/v0.4from
codex/snapshot-canonical-depth
Draft

afflom wants to merge 1 commit into
release/v0.4from
codex/snapshot-canonical-depth

Conversation

@afflom

@afflom afflom commented Nov 3, 2026

Copy link
Copy Markdown
Member

Serializing an already constructed semantic snapshot can panic at serde_json's raw-reader nesting limit. This surfaced in PrismLegal's 111-vector acceptance corpus through PrismPM (PP9001). SemanticSnapshot::to_json now converts its structured value directly to canonical Json, retaining the canonical-domain checks and existing bytes. Raw-input parsing retains duplicate-key and malformed-input validation.

A regression with a 160-level linked value failed at the original expect before the fix; the shallow byte-compatibility case passed. After the fix, both pass, including complete snapshot round-trip and digest checks. VERIFICATION.md records the observed failure.

Validation on release/v0.4 parent 0a01df6: all 221 LexLean library tests pass with ordinary stacks; validate-model passes (469 IDs, 86 codes); changed Rust files pass rustfmt and the diff passes whitespace checks. Full vv has not been run, so this remains draft. No language identity or external parser limit is changed.

The consuming application is using factored acceptance constants with its existing pinned compiler, so this repair does not block its work.

Fixes #430.

@afflom afflom left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent source review is clear for #430's already-constructed snapshot serialization fix. The existing structured conversion retains canonical-domain refusals, object ordering, escaping and byte/ID/LF behavior; raw text parsing is unchanged. The deep round-trip/digest regression and shallow byte-equivalence case cover the changed boundary. These three files do not move embedded semantic or renderer identities. Contributor-reported 221 library passes are focused evidence, not a complete gate.

Keep the scope precise: json_value/canonical_value still reparse while constructing snapshots before to_json, so this does not yet establish end-to-end deep Engine::snapshot support. That adjacent limitation remains tracked in #430's discussion and needs its own accepted-source regression/follow-up; it is not introduced by this patch.

Please retain draft while #403's final base integration runs. Integrate its landed tree before requesting this PR's single complete final-head gate, rather than paying for a full run on a base already scheduled to move. No draft or incomplete gate will be merged. This is a COMMENT review because the connected account is also the PR author.

@afflom afflom added this to the LexLean v0.4.1 milestone Nov 3, 2026 — with ChatGPT Codex Connector
@humuhumu33
humuhumu33 marked this pull request as ready for review November 4, 2026 15:44
@afflom
afflom marked this pull request as draft November 4, 2026 15:53

afflom commented Nov 4, 2026

Copy link
Copy Markdown
Member Author

Restored draft after the 15:44 readiness toggle. The head is still 17aea02 on its original 0a01df6 parent; no source/base integration or additional evidence accompanied the toggle, and the body still correctly says the complete gate has not run. Current release/v0.4 is c613290. The existing source review remains valid for already-constructed snapshot serialization, but it is not final integrated-tree acceptance.

The newly queued CI41860813912 is not a replacement for the required integrated final head. No rerun or validation workaround is requested. The retained local integration/witness preparation remains unexecuted because automatic content review stopped that delegated validation preparation for possible cybersecurity risk; the exact rejected action was not exposed. That action will not be retried, rephrased or circumvented. #430 remains open; no pass or readiness claim is added.

This branch has not been deployed

No deployments
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.

1 participant