feat(FN-2471): persist source issue provenance in task storage

- Add TaskSourceIssue contract and thread sourceIssue through Task, TaskCreateInput, archived task entries, and TaskStore serialization paths.
- Extend SQLite schema to v45 with sourceIssue* columns and add migration coverage for v44 upgrades plus legacy JSON migration import.
- Persist, update, clear, and archive/unarchive sourceIssue metadata in TaskStore with dedicated regression tests.
- Update core and dashboard tests to schema v45 expectations and stabilize flaky modal assertions with async waits.
This commit is contained in:
Fusion
2026-04-24 12:14:56 -07:00
committed by gsxdsm
parent 0625f4a64a
commit 62cb15a4b8
15 changed files with 269 additions and 34 deletions

View File

@@ -86,7 +86,7 @@ export function probeFts5(db: DatabaseSync): boolean {
// ── Schema Definition ────────────────────────────────────────────────
const SCHEMA_VERSION = 44;
const SCHEMA_VERSION = 45;
function normalizeTaskComments(
steeringComments: SteeringComment[] | undefined,
@@ -199,6 +199,11 @@ CREATE TABLE IF NOT EXISTS tasks (
workflowStepResults TEXT DEFAULT '[]',
prInfo TEXT,
issueInfo TEXT,
sourceIssueProvider TEXT,
sourceIssueRepository TEXT,
sourceIssueExternalIssueId TEXT,
sourceIssueNumber INTEGER,
sourceIssueUrl TEXT,
mergeDetails TEXT,
breakIntoSubtasks INTEGER DEFAULT 0,
enabledWorkflowSteps TEXT DEFAULT '[]',
@@ -1735,6 +1740,19 @@ export class Database {
});
}
// Source issue provenance contract (FN-2471)
// Persists durable source identity for imported issues separately from
// transient/live issueInfo status snapshots.
if (version < 45) {
this.applyMigration(45, () => {
this.addColumnIfMissing("tasks", "sourceIssueProvider", "TEXT");
this.addColumnIfMissing("tasks", "sourceIssueRepository", "TEXT");
this.addColumnIfMissing("tasks", "sourceIssueExternalIssueId", "TEXT");
this.addColumnIfMissing("tasks", "sourceIssueNumber", "INTEGER");
this.addColumnIfMissing("tasks", "sourceIssueUrl", "TEXT");
});
}
}
/**