Fix v0.3.7: tag dashboard + editor as dormant, generalize requires check

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) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 20:34:35 +00:00
parent 6fec66bcc1
commit 0364fbb1a9
4 changed files with 15 additions and 11 deletions

View File

@@ -196,14 +196,14 @@ See `docs/DEMO-WORKFLOWS.md` for full stage definitions and Starlark code.
### v0.3.7 — Package Audit (complete) ### 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 | | 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. | | 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. | | 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. |
| 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. | | 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. Excluded from nav, shown with badge in admin. git-board and gitea-client are standalone (not chat-dependent). | | 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. | | 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. | | 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. | | Tests | ✅ | 4 handler tests (SetStatus dormant, enable blocked, surfaces exclude dormant, admin list includes dormant). All existing tests pass. |

View File

@@ -6,7 +6,8 @@
"tier": "browser", "tier": "browser",
"author": "Switchboard Core", "author": "Switchboard Core",
"icon": "📊", "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", "route": "/s/dashboard",
"permissions": [], "permissions": [],
"settings": [ "settings": [

View File

@@ -6,7 +6,8 @@
"tier": "browser", "tier": "browser",
"author": "Switchboard Core", "author": "Switchboard Core",
"icon": "✏️", "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", "route": "/s/editor",
"layout": "editor", "layout": "editor",
"permissions": [], "permissions": [],

View File

@@ -584,21 +584,23 @@ func (h *PackageHandler) InstallPackage(c *gin.Context) {
} }
// v0.3.7: Auto-set dormant for packages with unmet requires. // 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 { if reqs, ok := manifest["requires"].([]any); ok && len(reqs) > 0 {
for _, r := range reqs { for _, r := range reqs {
req, _ := r.(string) req, _ := r.(string)
if req == "chat" { if req != "" && !knownCaps[req] {
isDormant = true unmetReqs = append(unmetReqs, req)
break
} }
} }
} }
isDormant := len(unmetReqs) > 0
if isDormant { if isDormant {
h.stores.Packages.SetStatus(c.Request.Context(), pkgID, "dormant") h.stores.Packages.SetStatus(c.Request.Context(), pkgID, "dormant")
h.stores.Packages.SetEnabled(c.Request.Context(), pkgID, false) h.stores.Packages.SetEnabled(c.Request.Context(), pkgID, false)
preservedEnabled = 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{ resp := gin.H{