P1: evaluate DB safety against the fetched deploy commit #2

Open
opened 2026-07-10 17:36:11 +00:00 by kavi · 0 comments
Owner

Muralla release dry-run on 2026-07-10 exposed a false block: /root/apps/muralla was clean but stale on main@86ef83e0d (21 migration dirs), while production DB had 24 applied and origin/production already contained those migrations. kua-db therefore reported 3 orphaned migrations.

Root cause: deploy() runs kuaDbSafeCheck(appName) before git fetch and checkout of the deploy branch. Safety is evaluated against an unrelated stale working tree, not the commit that will be built.

Acceptance:

  • Under the existing per-app lock, validate the working tree and fetch/checkout the exact deploy branch before calling kua-db safety.
  • Record the candidate commit in progress before the DB gate and prove the checked disk tree is that commit.
  • A blocked DB gate must perform no build, compose, migration, or runtime mutation.
  • Preserve fail-loud dirty-tree behavior and do not discard operator changes.
  • Add regression tests for call order and stale-clean checkout behavior.
  • Prepare a reviewed PR only. Do not deploy kua-deploy or touch sol-prod.

This must land only after the production-to-main security reconciliation in #1.

Muralla release dry-run on 2026-07-10 exposed a false block: /root/apps/muralla was clean but stale on main@86ef83e0d (21 migration dirs), while production DB had 24 applied and origin/production already contained those migrations. kua-db therefore reported 3 orphaned migrations. Root cause: deploy() runs kuaDbSafeCheck(appName) before git fetch and checkout of the deploy branch. Safety is evaluated against an unrelated stale working tree, not the commit that will be built. Acceptance: - Under the existing per-app lock, validate the working tree and fetch/checkout the exact deploy branch before calling kua-db safety. - Record the candidate commit in progress before the DB gate and prove the checked disk tree is that commit. - A blocked DB gate must perform no build, compose, migration, or runtime mutation. - Preserve fail-loud dirty-tree behavior and do not discard operator changes. - Add regression tests for call order and stale-clean checkout behavior. - Prepare a reviewed PR only. Do not deploy kua-deploy or touch sol-prod. This must land only after the production-to-main security reconciliation in #1.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kavi/kua-deploy#2
No description provided.