1
+# ADR-029 — Positioning vs Databan: Host Integration API, accepted elements, OD-09 revision
2
+
3
+- Status: Accepted (C0)
4
+- Date: 2026-12-03
5
+- Booklet: booklet 2 revised appendix (owner message 2026-12-03, second), ب3..ب6,
6
+ ب10, §14 (OD-09, OD-12, OD-14), §16
7
+
8
+## Context
9
+
10
+The owner studied the official Databan catalog (fall 1405 edition) and revised the
11
+booklet-2 appendix. Per the owner: Databan is a smart layer on top of existing
12
+accounting-software ledgers — it reads ledgers directly, runs on the company's own
13
+server (Windows + SQL Server), brings multiple companies into one template, and its
14
+domain is reports, dashboards, alerts, automation, and government systems. **It does
15
+not prepare financial statements.** These are marketing claims from a promotional
16
+document; the agent has not verified them (`databansoft.ir` is unreachable from this
17
+sandbox's network allowlist) and makes no independent capability claims. Inspiration
18
+only; no Databan code, text, design, name, or brand is copied (OD-14, §16, appendix
19
+legal restriction).
20
+
21
+## Decision
22
+
23
+### Positioning (owner decision, recorded)
24
+
25
+Aram is an **independent product with a pluggable core** and a **Host Integration
26
+API** (REST contract + permissions) so it can later be embedded as a module inside a
27
+data platform. Any commercial cooperation with Databan or similar vendors is outside
28
+the agent's scope. The gap Aram fills: the **preparation, control, and audit engine
29
+for financial statements** — which the catalog says Databan does not provide.
30
+
31
+Implementation note: the Host Integration API contract is designed alongside the
32
+plugin API (C4) and exposed with the API surface (C7); it reuses the single
33
+authorization policy (below), never a parallel permission model.
34
+
35
+### OD-14 capability comparison (owner-provided catalog description, unverified)
36
+
37
+| Capability | Databan (per catalog, unverified) | Aram (booklet 2) |
38
+|---|---|---|
39
+| Read accounting-software ledgers directly, no source mutation | Yes | Yes — Connectors + read-only safety (ب4/ب5, C4/C5) |
40
+| Runs on the company's own server (Windows + SQL Server) | Yes | Yes — offline Windows default; SQL Server source via pyodbc (C5/C9) |
41
+| Multi-company in one template | Yes | Yes — packs + group dashboard (ب8, C6/C7); consolidation next version |
42
+| Reports / dashboards / alerts / automation | Yes | Statements, work center, drift alerts, nightly jobs (C7/C8) |
43
+| Government systems (مودیان/IMED/trade) | Yes | **Rejected — out of scope** (appendix) |
44
+| **Financial-statement preparation + controls + audit** | **No** | **Yes — the core product** (C1–C3) |
45
+
46
+### OD-09 revision (owner directive supersedes the §14 default)
47
+
48
+Target environment is Windows + SQL Server with an existing ODBC driver, so
49
+**`pyodbc` is preferred**; `python-tds` (pure-Python) is the fallback for offline
50
+packaging where no ODBC driver exists. Proof gate unchanged: connection test +
51
+100k-row extraction in C5; switch if unstable. (Evidence/directive over default, §14.)
52
+
53
+### Accepted elements → phase mapping (appendix priority order)
54
+
55
+1. **Direct ledger reads without source mutation** → confirms ب4/ب5 (C4/C5); OD-09 revised above.
56
+2. **Multi-layer access control** (module ← company ← fiscal year ← row/field), one
57
+ policy across API, UI, exports, and any AI module → extends ب10 (C8).
58
+3. **Source-drift detection**: nightly Windows-service job re-measures source sums +
59
+ hash after snapshot approval; added/modified/deleted documents dated in an approved
60
+ year ⇒ alert + audit record + year moved to «نیازمند بازبینی» (needs-review);
61
+ approved output never changes automatically → C8 (detection) + C9 (Windows service).
62
+4. **Nightly document-level audit** (optional, only with a document-level connector):
63
+ unbalanced, probable-duplicate, large-amount, modified/deleted documents; feeds new
64
+ controls **C-16+** → after C6 per OD-12; control catalog extension registered in C3.
65
+5. **Work center**: one page for everything awaiting the user (unknown accounts, failed
66
+ controls, approval/reopen requests, source drift) → C7.
67
+6. **Dry-run** for every extraction and automated job (result shown, zero effect) → C4/C8.
68
+7. **Signed updates with automatic rollback + in-app backup/restore** → C9 (+ C8 backup).
69
+8. **Print templates with company letterhead** for statements, statutory ledger exports
70
+ (روزنامه/کل), supporting tables; global **Ctrl+K** search → C7.
71
+9. **AI assistant — phase C11, optional, OFF by default**: understands questions only,
72
+ **never generates numbers**; figures come only from the engine and an approved
73
+ CalculationRun with lineage; read-only; local model or anonymization of person/company
74
+ names before any external service; every query audited; AI mapping suggestions remain
75
+ suggestions with mandatory human approval (ب8 unchanged) → C11.
76
+10. **Multi-company** with one template + group dashboard; consolidated statements in a
77
+ later version → C6/C7 (consolidation out of V1).
78
+
79
+### Rejected scope (appendix, binding)
80
+
81
+مودیان, IMED, comprehensive trade system, bank-invoice processing and document reading,
82
+generic form builder and cartable. Messenger bots for financial data are **prohibited by
83
+default**; if ever needed, notifications only, **without figures**.
84
+
85
+## Proof
86
+
87
+- Revised appendix verbatim in `docs/booklet/BOOKLET_v2.0.md`, SHA-256
88
+ `79618dddb3de9bde195b8253880593b2900389369150c917d81b97006762823a` (revision history in
89
+ `MANIFEST.json`).
90
+- Owner directive is the evidence source for the catalog description; agent network
91
+ allowlist excludes `databansoft.ir` (no independent verification claimed).
92
+- Roadmap updated in `PROJECT_STATUS.md` (C5/C7/C8/C9 scope notes + C11 row).
93
+
94
+## Consequences
95
+
96
+- C5 connector work starts from pyodbc; the pure-Python fallback stays available for
97
+ driverless offline machines (ADR required if the proof gate fails).
98
+- The needs-review year status and C-16+ controls enter the data-model/control design
99
+ in C3/C8; no approved output is ever mutated automatically (P-01/D-07 preserved).
100
+- C11 is optional and gated: no number ever originates from an AI model; lineage and
101
+ audit are mandatory; default OFF.