Files
fusion/packages/dashboard/app/components/settings/sections/ProjectModelsSection.search.ts
Fusion Agent a81c9b80d9 FN-036: make task title summarization project-controlled
Make generated task titles project-controlled while preserving useful summaries at any length.

- Add project-level title summarization settings and UI controls.
- Make summarization length-independent across task creation, planning, GitHub, and agent flows.
- Update localization, documentation, and regression coverage.

Files changed:
 .../fn-036-systematic-title-summarization.md       |   7 +
 docs/settings-reference.md                         |   2 +-
 docs/storage.md                                    |   2 +-
 docs/task-management.md                            |   4 +-
 packages/core/src/__tests__/ai-summarize.test.ts   |  34 ++--
 .../__tests__/store-create-intake-column.test.ts   | 186 +++++++++++++++++++++
 packages/core/src/ai/ai-summarize.ts               |  32 ++--
 packages/core/src/task-store/task-creation.ts      |  83 +++++++--
 packages/core/src/types/settings/settings-scope.ts |   9 +-
 packages/core/src/types/task/task-core.ts          |   2 +-
 .../dashboard/app/__tests__/api-projects.test.ts   |   4 +-
 .../app/__tests__/settings-sections.test.tsx       |   2 +-
 .../dashboard/app/api/planning/ai-summarize.ts     |   2 +-
 .../__tests__/SettingsModal.search.test.ts         |   5 +-
 .../search/__tests__/settings-search-index.test.ts |   2 +-
 .../sections/ProjectModelsSection.search.ts        |   4 +-
 .../settings/sections/ProjectModelsSection.tsx     |  11 +-
 .../src/__tests__/github-tracking.test.ts          |  12 +-
 .../src/__tests__/routes-planning.test.ts          |  28 +++-
 .../dashboard/src/__tests__/routes-tasks.test.ts   |  19 +++
 packages/dashboard/src/github-tracking.ts          |   9 +-
 .../routes/register-ai-text-assistant-routes.ts    |   7 +-
 .../src/__tests__/agent-tools-delegation.test.ts   |   1 +
 .../src/__tests__/heartbeat-executor.test.ts       |   1 -
 packages/engine/src/__tests__/triage.test.ts       |   7 +-
 packages/engine/src/agent-tools.ts                 |   7 +-
 packages/engine/src/triage.ts                      |  12 +-
 packages/i18n/locales/en/app.json                  |   6 +-
 packages/i18n/locales/pt-BR/app.json               |   8 +-
 packages/i18n/src/resources.d.ts                   |   6 +-
 30 files changed, 418 insertions(+), 96 deletions(-)

Fusion-Task-Id: FN-036

Fusion-Task-Lineage: df603386-e63e-4be8-a8e5-bae9aa1d4a80

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-08-20 03:57:23 +00:00

104 lines
6.2 KiB
TypeScript

