feat(FN-2989): merge fusion/fn-2989

- Add `CustomProviderForm` component and routing for user-defined OpenAI/Anthropic-compatible endpoints (FN-2987)
- Expand `agent-heartbeat.ts` with richer prompt guidance and criteria updates
- Strengthen executor prompts in `executor.ts` with expanded implementation guidance
- Enrich reviewer prompts in `reviewer.ts` with enhanced review criteria
- Add triage prompt guidance in `triage.ts` for task classification
- Extend merger prompts in `merger.ts` with merge strategy guidance
- Add `agent-document-tools.test.ts` and `agent-tools.test.ts` integration tests
- Expand `store.ts` with new task/document operations; add `task-documents.test.ts` and `store.test.ts`
- Add legacy API route in `dashboard/app/api/legacy.ts` and auth path routing
- Update `ModelOnboardingModal` with custom provider onboarding flow
- Extend `SettingsModal` with custom provider configuration UI and mobile layout tests
- Add changeset for `@runfusion/fusion` minor release

Commits merged:
- feat(FN-2989): complete Step 5 — enrich remaining agent prompts
- feat(FN-2989): complete Step 4 — enrich reviewer prompt criteria
- feat(FN-2989): complete Step 3 — strengthen triage prompt guidance
- feat(FN-2989): complete Step 2 — expand executor guidance prompts
- feat(FN-2989): complete Step 1 — expand heartbeat prompts
- feat(FN-2987): merge fusion/fn-2987
- feat(FN-2959): merge fusion/fn-2959-2

Files changed:
.changeset/custom-openai-anthropic-providers.md    |   5 +
 docs/task-management.md                            |   4 +
 packages/core/src/__tests__/store.test.ts          |  38 +++
 packages/core/src/__tests__/task-documents.test.ts |  32 +++
 packages/core/src/store.ts                         |  34 ++-
 packages/dashboard/app/api/legacy.ts               |  41 ++++
 .../app/components/CustomProviderForm.css          |  45 ++++
 .../app/components/CustomProviderForm.tsx          | 203 ++++++++++++++++
 .../app/components/ModelOnboardingModal.css        |  14 ++
 .../app/components/ModelOnboardingModal.tsx        |  62 ++++-
 .../dashboard/app/components/SettingsModal.css     |  38 +++
 .../dashboard/app/components/SettingsModal.tsx     |  91 +++++++-
 .../__tests__/CustomProviderForm.test.tsx          |  60 +++++
 .../__tests__/ModelOnboardingModal.test.tsx        |  23 ++
 .../components/__tests__/SettingsModal.test.tsx    |  13 ++
 .../__tests__/SettingsModalNodeRouting.test.tsx    |   4 +
 .../components/__tests__/settings-mobile.test.tsx  |   4 +
 packages/dashboard/src/auth-paths.ts               |   4 +
 packages/dashboard/src/routes.ts                   |   2 +
 .../__tests__/custom-provider-routes.test.ts       | 118 ++++++++++
 .../src/routes/register-custom-provider-routes.ts  | 254 +++++++++++++++++++++
 .../src/__tests__/agent-document-tools.test.ts     |  15 ++
 packages/engine/src/__tests__/agent-tools.test.ts  |  43 ++++
 packages/engine/src/agent-heartbeat.ts             | 107 +++++++--
 packages/engine/src/agent-reflection.ts            |   7 +-
 packages/engine/src/agent-tools.ts                 |  28 ++-
 packages/engine/src/cron-runner.ts                 |   4 +
 packages/engine/src/executor.ts                    |  69 +++++-
 packages/engine/src/merger.ts                      |  26 ++-
 packages/engine/src/mission-execution-loop.ts      |   6 +
 packages/engine/src/reviewer.ts                    |  24 ++
 packages/engine/src/step-session-executor.ts       |  11 +-
 packages/engine/src/triage.ts                      |  20 ++
 33 files changed, 1407 insertions(+), 42 deletions(-)

Fusion-Task-Id: FN-2989
This commit is contained in:
Fusion
2026-04-29 20:25:14 -07:00
committed by gsxdsm
parent 3c37f8d4bb
commit 5beb515202
9 changed files with 241 additions and 33 deletions

View File

@@ -46,7 +46,10 @@ import {
export const TRIAGE_SYSTEM_PROMPT = `You are a task specification agent for "fn", an AI-orchestrated task board.
## Your Role
You are the specification quality gate for implementation success.
Your job: take a rough task description and produce a fully specified PROMPT.md that another AI agent can execute autonomously in a fresh context with zero memory of this conversation.
The quality of your spec directly determines execution quality, review churn, and merge risk.
## What you receive
- A raw task title and optional description (the user's rough idea)
@@ -222,8 +225,16 @@ You have these extra tools during triage:
When the planning conversation produces a structured plan, save it as a document with \`fn_task_document_write(key='plan', content='...')\` so the executor can reference it during implementation.
## Step Design Principles
- Each implementation step should produce a testable artifact or observable outcome
- Order steps by dependency (foundation before integration, implementation before final validation)
- Testing & Verification must run before Documentation & Delivery
- Avoid giant catch-all steps; split outcomes so execution can be verified incrementally
## Guidelines
- Read the project structure and relevant source files to understand context BEFORE writing
- Check package.json/scripts and explicit project commands to align real lint/test/build/typecheck commands
- Look for similar completed tasks and existing code patterns before inventing spec structure
- Be specific — name actual files, functions, and patterns from the codebase
- Steps should express OUTCOMES, not micro-instructions (2-5 checkboxes per step)
- Always include a testing step and a documentation step
@@ -249,6 +260,11 @@ After writing the PROMPT.md, call \`fn_review_spec()\` to get an independent qua
You MUST call \`fn_review_spec()\` after writing the PROMPT.md. Do not finish without getting an APPROVE verdict.
## PROMPT.md Quality Bar (Good vs Bad)
- Good: concrete mission, realistic file scope, dependency-aware step order, explicit quality gates, and clear non-goals.
- Bad: generic wording, vague steps ("implement feature"), missing tests, or file scope that cannot realistically satisfy requested behavior.
- Good file scope estimation includes likely touched tests, config, and integration files — not only the obvious implementation file.
## Output
Write the PROMPT.md directly using the write tool, then call \`fn_review_spec()\` for review.
@@ -283,6 +299,9 @@ Only inject this section when the task genuinely touches frontend UI. Omit it fo
export const FAST_TRIAGE_SYSTEM_PROMPT = `You are a task specification agent for "fn", an AI-orchestrated task board. This task is running in **fast mode** — produce a lean, executable PROMPT.md without heavyweight review scoring or subtask analysis.
## Your Role
You are a fast-path spec writer. Keep output lean but executable, with enough precision that an executor can run immediately.
Your job: turn a rough task description into a focused PROMPT.md another agent can execute autonomously.
## What you produce
@@ -409,6 +428,7 @@ Use that context to align file paths, APIs, assumptions, and completion expectat
- Read relevant source files before writing the spec
- Be specific: reference concrete files, modules, and commands from this repo
- Keep steps outcome-focused with 24 checkboxes per step
- Keep file scope realistic: include tests and integration touchpoints likely required for green quality gates
- Always include Testing & Verification and Documentation & Delivery steps
- Keep fast-mode scope lean and executable; do not add heavyweight review scoring or subtask-analysis sections