summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2026-03-13feat: post-elaboration sanity check for tools, acceptance criteria, and dev ↵Peter Stone
practices Add sanitizeElaboratedTask() called after every elaboration response: - Infers missing allowed_tools from instruction keywords (Write/Edit/Read/Bash/Grep/Glob) - Auto-adds Read when Edit is present - Appends Acceptance Criteria section if none present - Appends TDD reminder for coding tasks without test mention Also tighten buildElaboratePrompt to require acceptance criteria and list concrete tool examples, reducing how often the model omits tools. Fixes class of failures where agents couldn't create files because the elaborator omitted Write from allowed_tools. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13feat: resume support, summary extraction, and task state improvementsPeter Stone
- Extend Resume to CANCELLED, FAILED, and BUDGET_EXCEEDED tasks - Add summary extraction from agent stdout stream-json output - Fix storage: persist stdout/stderr/artifact_dir paths in UpdateExecution - Clear question_json on ResetTaskForRetry - Resume BLOCKED tasks in preserved sandbox so Claude finds its session - Add planning preamble: CLAUDOMATOR_SUMMARY_FILE env var + summary step - Update ADR-002 with new state transitions - UI style improvements Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-12feat: add Resume support for CANCELLED, FAILED, and BUDGET_EXCEEDED tasksClaudomator Agent
Interrupted tasks (CANCELLED, FAILED, BUDGET_EXCEEDED) now support session resume in addition to restart. Both buttons are shown on the task card. - executor: extend resumablePoolStates to include CANCELLED, FAILED, BUDGET_EXCEEDED - api: extend handleResumeTimedOutTask to accept all resumable states with state-specific resume messages; replace hard-coded TIMED_OUT check with a resumableStates map - web: add RESUME_STATES set; render Resume + Restart buttons for interrupted states; TIMED_OUT keeps Resume only - tests: 5 new Go tests (TestResumeInterrupted_*); updated task-actions.test.mjs with 17 tests covering dual-button behaviour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11feat: add Stats tab with task distribution and execution health metricsClaudomator Agent
- Export computeTaskStats and computeExecutionStats from app.js - Add renderStatsPanel with state count grid, KPI row (total/success-rate/cost/avg-duration), and outcome bar chart - Wire stats tab into switchTab and poll for live refresh - Add Stats tab button and panel to index.html - Add CSS for .stats-counts, .stats-kpis, .stats-bar-chart using existing state color variables - Add docs/stats-tab-plan.md with component structure and data flow - 14 new unit tests in web/test/stats.test.mjs (140 total, all passing) No backend changes — derives all metrics from existing /api/tasks and /api/executions endpoints. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11feat: add Summary and Q&A History sections to task detail panelClaudomator Agent
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11feat: require agents to write a final summary before exitingClaudomator Agent
Add a mandatory '## Final Summary' section to planningPreamble instructing agents to output a 2-5 sentence summary paragraph (headed by '## Summary') as their last output before exiting. Adds three tests to verify the section and its required content are present in the preamble. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11Merge remote-tracking branch 'local/master'Peter Stone
2026-03-11fix: clear question_json when restarting a task via ResetTaskForRetryPeter Stone
A BLOCKED task that fails on resume would keep its stale question_json after being restarted. The frontend then showed "waiting for your input" with the old prompt even though the task was running fresh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11docs: add discovery notes and implementation plan for summary/QA featureClaudomator Agent
2026-03-11fix: resume BLOCKED tasks in preserved sandbox so Claude finds its sessionPeter Stone
When a task ran in a sandbox (/tmp/claudomator-sandbox-*) and went BLOCKED, Claude stored its session under the sandbox path as the project slug. The resume execution was running in project_dir, causing Claude to look for the session in the wrong project directory and fail with "No conversation found". Fix: carry SandboxDir through BlockedError → Execution → resume execution, and run the resume in that directory so the session lookup succeeds. - BlockedError gains SandboxDir field; claude.go sets it on BLOCKED exit - storage.Execution gains SandboxDir (persisted via new sandbox_dir column) - executor.go stores blockedErr.SandboxDir in the execution record - server.go copies SandboxDir from latest execution to the resume execution - claude.go uses e.SandboxDir as working dir for resume when set Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-11docs: add executor package documentationClaudomator Agent
2026-03-11docs: add system architecture overviewClaudomator Agent
2026-03-10test: sandbox coverage + fix WebSocket racesPeter Stone
executor: add 7 tests for sandboxCloneSource, setupSandbox, and teardownSandbox (uncommitted-changes error, clean-no-commits removal). api: fix two data races in WebSocket tests — wsPingInterval/Deadline are now captured as locals before goroutine start; maxWsClients is moved from a package-level var into Hub.maxClients (with SetMaxClients method) so concurrent tests don't stomp each other. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10docs: add development narrative and ADRs 004-005Peter Stone
RAW_NARRATIVE.md: comprehensive chronological engineering history reconstructed from the git log covering all 45 major milestones. ADR-004: multi-agent routing — explicit load balancing in code (pickAgent) plus Gemini-based model classification (Classifier), and why the two decisions are intentionally separated. ADR-005: git sandbox execution model — clone isolation, bare-repo push, uncommitted-change enforcement, BLOCKED preservation, and session ID propagation on second resume cycle. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10task: promote validTransitions to package-level var; fix ADRPeter Stone
Hoists the map out of ValidTransition so it's not reallocated on every call. Adds missing CANCELLED→QUEUED and BUDGET_EXCEEDED→QUEUED entries to the ADR transition table to match the implemented state machine. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10executor: fix session ID on second block-and-resume cyclePeter Stone
When a resumed execution is blocked again, SessionID was set to the new exec's own UUID instead of the original ResumeSessionID. The next resume would then pass the wrong --resume argument to claude and fail. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10executor: explicit load balancing — code picks agent, classifier picks modelPeter Stone
pickAgent() deterministically selects the agent with the fewest active tasks, skipping rate-limited agents. The classifier now only selects the model for the pre-assigned agent, so Gemini gets tasks from the start rather than only as a fallback when Claude's quota is exhausted. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10feat: append verbatim user input to docs/RAW_NARRATIVE.mdPeter Stone
The elaborator now logs every user prompt to docs/RAW_NARRATIVE.md within the project directory. This is done in a background goroutine to ensure it doesn't delay the response.
2026-03-10feat: include project context in elaborator promptPeter Stone
The elaborator now reads CLAUDE.md and SESSION_STATE.md from the project directory (if they exist) and prepends their content to the user prompt. This allows the AI to generate tasks that are more context-aware.
2026-03-10fix: ensure tasks are re-classified on manual restartPeter Stone
Updated handleRunTask to use ResetTaskForRetry, which clears the agent type and model. This ensures that manually restarted tasks are always re-classified, allowing the system to switch to a different agent if the previous one is rate-limited. Also improved Claude quota-exhaustion detection.
2026-03-10docs: add comprehensive documentation plan (tasks_plan.md)Claudomator Agent
2026-03-10cli: implement --config flag to load TOML config fileClaudomator Agent
The --config flag was registered but silently ignored. Now: - config.LoadFile loads a TOML file on top of defaults - PersistentPreRunE applies the file when --config is set - Explicit CLI flags (--data-dir, --claude-bin) take precedence over the file Tests: TestLoadFile_OverridesDefaults, TestLoadFile_MissingFile_ReturnsError, TestRootCmd_ConfigFile_Loaded, TestRootCmd_ConfigFile_CLIFlagOverrides, TestRootCmd_ConfigFile_Missing_ReturnsError Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10executor: extract handleRunResult to deduplicate error-classification logicClaudomator Agent
Both execute() and executeResume() shared ~80% identical post-run logic: error classification (BLOCKED, TIMED_OUT, CANCELLED, BUDGET_EXCEEDED, FAILED), state transitions, result emission, and UpdateExecution. Extract this into handleRunResult(ctx, t, exec, err, agentType) on *Pool. Both functions now call it after runner.Run() returns. Also adds TestHandleRunResult_SharedPath which directly exercises the new function via a minimalMockStore, covering FAILED, READY, COMPLETED, and TIMED_OUT classification paths. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10Remove legacy claude field and working_dir backward compatClaudomator Agent
- Remove Claude field alias from Task struct (already removed in sandbox) - Remove UnmarshalJSON from AgentConfig that silently accepted working_dir - Remove legacy claude fallback in scanTask (db.go) - Remove TestGetTask_BackwardCompatibility test that validated removed behavior Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: unblock parent task when all subtasks completeClaudomator Agent
Add maybeUnblockParent helper that transitions a BLOCKED parent task to READY once every subtask is in the COMPLETED state. Called in both execute() and executeResume() immediately after a subtask is marked COMPLETED. Any non-COMPLETED sibling (RUNNING, FAILED, etc.) keeps the parent BLOCKED. Tests added: - TestPool_Submit_LastSubtask_UnblocksParent - TestPool_Submit_NotLastSubtask_ParentStaysBlocked - TestPool_Submit_ParentNotBlocked_NoTransition
2026-03-09executor: BLOCKED→READY for top-level tasks with subtasksClaudomator Agent
When a top-level task (ParentTaskID == "") finishes successfully, check for subtasks before deciding the next state: - subtasks exist → BLOCKED (waiting for subtasks to complete) - no subtasks → READY (existing behavior, unchanged) This applies to both execute() and executeResume(). Adds ListSubtasks to the Store interface. Tests: - TestPool_Submit_TopLevel_WithSubtasks_GoesBlocked - TestPool_Submit_TopLevel_NoSubtasks_GoesReady Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09docs: update ADR-002 for parent-subtask BLOCKED→READY state behaviorClaudomator Agent
- Transition table: add BLOCKED→READY (trigger: all subtasks COMPLETED) - Transition table: clarify RUNNING→READY only when no subtasks exist - Transition table: add RUNNING→BLOCKED for parent-with-subtasks path - Execution outcome mapping: reflect subtask check - State diagram: show BLOCKED→READY arc - Key Invariants: add #7 parent-with-subtasks goes BLOCKED on runner exit Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: log errors from all unchecked UpdateTaskState/UpdateTaskQuestion callsClaudomator Agent
All previously ignored errors from p.store.UpdateTaskState() and p.store.UpdateTaskQuestion() in execute() and executeResume() now log with structured context (taskID, state, error). Introduces a Store interface so tests can inject a failing mock store. Adds TestPool_UpdateTaskState_DBError_IsLoggedAndResultDelivered to verify that a DB write failure is logged and the result is still delivered to resultCh. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09storage: fix DeleteTask atomicity and use recursive CTEClaudomator Agent
Replace BFS loop with a single recursive CTE to collect all descendant task IDs in one query, and wrap all DELETE statements in a transaction so a partial failure cannot leave orphaned executions. Add TestDeleteTask_DeepSubtaskCascadeAtomic: creates a 3-level task hierarchy with executions at each level, deletes the root, and verifies all tasks and executions are removed with an explicit orphan-row check. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09storage: add missing indexes and ListRecentExecutions correctness testsClaudomator Agent
Add two schema indexes that were missing: - idx_executions_start_time on executions(start_time): speeds up ListRecentExecutions WHERE start_time >= ? ORDER BY start_time DESC - idx_tasks_parent_task_id on tasks(parent_task_id): speeds up ListSubtasks WHERE parent_task_id = ? Both use CREATE INDEX IF NOT EXISTS so they are safe to apply on existing databases without a migration version bump. Add TestListRecentExecutions_LargeDataset (100 rows, two tasks) covering: - returns all rows in descending start_time order - respects the limit parameter - filters correctly by since time - filters correctly by task_id Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: validate ?state= param in handleListTasks; standardize operation ↵Claudomator Agent
response shapes - handleListTasks: validate ?state= against known states, return 400 with clear error for unrecognized values (e.g. ?state=BOGUS) - handleCancelTask: replace {"status":"cancelling"|"cancelled"} with {"message":"...","task_id":"..."} to match run/resume shape - handleAnswerQuestion: replace {"status":"queued"} with {"message":"task queued for resume","task_id":"..."} - Tests: add TestListTasks_InvalidState_Returns400, TestListTasks_ValidState_Returns200, TestCancelTask_ResponseShape, TestAnswerQuestion_ResponseShape, TestRunTask_ResponseShape, TestResumeTimedOut_ResponseShape Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: add configurable mockRunner and async error-path testsClaudomator Agent
Replace the no-op mockRunner in server_test.go with a configurable version that supports err and sleep fields. Add testServerWithRunner helper and a pollState utility for async assertions. Add three new tests that exercise the pool's error paths end-to-end: - TestRunTask_AgentFails_TaskSetToFailed - TestRunTask_AgentTimesOut_TaskSetToTimedOut - TestRunTask_AgentCancelled_TaskSetToCancelled Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: document kill-goroutine safety and add goroutine-leak testClaudomator Agent
The pgid-kill goroutine in execOnce() uses a select with both ctx.Done() and the killDone channel. Add a detailed comment explaining why the goroutine cannot block indefinitely: the killDone arm fires unconditionally when cmd.Wait() returns (whether the process exited naturally or was killed), so the goroutine always exits before execOnce() returns. Add TestExecOnce_NoGoroutineLeak_OnNaturalExit to verify this: it samples runtime.NumGoroutine() before and after execOnce() with a no-op binary ("true") and a background context (never cancelled), asserting no net goroutine growth. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09task: remove legacy Claude field from Task structClaudomator Agent
2026-03-09scripts: pull latest from bare repo before building in deployPeter Stone
2026-03-09executor: strengthen rate-limit avoidance in classifierPeter Stone
Updated isQuotaExhausted to detect more Claude quota messages. Added 'rate limit reached (rejected)' to quota exhausted checks. Strengthened classifier prompt to explicitly forbid selecting rate-limited agents. Improved Pool to set 5h rate limit on quota exhaustion.
2026-03-09executor: fix sandbox teardown — remove working copy pull, retry push on ↵Peter Stone
concurrent rejection - Remove git pull into project_dir: working copy is the developer workspace and should be pulled manually; www-data can't write to root-owned .git/objects - On non-fast-forward push rejection (concurrent task pushed first), fetch and rebase then retry once instead of failing the entire task
2026-03-09executor: fix map leaks in activePerAgent and rateLimitedClaudomator Agent
activePerAgent: delete zero-count entries after decrement so the map doesn't accumulate stale keys for agent types that are no longer active. rateLimited: delete entries whose deadline has passed when reading them (in both the classifier block and the execute() pre-flight), so stale entries are cleaned up on the next check rather than accumulating forever. Both fixes are covered by new regression tests. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09api: make workspace root configurable instead of hardcoded /workspaceClaudomator Agent
- Add workspaceRoot field (default "/workspace") to Server struct - Add SetWorkspaceRoot method on Server - Update handleListWorkspaces to use s.workspaceRoot - Add WorkspaceRoot field to Config with default "/workspace" - Wire cfg.WorkspaceRoot into server in serve.go - Expose --workspace-root flag on the serve command - Add TestListWorkspaces_UsesConfiguredRoot integration test Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: update classifier model list to Claude 4.x and current Gemini modelsPeter Stone
2026-03-09web: show model alongside agent type on running task cardsClaudomator Agent
2026-03-09web: show execution id and agent type on running task cardsClaudomator Agent
Each running task card now shows a meta row with the assigned agent type (e.g. "claude" or "gemini") and the short execution ID, which is filled in asynchronously once the execution record is fetched. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-09executor: recover stale RUNNING tasks on server startupPeter Stone
On restart, any tasks in RUNNING state have no active goroutine. RecoverStaleRunning() marks them FAILED (retryable) and closes their open execution records with an appropriate error message. Called once from serve.go after the pool is created.
2026-03-09web: skip task list re-render when dialog or panel is openPeter Stone
Prevents periodic poll from clearing the task panel, open modals, or inline edit forms while the user is interacting with them. - isUserEditing() now also detects any open <dialog> or task-panel - poll() checks isUserEditing() before calling destructive renders
2026-03-09test: remove sandbox test output filePeter Stone
2026-03-09test: add sandbox test output fileClaudomator Agent
2026-03-09chore: remove deleted template files from gitPeter Stone
2026-03-09feat: delete templates feature and allow requeueing BUDGET_EXCEEDED tasksPeter Stone
Removed all template-related code from frontend (tabs, modals, logic) and backend (routes, files, DB table). Updated BUDGET_EXCEEDED tasks to be requeueable with a Restart button. Fixed ReferenceError in isUserEditing for Node.js tests.
2026-03-09web: sort Done/Interrupted tabs newest-first and filter Done tab by 24hPeter Stone
Updated sortTasksByDate to support descending sort. Changed renderTaskList to use descending sort for Done and Interrupted tabs. Updated filterTasksByTab to hide Done tasks older than 24 hours by default. Updated frontend tests to match new behavior.
2026-03-09task: allow requeueing BUDGET_EXCEEDED tasksPeter Stone
Permitted BUDGET_EXCEEDED -> QUEUED transition in ValidTransition. Updated frontend to show 'Restart' button for BUDGET_EXCEEDED tasks, allowing them to be requeued after failure.