feat(dashboard/skills): diff + propose-to-registry for pending evolution drafts (#5819)#6104
Conversation
…ion drafts (#5819) Completes the UI slice #5844 deferred. Pending update/patch candidates now render an inline unified diff (current skill body vs proposed prompt_context) with current_version -> proposed_version, and gain a Propose to Registry action that opens a registry PR straight from the draft via POST /api/skills/pending/{id}/propose-to-registry. The new route shares its proposal core with the installed-skill route (refactored to run_registry_proposal). Diff helper is dependency-free. Prompt tuning out of scope.
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ❌ Deployment failed View logs |
librefang-deploy | 02e612c | Jun 14 2026, 10:43 PM |
| (status = 502, description = "GitHub request failed") | ||
| ) | ||
| )] | ||
| pub async fn propose_pending_to_registry( |
There was a problem hiding this comment.
Missing #[tokio::test] integration test for this route. Per CLAUDE.md (§ "What you MUST do for any route / wiring change"), every new endpoint needs a test in crates/librefang-api/tests/ that spawns the router via start_test_server(), POSTs to /api/skills/pending/{id}/propose-to-registry, and asserts on the response shape — covering at minimum the 404 (unknown id), 401 (no GitHub token), and a happy-path stub (or a mocked GitHub token producing 200 with a pr_url). Without this, the dead_route_audit_test and openapi_path_coverage_test will catch wiring drift but nothing exercises the handler's load / staging / error paths. The cargo build in the test plan does not substitute for cargo test -p librefang-api.
Generated by Claude Code
Summary
Completes the dashboard slice that #5844 deferred. #5844 landed the
EvolutionModeFree/Controlled core, pending-queue routing, and registry PR automation, but noted that "the dashboard diff / 'Available' UI and the 'Propose to Registry' action land separately" — this is that follow-up.Change
Backend (
librefang-api):POST /api/skills/pending/{id}/propose-to-registry: stages a pending candidate as anInstalledSkillin a temp dir and opens a registry PR straight from the draft (no approve-first step). For update candidates it pulls the target skill's evolution history into the PR body.run_registry_proposal()core (reuse over duplication). Wired into the router + OpenAPI paths.Dashboard:
PendingCandidatetype extended withkind/target_skill_id/current_version/proposed_version.PendingSkillsSectionrenders an inline unified diff (current skill body vs proposedprompt_context) withcurrent_version → proposed_versionfor update candidates, plus a per-candidate "Propose to Registry" button.unifiedDiff.ts) with vitest tests. No new npm dependency.Scope / deferred
background_skill_reviewprompt tuning is out of scope (this issue is scoped to the dashboard diff / propose UI).openapi.json+ baselines regenerate viacargo xtaskor CI's openapi-drift job.Test plan
cargo build -p librefang-api && cargo clippy -p librefang-api -- -D warnings(cd crates/librefang-api/dashboard && pnpm test && pnpm build)Closes #5819