Commit Graph

82 Commits

Author SHA1 Message Date
Lauren ten Hoor
5b601c7db3 feat: auto-share ticket URL after task_create
Automatically includes the issue URL in the announcement when
task_create is called, eliminating the need for users to ask
'What's the URL?' after creating a task.

Changes:
- Enhanced announcement formatting with line breaks
- Always includes issue URL with 🔗 prefix
- Improved readability with structured format

Example output:
📋 Created #109: "Fix bug" (To Do)
🔗 https://github.com/user/repo/issues/109
Ready for pickup when needed.

Example with description:
📋 Created #110: "Add feature" (Planning)
With detailed description.
🔗 https://github.com/user/repo/issues/110
Picking up for DEV...

Addresses issue #109
2026-02-10 20:36:39 +08:00
Lauren ten Hoor
4540c9af30 Merge pull request #107 from laurentenhoor/feature/106-enhance-notification-urls
feat: enhance notification URLs with issue links and tool aliases
2026-02-10 20:33:30 +08:00
Lauren ten Hoor
2260f39383 feat: enhance notification URLs with issue links and tool aliases
Improvements to notification system for better traceability:

1. DEV Completion Notifications:
   - Always include issue URL (📋 Issue: ...)
   - Include PR/MR URL when available (🔗 PR: ...)
   - Issue URL serves as fallback when PR/MR not found
   - Both URLs shown when PR/MR exists for maximum traceability

2. QA Pass Notifications:
   - Now include issue URL (📋 Issue: ...)
   - Provides direct link to resolved issue

3. Tool Aliases:
   - Added 'work_finish' as alias for 'task_complete'
   - Added 'work_start' as alias for 'task_pickup'
   - Added 'status' as alias for 'queue_status'
   - Matches naming used in AGENTS.md documentation

Example DEV notification:
 DEV done #106 — Enhanced notification URLs
📋 Issue: https://github.com/user/repo/issues/106
🔗 PR: https://github.com/user/repo/pull/107
Moved to QA queue.

Example QA notification:
🎉 QA PASS #106 — All tests passed
📋 Issue: https://github.com/user/repo/issues/106
Issue closed.

