Admin report: Trade matches (mutual ISO/UFT pairs) #235
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.50) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 434 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.363
Shallow Review Depth
shallow_review_depth
0.289
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #235"
general
weight: 0.35
cursor[bot]
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Summary
Adds a Trade matches entry to the admin Reports registry (
/admin/reports/trade-matches). The report lists every mutual trade pair site-wide using the same matching engine as the signed-in Matches page (buildMatchesForCallerinfunctions/matches.js).What the report shows
- Matched SKU count — distinct SKUs appearing in either direction’s trade piles across enabled lanes
- Items left → right and items right → left — pile entries (SKU, optional
iso/uftflags) the matcher would surfaceconfig/adminReports.isoReportExcludedUids(same list as the Global ISO report); excluded accounts never appear on either side. Matching opt-outs are also suppressed.Data layer
getAdminTradeMatchesReport—assertSiteAdmin/ admin custom claim only (same gate aslistAdminCollectors)collectionsscan,userPreferenceswherematchingOptOut == true, batched prefs for collectors with collection data, andconfig/adminReportsfor exclusionstruncated: truewhen more existMetrics not tracked yet
None — all displayed fields are derived from existing collection
tradeFlag/quantitydata anduserPreferencesmatch settings. No PostHog or separate analytics feed is used for this report.Tests
functions/adminTradeMatchesReport.test.js— pair dedupe, ISO exclusion list, admin gatefrontend/src/pages/Admin/reports/filterAdminTradeMatchPairs.test.jsfrontend/src/pages/Admin/reports/useAdminTradeMatchesReport.test.jsfrontend/src/pages/Admin/reports/TradeMatchesReport.test.jsxSetup / deploy checklist
| Step | Required? |
|------|-----------|
| Cloud Functions deploy (
getAdminTradeMatchesReport) | Yes — report will 404/fail until deployed || Firestore rules | No change |
| Firestore indexes | No change |
| Hosting-only deploy | Not sufficient (callable lives in Functions) |
|
config/adminReports| Uses existing doc; exclusions managed on ISO report |<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a href="https://cursor.com/agents/bc-232735fc-c275-5825-ac11-326b5f5dc36d?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-232735fc-c275-5825-ac11-326b5f5dc36d&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>