CluPilotCloud/app
nexxo 048e5ba81f Subtract only what was counted, not everything a singleton adopted
A figure may only subtract what it counted as an intent in the first place. The
family loop counts a Product before knowing whether it will be adopted or
minted, so an adoption there could honestly be subtracted back out — but
syncModules() has never counted a module's own Product as an intent at all; it
only counts a module's Prices. Reading AdoptStripeProduct::adoptions as one
run-wide delta could not tell the two apart, so a module Product adopted from
an interrupted run silently inflated "adopted" and shrank "created" by exactly
one, for a Product the command never claimed to have made in the first place.

The fix counts the family side locally, at the one call site that already
counts the intent, and leaves a module's Product out of both figures entirely —
adopted or minted, it was never counted, so neither number may move for it.
AdoptStripeProduct::$adoptions is gone with it: nothing reads a singleton-wide
total that cannot be attributed to one side or the other, and keeping it around
unread would be exactly the kind of state this codebase does not leave lying
about.

The duplicate-product report had the same shape of bug one line down: it read
straight off the singleton's list with no before/after snapshot, so a second
handle() call in one process would reprint a duplicate an earlier run already
named. Sliced to what this run itself added, the same way the counters beside
it already were.

Also: the unread `$charged` line in the adoption test that TDD had already
exercised as dead weight, and its now-unused PlanPrices import.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-30 18:20:27 +02:00
..
Actions Stop charging VAT to the customers who owe us none 2026-07-30 02:15:41 +02:00
Console Subtract only what was counted, not everything a singleton adopted 2026-07-30 18:20:27 +02:00
Exceptions Refuse a portal login for an address that already belongs to an operator 2026-07-28 14:42:16 +02:00
Http Sell the year as well as the month, and say what it saves 2026-07-30 15:44:35 +02:00
Jobs Let the export have as many destinations as somebody wants 2026-07-29 02:43:15 +02:00
Listeners Keep a register of what was sent, and answer the customer from here 2026-07-29 21:02:36 +02:00
Livewire Take the address by field, fix the customer type, ask why they leave 2026-07-30 16:41:32 +02:00
Mail Accept terms instead of a start date, and fix the sender no server accepts 2026-07-30 15:22:35 +02:00
Models Take the address by field, fix the customer type, ask why they leave 2026-07-30 16:41:32 +02:00
Notifications Add the SSH identity to the vault, and give deployment config a console page 2026-07-29 00:52:44 +02:00
Observers Say the same thing to the customer, the register and the bank 2026-07-30 01:30:24 +02:00
Policies Move the console's identity out of the customer table 2026-07-28 10:31:43 +02:00
Providers Subtract only what was counted, not everything a singleton adopted 2026-07-30 18:20:27 +02:00
Provisioning Fix nine defects in the provisioning pipelines 2026-07-30 01:34:55 +02:00
Services Subtract only what was counted, not everything a singleton adopted 2026-07-30 18:20:27 +02:00
Support Make mails readable on a phone, and let an operator look at one 2026-07-30 14:50:37 +02:00