feat(worktrees): ai-agent worktrees moves to the worktrees plugin's commands #59

Closed
gabrielvidal wants to merge 0 commits from worktrees-cli into main
pull from: worktrees-cli
Owner

Summary

Step 2 of the worktrees move: ai-agent worktrees leaves the core for the worktrees plugin's commands (ai-agent-plugins, branch worktrees-cli). The core keeps a forwarding alias and gains two small generic bridges. Stacked on #58 (this branch contains it).

Key changes

  • cli/worktrees.py and its test are deleted; ai-agent worktrees … forwards to ai-agent plugin worktrees … (exit 2 with a message when the plugin is off). WORKER_NEVER / LAB_ONLY are empty.
  • GET …/hub/perf/storage/items?kind=&runner= (perf.read, bridge only): every storage item of one kind, where the overview keeps the top 300.
  • GET …/hub/trackers/<tid>/sessions (trackers.stamp): the conversations holding a tracker's items, with state and machine.
  • The plugin's own handler may close (never open) a tracked item on a guest's conversation; a run token still gets 403.
  • Plugin commands carry timeoutSec (the CLI waits that long instead of 120 s); ai-agent plugin <id> <cmd> exits 1 when the action answers ok: false.

Key decisions

  • No new host execution point: listing and removal go through the existing perf.read / perf.act storage engine, so the plugin never runs git.
  • A full worker can now run worktrees, like any plugin command; read / run workers are still refused.
  • GET /api/tracked is kept though nothing in core calls it now.
  • The homelab root CLAUDE.md is not edited: its ai-agent worktrees clean answer still works through the alias.

Changelog

  • Changed: ai-agent worktrees is now the Worktrees plugin's command; it needs the plugin on.

Test notes

  • Backend: 188 modules; 4 tests fail, the same as on the step-1 branch (test_agy, test_authz_matrix ×2, test_typed_plugins). Tracker and guest-confinement tests re-run independently: 61 pass. CLI 116 pass; vitest 1238 pass; tsc clean. The sidecar suite was not run (no sidecar change).
  • Real ls / scan / rm on the EVOX2 through a stand-in sidecar; the lab's host sidecar path is not exercised.
  • A runner without agent-probe storage tracking answers 501/503 on rm and lists nothing.
  • Merge after #58 and after the plugins worktrees-cli PR. Not deployed from the EVOX2: deploy from the Homelab, then approve the plugin's new capabilities.
## Summary Step 2 of the worktrees move: `ai-agent worktrees` leaves the core for the `worktrees` plugin's commands (ai-agent-plugins, branch `worktrees-cli`). The core keeps a forwarding alias and gains two small generic bridges. **Stacked on #58** (this branch contains it). ## Key changes - `cli/worktrees.py` and its test are deleted; `ai-agent worktrees …` forwards to `ai-agent plugin worktrees …` (exit 2 with a message when the plugin is off). `WORKER_NEVER` / `LAB_ONLY` are empty. - `GET …/hub/perf/storage/items?kind=&runner=` (`perf.read`, bridge only): every storage item of one kind, where the overview keeps the top 300. - `GET …/hub/trackers/<tid>/sessions` (`trackers.stamp`): the conversations holding a tracker's items, with state and machine. - The plugin's own handler may **close** (never open) a tracked item on a guest's conversation; a run token still gets 403. - Plugin commands carry `timeoutSec` (the CLI waits that long instead of 120 s); `ai-agent plugin <id> <cmd>` exits 1 when the action answers `ok: false`. ## Key decisions - **No new host execution point**: listing and removal go through the existing `perf.read` / `perf.act` storage engine, so the plugin never runs git. - A `full` worker can now run `worktrees`, like any plugin command; read / run workers are still refused. - `GET /api/tracked` is kept though nothing in core calls it now. - The homelab root CLAUDE.md is not edited: its `ai-agent worktrees clean` answer still works through the alias. ## Changelog - Changed: `ai-agent worktrees` is now the Worktrees plugin's command; it needs the plugin on. ## Test notes - Backend: 188 modules; 4 tests fail, the same as on the step-1 branch (`test_agy`, `test_authz_matrix` ×2, `test_typed_plugins`). Tracker and guest-confinement tests re-run independently: 61 pass. CLI 116 pass; vitest 1238 pass; `tsc` clean. The sidecar suite was not run (no sidecar change). - Real `ls` / `scan` / `rm` on the EVOX2 through a stand-in sidecar; the lab's host sidecar path is not exercised. - A runner without agent-probe storage tracking answers 501/503 on `rm` and lists nothing. - **Merge after #58 and after the plugins `worktrees-cli` PR.** Not deployed from the EVOX2: deploy from the Homelab, then approve the plugin's new capabilities.
gabrielvidal self-assigned this 2026-12-02 12:08:23 +01:00
gabrielvidal added 9 commits 2026-12-02 12:08:23 +01:00
Generic points the plugin stands on (docs/plugins.md → Trackers):
- trackers[]: declarative open/close rules over shell commands, folded by the
  parser into trackersAuto {key: {sig, items}}; a rule change re-derives only
  the transcripts holding its hint (Indexer.rederive_trackers), no version bump
- ui.card[].list: a tags bit drawn from a tracker — the old WorktreeTag, generic;
  tags bits also on the Conversations page and the details tag row
- provides git.worktrees: the diff engines, storage owners, scaffold and
  GET /api/tracked read a conversation's worktrees through one accessor
- trackers.stamp bridge; POST /api/conversation-meta {worktree} routed to the
  provider; pre-plugin worktreesAuto / meta.worktrees still read (carry-over)

Removed from core: WorktreeTag & co, _worktree_events, WorktreeInfo /
meta.worktrees, their i18n keys.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
cli/worktrees.py (git on the host) is gone: ls / rm / clean / scan are the
plugin's commands over perf.read, perf.act and trackers.stamp; the core
command is an alias that forwards to them. Core gains, all generic:
hub/perf/storage/items (every item of a kind), hub/trackers/<tid>/sessions,
the handler's close on a guest's conversation, the commands catalogue's
timeoutSec and exit 1 on an action's ok:false. WORKER_NEVER / LAB_ONLY are
empty.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Author
Owner
Merged into `main` as 80c0517c by the auto-ship batch https://ai-agent.lab.gabvdl.xyz/conversation/01a2368c-0e74-775d-a214-261381162140.
gabrielvidal closed this pull request 2026-12-02 13:04:37 +01:00

Pull request closed

Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: gabrielvidal/ai-agent#59