feat(trackers): worktree tracking leaves the core for the worktrees plugin #58

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

Summary

Worktree tracking leaves the core for the seeded worktrees plugin (ai-agent-plugins, branch worktrees-plugin): the pill, its hover card and the transcript parsing. The core gains three generic points instead — declarative trackers, a list popover on card bits, and the git.worktrees provider role the diff engines read through. Design form: move-the-worktree-tag-into-a-plugin_1fq05y.

Key changes

  • backend/plugins/trackers.py + manifest trackers[]: "what a conversation opened and closed", extracted from shell commands by rules declared as data (≤ 4 per plugin; no plugin code runs). Summary trackersAuto, card meta.trackers.
  • ui.card[].list: a tags bit driven by a tracker — count or single name, tone by state, hover / tap card grouped by project (lib/cardBits.ts, PluginCardBits.tsx). tags bits are now also drawn on the Conversations page and in the conversation's details.
  • provides: {"git.worktrees"}: diff/worktreediff.py, diff/gitdiff.py, the scaffold, Storage owners and ai-agent worktrees read worktrees through one accessor; no provider = [] and the diff replays the transcript.
  • trackers.stamp capability (POST …/hub/trackers/<tid>/events), owner-only GET /api/tracked?provides=; POST /api/conversation-meta {worktree} still works, routed to the provider.
  • Removed from core: WorktreeTag, _worktree_events, worktreesAuto, meta.worktrees, apply_worktree_event, WorktreeInfo, their i18n keys.
  • Docs: docs/plugins.md → "Trackers"; CLAUDE.md → "Worktree tracking is a plugin".

Key decisions

  • No PARSER_VERSION bump. Each summary entry carries the sig of the rules that produced it; a rule change re-parses only transcripts whose bytes contain the tracker's hint, once.
  • Carry-over is a read-side fold (plugins/carryover_trackers.py): old worktreesAuto / meta.worktrees are read as the provider's items, so past pills show as soon as the plugin is on.
  • Only the owner's active plugins define trackers; a guest's own install declares nothing the parser reads.
  • Guest confinement unchanged: _viewed_by filters the provider's worktrees to the guest's own projects, as before.
  • With the plugin off, a {worktree} stamp is dropped and ai-agent worktrees knows no owner (it warns).
  • The authz golden got one hand-added line for /api/tracked: main's golden is already out of date.

Changelog

  • Changed: the worktree pill on conversation cards is now the Worktrees plugin's; it also recognises new-worktree on the devbox.
  • Added: plugins can track what a conversation opened and closed, and show it as a pill with a list on its card.

Test notes

  • Backend: 188 modules; 3 fail, the same as on main (test_agy.py, test_authz_matrix.py, test_typed_plugins.py). New test_trackers.py (31), test_trackers_hub.py (13); test_run_isolation.py (14) covers the guest confinement. Re-run independently: 58 pass. CLI 117 pass. Frontend tsc clean, vitest 1238 pass.
  • Live local hub on the EVOX2 (screenshots below): zero-plugin boot shows no pill and no errors; installing the plugin restores pills and the worktree diff; the eye switch works.
  • Not checked: npm run build:mock by eye; the guest's view by screenshot (tests only).
  • Merge after the ai-agent-plugins worktrees-plugin PR. Not deployed from the EVOX2: deploy from the Homelab after merge. During a blue-green cutover both containers run the re-derive pass (compare-and-set, duplicate work only).

Screenshots

plugin-home-hover-card-zoom.png
plugin-conversation-details-hover.png
plugin-conversations-page-hover.png
plugin-eye-switch-off.png
zero-home.png

