{
  "id": "A02-integration-acceptance-pack",
  "version": "1.0",
  "prepared_on": "2026-11-16",
  "timezone": "America/Los_Angeles",
  "title": "CRM integration acceptance pack",
  "data_provenance": "Original synthetic educational fixture. No customer data, provider connection or production result.",
  "execution_status": "not_run_against_any_integration",
  "base_payload": {
    "event_id": "evt-demo-101",
    "tenant_id": "demo-a",
    "request_id": "REQ-101",
    "revision": 2,
    "status": "approved",
    "quantity": 3
  },
  "contract": {
    "workflow": "An approved CRM request creates or updates a work item; completion of the business work is a separate state.",
    "source_authority": "CRM owns approval, quantity and a monotonically increasing integer revision per tenant/request.",
    "destination_authority": "Destination owns completion status and its internal ID.",
    "business_key": [
      "tenant_id",
      "request_id",
      "action=transfer-approved-request"
    ],
    "delivery_key": "event_id identifies a delivery event; it is not the business identity.",
    "revision_policy": "Higher approved revision updates the same work item; older revisions are ignored. Equal revision/equal data is a duplicate; equal revision/conflicting data is held.",
    "validation": "Only the six BASE fields are accepted in this example. quantity and revision must be positive integers; event/request/tenant IDs must be nonempty. Only approved status is eligible.",
    "assumptions": "A chosen destination must support uniqueness, an idempotent write contract or reliable reconciliation. If it cannot, redesign the workflow or hold uncertain writes for review. Provider rules differ."
  },
  "scenarios": [
    {
      "id": "T01",
      "title": "Approved request",
      "initial_state": "Empty destination; valid sender scoped to demo-a.",
      "input_or_fault": "Deliver BASE once.",
      "expected_outcome": "One work item for demo-a / REQ-101, revision 2, quantity 3. Record the destination ID. Queue acceptance is not fulfillment completion.",
      "evidence_to_collect": "Receipt ID, validation decision, destination ID and a separate completed-transfer checkpoint.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T02",
      "title": "Repeated delivery",
      "initial_state": "T01 already completed.",
      "input_or_fault": "Deliver the identical BASE again with event_id evt-demo-101.",
      "expected_outcome": "Still one work item; no repeated notification or other business side effect. Retain a duplicate-receipt outcome.",
      "evidence_to_collect": "Two receipt attempts linked to one event and one destination ID. For each configured downstream effect, record the T01 baseline and verify that redelivery does not increase it.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T03",
      "title": "Concurrent equivalent events",
      "initial_state": "Empty destination; two workers start together.",
      "input_or_fault": "Deliver BASE and a copy with event_id evt-demo-102 concurrently; all business fields remain identical.",
      "expected_outcome": "One work item. Event IDs differ but the tenant/request/action business key is the same. Verify an atomic claim or equivalent destination uniqueness control; a sequential check alone is insufficient.",
      "evidence_to_collect": "Both correlation IDs, one stable business key, one destination ID, and the collision/duplicate decision.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T04",
      "title": "Older and newer revisions",
      "initial_state": "Destination has REQ-101 revision 2, quantity 3.",
      "input_or_fault": "Variant A: deliver event_id evt-demo-103, revision 1, quantity 1. Variant B: reset to the stated starting state, then deliver evt-demo-103b, revision 3, quantity 4. Other BASE fields remain unchanged.",
      "expected_outcome": "A: retain revision 2, quantity 3 and record stale revision. B: update the existing item to revision 3, quantity 4 with the same destination ID and exactly one item. Do not infer order from delivery time.",
      "evidence_to_collect": "For both variants: before/after destination ID, count, revision and quantity; stale or updated outcome under the source version rule.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T05",
      "title": "Conflicting same revision",
      "initial_state": "Destination has REQ-101 revision 2, quantity 3.",
      "input_or_fault": "Deliver event_id evt-demo-104, revision 2, quantity 9.",
      "expected_outcome": "Hold for investigation: the same revision carries conflicting data. Do not silently overwrite or classify it as an identical duplicate.",
      "evidence_to_collect": "Conflict reason, both payload fingerprints, unchanged destination and named exception owner.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T06",
      "title": "Unapproved source record",
      "initial_state": "Empty destination.",
      "input_or_fault": "Deliver event_id evt-demo-105 with status draft; other BASE fields unchanged.",
      "expected_outcome": "No work item or downstream task. Record not eligible, distinct from successful transfer. A later approved source revision is a separate eligible change.",
      "evidence_to_collect": "Source status, zero destination effects and reason for exclusion.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T07",
      "title": "Invalid or unexpected fields",
      "initial_state": "Empty destination.",
      "input_or_fault": "Variant A: quantity 0. Variant B: add destination_status completed. Run each separately with fresh event IDs.",
      "expected_outcome": "Reject each variant under this example contract: quantity must be a positive integer, and destination_status is not an allowed source field. No destination side effect.",
      "evidence_to_collect": "Validation reason and zero destination writes for each variant; do not record entire sensitive payloads in real logs.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T08",
      "title": "Invalid sender proof",
      "initial_state": "Empty destination; sandbox authenticity check configured.",
      "input_or_fault": "Deliver BASE with an invalid signature or invalid test credential, as appropriate for the chosen interface.",
      "expected_outcome": "Reject before accepting business work. No destination effects. Keep a minimal security outcome without logging secrets.",
      "evidence_to_collect": "Authentication result, zero accepted work, zero destination writes and redacted diagnostic record.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T09",
      "title": "Wrong account scope",
      "initial_state": "Empty destination; caller is authorized only for demo-b.",
      "input_or_fault": "Deliver BASE claiming tenant_id demo-a through the demo-b credential.",
      "expected_outcome": "Reject the scope mismatch even if the payload itself is well formed. No demo-a or demo-b work item is created.",
      "evidence_to_collect": "Authenticated scope, requested scope, rejection reason and destination checks for both accounts.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T10",
      "title": "Timeout after a successful write",
      "initial_state": "Empty destination; sandbox destination commits one work item but drops its response.",
      "input_or_fault": "Deliver BASE; force response loss after the destination commit.",
      "expected_outcome": "Mark the attempt as outcome unknown. Look up the business key or use the destination-supported retry contract to reconcile before another create. End with one work item or a visible unresolved exception, never assume timeout means no write.",
      "evidence_to_collect": "Destination lookup/receipt, original attempt ID and final reconciliation decision. If lookup is inconclusive, record that instead of blind replay.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T11",
      "title": "Rate limited destination",
      "initial_state": "Empty destination; the test destination rejects the first attempt before any write. Use a simulated clock.",
      "input_or_fault": "Destination returns 429 with Retry-After: 60 on the first attempt. Define receipt of that response as t=0; allow success on the next eligible attempt.",
      "expected_outcome": "Keep work pending. Under the agreed test policy, no retry before t=60; use a simulated clock. A later successful transfer creates one work item. Exhausted retries remain visible to the assigned owner.",
      "evidence_to_collect": "Attempt timestamps, parsed wait instruction, retry budget and final destination ID or exception.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T12",
      "title": "Partial multi-step workflow",
      "initial_state": "Sandbox work-item write succeeds; a separate notification sink returns a known pre-send failure.",
      "input_or_fault": "Deliver BASE; fail only the notification step before the test sink accepts anything.",
      "expected_outcome": "Preserve the work-item ID. Resume only the failed notification step after correction. Do not mark the whole workflow complete until required steps are confirmed.",
      "evidence_to_collect": "Independent step statuses and receipts. If notification acceptance becomes uncertain instead, reconcile or hold it; do not assume replay is safe.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T13",
      "title": "Worker dies before checkpoint",
      "initial_state": "Empty destination; destination uniqueness/reconciliation support is configured for the example business key.",
      "input_or_fault": "Process BASE; stop the worker after the destination commits but before the local completion checkpoint. Restart and redeliver.",
      "expected_outcome": "Recover the existing destination item and finish the checkpoint without creating a second item. Missing evidence leaves a visible exception. This tests recovery behavior, not a universal exactly-once guarantee.",
      "evidence_to_collect": "Durable attempt record, destination record, restart evidence and one final business record.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    },
    {
      "id": "T14",
      "title": "Reconciliation finds a gap",
      "initial_state": "Source snapshot has eligible demo-a requests REQ-101, REQ-102, REQ-103. Destination snapshot has REQ-101, REQ-103, REQ-999.",
      "input_or_fault": "Compare these frozen snapshots for the same scope and cutoff. Do not call a live production system.",
      "expected_outcome": "Report REQ-102 as missing and REQ-999 as unexpected. An authorized repair transfers only REQ-102 after a fresh duplicate check. Investigate REQ-999; do not automatically delete it.",
      "evidence_to_collect": "Snapshot cutoff, compared business keys, missing/unexpected sets, repair authorization and before/after counts.",
      "actual_status": "not_run",
      "actual_observation": null,
      "reviewer": null
    }
  ],
  "sources": [
    {
      "url": "https://docs.stripe.com/webhooks",
      "role": "Provider example showing duplicate delivery, ordering and asynchronous processing concerns; not a claim that this CRM uses Stripe."
    },
    {
      "url": "https://docs.stripe.com/api/idempotent_requests",
      "role": "Provider-specific request retry contract; no universal retention or retry guarantee inferred."
    },
    {
      "url": "https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/429",
      "role": "HTTP 429 and optional Retry-After reference."
    }
  ],
  "purpose": "Synthetic acceptance specification for project planning; not an automated test runner."
}
