Commit Graph

2 Commits (main)

Author SHA1 Message Date
Amir Alexander Abdelbaki f4de1e7cec Build the Pebble watchapp
The floorplan on a wrist, rendering the same GET /floorplan/presence payload as
render/floorplan-3d. If the two ever disagree, one of them is lying.

An app rather than a face, because buttons decide it: watchfaces receive no
button events and Pebble restricts touch to apps, and cycling through rooms was
the point. That costs being the default screen, and it means the JS — therefore
the data — only lives while the app is open, so every launch begins with a
fetch. The last plan is persisted and drawn immediately WITH ITS AGE, then
repainted when the fetch lands: a spinner on a screen that already has something
true to say is worse than slightly stale truth, clearly labelled.

The screens
  Plan: occupied rooms light, empty dark, and a dotted edge for rooms HA never
  reports on — "nobody is in the study" and "nothing can see the study" are
  different sentences. Occupancy reads in lightness, never hue, because colour
  already means who. Fused positions are drawn where the person is; an
  unattributed radar target is a hollow ring with no colour and no initial,
  since every visual language here for a person is reserved for people the
  system can name.

  Detail: one room per screen, Up/Down wrapping at both ends, each person a
  coloured dot plus their name. "Nobody here" is printed rather than left blank,
  which reads as a fault. The last entry in the cycle is "Somewhere in the
  house" — the people it cannot place are exactly who you picked the watch up
  to find.

The wire format is the fragile part
  One packed byte array, ~80 bytes for a three-room plan with names, written in
  JS and read in C — two implementations of one format, in two languages, that
  never run in the same process. Drift between them decodes as plausible-looking
  garbage rather than as an error, so test/run-tests.sh builds a payload with the
  real writer and decodes it with the real reader compiled against a stub SDK. It
  also checks that a truncated payload is refused wholesale (half a plan looks
  exactly like a whole one) and that a version mismatch is refused rather than
  decoded.

  That test earned itself immediately: it caught a disagreement about whether a
  radar target in a room HA does not report should read as occupied or unknown.
  The code was right — a positive detection outranks no-data — and the test's
  expectation was wrong.

Unverified, and both are about the new hardware rather than the code: the Round
2's platform identifier, and its round-screen detection in the JS. Nothing
hardcodes a resolution, so both are one-line changes once the SDK names them.
It has never run on a watch, in an emulator, or against a real identity.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FanS1vyE2gLhGkqKq6HtYj
2026-08-10 15:12:38 +02:00
Amir Alexander Abdelbaki a948f4b375 Workshop assistant, fleet monitoring, infra health, and shared endpoint surfaces
Adds the workshop/office assistant and the plumbing several other features
were waiting on. The through-line: every new capability that could act on
its own proposes instead, and says out loud when it does not know something.

New service — workshop/
  Project notebook (workshop.db) plus a never-pruned knowledge store
  (workshop-knowledge.db): standing workflow instructions by activity,
  keyword facts, durable project learnings, and the household's ONE hardware
  inventory. GET /context returns everything applying right now in one call,
  so the assistant is told the standing considerations rather than reminded
  of them. Two databases because they have different lifetimes: rebuilding
  the project store must not take the note about how you solder with it.

  Hardware statuses distinguish reserved (still on the shelf) from in_use
  (installed and working) — "can I use this right now" has different answers
  for the two, and naming a project on an in_use item never silently demotes
  it.

  Gitea repos with append-only history: commit/push/branch yes, unattended;
  force-push/rebase/amend/reset/filter-repo never, enforced server-side by
  branch protection rather than only by this code refusing. When history
  genuinely must be scrubbed, /scrub-request prints the commands for a human
  to run — the manual step is the safety mechanism.

  Fleet scripts: one monitoring-agent script per kind of machine, fetched by
  each endpoint's fleet-bootstrap timer. Remote code execution by design, so
  the constraints are the design — upload is a draft, publishing is separate,
  scripts live in SQLite rather than on the writable share, every version is
  kept, and the endpoint verifies the checksum and reports pass or fail.
  Slots exist for the ESP32s and network appliances that cannot run a script
  at all, holding the CheckMK-server-side config instead.

Infrastructure health
  opnsense becomes a LIST of firewalls, each named, keyed by name rather than
  index. CheckMK joins it. Both are polled by workshop (always-on) and read
  by digest-engine, so the digest can say "critical since Tuesday" instead of
  quoting a six-hour-old snapshot. Three states, because "I could not ask" is
  not "nothing is wrong".

pantry-vision
  All four stock movements are camera-driven; stock counts individual units
  and folds brand-free via Grocy product groups. Door-sensor-triggered
  appliance cameras record sightings as hints with timestamps, never as
  stock — a camera at a door cannot tell in from out.

identity
  Per-person colour and settable profile picture, assigned to avoid collisions
  between people sharing an initial, on the 2-bit-per-channel lattice a colour
  Pebble renders natively.

render/ — shared, vendored, dependency-free
  media-visualiser: two-tier by necessity, since most endpoints have no local
  audio; the synthetic tier says on screen that it is not an analysis.
  floorplan-3d: canvas 2D rather than three.js — the scene is prisms on a
  plane, which an isometric projection draws in ~200 lines, predictably on
  weak panels, with the frontend still at zero dependencies.

Config and fleet plumbing
  Rooms are one vocabulary (an HA area_id) from CoreSystemConfig through the
  builders to suggested_area. Keycloak and FreeIPA are coupled as one
  decision with USR_HA_ group naming, declaration-only for now and validated
  as such. Immich alongside the photo share, read-only. Thin clients get the
  full media-key set for a wireless remote.

Docs: fridge-item-location, workshop-assistant, rooms-and-endpoints,
endpoint-surfaces, pebble-presence-watchface.

Testing is stubbed suites and headless unit checks only — no real Grocy,
camera, vision model, CheckMK, Gitea, Samba or browser has been involved.
The CheckMK API shape and Gitea's branch-protection payload are written from
documentation and have version-sensitive field names.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FanS1vyE2gLhGkqKq6HtYj
2026-08-10 14:54:37 +02:00