## Summary Worktree tracking leaves the core for the seeded `worktrees` plugin (ai-agent-plugins, branch `worktrees-plugin`): the pill, its hover card and the transcript parsing. The core gains three generic points instead — declarative **trackers**, a **list popover** on card bits, and the **`git.worktrees` provider role** the diff engines read through. Design form: `move-the-worktree-tag-into-a-plugin_1fq05y`. ## Key changes - `backend/plugins/trackers.py` + manifest `trackers[]`: "what a conversation opened and closed", extracted from shell commands by rules declared as data (≤ 4 per plugin; no plugin code runs). Summary `trackersAuto`, card `meta.trackers`. - `ui.card[].list`: a `tags` bit driven by a tracker — count or single name, tone by state, hover / tap card grouped by project (`lib/cardBits.ts`, `PluginCardBits.tsx`). `tags` bits are now also drawn on the Conversations page and in the conversation's details. - `provides: {"git.worktrees"}`: `diff/worktreediff.py`, `diff/gitdiff.py`, the scaffold, Storage owners and `ai-agent worktrees` read worktrees through one accessor; no provider = `[]` and the diff replays the transcript. - `trackers.stamp` capability (`POST …/hub/trackers/<tid>/events`), owner-only `GET /api/tracked?provides=`; `POST /api/conversation-meta {worktree}` still works, routed to the provider. - Removed from core: `WorktreeTag`, `_worktree_events`, `worktreesAuto`, `meta.worktrees`, `apply_worktree_event`, `WorktreeInfo`, their i18n keys. - Docs: `docs/plugins.md` → "Trackers"; CLAUDE.md → "Worktree tracking is a plugin". ## Key decisions - **No `PARSER_VERSION` bump.** Each summary entry carries the `sig` of the rules that produced it; a rule change re-parses only transcripts whose bytes contain the tracker's `hint`, once. - **Carry-over is a read-side fold** (`plugins/carryover_trackers.py`): old `worktreesAuto` / `meta.worktrees` are read as the provider's items, so past pills show as soon as the plugin is on. - **Only the owner's active plugins define trackers**; a guest's own install declares nothing the parser reads. - **Guest confinement unchanged**: `_viewed_by` filters the provider's worktrees to the guest's own projects, as before. - With the plugin off, a `{worktree}` stamp is dropped and `ai-agent worktrees` knows no owner (it warns). - The authz golden got one hand-added line for `/api/tracked`: main's golden is already out of date. ## Changelog - Changed: the worktree pill on conversation cards is now the Worktrees plugin's; it also recognises `new-worktree` on the devbox. - Added: plugins can track what a conversation opened and closed, and show it as a pill with a list on its card. ## Test notes - Backend: 188 modules; 3 fail, the same as on main (`test_agy.py`, `test_authz_matrix.py`, `test_typed_plugins.py`). New `test_trackers.py` (31), `test_trackers_hub.py` (13); `test_run_isolation.py` (14) covers the guest confinement. Re-run independently: 58 pass. CLI 117 pass. Frontend `tsc` clean, vitest 1238 pass. - Live local hub on the EVOX2 (screenshots below): zero-plugin boot shows no pill and no errors; installing the plugin restores pills and the worktree diff; the eye switch works. - Not checked: `npm run build:mock` by eye; the guest's view by screenshot (tests only). - **Merge after the ai-agent-plugins `worktrees-plugin` PR.** Not deployed from the EVOX2: deploy from the Homelab after merge. During a blue-green cutover both containers run the re-derive pass (compare-and-set, duplicate work only). ## Screenshots ![plugin-home-hover-card-zoom.png](https://git.gabvdl.xyz/attachments/34c16b9c-8fe3-4160-b036-e5845fa9e0cb) ![plugin-conversation-details-hover.png](https://git.gabvdl.xyz/attachments/8cd1933b-ac3f-4c00-b92e-5e2136054cbb) ![plugin-conversations-page-hover.png](https://git.gabvdl.xyz/attachments/760a8e20-01b2-41e1-a194-1d1cf59529fe) ![plugin-eye-switch-off.png](https://git.gabvdl.xyz/attachments/a3dc2db4-fae6-494f-ab4b-5e1fa01e6b66) ![zero-home.png](https://git.gabvdl.xyz/attachments/360fd2d9-c7e1-42eb-9ef8-0cab689c9946)
gabrielvidal self-assigned this 2026-12-02 11:49:05 +01:00
gabrielvidal added 5 commits 2026-12-02 11:49:05 +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>
Author
Owner
Merged into `main` as e901a541 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:36 +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#58