feat(FN-3998): add task lineage commit associations API, UI, and tests
Adds task lineage commit associations: a new API route stores and exposes which commits belong to which task, the `TaskChangesTab` surfaces these lineage links visually, and documentation covers the reconciliation model. Includes comprehensive tests for both the route and component. Fusion-Task-Id: FN-3998
This commit is contained in:
@@ -1172,6 +1172,38 @@ Behavior summary:
|
||||
|
||||
`TaskStore.updateTask()` applies this guard before persisting `nodeId` changes.
|
||||
|
||||
### Task commit-association API (`GET /api/tasks/:id/commit-associations`)
|
||||
|
||||
Dashboard session-diff route registration (`packages/dashboard/src/routes/register-session-diff-routes.ts`) now exposes lineage commit associations for task detail views:
|
||||
|
||||
- **Route:** `GET /api/tasks/:id/commit-associations`
|
||||
- **Project scoping:** uses `getProjectContext(req)` so reads are project-aware like adjacent task diff endpoints.
|
||||
- **404 behavior:** returns `{ error: "Task not found" }` for unknown task ids.
|
||||
- **Response contract:**
|
||||
|
||||
```json
|
||||
{
|
||||
"taskId": "FN-1234",
|
||||
"lineageId": "uuid-or-null",
|
||||
"associations": [
|
||||
{
|
||||
"commitSha": "abc123...",
|
||||
"commitSubject": "feat(FN-1234): ...",
|
||||
"authoredAt": "2026-05-11T02:00:00.000Z",
|
||||
"matchedBy": "canonical-lineage-trailer | legacy-task-id-trailer | legacy-subject | manual-reconciliation",
|
||||
"confidence": "canonical | legacy | ambiguous",
|
||||
"taskIdSnapshot": "FN-1234",
|
||||
"note": "optional reconciliation note"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
`confidence` is a consumer-facing interpretation aid:
|
||||
- `canonical` = immutable lineage trailer match (highest confidence)
|
||||
- `legacy` = recovered via legacy task-id/subject matching
|
||||
- `ambiguous` = manual reconciliation where historical task-id attribution could be misleading
|
||||
|
||||
### Task branch field plumbing (`branch` + `baseBranch`)
|
||||
|
||||
Task create/update now preserves both branch fields end-to-end:
|
||||
|
||||
@@ -9,3 +9,19 @@
|
||||
- Reconciled GitHub-tracking task lineage: `FN-3874`, `FN-3940`, `FN-3943`
|
||||
- Summary: raw task-ID references in historical commits can map to different board meanings over time; therefore historical attribution must use immutable lineage IDs plus persisted association records rather than display task ID alone.
|
||||
- Confidence: high
|
||||
|
||||
## Dashboard confidence semantics (FN-3998 follow-through)
|
||||
|
||||
Task detail → Changes now surfaces lineage commit associations from `GET /api/tasks/:id/commit-associations` with explicit confidence labels.
|
||||
|
||||
- `canonical`
|
||||
- Match source: `canonical-lineage-trailer`
|
||||
- Meaning: commit carries immutable lineage trailer and is safe to treat as authoritative task attribution.
|
||||
- `legacy`
|
||||
- Match source: `legacy-task-id-trailer` or `legacy-subject`
|
||||
- Meaning: attribution recovered from pre-lineage-era metadata; useful but weaker than canonical lineage identity.
|
||||
- `ambiguous`
|
||||
- Match source: `manual-reconciliation`
|
||||
- Meaning: historical overlap required manual reconciliation; must remain visibly weaker in UI and should not be presented as canonical evidence.
|
||||
|
||||
When consuming this endpoint, prefer confidence-driven copy/visual hierarchy rather than flattening all rows into an equivalent "task commit" presentation.
|
||||
|
||||
Reference in New Issue
Block a user