{
  "engine": "rightshold-forensic-checks",
  "version": "1.0.0",
  "report_schema": "rightshold-forensic-report/1",
  "download": {
    "engine": "https://www.rightshold.com/cli/forensic-checks.cjs",
    "engine_sha256": "f3a7708d403858398e33600c0c41609a5b585060834f91f4a815244d751421f6",
    "wrapper": "https://www.rightshold.com/cli/forensic-check.cjs",
    "wrapper_sha256": "b9643b9aa51ab5a59d104d83797816ca3048b94a0672a629ff28f74f790a6fa0",
    "checksums": "https://www.rightshold.com/cli/forensic-checks.sha256"
  },
  "tests": [
    {
      "id": "seal.continuity",
      "number": 1,
      "group": "Sealing and timing",
      "name": "Continuity",
      "method": "Every anchored period is listed in order. Each must carry the time it was sealed and countersigned, the anchoring chain must be reported continuous, the next period must begin no later than the day after the previous one ended, and every record must name a period that is in the list. A missing seal, a broken chain, a gap between periods or a record that names an unknown period is flagged as significant.",
      "needs": "The anchoring facts: the list of anchored periods with their sealed and countersigned times, and whether the chain is continuous.",
      "thresholds": {}
    },
    {
      "id": "seal.timeliness",
      "number": 2,
      "group": "Sealing and timing",
      "name": "Timeliness of sealing",
      "method": "For each anchored period, the number of whole days from the period's end to the day it was countersigned. A period countersigned more than the stated number of days after it ended is listed with its delay. A late seal widens the window in which records could have been changed before they were fixed.",
      "needs": "Anchored periods with their end dates and countersigned times.",
      "thresholds": {
        "timeliness_max_days": 7
      }
    },
    {
      "id": "seal.late_entries",
      "number": 3,
      "group": "Sealing and timing",
      "name": "Late-recorded entries",
      "method": "For each entry, its claimed date is compared with the start of the period it was actually sealed in. An entry dated more than the grace window before that period began was recorded late: a sale dated March that first appears in a period sealed in September. Late entries are counted and totalled by category, and those that raise revenue are shown separately. Late revenue at or above the stated share of total revenue makes the flag significant.",
      "needs": "Entries that name the period they were sealed in, and the anchored periods.",
      "thresholds": {
        "late_entry_grace_days": 3,
        "late_revenue_significant_bp": 500
      }
    },
    {
      "id": "seal.corrections",
      "number": 4,
      "group": "Sealing and timing",
      "name": "Corrections",
      "method": "Every correction is matched to the entry it corrects and its effect is measured: the change in the entry's category total and in cash. Corrections are counted with their net effect per month and per category. Corrections that raise revenue or cash, and corrections sealed in the stated window before the examination date, are listed. A correction is an ordinary bookkeeping event; these are the ones a reader should ask about.",
      "needs": "Entries; corrections are optional (none recorded is a pass).",
      "thresholds": {
        "correction_recent_window_days": 30
      }
    },
    {
      "id": "seal.period_end",
      "number": 5,
      "group": "Sealing and timing",
      "name": "Period-end concentration",
      "method": "For each calendar month, the share of its revenue dated in its last days is compared with the business's own median share across all months. A month well above its own norm is flagged, and so are refunds or negative revenue entries in the first days of the next month that reverse a stated share of that period-end revenue: revenue pulled into a period and taken back after it closes.",
      "needs": "Revenue entries across at least the stated number of months.",
      "thresholds": {
        "period_end_days": 3,
        "period_end_excess_bp": 2500,
        "period_end_min_months": 3,
        "reversal_share_bp": 1000
      }
    },
    {
      "id": "tie.statement_entries",
      "number": 6,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Statement to entries",
      "method": "For each period statement, the revenue, cost of sales and operating expenses it reports are compared with the sums of that period's entries by category, exactly, in cents, and the statement's net result is compared with revenue minus cost of sales minus operating expenses. Where the statement gives the number of invoices issued, it is compared with the count of invoice entries. Any difference is shown and flagged as significant.",
      "needs": "Period statements with at least one of these figures, and the entries for their periods.",
      "thresholds": {}
    },
    {
      "id": "tie.cash_rollforward",
      "number": 7,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Cash roll-forward",
      "method": "For each period statement with opening and closing cash, the closing cash must equal the opening cash plus the cash entries dated in the period. Where one statement's period follows directly after another's, its opening cash must equal the previous closing cash. Differences are shown in cents and flagged as significant.",
      "needs": "Period statements with cash at start and end, and cash entries.",
      "thresholds": {}
    },
    {
      "id": "tie.ar_ap_rollforward",
      "number": 8,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Receivables and payables roll-forward",
      "method": "Receivables at the end of a period must equal receivables at the start plus invoices issued on credit minus payments received in the period. Payables are checked the same way where the statement gives them: bills recorded on credit added, bills paid subtracted. Consecutive periods must join. Differences are shown and flagged as significant.",
      "needs": "Period statements with receivables or payables at start and end, and the entries for their periods.",
      "thresholds": {}
    },
    {
      "id": "tie.invoice_sequence",
      "number": 9,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Invoice sequence",
      "method": "Invoice numbers are split into a prefix and a trailing number, handling zero padding; the numbering scheme found is stated. Within each prefix the numbers are checked for gaps, for numbers used more than once, and for invoices whose date is earlier than an invoice with a lower number. When the numbers are not sequential by design (too few end in digits, or they fill too little of their range) the test does not apply.",
      "needs": "At least two invoice entries with invoice numbers.",
      "thresholds": {
        "invoice_min_numbered_bp": 8000,
        "invoice_min_density_bp": 5000
      }
    },
    {
      "id": "tie.duplicates",
      "number": 10,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Duplicates",
      "method": "Three kinds: entries of the same type with the same counterparty, amount and date; one supporting document hash attached to more than one entry of the same type; and an invoice whose payments add up to more than the invoice, which is how a payment recorded twice shows. Each group found is listed. Payments recorded more than once are significant; the others are questions.",
      "needs": "Entries.",
      "thresholds": {}
    },
    {
      "id": "tie.support",
      "number": 11,
      "group": "Tie-outs: the books agree with themselves",
      "name": "Supporting documents",
      "method": "The share of entries, by count and by amount, that carry the hash of a supporting document, and how many of those documents were themselves sealed (they appear as sealed document records or carry a preparer's countersignature). Support below the stated share of entry value is a question; the largest unsupported entries are listed.",
      "needs": "Entries.",
      "thresholds": {
        "support_min_bp": 8000
      }
    },
    {
      "id": "rec.bank",
      "number": 12,
      "group": "Reconciliation to outside records",
      "name": "Bank reconciliation",
      "method": "Cash entries in the books are matched one to one with lines from the bank's or processor's own export, account by account: the amounts must be equal and the dates within the stated window; each entry takes the closest unused line. The report gives the matched share by count and by amount, the unmatched book entries and the unmatched bank lines. Where the bank gives running balances, the books' closing cash for each statement period is compared with the bank's balance on that date. This is only as strong as the bank lines supplied.",
      "needs": "Cash entries and bank or processor lines.",
      "thresholds": {
        "bank_match_window_days": 5,
        "bank_matched_min_bp": 9500
      }
    },
    {
      "id": "rec.deposits_revenue",
      "number": 13,
      "group": "Reconciliation to outside records",
      "name": "Deposits against revenue",
      "method": "For each period statement, the money that reached the bank (the sum of incoming bank lines dated in the period) is compared with the revenue reported less the increase in receivables. Revenue well above what reached the bank is a question; twice the stated shortfall is significant. Deposits can include loans, owner money and transfers, so a pass here does not prove the revenue.",
      "needs": "Period statements with revenue, and bank lines dated in those periods.",
      "thresholds": {
        "deposits_shortfall_bp": 1000
      }
    },
    {
      "id": "rec.countersigned_documents",
      "number": 14,
      "group": "Reconciliation to outside records",
      "name": "Countersigned documents",
      "method": "How many of the documents behind the records carry a preparer's countersignature on their exact bytes, and for which periods. Period statements whose document is not countersigned are listed as a question. A countersignature proves which bytes a preparer saw, never that the figures in them are right.",
      "needs": "The list of countersigned document hashes in the anchoring facts.",
      "thresholds": {}
    },
    {
      "id": "screen.benford",
      "number": 15,
      "group": "Screens (statistical: a flag here is only ever a question)",
      "name": "First-digit distribution (Benford)",
      "method": "The first significant digit of every entry amount at or above the stated minimum is counted and compared with the distribution Benford's law predicts for naturally occurring amounts (digit 1 about 30.1%, digit 9 about 4.6%). The statistic is the mean absolute deviation, in parts per million, computed in integers against a fixed table. Above the stated bound the screen raises a question and lists entries with the most over-represented digit. Many honest books do not follow the law (fixed prices, subscriptions), so this is a screen only.",
      "needs": "At least the stated minimum number of entry amounts.",
      "thresholds": {
        "benford_min_entries": 300,
        "benford_min_amount_cents": 1000,
        "benford_mad_ppm": 15000
      }
    },
    {
      "id": "screen.round_amounts",
      "number": 16,
      "group": "Screens (statistical: a flag here is only ever a question)",
      "name": "Round amounts and amounts just below levels",
      "method": "The share of entries that are whole multiples of the stated round unit is measured for the whole set and for each month; a month whose share stands well above the business's own share is a question. For each stated level (such as an approval limit), amounts just below it are counted against amounts in a band of the same width at and above it; far more just below than just above is a question.",
      "needs": "Entries (months with fewer than the stated number of entries are not screened).",
      "thresholds": {
        "round_unit_cents": 10000,
        "round_excess_bp": 2000,
        "round_min_month_entries": 10,
        "below_threshold_levels_cents": [
          100000,
          250000,
          500000,
          1000000
        ],
        "below_band_bp": 500,
        "below_min_count": 5,
        "below_ratio": 2
      }
    },
    {
      "id": "screen.concentration",
      "number": 17,
      "group": "Screens (statistical: a flag here is only ever a question)",
      "name": "Customer and vendor concentration",
      "method": "The share of revenue from the largest counterparty and from the largest five, and the share of costs paid to the largest supplier. This is information for the reader about dependence on a few names; it is flagged as a question only when a stated share is reached. Counterparty references are never repeated in the report; only shares and the entries behind the largest one are given.",
      "needs": "Revenue entries with counterparty references.",
      "thresholds": {
        "concentration_top1_bp": 5000,
        "concentration_top5_bp": 9000
      }
    },
    {
      "id": "screen.breaks",
      "number": 18,
      "group": "Screens (statistical: a flag here is only ever a question)",
      "name": "Month-to-month breaks",
      "method": "Monthly revenue and gross margin are compared with the median of up to the stated number of prior months. A month whose revenue departs from that median by more than the stated share, or whose margin moves by more than the stated number of points, is a question. Seasonal businesses will show breaks that have an ordinary explanation.",
      "needs": "Revenue entries across at least the stated number of months.",
      "thresholds": {
        "break_min_months": 4,
        "break_trailing_months": 6,
        "break_revenue_bp": 5000,
        "break_margin_bp": 1500
      }
    },
    {
      "id": "screen.weekend",
      "number": 19,
      "group": "Screens (statistical: a flag here is only ever a question)",
      "name": "Weekend postings",
      "method": "The share of entries dated on a Saturday or a Sunday, and their total. This is information only: for many businesses weekend trading is normal, and for others it is worth a question the reader can ask.",
      "needs": "Entries.",
      "thresholds": {}
    }
  ],
  "default_thresholds": {
    "timeliness_max_days": 7,
    "late_entry_grace_days": 3,
    "late_revenue_significant_bp": 500,
    "correction_recent_window_days": 30,
    "period_end_days": 3,
    "period_end_excess_bp": 2500,
    "period_end_min_months": 3,
    "reversal_share_bp": 1000,
    "invoice_min_numbered_bp": 8000,
    "invoice_min_density_bp": 5000,
    "support_min_bp": 8000,
    "bank_match_window_days": 5,
    "bank_matched_min_bp": 9500,
    "deposits_shortfall_bp": 1000,
    "benford_min_entries": 300,
    "benford_min_amount_cents": 1000,
    "benford_mad_ppm": 15000,
    "round_unit_cents": 10000,
    "round_excess_bp": 2000,
    "round_min_month_entries": 10,
    "below_threshold_levels_cents": [
      100000,
      250000,
      500000,
      1000000
    ],
    "below_band_bp": 500,
    "below_min_count": 5,
    "below_ratio": 2,
    "concentration_top1_bp": 5000,
    "concentration_top5_bp": 9000,
    "break_min_months": 4,
    "break_trailing_months": 6,
    "break_revenue_bp": 5000,
    "break_margin_bp": 1500,
    "ids_cap": 25
  },
  "limits": "These results come from a published battery of tests that an examiner would run on a set of books, run the same way every time on the records supplied, with the method of each test stated. A test that flags raises a specific question and names the records that caused it: it is evidence for a person to weigh. The results are not an audit opinion, an assurance, a valuation or a credit decision. A clean run does not prove the numbers are true: sales that were never recorded anywhere cannot be seen, and records that were already false when they were first sealed can pass every test that compares the books with themselves. A flag is not a finding of wrongdoing; many flags have an ordinary explanation the business can give. Reconciliation to outside records is only as strong as the outside records supplied. The timing tests rely on the sealing facts supplied with the records; confirm those against the anchored roots before relying on them.",
  "stored": "Rightshold keeps the signed report (the test results, the figures behind them and the ids of the records that raised flags), its signature, the input commitment and the time, visible only to your account. The records you send are used for the run and are not kept: only their SHA-256 commitment is. The public ledger receives only a salted commitment, the engine version and the time: no hash of your records, no figure, no record id, no counterparty and no account. The opening of that commitment (the SHA-256 of the records and of the report, and its salt) is returned to you inside the report. A report sealed earlier holds those two hashes on the ledger as they were.",
  "common_ownership": "Rightshold and a2ally are under common ownership. a2ally builds systems for some of the businesses that use these checks. Every business is checked by the same published engine with the same published thresholds, and anyone can re-run it on the same records.",
  "signing": {
    "protocol": "rightshold-forensic-signature/1",
    "statement": "This engine version, run on this exact input with these options, produced this report.",
    "key_id": "key_41eb7b6d1b11968a",
    "keys": "https://www.rightshold.com/.well-known/rightshold-keys.json"
  },
  "page": "https://www.rightshold.com/forensic-checks"
}