askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
danq9
signup: the person chooses the password and name on the confirm page
83c7aa6
2 weeks, 5 days ago
History
dbbasic-package.json · 7.7 KB · 120 lines
| 1 | { |
| 2 | "id": "app-banking", |
| 3 | "name": "Banking", |
| 4 | "version": "0.6.0", |
| 5 | "description": "Bank statement import and reconciliation -- the #1 practical anti-fraud control, and the one place a third party's independent record enters the system (plan/bank-import-reconciliation-spec.md). The posture is evidence handling, not ETL: bank_lines are append-only, keep their original row verbatim in `raw`, and are never hand-edited, so nobody can quietly reshape the evidence to agree with the books. Imports check THEMSELVES -- a statement carries its own checksum, so tie-out (opening + lines == closing) and continuity (this opening == the last statement's closing) run at import time and set the import's status; flagged imports still store their lines because hiding a truncated statement is exactly the failure this control catches, and the flags record which checks RAN so a balance-less CSV never reads as trustworthy as a tied-out one. Dedup is by the bank's own transaction id when the format has one (OFX FITID), else an ordinal-disambiguated content hash so genuine same-day twins both land while a re-imported file adds nothing; file-level idempotency is by sha256 of the statement itself. Reading a bank's export is DATA (bank_import_profiles.column_map), authored once with AI help and executed deterministically thereafter -- an AI that re-reads statements every month is nondeterministic and unauditable, the opposite of a control. Pure parsing/hashing/gate logic lives in object_banking.py at the repository root, a plain importable library like object_stock.py and object_finance.py, not a registered object. 0.1.0 shipped the evidence layer (collections, the CSV importer, the duplicate gate). 0.2.0 adds the reconciliation work itself: system_bank_matcher proposes book-side records for unmatched lines in tiers (reference+amount, exact amount in a date window, batched-deposit combinations) but only ever SUGGESTS above the configured auto-match tier, because confirming a match must be an ordinary attributed update -- reconciliation performed invisibly by whoever moves the money is the classic fraud hole. hook_bank_lines additionally makes the evidence immutable on update: what the bank said (posted_on, amount, description, raw, identity fields) can never be edited, only the operator's own reconciliation work can. action_resolve_bank_line books the unmatched tail -- bank fees and interest (entries small books routinely never record, which is why their cash drifts until they stop reconciling), own-account transfers, and NSF bounces -- each through object_finance.compose_posted_journal stamped generated_from bank_lines/{id} so resolving twice composes once. The reconciliation statement view is the remaining slice. 0.3.0 adds two things. `value_accounts` generalizes bank_accounts to every place value actually sits -- a checking account, a hardware wallet, a till, a gift card -- carrying denomination, custody (institution/self/third_party), how the balance can be VERIFIED, who manages it day to day, and whether a count needs a witness; the assurance a reconciliation carries follows from the verification method rather than being assumed equal (object_money.assurance_for). value_accounts REPLACED bank_accounts outright in 0.4.0 (rename plus a richer shape, migrated in one commit rather than left as two collections for one concept -- the drift this project criticises in the predecessor). And system_bank_escalation turns a quietly growing unreconciled tail into work someone is accountable for, in BOTH directions: bank lines the books cannot explain, and -- the direction people forget, and the more serious one -- recorded payments the bank never confirmed. OFX/QFX import lands too (action_import_ofx over object_ofx.py): the format worth supporting after CSV because it carries a stable per-transaction id (FITID), which makes dedup exact rather than heuristic and survives a bank re-wording a memo, and a stated closing balance, which lets the statement check its own arithmetic. OFX has no opening-balance tag at all, so a chained opening is taken from the previous statement's closing -- and the import records that the figure was DERIVED, because it makes the continuity check true by construction and only tie-out then carries weight. 0.4.0 also reconciles the accounts nobody sends a statement for: action_record_count counts a till or a safe, stamps what the books said at that moment, books the variance as cash over/short (a real expense -- pretending the drawer always balances is how a slow leak stays invisible for years), and records who counted AND who witnessed. An account may refuse a self-certified count outright, because the person counting the till is usually the person who could take from it. Structurally the same verb as app-catalog's action_apply_count: inventory shrinkage and a cash shortage are the same event in different denominations. Ships an attention provider for `unmatched` bank lines: money moved in the real world and this server has no book record explaining it, after system_bank_matcher already had its go. `suggested` is deliberately not counted -- a suggestion is the machine having done its job.", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": [ |
| 10 | "app-finance" |
| 11 | ], |
| 12 | "objects": [ |
| 13 | { |
| 14 | "id": "hook_bank_lines", |
| 15 | "path": "objects/hook/bank_lines.py" |
| 16 | }, |
| 17 | { |
| 18 | "id": "action_import_bank_csv", |
| 19 | "path": "objects/action/import_bank_csv.py" |
| 20 | }, |
| 21 | { |
| 22 | "id": "action_import_ofx", |
| 23 | "path": "objects/action/import_ofx.py" |
| 24 | }, |
| 25 | { |
| 26 | "id": "system_bank_matcher", |
| 27 | "path": "objects/system/bank_matcher.py" |
| 28 | }, |
| 29 | { |
| 30 | "id": "action_resolve_bank_line", |
| 31 | "path": "objects/action/resolve_bank_line.py" |
| 32 | }, |
| 33 | { |
| 34 | "id": "site_reconcile", |
| 35 | "path": "objects/site/reconcile.py" |
| 36 | }, |
| 37 | { |
| 38 | "id": "system_bank_escalation", |
| 39 | "path": "objects/system/bank_escalation.py" |
| 40 | }, |
| 41 | { |
| 42 | "id": "action_record_count", |
| 43 | "path": "objects/action/record_count.py" |
| 44 | }, |
| 45 | { |
| 46 | "id": "system_bank_attention", |
| 47 | "path": "objects/system/bank_attention.py" |
| 48 | } |
| 49 | ], |
| 50 | "schemas": [ |
| 51 | { |
| 52 | "collection": "value_accounts", |
| 53 | "path": "schemas/value_accounts.json" |
| 54 | }, |
| 55 | { |
| 56 | "collection": "value_account_counts", |
| 57 | "path": "schemas/value_account_counts.json" |
| 58 | }, |
| 59 | { |
| 60 | "collection": "bank_import_profiles", |
| 61 | "path": "schemas/bank_import_profiles.json" |
| 62 | }, |
| 63 | { |
| 64 | "collection": "bank_statement_imports", |
| 65 | "path": "schemas/bank_statement_imports.json" |
| 66 | }, |
| 67 | { |
| 68 | "collection": "bank_lines", |
| 69 | "path": "schemas/bank_lines.json" |
| 70 | } |
| 71 | ], |
| 72 | "permissions": [ |
| 73 | { |
| 74 | "path": "permissions/rules.json" |
| 75 | } |
| 76 | ], |
| 77 | "seed": [ |
| 78 | { |
| 79 | "collection": "site_routes", |
| 80 | "path": "seed/site_routes.tsv" |
| 81 | } |
| 82 | ], |
| 83 | "migrations": [], |
| 84 | "schedules": [ |
| 85 | { |
| 86 | "id": "bank_matcher_daily", |
| 87 | "object_id": "system_bank_matcher", |
| 88 | "schedule": "40 6 * * *", |
| 89 | "description": "Suggest and auto-match bank lines against existing records." |
| 90 | }, |
| 91 | { |
| 92 | "id": "bank_escalation_daily", |
| 93 | "object_id": "system_bank_escalation", |
| 94 | "schedule": "55 6 * * *", |
| 95 | "description": "Escalate bank lines left unmatched too long, so a stalled reconciliation is visible rather than silent." |
| 96 | } |
| 97 | ], |
| 98 | "nav": [ |
| 99 | { |
| 100 | "id": "reconcile", |
| 101 | "label": "Reconcile", |
| 102 | "path": "/reconcile", |
| 103 | "blurb": "Match imported bank lines against the books and resolve what differs", |
| 104 | "surface": "member", |
| 105 | "group": "Money", |
| 106 | "order": 360 |
| 107 | } |
| 108 | ], |
| 109 | "attention": [ |
| 110 | { |
| 111 | "id": "bank_lines_unmatched", |
| 112 | "object_id": "system_bank_attention", |
| 113 | "label": "Bank lines to match", |
| 114 | "path": "/reconcile", |
| 115 | "nav_id": "reconcile", |
| 116 | "group": "Money", |
| 117 | "severity": "normal" |
| 118 | } |
| 119 | ] |
| 120 | } |