feat(agent): enforce agent:* label lifecycle with ready and done states #32

Merged
frank merged 1 commit from agent/issue-31-agent-labels-lifecycle-agent-ready-agent into main 2026-07-12 16:44:46 +02:00
Owner

Summary

  • Introduces exclusive agent:workingagent:readyagent:done lifecycle with automatic label creation
  • Sets agent:ready after successful coding/CI babysitting; sets agent:done after merged PR worktree cleanup
  • Adds --ready-label flag and defaults; updates wiki and help text

Test plan

  • go test ./internal/agent/... ./internal/cmd/...
  • forge agent watch --help shows --working-label, --ready-label, --done-label defaults
  • End-to-end: claim issue → verify agent:working → CI green → agent:ready → merge PR → worktree removed → agent:done
  • Pipeline failure removes agent:working without setting ready/done

Closes #31

## Summary - Introduces exclusive `agent:working` → `agent:ready` → `agent:done` lifecycle with automatic label creation - Sets `agent:ready` after successful coding/CI babysitting; sets `agent:done` after merged PR worktree cleanup - Adds `--ready-label` flag and defaults; updates wiki and help text ## Test plan - [x] `go test ./internal/agent/... ./internal/cmd/...` - [x] `forge agent watch --help` shows `--working-label`, `--ready-label`, `--done-label` defaults - [ ] End-to-end: claim issue → verify `agent:working` → CI green → `agent:ready` → merge PR → worktree removed → `agent:done` - [ ] Pipeline failure removes `agent:working` without setting ready/done Closes #31
feat(agent): enforce agent:* label lifecycle with ready and done states
All checks were successful
CI / race (pull_request) Successful in 32s
CI / test (pull_request) Successful in 32s
e235d7d4d4
Introduce exclusive agent:working → agent:ready → agent:done transitions,
auto-create missing labels, and set agent:done after merged PR worktree cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
Author
Owner

🔗 Linked to issue #31. Babysitting CI until green…

🔗 Linked to issue #31. Babysitting CI until green…
Author
Owner

forge agent finished implementation

  • Commit: feat(agent): enforce agent:* label lifecycle with ready and done states
  • Pull request: #32
  • Next: waiting for CI / babysitting fixes if needed
README.md                     |   2 +-
 docs/wiki/Agent-Watch.md      |  20 +++++-
 internal/agent/agentfile.go   |   6 +-
 internal/agent/config.go      |   9 ++-
 internal/agent/config_test.go |   4 ++
 internal/agent/forge.go       |   2 +-
 internal/agent/labels.go      |  60 ++++++++++++++++++
 internal/agent/labels_test.go | 139 ++++++++++++++++++++++++++++++++++++++++++
 internal/agent/pipeline.go    |  40 ++++++++----
 internal/agent/watcher.go     |   2 +-
 internal/agent/worktree.go    |  10 +++
 internal/cmd/agent.go         |   9 ++-
 12 files changed, 282 insertions(+), 21 deletions(-)
