feat(FN-3990): add task lineage identity and association storage
Adds task lineage storage infrastructure (FN-3990 Step 2), introducing a dedicated `task-lineage.ts` module and related types to track task identity and association relationships, with corresponding database schema and store support plus tests and documentation for the lineage reconciliation process Fusion-Task-Id: FN-3990
This commit is contained in:
@@ -52,6 +52,8 @@ export interface EngineRunContext {
|
||||
agentId: string;
|
||||
/** Task ID being operated on (if applicable). */
|
||||
taskId?: string;
|
||||
/** Immutable task lineage ID for durable cross-history correlation. */
|
||||
taskLineageId?: string;
|
||||
/** Execution phase for disambiguating sub-operations (e.g., "heartbeat", "execute", "merge-attempt-1"). */
|
||||
phase?: string;
|
||||
/** Invocation source for heartbeat runs (e.g., "timer", "on_demand", "assignment"). */
|
||||
@@ -193,6 +195,7 @@ export function createRunAuditor(store: TaskStore, context: EngineRunContext | n
|
||||
metadata: {
|
||||
phase: context.phase,
|
||||
...(context.source ? { source: context.source } : {}),
|
||||
...(context.taskLineageId ? { taskLineageId: context.taskLineageId } : {}),
|
||||
...input.metadata,
|
||||
},
|
||||
};
|
||||
@@ -217,6 +220,7 @@ export function createRunAuditor(store: TaskStore, context: EngineRunContext | n
|
||||
metadata: {
|
||||
phase: context.phase,
|
||||
...(context.source ? { source: context.source } : {}),
|
||||
...(context.taskLineageId ? { taskLineageId: context.taskLineageId } : {}),
|
||||
...input.metadata,
|
||||
},
|
||||
};
|
||||
@@ -234,6 +238,7 @@ export function createRunAuditor(store: TaskStore, context: EngineRunContext | n
|
||||
metadata: {
|
||||
phase: context.phase,
|
||||
...(context.source ? { source: context.source } : {}),
|
||||
...(context.taskLineageId ? { taskLineageId: context.taskLineageId } : {}),
|
||||
...input.metadata,
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user