@mudraforge/statutory 2.13.0 → 2.14.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.
- package/CHANGELOG.md +15 -0
- package/README.md +6 -0
- package/package.json +1 -4
- package/src/calculators.js +139 -3
- package/src/constants.js +1 -1
- package/types/index.d.ts +95 -0
- package/conformance/README.md +0 -54
- package/conformance/fixtures/invalid_malformed_temporal_dates.json +0 -10
- package/conformance/fixtures/invalid_missing_effective_period.json +0 -6
- package/conformance/fixtures/invalid_missing_section_code.json +0 -9
- package/conformance/fixtures/valid_circular_frontmatter.md +0 -16
- package/conformance/fixtures/valid_full_section.json +0 -35
- package/conformance/fixtures/valid_minimal_section.json +0 -11
- package/conformance/test_conformance.js +0 -129
- package/docs/ACCOUNTING_ASSURANCE_AUDIT_DOSSIER.md +0 -276
- package/docs/ADESHA_ASSURANCE_OVERVIEW.md +0 -166
- package/docs/ARCHITECTURE.md +0 -773
- package/docs/ARCHITECTURE_DECISIONS.md +0 -158
- package/docs/CASE_01_FORM_TEXT.txt +0 -48
- package/docs/CATALOG.md +0 -1901
- package/docs/CA_PILOT_BENCHMARK_CASES.md +0 -282
- package/docs/CORPUS_QUALITY.md +0 -106
- package/docs/DATA_LICENSING.md +0 -73
- package/docs/DOMAIN_BREADTH_AND_DEPTH_COMPARISON.md +0 -209
- package/docs/ENTERPRISE_GOVERNANCE.md +0 -160
- package/docs/OKF_MAINTENANCE_SOP.md +0 -286
- package/docs/PILOT_EVALUATION_GUIDE.md +0 -215
- package/docs/PROVENANCE.md +0 -33
- package/docs/VERIFICATION.md +0 -106
- package/examples/README.md +0 -56
- package/examples/invoice_deduction_trace.json +0 -149
- package/examples/simulate_end_to_end_trace.js +0 -106
|
@@ -1,286 +0,0 @@
|
|
|
1
|
-
# OKF Statutory Profile: Maintenance Standard Operating Procedure (SOP)
|
|
2
|
-
|
|
3
|
-
> **Document Version**: 1.1.0
|
|
4
|
-
> **Classification**: Normative Engineering & Release Governance Standard
|
|
5
|
-
> **Target Substrate**: `@mudraforge/statutory` & Adesha Governance Runtime
|
|
6
|
-
> **Base Specification**: Open Knowledge Format (OKF) v0.2 (Upstream Google Specification)
|
|
7
|
-
> **Extension Profile**: MudraForge Statutory Knowledge Profile v0.2
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## 1. Purpose, Authority & Governance Boundary
|
|
12
|
-
|
|
13
|
-
This Standard Operating Procedure (SOP) establishes the mandatory release discipline, authoring conventions, citation standards, cryptographic integrity controls, and verification protocols for the MudraForge Statutory Knowledge Substrate (`@mudraforge/statutory`).
|
|
14
|
-
|
|
15
|
-
### 1.1 Release Control vs. Legal Correctness
|
|
16
|
-
This SOP functions as a **reproducible release control and engineering quality discipline**, not as proof of absolute statutory correctness or judicial finality:
|
|
17
|
-
- Passing all tests establishes conformance to the **tested requirements, mathematical formulas, and documented edge cases**. It does not independently prove that every legal interpretation is infallible or that government citations will remain valid indefinitely.
|
|
18
|
-
- In accordance with regulatory AI governance principles—such as those articulated in the Reserve Bank of India (RBI) 2025 FREE-AI Committee Report (*Free and Responsible Exploration of AI in Finance*)—automated toolkits, deterministic validators, and algorithmic guardrails exist to support institutional risk management, auditability, and validation. They are **decision-support controls**, never legal or statutory substitutes for an enterprise's own fiduciary governance, internal financial controls, or qualified tax counsel.
|
|
19
|
-
|
|
20
|
-
### 1.2 Target Failure Modes
|
|
21
|
-
This SOP is enforced to systematically prevent:
|
|
22
|
-
1. **Link Rot & Citation Drift**: Broken government URLs that degrade external inspectability and audit confidence.
|
|
23
|
-
2. **Behavioral & Calculator Drift**: Discrepancies between deterministic code calculators, LLM prompt directives, and primary legislative truth.
|
|
24
|
-
3. **Rollback, Replay & Tamper Vulnerabilities**: Malicious substitution, stale bundle replay, or unauthorized manipulation of statutory rules.
|
|
25
|
-
4. **Sub-Domain Collisions**: Heuristic false matches between single-digit or composite statutory sections (e.g. Section 8, Section 9(3), Section 194C).
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 2. Upstream OKF Specification vs. MudraForge Statutory Profile
|
|
30
|
-
|
|
31
|
-
To preserve architectural clarity, this standard strictly distinguishes between upstream Open Knowledge Format (OKF) conformance and MudraForge's additional statutory engineering profile:
|
|
32
|
-
|
|
33
|
-
```mermaid
|
|
34
|
-
flowchart TD
|
|
35
|
-
subgraph UPSTREAM["Upstream Google OKF v0.2 (Minimal & Portable)"]
|
|
36
|
-
direction TB
|
|
37
|
-
OKF_MD["Markdown Semantic Documentation"]
|
|
38
|
-
OKF_YAML["YAML Frontmatter Metadata (id, title, authority, dates)"]
|
|
39
|
-
OKF_DIR["Hierarchical Folder Structure by Regulatory Domain"]
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
subgraph PROFILE["MudraForge Statutory Profile (Engineering Extension)"]
|
|
43
|
-
direction TB
|
|
44
|
-
MF_JSON["section.json: Typed Machine Contracts & Formula ASTs"]
|
|
45
|
-
MF_CALC["Universal Statutory Virtual Machine (src/usvm/evaluation_vm.js)"]
|
|
46
|
-
MF_HASH["SHA-256 Merkle Tree Integrity Manifests (okf/manifest.json)"]
|
|
47
|
-
MF_SIG["Ed25519 Release Pinning & Tamper-Evident Signatures"]
|
|
48
|
-
MF_FAIL["Fail-Closed Missing Evidence & Contradiction Gates"]
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
UPSTREAM -->|Inherited By| PROFILE
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 2.1 Upstream OKF Conformance
|
|
55
|
-
Upstream Google OKF is a lightweight, portable knowledge representation designed for cross-agent interchange. It standardizes:
|
|
56
|
-
- Markdown-based legal narratives with structured YAML frontmatter.
|
|
57
|
-
- Hierarchical folder trees organized by regulatory jurisdiction and domain.
|
|
58
|
-
- Self-contained, portable knowledge artifacts that can be ingested by any LLM or knowledge base.
|
|
59
|
-
|
|
60
|
-
*Upstream OKF does NOT prescribe a specific calculation engine, machine-readable JSON schema, cryptographic release pipeline, or transactional runtime.*
|
|
61
|
-
|
|
62
|
-
### 2.2 The MudraForge Statutory Profile
|
|
63
|
-
The MudraForge Statutory Profile introduces additional normative engineering conventions on top of OKF to enable high-assurance financial automation:
|
|
64
|
-
- **Typed Machine Contracts (`section.json`)**: Eliminates heuristic interpretation of numeric thresholds, currency values, and applicability conditions.
|
|
65
|
-
- **Deterministic Computation**: All threshold comparisons, tax rates, excess math, and rounding execute through deterministic code on CPU (zero LLM token generation for numbers).
|
|
66
|
-
- **Cryptographic Release Verification**: SHA-256 Merkle trees and Ed25519 digital signatures guarantee byte-level non-tampering from edge to endpoint.
|
|
67
|
-
- **Fail-Closed Evidence Gates**: Rejection or quarantine of transactions when statutory evidence is incomplete, unverified, or contradictory.
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## 3. Architectural Separation & Testable Guarantees
|
|
72
|
-
|
|
73
|
-
Every statutory provision in the MudraForge profile maintains a strict division of responsibility across three distinct artifact types:
|
|
74
|
-
|
|
75
|
-
```mermaid
|
|
76
|
-
flowchart TD
|
|
77
|
-
subgraph ARTIFACTS["OKF Provision Directory: okf/<domain>/<statute_folder>/"]
|
|
78
|
-
SJ["section.json<br/>(Machine Contract)"]
|
|
79
|
-
CB["circulars/*.md<br/>(Semantic Executive Briefs)"]
|
|
80
|
-
FS["forms/*.json | forms/*.md<br/>(Filing Schemas & Templates)"]
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
subgraph ENGINE["Universal Statutory Virtual Machine (USVM)"]
|
|
84
|
-
SJ --> USVM["USVM Declarative Kernel<br/>• Declarative AST Execution<br/>• Rational BigInt Paisa Math<br/>• Fiduciary Invariant Gate"]
|
|
85
|
-
end
|
|
86
|
-
|
|
87
|
-
subgraph REASONING["Adesha Governance Layer (LLM + Human)"]
|
|
88
|
-
CB --> LLM["Agent Reasoning<br/>• Context Synthesis<br/>• Exception Analysis<br/>• Discrepancy Detection"]
|
|
89
|
-
CB --> AUDIT["External Tax Counsel<br/>• Independent Verification<br/>• Audit Trails"]
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
subgraph WRITEBACK["Compliance Systems"]
|
|
93
|
-
FS --> ERP["ERP Integration<br/>• Form 26Q, GSTR-3B, MSME-1"]
|
|
94
|
-
end
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### 3.1 Testable Guarantees
|
|
98
|
-
Rather than making unprovable claims of "zero hallucination", the MudraForge profile operates under four testable and verifiable guarantees:
|
|
99
|
-
|
|
100
|
-
1. **Deterministic Execution**: Calculations execute exclusively through deterministic code. Given identical inputs, rules, and effective dates, the resulting tax calculations, cumulative thresholds, and paisa rounding are mathematically invariant across all runs.
|
|
101
|
-
2. **Versioned Applicability**: Legal applicability is evaluated against versioned rules, notified effective dates, and explicit statutory sunset boundaries (e.g. Section 206C(1H) sunset on 1 April 2025; Section 393 effective 1 April 2026).
|
|
102
|
-
3. **Fail-Closed Handling of Uncertainty**: Missing, incomplete, or contradictory evidence triggers a fail-closed outcome (holding payments, flagging discrepancies, or requesting missing links) rather than manufacturing assumptions.
|
|
103
|
-
4. **Independent Verification**: Test fixtures verify specified behaviors, edge cases, and arithmetic against independent statutory ground truth rather than trusting agent self-reports.
|
|
104
|
-
|
|
105
|
-
### 3.2 Artifact Responsibilities
|
|
106
|
-
|
|
107
|
-
| Artifact | Primary Consumer | Content Mandate | Operational Role |
|
|
108
|
-
|---|---|---|---|
|
|
109
|
-
| [`section.json`](../okf/direct_tax/tds_goods_194q/section.json) | **Deterministic Engine Runtime** | Typed numbers, effective dates, boolean applicability conditions, and threshold formulas. | Machine execution on CPU. Prevents mathematical drift, rate confusion, and arithmetic errors. |
|
|
110
|
-
| `circulars/*.md` | **LLM Agents & Human Auditors** | Semantic legal context, executive interpretations, judicial precedents, and YAML frontmatter. | Cross-domain reasoning, statutory crosswalks, exception argumentation, and human auditability. |
|
|
111
|
-
| `forms/*` | **Compliance & Reporting Systems** | Machine-evaluable JSON schemas and Markdown return checklists. | Return preparation, ERP writeback payloads, and statutory disclosure schedules. |
|
|
112
|
-
|
|
113
|
-
---
|
|
114
|
-
|
|
115
|
-
## 4. Citation & Link Integrity Protocol
|
|
116
|
-
|
|
117
|
-
To prevent link rot caused by frequent government portal redesigns and CMS migrations, OKF provisions must follow the **Dual-Tier URL Standard**:
|
|
118
|
-
|
|
119
|
-
### 4.1 Tier 1: Canonical Authority Landing Pages
|
|
120
|
-
Direct PDF download paths on government websites frequently change or break during CMS updates. Therefore, official citation URLs must point to canonical, evergreen regulatory landing pages:
|
|
121
|
-
- **CBDT / Direct Tax Circulars**: `https://www.incometaxindia.gov.in/pages/communications/circulars.aspx`
|
|
122
|
-
- **CBDT Notifications**: `https://www.incometaxindia.gov.in/pages/communications/notifications.aspx`
|
|
123
|
-
- **Income-tax Act Provisions**: `https://www.incometaxindia.gov.in/pages/acts/income-tax-act.aspx`
|
|
124
|
-
- **CBIC / GST Circulars & Notifications**: `https://taxinformation.cbic.gov.in/`
|
|
125
|
-
- **MSME Policies & Office Memorandums**: `https://dcmsme.gov.in/` or `https://msme.gov.in/`
|
|
126
|
-
- **MCA Notifications & Orders**: `https://www.mca.gov.in/`
|
|
127
|
-
- **RBI Master Directions**: `https://www.rbi.org.in/`
|
|
128
|
-
- **Supreme Court of India**: `https://sci.gov.in/`
|
|
129
|
-
- **ICAI Standards & Guidance Notes**: `https://www.icai.org/`
|
|
130
|
-
- **US Internal Revenue Service (IRS)**: `https://www.irs.gov/`
|
|
131
|
-
|
|
132
|
-
### 4.2 Tier 2: Legal Instrument Metadata
|
|
133
|
-
In `section.json`, the legal instrument itself must be fully described so that statutory provenance is preserved even in offline or air-gapped environments:
|
|
134
|
-
```json
|
|
135
|
-
{
|
|
136
|
-
"authority": "Central Board of Direct Taxes (CBDT)",
|
|
137
|
-
"instrument": "Circular No. 13 of 2021 (Dated 30 June 2021)",
|
|
138
|
-
"subject": "Guidelines under section 194Q of the Income-tax Act, 1961 - Threshold calculation & advance netting",
|
|
139
|
-
"officialUrl": "https://www.incometaxindia.gov.in/pages/communications/circulars.aspx"
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
### 4.3 Domain Whitelist Enforcement
|
|
144
|
-
All citation URLs must belong to the regulatory domain whitelist defined in [`scripts/verify_citation_links.js`](../scripts/verify_citation_links.js). Citations to commercial blogs, paywalled content aggregators, or unvetted third-party websites are prohibited.
|
|
145
|
-
|
|
146
|
-
### 4.4 Protocol Security & TLS Trust
|
|
147
|
-
- **100% HTTPS Enforcement**: Insecure `http://` links are rejected by the linter.
|
|
148
|
-
- **Government PKI Recognition**: Automated link verification recognizes leaf certificates issued by the Government of India Controller of Certifying Authorities (CCA / NIC CA).
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
## 5. The 10-Step Release Control Lifecycle
|
|
153
|
-
|
|
154
|
-
Whenever authoring, updating, or amending a statutory provision, this 10-step quality discipline must be executed sequentially:
|
|
155
|
-
|
|
156
|
-
```mermaid
|
|
157
|
-
flowchart TD
|
|
158
|
-
S1["1. Legal Sourcing & Dual-Act Boundary"] --> S2["2. Author section.json"]
|
|
159
|
-
S2 --> S3["3. Author circulars/*.md"]
|
|
160
|
-
S3 --> S4["4. Author forms/* Schemas"]
|
|
161
|
-
S4 --> S5["5. Citation & Link Audit (npm run citations)"]
|
|
162
|
-
S5 --> S6["6. Linter & Schema Conformance (npm run validate)"]
|
|
163
|
-
S6 --> S7["7. Merkle Manifest Re-Gen (npm run manifest)"]
|
|
164
|
-
S7 --> S8["8. Client Pinning & Ed25519 Signing"]
|
|
165
|
-
S8 --> S9["9. Dual Regression Testing (Package + Engine)"]
|
|
166
|
-
S9 --> S10["10. SemVer Release & Distribution"]
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### Step 1: Legal Sourcing & Dual-Act Temporal Boundary
|
|
170
|
-
1. Identify primary legislation: Act name, Section number, notified effective date.
|
|
171
|
-
2. Determine temporal classification:
|
|
172
|
-
- `ACTIVE`: Currently in force under current legislation.
|
|
173
|
-
- `SUNSET_SUPERSEDED`: Subject to statutory sunset (e.g. Section 206C(1H) on 1 April 2025).
|
|
174
|
-
- `FUTURE_LAW`: Enacted forward law (e.g. Income-tax Act, 2025 Section 393 on 1 April 2026).
|
|
175
|
-
3. Author declarative AST package in `ast.json` evaluated by the Universal Statutory Virtual Machine (`src/usvm/evaluation_vm.js`).
|
|
176
|
-
|
|
177
|
-
### Step 2: Author `section.json` Machine Contract
|
|
178
|
-
- Declare mandatory fields: `sectionId`, `sectionCode`, `aliases`, `governingStatute`, `statutorySection`, `successorStatute`, `successorSection`, `title`, `effectivePeriod`, `plainTextSummary`, `keyStatutoryThresholds`, `officialCitations`, `requiredDocumentChecklist`, `tier`, `version`.
|
|
179
|
-
- Standardize all search aliases in lowercase or official legal codes (e.g. `["194q", "sec194q", "tds goods"]`).
|
|
180
|
-
|
|
181
|
-
### Step 3: Author Circulars (`circulars/*.md`)
|
|
182
|
-
- Enforce strict YAML frontmatter (`id`, `title`, `authority`, `date`, `statutory_section`, `valid_from`, `valid_to`, `temporal_status`, `subject`, `official_url`).
|
|
183
|
-
- Provide clear executive summaries detailing commercial application, tax base unbundling rules, and statutory exceptions.
|
|
184
|
-
|
|
185
|
-
### Step 4: Author Compliance Forms (`forms/*`)
|
|
186
|
-
- Supply machine-evaluable JSON schemas or Markdown checklists for compliance returns and statutory disclosures.
|
|
187
|
-
|
|
188
|
-
### Step 5: Citation & Link Integrity Audit
|
|
189
|
-
Run the automated citation verification suite:
|
|
190
|
-
```powershell
|
|
191
|
-
npm run citations
|
|
192
|
-
```
|
|
193
|
-
To run live network probing across all endpoints:
|
|
194
|
-
```powershell
|
|
195
|
-
node scripts/verify_citation_links.js --live
|
|
196
|
-
```
|
|
197
|
-
*Pass Criteria*: 0 syntax errors, 0 unauthorized domains, 0 HTTP failures.
|
|
198
|
-
|
|
199
|
-
### Step 6: Schema Conformance & Syntax Validation
|
|
200
|
-
Validate structure and conformance against test fixtures:
|
|
201
|
-
```powershell
|
|
202
|
-
npm run validate
|
|
203
|
-
npm run conformance
|
|
204
|
-
```
|
|
205
|
-
*Pass Criteria*: 100% schemas valid, 12/12 conformance fixtures passing, 0 defects.
|
|
206
|
-
|
|
207
|
-
### Step 7: Cryptographic Merkle Manifest Re-generation
|
|
208
|
-
Recompute per-file SHA-256 hashes and update the root Merkle digest:
|
|
209
|
-
```powershell
|
|
210
|
-
npm run manifest
|
|
211
|
-
npm run manifest:check
|
|
212
|
-
```
|
|
213
|
-
Record the resulting root hash in release notes.
|
|
214
|
-
|
|
215
|
-
### Step 8: Client Pinning & Trust Anchor Verification
|
|
216
|
-
1. Add the updated root digest to `PINNED_RELEASE_ROOTS` in [`src/index.js`](../src/index.js).
|
|
217
|
-
2. For remote edge synchronization, verify Ed25519 digital signature validation against the MudraForge Root Authority.
|
|
218
|
-
|
|
219
|
-
### Step 9: Dual Regression Testing
|
|
220
|
-
Execute both package unit tests and the core engine verification suite:
|
|
221
|
-
```powershell
|
|
222
|
-
# 1. Package Regression Suite (88 test suites)
|
|
223
|
-
npm run test
|
|
224
|
-
|
|
225
|
-
# 2. Engine Unified Test Runner (68 suites)
|
|
226
|
-
npm --prefix ../../mudraforge-sarvam test
|
|
227
|
-
|
|
228
|
-
# 3. Adesha Benchmark Runner (6 scenarios)
|
|
229
|
-
node ../../mudraforge-sarvam/tests/benchmarks/adesha_benchmark_challenge_01_runner.js
|
|
230
|
-
```
|
|
231
|
-
*Pass Criteria*: 100% passing across all 156 test suites and benchmark scenarios with 0 regressions.
|
|
232
|
-
|
|
233
|
-
### Step 10: SemVer Release & Distribution
|
|
234
|
-
1. Bump package version in `package.json` and synchronize `STATUTORY_CLIENT_VERSION` in `src/index.js`.
|
|
235
|
-
2. Document all changes in `CHANGELOG.md`.
|
|
236
|
-
3. Publish package to the public registry: `npm publish --access public`.
|
|
237
|
-
4. Deploy / seed edge catalogs on Cloudflare Workers KV.
|
|
238
|
-
5. Verify in a clean downstream consumer project (`scratch/fresh_public_npm_consumer`).
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
## 6. Anti-Drift & Security Invariants
|
|
243
|
-
|
|
244
|
-
All engineers and automated agents contributing to OKF provisions must uphold five mandatory invariants:
|
|
245
|
-
|
|
246
|
-
| Invariant | Operational Requirement | Verification Mechanism |
|
|
247
|
-
|---|---|---|
|
|
248
|
-
| **Rule 2: Stale Reference Scan** | After renaming or deprecating any provision, scan the entire codebase for stale references. | PowerShell `Get-ChildItem -Recurse \| Select-String` returns zero matches. |
|
|
249
|
-
| **Rule 3: Single Execution Path** | No duplicate inline calculators. All dispatchers delegate to canonical USVM kernel (`@mudraforge/statutory/usvm`). | Unit tests confirm identical mathematical output across all entrypoints. |
|
|
250
|
-
| **Rule 4: Regex User Input Escaping** | User-supplied search queries must be sanitized with `replace(/[.*+?^${}()\|[\]\\]/g, '\\$&')`. | Unit tests verify queries containing `(`, `)`, `[`, `]`, `*`. |
|
|
251
|
-
| **Rule 5: No Dead Schema Parameters** | Every parameter declared in `section.json` must be evaluated by the execution runtime. | Parameter mapping audit in `statutory_commons.js`. |
|
|
252
|
-
| **Rule 11: Statutory Truth Over Engine Output** | Calculations and effective dates must match independent legal ground truth, not merely agent agreement. | Parameterized test suites testing cumulative prior purchases and temporal dates. |
|
|
253
|
-
|
|
254
|
-
---
|
|
255
|
-
|
|
256
|
-
## 7. Verifiable Release Artifacts & Evidence Ledger
|
|
257
|
-
|
|
258
|
-
Claims of test passage and release integrity are substantiated by the following reproducible artifacts:
|
|
259
|
-
|
|
260
|
-
| Verification Layer | Active Release Evidence | Location / Verification Command |
|
|
261
|
-
|---|---|---|
|
|
262
|
-
| **Cryptographic Root** | `sha256-4bbe36c3db841b833dd2bebbd6c1c5ed735498e7b20d1221c323ceb211529fe0` | `npm run manifest:check` across all 86 files |
|
|
263
|
-
| **Citation Network Liveness** | 76/76 passing citations across 5 regulatory domains (0 failures) | `node scripts/verify_citation_links.js --live` |
|
|
264
|
-
| **Statutory Schema Conformance** | 29/29 sections, 30 circulars, 27 forms passing OKF v0.2 linter | `npm run validate` |
|
|
265
|
-
| **Package Regression** | 88/88 test suites passing with 100% reproducible precision | `npm run test` in `packages/statutory` |
|
|
266
|
-
| **Engine Invariant Regression** | 68/68 test suites passing across governance runtime and TLA+ oracles | `npm test` in `mudraforge-sarvam` |
|
|
267
|
-
| **Adesha Benchmark Challenge 01** | 6/6 scenarios scored (Base 100/100, Variants A-E verified) | `node mudraforge-sarvam/tests/benchmarks/adesha_benchmark_challenge_01_runner.js` |
|
|
268
|
-
| **Live NPM Consumer** | Installed and verified live from registry in clean consumer | `node scratch/fresh_public_npm_consumer/test_live_npm_benchmark.js` |
|
|
269
|
-
|
|
270
|
-
---
|
|
271
|
-
|
|
272
|
-
## 8. Pre-Flight Maintenance Checklist
|
|
273
|
-
|
|
274
|
-
Before closing any maintenance task or cutting a new release, verify that each item is completed:
|
|
275
|
-
|
|
276
|
-
- [ ] All 29 statutory provisions contain complete and valid `section.json` contracts.
|
|
277
|
-
- [ ] Every citation URL uses `https://` and resolves to an approved regulatory domain.
|
|
278
|
-
- [ ] `npm run citations` reports 0 defects and 0 unauthorized domains.
|
|
279
|
-
- [ ] `npm run validate` passes with 0 schema errors.
|
|
280
|
-
- [ ] `npm run conformance` passes 12/12 fixture tests.
|
|
281
|
-
- [ ] `npm run manifest:check` verifies all 86 files against SHA-256 digests.
|
|
282
|
-
- [ ] `PINNED_RELEASE_ROOTS` in `src/index.js` includes the active manifest root hash.
|
|
283
|
-
- [ ] Two-pass precision lookup correctly resolves single-digit sections (`8`, `9(3)`).
|
|
284
|
-
- [ ] All 88 package tests and 68 engine regression suites pass with 0 failures.
|
|
285
|
-
- [ ] Stale reference scan returns zero matches for deprecated names or legacy domains.
|
|
286
|
-
- [ ] Version number in `package.json` exactly matches `STATUTORY_CLIENT_VERSION`.
|
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
# MudraForge Adesha — Supervised Shadow Pilot Evaluation Guide
|
|
2
|
-
## Benchmarking Autonomous Finance AI Against Historical Accounts Payable Records
|
|
3
|
-
|
|
4
|
-
> **Document Type**: Enterprise Pilot Specification
|
|
5
|
-
> **System Under Evaluation**: MudraForge Adesha (Autonomous Finance AI)
|
|
6
|
-
> **Open Trust Anchor**: `@mudraforge/statutory` (MIT Zero-Dependency Substrate)
|
|
7
|
-
> **Execution Mode**: Supervised Read-Only Shadow Execution (Archival AP Records)
|
|
8
|
-
> **Target Audience**: Chief Financial Officers (CFOs), Heads of Tax, Accounts Payable Directors, Enterprise Risk Officers
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 1. Executive Context & Purpose
|
|
13
|
-
|
|
14
|
-
This document specifies the protocol for conducting a **Supervised Shadow Pilot** of MudraForge Adesha within an enterprise finance department.
|
|
15
|
-
|
|
16
|
-
In high-consequence corporate finance, autonomous systems must establish empirical accuracy and deterministic reliability before receiving operational authority. Modern accounts payable operations face immense regulatory pressure across direct tax withholding (TDS/TCS), commercial delayed payment laws (MSMED Act, Section 43B(h)), and evolving statutory transitions (the transition from the Income-tax Act, 1961 to the Income-tax Act, 2025). Human AP clerks and rigid rule engines frequently make systematic errors on cumulative thresholds, gross vs. basic tax bases, and legislative sunset dates.
|
|
17
|
-
|
|
18
|
-
MudraForge Adesha is an autonomous finance AI engineered to govern end-to-end accounts payable workflows. Rather than requesting live operational authority on day one, Adesha is evaluated in a **supervised shadow mode** against historical, customer-approved accounts payable datasets.
|
|
19
|
-
|
|
20
|
-
In this mode, Adesha reconstructs past vendor invoices, line items, and payment cycles in read-only memory, compares its deterministic legal determinations and simulated double-entry journal postings against the enterprise's historical enterprise resource planning (ERP) ledger entries, and generates an audit-grade reconciliation report highlighting variances, compliance risks, and cash-flow exposures.
|
|
21
|
-
|
|
22
|
-
### The Role of the Open Trust Anchor (`@mudraforge/statutory`)
|
|
23
|
-
A foundational risk in applying AI to enterprise finance is the hazard of ungrounded generative hallucinations. Adesha addresses this through architectural decoupling:
|
|
24
|
-
- **Autonomous Reasoning & Governance (Adesha Proprietary Platform)**: Ingests unstructured invoices, interprets complex scopes of work, arbitrates commercial discrepancies, and formulates payment authorization leases.
|
|
25
|
-
- **Deterministic Statutory Substrate ([`@mudraforge/statutory`](https://www.npmjs.com/package/@mudraforge/statutory))**: An open-source, zero-dependency legal knowledge format (OKF v0.2) and deterministic mathematical engine. All statutory determinations, cumulative thresholds, and tax formulas are calculated deterministically. Enterprise tax counsel and internal audit teams can inspect, verify, and run this substrate locally on-premise without external network communication.
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## 2. Core Pilot Objectives
|
|
30
|
-
|
|
31
|
-
The Supervised Shadow Pilot benchmarks Adesha's autonomous decision-making against settled historical records across five primary compliance domains:
|
|
32
|
-
|
|
33
|
-
1. **Withholding Tax (TDS/TCS) Classification & Rate Application**:
|
|
34
|
-
- Proper section categorization: Section 194C (Contractors: 1% individual vs. 2% company), Section 194J (Technical Services 2% vs. Professional 10%), Section 194I (Rent: 2% machinery vs. 10% land/building), and Section 194H (Commission: 2% post-October 2024 vs. 5% prior).
|
|
35
|
-
- Higher rate withholding for non-filers under Section 206AB (pre-1 April 2025) and invalid/inoperative PANs under Section 206AA (20% flat).
|
|
36
|
-
2. **Cumulative Financial-Year Threshold & Excess Math**:
|
|
37
|
-
- Verification of cumulative purchase gates under Section 194Q: ensuring withholding is calculated strictly on the incremental purchase value exceeding ₹50 Lakhs within the financial year, rather than the entire invoice amount.
|
|
38
|
-
- Aggregate contractor thresholds under Section 194C (single invoice > ₹30,000 or aggregate > ₹1,00,000).
|
|
39
|
-
3. **GST Basic Value Unbundling Adherence**:
|
|
40
|
-
- Verifying adherence to CBDT Circular No. 23 of 2017: confirming withholding was applied strictly to the basic taxable value and not computed on gross invoice totals inclusive of separately itemized CGST, SGST, or IGST.
|
|
41
|
-
4. **Legislative Sunsets & Dual-Act Temporal Crystallization**:
|
|
42
|
-
- Confirming that seller TCS under Section 206C(1H) was omitted for transactions on or after 1 April 2025.
|
|
43
|
-
- Governing withholding crystallization by the earlier-event rule (earlier of credit in books or payment disbursement), correctly distinguishing between the Income-tax Act, 1961 and the Income-tax Act, 2025 (effective 1 April 2026).
|
|
44
|
-
5. **MSME Delayed Payment Compliance & Section 43B(h)**:
|
|
45
|
-
- Tracking statutory payment clocks under Sections 15 and 16 of the MSMED Act, 2006 (15 days for unwritten terms, maximum 45 days for written agreements).
|
|
46
|
-
- Flagging compound interest liabilities at three times the RBI repo rate and identifying disallowance risks under Section 43B(h) of the Income-tax Act for amounts unpaid to Micro and Small suppliers at fiscal year-end, while applying the statutory trader exclusion (Office Memorandum 2/1(5)/2021).
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## 3. Candidate Ingestion Schema & Phased Staging
|
|
51
|
-
|
|
52
|
-
To minimize operational demands on enterprise accounting personnel, the pilot follows a two-stage progressive protocol:
|
|
53
|
-
|
|
54
|
-
### Phase 1: Calibration & Field Alignment (30 to 50 Historical Invoices)
|
|
55
|
-
A representative batch of 30 to 50 settled vendor invoices with known tax and payment outcomes is ingested. This phase validates data field mappings, verifies vendor classification schemas, and establishes baseline reconciliation rules with negligible customer effort.
|
|
56
|
-
|
|
57
|
-
### Phase 2: Comprehensive Historical Shadow Benchmark (200 to 500 Historical Invoices)
|
|
58
|
-
Following Phase 1 calibration, the evaluation expands to a full quarter's transaction volume (200 to 500 invoices). This volume enables robust validation of cumulative vendor spend thresholds (Section 194Q, Section 194C) and multi-month MSME payment clock tracking.
|
|
59
|
-
|
|
60
|
-
### Data Ingestion Parameters
|
|
61
|
-
The customer provides an archival tabular export (CSV, XLSX, or JSON extract) containing the following fields:
|
|
62
|
-
|
|
63
|
-
| Field Group | Required Parameters | Analytical Purpose in Shadow Pilot |
|
|
64
|
-
| :--- | :--- | :--- |
|
|
65
|
-
| **Transaction Metadata** | Invoice Number, Invoice Date, ERP Booking Date | Establishes temporal validity, accounting credit timestamp, and legislative regime. |
|
|
66
|
-
| **Vendor Identity** | Vendor Legal Name, Entity Type (Individual, LLP, Corporate), Vendor PAN, GSTIN | Determines applicable statutory rate tiers, corporate status, and Section 206AA rate penalties. |
|
|
67
|
-
| **Financial Values** | Basic Taxable Amount, Itemized CGST, SGST, IGST, Total Gross Invoice Value | Assesses adherence to GST unbundling standards vs. gross withholding. |
|
|
68
|
-
| **Historical ERP Classification** | Line-item description, historical TDS section applied, historical TDS amount withheld | Benchmarks human/ERP decisions against Adesha's deterministic statutory engine. |
|
|
69
|
-
| **Settlement Details** | Payment / Bank Clearance Date, Historical Payment Method, Bank UTR (if recorded) | Measures settlement intervals against MSMED Act statutory clocks. |
|
|
70
|
-
| **Vendor Master Attributes** | MSME Registration Category (Micro, Small, Medium, Trader), Udyam Number (if on file) | Drives MSME statutory interest calculations and Section 43B(h) disallowance risk analysis. |
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## 4. Adesha Shadow Execution Pipeline
|
|
75
|
-
|
|
76
|
-
The Supervised Shadow Pilot operates entirely offline as a non-intrusive analytical pipeline:
|
|
77
|
-
|
|
78
|
-
```
|
|
79
|
-
[Customer Archival AP Extract]
|
|
80
|
-
│
|
|
81
|
-
▼
|
|
82
|
-
┌────────────────────────────────────────┐
|
|
83
|
-
│ Phase 1: Ingestion & Input Validation │
|
|
84
|
-
│ - Field schema verification │
|
|
85
|
-
│ - Tax identifier syntax validation │
|
|
86
|
-
└────────────────────────────────────────┘
|
|
87
|
-
│
|
|
88
|
-
▼
|
|
89
|
-
┌────────────────────────────────────────┐
|
|
90
|
-
│ Phase 2: Semantic Reasoning & Parsing │
|
|
91
|
-
│ - Scope of work analysis │
|
|
92
|
-
│ - Contractual term classification │
|
|
93
|
-
└────────────────────────────────────────┘
|
|
94
|
-
│
|
|
95
|
-
▼
|
|
96
|
-
┌────────────────────────────────────────┐
|
|
97
|
-
│ Phase 3: USVM Declarative Grounding │
|
|
98
|
-
│ (@mudraforge/statutory/usvm) │
|
|
99
|
-
│ - Declarative AST rule evaluation │
|
|
100
|
-
│ - Cumulative FY threshold evaluation │
|
|
101
|
-
│ - 5-stage rational BigInt arithmetic │
|
|
102
|
-
│ - Statutory withholding derivation │
|
|
103
|
-
└────────────────────────────────────────┘
|
|
104
|
-
│
|
|
105
|
-
▼
|
|
106
|
-
┌────────────────────────────────────────┐
|
|
107
|
-
│ Phase 4: Simulated AP Orchestration │
|
|
108
|
-
│ - Single-use payment lease derivation │
|
|
109
|
-
│ - Double-entry ERP journal simulation │
|
|
110
|
-
└────────────────────────────────────────┘
|
|
111
|
-
│
|
|
112
|
-
▼
|
|
113
|
-
┌────────────────────────────────────────┐
|
|
114
|
-
│ Phase 5: Reconciliation & Variance │
|
|
115
|
-
│ - Delta analysis vs. historical ERP │
|
|
116
|
-
│ - Fail-closed ambiguity isolation │
|
|
117
|
-
└────────────────────────────────────────┘
|
|
118
|
-
│
|
|
119
|
-
▼
|
|
120
|
-
[Advisory Discrepancy & Verification Report]
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### The Fail-Closed Ambiguity Standard
|
|
124
|
-
In corporate finance, certain transactions contain contractual ambiguities that cannot be resolved solely from ledger metadata (for example, composite contracts spanning both equipment hardware supply and specialized engineering services).
|
|
125
|
-
|
|
126
|
-
- **Strict Fail-Closed Policy**: Adesha does not generate arbitrary tax assumptions or probabilistic guesses on ambiguous transactions.
|
|
127
|
-
- **Flagged Review Categories**: When archival data lacks necessary granularity (such as missing scope-of-work documentation or unbundled tax breakdowns), Adesha categorizes the item as `REQUIRES_HUMAN_REVIEW` accompanied by an explicit legal justification detailing the evidentiary prerequisite.
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 5. Pilot Deliverables & Tri-Part Variance Classification
|
|
132
|
-
|
|
133
|
-
At the conclusion of the evaluation, the enterprise finance leadership receives a comprehensive **Advisory Accounts Payable Discrepancy & Verification Report** comprising:
|
|
134
|
-
|
|
135
|
-
### 1. Executive Summary
|
|
136
|
-
- Total transaction count evaluated vs. records with complete statutory determinability.
|
|
137
|
-
- Aggregate count and value of historical transactions matching statutory baseline.
|
|
138
|
-
- Aggregate count and value of identified statutory variances and compliance risks.
|
|
139
|
-
|
|
140
|
-
### 2. Tri-Part Variance Classification Register
|
|
141
|
-
To provide actionable clarity without premature legal assumptions, all identified variances are categorized into three distinct classes:
|
|
142
|
-
|
|
143
|
-
- **Category A — Confirmed Calculation & Threshold Variances**:
|
|
144
|
-
Direct mathematical, rounding, or threshold calculation errors on settled law. Examples include withholding tax deducted on gross invoice totals instead of net basic amounts, or Section 194Q applied to the full invoice rather than the excess over ₹50 Lakhs.
|
|
145
|
-
- **Category B — Statutory Rate & Classification Discrepancies**:
|
|
146
|
-
Inconsistent statutory classifications where all transaction attributes (PAN, entity type, invoice date) are complete on the face of the record. Examples include applying Section 194C (2%) to professional services governed by Section 194J (10%), or applying Section 206C(1H) post-sunset.
|
|
147
|
-
- **Category C — Documentation Verification Checkpoints**:
|
|
148
|
-
Instances where historical treatment differed from statutory defaults but may be legally substantiated by external documents not present in the tabular ledger. Examples include lower-withholding certificates issued under Section 197, goods transporter declarations under Section 194C(6), or MSME trader NIC classification exclusions. These items are presented as *verification checkpoints* for internal tax counsel rather than asserting non-compliance.
|
|
149
|
-
|
|
150
|
-
### 3. Statutory Audit Trail
|
|
151
|
-
Every identified variance includes direct, canonical citations to the governing statute, section number, official Gazette notification, and relevant CBDT/CBIC executive circular.
|
|
152
|
-
|
|
153
|
-
### 4. Shadow Double-Entry Journal Reconciliation
|
|
154
|
-
For every invoice, Adesha generates a simulated double-entry journal voucher (Debit Expense, Debit Input Tax, Credit Vendor Payable, Credit TDS Payable). This simulated voucher is compared against the historical ERP general ledger journal to highlight booking discrepancies.
|
|
155
|
-
|
|
156
|
-
### Analytical Scope & Boundary Commitments
|
|
157
|
-
|
|
158
|
-
| What the Supervised Shadow Pilot Demonstrates | What It Cannot Establish by Itself |
|
|
159
|
-
| :--- | :--- |
|
|
160
|
-
| Adesha accurately parses and interprets historical AP extracts. | Instantaneous ingestion of proprietary ERP schemas without initial field mapping. |
|
|
161
|
-
| Mathematical and statutory determinations strictly agree with independent tax ground truth. | Legal infallibility across non-standard or unresolved statutory litigation edge cases. |
|
|
162
|
-
| Complete audit traceability from every recommendation to primary gazette citations. | Guaranteed immediate financial recovery or cash tax refunds. |
|
|
163
|
-
| Repeat deterministic runs on identical archival inputs produce mathematically identical results. | Production-grade real-time banking security or live ERP multi-region high availability. |
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## 6. Security, Confidentiality & Data Protection
|
|
168
|
-
|
|
169
|
-
Corporate accounts payable records contain commercially sensitive supplier pricing, bank account details, and corporate tax identifiers. The Supervised Shadow Pilot adheres to strict security protocols:
|
|
170
|
-
|
|
171
|
-
### Baseline Execution Boundaries
|
|
172
|
-
- **On-Premise / Private Cloud Execution**: The pilot engine and open `@mudraforge/statutory` substrate can run entirely within the enterprise's private network or local workstation environment with zero external data egress.
|
|
173
|
-
- **Strictly Read-Only Ingestion**: Adesha accesses only the historical extract provided by the customer. It possesses zero programmatic access to active ERP systems, production databases, or banking networks.
|
|
174
|
-
|
|
175
|
-
### Information Governance Protocols
|
|
176
|
-
Prior to ingesting customer records, standard enterprise safeguards are established:
|
|
177
|
-
1. **Bilateral Non-Disclosure Agreement (NDA)**: Protecting all vendor commercial terms, volume discounts, and operational financial metrics.
|
|
178
|
-
2. **Customer-Side Pseudonymization**: The enterprise may hash or redact sensitive identifiers (such as bank account numbers or internal vendor keys) prior to transmission.
|
|
179
|
-
3. **Data Disposal Mandate**: Certified cryptographic deletion of all evaluation datasets upon delivery and acceptance of the final audit report.
|
|
180
|
-
|
|
181
|
-
---
|
|
182
|
-
|
|
183
|
-
## 7. Strict Operational Safeguards
|
|
184
|
-
|
|
185
|
-
To maintain clear enterprise governance, the pilot operates under absolute operational restrictions:
|
|
186
|
-
|
|
187
|
-
- **Zero Live Ledger Mutations**: Adesha will not write back journals, alter vendor balances, or modify general ledger accounts in SAP, Zoho Books, NetSuite, Oracle, or Tally.
|
|
188
|
-
- **Zero Banking Rail Access**: Adesha does not connect to corporate banking APIs, initiate wire transfers, or hold authority to disburse funds.
|
|
189
|
-
- **Zero Regulatory Submissions**: Adesha will not generate or transmit Form 26Q quarterly returns or TDS challans to government portals.
|
|
190
|
-
- **Technical Advisory Designation**: All deliverables constitute technical compliance analysis and do not replace formal legal or statutory audit opinions from certified enterprise tax counsel.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
## 8. Quantitative Evaluation & Acceptance Benchmarks
|
|
195
|
-
|
|
196
|
-
The success of the Supervised Shadow Pilot is measured against objective, pre-agreed quantitative benchmarks:
|
|
197
|
-
|
|
198
|
-
| Evaluation Benchmark | Objective Definition | Success Threshold |
|
|
199
|
-
| :--- | :--- | :--- |
|
|
200
|
-
| **Input Completeness** | Proportion of archival records with sufficient parameters to evaluate statutory applicability | $\ge 90\%$ of provided dataset |
|
|
201
|
-
| **Calculation Accuracy** | Agreement with settled statutory ground truth on unambiguous records | $100\%$ precision on verified provisions |
|
|
202
|
-
| **Ambiguity Isolation** | Strict fail-closed categorization of records lacking necessary documentation | $100\%$ isolation of uncertain records |
|
|
203
|
-
| **Citation Traceability** | Traceability of every flagged variance to deep primary government endpoints | $100\%$ verified canonical citations |
|
|
204
|
-
| **Deterministic Reproducibility** | Mathematical identity across repeat runs on the same input dataset | Zero variance across repeated runs |
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
## 9. Initiating a Supervised Shadow Pilot
|
|
209
|
-
|
|
210
|
-
To schedule an architecture review, receive sample ingestion schemas, or coordinate a Supervised Shadow Pilot for your finance organization:
|
|
211
|
-
|
|
212
|
-
- **Enterprise Inquiries**: [hello@mudraforge.in](mailto:hello@mudraforge.in) or [support@mudraforge.in](mailto:support@mudraforge.in)
|
|
213
|
-
- **Direct Founder Contact**: Mondeep Engti at [mondeepe@gmail.com](mailto:mondeepe@gmail.com)
|
|
214
|
-
- **Technical Architecture Documentation**: [https://mudraforge.in/docs](https://mudraforge.in/docs)
|
|
215
|
-
- **Open Trust Anchor Repository**: [https://github.com/mondeep0123/mudraforge-statutory](https://github.com/mondeep0123/mudraforge-statutory)
|
package/docs/PROVENANCE.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# Published Release & Provenance Ledger
|
|
2
|
-
|
|
3
|
-
This document records the cryptographic provenance, normative specifications, and formal assurance artifacts for `@mudraforge/statutory`.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Release Baseline Ledger
|
|
8
|
-
|
|
9
|
-
| Item | Value |
|
|
10
|
-
|---|---|
|
|
11
|
-
| **Package Release** | **`v2.13.0`** (Production Release) |
|
|
12
|
-
| **Knowledge Specification** | **Google Open Knowledge Format (OKF v0.2) + MudraForge Statutory Schema Extension** |
|
|
13
|
-
| **Regulatory Snapshot** | **CBDT / CBIC / MCA / MSME Baseline: November 2026** |
|
|
14
|
-
| **Corpus Quality Card** | 100% Primary Citation Resolution (125/125 URLs verified; 182 citations across 46 provisions) in [`docs/CORPUS_QUALITY.md`](./CORPUS_QUALITY.md) |
|
|
15
|
-
| **Architecture Decision Records** | 7 Normative ADRs documented in [`docs/ARCHITECTURE_DECISIONS.md`](./ARCHITECTURE_DECISIONS.md) |
|
|
16
|
-
| **Vendor Conformance Suite** | 12/12 Passing Fixture Tests in [`conformance/`](../conformance/) |
|
|
17
|
-
| **End-to-End Execution Trace** | Audited 7-stage AP lifecycle in [`examples/`](../examples/) (`npm run example:trace`) |
|
|
18
|
-
| **Enterprise Assurance Preview** | Formal TLA+ & mutation defenses in [`docs/ADESHA_ASSURANCE_OVERVIEW.md`](./ADESHA_ASSURANCE_OVERVIEW.md) |
|
|
19
|
-
| **Integrity Root** | SHA-256 root manifest in [`okf/manifest.json`](../okf/manifest.json) (`sha256-7ffc75e8611a9c966eea756dd544fdae9144e2318d3478633232bb876d05e364` across 191 files) |
|
|
20
|
-
| **Temporal Framework** | Dual-Act Bridge: *Income-tax Act, 1961* & *Income-tax Act, 2025* |
|
|
21
|
-
| **Verification Gate** | 100% Pass across all 166 test suites (cumulative thresholds, legislative sunsets, and excess math) |
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## Cryptographic & Epistemic Scope
|
|
26
|
-
|
|
27
|
-
The SHA-256 root hash in `okf/manifest.json` provides mathematical verification of **byte-level integrity** (ensuring local files have not been corrupted, altered, or partially written). A hash certifies that bytes match the published release; it does not by itself constitute legal or statutory authority.
|
|
28
|
-
|
|
29
|
-
Epistemic authority is established strictly via:
|
|
30
|
-
1. Primary gazette citations and statutory text enacted by Parliament.
|
|
31
|
-
2. Executive circulars and notifications issued by the CBDT, CBIC, MCA, and Ministry of MSME.
|
|
32
|
-
3. Cryptographic Ed25519 signatures anchored to the MudraForge Root Authority.
|
|
33
|
-
4. Independent legal ground-truth test suites parameterizing effective dates and cumulative turnover thresholds.
|
package/docs/VERIFICATION.md
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
# @mudraforge/statutory: Verification & Conformance Report
|
|
2
|
-
|
|
3
|
-
> **Audited Package**: `@mudraforge/statutory` v2.13.0 (Public Open Knowledge Commons)
|
|
4
|
-
> **Target Runtime**: Node.js v20+, Bun, Deno, Cloudflare Workers
|
|
5
|
-
> **Public Test Status**: 166 Multi-Domain Regression & Verification Suites Passing (100% Reproducible)
|
|
6
|
-
> **Cryptographic Scope**: SHA-256 Merkle root digest over 191 bundled knowledge files (0 mismatches)
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## 1. Scope & Epistemic Limitations
|
|
11
|
-
|
|
12
|
-
In enterprise software and autonomous compliance systems, **a passing test suite is evidence of conformance under tested conditions—it is not an absolute judicial proof that every statutory interpretation or real-world edge case is correct**.
|
|
13
|
-
|
|
14
|
-
This report documents:
|
|
15
|
-
1. The reproducible public test commands used to verify OKF schemas, circular frontmatter, and temporal state transitions.
|
|
16
|
-
2. The differential tests used to check statutory threshold calculations against published legal sources.
|
|
17
|
-
3. The cryptographic integrity checks certifying that bundled local files match the published release byte-for-byte.
|
|
18
|
-
4. The vendor-neutral conformance fixtures ensuring third-party parsers interpret records consistently.
|
|
19
|
-
|
|
20
|
-
> **Commercial Architecture Reference**:
|
|
21
|
-
> For the commercial Adesha Autonomous Finance Runtime's formal verification—including TLC model checking of the payment authorization state space, adversarial mutation testing (MUTANT-01 to MUTANT-12), and Two-Generals banking timeout recovery—see [`ADESHA_ASSURANCE_OVERVIEW.md`](./ADESHA_ASSURANCE_OVERVIEW.md).
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## 2. Reproducing Public Package Checks Locally
|
|
26
|
-
|
|
27
|
-
Any developer, Chartered Accountant, or auditor can reproduce the verification checks for this open-source package locally with **zero external network access**:
|
|
28
|
-
|
|
29
|
-
```bash
|
|
30
|
-
# 1. Run the multi-domain regression suite (88 test suites covering all provisions & failure modes)
|
|
31
|
-
npm test
|
|
32
|
-
|
|
33
|
-
# 2. Run the fail-closed OKF schema & circular frontmatter validator
|
|
34
|
-
npm run validate
|
|
35
|
-
|
|
36
|
-
# 3. Run the vendor-neutral OKF conformance suite (12 fixture assertions)
|
|
37
|
-
npm run conformance
|
|
38
|
-
|
|
39
|
-
# 4. Generate the corpus quality card (Google Data Cards Playbook standard)
|
|
40
|
-
npm run quality
|
|
41
|
-
|
|
42
|
-
# 5. Verify cryptographic SHA-256 Merkle root integrity of all bundled files
|
|
43
|
-
npm run manifest:check
|
|
44
|
-
|
|
45
|
-
# 6. Recompile the statutory catalog from source files
|
|
46
|
-
npm run catalog
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 3. Cryptographic Integrity vs. Statutory Legal Truth
|
|
52
|
-
|
|
53
|
-
It is critical to distinguish **byte-level distribution integrity** from **statutory legal ground truth**:
|
|
54
|
-
|
|
55
|
-
- **What a SHA-256 hash proves**: Byte fidelity. It proves that the downloaded JSON schema or Markdown circular matches the exact byte sequence recorded in the Merkle manifest at publication time, ensuring no corrupted or partial writes.
|
|
56
|
-
- **What a SHA-256 hash does NOT prove**: Statutory correctness. A cryptographically intact file can still contain a legally outdated or misconstrued provision.
|
|
57
|
-
- **How legal truth is verified**: Every provision must pass our differential test suite (`test.js`) and corpus quality audit (`scripts/corpus_quality_report.js`), verifying calculations against primary Union Gazettes, official CBDT/CBIC circulars, and independent CA legal baselines.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## 4. Differential Test Coverage for Statutory Outcomes
|
|
62
|
-
|
|
63
|
-
The regression suite (`test.js`) verifies calculations against independently formulated legal baselines across key statutory boundary conditions:
|
|
64
|
-
|
|
65
|
-
| Provision / Domain | Tested Condition | Legal Ground Truth | Test Outcome |
|
|
66
|
-
| :--- | :--- | :--- | :--- |
|
|
67
|
-
| **Direct Tax: Section 194Q** | Cumulative purchases cross ₹50L threshold | Deduct 0.1% strictly on excess over ₹50L, NOT on gross | [PASS] Verified |
|
|
68
|
-
| **Direct Tax: Section 194Q** | Inoperative or missing vendor PAN | Section 206AA rate capped strictly at 5.0% | [PASS] Verified |
|
|
69
|
-
| **Direct Tax: Section 194J** | Technical Services vs. Professional Fees | 2% rate for FTS, 10% rate for professional services | [PASS] Verified |
|
|
70
|
-
| **Direct Tax: Section 206C(1H)** | Evaluated on or after 1 April 2025 | Finance Act 2025 sunsets section w.e.f. 01-04-2025 | [PASS] Intercepted |
|
|
71
|
-
| **Indirect Tax: CGST Sec 17(5)** | Blocked ITC negative list categories | Motor vehicles <= 13 seats, food/catering, club memberships | [PASS] Blocked |
|
|
72
|
-
| **MSME: MSMED Sections 15 & 16** | Payment window & compound penal interest | 15 days default / 45 days written contract; 3x RBI bank rate | [PASS] Verified |
|
|
73
|
-
| **Cross-Border: IRC §§ 901/904** | Foreign Tax Credit limitation baskets | Pass-through entity taxes, IRS Schedule K-3 requirement | [PASS] Verified |
|
|
74
|
-
| **Corporate M&A: Section 50B** | Slump sale net worth computation & FMV | WDV for depreciable assets, revaluations ignored, 0% GST going concern | [PASS] Verified |
|
|
75
|
-
| **Local Resilience (Dead Network)**| Edge query unreachable / simulated dead network | Gracefully falls back to local OKF disk snapshot | [PASS] Verified |
|
|
76
|
-
| **Explicit Retrieval Modes** | `mode: 'local'` requested by caller | Fails closed if provision unbundled; 0 network calls | [PASS] Verified |
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
## 5. Vendor-Neutral OKF Conformance Assertions
|
|
81
|
-
|
|
82
|
-
The conformance runner (`conformance/test_conformance.js`) tests parser behavior against standalone JSON and Markdown fixtures in `conformance/fixtures/`:
|
|
83
|
-
|
|
84
|
-
1. **Schema Ingestion**: Minimal valid schemas (`valid_minimal_section.json`) and full metadata schemas (`valid_full_section.json`) accepted.
|
|
85
|
-
2. **Temporal Bound Sanity**: Rejects schemas with missing effective dates (`invalid_missing_effective_period.json`) or inverted timelines (`invalid_malformed_temporal_dates.json`).
|
|
86
|
-
3. **Mandatory Identity**: Rejects schemas missing `sectionCode` (`invalid_missing_section_code.json`).
|
|
87
|
-
4. **Google OKF Frontmatter Extraction**: Correctly extracts YAML frontmatter from administrative circulars (`valid_circular_frontmatter.md`).
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## 6. Reproducible Release Tarball Verification
|
|
92
|
-
|
|
93
|
-
Every published release tarball can be independently verified against Git tag `v2.13.0`:
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# 1. Pack the distribution tarball
|
|
97
|
-
npm pack
|
|
98
|
-
|
|
99
|
-
# 2. Compute the SHA-256 checksum of the tarball (PowerShell)
|
|
100
|
-
Get-FileHash mudraforge-statutory-2.13.0.tgz -Algorithm SHA256
|
|
101
|
-
|
|
102
|
-
# Or in Linux / macOS:
|
|
103
|
-
# sha256sum mudraforge-statutory-2.13.0.tgz
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
The resulting package contains exactly 124 audited files (zero extraneous build artifacts, zero internal development scripts).
|