1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Codegen policy for backbone-accounting.
#
# `user_owned` globs are hand-written files that live inside generator-owned trees but are
# NOT schema-derived. `metaphor schema generate [--force]` skips them wholesale (never reads,
# merges, or deletes them). Everything else in src/ is regenerated from schema/models.
#
# Re-exports/declarations that must sit alongside generated code live inside
# `// <<< CUSTOM ... // END CUSTOM` markers (service/mod.rs, presentation/http/mod.rs,
# exports/events.rs, lib.rs) and are preserved by the marker mechanism, not listed here.
user_owned:
# GL-posting contract — hand-authored double-entry behavior + its HTTP surface.
- "src/application/service/posting_service.rs"
- "src/presentation/http/posting_handler.rs"
# Manual-journal approval workflow (draft → submit → approve → post → void).
- "src/application/service/journal_workflow_service.rs"
- "src/presentation/http/journal_workflow_handler.rs"
# GL-posting domain contract types (shared by ports, rules, and the service).
- "src/domain/gl_posting.rs"
# Pure posting-validation rules (no I/O).
- "src/domain/services/posting_rules.rs"
# Hand-authored repository ports (domain layer).
- "src/domain/repositories/budget_control.rs"
- "src/domain/repositories/deferred_tax.rs"
- "src/domain/repositories/posting_repository.rs"
- "src/domain/repositories/journal_workflow_repository.rs"
- "src/domain/repositories/period_close_repository.rs"
- "src/domain/repositories/bank_reconciliation_repository.rs"
- "src/domain/repositories/reporting_repository.rs"
# SQLx adapters for those ports (infrastructure layer) — all persistence lives here.
- "src/infrastructure/persistence/posting_repository.rs"
- "src/infrastructure/persistence/journal_workflow_repository.rs"
- "src/infrastructure/persistence/period_close_repository.rs"
- "src/infrastructure/persistence/bank_reconciliation_repository.rs"
- "src/infrastructure/persistence/reporting_repository.rs"
# Entity hierarchy read (ancestors root → self) for account / cost_center / fiscal_period.
- "src/domain/repositories/hierarchy_repository.rs"
- "src/infrastructure/persistence/hierarchy_repository.rs"
- "src/application/service/hierarchy_service.rs"
- "src/presentation/http/hierarchy_handler.rs"
# Financial-statement generation (Trial Balance / Balance Sheet / Income Statement).
- "src/application/service/reporting_service.rs"
- "src/presentation/http/reporting_handler.rs"
# Bank reconciliation matching + fiscal-period close.
- "src/application/service/bank_reconciliation_service.rs"
- "src/application/service/period_close_service.rs"
- "src/presentation/http/accounting_ops_handler.rs"
- "src/presentation/http/guarded_routes.rs"
# Reconciliation graph — Odoo-shaped edges + groups, side-effecting unlink.
- "src/domain/reconcile_graph.rs"
# Chart-of-accounts install engine (datasets are data; installs write real rows).
- "src/domain/chart_dataset.rs"
- "src/domain/repositories/chart_install_repository.rs"
- "src/infrastructure/persistence/chart_install_repository.rs"
- "src/application/service/chart_install_service.rs"
- "src/presentation/http/chart_routes.rs"
- "src/domain/services/reconcile_rules.rs"
- "src/domain/repositories/reconcile_graph_repository.rs"
- "src/infrastructure/persistence/reconcile_graph_repository.rs"
- "src/application/service/reconcile_write_service.rs"
- "src/presentation/http/reconcile_handler.rs"
# Message-bus adapter (publishes posting events to backbone-messaging).
- "src/infrastructure/messaging/**"
# Finance tail surfaces — EMV(QRCPS)/QRIS display, check printing sequences +
# registry, tax-tag legal-change repair (all verb-backed, no CRUD mount).
- "src/domain/emv_qr.rs"
- "src/application/service/emv_qr_service.rs"
- "src/presentation/http/emv_qr_handler.rs"
- "src/application/service/check_printing_service.rs"
- "src/presentation/http/check_printing_handler.rs"
- "src/application/service/tax_tag_repair_service.rs"
- "src/presentation/http/tax_tag_repair_handler.rs"
# Behavior tests + BDD oracle (the golden cases).
- "tests/posting_golden_cases.rs"
- "tests/posting_budget_control_cases.rs"
- "tests/reporting_golden_cases.rs"
- "tests/reconciliation_graph_golden_cases.rs"
- "tests/caba_flip_cases.rs"
- "tests/reconciliation_golden_cases.rs"
- "tests/period_close_golden_cases.rs"
- "tests/period_lifecycle_golden_cases.rs"
- "tests/messaging_bus.rs"
- "tests/integrity_probes.rs"
- "tests/journal_workflow_golden_cases.rs"
- "tests/chart_install_cases.rs"
- "tests/rls_probe.rs"
- "tests/emv_qr_cases.rs"
- "tests/check_printing_cases.rs"
- "tests/tax_tag_repair_cases.rs"
- "tests/posting_source_cases.rs"
- "tests/features/**"
# Hand-authored module documentation (PRD/BRD/FSD, business flows, ADRs).
- "docs/prd.md"
- "docs/brd.md"
- "docs/fsd.md"
- "docs/extension-guide.md"
- "docs/business-flows/**"
- "docs/adr/**"
# Hand-authored migrations. Everything listed here carries logic no schema
# can express, so a regeneration must leave it alone: a migration that is
# neither marked as generated nor declared here is swept on a forced regen,
# and a swept migration is a schema that silently stops matching the code.
# The rule for the next one: declare it in the same change that lands it.
#
# The tenancy strip (its ordering guard is hand-authored logic).
- "migrations/20260910232200_strip_tenancy.up.sql"
- "migrations/20260910232200_strip_tenancy.down.sql"
# Posting-source vocabulary: each producer module that started posting added
# its own value to the enum. One-way by nature, so they carry no down file.
- "migrations/20260706000000_add_manufacturing_posting_source.up.sql"
- "migrations/20260706010000_add_asset_posting_source.up.sql"
- "migrations/20260708000000_add_payroll_posting_source.up.sql"
- "migrations/20260710000000_add_maintenance_posting_source.up.sql"
- "migrations/20260712000000_add_equity_posting_source.up.sql"
- "migrations/20260819100004_posting_source_type_reconciliation.up.sql"
- "migrations/20260819100004_posting_source_type_reconciliation.down.sql"
- "migrations/20260822100000_posting_source_type_gateway_fee.up.sql"
- "migrations/20260822100000_posting_source_type_gateway_fee.down.sql"
# The posting contract's own guarantees: the idempotency key that collapses a
# retried post, and the fence the tenancy work later re-based.
- "migrations/20260712000100_accounting_post_idempotency_key.up.sql"
- "migrations/20260819100000_company_fence_strict.up.sql"
# The fiscal period lifecycle: the reopen trail and the trigger that holds
# every writer to the close, lock and reopen transitions.
- "migrations/20261008100000_fiscal_period_status_verbs.up.sql"
- "migrations/20261008100000_fiscal_period_status_verbs.down.sql"
- "migrations/20260819100000_company_fence_strict.down.sql"
# Reconciliation shape: the journal line's link to its full-reconcile group.
- "migrations/20260819100003_journal_line_full_reconcile_id.up.sql"
- "migrations/20260819100003_journal_line_full_reconcile_id.down.sql"
# Chart-of-accounts shape: where an account came from, the columns the
# install path stopped using, and the account status lifecycle.
- "migrations/20260820100000_chart_provenance.up.sql"
- "migrations/20260820100000_chart_provenance.down.sql"
- "migrations/20260820100001_drop_unused_account_columns.up.sql"
- "migrations/20260820100001_drop_unused_account_columns.down.sql"
- "migrations/20260821130000_status_lifecycle.up.sql"
- "migrations/20260821130000_status_lifecycle.down.sql"
# The localisation-facing surfaces: the QR display fields, cheque printing,
# and the tax-tag repair run.
- "migrations/20260906100000_emv_qr_display.up.sql"
- "migrations/20260906100000_emv_qr_display.down.sql"
- "migrations/20260906110000_bank_check_printing.up.sql"
- "migrations/20260906110000_bank_check_printing.down.sql"
- "migrations/20260906120000_tax_tag_repairs.up.sql"
- "migrations/20260906120000_tax_tag_repairs.down.sql"