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.
This commit is contained in:
2026-09-02 00:02:44 +02:00
parent 649ce9bc3b
commit 1b63e21c0f
5 changed files with 39 additions and 10 deletions
+4 -3
View File
@@ -155,9 +155,10 @@ func (e Enrolment) Heard(ctx context.Context, report Report) error {
// last_seen and the reason went to a log line, so "which machine is not doing what it was
// told" had no answer the next morning — which is the question a mesh exists to answer.
doing := inventory.Doing{
Outcome: inventory.OutcomeApplied,
Refused: report.Refused,
Applied: len(report.Applied),
Outcome: inventory.OutcomeApplied,
Refused: report.Refused,
Applied: len(report.Applied),
Declared: report.Declared,
}
switch {
case report.Refused != "":
+3
View File
@@ -94,6 +94,9 @@ type Report struct {
//
// The node states and this context writes, which is the shape of every message here.
Carried []int `json:"carried,omitempty"`
// Declared is the digest of the declaration this report is about — the same bytes, hashed
// the same way, as the `sent` digest the mesh recorded. Which declaration, not when.
Declared string `json:"declared,omitempty"`
}
// EnrolReply is what the mesh says back.