package host import ( "errors" "github.com/carlosframework/platform/internal/hostclaim" "github.com/carlosframework/platform/internal/provision" ) var errRootMigrationBusy = errors.New("root migration requires an idle, complete census") // Call only on fresh authoritative records while admission is excluded. // The caller also checks root journals and kernel reservations before writing. func rootMigrationPreflight(complete bool, records []provision.Record, claims []hostclaim.Claim) error { if !complete { return errRootMigrationBusy } for _, rec := range records { // Committed still owns cleanup; MoveComplete clears Move when settled. if rec.Move != nil { return errRootMigrationBusy } } for _, claim := range claims { // Refuse every active operation, including unknown future kinds. if claim.Op.ID != "" || (claim.Op.Kind != "" && claim.Op.Kind != hostclaim.KindServing) || claim.Op.Phase != "" { return errRootMigrationBusy } } return nil }