Commit Graph

195 Commits

Author SHA1 Message Date
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
Lauren ten Hoor
0e3c546e8d fix: use --params instead of --data for gateway call (#11) 2026-02-09 23:14:13 +08:00
Lauren ten Hoor
4ca35cf57c feat: add tool restrictions to DevClaw agents in plugin config 2026-02-09 23:05:48 +08:00
Lauren ten Hoor
9bc0513198 refactor: remove deprecated GitLab wrapper module and related code 2026-02-09 22:43:01 +08:00
Lauren ten Hoor
4e10b171c1 refactor: migrate issue provider logic to task manager interface and implement GitHub/GitLab providers 2026-02-09 22:38:43 +08:00
Lauren ten Hoor
3a2e739a62 refactor: remove glabPath and ghPath options from providers and update related code 2026-02-09 22:33:46 +08:00
Lauren ten Hoor
7a29da4c83 Merge feature/10-provider-abstraction into main 2026-02-09 22:19:46 +08:00
Lauren ten Hoor
3197f442d2 feat: abstract GitLab/GitHub CLI usage (#10)
- Move resolveRepoPath to lib/utils.ts
- Update all tools to use createProvider() from lib/providers/
- Remove direct imports from lib/gitlab.ts
- Mark lib/gitlab.ts as deprecated
- All tools now work with both GitHub (gh CLI) and GitLab (glab CLI)
- Provider auto-detected from git remote URL
2026-02-09 22:19:43 +08:00
Lauren ten Hoor
bbef2970d1 fix: update project title in README for consistency 2026-02-09 19:30:13 +08:00
Lauren ten Hoor
161cef44cf fix: center align logo and update header for clarity in README 2026-02-09 19:29:33 +08:00
Lauren ten Hoor
45c4f42090 feat: update README to include new DevClaw logo and adjust formatting 2026-02-09 19:27:40 +08:00
Lauren ten Hoor
d8d692053c Merge branch 'feature/8-logo-update' - Update logo (#8) 2026-02-09 19:21:13 +08:00
Lauren ten Hoor
57601c7e4d feat: update logo to white background and scale down (#8) 2026-02-09 19:21:09 +08:00
Lauren ten Hoor
07bba44432 feat: add DevClaw logo to README (#8) (#9) 2026-02-09 19:08:56 +08:00
Lauren ten Hoor
a9a3fc3f1f feat: Implement context detection and onboarding tools for DevClaw
- Add context-guard.ts to detect interaction context (via-agent, direct, group) and generate guardrails.
- Introduce onboarding.ts for conversational onboarding context templates and workspace file checks.
- Enhance setup.ts to support new agent creation with channel binding and migration of existing bindings.
- Create analyze-channel-bindings.ts to analyze channel availability and detect binding conflicts.
- Implement context-test.ts for debugging context detection.
- Develop devclaw_onboard.ts for explicit onboarding tool that guides users through setup.
- Update devclaw_setup.ts to include channel binding and migration support in setup process.
- Modify project-register.ts to enforce project registration from group context and auto-populate group ID.
- Enhance queue-status.ts to provide context-aware status checks and recommendations.
- Update task tools (task-complete, task-create, task-pickup) to clarify group ID usage for Telegram/WhatsApp.
2026-02-09 18:34:45 +08:00
Lauren ten Hoor
32eb079521 feat: add TypeScript support and shared types
- Added TypeScript configuration file (tsconfig.json) with strict settings.
- Introduced devDependencies for TypeScript in package.json.
- Added scripts for type checking and watching for changes.
- Created a new types file (lib/types.ts) defining shared types for the DevClaw plugin.
2026-02-09 14:27:13 +08:00
Lauren ten Hoor
b5bcd313e8 feat: refactor CLI registration and remove unused dependencies 2026-02-09 14:04:02 +08:00
Lauren ten Hoor
53dac61911 feat: add roadmap for configurable roles and channel-agnostic groups 2026-02-09 13:43:52 +08:00
Lauren ten Hoor
aa8e8dbd1b feat: refactor model selection to use developer tiers
- Replaced raw model aliases with developer tiers (junior, medior, senior, qa) in dispatch and model selection logic.
- Updated `dispatchTask` to resolve models based on tiers and plugin configuration.
- Modified `selectModel` to return tier names instead of model aliases based on task description.
- Implemented migration logic for transitioning from old model aliases to new tier names in worker state.
- Added setup logic for agent creation and model configuration in `setup.ts`.
- Created shared templates for workspace files and instructions for DEV/QA workers.
- Enhanced project registration to scaffold role files based on developer tiers.
- Updated task management tools to reflect changes in model selection and tier assignment.
- Introduced a new `devclaw_setup` tool for agent-driven setup and configuration.
- Updated plugin configuration schema to support model mapping per developer tier.
2026-02-09 13:41:22 +08:00
Lauren ten Hoor
8a79755e4c feat: Implement GitLabProvider for issue management using glab CLI
- Add GitLabProvider class for handling issue operations, label management, and MR checks.
- Implement methods for ensuring labels, creating issues, listing issues by label, and transitioning labels.
- Introduce a provider factory to auto-detect GitLab or GitHub based on the repository URL.
- Create project registration tool to validate repositories, create state labels, and log project entries.
- Enhance queue status and session health tools to support new session management features.
- Update task completion and task creation tools to support auto-chaining and improved session handling.
- Refactor task pickup tool to streamline model selection and session management.
2026-02-09 12:54:50 +08:00
Lauren ten Hoor
d921b5c7bb Refine session management terminology and clarify plugin-controlled lifecycle in documentation 2026-02-08 20:49:44 +08:00
Lauren ten Hoor
fd6c5142b9 Add comprehensive overview of management theory in MANAGEMENT.md 2026-02-08 18:45:16 +08:00
Lauren ten Hoor
e8908eb3b0 Add comprehensive management theory overview to MANAGMENT.md 2026-02-08 18:44:31 +08:00
Lauren ten Hoor
eb9438ab81 Rewrite architecture for session-per-model and plugin-controlled spawning
- Session-per-model: each project keeps separate sessions per model per role
  (haiku/sonnet/opus for DEV, grok for QA) instead of switching models
- Plugin-controlled lifecycle: sessions managed via Gateway RPC (sessions.patch)
  and CLI (openclaw agent), not agent instructions
- New end-to-end flow diagram: human → Telegram → main session → plugin → gateway → sub-agent
- Session reuse diagram showing spawn vs send path
- Updated system overview with Gateway as explicit component
- Updated data flow map with new projects.json sessions schema
- Session spawn/send moved to "DevClaw controls" in scope boundaries
- Added session_health using sessions.list gateway RPC
- Added session transcripts to file locations table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 18:17:03 +08:00
Lauren ten Hoor
e7e61987d4 Replace PM terminology with orchestrator/session model across docs
- Add "Agents vs Sessions" explainer section to ARCHITECTURE.md
- Replace all "PM Agent" references with "Orchestrator" in sequence diagrams
- Fix ticket creation: agents create issues via glab, not humans
- Update scope boundaries to show sub-agent session responsibilities
- Clarify plugin returns instructions, agent executes session operations
- Update ONBOARDING.md issue creation to show agent-first workflow

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 16:30:22 +08:00
Lauren ten Hoor
9195c4be7f Add ONBOARDING.md and ARCHITECTURE.md docs
ONBOARDING: Step-by-step setup guide — prerequisites, plugin install,
agent config, GitLab labels, project registration, first test.

ARCHITECTURE: Full component interaction — system overview diagram,
complete ticket lifecycle with sequence diagrams for every phase
(heartbeat → pickup → dev work → complete → QA → pass/fail/refine),
data flow map, scope boundaries, error recovery, file locations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 16:12:23 +08:00
Lauren ten Hoor
143a2aaafa Update tagline: every group chat becomes an autonomous dev team
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:40:43 +08:00
Lauren ten Hoor
8178a79999 Clarify PM/DEV/QA team structure and isolated group chat model
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:38:26 +08:00
Lauren ten Hoor
a94f4f9d54 Add tagline and intro to README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:36:04 +08:00
Lauren ten Hoor
9b5f796c7e Replace real project references with generic examples in README
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:34:26 +08:00
Lauren ten Hoor
850627d125 Add 'Why' section explaining the guardrails motivation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:30:28 +08:00
Lauren ten Hoor
44cc72fdb2 Rewrite README with architecture docs and mermaid diagrams
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:30:00 +08:00
Lauren ten Hoor
9ace15dad5 Initial commit: DevClaw OpenClaw plugin
Multi-project dev/qa pipeline orchestration with 4 agent tools:
- task_pickup: atomic task pickup with model selection and session reuse
- task_complete: DEV done, QA pass/fail/refine with label transitions
- queue_status: task queue and worker status across projects
- session_health: zombie detection and state consistency checks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-08 15:26:29 +08:00