Commit Graph

1095 Commits

Author SHA1 Message Date
Dustin Byrne
f92c842fb3 test(HAI-035): add restart integration tests for engine recovery scenarios
- Create test infrastructure with mock helpers for executor, merger, and scheduler
- Add in-progress task resume tests covering worktree recovery and branch handling
- Add in-review merge handling tests for post-crash merge completion
- Add triage re-pick and scheduler restart tests
- Add crash scenario edge case tests for partial state recovery
2026-03-25 22:52:37 -04:00
Dustin Byrne
b41e215246 feat(HAI-033): add dependency-chain worktree reuse and conditional cleanup
- Add executor logic to resolve and reuse dependency worktrees for warm build caches
- Add reuseWorktree method that creates a new branch in an existing worktree
- Add findWorktreeUser helper to check if a worktree is shared across tasks
- Update executor and merger cleanup to skip worktree removal when still in use
- Add comprehensive tests for worktree reuse and conditional cleanup paths
2026-03-25 22:51:43 -04:00
Dustin Byrne
c51fa74732 fix: deps wait for done (merged) not in-review 2026-03-25 22:40:02 -04:00
Dustin Byrne
edd42c269d feat(HAI-027): add configurable test and build commands to settings
- Add testCommand and buildCommand optional fields to Settings type
- Inject configured commands into triage agent context for task specs
- Add test/build command input fields to the settings modal UI
- Remove legacy executor-level command handling in favor of triage injection
- Add triage tests covering command injection behavior
2026-03-25 22:19:47 -04:00
Dustin Byrne
289f865689 feat(HAI-027): complete Step 2 — inject commands into triage agent context 2026-03-25 22:17:44 -04:00
Dustin Byrne
8ae79a95de feat(HAI-026): complete Step 2 — execute worktreeInitCommand after worktree creation 2026-03-25 22:11:36 -04:00
Dustin Byrne
69ff2f7aa0 feat: squash merge for clean one-commit-per-task history
- git merge --squash replaces git merge --no-ff
- Merge agent prompt updated for squash flow
- Fallback detection uses staged changes instead of MERGE_HEAD
- Abort uses git reset --merge instead of git merge --abort
- Store fallback merge also squashes + commits
2026-03-25 22:02:33 -04:00
Dustin Byrne
a6d18e1b53 feat: replace .DONE file with task_done tool
- task_done() marks all remaining steps as done and signals completion
- No more filesystem side channel for completion detection
- Removes all .DONE references from executor and prompts
2026-03-25 21:51:34 -04:00
Dustin Byrne
b5da595f3b feat: triage agent gets task_list and task_get tools for duplicate detection
- task_list: returns all non-done tasks (ID, column, description, deps)
- task_get: returns full task detail including PROMPT.md content
- Agent calls task_list to scan for duplicates, task_get to verify
2026-03-25 21:48:33 -04:00
Dustin Byrne
f74a1f3597 feat(HAI-022): add duplicate task detection during triage
- Add duplicate check instructions to specification prompt
- Read existing tasks before writing spec to detect duplicates
- Agent outputs DUPLICATE: {id} instead of PROMPT.md when duplicate found
- Parse agent output for duplicate flag and auto-close duplicate tasks
- Log duplicate relationship before deleting the duplicate task
2026-03-25 21:48:22 -04:00
Dustin Byrne
285893d026 feat: triage agent checks for duplicate tasks before specifying
- Triage prompt instructs agent to read existing task.json files
- If duplicate found, agent writes DUPLICATE: HAI-XXX to PROMPT.md
- Triage processor detects this and deletes the duplicate task
- Avoids wasting tokens specifying work that's already tracked
2026-03-25 21:47:23 -04:00
Dustin Byrne
34fe3fe969 fix(HAI-019): add generic type parameters to tool definitions
- Extract tool parameter schemas to module-level constants for reuse
- Add Static<typeof schema> type annotations to tool execute callbacks
- Import Static type from @mariozechner/pi-ai
- Remove inline parameter schema definitions from tool objects
2026-03-25 21:45:43 -04:00
Dustin Byrne
e7d964f9d2 feat(HAI-013): add markdown rendering styles and TaskDetailModal tests
- Add markdown-body base styles in dashboard styles.css
- Remove backdrop and enable scroll on task detail prompt rendering
- Add TaskDetailModal unit tests with vitest jsdom environment
- Update vitest config with globals and jsdom support
- Clean up unused test files and legacy concurrency module
2026-03-25 21:45:05 -04:00
Dustin Byrne
99502e4e05 feat: resume orphaned in-progress tasks on engine restart 2026-03-25 21:42:47 -04:00
Dustin Byrne
9596430016 fix(HAI-019): complete Step 1 — add generic type parameters to tool definitions
Extract TypeBox schemas to module-level constants and use Static<typeof schema>
to explicitly type execute callback params, resolving all TS7006 implicit-any
errors in the four create*Tool methods.
2026-03-25 21:33:15 -04:00
Dustin Byrne
60be31927f feat(HAI-016): add shared AgentSemaphore for concurrent agent limiting
- Create AgentSemaphore class in engine/src/concurrency.ts with configurable maxConcurrent
- Integrate semaphore into TriageProcessor and TaskExecutor to gate agent spawning
- Wire semaphore into merge path and dashboard engine components
- Add comprehensive tests for concurrency, executor, and triage integration
- Update JSDoc and types for maxConcurrent configuration option
2026-03-25 21:27:29 -04:00
Dustin Byrne
0f80d4f2b2 feat(HAI-016): complete Step 5 — wire semaphore into dashboard engine components 2026-03-25 21:25:07 -04:00
Dustin Byrne
1ebde5701a feat: task_create tool accepts optional dependencies 2026-03-25 21:22:19 -04:00
Dustin Byrne
6a45531a79 feat(HAI-016): complete Step 4 — integrate semaphore into merge path 2026-03-25 21:21:42 -04:00
Dustin Byrne
d487ebee51 feat(HAI-016): complete Step 3 — integrate semaphore into TaskExecutor 2026-03-25 21:19:07 -04:00
Dustin Byrne
640c288832 feat(HAI-016): complete Step 2 — integrate semaphore into TriageProcessor 2026-03-25 21:17:31 -04:00
Dustin Byrne
6379008a88 feat(HAI-016): complete Step 1 — create shared AgentSemaphore 2026-03-25 21:14:13 -04:00
Dustin Byrne
b8d4853e85 feat: register task_update, task_log, task_create as agent tools
Replaces CLI-based progress reporting (hai task update/log/create)
with custom tools registered on the worker's pi session. No PATH
dependency, no shell overhead, works in any worktree.

- task_update(step, status) — update step lifecycle
- task_log(message) — log actions and decisions
- task_create(description) — create tasks for out-of-scope work
- review_step unchanged (already a tool)
- System prompt and execution prompt updated to reference tools
2026-03-25 21:04:20 -04:00
Dustin Byrne
64b28a012e feat(HAI-007): complete Step 1 — set specifying status during triage 2026-03-25 20:52:01 -04:00
Dustin Byrne
f6dc070bd8 feat(HAI-005): add auto-merge functionality for in-review tasks
- Add autoMerge boolean to Settings model with default false
- Add auto-merge toggle UI to the In Review column header
- Implement server-side auto-merge behavior in dashboard command
- Fix pre-existing build errors in types, executor, and dashboard server
- Update README with auto-merge documentation
2026-03-25 20:48:34 -04:00
Dustin Byrne
2713176190 fix: simplify triage testing requirements — rules only, no prereq check 2026-03-25 20:47:39 -04:00
Dustin Byrne
92154b70b6 feat(HAI-006): add groupOverlappingFiles setting for file-scope-aware task scheduling
- Add groupOverlappingFiles toggle to Settings types and store with default enabled
- Parse File Scope sections from PROMPT.md to extract per-task file lists
- Implement overlap detection in scheduler to group tasks sharing files
- Add groupOverlappingFiles toggle to the Settings UI modal
- Update README and remove obsolete triage overlap logic
2026-03-25 20:46:07 -04:00
Dustin Byrne
7c39f325e2 fix: triage agent must require real tests, create test infra task if missing
Triage prompt now explicitly:
- Checks for test framework before writing spec
- Creates a prerequisite task if no test framework exists
- Adds it as a dependency on the current task
- Forbids typecheck-only or manual-only testing steps
2026-03-25 20:45:07 -04:00
Dustin Byrne
c3a785a3fb feat(HAI-006): complete Step 3 — implement overlap detection in scheduler 2026-03-25 20:43:19 -04:00
Dustin Byrne
7f3cf51c19 fix(HAI-005): fix pre-existing build errors in types, executor, and dashboard server 2026-03-25 20:41:06 -04:00
Dustin Byrne
6fbf3519b5 feat(HAI-002): add maxWorktrees setting to limit total git worktrees
- Add maxWorktrees field to Settings interface with default of 4
- Enforce worktree limit in Scheduler.schedule() alongside maxConcurrent
- Wire setting through dashboard startup from persisted settings
- Include maxWorktrees in /api/config response
- Add Max Worktrees input to Settings Modal UI
- Backward compatible: existing configs without maxWorktrees use default
2026-03-25 20:32:07 -04:00
Dustin Byrne
93651835b6 fix: executor prompt gives agent concrete CLI examples and review_step instructions
- System prompt explains review_step tool with review level table
- Execution prompt injects real task ID in all CLI examples
- Execution prompt parses review level from PROMPT.md and tells agent exactly when to call review_step
- Removed {TASK_ID} placeholders that agent saw as literal text
2026-03-25 20:24:32 -04:00
Dustin Byrne
040409041a feat: cross-model review via review_step tool
- reviewer.ts: spawns separate pi agent with read-only tools
  and reviewer system prompt (taskplane's review format/verdicts)
- Executor registers review_step as a custom tool on the worker session
- Worker calls review_step(step, type, step_name) at step boundaries
  based on review level (0=none, 1=plan, 2=plan+code, 3=full)
- Reviewer returns APPROVE/REVISE/RETHINK with structured feedback
- REVISE feedback returned inline to worker for immediate action
- Review calls logged to task via hai task log
2026-03-25 20:22:20 -04:00
Dustin Byrne
66a62b9bcb refactor: drop discover command, agents create new tasks instead 2026-03-25 20:17:38 -04:00
Dustin Byrne
8a2a5ac14b feat: taskplane-style specs + CLI step tracking
- Triage agent generates full PROMPT.md (mission, steps, file scope,
  review level, docs requirements, commit conventions, guardrails)
- Executor agent reports progress via hai task CLI
- hai task update <id> <step> <status> — step lifecycle
- hai task log <id> <message> — execution log
- hai task discover <id> <what> <disp> — record discoveries
- hai task show <id> — display steps, progress, discoveries, log
- Steps auto-parsed from PROMPT.md headings into task.json
- Task types extended with steps, reviews, discoveries, log
2026-03-25 20:14:04 -04:00
Dustin Byrne
158c0ceb59 feat(HAI-003): clear task status in completeTask before moving to done 2026-03-25 20:01:16 -04:00
Dustin Byrne
ada968512e feat(HAI-002): set status at engine processor lifecycle points 2026-03-25 19:24:11 -04:00
Dustin Byrne
f57b87f7d3 feat(HAI-001): handle optional title in engine components 2026-03-25 19:15:35 -04:00
Dustin Byrne
98ddf0f3d3 fix: remove dead setStatus calls from engine 2026-03-25 19:02:24 -04:00
Dustin Byrne
d2056f620a feat(HAI-001): wire status updates in executor 2026-03-25 18:51:38 -04:00
Dustin Byrne
ea148e983b feat(HAI-001): wire status updates in scheduler (blocked/queued) 2026-03-25 18:51:27 -04:00
Dustin Byrne
cbb411cba3 feat(HAI-001): wire status updates in triage processor 2026-03-25 18:51:09 -04:00
Dustin Byrne
834a9f840b fix: MERGE_HEAD detection in AI merger 2026-03-25 18:44:49 -04:00
Dustin Byrne
16e9043aee feat: AI-powered merge via pi agent 2026-03-25 18:43:49 -04:00
Dustin Byrne
961203692d feat: hai board — core, dashboard, cli, engine 2026-03-25 18:32:10 -04:00