Externalize audit pipeline services

This commit is contained in:
2026-06-07 23:06:31 +02:00
parent 470fb0f348
commit a45b92ea0a
42 changed files with 3141 additions and 247 deletions

View File

@@ -0,0 +1,44 @@
---
id: TASK-36
title: Remove optional helper undefined args
status: In Progress
assignee: []
created_date: '2026-06-06 21:15'
updated_date: '2026-06-06 21:23'
labels: []
dependencies: []
priority: high
ordinal: 38000
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Fix remaining spec-review issues in auditGenerationAction by avoiding explicit undefined auditId and nested usage fields in helper call arguments.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [x] #1 persistAuditStage callsites include auditId only by conditional spread
- [x] #2 recordOpenRouterUsage/recordAuditUsageEvent/capture helper callsites include optional auditId only by conditional spread
- [x] #3 stage usage helper args are built without explicit undefined token fields
<!-- AC:END -->
## Implementation Plan
<!-- SECTION:PLAN:BEGIN -->
1. Inspect auditId and usage helper callsites
2. Add RED source contracts for optional auditId and nested usage args
3. Run focused test and record RED
4. Implement minimal conditional spreads and usage arg helper
5. Run focused tests green and full pnpm test if fast
6. Self-review scope and leave task In Progress
<!-- SECTION:PLAN:END -->
## Implementation Notes
<!-- SECTION:NOTES:BEGIN -->
RED: tsc passed. Focused node --test .test-output/tests/audit-generation-action-source.test.js failed as expected on persistAuditStage auditId callsites, helper auditId callsites, and inline nested usage objects.
GREEN: pnpm exec tsc -p tsconfig.test.json passed. Focused node --test .test-output/tests/audit-generation-action-source.test.js passed 24/24. Full pnpm test passed 356/356. Implemented conditional auditId spreads at persist/helper callsites and stage usage builder for callsite usage objects.
<!-- SECTION:NOTES:END -->