Files
mesh-controller/internal/inventory/migrations/0014-what-a-machine-was-last-sent.sql
T
jschoubben 5a28434ba8 "Behind" means not running what the mesh would send
It meant "failed or refused". So a machine that applied cleanly and whose
declaration has since changed was not behind — and novox/hq ADR 0010's
question, did my change go out?, was answerable exactly for the machines that
broke. For every machine that worked, the answer was silence whether the change
had gone out or not, which is the thing replacing a pipeline was supposed not
to cost.

The mesh now records a digest of what it last sent each machine. A digest
rather than the declaration: it can compute what a machine should be at any
moment, and keeping a copy would be a second account of it able to disagree
with the first. What cannot be recomputed is what was actually sent.

Recorded after the send, not before — a digest kept for something that failed
to send would make the machine look current for a declaration it never
received.

Never told stays separate from out of date. The remedy is the same push and the
situations are not alike: nobody has ever asked that machine to be anything.
And a machine the mesh could not work out is not reported as waiting, because
saying so would invent a comparison — that is `plan`'s answer to give.

`status` says it and `push --behind` sends it, or the flag would know something
the person reading the status does not.
2026-08-31 05:17:21 +02:00

16 lines
932 B
SQL

-- What the mesh last sent a machine, as a digest.
--
-- Not the declaration itself: the mesh can compute that again at any moment, and keeping a copy
-- would be a second account of what a machine should be, able to disagree with the first. What
-- cannot be recomputed is *what was actually sent*, and that is the whole of the difference
-- between "this machine is out of date" and "this machine has never been told".
--
-- Without it, "behind" could only mean "failed or refused" — so a machine that applied cleanly and
-- whose declaration has since changed was not behind, and novox/hq ADR 0010's question, *did my
-- change go out?*, was answerable only for machines that broke.
alter table node add column sent text;
-- When, so a machine sent something long ago and silent since is distinguishable from one sent
-- something a moment ago that has not had time to answer.
alter table node add column sent_at timestamptz;