Agent output (tail)
- Bei Fehlschlag wird nur `agent:working` entfernt
- Neues Flag `--ready-label` (Default `agent:ready`), `--done-label` defaultet auf `agent:done`
- Wiki und `--help` sind angepasst
TODO_DONE: Nach erfolgreichem Abschluss der Agent-Arbeit trägt das Issue `agent:ready` (und nicht mehr `agent:working`)
TODO_DONE: Nach Merge des zugehörigen PRs und Löschen des Worktrees trägt das Issue `agent:done`
TODO_DONE: Es liegt zu jedem Zeitpunkt höchstens ein `agent:*`-Label am Issue
TODO_DONE: Der Agent setzt/korrigiert die Labels in den genannten Lifecycle-Schritten selbst
TODO_DONE: Fehlende Labels (`agent:working`, `agent:ready`, `agent:done`) werden bei Bedarf automatisch im Repo angelegt
TODO_DONE: Wiki/`forge agent watch --help` und Defaults (`working_label` / neuer Zwischenstatus / `done_label`) sind angepasst
PR_TITLE: feat(agent): enforce agent:* label lifecycle with ready and done states
PR_BODY:
## Summary
- Introduces exclusive `agent:working` → `agent:ready` → `agent:done` lifecycle with automatic label creation
- Sets `agent:ready` after successful coding/CI babysitting; sets `agent:done` after merged PR worktree cleanup
- Adds `--ready-label` flag and defaults; updates wiki and help text
## Test plan
- [x] `go test ./internal/agent/... ./internal/cmd/...`
- [x] `forge agent watch --help` shows `--working-label`, `--ready-label`, `--done-label` defaults
- [ ] End-to-end: claim issue → verify `agent:working` → CI green → `agent:ready` → merge PR → worktree removed → `agent:done`
- [ ] Pipeline failure removes `agent:working` without setting ready/done
✅ **forge agent finished implementation** - Commit: `feat(agent): enforce agent:* label lifecycle with ready and done states` - Pull request: https://repository.hildebrandt.io/frank/forgecli/pulls/32 - Next: waiting for CI / babysitting fixes if needed ``` README.md | 2 +- docs/wiki/Agent-Watch.md | 20 +++++- internal/agent/agentfile.go | 6 +- internal/agent/config.go | 9 ++- internal/agent/config_test.go | 4 ++ internal/agent/forge.go | 2 +- internal/agent/labels.go | 60 ++++++++++++++++++ internal/agent/labels_test.go | 139 ++++++++++++++++++++++++++++++++++++++++++ internal/agent/pipeline.go | 40 ++++++++---- internal/agent/watcher.go | 2 +- internal/agent/worktree.go | 10 +++ internal/cmd/agent.go | 9 ++- 12 files changed, 282 insertions(+), 21 deletions(-) ``` <details><summary>Agent output (tail)</summary> ``` - Bei Fehlschlag wird nur `agent:working` entfernt - Neues Flag `--ready-label` (Default `agent:ready`), `--done-label` defaultet auf `agent:done` - Wiki und `--help` sind angepasst TODO_DONE: Nach erfolgreichem Abschluss der Agent-Arbeit trägt das Issue `agent:ready` (und nicht mehr `agent:working`) TODO_DONE: Nach Merge des zugehörigen PRs und Löschen des Worktrees trägt das Issue `agent:done` TODO_DONE: Es liegt zu jedem Zeitpunkt höchstens ein `agent:*`-Label am Issue TODO_DONE: Der Agent setzt/korrigiert die Labels in den genannten Lifecycle-Schritten selbst TODO_DONE: Fehlende Labels (`agent:working`, `agent:ready`, `agent:done`) werden bei Bedarf automatisch im Repo angelegt TODO_DONE: Wiki/`forge agent watch --help` und Defaults (`working_label` / neuer Zwischenstatus / `done_label`) sind angepasst PR_TITLE: feat(agent): enforce agent:* label lifecycle with ready and done states PR_BODY: ## Summary - Introduces exclusive `agent:working` → `agent:ready` → `agent:done` lifecycle with automatic label creation - Sets `agent:ready` after successful coding/CI babysitting; sets `agent:done` after merged PR worktree cleanup - Adds `--ready-label` flag and defaults; updates wiki and help text ## Test plan - [x] `go test ./internal/agent/... ./internal/cmd/...` - [x] `forge agent watch --help` shows `--working-label`, `--ready-label`, `--done-label` defaults - [ ] End-to-end: claim issue → verify `agent:working` → CI green → `agent:ready` → merge PR → worktree removed → `agent:done` - [ ] Pipeline failure removes `agent:working` without setting ready/done ``` </details>
Author
Owner

☑️ ToDos checked off

  • Nach erfolgreichem Abschluss der Agent-Arbeit trägt das Issue agent:ready (und nicht mehr agent:working)
  • Nach Merge des zugehörigen PRs und Löschen des Worktrees trägt das Issue agent:done
  • Es liegt zu jedem Zeitpunkt höchstens ein agent:*-Label am Issue
  • Der Agent setzt/korrigiert die Labels in den genannten Lifecycle-Schritten selbst
  • Fehlende Labels (agent:working, agent:ready, agent:done) werden bei Bedarf automatisch im Repo angelegt
  • Wiki/forge agent watch --help und Defaults (working_label / neuer Zwischenstatus / done_label) sind angepasst
☑️ **ToDos checked off** - [x] Nach erfolgreichem Abschluss der Agent-Arbeit trägt das Issue `agent:ready` (und nicht mehr `agent:working`) - [x] Nach Merge des zugehörigen PRs und Löschen des Worktrees trägt das Issue `agent:done` - [x] Es liegt zu jedem Zeitpunkt höchstens ein `agent:*`-Label am Issue - [x] Der Agent setzt/korrigiert die Labels in den genannten Lifecycle-Schritten selbst - [x] Fehlende Labels (`agent:working`, `agent:ready`, `agent:done`) werden bei Bedarf automatisch im Repo angelegt - [x] Wiki/`forge agent watch --help` und Defaults (`working_label` / neuer Zwischenstatus / `done_label`) sind angepasst
Author
Owner
🟢 **CI green** (attempt 1/3) https://repository.hildebrandt.io/frank/forgecli/actions/runs/86
frank merged commit b222b7313d into main 2026-07-12 16:44:46 +02:00
frank deleted branch agent/issue-31-agent-labels-lifecycle-agent-ready-agent 2026-07-12 16:44:46 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
frank/forgecli!32
No description provided.