Commit Graph

7871 Commits

Author SHA1 Message Date
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
dbea81c67e feat(HAI-015): add agent-active glow effect to TaskCard
- Add agent-active CSS with animated purple border glow using in-progress theme color
- Apply agent-active class conditionally in TaskCard component
- Add TaskCard agent-active unit tests
- Move TaskCard tests to __tests__ directory
2026-03-25 21:44:26 -04:00
Dustin Byrne
f34d849282 feat(HAI-020): add atomic writes and remove truncation recovery workarounds
- Add atomic writes for config.json with config lock in store
- Simplify safeReadTaskJson to readTaskJson, removing truncation recovery logic
- Remove withRetry workaround from fetchTaskDetail in dashboard API
- Remove related retry logic from executor and dashboard command
- Update store tests to cover atomic write behavior
2026-03-25 21:43:57 -04:00
Dustin Byrne
bce41ca00c feat(HAI-013): complete Step 1 — add markdown-body base styles, ensure no backdrop on prompt rendering 2026-03-25 21:43:46 -04:00
Dustin Byrne
99502e4e05 feat: resume orphaned in-progress tasks on engine restart 2026-03-25 21:42:47 -04:00
Dustin Byrne
2488e1c9d2 feat(HAI-020): complete Step 3 — remove withRetry workaround from fetchTaskDetail 2026-03-25 21:38:16 -04:00
Dustin Byrne
6975fae33f feat(HAI-020): complete Step 2 — simplify safeReadTaskJson to readTaskJson, remove truncation recovery 2026-03-25 21:37:44 -04:00
Dustin Byrne
6d2c234d89 feat(HAI-020): complete Step 1 — atomic writes for config.json with config lock 2026-03-25 21:36:38 -04:00
Dustin Byrne
0e023c7b2b fix(HAI-018): improve error handling for task detail fetching
- Fix server-side error handling in GET /tasks/:id with retry on transient failures
- Add client-side retry logic for fetchTaskDetail in dashboard
- Add unit tests for routes and API error/retry behavior
- Remove outdated core store tests and vitest config
- Update documentation for error handling improvements
2026-03-25 21:33:39 -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
0c0ca5ad95 fix(HAI-018): complete Step 4 — documentation & delivery 2026-03-25 21:32:46 -04:00
Dustin Byrne
6f1cc2cb48 fix(HAI-018): complete Step 2 — add client-side retry for fetchTaskDetail
- Added withRetry wrapper in api.ts (1 retry, 200ms delay)
- fetchTaskDetail now retries transient 500s transparently
- TaskCard shows 'Failed to load task details' instead of raw error
- Added api.test.ts with success, retry-success, and exhaustion tests
2026-03-25 21:32:11 -04:00
Dustin Byrne
d452aeb0c1 fix(HAI-018): complete Step 1 — fix server-side error handling in GET /tasks/:id
- Route now returns 404 only for ENOENT, 500 for transient errors
- store.getTask() retries once after 50ms on non-ENOENT failures
- Added route tests for success, 404, and 500 cases
- Updated vitest config to include src/**/*.test.* files
2026-03-25 21:30:18 -04:00
Dustin Byrne
01752d5d6a feat(HAI-017): add per-task write lock, atomic writes, and defensive JSON parsing to TaskStore
- Add per-task write lock in TaskStore to prevent concurrent write corruption
- Implement defensive JSON parsing with recovery for task.json files
- Use atomic writes (write-to-temp + rename) for task.json updates
- Add vitest config and tests for lock, parsing, and atomic write behavior
- Remove concurrency module from engine, consolidating store safety in core
2026-03-25 21:29:10 -04:00
Dustin Byrne
ea2a9399c7 feat(HAI-017): complete Step 5 — documentation and delivery 2026-03-25 21:28:52 -04:00
Dustin Byrne
a8f31782a8 test(HAI-017): complete Step 4 — add vitest config and tests for lock, parsing, atomic writes 2026-03-25 21:27:49 -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
dcf9da35a0 docs(HAI-016): complete Step 7 — update JSDoc for maxConcurrent and AgentSemaphore 2026-03-25 21:27:05 -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
65ed0d919e feat(HAI-017): complete Step 3 — use atomic writes for task.json 2026-03-25 21:24:46 -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
edb31077d4 feat(HAI-017): complete Step 2 — add defensive JSON parsing with recovery 2026-03-25 21:21:15 -04:00
Dustin Byrne
ab3acd59b5 feat(HAI-017): complete Step 1 — add per-task write lock to TaskStore 2026-03-25 21:19:19 -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
b9ee8cc04b feat(HAI-014): reorder TaskCard layout and add tests
- Reorder JSX and update layout in TaskCard component
- Update dashboard styles for new TaskCard layout
- Add TaskCard unit tests with vitest
- Add vitest config and test dependencies to dashboard package
2026-03-25 21:11:16 -04:00
Dustin Byrne
43cc7e7f05 test(HAI-015): complete Step 3 — add TaskCard agent-active tests 2026-03-25 21:11:07 -04:00
Dustin Byrne
19b12a4770 test(HAI-014): complete Step 2 — add TaskCard tests and vitest config 2026-03-25 21:10:51 -04:00
Dustin Byrne
4777ae5dcb feat(HAI-014): complete Step 1 — reorder JSX and update layout 2026-03-25 21:10:10 -04:00
Dustin Byrne
cf79ae52d4 test(HAI-013): complete Step 2 — add TaskDetailModal tests and vitest config 2026-03-25 21:10:05 -04:00
Dustin Byrne
ebbc6d479a feat(HAI-015): complete Step 2 — apply agent-active class conditionally 2026-03-25 21:09:26 -04:00
Dustin Byrne
97f9dc6dbb feat(HAI-015): complete Step 1 — add agent-active glow CSS 2026-03-25 21:09:16 -04:00
Dustin Byrne
428362a6fd feat(HAI-013): complete Step 1 — drop detail-prompt backdrop and scroll for markdown rendering 2026-03-25 21:09:00 -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
06a6046950 feat(HAI-012): add activity timeline to TaskDetailModal
- Add formatTimestamp helper for relative time display
- Add Activity section rendering task log entries in reverse chronological order
- Display log action, timestamp, and optional outcome per entry
- Add timeline-style CSS with scrollable list, dot indicators, and styled outcome blocks
2026-03-25 21:04:03 -04:00
Dustin Byrne
c8aacc3622 feat(HAI-012): complete Steps 1-2 — add activity timeline to TaskDetailModal with styling 2026-03-25 21:03:12 -04:00
Dustin Byrne
963bc15e58 fix(HAI-010): serialize auto-merge with queue, startup sweep, and periodic retry
- Add serialized merge queue to prevent concurrent git merge operations
- Enqueue in-review tasks on startup so pre-existing tasks are not missed
- Add periodic retry interval to re-attempt failed merges automatically
- Re-check autoMerge setting and task column before each merge attempt
- Clean up merge retry interval on SIGINT for graceful shutdown
2026-03-25 21:01:30 -04:00
Dustin Byrne
c31893ce18 feat(HAI-011): add progress indicator to TaskCard
- Add step completion progress bar to TaskCard component
- Color progress fill dynamically based on column status
- Add card-progress, card-progress-bar, card-progress-fill, and card-progress-label styles
- Show completed/total step count label beside progress bar
2026-03-25 21:00:36 -04:00
Dustin Byrne
a7b225d096 fix(HAI-010): complete Step 1 — serialize auto-merge, startup sweep, periodic retry
- Add serialized merge queue preventing concurrent git merge operations
- Startup sweep enqueues existing in-review tasks when autoMerge is enabled
- Periodic retry interval catches failed merges on each poll cycle
- All three paths (event-driven, startup, periodic) use the same queue
- Reset task status on merge failure so tasks don't appear stuck
- Re-check autoMerge setting before each dequeue
2026-03-25 21:00:01 -04:00
Dustin Byrne
1d1fc8dbe1 feat(HAI-011): complete Step 1+2 — add progress indicator to TaskCard with styles 2026-03-25 20:59:22 -04:00
Dustin Byrne
32d1210f01 fix(HAI-009): move queued tasks to Up Next group and add tests
- Fix worktreeGrouping to place queued tasks in Up Next group only
- Add unit tests for worktreeGrouping utility (120+ lines)
- Clean up InlineCreateCard component styling
- Remove unused code from triage engine
- Fix TaskCard status display
2026-03-25 20:59:05 -04:00
Dustin Byrne
424cc9acbd test(HAI-009): complete Step 2 — add unit tests for worktreeGrouping 2026-03-25 20:57:20 -04:00
Dustin Byrne
a205674c1a fix(HAI-009): complete Step 1 — move queued tasks to Up Next group only 2026-03-25 20:55:06 -04:00
Dustin Byrne
58bc6a0677 fix(HAI-008): wrap text in inline create card textarea
- Replace input with auto-resizing textarea in InlineCreateCard
- Add dynamic height adjustment on content change
- Style textarea with no resize handle, hidden overflow, and proper line-height
2026-03-25 20:54:24 -04:00
Dustin Byrne
0f00cb9aac feat(HAI-007): set specifying status during triage
- Set task status to 'specifying' when triage specification begins
- Clear status back to null before moving task to todo on success
- Clear status on specification error with safe catch
- Add 'specifying' to active statuses in dashboard TaskCard
2026-03-25 20:54:11 -04:00
Dustin Byrne
224cbe1c0c fix(HAI-008): wrap text in inline create card textarea 2026-03-25 20:52:52 -04:00