feat(FN-5252): update done-card files chip display logic

Adds a new files chip on done-state TaskCards showing insertion/deletion counts, backed by new types (`filesChanged`, `insertions`, `deletions`) in core; architecture docs updated to reflect the change. The component implementation is a net reduction of 20 lines, with corresponding test coverage add

Fusion-Task-Id: FN-5252
This commit is contained in:
Fusion (runfusion.ai)
2026-05-19 21:31:51 -07:00
committed by gsxdsm
parent c4745caec0
commit 61dd439e20
4 changed files with 42 additions and 48 deletions

View File

@@ -1384,13 +1384,16 @@ Done-task file-count surfaces intentionally distinguish three data sources:
1. **`/api/tasks/:id/diff` (lineage union, authoritative landed diff)**
- This route aggregates the task's landed lineage and returns `stats.filesChanged` plus the file list used by the Changes tab.
- Task cards and done-task diff views should treat this as the canonical "files changed" source.
- Done-task cards and diff views should treat this as the canonical "files changed" source.
2. **`task.mergeDetails.filesChanged` / `insertions` / `deletions` (final-commit shortstat)**
- These fields describe only the recorded final merge/squash commit shortstat.
- In multi-commit lineages this can undercount the full landed diff and is therefore labeled as commit-level metadata (for example, "Files in merge commit" / "Final commit summary").
3. **`task.modifiedFiles` (execution-time worktree snapshot)**
- On done cards, `mergeDetails.filesChanged` is only a transient loading placeholder until `/api/tasks/:id/diff` resolves.
3. **`task.mergeDetails.landedFiles` (recorded committed file list)**
- When live diff stats are unavailable, done-task cards may fall back to the recorded landed file list length.
- This remains committed-diff metadata; transient executor worktree captures are not surfaced as a done-card files chip.
4. **`task.modifiedFiles` (execution-time worktree snapshot)**
- Captured in the executor worktree during implementation (`git diff <base>..HEAD` snapshot), before final merge outcomes are known.
- Can include transient/superset paths that did not land; UI labels this as "files touched during execution" rather than "files changed" for done tasks.
- Can include transient/superset paths that did not land; done-task cards must not use it for the files-changed chip.
**FN-4647 decision:** `mergeDetails` shortstat fields remain commit-level metadata. No additional persisted lineage-level summary field is introduced at this time; done-task landed totals continue to be served live via `/api/tasks/:id/diff`.