Reject-and-detach option for mission submissions#690
Open
dhamariT wants to merge 2 commits into
Open
Conversation
Reviewers can now reject a mission submission and, in the same step, detach the project from the mission so the builder is freed to pick a different one. Detaching deducts 5 stardust from the builder. - Add a 'detach project' checkbox to the verdict form (rejections only) - Detach via Project#detach_mission!, guarded to the submission's current mission so a since-swapped mission is never yanked - Charge DETACH_PENALTY (5) stardust via a ledger entry on detach, which writes its own balance_adjustment PaperTrail audit - Tests for plain reject (no charge), reject+detach (-5, mission freed), and detach flag ignored on approve
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 58f969d. Configure here.
Reject-and-detach now just frees the project from the mission with no stardust deduction.
Member
|
@dhamariT this should have a demo of it working! |
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.

What & why
On
/admin/missions/<mission>/submissionsthe reviewer could only Approve or Reject. When a submission was rejected the project stayed attached to that mission, so the builder was stuck on the mission they'd just been rejected from with no clean way to move on.This adds a third path: reject and detach the project from the mission, freeing the builder to pick a different mission.
The flow
The verdict form now has a "Also detach this project from the mission" checkbox. It only takes effect on rejections (ignored on approve):
How it works
Project#detach_mission!(soft-detaches theMissionAttachment).Audit / papertrail
Project::MissionAttachmenthashas_paper_trail, so the detach is versioned, with whodunnit set via the admin controller chain (attributed to the reviewer).No migration — reuses the existing soft-detach column.
Tests
(Rubocop clean on the changed files.)
Notes
undomoves a submission back to pending but does not re-attach the mission. Detach is intentionally a one-way reviewer action; flag if you want undo to reverse it too.detach_mission!re-attaches a fallback if the project previously shipped (non-rejected) to another mission — a shipped project never goes mission-less. For a typical first rejection there's no fallback, so the project just becomes mission-free.Note
Medium Risk
Changes mission attachment state on reject (guarded to current mission only) inside the existing transaction; undo does not re-attach per PR notes.
Overview
Mission reviewers can optionally detach the builder's project from the mission when rejecting a submission, so the builder is not stuck on a mission they failed.
The review verdict form adds an "Also detach this project from the mission" checkbox (with hint copy and styling). On reject, if that flag is set, the update action calls new
detach_submission_project!, which uses existingProject#detach_mission!only when the submission's mission is still the project's current mission. Approve ignores the flag; plain reject behavior is unchanged. The flash notice reflects when a detach actually occurred.Controller tests cover plain reject, reject+detach, and detach ignored on approve.
Reviewed by Cursor Bugbot for commit e62b7ff. Bugbot is set up for automated code reviews on this repo. Configure here.