Check the migration actually kept everything, and let report say so

internal/validate was written and tested and then never called: `run` ended
at cutover, so the tool performed a migration and never confirmed it had
carried the data across, and `report` was an error message pointing at the
package that would have answered.

`run` now compares the migrated instance against the snapshot preflight took
and fails if an account or a domain that existed before is missing from it.
The comparison runs against the service cutover has just started, which is
the instance people will actually use - its real config, its real ports,
under its real service manager - and costs no extra downtime; booting a
second copy inside the maintenance window would. BootCheck stays as the
equivalent for an instance the tool boots itself.

The service is left running on a failure. By that point the store has been
migrated in place, so stopping it undoes nothing, and only the operator can
weigh the finding against their recovery point.

A check that could not run is reported as skipped, never as a pass. Preflight
only captures the "before" when it has an admin URL, and a run without one
has to say it compared nothing rather than imply everything survived - which
is the exact failure ARCHITECTURE.md §4.7 warns about. `report <run-id>`
re-reads the recorded verdict rather than re-checking: run again next week
and you would be asking how the instance looks now, not how it looked when
it was migrated.

§4.7 said validation ran after cutover while the only implementation booted
its own copy, and listed a suite far larger than what exists. It now says
which of the two happens, and which checks are real.
This commit is contained in:
2026-08-24 12:27:36 -07:00
parent 558af1005f
commit 28128633ef
9 changed files with 515 additions and 7 deletions
+5
View File
@@ -13,6 +13,11 @@ type Status string
const (
StatusOK Status = "ok"
StatusFail Status = "fail"
// StatusSkip is a check that could not be performed. It is deliberately
// not StatusOK: "every account survived" and "we were unable to look"
// are different answers, and reporting the second as the first is the
// failure mode ARCHITECTURE.md §4.7 warns about.
StatusSkip Status = "skip"
)
type CheckResult struct {