{
  "$comment": "For each broken copy in cases.mjs, the first failure the receipt check must give (the reason it is refused). check-negatives.mjs and the server test compare with it; a new case adds its line here.",
  "first_failure": {
    "exp is iat + 10 years, not 1 January of year + 11": "OBT-RCP-5.2-05: exp 2115280920, want 2145916800 (1 January 2038)",
    "nbf differs from iat": "OBT-RCP-5.2-04: nbf must equal iat",
    "the decisions do not sum to the document net": "OBT-RCP-5.5-03: decisions' net 99999 cents, document.net 100000",
    "a VATEX code on a standard-rated line": "schema: /decisions/0 must NOT be valid",
    "a reverse charge without its basis": "schema: /decisions/0/liability must have required property 'basis'",
    "a treatment word that is not in the list": "schema: /decisions/0/treatment must be equal to one of the allowed values",
    "money as a JSON number": "schema: /document/net must be string",
    "a free-text member the type does not define": "schema: / must NOT have additional properties",
    "a free-text member inside a check": "schema: /checks/0 must NOT have additional properties",
    "the ETSI status members CIR 2026/1731 made void (EAA-5.2.10.1-04 to -12)": "schema: /status must NOT have additional properties",
    "a credit note with no preceding document": "schema: /document must have required property 'preceding'",
    "both a supply date and a supply period": "schema: /document must NOT be valid",
    "no file hash and no GOBL digest": "schema: /document must have required property 'file_sha256'",
    "a B2B buyer with no business proof": "schema: /buyer must have required property 'business_proof'",
    "a consumer with a business proof": "schema: /buyer must NOT be valid",
    "a check made by another party (v0: the issuer only)": "OBT-RCP-5.7-05: check buyer_vat_number by VATDE-123456788, not the issuer",
    "a VIES check that is unavailable but names a name-and-address result": "schema: /checks/0/result must NOT be valid",
    "an attested check without its code location": "schema: /checks/0/provenance must NOT have additional properties",
    "an engine with a plain SHA-256 of the inputs": "schema: /decisions/0/engine/inputs_commitment must match pattern \"^hmac-sha256:[A-Za-z0-9_-]{43}$\"",
    "an article-level ELI": "schema: /decisions/0/law/0/act must match pattern \"^(http://data\\.europa\\.eu/eli/(dir|reg|reg_impl|dec|dec_impl)/[0-9]{4}/[0-9]{1,5}/oj|[A-Z]{2}-[A-Z0-9-]{2,24})$\"",
    "a decision that cites only EU law (no Portuguese article)": "OBT-RCP-5.5-17: decision 0: no article of PT law (a national act code of its annex)",
    "a Portuguese article with a degree sign for the ordinal": "OBT-PT-3-10: decision 0: PT-CIVA \"6° n.º 6 a)\" is not in the annex's form (e.g. \"18.º n.º 1 c)\")",
    "a Portuguese article written with words and commas": "OBT-PT-3-10: decision 0: PT-CIVA \"6.º, n.º 6, alínea a)\" is not in the annex's form (e.g. \"18.º n.º 1 c)\")",
    "a line in two decisions": "OBT-RCP-5.5-02: line 2 is in two decisions",
    "a line with no decision": "OBT-RCP-5.5-02: line 2 has no decision",
    "the status URL over plain HTTP": "schema: /status/status_list/uri must match pattern \"^https://[A-Za-z0-9.-]+(:[0-9]{1,5})?(/[A-Za-z0-9._~%!$&'()*+,;=:@-]*)*$\"",
    "a consolidation id that is not a CELEX consolidation number": "schema: /decisions/0/law/0/consolidation must match pattern \"^0[0-9]{4}[A-Z][0-9]{4}-[0-9]{8}$\"",
    "a withholding that applies with no amount": "schema: /withholding must have required property 'amount'",
    "a tax id in lower case (the canonical form is upper case)": "schema: /buyer/tax_id must match pattern \"^[A-Z]{2}[0-9A-Z+*]{2,15}$\"",
    "a tax id with a space": "schema: /seller/tax_id must match pattern \"^[A-Z]{2}[0-9A-Z+*]{2,15}$\"",
    "a tax id with dots": "schema: /seller/tax_id must match pattern \"^[A-Z]{2}[0-9A-Z+*]{2,15}$\"",
    "a document number with a Cyrillic letter that looks Latin": "schema: /document/number must match pattern \"^[A-Za-z0-9._/-]+( [A-Za-z0-9._/-]+)*$\"",
    "a document number with an accented letter": "schema: /document/number must match pattern \"^[A-Za-z0-9._/-]+( [A-Za-z0-9._/-]+)*$\"",
    "a document number with two spaces": "schema: /document/number must match pattern \"^[A-Za-z0-9._/-]+( [A-Za-z0-9._/-]+)*$\"",
    "a document number with a trailing space": "schema: /document/number must match pattern \"^[A-Za-z0-9._/-]+( [A-Za-z0-9._/-]+)*$\"",
    "a document number with a zero-width space": "schema: /document/number must match pattern \"^[A-Za-z0-9._/-]+( [A-Za-z0-9._/-]+)*$\"",
    "S at rate 0 (BR-S-05)": "schema: /decisions/0/rate must NOT be valid",
    "Z at a non-zero rate (BR-Z-05)": "schema: /decisions/0/rate must be equal to constant",
    "O with a rate (BR-O-05)": "schema: /decisions/0 must NOT be valid",
    "E with neither a VATEX code nor a mention (BR-E-10)": "OBT-RCP-5.5-07: decision 0 (E) has neither vatex nor pt.mention",
    "E with the reverse-charge VATEX code (PEPPOL-EN16931-P0104)": "schema: /decisions/0/vat_category must be equal to constant",
    "a VATEX code that is not in the code list (BR-CL-22)": "OBT-RCP-5.1-06: decision 0: VATEX-EU-ZZZ is not in VATEX v17b",
    "gross is not net + vat (BR-CO-15)": "OBT-RCP-5.3-08: gross 1001.00 is not net 1000.00 + vat 0.00",
    "AE with VAT charged (BR-AE-09)": "OBT-RCP-5.5-05: decision 0 (AE) has VAT",
    "only a charge, no line (BR-16)": "schema: /decisions/0 must have required property 'lines'",
    "type 384 (not in v0; Peppol P0112)": "schema: /document/type must be equal to one of the allowed values",
    "VAT in the national currency, in the document currency (PEPPOL-EN16931-R005)": "OBT-RCP-5.3-09: vat_national is in the document currency",
    "a dollar invoice with VAT and no euro amount (Directive Art. 230)": "OBT-RCP-5.3-09: the document is in USD with VAT: vat_national in EUR is required",
    "VAT in the national currency with the opposite sign (PEPPOL-EN16931-R055)": "OBT-RCP-5.3-09: vat_national has the opposite sign of vat",
    "currency XYZ (BR-CL-04)": "OBT-RCP-5.1-06: currency XYZ",
    "country XX (BR-CL-14)": "OBT-RCP-5.1-06: country XX",
    "30 February (PEPPOL-EN16931-F001)": "OBT-RCP-5.1-07: 2027-02-30 is not a calendar date",
    "a rate written as 0.00 (one spelling only)": "schema: /decisions/0/rate must be equal to constant",
    "money written as -0.00 (one spelling only)": "schema: /decisions/0/vat must match pattern \"^(0\\.00|-?(0\\.(0[1-9]|[1-9][0-9])|[1-9][0-9]{0,14}\\.[0-9]{2}))$\"",
    "a negative charge": "OBT-RCP-5.5-08: decision 1: a charge or allowance with a negative net",
    "AE with the supplier liable": "schema: /decisions/0/liability/who must be equal to constant",
    "an intra-Community supply of goods with no deliver-to country (BR-IC-12)": "OBT-RCP-5.3-10: a K decision needs document.deliver_to_country",
    "decisions whose VAT does not sum to the document VAT (BR-CO-14)": "OBT-RCP-5.5-04: decisions' vat 23000 cents, document.vat 23100",
    "S 23 % with the VAT of another rate (BR-S-09)": "OBT-RCP-5.5-06: S|23: vat 6000 cents, net x rate is 23000",
    "an e-invoice with two exemption reasons in E (BR-E-01)": "OBT-RCP-5.5-10: category E has 2 different reasons (EN 16931 allows one: BR-E-01)",
    "a buyer with no VAT identifier on an Art. 196 reverse charge (Art. 226(4))": "OBT-RCP-5.4-04: K and an Art. 196 reverse charge need the buyer's VAT identifier on the document",
    "_sd_alg left in the processed claims (RFC 9901 7.1 step 3.f removes it)": "schema: / must NOT have additional properties",
    "the treatment zero_unclassified (Art. 226(11): the invoice names the provision)": "schema: /decisions/0/treatment must be equal to one of the allowed values",
    "a promise of \"correct\" on the buyer's own word (Reg. 282/2011 Art. 18)": "schema: /assurance/treatment must be equal to constant",
    "the Art. 59c threshold on a rule it does not cover": "schema: /decisions/0/place_of_supply/rule must be equal to one of the allowed values",
    "a margin scheme shown as standard-rated (Art. 325)": "schema: /decisions/0 must have required property 'vatex'",
    "a reading that is not in the list": "schema: /decisions/0/law/2/reading must be equal to constant",
    "pt.kind that does not fit the document type (an NC as 380)": "OBT-PT-2-02: pt.kind NC does not fit document.type 380",
    "an FS without the simplified flag": "OBT-PT-2-03: document.simplified is true exactly for an FS",
    "a malformed ATCUD": "OBT-PT-2-04: pt.atcud is missing or malformed",
    "a place in Portugal with no region, on a receipt Germany governs (OBT-RCP-4-04)": "OBT-PT-3-02: decision 0: a Portuguese place needs its region (mainland, azores, madeira)",
    "an OSS sale into Portugal by a German seller, with no Portuguese article (OBT-RCP-5.5-18)": "OBT-RCP-5.5-18: decision 0: the VAT is PT's, so it names an article of PT law (a national act code of its annex)",
    "an OSS sale into Portugal by a German seller, its Portuguese article in the wrong form (OBT-RCP-4-04)": "OBT-PT-3-10: decision 0: PT-CIVA \"Artigo 18.º, n.º 1, alínea c)\" is not in the annex's form (e.g. \"18.º n.º 1 c)\")",
    "a Portuguese seller owing Spanish VAT outside a special scheme (OBT-RCP-4-02: Spain governs, not covered)": "OBT-RCP-4-02: decision 0: the seller owes ES's VAT outside a special scheme, so ES's invoicing rules govern the document (Art. 219a(1)), which version 0 does not cover",
    "a Portuguese small business exempt in Spain under the cross-border scheme (OBT-RCP-4-02: Spain governs, not covered)": "OBT-RCP-4-02: decision 0: the cross-border small-business exemption (Art. 284(2)) is for a supply in a Member State other than the seller's, so that State's invoicing rules govern the document (Art. 219a(1)), which version 0 does not cover",
    "a German small business exempt in Portugal under the cross-border scheme (OBT-RCP-4-02: Portugal governs, not covered)": "OBT-RCP-4-02: decision 0: the cross-border small-business exemption (Art. 284(2)) is for a supply in a Member State other than the seller's, so that State's invoicing rules govern the document (Art. 219a(1)), which version 0 does not cover",
    "a Portuguese place with no region": "OBT-PT-3-02: decision 0: a Portuguese place needs its region (mainland, azores, madeira)",
    "a Portuguese act code that is not in the annex": "OBT-PT-3-03: decision 0: PT-CODIGO-X is not a Portuguese act code",
    "a reverse charge with no AT code": "OBT-PT-3-04: decision 0: a decision with no VAT needs pt.saft_exemption_code",
    "a standard-rated decision with an AT code": "OBT-PT-3-04: decision 0: a decision with VAT carries no exemption code",
    "an AT code that is not in the table": "OBT-PT-3-05: decision 0: M08 is not in AT's table",
    "M16 (intra-EU goods) on a reverse-charged service": "OBT-PT-3-06: decision 0: M16 goes with K, not AE",
    "M13 (second-hand goods) with the VATEX of travel agents": "OBT-PT-3-06: decision 0: M13 with E goes with VATEX-EU-F, not VATEX-EU-D",
    "the mention of another code": "OBT-PT-3-08: decision 0: the mention of M40 must be AT's (IVA - autoliquidação)",
    "M35 on an invoice before 1 July 2026": "OBT-PT-3-07: decision 0: M35 applies from 2026-07-01",
    "a withholding at 23 % that names the 11.5 % basis": "OBT-PT-4-02: cirs_101_1_c is 11.5 %, not 23 %",
    "a waiver that is not in CIRS Art. 101.º-B n.º 1": "OBT-PT-4-03: cirs_101b_1_z is not a waiver of CIRS Art. 101.º-B n.º 1",
    "a standard rate that does not say where its tier came from (OBT-RCP-5.5-19)": "OBT-RCP-5.5-19: decision 0: a S rate names where its tier came from (basis.rate)",
    "a rate basis on a reverse charge, which has no tier (OBT-RCP-5.5-19)": "OBT-RCP-5.5-19: decision 0: basis.rate is only for a rated category (S, L, M), not AE",
    "one kind of fact named twice (OBT-RCP-5.5-20)": "OBT-RCP-5.5-20: decision 0: buyer_taxable_status is named twice",
    "a stand-in rate under a \"correct\" promise (OBT-RCP-5.5-22)": "OBT-RCP-5.5-22: a decision rests on an assumed fact or a stand-in rate, so assurance.treatment is provisional",
    "a basis that is not an object": "schema: /decisions/0/basis must be object",
    "a basis whose facts are not a list": "schema: /decisions/0/basis/facts must be array",
    "a basis with an empty fact": "schema: /decisions/0/basis/facts/4 must be object",
    "a fact of a kind not in the list": "schema: /decisions/0/basis/facts/4/kind must be equal to one of the allowed values",
    "a supply nature \"checked\" with no check behind it (OBT-RCP-5.5-21)": "OBT-RCP-5.5-21: decision 0: supply_nature is \"checked\" but no check of the receipt backs it",
    "a buyer location \"evidenced\" with no location evidence (OBT-RCP-5.5-21)": "OBT-RCP-5.5-21: decision 0: buyer_location is \"evidenced\" but the decision holds no location evidence for it",
    "a list-item rate that cites no Directive point (OBT-RCP-5.5-36)": "OBT-RCP-5.5-36: decision 0: a rate from a national list cites, in law, the Directive point that allows it (e.g. \"Annex III(3)\", \"105a(3)\")",
    "a list-item rate citing a deleted Annex III point (OBT-RCP-5.5-36: point 14 is gone)": "OBT-RCP-5.5-36: decision 0: a rate from a national list cites, in law, the Directive point that allows it (e.g. \"Annex III(3)\", \"105a(3)\")",
    "an Annex III point cited under another EU act, not the Directive (OBT-RCP-5.5-36)": "OBT-RCP-5.5-36: decision 0: a rate from a national list cites, in law, the Directive point that allows it (e.g. \"Annex III(3)\", \"105a(3)\")",
    "a legal reference to another article than its entry (OBT-RCP-5.5-37, Part 10 OBT-REF-7-04)": "OBT-RCP-5.5-37: decision 0, law 0: the reference \"eu:dir.2006.112@2025-04-14/art_45\" is \"45\", and the entry's article is \"44\"",
    "a legal reference that names no edition (OBT-RCP-5.5-37, Part 10 OBT-REF-7-02)": "OBT-RCP-5.5-37: decision 0, law 0: the reference \"eu:dir.2006.112/art_44\" names no edition",
    "a legal reference to another act than its entry (OBT-RCP-5.5-37, Part 10 OBT-REF-7-03)": "OBT-RCP-5.5-37: decision 0, law 0: the reference \"eu:reg-impl.2011.282@2025-04-14/art_44\" is the act http://data.europa.eu/eli/reg_impl/2011/282/oj, and the entry's act is http://data.europa.eu/eli/dir/2006/112/oj",
    "a legal reference without the a contrario reading of its entry (OBT-RCP-5.5-37, Part 10 OBT-REF-7-05)": "OBT-RCP-5.5-37: decision 0, law 2: the reference \"pt:civa@2026-05-20/art_6/par_6/pnt_a\" has the reading none, and the entry's is a_contrario",
    "a legal reference that does not parse, never repaired (OBT-RCP-5.5-37, LexPin LEXPIN-4-03)": "OBT-RCP-5.5-37: decision 0, law 0: the reference \"eu:dir.2006.112@2025-04-14/article_44\" does not parse (kind at \"article\")",
    "a list-item rate that does not cite its item (OBT-PT-3-11)": "OBT-PT-3-11: decision 0: a rate from one of CIVA's lists cites its item in law (e.g. \"Lista I verba 2.27\")",
    "an assumed fact under a \"correct\" promise (OBT-RCP-5.5-22)": "OBT-RCP-5.5-22: a decision rests on an assumed fact or a stand-in rate, so assurance.treatment is provisional",
    "a consolidated-version ELI (it redirects for any date, Part 3 clause 5.5)": "schema: /decisions/0/law/0/act must match pattern \"^(http://data\\.europa\\.eu/eli/(dir|reg|reg_impl|dec|dec_impl)/[0-9]{4}/[0-9]{1,5}/oj|[A-Z]{2}-[A-Z0-9-]{2,24})$\"",
    "no withholding, yet a withholder named (Part 3 clause 5.6: absent otherwise)": "schema: /withholding must NOT be valid",
    "the report as one object, not a list (OBT-RCP-5.8-05)": "schema: /report must be array",
    "a report with no regime (OBT-RCP-5.8-06)": "schema: /report/0 must have required property 'regime'",
    "a report regime the governing State's annex does not list (OBT-RCP-5.8-06)": "OBT-RCP-5.8-06: report 0: PT-SAFT is neither EU-DRR nor a regime of the PT annex",
    "the EU digital reporting for a document issued before 1 July 2030 (OBT-RCP-5.8-07)": "OBT-RCP-5.8-07: report 1: EU-DRR is for a document issued from 2030-07-01",
    "the same authority and regime reported twice (OBT-RCP-5.8-08)": "OBT-RCP-5.8-08: report 1: a second entry for PT-AT under PT-EFATURA",
    "the e-invoice hash as the old single member einvoice_sha256 (OBT-RCP-5.3-11)": "schema: /document must NOT have additional properties",
    "two e-invoice entries with one hash (OBT-RCP-5.3-18)": "OBT-RCP-5.3-18: two einvoices entries with the same sha256",
    "an e-invoice syntax EN 16931-3 does not bind (OBT-RCP-5.3-18)": "schema: /document/einvoices/0/syntax must be equal to one of the allowed values",
    "an e-invoice entry with no BT-24 (OBT-RCP-5.3-18)": "schema: /document/einvoices/0 must have required property 'specification'",
    "a BT-24 with a space at its end: the XML's value has its ends trimmed (OBT-RCP-5.3-18)": "schema: /document/einvoices/0/specification must match pattern \"^[^\\u0000-\\u0020\\u007F](?:[^\\u0000-\\u001F\\u007F]*[^\\u0000-\\u0020\\u007F])?$\"",
    "a facilitation service placed under Art. 46a before 1 July 2028, the day it applies from (OBT-RCP-5.5-38)": "OBT-RCP-5.5-38: decision 0: facilitation_service is for a tax point from 2028-07-01 (Directive Art. 46a); this one is 2027-01-13",
    "a facilitation service from 1 July 2028 that does not cite Art. 46a (OBT-RCP-5.5-38)": "OBT-RCP-5.5-38: decision 0: facilitation_service cites Directive Art. 46a in law",
    "a chargeable date that is no calendar date: 31 February (OBT-RCP-5.1-07, 5.3-15)": "OBT-RCP-5.1-07: 2027-02-31 is not a calendar date"
  },
  "$comment_schema_rule": "For each broken copy the JSON Schema refuses, the rule of the text it breaks: the most exact one, else OBT-RCP-5.1-01 (the claims validate against Annex A.1). make-vectors.mjs writes it as the vector's `rule`, so a checker that names rules, not schema paths, is held to the same rule.",
  "schema_rule": {
    "a VATEX code on a standard-rated line": "OBT-RCP-5.5-12",
    "a reverse charge without its basis": "OBT-RCP-5.5-27",
    "a treatment word that is not in the list": "OBT-RCP-5.1-05",
    "money as a JSON number": "OBT-RCP-5.1-03",
    "a free-text member the type does not define": "OBT-RCP-5.1-02",
    "a free-text member inside a check": "OBT-RCP-5.1-02",
    "the ETSI status members CIR 2026/1731 made void (EAA-5.2.10.1-04 to -12)": "OBT-RCP-9.1-01",
    "a credit note with no preceding document": "OBT-RCP-5.3-14",
    "both a supply date and a supply period": "OBT-RCP-5.3-04",
    "no file hash and no GOBL digest": "OBT-RCP-5.3-11",
    "a B2B buyer with no business proof": "OBT-RCP-5.4-03",
    "a consumer with a business proof": "OBT-RCP-5.4-03",
    "a VIES check that is unavailable but names a name-and-address result": "OBT-RCP-5.7-13",
    "an attested check without its code location": "OBT-RCP-5.7-07",
    "an engine with a plain SHA-256 of the inputs": "OBT-RCP-5.5-34",
    "an article-level ELI": "OBT-RCP-5.1-08",
    "a consolidated-version ELI (it redirects for any date, Part 3 clause 5.5)": "OBT-RCP-5.1-08",
    "no withholding, yet a withholder named (Part 3 clause 5.6: absent otherwise)": "OBT-RCP-5.6-03",
    "the status URL over plain HTTP": "OBT-RCP-5.1-08",
    "a consolidation id that is not a CELEX consolidation number": "OBT-RCP-5.1-08",
    "a withholding that applies with no amount": "OBT-RCP-5.6-03",
    "a tax id in lower case (the canonical form is upper case)": "OBT-RCP-5.4-05",
    "a tax id with a space": "OBT-RCP-5.4-05",
    "a tax id with dots": "OBT-RCP-5.4-05",
    "a document number with a Cyrillic letter that looks Latin": "OBT-RCP-5.3-02",
    "a document number with an accented letter": "OBT-RCP-5.3-02",
    "a document number with two spaces": "OBT-RCP-5.3-02",
    "a document number with a trailing space": "OBT-RCP-5.3-02",
    "a document number with a zero-width space": "OBT-RCP-5.3-02",
    "S at rate 0 (BR-S-05)": "OBT-RCP-5.5-11",
    "Z at a non-zero rate (BR-Z-05)": "OBT-RCP-5.5-11",
    "O with a rate (BR-O-05)": "OBT-RCP-5.5-11",
    "E with the reverse-charge VATEX code (PEPPOL-EN16931-P0104)": "OBT-RCP-5.5-12",
    "only a charge, no line (BR-16)": "OBT-RCP-5.5-02",
    "type 384 (not in v0; Peppol P0112)": "OBT-RCP-5.3-01",
    "a rate written as 0.00 (one spelling only)": "OBT-RCP-5.1-05",
    "money written as -0.00 (one spelling only)": "OBT-RCP-5.1-03",
    "AE with the supplier liable": "OBT-RCP-5.5-13",
    "_sd_alg left in the processed claims (RFC 9901 7.1 step 3.f removes it)": "OBT-RCP-5.2-10",
    "the treatment zero_unclassified (Art. 226(11): the invoice names the provision)": "OBT-RCP-5.1-05",
    "a promise of \"correct\" on the buyer's own word (Reg. 282/2011 Art. 18)": "OBT-RCP-5.9-01",
    "the Art. 59c threshold on a rule it does not cover": "OBT-RCP-5.5-14",
    "a margin scheme shown as standard-rated (Art. 325)": "OBT-RCP-5.5-15",
    "a reading that is not in the list": "OBT-RCP-5.1-05",
    "a basis that is not an object": "OBT-RCP-5.5-33",
    "a basis whose facts are not a list": "OBT-RCP-5.5-33",
    "a basis with an empty fact": "OBT-RCP-5.5-33",
    "a fact of a kind not in the list": "OBT-RCP-5.1-05",
    "the report as one object, not a list (OBT-RCP-5.8-05)": "OBT-RCP-5.8-05",
    "a report with no regime (OBT-RCP-5.8-06)": "OBT-RCP-5.8-06",
    "the e-invoice hash as the old single member einvoice_sha256 (OBT-RCP-5.3-11)": "OBT-RCP-5.1-02",
    "an e-invoice syntax EN 16931-3 does not bind (OBT-RCP-5.3-18)": "OBT-RCP-5.3-18",
    "an e-invoice entry with no BT-24 (OBT-RCP-5.3-18)": "OBT-RCP-5.3-18",
    "a BT-24 with a space at its end: the XML's value has its ends trimmed (OBT-RCP-5.3-18)": "OBT-RCP-5.3-18"
  }
}
