Skip to content

feat: Phase 2 — browser skill-management HTTP endpoints (+ groups plumbing)#214

Merged
aroff merged 2 commits into
mainfrom
feat/origin-groups-and-phase2
Jul 22, 2026
Merged

feat: Phase 2 — browser skill-management HTTP endpoints (+ groups plumbing)#214
aroff merged 2 commits into
mainfrom
feat/origin-groups-and-phase2

Conversation

@aroff

@aroff aroff commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Two things: the groups follow-up from Phase 1, and Phase 2 of spec 003 (the HTTP endpoints).

groups plumbing (Phase-1 follow-up)

add_from_origin/commit now take a groups: Vec<String> and record it on the Manifest + Lock entry; an empty list on Update preserves the skill's existing groups. This deletes the CLI reapply_groups_after_seam workaround (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, or 409 on an already-installed id, else 400/500.
  • POST /skills/update {skill_id?, check?}preflight + add_from_origin(Update). Replaces the old upgrade handler that shelled out to a subprocess. /skills/upgrade kept as an alias.
  • POST /reindex[/{id}] → real service.reindex (was 501); returns 200 with reindexed:false when 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 → adds writable + embedding_provider capability flags (the browser reads these to disable controls / show provider state — spec 003 §6).

Serve edge: execute_serve now builds its own service with inject_edge_services (embedding provider + repository manager) and with_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 took project_root; this wires it).

Review

The core seams (Phase 1) were opus-reviewed already. This HTTP layer was reviewed for: the ServiceError::AlreadyIndexed → 409 mapping (explicit, doesn't disturb the blanket →400 used elsewhere), the served-project-root resolution (via load_project_config at 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).
  • --global installs 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 --workspace692 passed, 0 failed
  • New handler tests: install (201/409/400 + 403-without-write), update (200/check/404), reindex (200-skipped + 403), status capabilities. serve-command.mdx endpoint table updated.

Next: Phase 3 (the web UI — install flow over the four Origin variants, per-skill update/remove, read-only SKILL.md view). The HTTP surface it needs is now in place.

🤖 Generated with Claude Code

aroff and others added 2 commits July 22, 2026 13:14
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>
@aroff
aroff merged commit 71e6e89 into main Jul 22, 2026
10 checks passed
@aroff
aroff deleted the feat/origin-groups-and-phase2 branch July 22, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant