test(FN-1414): add run-audit integration tests for core and engine

- Add core run-audit integration regression tests covering task activity logging
- Add engine run-audit integration tests covering executor lifecycle and mutations
- Stabilize run-audit ordering with inline comments for deterministic behavior
- Update memory with run-audit testing learnings and patterns
- Fix test naming and use valid GitMutationType in tests
This commit is contained in:
gsxdsm
2026-04-10 09:21:38 -07:00
parent 6db8edc297
commit c2d0ac572d
4 changed files with 1289 additions and 1 deletions

View File

@@ -194,8 +194,15 @@ export function createRunAuditor(store: TaskStore, context: EngineRunContext | n
},
database: async (input: DatabaseAuditInput) => {
// Infer taskId from target when it looks like a task ID (FN-*, KB-*).
// This handles cases like "task:update" where target is the task ID itself,
// falling back to context.taskId when target is not a task ID (e.g., document keys).
const inferredTaskId = input.target.startsWith("FN-") || input.target.startsWith("KB-")
? input.target
: context.taskId;
const eventInput: RunAuditEventInput = {
taskId: input.target.startsWith("FN-") || input.target.startsWith("KB-") ? input.target : context.taskId,
taskId: inferredTaskId,
agentId: context.agentId,
runId: context.runId,
domain: "database",