Addresses issue #106
2026-02-10 20:32:51 +08:00
Lauren ten Hoor
7339a8395d Merge feat/105-test-md-lauren: Create TEST.md with information about Lauren ten Hoor
Addresses issue #105
2026-02-10 20:21:02 +08:00
Lauren ten Hoor
107126b167 feat: create TEST.md with information about Lauren ten Hoor (#105) 2026-02-10 20:20:51 +08:00
Lauren ten Hoor
29fafd4958 Merge pull request #104 from laurentenhoor/feature/103-enforce-qa-comments
docs: enforce QA comments on every review (pass or fail)
2026-02-10 18:54:24 +08:00
Lauren ten Hoor
624b84b5bb docs: add QA workflow documentation with comment requirements
Added comprehensive QA workflow documentation explaining:
- Required steps for QA reviews
- Mandatory task_comment before task_complete
- Comment templates for pass/fail scenarios
- Rationale for enforcement (audit trail, knowledge sharing, etc.)
- Best practices for QA documentation

This documentation supports the QA comment enforcement
introduced in role templates.

Related to issue #103
2026-02-10 18:53:43 +08:00
Lauren ten Hoor
47efdc880e Merge pull request #102 from laurentenhoor/feature/101-include-pr-url
feat: include PR/MR URL in DEV completion notifications
2026-02-10 18:23:23 +08:00
Lauren ten Hoor
09f6903ebb feat: include PR/MR URL in DEV completion notifications
Adds automatic PR/MR URL detection and inclusion in DEV completion
announcements to provide better visibility into completed work.

Changes:
1. TaskManager interface:
   - Added getMergedMRUrl() method to fetch PR/MR URL for an issue

2. GitHub/GitLab providers:
   - Implemented getMergedMRUrl() to find most recent merged PR/MR
   - Returns URL of PR/MR that references the issue number

3. task_complete tool:
   - Added optional prUrl parameter
   - Auto-detects PR/MR URL if not provided
   - Includes PR URL in announcement with 🔗 prefix
   - Format: 'PR: https://github.com/...'

4. Role templates (dev.md):
   - Updated to instruct workers to include prUrl in task_complete
   - Documents that prUrl is optional (auto-detected as fallback)

Example announcement:
 DEV done #101 — Added PR/MR URL to notifications
🔗 PR: https://github.com/user/repo/pull/102
. Moved to QA queue.

Addresses issue #101
2026-02-10 18:22:44 +08:00
Lauren ten Hoor
83e723df32 Merge fix/100-remove-test-md: Remove TEST.md file
Addresses issue #100
2026-02-10 18:18:10 +08:00
Lauren ten Hoor
15b3299c51 chore: remove TEST.md file (#100) 2026-02-10 18:17:53 +08:00
Lauren ten Hoor
decf4a23a2 Merge feat/99-add-test-md-lauren: Add TEST.md with statement about Lauren ten Hoor
Addresses issue #99
2026-02-10 18:12:25 +08:00
Lauren ten Hoor
3280620f00 feat: add TEST.md with statement about Lauren ten Hoor (#99) 2026-02-10 18:12:14 +08:00
Lauren ten Hoor
c3e8e973ef Merge pull request #98 from laurentenhoor/fix/97-clean-label-transitions
fix: ensure clean label transitions by removing all state labels
2026-02-10 18:00:19 +08:00
Lauren ten Hoor
c973c04635 fix: ensure clean label transitions by removing all state labels
Problem:
GitHub was showing confusing label transitions like:
- 'added To Do Doing and removed To Do'
- 'added To Test Testing Done and removed Doing To Test Testing'

This occurred when issues had multiple state labels simultaneously
(due to bugs, manual edits, or failed transitions).

Root Cause:
The old transitionLabel() only removed the 'from' label and added
the 'to' label. If other state labels existed on the issue, they
would remain, causing messy multi-label states.

Solution:
1. Fetch the current issue to inspect all labels
2. Find ALL state labels on the issue (not just 'from')
3. Remove ALL state labels in a single operation
4. Add only the new 'to' label

This ensures atomic, clean transitions that display on GitHub as
a single 'removed X, added Y' operation, even if the issue
previously had multiple state labels.

Changes:
- GitHubProvider.transitionLabel(): Remove all state labels before adding new one
- GitLabProvider.transitionLabel(): Same fix for GitLab consistency

Addresses issue #97
2026-02-10 17:59:57 +08:00
Lauren ten Hoor
6c20a2c38c Merge feat/96-add-test-md: Add TEST.md with dummy content
Addresses issue #96
2026-02-10 17:42:54 +08:00
Lauren ten Hoor
a824d06634 feat: add TEST.md with dummy content (#96) 2026-02-10 17:42:40 +08:00
Lauren ten Hoor
1eb63f517b Merge pull request #95 from laurentenhoor/fix/71-task-update-tool
test: add integration test skeleton for task_update tool
2026-02-10 17:18:50 +08:00
Lauren ten Hoor
3e756fc6a8 test: add integration test skeleton for task_update tool
Adds test file with validation scenarios:
- Schema validation for required/optional params
- All 8 state labels are supported
- Same-state transitions handled gracefully
- Audit logging verification

Includes manual test scenarios for integration verification.

Addresses issue #71 acceptance criteria:
 Can transition any issue to any valid state
 Logs reason to audit trail
 Updates GitHub label (projects.json managed by session_health)
 Documented as orchestrator-only in AGENTS.md
2026-02-10 17:18:21 +08:00
Lauren ten Hoor
4cd95acd20 refactor: remove unused test helpers and related test files
- Deleted `helpers.ts`, `projects.test.ts`, and `scenarios.test.ts` as they are no longer needed.
- Updated `package.json` to remove the test script that referenced the deleted files.
2026-02-10 17:02:44 +08:00
Lauren ten Hoor
880ffdf584 feat: update project name in test helpers and scenarios for consistency 2026-02-10 17:01:54 +08:00
Lauren ten Hoor
9e3279872a feat: add sessionKey to dispatch options and related tools for subagent tracking 2026-02-10 16:58:37 +08:00
Lauren ten Hoor
04f4f6ebc6 Merge fix/90-remove-test-md: Remove TEST.md file
Addresses issue #90
2026-02-10 16:51:30 +08:00
Lauren ten Hoor
d03055a3cf chore: remove TEST.md file (#90) 2026-02-10 16:51:18 +08:00
Lauren ten Hoor
52c7b232d7 feat: add TEST.md with testing content (issue #88) (#89) 2026-02-10 16:14:01 +08:00
Lauren ten Hoor
a52f2e7070 chore: delete TEST.md (issue #86) (#87) 2026-02-10 15:52:00 +08:00
Lauren ten Hoor
4f2be8e551 feat: create TEST.md markdown file (#78) 2026-02-10 15:48:16 +08:00
Lauren ten Hoor
682202e447 Create TEST.md markdown file (#79)
As described in issue #78
2026-02-10 15:26:23 +08:00
Lauren ten Hoor
ec9a29356f Merge pull request #36 from laurentenhoor/fix/27-persist-sessions-on-complete
fix: add defensive safeguards and documentation for session persistence
2026-02-10 10:52:49 +08:00
Lauren ten Hoor
d1a02d988d fix: add defensive safeguards and documentation for session persistence (#27)
- Add defensive verification in deactivateWorker to catch any accidental
  session clearing bugs
- Enhance documentation in activateWorker, deactivateWorker, and
  updateWorker to clearly explain session preservation behavior
- Add comprehensive example flow in activateWorker docs showing session
  reuse across multiple tasks and tiers
- Add test suite for session persistence (projects.test.ts) to prevent
  regression
- Add npm test script to run test suite

This ensures sessions persist per tier after task completion, enabling
session reuse across multiple tasks of the same tier for massive token
savings (~50K per reuse) and context preservation.

Fixes: Bug where sessions could theoretically be accidentally cleared
during worker state updates, though current code was already correct.
This adds defense-in-depth to make the invariant bulletproof.
2026-02-10 10:52:12 +08:00
Lauren ten Hoor
38ad3fe27f refactor: generalize channel type handling across various components 2026-02-10 09:56:17 +08:00
Lauren ten Hoor
cb0f628772 fix: strengthen 'no closing keywords' warning in DEV instructions (#24) (#34)
- Expanded DEFAULT_DEV_INSTRUCTIONS with more detailed context and explicit
  warning about not using 'Closes #X', 'Fixes #X', 'Resolves #X'
- Added 'Fixes issue #X' to the list of prohibited closing keywords
- Added new 'Worker Task Templates' section to AGENTS_MD_TEMPLATE with
  explicit CRITICAL warning about closing keywords in PR/MR descriptions
- Updated workflow steps to reinforce proper issue referencing:
  Use 'As described in issue #X' or 'Addresses issue #X' instead

This prevents GitHub from auto-closing issues when PRs merge, ensuring
DevClaw's task_complete validation and QA workflow are not bypassed.

As described in issue: #24
2026-02-10 09:36:51 +08:00
Lauren ten Hoor
a9e5b9ef3e feat: add task_update and task_comment tools (#33)
Closes #26

This PR adds two new DevClaw tools for better task lifecycle management:

- task_update: Change issue state programmatically without full pickup/complete flow
- task_comment: Add review comments or notes to issues with optional role attribution
2026-02-10 09:20:27 +08:00
Lauren ten Hoor
78bc95efb3 Merge pull request #32 from laurentenhoor/feature/24-remove-closes-keyword
fix: remove GitHub auto-closing keywords from worker templates (#24)
2026-02-10 09:03:42 +08:00
Lauren ten Hoor
4663fa6fec fix: remove GitHub auto-closing keywords from worker templates (#24)
- Added explicit warning to DEFAULT_DEV_INSTRUCTIONS
- Added warning to AGENTS_MD_TEMPLATE conventions section
- Workers instructed to use 'As described in issue #X' instead of 'Closes #X'
- Prevents GitHub/GitLab from auto-closing issues before QA validation
2026-02-10 09:03:19 +08:00
Lauren ten Hoor
31481d4ae2 Revert "fix: add explicit worker state update in task_pickup after dispatch (#23)"
This reverts commit d727a812e6.
2026-02-10 08:58:01 +08:00
Lauren ten Hoor
8c13173dc5 fix: add explicit worker state update in task_pickup after dispatch (#23) (#31)
Adds defense-in-depth by explicitly calling activateWorker() in task_pickup.ts
after dispatchTask() returns. This ensures the worker state (active, issueId,
model, sessionKey, startTime) is properly set in projects.json even if
dispatchTask's internal state update encounters issues.

The redundant update:
- Sets active=true, issueId, and model for both spawn and reuse cases
- Sets sessionKey and startTime only on new spawns (not on session reuse)
- Provides fallback if race conditions or I/O errors affect dispatch.ts

Fixes #23
2026-02-10 08:34:30 +08:00
Lauren ten Hoor
d727a812e6 fix: add explicit worker state update in task_pickup after dispatch (#23)
Adds defense-in-depth by explicitly calling activateWorker() in task_pickup.ts
after dispatchTask() returns. This ensures the worker state (active, issueId,
model, sessionKey, startTime) is properly set in projects.json even if
dispatchTask's internal state update encounters issues.

The redundant update:
- Sets active=true, issueId, and model for both spawn and reuse cases
- Sets sessionKey and startTime only on new spawns (not on session reuse)
- Provides fallback if race conditions or I/O errors affect dispatch.ts

Fixes #23
2026-02-10 08:34:03 +08:00
Lauren ten Hoor
6bc33b9d23 fix: use assert instead of expect in test file (#30) 2026-02-10 08:28:02 +08:00
Lauren ten Hoor
d8502362ec feat: enhance queue_status with execution-aware task sequencing (#29)
- Show plugin-level projectExecution setting in output
- Show project-level roleExecution for each project
- Sequential mode: single global task sequence across projects
- Parallel mode: per-project task tracks
- Proper handling of roleExecution within each project
- Priority ordering (To Improve > To Test > To Do)
- Visual distinction between active and upcoming tasks

Closes #21
2026-02-10 08:27:00 +08:00
Lauren ten Hoor
4d4bd34325 fix: re-throw error when state update fails after dispatch (#23) (#25)
When a worker session is successfully dispatched but activateWorker
fails to update projects.json, the error was being logged but not
re-thrown. This caused task_pickup to return success even though
the state wasn't updated, leading to task_complete failures later.

Now we re-throw the error after logging the warning, so the caller
knows the state update failed even though the session is running.

Fixes: #23
2026-02-10 01:30:45 +08:00
Lauren ten Hoor
56143cb208 feat: include ticket URL in task pickup announcements (#22)
- Add issue URL to announcement in dispatch.ts
- Add issueUrl field to workerStart notification event
- Update notification message to include URL
- Both automated notifications and manual announcements now show full ticket URL

Example output:
🔧 Spawning DEV (medior) for #7: Create TODO.md...
🔗 https://github.com/laurentenhoor/devclaw/issues/7
2026-02-10 01:11:56 +08:00
Lauren ten Hoor
6ec01537a6 fix: block sessions_send in addition to sessions_spawn (#19) (#20)
Workers shouldn't spawn sub-agents or message other sessions directly.
All coordination should go through DevClaw tools (task_pickup, task_complete, etc.).
2026-02-10 00:54:36 +08:00
Lauren ten Hoor
aae6c2ee78 feat: add two-level work mode (projectExecution + roleExecution) (#15) (#18)
Replaces single 'workMode' with two distinct settings:

1. Plugin-level 'projectExecution' (parallel | sequential)
   - parallel: each project can have active workers independently
   - sequential: only one project can have active workers at a time

2. Project-level 'roleExecution' (parallel | sequential)
   - parallel: DEV and QA can run simultaneously on same project
   - sequential: only one role (DEV or QA) active at a time per project

Changes:
- index.ts: rename workMode → projectExecution in config schema
- projects.ts: add roleExecution field to Project type
- heartbeat_tick: check both levels before picking up tasks
- task_pickup: enforce roleExecution when picking up manually
- project_register: accept roleExecution param (default: parallel)
- devclaw_setup: accept projectExecution param

All defaults remain 'parallel' for backward compatibility.
2026-02-10 00:50:52 +08:00
Lauren ten Hoor
d40aa41b16 feat: add programmatic alerting for worker lifecycle events (#16) (#17)
Adds notification system for full visibility into the DevClaw pipeline:

Events and targets:
- workerStart: Posted to project group when worker spawns/resumes
- workerComplete: Posted to project group when DEV done/QA pass/fail/refine
- heartbeat: Posted to orchestrator DM with tick summary

Implementation:
- New lib/notify.ts module with buildMessage() and sendMessage()
- Integrated into task_pickup, task_complete, and heartbeat_tick
- Uses OpenClaw gateway to invoke message tool

Configuration (optional):
- orchestratorDm: Chat ID for heartbeat notifications
- notifications.heartbeatDm: Enable/disable heartbeat DM (default: true)
- notifications.workerStart: Enable/disable start notifications (default: true)
- notifications.workerComplete: Enable/disable completion notifications (default: true)

Notifications fail silently (logged but don't break main flow).
2026-02-10 00:40:44 +08:00
Lauren ten Hoor
c88071db0e Revert "docs: add TODO.md with onboarding flow and repo cloning instructions"
This reverts commit f01cba1d79.
2026-02-10 00:17:24 +08:00
Lauren ten Hoor
f01cba1d79 docs: add TODO.md with onboarding flow and repo cloning instructions
- Create comprehensive onboarding guide for new contributors
- Document prerequisites (Node.js, OpenClaw, glab/gh CLI)
- Include step-by-step setup from clone to running project
- Add troubleshooting section for common issues
- Link to additional resources

Closes #7
2026-02-10 00:03:14 +08:00
Lauren ten Hoor
9afa318697 feat: add heartbeat_tick tool for automated task pickup (#13) (#14)
Adds heartbeat_tick tool that automates task pickup across all projects:

- Runs session health checks (zombie cleanup) before pickups
- Loops over all registered projects
- Picks up tasks by priority (To Improve > To Test > To Do)
- Supports two work modes:
  - parallel: each project can have DEV+QA running independently
  - sequential: only 1 DEV + 1 QA globally (can be different projects)
- Respects per-project maxDevWorkers/maxQaWorkers settings
- Supports dryRun mode and maxPickups limit
- Context guard: only works from DM/cron, blocks project groups

Also adds:
- workMode config option (parallel | sequential)
- maxDevWorkers/maxQaWorkers fields to Project type
2026-02-09 23:49:13 +08:00
Lauren ten Hoor
4f4952f978 feat: configure subagent cleanup interval to keep development sessions alive 2026-02-09 23:32:47 +08:00
Lauren ten Hoor
374628f3c6 feat: auto-detect project, role, model, and issue in task_pickup (#11) (#12)
- projectGroupId: auto-detected from group chat context
- role: inferred from issue label (To Do/To Improve → dev, To Test → qa)
- model: detected from tier labels on issue, then falls back to heuristics
- issueId: if omitted, picks next by priority (To Improve > To Test > To Do)

All parameters are now optional. Tool includes autoDetected object in response
to indicate which values were auto-detected vs explicitly provided.
2026-02-09 23:23:45 +08:00