{
 "faults": [
  {
   "id": "B01",
   "title": "Contract prices doubled during CRM import",
   "kind": "systems_agree",
   "real_world_cause": "An import treats each signed annual price as a semiannual price and doubles it. CRM, invoicing and collections all use the imported terms; only the signed order forms establish the correct prices.",
   "tables": [
    "crm_contract_tiers",
    "crm_opportunities",
    "contract_invoice_lines",
    "contract_payments"
   ],
   "selection": "Select up to 2 crm_contracts, lowest contract_id first, with service_start <= 2026-09-30 <= service_end, discount_pct < 100, a positive annual_list_value on the tier covering 2026-09-30, and no contract_credits row for that contract with credit_type = service. Require a matching closed_won crm_opportunities row and exactly one tier covering every day of the contract. For each selected contract, select all its tiers, its linked opportunity, all its recurring contract_invoice_lines, and all existing contract_payments whose invoice_id occurs on those recurring lines. Related-row counts are the complete matching sets, without a limit.",
   "changes": "For every selected tier, set annual_list_value to twice its original value. Recompute the linked opportunity amount as the sum of the new tier annual_list_value times (1 - discount_pct/100) times tier months/12; each unchanged contract-year tier has 12 months. For each selected recurring invoice line, use the new annual_list_value of the tier covering period_start times (1 - discount_pct/100) times 12/12 for annual billing or 3/12 for quarterly billing. Preserve all invoice dates, periods, quantities and IDs. For every selected payment, set amount to the sum of all current contract_invoice_lines amounts on its invoice_id, including unchanged usage and one_off lines. Preserve payment dates and do not create payments for unpaid invoices. Product seats, usage, onboarding fees and goodwill credits remain unchanged because none determines the negotiated annual price.",
   "correct_arr": "Each selected contract should contribute its original September 30 tier annual_list_value times (1 - discount_pct/100). The fault doubles that contracted recurring contribution; usage ARR is unchanged. The original prices are those on the signed order forms.",
   "arr_effect": "overstated",
   "reconciliation_would_catch": false,
   "reconciliation_reason": "CRM values, contract billings, recorded receipts and revenue calculated from the same schedule agree, so reconciliation needs the signed order forms to expose the pricing error."
  },
  {
   "id": "B02",
   "title": "Negotiated contract discount omitted everywhere",
   "kind": "systems_agree",
   "real_world_cause": "Sales operations misses the discount paragraph when entering a signed order form. The customer pays invoices generated from those incorrect terms, so the discount omission propagates through the financial systems.",
   "tables": [
    "crm_contracts",
    "crm_opportunities",
    "contract_invoice_lines",
    "contract_payments"
   ],
   "selection": "Select up to 2 crm_contracts, lowest contract_id first, with service_start <= 2026-09-30 <= service_end, 0 < discount_pct < 100, a positive tier covering September 30, and a linked closed_won opportunity with opportunity_type = new. Require that the account_id has exactly one crm_contracts row and that the contract has no service contract_credits. Select each contract's linked opportunity, every recurring invoice line for the contract, and every existing payment for an invoice containing one of those recurring lines. Related-row counts are all matching rows.",
   "changes": "Set each selected contract discount_pct to 0. Recompute its opportunity amount as the sum of tier annual_list_value times tier months/12, with 12 months per unchanged contract-year tier. Recompute every recurring invoice line as the tier annual_list_value covering period_start times 1 for annual billing or 3/12 for quarterly billing. For each affected invoice's existing payment, replace amount with the sum of all current invoice-line amounts on that invoice_id, retaining paid_on. Leave one_off lines, usage lines, goodwill credits, tier prices, seats and service dates unchanged. Do not insert payments.",
   "correct_arr": "Each selected contract should count at its original September 30 tier annual_list_value less its original signed discount. The incorrect extracts count the undiscounted annual list value instead; usage ARR is unchanged.",
   "arr_effect": "overstated",
   "reconciliation_would_catch": false,
   "reconciliation_reason": "The omitted discount is absent from CRM, invoices and recorded payments alike, and ordinary reconciliation cannot recover the signed commercial concession."
  },
  {
   "id": "B03",
   "title": "Lifetime card coupon lost at subscription creation",
   "kind": "systems_agree",
   "real_world_cause": "A checkout integration fails to persist an accepted lifetime coupon when creating the subscription. Every subsequent charge follows the undiscounted subscription, while the customer's checkout confirmation establishes the intended discount.",
   "tables": [
    "card_subscriptions",
    "card_invoice_lines",
    "card_refunds"
   ],
   "selection": "Select up to 3 card_subscriptions, lowest subscription_id first, with started_on <= 2026-09-30, ended_on null, recurring_discount_pct = 20, and a positive seat count in effect on September 30. Require that the customer has exactly one subscription, that its card_customers workspace_id has no matching crm_accounts workspace_id, and that price_id joins to a monthly or annual card_price_list row. Select all recurring and proration card_invoice_lines for those subscriptions and all card_refunds linked to those lines. Related-row counts are all matching rows.",
   "changes": "Set recurring_discount_pct to 0 on the selected subscriptions. For each selected recurring line, set amount to quantity times the subscription's card_price_list.unit_amount. For each selected proration line, identify the subscription billing period containing invoice_date from started_on and billing_interval; set amount to quantity times unit_amount times inclusive days from invoice_date through that period's end divided by total days in that period. Preserve quantities, IDs and dates. For each selected refund, recompute amount from the new linked line amount times unused days after the subscription end through period_end divided by inclusive days from period_start through period_end, as prescribed in SYSTEMS.md; no refund is inserted. Product seats and plan history remain unchanged. There is no separate card-payment table to update.",
   "correct_arr": "Each selected subscription should count September 30 seats times its unit price times 0.80, multiplied by 12 for monthly prices or 1 for annual prices. Removing the coupon overstates this recurring ARR; usage ARR is unchanged.",
   "arr_effect": "overstated",
   "reconciliation_would_catch": false,
   "reconciliation_reason": "Subscription terms, seat quantities and all card charges consistently omit the coupon, so monthly reconciliation needs the external checkout confirmation to detect it."
  },
  {
   "id": "B04",
   "title": "Metering counts every run twice before billing",
   "kind": "systems_agree",
   "real_world_cause": "A metering deployment counts both the start and completion event as a billable run. Billing consumes the same inflated daily totals, so only application execution logs outside the extracts reveal the duplication.",
   "tables": [
    "usage_daily",
    "card_invoice_lines"
   ],
   "selection": "Select up to 2 product_workspaces, lowest workspace_id first. Each must have exactly one card_customers row and exactly one subscription for that customer, with started_on <= 2026-07-01 and ended_on null, and no linked crm_accounts row. The latest product_plan_changes row on or before July 1 must be self_serve, with no later plan change through September 30; require exactly one self_serve product_workspace_monthly row for each of July 31, August 31 and September 30. Require positive timely usage in at least one of July, August or September. For every July-September usage billing group whose calculated billing date is <= 2026-10-05, require exactly one corresponding card invoice line matching workspace_id, usage-month period_start and period_end, calculated invoice_date and usage or usage_late line_type. Select all usage_daily rows for these workspaces dated July 1 through September 30 and all corresponding billing-group lines dated through October 5. Related-row counts are all matching rows.",
   "changes": "Double runs on every selected usage_daily row, preserving usage_id, usage_date and loaded_at. For each corresponding selected invoice line, recompute quantity as the sum of current runs for that workspace and usage month assigned to that line's billing date and line_type under the usage billing convention. Set amount to quantity times 0.01. Preserve every other invoice-line column. Late September usage assigned to November 5 has no invoice in this extract, so do not add a line for it. Recurring charges and refunds remain unchanged.",
   "correct_arr": "For each selected workspace, usage ARR should be 4 times the original timely usage revenue for July, August and September. All three months are complete paid months; late rows remain excluded from their original reported months. The fault doubles that usage ARR and leaves recurring ARR unchanged.",
   "arr_effect": "overstated",
   "reconciliation_would_catch": false,
   "reconciliation_reason": "Metered revenue, card usage billings and the ARR run rate all use the same doubled counts, while seats and recurring charges impose no independent limit on legitimate runs."
  },
  {
   "id": "B05",
   "title": "Current ramp price overwritten with prior-year price",
   "kind": "systems_disagree",
   "real_world_cause": "A CRM synchronization job copies the previous year's price into the current ramp tier. The opportunity and invoices retain the agreed higher ramp price.",
   "tables": [
    "crm_contract_tiers"
   ],
   "selection": "Select up to 2 contracts, lowest contract_id first, with service_start <= 2026-09-30 <= service_end and discount_pct < 100. Require exactly one tier covering September 30 with tier >= 2, exactly one preceding tier numbered tier - 1, and 0 < preceding annual_list_value < current annual_list_value. Require at least one recurring contract_invoice_lines row for the contract with period_start inside the current tier and invoice_date <= 2026-10-05, whose amount equals the original current-tier net annual value times 1 for annual billing or 3/12 for quarterly billing. Change exactly the one current tier row per selected contract.",
   "changes": "Replace the current tier's annual_list_value with the preceding tier's original annual_list_value. Leave tier dates, the other tiers, crm_contracts, opportunity amounts, all invoice lines and all payments unchanged.",
   "correct_arr": "Each selected contract should count at its original, higher September 30 tier annual_list_value times (1 - discount_pct/100). The overwritten tier understates contracted recurring ARR by the net difference between the two annual list values; usage ARR is unchanged.",
   "arr_effect": "understated",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The lowered current-tier price cannot reproduce the existing higher recurring invoices or the unchanged opportunity's total contract value."
  },
  {
   "id": "B06",
   "title": "Latest billed seat increase missing from extract",
   "kind": "systems_disagree",
   "real_world_cause": "An incremental export loses a seat-change event after the billing engine has already processed it. Product and invoices retain the increased seat count.",
   "tables": [
    "card_seat_changes"
   ],
   "selection": "Select up to 3 subscriptions, lowest subscription_id first, with ended_on null and started_on < 2026-09-01. Require a unique latest card_seat_changes row across the full extract, dated September 1 through September 30, and an earlier predecessor row; order events by effective_date then change_id. Require latest.seats_after > predecessor.seats_after and no other event on the latest event's date. Require a positive proration card_invoice_lines row for that subscription on the latest effective_date with quantity equal to that seat increase. Delete exactly the latest seat-change row per selected subscription.",
   "changes": "Delete the selected card_seat_changes rows. Preserve all earlier seat events, card_subscriptions, recurring and proration invoice lines, refunds, and product_workspace_monthly rows.",
   "correct_arr": "Each selected subscription should use the original latest seats_after on September 30, at its price and recurring discount, annualized by billing interval. The fault instead leaves the preceding lower seat count as the last recorded count, understating recurring ARR by the omitted seats times the net annualized seat price.",
   "arr_effect": "understated",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "Existing proration charges bill seat additions that the extracted seat history no longer contains."
  },
  {
   "id": "B07",
   "title": "Scheduled seat decrease backdated by one billing period",
   "kind": "systems_disagree",
   "real_world_cause": "A migration script subtracts a month from a scheduled reduction's effective date. The subscription's seat history then releases seats before the paid billing period ends.",
   "tables": [
    "card_seat_changes"
   ],
   "selection": "Select up to 2 monthly card subscriptions, lowest subscription_id first, with ended_on null. Require their unique latest seat-change row to be a decrease effective October 1 through October 5, on a billing-period start generated from started_on. Let P be the immediately preceding billing-period start in September. Require the predecessor seat-change effective_date < P, predecessor.seats_after > latest.seats_after > 0, and no other seat event on or after P except this latest row. Require a recurring invoice line at P with quantity equal to predecessor.seats_after. Change exactly one seat-change row per selected subscription.",
   "changes": "Set the selected decrease row effective_date to P, the preceding September billing-period start. Preserve change_id, subscription_id and seats_after. Leave both the September and October invoice lines, subscription terms and product snapshots unchanged.",
   "correct_arr": "The higher predecessor seat count should remain in effect on September 30, because the genuine reduction takes effect at the October billing-period start. The fault makes the lower count effective a full billing period early and understates recurring ARR by the removed seats times the discounted monthly seat price times 12.",
   "arr_effect": "understated",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The September recurring invoice still bills the higher seats for the same period in which the corrupted seat history now reports the lower count."
  },
  {
   "id": "B08",
   "title": "Workspace link erased on migrated CRM accounts",
   "kind": "systems_disagree",
   "real_world_cause": "An account deduplication job overwrites populated workspace links with nulls from an older CRM record. The contract remains valid, but the connection to the preceding card customer disappears.",
   "tables": [
    "crm_accounts"
   ],
   "selection": "Select up to 2 distinct crm_accounts, lowest account_id first, with workspace_id nonnull and a contract in service on September 30 whose linked closed_won opportunity has opportunity_type = migration. Require a card_customers row for the same workspace and a subscription for that customer whose ended_on equals the contract service_start minus one day. If multiple contracts qualify for an account, use the lowest contract_id only to establish eligibility; change the account once. Change exactly one account row per selected account.",
   "changes": "Set workspace_id to null on each selected crm_accounts row. Leave contracts, opportunities, product plan changes, card customers, subscription end dates, refunds, invoice lines, usage and payments unchanged.",
   "correct_arr": "September 30 should still count the same active contract tiers and the same eligible workspace usage at their original values, so total ARR is unchanged. The original workspace links should identify each card-to-contract move as migration out and migration in, with only the value difference classified as expansion or contraction, rather than a churn and a new customer.",
   "arr_effect": "unchanged",
   "reconciliation_would_catch": false,
   "reconciliation_reason": "CRM contract amounts, invoices and receipts still reconcile, while detecting the false churn and new-customer attribution requires a specific migration identity or link-coverage review."
  },
  {
   "id": "B09",
   "title": "September usage partition partially omitted",
   "kind": "systems_disagree",
   "real_world_cause": "A failed partition export drops daily metering records from the warehouse delivery. The billing system received those records before the export failure and invoiced them normally.",
   "tables": [
    "usage_daily"
   ],
   "selection": "Choose the lowest workspace_id having exactly one card customer and exactly one subscription for that customer with started_on <= 2026-07-01 and ended_on null, and no linked crm_accounts row. Require the latest product plan on or before July 1 to be self_serve and no later plan change through September 30. Require exactly one card usage invoice line for this workspace dated 2026-10-05 with period_start = 2026-09-01 and period_end = 2026-09-30. The workspace must have at least one positive-runs usage_daily row dated in September with loaded_at < 2026-10-05 00:00:00. Within that workspace select up to 20 such usage rows, ordered by usage_date then usage_id. If no workspace qualifies, change nothing.",
   "changes": "Delete the selected usage_daily rows only. Preserve the October 5 usage invoice line, its quantity and amount, all other usage rows, product history and subscription records.",
   "correct_arr": "The selected workspace should include its original timely September usage along with July and August in its three-complete-month run rate. Correct usage ARR exceeds the faulted usage ARR by 4 times 0.01 times the sum of runs on the deleted rows; recurring ARR is unchanged.",
   "arr_effect": "understated",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The unchanged October 5 September-usage invoice contains more timely runs than the surviving daily usage records support."
  },
  {
   "id": "B10",
   "title": "Warehouse load timestamps substituted for metering arrival times",
   "kind": "systems_disagree",
   "real_world_cause": "An ETL repair stamps timely metering rows with the repair job's October 5 execution time. Rows already included in normal billing now falsely appear to have missed the ARR finalization cutoff.",
   "tables": [
    "usage_daily"
   ],
   "selection": "Choose the lowest workspace_id with exactly one card customer and exactly one subscription for that customer, started_on <= 2026-07-01 and ended_on null, and no linked CRM account. Require its latest product plan on or before July 1 to be self_serve with no later plan change through September 30, and exactly one October 5 card usage line covering September. Select up to 10 positive-runs September usage_daily rows for that workspace with loaded_at < 2026-10-05 00:00:00, ordered by usage_date then usage_id. Require at least one such row for workspace eligibility; if no workspace qualifies, change nothing.",
   "changes": "Set loaded_at to 2026-10-05 02:00:00 on every selected usage_daily row. Preserve usage_id, workspace_id, usage_date and runs. Do not move quantities out of the October 5 usage invoice and do not insert a usage_late invoice line.",
   "correct_arr": "The original arrival timestamps qualify these runs for September's finalized usage revenue. Correct September 30 usage ARR includes 4 times their revenue, whereas the corrupted timestamps exclude them from the reported run rate and place them on the restatement list; recurring ARR is unchanged.",
   "arr_effect": "understated",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The October 5 normal usage bill includes runs whose altered timestamps say they missed that bill's cutoff and should instead be billed as late usage in November."
  },
  {
   "id": "B11",
   "title": "Paid contract renewal charge missing from invoice extract",
   "kind": "systems_disagree",
   "real_world_cause": "An invoice-line exporter drops recurring charges while retaining the associated bank-payment feed. Finance then sees cash against an incomplete or absent invoice in the extract.",
   "tables": [
    "contract_invoice_lines"
   ],
   "selection": "Select up to 2 contract_invoice_lines, lowest line_id first, with line_type = recurring, amount > 0, invoice_date between 2026-09-01 and 2026-09-30, and a parent contract in service on September 30. Require exactly one existing contract_payments row for invoice_id and require its original amount to equal the sum of original contract_invoice_lines amounts on that invoice_id. To use distinct invoices, retain only the lowest eligible line_id for each invoice_id before taking the first 2 rows. Delete exactly the selected invoice-line rows.",
   "changes": "Delete the selected recurring contract_invoice_lines rows. Preserve every other line on those invoices, all contract_payments including amounts and paid_on, and all CRM contracts, tiers and opportunities.",
   "correct_arr": "The selected contracts should still contribute their original in-service September 30 tier values net of discount. Contracted recurring ARR and usage ARR are unchanged because neither is determined by whether these invoice lines were exported; the original recurring lines should remain in billing and deferred or unbilled revenue records.",
   "arr_effect": "unchanged",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The preserved payments exceed the remaining extracted invoice totals by exactly the omitted recurring charges."
  },
  {
   "id": "B12",
   "title": "Bank transfer replayed as a second contract payment",
   "kind": "systems_disagree",
   "real_world_cause": "A bank-feed retry loses its idempotency key and inserts an already recorded transfer under a new payment ID. The customer made only one transfer.",
   "tables": [
    "contract_payments"
   ],
   "selection": "Select exactly 1 contract_payments row, lowest payment_id first, with paid_on between 2026-09-01 and 2026-09-30 and amount > 0. Require its invoice_id to have exactly one payment in the original extract, at least one contract_invoice_lines row, and an original invoice-line total equal to the payment amount. If none qualifies, add nothing.",
   "changes": "Insert exactly one contract_payments row. Give payment_id the smallest unused identifier of the form PAY- followed by a positive integer padded to at least five digits, testing unused values against the entire original contract_payments table. Set invoice_id to the selected payment's invoice_id, paid_on to its paid_on, and amount to its amount. These are all four columns. Preserve the original payment and every invoice, contract and usage record.",
   "correct_arr": "All September 30 recurring and usage ARR should remain at their original values because payment duplication does not create service, seats or runs. The supporting collections records should contain only the original transfer, rather than twice the cash against the selected invoice.",
   "arr_effect": "unchanged",
   "reconciliation_would_catch": true,
   "reconciliation_reason": "The invoice now has recorded payments totaling twice its billed amount, and the replay has no second bank transfer to support it."
  }
 ]
}
