Disjoint held-out setup. 8 synthetic attribution discrepancy records across two merchant tenants. All data wholly synthetic; no price, stock, refund or ad spend change. Positive (3: ATD-001 through ATD-003): current analyst, valid tenant/store, authorized role, source data current revision, discrepancy materiality above threshold, inbox available. Negative (5: ATD-004 through ATD-008): expired session, wrong tenant, wrong role, stale source revision, below threshold. All hypothetical.
Allowed workflow (ec_1, operation A). Fixture ATD-001: analyst ANL-1100 authenticates with current session SES-EC-001 for tenant BRAND-A (TEN-1101), store STR-2201 at ROLE-V1. Source revision SRC-V1 for period P-2026-Q1. Submits discrepancy intake with key op:ec_A_001 scoped to TEN-1101/STR-2201/ANL-1100/SRC-V1/P-2026-Q1/SES-EC-001. Discrepancy coordinator (scoped approver) independently reads: (a) session SES-EC-001 current; (b) ANL-1100 has analyst role at TEN-1101, STR-2201 at ROLE-V1; (c) source revision SRC-V1 current for period P-2026-Q1; (d) discrepancy materiality above threshold; (e) analytics inbox available; (f) no pending discrepancy for same key. Approves. Discrepancy processor (different scoped executor, bound to immutable A payload and key op:ec_A_001) delivers intake record to analytics inbox. Expected receipt: ATD-REF-4401 at inbox authority (read independently, confirm present). Receipt distinct from price change, stock adjustment, refund or ad spend change. Evidence: discrepancy log at audit authority (read independently, confirm present for op:ec_A_001). Durable committed operation record for op:ec_A_001 read separately at operation log (confirm committed, distinct from receipt and audit). Acceptance: 3 of 3 positive produce confirmed discrepancy receipts.
Webhook verification tests. Tampered raw-body: webhook delivery with modified body but valid X-Shopify-Webhook-Id; HMAC verification against raw unparsed body fails; delivery rejected before processing. Byte-identical duplicate: redelivered webhook carrying same X-Shopify-Webhook-Id as a previously processed delivery; deduplication blocks; 0 new discrepancy records. Legitimate separate subscription: different webhook subscription triggered by the same merchant action shares X-Shopify-Event-Id but carries a distinct X-Shopify-Webhook-Id; processed independently as a separate delivery. Stale source delivery (separate seed, does not conflict with A's SRC-V1 which is current at A's own read): webhook WH-STALE-01 (distinct X-Shopify-Webhook-Id, valid HMAC) carries source SRC-V3 data for TEN-1101/STR-2201/P-2026-Q3; a second delivery WH-ACTIVE-01 (distinct X-Shopify-Webhook-Id, valid HMAC) carries SRC-V4 for the same tenant/store/period. Authenticate each via raw-body HMAC; deduplicate each by X-Shopify-Webhook-Id. Re-read authoritative current source revision for TEN-1101/STR-2201/P-2026-Q3: SRC-V4 current. Retain SRC-V4 in the attribution projection; log WH-STALE-01 as audited no-op against stale SRC-V3. Signed timestamp, delivery ID and event ID are never the source revision authority. Compare matched attribution record and price, stock, refund and ad-spend authorities at TEN-1101/STR-2201 before and after both deliveries: unchanged.
Tenant A/B role and egress cleanup. BRAND-B (TEN-1102) merchant attempts BRAND-A analytics read: denied (wrong tenant). BRAND-A viewer VWR-1110 attempts analyst action: denied (wrong role, current role version verified). After test: all synthetic discrepancy records, intake receipts and inbox entries purged from both tenants. Egress cleanup verified: no synthetic data persists in exports, caches or logs beyond test retention.
Replay of A. Key op:ec_A_001 already committed at inbox authority. Exact replay with identical key and complete original payload (tenant TEN-1101, store STR-2201, analyst ANL-1100 at ROLE-V1, source SRC-V1, period P-2026-Q1, session SES-EC-001) by still-authorized original requester ANL-1100 within exact tenant TEN-1101 scope: system returns only A's existing non-secret receipt ATD-REF-4401 and current discrepancy status. 0 new discrepancy actions. 0 duplicates. Changed payload or different principal/tenant scope: held or rejected.
Independently approved B (ec_1b, operation B). Fixture ATD-002: analyst ANL-1101 authenticates with session SES-EC-002 for tenant TEN-1102 (BRAND-B), store STR-2202, source revision SRC-V1 for period P-2026-Q1, at ROLE-V1. Key op:ec_B_002 with immutable payload scoped to TEN-1102/STR-2202/ANL-1101/SRC-V1/P-2026-Q1/SES-EC-002. B's discrepancy coordinator (scoped to TEN-1102) independently approves; B's discrepancy processor delivers. Durable operation record for op:ec_B_002 committed at operation log; receipt ATD-REF-4402 at inbox authority; audit entry confirmed - each read independently. 2 new discrepancy receipts across A/B, 0 from replay.
Denied: wrong tenant (ec_2a). ATD-004: BRAND-B discrepancy to BRAND-A inbox. 0 cross-tenant intakes. Denied: wrong role (ec_2b). ATD-005: viewer attempting analyst action. Denied: stale source (ec_2c). ATD-006: source revision outdated. Denied: below threshold (ec_2d). ATD-007: discrepancy below materiality threshold. Denied: expired session (ec_2e). ATD-008: session expired.
Revocation (ec_4, ATD-R101). Fixture ATD-R101 with stable key op:ec_R_101: analyst ANL-1100 queues discrepancy for TEN-1101/STR-2201/source SRC-V1/period P-2026-Q1 while holding analyst role at ROLE-V1. Before first send, async worker detects ROLE-V2 (analyst role revoked) and parks the queued submission. On retry of the same queued key op:ec_R_101 and payload, worker re-checks role version, confirms ROLE-V2 still current, and blocks; submission remains parked. Read durable operation records before: op:ec_A_001 committed, op:ec_B_002 committed, op:ec_R_101 parked in monitored queue (not a committed successful operation). Read inbox authority before: ATD-REF-4401 (op:ec_A_001) present, ATD-REF-4402 (op:ec_B_002) present, no receipt for op:ec_R_101. If the stale queued submission bypasses the worker and reaches the backend, inbox authority reads ROLE-V2 (revoked) and rejects; no receipt created, no price, stock, refund or ad change. Read durable operations after: op:ec_A_001 committed (unchanged), op:ec_B_002 committed (unchanged), op:ec_R_101 still parked (queued item, not a committed business effect). Read downstream before and after blocked send: price register at TEN-1101/STR-2201, stock ledger at TEN-1101/STR-2201, refund log at TEN-1101 and ad-spend authority at TEN-1101/STR-2201 unchanged. Read inbox authority after: ATD-REF-4401 and ATD-REF-4402 unchanged, no receipt for op:ec_R_101. Read audit authority: op:ec_A_001 and op:ec_B_002 entries unchanged, no entry for op:ec_R_101 beyond denial record. If pending or in-flight at inbox authority for op:ec_R_101: HOLD for brand analytics director. Cross-tenant negative fixture: async export worker receives job with forged tenant ID TEN-1101 originating from TEN-1102 context; worker validates tenant binding before fetch, denies read of TEN-1101 inbox, denies write to TEN-1102 export; no discrepancy receipt, no data exposure, no price or stock effect. Forged write to foreign target: TEN-1102 context submits job attempting to insert a synthetic discrepancy record into TEN-1101 analytics inbox; worker validates tenant binding before execution, denies the write; TEN-1101 inbox, receipts and audit unchanged. 0 discrepancies from revoked roles.
Dropped response (ec_4b, ATD-R301). Distinct fixture: analyst ANL-1102 submits discrepancy ATD-R301 for BRAND-A (TEN-1101)/store STR-2203/source SRC-V2/period P-2026-Q2 with key op:ec_R_301, session SES-EC-003, response dropped. Independently read: (1) session SES-EC-003 current; (2) ANL-1102 has analyst role at TEN-1101, STR-2203 at current ROLE version; (3) source SRC-V2 current for period P-2026-Q2; (4) discrepancy above threshold; (5) durable transaction log for op:ec_R_301 present or absent; (6) inbox authority receipt under op:ec_R_301 present or absent; (7) audit authority for op:ec_R_301 present or absent; (8) pending/in-flight at inbox authority for op:ec_R_301; (9) price register at TEN-1101/STR-2203, stock ledger at TEN-1101/STR-2203, refund log at TEN-1101 and ad-spend authority at TEN-1101/STR-2203 - each scoped to tenant/store and op:ec_R_301 key. Denial guard: if session SES-EC-003 expired, analyst role revoked or version mismatched, tenant TEN-1101 binding invalid, or source/period revision stale or unverified at reads (1) through (4): refuse; no requester-facing receipt, no retry, no downstream effect. First guard: if any remaining read is unknown, unavailable, contradictory, or pending/in-flight at inbox or audit for this key: HOLD for brand analytics director; no resend, no write, no price or stock effect. Applied: if log committed AND receipt confirmed present AND audit confirmed present, all consistent, no pending/in-flight: complete, return existing receipt, no resend. Disagree: if receipt confirmed present but audit or log absent or inconsistent: HOLD for brand analytics director read-only reconciliation; no resend, no write. Committed but absent: if log committed but receipt absent: HOLD. Conclusively uncommitted: durable log absent, inbox authority conclusively absent for op:ec_R_301, audit conclusively absent, pending/in-flight clear, price register, stock ledger, refund log and ad-spend authority at TEN-1101/STR-2203 unchanged for this key, session current, ANL-1102 authorized, analyst role current, source and period current; discrepancy coordinator freshly scoped approves; discrepancy processor resubmits same key op:ec_R_301 with same payload. No automatic retry. 0 duplicates. 0 price, stock, refund or ad spend changes from recovery.
Staged restore (ec_5, ATD-R201). Stage privately with no production discrepancy submissions or key writes. Read existing A/B keys and receipts: op:ec_A_001 to ATD-REF-4401 at inbox authority, op:ec_B_002 to ATD-REF-4402 at inbox authority. Read R101 key op:ec_R_101: no receipt (denied, role revoked ROLE-V2). Read R201 key op:ec_R_201: absent before restore. Independently read inbox authority, audit authority, pending/in-flight state, and downstream records (price register, stock ledger, refund log, ad-spend authority at each test store) before restoring verified snapshot in private. After staging, re-read: op:ec_A_001 to ATD-REF-4401 (unchanged), op:ec_B_002 to ATD-REF-4402 (unchanged), op:ec_R_101 to no receipt (confirmed denied), op:ec_R_201 to absent, pending/in-flight clear, price register, stock ledger, refund log and ad-spend authority unchanged at each test store. Planned test: compare authoritative operation log and audit records for op:ec_A_001, op:ec_B_002, op:ec_R_101 and op:ec_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: ANL-1100 role revoked at ec_4 ROLE-V2 remains denied; no re-enabled role or live price, stock, refund or ad effect from restore. Named owner: brand analytics director reads discrepancy register, reconciles pending against independent receipts and signs off. Two roles sign off before production resume: discrepancy coordinator verifies inbox register, discrepancy processor verifies submission workflows. Named fallback: brand analytics director; discrepancy review reverts to manual inbox delivery.
Cross-tenant and access testing. Browser keyboard navigation with screen reader on analytics dashboard: Tab/Shift-Tab moves focus between discrepancy items; Enter opens detail; intake action announced. 200% text zoom: merchant names, store references and attribution status readable. Narrow viewport (375px): discrepancy table scrollable without data loss. Cross-tenant test: BRAND-A analyst cannot access BRAND-B discrepancy data, analytics queue or audit logs. Wrong-role fixture: viewer cannot execute analyst discrepancy intake even with valid tenant membership.
This is a hypothetical scenario for illustration. Actual scope, timeline and cost depend on your requirements.