Skip to content

fixtures: TASK-25239 keep the feature report mirror in step with api#2208 - #4199

Merged
Hugo0 merged 3 commits into
feat/state-machine-hardeningfrom
fix/cohort-matrix-dead-ends
Nov 21, 2026
Merged

Hugo0 merged 3 commits into
feat/state-machine-hardeningfrom
fix/cohort-matrix-dead-ends

Conversation

@Hugo0

@Hugo0 Hugo0 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Pairs with peanutprotocol/peanut-api-ts#2208, which fixes the user dead ends the cohort matrix found. The app needs no screen change: it already renders those answers. This PR only keeps the hand-kept fixture mirror of the API's feature report (src/dev/fixtures/featureReport.ts) in step, so fixture-driven tests and dev surfaces get the answers the API now sends:

  • local answers from the resident's own account (ARS for Argentina) and keeps that account's step.
  • A ready entry always names its step: activate, or enroll where activate does not open the feature.
  • A Bridge rail blocked with identity_approval_ended is not a candidate; the identity refusal and its identity step answer.

The demo user's written-out report (src/constants/demo-data.ts) gains the enroll step on its ready entries, so it stays equal to the mirror (a test checks that). Demo mode renders the same.

An explicit fixture report (responses['GET /users/me'].capabilities.features) now replaces the demo report instead of merging into it entry by entry. Merged, the demo's new enroll steps leaked into a fixture that set the same accounts on.

How the app renders the API change (checked, no change needed)

  • ready with enroll: gateFromEntry maps ready to needs-enrollment without reading the action, so the enroll remedy and the QR unlock run as before.
  • bank refused identity_rejected with identity: blocked-rejection with byIdentity, instead of the residence copy.
  • local refused manteca_account_rejected, or with contact-support or identity: the Manteca add-money screen already handles each (MantecaAccountUnavailable, support, KycFailedModal). The Accounts drawer reads local.accounts.ARS, which was already right.

Task

TASK-25239: https://www.notion.so/41f8381175798159af5cd22758b53aeb

Risks

Fixtures, demo data and tests only. The demo data change does not alter what demo mode shows (ready ignores its action).

QA

tests.yml run 44908259781 green (22,806 unit tests).

Screenshots: N/A (no visible change).

The API's feature report now answers local from the resident's own account
with its step, names the step on every ready entry (activate or enroll), and
lets the identity refusal answer for Bridge rails closed by an ended approval.
Fixture-driven tests read the same answers the API sends.
@notion-workspace

Copy link
Copy Markdown

@vercel

vercel Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
peanut-wallet Ready Ready Preview Nov 21, 2026 1:26pm UTC

Request Review

@Hugo0

Hugo0 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

/chip review

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — INCOMPLETE · no blocking findings — this is not an approval

⚠️ This review is incomplete. The third opinion (product truth, tests, contract) did not run — claude-api_error (after a retry; first: claude-api_error). The copy check did not run — claude-api_error (after a retry; first: claude-api_error). Its questions are unanswered, not answered clean. Comment /chip review to run it again.

No actionable findings in the fixture and demo-report changes.

Checked clean

  • Confirmed exact head and merge base; reviewed both changed files and their surrounding report logic.
  • Checked ready/enroll and identity-refusal rendering through the existing capability gate.
  • Checked the local-account refusal selection and action propagation against the fixture inputs.
  • CI at this head was still in progress at review time; completed checks observed were successful or skipped.

Security review: did not run — this change has no security, privacy or money surface, so it was not asked. This review is one reviewer short.

Third opinion: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.

Copy check: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.

Exact head: fd2b39192926 · Context: repo · Took 1m

… of merging into it

Merged entry by entry, the demo report's enroll steps leaked into a fixture
that set the same accounts on.
@Hugo0

Hugo0 commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

/chip review

@chip-peanut-bot chip-peanut-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chip review — INCOMPLETE · no blocking findings — this is not an approval

⚠️ This review is incomplete. The third opinion (product truth, tests, contract) did not run — claude-api_error (after a retry; first: claude-api_error). The copy check did not run — claude-api_error (after a retry; first: claude-api_error). Its questions are unanswered, not answered clean. Comment /chip review to run it again.

One fixture regression: partial report overrides now produce incomplete /users/me reports.

Findings

  • MAJOR · src/dev/fixtures/featureReport.ts:520 · Partial fixture reports drop the other features
    Existing named fixtures such as feature-activation-bank-ready and card-address-required specify only bank or card under capabilities.features. fixtureRespond deep-merges that patch into the demo user, but this return then replaces the complete report with the partial patch. The resulting /users/me omits required qr, local, or card entries; consumers such as routeFromCapabilities read features.card.state and features.qr without guarding for missing entries, so a fixture can fail for an unrelated missing feature. Build a complete fixture-derived report before applying the explicit feature patch, or make every existing explicit fixture supply the full report.

Checked clean

  • Confirmed exact head and merge base; reviewed the new commit and the full PR diff.
  • Traced explicit report overrides through fixtureRespond and existing partial named fixtures.
  • Rechecked ready/enroll, identity refusal, and local-account selection from the prior clean review; no new issue found there.
  • CI at this head was still in progress; completed checks observed were successful or skipped.

Security review: did not run — this change has no security, privacy or money surface, so it was not asked. This review is one reviewer short.

Third opinion: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.

Copy check: did not run — claude-api_error (after a retry; first: claude-api_error). This review is one reviewer short.

Exact head: e23dccc8ca13 · Context: repo · Took 2m

if (!user?.capabilities) return user
// An explicit report is the whole answer: merged over the demo report, it would keep the demo's steps.
const explicit = override?.capabilities?.features
if (explicit !== undefined) return { ...user, capabilities: { ...user.capabilities, features: explicit } }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAJOR: Partial fixture reports drop the other features

Existing named fixtures such as feature-activation-bank-ready and card-address-required specify only bank or card under capabilities.features. fixtureRespond deep-merges that patch into the demo user, but this return then replaces the complete report with the partial patch. The resulting /users/me omits required qr, local, or card entries; consumers such as routeFromCapabilities read features.card.state and features.qr without guarding for missing entries, so a fixture can fail for an unrelated missing feature. Build a complete fixture-derived report before applying the explicit feature patch, or make every existing explicit fixture supply the full report.

@Hugo0
Hugo0 marked this pull request as ready for review November 21, 2026 13:34
@Hugo0
Hugo0 merged commit fda8a6a into feat/state-machine-hardening Nov 21, 2026
25 of 28 checks passed

This branch was successfully deployed

1 active deployment
Preview — e23dccc8 Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet