@mudraforge/statutory 2.11.0 → 2.12.1

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 (70) hide show
  1. package/CHANGELOG.md +155 -1
  2. package/CONTRIBUTING.md +2 -2
  3. package/README.md +1 -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 +6 -6
  9. package/docs/CASE_01_FORM_TEXT.txt +48 -0
  10. package/docs/CATALOG.md +405 -39
  11. package/docs/CA_PILOT_BENCHMARK_CASES.md +282 -0
  12. package/docs/CORPUS_QUALITY.md +31 -22
  13. package/docs/DOMAIN_BREADTH_AND_DEPTH_COMPARISON.md +1 -1
  14. package/okf/corporate_ma_restructuring/business_combinations_indas_103/circulars/mca_notification_indas_103_business_combinations.md +41 -0
  15. package/okf/corporate_ma_restructuring/business_combinations_indas_103/forms/purchase_price_allocation_schedule.json +110 -0
  16. package/okf/corporate_ma_restructuring/business_combinations_indas_103/section.json +65 -0
  17. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/circulars/mca_notification_indas_36_impairment.md +45 -0
  18. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/forms/cgu_impairment_testing_register.json +53 -0
  19. package/okf/corporate_ma_restructuring/impairment_of_assets_indas_36/section.json +61 -0
  20. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/circulars/icai_guidance_share_based_payments.md +37 -0
  21. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/forms/esop_graded_vesting_amortization_schedule.json +49 -0
  22. package/okf/corporate_ma_restructuring/share_based_payments_indas_102/section.json +60 -0
  23. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/circulars/mca_notification_indas_12_income_taxes.md +40 -0
  24. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/forms/deferred_tax_asset_liability_reconciliation_schedule.json +46 -0
  25. package/okf/direct_tax/income_taxes_deferred_tax_indas_12/section.json +61 -0
  26. package/okf/direct_tax/tds_commission_194h/section.json +5 -4
  27. package/okf/direct_tax/tds_contractor_194c/section.json +3 -3
  28. package/okf/direct_tax/tds_ecommerce_194o/section.json +3 -3
  29. package/okf/direct_tax/tds_goods_194q/circulars/cbdt_circular_13_2021_guidelines.md +2 -2
  30. package/okf/direct_tax/tds_goods_194q/section.json +9 -3
  31. package/okf/direct_tax/tds_goods_393/section.json +6 -4
  32. package/okf/direct_tax/tds_individual_contract_194m/section.json +3 -3
  33. package/okf/direct_tax/tds_interest_194a/section.json +7 -4
  34. package/okf/direct_tax/tds_perquisites_194r/section.json +1 -1
  35. package/okf/direct_tax/tds_property_194ia/section.json +3 -3
  36. package/okf/direct_tax/tds_rent_194i/section.json +5 -4
  37. package/okf/direct_tax/tds_rent_individual_194ib/section.json +2 -2
  38. package/okf/direct_tax/tds_services_194j/circulars/cbdt_circular_03_2020_fts_rate_cut.md +1 -1
  39. package/okf/direct_tax/tds_services_194j/section.json +10 -3
  40. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/circulars/cbic_circular_170_2022_itc_reporting.md +30 -0
  41. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/circulars/cbic_notification_18_2022_cutoff_amendment.md +26 -0
  42. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/forms/gstr_3b_table_4b1_reversal_schedule.json +101 -0
  43. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/forms/rule_42_43_annual_reconciliation_worksheet.json +87 -0
  44. package/okf/indirect_tax_gst/common_itc_reversal_rule42_43/section.json +65 -0
  45. package/okf/indirect_tax_gst/itc_reversal_rule37_37a/circulars/cbic_circular_192_2023_ecl_interest_calculation.md +36 -0
  46. package/okf/indirect_tax_gst/itc_reversal_rule37_37a/section.json +8 -1
  47. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/cbic_notification_07_2025_composition_rent_exclusion.md +41 -0
  48. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/cbic_notification_09_2024_renting_rcm.md +37 -0
  49. package/okf/indirect_tax_gst/rcm_liability_sec9_3/circulars/gst_council_55th_meeting_renting_rcm_regularization.md +31 -0
  50. package/okf/indirect_tax_gst/rcm_liability_sec9_3/section.json +24 -2
  51. package/okf/international_tax/financial_instruments_ecl_indas_109/circulars/mca_notification_indas_109_financial_instruments.md +43 -0
  52. package/okf/international_tax/financial_instruments_ecl_indas_109/forms/indas_109_ecl_provision_matrix_schedule.json +43 -0
  53. package/okf/international_tax/financial_instruments_ecl_indas_109/section.json +62 -0
  54. package/okf/manifest.json +71 -20
  55. package/okf/msme_commercial/lease_accounting_indas_116/circulars/mca_notification_indas_116_leases.md +48 -0
  56. package/okf/msme_commercial/lease_accounting_indas_116/forms/lease_rou_asset_and_liability_schedule.json +55 -0
  57. package/okf/msme_commercial/lease_accounting_indas_116/section.json +67 -0
  58. package/okf/msme_commercial/provisions_contingencies_indas_37/circulars/mca_notification_indas_37_provisions.md +36 -0
  59. package/okf/msme_commercial/provisions_contingencies_indas_37/forms/provisions_and_contingent_liabilities_register.json +38 -0
  60. package/okf/msme_commercial/provisions_contingencies_indas_37/section.json +61 -0
  61. package/okf/msme_commercial/revenue_recognition_indas_115/circulars/mca_notification_indas_115_revenue_contracts.md +56 -0
  62. package/okf/msme_commercial/revenue_recognition_indas_115/forms/revenue_contract_5step_allocation_schedule.json +54 -0
  63. package/okf/msme_commercial/revenue_recognition_indas_115/section.json +69 -0
  64. package/package.json +7 -1
  65. package/src/calculators.js +2195 -260
  66. package/src/constants.js +1 -1
  67. package/src/index.js +407 -23
  68. package/src/tally.js +812 -0
  69. package/src/zoho_gstr2b.js +2964 -0
  70. package/types/index.d.ts +476 -0
package/src/constants.js CHANGED
@@ -6,5 +6,5 @@
6
6
  * @license MIT
7
7
  */
8
8
 
9
- export const STATUTORY_CLIENT_VERSION = '2.11.0';
9
+ export const STATUTORY_CLIENT_VERSION = '2.12.1';
10
10
  export const DEFAULT_BASE_URL = 'https://api.mudraforge.in';
package/src/index.js CHANGED
@@ -17,12 +17,28 @@ import { fileURLToPath } from 'node:url';
17
17
  import {
18
18
  roundToPaisa,
19
19
  roundSection288B,
20
+ cleanNumericAmount,
21
+ toIntegerPaise,
22
+ fromIntegerPaise,
23
+ MalformedNumericInputError,
24
+ MissingMandatoryParameterError,
25
+ assertMandatoryNumeric,
20
26
  calculateCorporateTaxMatVsConcessional,
21
27
  evaluatePlaceOfSupplyAndLut,
22
28
  calculateTransferPricingAlp,
23
29
  evaluateSection79LossContinuity,
24
30
  evaluateSection281TaxClearance,
25
31
  revalueForeignExchangeIndAs109,
32
+ calculateBusinessCombinationsIndAs103,
33
+ calculateImpairmentIndAs36,
34
+ calculateRevenueAllocationIndAs115,
35
+ calculateLeaseAmortizationIndAs116,
36
+ calculateExpectedCreditLossIndAs109,
37
+ calculateEsopAmortizationIndAs102,
38
+ calculateDeferredTaxIndAs12,
39
+ evaluateProvisionsAndContingenciesIndAs37,
40
+ calculateForeignCurrencyIndAs21,
41
+ resolveMissingPanPenaltyFloor,
26
42
  evaluateSection194Q,
27
43
  evaluateSection194C,
28
44
  evaluateSection194H,
@@ -41,6 +57,9 @@ import {
41
57
  evaluateSection43bH,
42
58
  calculateMsmeCompoundInterest,
43
59
  calculateAdvanceTaxAndInterest,
60
+ calculateRule42InputServiceReversal,
61
+ reconcileRule42AnnualTrueUp,
62
+ calculateRule43CapitalGoodsReversal,
44
63
  calculateGstItcApportionmentRule42_43,
45
64
  evaluateCrossBorderRemittance,
46
65
  generateMsme1AndScheduleThreeAging,
@@ -58,6 +77,27 @@ import {
58
77
  STATUTORY_OUTCOMES_DICTIONARY,
59
78
  enrichWithOutcomeExplanation
60
79
  } from './outcomes.js';
80
+ import {
81
+ parseTallyDaybookCsv,
82
+ parseTallyDaybookXml,
83
+ reconcile194QDaybook,
84
+ generateTally194QJournalXml,
85
+ generateAuditMarkdownReport,
86
+ getIndianFinancialYear
87
+ } from './tally.js';
88
+ import {
89
+ parseZohoBillsCsv,
90
+ parseZohoBillsJson,
91
+ parseGstr2bJson,
92
+ reconcileZohoGstr2b,
93
+ generateGstr2bAuditMarkdownReport,
94
+ normalizeInvoiceNumber,
95
+ normalizeGstin,
96
+ calculateOverdueStartDate,
97
+ calculateEclUtilizationInterest,
98
+ calculatePortfolioEclUtilizationInterest,
99
+ buildEvidenceProvenance
100
+ } from './zoho_gstr2b.js';
61
101
 
62
102
  import { STATUTORY_CLIENT_VERSION, DEFAULT_BASE_URL } from './constants.js';
63
103
 
@@ -77,7 +117,7 @@ export { STATUTORY_CLIENT_VERSION, DEFAULT_BASE_URL };
77
117
  /**
78
118
  * Current verified Merkle root digest for the active OKF v0.2 corpus.
79
119
  */
80
- export const CURRENT_RELEASE_MERKLE_ROOT = 'sha256-bf547512a57f26eae9a5ebcb9f0ec41c397421366b1b4223ab9e17d282721ca7';
120
+ export const CURRENT_RELEASE_MERKLE_ROOT = 'sha256-b17c37b2724aece2a28beaab5720a777ae27e661ac51f1436be6eff3ca5ef64b';
81
121
  export const MERKLE_ROOT_OKF_V2 = CURRENT_RELEASE_MERKLE_ROOT;
82
122
 
83
123
  /**
@@ -85,6 +125,12 @@ export const MERKLE_ROOT_OKF_V2 = CURRENT_RELEASE_MERKLE_ROOT;
85
125
  * Prevents unauthorized bundle substitution attacks even if an attacker controls the remote endpoint.
86
126
  */
87
127
  export const PINNED_RELEASE_ROOTS = new Set([
128
+ 'sha256-318004673a779499e82fd7316c7a6728f3bcdaf449bb4a557b6bd685b899dee3', // fix/public-okf-table1-sl-nos-and-temporal-thresholds (Section 393 Table 1 Sl Nos & 2025 Act thresholds)
129
+ 'sha256-b17c37b2724aece2a28beaab5720a777ae27e661ac51f1436be6eff3ca5ef64b', // feat/okf-accounting-domain-expansion (46 Sections across 5 Domains, 52 Circulars, 47 Forms)
130
+ 'sha256-a94baf08cbdea064a7b1bd25c1e1311821bf75e9b0d15cc8e0648339d487c79b', // feat/zoho-gstr2b-ap-reconciliation (38 Sections across 5 Domains, 44 Circulars, 39 Forms)
131
+ 'sha256-df76c16ed86673426eeb87fafa1c23712830ce5314339ff17fbb2e0e1795e046', // feat/notification-07-2025-composition-rent-rcm-exclusion (38 Sections across 5 Domains, 42 Circulars)
132
+ 'sha256-f7709f6a77a3b5ae16d69baf49f6e5c69bb01e29a4f13a506eb757220bf68e03', // feat/notification-09-2024-commercial-rent-rcm (38 Sections across 5 Domains, 41 Circulars)
133
+ 'sha256-2e402bb02fe71939c79b9f11ad737d20faac21daf8e27417cb13ec1933511c19', // feat/gst-rule-42-43 (38 Sections across 5 Domains)
88
134
  'sha256-feb1555f10c9f5c70de18ef340e0ba6cf1f060fb19cae866aa36240345c46f3a', // feat/rent-194ib-contract-194m (37 Sections across 5 Domains)
89
135
  'sha256-02090e4063a863e3486401215469350c911dc0c9a24855e1d9db2903946aa644', // feat/perquisites-194r (35 Sections across 5 Domains)
90
136
  'sha256-bd351719a8235c44f2bac87cc347423baa8ac3ecb74c0ee63d1fffa9f33dbebe', // feat/property-194ia (35 Sections across 5 Domains)
@@ -1847,6 +1893,69 @@ export class StatutoryClient {
1847
1893
  return revalueForeignExchangeIndAs109(payload);
1848
1894
  }
1849
1895
 
1896
+ /**
1897
+ * Business Combinations & Purchase Price Allocation (PPA) under Ind AS 103 / IFRS 3 / ASC 805.
1898
+ */
1899
+ calculateBusinessCombinationsIndAs103(payload) {
1900
+ return calculateBusinessCombinationsIndAs103(payload);
1901
+ }
1902
+
1903
+ /**
1904
+ * Asset & CGU Impairment Testing & DCF Value in Use under Ind AS 36 / IAS 36 / ASC 360.
1905
+ */
1906
+ calculateImpairmentIndAs36(payload) {
1907
+ return calculateImpairmentIndAs36(payload);
1908
+ }
1909
+
1910
+ /**
1911
+ * 5-Step Revenue Recognition & Relative SSP Allocation under Ind AS 115 / IFRS 15 / ASC 606.
1912
+ */
1913
+ calculateRevenueAllocationIndAs115(payload) {
1914
+ return calculateRevenueAllocationIndAs115(payload);
1915
+ }
1916
+
1917
+ /**
1918
+ * Right-of-Use Asset & Lease Liability Amortization under Ind AS 116 / IFRS 16 / ASC 842.
1919
+ */
1920
+ calculateLeaseAmortizationIndAs116(payload) {
1921
+ return calculateLeaseAmortizationIndAs116(payload);
1922
+ }
1923
+
1924
+ /**
1925
+ * Expected Credit Loss (ECL) Impairment under Ind AS 109 / IFRS 9 / ASC 326.
1926
+ */
1927
+ calculateExpectedCreditLossIndAs109(payload) {
1928
+ return calculateExpectedCreditLossIndAs109(payload);
1929
+ }
1930
+
1931
+ /**
1932
+ * ESOP Graded Vesting Front-Loaded Amortization under Ind AS 102 / IFRS 2 / ASC 718.
1933
+ */
1934
+ calculateEsopAmortizationIndAs102(payload) {
1935
+ return calculateEsopAmortizationIndAs102(payload);
1936
+ }
1937
+
1938
+ /**
1939
+ * Balance Sheet Deferred Tax (DTA / DTL) and ETR Reconciliation under Ind AS 12 / IAS 12 / ASC 740.
1940
+ */
1941
+ calculateDeferredTaxIndAs12(payload) {
1942
+ return calculateDeferredTaxIndAs12(payload);
1943
+ }
1944
+
1945
+ /**
1946
+ * Provisions, Contingent Liabilities & Tax Dispute Triangulation under Ind AS 37 / IAS 37 / ASC 450.
1947
+ */
1948
+ evaluateProvisionsAndContingenciesIndAs37(payload) {
1949
+ return evaluateProvisionsAndContingenciesIndAs37(payload);
1950
+ }
1951
+
1952
+ /**
1953
+ * Foreign Currency Monetary Revaluation & FCTR Translation under Ind AS 21 / IAS 21 / ASC 830.
1954
+ */
1955
+ calculateForeignCurrencyIndAs21(payload) {
1956
+ return calculateForeignCurrencyIndAs21(payload);
1957
+ }
1958
+
1850
1959
  /**
1851
1960
  * Section 194Q: Deduction of tax at source on purchase of goods exceeding ₹50 Lakh.
1852
1961
  */
@@ -1952,6 +2061,34 @@ export class StatutoryClient {
1952
2061
  return calculateRule37ASupplierNonFilingReversal(payload);
1953
2062
  }
1954
2063
 
2064
+ /**
2065
+ * Rule 42: Inputs and input services common ITC reversal (monthly provisional).
2066
+ */
2067
+ calculateRule42InputServiceReversal(payload) {
2068
+ return calculateRule42InputServiceReversal(payload);
2069
+ }
2070
+
2071
+ /**
2072
+ * Rule 42(2): Annual common credit true-up reconciliation & Section 50(1) interest.
2073
+ */
2074
+ reconcileRule42AnnualTrueUp(payload) {
2075
+ return reconcileRule42AnnualTrueUp(payload);
2076
+ }
2077
+
2078
+ /**
2079
+ * Rule 43: Capital goods common ITC 60-month amortisation and reversal.
2080
+ */
2081
+ calculateRule43CapitalGoodsReversal(payload) {
2082
+ return calculateRule43CapitalGoodsReversal(payload);
2083
+ }
2084
+
2085
+ /**
2086
+ * Rule 42 & 43: Combined input tax credit apportionment orchestrator.
2087
+ */
2088
+ calculateGstItcApportionmentRule42_43(payload) {
2089
+ return calculateGstItcApportionmentRule42_43(payload);
2090
+ }
2091
+
1955
2092
  /**
1956
2093
  * MSMED Act Section 16: Compound interest with monthly rests at 3x RBI Bank Rate.
1957
2094
  */
@@ -1973,6 +2110,211 @@ export class StatutoryClient {
1973
2110
  return evaluateCrossBorderRemittance(payload);
1974
2111
  }
1975
2112
 
2113
+ /**
2114
+ * Parse raw Tally or ERP daybook CSV text into normalized vouchers.
2115
+ * @param {string} csvText
2116
+ */
2117
+ parseTallyDaybookCsv(csvText) {
2118
+ return parseTallyDaybookCsv(csvText);
2119
+ }
2120
+
2121
+ /**
2122
+ * Parse raw Tally XML daybook export into normalized vouchers.
2123
+ * @param {string} xmlText
2124
+ */
2125
+ parseTallyDaybookXml(xmlText) {
2126
+ return parseTallyDaybookXml(xmlText);
2127
+ }
2128
+
2129
+ /**
2130
+ * Reconcile daybook vouchers against Section 194Q and Section 40(a)(ia) rules.
2131
+ * @param {Array<Object>} vouchers
2132
+ * @param {Object} [options]
2133
+ */
2134
+ reconcileDaybook(vouchers, options = {}) {
2135
+ return reconcile194QDaybook(vouchers, options);
2136
+ }
2137
+
2138
+ /**
2139
+ * Programmatic alias for reconcileDaybook.
2140
+ */
2141
+ reconcile194QDaybook(vouchers, options = {}) {
2142
+ return reconcile194QDaybook(vouchers, options);
2143
+ }
2144
+
2145
+ /**
2146
+ * Generate Tally-compliant XML compensating journal vouchers for unwithheld TDS.
2147
+ * @param {Object} reconciliationResult
2148
+ * @param {Object} [options]
2149
+ */
2150
+ generateTallyJournalXml(reconciliationResult, options = {}) {
2151
+ return generateTally194QJournalXml(reconciliationResult, options);
2152
+ }
2153
+
2154
+ /**
2155
+ * Programmatic alias for generateTallyJournalXml.
2156
+ */
2157
+ generateTally194QJournalXml(reconciliationResult, options = {}) {
2158
+ return generateTally194QJournalXml(reconciliationResult, options);
2159
+ }
2160
+
2161
+ /**
2162
+ * Format a clean Markdown audit exception report for Form 3CD working papers.
2163
+ * @param {Object} reconciliationResult
2164
+ */
2165
+ generateAuditReport(reconciliationResult) {
2166
+ return generateAuditMarkdownReport(reconciliationResult);
2167
+ }
2168
+
2169
+ /**
2170
+ * Parse raw Zoho Books Bills CSV text into normalized bill records.
2171
+ * @param {string} csvText
2172
+ */
2173
+ parseZohoBillsCsv(csvText) {
2174
+ return parseZohoBillsCsv(csvText);
2175
+ }
2176
+
2177
+ /**
2178
+ * Parse raw Zoho Books API JSON payload into normalized bill records.
2179
+ * @param {Object|string} jsonData
2180
+ */
2181
+ parseZohoBillsJson(jsonData) {
2182
+ return parseZohoBillsJson(jsonData);
2183
+ }
2184
+
2185
+ /**
2186
+ * Parse raw GST Portal Form GSTR-2B JSON payload into normalized invoice and CDNR records.
2187
+ * @param {Object|string} gstr2bData
2188
+ */
2189
+ parseGstr2bJson(gstr2bData) {
2190
+ return parseGstr2bJson(gstr2bData);
2191
+ }
2192
+
2193
+ /**
2194
+ * Reconcile Zoho Books AP Bills with Form GSTR-2B and audit Rule 37 180-day aging.
2195
+ * @param {Object} params
2196
+ * @param {Array<Object>|string} params.zohoBills
2197
+ * @param {Array<Object>|string} params.gstr2b
2198
+ * @param {Object} [params.options]
2199
+ */
2200
+ reconcileZohoGstr2b(params) {
2201
+ return reconcileZohoGstr2b(params);
2202
+ }
2203
+
2204
+ /**
2205
+ * Generate an executive Markdown audit exception memorandum for Zoho Books & GSTR-2B.
2206
+ * @param {Object} reconResult
2207
+ */
2208
+ generateGstr2bAuditMarkdownReport(reconResult) {
2209
+ return generateGstr2bAuditMarkdownReport(reconResult);
2210
+ }
2211
+
2212
+ /**
2213
+ * Programmatic alias for generateGstr2bAuditMarkdownReport.
2214
+ */
2215
+ generateGstr2bAuditReport(reconResult) {
2216
+ return generateGstr2bAuditMarkdownReport(reconResult);
2217
+ }
2218
+
2219
+ /**
2220
+ * Reconstruct cumulative portfolio ECL utilization for multiple overlapping overdue invoices under Rule 88B(3).
2221
+ * @param {Object} params
2222
+ */
2223
+ calculatePortfolioEclUtilizationInterest(params) {
2224
+ return calculatePortfolioEclUtilizationInterest(params);
2225
+ }
2226
+
2227
+ /**
2228
+ * Run regulatory watchtower surveillance and generate Empanelment Freshness Certificate.
2229
+ * @param {Object} [options]
2230
+ */
2231
+ async runWatchtower(options = {}) {
2232
+ const { runStatutoryWatchtower: runner } = await import('../scripts/watchtower.js');
2233
+ return runner({ okfDir: this.okfDir, ...options });
2234
+ }
2235
+
2236
+ /**
2237
+ * Calculate exact Day 180 overdue start date for an invoice.
2238
+ * @param {string} billDateIso
2239
+ */
2240
+ calculateOverdueStartDate(billDateIso) {
2241
+ return calculateOverdueStartDate(billDateIso);
2242
+ }
2243
+
2244
+ /**
2245
+ * Calculate chronological interest under Section 50(1) read with Rule 88B(3)
2246
+ * across Electronic Credit Ledger (ECL) movements.
2247
+ * @param {Object} params
2248
+ */
2249
+ calculateEclUtilizationInterest(params) {
2250
+ return calculateEclUtilizationInterest(params);
2251
+ }
2252
+
2253
+ /**
2254
+ * Construct an immutable evidence provenance record for a reconciliation item.
2255
+ * @param {Object} params
2256
+ */
2257
+ buildEvidenceProvenance(params) {
2258
+ return buildEvidenceProvenance(params);
2259
+ }
2260
+
2261
+ /**
2262
+ * Normalize invoice number for exact and alphanumeric canonical matching.
2263
+ * @param {string} raw
2264
+ */
2265
+ normalizeInvoiceNumber(raw) {
2266
+ return normalizeInvoiceNumber(raw);
2267
+ }
2268
+
2269
+ /**
2270
+ * Normalize and validate GSTIN string.
2271
+ * @param {string} raw
2272
+ */
2273
+ normalizeGstin(raw) {
2274
+ return normalizeGstin(raw);
2275
+ }
2276
+
2277
+ /**
2278
+ * Programmatic alias for generateAuditReport.
2279
+ */
2280
+ generateAuditMarkdownReport(reconciliationResult) {
2281
+ return generateAuditMarkdownReport(reconciliationResult);
2282
+ }
2283
+
2284
+ /**
2285
+ * Clean and normalize raw accounting numeric input.
2286
+ * @param {any} val
2287
+ * @param {Object} [options]
2288
+ */
2289
+ cleanNumericAmount(val, options = {}) {
2290
+ return cleanNumericAmount(val, options);
2291
+ }
2292
+
2293
+ /**
2294
+ * Round an amount to paisa precision (2 decimal places).
2295
+ * @param {any} amount
2296
+ */
2297
+ roundToPaisa(amount) {
2298
+ return roundToPaisa(amount);
2299
+ }
2300
+
2301
+ /**
2302
+ * Convert rupee amount to integer paise for zero-drift arithmetic.
2303
+ * @param {any} amount
2304
+ * @param {string} [fieldName='amount']
2305
+ */
2306
+ toIntegerPaise(amount, fieldName = 'amount') {
2307
+ return toIntegerPaise(amount, fieldName);
2308
+ }
2309
+
2310
+ /**
2311
+ * Convert integer paise back to rounded rupees.
2312
+ * @param {number} paise
2313
+ */
2314
+ fromIntegerPaise(paise) {
2315
+ return fromIntegerPaise(paise);
2316
+ }
2317
+
1976
2318
  /**
1977
2319
  * Retrieve statutory outcomes and disposition codes.
1978
2320
  * @param {string} [provision] Optional section code or provision alias
@@ -2217,7 +2559,7 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2217
2559
  successor: {
2218
2560
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2219
2561
  sectionCode: '393',
2220
- statutorySection: 'Section 393(1), Table 8, Item (ii)',
2562
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 8(ii)',
2221
2563
  title: 'Deduction of tax at source on payment of a certain sum for purchase of goods',
2222
2564
  effectiveDate: '2026-04-01',
2223
2565
  threshold: 'Buyer turnover > ₹10 Cr in preceding FY; annual purchases > ₹50 Lakhs in current FY',
@@ -2232,10 +2574,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2232
2574
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2233
2575
  legalPrinciple: 'Tax withholding liability crystallizes on the earlier of credit to payee account in books or payment disbursement. If the trigger event occurred on or before 31 March 2026, the 1961 Act governs the deduction, remittance, and compliance obligations, notwithstanding subsequent settlement.'
2234
2576
  },
2235
- aliases: ['194q', 'sec194q', 'section 194q', '393', 'sec393', 'section 393', '393(1)', '393(1)(table 8)(ii)', 'goods tds', 'purchase of goods']
2577
+ aliases: ['194q', 'sec194q', 'section 194q', '393', 'sec393', 'section 393', '393(1)', '393(1)(table 1)(sl 8)(ii)', '393(1)(table 8)(ii)', 'ita2025_sec393_table1_sl8_ii', 'goods tds', 'purchase of goods']
2236
2578
  },
2237
2579
  {
2238
- id: 'CROSSWALK_194J_393_TABLE6_III',
2580
+ id: 'CROSSWALK_194J_393_TABLE1_SL6_III',
2239
2581
  domain: 'direct_tax',
2240
2582
  predecessor: {
2241
2583
  act: 'Income-tax Act, 1961 (Act No. 43 of 1961)',
@@ -2251,10 +2593,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2251
2593
  successor: {
2252
2594
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2253
2595
  sectionCode: '393',
2254
- statutorySection: 'Section 393(1), Table 6, Item (iii)',
2596
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 6(iii)',
2255
2597
  title: 'Deduction of tax at source on fees for professional or technical services',
2256
2598
  effectiveDate: '2026-04-01',
2257
- threshold: '₹30,000 aggregate in financial year per category',
2599
+ threshold: '₹50,000 aggregate in financial year per category',
2258
2600
  standardRate: '2.0% (FTS) / 10.0% (Professional)',
2259
2601
  penaltyRate: '20.0% (Section 397(2))',
2260
2602
  challan: 'Challan under Income-tax Act, 2025',
@@ -2266,10 +2608,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2266
2608
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2267
2609
  legalPrinciple: 'Liability crystallizes on earlier of credit or payment. Pre-April 1, 2026 events are saved and governed under the 1961 Act.'
2268
2610
  },
2269
- aliases: ['194j', 'sec194j', 'section 194j', '393(1)(table 6)', 'technical services tds', 'professional fees tds', 'fts']
2611
+ aliases: ['194j', 'sec194j', 'section 194j', '393(1)(table 1)(sl 6)(iii)', '393(1)(table 6)', 'ita2025_sec393_table1_sl6_iii', 'technical services tds', 'professional fees tds', 'fts']
2270
2612
  },
2271
2613
  {
2272
- id: 'CROSSWALK_194C_393_TABLE3_I',
2614
+ id: 'CROSSWALK_194C_393_TABLE1_SL6_I',
2273
2615
  domain: 'direct_tax',
2274
2616
  predecessor: {
2275
2617
  act: 'Income-tax Act, 1961 (Act No. 43 of 1961)',
@@ -2285,7 +2627,7 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2285
2627
  successor: {
2286
2628
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2287
2629
  sectionCode: '393',
2288
- statutorySection: 'Section 393(1), Table 3, Item (i)',
2630
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 6(i)',
2289
2631
  title: 'Deduction of tax at source on payments to contractors',
2290
2632
  effectiveDate: '2026-04-01',
2291
2633
  threshold: 'Single contract > ₹30,000 or aggregate > ₹1,00,000 in FY',
@@ -2300,17 +2642,17 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2300
2642
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2301
2643
  legalPrinciple: 'Liability crystallizes on earlier of credit or payment. Pre-April 1, 2026 events are saved and governed under the 1961 Act.'
2302
2644
  },
2303
- aliases: ['194c', 'sec194c', 'section 194c', '393(1)(table 3)', 'contractor tds', 'subcontractor tds']
2645
+ aliases: ['194c', 'sec194c', 'section 194c', '393(1)(table 1)(sl 6)(i)', '393(1)(table 3)', 'contractor tds', 'subcontractor tds']
2304
2646
  },
2305
2647
  {
2306
- id: 'CROSSWALK_194I_393_TABLE5_I',
2648
+ id: 'CROSSWALK_194I_393_TABLE1_SL2',
2307
2649
  domain: 'direct_tax',
2308
2650
  predecessor: {
2309
2651
  act: 'Income-tax Act, 1961 (Act No. 43 of 1961)',
2310
2652
  sectionCode: '194I',
2311
2653
  statutorySection: 'Section 194I',
2312
2654
  title: 'Deduction of tax at source on rent',
2313
- threshold: '₹2,40,000 aggregate in financial year',
2655
+ threshold: '₹50,000 per month (or part of month)',
2314
2656
  standardRate: '2.0% (Plant & Machinery) / 10.0% (Land & Building)',
2315
2657
  penaltyRate: '20.0% (Section 206AA)',
2316
2658
  challan: 'ITNS 281',
@@ -2319,7 +2661,7 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2319
2661
  successor: {
2320
2662
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2321
2663
  sectionCode: '393',
2322
- statutorySection: 'Section 393(1), Table 5, Item (i)',
2664
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 2',
2323
2665
  title: 'Deduction of tax at source on rent',
2324
2666
  effectiveDate: '2026-04-01',
2325
2667
  threshold: '₹2,40,000 aggregate in financial year',
@@ -2334,10 +2676,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2334
2676
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2335
2677
  legalPrinciple: 'Liability crystallizes on earlier of credit or payment. Pre-April 1, 2026 events are saved and governed under the 1961 Act.'
2336
2678
  },
2337
- aliases: ['194i', 'sec194i', 'section 194i', '393(1)(table 5)', 'rent tds']
2679
+ aliases: ['194i', 'sec194i', 'section 194i', '393(1)(table 1)(sl 2)', '393(1)(table 5)', 'rent tds']
2338
2680
  },
2339
2681
  {
2340
- id: 'CROSSWALK_194H_393_TABLE4_I',
2682
+ id: 'CROSSWALK_194H_393_TABLE1_SL1_II',
2341
2683
  domain: 'direct_tax',
2342
2684
  predecessor: {
2343
2685
  act: 'Income-tax Act, 1961 (Act No. 43 of 1961)',
@@ -2353,10 +2695,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2353
2695
  successor: {
2354
2696
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2355
2697
  sectionCode: '393',
2356
- statutorySection: 'Section 393(1), Table 4, Item (i)',
2698
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 1(ii)',
2357
2699
  title: 'Deduction of tax at source on commission or brokerage',
2358
2700
  effectiveDate: '2026-04-01',
2359
- threshold: '₹15,000 aggregate in financial year',
2701
+ threshold: '₹20,000 aggregate in financial year',
2360
2702
  standardRate: '2.0%',
2361
2703
  penaltyRate: '20.0% (Section 397(2))',
2362
2704
  challan: 'Challan under Income-tax Act, 2025',
@@ -2368,10 +2710,10 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2368
2710
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2369
2711
  legalPrinciple: 'Liability crystallizes on earlier of credit or payment. Pre-April 1, 2026 events are saved and governed under the 1961 Act.'
2370
2712
  },
2371
- aliases: ['194h', 'sec194h', 'section 194h', '393(1)(table 4)', 'commission tds', 'brokerage tds']
2713
+ aliases: ['194h', 'sec194h', 'section 194h', '393(1)(table 1)(sl 1)(ii)', '393(1)(table 4)', 'commission tds', 'brokerage tds']
2372
2714
  },
2373
2715
  {
2374
- id: 'CROSSWALK_194R_393_TABLE8_12',
2716
+ id: 'CROSSWALK_194R_393_TABLE1_SL8_IV',
2375
2717
  domain: 'direct_tax',
2376
2718
  predecessor: {
2377
2719
  act: 'Income-tax Act, 1961 (Act No. 43 of 1961)',
@@ -2387,7 +2729,7 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2387
2729
  successor: {
2388
2730
  act: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2389
2731
  sectionCode: '393',
2390
- statutorySection: 'Section 393(1), Table 8, Item 12',
2732
+ statutorySection: 'Section 393(1), Table 1, Sl. No. 8(iv)',
2391
2733
  title: 'Deduction of tax at source on benefit or perquisite in respect of business or profession',
2392
2734
  effectiveDate: '2026-04-01',
2393
2735
  threshold: '₹20,000 aggregate value in financial year',
@@ -2402,7 +2744,7 @@ export const STATUTORY_CROSSWALK_CATALOG = [
2402
2744
  subsidiary: 'General Clauses Act, 1897 Section 6 (Effect of Repeal)',
2403
2745
  legalPrinciple: 'Liability crystallizes on earlier of credit or payment. Pre-April 1, 2026 events are saved and governed under the 1961 Act.'
2404
2746
  },
2405
- aliases: ['194r', 'sec194r', 'section 194r', 'perquisites tds', 'business benefits tds']
2747
+ aliases: ['194r', 'sec194r', 'section 194r', '393(1)(table 1)(sl 8)(iv)', 'perquisites tds', 'business benefits tds']
2406
2748
  },
2407
2749
  {
2408
2750
  id: 'CROSSWALK_195_393_2',
@@ -2930,7 +3272,7 @@ export const STATUTORY_AMENDMENTS_CHANGELOG = [
2930
3272
  statute: 'Income-tax Act, 2025 (Act No. 1 of 2025)',
2931
3273
  legalAuthority: 'Parliament of India / Income-tax Act, 2025',
2932
3274
  previousValue: 'Income-tax Act, 1961 (Scattered Chapter XVII-B sections: 194C, 194J, 194Q, 194I, 194H, 194R, 195)',
2933
- amendedValue: 'Income-tax Act, 2025 Section 393 Tables (Table 3: Contractors, Table 4: Commission, Table 5: Rent, Table 6: Professional/FTS, Table 8: Goods/Perquisites)',
3275
+ amendedValue: 'Income-tax Act, 2025 Section 393 Table 1 (Sl No 1: Commission, Sl No 2: Rent, Sl No 5: Interest, Sl No 6: Contractors/FTS, Sl No 8: Goods/Perquisites)',
2934
3276
  changeSummary: 'The Income-tax Act, 2025 consolidates and restructures direct tax withholding into unified schedules under Section 393, repealing the 1961 Act subject to Section 536 savings.',
2935
3277
  statutoryImpact: 'Withholding liabilities on or after 1 April 2026 are governed by 2025 Act section references and procedural compliance.',
2936
3278
  aliases: ['393', 'income tax act 2025', '2025 act']
@@ -2988,15 +3330,36 @@ export function getStatutoryDiff(options = {}) {
2988
3330
  }
2989
3331
 
2990
3332
  // ── Deterministic Zero-Dependency Statutory Calculators Export ──────────────
3333
+ async function runStatutoryWatchtower(options = {}) {
3334
+ const { runStatutoryWatchtower: runner } = await import('../scripts/watchtower.js');
3335
+ return runner(options);
3336
+ }
3337
+
2991
3338
  export {
2992
3339
  roundToPaisa,
2993
3340
  roundSection288B,
3341
+ cleanNumericAmount,
3342
+ toIntegerPaise,
3343
+ fromIntegerPaise,
3344
+ MalformedNumericInputError,
3345
+ MissingMandatoryParameterError,
3346
+ assertMandatoryNumeric,
2994
3347
  calculateCorporateTaxMatVsConcessional,
2995
3348
  evaluatePlaceOfSupplyAndLut,
2996
3349
  calculateTransferPricingAlp,
2997
3350
  evaluateSection79LossContinuity,
2998
3351
  evaluateSection281TaxClearance,
2999
3352
  revalueForeignExchangeIndAs109,
3353
+ calculateBusinessCombinationsIndAs103,
3354
+ calculateImpairmentIndAs36,
3355
+ calculateRevenueAllocationIndAs115,
3356
+ calculateLeaseAmortizationIndAs116,
3357
+ calculateExpectedCreditLossIndAs109,
3358
+ calculateEsopAmortizationIndAs102,
3359
+ calculateDeferredTaxIndAs12,
3360
+ evaluateProvisionsAndContingenciesIndAs37,
3361
+ calculateForeignCurrencyIndAs21,
3362
+ resolveMissingPanPenaltyFloor,
3000
3363
  evaluateSection194Q,
3001
3364
  evaluateSection194C,
3002
3365
  evaluateSection194H,
@@ -3015,6 +3378,9 @@ export {
3015
3378
  evaluateSection43bH,
3016
3379
  calculateMsmeCompoundInterest,
3017
3380
  calculateAdvanceTaxAndInterest,
3381
+ calculateRule42InputServiceReversal,
3382
+ reconcileRule42AnnualTrueUp,
3383
+ calculateRule43CapitalGoodsReversal,
3018
3384
  calculateGstItcApportionmentRule42_43,
3019
3385
  evaluateCrossBorderRemittance,
3020
3386
  generateMsme1AndScheduleThreeAging,
@@ -3028,7 +3394,25 @@ export {
3028
3394
  getStatutoryOutcomes,
3029
3395
  explainStatutoryDisposition,
3030
3396
  STATUTORY_OUTCOMES_DICTIONARY,
3031
- enrichWithOutcomeExplanation
3397
+ enrichWithOutcomeExplanation,
3398
+ parseTallyDaybookCsv,
3399
+ parseTallyDaybookXml,
3400
+ reconcile194QDaybook,
3401
+ generateTally194QJournalXml,
3402
+ generateAuditMarkdownReport,
3403
+ getIndianFinancialYear,
3404
+ parseZohoBillsCsv,
3405
+ parseZohoBillsJson,
3406
+ parseGstr2bJson,
3407
+ reconcileZohoGstr2b,
3408
+ generateGstr2bAuditMarkdownReport,
3409
+ normalizeInvoiceNumber,
3410
+ normalizeGstin,
3411
+ calculateOverdueStartDate,
3412
+ calculateEclUtilizationInterest,
3413
+ calculatePortfolioEclUtilizationInterest,
3414
+ buildEvidenceProvenance,
3415
+ runStatutoryWatchtower
3032
3416
  };
3033
3417
 
3034
3418