feat: Phase 2 — browser skill-management HTTP endpoints (+ groups plumbing)#214
Merged
Conversation
Add a `groups: Vec<String>` param to add_from_origin/commit and apply it in upsert_manifest_and_lock (manifest DependencySpec + lock entry). An empty list on Update preserves the skill's existing groups, so `update` no longer needs to reapply them. Delete the CLI `reapply_groups_after_seam` workaround; add/update pass groups directly. New test covers record-on-add + preserve-on-update. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e seams
Spec 003 §§1-4,6 HTTP surface, all over the Phase-1 core seams (write-gated
per ADR-0003):
- POST /skills/install {origin, groups?} → add_from_origin(Fresh); 201, or 409
on an already-installed id, else 400/500.
- POST /skills/update {skill_id?, check?} → preflight + add_from_origin(Update);
replaces the subprocess-shelling upgrade handler. /skills/upgrade kept as an
alias route.
- POST /reindex[/{id}] → real service.reindex (was 501); 200 with reindexed:false
when no provider (skip, not fail — ADR-0002). /reindex/{id} reindexes all
(core has no single-skill mode; documented).
- GET /status → adds writable + embedding_provider capability flags.
- serve edge: execute_serve builds its own service with inject_edge_services +
with_project_root(served project) so HTTP installs write to the served
project, not the server's cwd (closes the Phase-1 cwd blocker for serve).
Handler tests (install 201/409/400, update 200/check/404, reindex 200-skipped/
403, status capabilities) + serve-command.mdx endpoint table updated.
Full workspace green: build + clippy -D warnings + 692 tests, 0 failures.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things: the
groupsfollow-up from Phase 1, and Phase 2 of spec 003 (the HTTP endpoints).groupsplumbing (Phase-1 follow-up)add_from_origin/commitnow take agroups: Vec<String>and record it on the Manifest + Lock entry; an empty list onUpdatepreserves the skill's existing groups. This deletes the CLIreapply_groups_after_seamworkaround (add/update pass groups directly). Test covers record-on-add + preserve-on-update.Phase 2 — browser skill-management HTTP surface (spec 003 §§1-4,6)
All endpoints run over the Phase-1 core seams, write-gated per ADR-0003 (403 without
--enable-write):POST /skills/install{origin, groups?}→add_from_origin(Fresh)→201, or409on an already-installed id, else 400/500.POST /skills/update{skill_id?, check?}→preflight+add_from_origin(Update). Replaces the oldupgradehandler that shelled out to a subprocess./skills/upgradekept as an alias.POST /reindex[/{id}]→ realservice.reindex(was501); returns200withreindexed:falsewhen no embedding provider is configured (skip, not fail — ADR-0002)./reindex/{id}reindexes the whole index (core has no single-skill mode; documented).GET /status→ addswritable+embedding_providercapability flags (the browser reads these to disable controls / show provider state — spec 003 §6).Serve edge:
execute_servenow builds its own service withinject_edge_services(embedding provider + repository manager) andwith_project_root(<served project>), so HTTP installs write to the served project rather than the server's cwd — this closes, for the serve path, the Phase-1 cwd blocker (the core seam already tookproject_root; this wires it).Review
The core seams (Phase 1) were opus-reviewed already. This HTTP layer was reviewed for: the
ServiceError::AlreadyIndexed → 409mapping (explicit, doesn't disturb the blanket→400used elsewhere), the served-project-root resolution (viaload_project_configat startup, injected once — not per-request cwd), write-gating of the three mutating routes, and that the injected service is the one the server actually uses. Clean.Known limitations (documented, not blocking)
/reindex/{id}reindexes the whole index (no single-skill reindex in core).--globalinstalls remain CLI-only (the seam is project-level); the HTTP surface is project-scoped by design (spec 003 is local-first single-project).Testing
cargo build --workspace --all-targets✅ ·clippy --all-targets -D warnings✅ ·cargo test --workspace→ 692 passed, 0 failed ✅serve-command.mdxendpoint table updated.Next: Phase 3 (the web UI — install flow over the four
Originvariants, per-skill update/remove, read-onlySKILL.mdview). The HTTP surface it needs is now in place.🤖 Generated with Claude Code