Disjoint held-out setup. 10 synthetic catalog discrepancy records in two cohorts. Positive (3: CAT-001 through CAT-003): current authenticated merchant, valid store/workspace, active variant revision, discrepancy between platform catalog and POS/feed data, exception intake queue available, no pending duplicate for same variant revision. Negative (7: CAT-004 through CAT-010): expired merchant session, wrong tenant (merchant B reporting merchant A catalog), wrong role (analyst attempting intake-only action), variant revision stale, discrepancy already resolved, intake queue suspended, cross-tenant SKU collision attempt. Held-out excludes revocation (CAT-R101), restore (CAT-R201), dropped-response recovery (CAT-R301) and stale (rt_R_STALE_901). Training/tuning disjoint. All hypothetical.
Allowed workflow (rt_1, operation A). Fixture CAT-001: merchant MER-8800 authenticates for workspace WS-5501. Store STR-6601 with active catalog. Variant VAR-9901 at revision REV-V1 shows price $24.99 in platform; POS feed shows $22.99. Merchant submits catalog discrepancy exception with key op:rt_A_001 scoped to merchant MER-8800/workspace WS-5501/store STR-6601/variant VAR-9901/REV-V1/session SES-RT-001. Exception coordinator independently reads: (a) MER-8800 authenticated for WS-5501; (b) STR-6601 active in WS-5501; (c) VAR-9901 at REV-V1 current; (d) discrepancy verified between platform and feed; (e) intake queue available; (f) no pending exception for same variant/revision. Approves. Exception processor (authorized executor) records exception in merchant's discrepancy queue. Expected business receipt: exception intake receipt at catalog authority with reference DISC-REF-8801 (read independently, confirm present). Exception receipt is distinct from POS price write, inventory adjustment or catalog publish. Evidence: exception log at audit authority (read independently, confirm present for op:rt_A_001). Acceptance target: 3 of 3 positive records produce confirmed exception intake receipts.
Cross-tenant SKU collision test. Merchant B (WS-5502) uses same SKU identifier "PROD-XYZ-001" as merchant A (WS-5501). Workspace isolation ensures no collision: each workspace maintains independent catalogs. Merchant B exception referencing "PROD-XYZ-001" resolves to WS-5502 catalog only. Cross-workspace access denied.
Stale feed versus live authoritative record. If POS feed data is timestamped older than platform's authoritative catalog revision: exception flagged as stale-feed discrepancy for merchant review. If platform catalog revision is older than POS: exception flagged as platform-stale for catalog refresh.
Replay of A. Key op:rt_A_001 already committed at catalog authority. Exact replay with identical key and complete original payload (merchant MER-8800, workspace WS-5501, store STR-6601, variant VAR-9901 at REV-V1) by still-authorized original requester MER-8800 within exact workspace WS-5501 scope: system returns only A's existing non-secret receipt DISC-REF-8801 and current exception status. 0 new exception intakes. 0 duplicates. Changed payload or different principal/workspace scope: held or rejected.
Independently approved B (rt_1b, operation B). Fixture CAT-002: different merchant MER-8801, workspace WS-5502, store STR-6602, variant VAR-9902, key op:rt_B_002. Independently approved. Expected receipt: DISC-REF-8802. From three submissions: 2 new exception intake receipts, 0 from replay.
Webhook verification tests. (1) Raw-body tamper: webhook with valid X-Shopify-Hmac-SHA256 for original body but body modified after signing; HMAC recomputed against received raw bytes does not match header; rejected before parsing, no catalog or exception effect. (2) Exact duplicate delivery: webhook with same X-Shopify-Webhook-Id as a previously processed delivery; deduplicated, returns acknowledgment, 0 new exception intakes, no catalog/stock/price change. (3) Valid distinct older event: webhook with different X-Shopify-Webhook-Id, valid HMAC, but X-Shopify-Event-Id grouping an older merchant action; accepted, but platform reads authoritative current store/item revision from catalog authority before applying; if current revision is newer, event is logged without downgrade; no catalog/stock/price change from stale event.
Denied: wrong tenant (rt_2a). CAT-004: merchant B reporting merchant A discrepancy. 0 cross-tenant exceptions. Denied: wrong role (rt_2b). CAT-005: analyst attempting intake action. Denied: stale revision (rt_2c). CAT-006: variant revision stale (REV-V1 submitted, current REV-V2). Denied: already resolved (rt_2d). CAT-007: discrepancy already resolved. Denied: queue suspended (rt_2e). CAT-008: intake queue suspended for workspace. Denied: expired session (rt_2f). CAT-009: merchant session expired. Denied: cross-tenant SKU (rt_2g). CAT-010: cross-tenant SKU collision attempt explicitly denied.
Revocation (rt_4, CAT-R101). Fixture CAT-R101 with stable key op:rt_R_101: merchant MER-8800 queues discrepancy exception for workspace WS-5501/store STR-6601/variant VAR-9903 at REV-V1 while store active. Before first send, async worker detects STR-6601 deactivated in workspace at store record v2 and parks submission. On retry of the same queued key op:rt_R_101 and payload, worker re-checks store version, confirms v2 (deactivated) still current, and blocks; submission remains parked. Read catalog authority before: DISC-REF-8801 (op:rt_A_001) present, DISC-REF-8802 (op:rt_B_002) present, no receipt for op:rt_R_101. If the stale queued submission reaches the backend, authority reads store v2 (deactivated) and rejects; no receipt, no stock or price change effect. Read after: unchanged, no receipt for op:rt_R_101. If pending or in-flight: HOLD for retail operations manager. Cross-tenant negative fixture: async cache worker receives request with workspace ID WS-5501 originating from WS-5502 context; worker validates workspace binding before fetch, denies read of WS-5501 catalog/pricing, denies write to WS-5502 cache; no exception receipt, no data exposure, no stock or price change. Forged write to foreign target: WS-5502 context submits job attempting to mutate a catalog price record in WS-5501 catalog authority; worker validates workspace binding before execution, denies the write; WS-5501 catalog, pricing, exception receipts and audit unchanged. 0 exceptions for deactivated stores.
Dropped response recovery (rt_4b, CAT-R301). Distinct fixture: merchant MER-8802 submits exception CAT-R301 for workspace WS-5503/store STR-6603/variant VAR-9904 at REV-V1 (platform $29.99 vs POS feed $26.99) with key op:rt_R_301, session SES-RT-003, response dropped. Independently read: (1) MER-8802 authenticated for WS-5503; (2) STR-6603 active; (3) VAR-9904 at REV-V1 current; (4) discrepancy verified; (5) intake queue available; (6) durable log for op:rt_R_301; (7) catalog authority receipt under op:rt_R_301; (8) audit for op:rt_R_301; (9) pending/in-flight; (10) any downstream stock or price change. First guard: if any read unknown, unavailable, contradictory, or pending/in-flight: HOLD for retail operations manager; no resend, no write, no stock or price change. Applied: log+receipt+audit consistent, no pending/in-flight: complete. Disagree: receipt present but records inconsistent: HOLD read-only reconciliation. Committed but absent: HOLD. Conclusively uncommitted: session SES-RT-003 confirmed current and bound to MER-8802, STR-6603 active, VAR-9904 at REV-V1 current; complete absence confirmed: no durable log, no catalog authority receipt, no audit record, no pending/in-flight, no downstream stock or price change for op:rt_R_301; exception coordinator freshly scoped approves; exception processor resubmits same key op:rt_R_301 with same payload. No automatic retry. 0 duplicates. 0 POS price writes, inventory adjustments or catalog publishes from recovery.
Staged restore (rt_5, CAT-R201). Stage privately with no production exception submissions or key writes. Read existing A/B keys and receipts: op:rt_A_001 → DISC-REF-8801, op:rt_B_002 → DISC-REF-8802. Read R101 key op:rt_R_101: no receipt (denied, store deactivated v2). Read R201 key op:rt_R_201: absent before restore. Independently read catalog authority, audit and pending/in-flight/downstream state (including stock and price changes) before restoring verified snapshot. After staging, re-read: op:rt_A_001 → DISC-REF-8801 (unchanged), op:rt_B_002 → DISC-REF-8802 (unchanged), op:rt_R_101 → no receipt (confirmed denied), op:rt_R_201 → absent, pending/in-flight clear, no new stock or price effects. Planned test: compare authoritative operation log and audit records for op:rt_A_001, op:rt_B_002, op:rt_R_101 and op:rt_R_201 before and after private staging: A/B operation markers and audit entries unchanged, R101 denial evidence preserved in audit, R201 has no operation record or audit entry, pending/in-flight and downstream controls unchanged. Newer revocations preserved: STR-6601 deactivated at rt_4 v2 remains denied; no re-enabled store or live stock/price effect from restore. Named owner: retail operations manager reads register, reconciles and signs off. Two roles sign off: exception coordinator and exception processor. Named fallback: retail operations manager; discrepancy handled via manual catalog audit.
Concrete accessibility targets. Browser keyboard navigation on merchant dashboard: Tab/Shift-Tab moves focus between catalog items; Enter opens variant detail; exception action announced by screen reader. 200% text zoom: variant name, price discrepancy and exception status readable. Narrow viewport (375px): catalog table scrollable without data loss. Cross-tenant test: workspace A merchant cannot access workspace B catalog, pricing or exception queue.
This is a hypothetical scenario for illustration. Actual scope, timeline and cost depend on your requirements.