← AIcentric Enterprise Suite All AIcentric Enterprise Suite Docs Live Unmodified Specification 28 Specs · ~225 KB

Full Sample Specification: AIcentricERP_ARCHITECTURE.md

Complete, unmodified 2,526-line (DF3-ARCH-1.0 (3.0.0)) contract-driven Markdown blueprint for AIcentricERP — an opening §0 executive summary and plain-words operator workflows followed by bound service surfaces and ports, cryptographic & compliance invariants, typed entity/field schemas, bound domain facades (§1.2), HTTP endpoints, single-table Offstack storage contracts, fail-closed tenancy/RBAC matrices, compiled behavioral laws, and UI panel/form contracts. Read it yourself and judge what kind of spec it is.


§0. Executive Summary, Compliance & Legacy Intent

AIcentricERP is a flagship enterprise core financial accounting, multi-subsidiary general ledger, subledger control, and continuous financial audit platform built as a modular single-process web console and Offstack-persisted ledger engine. Across 27 entities, 116 bound domain facades, and 118 unrolled HTTP routes, it eliminates shadow month-end close workbooks, manual FX revaluation spreadsheets, email-driven 3-way AP matching, offline bank-feed tick-and-tie sheets, vendor bank-fraud email approvals, ASC 606 revenue waterfalls, and silent post-close ledger edits by enforcing atomic double-entry conservation (sum(debits) == sum(credits)), fiscal period close locks (CLOSED-YYYY-MM) gated by CloseTask DAG sign-offs, SOX 404 Segregation of Duties (SoD), 3-way PO-receipt-bill matching with deterministic basis-point tolerances, signed credit memo adjustments, fixed-asset depreciation schedules, FIFO/weighted-average inventory valuation, multi-subsidiary intercompany eliminations, bank statement reconciliation, cost-center budget encumbrance ceilings, selective S3 Object Lock evidence custody, sales tax/VAT calculation, Benford's Law first-digit chi-square anomaly screening (chi2 > 15.51), and zero-leakage bitemporal (as_of, as_known_at) trial balance and aging queries.

Plain-Words Needs & Operator Workflows