/**
* Search entries for the Project Models section.
*
* FNXC:SettingsSearch 2026-07-15-17:35:
* One entry per descriptor row the section renders, co-located so a setting and its index entry change in the same edit. Labels and help mirror the section's `t()` calls verbatim: the index matches on the copy operators actually read, so a paraphrase here would make search miss the words on screen.
* This section is the reason the index was rewritten. Operators searched "summarize" and Project Models did not surface, because the old index was a hand-written keyword list per nav entry; it was patched twice (FN-7907, then again 2026-07-14) and still only covered whatever someone had thought to type. `autoSummarizeTitles` now carries NO keywords on purpose — "Auto-summarize" is in its own label and "summarization" in its help, and both are indexed automatically. Adding "summarize" back as a keyword would restate the label and re-create the list that rotted.
* Absent by design: the model-lane pickers, the Chat default target picker, preset CRUD and its per-size grid, and the workflow lane rows. They are bespoke widgets, not descriptor rows — there is no `data-settings-key` anchor for a result to jump to.
*/
import type { SettingsSearchEntry } from "../search/types";
export const projectModelsSearchEntries: SettingsSearchEntry[] = [
{
sectionId: "project-models",
key: "executorEscalationModel",
labelKey: "settings.projectModels.executorEscalationModel",
labelFallback: "Executor Escalation Model",
helpKey: "settings.projectModels.executorEscalationModelHelp",
helpFallback:
"Alternate model used once tool-failure retries are exhausted. No default — unset means no alternate model; configure escalation policy and an optional node target in Scheduling.",
keywords: ["tool failure", "alternate model", "retry model", "provider", "executor"],
},
{
sectionId: "project-models",
key: "tokenCap",
labelKey: "settings.projectModels.tokenCap",
labelFallback: "Token Cap",
helpKey: "settings.projectModels.automaticallyCompactContextWhenApproachingThisTokenCount",
helpFallback:
"Automatically compact context when approaching this token count. Leave empty for no cap (compact only on overflow errors). Set a number to proactively compact when reaching this token count. No default — unset (no cap).",
keywords: ["context window", "limit", "budget"],
},
{
sectionId: "project-models",
key: "chatNewSessionMode",
labelKey: "settings.projectModels.chatNewSessionMode",
labelFallback: "New Chat behavior",
helpKey: "settings.projectModels.chatNewSessionModeHelp",
helpFallback:
"Prompt mode opens New Chat with this default preselected. Always-default mode skips the dialog when the configured default is complete.",
keywords: ["direct chat", "skip dialog"],
},
{
sectionId: "project-models",
key: "autoSelectModelPreset",
labelKey: "settings.projectModels.autoSelectPresetBasedOnTaskSize",
labelFallback: " Auto-select preset based on task size ",
helpKey: "settings.projectModels.autoSelectModelPresetHint",
helpFallback: "Default: disabled.",
/*
FNXC:SettingsSearch 2026-07-15-17:35:
The help is just "Default: disabled.", so this row's only indexable copy is its label. The sizes it selects between (S/M/L) live in the grid below, which is bespoke and unindexed, hence the size keywords here.
*/
keywords: ["small", "medium", "large", "S M L"],
},
{
sectionId: "project-models",
key: "taskDefinitionInInputLanguage",
labelKey: "settings.projectModels.taskDefinitionInInputLanguage",
labelFallback: "Write task definitions in the operator's input language",
helpKey: "settings.projectModels.taskDefinitionInInputLanguageHelp",
helpFallback:
"When enabled, generated task-definition prose uses supported detectable input languages (Spanish, French, Korean, or Chinese as zh-CN). Headings, markers, and code stay English. Unsupported or undetectable input stays English. Default: disabled.",
keywords: ["task definition", "prompt language", "localized prose", "Spanish", "French", "Korean", "Chinese"],
},
{
sectionId: "project-models",
key: "autoSummarizeTitles",
labelKey: "settings.projectModels.autoSummarizeLongDescriptionsAsTitles",
labelFallback: " Auto-summarize task titles ",
helpKey: "settings.projectModels.whenEnabledTasksCreatedWithoutATitleBut",
helpFallback:
" When enabled, every non-empty task description created without a title receives an AI-generated title (max 60 characters). Explicit titles are preserved, and manual or explicit force requests remain available when this is disabled. The same model is also used for merge commit summaries and GitHub tracking issue titles. Default: disabled. ",
},
{
sectionId: "project-models",
key: "useAiMergeCommitSummary",
labelKey: "settings.projectModels.aIMergeCommitSummaries",
labelFallback: " AI merge commit summaries ",
helpKey: "settings.projectModels.whenEnabledMergeCommitMessagesIncludeAnAI",
helpFallback:
" When enabled, merge commit messages include an AI-generated subject plus body summary (narrative + bullets + diff-stat) instead of just listing step commit subjects. Uses the title summarization model. Default: enabled. ",
},
{
sectionId: "project-models",
key: "prTitlePromptInstructions",
labelKey: "settings.projectModels.prTitlePromptInstructions",
labelFallback: "PR title prompt guidance",
helpKey: "settings.projectModels.prTitlePromptInstructionsHelp",
helpFallback:
"Guides the AI-generated Create PR title. Leave blank to use the default PR metadata prompt. No default — unset.",
keywords: ["pull request", "conventional commit"],
},
{
sectionId: "project-models",
key: "prDescriptionPromptInstructions",
labelKey: "settings.projectModels.prDescriptionPromptInstructions",
labelFallback: "PR description prompt guidance",
helpKey: "settings.projectModels.prDescriptionPromptInstructionsHelp",
helpFallback:
"Guides the AI-generated Create PR summary, changes, and testing sections. Leave blank to use the default PR metadata prompt. No default — unset.",
keywords: ["pull request", "body"],
},
];