Skip to content

feat(children-v2): v2.1 enabler — MRF-default + answerObject v4 (2/3, stacks on #9686)#9687

Open
tutntut wants to merge 3 commits into
children-v2-corefrom
children-v2-mrf-v4
Open

feat(children-v2): v2.1 enabler — MRF-default + answerObject v4 (2/3, stacks on #9686)#9687
tutntut wants to merge 3 commits into
children-v2-corefrom
children-v2-mrf-v4

Conversation

@tutntut

@tutntut tutntut commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What this is

Part 2 of 3 of the MyInfo Children v2 split (#9678). This is the v2.1 platform enabler. It stacks on PR-A (#9686) — review/merge that first; this PR's diff is only the incremental v2.1 changes.

⚠️ Base branch is children-v2-core (PR-A), not develop.

What's in this PR

Two enablers that prepare MyInfo Children v2 for the unified-modes / answerObject-v4 world. Both are built but stay dark until storage-mode v4 and MRF-with-webhook land (Converge Storage & MRF Modes).

1. v2 is the default for children in Multi-respondent forms

MRF / unified modes is the definitive home for the children field, so a children field added to a Multi-respondent form is v2 by default — no children-v2 flag needed (the flag continues to gate v2 only in Storage/Encrypt mode). createFormField / updateFormField add the responseMode === Multirespondent term; the builder reintroduces isChildrenV2InBuilder (version === V2 or MRF) and canAddChildrenField now offers the field in MRF too.

2. answerObject v4 children shape

adaptV3ToV4 now emits the v2 children shape — single child, no child-N numbering, optional per-child type threaded from childrenTypes. Wired at the SDK adapter so it flips on automatically when storage-mode v4 is enabled; v2 itself still ships end-to-end through the existing V3 path in PR-A.

Anything breaking? No.

Backwards compatible. The MRF-default path is gated behind the existing betaFlags.children whitelist (which must stay tight until the MRF submission path is fully wired). The v4 adapter shape only activates when storage-mode v4 is enabled.

Note: the MRF submission path (picker dedup + per-child type + v4 storage + step assignment + response type column) is still WIP — see #9678's notes. Keep betaFlags.children a tight whitelist until that lands.

Tests

TC1: MRF default (builder)

  • Adding a children field to a Multi-respondent form creates it as version 2 with no children-v2 flag (behind the betaFlags.children whitelist).
  • In a Multi-respondent form the v2 builder hides Secondary Race + Allow-Multiple and shows the v2 description immediately (before save).

TC2: Storage-mode unchanged

  • In Storage/Encrypt mode, v1 vs v2 is still governed only by the children-v2 flag (this PR doesn't change that path).

TC3: v4 adapter shape

  • adaptV3ToV4 on a v2 children answer yields a single child, no child-N numbering, and a per-child type when childrenTypes is present (covered by the SDK spec).

🤖 Assembled by Claude Code (part 2 of the #9678 split). Verified locally via type-check across backend/frontend/sdk + lint; backend Jest / frontend vitest run on CI (native-module mismatch blocks them in the authoring sandbox).

tutntut and others added 2 commits June 30, 2026 14:42
MRF/unified-modes is the definitive home for the children field, so a children field in a Multi-respondent form is v2 by default — no children-v2 flag needed. createFormField/updateFormField add the `responseMode === Multirespondent` term; the builder reintroduces isChildrenV2InBuilder (version OR MRF) and canAddChildrenField offers the field in MRF too. (ADR-0001)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
adaptV3ToV4 produces the v2 children answer shape (single child, no child-N numbering, optional per-child `type` threaded from childrenTypes). Wired at the SDK adapter so it flips on automatically when storage-mode v4 lands; v2 itself still ships end-to-end through the existing V3 path. (ADR-0001)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tutntut tutntut requested a review from a team as a code owner June 30, 2026 14:43
@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

…mmetry

Review follow-up:
- Cite ADR-0001 (not the not-yet-present ADR-0002) in the v2-invariant
  comments (createFormField, updateFormField, enforceChildrenV2Invariants,
  EditMyInfoChildren) — the dropped-options/version decisions are ADR-0001.
- Document why the v2 test differs between create (ignores payload version so
  the flag/MRF stays the authoritative gate) and update (trusts the stamped
  version, never re-derives from the flag).
- Note in adaptV4ToV3 that per-child `type` is intentionally not reconstructed
  (v3 has no slot; reverse path is decrypt-only) — flags the one-way seam.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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