Cross-phase · Architecture Core

AIB Model Coverage & Gap Register

This register records, for the AIB reference model, the difference between what is modelled (a table exists in the canonical schema) and what is implemented (the table carries data, feeds a view, or backs a screen/agent). It is the authoritative scope document for closing the model's gaps. It is derived from a structured audit of db/migrations/schema_d1.sql (387 tables, 20 views), web/data/schema.json (per-table catalogue + scaffold flag), and web/data/d1-snapshot.json (seeded-row counts — the only trustworthy implementation signal). The live /coverage page derives the per-table tier counts from those same sources; this document carries the judgement the data cannot: which missing capabilities matter, and why.

Headline (updated). Coverage is near-comprehensive for the EEA prudential and conduct perimeter, and the core figures now compute bottom-up. The general ledger, IFRS 9 ECL, the capital/RWA chain (SA + IRB + market + op → TREA → CET1) and the P&L all derive from the seeded book and reconcile to the filed FINREP/COREP — across six quarters, each balancing independently. npm run check:trace is the gate. What remains are genuine modelling gaps in the management-steering dimension (MIS, profitability, budget, RM pipeline) and a few risk refinements (FX revaluation, CVA, IMA VaR) — recorded below. The original integrity problem — figures that traced to nothing — is closed.

The four tiers

Every capability sorts into one of four tiers. The tier — not the dimension — predicts depth.

TierDefinitionFix type
RealNumber is computed from underlying rows via a v_* view— (already wired)
FaçadeThe inputs to a Real view are hand-seeded constants, not computedwire
StubTable has correct DDL but zero rows; nothing reads itseed (or seed + wire)
MissingNo table exists for a capability a real EEA bank needsmodel

scaffold:false in schema.json is not an implementation signal: the entire General Ledger and all four FRTB tables are scaffold:false yet hold zero rows. Only a non-zero seeded-row count in the snapshot indicates implementation.

Coverage at a glance

  • 387 tables modelled · ~338 seeded (~87%) · ~49 zero-row.
  • 20 views — all 20 regulatory (COREP / FINREP / LCR / NSFR). Zero accounting or management views.
  • 32 agents, 14 screens — concentrated on compliance, AML, and prudential reporting; thin on accounting and management steering.

Accounting / Finance

The weakest dimension. The General Ledger is well-designed and wired to nothing.

Real & implemented: nostro reconciliation (nostro_account, nostro_balance, nostro_reconciliation, recon_break); fee/revenue accounting (fee_invoice, fee_invoice_line, retrocession_payment, sla_fee_accrual); tax (vat_record, tax_reclaim_record, tax_classification, fatca_account_report, crs_account_report, country_by_country_report); the DPM/XBRL datapoint warehouse (dpm_*, rpt_datapoint_value, rpt_fact_datapoint, rpt_view_catalog).

Stub (good DDL, zero rows): the entire GL core — chart_of_accounts, accounting_period, journal_entry, journal_line, trial_balance_snapshot, cost_center; plus ifrs9_interest_accrual, fair_value_measurement (IFRS 13), annual_financial_statement.

Missing (no table): IFRS 9 ECL / impairment / staging engine — implemented (workstream 4: loan_facility ECL columns + ecl_allowance_movement + v_ifrs9_ecl_by_stage, per-exposure PD×LGD×EAD → allowance CHF 2.26m on the sampled book); sub-ledgers and GL-to-subledger reconciliation; FX revaluation/translation engine (journal_entry.entry_type='fx_revaluation' is declared but never implemented; no CTA/OCI); income statement / P&L aggregation; consolidation and intercompany elimination.

Integrity break. FINREP F01.01 lives in finrep_template as hand-keyed totals (total_assets=520m, total_liabilities=470m, total_equity=50m) and v_finrep_f0101_balance_sheet merely re-selects them. No view aggregates the GL into the balance sheet. corep_finrep_bridge reconciles FINREP↔COREP to each other, not to the ledger. docs/aib-reporting-architecture.md aspires to "F 01.01 totals reconcile to ledger" — there is no view or data implementing it.

