@mudraforge/statutory 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (176) hide show
  1. package/CHANGELOG.md +172 -1
  2. package/CONTRIBUTING.md +2 -2
  3. package/README.md +14 -1
  4. package/SECURITY.md +2 -2
  5. package/SKILL.md +1 -1
  6. package/bin/cli.js +288 -27
  7. package/docs/ACCOUNTING_ASSURANCE_AUDIT_DOSSIER.md +276 -0
  8. package/docs/ARCHITECTURE.md +76 -53
  9. package/docs/ARCHITECTURE_DECISIONS.md +22 -2
  10. package/docs/CASE_01_FORM_TEXT.txt +48 -0
  11. package/docs/CATALOG.md +405 -39
  12. package/docs/CA_PILOT_BENCHMARK_CASES.md +282 -0
  13. package/docs/CORPUS_QUALITY.md +31 -22
  14. package/docs/DOMAIN_BREADTH_AND_DEPTH_COMPARISON.md +5 -5
  15. package/docs/ENTERPRISE_GOVERNANCE.md +2 -1
  16. package/docs/OKF_MAINTENANCE_SOP.md +5 -5
  17. package/docs/PILOT_EVALUATION_GUIDE.md +5 -4
  18. package/docs/PROVENANCE.md +6 -6
  19. package/docs/VERIFICATION.md +6 -6
  20. package/okf/corporate_ma_restructuring/business_combinations_indas_103/ast.json +20 -0
  21. package/okf/corporate_ma_restructuring/business_combinations_indas_103/circulars/mca_notification_indas_103_business_combinations.md +41 -0
  22. package/okf/corporate_ma_restructuring/business_combinations_indas_103/forms/purchase_price_allocation_schedule.json +110 -0
  23. package/okf/corporate_ma_restructuring/business_combinations_indas_103/section.json +65 -0
  24. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/ast.json +20 -0
  25. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/circulars/mca_notification_indas_36_impairment.md +45 -0
  26. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/forms/cgu_impairment_testing_register.json +53 -0
  27. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/section.json +61 -0
  28. package/okf/corporate_ma_restructuring/loss_carryforward_sec79/ast.json +33 -0
  29. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/ast.json +20 -0
  30. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/circulars/icai_guidance_share_based_payments.md +37 -0
  31. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/forms/esop_graded_vesting_amortization_schedule.json +49 -0
  32. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/section.json +60 -0
  33. package/okf/corporate_ma_restructuring/slump_sale_50b/ast.json +21 -0
  34. package/okf/corporate_ma_restructuring/tax_clearance_sec281/ast.json +21 -0
  35. package/okf/direct_tax/corporate_tax_115baa_115jb/ast.json +23 -0
  36. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/ast.json +20 -0
  37. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/circulars/mca_notification_indas_12_income_taxes.md +40 -0
  38. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/forms/deferred_tax_asset_liability_reconciliation_schedule.json +46 -0
  39. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/section.json +61 -0
  40. package/okf/direct_tax/special_rates_non_filer_206ab/ast.json +26 -0
  41. package/okf/direct_tax/statutory_disallowance_43b/ast.json +35 -0
  42. package/okf/direct_tax/tcs_goods_206c_1h/ast.json +69 -0
  43. package/okf/direct_tax/tds_commission_194h/ast.json +60 -0
  44. package/okf/direct_tax/tds_commission_194h/section.json +5 -4
  45. package/okf/direct_tax/tds_contractor_194c/ast.json +71 -0
  46. package/okf/direct_tax/tds_contractor_194c/section.json +3 -3
  47. package/okf/direct_tax/tds_ecommerce_194o/ast.json +48 -0
  48. package/okf/direct_tax/tds_ecommerce_194o/section.json +3 -3
  49. package/okf/direct_tax/tds_goods_194q/ast.json +71 -0
  50. package/okf/direct_tax/tds_goods_194q/circulars/cbdt_circular_13_2021_guidelines.md +2 -2
  51. package/okf/direct_tax/tds_goods_194q/section.json +9 -3
  52. package/okf/direct_tax/tds_goods_393/ast.json +59 -0
  53. package/okf/direct_tax/tds_goods_393/section.json +6 -4
  54. package/okf/direct_tax/tds_individual_contract_194m/ast.json +59 -0
  55. package/okf/direct_tax/tds_individual_contract_194m/section.json +3 -3
  56. package/okf/direct_tax/tds_interest_194a/ast.json +59 -0
  57. package/okf/direct_tax/tds_interest_194a/section.json +7 -4
  58. package/okf/direct_tax/tds_perquisites_194r/ast.json +47 -0
  59. package/okf/direct_tax/tds_perquisites_194r/section.json +1 -1
  60. package/okf/direct_tax/tds_property_194ia/ast.json +70 -0
  61. package/okf/direct_tax/tds_property_194ia/section.json +3 -3
  62. package/okf/direct_tax/tds_rent_194i/ast.json +60 -0
  63. package/okf/direct_tax/tds_rent_194i/section.json +5 -4
  64. package/okf/direct_tax/tds_rent_individual_194ib/ast.json +59 -0
  65. package/okf/direct_tax/tds_rent_individual_194ib/section.json +2 -2
  66. package/okf/direct_tax/tds_services_194j/ast.json +60 -0
  67. package/okf/direct_tax/tds_services_194j/circulars/cbdt_circular_03_2020_fts_rate_cut.md +1 -1
  68. package/okf/direct_tax/tds_services_194j/section.json +10 -3
  69. package/okf/indirect_tax_gst/blocked_itc_17_5/ast.json +26 -0
  70. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/ast.json +26 -0
  71. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/circulars/cbic_circular_170_2022_itc_reporting.md +30 -0
  72. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/circulars/cbic_notification_18_2022_cutoff_amendment.md +26 -0
  73. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/forms/gstr_3b_table_4b1_reversal_schedule.json +101 -0
  74. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/forms/rule_42_43_annual_reconciliation_worksheet.json +87 -0
  75. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/section.json +65 -0
  76. package/okf/indirect_tax_gst/composite_mixed_supplies_sec8/ast.json +21 -0
  77. package/okf/indirect_tax_gst/composition_levy_sec10/ast.json +23 -0
  78. package/okf/indirect_tax_gst/credit_debit_notes_sec34/ast.json +21 -0
  79. package/okf/indirect_tax_gst/e_invoicing_rule48_4/ast.json +20 -0
  80. package/okf/indirect_tax_gst/export_services_lut_sec16/ast.json +20 -0
  81. package/okf/indirect_tax_gst/gst_tds_sec51/ast.json +23 -0
  82. package/okf/indirect_tax_gst/itc_eligibility_16_2/ast.json +20 -0
  83. package/okf/indirect_tax_gst/itc_reversal_rule37_37a/ast.json +45 -0
  84. package/okf/indirect_tax_gst/itc_reversal_rule37_37a/circulars/cbic_circular_192_2023_ecl_interest_calculation.md +36 -0
  85. package/okf/indirect_tax_gst/itc_reversal_rule37_37a/section.json +8 -1
  86. package/okf/indirect_tax_gst/rcm_liability_sec9_3/ast.json +26 -0
  87. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/cbic_notification_07_2025_composition_rent_exclusion.md +41 -0
  88. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/cbic_notification_09_2024_renting_rcm.md +37 -0
  89. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/gst_council_55th_meeting_renting_rcm_regularization.md +31 -0
  90. package/okf/indirect_tax_gst/rcm_liability_sec9_3/section.json +24 -2
  91. package/okf/international_tax/cross_border_remittance_195/ast.json +39 -0
  92. package/okf/international_tax/financial_instruments_ecl_indas_109/ast.json +24 -0
  93. package/okf/international_tax/financial_instruments_ecl_indas_109/circulars/mca_notification_indas_109_financial_instruments.md +43 -0
  94. package/okf/international_tax/financial_instruments_ecl_indas_109/forms/indas_109_ecl_provision_matrix_schedule.json +43 -0
  95. package/okf/international_tax/financial_instruments_ecl_indas_109/section.json +62 -0
  96. package/okf/international_tax/foreign_exchange_indas_21_109/ast.json +20 -0
  97. package/okf/international_tax/foreign_tax_credit_irc_901_904/ast.json +20 -0
  98. package/okf/international_tax/transfer_pricing_alp_92c/ast.json +25 -0
  99. package/okf/manifest.json +117 -20
  100. package/okf/msme_commercial/delayed_payments_15_16/ast.json +38 -0
  101. package/okf/msme_commercial/enterprise_classification_sec7/ast.json +25 -0
  102. package/okf/msme_commercial/lease_accounting_indas_116/ast.json +20 -0
  103. package/okf/msme_commercial/lease_accounting_indas_116/circulars/mca_notification_indas_116_leases.md +48 -0
  104. package/okf/msme_commercial/lease_accounting_indas_116/forms/lease_rou_asset_and_liability_schedule.json +55 -0
  105. package/okf/msme_commercial/lease_accounting_indas_116/section.json +67 -0
  106. package/okf/msme_commercial/mca_msme_1_filing/ast.json +20 -0
  107. package/okf/msme_commercial/provisions_contingencies_indas_37/ast.json +20 -0
  108. package/okf/msme_commercial/provisions_contingencies_indas_37/circulars/mca_notification_indas_37_provisions.md +36 -0
  109. package/okf/msme_commercial/provisions_contingencies_indas_37/forms/provisions_and_contingent_liabilities_register.json +38 -0
  110. package/okf/msme_commercial/provisions_contingencies_indas_37/section.json +61 -0
  111. package/okf/msme_commercial/revenue_recognition_indas_115/ast.json +20 -0
  112. package/okf/msme_commercial/revenue_recognition_indas_115/circulars/mca_notification_indas_115_revenue_contracts.md +56 -0
  113. package/okf/msme_commercial/revenue_recognition_indas_115/forms/revenue_contract_5step_allocation_schedule.json +54 -0
  114. package/okf/msme_commercial/revenue_recognition_indas_115/section.json +69 -0
  115. package/okf/msme_commercial/statutory_disclosures_sec22/ast.json +21 -0
  116. package/package.json +22 -1
  117. package/src/calculators.js +2195 -260
  118. package/src/constants.js +1 -1
  119. package/src/index.js +421 -23
  120. package/src/payroll.js +506 -0
  121. package/src/tally.js +812 -0
  122. package/src/usvm/evaluation_vm.js +504 -0
  123. package/src/usvm/index.js +65 -0
  124. package/src/usvm/math_rational.js +165 -0
  125. package/src/usvm/rules/sec_115baa_115jb_mat.json +23 -0
  126. package/src/usvm/rules/sec_192_salary_tds.json +23 -0
  127. package/src/usvm/rules/sec_194a_interest.json +59 -0
  128. package/src/usvm/rules/sec_194c_contractors.json +71 -0
  129. package/src/usvm/rules/sec_194h_commission.json +60 -0
  130. package/src/usvm/rules/sec_194i_rent.json +60 -0
  131. package/src/usvm/rules/sec_194ia_property.json +70 -0
  132. package/src/usvm/rules/sec_194ib_rent_ind.json +59 -0
  133. package/src/usvm/rules/sec_194j_services.json +60 -0
  134. package/src/usvm/rules/sec_194m_contract_ind.json +59 -0
  135. package/src/usvm/rules/sec_194o_ecommerce.json +48 -0
  136. package/src/usvm/rules/sec_194q_goods.json +71 -0
  137. package/src/usvm/rules/sec_194r_perquisites.json +47 -0
  138. package/src/usvm/rules/sec_195_cross_border.json +39 -0
  139. package/src/usvm/rules/sec_206ab_non_filer.json +26 -0
  140. package/src/usvm/rules/sec_206c1h_tcs.json +69 -0
  141. package/src/usvm/rules/sec_281_tax_clearance.json +21 -0
  142. package/src/usvm/rules/sec_393_goods.json +59 -0
  143. package/src/usvm/rules/sec_43bh_disallowance.json +35 -0
  144. package/src/usvm/rules/sec_50b_slump_sale.json +21 -0
  145. package/src/usvm/rules/sec_79_loss_continuity.json +33 -0
  146. package/src/usvm/rules/sec_92c_transfer_pricing.json +25 -0
  147. package/src/usvm/rules/sec_ftc_dtaa_relief.json +20 -0
  148. package/src/usvm/rules/sec_gst_blocked_itc_17_5.json +26 -0
  149. package/src/usvm/rules/sec_gst_composite_mixed_8.json +21 -0
  150. package/src/usvm/rules/sec_gst_composition_levy_10.json +23 -0
  151. package/src/usvm/rules/sec_gst_credit_debit_notes_34.json +21 -0
  152. package/src/usvm/rules/sec_gst_einvoicing_rule48_4.json +20 -0
  153. package/src/usvm/rules/sec_gst_ewaybill_rule138.json +21 -0
  154. package/src/usvm/rules/sec_gst_export_lut_16.json +20 -0
  155. package/src/usvm/rules/sec_gst_itc_eligibility_16_2.json +20 -0
  156. package/src/usvm/rules/sec_gst_itc_reversal_rule37_37a.json +45 -0
  157. package/src/usvm/rules/sec_gst_rcm_liability_9_3.json +26 -0
  158. package/src/usvm/rules/sec_gst_rule42_43_apportionment.json +26 -0
  159. package/src/usvm/rules/sec_gst_tds_sec51.json +23 -0
  160. package/src/usvm/rules/sec_indas102_esop.json +20 -0
  161. package/src/usvm/rules/sec_indas103_mna.json +20 -0
  162. package/src/usvm/rules/sec_indas109_ecl.json +24 -0
  163. package/src/usvm/rules/sec_indas115_revenue.json +20 -0
  164. package/src/usvm/rules/sec_indas116_leases.json +20 -0
  165. package/src/usvm/rules/sec_indas12_deferred_tax.json +20 -0
  166. package/src/usvm/rules/sec_indas21_fx_reval.json +20 -0
  167. package/src/usvm/rules/sec_indas36_impairment.json +20 -0
  168. package/src/usvm/rules/sec_indas37_provisions.json +20 -0
  169. package/src/usvm/rules/sec_msme_classification_sec7.json +25 -0
  170. package/src/usvm/rules/sec_msme_delayed_payments_15_16.json +38 -0
  171. package/src/usvm/rules/sec_msme_disclosures_sec22.json +21 -0
  172. package/src/usvm/rules/sec_msme_mca_form_1.json +20 -0
  173. package/src/usvm/schemas/statutory_ast_schema.js +203 -0
  174. package/src/usvm/usvm_domain_evaluators.js +1021 -0
  175. package/src/zoho_gstr2b.js +2964 -0
  176. package/types/index.d.ts +515 -0
@@ -0,0 +1,276 @@
1
+ # MudraForge Accounting Assurance & Statutory Audit Defense Dossier
2
+
3
+ This document serves as the authoritative, permanent reference manual and verification catalog for the enterprise Accounts Payable (AP) reconciliation, numerical hygiene, and statutory assurance capabilities implemented in `@mudraforge/statutory`.
4
+
5
+ External technical, financial, and tax audits (e.g. Big-4 accounting firms, statutory auditors, tax counsel) frequently probe automated financial platforms for theoretical shortcuts, unhandled edge cases, and legal misinterpretations. This dossier establishes the legal ground truth, mathematical definitions, error boundaries, and corresponding automated regression tests (Tests 120 through 146 in `packages/statutory/test.js`) that guarantee deterministic audit defensibility.
6
+
7
+ ---
8
+
9
+ ## 1. Architectural Philosophy: From Statutory Calculation to Accounting Assurance
10
+
11
+ A statutory calculation engine that merely implements standalone formulas (e.g. `turnover * 0.001`) fails when exposed to real enterprise ERP exports. Raw corporate accounting data is inherently messy: it contains parenthesized credits, trailing minus signs, inconsistent currency formatting, conflicting tax allocations, multi-state branch structures, and varying payment appropriation policies.
12
+
13
+ MudraForge implements **Transaction-Level Accounting Assurance**:
14
+
15
+ ```
16
+ Messy Accounting Ingestion (Zoho Books / Tally Daybooks / GSTR-2B)
17
+ ↓
18
+ Four-State Numeric Classification & Integer-Paise Normalization (Zero Drift)
19
+ ↓
20
+ Epistemic Uncertainty Gate (ISO Mod-36 Checksums, Duplicate Billing, Defective Tax Splits)
21
+ ↓
22
+ 4-Way Decoupled Jurisdictional Evaluation (Tax Classification, Jurisdiction, Eligibility, Routing)
23
+ ↓
24
+ Statutory Provisos & Accounting Math (Rule 37 Proportional Allocation, Rule 88B ECL Audit)
25
+ ↓
26
+ Actionable Exception Register & Executive Audit Memorandum (isAuthorizedToDisburse: false)
27
+ ```
28
+
29
+ ---
30
+
31
+ ## 2. Numerical Hygiene & Input Boundary Hardening
32
+
33
+ ### 2.1 Four-State Numeric Classification Model
34
+ Standard JavaScript type coercion (`Number(x) || 0`) introduces catastrophic statutory failures: malformed strings (e.g. `"₹ 10,00,000"`, `"#VALUE!"`) silently evaluate to `NaN` and collapse to `0`, preventing mandatory tax deductions and creating massive penal exposure under Section 40(a)(ia).
35
+
36
+ MudraForge's `cleanNumericAmount(val, options)` classifies every numeric input into one of four distinct states:
37
+
38
+ | Input State | Example | Engine Behavior | Statutory Rationale |
39
+ |---|---|---|---|
40
+ | **Valid Numeric** | `100000`, `"₹ 10,00,000"`, `"(₹ 50,000)"` | Deterministic float or integer paise | Legitimate transaction amount. |
41
+ | **Valid Zero** | `0`, `"0"`, `"₹ 0.00"` | Returns `0` (or `0` paise) | Explicit non-taxable base or zero-rated voucher. |
42
+ | **Missing Optional** | `undefined`, `null`, `""` (when optional) | Returns `options.defaultValue` | Unused optional fields (e.g. surcharge, cess). |
43
+ | **Missing Mandatory** | `undefined`, `null`, `""` (when mandatory) | Throws `MissingMandatoryParameterError` | Essential statutory threshold inputs cannot be guessed. |
44
+ | **Malformed Representation** | `"100 200"`, `"1,,000"`, `"#VALUE!"` | Throws `MalformedNumericInputError` | Prevents corrupt ERP exports from silently distorting tax calculations. |
45
+
46
+ ### 2.2 Integer-Paise Arithmetic & Max Safe Integer Boundary
47
+ To eliminate floating-point drift across cumulative annual purchases and multi-invoice allocations:
48
+ - **Integer Representation**: All intermediate thresholds, allocations, and variances are converted to integer paise using `toIntegerPaise(amount)`.
49
+ - **Ceiling Boundary**: Values exceeding `Number.MAX_SAFE_INTEGER` (9,007,199,254,740,991 paise = ₹90,071,992,547,409.91) are rejected fail-closed to prevent IEEE 754 precision degradation.
50
+ - **Sub-Paisa Rounding**: Half-up rounding (`roundToPaisa(amount)`) is applied consistently.
51
+
52
+ ### 2.3 Accounting Format Ingestion
53
+ - **Parenthesized Negatives**: Accounting conventions representing negative balances as `(₹ 50,000.00)` or `INR (25,000)` are parsed as negative numbers.
54
+ - **Trailing Minus**: ERP formats such as `50,000.00-` are normalized to `-50000.00`.
55
+ - **Ledger-Aware CR Credits**: Credit indicators (`CR`) are not blindly negated; credit balances are preserved as positive balances unless `{ interpretCreditAsNegative: true }` is explicitly requested by the ledger parser.
56
+
57
+ ---
58
+
59
+ ## 3. Four-Way Decoupled Jurisdictional Matrix
60
+
61
+ Enterprise ERP workflows cannot rely on a single binary eligibility flag (`ELIGIBLE` vs `INELIGIBLE`). Real tax assurance requires decoupling four orthogonal decisions on every transaction:
62
+
63
+ ```
64
+ Transaction Evaluation
65
+ │
66
+ ┌──────────────────┬──────────────┴─────┬─────────────────┐
67
+ ▼ ▼ ▼ ▼
68
+ 1. Tax Determination 2. Recipient 3. ITC 4. Operational
69
+ (IGST Act Sec 5/10) Jurisdiction Eligibility Routing
70
+ (CGST Sec 25(4)) (Sec 16/17(5)) (ERP Action)
71
+ ```
72
+
73
+ ### 3.1 Decision Taxonomy
74
+
75
+ #### 1. Tax Determination (`taxClassification`)
76
+ - `INTRASTATE_CORRECT`: Supplier state equals POS state; local CGST + SGST charged correctly.
77
+ - `INTERSTATE_CORRECT`: Supplier state differs from POS state; IGST charged correctly.
78
+ - `ERRONEOUS_INTRASTATE_LEVY`: Supplier state differs from POS, but supplier erroneously charged local CGST/SGST.
79
+ - `ERRONEOUS_INTERSTATE_LEVY`: Supplier state equals POS, but supplier erroneously charged IGST.
80
+ - `INDETERMINATE`: Missing Place of Supply or conflicting tax split.
81
+
82
+ #### 2. Recipient Jurisdiction (`recipientJurisdiction`)
83
+ - `FILING_GSTIN_MATCHES_POS`: The filing entity's registered state matches the Place of Supply.
84
+ - `REGISTERED_DISTINCT_PERSON_BRANCH`: Recipient's corporate enterprise maintains a valid distinct-person GSTIN under Section 25(4) in the POS state.
85
+ - `UNREGISTERED_IN_POS_STATE`: Recipient has no GST registration in the POS state.
86
+ - `INDETERMINATE`: Missing recipient or POS state code.
87
+
88
+ #### 3. ITC Eligibility (`itcEligibility`)
89
+ - `ELIGIBLE_NORMAL`: Valid tax invoice, populated in GSTR-2B, no statutory blocks.
90
+ - `ELIGIBLE_IN_BRANCH_RETURN`: Valid tax credit, but must be claimed in the branch GSTIN's GSTR-3B.
91
+ - `INELIGIBLE_STRANDED_LOCAL_LEVY`: Mandatory local supply under Section 12(3)/12(4) (e.g. hotel, catering) in a state where recipient is unregistered.
92
+ - `INELIGIBLE_BLOCKED_SEC_17_5`: Blocked under Section 17(5) (motor vehicles, outdoor catering, employee personal perks).
93
+ - `INELIGIBLE_DEFECTIVE_INVOICE`: Defective tax split or erroneous jurisdiction.
94
+ - `INELIGIBLE_PORTAL_FLAGGED`: Flagged ineligible by GSTN portal in Form GSTR-2B (e.g. Section 16(4) time-bar).
95
+ - `PROVISIONAL_PENDING_FILING`: Missing in current GSTR-2B, credit restricted under Section 16(2)(aa) and Rule 36(4).
96
+ - `INDETERMINATE`: Requires human review.
97
+
98
+ #### 4. Operational Routing (`operationalRouting`)
99
+ - `CLAIM_IN_CURRENT_GSTR3B_TABLE_4A5`: Avail in current tax period return.
100
+ - `ROUTE_TO_BRANCH_GSTIN`: Route accounting voucher to branch entity for inclusion in their state return.
101
+ - `BOOK_AS_EXPENSE_NO_ITC`: Absorb tax component as business operating expense; do not avail in ECL.
102
+ - `REPORT_IN_GSTR3B_TABLE_4B1_PERMANENT_REVERSAL`: Report permanent non-reclaimable reversal.
103
+ - `REQUEST_VENDOR_CREDIT_NOTE_AMENDMENT`: Issue commercial dispute notice demanding credit note and reissue.
104
+ - `WITHHOLD_CLAIM_PENDING_SUPPLIER_GSTR1`: Withhold claim until vendor files Form GSTR-1/IFF.
105
+ - `PHYSICAL_GOODS_RECEIPT_VERIFICATION_PENDING`: In GSTR-2B but missing in books (unrecorded AP or transit).
106
+ - `MANUAL_HUMAN_INVESTIGATION_REQUIRED`: Escalate to senior tax auditor.
107
+
108
+ ---
109
+
110
+ ## 4. Rule 37 Proportional Reversal & Rule 88B(3) ECL Audit
111
+
112
+ ### 4.1 Section 16(2) Second Proviso & Rule 37 Payment Appropriation
113
+ Section 16(2) second proviso requires a recipient to pay the supplier the value of supply along with tax within 180 days from the invoice date. Failure to pay triggers mandatory ITC reversal.
114
+
115
+ MudraForge implements three payment appropriation models:
116
+ 1. **`PROPORTIONATE` (Default Statutory Baseline)**:
117
+ $$\text{Unpaid Ratio} = \frac{\text{Balance Due}}{\text{Total Invoice Amount}}$$
118
+ $$\text{Reversal ITC} = \text{Total ITC} \times \text{Unpaid Ratio}$$
119
+ 2. **`VALUE_FIRST` (Contractual Preference)**:
120
+ Payments satisfy the taxable base first; remaining balance is attributed to unpaid tax.
121
+ 3. **`TAX_FIRST` (Tax Compliance Priority)**:
122
+ Payments satisfy tax liability first. Note: Failure to pay taxable consideration still triggers proportional reversal under Rule 37(1).
123
+
124
+ ### 4.2 Statutory Exemptions from Rule 37
125
+ - **Proviso 1 to Rule 37(1) — Reverse Charge (RCM)**: RCM supplies under Section 9(3)/9(4) are statutorily exempt because tax is paid directly to the Government, not the supplier.
126
+ - **Proviso 2 to Rule 37(1) — Schedule I Deemed Supplies**: Supplies without consideration between distinct or related persons are statutorily exempt.
127
+
128
+ ### 4.3 Rule 88B(3) Electronic Credit Ledger Audit & Section 50(1) Interest
129
+ Under Section 50(1) read with Rule 88B(3) (inserted retrospectively w.e.f. 1 July 2017), interest is levied **only when ITC has been wrongly availed and utilized**.
130
+
131
+ - **ECL Closing Balance Check**: If the minimum daily closing balance in the taxpayer's Electronic Credit Ledger (`minimumEclBalanceInr`) remained equal to or greater than the unreversed ITC throughout the default window:
132
+ $$\text{Wrongful Utilization} = \max(0, \text{Unreversed ITC} - \text{Minimum ECL Balance}) = ₹0.00$$
133
+ $$\text{Statutory Interest} = ₹0.00$$
134
+ - **Dipped Balance**: If the ECL balance dipped below the unreversed ITC, 18% annual interest is computed strictly on the utilized portion for the days elapsed past 180:
135
+ $$\text{Interest} = \text{Utilized Amount} \times \frac{0.18}{365} \times (\text{Days Elapsed} - 180)$$
136
+ - **Unavailable History**: If closing ledger balances are missing, the engine refuses to guess, issuing an advisory requiring human verification of ledger statements.
137
+
138
+ ---
139
+
140
+ ## 5. Epistemic Uncertainty & Fail-Closed Governance
141
+
142
+ When financial or legal evidence is incomplete, automated accounting engines must never fabricate certainty. MudraForge marks transactions as `REQUIRES_HUMAN_VERIFICATION` under five statutory conditions:
143
+
144
+ 1. **`INVALID_SUPPLIER_GSTIN_CHECKSUM`**: Supplier GSTIN fails ISO Mod-36 check digit calculation. Prevents claiming credits on invalid or fraudulent registrations.
145
+ 2. **`AMBIGUOUS_DUPLICATE_INVOICE_MATCH`**: Multiple candidate records share the identical supplier GSTIN and invoice number. Prevents guessing between duplicate billing and amended vouchers.
146
+ 3. **`CONTRADICTORY_TAX_SPLIT`**: Voucher contains concurrent CGST/SGST and IGST. Defective on its face under Section 31.
147
+ 4. **`MISSING_POS_DATA`**: Place of Supply is omitted or indeterminate in both Books and GSTR-2B.
148
+ 5. **`MISSING_ECL_HISTORY`**: Electronic Credit Ledger closing balances are omitted when evaluating delayed interest.
149
+
150
+ ---
151
+
152
+ ## 6. The Complete Verification Matrix: Tests 120 through 146
153
+
154
+ Every statutory capability and defensive boundary is continuously verified by deterministic regression tests in `packages/statutory/test.js`:
155
+
156
+ | Test # | Test Title | Statutory / Accounting Provision | Ground Truth Verified |
157
+ |---|---|---|---|
158
+ | **120** | Numerical Input Resilience & Currency Sanitization | Enterprise ERP Ingestion Standards | Normalizes `"₹ 10,00,000"`, `"1,23,456.78"`, whitespace, and non-finite inputs. |
159
+ | **121** | Excel Date Serial & Diverse Date Normalization | RFC 4180 / Microsoft Excel Standards | Normalizes Excel serial numbers (`45453` -> `2024-06-10`) and Indian date formats (`10/06/2024`). |
160
+ | **122** | Accounting Negative Formats: Parens, Minus & CR | GAAP / Ind AS Presentation Rules | Correctly identifies `(₹ 50,000.00)` as negative and preserves `50,000.00 CR` ledger credits. |
161
+ | **123** | Zero-Argument & Empty Destructuring Robustness | Safe API Contract Standards | Invocations with `{}` or zero arguments execute safely without unhandled TypeErrors. |
162
+ | **124** | UTF-8 BOM & European Delimiter Parsing | RFC 4180 CSV Ingestion | Strips UTF-8 BOM (`\uFEFF`) and automatically detects semicolon (`;`) and tab (`\t`) delimiters. |
163
+ | **125** | Parenthesized Negative Vouchers & Return Netting | CBDT Circular 13/2021 Question 4 | Parenthesized `(₹ 10,00,000)` return voucher reduces rolling purchase base to ₹45L, preventing wrongful Section 194Q alerts. |
164
+ | **126** | StatutoryClient Programmatic Parity for Daybooks | Package Architecture Parity | Verifies full client parity for `parseTallyDaybookCsv`, `reconcile194QDaybook`, XML, and reports. |
165
+ | **127** | Strict Malformed Numeric & Integer-Paise Precision | Financial Computation Integrity | Enforces 4-state classification, `Number.MAX_SAFE_INTEGER` bounds, and fractional sub-paisa rules. |
166
+ | **128** | Mandatory Parameter Enforcement across Calculators | Statutory Defensive Architecture | Asserts 12 core statutory calculators throw `MissingMandatoryParameterError` on incomplete data. |
167
+ | **129** | Real-World Tally Ingestion: Dual Columns & Quotes | TallyPrime Export Specifications | Dual Debit/Credit column netting, Particulars header lookup, blank-row filtering, and RFC 4180 quotes. |
168
+ | **130** | StatutoryClient Arithmetic and Precision Parity | Package Architecture Parity | Exposes `cleanNumericAmount`, `toIntegerPaise`, `fromIntegerPaise`, `roundToPaisa` on `StatutoryClient`. |
169
+ | **131** | Zoho Books Bills CSV Parsing | Zoho Books Export Specifications | Parses Zoho bill CSVs, extracting Section 17(5) categories, RCM flags, and Schedule I deemed supplies. |
170
+ | **132** | Zoho API JSON & GSTR-2B JSON Ingestion | GST Portal API Schema / Zoho REST API | Parses B2B invoices, CDNR credit/debit notes netting, date normalization, and item tax rollups. |
171
+ | **133** | 2-Way Reconciliation MATCHED_ELIGIBLE | CGST Act Section 16(2) | Fuzzy alphanumeric key matching resolves separator variance (`INV/2024-25/001` vs `INV-2024-25-001`). |
172
+ | **134** | Statutory Dispositions: Missing 2B, Books, Mismatch | CGST Act Sec 16(2)(aa) & Rule 36(4) | Categorizes `MISSING_IN_GSTR2B` (provisional restricted), `MISMATCH_AMOUNT_VALUE`, and `MISSING_IN_BOOKS`. |
173
+ | **135** | Section 17(5) Blocked Credit & POS Mismatch | CGST Act Sec 17(5) & IGST Act Sec 12 | Isolates blocked motor vehicle ITC for GSTR-3B Table 4(B)(1) and disallows out-of-state local tax. |
174
+ | **136** | Rule 37 180-Day Aging & Section 50(1) Delayed Interest | CGST Act Sec 16(2) 2nd Proviso & Rule 37 | Unpaid bill >180 days triggers Table 4(B)(2) reversal + 18% delayed interest exposure for overdue days. |
175
+ | **137** | StatutoryClient Parity & Executive Report Generation | Client API & Audit Memorandum | Verifies programmatic methods and renders executive Markdown audit memorandum with health matrix. |
176
+ | **138** | CLI Integration — reconcile-gstr2b | Command Line Interface | Executes CLI command `reconcile-gstr2b` with JSON pipeline and report output. |
177
+ | **139** | Multi-State POS Triangulation & Branch Routing | CGST Act Sec 25(4) & IGST Act Sec 12(3) | Routes distinct-person vouchers to branch GSTIN; absorbs stranded hotel local CGST/SGST as expense. |
178
+ | **140** | Rule 37 Exceptions, Proportional Netting & Rule 88B | Rule 37(1) Provisos & Rule 88B(3) | Validates RCM & Schedule 1 exemptions, 50% partial payment netting, and 0% interest on unutilized ECL. |
179
+ | **141** | GSTR-2B GSTN Ineligible Flag & Goods-In-Transit | CGST Act Sec 16(4) & Sec 16(2)(b) | Captures portal `itcavl: "N"` flag; classifies recent unrecorded invoices (<15 days) as goods in transit. |
180
+ | **142** | Zoho Books Vendor Credits Netting | Accounting Double-Entry Principles | Parses native `vendor_credits` array, performing negative taxable and tax netting against gross AP. |
181
+ | **143** | Explicit Uncertainty Routing (REQUIRES_HUMAN) | Audit Governance & Epistemic Honesty | Fails closed on invalid GSTIN checksum, contradictory tax splits, and duplicate invoice candidates. |
182
+ | **144** | Payment Appropriation Policies & Dipped ECL Math | Rule 37(1) & Rule 88B(3) Math | Verifies `VALUE_FIRST` vs `PROPORTIONATE` reversal math and computes 18% interest on dipped ECL balances. |
183
+ | **145** | Decoupled Jurisdictional Decisions Structure | Architectural Assurance | Asserts transaction-level 4-way decisions structure (`taxClassification`, `recipientJurisdiction`, etc.). |
184
+ | **146** | 50-Transaction Synthetic E2E Batch Test | Comprehensive Enterprise AP Simulation | 47 bills and 45 GSTR-2B records across 9 compliance groups evaluated in an end-to-end stress run. |
185
+ | **147** | Chronological Rule 88B(3) ECL Ledger History | CGST Act Section 50(1) & Rule 88B(3) | Evaluates day-by-day movements across 5 trajectories: zero dip, temporary dip, multiple dips/recoveries, partial dip, and post-utilization reversal. |
186
+ | **148** | Evidence Provenance Integrity & Audit Trail | Forensic Audit Reproducibility | Attaches cryptographic `evidenceProvenance` object with SHA-256 derived signature (`MF-PROV-...`), source references, 4-way decisions, and pinned Merkle root. |
187
+ | **149** | Section 12(3) Lodging vs Section 12(7) Event Management | IGST Act Place of Supply Triangulation | Distinguishes immovable lodging (property location -> stranded expense) from B2B event organizing (recipient location -> mandatory IGST / vendor credit note demand). |
188
+ | **150** | Zoho Books API Contract Hardening | Enterprise API Resilience | Validates pagination `page_context` retention, null/empty record resilience, and fail-closed handling of Zoho API error codes (e.g. Code 14). |
189
+ | **151** | Property-Based Fuzz Testing (500 Transactions) | Invariant Enforcement & Stress Resilience | Generates 500 randomized transactions, asserting double-entry accounting conservation, zero floating-point drift, and immutable `isAuthorizedToDisburse: false`. |
190
+
191
+ ---
192
+
193
+ ## 7. The 50-Transaction Synthetic E2E Batch Specification (Test 146)
194
+
195
+ Test 146 constructs an end-to-end multi-scenario corporate portfolio evaluating 47 Zoho purchase bills and 45 GST Portal GSTR-2B records across 9 orthogonal compliance groups:
196
+
197
+ | Group | Invoice Range | Transaction Character | Statutory Grounding | Resulting Engine Disposition |
198
+ |---|---|---|---|---|
199
+ | **Group 1** | 01–20 | Clean matched bills alternating intrastate (Maharashtra `27`) and interstate (Karnataka `29`). | CGST Act Section 16(2) | `MATCHED_ELIGIBLE` (Table 4A5 credit) |
200
+ | **Group 2** | 21–25 | Bangalore supplier (`29`) charging Karnataka local tax where recipient has a distinct-person branch in `29`. | CGST Act Section 25(4) | `MATCHED_ROUTABLE_TO_BRANCH_GSTIN` (`ROUTE_TO_BRANCH_GSTIN`) |
201
+ | **Group 3** | 26–30 | Chennai hotel (`33`) charging Tamil Nadu local tax where recipient has no branch in `33`. | IGST Act Section 12(3) | `MATCHED_INELIGIBLE_STRANDED_LOCAL_CGST_SGST` (`BOOK_AS_EXPENSE_NO_ITC`) |
202
+ | **Group 4** | 31–35 | Invoices dated 210 days ago, 50% paid balance remaining. | Rule 37(1) & Rule 88B(3) | `MATCHED_ELIGIBLE` with `rule37OverdueCount: 5`, proportional Table 4(B)(2) reversal, and ₹0.00 interest due to ₹10L ECL balance. |
203
+ | **Group 5** | 36–38 | Goods Transport Agency (GTA) freight invoices unpaid past 180 days. | Rule 37(1) Proviso 1 (RCM) | `MATCHED_ELIGIBLE` with `EXEMPT_RCM_SUPPLY` (zero reversal required). |
204
+ | **Group 6** | 39–41 | Invoices flagged `itcavl: false` by GSTN with reason `TIME_BARRED_SEC_16_4`. | CGST Act Section 16(4) | `GSTR2B_INELIGIBLE_FLAGGED_BY_GSTN` (`REPORT_IN_GSTR3B_TABLE_4B1_PERMANENT_REVERSAL`) |
205
+ | **Group 7** | 42–44 | Fresh invoices dated 5 days prior to audit date, absent in GSTR-2B. | CGST Act Section 16(2)(aa) | `MISSING_IN_GSTR2B_TIMING` (`PROVISIONAL_PENDING_NEXT_GSTR2B`) |
206
+ | **Group 8** | 45–47 | Invoices present in GSTR-2B dated 3 days ago, absent in Zoho Books. | CGST Act Section 16(2)(b) | `MISSING_IN_BOOKS` (`PHYSICAL_GOODS_RECEIPT_VERIFICATION_PENDING`) |
207
+ | **Group 9** | 48–50 | Corrupted checksum (48), contradictory tax split (49), missing Place of Supply (50). | Fail-Closed Governance | `REQUIRES_HUMAN_VERIFICATION` (with discrete `uncertaintyReason` codes). |
208
+
209
+ ---
210
+
211
+ ## 8. Advanced Accounting Assurance & Forensic Integrity (Tests 147–151)
212
+
213
+ ### A. Chronological Rule 88B(3) ECL Simulation
214
+ Under Explanation (1) to Rule 88B of the CGST Rules, wrongful utilization of input tax credit occurs **only when and to the extent that** the balance in the Electronic Credit Ledger (ECL) dips below the unreversed ITC amount. MudraForge models this day-by-day:
215
+ - **Trajectory 1 (Zero Dip)**: ECL balance remains above unreversed ITC -> 0% interest throughout.
216
+ - **Trajectory 2 (Temporary Dip)**: ECL dips below unreversed ITC for a 10-day window -> interest is calculated strictly for those 10 days on the dipped amount.
217
+ - **Trajectory 3 (Multiple Dips & Recoveries)**: Sum of day-weighted interest across each distinct dip interval.
218
+ - **Trajectory 4 (Partial Utilization)**: If the ECL balance remains positive (e.g. ₹3,00,000 against ₹5,00,000 unreversed ITC), interest is quantified strictly on the ₹2,00,000 shortfall.
219
+ - **Trajectory 5 (Post-Utilization Reversal)**: If the taxpayer reverses the ITC prior to assessment, interest calculation terminates on the exact reversal date.
220
+
221
+ ### B. Cryptographic Evidence Provenance (`MF-PROV-...`)
222
+ Every reconciliation item now bears an immutable, self-contained `evidenceProvenance` object:
223
+ ```json
224
+ {
225
+ "provenanceId": "MF-PROV-3A7F8B12C4E9D021",
226
+ "provenanceTimestamp": "2024-08-10T14:30:00.000Z",
227
+ "source": { "sourceSystem": "ZOHO_BOOKS", "billNumber": "INV-2024-001" },
228
+ "externalEvidence": { "sourceSystem": "GST_PORTAL_GSTR2B", "presentInGstr2b": true },
229
+ "matchingMethod": "EXACT",
230
+ "statutoryBasis": {
231
+ "governingStatute": "Central Goods and Services Tax Act, 2017 / Integrated Goods and Services Tax Act, 2017",
232
+ "primarySection": "CGST Act Section 16(2)"
233
+ },
234
+ "jurisdictionDecisions": {
235
+ "taxClassification": "INTRASTATE_CORRECT",
236
+ "recipientJurisdiction": "FILING_GSTIN_MATCHES_POS",
237
+ "itcEligibility": "ELIGIBLE_NORMAL",
238
+ "operationalRouting": "CLAIM_IN_CURRENT_GSTR3B_TABLE_4A5"
239
+ },
240
+ "uncertaintyAssessment": { "isCertain": true, "uncertaintyReason": "NONE" },
241
+ "governanceTrail": {
242
+ "requiresHumanReview": false,
243
+ "merkleSubstrateRoot": "sha256-f7709f6a77a3b5ae16d69baf49f6e5c69bb01e29a4f13a506eb757220bf68e03",
244
+ "isAuthorizedToDisburse": false
245
+ }
246
+ }
247
+ ```
248
+
249
+ ### C. Section 12(3) vs Section 12(7) Place of Supply Triangulation
250
+ - **Section 12(3)(a) Immovable Lodging**: Accommodation in hotels, guest houses, or campsites strictly fixes the Place of Supply at the property location. If the recipient has no GST registration in that state, the CGST/SGST is legally stranded and absorbed as an operating expense (`BOOK_AS_EXPENSE_NO_ITC`).
251
+ - **Section 12(7)(a)(i) B2B Event Management**: Organization of conferences, exhibitions, or corporate events provided to a registered person fixes the Place of Supply at the **location of the recipient**. If a local vendor charges venue state CGST/SGST, it is an `ERRONEOUS_INTRASTATE_LEVY`. The engine flags this as a defective invoice and instructs the AP team to demand a vendor credit note and corrected IGST invoice (`REQUEST_VENDOR_CREDIT_NOTE_AMENDMENT`).
252
+
253
+ ### D. Zoho Books API Contracts & Property-Based Fuzz Testing
254
+ - **API Pagination**: Preserves `page_context` (`page`, `per_page`, `has_more_page`, `total`) for multi-page batch ingestion.
255
+ - **Fail-Closed API Errors**: Throws explicit, actionable errors upon encountering Zoho API error codes (e.g. Code 14 invalid parameter).
256
+ - **500-Transaction Fuzz Invariants**: Validates that double-entry balance, disposition categorization, and disbursement lock (`isAuthorizedToDisburse: false`) hold across 500 randomized transactions.
257
+
258
+ ---
259
+
260
+ ## 9. Preserving Audit Defensibility in Production
261
+
262
+ To prove compliance to external auditors, execute the automated verification pipeline:
263
+
264
+ ```bash
265
+ # 1. Full statutory test suite (asserts all 151 tests pass)
266
+ npm test
267
+
268
+ # 2. Excel Add-in verification suite (asserts 25 custom functions pass)
269
+ npm -C packages/excel-addin test
270
+
271
+ # 3. OKF v0.2 Schema, Circular, and Form validator
272
+ npm run validate
273
+
274
+ # 4. Cryptographic Merkle Root integrity check (asserts 117/117 files match pinned hash)
275
+ npm run manifest:check
276
+ ```
@@ -1,7 +1,7 @@
1
1
  # MudraForge Statutory Architecture
2
2
  ## Grounding Financial AI in Deterministic Law & Open Knowledge
3
3
 
4
- > **MudraForge Statutory Bundle**: `v2.10.0`
4
+ > **MudraForge Statutory Bundle**: `v2.13.0`
5
5
  > **Knowledge Specification**: Google Open Knowledge Format (OKF) specification (upstream v0.2)
6
6
  > **License**: MIT (Public Knowledge Commons)
7
7
  > **Status**: Public Beta
@@ -73,7 +73,7 @@ The journey of an accounts payable transaction from incoming PDF invoice to gene
73
73
  └───────────────────────────────────┬────────────────────────────────────┘
74
74
  ▼
75
75
  ┌────────────────────────────────────────────────────────────────────────┐
76
- │ STAGE 3: DETERMINISTIC STATUTORY COMPUTATION (Arithmetic Engine) │
76
+ │ STAGE 3: USVM DECLARATIVE AST EXECUTION (Rational BigInt Kernel) │
77
77
  │ Prior FY Purchases: INR 45,00,000 | Cumulative: INR 1,05,00,000 │
78
78
  │ Taxable Excess: INR 55,00,000 | GST Unbundled (Circular 13/2021) │
79
79
  │ TDS Deducted: INR 5,500 | Net Payable to Vendor: INR 70,74,500 │
@@ -143,34 +143,36 @@ The journey of an accounts payable transaction from incoming PDF invoice to gene
143
143
  3. *Temporal State Machine Evaluation*:
144
144
  - Verifies `transactionDate >= section.effectiveFrom`.
145
145
  - Evaluates `section.sunsetDate`. If $\text{transactionDate} \ge \text{sunsetDate}$ (as with Section 206C(1H) on 1 April 2025), transitions status to `SUNSET_SUPERSEDED` and halts execution.
146
- - Evaluates `section.successorAct2025Mapping`. If $\text{transactionDate} \ge \text{2026-04-01}$, cross-compiles citation to the *Income-tax Act, 2025* codification (e.g. Section 194Q $\rightarrow$ Section 393(1), Table 8, Item (ii)).
146
+ - Evaluates `section.successorAct2025Mapping`. If $\text{transactionDate} \ge \text{2026-04-01}$, cross-compiles citation to the *Income-tax Act, 2025* codification (e.g. Section 194Q $\rightarrow$ Section 393(1), Table 1, Sl. No. 8(ii)).
147
147
  - **Outbound Payload**: Immutable `StatutoryRuleSnapshot` containing thresholds, rates, circular provisos, and successor mapping.
148
148
  - **Failure Modes & Degradation Handling**:
149
149
  - `ERR_SECTION_NOT_FOUND`: Specified statutory provision not indexed in active OKF manifest.
150
150
  - `ERR_STATUTE_SUNSET_EXPIRED`: Transaction attempted against an expired or omitted legal section.
151
151
  - `ERR_UNMAPPED_SUCCESSOR`: Transaction date falls into the 2025 Act era without an explicit statutory cross-reference.
152
152
 
153
- ### 3.3 Stage 3: Deterministic Statutory Computation Engine
154
- - **Operational Purpose**: Executes statutory arithmetic in strictly isolated, deterministic code using integer paisa. Generative LLMs are barred from performing this arithmetic (Rule 11).
153
+ ### 3.3 Stage 3: Universal Statutory Virtual Machine (USVM) Declarative Execution Engine
154
+ - **Operational Purpose**: Executes statutory rules through the stateless Universal Statutory Virtual Machine (`@mudraforge/statutory/usvm`), evaluating declarative Abstract Syntax Tree (AST) representations with 5-stage rational BigInt arithmetic. Generative LLMs are barred from performing this arithmetic (Rule 11).
155
155
  - **Inbound Data Contract**:
156
156
  - `ingestedInvoice`: Verified invoice amounts, item breakdown, and vendor PAN.
157
- - `statutorySnapshot`: Applicable OKF rule parameters (thresholds, statutory rates, penalty escalations).
157
+ - `statutorySnapshot`: Applicable OKF declarative AST package (`ast.json` or pre-cached USVM rule).
158
158
  - `ledgerHistory`: Verified historical purchases from the same vendor within the active financial year.
159
159
  - **Deterministic Computation Algorithms**:
160
- 1. *Cumulative Threshold Evaluation (Section 194Q)*:
160
+ 1. *Declarative AST Rule Traversal*: The USVM kernel (`evaluation_vm.js`, 355 lines) evaluates statutory expressions over facts in <15 microseconds without relying on hardcoded procedural conditionals.
161
+ 2. *Cumulative Threshold Evaluation (Section 194Q)*:
161
162
  - Retrieves cumulative prior FY purchases from the verified ERP ledger: $\text{Prior Purchases} = \text{INR } 45,00,000$.
162
163
  - Computes cumulative aggregate: $\text{Cumulative} = 45,00,000 + 60,00,000 = \text{INR } 1,05,00,000$.
163
- 2. *GST Unbundling & Taxable Base Netting*:
164
+ 3. *GST Unbundling & Taxable Base Netting*:
164
165
  - Strictly enforces CBDT Circular 13/2021 and Circular 23/2017: GST components (CGST/SGST/IGST) are excluded from the withholding base when charged separately.
165
166
  - Computes marginal taxable excess:
166
167
  $$\text{Taxable Excess} = \max(0, \min(\text{Basic Value}, \text{Cumulative} - 50,00,000)) = \text{INR } 55,00,000$$
167
- 3. *PAN Compliance & Penalty Rate Interception*:
168
+ 4. *PAN Compliance & Penalty Rate Interception*:
168
169
  - Inspects vendor PAN validity and Section 206AB compliance. If PAN is valid and active, standard rate ($0.1\%$) applies:
169
170
  $$\text{TDS Deducted} = \lfloor 55,00,000 \times 0.001 \rfloor = \text{INR } 5,500$$
170
171
  - If PAN is inoperative or specified non-filer, automatically elevates rate to 5% u/s 206AA/206AB.
171
- 4. *Net Payable Allocation*:
172
- $$\text{Net Payable to Vendor} = \text{Gross Invoice Total} - \text{TDS Deducted} = 70,80,000 - 5,500 = \text{INR } 70,74,500$$
173
- - **Outbound Payload**: Canonical `StatutoryCalculationResult` detailing basic value, unbundled taxes, taxable excess, deduction, and net payable.
172
+ 5. *Net Payable Allocation & Rational BigInt Precision*:
173
+ - Computed via 5-stage rational fractions (`math_rational.js`) eliminating IEEE 754 float drift:
174
+ $$\text{Net Payable to Vendor} = \text{Gross Invoice Total} - \text{TDS Deducted} = 70,80,000 - 5,500 = \text{INR } 70,74,500$$
175
+ - **Outbound Payload**: Canonical `StatutoryCalculationResult` detailing basic value, unbundled taxes, taxable excess, deduction, net payable, and mandatory fiduciary invariant `isAuthorizedToDisburse: false`.
174
176
  - **Failure Modes & Degradation Handling**:
175
177
  - `ERR_NEGATIVE_TAXABLE_BASE`: Negative purchase value or invalid credit note netting.
176
178
  - `ERR_PAN_INOPERATIVE_MANDATORY_ELEVATION`: Vendor PAN inoperative, requiring mandatory 5% withholding rate escalation.
@@ -276,7 +278,7 @@ Large Language Models (LLMs) are stochastic token predictors. In corporate accou
276
278
  *Example*: **Section 206C(1H)** was omitted by the Finance Act, 2025 effective 1 April 2025. Standard model weights continue citing and enforcing sunset sections long after their legal expiration date because pre-training data lacks temporal enforcement boundaries.
277
279
 
278
280
  3. **Dual-Act Legislative Transition**:
279
- India transitioned to the **Income-tax Act, 2025** (which took effect 1 April 2026), replacing familiar 1961 section numbers with new codifications (e.g., Section 194Q transitions to Section 393(1), Table 8, Item (ii)). Agents without a dual-act mapping layer hallucinate cross-statutory citations.
281
+ India transitioned to the **Income-tax Act, 2025** (which took effect 1 April 2026), replacing familiar 1961 section numbers with new codifications (e.g., Section 194Q transitions to Section 393(1), Table 1, Sl. No. 8(ii)). Agents without a dual-act mapping layer hallucinate cross-statutory citations.
280
282
 
281
283
  4. **The Failure of Messy Web Searches (Web RAG)**:
282
284
  When autonomous agents attempt to retrieve tax laws using automated search queries, they ingest conflicting third-party summaries: outdated SEO-optimized accounting blogs from 2018–2022, promotional vendor writeups, and unstructured discussion forums. These sources consistently miss crucial statutory provisos—such as CBDT Circular 13/2021 unbundling GST from TDS, or Ministry of MSME OM 2/1(5)/2021 excluding wholesale/retail traders. Web RAG introduces high latency, burns thousands of context tokens, and injects contradictory noise into agent reasoning.
@@ -298,15 +300,16 @@ To resolve these vulnerabilities, MudraForge enforces a strict **Separation of P
298
300
  └──────────────────────────────────▲─────────────────────────────────────┘
299
301
  │ Queries local disk / edge
300
302
  ┌──────────────────────────────────┴─────────────────────────────────────┐
301
- │ 2. Statutory Knowledge Substrate (OKF Layer - This Package) │
303
+ │ 2. Statutory Knowledge & USVM Substrate (OKF Layer - This Package) │
302
304
  │ • Authoritative, versioned reference law under Google's OKF standard│
305
+ │ • Universal Statutory Virtual Machine (USVM Declarative ASTs) │
303
306
  │ • Temporal validity state machines (detects sunsets & transitions) │
304
- │ • Zero dependencies, 100% offline-capable, sub-1ms local lookup │
307
+ │ • Zero dependencies, 100% offline-capable, <15µs local evaluation │
305
308
  └──────────────────────────────────▲─────────────────────────────────────┘
306
309
  │ Feeds verified ground truth
307
310
  ┌──────────────────────────────────┴─────────────────────────────────────┐
308
- │ 3. Deterministic Execution & Governance (Adesha Runtime) │
309
- │ • Pure arithmetic legal calculators (194Q excess, MSMED 3x RBI) │
311
+ │ 3. Deterministic Governance & Execution (Adesha Sovereign Runtime) │
312
+ │ • 5-stage rational BigInt arithmetic (194Q excess, MSMED 3x RBI) │
310
313
  │ • Single-use payment leases, CAS gates & Two-Generals recovery │
311
314
  │ • Double-entry general ledger writeback with source-bound lines │
312
315
  └────────────────────────────────────────────────────────────────────────┘
@@ -334,16 +337,17 @@ To ensure safety, MudraForge enforces an absolute **Separation of Powers** acros
334
337
  │ Dispatches structured queries
335
338
  ▼
336
339
  ┌────────────────────────────────────────────────────────────────────────┐
337
- │ 2. STATUTORY KNOWLEDGE SUBSTRATE (OKF Layer - This Package) │
340
+ │ 2. STATUTORY KNOWLEDGE & USVM SUBSTRATE (OKF Layer - This Package) │
338
341
  │ • Declarative legal ground truth under Google OKF specification │
342
+ │ • Universal Statutory Virtual Machine (USVM Declarative ASTs) │
339
343
  │ • Deterministic temporal state machine (sunsets & Act 2025 mappings)│
340
- │ • 100% offline filesystem lookup (sub-1ms local traversal) │
344
+ │ • 100% offline filesystem lookup (<15µs local traversal) │
341
345
  └──────────────────────────────────┬─────────────────────────────────────┘
342
- │ Feeds verified statutory parameters
346
+ │ Feeds verified statutory AST & parameters
343
347
  ▼
344
348
  ┌────────────────────────────────────────────────────────────────────────┐
345
349
  │ 3. DETERMINISTIC GOVERNANCE & SETTLEMENT RUNTIME (Adesha Runtime) │
346
- │ • Integer-paisa legal arithmetic calculators (194Q, MSMED 3x RBI) │
350
+ │ • 5-stage rational BigInt arithmetic (194Q excess, MSMED 3x RBI) │
347
351
  │ • Single-use cryptographic CAS leases (RFC 8785 + SHA-256) │
348
352
  │ • Two-Generals idempotent banking recovery (Host-to-Host RTGS) │
349
353
  │ • Balanced double-entry writeback to core ERP (SAP / Zoho Books) │
@@ -459,9 +463,9 @@ When an autonomous agent (Antigravity, Cursor, Claude Code) receives a complianc
459
463
 
460
464
  ### Dual-Act Legislative Migration Matrix
461
465
  The OKF embeds a cross-compilation matrix forward-mapping the *Income-tax Act, 1961* to the *Income-tax Act, 2025*:
462
- - `194Q` $\rightarrow$ Section 393(1), Table 8, Item (ii)
463
- - `194J` $\rightarrow$ Section 393(1), Table 8, Item (iii)
464
- - `194C` $\rightarrow$ Section 393(1), Table 8, Item (i)
466
+ - `194Q` $\rightarrow$ Section 393(1), Table 1, Sl. No. 8(ii)
467
+ - `194J` $\rightarrow$ Section 393(1), Table 1, Sl. No. 6(iii)
468
+ - `194C` $\rightarrow$ Section 393(1), Table 1, Sl. No. 8(i)
465
469
 
466
470
  Transactions dated before 1 April 2026 resolve under the 1961 Act; transactions on or after 1 April 2026 automatically compile under the 2025 Act codification.
467
471
 
@@ -477,7 +481,7 @@ Currently, the substrate indexes and provides deterministic ground truth across
477
481
  - **Section 194Q**: 0.1% TDS on purchase of goods exceeding ₹50 Lakhs cumulative annual threshold (calculating strictly on the excess over ₹50L).
478
482
  - **Section 206C(1H)**: TCS on sale of goods, with automated temporal interception of its **1 April 2025 sunset** under the Finance Act, 2025.
479
483
  - **Section 194J**: Fees for Technical Services (2% FTS) vs. Professional Fees (10%), enforcing standard 20% non-PAN penalty rates under Section 206AA(1)(iii) / Section 397(2)(a).
480
- - **Dual-Act Forward Mapping**: Complete cross-compilation matrix from *Income-tax Act, 1961* to the *Income-tax Act, 2025* (which took effect 1 April 2026), mapping sections seamlessly (e.g., Section 194Q → Section 393(1), Table 8, Item (ii)).
484
+ - **Dual-Act Forward Mapping**: Complete cross-compilation matrix from *Income-tax Act, 1961* to the *Income-tax Act, 2025* (which took effect 1 April 2026), mapping sections seamlessly (e.g., Section 194Q → Section 393(1), Table 1, Sl. No. 8(ii)).
481
485
 
482
486
  ### 2. Indirect Tax & Procurement Compliance (GST)
483
487
  - **CGST Section 17(5)**: Comprehensive statutory negative list for Blocked Input Tax Credit (ITC)—including motor vehicles, corporate food & beverages, personal consumption, club memberships, and statutory exceptions/provisos.
@@ -525,12 +529,13 @@ The statutory substrate published in this repository (`@mudraforge/statutory`) a
525
529
  flowchart TD
526
530
  AP["Corporate AP Stream:<br/>PDF Invoices / IRN e-Invoices"] --> Triage["Statutory Domain Classifier<br/>& Context Builder"]
527
531
 
528
- subgraph Tier1["Tier 1: Open Substrate (This Repository)"]
532
+ subgraph Tier1["Tier 1: Open Substrate & USVM (This Repository)"]
529
533
  Triage --> Substrate{"Local OKF Filesystem<br/>(Zero Network Calls)"}
530
- Substrate --> S1["194Q Thresholds & Excess Scope"]
531
- Substrate --> S2["206C(1H) Sunset Evaluation"]
532
- Substrate --> S3["MSMED 15/16 Payment Rules"]
533
- Substrate --> S4["194J FTS vs Professional Rates"]
534
+ Substrate --> S1["194Q Thresholds & Excess AST"]
535
+ Substrate --> S2["206C(1H) Sunset Evaluation AST"]
536
+ Substrate --> S3["MSMED 15/16 Payment Rules AST"]
537
+ Substrate --> S4["194J FTS vs Professional AST"]
538
+ S1 & S2 & S3 & S4 --> USVMKernel["USVM Declarative Kernel<br/>(<15µs Latency, Rational BigInt)"]
534
539
  end
535
540
 
536
541
  subgraph Tier2["Tier 2: Hosted Edge Sync API (api.mudraforge.in)"]
@@ -539,8 +544,8 @@ flowchart TD
539
544
  end
540
545
 
541
546
  subgraph Tier3["Tier 3: Commercial Adesha Governance Runtime"]
542
- S1 & S2 & S3 & S4 --> CalcEngine["Deterministic Arithmetic Calculator<br/>(₹50L Excess, 3x RBI Interest)"]
543
- CalcEngine --> CanonResult["Canonical Financial Result<br/>(RFC 8785 JCS + SHA-256 Seal)"]
547
+ USVMKernel --> USVMRuntime["Enterprise USVM Pipeline<br/>(Ledger Accumulator & 3x RBI)"]
548
+ USVMRuntime --> CanonResult["Canonical Financial Result<br/>(RFC 8785 JCS + SHA-256 Seal)"]
544
549
  CanonResult --> PresLock["Presentation Consistency Lock<br/>(Automated Prose Auditor)"]
545
550
  PresLock --> Lease["Single-Use Payment Lease<br/>(Atomic CAS Gate)"]
546
551
  Lease --> Bank["Banking Outflow Rails<br/>(RazorpayX / Host-to-Host)"]
@@ -557,7 +562,7 @@ flowchart TD
557
562
  | **Offline Filesystem Traversal** | Supported (Sub-1ms local lookup, 0 network calls) | N/A (Edge API requires network) | Local caching within VPC |
558
563
  | **Edge Synchronization** | **Included** (Free best-effort sync: `npx @mudraforge/statutory sync`) | Priority SLA edge sync & expanded catalog | Automated continuous gazette synchronization |
559
564
  | **Agent Skill Interface** | Included (`init-skill` CLI) | Supported | Included |
560
- | **Deterministic Tax Math** | Reference metadata only | Gated Edge API (`POST /calculate`) | Built-in native arithmetic engine |
565
+ | **Deterministic Tax Math & USVM** | Included via USVM (`@mudraforge/statutory/usvm`) | Gated Edge USVM API (`POST /calculate`) | Built-in native USVM execution with live ledger hooks |
561
566
  | **Systems of Record (SoR) Access** | None (Stateless) | None (Stateless) | **Direct Live Integration** (SAP, Zoho, Oracle, Bank Rails) |
562
567
  | **Statutory Claim Validator** | Excluded | Excluded | **Included Exclusively** *(Strictly requires live access to enterprise Systems of Record)* |
563
568
  | **Payment Authorization Leases**| Excluded | Excluded | Single-use cryptographic CAS leases |
@@ -614,9 +619,9 @@ Data traveling between tiers is encapsulated within a deterministic verification
614
619
  ### 9.3 Edge Consistency & Eventual Consistency Resolution (Cloudflare KV)
615
620
 
616
621
  Cloudflare Workers KV provides global low-latency reads via eventual consistency across edge nodes. To prevent release skew during regulatory updates:
617
- 1. *Immutable Version Tagging*: All statutory releases are written under unique semver namespaces (`statutory:releases:v2.10.0:...`).
618
- 2. *Atomic Manifest Flip*: The global pointer `statutory:active_release` is updated only after all 86 files across all domains are fully confirmed across edge replicas.
619
- 3. *Cache-Control Invalidation*: Manifest responses carry strict validation headers (`ETag: "v2.10.0"`, `stale-while-revalidate=600`).
622
+ 1. *Immutable Version Tagging*: All statutory releases are written under unique semver namespaces (`statutory:releases:v2.13.0:...`).
623
+ 2. *Atomic Manifest Flip*: The global pointer `statutory:active_release` is updated only after all 191 files across all domains are fully confirmed across edge replicas.
624
+ 3. *Cache-Control Invalidation*: Manifest responses carry strict validation headers (`ETag: "v2.13.0"`, `stale-while-revalidate=600`).
620
625
  4. *Local Fallback*: If Tier 2 returns HTTP 5xx or fails DNS resolution, Tier 1 and Tier 3 automatically fall back to the bundled local filesystem snapshot without failing the active business transaction.
