feat(FN-5060): complete Step 8 — update docs and changeset
This commit is contained in:
committed by
gsxdsm
parent
2b96475fdd
commit
68b5694cba
5
.changeset/FN-5060-extend-duplicate-guard.md
Normal file
5
.changeset/FN-5060-extend-duplicate-guard.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Extend the FN-4918 deterministic duplicate guard to the remaining task-creation surfaces: CLI `fn task add` (direct-store, with a new `--no-dedup` flag), engine `createAgentTask` (powers `fn_task_create` and triage subtask splits — duplicate detections now report `Linked existing ...`), and mission feature triage (links to the canonical task on duplicate). Dashboard `POST /api/tasks` now consumes the same shared helper so behavior is identical across surfaces. `InlineCreateCard` gains the duplicate-warning modal already shipped on `QuickEntryBox`.
|
||||
@@ -28,17 +28,29 @@ Dashboard `POST /tasks` now performs a pre-create duplicate gate using token-ove
|
||||
- Override creates emit activity type `task:duplicate-warning-overridden` with acknowledged IDs and scored candidate metadata.
|
||||
- Duplicate lineage is persisted on the task row via canonical source fields (`sourceType: "task_duplicate"`, `sourceParentTaskId`) plus `sourceMetadata.duplicateOfTaskIds` when available, so `fn task show <id>` and Task Detail views can render duplicate-of linkage directly from task provenance.
|
||||
|
||||
#### Deterministic duplicate guard (FN-4918)
|
||||
#### Deterministic duplicate guard (FN-4918, extended by FN-5060)
|
||||
|
||||
`POST /tasks` also applies a deterministic guard for exact normalized content matches (title + description fingerprint) within a 60s window.
|
||||
Fusion applies a deterministic guard for exact normalized content matches (title + description fingerprint) within a 60s window. The shared implementation lives in `packages/core/src/duplicate-guard.ts` (`runDeterministicDuplicateGuard` + `reconcileDeterministicDuplicate`) and is wired into all primary task-creation surfaces:
|
||||
|
||||
- If an existing same-fingerprint task is found in-window, create returns `409` with `{ error: "duplicate_candidates", details: { matches: [{ ..., score: 1, deterministic: true }] } }`.
|
||||
- If two creates race across processes and both reach persistence, post-create reconciliation can return `200` with the canonical older task and auto-archive the newer sibling.
|
||||
- Dashboard `POST /tasks`
|
||||
- CLI `fn task create` (`runTaskCreate`)
|
||||
- Engine `createAgentTask` (powers `fn_task_create`, including triage subtask splits)
|
||||
- Mission feature triage (`MissionStore.triageFeature`)
|
||||
|
||||
Behavior is consistent across these surfaces:
|
||||
|
||||
- If an existing same-fingerprint task is found in-window, create returns/behaves as a link-to-existing result (`duplicate_candidates` for API, `Linked existing ...` for CLI/tool responses).
|
||||
- If two creates race across processes and both reach persistence, post-create reconciliation keeps the older canonical task and auto-archives the newer sibling.
|
||||
- New rows stamp `task.source.sourceMetadata.contentFingerprint` for deterministic matching.
|
||||
- Reconciled losers stamp `task.source.sourceMetadata.deterministicDuplicateOf = <canonicalTaskId>` and are archived (not deleted).
|
||||
- Reconciliation archives record activity event `task:auto-archived-deterministic-duplicate`.
|
||||
|
||||
This deterministic layer complements (does not replace) the FN-4829 similarity warning gate. `bypassDuplicateCheck: true` on `POST /tasks` disables both gates. FN-4892 remains a separate engine-side same-agent intake heuristic at triage finalize.
|
||||
Bypass controls:
|
||||
|
||||
- Dashboard API: `bypassDuplicateCheck: true` skips deterministic + similarity duplicate gates.
|
||||
- CLI: `fn task create --no-dedup` skips deterministic duplicate guard.
|
||||
|
||||
This deterministic layer complements (does not replace) the FN-4829 similarity warning gate. FN-4892 remains a separate engine-side same-agent intake heuristic at triage finalize.
|
||||
|
||||
##### Fail-open boundary (FN-5084)
|
||||
|
||||
|
||||
@@ -166,6 +166,10 @@ interface TaskWorkflowRouteDeps {
|
||||
runGitCommand: (args: string[], cwd: string, timeoutMs: number) => Promise<string>;
|
||||
trimTaskDetailActivityLog: (task: TaskDetail) => TaskDetail;
|
||||
triggerCommentWakeForAssignedAgent: (scopedStore: TaskStore, task: Task, wake: { triggeringCommentType: "steering" | "task" | "pr"; triggeringCommentIds?: string[]; triggerDetail: string }) => Promise<void>;
|
||||
resolveSelfHealingManager: (scopedStore: TaskStore) => {
|
||||
rootDir: string;
|
||||
reconcileInReviewBranchRebind: (opts?: { includeTaskIds?: Set<string> }) => Promise<import("@fusion/engine").RebindResult>;
|
||||
} | undefined;
|
||||
}
|
||||
|
||||
export function registerTaskWorkflowRoutes(ctx: ApiRoutesContext, deps: TaskWorkflowRouteDeps): void {
|
||||
|
||||
Reference in New Issue
Block a user