app: founding bridge drops fields — Go json tags vs TS camelCase (S4 renders no options) #236

Closed
opened 2026-07-31 20:30:36 +00:00 by ben · 2 comments
Owner

Parent

Found during #183 Phase A (A1, first real drive of the founding wizard). Same QA thread as #230–#233.

What happened

Driving founding for real, three symptoms with one root cause:

  • P1-S4 ("where will it live") rendered zero access options — the journey dead-ends; A1 blocked.
  • Uploading a logo on P1-S3 changed nothing.
  • The S6 review would misreport the brand chips (logo/greeting always "unset").

The helper is fine — driven directly over its stdio contract it returns all four S4 options. The break is the wire contract: the helper's JSON speaks its Go tags (snake_case: access_options, pre_check, logo_source, can_accept_visitors, has_logo, greeting_set, ip_known) while the app's client reads and writes camelCase. Reads came back undefined and were swallowed by ?? []-style fallbacks (an empty options list instead of a loud failure); the logo param was sent under a name the helper doesn't read, so it silently dropped.

The TS client was only ever exercised against its own fake, which speaks the client's names — so every unit test passes while every real-bridge exchange loses fields. The live boot seam test spawns the real helper but only exercises boot/seat, so it couldn't see it either. This is the second #191-class drift found on first real launch (after #233).

What I expected

Every field the helper returns reaches the screen that renders it; every param the app sends reaches the orchestrator; a contract mismatch fails loud, never an empty screen.

