feat(boulder): multi-boulder architecture for concurrent plan execution#2050
feat(boulder): multi-boulder architecture for concurrent plan execution#2050kristianvast wants to merge 8 commits intocode-yeongyu:devfrom
Conversation
|
Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA). To sign the CLA, please comment on this PR with: This is a one-time requirement. Once signed, all your future contributions will be automatically accepted. I have read the CLA Document and I hereby sign the CLA Kristian Vastveit seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
1 issue found across 14 files
Confidence score: 4/5
- This PR looks safe to merge; the only noted issue is a markdown formatting problem rather than a functional bug.
- In
src/features/builtin-commands/templates/start-work.ts, an unclosed**will bold unintended content including the JSON code block, which could confuse users reading the template output. - Pay close attention to
src/features/builtin-commands/templates/start-work.ts- fix the missing closing bold marker to avoid malformed markdown.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/features/builtin-commands/templates/start-work.ts">
<violation number="1" location="src/features/builtin-commands/templates/start-work.ts:18">
P2: Missing closing asterisks for bold markdown text. The line opens bold formatting with `**` but never closes it, causing malformed markdown that will incorrectly bold subsequent content including the JSON code block.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| - If MULTIPLE plans: show list with timestamps, ask user to select | ||
|
|
||
| 4. **Create/Update boulder.json**: | ||
| 4. **Create/Update \`.sisyphus/boulders/{plan-name}.json\`: |
There was a problem hiding this comment.
P2: Missing closing asterisks for bold markdown text. The line opens bold formatting with ** but never closes it, causing malformed markdown that will incorrectly bold subsequent content including the JSON code block.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/features/builtin-commands/templates/start-work.ts, line 18:
<comment>Missing closing asterisks for bold markdown text. The line opens bold formatting with `**` but never closes it, causing malformed markdown that will incorrectly bold subsequent content including the JSON code block.</comment>
<file context>
@@ -4,18 +4,18 @@ export const START_WORK_TEMPLATE = `You are starting a Sisyphus work session.
- If MULTIPLE plans: show list with timestamps, ask user to select
-4. **Create/Update boulder.json**:
+4. **Create/Update \`.sisyphus/boulders/{plan-name}.json\`:
\`\`\`json
{
</file context>
| 4. **Create/Update \`.sisyphus/boulders/{plan-name}.json\`: | |
| 4. **Create/Update \`.sisyphus/boulders/{plan-name}.json\`**: |
|
[sisyphus-bot] PR Assessment ReportStatus: BLOCKED — Cannot merge at this time Blocking Issues
Required Actions
Technical Summary
Minor Issue (from cubic review)
This assessment was generated automatically. A maintainer will review this PR for architectural approval. |
Summary
.sisyphus/boulder.json(last-write-wins) to per-plan.sisyphus/boulders/{plan-name}.jsonfiles, enabling multiple plans to execute concurrently without conflictsMap<sessionID, planName>tracker (plan-name-tracker.ts) with disk-scan fallback (findBoulderForSession) for the CLIrunprocess (separate process, no shared memory)planNameparameter (existing API unchanged)Problem
The singleton
.sisyphus/boulder.jsonis the only bottleneck preventing parallel multi-plan execution. When two plans run concurrently, the last writer wins and corrupts the other plan's state. Evidence and notepad paths are already plan-name isolated — only the boulder file was missing this isolation.Solution
Per-plan boulder files at
.sisyphus/boulders/{plan-name}.json:start-workwrites to the per-plan path and registerssessionID → planNamein memorygetSessionPlanName(sessionID)(in-memory, fast) withfindBoulderForSession(dir, sessionID)(disk scan) as fallback.sisyphus/boulder.jsonstill works —findBoulderForSessionandappendSessionIdboth fall back to it when no per-plan file existsChanges
Storage layer (
src/features/boulder-state/):constants.ts— AddedBOULDERS_DIR = "boulders"andBOULDERS_BASE_PATHstorage.ts— OptionalplanName?on 5 I/O functions; newfindBoulderForSession()with legacy fallback;appendSessionIdfalls back to legacy path when per-plan file doesn't existplan-name-tracker.ts— New: in-memoryMap<sessionID, planName>withsetSessionPlanName/getSessionPlanName/clearSessionPlanNameindex.ts— Barrel export forplan-name-trackerConsumer hooks (all migrated to plan-aware calls):
src/hooks/start-work/start-work-hook.ts— Primary writer; callssetSessionPlanName+ writes to per-plan pathsrc/hooks/atlas/event-handler.ts— Reads viagetSessionPlanName → readBoulderState(dir, planName) ?? findBoulderForSessionsrc/hooks/atlas/tool-execute-after.ts— Same fallback chain +appendSessionIdwith plan namesrc/hooks/prometheus-md-only/agent-resolution.ts— UsesfindBoulderForSessionfor agent resolutionsrc/cli/run/continuation-state.ts— UsesfindBoulderForSession(disk-only; CLI is a separate process)src/plugin/tool-execute-before.ts—/stop-continuationclears per-plan boulder +clearSessionPlanNameCleanup wiring:
src/plugin/event.ts—session.deletednow callsclearSessionPlanName(sessionID)src/features/builtin-commands/templates/start-work.ts— Updated path references fromboulder.jsontoboulders/{plan-name}.jsonBackward Compatibility
planName?as last parameter — omitting it reads/writes the legacy.sisyphus/boulder.jsonpath unchangedfindBoulderForSessionscans per-plan files first, then falls back to legacyboulder.jsonappendSessionIdfalls back to legacy path when the per-plan file doesn't existplanNameTesting
storage.test.tscovering per-plan read/write/clear/append/find + legacy fallbackplan-name-tracker.test.tscovering set/get/clear/resetSummary by cubic
Enable concurrent plan execution by moving boulder state to per-plan files and adding a session→plan tracker. All hooks now resolve plan-aware state with a legacy fallback; no breaking changes.
New Features
Migration
Written for commit b38fbb8. Summary will update on new commits.