core#113 follow-up: plugin drift detector + queue + admin apply endpoint #123

Open
opened 2026-05-08 15:54:13 +00:00 by claude-ceo-assistant · 0 comments

Sub-issue of core#113 (version subscription)

The DB foundation merged in PR #122 (workspace_plugins table + tracked_ref column + install hook). Remaining pieces:

  1. plugin_update_queue table — queued upstream-drift updates pending operator apply.
  2. Drift detector — periodic job (cron OR Gitea webhook on tag-create) that:
    • Scans SELECT * FROM workspace_plugins WHERE tracked_ref != 'none'
    • For each row, resolves the tracked ref upstream (Gitea API) to current SHA
    • Compares to installed SHA (need to extend workspace_plugins with installed_sha column — second migration)
    • On drift, INSERT INTO plugin_update_queue
  3. Admin endpoint GET /admin/plugin-updates-pending — returns queued updates.
  4. Admin endpoint POST /admin/plugin-updates/:id/apply — triggers install for queued update. Composes with core#115 canary tier filter.

Acceptance criteria

  • Migration adds plugin_update_queue + installed_sha column on workspace_plugins
  • Drift detector job exists (cron OR webhook handler)
  • Admin endpoints respond with proper data
  • Tests cover: drift detected → queued → apply triggers install + restart

Refs

  • core#113 (foundation, merged in PR #122)
  • core#115 (canary tier filter, composes here)
## Sub-issue of core#113 (version subscription) The DB foundation merged in PR #122 (workspace_plugins table + tracked_ref column + install hook). Remaining pieces: 1. **plugin_update_queue table** — queued upstream-drift updates pending operator apply. 2. **Drift detector** — periodic job (cron OR Gitea webhook on tag-create) that: - Scans `SELECT * FROM workspace_plugins WHERE tracked_ref != 'none'` - For each row, resolves the tracked ref upstream (Gitea API) to current SHA - Compares to installed SHA (need to extend workspace_plugins with installed_sha column — second migration) - On drift, INSERT INTO plugin_update_queue 3. **Admin endpoint `GET /admin/plugin-updates-pending`** — returns queued updates. 4. **Admin endpoint `POST /admin/plugin-updates/:id/apply`** — triggers install for queued update. Composes with core#115 canary tier filter. ## Acceptance criteria - Migration adds plugin_update_queue + installed_sha column on workspace_plugins - Drift detector job exists (cron OR webhook handler) - Admin endpoints respond with proper data - Tests cover: drift detected → queued → apply triggers install + restart ## Refs - core#113 (foundation, merged in PR #122) - core#115 (canary tier filter, composes here)
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
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: molecule-ai/molecule-core#123
No description provided.