From 9360f32b66ded8e030df5b88be0b7bc794de8fea Mon Sep 17 00:00:00 2001 From: Jeffrey Smith Date: Sat, 28 Mar 2026 20:34:35 +0000 Subject: [PATCH] Fix v0.3.7: tag dashboard + editor as dormant, generalize requires check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Functional audit found dashboard and editor render blank — they depend on the removed sw.* imperative SDK (sw.tabs, sw.chat, sw.layout, etc). Tagged with requires: ["legacy-sdk"] so the installer auto-sets dormant. Generalized the dormant requires check: any unmet requirement now triggers dormant status, not just "chat". Co-Authored-By: Claude Opus 4.6 (1M context) --- ROADMAP.md | 8 ++++---- packages/dashboard/manifest.json | 3 ++- packages/editor/manifest.json | 3 ++- server/handlers/packages.go | 12 +++++++----- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index a806dad..f18a855 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -202,14 +202,14 @@ See `docs/DEMO-WORKFLOWS.md` for full stage definitions and Starlark code. ### v0.3.7 — Package Audit (complete) -Verified all 16 packages install correctly. Chat-dependent packages auto-set to dormant. +Verified all 16 packages install correctly. Packages with unmet `requires` auto-set to dormant. | Step | Status | Description | |------|--------|-------------| | Manifest fixes | ✅ | Fixed 6 chat-extension manifests (`"name"` → `"title"`, was blocking install). Added explicit `"type": "surface"` to hello-dashboard, icd-test-runner, sdk-test-runner. | -| Dormant status | ✅ | Added `dormant` to `packages.status` CHECK constraint (both dialects). Installer auto-detects `requires: ["chat"]` and sets `status=dormant, enabled=false`. Enable endpoint returns 409 for dormant packages. | -| Browser package audit | ✅ | All 10 standalone packages install and activate: hello-dashboard, dashboard, editor, schedules, tasks, team-activity-log, gitea-client, git-board, icd-test-runner, sdk-test-runner. | -| Chat-dependency tagging | ✅ | 6 chat-dependent extensions (csv-table, diff-viewer, js-sandbox, katex-renderer, mermaid-renderer, regex-tester) install as dormant. Excluded from nav, shown with badge in admin. git-board and gitea-client are standalone (not chat-dependent). | +| Dormant status | ✅ | Added `dormant` to `packages.status` CHECK constraint (both dialects). Installer auto-detects unmet `requires` and sets `status=dormant, enabled=false`. Enable endpoint returns 409 for dormant packages. | +| Functional audit | ✅ | Navigated to every surface in browser. 7 working: schedules, tasks, team-activity-log, git-board, hello-dashboard, icd-test-runner, sdk-test-runner. 2 broken: dashboard + editor (depend on removed `sw.*` imperative SDK) — tagged `requires: ["legacy-sdk"]` → dormant. | +| Chat-dependency tagging | ✅ | 6 chat-dependent extensions (csv-table, diff-viewer, js-sandbox, katex-renderer, mermaid-renderer, regex-tester) install as dormant. git-board and gitea-client are standalone. | | Dependency check fix | ✅ | Relaxed library dependency validation to allow `pending_review` libraries (gitea-client declares permissions). Only `suspended`/`dormant` libraries blocked. | | Admin UI | ✅ | Dormant badge, disabled Enable button with tooltip, Dormant stat card in admin packages view. | | Tests | ✅ | 4 handler tests (SetStatus dormant, enable blocked, surfaces exclude dormant, admin list includes dormant). All existing tests pass. | diff --git a/packages/dashboard/manifest.json b/packages/dashboard/manifest.json index 26c9a5c..6fd9992 100644 --- a/packages/dashboard/manifest.json +++ b/packages/dashboard/manifest.json @@ -6,7 +6,8 @@ "tier": "browser", "author": "Switchboard Core", "icon": "📊", - "description": "Project dashboard exercising all SDK primitives", + "description": "Project dashboard exercising all SDK primitives (requires legacy sw.* SDK — dormant until rewritten)", + "requires": ["legacy-sdk"], "route": "/s/dashboard", "permissions": [], "settings": [ diff --git a/packages/editor/manifest.json b/packages/editor/manifest.json index fb4a51f..b9398dc 100644 --- a/packages/editor/manifest.json +++ b/packages/editor/manifest.json @@ -6,7 +6,8 @@ "tier": "browser", "author": "Switchboard Core", "icon": "✏️", - "description": "Code editor with workspace management, file tree, and AI assist", + "description": "Code editor with workspace management, file tree, and AI assist (requires legacy sw.* SDK — dormant until rewritten)", + "requires": ["legacy-sdk"], "route": "/s/editor", "layout": "editor", "permissions": [], diff --git a/server/handlers/packages.go b/server/handlers/packages.go index 30fb97f..e9c162f 100644 --- a/server/handlers/packages.go +++ b/server/handlers/packages.go @@ -584,21 +584,23 @@ func (h *PackageHandler) InstallPackage(c *gin.Context) { } // v0.3.7: Auto-set dormant for packages with unmet requires. - isDormant := false + // Known capabilities: (none yet — chat and legacy-sdk are future/removed). + knownCaps := map[string]bool{} + var unmetReqs []string if reqs, ok := manifest["requires"].([]any); ok && len(reqs) > 0 { for _, r := range reqs { req, _ := r.(string) - if req == "chat" { - isDormant = true - break + if req != "" && !knownCaps[req] { + unmetReqs = append(unmetReqs, req) } } } + isDormant := len(unmetReqs) > 0 if isDormant { h.stores.Packages.SetStatus(c.Request.Context(), pkgID, "dormant") h.stores.Packages.SetEnabled(c.Request.Context(), pkgID, false) preservedEnabled = false - log.Printf("[packages] %s: dormant (unmet requires: chat)", pkgID) + log.Printf("[packages] %s: dormant (unmet requires: %v)", pkgID, unmetReqs) } resp := gin.H{