Add Sandcastle AI agent workflow#1412
Conversation
✅ Deploy Preview for bettervoting ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis PR introduces a new Sequence Diagram(s)sequenceDiagram
participant Main as main.mts
participant Planner
participant Sandbox
participant Implementer
participant Reviewer
participant Merger
participant QAAgent
loop Up to MAX_ITERATIONS
Main->>Planner: request unblocked issues
Planner-->>Main: selected issues/branches
par per branch
Main->>Sandbox: create docker sandbox
Sandbox->>Implementer: implement issue
Implementer-->>Sandbox: commits (if any)
Sandbox->>Reviewer: review (if commits produced)
end
Main->>Merger: merge completed branches
end
Main->>QAAgent: create QA issue (unless --noqa)
Related Issues: None specified in the provided changes. Related PRs: None specified in the provided changes. Suggested labels: tooling, infrastructure, ci Suggested reviewers: None specified in the provided changes. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.sandcastle/review-prompt.md:
- Around line 7-13: The review prompt in review-prompt.md still references
TARGET_BRANCH even though only BRANCH is injected, so the git commands will
expand incorrectly. Update the prompt content to either pass TARGET_BRANCH from
main.mts or replace the unresolved TARGET_BRANCH placeholder in the git diff and
git log commands so they reference the actual baseline branch consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6446a8b2-b987-4a29-abce-c72f62358e6e
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (11)
.gitignore.sandcastle/.gitignore.sandcastle/CODING_STANDARDS.md.sandcastle/Dockerfile.sandcastle/implement-prompt.md.sandcastle/main.mts.sandcastle/merge-prompt.md.sandcastle/plan-prompt.md.sandcastle/qa-issue-prompt.md.sandcastle/review-prompt.mdpackage.json
| ## Branch diff | ||
|
|
||
| !`git diff {{TARGET_BRANCH}}...{{BRANCH}}` | ||
|
|
||
| ## Commits on this branch | ||
|
|
||
| !`git log {{TARGET_BRANCH}}..{{BRANCH}} --oneline` |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Inject TARGET_BRANCH or stop referencing it here.
main.mts only passes BRANCH into this prompt, so git diff {{TARGET_BRANCH}}...{{BRANCH}} and git log {{TARGET_BRANCH}}..{{BRANCH}} will expand with an unresolved placeholder. The reviewer will not inspect the correct baseline.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In @.sandcastle/review-prompt.md around lines 7 - 13, The review prompt in
review-prompt.md still references TARGET_BRANCH even though only BRANCH is
injected, so the git commands will expand incorrectly. Update the prompt content
to either pass TARGET_BRANCH from main.mts or replace the unresolved
TARGET_BRANCH placeholder in the git diff and git log commands so they reference
the actual baseline branch consistently.
Task: Remove WizardExtra and replace multi-step wizard with single-page flow. PRD: Issue Equal-Vote#1405 - Equal-Vote#1405 Key decisions: - Deleted WizardExtra.tsx entirely; Wizard.tsx is now single-page (no slide animation) - Added MultiRaceTitleSection sub-component in Wizard.tsx for multi-race title/description entry - onCustomize() helper applies open voter access + device-ID auth + contact email defaults and navigates to /admin/build_ballot - ConfirmationDialogProvider gains dismissable?: boolean option: adds X IconButton in DialogTitle, onClose resolves promise with null instead of boolean - wizard.publish_confirm.cancel changed from 'See more options' to 'Customize in editor' - Single-race onNext handles null (dismiss) as no-op so wizard stays visible with form values intact Files changed: - packages/frontend/src/components/ElectionForm/Wizard/Wizard.tsx (rewritten) - packages/frontend/src/components/ElectionForm/Wizard/WizardExtra.tsx (deleted) - packages/frontend/src/components/ConfirmationDialogProvider.tsx (added dismissable support) - packages/frontend/src/i18n/en.yaml (updated cancel label) - testing/tests/create-election.spec.ts (5 new tests replacing old 5) Notes: E2E tests require full docker stack and cannot be verified here; backend unit tests all pass (133/133). TypeScript checks clean for modified files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Simplify redundant `!election.title || election.title.length < 1` to just `!election.title` (the falsy check already covers empty string). Rename `dismiss dialog returns to page 1` test to `dismiss dialog keeps wizard visible` since page 2 no longer exists after the WizardExtra removal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Usage
Running
npm run sandcastlelocally will spawn the workflow. Any issues with the Sandcastle label are eligible to be picked up. Then the changes will be merged into the main branch locally.Original Walkthrough Video
https://www.youtube.com/watch?v=E5-QK3CDVQM
Summary
.sandcastle/directory with a multi-phase AI agent orchestration workflow for autonomously implementing GitHub issues🤖 Generated with Claude Code