hub: review fix 4 — the hub writes the household's receipt; a box cannot word it or flood it (D84)

offsite_end_scheduled bypasses the household's switches and went through the
ordinary customer leg: subject and body were the box's own sentence, and 50
invented subjects gave 50 mails.

- processReceipt: the details must name a checked app (app-name shape, not
  reserved) and two parsed dates; the mail is rendered only from the hub's
  bundle with that app and the parsed end date — never the box's message.
- The cooldown key is the checked app + the parsed time of the press.
- At most 5 receipts per household in 24 hours, counted in the hub's sent log;
  drops are said once a day; old receipt keys leave the cooldown map.
- Pinned: a blocked household and a household with no address get none.

Tests seen red before the fix; 12 mutations seen red, 3 after a redo
(documentation/audits/build-release-4-2026-11-15/A/redproof-review-4.txt).

Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
admin committed 2026-11-15 14:46:27 +01:00
1 parent 875c339cf5
commit be272b7cf4
10 files changed
+455 -26

No files matched your search

@@ -1892,7 +1892,10 @@ part alone, exactly as before, and still raises `offsite_snapshots_vanished`.
**The mail (D84)** `[FACT — built, not released]`. At the press the box sends `offsite_end_scheduled`; the hub mails
it to the household's own notification address — once per press, in the household's language, whatever its group
switches say (a receipt: `notify.householdReceiptEvents`), and not to the operator. **A household with no
switches say (a receipt: `notify.householdReceiptEvents`), and not to the operator. **The hub writes the mail, not the
box** (review of 2026-11-15): subject and body come from the hub's own bundle, with an app name the hub checked and
the end date it parsed from the details; the box's sentence is never mailed. A household gets at most 5 receipts in
24 hours (counted in the hub's sent log); the rest are dropped and said once a day in the hub's log. **A household with no
notification address gets no mail: the page is all it has.** A blocked household gets none either.
**Edge cases, each with its rule and its test.**
@@ -1985,7 +1988,7 @@ final dot (`2026. 12. 15.`), so the Hungarian sentences have no dot after it.
| A press that is refused (the app is installed; no hub tier) | „Ennek az alkalmazásnak a távoli másolatait most nem lehet törlésre kijelölni.” | "The off-site copies of this app cannot be marked for deletion now." |
| A record that could not be saved | „Nem sikerült elmenteni. Próbáld újra.” | "This could not be saved. Try again." |
| **The mail — subject** | „[Felhom] Információ: {app}: a távoli másolatok törlésre kijelölve” | "[Felhom] Information: {app}: the off-site copies are marked for deletion" |
| **The mail — body** (inside the hub's ordinary household mail frame: greeting, server, time, level, type, sign-off) | „{app}: az alkalmazás távoli másolatai törlésre vannak kijelölve. Törlésük napja: {dátum} Addig a Mentések oldalon a „Mégis megtartom” gombbal visszavonhatod.” | "{app}: the off-site copies of this app are marked for deletion. They are deleted on: {date}. Until then you can take this back on the Backups page with the “Keep it after all” button." |
| **The mail — body** (the HUB's own sentence, `mail.receipt.offsite_end_scheduled`, inside the hub's ordinary household mail frame: greeting, server, time, level, type, sign-off; the box's event carries the same sentence for the event list only) | „{app}: az alkalmazás távoli másolatai törlésre vannak kijelölve. Törlésük napja: {dátum} Addig a Mentések oldalon a „Mégis megtartom” gombbal visszavonhatod.” | "{app}: the off-site copies of this app are marked for deletion. They are deleted on: {date}. Until then you can take this back on the Backups page with the “Keep it after all” button." |
No mail to the household at the deletion: it can do nothing with it (`08` §8.1). The operator's records are
`offsite_ended_app_removed` (info, per app, not mailed) and `offsite_ended_app_refused` (warning) — `08` §6.5.