Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
eea2a1f
feat: implement sandcastle refinement loop with critic-based convergence
jerome-benoit May 4, 2026
6a5e967
fix: address review findings (shell injection, false convergence, nes…
jerome-benoit May 4, 2026
d7cd5e2
fix: guard retry calls, split rebase logic, remove dead critic retry
jerome-benoit May 4, 2026
bfad1d9
fix: handle nullable issue body and guard JSON parse
jerome-benoit May 4, 2026
e6b613a
fix: distinguish stalled from converged (re-reported findings → draft…
jerome-benoit May 5, 2026
5901fbf
fix: LOW-only findings should not prevent convergence
jerome-benoit May 5, 2026
ee43546
fix: log validation errors, conditional checklist, derive PR title fr…
jerome-benoit May 5, 2026
d70bc29
refactor: extract sandcastle into modular architecture
jerome-benoit May 5, 2026
3215748
fix: centralize constants, fix PR type-of-change, sanitize titles
jerome-benoit May 5, 2026
25e85de
fix: full validation post-rebase, execFileSync for gh issue list
jerome-benoit May 5, 2026
4f83a6c
perf: skip critic when implementer produces 0 commits on round 2+
jerome-benoit May 5, 2026
301c391
fix: remove unsound type guard, filter unknown plan IDs, guard Concur…
jerome-benoit May 5, 2026
8e05a15
feat: state-of-the-art algorithmic improvements
jerome-benoit May 5, 2026
100838c
fix(sandcastle): resolve all algorithmic audit findings
jerome-benoit May 5, 2026
badfc92
fix(sandcastle): harden subprocess calls and reduce cyclomatic comple…
jerome-benoit May 5, 2026
3d2a46f
fix(sandcastle): address review findings — convergence, planner failu…
jerome-benoit May 5, 2026
bf8ca04
fix(.sandcastle): address all algorithmic audit findings
jerome-benoit May 5, 2026
d1db4e4
fix: unref timeout timer to prevent process hang, catch critic throws
jerome-benoit May 5, 2026
7f0a41a
fix: count commits before break on critic failure (prevents work loss)
jerome-benoit May 5, 2026
5872f70
fix: suppress unhandled rejection from timeout promise on task success
jerome-benoit May 5, 2026
5881b92
fix: force process exit after completion (prevents hang from timed-ou…
jerome-benoit May 5, 2026
29c2ce6
fix: check findings null before commits zero (correct status on imple…
jerome-benoit May 5, 2026
a4f323d
fix: report known findings in PR body even when converged (prevents s…
jerome-benoit May 5, 2026
41d09b4
feat: state-of-the-art convergence improvements (ARCS, SWE-Agent, Ope…
jerome-benoit May 5, 2026
2f8cbf7
fix: move bestSha after ratchet, add validation timeout, fix severity…
jerome-benoit May 5, 2026
5ef3725
fix: recount totalCommits from git after best-state reset (semantic c…
jerome-benoit May 5, 2026
177ecbd
refactor(.sandcastle): address all 45 quality audit findings
jerome-benoit May 5, 2026
69ca4fa
fix: use constants from constants.ts + add planner timeout (multi-age…
jerome-benoit May 5, 2026
d8b3454
refactor(.sandcastle): harden prompts — cap findings, add known decis…
jerome-benoit May 5, 2026
189f655
perf(.sandcastle): convert execFileSync to async execFileAsync (unblo…
jerome-benoit May 5, 2026
96bbd80
fix: catch planner timeout rejection (retry instead of crash) + add c…
jerome-benoit May 5, 2026
7954fec
Merge branch 'main' into feat/sandcastle-refinement-loop
jerome-benoit May 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions .sandcastle/critic-prompt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Critic Agent

Analyze the implementation on branch `{{BRANCH}}` and produce structured findings.

## Task

Run `git diff main...{{BRANCH}}` to see all changes. Examine the diff carefully. For each issue found, produce a structured finding.

Comment on lines +7 to +8
Read `CONTRIBUTING.md` for the project's coding standards.

## Output Format

Output your findings as JSON wrapped in nonce-tagged delimiters. Use EXACTLY this tag format:

```text
<findings-{{NONCE}}>[...]</findings-{{NONCE}}>
```

Each finding must have this structure:

```json
{
"file": "path/to/file.ts",
"line": 42,
"title": "short description of the issue",
"severity": "CRITICAL|HIGH|MEDIUM|LOW",
"category": "security|logic|performance|architecture|style",
"confidence": "HIGH|MEDIUM|LOW",
"description": "detailed explanation of why this is a problem",
"suggestion": "how to fix it"
}
```

If no issues are found, output:

```text
<findings-{{NONCE}}>[]</findings-{{NONCE}}>
```

## Rules

- Do NOT modify any files. Do NOT commit. Do NOT push.
- Only report issues in the CHANGED code (not pre-existing issues).
- Use HIGH confidence only when you've verified the issue by reading the relevant code.
- Use MEDIUM confidence for pattern-based detection.
- Use LOW confidence for style preferences or uncertain issues.
- Focus on: logic errors, missing edge cases, security issues, type safety violations, test gaps.
- Do NOT report formatting issues (prettier handles those).

## Completion

After outputting the findings, output:

```text
<promise>COMPLETE</promise>
```
17 changes: 10 additions & 7 deletions .sandcastle/implement-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Implement issue **#{{TASK_ID}}** ("{{ISSUE_TITLE}}") on branch `{{BRANCH}}`.

## Issue Details

!`gh issue view {{TASK_ID}} --json body,title,labels,comments`
{{ISSUE_BODY}}

## Recent Commits
## Review Findings

!`git log -n 10 --format="%h %s" --date=short`
{{FINDINGS}}

## Exploration

Expand All @@ -22,24 +22,26 @@ Read `AGENTS.md` and `CONTRIBUTING.md` for project conventions.

## Implementation

1. Implement the fix/feature. Follow existing patterns:
1. If review findings are provided above, cross-validate each one against the code. Fix findings you agree with. Ignore findings that are incorrect or not applicable.

2. If no findings are provided, implement the issue from scratch following existing patterns:
- Strict TypeScript, JSDoc on public APIs
- Co-located tests in `*.test.ts` files
- Zod for runtime validation

2. Before every commit, run the full validation suite:
3. Before every commit, run the full validation suite:

```bash
npm run type-check && npm run test && npm run test:node && npm run test:edge && npm run prettier-check && npm run lint && npm run build && npm run check-build && npm run build:v2 && npm run check-build:v2
```

3. Commit with conventional commits:
4. Commit with conventional commits:
- `fix: <description>` — bug fix
- `feat: <description>` — new feature
- `refactor: <description>` — restructuring
- `chore: <description>` — tooling/config

4. Push the branch:
5. Push the branch:

```bash
git push -u origin {{BRANCH}}
Expand All @@ -51,6 +53,7 @@ Read `AGENTS.md` and `CONTRIBUTING.md` for project conventions.
- Tests must pass before pushing. Zero type errors, zero test failures.
- Do not modify unrelated files.
- Do not bump version numbers.
- Push BEFORE signaling completion.

## Completion

Expand Down
Loading
Loading