docs: P4b S4.1 landed; record the interim document-line guard and S4's departures

This commit is contained in:
swaits committed 2026-10-27 01:57:04 -06:00
1 parent 13282cf80e
commit 6995ebfee6
2 files changed
+33 -1

No files matched your search

+32
View File
@@ -92,6 +92,38 @@ states a rule must use CHOICE where a human chose and must add its
`**bookspec:**` id line** (B-39 S4.5, B-40 S4.5, B-41 S7, B-43 P4, `**bookspec:**` id line** (B-39 S4.5, B-40 S4.5, B-41 S7, B-43 P4,
B-44 P6, B-45 P8); `rules_md_carries_every_id` fails the tree otherwise. B-44 P6, B-45 P8); `rules_md_carries_every_id` fails the tree otherwise.
**2026-10-27: P4b S4.1 landed (`13282cf8`); P4b S4 is in progress.** The
core can now carry a document's terms, its number, its line's own account,
quantity and unit price, the parties' snapshots and the bill's vendor
reference: `Terms`/`TermsKind`/`EarlyDiscount` with exact due dates
(Net n, Net n EOM, due on receipt, custom), `kernel::discount_max` and
`kernel::line_amount` (Kani, with bridge properties),
`PartySnapshot`, `Invoice`/`Bill`'s new optional fields,
`Ledger::next_invoice_number` and `Ledger::check_vendor_ref`. Ten tests in
`spec_documents.rs`; `just check` and `just prove` green (51 fast Kani
harnesses, Lean 90 headline theorems, standard axioms only); no golden
moved.
One guard, and the reason it exists: `Store::create_invoice` and
`create_bill` refuse a line carrying `account`, `quantity` or
`unit_price` (`StoreError::DocumentFieldsAwaitUpgrade`) because the
journal does not write those fields yet. A store caller could otherwise
post a document whose replay silently loses its line account, which I-3
forbids and no MCP path reaches today. **S4.3 removes the guard in the
same change that journals the three fields and adds its byte-for-byte
test**; `document_line_fields_wait_for_documents_v2` proves the refusal,
the unchanged journal and the unchanged ordinary posting, and the guard
sits before `rehearse` in both commands. Departures to carry forward: the
`Sent`/`SentVia`/`SendKind` types are defined here though S5 owns them
(**S5 adds `Ledger::mark_sent` and must not redefine them**);
`InvoiceFields`/`BillFields` and `create_invoice_with`/`create_bill_with`
are the carrier for the create inputs the plan names but does not place;
and `check_document_line_account`'s fallback to the store's name-based
cash-account rule is a second copy of that rule, to unify later. The
bookspec examples `payment-terms-due-date` and
`invoice-numbers-run-and-voids-keep-theirs` remain owed by a later S4
slice, since P13's checker now takes an unknown key as an error.
The 2026-10-16 audit of the first company's books (62 verified findings, The 2026-10-16 audit of the first company's books (62 verified findings,
20 engine defects) and the design discussion that followed produced 20 engine defects) and the design discussion that followed produced
+1 -1
View File
@@ -815,7 +815,7 @@ One row per unit of work. A unit is what one engineer takes into one git worktre
| U0a | Split `server.rs` by tool group | not started | none | U0b, U0c, S4.1, S4.2, S7.1 (core steps only) | none | 3-4 | | U0a | Split `server.rs` by tool group | not started | none | U0b, U0c, S4.1, S4.2, S7.1 (core steps only) | none | 3-4 |
| U0b | The attention engine over `PackageBooks` | not started | none | U0a, U0c, S4.1, S4.2 | none | 4-6 | | U0b | The attention engine over `PackageBooks` | not started | none | U0a, U0c, S4.1, S4.2 | none | 4-6 |
| U0c | `docs/testing.md` sections for S1-B, S2, S3; `docs/mcp-interface.md` cleanup of stale P4b notes | landed 2026-10-26 (`198aa2a1`) | none | everything | none | 0.5-1 | | U0c | `docs/testing.md` sections for S1-B, S2, S3; `docs/mcp-interface.md` cleanup of stale P4b notes | landed 2026-10-26 (`198aa2a1`) | none | everything | none | 0.5-1 |
| P4b S4 | `documents_v2`: numbers, terms, line accounts, snapshots, preview and confirm, the issued PDF filed, party email and terms, invoicing settings | not started | S4.1 and S4.2 need nothing; S4.3 needs S4.1, S4.2; S4.4 needs U0a, S4.3; S4.5 needs S4.4 | S5 (after S4.2), S7 (core after S1), P6, P9a, P11a, P13 | `documents_v2` (one upgrade after S7, D-52) | 12-16 | | P4b S4 | `documents_v2`: numbers, terms, line accounts, snapshots, preview and confirm, the issued PDF filed, party email and terms, invoicing settings | in progress: S4.1 landed 2026-10-27 (`13282cf8`); S4.2-S4.5 open | S4.1 and S4.2 need nothing; S4.3 needs S4.1, S4.2; S4.4 needs U0a, S4.3; S4.5 needs S4.4 | S5 (after S4.2), S7 (core after S1), P6, P9a, P11a, P13 | `documents_v2` (one upgrade after S7, D-52) | 12-16 |
| P4b S5 | Sent tracking | not started | S1; S4.2 for the defaults (works without it, see the unit) | S4.3 onward, S6 | `documents_v2` | 3-4 | | P4b S5 | Sent tracking | not started | S1; S4.2 for the defaults (works without it, see the unit) | S4.3 onward, S6 | `documents_v2` | 3-4 |
| P4b S6 | Paying on terms: multi-document payments, discounts, the processor fee, bills due, aging exports | not started | S4.1 (`Terms`), U0a | S5, S7, P6 | `documents_v2` | 8-10 | | P4b S6 | Paying on terms: multi-document payments, discounts, the processor fee, bills due, aging exports | not started | S4.1 (`Terms`), U0a | S5, S7, P6 | `documents_v2` | 8-10 |
| P4b S7 | Bad debts (write-offs) | not started | S1; S4.3 for the same-call evidence attach; U0a | S4.4 onward, S5, S6 | `documents_v2` | 4-6 | | P4b S7 | Bad debts (write-offs) | not started | S1; S4.3 for the same-call evidence attach; U0a | S4.4 onward, S5, S6 | `documents_v2` | 4-6 |