Files
501bece3a1 [AI] migrations: enforce append-only migration files in CI (#8446)
* [AI] Enforce append-only migration files in CI

Shipped migrations are append-only: existing installs never re-run
them, so editing one silently forks the database schema across the user
base, and deleting one breaks the migration check for every existing
budget file. The CI migration check now diffs blob hashes against the
merge base to reject edits/deletions, keeps the existing
timestamp-ordering rule, emits advisory PR annotations for migrations
containing DROP/RENAME statements, and fails loudly when git commands
fail instead of passing on empty output.

First of a series that makes clients on different app versions sync
safely against the same budget file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [AI] Derive the newest upstream migration id with an explicit max

The ls-tree listing is alphabetical, so taking the last entry only
worked while every migration id has the same digit count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [AI] Post advisory migration warnings as a PR comment

The risky-SQL warnings were only visible as job annotations, and since
the job passes there was no prompt to look at them. The migrations job
now uploads its findings as an artifact, and a new workflow_run workflow
(trusted base-repo context, so it also works for fork PRs whose tokens
are read-only) validates the artifact against a fixed allowlist and
posts/updates a PR comment — removing it again once the warnings are
resolved.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* [AI] Align overview numbering with the inline check comments

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-16 06:08:46 +00:00
..