Household: member names and the subscription-names opt-in (v0.3.0) #4

Manually merged
mnovak merged 1 commits from feature/household into main 2026-11-04 16:17:51 +01:00
Owner

Closes the two v1 gaps left after day 2 on the core side: who is who in a shared budget, and the opt-in for household duplicates ("You both pay Spotify").

Events

Event Log Rule
profile.named {name} personal 1-40 characters, trimmed; the latest counts
household.sharing_set {budget, on} personal a shared budget only: rejected for the default budget or an unknown one
member.named {budget, name} shared budget the budget must exist there; 1-40 characters
subscriptions.shared {budget, names} shared budget at most 100 names, each 1-40 characters, no repeats, no surrounding spaces; [] withdraws

The state keeps profile_name and household_sharing. A shared budget's state keeps nothing per author: the app folds the latest per author, because only Fundamentum knows who wrote what.

fiscus-insight::household::shared_names(state, today)

What leaves when someone opts in: the service key of every subscription still paid (active, or charged after a cancel), sorted, at most 100. PAYPAL *SPOTIFY 4029357733 leaves as spotify. Merchant text, references and amounts never leave.

Tests (first)

  • fiscus-ledger/tests/household.rs: the profile name is trimmed and bounded; the opt-in works per shared budget only; member and subscription events need the budget and are bounded; the new type tags round-trip as JSON.
  • fiscus-insight/tests/household.rs: only service keys of subscriptions still paid; a too-short key (TV) is not sent; a cancelled one drops out.

cargo test --workspace: 92 passed.

Self-review

  • No float, no I/O, no clock: today is a parameter.
  • Hostile input: every new event has bounds, and apply() stays total, so anything else is a typed rejection.
  • Privacy: the opt-in is off by default. Without it the app sends subscriptions.shared only to withdraw names it sent before, and only keys ever leave.
  • clippy: clean for the new code. Three new toolchain lints fire on older code (merchant.rs:9, money.rs:52, subscriptions.rs:152), and cargo fmt --check shows older drift. Both are left for a separate cleanup so this diff stays small.
  • The workspace version becomes 0.3.0, a minor bump for the new events. The Fiscus side follows with the tag.
Closes the two v1 gaps left after day 2 on the core side: who is who in a shared budget, and the opt-in for household duplicates ("You both pay Spotify"). ## Events | Event | Log | Rule | |:--|:--|:--| | `profile.named {name}` | personal | 1-40 characters, trimmed; the latest counts | | `household.sharing_set {budget, on}` | personal | a shared budget only: rejected for the default budget or an unknown one | | `member.named {budget, name}` | shared budget | the budget must exist there; 1-40 characters | | `subscriptions.shared {budget, names}` | shared budget | at most 100 names, each 1-40 characters, no repeats, no surrounding spaces; `[]` withdraws | The state keeps `profile_name` and `household_sharing`. A shared budget's state keeps nothing per author: the app folds the latest per author, because only Fundamentum knows who wrote what. ## `fiscus-insight::household::shared_names(state, today)` What leaves when someone opts in: the **service key** of every subscription still paid (active, or charged after a cancel), sorted, at most 100. `PAYPAL *SPOTIFY 4029357733` leaves as `spotify`. Merchant text, references and amounts never leave. ## Tests (first) - `fiscus-ledger/tests/household.rs`: the profile name is trimmed and bounded; the opt-in works per shared budget only; member and subscription events need the budget and are bounded; the new type tags round-trip as JSON. - `fiscus-insight/tests/household.rs`: only service keys of subscriptions still paid; a too-short key (`TV`) is not sent; a cancelled one drops out. `cargo test --workspace`: 92 passed. ## Self-review - No float, no I/O, no clock: `today` is a parameter. - Hostile input: every new event has bounds, and `apply()` stays total, so anything else is a typed rejection. - Privacy: the opt-in is off by default. Without it the app sends `subscriptions.shared` only to withdraw names it sent before, and only keys ever leave. - clippy: clean for the new code. Three new toolchain lints fire on older code (`merchant.rs:9`, `money.rs:52`, `subscriptions.rs:152`), and `cargo fmt --check` shows older drift. Both are left for a separate cleanup so this diff stays small. - The workspace version becomes 0.3.0, a minor bump for the new events. The Fiscus side follows with the tag.
mnovak added 1 commit 2026-11-04 16:17:38 +01:00
mnovak manually merged commit deb31374ea into main 2026-11-04 16:17:51 +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#4