feat(FN-4222): add experiment-finalize CLI command and API route

Implements the `experiment-finalize` CLI command (FN-4222) and its companion dashboard API route, wiring the feature through the pi extension as a new callable tool. Includes the command implementation, extension tooling, API integration, and corresponding test coverage.

Fusion-Task-Id: FN-4222
This commit is contained in:
Fusion
2026-05-14 04:20:59 -07:00
committed by gsxdsm
parent 25234edc97
commit 81b1eae394
15 changed files with 732 additions and 2 deletions

View File

@@ -33,7 +33,7 @@ Mission → Milestone → Slice → Feature → Task
- **Agent tools** — `fn_agent_stop`, `fn_agent_start`, `fn_agent_create`, `fn_agent_delete`, `fn_list_agents`, `fn_delegate_task`, `fn_agent_show`, `fn_agent_org_chart`
- **Skills tools** — `fn_skills_search`, `fn_skills_install`
- **Insight tools** — `fn_insight_list`, `fn_insight_show`, `fn_insight_run_list`, `fn_insight_run_show`
- **Other tools** — `fn_web_fetch`, `fn_research_run`, `fn_research_list`, `fn_research_get`, `fn_research_cancel`, `fn_research_retry`
- **Other tools** — `fn_web_fetch`, `fn_research_run`, `fn_research_list`, `fn_research_get`, `fn_research_cancel`, `fn_research_retry`, `fn_experiment_finalize`
<!-- END: tool-categories -->
- **Dashboard** — Use `/fn` command to start/stop the dashboard

View File

@@ -448,6 +448,18 @@ Cited-research pipeline: retry a failed run when lifecycle marks it retryable (n
|-----------|------|----------|-------------|
| `id` | string | ✓ | Research run ID |
### fn_experiment_finalize
Group kept experiment runs into reviewable branches and finalize the session. Use dryRun=true to preview the plan without touching git.
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| `sessionId` | string | ✓ | Experiment session ID |
| `integrationBranch` | string | — | Integration branch to compute merge-base against (default: main) |
| `dryRun` | boolean | — | Preview plan only; do not create branches |
| `planOverride` | unknown | — | Optional plan override payload |
| `summary` | string | — | Optional finalize summary |
<!-- END: extension-tools -->
## Dashboard Command

View File

@@ -35,6 +35,7 @@ All skill/extension tool invocations in this catalog use the public `fn_*` names
| `fn_research_get` | Cited-research pipeline: get one run with structured findings and citations (not experiment-loop state). |
| `fn_research_cancel` | Cited-research pipeline: cancel an in-flight run; terminal runs return INVALID_TRANSITION (does not control experiment loops). |
| `fn_research_retry` | Cited-research pipeline: retry a failed run when lifecycle marks it retryable (not an autonomous experiment loop retry). |
| `fn_experiment_finalize` | Group kept experiment runs into reviewable branches and finalize the session. Use dryRun=true to preview the plan without touching git. |
| `fn_insight_list` | List persisted project insights with optional category/status filters. |
| `fn_insight_show` | Show a single persisted insight by ID. |
| `fn_insight_run_list` | List recent insight-generation runs with optional status/trigger filters. |