621
626
 
622
627
  ### 9.4 Architectural Boundaries: The Autonomous Coprocessor vs. Stateless Subsystems
@@ -629,13 +634,15 @@ To balance open developer accessibility with enterprise security, the architectu
629
634
 
630
635
  ```
631
636
  ┌────────────────────────────────────────────────────────────────────────┐
632
- │ STATELESS REFERENCE & ARITHMETIC SUBSYSTEMS (Tiers 1 & 2) │
633
- │ ~50% Functional Scope (Decoupled Reference Law & Edge Math) │
637
+ │ STATELESS REFERENCE & USVM ENGINE (Tiers 1 & 2) │
638
+ │ ~50% Functional Scope (Decoupled Reference Law, ASTs & USVM) │
634
639
  │ • Normalized OKF v0.2 schemas, rates, thresholds, and sunset timelines │
640
+ │ • Universal Statutory Virtual Machine (USVM) declarative AST kernel │
641
+ │ • 5-stage rational BigInt arithmetic eliminating IEEE 754 float drift │
635
642
  │ • Synchronous offline filesystem lookup (Tier 1 Free Package & CLI) │
636
643
  │ • Best-effort edge gazette synchronization (Tier 1 & Tier 2) │
637
- │ • Metered stateless cloud arithmetic API (Tier 2 POST /calculate) │
638
- │ • Scope: Stateless reference & pure math; ZERO enterprise SoR access │
644
+ │ • Metered stateless cloud USVM API (Tier 2 POST /calculate) │
645
+ │ • Scope: Stateless reference & USVM math; ZERO enterprise SoR access │
639
646
  └──────────────────────────────────┬─────────────────────────────────────┘
640
647
  │ Integrated into
641
648
  ▼
@@ -677,27 +684,32 @@ The **Statutory Claim Validator** is deployed exclusively within the **Tier 3 Fu
677
684
  - **Vendor Compliance Standing & Penalty Rate Interception**: Inspects vendor compliance metrics to evaluate higher deduction rates under Section 206AB (non-filers of income tax returns) and Section 206AA (inoperative PAN status), elevating standard rates to mandatory statutory penalty tiers (5% or 20%) when non-compliance is verified.
678
685
  - **AI Assertion & Presentation Lock Verification**: Validates narrative claims generated by LLM assistants against verified SoR ground truth, ensuring no hallucinated tax rate, threshold, or section reference reaches human approving officers.
679
686
 
680
- ### 9.6 The Deterministic Calculation Engine (`POST /calculate`)
687
+ ### 9.6 The Universal Statutory Virtual Machine (USVM) & Edge Calculation
681
688
 
682
- The **Deterministic Calculation Engine** executes verified tax arithmetic within an isolated runtime environment:
689
+ The **Universal Statutory Virtual Machine (USVM)** (`@mudraforge/statutory/usvm`) provides a stateless, declarative AST execution kernel that eliminates hardcoded procedural calculation logic:
683
690
 
684
- 1. **Multi-Invoice Cumulative Spend Tracking**:
685
- Statutory provisions requiring cumulative threshold evaluations (such as Section 194Q) necessitate stateful tracking across a financial year. The engine interfaces with enterprise ledger history to aggregate verified prior purchases, applying withholding strictly to the marginal excess exceeding the statutory limit (e.g. INR 50,00,000) rather than the aggregate invoice gross.
686
- 2. **Tax Component Unbundling**:
691
+ 1. **Declarative Abstract Syntax Tree (AST) Rules**:
692
+ Statutes are compiled into declarative AST expressions (e.g. `okf/*/ast.json` and `src/usvm/rules/*.json`). The virtual machine evaluates logical and arithmetic operations without embedding hardcoded procedural branching in application code.
693
+ 2. **Multi-Invoice Cumulative Spend Tracking**:
694
+ Statutory provisions requiring cumulative threshold evaluations (such as Section 194Q) evaluate prior purchases against financial-year limits, withholding strictly on the marginal excess exceeding the statutory limit (e.g. INR 50,00,000) rather than the aggregate invoice gross.
695
+ 3. **Tax Component Unbundling**:
687
696
  Implements administrative guidelines (including CBDT Circular 13/2021) requiring the exclusion of separately billed GST components from the tax deduction base, preventing compounding tax-on-tax withholding errors.
688
- 3. **Integer-Paisa Precision & Cryptographic Lease Minting**:
689
- Calculations are executed in integer paisa to eliminate floating-point representation drift. The resulting payment authorization is sealed via RFC 8785 JSON Canonicalization Scheme (JCS) and SHA-256 into a single-use Compare-and-Swap (CAS) lease. Any subsequent alteration to the transaction payload, beneficiary details, or tax allocation invalidates the lease prior to banking dispatch.
690
- 4. **Distributed Edge Synchronization**:
691
- To minimize compliance drift from legislative amendments, the calculation engine maintains synchronized release manifests across global edge nodes, ensuring tenant runtimes evaluate active transactions against validated gazette baselines.
697
+ 4. **5-Stage Rational BigInt Arithmetic (`math_rational.js`)**:
698
+ Calculations are executed with rational fractions (`[numerator, denominator]` BigInt pairs) to eliminate IEEE 754 floating-point drift before rounding to the nearest paisa (`roundToPaisa`).
699
+ 5. **Cryptographic CAS Lease Minting**:
700
+ The resulting payment authorization is sealed via RFC 8785 JSON Canonicalization Scheme (JCS) and SHA-256 into a single-use Compare-and-Swap (CAS) lease. Any subsequent alteration to the transaction payload, beneficiary details, or tax allocation invalidates the lease prior to banking dispatch.
701
+ 6. **Distributed Edge Synchronization & Lightweight Tree-Shaking**:
702
+ Exposed via tree-shakable subpath `@mudraforge/statutory/usvm` (~12 kB GZIP vs 92.9 kB full library), enabling microsecond edge evaluation on Cloudflare Workers V8 isolates without cold start latency.
692
703
 
693
704
  ---
694
705
 
695
- ## 10. Working Example: Offline Local Traversal
706
+ ## 10. Working Example: Offline Traversal & USVM Execution
696
707
 
697
- The public package allows developers and agents to traverse statutory law with zero external network requests:
708
+ The public package allows developers and agents to traverse statutory law and evaluate rules with zero external network requests:
698
709
 
699
710
  ```javascript
700
711
  import { lookupLocalStatute, isStatuteActive } from '@mudraforge/statutory';
712
+ import { evaluateStatutoryAst, getStatutoryAst } from '@mudraforge/statutory/usvm';
701
713
 
702
714
  // 1. Look up Section 194Q offline (sub-1ms)
703
715
  const statute = lookupLocalStatute('194Q');
@@ -708,6 +720,17 @@ console.log(statute.keyStatutoryThresholds.taxableBaseScope);
708
720
  // 2. Check temporal status against effective dates
709
721
  const isActive2024 = await isStatuteActive('206C(1H)', '2024-05-01'); // true
710
722
  const isActive2025 = await isStatuteActive('206C(1H)', '2025-06-01'); // false (sunset effective 1 April 2025)
723
+
724
+ // 3. Evaluate Section 194Q via USVM Declarative AST (<15µs latency)
725
+ const ast194Q = getStatutoryAst('194Q');
726
+ const voucher = evaluateStatutoryAst(ast194Q, {
727
+ invoiceAmount: 6000000,
728
+ priorFyPurchases: 4500000,
729
+ hasPan: true,
730
+ transactionDate: '2026-03-15'
731
+ });
732
+ console.log(voucher.calculatedTdsInr); // 5500 (0.1% on excess over ₹50L)
733
+ console.log(voucher.isAuthorizedToDisburse); // false (Fiduciary invariant)
711
734
  ```
712
735
 
713
736
  ---
@@ -733,10 +756,10 @@ To prevent version skew across regions, the edge runtime employs an **Immutable
733
756
  1. **Immutable Artifact Keys**: Every section schema, circular, and form is stored under an immutable, version-tagged key:
734
757
  ```
735
758
  statutory:releases:<semver>:<domain>:<section_code>
736
- # Example: statutory:releases:v2.10.0:direct_tax:194Q
759
+ # Example: statutory:releases:v2.13.0:direct_tax:194Q
737
760
  ```
738
761
  Once written to KV, the bytes for a specific semver key are permanently immutable.
739
- 2. **Atomic Manifest Pointers**: Releases are indexed by a versioned root manifest (`statutory:manifests:v2.10.0`). The active pointer is switched only after all constituent keys are fully populated.
762
+ 2. **Atomic Manifest Pointers**: Releases are indexed by a versioned root manifest (`statutory:manifests:v2.13.0`). The active pointer is switched only after all constituent keys are fully populated.
740
763
  3. **Cache Invalidation & ETag Gates**: The manifest endpoint serves HTTP `ETag` validators with short edge TTLs (`Cache-Control: public, max-age=60, s-maxage=300, stale-while-revalidate=600`). This ensures edge caches converge globally within minutes while allowing clients to detect release changes via deterministic SHA-256 root hash comparisons.
741
764
  - **Commercial Boundary**: Only the automated, continuously maintained edge update stream, neural discovery search, and deep deterministic calculator engines require an Enterprise API subscription post-beta.
742
765