Skip to main content

max / makenotwork

Credit the split purchases files, and floor the synckit declarations The money seal counted 8 new untested files after the 2026-09-04 splits, which blocked the 0.16.3 release. Neither cause was missing coverage. purchases.rs became five files, and db_transactions_layer.rs still named only the parent module. The seal credits a declared subject exactly, so thirteen functions it calls directly read as untested. The header now names all five, and says which function is in which. routes/synckit/{mod,routes,wire}.rs hold no behaviour: 31 lines of `mod` lines, a router of 94 `.route(` calls, and six serde types. That is the declaration-only shape the floor of 2 already existed for, so the floor is 5 and names each file and its reason. The handlers went to sync.rs, keys.rs, billing.rs and blobs.rs and took their tests with them.
Co-Authored-By
Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session
https://claude.ai/code/session_01WFBzMprSmNCfvdj2cGZyka
Author: Max Johnson <me@maxj.phd> · 2026-09-05 13:40 UTC
Signed with PGP, not checked
Commit: 168e611d85917ddeaf0d1eb555c01056fa7344b0
Parent: 5361242
2 files changed, +40 insertions, -15 deletions
@@ -34,20 +34,34 @@
34 34 /// areas is the thing this seal exists to refuse. If you genuinely need to add
35 35 /// one, the honest move is to write the test, not to bump the constant.
36 36 ///
37 - /// # 2 is the floor, and it is not a to-do
37 + /// # 5 is the floor, and it is not a to-do
38 38 ///
39 - /// The two files left are `routes/stripe/mod.rs` and `db/synckit/mod.rs`. Both
40 - /// are declaration-only: `mod` and `pub use`, plus a route table. Neither holds
41 - /// behaviour a test could observe that is not already observed by testing the
42 - /// thing it declares, and a test written to move this number would be theatre
43 - /// inside a seal whose only value is that it is dumb and honest.
39 + /// Every file left is declaration-only: `mod` and `pub use`, a route table, or
40 + /// serde wire types. None holds behaviour a test could observe that is not
41 + /// already observed by testing the thing it declares, and a test written to
42 + /// move this number would be theatre inside a seal whose only value is that it
43 + /// is dumb and honest.
44 44 ///
45 - /// Excluding them by rule was considered and declined. The rule is one sentence
46 - /// long ("how many files in these areas contain no test"), and a second concept
47 - /// bolted on to spare two files costs more than it saves; a floor of 2 that says
48 - /// why is more honest than a rule with a carve-out in it. So: do not drive this
49 - /// to 0, and do not treat 2 as work outstanding.
50 - const UNTESTED_HIGH_WATER: usize = 2;
45 + /// - `routes/stripe/mod.rs` and `db/synckit/mod.rs`, the original two.
46 + /// - `routes/synckit/mod.rs` (31 lines, doc comment and eleven `mod` lines),
47 + /// `routes/synckit/routes.rs` (the router: one function, 94 `.route(` calls
48 + /// and nothing else) and `routes/synckit/wire.rs` (six serde types shared by
49 + /// `sync` and `groups`). These three are what the 2026-09-04 decomposition
50 + /// left behind when `routes/synckit/mod.rs` was cut into eleven files; the
51 + /// handlers that carried the behaviour went to `sync.rs`, `keys.rs`,
52 + /// `billing.rs` and `blobs.rs`, which carry their tests with them.
53 + ///
54 + /// So the rise from 2 to 5 is not new untested behaviour, which is the thing
55 + /// this seal exists to refuse. It is one covered file becoming one covered set
56 + /// plus three declarations. Raising the number for any other reason is the
57 + /// dishonest move: write the test instead.
58 + ///
59 + /// Excluding declaration-only files by rule was considered and declined twice.
60 + /// The rule is one sentence long ("how many files in these areas contain no
61 + /// test"), and a second concept bolted on to spare five files costs more than
62 + /// it saves; a floor that says why is more honest than a rule with a carve-out
63 + /// in it. So: do not drive this to 0, and do not treat 5 as work outstanding.
64 + const UNTESTED_HIGH_WATER: usize = 5;
51 65
52 66 /// Anything that moves money or decides what someone is entitled to.
53 67 const MONEY: &[&str] = &[
@@ -1,5 +1,9 @@
1 1 //! DB-layer contract tests for the money core (`db::transactions`,
2 - //! `db::transactions::purchases`).
2 + //! `db::transactions::purchases`, `db::transactions::purchases::checkout`,
3 + //! `db::transactions::purchases::claims`,
4 + //! `db::transactions::purchases::guest`,
5 + //! `db::transactions::purchases::reads`,
6 + //! `db::transactions::purchases::refunds`).
3 7 //!
4 8 //! `db::transactions` is the largest money module and its contracts were asserted
5 9 //! only indirectly through HTTP/webhook flows. These call
@@ -9,8 +13,15 @@
9 13 //! claiming, free-claim dedup (single and batch), and buyer/seller scoping, are
10 14 //! pinned at the layer they live in.
11 15 //!
12 - //! Every function under test lives in `purchases.rs`, which the header above
13 - //! names so the coverage seal credits it.
16 + //! Every function under test lives under `db/transactions/purchases/`, and the
17 + //! header above names each of the five files rather than the directory module.
18 + //! The seal credits a declared subject exactly, so naming only the parent would
19 + //! leave five covered files reading as untested: `create_transaction`,
20 + //! `complete_transaction` and `complete_cart_transactions` are `checkout.rs`,
21 + //! the two `claim_free_item*` are `claims.rs`, `complete_guest_transaction` and
22 + //! `attach_guest_purchases_by_email` are `guest.rs`, the three read helpers are
23 + //! `reads.rs`, and the refund-claim pair plus
24 + //! `transaction_exists_for_checkout_session` are `refunds.rs`.
14 25
15 26 use crate::harness::TestHarness;
16 27 use makenotwork::db::{