What is the Home maintenance MVP? #61

Closed
opened 2026-11-23 16:05:26 -05:00 by bobby · 2 comments
Owner

Part of #44

Question

What does the home maintenance domain need at MVP: core entities (assets, tasks, recurrence schedules, completion history?), reminder behaviour, the first endpoints/flows, and what is explicitly deferred?

Part of #44 ## Question What does the home maintenance domain need at MVP: core entities (assets, tasks, recurrence schedules, completion history?), reminder behaviour, the first endpoints/flows, and what is explicitly deferred?
bobby added the wayfinder:grilling label 2026-11-23 16:05:26 -05:00
bobby added a new dependency 2026-11-23 16:05:35 -05:00
bobby self-assigned this 2026-11-25 13:10:04 -05:00
Author
Owner

Resolution: Maintenance MVP

The domain is renamed Maintenance (/v1/maintenance/..., Scopes maintenance:read|write). It covers the upkeep of the Household's physical property: the home, its land, its equipment, and its vehicles. It's mainly for recurring, infrequent upkeep plus a history of the work done. Terms are in GLOSSARY.md → Maintenance.

Ownership (ADR-0001 / ADR-0005 applied)

  • Everything is Household data. There's no Personal variant, even for a car titled to one Person: the upkeep record is shared. Every Household member has equal read/write. A Person who isn't a Household member has no access.
  • Standard maintenance:read|write Household grants exist. No Bot ships in v1.

Entities

  • Asset: any physical thing kept up (roof, furnace, fridge, car). Fields: name (required); optional location, make, model, serial (the VIN for a car), installed_on, warranty_until, notes; archived. An optional meter has unit distance|duration and can be set only while the Asset has no Readings. On replacement or sale, archive the Asset (its Services stay), then re-point or archive its Tasks. Delete only if nothing references it.
  • Reading: an Asset's meter value on a date (read_on, value as an SI integer: m or s), optional external_id, recorded_by. The latest Reading drives usage-based due dates.
  • Task: always recurring. Fields: title, optional asset_id, note, optional lead_days, archived, snoozed_until.
    • Floating: an interval (count + unit) after the last Service.
    • Fixed: a restricted RRULE (FREQ, INTERVAL, BYMONTH, BYMONTHDAY, BYDAY with ordinals, BYSETPOS; no COUNT/UNTIL) with a start date, computed with dateutil.rrule. For example FREQ=MONTHLY;BYDAY=1SA.
    • Optional usage interval (e.g. 5,000 mi as metres) in either mode. The Task is due on whichever comes first, judged against the latest Reading. There's no projection of future mileage.
    • First due date: from the latest Service if one exists (log a backdated Service if you know when the work was last done), otherwise creation date + one interval. A fixed Task's first due date is the rule's next occurrence.
    • Snooze hides the Task as due until snoozed_until without moving the schedule. Archive stops it coming due. Delete only while it has no Services.
  • Service: any work done on a date. Fields: done_on (required), optional task_id (fulfilling it resets a floating schedule), optional asset_id, title (required when there's no Task), optional done_by (Person; may differ from recorded_by), note, cost_cents (USD, no Finance link), meter_value, optional external_id. One-off past work ("fixed the faucet") is a standalone Service. There are no future one-off to-dos, which keeps the domain from drifting into a to-do list.

API surface (flat, owner + recorded_by on every record)

  • assets: CRUD, archive. assets/{id}/readings: list, create, PATCH, DELETE (hard).
  • tasks: CRUD, archive, snooze. Each response carries computed due_on / due_at_meter and status: ok|due|overdue|snoozed. GET /tasks?due_before=…&status=… is the "what's due" view. Nothing is stored, so editing or deleting a Service just changes the next read.
  • services: list (filters: Task, Asset, date range), create, PATCH, DELETE (hard).
  • Idempotent creates on Services and Readings: a repeated external_id (unique per Household) returns 200 with the existing record.
  • SI integers throughout. No seed data.

Requirement on the Scheduling/ntfy fog

Notify the Household when a Task becomes due or overdue, honouring per-Task lead_days. The notifier must be triggered by events as well as on a schedule, because a new Reading can make a usage-based Task due. Timing, deduplication, and quiet hours belong to the shared capability.

Deferred to Maintenance v2

Attachments (photos, receipts, manuals; these need object storage); linking a Service's cost to a Finance Transaction; an HA Bot posting runtime Readings (e.g. furnace hours driving filter Tasks; the external_id and meters are ready for it); HA completing Tasks or creating Jobs from them; future one-off to-dos.

Out of scope

hAPI's own infrastructure upkeep (server patching etc.), which stays with Renovate, Flux, and the talosctl runbook.

No ADR: nothing here is hard to reverse.

## Resolution: Maintenance MVP The domain is renamed **Maintenance** (`/v1/maintenance/...`, Scopes `maintenance:read|write`). It covers the **upkeep of the Household's physical property: the home, its land, its equipment, and its vehicles**. It's mainly for recurring, infrequent upkeep plus a history of the work done. Terms are in `GLOSSARY.md` → *Maintenance*. ### Ownership (ADR-0001 / ADR-0005 applied) - **Everything is Household data.** There's no Personal variant, even for a car titled to one Person: the upkeep record is shared. Every Household member has equal read/write. A Person who isn't a Household member has no access. - Standard `maintenance:read|write` **Household grants** exist. No Bot ships in v1. ### Entities - **Asset**: any physical thing kept up (roof, furnace, fridge, car). Fields: `name` (required); optional `location`, `make`, `model`, `serial` (the VIN for a car), `installed_on`, `warranty_until`, `notes`; `archived`. An optional **meter** has unit `distance|duration` and can be set only while the Asset has no Readings. On replacement or sale, archive the Asset (its Services stay), then re-point or archive its Tasks. Delete only if nothing references it. - **Reading**: an Asset's meter value on a date (`read_on`, `value` as an SI integer: m or s), optional `external_id`, `recorded_by`. The latest Reading drives usage-based due dates. - **Task**: always recurring. Fields: `title`, optional `asset_id`, note, optional `lead_days`, `archived`, `snoozed_until`. - **Floating**: an interval (count + unit) after the last Service. - **Fixed**: a restricted **RRULE** (`FREQ`, `INTERVAL`, `BYMONTH`, `BYMONTHDAY`, `BYDAY` with ordinals, `BYSETPOS`; no `COUNT`/`UNTIL`) with a start date, computed with `dateutil.rrule`. For example `FREQ=MONTHLY;BYDAY=1SA`. - Optional **usage interval** (e.g. 5,000 mi as metres) in either mode. The Task is due on **whichever comes first**, judged against the latest Reading. There's no projection of future mileage. - **First due date**: from the latest Service if one exists (log a backdated Service if you know when the work was last done), otherwise creation date + one interval. A fixed Task's first due date is the rule's next occurrence. - **Snooze** hides the Task as due until `snoozed_until` without moving the schedule. **Archive** stops it coming due. Delete only while it has no Services. - **Service**: any work done on a date. Fields: `done_on` (required), optional `task_id` (fulfilling it resets a floating schedule), optional `asset_id`, `title` (required when there's no Task), optional `done_by` (Person; may differ from `recorded_by`), note, `cost_cents` (USD, no Finance link), `meter_value`, optional `external_id`. One-off past work ("fixed the faucet") is a standalone Service. **There are no future one-off to-dos**, which keeps the domain from drifting into a to-do list. ### API surface (flat, `owner` + `recorded_by` on every record) - `assets`: CRUD, archive. `assets/{id}/readings`: list, create, `PATCH`, `DELETE` (hard). - `tasks`: CRUD, archive, snooze. Each response carries computed `due_on` / `due_at_meter` and `status: ok|due|overdue|snoozed`. `GET /tasks?due_before=…&status=…` is the "what's due" view. Nothing is stored, so editing or deleting a Service just changes the next read. - `services`: list (filters: Task, Asset, date range), create, `PATCH`, `DELETE` (hard). - Idempotent creates on Services and Readings: a repeated `external_id` (unique per Household) returns `200` with the existing record. - SI integers throughout. No seed data. ### Requirement on the Scheduling/ntfy fog Notify the Household when a Task becomes due or overdue, honouring per-Task `lead_days`. The notifier must be **triggered by events as well as on a schedule**, because a new Reading can make a usage-based Task due. Timing, deduplication, and quiet hours belong to the shared capability. ### Deferred to Maintenance v2 Attachments (photos, receipts, manuals; these need object storage); linking a Service's cost to a Finance Transaction; an **HA Bot posting runtime Readings** (e.g. furnace hours driving filter Tasks; the `external_id` and meters are ready for it); HA completing Tasks or creating Jobs from them; future one-off to-dos. ### Out of scope hAPI's own infrastructure upkeep (server patching etc.), which stays with Renovate, Flux, and the `talosctl` runbook. No ADR: nothing here is hard to reverse.
bobby closed this issue 2026-11-25 14:05:40 -05:00
Author
Owner

Reversed by Which cluster hardening ships in v1? (ADR-0015): Maintenance now also covers the Household's digital systems. The map's out-of-scope line for 'hAPI's own infrastructure upkeep as Maintenance Tasks' is removed. A "hAPI cluster" Asset carries the monthly "Upgrade the cluster" Task and ADR-0014's "Rehearse disaster recovery" Task. It still isn't a to-do list: Tasks must recur. Patching itself still runs through Renovate and the talosctl runbook; the Task is only the reminder.

**Reversed by *Which cluster hardening ships in v1?* (ADR-0015):** Maintenance now also covers the Household's digital systems. The map's out-of-scope line for 'hAPI's own infrastructure upkeep as Maintenance Tasks' is removed. A **"hAPI cluster" Asset** carries the monthly "Upgrade the cluster" Task and ADR-0014's "Rehearse disaster recovery" Task. It still isn't a to-do list: Tasks must recur. Patching itself still runs through Renovate and the `talosctl` runbook; the Task is only the reminder.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: bobby/hapi#61