@ai-hero/sandcastle 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/templates/parallel-planner/main.ts +28 -37
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -117,14 +117,14 @@ console.log(result.branch); // target branch name
|
|
|
117
117
|
|
|
118
118
|
## How it works
|
|
119
119
|
|
|
120
|
-
Sandcastle uses a worktree-based architecture for
|
|
120
|
+
Sandcastle uses a worktree-based architecture for agent execution:
|
|
121
121
|
|
|
122
|
-
- **Worktree**: Sandcastle creates a git worktree on the host at `.sandcastle/worktrees/`. The worktree is a
|
|
122
|
+
- **Worktree**: Sandcastle creates a git worktree on the host at `.sandcastle/worktrees/`. The worktree is a just a normal `git worktree`.
|
|
123
123
|
- **Bind-mount**: The worktree directory is bind-mounted into the sandbox container as the agent's working directory. The agent writes directly to the host filesystem through the mount.
|
|
124
124
|
- **No sync needed**: Because the agent writes directly to the host filesystem, there are no sync-in or sync-out operations. Commits made by the agent are immediately visible on the host.
|
|
125
125
|
- **Merge back**: After the run completes, the temp worktree branch is fast-forward merged back to the target branch, and the worktree is cleaned up.
|
|
126
126
|
|
|
127
|
-
|
|
127
|
+
From your point of view, you just run `sandcastle.run({ branch: 'foo' })`, and get a commit on branch `foo` once it's complete. All 100% local.
|
|
128
128
|
|
|
129
129
|
## Prompts
|
|
130
130
|
|
|
@@ -167,43 +167,34 @@ for (let iteration = 1; iteration <= MAX_ITERATIONS; iteration++) {
|
|
|
167
167
|
continue;
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
//
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
// A markdown list of issue numbers and titles, one per line.
|
|
199
|
-
ISSUES: completedIssues
|
|
200
|
-
.map((i) => `- #${i.number}: ${i.title}`)
|
|
201
|
-
.join("\n"),
|
|
202
|
-
},
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
console.log("\nBranches merged.");
|
|
206
|
-
}
|
|
170
|
+
// -------------------------------------------------------------------------
|
|
171
|
+
// Phase 3: Merge
|
|
172
|
+
//
|
|
173
|
+
// One sonnet agent merges all completed branches into the current branch,
|
|
174
|
+
// resolving any conflicts and running tests to confirm everything still works.
|
|
175
|
+
//
|
|
176
|
+
// The {{BRANCHES}} and {{ISSUES}} prompt arguments are lists that the agent
|
|
177
|
+
// uses to know which branches to merge and which issues to close.
|
|
178
|
+
// -------------------------------------------------------------------------
|
|
179
|
+
await sandcastle.run({
|
|
180
|
+
hooks,
|
|
181
|
+
copyToSandbox,
|
|
182
|
+
name: "merger",
|
|
183
|
+
maxIterations: 10,
|
|
184
|
+
// Sonnet is sufficient for merge conflict resolution.
|
|
185
|
+
model: "claude-sonnet-4-6",
|
|
186
|
+
promptFile: "./.sandcastle/merge-prompt.md",
|
|
187
|
+
promptArgs: {
|
|
188
|
+
// A markdown list of branch names, one per line.
|
|
189
|
+
BRANCHES: completedBranches.map((b) => `- ${b}`).join("\n"),
|
|
190
|
+
// A markdown list of issue numbers and titles, one per line.
|
|
191
|
+
ISSUES: completedIssues
|
|
192
|
+
.map((i) => `- #${i.number}: ${i.title}`)
|
|
193
|
+
.join("\n"),
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
console.log("\nBranches merged.");
|
|
207
198
|
}
|
|
208
199
|
|
|
209
200
|
console.log("\nAll done.");
|