Repository navigation
fixtures: TASK-25239 keep the feature report mirror in step with api#2208 - #4199
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
/chip review |
There was a problem hiding this comment.
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 reviewto 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.
|
/chip review |
There was a problem hiding this comment.
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 reviewto 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 asfeature-activation-bank-readyandcard-address-requiredspecify onlybankorcardundercapabilities.features.fixtureResponddeep-merges that patch into the demo user, but this return then replaces the complete report with the partial patch. The resulting/users/meomits requiredqr,local, orcardentries; consumers such asrouteFromCapabilitiesreadfeatures.card.stateandfeatures.qrwithout 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 } } |
There was a problem hiding this comment.
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.
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:localanswers from the resident's own account (ARS for Argentina) and keeps that account's step.readyentry always names its step:activate, orenrollwhere activate does not open the feature.identity_approval_endedis not a candidate; the identity refusal and itsidentitystep answer.The demo user's written-out report (
src/constants/demo-data.ts) gains theenrollstep on itsreadyentries, 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 newenrollsteps leaked into a fixture that set the same accounts on.How the app renders the API change (checked, no change needed)
readywithenroll:gateFromEntrymapsreadytoneeds-enrollmentwithout reading the action, so theenrollremedy and the QR unlock run as before.bankrefusedidentity_rejectedwithidentity:blocked-rejectionwithbyIdentity, instead of the residence copy.localrefusedmanteca_account_rejected, or withcontact-supportoridentity: the Manteca add-money screen already handles each (MantecaAccountUnavailable, support,KycFailedModal). The Accounts drawer readslocal.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 (
readyignores its action).QA
tests.ymlrun 44908259781 green (22,806 unit tests).Screenshots: N/A (no visible change).