P2 redesign Phase 5 — prune/check/unlock + maintenance ticker + repo stats + pending-runs queue #3

Merged
steve merged 37 commits from p2r-phase5-maintenance into main 2026-05-04 10:25:02 +01:00
Showing only changes of commit bc77081366 - Show all commits
+7
View File
@@ -116,6 +116,13 @@ func TestMigration0009Schema(t *testing.T) {
t.Fatal("expected unique constraint violation on (host_id, kind), got nil")
}
// CHECK (kind IN ('repo','admin')) must reject an invalid kind.
if _, err := s.DB().ExecContext(ctx,
`INSERT INTO host_credentials (host_id, kind, enc_repo_creds, updated_at) VALUES (?,?,?,?)`,
"h-0009", "other", "enc-other", now); err == nil {
t.Fatal("expected CHECK constraint violation on kind='other', got nil")
}
// host_repo_stats table must exist with expected columns.
if _, err := s.DB().ExecContext(ctx,
`INSERT INTO host_repo_stats (host_id, lock_present, updated_at) VALUES (?,?,?)`,