Open
Conversation
Contributor
There was a problem hiding this comment.
4 issues found across 4 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/alembic/script.py.mako">
<violation number="1" location="backend/alembic/script.py.mako:18">
P1: Custom agent: **Check for Cursor Rules Drift**
Rule "Check for Cursor Rules Drift" is violated: this PR adds new Alembic migration safety conventions, but the relevant Cursor rule (`.cursor/rules/backend-rules.mdc`) was not updated to include them.</violation>
<violation number="2" location="backend/alembic/script.py.mako:30">
P2: The checklist incorrectly labels `now()` as a volatile default that rewrites the table; use a truly volatile example like `clock_timestamp()`.</violation>
</file>
<file name="backend/entrypoint.dev.sh">
<violation number="1" location="backend/entrypoint.dev.sh:25">
P2: The migration gate only treats `"true"` as enabled, so valid truthy values like `1`, `on`, or `yes` will incorrectly disable migrations.</violation>
</file>
<file name="backend/entrypoint.sh">
<violation number="1" location="backend/entrypoint.sh:50">
P1: The migration gate only accepts `"true"`; other common truthy values (e.g. `1`, `yes`, `on`) will incorrectly skip migrations.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| @@ -15,6 +15,25 @@ down_revision = ${repr(down_revision)} | |||
| branch_labels = ${repr(branch_labels)} | |||
Contributor
There was a problem hiding this comment.
P1: Custom agent: Check for Cursor Rules Drift
Rule "Check for Cursor Rules Drift" is violated: this PR adds new Alembic migration safety conventions, but the relevant Cursor rule (.cursor/rules/backend-rules.mdc) was not updated to include them.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At backend/alembic/script.py.mako, line 18:
<comment>Rule "Check for Cursor Rules Drift" is violated: this PR adds new Alembic migration safety conventions, but the relevant Cursor rule (`.cursor/rules/backend-rules.mdc`) was not updated to include them.</comment>
<file context>
@@ -15,6 +15,25 @@ down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}
depends_on = ${repr(depends_on)}
+# --- DDL safety checklist (remove before committing) ---
+#
+# [ ] lock_timeout: env.py sets a 10s default. Override per-statement
</file context>
d21665c to
5a8f3da
Compare
Gate entrypoint migrations behind `RUN_ALEMBIC_MIGRATIONS` with a case-insensitive check matching Pydantic's bool coercion. Set a 10s `lock_timeout` in Alembic's online migration path to fail fast under contention. Add a DDL safety checklist to the migration template so authors consider locking, concurrent indexing, and expand-contract patterns.
5a8f3da to
bbd1e32
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gate entrypoint migrations behind
RUN_ALEMBIC_MIGRATIONSwith a case-insensitive check matching Pydantic's bool coercion. Set a 10slock_timeoutin Alembic's online migration path to fail fast under contention. Add a DDL safety checklist to the migration template so authors consider locking, concurrent indexing, and expand-contract patterns.