Repository navigation
[SENTRY][PALAD-AI-RAILS-2M] Fix project destroy when workflows are column-bound - #181
Merged
artempartos merged 2 commits intoSep 4, 2026
Merged
Conversation
Destroy the board (and its ColumnWorkflowBindings) before project workflows so Workflow#check_column_bindings no longer aborts cascade teardown. Fixes PALAD-AI-RAILS-2M.
alex-astafyev
approved these changes
Sep 1, 2026
alex-astafyev
left a comment
Collaborator
There was a problem hiding this comment.
Code review verdict: Approve
Matches the tech design and fixes the Sentry failure mode (board destroyed before workflows so ColumnWorkflowBindings are gone before Workflow#check_column_bindings).
What looks good
- Minimal, correct change: association reorder + comment explaining why order matters
- Standalone workflow soft/hard delete guards preserved (covered in workflow_test)
- Strong model regression with binding + board_task + workflow_run + column_transition
- Integration coverage for the company destroy HTTP path
Non-blocking notes
- Association declaration order remains load-bearing (also on Board: tasks before columns). The new comment is enough for this fix; a prepended before_destroy is optional hardening only.
- CI Backend/Frontend checks were still pending at review time — Wait/Gate will block QA until they pass.
Acceptance criteria: met for the described failure mode.
BoardColumn/BoardTask already guard after_commit touch with persisted?; ColumnWorkflowBinding did not, so project destroy (board-first) raised ActiveRecord::ActiveRecordError and failed Backend Checks. Signed-off-by: Alex Astafyev <[email protected]> Co-authored-by: Cursor <[email protected]>
alex-astafyev
approved these changes
Sep 1, 2026
alex-astafyev
left a comment
Collaborator
There was a problem hiding this comment.
Code review verdict: Approve
Re-reviewed after the CI fix commit (30f0eb2). Still matches the tech design and acceptance criteria for PALAD-AI-RAILS-2M.
What looks good
- Association reorder + comment: board destroyed before workflows/runs so bindings and column_transitions are cleared first
ColumnWorkflowBinding#touch_boardnow mirrorsBoardColumn/BoardTask(persisted?guard) — necessary becauseafter_commitruns after the outer destroy transaction, when the board is already gone- Standalone soft/hard delete guards preserved and covered
- Model + integration regressions cover the Sentry path (binding) and the RESTRICT edge (run + ColumnTransition)
Non-blocking
- Destroy order remains load-bearing on association declaration order; the comment is enough for this fix
- Backend Checks still in progress at review time — Gate/Wait will block QA until green
Acceptance criteria: met for the described failure mode.
alex-astafyev
marked this pull request as draft
September 1, 2026 08:34
alex-astafyev
marked this pull request as ready for review
September 1, 2026 12:30
artempartos
added a commit
that referenced
this pull request
Sep 6, 2026
Everything here was found in Sentry on the currently deployed release, and each is the smallest change that makes the reported failure impossible. PALAD-AI-TEMPORAL-X — an `exec` nobody could account for pinned its reservation forever. AD-5 retains a slot so a late Pod never finds its seat handed to someone else, but only a create or a start can produce that Pod: an exec runs inside a container, and release is reached only once that container is provably absent, so a late one can only 404. The gate is now scoped to the phases that can still materialize a workload, and the queue health line reports `pinned_reservations` beside the wider `uncertain_operations` so the alarm counts slots actually held. Replaying an uncertain exec is still refused — launching the agent twice is the thing that must not happen — it just no longer costs the pool a slot. PALAD-AI-RAILS-2R — `update_connector` had no `update_connector?` on the policy, so the dynamic authorize raised NoMethodError and every role got a 500 instead of an answer. `accept_tool_drift` was one click away from the same fate. A structural test now walks every company-scoped route and asserts its policy can answer, because actions get added far more often than policies get re-read. PALAD-AI-RAILS-2N — a soft-deleted step keeps its position and the unique (workflow, position) index still covers it, so the builder's "one past the highest visible position" collided with a step the user had already deleted. Appending is the server's job now; the client no longer sends a position, and a caller that does send a taken one gets a 422 rather than a 500. PALAD-AI-RAILS-2P — one tool whose schema the MCP gem refuses raised out of tools/list and took the whole endpoint down with it, including calls to the tools that were fine. Validation only protects new writes; a row saved before `$ref` was forbidden still has a matching digest. Each tool is now published on its own and a bad one is dropped loudly, the way a failed digest check already was. PALAD-AI-RAILS-2K — reorder renumbered only the columns the payload named and left the rest where they were, colliding on (board_id, position). The board settings dialog sends a partial list whenever a column appears while it is open. The whole board is now ordered every time: named columns first, the rest after in their existing order. PALAD-AI-RAILS-2M needed no code — PR #181 fixed it after the release the events came from — and the rest of the open issues were stale. Both are closed in Sentry with the evidence. Signed-off-by: Artem Petrov <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
This was referenced Oct 27, 2026
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.
Summary
Projectassociations soboardis destroyed beforeworkflows/workflow_runs, clearingColumnWorkflowBinding(and column transitions) beforeWorkflow#check_column_bindingsruns.Test plan
bin/rails test test/models/project_test.rb test/models/workflow_test.rb test/models/board_test.rb test/integration/web/company/projects_controller_test.rbRecordNotDestroyedMade with Cursor