Files
mesh-controller/internal/inventory/migrations/0018-a-report-names-its-declaration.sql
T
jschoubben 1b63e21c0f Caught up is an equality, not an ordering
The report carries the digest of the declaration it applied (mesh-host
8211d8b), and the mesh stores it beside the outcome. `reported` rows in
the status JSON now say `current`: whether the machine's last word
names the declaration last sent.

Not derivable from the timestamps beside it, which is why they were
not enough: an apply begun under the previous declaration reports
after the next send — newer, and still about the old words. The lab
lost exactly that race between one test's closing push and the next
test's opening one.

Empty digests — every host from before reports carried one — read as
not current, which errs toward waiting rather than toward asserting on
files that are not there yet.
2026-09-02 00:02:44 +02:00

13 lines
785 B
SQL

-- Which declaration a machine's report is about.
--
-- The mesh decided "has this machine caught up" by comparing its send time to the report's
-- arrival, and lost the race it invited: an apply started under the previous declaration
-- finishes after the next one is sent, its report lands newer than the send, and the machine
-- reads as caught up with words it has not read yet.
--
-- The report now carries the digest of the exact bytes it applied -- the same bytes, hashed the
-- same way, that `node.sent` records. Caught up is `declared = sent`: an equality the mesh
-- checks rather than an ordering it hopes. Empty means the machine has not said, which is every
-- report from before this column existed.
alter table node_report add column declared text not null default '';