Commit Graph

167 Commits

Author SHA1 Message Date
Lauren ten Hoor
c61060aff5 test: add comment to README.md (#163) 2026-02-13 19:29:50 +08:00
Lauren ten Hoor
dfeadf742a feat: make workflow states dynamic with XState-style statechart config (#147) (#160)
## Summary

Introduces a configurable workflow state machine that replaces all hardcoded
state labels. The default workflow matches current behavior exactly, ensuring
backward compatibility.

## Architecture

### lib/workflow.ts — Core workflow engine

XState-style statechart configuration:

```typescript
type StateConfig = {
  type: 'queue' | 'active' | 'hold' | 'terminal';
  role?: 'dev' | 'qa';
  label: string;
  color: string;
  priority?: number;
  on?: Record<string, TransitionTarget>;
};
```

All behavior is derived from the config:
- Queue states: `type: 'queue'`, grouped by role, ordered by priority
- Active states: `type: 'active'` — worker occupied
- Transitions: defined with optional actions (gitPull, detectPr, closeIssue, reopenIssue)
- Labels and colors: derived from state.label and state.color

### Derivation functions

- `getStateLabels()` — all labels for issue tracker sync
- `getLabelColors()` — label → color mapping
- `getQueueLabels(role)` — queue labels for a role, ordered by priority
- `getActiveLabel(role)` — the active/in-progress label for a role
- `getRevertLabel(role)` — queue label to revert to on failure
- `detectRoleFromLabel()` — detect role from a queue label
- `getCompletionRule(role, result)` — derive transition rule from config

## Files Changed

- **lib/workflow.ts** — NEW: workflow engine and default config
- **lib/providers/provider.ts** — deprecate STATE_LABELS, LABEL_COLORS; derive from workflow
- **lib/providers/github.ts** — use workflow config for label operations
- **lib/providers/gitlab.ts** — use workflow config for label operations
- **lib/services/pipeline.ts** — use getCompletionRule() from workflow
- **lib/services/tick.ts** — use workflow for queue/active labels
- **lib/services/health.ts** — use workflow for active/revert labels
- **lib/tools/work-start.ts** — use workflow for target label

## Backward Compatibility

- DEFAULT_WORKFLOW matches current hardcoded behavior exactly
- Deprecated exports kept for any external consumers
- No breaking changes to tool interfaces or project state

## Future Work

- Load per-project workflow overrides from projects.json
- User-facing config in projects/workflow.json
- Tool schema generation from workflow states
2026-02-13 18:50:09 +08:00
Lauren ten Hoor
24235cdbf7 Merge pull request #157 from laurentenhoor/fix/156-remove-chained-dispatch
fix: remove chained dispatch from work_finish - heartbeat only pickup path (#156)
2026-02-13 17:51:32 +08:00
Lauren ten Hoor
9dc5c66ce9 fix: remove chained dispatch from work_finish - heartbeat only pickup path (#156) 2026-02-13 17:50:50 +08:00
Lauren ten Hoor
c5c5e29e8f Merge pull request #155 from laurentenhoor/fix/138-orchestrator-issue-urls
fix: strengthen AGENTS.md to always include issue URLs in responses (#138)
2026-02-13 17:39:07 +08:00
Lauren ten Hoor
f2ccbe8bc8 fix: strengthen AGENTS.md to always include issue URLs in responses (#138) 2026-02-13 17:38:42 +08:00
Lauren ten Hoor
84d948ee68 fix: dispatch timeout causing missed Telegram notifications (#153) (#154)
## Problem

`dispatchTask()` shells out to `openclaw gateway call sessions.patch` which
times out when the gateway is busy, causing:
1. Notifications never fire (they're at the end of dispatchTask)
2. Worker state may not be recorded
3. Workers run silently

## Solution (3 changes)

### 1. Make `ensureSession` fire-and-forget
Session key is deterministic, so we don't need to wait for confirmation.
Health check catches orphaned state later.

### 2. Use runtime API for notifications instead of CLI
Pass `runtime` through opts and use direct API calls:
- `runtime.channel.telegram.sendMessageTelegram()`
- `runtime.channel.whatsapp.sendMessageWhatsApp()`
- etc.

### 3. Move notification before session dispatch
Fire workerStart/workerComplete notifications early (after label transition)
before the session calls that can timeout.

## Files Changed

- lib/dispatch.ts — fire-and-forget ensureSession, early notification, accept runtime
- lib/notify.ts — use runtime API for direct channel sends
- lib/services/pipeline.ts — early notification, accept runtime
- lib/services/tick.ts — pass runtime through to dispatchTask
- lib/tool-helpers.ts — accept runtime in tickAndNotify
- lib/tools/work-start.ts — pass api.runtime to dispatchTask
- lib/tools/work-finish.ts — pass api.runtime to executeCompletion/tickAndNotify
2026-02-13 17:29:32 +08:00
Lauren ten Hoor
24b35b3a3e fix: dispatch timeout causing missed Telegram notifications (#153) (#154)
## Problem

`dispatchTask()` shells out to `openclaw gateway call sessions.patch` which
times out when the gateway is busy, causing:
1. Notifications never fire (they're at the end of dispatchTask)
2. Worker state may not be recorded
3. Workers run silently

## Solution (3 changes)

### 1. Make `ensureSession` fire-and-forget
Session key is deterministic, so we don't need to wait for confirmation.
Health check catches orphaned state later.

### 2. Use runtime API for notifications instead of CLI
Pass `runtime` through opts and use direct API calls:
- `runtime.channel.telegram.sendMessageTelegram()`
- `runtime.channel.whatsapp.sendMessageWhatsApp()`
- etc.

### 3. Move notification before session dispatch
Fire workerStart/workerComplete notifications early (after label transition)
before the session calls that can timeout.

## Files Changed

- lib/dispatch.ts — fire-and-forget ensureSession, early notification, accept runtime
- lib/notify.ts — use runtime API for direct channel sends
- lib/services/pipeline.ts — early notification, accept runtime
- lib/services/tick.ts — pass runtime through to dispatchTask
- lib/tool-helpers.ts — accept runtime in tickAndNotify
- lib/tools/work-start.ts — pass api.runtime to dispatchTask
- lib/tools/work-finish.ts — pass api.runtime to executeCompletion/tickAndNotify
2026-02-13 17:29:25 +08:00
Lauren ten Hoor
d1106fc0bb Merge pull request #152 from laurentenhoor/fix/142-blocked-dispatch-loop
fix: blocked issues now go to Refining to prevent infinite dispatch loop (#142)
2026-02-13 17:12:57 +08:00
Lauren ten Hoor
130c38a314 fix: blocked issues now go to Refining to prevent infinite dispatch loop (#142) 2026-02-13 17:12:29 +08:00
Lauren ten Hoor
506f07bdb0 Merge pull request #151 from laurentenhoor/feature/150-centralize-notifications
refactor: centralize notifications in core dispatch/completion functions (#150)
2026-02-13 17:01:07 +08:00
Lauren ten Hoor
265f82f3a9 refactor: centralize notifications in core dispatch/completion functions (#150) 2026-02-13 17:00:42 +08:00
Lauren ten Hoor
80587412ee Merge pull request #149 from laurentenhoor/feature/148-include-issue-comments
feat: include issue comments in worker task context (#148)
2026-02-13 16:49:39 +08:00
Lauren ten Hoor
c0b3e15581 feat: include issue comments in worker task context (#148) 2026-02-13 16:49:15 +08:00
Lauren ten Hoor
54fabe1197 fix: change Planning label colour from blue to grey (#144) (#146)
Change Planning label from #6699cc (blue) to #95a5a6 (grey/slate) to distinguish it from To Do (#428bca).

Note: Only affects newly created labels. Existing repos need manual update.
2026-02-13 16:22:04 +08:00
Lauren ten Hoor
825c5e6f50 feat: redesign health check to triangulate projects.json, issue label, and session state (#143) (#145)
## Changes

- Remove `activeSessions` parameter from health check (was never populated)
- Add gateway session lookup via `openclaw gateway call status`
- Add issue label lookup via `provider.getIssue(issueId)`
- Implement detection matrix with 6 issue types:
  - session_dead: active worker but session missing in gateway
  - label_mismatch: active worker but issue not in Doing/Testing
  - stale_worker: active for >2h
  - stuck_label: inactive but issue has Doing/Testing label
  - orphan_issue_id: inactive but issueId set
  - issue_gone: active but issue deleted/closed

## Files

- lib/services/health.ts — complete rewrite with three-source triangulation
- lib/tools/health.ts — remove activeSessions param, fetch sessions from gateway
- lib/services/heartbeat.ts — remove empty activeSessions calls, pass sessions map
2026-02-13 16:20:21 +08:00
Lauren ten Hoor
4a029c1b3b Release v1.1.0 — Security hardening, session resilience, heartbeat fixes
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 10:57:21 +08:00
Lauren ten Hoor
83f1f1adf0 feat: implement runCommand wrapper and refactor command executions across modules 2026-02-13 10:50:35 +08:00
Lauren ten Hoor
e55b7fa555 Merge pull request #140 from laurentenhoor/feature/139-heartbeat-notifications
fix: send Telegram notifications for heartbeat pickups (#139)
2026-02-13 10:36:51 +08:00
Lauren ten Hoor
b1961fd362 fix: send Telegram notifications for heartbeat pickups (#139) 2026-02-13 10:36:32 +08:00
Lauren ten Hoor
412cddfb84 chore: remove TEST.md file (#136) 2026-02-13 09:35:40 +08:00
Lauren ten Hoor
5a960a1e1e docs: add TypeScript config fix to CHANGELOG
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 20:48:38 +08:00
Lauren ten Hoor
9739a14910 fix: update TypeScript config for proper openclaw plugin-sdk type resolution
Changed module resolution from Node16 to Bundler (with ESNext module) to
properly resolve openclaw/plugin-sdk type exports. This fixes build errors
where OpenClawPluginApi and jsonResult types were not being found.

The Node16 module resolution was not following the re-exports in openclaw's
plugin-sdk index.d.ts correctly. Bundler resolution is more compatible with
modern package.json exports.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 20:47:25 +08:00
Lauren ten Hoor
942fe9fd5d Release v1.0.0 - First Official Launch 🎉
First stable release of DevClaw, transforming OpenClaw into a
complete dev team management system.

Key features:
- Autonomous multi-project development pipeline
- Intelligent tier-based model selection (Junior/Medior/Senior)
- Token-free scheduling with work_heartbeat
- 60-80% token savings through tier selection and session reuse
- GitHub/GitLab integration with atomic operations
- Comprehensive tooling and documentation

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 20:40:20 +08:00
Lauren ten Hoor
b2fc94db9e feat: LLM-powered model auto-configuration and improved onboarding
Major changes:
- Add autoconfigure_models tool for intelligent model assignment
- Implement LLM-based model selection using openclaw agent
- Improve onboarding flow with better model access checks
- Update README with clearer installation and onboarding instructions

Technical improvements:
- Add model-fetcher utility to query authenticated models
- Add smart-model-selector for LLM-driven model assignment
- Use session context for LLM calls during onboarding
- Suppress logging from openclaw models list calls

Documentation:
- Add prerequisites section to README
- Add conversational onboarding example
- Improve quick start flow

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-12 20:37:15 +08:00
Lauren ten Hoor
84483176f4 docs: enforce orchestrator as planner-only, no direct coding (#133) (#135)
## Changes

### lib/templates.ts (AGENTS.md template)
- Added 'Critical: You Do NOT Write Code' section to orchestrator instructions
- Listed what orchestrator CAN do (planning, analysis, status checks)
- Listed what MUST go through workers (code, git ops, tests)
- Added 'Never write code yourself' to Safety section

### README.md
- Added 'The orchestrator's role' section explaining the workflow boundary
- Table showing what goes through workers vs orchestrator
- Explained why: audit trail, tier selection, parallelization, QA pipeline

### docs/ARCHITECTURE.md
- Updated scope boundaries diagram to show 'planning only' for orchestrator
- Added key boundary note about planner/dispatcher role

Addresses issue #133
2026-02-12 12:36:12 +08:00
Lauren ten Hoor
7dd9aa7a15 Merge pull request #134 from laurentenhoor/feat/132-improve-onboarding
feat: improve onboarding with model access check and Telegram group guidance
2026-02-12 12:32:57 +08:00
Lauren ten Hoor
93d616b0dc feat: improve onboarding with model access check and Telegram group guidance
Enhanced the DevClaw onboarding flow to address real-world usability issues
discovered during testing.

Changes:

1. Model Selection Improvements (Step 2):
   - Added explicit prompt to check user's available models first
   - Changed 'Default Model' table to 'Suggested default' to emphasize flexibility
   - Added model selection guidance with class descriptions:
     * junior/tester: Fast, cheap (Haiku-class, GPT-4-mini)
     * medior/reviewer: Balanced (Sonnet-class, GPT-4)
     * senior: Most capable (Opus-class, o1)
   - Emphasized guiding users to configure finer-grained mappings
   - Added warning that defaults are suggestions, not requirements

2. Telegram Group Setup Guidance (New Step 4):
   - Added comprehensive section on project isolation best practices
   - Explains the one-group-per-project model clearly
   - Provides rationale:
     * Clean issue backlogs per project
     * Isolated worker state
     * Clear audit trails
     * Team-specific access control
   - Documents mention requirement (@botname command)
   - Includes single-project mode option with strong warning
   - Provides tip for getting group ID from bot

3. Improved Flow:
   - Renumbered steps (Project Registration is now Step 5)
   - Added group ID discovery tip
   - Maintained conversational tone while being more explicit

Impact:
- Prevents configuration failures from using unavailable models
- Guides users toward sustainable multi-project setup
- Reduces support burden by proactively explaining best practices
- Still allows single-project mode for solo developers

Addresses issue #132
2026-02-12 12:31:50 +08:00
Lauren ten Hoor
3b508ca293 0.1.1 2026-02-12 11:48:09 +08:00
Lauren ten Hoor
fe3486b647 fix: correct npm package entry point and include manifest file 2026-02-12 11:48:05 +08:00
Lauren ten Hoor
3d3d1cc2e4 fix: update installation commands to reflect new package name 2026-02-12 00:42:15 +08:00
Lauren ten Hoor
a4312c886a fix: update package name and URLs to reflect new ownership 2026-02-12 00:32:35 +08:00
Lauren ten Hoor
e4b54646da refactor: remove context awareness documentation and related code; streamline tool registration and context detection 2026-02-12 00:25:34 +08:00
Lauren ten Hoor
dc3a7fcf9e Merge pull request #131 from laurentenhoor/feat/130-npm-publish
feat: set up npm publishing infrastructure
2026-02-12 00:14:33 +08:00
Lauren ten Hoor
4fed5b4c48 feat: set up npm publishing infrastructure
Configures DevClaw package for publishing to npm registry with automated
GitHub Actions workflow and comprehensive publishing documentation.

Changes:

1. package.json:
   - Added publishConfig with access: public (required for scoped packages)
   - Already has correct name: @openclaw/devclaw
   - Version: 0.1.0 (ready for initial release)
   - Files array properly configured (dist/, roles/, docs/)
   - prepublishOnly script ensures build before publish

2. GitHub Actions Workflow (.github/workflows/npm-publish.yml):
   - Triggers on release publication
   - Manual workflow dispatch option with tag input
   - Uses NPM_ACCESS_TOKEN secret for authentication
   - Includes npm provenance for supply chain security
   - Publishes as public package
   - Provides summary output after publication

3. Publishing Documentation (PUBLISHING.md):
   - Comprehensive guide for all publishing methods
   - Automated publishing via GitHub releases (recommended)
   - Manual workflow trigger instructions
   - Local publishing fallback
   - Dry-run testing procedures
   - Version management guidelines
   - Troubleshooting common issues
   - Post-publishing checklist

Configuration Details:
- Package name: @openclaw/devclaw (scoped)
- npm account: laurentenhoor
- Access: public (free for scoped packages)
- Provenance: enabled for transparency
- Node.js: >=20 required

Ready for Initial Release:
To publish the first version:
1. Verify NPM_ACCESS_TOKEN is set in GitHub secrets
2. Create and push tag: git tag v0.1.0 && git push --tags
3. Create GitHub release from tag
4. Workflow automatically builds and publishes to npm

Addresses issue #130
2026-02-12 00:13:39 +08:00
Lauren ten Hoor
81543600fe refactor: remove work_heartbeat tool and related tests; update documentation and notification logic 2026-02-12 00:02:18 +08:00
Lauren ten Hoor
31849489a8 refactor: integrate OpenClaw API for configuration management and CLI registration 2026-02-11 23:40:22 +08:00
Lauren ten Hoor
aaf7818c33 docs: enhance heartbeat service descriptions and CLI registration 2026-02-11 23:13:53 +08:00
Lauren ten Hoor
1e15c42657 Merge pull request #129 from laurentenhoor/claude/update-docs-benefits-BhoG1 2026-02-11 15:48:12 +08:00
Claude
b8ea37189b docs: replace README with README2, add install link to intro
Removed the old README.md and promoted README2.md to README.md.
Added a "Get started" link after the intro paragraph pointing to
the installation section.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 07:29:17 +00:00
Claude
13abef8bc1 docs: remove diagram, restructure Why DevClaw into clean bullet lists
Replaced dense inline-linked paragraphs with a short intro sentence
per pillar followed by bullet points. Each bullet is one concept with
one link. Removed the ASCII parallelization diagram.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 07:23:04 +00:00
Claude
348b33f40b docs: title with OpenClaw, savings in header, vertical architecture diagram
- Title: "DevClaw — Development Plugin for OpenClaw"
- Renamed "Token savings" header to "~60-80% token savings"
- Added vertical ASCII diagram showing heartbeat dispatching to
  isolated projects with parallel DEV/QA — mobile-friendly layout

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 06:00:59 +00:00
Claude
8cebeee314 docs: visually differentiate human message in demo transcript
Indent the "You:" line differently from the Agent lines so it stands
out as a human dropping into an otherwise autonomous flow.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 05:07:14 +00:00
Claude
f13e101656 docs: shorten demo, inline human interaction, use GitHub issues
Trimmed the chat transcript: removed separate "You jump in" section,
inlined a single human message within the webapp group flow, dropped
Linear sync in favor of GitHub issue creation. Shorter, tighter.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 05:01:38 +00:00
Claude
fce256fe59 docs: add concise three-pillar benefits section with cross-links
Autonomous multi-project development, process enforcement, and token
savings — each as a brief paragraph with inline links to the detailed
sections below.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 04:31:53 +00:00
Claude
9d1e253f11 docs: remove auto-chaining, reframe around scheduling system
Auto-chaining was removed from the codebase. All docs now describe the
scheduling model: work_finish transitions labels, the heartbeat's tick
pass (which also fires immediately after every work_finish) detects
available work and fills free slots. Removed autoChain config references.

Files updated: README.md, README2.md, docs/TOOLS.md, ARCHITECTURE.md,
ROADMAP.md, MANAGEMENT.md, ONBOARDING.md, lib/templates.ts

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 04:20:25 +00:00
Claude
261babdf61 docs: merge demo into one continuous chat view with external sync
Single unbroken group-chat transcript now flows from autonomous work,
through human planning/steering, syncing issues to Linear, and back
to autonomous execution — showing everything happens in the same
conversation.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 02:20:08 +00:00
Claude
40215f5c28 docs: show planning and steering in the same group chat demo
Manual interaction example now shows creating issues, sequencing work,
and parking tasks in Planning — all in the same conversation where
autonomous execution happens.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 02:12:50 +00:00
Claude
089664a675 docs: rewrite 'what it looks like' to show multi-project auto-scheduling
Show two projects running overnight with heartbeat-driven dispatch,
auto-chaining, QA failures cycling back to DEV, and different developer
levels — all without human involvement. Manual mode shown as secondary.

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 02:08:41 +00:00
Claude
7a59c76709 docs: add task management section, auto-scheduling with configs, simplify team tables
- Bundle task management: issue tracker integration, creating/updating/commenting,
  custom instructions per project — all in one section
- Add automatic scheduling section: heartbeat service, auto-chaining, execution
  modes, with full config snippets and settings table
- Remove standalone "Parallel everything" section (folded into scheduling)
- Simplify team tables: Level / Assigns to / Model columns

https://claude.ai/code/session_01R3rGevPY748gP4uK2ggYag
2026-02-11 02:06:38 +00:00