--- id: TASK-35 title: Remove remaining undefined audit generation payloads status: In Progress assignee: [] created_date: '2026-06-06 21:06' updated_date: '2026-06-06 21:13' labels: [] dependencies: [] priority: high ordinal: 37000 --- ## Description Fix TASK-34 spec-review issues by preventing appendRunEvent, success finish, and quality stage calls from sending explicit undefined optional fields. ## Acceptance Criteria - [x] #1 appendRunEvent only sends details when defined - [x] #2 success finishAuditGenerationRun omits errorSummary instead of sending undefined - [x] #3 quality-stage persistAuditStage callsite does not pass explicit undefined optional fields ## Implementation Plan 1. Inspect appendRunEvent, quality persist stage, and success finish call 2. Add RED source contracts for remaining explicit undefined patterns 3. Run focused tests and record RED 4. Implement minimal conditional spreads 5. Run focused tests green and full pnpm test if fast 6. Self-review scope and leave task In Progress ## Implementation Notes RED: tsc passed. Focused node --test .test-output/tests/audit-generation-action-source.test.js failed as expected on three contracts: appendRunEvent details sent as args.details, success finishAuditGenerationRun ternary errorSummary undefined, and qualityReview persistAuditStage callsite ternary errorSummary undefined. RED: tsc passed. Focused node --test .test-output/tests/audit-generation-action-source.test.js failed as expected on appendRunEvent details, success finishAuditGenerationRun errorSummary ternary, and qualityReview persistAuditStage errorSummary ternary. GREEN: focused source test passed 21/21; full pnpm test passed 353/353. Self-review: changed only convex/auditGenerationAction.ts and tests/audit-generation-action-source.test.ts in this turn; no commits/staging; no UsageEvents or ScreenshotOne behavior changes.