app: founding bridge drops fields — Go json tags vs TS camelCase (S4 renders no options) #236
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#236
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
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 backundefinedand 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
Additional context
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.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), whileapp/src/lib/founding.tsdeclares and reads the matching TS fields camelCase (accessOptions,preCheck,logoSource,canAcceptVisitors,hasLogo,greetingSet,ipKnown) with no snake↔camel conversion anywhere inapp/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
undefinedon 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:
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.Acceptance criteria:
Out of scope:
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.
Fixed in
dbc4cec(onmain).Root cause: the
foundstdio bridge marshals its Go tags verbatim (snake_case) while the app'sFoundingClient, its types, and every wizard screen speak camelCase, with no conversion inapp/src— soaccess_options/pre_check/logo_source/has_logo/greeting_set/ip_known/can_accept_visitorsall read backundefined(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—wireMappedFoundingTransportwraps the raw transport: request deep-mapped camel→snake, response snake→camel, once per payload.ProbeReport/SpecFloor/Standup.gatewayIpcamelised so the rule is uniform across the whole founding surface, not just the 7 drifted soft-phase fields.app/src/bootstrap.ts— the productionBridgeFoundingClientcomposes over the wrapper.Durable guards (the real ask):
app/tests/unit/boot.test.tsnow 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.tsstub-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-tsctypecheck pass (was 386; +14 new). No dependency changes.STATUS.mdupdated in the same commit.