feat(package): one attention engine over PackageBooks (U0b)
Needs attention was computed by the viewer alone, while books.start hand-picked a handful of next steps. The human's list and the agent's could disagree, and a new item had to be written twice (or, as books.start showed, not at all). Move the engine to ledger-package over PackageBooks: one function, find/find_with(books, today, settings, integrity), reads the ledger, the journal's event types (an entry's origin), the attachments and their links, the statements, the reconciliations, and the database check. The viewer's attention module now only maps Target to Route; books.start turns the same items into its next steps (why = the item's title, top 12), so the list the human sees and the steps the agent gets cannot drift. PackageBooks gains settings, journal, statements, reconciliations and disk_check, implemented for Store and Snapshot, so both views answer alike. The W-9, reconciliation and 1099 predicates move beside the items to keep one copy. ledger-package gains ledger-config and serde_json (the receipt policy and the tool arguments the items carry). Tests: view_model.rs and spec_kept.rs pass unchanged; the new attention_parity.rs compares the viewer and books.start item for item on the demo books and on a book written entry by entry. just check green.
This commit is contained in:
1 parent
eeee9658da
commit
0cf2f8f5c5
17 files changed
+2026
-895
No files matched your search
@@ -81,6 +81,20 @@ appended journal lines; the UI renders an immutable view model rebuilt per
|
||||
change. Statements and series come from `ledger-core` (`reports`,
|
||||
`analysis`); the GUI only arranges them. See `plan/gui.md`.
|
||||
|
||||
## Shared read-only views (`ledger-package`)
|
||||
|
||||
`ledger-package` is the shared read-only view: packages, the invoice PDF,
|
||||
and Needs attention, over `Store` or `Snapshot`. Its `PackageBooks` trait
|
||||
is what those builders read of the books (ledger, settings, journal,
|
||||
attachments and their links and bytes, statements, reconciliations), so the
|
||||
server and the viewer make the same package, the same invoice, and the same
|
||||
attention list from one piece of code; nothing in it writes. The viewer's
|
||||
`attention` module only maps each item's `Target` to its own route, and
|
||||
`books.start` turns the items into its next steps, so the human's list and
|
||||
the agent's cannot drift apart. The crate depends inward (`ledger-core`,
|
||||
`ledger-store`, `ledger-config`, `ledger-import`, `ledger-vault`), never on
|
||||
`ledger-mcp` or `ledger-gui`.
|
||||
|
||||
## The journal format gate (`ledger-store`, P0)
|
||||
|
||||
Every journal line passes a gate after its parse, seq and chain checks
|
||||
|
||||
Reference in new issue
Block a user