fix(cli): enforce verified backups and reliable upgrade/rollback outcomes #152
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#152
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The release-risk review from
1bb097dd1athrough the statistics-deck implementation found existing weaknesses inhikctl update applyand rollback. A larger release involving schema migrations, calibration provenance, and historical counting reconciliation makes these weaknesses more consequential: an upgrade can proceed without a recoverable database backup, and success can be reported without sufficient evidence of readiness or recovery.These are source-review findings, not a reproduced production outage. The viewer role itself is already supported by CLI argument validation, provisioning, listing, and tests.
Findings
References below are pinned to reviewed master commit
d27708c.snapshot_engine.py, around lines 110–128, catches checkpoint/backup errors and still returns an archive withdatabase.backed_up=false.cmd_update.py, around lines 163–169, treats that returned archive as successful. A later rollback may therefore have no database to restore. This does not mean every backup is bad; the failure is that a required backup is not enforced.app/main.py, line 48. The updater then polls/healthfor eight attempts with two-second sleeps plus request time./healthreturns a static success payload and does not exercise statistics or role permissions. Startup work on a production-sized database may exceed that readiness window; this is a risk to measure, not a confirmed timeout.rollback_engine.pylogs restored-database integrity failure but does not fold it into success. Its success expression also excludes dependency/environment restoration and service health. Database expectation is inferred from archive-file existence, so a missing required DB can be treated as not expected.Acceptance criteria
Scope and release context
Harden the CLI update/snapshot/rollback contract on both supported service platforms. Frontend merge conflicts and asset-cache versioning are separate release concerns;
/healthalone must not be represented as proof that the statistics deck works. Existing Windows PATH issues #59 and #60 are separate.Prioritize a verified database backup and fail-closed upgrade behavior before deploying the statistics-deck release. No production mutation or real upgrade/rollback was performed during this review.
Maintainer triage — 2026-09-27
Accept the existing fail-closed backup, stop, dependency, readiness and rollback requirements. Agent implementation and deterministic failure-path tests may proceed. Document and perform a production-sized database-copy upgrade/rollback rehearsal before release; retain the original platform and release verification requirements. No production upgrade is authorized by this triage.