Steps to reproduce

  1. Launch the production shell over the real helper and drive founding to P1-S4.
  2. The options list is empty (against the seam's "exactly four" contract); a logo upload on S3 leaves the draft logo-less.

Additional context

  • A local fix is applied on the operator laptop (uncommitted): the conversion is total and lives only at the transport boundary — the bridge client deep-maps response keys snake→camel and request params camel→snake. Keys without underscores, including the untagged capitalised Go fields (the Preview artifacts' Portal/SignIn/Content), pass through unchanged. All 386 app tests and the typecheck pass; verified against the real helper's captured payloads. This ticket is for landing it.
  • The durable guard is the real ask: extend the live boot seam test (which already spawns the real helper) to sweep every founding op and assert the mapped fields are non-null — so a Go tag or TS interface rename can never again ship as silently-empty UI. The stub-transport unit tests should also speak wire names, not client names.
## Parent Found during #183 Phase A (A1, first real drive of the founding wizard). Same QA thread as #230–#233. ## What happened Driving founding for real, three symptoms with one root cause: - P1-S4 ("where will it live") rendered **zero access options** — the journey dead-ends; A1 blocked. - Uploading a logo on P1-S3 changed nothing. - The S6 review would misreport the brand chips (logo/greeting always "unset"). The helper is fine — driven directly over its stdio contract it returns all four S4 options. The break is the wire contract: **the helper's JSON speaks its Go tags (snake_case: `access_options`, `pre_check`, `logo_source`, `can_accept_visitors`, `has_logo`, `greeting_set`, `ip_known`) while the app's client reads and writes camelCase**. Reads came back `undefined` and were swallowed by `?? []`-style fallbacks (an empty options list instead of a loud failure); the logo param was sent under a name the helper doesn't read, so it silently dropped. The TS client was only ever exercised against its own fake, which speaks the client's names — so every unit test passes while every real-bridge exchange loses fields. The live boot seam test spawns the real helper but only exercises boot/seat, so it couldn't see it either. This is the second #191-class drift found on first real launch (after #233). ## What I expected Every field the helper returns reaches the screen that renders it; every param the app sends reaches the orchestrator; a contract mismatch fails loud, never an empty screen. ## Steps to reproduce 1. Launch the production shell over the real helper and drive founding to P1-S4. 2. The options list is empty (against the seam's "exactly four" contract); a logo upload on S3 leaves the draft logo-less. ## Additional context - **A local fix is applied on the operator laptop** (uncommitted): the conversion is total and lives only at the transport boundary — the bridge client deep-maps response keys snake→camel and request params camel→snake. Keys without underscores, including the untagged capitalised Go fields (the Preview artifacts' `Portal`/`SignIn`/`Content`), pass through unchanged. All 386 app tests and the typecheck pass; verified against the real helper's captured payloads. This ticket is for landing it. - **The durable guard is the real ask**: extend the live boot seam test (which already spawns the real helper) to sweep every founding op and assert the mapped fields are non-null — so a Go tag or TS interface rename can never again ship as silently-empty UI. The stub-transport unit tests should also speak wire names, not client names.
Author
Owner

This was generated by AI during triage.

Triage

Category: bug · State: ready-for-agent

Verification: confirmed by inspection — the Go side (internal/founding/stdio.go, access.go, preview.go, internal/controlapi/settings.go) tags its founding-wire structs snake_case (access_options, pre_check, logo_source, can_accept_visitors, has_logo, greeting_set, ip_known), while app/src/lib/founding.ts declares and reads the matching TS fields camelCase (accessOptions, preCheck, logoSource, canAcceptVisitors, hasLogo, greetingSet, ipKnown) with no snake↔camel conversion anywhere in app/src. Matches the reported symptom exactly. No existing implementation, no prior .out-of-scope/ rejection.

Agent Brief

Category: bug
Summary: The founding bridge silently drops every field between the Go helper and the TS client — wire keys are snake_case, the client reads/writes camelCase, with no conversion layer.

Current behavior:
The helper's stdio JSON contract for founding speaks its Go struct tags verbatim (snake_case). The app's TypeScript client types and reads/writes camelCase field names against the same payloads. Every mismatched field comes back undefined on read and is swallowed by permissive fallbacks (e.g. an empty options array instead of a loud failure), and every mismatched field sent to the helper under the client's name is silently ignored by the helper. Concretely: P1-S4 renders zero access options, a logo uploaded on P1-S3 never reaches the draft, and S6's review misreports brand-chip state (logo/greeting always "unset"). Untagged, already-capitalised Go fields (e.g. the Preview artifacts' Portal/SignIn/Content) are unaffected since they have no underscores to convert. Unit tests don't catch this because the TS client is only ever exercised against its own fake, which already speaks the client's field names; the live boot seam test spawns the real helper but only exercises boot/seat, not the founding ops.

Desired behavior:
Every field the helper returns over the wire reaches the screen that renders it; every param the app sends reaches the orchestrator. The conversion between the helper's wire names and the client's names happens at the transport boundary (a single deep-mapping layer), not ad hoc at each call site. A contract mismatch that conversion can't resolve fails loud rather than silently producing an empty/undefined value.

Key interfaces:

  • The bridge/transport layer between the TS client (app/src/lib/founding.ts) and the real helper (stdio) — add a deep key-mapping step: response keys snake→camel, request params camel→snake. Keys with no underscores (including capitalised untagged Go fields) pass through unchanged.
  • The stub/fake transport used by existing unit tests should speak wire names (snake_case), not client names, so tests exercise the same conversion path production does.
  • The live boot seam test (which already spawns the real helper) should be extended to sweep the founding ops end-to-end and assert mapped fields are non-null — not just boot/seat.

Acceptance criteria:

  • Driving founding against the real helper: P1-S4 renders the full access-options list (the seam's "exactly four" contract), a P1-S3 logo upload reaches and persists in the draft, and S6 correctly reports logo/greeting state.
  • A single conversion layer at the transport boundary handles snake↔camel for all founding wire traffic — no per-field ad hoc mapping scattered through the client.
  • The stub-transport unit tests speak wire (snake_case) names, not client names.
  • The live boot seam test sweeps founding ops and asserts mapped response fields are non-null, so a future Go-tag/TS-interface rename fails the seam test instead of shipping as a silently empty screen.
  • All existing app tests and the typecheck continue to pass.

Out of scope:

  • Any wire contract outside founding's stdio ops (e.g. other helper surfaces), unless they share the same transport boundary and are trivially covered by the same conversion layer.
  • The theming/brand-token consumption gap (#237) — separate root cause.

Note: the reporter mentions a local, uncommitted fix already applied on their machine (a deep-mapping bridge client, verified against real captured payloads). That fix is not present in the repo — treat it as unavailable and implement independently; the approach it describes (transport-boundary deep-map, untouched for non-underscored keys) is a reasonable starting point, not a constraint.

> *This was generated by AI during triage.* ## Triage **Category:** bug · **State:** ready-for-agent **Verification:** confirmed by inspection — the Go side (`internal/founding/stdio.go`, `access.go`, `preview.go`, `internal/controlapi/settings.go`) tags its founding-wire structs snake_case (`access_options`, `pre_check`, `logo_source`, `can_accept_visitors`, `has_logo`, `greeting_set`, `ip_known`), while `app/src/lib/founding.ts` declares and reads the matching TS fields camelCase (`accessOptions`, `preCheck`, `logoSource`, `canAcceptVisitors`, `hasLogo`, `greetingSet`, `ipKnown`) with no snake↔camel conversion anywhere in `app/src`. Matches the reported symptom exactly. No existing implementation, no prior `.out-of-scope/` rejection. ## Agent Brief **Category:** bug **Summary:** The founding bridge silently drops every field between the Go helper and the TS client — wire keys are snake_case, the client reads/writes camelCase, with no conversion layer. **Current behavior:** The helper's stdio JSON contract for founding speaks its Go struct tags verbatim (snake_case). The app's TypeScript client types and reads/writes camelCase field names against the same payloads. Every mismatched field comes back `undefined` on read and is swallowed by permissive fallbacks (e.g. an empty options array instead of a loud failure), and every mismatched field sent to the helper under the client's name is silently ignored by the helper. Concretely: P1-S4 renders zero access options, a logo uploaded on P1-S3 never reaches the draft, and S6's review misreports brand-chip state (logo/greeting always "unset"). Untagged, already-capitalised Go fields (e.g. the Preview artifacts' `Portal`/`SignIn`/`Content`) are unaffected since they have no underscores to convert. Unit tests don't catch this because the TS client is only ever exercised against its own fake, which already speaks the client's field names; the live boot seam test spawns the real helper but only exercises boot/seat, not the founding ops. **Desired behavior:** Every field the helper returns over the wire reaches the screen that renders it; every param the app sends reaches the orchestrator. The conversion between the helper's wire names and the client's names happens at the transport boundary (a single deep-mapping layer), not ad hoc at each call site. A contract mismatch that conversion can't resolve fails loud rather than silently producing an empty/undefined value. **Key interfaces:** - The bridge/transport layer between the TS client (`app/src/lib/founding.ts`) and the real helper (stdio) — add a deep key-mapping step: response keys snake→camel, request params camel→snake. Keys with no underscores (including capitalised untagged Go fields) pass through unchanged. - The stub/fake transport used by existing unit tests should speak wire names (snake_case), not client names, so tests exercise the same conversion path production does. - The live boot seam test (which already spawns the real helper) should be extended to sweep the founding ops end-to-end and assert mapped fields are non-null — not just boot/seat. **Acceptance criteria:** - [ ] Driving founding against the real helper: P1-S4 renders the full access-options list (the seam's "exactly four" contract), a P1-S3 logo upload reaches and persists in the draft, and S6 correctly reports logo/greeting state. - [ ] A single conversion layer at the transport boundary handles snake↔camel for all founding wire traffic — no per-field ad hoc mapping scattered through the client. - [ ] The stub-transport unit tests speak wire (snake_case) names, not client names. - [ ] The live boot seam test sweeps founding ops and asserts mapped response fields are non-null, so a future Go-tag/TS-interface rename fails the seam test instead of shipping as a silently empty screen. - [ ] All existing app tests and the typecheck continue to pass. **Out of scope:** - Any wire contract outside founding's stdio ops (e.g. other helper surfaces), unless they share the same transport boundary and are trivially covered by the same conversion layer. - The theming/brand-token consumption gap (#237) — separate root cause. **Note:** the reporter mentions a local, uncommitted fix already applied on their machine (a deep-mapping bridge client, verified against real captured payloads). That fix is not present in the repo — treat it as unavailable and implement independently; the approach it describes (transport-boundary deep-map, untouched for non-underscored keys) is a reasonable starting point, not a constraint.
Author
Owner

Fixed in dbc4cec (on main).

Root cause: the found stdio bridge marshals its Go tags verbatim (snake_case) while the app's FoundingClient, its types, and every wizard screen speak camelCase, with no conversion in app/src — so access_options/pre_check/logo_source/has_logo/greeting_set/ip_known/can_accept_visitors all read back undefined (swallowed by ?? [] fallbacks) and mismatched params were dropped.

Fix — one conversion layer at the transport boundary:

  • app/src/lib/wireMapping.ts — snakeToCamel/camelToSnake/deepMapKeys: the mechanical rule. Single-word and untagged PascalCase keys (Portal/SignIn/Content/Severity) pass through unchanged; values (incl. base64 bytes) are never rewritten.
  • app/src/lib/founding.ts — wireMappedFoundingTransport wraps the raw transport: request deep-mapped camel→snake, response snake→camel, once per payload. ProbeReport/SpecFloor/Standup.gatewayIp camelised so the rule is uniform across the whole founding surface, not just the 7 drifted soft-phase fields.
  • app/src/bootstrap.ts — the production BridgeFoundingClient composes over the wrapper.

Durable guards (the real ask):

  • app/tests/unit/boot.test.ts now sweeps offered→begin→start→save-details→save-brand-kit(logo+greeting)→access-options→preview→review over the real production helper and asserts the four options render, the logo persists in the draft, and S6 reports logo/greeting truthfully — a Go-tag/TS-interface rename now fails the seam test instead of shipping a silently-empty screen.
  • app/tests/unit/founding.test.ts stub-transport tests now speak wire (snake_case) names through the same wrapper production drives.
  • app/tests/unit/wireMapping.test.ts — offline coverage of the conversion rule.

All 400 app tests + vue-tsc typecheck pass (was 386; +14 new). No dependency changes. STATUS.md updated in the same commit.

Fixed in dbc4cec (on `main`). **Root cause:** the `found` stdio bridge marshals its Go tags verbatim (snake_case) while the app's `FoundingClient`, its types, and every wizard screen speak camelCase, with no conversion in `app/src` — so `access_options`/`pre_check`/`logo_source`/`has_logo`/`greeting_set`/`ip_known`/`can_accept_visitors` all read back `undefined` (swallowed by `?? []` fallbacks) and mismatched params were dropped. **Fix — one conversion layer at the transport boundary:** - `app/src/lib/wireMapping.ts` — `snakeToCamel`/`camelToSnake`/`deepMapKeys`: the mechanical rule. Single-word and untagged PascalCase keys (`Portal`/`SignIn`/`Content`/`Severity`) pass through unchanged; values (incl. base64 bytes) are never rewritten. - `app/src/lib/founding.ts` — `wireMappedFoundingTransport` wraps the raw transport: request deep-mapped camel→snake, response snake→camel, once per payload. `ProbeReport`/`SpecFloor`/`Standup.gatewayIp` camelised so the rule is uniform across the whole founding surface, not just the 7 drifted soft-phase fields. - `app/src/bootstrap.ts` — the production `BridgeFoundingClient` composes over the wrapper. **Durable guards (the real ask):** - `app/tests/unit/boot.test.ts` now sweeps offered→begin→start→save-details→save-brand-kit(logo+greeting)→access-options→preview→review over the **real production helper** and asserts the four options render, the logo persists in the draft, and S6 reports logo/greeting truthfully — a Go-tag/TS-interface rename now fails the seam test instead of shipping a silently-empty screen. - `app/tests/unit/founding.test.ts` stub-transport tests now speak wire (snake_case) names through the same wrapper production drives. - `app/tests/unit/wireMapping.test.ts` — offline coverage of the conversion rule. All 400 app tests + `vue-tsc` typecheck pass (was 386; +14 new). No dependency changes. `STATUS.md` updated in the same commit.
ben closed this issue 2026-07-31 21:07:49 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#236
No description provided.