Top accounting gaps

  1. GL is seeded with nothing and read by nothing; the bank has no books.
  2. IFRS 9 ECL / impairment / staging entirely missing — F18 NPE is a constant.
  3. No FX revaluation/translation engine despite the declared entry type.
  4. No sub-ledgers and no GL-to-subledger reconciliation (only nostro).
  5. No income statement and no consolidation/intercompany.

Risk

Broad, shallow, and standardised-only. Capital, liquidity, op-risk and ICAAP are genuinely computed; the credit-RWA inputs are hand-entered and market risk is a placeholder.

Real & implemented: own funds & ratios (capital_ratio_daily, own_funds_instrument, own_funds_deduction, leverage_ratio_calc → v_corep_c0100/c0300/c4700); large exposures (large_exposure_record → v_corep_c2800); liquidity & ALM (LCR lcr_* → v_lcr_c7200; NSFR nsfr_* → v_nsfr_c8000; IRRBB irrbb_*, alm_repricing_gap); operational risk (operational_loss_sma, corep_operational_risk_submission → v_corep_c1600, rcsa_*, kri_*); ICAAP / economic capital (icaap_*, economic_capital_allocation, reverse_stress_test, supervisory_stress_test_submission); model risk (model_risk_register); climate/ESG (climate_*, gar_calculation, taxonomy_*, esg_portfolio_metric).

Façade (hand-seeded inputs): corep_credit_risk_submission.sa_total_rwa (168m solo) — not computed from exposures; cva_own_funds_requirement; capital_ratio_daily.market_risk_rwa (a hardcoded CHF 12m plug).

Stub / disconnected: all four FRTB tables (frtb_book_boundary, frtb_sensitivity_result, frtb_pla_test, frtb_drc_position) — zero seed INSERTs; IRB (irb_rating_model, irb_rating_assignment) carries real PD/LGD/EAD but corep_credit_risk_submission.irb_total_rwa = 0, so IRB never reaches reported capital; netting_set, sa_ccr_netting_set_calc, margin_call_event, securitisation_position, mrel_liability, resolution_action, ilaap_liquidity_stress_result — unseeded.

Missing: ECL / IFRS 9 engine (shared with accounting); per-exposure standardised credit-RWA table that produces sa_total_rwa from line items × risk weights; market-risk RWA / own-funds source (C 18.00 / C 20–24); CVA calculation; VaR/sensitivities time series.

Top risk gaps

  1. Market risk is fiction — no trading book, FRTB unseeded, RWA is a plug.
  2. IRB is decorative — real PD/LGD/EAD never reaches irb_total_rwa.
  3. No ECL / IFRS 9 engine. Closed — per-exposure ECL on loan_facility (workstream 4).
  4. COREP/FINREP numbers are entered, not computed; views are pass-throughs.
  5. Counterparty credit (SA-CCR) and the resolution leg of BRRD are stubs.

Management / Steering

An afterthought, not a first-class dimension. There is no management-reporting layer distinct from regulatory reporting — all 20 views are regulatory.

Real & implemented: product governance & pricing (product_catalog, product_pricing, product_agreement, product_target_market, new_product_approval) — the most complete steering area; FTP (ftp_rate, ftp_allocation) — token rows; capital allocation (economic_capital_allocation); governance evidence (governance_meeting_minutes, credit_committee_decision, approved_person_register, succession_plan); conduct & culture (conflict_of_interest, gift_entertainment_record, personal_account_dealing, whistleblower_report, conduct_attestation, staff_competence_record).

Stub (good DDL, zero rows): the entire Performance domain (performance_record, performance_attribution, gips_composite) — and note this is investment performance, not business profitability; capital_plan_projection (3-year base/adverse/severe P&L + capital actions); the entire remuneration_* domain (remuneration_identified_staff, remuneration_award, remuneration_clawback); cost_center; related_party, related_party_transaction.

Missing: MIS / management-reporting layer (no mis_*, management_report, kpi, scorecard); budget / forecast / plan-vs-actual; cost-allocation engine; client / segment / product profitability (RAROC/RORAC); RM pipeline / AUM / net new money steering (CRM is one advice-log table); strategic/business-plan tracking.

Top management gaps

  1. No MIS / management-reporting layer — all reporting is regulatory.
  2. No business profitability — no RAROC/RORAC, no client/segment/product P&L.
  3. GL backbone unseeded — no actuals to drive plan-vs-actual or cost allocation.
  4. No budget / forecast.
  5. No RM pipeline / AUM steering despite RM agent personas.

Remediation roadmap

Three kinds of gap, each with a different fix. The workstreams below are the agreed build sequence; this register is updated as each lands.

#WorkstreamClosesKindStatus
1Coverage register + /coverage pagevisibility of the gap itselfdoc + UI✅ done
2Seed the stub tables (GL, performance, remuneration, capital plan, FRTB)the seed gaps — high-quality DDL with no rowsseed✅ done — 17 tables, 122 rows
3Wire GL → FINREP (trial balance → F 01.01 via a view; provenance)the integrity break for the balance sheetwire✅ done — v_finrep_f0101_from_ledger, reconciles 520/470/50
4IFRS 9 ECL engine (per-exposure staging + PD×LGD×EAD → loss allowance → F18)the most material missing capabilitymodel✅ done — loan_facility ECL cols + ecl_allowance_movement + v_ifrs9_ecl_by_stage
5Traceable comprehensive book (40 clients, 24 loans, 64 positions)sub-ledgers sum to the balance sheetseed✅ done — gen-book-fixtures.mjs
6Bottom-up capital chain (SA + CRR Art.153 IRB + market + SMA op → TREA → CET1)the capital/RWA chain was hand-keyedmodel✅ done — recomputed: CET1 13.84%, TREA 317.84m (incl SA-CCR + CVA from the derivative book + own-managed fund seed RW), own funds trace to GL equity
7P&L from ledger + 6-quarter history (F02.00 from GL; each quarter balances + ties to FINREP)P&L untraced; single periodmodel✅ done — v_finrep_f0200_from_ledger, 6 quarters 2025-Q1…2026-Q2
8Lineage explorer (datapoint → DPM → view → source rows)reported figures opaqueUI✅ done — /lineage + inline trace links
9Tier 1+2 product capabilities (cards, alternatives, derivatives, tokenized-RWA, crypto custody, fiduciary, insurance, payments, advisory)only WM + lending modelledmodel + UI✅ done — 43 tables → AUM/TREA/fee, all traced; /products
10Asset mgmt + pension + research/CIO + agents (fund manufacturing/servicing/depositary, 2nd/3rd-pillar pension, house view/IC office)the bank distributed but did not manufacture; no pension; no research layermodel + agents + UI✅ done — 32 tables + 4 ADS-v2 agents; AUM → 1.213bn, own-fund seed → CET1 13.84%; /funds /pension /research-cio

The remaining modelling gaps (P&L aggregation, consolidation, FX revaluation, market-risk RWA source, MIS / profitability / budget / RM pipeline) are recorded here as known and out of the current build scope.

Book traceability

The seeded book is now sized to the published balance sheet and reconciles bottom-up. db/seed/27_book_fixtures.sql (emitted by web/scripts/gen-book-fixtures.mjs) carries a coherent population — 40 clients, 41 accounts, 24 loan facilities, 64 custody positions, 33 instruments — whose sub-ledger control totals sum exactly to the GL trial balance and the filed FINREP F 01.01. web/scripts/check-trace.mjs (npm run check:trace) is the gate:

ChainSub-ledger= control= report
Customer loans (gross)Σ loan_facility.drawn_amount_chf = 210.0mGL 1200FINREP total_loans_gross
Non-performingΣ stage-3 drawn = 3.2m—FINREP npe_gross
Loss allowanceΣ ecl_recognised = 2.0mGL 1290Σ ecl_allowance_movement closing
Customer depositsΣ account_balance.balance = 400.0mGL 2100—
Balance sheetGL assets 520.0m= liabilities 470.0m + equity 50.0mFINREP F 01.01

Securities custody (600.0m across 64 positions) is off-balance-sheet and traces to AUM, not to GL 1300 (the bank's own treasury book). With the product, fund and pension books layered on, firm-wide AUM is 1.213bn. All check:trace assertions pass.