Package runtime migrations and branding assets

This commit is contained in:
rob
2026-08-30 07:21:37 +01:00
parent 97a75d0243
commit af4aa713b9
51 changed files with 72 additions and 29 deletions
+6 -2
View File
@@ -1,6 +1,7 @@
# Current State
- Development stage: approved v1 and business-letter workflow implemented; no active task.
- Development stage: approved v1, business-letter workflow, and deployable wheel
packaging implemented; no active task.
- Implemented: persistence/migrations, exact money, chart/settings, balanced journals,
audit, all core records and sales/payables workflows, recurring definitions, bank
import/reconciliation, currency/VAT/tax records, assets, period locks/backups,
@@ -21,7 +22,10 @@
and P&L were generated and visually inspected against `docs/design/references/`;
multi-page invoice and ledger/report pagination was checked.
- Missing approved functionality: none identified by the completed requirements audit.
- Known problems: no known failing test or migration.
- Packaging: migrations and branding resources are included in the wheel. A wheel
installed into an isolated target outside the checkout initialized revision 0028
and generated all five branded sample PDFs.
- Known problems: no known failing test, migration, or packaging defect.
- Repository baseline: the completed implementation is captured in the initial Git
commit; generated runtime/test artifacts remain ignored.
- Current active task: none.
+14 -7
View File
@@ -7,9 +7,9 @@ a pre-trading sole-trader software business. SQLite is authoritative.
## 2. Repository state
The accounting/service layers and full backlog are implemented and captured in the
initial Git baseline. `.venv`, caches, generated databases, bytecode, and package
metadata are ignored.
The accounting/service layers and full approved backlog are implemented. The initial
Git baseline exists; a follow-up packaging change makes wheels self-contained. `.venv`,
caches, generated databases, bytecode, build output, and package metadata are ignored.
## 3. Current application state
@@ -34,15 +34,18 @@ approval, XDG runtime locations, and ReportLab/svglib shared A4 rendering.
Completed the full backlog, including migrations 0014–0028, all controls
and reports, CLI/runtime paths, PDF renderers, managed generated-document metadata,
and deterministic visual samples. Corrected migration 0017 to use SQLite batch mode.
PKG-001 moved migrations and branding resources into the installable package and
validated initialization/document generation from a wheel outside the checkout.
## 7. Current task
No active approved task. The final audit tasks and `DOC-FUTURE-001` business-letter
draft/finalize/archive workflow are complete. `DOC-006` added the root operator guide.
No active approved task. The final audit tasks, business-letter workflow, operator
guide, and self-contained wheel deployment task are complete.
## 8. Important code locations
- Models/migrations: `src/roborto_accounting/persistence/`, `alembic/versions/`
- Models/migrations: `src/roborto_accounting/persistence/`,
`src/roborto_accounting/migrations/versions/`
- Services: `src/roborto_accounting/services/`
- Reports/documents: `src/roborto_accounting/reporting/`
- CLI/runtime paths: `src/roborto_accounting/cli/`, `src/roborto_accounting/config.py`
@@ -55,6 +58,9 @@ draft/finalize/archive workflow are complete. `DOC-006` added the root operator
- `.venv/bin/alembic -c <temporary-config> upgrade head` — fresh SQLite through 0028
- `.venv/bin/accounts --help`
- `.venv/bin/accounts document-samples --output <directory>`
- `.venv/bin/pip wheel . --no-deps --no-build-isolation --wheel-dir <directory>`
- wheel installed to an isolated target outside the checkout: initialization through
0028 and five sample PDFs succeeded
- `git diff --check`
## 10. Environment variables by NAME ONLY
@@ -64,7 +70,8 @@ draft/finalize/archive workflow are complete. `DOC-006` added the root operator
## 11. Testing/quality status
60 isolated tests pass. Fresh migration through 0028 has no SQLite foreign-key
violations. Representative A4 invoice, quotation, Cash Flow, and P&L PDFs were
violations. The built wheel contains migrations and both brand SVGs and works outside
the checkout. Representative A4 invoice, quotation, Cash Flow, and P&L PDFs were
visually inspected; multi-page headers, wrapping, totals, footers, and page numbering
were checked.
+2 -1
View File
@@ -73,7 +73,8 @@ documents, and backups in `~/.local/share/roborto-accounting`, and state in
- `src/roborto_accounting/`: package and separated layers
- `tests/`: isolated automated tests
- `alembic/`: migrations
- `src/roborto_accounting/migrations/`: packaged Alembic migrations
- `src/roborto_accounting/assets/branding/`: packaged document-branding resources
- `docs/`: maintained context
- `AGENTS.md`: working instructions
+17 -2
View File
@@ -31,7 +31,7 @@ major task is `IN PROGRESS`.
- Objective: Establish migrations and exact `Decimal` storage policy.
- Scope: Alembic environment, initial migration workflow, SQLite encoding/scale/rounding.
- Acceptance criteria: upgrade/downgrade works; monetary round-trip proves no floats.
- Relevant code: `alembic/`, persistence money type, tests.
- Relevant code: `src/roborto_accounting/migrations/`, persistence money type, tests.
- Validation: migration and arithmetic tests.
- Dependencies: FND-002. Non-goals: business tables. Open questions: exact encoding is proposed.
@@ -468,7 +468,7 @@ major task is `IN PROGRESS`.
- Objective: Implement the approved reusable light-mode Roborto document identity.
- Scope: rendering-library selection, deterministic A4 output, margins, typography, `logo-light.svg`, colour tokens, headings, tables, totals, footer/page numbering, wrapping and page breaks.
- Acceptance criteria: one UI-independent theme serves every renderer; output is print-safe, greyscale-legible, deterministic, and contains no accounting logic.
- Relevant code: future `reporting/documents/`, `assets/branding/`, `docs/design/`.
- Relevant code: `reporting/documents/`, packaged branding assets, `docs/design/`.
- Validation: unit/layout tests plus generated representative multi-page PDF inspection.
- Dependencies: DOC-001. Non-goals: per-document themes, dashboards, gradients, shadows, proprietary fonts, Flask/React. Open questions: rendering library.
@@ -523,6 +523,21 @@ major task is `IN PROGRESS`.
- Dependencies: CLI-006, DOC-FUTURE-001. Non-goals: deployment automation or invented
workflows. Open questions: none.
### PKG-001 — Self-contained wheel deployment
- Priority: P0; Status: COMPLETE
- Objective: Make a normal wheel installation independent of the source checkout.
- Scope: package Alembic migrations and brand SVG resources, resolve them from the
installed package, and retain the repository Alembic developer workflow.
- Acceptance criteria: a built wheel contains every migration and branding asset;
code installed from that wheel can initialize a new database and generate branded
document samples while running outside the repository.
- Relevant code: `pyproject.toml`, packaged migrations/assets, runtime configuration,
CLI initialization, deployment tests.
- Validation: full tests, clean wheel inspection, external-location database
initialization and PDF sample generation.
- Dependencies: FND-002, DOC-005. Non-goals: system-wide installation automation,
cloud deployment, or changing the XDG runtime-storage policy. Open questions: none.
## Backlog review
The approved specification is represented by tasks, acceptance criteria, decisions, or
+2 -1
View File
@@ -14,7 +14,8 @@ Profit & Loss statements, transaction/accounting/year-end reports, and other
professional A4 output. Do not independently style each renderer.
- A4 portrait by default, white/light background, generous margins and whitespace.
- Use `assets/branding/logo-light.svg`; never put the dark logo panel on light pages.
- Use the packaged `src/roborto_accounting/assets/branding/logo-light.svg`; never put
the dark logo panel on light pages.
- Roborto green `#7ee787`; Roborto dark `#0b0f14`; dark body text and light rules.
- Clean, non-proprietary sans-serif typography; monospace only sparingly.
- Strong dark titles with a short thin green accent, not full-width colour banners.
+3 -2
View File
@@ -19,8 +19,9 @@ Never infer business data or reproduce text errors from it.
## Assets and references
- `assets/branding/logo-light.svg`: required light-document logo.
- `assets/branding/logo-dark.svg`: retained dark-mode asset, not for white A4 pages.
- `src/roborto_accounting/assets/branding/logo-light.svg`: required light-document logo.
- `src/roborto_accounting/assets/branding/logo-dark.svg`: retained dark-mode asset,
not for white A4 pages.
- `docs/design/references/invoice-reference.png`: canonical visual direction.
- Other PNGs: quotation, letter, Cash Flow, and Profit & Loss adaptations.