Skip to content

Envelope classifier learns typed response structs (blocker for the typed-response conversion) #863

Closed

Description

@athvin

API product implementation work · roadmap #1008 · use parent dependency order; not a separate product rank.

Part of #857. Stack rank 6 of 13. Depends on: T2. Hard blocker for the typed-response conversion — nothing converts before this lands.

Color

The trap that orders the whole typed-response phase: classify_envelope parses Json(json!(…)) literals out of the handler source. Convert one handler to Json(JobsResponse { jobs }) and its ledger entry silently flips from wrapped/jobs to scalar — the envelope gate goes blind at exactly the moment the refactor needs it most. The ledger exists because of W0.5b (a BFF forward<unknown[]> against a {jobs: […]} envelope crashed the real dashboard while every mock-backed tier was green); letting it degrade during the conversion would reopen that class.

Scope

Extend er_api_spec::classify_envelope to resolve Json(<LocalStruct>) through the existing struct_fields parser into wrapped/record as appropriate (one field whose type is a collection → wrapped; several fields → record), keeping every current form working. Pin the new arms in the_classifier_reads_each_form — the test that exercises each classifier branch explicitly.

Out of scope

Converting any handler (T7). New envelope kinds.

Testing

A fixture handler in each typed form classifies identically to its json! twin; envelopes.json is unchanged in this PR (no handlers converted yet — a diff here means the classifier changed behaviour on existing code). make check.

Definition of done

Epic DoD, plus: the classifier reads both spellings of every envelope class; the pinning test covers the new arms; envelopes.json byte-identical.

Activity

  1. added
    rust
    mvp
    on Nov 8, 2026
  2. self-assigned this
    on Nov 9, 2026
  3. athvin commented on Nov 9, 2026

    @athvin
    OwnerAuthor

    Claimed — working in #1073 (draft). Closing that PR releases the claim. Continuing the API prerequisites in dependency order under the delegated selection authority.

  4. added 2 commits that reference this issue on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

mvprust

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions