[ledger] Sharing: only an explicit assignment shares a payment; budget.shared; v0.2.1 #3

Manually merged
mnovak merged 2 commits from fix/explicit-sharing into main 2026-11-03 23:36:12 +01:00
Owner

A boundary bug that Fiscus's integration test found. A person whose only budget is a shared one (for example someone who just joined "Holiday") has it as their default budget. Their unassigned payments then counted as "in" it, so shared_payment would have sent them to the other members.

What changes

  • shared_payment needs an explicit payment.assigned: the latest one on either half of a confirmed pair. Falling into a budget as the default never shares a payment.
  • New budget.shared event: a shared budget in a personal log, created there or joined. It behaves like budget.created, but it is never the default budget. Unassigned spending therefore never shows under a budget other people see, even locally.
  • Version 0.2.1. The design note says both.

Tests: 87 pass, 0 fail

Two new tests in sharing:

  • A payment whose budget is only the default isn't shared.
  • budget.shared is never the default, an explicit assignment shares, and a second budget.shared with the same id is rejected.

Self-review

  • EventBody gains a variant: Fiscus (the only user) must handle budget.shared wherever it matches events. Its fiscus-sync writes it on create and join.
  • No change to budget.created or to any day-1 event: existing logs replay byte-identically, and the replay tests are unchanged and green.
A boundary bug that Fiscus's integration test found. A person whose only budget is a shared one (for example someone who just joined "Holiday") has it as their **default** budget. Their unassigned payments then counted as "in" it, so `shared_payment` would have sent them to the other members. ## What changes - **`shared_payment` needs an explicit `payment.assigned`:** the latest one on either half of a confirmed pair. Falling into a budget as the default never shares a payment. - **New `budget.shared` event:** a shared budget in a personal log, created there or joined. It behaves like `budget.created`, but it is never the default budget. Unassigned spending therefore never shows under a budget other people see, even locally. - Version 0.2.1. The design note says both. ## Tests: 87 pass, 0 fail Two new tests in `sharing`: - A payment whose budget is only the default isn't shared. - `budget.shared` is never the default, an explicit assignment shares, and a second `budget.shared` with the same id is rejected. ## Self-review - **`EventBody` gains a variant:** Fiscus (the only user) must handle `budget.shared` wherever it matches events. Its `fiscus-sync` writes it on create and join. - **No change to `budget.created` or to any day-1 event:** existing logs replay byte-identically, and the replay tests are unchanged and green.
mnovak added 2 commits 2026-11-03 23:36:09 +01:00
mnovak manually merged commit 11a4070151 into main 2026-11-03 23:36:12 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mnovak/FiscusPublic#3