From f3cce1d42f8e341a38b28d4a6a207fd96b5a3efe Mon Sep 17 00:00:00 2001 From: Arthur Breton Date: Sat, 7 Nov 2026 09:26:12 +0800 Subject: [PATCH] docs(perps): regenerate review rules from 85ab3b95 --- .../skills/perps-review-pr/references/review-sources.json | 4 ++-- domains/perps/skills/perps-review-pr/references/shared.md | 4 ++-- domains/perps/skills/perps-review-pr/skill.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/domains/perps/skills/perps-review-pr/references/review-sources.json b/domains/perps/skills/perps-review-pr/references/review-sources.json index e085c94c..1e2b6a2b 100644 --- a/domains/perps/skills/perps-review-pr/references/review-sources.json +++ b/domains/perps/skills/perps-review-pr/references/review-sources.json @@ -1,8 +1,8 @@ { "repository": "MetaMask/experimental-metamask-recipe-perps", - "revision": "32965a3a6676ad7d65ebb165a88491367647a453", + "revision": "85ab3b95f228eff750055ae1df5b0d052b5a87aa", "files": { - "review/antipatterns.md": "437ae50e15329ebf4070f4443207a9fc75ab568ce62a5e7f8abd8b99e8a92bea", + "review/antipatterns.md": "219ad195518a9ac1a7836886b24aa2078c17e7bc2e1fc79bf0e03da0e1a5c63e", "review/antipatterns.mobile.md": "6a3c2bb3d2ff6c3d86cca0272c51e7443c79a81e12b1fd2d5770d1b473285b6a", "review/antipatterns.extension.md": "bc4179be1d56ced4979573ecb246943b211a85dac382c61955d2c97ab8f6f652", "review/antipatterns.core.md": "700457a01b9ab99265a314d1f2452fe6a388094ce9ccdda4ca2a4db210aff7ba", diff --git a/domains/perps/skills/perps-review-pr/references/shared.md b/domains/perps/skills/perps-review-pr/references/shared.md index fb013afa..1a797156 100644 --- a/domains/perps/skills/perps-review-pr/references/shared.md +++ b/domains/perps/skills/perps-review-pr/references/shared.md @@ -58,7 +58,7 @@ Constants live in the controller package (`core/packages/perps-controller/src/co ## Protocol Abstraction -- [ ] **Execution identity inferred from display fields**: Preserve the venue's documented identity at the provider boundary and expose a stable opaque ID shared by REST and WebSocket paths. Equal order ID, time, size and price need not identify one fill. Do not deduplicate without that guarantee or key navigable history by array position. Check prepend stability and tied timestamps. Equality checks that suppress a snapshot or stream update must include the stable entity ID and every field a consumer reads (trigger price, order type, reduce-only). A valid empty snapshot replaces the cache. Test an ID-only replacement, a trigger-only change and populated-to-empty. +- [ ] **Execution identity inferred from display fields**: Preserve the venue's documented identity at the provider boundary and expose a stable opaque ID shared by REST and WebSocket paths. Equal order ID, time, size and price need not identify one fill. Do not deduplicate without that guarantee or key navigable history by array position. Check prepend stability and tied timestamps. Equality checks that suppress a snapshot or stream update must include the stable entity ID and every field a consumer reads (trigger price, order type, reduce-only). A valid empty snapshot replaces the cache; an unavailable nullish response must not clear or confirm seeded state. Test null, undefined, empty and subsequent live data, plus ID-only and trigger-only changes. - [ ] **Entity ownership lost in transit**: Carry the entity's `providerId`, and any requested `accountId` or network, through transforms, fill aggregation, mutation params, batch partitioning, follow-up writes (edit, cancel, post-open TP/SL), cache keys and subscription params. Never fall back to the default provider or selected account when the entity names its owner. Apply provider-specific classification at the normalization boundary. Test two providers with a colliding symbol or order ID, and an explicit non-selected account. @@ -135,7 +135,7 @@ Controller → Redux → Hooks → Components. Standalone mode for lightweight q - [ ] **Direct controller call from component** — components calling `PerpsController.method()` directly instead of going through hooks (`usePerpsTrading`, `usePerpsAccount`, etc.). - [ ] **Missing `accountState` check** — accessing positions/orders/balances without verifying accountState is loaded. Causes undefined errors on first load or account switch. -- [ ] **Derived flag promoted to structural state without its own lifecycle** — define initialization, every set condition, and every clear condition independently of the old string or transient value that first produced the flag. Test both set and clear paths. +- [ ] **Derived flag promoted to structural state without its own lifecycle** — define initialization, every set condition, and every clear condition independently of the old string or transient value that first produced the flag. Pending trading prerequisites belong to the shared operation lifetime, so a form remount cannot re-enable submission before setup settles. Test set, clear and remount with setup still pending. - [ ] **Async flow loses ownership of cleanup** — fire-and-forget timers and navigation listeners need a generation guard plus `dispose()` on retry, unmount, and failure. Treat nested confirmation routes as part of the same flow so cleanup does not fire while the user is still inside it. A lookup added before startup, unlock or deeplink navigation needs a short explicit deadline that falls back to the prior offline result; test with the request held pending. - [ ] **One in-flight mutation lock replaces earlier accepted outcomes** — serialize active requests separately from post-success reconciliation. Keep each accepted result keyed by provider and stable entity ID until an authoritative read or stream confirms it; clear the set when account, provider, network, or connection generation changes. Test sequential successes followed by a partial terminal update. - [ ] **Preload data not seeded** — new hook not using `getPreloadedData()` lazy initializer. First render shows skeleton instead of cached data from the 5-minute preload cycle. diff --git a/domains/perps/skills/perps-review-pr/skill.md b/domains/perps/skills/perps-review-pr/skill.md index 8b2ca2b9..5b4bd24f 100644 --- a/domains/perps/skills/perps-review-pr/skill.md +++ b/domains/perps/skills/perps-review-pr/skill.md @@ -7,7 +7,7 @@ maturity: stable # Perps static review -Generated from the canonical Perps review rules @ 32965a3a6676ad7d65ebb165a88491367647a453. Do not hand-edit: regenerate with scripts/materialize-review.mjs. references/review-sources.json records the source repository and every digest. +Generated from the canonical Perps review rules @ 85ab3b95f228eff750055ae1df5b0d052b5a87aa. Do not hand-edit: regenerate with scripts/materialize-review.mjs. references/review-sources.json records the source repository and every digest. Run only on explicit invocation by name or an explicitly selected workflow. Review source, diff and recorded evidence only: no tests, builds, recipes, installs, probes, app launch, product change, publish or workspace cleanup. Delegated skills inherit this static, read-only boundary. The criteria below are review criteria, not instructions to perform the fixes, releases or migrations they describe.