Finance teams across controllers, GL accountants, AR/AP clerks, treasury analysts, and external auditors operate from a single governed accounting plane:

  1. Chart of Accounts, Fiscal Close Cockpit & Immutable General Ledger: Maintain a multi-currency Chart of Accounts (ACC-####) and LegalEntity (LE-####) registry; orchestrate month-end CloseTask (CTSK-####) checklists before locking FiscalPeriod (PER-####); post balanced double-entry journals (JE-####) with child JournalLine splits (JEL-####); execute IntercompanyTransfer (ICT-####) eliminations; and correct mistakes strictly via linked reversing or voiding entries, never via silent in-place mutation.
  2. Customer Governance, AR Invoices, ASC 606 Revenue & Credit Memos: Govern Customer (CUST-####) credit limits and dunning pauses; issue customer invoices (INV-####) with structured EU VAT / US Sales Tax rates (TAX-####); allocate ASC 606 / IFRS 15 RevenueSchedule (REV-####) and RevenueObligation (POB-####) splits (10000 bps conservation); apply signed negative credit memos (CM-####); and track server-computed bitemporal aging buckets.
  3. Vendor Bank-Fraud Governance, Procurement, 3-Way Match & SOX 404 SoD: Govern Vendor (VEND-####) payment holds and dual-approval VendorBankChange (VBC-####) requests with SOX SoD; record PurchaseOrder (PO-####) and GoodsReceipt (GRN-####); match vendor Bill (BILL-####) submissions within configurable tolerance_bps (<= 500 bps); and enforce SOX 404 SoD so creators never self-approve bills or match overrides.
  4. Treasury Cash, Bank Reconciliation, Assets, Inventory, Budgets & Audit: Settle Payment (PAY-####) records idempotently with realized FX gain/loss to ACC-8010; reconcile BankStatementLine (BNK-####) camt.053/MT940/BAI2 feeds; maintain FixedAsset (FA-####) depreciation, InventoryValuation (SKU-####), BudgetCommitment (BUD-####) encumbrances, dated FxRate (FXRT-####) & period-end FxRevaluation (FXR-####), selective S3 Object Lock EvidenceArtifact (EVID-####) custody, and hash-chained AuditLog (AUD-####).

Compliance & Regulatory Posture

Runtime Topology

Single-process modular SPA + REST API server (app/server.py -> app/spa_server.py on port 13820) backed exclusively by Offstack (DynamoDB, S3, Secrets Manager Core + SQS, SNS, EventBridge, SSM, KMS Extended verified in toolkits/offstack/docs/OFFSTACK_AI_MANUAL.txt) via the single storage confinement seam app/offstack_store.py (forbid_sqlite_fallback=True, forbid_local_fallback=True).

Legacy Spec Disposition Matrix (AIcentricERP_ARCHITECTURE.md v1.0/v2.0 -> v3.0.0 Flagship DF3-ARCH-1.0)

Legacy RequirementDispositionRationale & DF3-ARCH-1.0 Target
Core COA (ACC-1010), Double-Entry GL (JE-0001), AR Invoices (INV-0042), AP Bills (BILL-0007)PRESERVEDRetained as canonical alpha-corp baseline seeds alongside 27 flagship entities (§1.5, §2)
sum(debits) == sum(credits), CLOSED-YYYY-MM period locks, FX gain/loss to ACC-8010, Benford chi2 > 15.51UPGRADEDFormalized into 24 executable invariants across all 5 DF3 primitives (§1.4)
v2.0.0 15-entity ledger baseline (Account..AuditLog) & alpha-corp / beta-corp / zz-probe tenancyUPGRADEDPreserved all 15 entities and expanded with 12 researched enterprise ERP entities (LegalEntity, IntercompanyTransfer, CloseTask, BankStatementLine, Vendor, VendorBankChange, Customer, RevenueSchedule, RevenueObligation, FxRate, BudgetCommitment, EvidenceArtifact) meeting LINT-20 Flagship Depth
Legacy single-owner no-role auth, limit=50, float/Decimal wire amountsUPGRADEDReplaced with fail-closed RBAC (403 missing_role), SOX SoD, DEFAULT_LIST_LIMIT = 200, and integer *_cents/*_micros/*_bps
Legacy app/sim_store.py, single-table aicentric_erp, bundle.js, Vite/React/Nuitka tooling, port 13250/13251SUPERSEDED_TECHSuperseded by app/offstack_store.py, 28 partitioned Offstack DynamoDB tables + S3/KMS, modular frontend/js/, unique port 13820, and PyInstaller VibeInstaller schema-v1 (§5.1, §6, §9)
Legacy standalone FastMCP 13250 transport & HKCU registry token launcher assumptionsINTENTIONALLY_DROPPEDSuperseded by DF3 single-process app/server.py + app/spa_server.py and schema-v1 installer_config.json (§1.1, §9)

Incumbent Parity & Research Coverage Matrix (RESEARCH_SYNTHESIS.md & REGULATORY_AND_WORKFLOW_BRIEF.md)

Research Capability / Pain PointModeled Entities & RoutesExecutable Invariant(s)Disposition
Period close checklist & task DAG replacing shadow close spreadsheetsFiscalPeriod (/api/fiscal-periods, /close, /reopen), CloseTask (/api/close-tasks, /start, /signoff, /waive)INV-STATE-01IMPLEMENTED
Server-computed bitemporal AR/AP aging & trial balance tie-outsInvoice, Bill, Customer, Vendor, /api/reports/aging, /api/reports/trial-balance, /api/reports/tax-summaryINV-CONS-01, INV-CONS-02, INV-CEIL-07IMPLEMENTED
Idempotent cash application, partial payments, signed credit memos & realized FX to ACC-8010Payment (/api/payments, /reverse), CreditMemo (/api/credit-memos, /apply), /api/invoices/{invoice_id}/pay, /api/bills/{bill_id}/payINV-IDEMP-01, INV-STATE-04IMPLEMENTED
3-way PO-GRN-Bill matching with bps tolerance & SOX 404 SoD (creator != approver)PurchaseOrder (/api/purchase-orders, /cancel), GoodsReceipt (/api/goods-receipts), Bill (/api/bills, /approve, /override-match)INV-CEIL-02IMPLEMENTED
Dated FX rate repository & period-end unrealized FX revaluation (dry_run preview)FxRate (/api/fx-rates), FxRevaluation (/api/fx-revaluations)INV-IDEMP-03, INV-CEIL-04IMPLEMENTED
Bank feed ingestion (camt.053/MT940/BAI2) & matching state machineBankStatementLine (/api/bank-statements, /match, /reconcile, /exclude)INV-IDEMP-04IMPLEMENTED
Fixed asset register, straight-line/double-declining depreciation & disposal gain/lossFixedAsset (/api/fixed-assets, /depreciate, /dispose), InventoryValuation (/api/inventory, /adjust)INV-CEIL-03IMPLEMENTED
Multi-subsidiary legal entities & intercompany cross-charge eliminationsLegalEntity (/api/legal-entities, /toggle), IntercompanyTransfer (/api/intercompany-transfers, /post, /eliminate, /dispute)INV-STATE-07IMPLEMENTED
Immutable bitemporal audit corrections, Benford chi-square anomaly screening & SHA-256 chainJournalEntry (/api/journals, /reverse, /void), JournalLine (/api/journals/{journal_id}/lines), AuditLog (/api/audit-logs), /api/audit/benfordINV-CONS-01, INV-CONS-02, INV-ALLOC-01, INV-STATE-02, INV-STATE-03IMPLEMENTED
Vendor bank-change dual approval (anti-fraud SoD) & customer credit-hold / dunning pauseVendor (/api/vendors, /hold, /archive), VendorBankChange (/api/vendor-bank-changes, /confirm, /approve, /reject), Customer (/api/customers, /credit-hold, /dunning-pause)INV-STATE-06, INV-CEIL-07IMPLEMENTED
FASB ASC 606 / IFRS 15 revenue recognition schedules & 10000-bps POB allocationRevenueSchedule (/api/revenue-schedules, /recognize, /pause), RevenueObligation (/api/revenue-schedules/{schedule_id}/obligations)INV-CONS-03, INV-ALLOC-02IMPLEMENTED
Cost-center budget encumbrance ceilings, EU VAT/US Sales Tax & selective S3 Object Lock evidenceBudgetCommitment (/api/budgets, /activate, /encumber, /freeze), TaxRate (/api/tax-rates, /toggle), EvidenceArtifact (/api/evidence-artifacts, /content, /legal-hold)INV-CEIL-01, INV-CEIL-05, INV-CEIL-06, INV-STATE-08IMPLEMENTED
Async bulk CSV/XLSX/camt.053 batch import runner & BI lakehouse Parquet CDC projection(Deferred to V2 data-plane beyond transactional REST core; deterministic single-record idempotent REST APIs active in V1)(none — outside transactional OLTP scope)INTENTIONALLY_DEFERRED

§1. Domain Architecture, Facades, Laws & Wire Entities

§1.1 Service Surface & Inter-Vertical Boundary Law

§1.2 Bound Domain Facades

Target <= 650 LOC per Python module under app/, max_function_cc <= 25, max_function_lines <= 80, min_type_annotation_ratio >= 0.70, max_delegation_ratio < 0.50, max_undeclared_file_share <= 0.65, zero silent except: pass handlers. All validation, double-entry arithmetic, SoD enforcement, and bitemporal filtering MUST live in declared domain modules, never in thin forwarding shims (116 bound domain facades):

ModuleFacade FunctionDomain Responsibility
app/audit.pyget_time_axis_overviewReturn tenant min/max effective_at (as_of) and recorded_at (as_known_at) bitemporal bounds (QG-READ-IDEMP)
app/audit.pylist_audit_logsRead tamper-evident SHA-256 hash-chained AUD-#### ledger (admin_roles only) with limit=200, offset=0, and (as_of, as_known_at)
app/accounts.pylist_accountsList Chart of Accounts rows newest-first with type/status/currency filters, limit=200, offset=0, and (as_of, as_known_at)
app/accounts.pycreate_accountCreate GL account (ACC-####) enforcing unique code (409 duplicate_key on mismatch, 200 idempotent replay on exact match)
app/accounts.pyget_accountFetch single GL account by account_id at optional (as_of, as_known_at) (404 account_not_found)
app/accounts.pyupdate_accountPatch mutable account name or allow_manual_posting flag + hash-chained AUD-####
app/accounts.pyarchive_accountTransition active GL account (active -> archived) refusing already-archived accounts (400 unarchivable_account)
app/periods.pylist_fiscal_periodsList fiscal periods with status/period_code filters, limit=200, offset=0, and bitemporal snapshot filtering
app/periods.pycreate_fiscal_periodCreate fiscal period (PER-####) enforcing unique period_code (YYYY-MM) and start_date <= end_date
app/periods.pyget_fiscal_periodFetch fiscal period by period_id at optional (as_of, as_known_at) (404 period_not_found)
app/periods.pyclose_fiscal_periodLock fiscal period (open/soft_closed -> closed) refusing already-closed periods (400 closed_period) + S3 close binder
app/periods.pyreopen_fiscal_periodReopen closed fiscal period (closed -> soft_closed) requiring non-empty reason and admin role (400 invalid_period_transition)
app/periods.pylist_close_tasksList month-end close checklist tasks (CTSK-####) filtered by period_id, owner_role, status, limit=200, offset=0
app/periods.pycreate_close_taskCreate period close task (CTSK-####) linked to FiscalPeriod.period_id (REL-08)
app/periods.pystart_close_taskTransition open -> in_progress close task (400 invalid_state_transition otherwise)
app/periods.pysignoff_close_taskSign off open/in_progress -> signed_off close task stamping signed_off_by
app/periods.pywaive_close_taskWaive open/in_progress -> waived close task requiring admin role and reason
app/taxes.pylist_tax_ratesList Sales Tax / VAT / TDS rates with jurisdiction/tax_type/active filter, limit=200, offset=0, and bitemporal filtering
app/taxes.pycreate_tax_rateCreate tax rate (TAX-####) enforcing 0 <= rate_bps <= 3500 (INV-CEIL-01) and liability_account_id FK (REL-04)
app/taxes.pytoggle_tax_rateEnable or disable tax rate (active boolean toggle) + AUD-####
app/journals.pylist_journalsList double-entry journals newest-first with status/period_code/source_module filters, limit=200, offset=0, and (as_of, as_known_at)
app/journals.pyrecord_journalPost immutable double-entry journal (JE-####) via DynamoDB TransactWriteItems, enforcing open period_id (REL-01) and debits == credits (INV-STATE-03)
app/journals.pyget_journalFetch journal entry + lines at optional (as_of, as_known_at) (404 journal_not_found)
app/journals.pyreverse_journalCreate linked offsetting reversing JE-#### and mark source reversed (400 unvoidable_journal if not posted)
app/journals.pyvoid_journalTransition posted -> voided preserving immutable history (400 unvoidable_journal if not posted) + AUD-####
app/journals.pylist_journal_linesList nested JournalLine items for {journal_id} (limit=200, offset=0) with (as_of, as_known_at)
app/journals.pyadd_journal_lineAppend JournalLine (JEL-####) enforcing sum(debits) <= total_debit_cents (INV-CONS-01), sum(credits) <= total_credit_cents (INV-CONS-02), and allocation_bps <= 10000 (INV-ALLOC-01)
app/customers.pylist_customersList governed AR customer masters (CUST-####) filtered by status, dunning_paused, customer_code (limit=200, offset=0)
app/customers.pycreate_customerCreate AR customer master (CUST-####) enforcing unique customer_code, credit_limit_cents <= 10000000000 (INV-CEIL-07), and KMS PII encryption
app/customers.pyget_customerFetch customer master (404 customer_not_found) with role-based PII masking (masked_pii_roles)
app/customers.pyupdate_customerPatch mutable customer legal_name, billing_email, billing_address, or credit_limit_cents
app/customers.pytoggle_customer_credit_holdToggle customer status between active and credit_hold + AUD-####
app/customers.pytoggle_dunning_pauseToggle customer dunning_paused flag (freezes/resumes dunning notices)
app/invoices.pylist_invoicesList AR invoices newest-first with status/customer_id/currency filters, limit=200, offset=0, and (as_of, as_known_at)
app/invoices.pyissue_invoiceIssue AR invoice (INV-####) with KMS-encrypted customer PII, optional Customer FK (REL-13), tax calculation, and unique invoice_number
app/invoices.pyget_invoiceFetch AR invoice (404 invoice_not_found) applying role-based PII masking (masked_pii_roles) at (as_of, as_known_at)
app/invoices.pysend_invoiceTransition AR invoice draft -> unpaid (400 invalid_state_transition otherwise) + AUD-####
app/invoices.pypay_invoiceSettle AR invoice (unpaid/partially_paid -> paid) recording PAY-####, FX gain/loss to ACC-8010, and refusing paid/voided (400 unpayable_invoice)
app/invoices.pyvoid_invoiceVoid non-paid AR invoice (draft/unpaid -> voided, refusing paid/voided with 400 invalid_state_transition)
app/invoices.pylist_credit_memosList AR/AP credit memos newest-first with doc_kind/status filters, limit=200, offset=0, and (as_of, as_known_at)
app/invoices.pycreate_credit_memoCreate signed negative credit memo (CM-####, adjustment_cents <= 0) linked optionally to Invoice (REL-06)
app/invoices.pyapply_credit_memoApply draft credit memo to target AR/AP balance (draft -> applied, refusing non-draft with 400 invalid_state_transition)
app/revenue.pylist_revenue_schedulesList ASC 606 / IFRS 15 revenue recognition schedules (REV-####) filtered by status, standard_mode (limit=200, offset=0)
app/revenue.pycreate_revenue_scheduleCreate revenue schedule (REV-####) with optional invoice_id (REL-16), period_id (REL-17), and deferred_account_id
app/revenue.pyget_revenue_scheduleFetch revenue schedule + obligations (404 schedule_not_found)
app/revenue.pyrecognize_revenue_periodRecognize periodic revenue (active/recognizing -> recognizing/completed) never exceeding total_contract_cents
app/revenue.pypause_revenue_schedulePause active revenue schedule (active/recognizing -> paused, refusing completed with 400 invalid_state_transition)
app/revenue.pylist_revenue_obligationsList nested ASC 606 RevenueObligation items (POB-####) for {schedule_id} (limit=200, offset=0)
app/revenue.pyadd_revenue_obligationAdd performance obligation (POB-####) enforcing sum(allocation_bps) <= 10000 (INV-ALLOC-02) and sum(allocated_cents) <= total_contract_cents (INV-CONS-03)
app/revenue.pydelete_revenue_obligationDelete unfulfilled RevenueObligation (POB-####) without rewinding sequence counters
app/vendors.pylist_vendorsList governed AP vendor masters (VEND-####) filtered by status, payment_hold, vendor_code (limit=200, offset=0)
app/vendors.pycreate_vendorCreate vendor master (VEND-####) enforcing unique vendor_code and KMS-encrypted contact PII
app/vendors.pyget_vendorFetch vendor master (404 vendor_not_found) with role-based PII masking
app/vendors.pyupdate_vendorPatch mutable vendor legal_name, contact_email, or ers_enabled flag
app/vendors.pytoggle_vendor_holdToggle vendor payment_hold boolean flag (active <-> on_hold)
app/vendors.pyarchive_vendorArchive inactive/non-held vendor (-> archived, refusing already-archived with 400 invalid_state_transition)
app/vendors.pylist_vendor_bank_changesList vendor bank IBAN change requests (VBC-####) filtered by status, vendor_id (limit=200, offset=0)
app/vendors.pycreate_vendor_bank_changeOpen anti-fraud vendor bank change request (VBC-####) linked to Vendor.vendor_id (REL-11)
app/vendors.pyconfirm_vendor_bank_changeConfirm out-of-band vendor bank verification (pending -> confirmed)
app/vendors.pyapprove_vendor_bank_changeDual-approve vendor bank change enforcing SOX SoD approver_actor_id != requester_actor_id (INV-STATE-06, 400 sod_violation)
app/vendors.pyreject_vendor_bank_changeReject pending/confirmed vendor bank change (-> rejected)
app/procurement.pylist_purchase_ordersList purchase orders newest-first with status/vendor_id filters, limit=200, offset=0, and (as_of, as_known_at)
app/procurement.pycreate_purchase_orderCreate PO (PO-####) enforcing 0 <= tolerance_bps <= 500 (INV-CEIL-02), optional Vendor FK (REL-14), and unique po_number
app/procurement.pyget_purchase_orderFetch purchase order by po_id (404 po_not_found) at (as_of, as_known_at)
app/procurement.pycancel_purchase_orderCancel open PO (open -> cancelled, refusing received/matched/cancelled with 400 invalid_state_transition)
app/procurement.pylist_goods_receiptsList goods receipts newest-first with po_id/status filters, limit=200, offset=0, and (as_of, as_known_at)
app/procurement.pyrecord_goods_receiptRecord GRN (GRN-####) linked to PurchaseOrder.po_id (REL-05) and advance PO receipt status
app/bills.pylist_billsList AP vendor bills newest-first with status/match_status/vendor_id filters, limit=200, offset=0, and (as_of, as_known_at)
app/bills.pyrecord_billRecord AP bill (BILL-####) with KMS-encrypted vendor PII, optional Vendor FK (REL-15), 3-way variance check, and creator stamp
app/bills.pyget_billFetch AP bill (404 bill_not_found) with role-based PII masking at (as_of, as_known_at)
app/bills.pyapprove_billApprove matched AP bill enforcing SOX 404 SoD (approver_actor != created_by_actor, else 400 sod_violation)
app/bills.pyoverride_bill_matchAdmin-only override of variance_hold AP bill (match_status -> override_approved) enforcing SOX 404 SoD + AUD-####
app/bills.pypay_billDisburse payment against approved/unpaid AP bill (-> paid), checking vendor bank-change hold, realized FX delta, and refusing double-pay (400 unpayable_bill)
app/payments.pylist_paymentsList AR/AP cash payments newest-first with direction/status filters, limit=200, offset=0, and (as_of, as_known_at)
app/payments.pyrecord_paymentSettle payment (PAY-####) against Account.bank_account_id (REL-07) with idempotency_key deduplication (INV-IDEMP-01)
app/payments.pyget_paymentFetch single payment (404 payment_not_found) at (as_of, as_known_at)
app/payments.pyreverse_paymentReverse settled payment (settled -> reversed) posting offsetting GL entry + AUD-####
app/payments.pylist_bank_statementsList imported BankStatementLine records (BNK-####) filtered by status, bank_account_id, format_kind (limit=200, offset=0)
app/payments.pyimport_bank_statement_lineImport camt.053/MT940/BAI2 bank statement line (BNK-####) linked to Account (REL-09) with idempotency_key replay (INV-IDEMP-04)
app/payments.pymatch_bank_lineMatch unmatched bank statement line (unmatched -> matched) to payment/invoice/bill
app/payments.pyreconcile_bank_lineReconcile matched bank statement line (matched -> reconciled, refusing unmatched with 400 invalid_state_transition)
app/payments.pyexclude_bank_lineExclude unmatched bank statement line (unmatched -> excluded) with audit reason
app/fixed_assets.pylist_fixed_assetsList fixed assets newest-first with asset_class/status filters, limit=200, offset=0, and (as_of, as_known_at)
app/fixed_assets.pyregister_fixed_assetRegister fixed asset (FA-####) enforcing 1 <= useful_life_months <= 600 (INV-CEIL-03) and salvage_value_cents <= cost_cents
app/fixed_assets.pyrun_asset_depreciationCompute and post monthly straight-line/double-declining depreciation (accumulated_depreciation_cents++, net_book_value_cents--)
app/fixed_assets.pydispose_fixed_assetDispose active fixed asset (-> disposed) computing gain/loss against NBV and posting GL disposal entry
app/inventory.pylist_inventory_itemsList inventory SKUs newest-first with valuation_method/status filters, limit=200, offset=0, and (as_of, as_known_at)
app/inventory.pycreate_inventory_itemRegister inventory SKU (SKU-####) with fifo or weighted_avg layer tracking and total_value_cents = qty * unit_cost
app/inventory.pyadjust_inventory_valuationApply signed quantity/cost valuation layer adjustment (qty_delta receipt or COGS issue) preventing negative on-hand stock (400 insufficient_inventory)
app/intercompany.pylist_legal_entitiesList subsidiary legal entities (LE-####) filtered by functional_currency, status (limit=200, offset=0)
app/intercompany.pycreate_legal_entityCreate subsidiary legal entity (LE-####) enforcing unique entity_code and aws_region pinning
app/intercompany.pytoggle_legal_entityToggle legal entity status (active <-> inactive) + AUD-####
app/intercompany.pylist_intercompany_transfersList intercompany transfers (ICT-####) filtered by status, period_id (limit=200, offset=0)
app/intercompany.pycreate_intercompany_transferCreate draft intercompany charge (ICT-####) linking LegalEntity (REL-22) and FiscalPeriod (REL-19)
app/intercompany.pyget_intercompany_transferFetch intercompany transfer (404 ic_transfer_not_found)
app/intercompany.pypost_intercompany_transferPost draft -> posted intercompany transfer (400 invalid_state_transition otherwise)
app/intercompany.pyeliminate_intercompany_transferEliminate posted -> eliminated intercompany transfer (INV-STATE-07, refusing draft with 400 invalid_state_transition)
app/intercompany.pydispute_intercompany_transferMark draft/posted intercompany transfer disputed with audit note
app/budgets.pylist_budgetsList cost-center budget commitments (BUD-####) filtered by status, cost_center, period_id (limit=200, offset=0)
app/budgets.pycreate_budgetCreate draft budget commitment (BUD-####) enforcing unique budget_code and max_overrun_bps <= 2000 (INV-CEIL-05)
app/budgets.pyactivate_budgetActivate draft -> active budget commitment
app/budgets.pyencumber_budgetEncumber funds against active budget (INV-STATE-08, enforcing encumbered_cents <= allocated_cents * (10000 + max_overrun_bps) // 10000)
app/budgets.pyfreeze_budgetFreeze active budget (active -> frozen, refusing draft/frozen with 400 invalid_state_transition)
app/evidence.pylist_evidence_artifactsList S3 custody evidence artifacts (EVID-####) filtered by doc_class, object_lock_mode, legal_hold (limit=200, offset=0)
app/evidence.pycreate_evidence_artifactRegister evidence artifact (EVID-####) enforcing size_bytes <= 10485760 (INV-CEIL-06) and forbidding S3 Object Lock on contact_pii_export
app/evidence.pyupload_evidence_bytesUpload evidence bytes (<= 10485760 bytes) to Offstack S3 erp-close-archives computing SHA-256
app/evidence.pydownload_evidence_bytesVerify SHA-256 and stream evidence bytes from Offstack S3 (QG-READ-IDEMP)
app/evidence.pytoggle_evidence_legal_holdToggle statutory legal_hold on evidence artifact + AUD-####
app/reporting.pylist_fx_ratesList dated FX conversion rates (FXRT-####) filtered by from_currency, to_currency, effective_date (limit=200, offset=0, (as_of, as_known_at))
app/reporting.pyupsert_fx_rateCreate (201) or idempotently replay (200) dated FX rate on rate_key (INV-IDEMP-03, rate_micros <= 1000000000 INV-CEIL-04)
app/reporting.pylist_fx_revaluationsList period-end FX revaluation runs newest-first with period_code/currency filters, limit=200, offset=0, and (as_of, as_known_at)
app/reporting.pyrun_fx_revaluationCompute unrealized/realized FX revaluation (FXR-####) across foreign-currency open items (dry_run preview or commit)
app/reporting.pyget_trial_balanceRead-only zero-write bitemporal trial balance verifying total_debits == total_credits at (as_of, as_known_at) (QG-READ-IDEMP)
app/reporting.pyget_aging_reportRead-only server-computed AR/AP aging buckets (current, 1_30, 31_60, 61_90, 90_plus) at (as_of, as_known_at) (QG-READ-IDEMP)
app/reporting.pyget_tax_summaryRead-only jurisdiction VAT / Sales Tax liability summary at (as_of, as_known_at) (QG-READ-IDEMP)
app/reporting.pyrun_benford_auditRun Benford's Law first-digit chi-square test across posted journals (chi2 > 15.51 flags anomaly + AUD-####)

§1.3 Typed Python Facade Signatures

Every list_* facade enforces limit: int = 200, offset: int = 0 matching §3 verbatim. The bitemporal facades (list_audit_logs, list_accounts, create_account, get_account, update_account, archive_account, list_fiscal_periods, create_fiscal_period, get_fiscal_period, close_fiscal_period, reopen_fiscal_period, list_close_tasks, list_tax_rates, create_tax_rate, toggle_tax_rate, list_journals, record_journal, get_journal, reverse_journal, void_journal, list_journal_lines, add_journal_line, list_invoices, issue_invoice, get_invoice, send_invoice, pay_invoice, void_invoice, list_credit_memos, create_credit_memo, apply_credit_memo, list_purchase_orders, create_purchase_order, get_purchase_order, cancel_purchase_order, list_goods_receipts, record_goods_receipt, list_bills, record_bill, get_bill, approve_bill, override_bill_match, pay_bill, list_payments, record_payment, get_payment, reverse_payment, list_fixed_assets, register_fixed_asset, run_asset_depreciation, dispose_fixed_asset, list_inventory_items, create_inventory_item, adjust_inventory_valuation, list_fx_rates, upsert_fx_rate, list_fx_revaluations, run_fx_revaluation, get_trial_balance, get_aging_report, get_tax_summary, run_benford_audit) accept and propagate as_of: str = "" (effective_at <= as_of) and as_known_at: str = "" (recorded_at <= as_known_at) with zero wall-clock shortcuts on historical reads.

from typing import Any


def get_time_axis_overview(
    corp_id: str,
) -> dict[str, Any]: ...


def list_audit_logs(
    corp_id: str,
    entity_type: str = "",
    action: str = "",
    anomaly_only: bool | None = None,
    limit: int = 200,
    offset: int = 0,
    actor_role: str = "owner",
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def list_accounts(
    corp_id: str,
    account_type: str = "",
    status: str = "",
    currency: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_account(
    corp_id: str,
    code: str,
    name: str,
    account_type: str,
    normal_balance: str,
    currency: str = "USD",
    is_control_account: bool = False,
    allow_manual_posting: bool = True,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_account(
    corp_id: str,
    account_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def update_account(
    corp_id: str,
    account_id: str,
    name: str = "",
    allow_manual_posting: bool | None = None,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def archive_account(
    corp_id: str,
    account_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_fiscal_periods(
    corp_id: str,
    status: str = "",
    period_code: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_fiscal_period(
    corp_id: str,
    period_code: str,
    start_date: str,
    end_date: str,
    close_checklist_complete: bool = False,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_fiscal_period(
    corp_id: str,
    period_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def close_fiscal_period(
    corp_id: str,
    period_id: str,
    actor_role: str = "owner",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def reopen_fiscal_period(
    corp_id: str,
    period_id: str,
    reason: str,
    actor_role: str = "owner",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_close_tasks(
    corp_id: str,
    period_id: str = "",
    owner_role: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_close_task(
    corp_id: str,
    task_code: str,
    title: str,
    period_id: str,
    owner_role: str = "gl_accountant",
    sequence_order: int = 1,
) -> dict[str, Any]: ...


def start_close_task(
    corp_id: str,
    close_task_id: str,
) -> dict[str, Any]: ...


def signoff_close_task(
    corp_id: str,
    close_task_id: str,
    signed_off_by: str = "controller_1",
) -> dict[str, Any]: ...


def waive_close_task(
    corp_id: str,
    close_task_id: str,
    reason: str = "non_material",
) -> dict[str, Any]: ...


def list_tax_rates(
    corp_id: str,
    jurisdiction: str = "",
    tax_type: str = "",
    active: bool | None = None,
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_tax_rate(
    corp_id: str,
    tax_code: str,
    jurisdiction: str,
    tax_type: str,
    rate_bps: int,
    liability_account_id: str,
    active: bool = True,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def toggle_tax_rate(
    corp_id: str,
    tax_rate_id: str,
    active: bool,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_journals(
    corp_id: str,
    status: str = "",
    period_code: str = "",
    source_module: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def record_journal(
    corp_id: str,
    period_id: str,
    posting_date: str,
    description: str,
    total_debit_cents: int,
    total_credit_cents: int,
    currency: str = "USD",
    fx_rate_micros: int = 1000000,
    reference: str = "",
    source_module: str = "gl_manual",
    lines: list[dict[str, Any]] | None = None,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_journal(
    corp_id: str,
    journal_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def reverse_journal(
    corp_id: str,
    journal_id: str,
    reason: str = "",
    posting_date: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def void_journal(
    corp_id: str,
    journal_id: str,
    reason: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_journal_lines(
    corp_id: str,
    journal_id: str,
    account_id: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def add_journal_line(
    corp_id: str,
    journal_id: str,
    account_id: str,
    debit_cents: int = 0,
    credit_cents: int = 0,
    signed_amount_cents: int = 0,
    allocation_bps: int = 0,
    memo: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_customers(
    corp_id: str,
    status: str = "",
    dunning_paused: bool | None = None,
    customer_code: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_customer(
    corp_id: str,
    customer_code: str,
    legal_name: str,
    billing_email: str,
    billing_address: str,
    credit_limit_cents: int = 5000000,
    ar_account_id: str = "",
    dunning_paused: bool = False,
) -> dict[str, Any]: ...


def get_customer(
    corp_id: str,
    customer_id: str,
    actor_role: str = "ar_clerk",
) -> dict[str, Any]: ...


def update_customer(
    corp_id: str,
    customer_id: str,
    legal_name: str = "",
    billing_email: str = "",
    billing_address: str = "",
    credit_limit_cents: int | None = None,
) -> dict[str, Any]: ...


def toggle_customer_credit_hold(
    corp_id: str,
    customer_id: str,
    hold_active: bool = True,
) -> dict[str, Any]: ...


def toggle_dunning_pause(
    corp_id: str,
    customer_id: str,
    dunning_paused: bool = True,
) -> dict[str, Any]: ...


def list_invoices(
    corp_id: str,
    status: str = "",
    customer_id: str = "",
    currency: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def issue_invoice(
    corp_id: str,
    invoice_number: str,
    customer_name: str,
    customer_email: str,
    billing_address: str,
    due_date: str,
    subtotal_cents: int,
    customer_id: str = "",
    tax_rate_id: str = "",
    currency: str = "USD",
    fx_rate_micros: int = 1000000,
    payment_terms: str = "net_30",
    ar_account_id: str = "ACC-1200",
    revenue_account_id: str = "ACC-4000",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_invoice(
    corp_id: str,
    invoice_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def send_invoice(
    corp_id: str,
    invoice_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def pay_invoice(
    corp_id: str,
    invoice_id: str,
    bank_account_id: str = "ACC-1010",
    amount_cents: int | None = None,
    settlement_fx_rate_micros: int = 1000000,
    payment_method: str = "ach",
    idempotency_key: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def void_invoice(
    corp_id: str,
    invoice_id: str,
    reason: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_credit_memos(
    corp_id: str,
    doc_kind: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_credit_memo(
    corp_id: str,
    memo_number: str,
    doc_kind: str,
    adjustment_cents: int,
    reason: str,
    invoice_id: str = "",
    bill_id: str = "",
    tax_adjustment_cents: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def apply_credit_memo(
    corp_id: str,
    credit_memo_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_revenue_schedules(
    corp_id: str,
    status: str = "",
    standard_mode: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_revenue_schedule(
    corp_id: str,
    contract_ref: str,
    total_contract_cents: int,
    standard_mode: str = "asc_606",
    invoice_id: str = "",
    period_id: str = "",
    deferred_account_id: str = "",
) -> dict[str, Any]: ...


def get_revenue_schedule(
    corp_id: str,
    schedule_id: str,
) -> dict[str, Any]: ...


def recognize_revenue_period(
    corp_id: str,
    schedule_id: str,
    recognize_cents: int,
    period_id: str = "",
) -> dict[str, Any]: ...


def pause_revenue_schedule(
    corp_id: str,
    schedule_id: str,
    reason: str = "contract_modification",
) -> dict[str, Any]: ...


def list_revenue_obligations(
    corp_id: str,
    schedule_id: str,
    satisfaction_method: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def add_revenue_obligation(
    corp_id: str,
    schedule_id: str,
    obligation_code: str,
    description: str,
    satisfaction_method: str = "ratable",
    allocation_bps: int = 10000,
    allocated_cents: int = 0,
) -> dict[str, Any]: ...


def delete_revenue_obligation(
    corp_id: str,
    schedule_id: str,
    obligation_id: str,
) -> dict[str, Any]: ...


def list_vendors(
    corp_id: str,
    status: str = "",
    payment_hold: bool | None = None,
    vendor_code: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_vendor(
    corp_id: str,
    vendor_code: str,
    legal_name: str,
    contact_email: str,
    tax_id: str,
    bank_iban: str = "",
    ap_account_id: str = "",
    payment_hold: bool = False,
    ers_enabled: bool = False,
) -> dict[str, Any]: ...


def get_vendor(
    corp_id: str,
    vendor_id: str,
    actor_role: str = "ap_clerk",
) -> dict[str, Any]: ...


def update_vendor(
    corp_id: str,
    vendor_id: str,
    legal_name: str = "",
    contact_email: str = "",
    ers_enabled: bool | None = None,
) -> dict[str, Any]: ...


def toggle_vendor_hold(
    corp_id: str,
    vendor_id: str,
    payment_hold: bool = True,
) -> dict[str, Any]: ...


def archive_vendor(
    corp_id: str,
    vendor_id: str,
) -> dict[str, Any]: ...


def list_vendor_bank_changes(
    corp_id: str,
    status: str = "",
    vendor_id: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_vendor_bank_change(
    corp_id: str,
    vendor_id: str,
    new_iban: str,
    requester_actor_id: str = "ap_clerk_1",
) -> dict[str, Any]: ...


def confirm_vendor_bank_change(
    corp_id: str,
    bank_change_id: str,
) -> dict[str, Any]: ...


def approve_vendor_bank_change(
    corp_id: str,
    bank_change_id: str,
    approver_actor_id: str,
) -> dict[str, Any]: ...


def reject_vendor_bank_change(
    corp_id: str,
    bank_change_id: str,
    reason: str = "verification_failed",
) -> dict[str, Any]: ...


def list_purchase_orders(
    corp_id: str,
    status: str = "",
    vendor_id: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_purchase_order(
    corp_id: str,
    po_number: str,
    vendor_name: str,
    expected_qty: int,
    unit_price_cents: int,
    vendor_id: str = "",
    currency: str = "USD",
    tolerance_bps: int = 100,
    actor_role: str = "ap_clerk",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_purchase_order(
    corp_id: str,
    po_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def cancel_purchase_order(
    corp_id: str,
    po_id: str,
    reason: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_goods_receipts(
    corp_id: str,
    po_id: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def record_goods_receipt(
    corp_id: str,
    receipt_number: str,
    po_id: str,
    received_qty: int,
    received_value_cents: int,
    warehouse_code: str = "WH-MAIN",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_bills(
    corp_id: str,
    status: str = "",
    match_status: str = "",
    vendor_id: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def record_bill(
    corp_id: str,
    bill_number: str,
    vendor_contact_email: str,
    vendor_tax_id: str,
    due_date: str,
    subtotal_cents: int,
    vendor_id: str = "",
    po_id: str = "",
    receipt_id: str = "",
    tax_rate_id: str = "",
    currency: str = "USD",
    fx_rate_micros: int = 1000000,
    created_by_actor: str = "ap_clerk_1",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_bill(
    corp_id: str,
    bill_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def approve_bill(
    corp_id: str,
    bill_id: str,
    approver_actor: str,
    actor_role: str = "erp_admin",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def override_bill_match(
    corp_id: str,
    bill_id: str,
    approver_actor: str,
    override_reason: str,
    actor_role: str = "erp_admin",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def pay_bill(
    corp_id: str,
    bill_id: str,
    bank_account_id: str = "ACC-1010",
    amount_cents: int | None = None,
    settlement_fx_rate_micros: int = 1000000,
    payment_method: str = "ach",
    idempotency_key: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_payments(
    corp_id: str,
    direction: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def record_payment(
    corp_id: str,
    idempotency_key: str,
    direction: str,
    bank_account_id: str,
    amount_cents: int,
    invoice_id: str = "",
    bill_id: str = "",
    settlement_currency: str = "USD",
    settlement_fx_rate_micros: int = 1000000,
    payment_method: str = "ach",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_payment(
    corp_id: str,
    payment_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def reverse_payment(
    corp_id: str,
    payment_id: str,
    reason: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_bank_statements(
    corp_id: str,
    status: str = "",
    bank_account_id: str = "",
    format_kind: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def import_bank_statement_line(
    corp_id: str,
    idempotency_key: str,
    bank_account_id: str,
    statement_date: str,
    amount_cents: int,
    format_kind: str = "camt_053",
    reference_text: str = "",
) -> dict[str, Any]: ...


def match_bank_line(
    corp_id: str,
    statement_line_id: str,
    payment_id: str = "",
) -> dict[str, Any]: ...


def reconcile_bank_line(
    corp_id: str,
    statement_line_id: str,
) -> dict[str, Any]: ...


def exclude_bank_line(
    corp_id: str,
    statement_line_id: str,
    reason: str = "bank_fee_duplicate",
) -> dict[str, Any]: ...


def list_fixed_assets(
    corp_id: str,
    asset_class: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def register_fixed_asset(
    corp_id: str,
    asset_tag: str,
    asset_name: str,
    asset_class: str,
    acquisition_date: str,
    cost_cents: int,
    salvage_value_cents: int,
    useful_life_months: int,
    depreciation_method: str = "straight_line",
    asset_account_id: str = "ACC-1500",
    accum_depr_account_id: str = "ACC-1590",
    expense_account_id: str = "ACC-6200",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def run_asset_depreciation(
    corp_id: str,
    asset_id: str,
    period_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def dispose_fixed_asset(
    corp_id: str,
    asset_id: str,
    proceeds_cents: int,
    period_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_inventory_items(
    corp_id: str,
    valuation_method: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def create_inventory_item(
    corp_id: str,
    sku_code: str,
    item_name: str,
    valuation_method: str,
    quantity_on_hand: int,
    unit_cost_cents: int,
    inventory_account_id: str = "ACC-1300",
    cogs_account_id: str = "ACC-5000",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def adjust_inventory_valuation(
    corp_id: str,
    sku_id: str,
    qty_delta: int,
    unit_cost_cents: int,
    reason: str,
    period_id: str,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_legal_entities(
    corp_id: str,
    functional_currency: str = "",
    status: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_legal_entity(
    corp_id: str,
    entity_code: str,
    legal_name: str,
    functional_currency: str = "USD",
    jurisdiction: str = "US",
    aws_region: str = "us-east-1",
) -> dict[str, Any]: ...


def toggle_legal_entity(
    corp_id: str,
    legal_entity_id: str,
    active: bool = True,
) -> dict[str, Any]: ...


def list_intercompany_transfers(
    corp_id: str,
    status: str = "",
    period_id: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_intercompany_transfer(
    corp_id: str,
    transfer_code: str,
    amount_cents: int,
    from_entity_id: str = "",
    to_entity_id: str = "",
    period_id: str = "",
    currency: str = "USD",
) -> dict[str, Any]: ...


def get_intercompany_transfer(
    corp_id: str,
    ic_transfer_id: str,
) -> dict[str, Any]: ...


def post_intercompany_transfer(
    corp_id: str,
    ic_transfer_id: str,
) -> dict[str, Any]: ...


def eliminate_intercompany_transfer(
    corp_id: str,
    ic_transfer_id: str,
) -> dict[str, Any]: ...


def dispute_intercompany_transfer(
    corp_id: str,
    ic_transfer_id: str,
    reason: str = "amount_mismatch",
) -> dict[str, Any]: ...


def list_budgets(
    corp_id: str,
    status: str = "",
    cost_center: str = "",
    period_id: str = "",
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_budget(
    corp_id: str,
    budget_code: str,
    cost_center: str,
    allocated_cents: int,
    period_id: str = "",
    account_id: str = "",
    max_overrun_bps: int = 500,
) -> dict[str, Any]: ...


def activate_budget(
    corp_id: str,
    budget_id: str,
) -> dict[str, Any]: ...


def encumber_budget(
    corp_id: str,
    budget_id: str,
    amount_cents: int,
) -> dict[str, Any]: ...


def freeze_budget(
    corp_id: str,
    budget_id: str,
) -> dict[str, Any]: ...


def list_evidence_artifacts(
    corp_id: str,
    doc_class: str = "",
    object_lock_mode: str = "",
    legal_hold: bool | None = None,
    limit: int = 200,
    offset: int = 0,
) -> list[dict[str, Any]]: ...


def create_evidence_artifact(
    corp_id: str,
    doc_class: str,
    target_ref_id: str,
    file_name: str,
    size_bytes: int = 1024,
    object_lock_mode: str = "none",
    retention_days: int = 2555,
    legal_hold: bool = False,
) -> dict[str, Any]: ...


def upload_evidence_bytes(
    corp_id: str,
    artifact_id: str,
    payload: bytes,
) -> dict[str, Any]: ...


def download_evidence_bytes(
    corp_id: str,
    artifact_id: str,
) -> dict[str, Any]: ...


def toggle_evidence_legal_hold(
    corp_id: str,
    artifact_id: str,
    legal_hold: bool = True,
) -> dict[str, Any]: ...


def list_fx_rates(
    corp_id: str,
    from_currency: str = "",
    to_currency: str = "",
    effective_date: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def upsert_fx_rate(
    corp_id: str,
    rate_key: str,
    from_currency: str,
    to_currency: str,
    rate_micros: int,
    effective_date: str = "2026-01-15",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def list_fx_revaluations(
    corp_id: str,
    period_code: str = "",
    currency: str = "",
    limit: int = 200,
    offset: int = 0,
    as_of: str = "",
    as_known_at: str = "",
) -> list[dict[str, Any]]: ...


def run_fx_revaluation(
    corp_id: str,
    period_id: str,
    currency: str,
    closing_fx_rate_micros: int,
    dry_run: bool = False,
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_trial_balance(
    corp_id: str,
    period_code: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_aging_report(
    corp_id: str,
    ledger_side: str = "ar",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def get_tax_summary(
    corp_id: str,
    period_code: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...


def run_benford_audit(
    corp_id: str,
    period_code: str = "",
    as_of: str = "",
    as_known_at: str = "",
) -> dict[str, Any]: ...

§1.4 Behavioral Laws, Executable Invariants & Error Vocabulary

Executable Invariants Table

IDKindEntityChild EntityParent FieldChild FieldCeiling FieldSetup RouteSetup BodyProbe RouteProbe BodyList RouteExpected StatusExpected Code
INV-CONS-01conservation_sumJournalEntryJournalLinetotal_debit_centsdebit_cents``POST /api/journals{"period_id": "{period_id}", "posting_date": "2026-01-15", "description": "Probe debit sum", "total_debit_cents": 10000, "total_credit_cents": 10000, "currency": "USD", "fx_rate_micros": 1000000}POST /api/journals/{journal_id}/lines{"account_id": "{account_id}", "debit_cents": 15000, "credit_cents": 0, "signed_amount_cents": 15000, "allocation_bps": 10000, "memo": "Exceeds header debit"}GET /api/journals/{journal_id}/lines400unbalanced_journal
INV-CONS-02conservation_sumJournalEntryJournalLinetotal_credit_centscredit_cents``POST /api/journals{"period_id": "{period_id}", "posting_date": "2026-01-15", "description": "Probe credit sum", "total_debit_cents": 10000, "total_credit_cents": 10000, "currency": "USD", "fx_rate_micros": 1000000}POST /api/journals/{journal_id}/lines{"account_id": "{account_id}", "debit_cents": 0, "credit_cents": 15000, "signed_amount_cents": -15000, "allocation_bps": 10000, "memo": "Exceeds header credit"}GET /api/journals/{journal_id}/lines400unbalanced_journal
INV-CONS-03conservation_sumRevenueScheduleRevenueObligationtotal_contract_centsallocated_cents``POST /api/revenue-schedules{"contract_ref": "CTR-CONS-{sentinel}", "total_contract_cents": 100000, "standard_mode": "asc_606"}POST /api/revenue-schedules/{schedule_id}/obligations{"obligation_code": "POB-OVR-{sentinel}", "description": "Exceeds contract sum", "satisfaction_method": "ratable", "allocation_bps": 10000, "allocated_cents": 150000}GET /api/revenue-schedules/{schedule_id}/obligations400allocation_mismatch
INV-ALLOC-01allocation_totalJournalEntryJournalLine``allocation_bps``POST /api/journals{"period_id": "{period_id}", "posting_date": "2026-01-15", "description": "Probe allocation bps", "total_debit_cents": 10000, "total_credit_cents": 10000, "currency": "USD", "fx_rate_micros": 1000000}POST /api/journals/{journal_id}/lines{"account_id": "{account_id}", "debit_cents": 5000, "credit_cents": 0, "signed_amount_cents": 5000, "allocation_bps": 6000, "memo": "Exceeds 10000 bps"}GET /api/journals/{journal_id}/lines400allocation_exceeds_10000_bps
INV-ALLOC-02allocation_totalRevenueScheduleRevenueObligation``allocation_bps``POST /api/revenue-schedules{"contract_ref": "CTR-ALLOC-{sentinel}", "total_contract_cents": 100000, "standard_mode": "ifrs_15"}POST /api/revenue-schedules/{schedule_id}/obligations{"obligation_code": "POB-BPS-{sentinel}", "description": "Exceeds 10000 bps", "satisfaction_method": "point_in_time", "allocation_bps": 6000, "allocated_cents": 50000}GET /api/revenue-schedules/{schedule_id}/obligations400allocation_exceeds_10000_bps
INV-CEIL-01monotonic_ceilingTaxRate``rate_bps``rate_bpsPOST /api/tax-rates{"tax_code": "VAT_{sentinel}", "jurisdiction": "EU_VAT", "tax_type": "vat", "rate_bps": 2000, "liability_account_id": "{account_id}"}POST /api/tax-rates{"tax_code": "VAT_OVR_{sentinel}", "jurisdiction": "EU_VAT", "tax_type": "vat", "rate_bps": 3501, "liability_account_id": "{account_id}"}GET /api/tax-rates400invalid_tax_rate
INV-CEIL-02monotonic_ceilingPurchaseOrder``tolerance_bps``tolerance_bpsPOST /api/purchase-orders{"po_number": "PO-SET-{sentinel}", "vendor_name": "Nordic Steel AB", "expected_qty": 10, "unit_price_cents": 5000, "currency": "USD", "tolerance_bps": 100}POST /api/purchase-orders{"po_number": "PO-OVR-{sentinel}", "vendor_name": "Nordic Steel AB", "expected_qty": 10, "unit_price_cents": 5000, "currency": "USD", "tolerance_bps": 501}GET /api/purchase-orders400invalid_purchase_order
INV-CEIL-03monotonic_ceilingFixedAsset``useful_life_months``useful_life_monthsPOST /api/fixed-assets{"asset_tag": "FA-SET-{sentinel}", "asset_name": "CNC Mill", "asset_class": "machinery", "acquisition_date": "2026-01-10", "cost_cents": 500000, "salvage_value_cents": 50000, "useful_life_months": 60, "depreciation_method": "straight_line"}POST /api/fixed-assets{"asset_tag": "FA-OVR-{sentinel}", "asset_name": "CNC Mill", "asset_class": "machinery", "acquisition_date": "2026-01-10", "cost_cents": 500000, "salvage_value_cents": 50000, "useful_life_months": 601, "depreciation_method": "straight_line"}GET /api/fixed-assets400invalid_fixed_asset
INV-CEIL-04monotonic_ceilingFxRate``rate_micros``rate_microsPOST /api/fx-rates{"rate_key": "FX-SET-{sentinel}", "from_currency": "EUR", "to_currency": "USD", "rate_micros": 1085000, "effective_date": "2026-01-15"}POST /api/fx-rates{"rate_key": "FX-OVR-{sentinel}", "from_currency": "EUR", "to_currency": "USD", "rate_micros": 1000000001, "effective_date": "2026-01-15"}GET /api/fx-rates400invalid_fx_rate
INV-CEIL-05monotonic_ceilingBudgetCommitment``max_overrun_bps``max_overrun_bpsPOST /api/budgets{"budget_code": "BUD-SET-{sentinel}", "cost_center": "CC-ENG", "allocated_cents": 500000, "max_overrun_bps": 500}POST /api/budgets{"budget_code": "BUD-OVR-{sentinel}", "cost_center": "CC-ENG", "allocated_cents": 500000, "max_overrun_bps": 2001}GET /api/budgets400invalid_budget
INV-CEIL-06monotonic_ceilingEvidenceArtifact``size_bytes``size_bytesPOST /api/evidence-artifacts{"doc_class": "close_binder", "target_ref_id": "PER-0001", "file_name": "close.json", "size_bytes": 4096, "object_lock_mode": "governance"}POST /api/evidence-artifacts{"doc_class": "close_binder", "target_ref_id": "PER-0001", "file_name": "huge.json", "size_bytes": 10485761, "object_lock_mode": "none"}GET /api/evidence-artifacts400invalid_evidence
INV-CEIL-07monotonic_ceilingCustomer``credit_limit_cents``credit_limit_centsPOST /api/customers{"customer_code": "CUST-SET-{sentinel}", "legal_name": "Acme Buyer LLC", "billing_email": "ap@acme.example", "billing_address": "100 Main St", "credit_limit_cents": 5000000}POST /api/customers{"customer_code": "CUST-OVR-{sentinel}", "legal_name": "Acme Buyer LLC", "billing_email": "ap@acme.example", "billing_address": "100 Main St", "credit_limit_cents": 10000000001}GET /api/customers400invalid_customer
INV-IDEMP-01idempotent_replayPayment````````POST /api/payments{"idempotency_key": "PAY-KEY-{sentinel}", "direction": "ar_receipt", "bank_account_id": "{account_id}", "amount_cents": 25000, "invoice_id": "{invoice_id}", "settlement_currency": "USD", "settlement_fx_rate_micros": 1000000, "payment_method": "ach"}POST /api/payments{"idempotency_key": "PAY-KEY-{sentinel}", "direction": "ar_receipt", "bank_account_id": "{account_id}", "amount_cents": 25000, "invoice_id": "{invoice_id}", "settlement_currency": "USD", "settlement_fx_rate_micros": 1000000, "payment_method": "ach"}GET /api/payments200``
INV-IDEMP-02idempotent_replayAccount````````POST /api/accounts{"code": "9101", "name": "Suspense Clearing", "account_type": "asset", "normal_balance": "debit", "currency": "USD"}POST /api/accounts{"code": "9101", "name": "Suspense Clearing", "account_type": "asset", "normal_balance": "debit", "currency": "USD"}GET /api/accounts200``
INV-IDEMP-03idempotent_replayFxRate````````POST /api/fx-rates{"rate_key": "GBP-USD-{sentinel}", "from_currency": "GBP", "to_currency": "USD", "rate_micros": 1270000, "effective_date": "2026-01-15"}POST /api/fx-rates{"rate_key": "GBP-USD-{sentinel}", "from_currency": "GBP", "to_currency": "USD", "rate_micros": 1270000, "effective_date": "2026-01-15"}GET /api/fx-rates200``
INV-IDEMP-04idempotent_replayBankStatementLine````````POST /api/bank-statements{"idempotency_key": "BNK-KEY-{sentinel}", "bank_account_id": "{account_id}", "statement_date": "2026-01-20", "amount_cents": 50000, "format_kind": "camt_053", "reference_text": "Wire 101"}POST /api/bank-statements{"idempotency_key": "BNK-KEY-{sentinel}", "bank_account_id": "{account_id}", "statement_date": "2026-01-20", "amount_cents": 50000, "format_kind": "camt_053", "reference_text": "Wire 101"}GET /api/bank-statements200``
INV-STATE-01state_precondition_refusalFiscalPeriod``status````POST /api/fiscal-periods/{period_id}/close{}POST /api/fiscal-periods/{period_id}/close{}GET /api/fiscal-periods400closed_period
INV-STATE-02state_precondition_refusalJournalEntry``status````POST /api/journals/{journal_id}/void{}POST /api/journals/{journal_id}/void{}GET /api/journals400unvoidable_journal
INV-STATE-03state_precondition_refusalJournalEntry``total_debit_cents````POST /api/journals{"period_id": "{period_id}", "posting_date": "2026-01-15", "description": "Balanced setup entry", "total_debit_cents": 10000, "total_credit_cents": 10000, "currency": "USD", "fx_rate_micros": 1000000}POST /api/journals{"period_id": "{period_id}", "posting_date": "2026-01-15", "description": "Unbalanced reject entry", "total_debit_cents": 10000, "total_credit_cents": 9000, "currency": "USD", "fx_rate_micros": 1000000}GET /api/journals400unbalanced_journal
INV-STATE-04state_precondition_refusalInvoice``status````POST /api/invoices/{invoice_id}/pay{"bank_account_id": "{account_id}", "payment_method": "ach"}POST /api/invoices/{invoice_id}/pay{"bank_account_id": "{account_id}", "payment_method": "ach"}GET /api/invoices400unpayable_invoice
INV-STATE-05state_precondition_refusalAccount``status````POST /api/accounts/{account_id}/archive{}POST /api/accounts/{account_id}/archive{}GET /api/accounts400unarchivable_account
INV-STATE-06state_precondition_refusalVendorBankChange``status````POST /api/vendor-bank-changes{"vendor_id": "{vendor_id}", "new_iban": "DE89370400440532013000", "requester_actor_id": "ap_clerk_99"}POST /api/vendor-bank-changes/{bank_change_id}/approve{"approver_actor_id": "ap_clerk_99"}GET /api/vendor-bank-changes400sod_violation
INV-STATE-07state_precondition_refusalIntercompanyTransfer``status````POST /api/intercompany-transfers{"transfer_code": "ICT-GATE-{sentinel}", "amount_cents": 45000, "currency": "USD"}POST /api/intercompany-transfers/{ic_transfer_id}/eliminate{}GET /api/intercompany-transfers400invalid_state_transition
INV-STATE-08state_precondition_refusalBudgetCommitment``status````POST /api/budgets{"budget_code": "BUD-GATE-{sentinel}", "cost_center": "CC-OPS", "allocated_cents": 250000, "max_overrun_bps": 500}POST /api/budgets/{budget_id}/encumber{"amount_cents": 10000}GET /api/budgets400invalid_state_transition

Closed Error Vocabulary Table

Uniform error envelope across every non-2xx API reply: {"ok": false, "error": {"code": "<snake_case>", "message": "<str>"}}.

CodeHTTPCategoryTrigger
invalid_limit400validationQuery ?limit= non-integer or outside 1..500
invalid_offset400validationQuery ?offset= negative or non-integer
invalid_timestamp400validationMalformed ISO-8601 as_of, as_known_at, or date range
invalid_content_length400validationNegative or non-integer HTTP Content-Length header
invalid_field400validationMissing required body field or schema pattern/range violation
invalid_tax_rate400refusalTaxRate.rate_bps outside 0..3500 (INV-CEIL-01) or unknown jurisdiction
invalid_purchase_order400refusalPurchaseOrder.tolerance_bps outside 0..500 (INV-CEIL-02) or non-positive qty/price
invalid_fixed_asset400refusalFixedAsset.useful_life_months outside 1..600 (INV-CEIL-03) or salvage > cost
invalid_fx_rate400refusalFxRate.rate_micros outside 1..1000000000 (INV-CEIL-04) or identical currency pair
invalid_budget400refusalBudgetCommitment.max_overrun_bps outside 0..2000 (INV-CEIL-05) or non-positive allocation
invalid_evidence400refusalEvidenceArtifact.size_bytes outside 1..10485760 (INV-CEIL-06) or Object Lock on contact_pii_export
invalid_customer400refusalCustomer.credit_limit_cents outside 0..10000000000 (INV-CEIL-07)
invalid_period_transition400refusalMissing reason on fiscal period reopen or invalid date span
invalid_state_transition400refusalDisallowed workflow transition on close task, invoice, credit memo, revenue schedule, vendor, PO, bill, bank line, intercompany transfer, budget, payment, or asset
unbalanced_journal400refusaltotal_debit_cents != total_credit_cents, zero total, or line sum exceeding header (INV-CONS-01/02)
allocation_mismatch400refusalRevenueObligation.allocated_cents sum exceeds RevenueSchedule.total_contract_cents (INV-CONS-03)
allocation_exceeds_10000_bps400refusalCumulative allocation_bps exceeds 10000 bps (INV-ALLOC-01/02)
budget_exceeded400refusalEncumbrance exceeds allocated_cents * (10000 + max_overrun_bps) // 10000
closed_period400refusalAttempt to post or re-close against a closed FiscalPeriod (INV-STATE-01)
unvoidable_journal400refusalAttempt to void or reverse a journal whose status is not posted (INV-STATE-02)
unarchivable_account400refusalAttempt to archive an already-archived or non-zero control GL account (INV-STATE-05)
unpayable_invoice400refusalAttempt to pay an already-paid or voided invoice (INV-STATE-04)
unpayable_bill400refusalAttempt to pay a draft, variance_hold, paid, or voided bill or vendor on payment_hold
sod_violation400refusalSOX 404 Segregation of Duties violation (approver_actor == created_by_actor / requester_actor_id) (INV-STATE-06)
insufficient_inventory400refusalInventory valuation adjustment would reduce quantity_on_hand below 0
unauthorized401authMissing, expired, alg=none, or bad-signature HS256 JWT when AUTH_MODE=jwt
missing_corp403tenancyOmitted, empty, or unknown X-Corp-Id header
missing_role403rbacOmitted or empty X-Role header on any protected /api/* endpoint
invalid_role403rbacNon-empty X-Role outside declared §2 closed role set
insufficient_role403rbacValid role excluded from target §4.1 route group
account_not_found404not_foundUnknown or cross-tenant account_id
period_not_found404not_foundUnknown or cross-tenant period_id
close_task_not_found404not_foundUnknown or cross-tenant close_task_id
tax_rate_not_found404not_foundUnknown or cross-tenant tax_rate_id
journal_not_found404not_foundUnknown or cross-tenant journal_id
customer_not_found404not_foundUnknown or cross-tenant customer_id
invoice_not_found404not_foundUnknown or cross-tenant invoice_id
credit_memo_not_found404not_foundUnknown or cross-tenant credit_memo_id
schedule_not_found404not_foundUnknown or cross-tenant schedule_id
obligation_not_found404not_foundUnknown or cross-tenant obligation_id
vendor_not_found404not_foundUnknown or cross-tenant vendor_id
bank_change_not_found404not_foundUnknown or cross-tenant bank_change_id
po_not_found404not_foundUnknown or cross-tenant po_id
bill_not_found404not_foundUnknown or cross-tenant bill_id
payment_not_found404not_foundUnknown or cross-tenant payment_id
statement_line_not_found404not_foundUnknown or cross-tenant statement_line_id
asset_not_found404not_foundUnknown or cross-tenant asset_id
sku_not_found404not_foundUnknown or cross-tenant sku_id
legal_entity_not_found404not_foundUnknown or cross-tenant legal_entity_id
ic_transfer_not_found404not_foundUnknown or cross-tenant ic_transfer_id
budget_not_found404not_foundUnknown or cross-tenant budget_id
artifact_not_found404not_foundUnknown or cross-tenant artifact_id or missing S3 payload
route_not_found404routingUnmatched HTTP method or API URL path
duplicate_key409conflictConflicting duplicate natural unique key across tenant collections
payload_too_large413hardeningPre-read Content-Length exceeds 1_048_576 bytes
upgrade_required426hardeningCleartext HTTP request lacking X-Forwarded-Proto: https when FORCE_HTTPS=true
rate_limited429hardeningToken-bucket rate limit exceeded (emits Retry-After)
sim_unavailable503infraOffstack DynamoDB or Secrets Manager unreachable or timed out
blob_unavailable503infraOffstack S3 or KMS unreachable during encrypted export or key wrap
service_busy503hardeningBounded HTTP concurrency semaphore saturated (emits Retry-After)

§1.5 Wire-Name Unity & Entity Schemas

Exact 5 DF3 IR types (ir.py): text | int | money | enum | bool. Every request body field in §3, parameter in §1.3, column/input in §6–§7, and PII entry in §4.2 matches exact field names below across all 27 entities.

Account (accounts, pk=account_id, list=GET /api/accounts, create=POST /api/accounts)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
account_idtextnonoyesyesauto:ACC-####pattern=^ACC-[0-9]{4}$Server-assigned immutable PK
codetextyesyesyesyes``pattern=^[0-9]{4,6}$Unique GL account code (200 replay on identical payload; 409 on mismatch)
nametextyesyesnono``min_length=2; max_length=120Display name (PATCH mutable)
account_typeenumyesyesnoyesassetenum=[asset, liability, equity, revenue, expense]Accounting classification
normal_balanceenumyesyesnoyesdebitenum=[debit, credit]Standard balance side
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]ISO 4217 currency code
is_control_accountboolnoyesnonofalse``Subledger control flag (AR/AP/Inventory)
allow_manual_postingboolnoyesnonotrue``Direct GL posting toggle (PATCH mutable)
balance_centsmoneynononono0min_value=-999999999999; max_value=999999999999Signed minor-unit GL balance
statusenumnononoyesactiveenum=[active, archived]Lifecycle state (archive_account)
effective_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp (as_of)
recorded_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp (as_known_at)

FiscalPeriod (fiscal_periods, pk=period_id, list=GET /api/fiscal-periods, create=POST /api/fiscal-periods)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
period_idtextnonoyesyesauto:PER-####pattern=^PER-[0-9]{4}$Server-assigned immutable PK
period_codetextyesyesyesyes``pattern=^[0-9]{4}-[0-9]{2}$Unique fiscal month (YYYY-MM)
start_datetextyesyesnoyes2026-01-01pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Period start ISO date
end_datetextyesyesnoyes2026-01-31pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Period end ISO date
close_checklist_completeboolnoyesnonofalse``Pre-close reconciliation checklist flag
statusenumnononoyesopenenum=[open, soft_closed, closed]Posting lock state (CLOSED-YYYY-MM)
locked_by_roletextnononoyes``max_length=32Role that locked period
reopen_reasontextnononono``max_length=256Mandatory audit reason on reopen
effective_attextnononoyes2026-01-01T00:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-01T00:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

CloseTask (close_tasks, pk=close_task_id, list=GET /api/close-tasks, create=POST /api/close-tasks)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
close_task_idtextnonoyesyesauto:CTSK-####pattern=^CTSK-[0-9]{4}$Close checklist task PK
task_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique close step identifier
titletextyesyesnono``min_length=3; max_length=160Close checklist task description
period_idtextyesyesnoyes``pattern=^PER-[0-9]{4}$FK -> FiscalPeriod.period_id (REL-08)
owner_roleenumnoyesnoyesgl_accountantenum=[gl_accountant, ar_clerk, ap_clerk, controller, erp_admin]Responsible close role
sequence_orderintnoyesnono1min_value=1; max_value=100Ordered close execution DAG rank
statusenumnononoyesopenenum=[open, in_progress, signed_off, waived]Close task lifecycle
signed_off_bytextnononoyes``max_length=64Controller/accountant sign-off actor
effective_attextnononoyes2026-01-31T18:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-31T18:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

TaxRate (tax_rates, pk=tax_rate_id, list=GET /api/tax-rates, create=POST /api/tax-rates)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
tax_rate_idtextnonoyesyesauto:TAX-####pattern=^TAX-[0-9]{4}$Server-assigned immutable PK
tax_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{2,24}$Unique tax code
jurisdictionenumyesyesnoyesUS_STATEenum=[US_FEDERAL, US_STATE, EU_VAT, UK_VAT, RS_PDV, GLOBAL]Tax authority
tax_typeenumyesyesnoyessales_taxenum=[sales_tax, vat, withholding_tds, reverse_charge]Tax regime mechanism
rate_bpsintyesyesnono825min_value=0; max_value=3500Rate in basis points (INV-CEIL-01 cap 3500)
liability_account_idtextyesyesnoyes``pattern=^ACC-[0-9]{4}$FK -> Account.account_id (REL-04)
activeboolnoyesnonotrue``Toggled via toggle_tax_rate
effective_attextnononoyes2026-01-01T00:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-01T00:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

JournalEntry (journals, pk=journal_id, list=GET /api/journals, create=POST /api/journals)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
journal_idtextnonoyesyesauto:JE-####pattern=^JE-[0-9]{4}$Server-assigned immutable PK
period_idtextyesyesnoyes``pattern=^PER-[0-9]{4}$FK -> FiscalPeriod.period_id (REL-01)
posting_datetextyesyesnoyes2026-01-15pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Accounting posting date
descriptiontextyesyesnono``min_length=3; max_length=256Immutable journal memo
total_debit_centsmoneyyesyesnono1000min_value=1; max_value=99999999999Must equal total_credit_cents (INV-CONS-01)
total_credit_centsmoneyyesyesnono1000min_value=1; max_value=99999999999Must equal total_debit_cents (INV-CONS-02)
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Transaction currency
fx_rate_microsintnoyesnono1000000min_value=1; max_value=1000000000Fixed-point FX multiplier (1000000 = 1.0)
referencetextnoyesnoyes``max_length=64Linked document label
source_moduleenumnoyesnoyesgl_manualenum=[gl_manual, ar_subledger, ap_subledger, fx_reval, fixed_assets, inventory_cogs, tax_engine]Originating ledger module
period_codetextnononoyes2026-01pattern=^[0-9]{4}-[0-9]{2}$Derived fiscal period code
reverses_journal_idtextnononoyes``pattern=^JE-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
statusenumnononoyespostedenum=[posted, reversed, voided]Append-only posting state
benford_flaggedboolnonononofalse``Benford first-digit anomaly flag
effective_attextnononoyes2026-01-15T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp (as_of)
recorded_attextnononoyes2026-01-15T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp (as_known_at)

JournalLine (journal_lines, pk=line_id, list=GET /api/journals/{journal_id}/lines, create=POST /api/journals/{journal_id}/lines)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
line_idtextnonoyesyesauto:JEL-####pattern=^JEL-[0-9]{4}$Server-assigned nested line PK
journal_idtextyesyesnoyes``pattern=^JE-[0-9]{4}$FK -> JournalEntry.journal_id (REL-02)
account_idtextyesyesnoyes``pattern=^ACC-[0-9]{4}$FK -> Account.account_id (REL-03)
debit_centsmoneynoyesnono0min_value=0; max_value=99999999999Unsigned debit minor units
credit_centsmoneynoyesnono0min_value=0; max_value=99999999999Unsigned credit minor units
signed_amount_centsmoneyyesyesnono0min_value=-99999999999; max_value=99999999999Signed net line amount (+ debit / - credit for reversals)
allocation_bpsintnoyesnono0min_value=0; max_value=10000Cost allocation share (INV-ALLOC-01 sum <= 10000)
tax_rate_idtextnoyesnoyes``pattern=^TAX-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
memotextnoyesnono``max_length=160Line-level audit memo
effective_attextnononoyes2026-01-15T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Inherited event stamp
recorded_attextnononoyes2026-01-15T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$System write stamp

Customer (customers, pk=customer_id, list=GET /api/customers, create=POST /api/customers)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
customer_idtextnonoyesyesauto:CUST-####pattern=^CUST-[0-9]{4}$Governed AR customer PK
customer_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique customer master code
legal_nametextyesyesnono``min_length=2; max_length=120Customer legal name (security.pii_fields)
billing_emailtextyesyesnoyes``pattern=^[^@\s]+@[^@\s]+\.[^@\s]+$Customer billing email (security.pii_fields)
billing_addresstextyesyesnono``min_length=5; max_length=240Customer billing address (security.pii_fields)
credit_limit_centsmoneynoyesnono5000000min_value=0; max_value=10000000000AR credit exposure cap (INV-CEIL-07)
ar_account_idtextnoyesnoyes``pattern=^ACC-[0-9]{4}$Optional FK -> Account.account_id (REL-12)
dunning_pausedboolnoyesnonofalse``Disputed-invoice dunning pause flag
statusenumnononoyesactiveenum=[active, credit_hold, archived]Credit hold lifecycle
created_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

Invoice (invoices, pk=invoice_id, list=GET /api/invoices, create=POST /api/invoices)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
invoice_idtextnonoyesyesauto:INV-####pattern=^INV-[0-9]{4}$Server-assigned immutable PK
invoice_numbertextyesyesyesyes``pattern=^INV-[A-Z0-9-]{4,20}$Unique EU VAT Art. 226 sequential number
customer_nametextyesyesnono``min_length=2; max_length=120Customer legal name (security.pii_fields)
customer_emailtextyesyesnoyes``pattern=^[^@\s]+@[^@\s]+\.[^@\s]+$Customer billing email (security.pii_fields)
billing_addresstextyesyesnono``min_length=5; max_length=240Customer billing address (security.pii_fields)
due_datetextyesyesnoyes2026-02-15pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Contractual due date
subtotal_centsmoneyyesyesnono10000min_value=1; max_value=99999999999Pre-tax invoice subtotal
customer_idtextnoyesnoyes``pattern=^CUST-[0-9]{4}$Optional FK -> Customer.customer_id (REL-13)
tax_rate_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Invoice currency
fx_rate_microsintnoyesnono1000000min_value=1; max_value=1000000000Posting FX rate in micros
payment_termsenumnoyesnoyesnet_30enum=[net_30, net_15, 2_10_net_30, due_on_receipt]Early-pay discount/terms
ar_account_idtextnoyesnoyesACC-1200max_length=16Non-FK optional reference string; do not enforce FK existence
revenue_account_idtextnoyesnoyesACC-4000max_length=16Non-FK optional reference string; do not enforce FK existence
tax_amount_centsmoneynononono0min_value=0; max_value=99999999999Server-computed tax minor units
total_amount_centsmoneynononono10000min_value=1; max_value=99999999999subtotal_cents + tax_amount_cents
paid_amount_centsmoneynononono0min_value=0; max_value=99999999999Settled minor units
remaining_due_centsmoneynononono10000min_value=0; max_value=99999999999Open receivable balance
journal_idtextnononoyes``pattern=^JE-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
statusenumnononoyesdraftenum=[draft, unpaid, partially_paid, paid, overdue, voided]AR lifecycle status
effective_attextnononoyes2026-01-16T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-16T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

CreditMemo (credit_memos, pk=credit_memo_id, list=GET /api/credit-memos, create=POST /api/credit-memos)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
credit_memo_idtextnonoyesyesauto:CM-####pattern=^CM-[0-9]{4}$Server-assigned immutable PK
memo_numbertextyesyesyesyes``pattern=^CM-[A-Z0-9-]{4,20}$Unique credit/debit memo code
doc_kindenumyesyesnoyesar_credit_memoenum=[ar_credit_memo, ap_debit_memo]Subledger adjustment direction
adjustment_centsmoneyyesyesnono-5000min_value=-99999999999; max_value=0Signed negative adjustment (Signed Money)
reasontextyesyesnono``min_length=3; max_length=256Audit justification
invoice_idtextnoyesnoyes``pattern=^INV-[0-9]{4}$Optional FK -> Invoice.invoice_id (REL-06)
bill_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
tax_adjustment_centsmoneynoyesnono0min_value=-99999999999; max_value=0Signed negative VAT/tax reversal
statusenumnononoyesdraftenum=[draft, applied, voided]Lifecycle state (apply_credit_memo)
effective_attextnononoyes2026-01-18T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-18T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

RevenueSchedule (revenue_schedules, pk=schedule_id, list=GET /api/revenue-schedules, create=POST /api/revenue-schedules)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
schedule_idtextnonoyesyesauto:REV-####pattern=^REV-[0-9]{4}$ASC 606 / IFRS 15 schedule PK
contract_reftextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique customer contract reference
total_contract_centsmoneyyesyesnono100000min_value=1; max_value=99999999999Transaction price (INV-CONS-03 sum cap)
standard_modeenumnoyesnoyesasc_606enum=[asc_606, ifrs_15]Accounting standard regime
invoice_idtextnoyesnoyes``pattern=^INV-[0-9]{4}$Optional FK -> Invoice.invoice_id (REL-16)
period_idtextnoyesnoyes``pattern=^PER-[0-9]{4}$Optional FK -> FiscalPeriod.period_id (REL-17)
deferred_account_idtextnoyesnoyes``max_length=16Non-FK optional reference string; do not enforce FK existence
recognized_centsmoneynononono0min_value=0; max_value=99999999999Cumulative recognized revenue
statusenumnononoyesactiveenum=[active, recognizing, completed, paused]Recognition lifecycle
created_attextnononoyes2026-01-16T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

RevenueObligation (revenue_obligations, pk=obligation_id, list=GET /api/revenue-schedules/{schedule_id}/obligations, create=POST /api/revenue-schedules/{schedule_id}/obligations)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
obligation_idtextnonoyesyesauto:POB-####pattern=^POB-[0-9]{4}$Nested performance obligation PK
schedule_idtextnononoyes``pattern=^REV-[0-9]{4}$Path-bound FK -> RevenueSchedule.schedule_id (REL-18)
obligation_codetextyesyesnoyes``pattern=^[A-Z0-9_-]{3,32}$Performance obligation code
descriptiontextyesyesnono``min_length=2; max_length=160Distinct good/service promise
satisfaction_methodenumnoyesnoyesratableenum=[ratable, point_in_time, milestone]ASC 606 satisfaction pattern
allocation_bpsintyesyesnono5000min_value=1; max_value=10000SSP share (INV-ALLOC-02 sum <= 10000)
allocated_centsmoneyyesyesnono50000min_value=1; max_value=99999999999Allocated transaction price (INV-CONS-03)
created_attextnononoyes2026-01-16T10:05:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

Vendor (vendors, pk=vendor_id, list=GET /api/vendors, create=POST /api/vendors)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
vendor_idtextnonoyesyesauto:VEND-####pattern=^VEND-[0-9]{4}$Governed AP vendor master PK
vendor_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique vendor master key
legal_nametextyesyesnono``min_length=2; max_length=120Supplier legal name (security.pii_fields)
contact_emailtextyesyesnoyes``pattern=^[^@\s]+@[^@\s]+\.[^@\s]+$Vendor billing contact (security.pii_fields)
tax_idtextyesyesnoyes``min_length=4; max_length=32Non-FK optional reference string; do not enforce FK existence
bank_ibantextnoyesnoyes``max_length=34Mod-97 validated settlement IBAN
ap_account_idtextnoyesnoyes``pattern=^ACC-[0-9]{4}$Optional FK -> Account.account_id (REL-10)
payment_holdboolnoyesnonofalse``Anti-fraud payment hold flag
ers_enabledboolnoyesnonofalse``Evaluated Receipt Settlement flag
statusenumnononoyesactiveenum=[active, on_hold, archived]Vendor governance state
created_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

VendorBankChange (vendor_bank_changes, pk=bank_change_id, list=GET /api/vendor-bank-changes, create=POST /api/vendor-bank-changes)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
bank_change_idtextnonoyesyesauto:VBC-####pattern=^VBC-[0-9]{4}$Bank-change anti-fraud request PK
vendor_idtextyesyesnoyes``pattern=^VEND-[0-9]{4}$FK -> Vendor.vendor_id (REL-11)
new_ibantextyesyesnoyes``min_length=15; max_length=34; pattern=^[A-Z]{2}[0-9A-Z]{13,32}$Requested payout IBAN (security.pii_fields)
requester_actor_idtextnoyesnoyesap_clerk_1min_length=2; max_length=64Non-FK optional reference string; do not enforce FK existence
approver_actor_idtextnononoyes``max_length=64Non-FK optional reference string; do not enforce FK existence
statusenumnononoyespendingenum=[pending, confirmed, approved, rejected]Dual-control anti-fraud gate (INV-STATE-06)
created_attextnononoyes2026-01-18T11:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

PurchaseOrder (purchase_orders, pk=po_id, list=GET /api/purchase-orders, create=POST /api/purchase-orders)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
po_idtextnonoyesyesauto:PO-####pattern=^PO-[0-9]{4}$Server-assigned immutable PK
po_numbertextyesyesyesyes``pattern=^PO-[A-Z0-9-]{4,20}$Unique procurement order code
vendor_nametextyesyesnono``min_length=2; max_length=120Supplier legal name
expected_qtyintyesyesnono10min_value=1; max_value=1000000Ordered unit quantity
unit_price_centsmoneyyesyesnono5000min_value=1; max_value=9999999999Contracted unit price
vendor_idtextnoyesnoyes``pattern=^VEND-[0-9]{4}$Optional FK -> Vendor.vendor_id (REL-14)
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]PO currency
tolerance_bpsintnoyesnono100min_value=0; max_value=5003-way match variance ceiling (INV-CEIL-02 max 500)
total_amount_centsmoneynononono50000min_value=1; max_value=99999999999expected_qty * unit_price_cents
statusenumnononoyesopenenum=[open, partially_received, received, matched, cancelled]Procurement lifecycle
effective_attextnononoyes2026-01-12T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-12T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

GoodsReceipt (goods_receipts, pk=receipt_id, list=GET /api/goods-receipts, create=POST /api/goods-receipts)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
receipt_idtextnonoyesyesauto:GRN-####pattern=^GRN-[0-9]{4}$Server-assigned immutable PK
receipt_numbertextyesyesyesyes``pattern=^GRN-[A-Z0-9-]{4,20}$Unique warehouse GRN reference
po_idtextyesyesnoyes``pattern=^PO-[0-9]{4}$FK -> PurchaseOrder.po_id (REL-05)
received_qtyintyesyesnono10min_value=1; max_value=1000000Verified received quantity
received_value_centsmoneyyesyesnono50000min_value=1; max_value=99999999999GRNI accrual value
warehouse_codetextnoyesnoyesWH-MAINmin_length=2; max_length=32Receiving facility code
statusenumnononoyesacceptedenum=[accepted, quarantined, reversed]Inspection outcome
effective_attextnononoyes2026-01-13T12:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-13T12:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

Bill (bills, pk=bill_id, list=GET /api/bills, create=POST /api/bills)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
bill_idtextnonoyesyesauto:BILL-####pattern=^BILL-[0-9]{4}$Server-assigned immutable PK
bill_numbertextyesyesyesyes``pattern=^BILL-[A-Z0-9-]{4,20}$Unique vendor invoice number
vendor_contact_emailtextyesyesnoyes``pattern=^[^@\s]+@[^@\s]+\.[^@\s]+$Vendor billing email (security.pii_fields)
vendor_tax_idtextyesyesnoyes``min_length=4; max_length=32Non-FK optional reference string; do not enforce FK existence (security.pii_fields)
due_datetextyesyesnoyes2026-02-20pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Payment due date
subtotal_centsmoneyyesyesnono50000min_value=1; max_value=99999999999Pre-tax vendor bill subtotal
vendor_idtextnoyesnoyes``pattern=^VEND-[0-9]{4}$Optional FK -> Vendor.vendor_id (REL-15)
po_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
receipt_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
tax_rate_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Bill currency
fx_rate_microsintnoyesnono1000000min_value=1; max_value=1000000000Posting FX rate in micros
created_by_actortextnoyesnoyesap_clerk_1min_length=2; max_length=64SOX 404 SoD creator actor ID
approved_by_actortextnononoyes``max_length=64Distinct approver actor ID
tax_amount_centsmoneynononono0min_value=0; max_value=99999999999Server-computed VAT/sales tax
total_amount_centsmoneynononono50000min_value=1; max_value=99999999999Total payable amount
paid_amount_centsmoneynononono0min_value=0; max_value=99999999999Disbursed minor units
variance_bpsintnononono0min_value=0; max_value=10000Computed 3-way match variance
match_statusenumnononoyesunmatchedenum=[unmatched, matched, variance_blocked, override_approved]3-way PO-receipt-bill match state
statusenumnononoyesunpaidenum=[draft, unpaid, approved, paid, variance_hold, voided]AP bill lifecycle status
effective_attextnononoyes2026-01-17T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-17T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

Payment (payments, pk=payment_id, list=GET /api/payments, create=POST /api/payments)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
payment_idtextnonoyesyesauto:PAY-####pattern=^PAY-[0-9]{4}$Server-assigned immutable PK
idempotency_keytextyesyesyesyes``min_length=4; max_length=64Non-FK idempotency key string; do not enforce FK existence (INV-IDEMP-01)
directionenumyesyesnoyesar_receiptenum=[ar_receipt, ap_disbursement]Cash flow direction
bank_account_idtextyesyesnoyes``pattern=^ACC-[0-9]{4}$FK -> Account.account_id (REL-07)
amount_centsmoneyyesyesnono10000min_value=1; max_value=99999999999Settlement minor units
invoice_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
bill_idtextnoyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
settlement_currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Settlement currency
settlement_fx_rate_microsintnoyesnono1000000min_value=1; max_value=1000000000Settlement FX rate in micros
payment_methodenumnoyesnoyesachenum=[ach, sepa, wire, check, card]Clearing rail
fx_gain_loss_centsmoneynononono0min_value=-99999999999; max_value=99999999999Signed realized FX delta posted to ACC-8010
journal_idtextnononoyes``pattern=^JE-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
statusenumnononoyessettledenum=[settled, reversed]Settlement state (reverse_payment)
effective_attextnononoyes2026-01-19T11:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-19T11:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

BankStatementLine (bank_statements, pk=statement_line_id, list=GET /api/bank-statements, create=POST /api/bank-statements)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
statement_line_idtextnonoyesyesauto:BNK-####pattern=^BNK-[0-9]{4}$Bank statement feed line PK
idempotency_keytextyesyesyesyes``min_length=4; max_length=64Non-FK idempotency key string; do not enforce FK existence (INV-IDEMP-04)
bank_account_idtextyesyesnoyes``pattern=^ACC-[0-9]{4}$FK -> Account.account_id (REL-09)
statement_datetextyesyesnoyes2026-01-20pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Value date of bank transaction
amount_centsmoneyyesyesnono50000min_value=-99999999999; max_value=99999999999Signed bank inflow/outflow (Signed Money)
format_kindenumnoyesnoyescamt_053enum=[camt_053, mt940, bai2, csv_feed]Bank statement wire format
reference_texttextnoyesnono``max_length=160Remittance memo for fuzzy match
matched_payment_idtextnononoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
statusenumnononoyesunmatchedenum=[unmatched, matched, reconciled, excluded]Bank rec state machine
created_attextnononoyes2026-01-20T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

FixedAsset (fixed_assets, pk=asset_id, list=GET /api/fixed-assets, create=POST /api/fixed-assets)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
asset_idtextnonoyesyesauto:FA-####pattern=^FA-[0-9]{4}$Server-assigned immutable PK
asset_tagtextyesyesyesyes``pattern=^[A-Z0-9-]{3,32}$Unique physical asset tag
asset_nametextyesyesnono``min_length=2; max_length=120Asset description
asset_classenumyesyesnoyesmachineryenum=[machinery, it_equipment, buildings, vehicles, intangible]Asset book class
acquisition_datetextyesyesnoyes2026-01-05pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Capitalization date
cost_centsmoneyyesyesnono500000min_value=1; max_value=99999999999Historical capitalized cost
salvage_value_centsmoneyyesyesnono50000min_value=0; max_value=99999999999Residual floor (<= cost_cents)
useful_life_monthsintyesyesnono60min_value=1; max_value=600Depreciation horizon (INV-CEIL-03 max 600)
depreciation_methodenumnoyesnoyesstraight_lineenum=[straight_line, double_declining]Depreciation formula
asset_account_idtextnoyesnoyesACC-1500max_length=16Non-FK optional reference string; do not enforce FK existence
accum_depr_account_idtextnoyesnoyesACC-1590max_length=16Non-FK optional reference string; do not enforce FK existence
expense_account_idtextnoyesnoyesACC-6200max_length=16Non-FK optional reference string; do not enforce FK existence
accumulated_depreciation_centsmoneynononono0min_value=0; max_value=99999999999Cumulative booked depreciation
net_book_value_centsmoneynononono500000min_value=0; max_value=99999999999cost_cents - accumulated_depreciation_cents
statusenumnononoyesactiveenum=[active, fully_depreciated, disposed, impaired]Asset lifecycle state
effective_attextnononoyes2026-01-05T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-05T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

InventoryValuation (inventory_items, pk=sku_id, list=GET /api/inventory, create=POST /api/inventory)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
sku_idtextnonoyesyesauto:SKU-####pattern=^SKU-[0-9]{4}$Server-assigned immutable PK
sku_codetextyesyesyesyes``pattern=^[A-Z0-9-]{3,32}$Unique stock keeping code
item_nametextyesyesnono``min_length=2; max_length=120Inventory item label
valuation_methodenumyesyesnoyesfifoenum=[fifo, weighted_avg]Costing algorithm
quantity_on_handintyesyesnono100min_value=0; max_value=10000000Current on-hand units
unit_cost_centsmoneyyesyesnono2500min_value=0; max_value=999999999Current unit cost
inventory_account_idtextnoyesnoyesACC-1300max_length=16Non-FK optional reference string; do not enforce FK existence
cogs_account_idtextnoyesnoyesACC-5000max_length=16Non-FK optional reference string; do not enforce FK existence
total_value_centsmoneynononono250000min_value=0; max_value=99999999999Subledger inventory balance
statusenumnononoyesactiveenum=[active, discontinued]SKU status
effective_attextnononoyes2026-01-11T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-11T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

LegalEntity (legal_entities, pk=legal_entity_id, list=GET /api/legal-entities, create=POST /api/legal-entities)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
legal_entity_idtextnonoyesyesauto:LE-####pattern=^LE-[0-9]{4}$Multi-subsidiary legal entity PK
entity_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{2,24}$Unique subsidiary code
legal_nametextyesyesnono``min_length=2; max_length=120Registered subsidiary name
functional_currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Functional reporting currency
jurisdictionenumnoyesnoyesUSenum=[US, DE, FR, GB, RS, CH]Statutory tax jurisdiction
aws_regiontextnoyesnoyesus-east-1pattern=^[a-z]{2}-[a-z]+-[0-9]+$EU VAT Art. 247 data residency pin
statusenumnononoyesactiveenum=[active, inactive]Legal entity operational state
created_attextnononoyes2026-01-05T08:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

IntercompanyTransfer (intercompany_transfers, pk=ic_transfer_id, list=GET /api/intercompany-transfers, create=POST /api/intercompany-transfers)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
ic_transfer_idtextnonoyesyesauto:ICT-####pattern=^ICT-[0-9]{4}$Intercompany elimination transfer PK
transfer_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique intercompany cross-charge ref
amount_centsmoneyyesyesnono50000min_value=1; max_value=99999999999Intercompany charge amount
from_entity_idtextnoyesnoyes``pattern=^LE-[0-9]{4}$Optional FK -> LegalEntity.legal_entity_id (REL-22)
to_entity_idtextnoyesnoyes``pattern=^LE-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
period_idtextnoyesnoyes``pattern=^PER-[0-9]{4}$Optional FK -> FiscalPeriod.period_id (REL-19)
currencyenumnoyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Transfer currency
statusenumnononoyesdraftenum=[draft, posted, eliminated, disputed]Elimination state (INV-STATE-07)
created_attextnononoyes2026-01-20T10:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

BudgetCommitment (budgets, pk=budget_id, list=GET /api/budgets, create=POST /api/budgets)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
budget_idtextnonoyesyesauto:BUD-####pattern=^BUD-[0-9]{4}$Cost-center budget commitment PK
budget_codetextyesyesyesyes``pattern=^[A-Z0-9_-]{3,32}$Unique budget line key
cost_centertextyesyesnoyesCC-GENpattern=^[A-Z0-9_-]{2,24}$Cost center code
allocated_centsmoneyyesyesnono500000min_value=1; max_value=99999999999Approved budget ceiling
period_idtextnoyesnoyes``pattern=^PER-[0-9]{4}$Optional FK -> FiscalPeriod.period_id (REL-20)
account_idtextnoyesnoyes``pattern=^ACC-[0-9]{4}$Optional FK -> Account.account_id (REL-21)
max_overrun_bpsintnoyesnono500min_value=0; max_value=2000Permitted tolerance (INV-CEIL-05 max 2000)
encumbered_centsmoneynononono0min_value=0; max_value=99999999999Committed encumbrances
statusenumnononoyesdraftenum=[draft, active, frozen]Budget lifecycle (INV-STATE-08)
created_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

EvidenceArtifact (evidence_artifacts, pk=artifact_id, list=GET /api/evidence-artifacts, create=POST /api/evidence-artifacts)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
artifact_idtextnonoyesyesauto:EVID-####pattern=^EVID-[0-9]{4}$S3 custody artifact PK
doc_classenumyesyesnoyesclose_binderenum=[close_binder, vat_invoice_xml, match_packet, sox_workpaper, contact_pii_export]Regulatory classification (contact_pii_export forbids Object Lock)
target_ref_idtextyesyesnoyes``min_length=3; max_length=64Non-FK optional reference string; do not enforce FK existence
file_nametextyesyesnoyes``min_length=3; max_length=120Artifact filename
size_bytesintnoyesnono1024min_value=1; max_value=10485760Payload size cap (INV-CEIL-06 10 MB)
object_lock_modeenumnoyesnoyesnoneenum=[none, governance, compliance]Selective S3 Object Lock mode
retention_daysintnoyesnono2555min_value=1; max_value=3650Statutory retention days (2555 = 7y)
legal_holdboolnoyesnonofalse``Litigation/audit hold lock
has_bytesboolnonononofalse``True once S3 object uploaded
sha256textnononoyes``max_length=64Verified S3 payload SHA-256
created_attextnononoyes2026-01-19T12:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once UTC timestamp

FxRate (fx_rates, pk=fx_rate_id, list=GET /api/fx-rates, create=POST /api/fx-rates)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
fx_rate_idtextnonoyesyesauto:FXRT-####pattern=^FXRT-[0-9]{4}$Dated FX rate PK
rate_keytextyesyesyesyes``min_length=4; max_length=64Idempotent natural key (INV-IDEMP-03)
from_currencyenumyesyesnoyesEURenum=[USD, EUR, GBP, RSD, CHF, JPY]Source currency
to_currencyenumyesyesnoyesUSDenum=[USD, EUR, GBP, RSD, CHF, JPY]Functional target currency
rate_microsintyesyesnono1085000min_value=1; max_value=1000000000Fixed-point FX rate (INV-CEIL-04 max 1000000000)
effective_datetextnoyesnoyes2026-01-15pattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}$Effective FX valuation date
effective_attextnononoyes2026-01-15T00:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-15T00:01:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

FxRevaluation (fx_revaluations, pk=reval_id, list=GET /api/fx-revaluations, create=POST /api/fx-revaluations)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
reval_idtextnonoyesyesauto:FXR-####pattern=^FXR-[0-9]{4}$Server-assigned immutable PK
period_idtextyesyesnoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
currencyenumyesyesnoyesEURenum=[USD, EUR, GBP, RSD, CHF, JPY]Revalued foreign currency
closing_fx_rate_microsintyesyesnono1085000min_value=1; max_value=1000000000Period-end closing FX rate in micros
dry_runboolnoyesnonofalse``Preview without posting GL entry
period_codetextnononoyes2026-01pattern=^[0-9]{4}-[0-9]{2}$Revaluation period code
unrealized_delta_centsmoneynononono0min_value=-99999999999; max_value=99999999999Signed unrealized FX adjustment (Signed Money)
journal_idtextnononoyes``pattern=^JE-[0-9]{4}$Non-FK optional reference string; do not enforce FK existence
effective_attextnononoyes2026-01-31T23:59:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-31T23:59:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal system stamp

AuditLog (audit_logs, pk=audit_id, list=GET /api/audit-logs, create=read_only)

FieldIR TypeRequiredCreateUniqueOne-WordDefault / InitialConstraints / Enum / PatternNotes
audit_idtextnonoyesyesauto:AUD-####pattern=^AUD-[0-9]{4}$Append-only audit entry PK
entity_typeenumyesnonoyesjournalenum=[account, period, close_task, tax_rate, journal, customer, invoice, credit_memo, revenue_schedule, vendor, vendor_bank_change, purchase_order, goods_receipt, bill, payment, bank_statement, fixed_asset, inventory, legal_entity, intercompany_transfer, budget, evidence, fx_rate, fx_reval, benford]Audited entity category
entity_idtextyesnonoyes``max_length=32Non-FK optional reference string; do not enforce FK existence
actor_roletextyesnonoyes``pattern=^[a-z_]+$Caller X-Role
actiontextyesnonoyes``pattern=^[a-z_]+$Mutating operation tag
benford_chi2_bpsintnononono0min_value=0; max_value=10000000Scaled Benford chi-square (155100 = 15.51)
anomaly_flaggedboolnonononofalse``Fraud/audit anomaly flag
prev_hashtextyesnonoyes``pattern=^[0-9a-f]{64}$Prior tenant hash or "0"*64 genesis
entry_hashtextyesnoyesyes``pattern=^[0-9a-f]{64}$SHA-256 hash chain digest
effective_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Bitemporal event stamp
recorded_attextnononoyes2026-01-10T09:00:00Zpattern=^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]{1,6})?Z$Write-once audit UTC stamp

§1.5b Explicit Entity Relations

All 22 creatable single-hop precondition-free FK links (From Entity holds Via FK, To Entity is the referenced parent; zero read_only children, exact §3-verbatim routes with zero ?query suffixes):

IDFrom EntityTo EntityVia FKParent Create RouteLink RouteReader RouteChild Create RouteChild Verify Route
REL-01JournalEntryFiscalPeriodperiod_idPOST /api/fiscal-periodsPOST /api/journalsGET /api/journalsPOST /api/journalsGET /api/journals
REL-02JournalLineJournalEntryjournal_idPOST /api/journalsPOST /api/journals/{journal_id}/linesGET /api/journals/{journal_id}/linesPOST /api/journals/{journal_id}/linesGET /api/journals/{journal_id}/lines
REL-03JournalLineAccountaccount_idPOST /api/accountsPOST /api/journals/{journal_id}/linesGET /api/journals/{journal_id}/linesPOST /api/journals/{journal_id}/linesGET /api/journals/{journal_id}/lines
REL-04TaxRateAccountliability_account_idPOST /api/accountsPOST /api/tax-ratesGET /api/tax-ratesPOST /api/tax-ratesGET /api/tax-rates
REL-05GoodsReceiptPurchaseOrderpo_idPOST /api/purchase-ordersPOST /api/goods-receiptsGET /api/goods-receiptsPOST /api/goods-receiptsGET /api/goods-receipts
REL-06CreditMemoInvoiceinvoice_idPOST /api/invoicesPOST /api/credit-memosGET /api/credit-memosPOST /api/credit-memosGET /api/credit-memos
REL-07PaymentAccountbank_account_idPOST /api/accountsPOST /api/paymentsGET /api/paymentsPOST /api/paymentsGET /api/payments
REL-08CloseTaskFiscalPeriodperiod_idPOST /api/fiscal-periodsPOST /api/close-tasksGET /api/close-tasksPOST /api/close-tasksGET /api/close-tasks
REL-09BankStatementLineAccountbank_account_idPOST /api/accountsPOST /api/bank-statementsGET /api/bank-statementsPOST /api/bank-statementsGET /api/bank-statements
REL-10VendorAccountap_account_idPOST /api/accountsPOST /api/vendorsGET /api/vendorsPOST /api/vendorsGET /api/vendors
REL-11VendorBankChangeVendorvendor_idPOST /api/vendorsPOST /api/vendor-bank-changesGET /api/vendor-bank-changesPOST /api/vendor-bank-changesGET /api/vendor-bank-changes
REL-12CustomerAccountar_account_idPOST /api/accountsPOST /api/customersGET /api/customersPOST /api/customersGET /api/customers
REL-13InvoiceCustomercustomer_idPOST /api/customersPOST /api/invoicesGET /api/invoicesPOST /api/invoicesGET /api/invoices
REL-14PurchaseOrderVendorvendor_idPOST /api/vendorsPOST /api/purchase-ordersGET /api/purchase-ordersPOST /api/purchase-ordersGET /api/purchase-orders
REL-15BillVendorvendor_idPOST /api/vendorsPOST /api/billsGET /api/billsPOST /api/billsGET /api/bills
REL-16RevenueScheduleInvoiceinvoice_idPOST /api/invoicesPOST /api/revenue-schedulesGET /api/revenue-schedulesPOST /api/revenue-schedulesGET /api/revenue-schedules
REL-17RevenueScheduleFiscalPeriodperiod_idPOST /api/fiscal-periodsPOST /api/revenue-schedulesGET /api/revenue-schedulesPOST /api/revenue-schedulesGET /api/revenue-schedules
REL-18RevenueObligationRevenueScheduleschedule_idPOST /api/revenue-schedulesPOST /api/revenue-schedules/{schedule_id}/obligationsGET /api/revenue-schedules/{schedule_id}/obligationsPOST /api/revenue-schedules/{schedule_id}/obligationsGET /api/revenue-schedules/{schedule_id}/obligations
REL-19IntercompanyTransferFiscalPeriodperiod_idPOST /api/fiscal-periodsPOST /api/intercompany-transfersGET /api/intercompany-transfersPOST /api/intercompany-transfersGET /api/intercompany-transfers
REL-20BudgetCommitmentFiscalPeriodperiod_idPOST /api/fiscal-periodsPOST /api/budgetsGET /api/budgetsPOST /api/budgetsGET /api/budgets
REL-21BudgetCommitmentAccountaccount_idPOST /api/accountsPOST /api/budgetsGET /api/budgetsPOST /api/budgetsGET /api/budgets
REL-22IntercompanyTransferLegalEntityfrom_entity_idPOST /api/legal-entitiesPOST /api/intercompany-transfersGET /api/intercompany-transfersPOST /api/intercompany-transfersGET /api/intercompany-transfers

§2. Tenancy & Probe-Ready Deterministic Seed Fixtures

CollectionAlpha CountBeta/Probe CountSequence KeyInitial CounterBoundary-Splitting Guarantee
accounts90ACC9ACC-1010 (1010 Cash, asset, active), ACC-1200 (1200 AR), ACC-1300 (1300 Inventory), ACC-1500 (1500 Equipment), ACC-1590 (1590 Accum Depr), ACC-2000 (2000 AP), ACC-4000 (4000 Revenue), ACC-5000 (5000 COGS), ACC-8010 (8010 FX Gain/Loss)
fiscal_periods30PER3PER-0001 (2025-12, closed for reopen), PER-0002 (2026-01, open default), PER-0003 (2026-02, open for close)
close_tasks30CTSK3CTSK-0001 (open for start), CTSK-0002 (in_progress for signoff), CTSK-0003 (open for waive)
tax_rates20TAX2TAX-0001 (US_CA_825, US_STATE, 825 bps, active=true), TAX-0002 (EU_DE_VAT, EU_VAT, 1900 bps, active=false)
journals30JE3JE-0001 (posted, gl_manual, 50000/50000), JE-0002 (posted, 25000/25000 for reverse), JE-0003 (posted, ar_subledger, 15000/15000 for void)
journal_lines60JEL6JEL-0001/0002 (JE-0001), JEL-0003/0004 (JE-0002), JEL-0005/0006 (JE-0003), sum(debits) == sum(credits) == 90000
customers30CUST3CUST-0042 (active, dunning_paused=false), CUST-0001 (active for credit-hold), CUST-0002 (credit_hold, dunning_paused=true)
invoices40INV4INV-0042 (CUST-0042, unpaid legacy pin), INV-0001 (draft for send), INV-0002 (unpaid EUR for pay), INV-0003 (draft for void)
credit_memos20CM2CM-0001 (ar_credit_memo, -2500, draft for apply), CM-0002 (ap_debit_memo, -1500, applied)
revenue_schedules30REV3REV-0001 (asc_606, active, 120000 for recognize), REV-0002 (ifrs_15, active, 80000 for pause), REV-0003 (asc_606, paused, 60000)
revenue_obligations40POB4POB-0001 (7500 bps, 90000), POB-0002 (2500 bps, 30000), POB-0003 (10000 bps, 80000), POB-0004 (REV-0003 for DELETE)
vendors30VEND3VEND-0007 (active, payment_hold=false), VEND-0008 (active for hold), VEND-0009 (on_hold, ers_enabled=true for archive)
vendor_bank_changes30VBC3VBC-0001 (VEND-0007, pending for confirm), VBC-0002 (VEND-0008, confirmed for approve), VBC-0003 (VEND-0009, pending for reject)
purchase_orders20PO2PO-0001 (open, VEND-0007, 100 bps), PO-0002 (received, VEND-0009, 200 bps)
goods_receipts20GRN2GRN-0001 (PO-0002, accepted), GRN-0002 (PO-0001, quarantined)
bills40BILL4BILL-0007 (VEND-0007, unpaid, ap_clerk_1), BILL-0001 (draft, matched for approve), BILL-0002 (variance_hold, variance_blocked for override-match), BILL-0003 (approved for pay)
payments20PAY2PAY-0001 (ar_receipt, USD, settled), PAY-0002 (ap_disbursement, EUR, fx_gain_loss_cents=450, settled)
bank_statements30BNK3BNK-0001 (unmatched, camt_053, +50000 for match), BNK-0002 (matched, mt940, -25000 for reconcile), BNK-0003 (unmatched, bai2, +10000 for exclude)
fixed_assets20FA2FA-0001 (machinery, straight_line, active for depreciate), FA-0002 (it_equipment, double_declining, active for dispose)
inventory_items20SKU2SKU-0001 (fifo, 100 units), SKU-0002 (weighted_avg, 50 units)
legal_entities20LE2LE-0001 (US-HQ, USD, us-east-1, active), LE-0002 (DE-SUB, EUR, eu-central-1, inactive)
intercompany_transfers30ICT3ICT-0001 (draft for post), ICT-0002 (posted for eliminate), ICT-0003 (draft for dispute)
budgets30BUD3BUD-0001 (draft, CC-ENG for activate), BUD-0002 (active, CC-OPS for encumber), BUD-0003 (active, CC-FIN for freeze)
evidence_artifacts20EVID2EVID-0001 (close_binder, governance, legal_hold=false), EVID-0002 (vat_invoice_xml, none, legal_hold=true)
fx_rates20FXRT2FXRT-0001 (EUR->USD, 1085000, 2026-01-15), FXRT-0002 (GBP->USD, 1270000, 2026-01-20)
fx_revaluations20FXR2FXR-0001 (EUR, 2026-01), FXR-0002 (GBP, 2026-01)
audit_logs20AUD2Contiguous hash-chained genesis (AUD-0001 prev_hash="0"*64, AUD-0002 prev_hash=AUD-0001.entry_hash)

§3. Unrolled REST Route Contract

All GET routes are strictly write-free (QG-READ-IDEMP), default DEFAULT_LIST_LIMIT = 200 (1 <= limit <= 500), slice via ?offset=0 (>= 0), emit X-Total-Count, X-Limit, and X-Offset, and reject invalid pagination with 400 invalid_limit / 400 invalid_offset.

#MethodPathFacadeRequest Body / QueryResponseErrors
1GET/health(exempt zero-RPC)(none)200 {"status": "ok", "app": "AIcentricERP", "engine": "offstack"}(none)
2GET/(exempt static SPA)(none)200 text/html (frontend/dist/index.html)(none)
3GET/api/time-axisget_time_axis_overview(none)200 bitemporal bounds dictmissing_corp, missing_role, invalid_role, sim_unavailable
4GET/api/audit-logslist_audit_logs?entity_type&action&anomaly_only&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
5GET/api/accountslist_accounts?account_type&status&currency&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
6POST/api/accountscreate_account{code, name, account_type, normal_balance, currency?, is_control_account?, allow_manual_posting?}201 Account / 200 replayinvalid_field, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
7GET/api/accounts/{account_id}get_account?as_of&as_known_at200 Accountinvalid_timestamp, account_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
8PATCH/api/accounts/{account_id}update_account{name?, allow_manual_posting?}200 Account + AUDinvalid_field, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
9POST/api/accounts/{account_id}/archivearchive_account{}200 archived Account + AUDunarchivable_account, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
10GET/api/fiscal-periodslist_fiscal_periods?status&period_code&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
11POST/api/fiscal-periodscreate_fiscal_period{period_code, start_date, end_date, close_checklist_complete?}201 FiscalPeriod + AUDinvalid_field, invalid_period_transition, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
12GET/api/fiscal-periods/{period_id}get_fiscal_period?as_of&as_known_at200 FiscalPeriodinvalid_timestamp, period_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
13POST/api/fiscal-periods/{period_id}/closeclose_fiscal_period{}200 closed FiscalPeriod + S3 binder + AUDclosed_period, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, blob_unavailable, sim_unavailable
14POST/api/fiscal-periods/{period_id}/reopenreopen_fiscal_period{reason}200 reopened FiscalPeriod + AUDinvalid_period_transition, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
15GET/api/close-taskslist_close_tasks?period_id&owner_role&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
16POST/api/close-taskscreate_close_task{task_code, title, period_id, owner_role?, sequence_order?}201 CloseTask + AUDinvalid_field, period_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
17POST/api/close-tasks/{close_task_id}/startstart_close_task{}200 in_progress CloseTask + AUDinvalid_state_transition, close_task_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
18POST/api/close-tasks/{close_task_id}/signoffsignoff_close_task{signed_off_by?}200 signed_off CloseTask + AUDinvalid_state_transition, close_task_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
19POST/api/close-tasks/{close_task_id}/waivewaive_close_task{reason?}200 waived CloseTask + AUDinvalid_state_transition, close_task_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
20GET/api/tax-rateslist_tax_rates?jurisdiction&tax_type&active&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
21POST/api/tax-ratescreate_tax_rate{tax_code, jurisdiction, tax_type, rate_bps, liability_account_id, active?}201 TaxRate + AUDinvalid_field, invalid_tax_rate, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
22POST/api/tax-rates/{tax_rate_id}/toggletoggle_tax_rate{active}200 TaxRate + AUDinvalid_field, tax_rate_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
23GET/api/journalslist_journals?status&period_code&source_module&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
24POST/api/journalsrecord_journal{period_id, posting_date, description, total_debit_cents, total_credit_cents, currency?, fx_rate_micros?, reference?, source_module?, lines?}201 JournalEntry + AUDinvalid_field, unbalanced_journal, closed_period, period_not_found, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
25GET/api/journals/{journal_id}get_journal?as_of&as_known_at200 JournalEntryinvalid_timestamp, journal_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
26POST/api/journals/{journal_id}/reversereverse_journal{reason?, posting_date?}200 reversing JournalEntry + AUDunvoidable_journal, closed_period, journal_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
27POST/api/journals/{journal_id}/voidvoid_journal{reason?}200 voided JournalEntry + AUDunvoidable_journal, journal_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
28GET/api/journals/{journal_id}/lineslist_journal_lines?account_id&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, journal_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
29POST/api/journals/{journal_id}/linesadd_journal_line{account_id, debit_cents?, credit_cents?, signed_amount_cents, allocation_bps?, tax_rate_id?, memo?}201 JournalLine + AUDinvalid_field, unbalanced_journal, allocation_exceeds_10000_bps, journal_not_found, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
30GET/api/customerslist_customers?status&dunning_paused&customer_code&limit=200&offset=0200 list[dict] (PII masked for viewer/auditor)invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
31POST/api/customerscreate_customer{customer_code, legal_name, billing_email, billing_address, credit_limit_cents?, ar_account_id?, dunning_paused?}201 Customer + AUDinvalid_field, invalid_customer, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
32GET/api/customers/{customer_id}get_customer(none)200 Customercustomer_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
33PATCH/api/customers/{customer_id}update_customer{legal_name?, billing_email?, billing_address?, credit_limit_cents?}200 Customer + AUDinvalid_field, invalid_customer, customer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
34POST/api/customers/{customer_id}/credit-holdtoggle_customer_credit_hold{hold_active?}200 Customer + AUDcustomer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
35POST/api/customers/{customer_id}/dunning-pausetoggle_dunning_pause{dunning_paused?}200 Customer + AUDcustomer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
36GET/api/invoiceslist_invoices?status&customer_id&currency&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
37POST/api/invoicesissue_invoice{invoice_number, customer_name, customer_email, billing_address, due_date, subtotal_cents, customer_id?, tax_rate_id?, currency?, fx_rate_micros?, payment_terms?, ar_account_id?, revenue_account_id?}201 Invoice + AUDinvalid_field, customer_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
38GET/api/invoices/{invoice_id}get_invoice?as_of&as_known_at200 Invoice (PII masked for viewer/auditor)invalid_timestamp, invoice_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
39POST/api/invoices/{invoice_id}/sendsend_invoice{}200 unpaid Invoice + AUDinvalid_state_transition, invoice_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
40POST/api/invoices/{invoice_id}/paypay_invoice{bank_account_id?, amount_cents?, settlement_fx_rate_micros?, payment_method?, idempotency_key?}200 paid Invoice + PAY + AUDunpayable_invoice, closed_period, invoice_not_found, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
41POST/api/invoices/{invoice_id}/voidvoid_invoice{reason?}200 voided Invoice + AUDinvalid_state_transition, invoice_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
42GET/api/credit-memoslist_credit_memos?doc_kind&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
43POST/api/credit-memoscreate_credit_memo{memo_number, doc_kind, adjustment_cents, reason, invoice_id?, bill_id?, tax_adjustment_cents?}201 CreditMemo + AUDinvalid_field, invoice_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
44POST/api/credit-memos/{credit_memo_id}/applyapply_credit_memo{}200 applied CreditMemo + AUDinvalid_state_transition, credit_memo_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
45GET/api/revenue-scheduleslist_revenue_schedules?status&standard_mode&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
46POST/api/revenue-schedulescreate_revenue_schedule{contract_ref, total_contract_cents, standard_mode?, invoice_id?, period_id?, deferred_account_id?}201 RevenueSchedule + AUDinvalid_field, invoice_not_found, period_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
47GET/api/revenue-schedules/{schedule_id}get_revenue_schedule(none)200 RevenueSchedule + obligationsschedule_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
48POST/api/revenue-schedules/{schedule_id}/recognizerecognize_revenue_period{recognize_cents, period_id?}200 RevenueSchedule + JE + AUDinvalid_field, invalid_state_transition, closed_period, schedule_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
49POST/api/revenue-schedules/{schedule_id}/pausepause_revenue_schedule{reason?}200 paused RevenueSchedule + AUDinvalid_state_transition, schedule_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
50GET/api/revenue-schedules/{schedule_id}/obligationslist_revenue_obligations?satisfaction_method&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, schedule_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
51POST/api/revenue-schedules/{schedule_id}/obligationsadd_revenue_obligation{obligation_code, description, satisfaction_method?, allocation_bps, allocated_cents}201 RevenueObligation + AUDinvalid_field, allocation_mismatch, allocation_exceeds_10000_bps, schedule_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
52DELETE/api/revenue-schedules/{schedule_id}/obligations/{obligation_id}delete_revenue_obligation(none)200 {"deleted": true}schedule_not_found, obligation_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
53GET/api/vendorslist_vendors?status&payment_hold&vendor_code&limit=200&offset=0200 list[dict] (PII masked for viewer/auditor)invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
54POST/api/vendorscreate_vendor{vendor_code, legal_name, contact_email, tax_id, bank_iban?, ap_account_id?, payment_hold?, ers_enabled?}201 Vendor + AUDinvalid_field, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
55GET/api/vendors/{vendor_id}get_vendor(none)200 Vendorvendor_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
56PATCH/api/vendors/{vendor_id}update_vendor{legal_name?, contact_email?, ers_enabled?}200 Vendor + AUDinvalid_field, vendor_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
57POST/api/vendors/{vendor_id}/holdtoggle_vendor_hold{payment_hold?}200 Vendor + AUDvendor_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
58POST/api/vendors/{vendor_id}/archivearchive_vendor{}200 archived Vendor + AUDinvalid_state_transition, vendor_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
59GET/api/vendor-bank-changeslist_vendor_bank_changes?status&vendor_id&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
60POST/api/vendor-bank-changescreate_vendor_bank_change{vendor_id, new_iban, requester_actor_id?}201 VendorBankChange + AUDinvalid_field, vendor_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
61POST/api/vendor-bank-changes/{bank_change_id}/confirmconfirm_vendor_bank_change{}200 confirmed VendorBankChange + AUDinvalid_state_transition, bank_change_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
62POST/api/vendor-bank-changes/{bank_change_id}/approveapprove_vendor_bank_change{approver_actor_id}200 approved VendorBankChange + AUDsod_violation, invalid_state_transition, bank_change_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
63POST/api/vendor-bank-changes/{bank_change_id}/rejectreject_vendor_bank_change{reason?}200 rejected VendorBankChange + AUDinvalid_state_transition, bank_change_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
64GET/api/purchase-orderslist_purchase_orders?status&vendor_id&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
65POST/api/purchase-orderscreate_purchase_order{po_number, vendor_name, expected_qty, unit_price_cents, vendor_id?, currency?, tolerance_bps?}201 PurchaseOrder + AUDinvalid_field, invalid_purchase_order, vendor_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
66GET/api/purchase-orders/{po_id}get_purchase_order?as_of&as_known_at200 PurchaseOrderinvalid_timestamp, po_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
67POST/api/purchase-orders/{po_id}/cancelcancel_purchase_order{reason?}200 cancelled PurchaseOrder + AUDinvalid_state_transition, po_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
68GET/api/goods-receiptslist_goods_receipts?po_id&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
69POST/api/goods-receiptsrecord_goods_receipt{receipt_number, po_id, received_qty, received_value_cents, warehouse_code?}201 GoodsReceipt + AUDinvalid_field, po_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
70GET/api/billslist_bills?status&match_status&vendor_id&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
71POST/api/billsrecord_bill{bill_number, vendor_contact_email, vendor_tax_id, due_date, subtotal_cents, vendor_id?, po_id?, receipt_id?, tax_rate_id?, currency?, fx_rate_micros?, created_by_actor?}201 Bill + AUDinvalid_field, vendor_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
72GET/api/bills/{bill_id}get_bill?as_of&as_known_at200 Bill (PII masked for viewer/auditor)invalid_timestamp, bill_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
73POST/api/bills/{bill_id}/approveapprove_bill{approver_actor}200 approved Bill + AUDsod_violation, invalid_state_transition, bill_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
74POST/api/bills/{bill_id}/override-matchoverride_bill_match{approver_actor, override_reason}200 override_approved Bill + AUDsod_violation, invalid_state_transition, bill_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
75POST/api/bills/{bill_id}/paypay_bill{bank_account_id?, amount_cents?, settlement_fx_rate_micros?, payment_method?, idempotency_key?}200 paid Bill + PAY + AUDunpayable_bill, closed_period, bill_not_found, account_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
76GET/api/paymentslist_payments?direction&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
77POST/api/paymentsrecord_payment{idempotency_key, direction, bank_account_id, amount_cents, invoice_id?, bill_id?, settlement_currency?, settlement_fx_rate_micros?, payment_method?}201 Payment / 200 idempotent replayinvalid_field, closed_period, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
78GET/api/payments/{payment_id}get_payment?as_of&as_known_at200 Paymentinvalid_timestamp, payment_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
79POST/api/payments/{payment_id}/reversereverse_payment{reason?}200 reversed Payment + AUDinvalid_state_transition, closed_period, payment_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
80GET/api/bank-statementslist_bank_statements?status&bank_account_id&format_kind&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
81POST/api/bank-statementsimport_bank_statement_line{idempotency_key, bank_account_id, statement_date, amount_cents, format_kind?, reference_text?}201 BankStatementLine / 200 replayinvalid_field, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
82POST/api/bank-statements/{statement_line_id}/matchmatch_bank_line{payment_id?}200 matched BankStatementLine + AUDinvalid_state_transition, statement_line_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
83POST/api/bank-statements/{statement_line_id}/reconcilereconcile_bank_line{}200 reconciled BankStatementLine + AUDinvalid_state_transition, statement_line_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
84POST/api/bank-statements/{statement_line_id}/excludeexclude_bank_line{reason?}200 excluded BankStatementLine + AUDinvalid_state_transition, statement_line_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
85GET/api/fixed-assetslist_fixed_assets?asset_class&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
86POST/api/fixed-assetsregister_fixed_asset{asset_tag, asset_name, asset_class, acquisition_date, cost_cents, salvage_value_cents, useful_life_months, depreciation_method?, asset_account_id?, accum_depr_account_id?, expense_account_id?}201 FixedAsset + AUDinvalid_field, invalid_fixed_asset, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
87POST/api/fixed-assets/{asset_id}/depreciaterun_asset_depreciation{period_id}200 FixedAsset + JE + AUDinvalid_fixed_asset, closed_period, asset_not_found, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
88POST/api/fixed-assets/{asset_id}/disposedispose_fixed_asset{proceeds_cents, period_id}200 disposed FixedAsset + JE + AUDinvalid_state_transition, closed_period, asset_not_found, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
89GET/api/inventorylist_inventory_items?valuation_method&status&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
90POST/api/inventorycreate_inventory_item{sku_code, item_name, valuation_method, quantity_on_hand, unit_cost_cents, inventory_account_id?, cogs_account_id?}201 InventoryValuation + AUDinvalid_field, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
91POST/api/inventory/{sku_id}/adjustadjust_inventory_valuation{qty_delta, unit_cost_cents, reason, period_id}200 InventoryValuation + JE + AUDinsufficient_inventory, closed_period, sku_not_found, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
92GET/api/legal-entitieslist_legal_entities?functional_currency&status&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
93POST/api/legal-entitiescreate_legal_entity{entity_code, legal_name, functional_currency?, jurisdiction?, aws_region?}201 LegalEntity + AUDinvalid_field, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
94POST/api/legal-entities/{legal_entity_id}/toggletoggle_legal_entity{active?}200 LegalEntity + AUDlegal_entity_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
95GET/api/intercompany-transferslist_intercompany_transfers?status&period_id&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
96POST/api/intercompany-transferscreate_intercompany_transfer{transfer_code, amount_cents, from_entity_id?, to_entity_id?, period_id?, currency?}201 IntercompanyTransfer + AUDinvalid_field, legal_entity_not_found, period_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
97GET/api/intercompany-transfers/{ic_transfer_id}get_intercompany_transfer(none)200 IntercompanyTransferic_transfer_not_found, missing_corp, missing_role, invalid_role, sim_unavailable
98POST/api/intercompany-transfers/{ic_transfer_id}/postpost_intercompany_transfer{}200 posted IntercompanyTransfer + AUDinvalid_state_transition, ic_transfer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
99POST/api/intercompany-transfers/{ic_transfer_id}/eliminateeliminate_intercompany_transfer{}200 eliminated IntercompanyTransfer + AUDinvalid_state_transition, ic_transfer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
100POST/api/intercompany-transfers/{ic_transfer_id}/disputedispute_intercompany_transfer{reason?}200 disputed IntercompanyTransfer + AUDinvalid_state_transition, ic_transfer_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
101GET/api/budgetslist_budgets?status&cost_center&period_id&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
102POST/api/budgetscreate_budget{budget_code, cost_center, allocated_cents, period_id?, account_id?, max_overrun_bps?}201 BudgetCommitment + AUDinvalid_field, invalid_budget, period_not_found, account_not_found, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
103POST/api/budgets/{budget_id}/activateactivate_budget{}200 active BudgetCommitment + AUDinvalid_state_transition, budget_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
104POST/api/budgets/{budget_id}/encumberencumber_budget{amount_cents}200 BudgetCommitment + AUDinvalid_field, invalid_state_transition, budget_exceeded, budget_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
105POST/api/budgets/{budget_id}/freezefreeze_budget{}200 frozen BudgetCommitment + AUDinvalid_state_transition, budget_not_found, missing_corp, missing_role, invalid_role, insufficient_role, sim_unavailable
106GET/api/evidence-artifactslist_evidence_artifacts?doc_class&object_lock_mode&legal_hold&limit=200&offset=0200 list[dict]invalid_limit, invalid_offset, missing_corp, missing_role, invalid_role, sim_unavailable
107POST/api/evidence-artifactscreate_evidence_artifact{doc_class, target_ref_id, file_name, size_bytes?, object_lock_mode?, retention_days?, legal_hold?}201 EvidenceArtifact + AUDinvalid_field, invalid_evidence, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
108PUT/api/evidence-artifacts/{artifact_id}/contentupload_evidence_bytesraw bytes (<= 10 MB)200 EvidenceArtifact + sha256 + AUDinvalid_evidence, artifact_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, blob_unavailable, sim_unavailable
109GET/api/evidence-artifacts/{artifact_id}/contentdownload_evidence_bytes(none)200 raw bytes (QG-READ-IDEMP)artifact_not_found, missing_corp, missing_role, invalid_role, blob_unavailable, sim_unavailable
110POST/api/evidence-artifacts/{artifact_id}/legal-holdtoggle_evidence_legal_hold{legal_hold?}200 EvidenceArtifact + AUDartifact_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
111GET/api/fx-rateslist_fx_rates?from_currency&to_currency&effective_date&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
112POST/api/fx-ratesupsert_fx_rate{rate_key, from_currency, to_currency, rate_micros, effective_date?}201 FxRate / 200 replay + AUDinvalid_field, invalid_fx_rate, duplicate_key, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
113GET/api/fx-revaluationslist_fx_revaluations?period_code&currency&limit=200&offset=0&as_of&as_known_at200 list[dict]invalid_limit, invalid_offset, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
114POST/api/fx-revaluationsrun_fx_revaluation{period_id, currency, closing_fx_rate_micros, dry_run?}201 FxRevaluation / 200 dry-runinvalid_field, closed_period, period_not_found, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable
115GET/api/reports/trial-balanceget_trial_balance?period_code&as_of&as_known_at200 bitemporal TrialBalanceinvalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
116GET/api/reports/agingget_aging_report?ledger_side=ar&as_of&as_known_at200 bitemporal AR/AP aging bucketsinvalid_field, invalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
117GET/api/reports/tax-summaryget_tax_summary?period_code&as_of&as_known_at200 jurisdiction VAT/Sales Tax summaryinvalid_timestamp, missing_corp, missing_role, invalid_role, sim_unavailable
118POST/api/audit/benfordrun_benford_audit{period_code?}200 Benford chi-square summary + AUDinvalid_field, missing_corp, missing_role, invalid_role, insufficient_role, payload_too_large, sim_unavailable

§4. Authorization Precedence, RBAC & Production Hardening

§4.0 Check Precedence

1. Exempt (#1, #2, /js/*, /css/*, /static/vendor/*) -> 2. URL-decode + posixpath.normpath() + route match (404 route_not_found) + FORCE_HTTPS=true (426 upgrade_required) -> 3. Pre-read Content-Length cap (400 invalid_content_length / 413 payload_too_large BEFORE rfile.read()) -> 4. Bounded concurrency (503 service_busy + Retry-After) -> 5. Tiered token-bucket rate limit (429 rate_limited + Retry-After) -> 6. AUTH_MODE=jwt HS256 verification (401 unauthorized) -> 7. X-Corp-Id tenancy check (403 missing_corp) -> 8. X-Role presence (403 missing_role on omitted/empty X-Role — NEVER defaults to owner or any privileged role) -> 9. Valid closed role check (403 invalid_role) -> 10. RBAC route matrix check (403 insufficient_role) -> 11. Input validation, SoD, period lock & double-entry invariants (400/404/409) -> 12. Hash-chained AUD-#### append (mutating ops only).

(HS256 AUTH_MODE=jwt & /{pk} Precedence: verified HS256 Authorization: Bearer tokens supply corp/role claims even when X-Corp-Id/X-Role headers are omitted, while empty JWT_SECRET fails closed 401/403; on /{pk} routes, resolve 404 <entity>_not_found BEFORE body 400 missing_required validation.)

§4.1 Exhaustive Disjoint Role × Route RBAC Matrix

Exempt (Auth/Corp/Role Bypass): #1, #2, /js/*, /css/*, /static/vendor/*. Every protected /api/* request with omitted or empty X-Role returns 403 missing_role.

Route GroupRoutes (#)Allowed RolesDenied / Notes
Standard Ledger, Subledger, Evidence & Bitemporal Report Reads#3, #5, #7, #10, #12, #15, #20, #23, #25, #28, #30, #32, #36, #38, #42, #45, #47, #50, #53, #55, #59, #64, #66, #68, #70, #72, #76, #78, #80, #85, #89, #92, #95, #97, #101, #106, #109, #111, #113, #115, #116, #117owner, erp_admin, controller, gl_accountant, ar_clerk, ap_clerk, auditor, viewerOmitted X-Role -> 403 missing_role; viewer/auditor see masked PII
General Ledger, Tax, Assets, Inventory, FX, Intercompany, Close Tasks & Budgets#6, #8, #9, #16, #17, #21, #22, #24, #26, #27, #29, #86, #87, #88, #90, #91, #96, #98, #100, #102, #104, #112, #114owner, erp_admin, controller, gl_accountantar_clerk, ap_clerk, auditor, viewer -> 403 insufficient_role
Accounts Receivable Customers, Invoices, Credit Memos & ASC 606 Revenue#31, #33, #34, #35, #37, #39, #40, #41, #43, #44, #46, #48, #49, #51, #52owner, erp_admin, controller, gl_accountant, ar_clerkap_clerk, auditor, viewer -> 403 insufficient_role
Vendors, Procurement POs, Goods Receipts, AP Bills, Cash & Bank Feeds#54, #56, #57, #60, #61, #65, #67, #69, #71, #75, #77, #79, #81, #82, #83, #84owner, erp_admin, controller, gl_accountant, ap_clerkar_clerk, auditor, viewer -> 403 insufficient_role
SOX 404 Governance: Period Close, Task Signoff/Waive, AP/Bank SoD, Intercompany Elim, Budgets & Custody#11, #13, #14, #18, #19, #58, #62, #63, #73, #74, #93, #94, #99, #103, #105, #107, #108, #110, #118owner, erp_admin, controllergl_accountant, ar_clerk, ap_clerk, auditor, viewer -> 403 insufficient_role; creator cannot self-approve (400 sod_violation)
Sensitive Tamper-Evident Audit Ledger Read#4owner, erp_admin, controller, auditorRestricted strictly to admin_roles; gl_accountant, ar_clerk, ap_clerk, viewer -> 403 insufficient_role

(Disjoint Partition Check: union covers #3..#118 (116 routes) with zero overlap and zero unmapped routes; Exempt = {#1, #2}.)

§4.2 Security, Privacy & Compliance Hardening


§5. Infrastructure & Enabling Services

§5.1 Offstack Enabling Infrastructure Contract (app/offstack_store.py)

PROMINENT BUILDER DIRECTIVE: toolkits/offstack/docs/OFFSTACK_AI_MANUAL.txt (~4K tokens covering 75 AWS services / 4,512 operations) is ALWAYS available during build and verification. Read [CONNECT], [RDBMS], [AUTH_TENANCY], [SERVICES_ALL_75], [NOT_IN_OFFSTACK], and [HIGH_IMPACT_GOTCHAS] before writing or modifying app/offstack_store.py.

Verified Offstack Services Map (Core + Verified Extended)

AWS ServiceTierResource / PrefixPurpose
DynamoDBCore27 erp_* domain tables + erp_sequences28 tenant-partitioned tables (PK=corp_id), TransactWriteItems atomic journal+balance commits, GSI1–GSI3 indexes, atomic erp_sequences
S3Coreerp-close-archivesSelective Object Lock snapshots (close_binder, vat_invoice_xml, match_packet, sox_workpaper), tax exports, and SOX audit seal archives
Secrets ManagerCoreaicentricerp/jwt-hmac, aicentricerp/pii-envelopeHS256 JWT secret & PII field encryption key storage/rotation
SQSExtendedaicentricerp-subledger-events, aicentricerp-posting-dlqAsync subledger posting queue & dead-letter recovery for failed batch jobs
SNSExtendedaicentricerp-audit-alertsBenford's Law anomaly (chi2 > 15.51), variance_hold, and vendor bank-change escalation alerts
EventBridgeExtendedaicentricerp-close-busPeriod close, depreciation batch, ASC 606 recognition, and FX revaluation domain events
SSMExtended/aicentricerp/config/*Non-secret statutory retention windows, tolerance_bps defaults, and FX precision settings
KMSExtendedalias/aicentricerp-pii-keyEnvelope encryption keys for security.pii_fields and close binder SHA-256 signing

(Zero [NOT_IN_OFFSTACK] services declared: ec2, ecs, eks, docdb, sagemaker*, bedrock*, inspector2 are strictly absent.)

§5.2 Optional AI Gateway Integration

Autonomous Benford anomaly explanations and month-end variance triage route strictly through ArtificialIntelligenceOptimizer (aioptimizer) resolved dynamically from AIO_BASE_URL (http://127.0.0.1:14787) or %LOCALAPPDATA%\ArtificialIntelligenceOptimizer\aioptimizer.json using explicit pinned model slugs (x-aio-pin-model: 1) and zero hardcoded model auto-routing.


§6. Frontend Architecture, Theme & DF3 DOM Determinism


§7. IR-Aligned UI Surface Contracts

§7.1 Actions (ActionSpec)

IDEntityActionRouteEffectButton Label
ACT-01Accountupdate_accountPATCH /api/accounts/{account_id}sets name, allow_manual_postingSave Account
ACT-02Accountarchive_accountPOST /api/accounts/{account_id}/archivesets status='archived'Archive Account
ACT-03FiscalPeriodclose_fiscal_periodPOST /api/fiscal-periods/{period_id}/closesets status='closed'Close Period
ACT-04FiscalPeriodreopen_fiscal_periodPOST /api/fiscal-periods/{period_id}/reopensets status='soft_closed'Reopen Period
ACT-05CloseTaskstart_close_taskPOST /api/close-tasks/{close_task_id}/startsets status='in_progress'Start Close Task
ACT-06CloseTasksignoff_close_taskPOST /api/close-tasks/{close_task_id}/signoffsets status='signed_off', signed_off_bySign Off Task
ACT-07CloseTaskwaive_close_taskPOST /api/close-tasks/{close_task_id}/waivesets status='waived'Waive Close Task
ACT-08TaxRatetoggle_tax_ratePOST /api/tax-rates/{tax_rate_id}/togglesets active=true or falseToggle Tax Rate
ACT-09JournalEntryreverse_journalPOST /api/journals/{journal_id}/reversesets status='reversed'Reverse Journal
ACT-10JournalEntryvoid_journalPOST /api/journals/{journal_id}/voidsets status='voided'Void Journal
ACT-11Customerupdate_customerPATCH /api/customers/{customer_id}sets legal_name, billing_email, billing_address, credit_limit_centsSave Customer
ACT-12Customertoggle_customer_credit_holdPOST /api/customers/{customer_id}/credit-holdsets status='credit_hold' or 'active'Toggle Credit Hold
ACT-13Customertoggle_dunning_pausePOST /api/customers/{customer_id}/dunning-pausesets dunning_paused=true or falseToggle Dunning Pause
ACT-14Invoicesend_invoicePOST /api/invoices/{invoice_id}/sendsets status='unpaid'Send Invoice
ACT-15Invoicepay_invoicePOST /api/invoices/{invoice_id}/paysets status='paid'Pay Invoice
ACT-16Invoicevoid_invoicePOST /api/invoices/{invoice_id}/voidsets status='voided'Void Invoice
ACT-17CreditMemoapply_credit_memoPOST /api/credit-memos/{credit_memo_id}/applysets status='applied'Apply Credit Memo
ACT-18RevenueSchedulerecognize_revenue_periodPOST /api/revenue-schedules/{schedule_id}/recognizesets recognized_cents, statusRecognize Revenue
ACT-19RevenueSchedulepause_revenue_schedulePOST /api/revenue-schedules/{schedule_id}/pausesets status='paused'Pause Schedule
ACT-20RevenueObligationdelete_revenue_obligationDELETE /api/revenue-schedules/{schedule_id}/obligations/{obligation_id}removes RevenueObligation without counter rewindRemove Obligation
ACT-21Vendorupdate_vendorPATCH /api/vendors/{vendor_id}sets legal_name, contact_email, ers_enabledSave Vendor
ACT-22Vendortoggle_vendor_holdPOST /api/vendors/{vendor_id}/holdsets payment_hold=true or falseToggle Payment Hold
ACT-23Vendorarchive_vendorPOST /api/vendors/{vendor_id}/archivesets status='archived'Archive Vendor
ACT-24VendorBankChangeconfirm_vendor_bank_changePOST /api/vendor-bank-changes/{bank_change_id}/confirmsets status='confirmed'Confirm Bank Change
ACT-25VendorBankChangeapprove_vendor_bank_changePOST /api/vendor-bank-changes/{bank_change_id}/approvesets status='approved', approver_actor_idApprove Bank Change
ACT-26VendorBankChangereject_vendor_bank_changePOST /api/vendor-bank-changes/{bank_change_id}/rejectsets status='rejected'Reject Bank Change
ACT-27PurchaseOrdercancel_purchase_orderPOST /api/purchase-orders/{po_id}/cancelsets status='cancelled'Cancel PO
ACT-28Billapprove_billPOST /api/bills/{bill_id}/approvesets status='approved'Approve Bill
ACT-29Billoverride_bill_matchPOST /api/bills/{bill_id}/override-matchsets match_status='override_approved'Override Match Hold
ACT-30Billpay_billPOST /api/bills/{bill_id}/paysets status='paid'Pay Bill
ACT-31Paymentreverse_paymentPOST /api/payments/{payment_id}/reversesets status='reversed'Reverse Payment
ACT-32BankStatementLinematch_bank_linePOST /api/bank-statements/{statement_line_id}/matchsets status='matched', matched_payment_idMatch Bank Line
ACT-33BankStatementLinereconcile_bank_linePOST /api/bank-statements/{statement_line_id}/reconcilesets status='reconciled'Reconcile Bank Line
ACT-34BankStatementLineexclude_bank_linePOST /api/bank-statements/{statement_line_id}/excludesets status='excluded'Exclude Bank Line
ACT-35FixedAssetrun_asset_depreciationPOST /api/fixed-assets/{asset_id}/depreciatesets accumulated_depreciation_cents, net_book_value_centsRun Depreciation
ACT-36FixedAssetdispose_fixed_assetPOST /api/fixed-assets/{asset_id}/disposesets status='disposed'Dispose Asset
ACT-37InventoryValuationadjust_inventory_valuationPOST /api/inventory/{sku_id}/adjustsets quantity_on_hand, total_value_centsAdjust Valuation
ACT-38LegalEntitytoggle_legal_entityPOST /api/legal-entities/{legal_entity_id}/togglesets status='active' or 'inactive'Toggle Entity
ACT-39IntercompanyTransferpost_intercompany_transferPOST /api/intercompany-transfers/{ic_transfer_id}/postsets status='posted'Post Transfer
ACT-40IntercompanyTransfereliminate_intercompany_transferPOST /api/intercompany-transfers/{ic_transfer_id}/eliminatesets status='eliminated'Eliminate Transfer
ACT-41IntercompanyTransferdispute_intercompany_transferPOST /api/intercompany-transfers/{ic_transfer_id}/disputesets status='disputed'Dispute Transfer
ACT-42BudgetCommitmentactivate_budgetPOST /api/budgets/{budget_id}/activatesets status='active'Activate Budget
ACT-43BudgetCommitmentencumber_budgetPOST /api/budgets/{budget_id}/encumbersets encumbered_centsEncumber Budget
ACT-44BudgetCommitmentfreeze_budgetPOST /api/budgets/{budget_id}/freezesets status='frozen'Freeze Budget
ACT-45EvidenceArtifactupload_evidence_bytesPUT /api/evidence-artifacts/{artifact_id}/contentsets has_bytes=true, sha256, size_bytesUpload Custody Bytes
ACT-46EvidenceArtifacttoggle_evidence_legal_holdPOST /api/evidence-artifacts/{artifact_id}/legal-holdsets legal_hold=true or falseToggle Legal Hold

§7.2 Tallies (TallySpec)

IDNameEntityFormulaRunning
TAL-01Total AccountsAccountcount(all)true
TAL-02Active AccountsAccountcount(status == 'active')true
TAL-03Control AccountsAccountcount(is_control_account == true)true
TAL-04Open Fiscal PeriodsFiscalPeriodcount(status == 'open')true
TAL-05Closed Fiscal PeriodsFiscalPeriodcount(status == 'closed')true
TAL-06Open Close TasksCloseTaskcount(status == 'open')true
TAL-07Signed Off Close TasksCloseTaskcount(status == 'signed_off')true
TAL-08Active Tax RatesTaxRatecount(active == true)true
TAL-09Posted JournalsJournalEntrycount(status == 'posted')true
TAL-10Total Posted DebitsJournalEntrysum(total_debit_cents)true
TAL-11Total Posted CreditsJournalEntrysum(total_credit_cents)true
TAL-12Journal Lines CountJournalLinecount(all)true
TAL-13Total Journal Allocation BPSJournalLinesum(allocation_bps)true
TAL-14Total CustomersCustomercount(all)true
TAL-15Credit Hold CustomersCustomercount(status == 'credit_hold')true
TAL-16Total Customer Credit LimitCustomersum(credit_limit_cents)true
TAL-17Total InvoicesInvoicecount(all)true
TAL-18Unpaid InvoicesInvoicecount(status == 'unpaid')true
TAL-19Total AR BilledInvoicesum(total_amount_cents)true
TAL-20Applied Credit MemosCreditMemocount(status == 'applied')true
TAL-21Total Credit Memo AdjustmentsCreditMemosum(adjustment_cents)true
TAL-22Active Revenue SchedulesRevenueSchedulecount(status == 'active')true
TAL-23Total Contracted RevenueRevenueSchedulesum(total_contract_cents)true
TAL-24Total Recognized RevenueRevenueSchedulesum(recognized_cents)true
TAL-25Performance ObligationsRevenueObligationcount(all)true
TAL-26Total Allocated RevenueRevenueObligationsum(allocated_cents)true
TAL-27Total VendorsVendorcount(all)true
TAL-28Payment Hold VendorsVendorcount(payment_hold == true)true
TAL-29Pending Bank ChangesVendorBankChangecount(status == 'pending')true
TAL-30Approved Bank ChangesVendorBankChangecount(status == 'approved')true
TAL-31Open Purchase OrdersPurchaseOrdercount(status == 'open')true
TAL-32Total PO CommitmentsPurchaseOrdersum(total_amount_cents)true
TAL-33Accepted Goods ReceiptsGoodsReceiptcount(status == 'accepted')true
TAL-34Total Goods Received ValueGoodsReceiptsum(received_value_cents)true
TAL-35Total Vendor BillsBillcount(all)true
TAL-36Variance Hold BillsBillcount(status == 'variance_hold')true
TAL-37Total AP PayableBillsum(total_amount_cents)true
TAL-38Settled PaymentsPaymentcount(status == 'settled')true
TAL-39Total Cash SettledPaymentsum(amount_cents)true
TAL-40Unmatched Bank LinesBankStatementLinecount(status == 'unmatched')true
TAL-41Reconciled Bank LinesBankStatementLinecount(status == 'reconciled')true
TAL-42Bank Statement Net CashBankStatementLinesum(amount_cents)true
TAL-43Active Fixed AssetsFixedAssetcount(status == 'active')true
TAL-44Total Asset NBVFixedAssetsum(net_book_value_cents)true
TAL-45Active Inventory SKUsInventoryValuationcount(status == 'active')true
TAL-46Total Inventory ValueInventoryValuationsum(total_value_cents)true
TAL-47Active Legal EntitiesLegalEntitycount(status == 'active')true
TAL-48Posted Intercompany TransfersIntercompanyTransfercount(status == 'posted')true
TAL-49Eliminated IntercompanyIntercompanyTransfercount(status == 'eliminated')true
TAL-50Total Intercompany VolumeIntercompanyTransfersum(amount_cents)true
TAL-51Active BudgetsBudgetCommitmentcount(status == 'active')true
TAL-52Total Budget AllocatedBudgetCommitmentsum(allocated_cents)true
TAL-53Total Budget EncumberedBudgetCommitmentsum(encumbered_cents)true
TAL-54Evidence ArtifactsEvidenceArtifactcount(all)true
TAL-55Legal Hold ArtifactsEvidenceArtifactcount(legal_hold == true)true
TAL-56Dated FX RatesFxRatecount(all)true
TAL-57FX Revaluation RunsFxRevaluationcount(all)true
TAL-58Audit Ledger EntriesAuditLogcount(all)true

§7.3 Scopes (ScopeSpec)

IDWhatLabelEntityFieldControl Kind
SC-01Filter accounts by account_typeAccount Typeaccountsaccount_typeselect
SC-02Filter accounts by statusAccount Statusaccountsstatuschips
SC-03Filter accounts by currencyAccount Currencyaccountscurrencyselect
SC-04Filter fiscal periods by statusPeriod Statusfiscal_periodsstatuschips
SC-05Search fiscal periods by period_codePeriod Codefiscal_periodsperiod_codesearch
SC-06Filter close tasks by statusClose Task Statusclose_tasksstatuschips
SC-07Filter close tasks by owner_roleTask Owner Roleclose_tasksowner_roleselect
SC-08Filter tax rates by jurisdictionJurisdictiontax_ratesjurisdictionselect
SC-09Filter tax rates by tax_typeTax Typetax_ratestax_typeselect
SC-10Filter tax rates by activeActive Taxtax_ratesactivechips
SC-11Filter journals by statusJournal Statusjournalsstatuschips
SC-12Search journals by period_codePosting Periodjournalsperiod_codesearch
SC-13Filter journals by source_moduleSource Modulejournalssource_moduleselect
SC-14Search journal lines by account_idLine Accountjournal_linesaccount_idsearch
SC-15Filter customers by statusCustomer Statuscustomersstatuschips
SC-16Filter customers by dunning_pausedDunning Pausedcustomersdunning_pausedchips
SC-17Search customers by customer_codeCustomer Codecustomerscustomer_codesearch
SC-18Filter invoices by statusInvoice Statusinvoicesstatuschips
SC-19Search invoices by customer_idCustomer IDinvoicescustomer_idsearch
SC-20Filter invoices by currencyInvoice Currencyinvoicescurrencyselect
SC-21Filter credit memos by doc_kindMemo Kindcredit_memosdoc_kindselect
SC-22Filter credit memos by statusMemo Statuscredit_memosstatuschips
SC-23Filter revenue schedules by statusSchedule Statusrevenue_schedulesstatuschips
SC-24Filter revenue schedules by standard_modeAccounting Standardrevenue_schedulesstandard_modeselect
SC-25Filter obligations by satisfaction_methodSatisfaction Methodrevenue_obligationssatisfaction_methodselect
SC-26Filter vendors by statusVendor Statusvendorsstatuschips
SC-27Filter vendors by payment_holdPayment Holdvendorspayment_holdchips
SC-28Search vendors by vendor_codeVendor Codevendorsvendor_codesearch
SC-29Filter bank changes by statusBank Change Statusvendor_bank_changesstatuschips
SC-30Search bank changes by vendor_idBank Change Vendorvendor_bank_changesvendor_idsearch
SC-31Filter purchase orders by statusPO Statuspurchase_ordersstatusselect
SC-32Search purchase orders by vendor_idPO Vendorpurchase_ordersvendor_idsearch
SC-33Search goods receipts by po_idGRN POgoods_receiptspo_idsearch
SC-34Filter goods receipts by statusGRN Statusgoods_receiptsstatuschips
SC-35Filter bills by statusBill Statusbillsstatuschips
SC-36Filter bills by match_status3-Way Matchbillsmatch_statusselect
SC-37Search bills by vendor_idBill Vendorbillsvendor_idsearch
SC-38Filter payments by directionCash Directionpaymentsdirectionselect
SC-39Filter payments by statusPayment Statuspaymentsstatuschips
SC-40Filter bank statements by statusBank Line Statusbank_statementsstatuschips
SC-41Filter bank statements by format_kindStatement Formatbank_statementsformat_kindselect
SC-42Filter fixed assets by asset_classAsset Classfixed_assetsasset_classselect
SC-43Filter fixed assets by statusAsset Statusfixed_assetsstatuschips
SC-44Filter inventory by valuation_methodValuation Methodinventory_itemsvaluation_methodselect
SC-45Filter inventory by statusInventory Statusinventory_itemsstatuschips
SC-46Filter legal entities by functional_currencyEntity Currencylegal_entitiesfunctional_currencyselect
SC-47Filter legal entities by statusEntity Statuslegal_entitiesstatuschips
SC-48Filter intercompany transfers by statusIC Statusintercompany_transfersstatuschips
SC-49Filter budgets by statusBudget Statusbudgetsstatuschips
SC-50Search budgets by cost_centerCost Centerbudgetscost_centersearch
SC-51Filter evidence by doc_classDocument Classevidence_artifactsdoc_classselect
SC-52Filter evidence by object_lock_modeObject Lock Modeevidence_artifactsobject_lock_modechips
SC-53Filter FX rates by from_currencySource Currencyfx_ratesfrom_currencyselect
SC-54Search FX revaluations by period_codeFX Periodfx_revaluationsperiod_codesearch
SC-55Filter audit logs by entity_typeAudit Subsystemaudit_logsentity_typeselect
SC-56Search audit logs by actionAudit Actionaudit_logsactionsearch

§7.4 Places (PlaceSpec)

IDSubjectWhereLabel
PL-01AccountssidebarChart of Accounts
PL-02Periods & ClosesidebarFiscal Periods, Close Tasks & Tax
PL-03JournalssidebarDouble-Entry General Ledger
PL-04Customers & ARsidebarCustomers, AR Invoices & Credit Memos
PL-05Revenue ASC 606sidebarRevenue Schedules & Obligations
PL-06Vendors & APsidebarVendors, Bank Changes & AP Bills
PL-07ProcurementsidebarPOs, Goods Receipts & 3-Way Match
PL-08Payments & BanksidebarCash Clearing, FX & Bank Rec
PL-09Assets & InventorysidebarFixed Assets & Inventory Valuation
PL-10IntercompanysidebarLegal Entities & Eliminations
PL-11Budgets & CustodysidebarBudgets & S3 Object Lock Evidence
PL-12Reports & AuditsidebarTrial Balance, Aging, Benford & Audit
PL-13ledger_kpi_stripheader_barBalanced GL, AR/AP Open & NBV KPI Strip
PL-14bitemporal_scrubberheader_barGlobal as_of and as_known_at Clock Scrubber
PL-15tenant_role_barheader_barTenant X-Corp-Id and X-Role Context Switcher
PL-16account_master_detailAccounts viewCOA Create Form, Table & Balance Inspector
PL-17fiscal_close_cockpitPeriods & Close viewPeriod Close Lock Controls, Close Tasks & Tax Registry
PL-18journal_workbenchJournals viewBalanced Journal Builder & Nested Line Splits
PL-19customer_credit_drawerCustomers & AR viewCustomer Credit Hold, Dunning Pause & Invoice Issuer
PL-20asc606_waterfall_panelRevenue ASC 606 viewRevenue Schedule & 10000-bps Obligation Panel
PL-21vendor_bank_fraud_deskVendors & AP viewVendor Master, Dual-Approval IBAN & Bill Desk
PL-22three_way_match_panelProcurement viewPO, GRN & AP Bill 3-Way Match Variance Queue
PL-23bank_reconciliation_panelPayments & Bank viewIdempotent Payments, FX Rates & camt.053 Bank Rec
PL-24asset_depreciation_panelAssets & Inventory viewFixed Asset Schedule & FIFO/Weighted Avg Grid
PL-25intercompany_elimination_deskIntercompany viewSubsidiary Legal Entities & Elimination Transfers
PL-26budget_encumbrance_panelBudgets & Custody viewCost-Center Budget Ceilings & Encumbrance Monitor
PL-27evidence_custody_vaultBudgets & Custody viewSelective S3 Object Lock Evidence & SHA-256 Verifier
PL-28trial_balance_panelReports & Audit viewBitemporal Trial Balance, Aging & Tax Summary
PL-29fx_revaluation_panelReports & Audit viewPeriod-End Unrealized FX Revaluation Preview & Commit
PL-30audit_benford_panelReports & Audit viewBenford Chi-Square Scanner & Hash Audit Ledger

§7.5 Close Constraints (CloseConstraintSpec)

IDWhatLabel
CC-01cross_tenant_isolation: alpha-corp ledger rows and sequences are strictly invisible to beta-corp and zz-probe across all 28 tablesCross-tenant isolation
CC-02missing_corp: omitted or unknown X-Corp-Id rejected with 403 missing_corp before payload validationMissing tenant rejected
CC-03missing_role: omitted or empty X-Role on protected routes rejected fail-closed with 403 missing_roleDefault-deny role header
CC-04double_entry_conservation: unbalanced journals and over-summed lines rejected with 400 unbalanced_journalZero-sum double-entry GL
CC-05asc606_allocation_conservation: RevenueObligation allocation_bps <= 10000 and allocated_cents <= total_contract_cents enforcedASC 606 obligation conservation
CC-06closed_period_lock: posting journals, settlements, recognition, or depreciation into a closed fiscal period rejected with 400 closed_periodClosed fiscal period lock
CC-07sox_sod_enforcement: self-approval on vendor bills, match overrides, or vendor bank changes rejected with 400 sod_violationSOX 404 Segregation of Duties
CC-08selective_object_lock: S3 Object Lock allowed on statutory close/tax/SOX artifacts and rejected on contact_pii_export with 400 invalid_evidenceSelective S3 Object Lock custody
CC-09budget_encumbrance_ceiling: encumbering draft/frozen budgets rejected with 400 invalid_state_transition and overruns rejected with 400 budget_exceededBudget encumbrance ceiling
CC-10read_idempotency: all GET routes including trial balance, aging, and audit logs perform zero Offstack writesStrict GET read idempotency
CC-11bitemporal_isolation: historical as_of and as_known_at queries exclude future effective_at and recorded_at recordsBitemporal zero future leakage
CC-12pii_encryption_masking: Customer, Invoice, Vendor, VendorBankChange, and Bill PII fields encrypted at rest and masked for viewer and auditorPII encryption & role masking
CC-13hash_chain_audit: every mutating action appends a contiguous SHA-256 prev_hash/entry_hash AUD-#### entryTamper-evident audit chain

§8. Wave Decomposition, Verification & Windows Portability

18 modular build tasks across 3 waves keeping Python modules <= 650 LOC and JS files <= 800 LOC:


§9. Packaging (VibeInstaller Schema-v1), DF3 CLI & Supervision Protocol

python -m darkfactory3 lint-spec AIcentricERP_ARCHITECTURE.md --strict --monorepo-root C:/GitLab-Repos/vranjesevic-commercial
python -m darkfactory3 draft AIcentricERP_ARCHITECTURE.md -o <workdir>/app_spec.ir.json --base-url http://127.0.0.1:14787 --model deepseek/deepseek-v4.1-flash-1017
python -m darkfactory3 run <workdir> AIcentricERP_ARCHITECTURE.md --base-url http://127.0.0.1:14787 --model deepseek/deepseek-v4.1-flash-1017 --vibe-installer --installer-ui webview --installer-privilege lowest --installer-compression lzma2/max --theme emerald-ledger --panel-ux master-detail --enforce-row-selection --enforce-exact-form-fields --enforce-exact-table-columns

installer_config.json (VibeInstaller schema-v1):

{
  "schema_version": 1,
  "app": {
    "name": "AIcentricERP",
    "cli_command": "aicentricerp",
    "version": "3.0.0"
  },
  "packaging": {
    "backend": "pyinstaller",
    "sim_rider": true
  },
  "simulator": {
    "enabled": true,
    "source": "offstack",
    "strict": true
  },
  "service": {
    "port": 13820,
    "health_path": "/health"
  },
  "source": {
    "entry_points": ["desktop_launcher.py"],
    "proprietary_dirs": ["app"],
    "exclude": ["tests", "build_exe.py", "frontend/build.py", "research"]
  },
  "path_audit": {
    "root_markers": ["installer_config.json"],
    "scan_dirs": ["app"],
    "report_name": "AIcentricERP Path Portability Audit"
  },
  "isolate": {
    "copy_dirs": ["app", "frontend"],
    "required_files": ["installer_config.json", "aicentricerp.spec", "desktop_launcher.py", "requirements.txt"]
  },
  "build": {
    "exe_name": "aicentricerp",
    "skip_verify": true,
    "room_prefix": "erp",
    "serve_health_path": "/health"
  },
  "components": {
    "python_runtime": {"enabled": true, "version": "3.13.12"},
    "pip": {"enabled": true, "requirements": "requirements.txt"},
    "frontend": {
      "enabled": true,
      "index": "frontend/dist/index.html",
      "dist": "frontend/dist",
      "static_assets": [
        "frontend/dist/css/tokens.css",
        "frontend/dist/css/panel_ux.css"
      ],
      "fix": true
    }
  },
  "inno": {
    "app_id": "9e91abcd-b994-40ab-9ae0-1f3b38e01c78",
    "app_name": "AIcentricERP",
    "app_publisher": "DarkFactory",
    "app_version": "3.0.0",
    "dist_dir": "aicentricerp",
    "default_dir_name": "AIcentricERP",
    "output_base_filename": "AIcentricERP-3.0.0-Setup",
    "app_exe_name": "aicentricerp.exe",
    "privilege": "lowest",
    "compression": "lzma2/max",
    "gui_app": true,
    "desktop_icon": false,
    "main_launcher": {
      "no_dispatch": true,
      "runtime_smoke": ["--version", "--self-test"]
    }
  }
}

Supervision Protocol Summary & Gate Matrix

Agents building or auditing AIcentricERP MUST read toolkits/offstack/docs/OFFSTACK_AI_MANUAL.txt before modifying app/offstack_store.py and verify all gates across Waves 1–3:

  1. P1 ×14 (Offstack & Portability): gate-ast-rules (boto3/botocore confined strictly to app/offstack_store.py; zero sibling vertical imports; zero RPCs/disk writes at import), gate-aqa-hollow-stub, gate-storage-chaos, and INSTALLER-SCAN (vibeinstaller.config_schema, exact pins botocore>=1.42.1,<1.42.7, Windows portability).
  2. P2 ×13 (Ledger Invariants & Security): Double-entry conservation, ASC 606 obligation conservation, allocation BPS sums, closed period locks, SOX 404 SoD (bills & vendor bank changes), 3-way PO-receipt-bill match, signed credit memos, bitemporal (as_of, as_known_at) trial balance propagation, selective S3 Object Lock, PII encryption/masking, and SHA-256 AUD-#### chain.
  3. P2-FE (Modular UI & Theme): SEC-XSS (zero_unsafe_inner_html), SEC-API-BOUNDARY (no_fetch_outside_api_js), modular frontend/js/ (<= 800 LOC/JS, zero bundle.js/frontend/dist/js/), THEME-STATIC (tokens.css first, var(--*), [data-theme]), PANEL-UX, QG-UI-FORM-FIELDS, QG-UI-TABLE-COLS, and QG-UI-ROW-SELECT.
  4. P3 & Zero-LLM Exit Gate:
  5. python -m darkfactory3 lint-spec AIcentricERP_ARCHITECTURE.md --strict --monorepo-root C:/GitLab-Repos/vranjesevic-commercial -> exit 0, 0 errors, 0 warnings.
  6. _harvest_prose_contract() extracts 100% of entities, relations, facades, routes, RBAC, seeds, invariants, actions, tallies, scopes, places, Offstack services, and installer_config.json.
  7. Zero-LLM build_appspec_from_harvested() produces validate_ir(spec) == [] and audit_ir_stage_a_readiness(spec)["probe_issues"] == [].
  8. All Stage A/B probes (SHOW, DO, TALLY, SCOPE, PLACE, RELATE, CENSUS, PERSIST, CLOSE, RD, INVARIANT, SEC-*, PROD-*, QG-*, THEME-*, UX-*, INSTALLER-*) execute against ephemeral OffstackSidecar with >= 25 zero-skip tests passing.

Want a live walkthrough or evaluation setup for AIcentric Enterprise Suite? Message George Vranjesevic or reach out at george@developmentsnapshot.com.