Repository navigation
feat(api): classify local typed response envelopes (#863) - #1073
Merged
Merged
Conversation
athvin
force-pushed
the
issue/863-typed-envelopes
branch
from
November 9, 2026 23:17
c51e0dd to
8508193
Compare
athvin
marked this pull request as ready for review
November 9, 2026 23:18
This was referenced Nov 9, 2026
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.
Closes #863
What
Teach the shared success-envelope classifier to resolve local typed response constructors while retaining the existing JSON forms and committed ledger.
Why
Converting
Json(json!({"jobs": jobs}))toJson(JobsResponse { jobs })currently downgrades the ledger from wrapped to scalar. The classifier must retain the envelope before #864 converts handlers.Proof
The two new classifier/adapter fixtures first failed on
Scalarversuswrapped/jobs. All 16 library tests now pass; focused clippy passes with warnings denied. All five contract artifacts are byte-identical to base. Fullmake checkpassed on c51e0dd. Rebase onto CI-only main50de124e leftrust/,entities/,frontend/and Makefile byte-identical; all affected CI-speed, skills, bridge, script/workflow, PR-contract and static-credential gates passed on the refreshed tree. Fresh CI passed on85081931, including the real-service integration jobs; exact-head preflight confirmed every required context and all four detect jobs.Risk & rollback
Source-derivation tooling only; no handler or runtime payload change. Supported constructors are plain local named structs; unsupported serialization attributes fail explicitly. Revert the merge commit to undo it.
Post-merge ledger
Closed by: Codex · session
Codex:01a1be1b-0c92-7703-a4c2-25cb2c999baaonMac-46· 2026-11-09T23:52:56.257147+00:00 (one blocked item)mainis green with this change on it — deferred — Stabilize marketing audit and volume interaction tests #1074 owns the pre-existing frontend failure; this is not a claim that all main checks passed. Merge9c16f988528effee9c8a9cb0c1927cea217009d5has successful Rust 42719890932 (attempt2), infra42719891075 and devcontainer42719890947. The Rust job's first attempt stopped before testing at the 40GiB disk threshold; one failed-job retry passed unchanged. Frontend42719890729 repeats base50de's mobile Safari slider failure in unchanged marketing code. The 30-minute watch ended23:52:09Z with no additional failures.images— 42719890770 succeeded for the exact merge SHA.deploy— blocked — 42720333784 explicitly deployed9c16f988 to dev/prod, succeeded, and returned/readyz200. A process-emitted startup line for this image remains unverified: this session has no available AWS execution/log-query tool, and guarded CLI access was rejected. Earlier peer log evidence predates this SHA. Workflow readiness is not substituted for process proof.Context — plan, discoveries, measurements, files
Plan
the_classifier_reads_each_form, and an adapter fixture covering both the GET ledger and OpenAPI GET/write derivation.classify_envelope; reusestruct_fieldsfor local declarations, preserve declared serialization order, and reject unsupported local serialization representations instead of silently publishing wrong keys. Keep legacy unknownJson(value), JSON literal, page helper and Arrow behavior.make check; require the realenvelopes.json, MCP manifest and both OpenAPI snapshots to remain byte-identical. No handler conversion, entity change or generated artifact edit belongs here.Discoveries
Post-merge: Rust run 42719890932 failed before tests because a runner retained only 36 GiB after cleanup (40 GiB required); failed-job retry 1/2 completed successfully at attempt 2. Frontend run 42719890729 repeats the pre-existing mobile Safari slider failure tracked by peer-owned #1074. The unchanged frontend path failed on base50de as well. Deploy 42720333784 explicitly deployed merge9c16f988 in dev/prod; both completed and
/readyzreturned200. A process-emitted startup log for this image is still unverified; workflow readiness is not substituted for it.Main baseline: frontend run42717888912 at50de124e failed the unchanged mobile-Safari volume interaction after a peer rerun. Peer-owned #1074 tracks that marketing test; it is outside this diff. Do not attribute it to the classifier or silently describe latest main as all green.
A quoted closing parenthesis reproduced a scalar misclassification. The typed constructor path now uses Rust token groups; the regression failed before that fix and passes after it.
The existing field parser ignores serialization attributes. The typed path rejects those rather than claiming Rust names are serialized keys. Write-response collection now propagates classifier failures even when another branch has a readable JSON response. Unknown variables and external constructors retain their prior scalar classification; empty named objects retain the empty JSON literal classification.
Measurements
Files
rust/crates/er-api-spec/src/envelopes.rsrust/crates/er-api-spec/src/operations/responses.rsand adapter fixtures