Stop a clean migration reporting domains it never lost

The post-migration comparison had the two versions counting domains
differently, and yesterday's wiring turned that into a gate: `run` would have
failed a migration that lost nothing.

The 0.15 side added every domain appearing in any account's address on top of
the domain principals - the fallback's own comment says "if the instance has
no explicit domain principals", but the loop ran unconditionally. The 0.16
side did the reverse, listing only domains some account calls its primary,
discarding the full Domain list it had already fetched. An instance with
three declared domains and accounts aliased across nine reported nine before
and three after. INBUXA is exactly that shape, and this was the account/domain
over-count noted as undiagnosed.

Both sides now mean "the domains this server holds". A domain that still goes
missing is reported as a warning rather than failing the run: what the two
versions call a domain differs across this boundary in ways we have now been
caught by once, and a missing account - which is compared with a local-part
fallback and is what actually matters - still fails.

Narrowing OK() also made String() return before printing the domain lines,
so the new warning would have been silent. Caught by its own test.
This commit is contained in:
2026-08-24 13:26:15 -07:00
parent 28128633ef
commit 3adaee3bc6
9 changed files with 156 additions and 24 deletions
+10 -2
View File
@@ -71,11 +71,16 @@ func RunLive(ctx context.Context, store *checkpoint.Store, rs *checkpoint.RunSta
if err != nil {
return checkpoint.StepOutcome{}, err
}
if !r.OK() {
switch {
case !r.OK():
// Recorded as a completed step with a failing verdict rather
// than an error: the comparison ran, and its answer is the
// finding. An error here would read as "we could not look".
return checkpoint.StepOutcome{Verdict: string(StatusFail), Detail: r.String()}, nil
case !r.DomainsOK():
// The two versions disagree about what counts as a domain, so
// this is reported rather than treated as data loss.
return checkpoint.StepOutcome{Verdict: string(StatusWarn), Detail: r.String()}, nil
}
return checkpoint.StepOutcome{Detail: r.String()}, nil
})
@@ -88,8 +93,11 @@ func RunLive(ctx context.Context, store *checkpoint.Store, rs *checkpoint.RunSta
}
status := StatusOK
if outcome.Verdict == string(StatusFail) {
switch outcome.Verdict {
case string(StatusFail):
status = StatusFail
case string(StatusWarn):
status = StatusWarn
}
report.Results = append(report.Results, CheckResult{Name: "content-integrity", Status: status, Detail: outcome.Detail})
return report, nil