Files
pitchfast/backlog/tasks/task-36 - Remove-optional-helper-undefined-args.md

1.7 KiB

id, title, status, assignee, created_date, updated_date, labels, dependencies, priority, ordinal
id title status assignee created_date updated_date labels dependencies priority ordinal
TASK-36 Remove optional helper undefined args In Progress
2026-06-06 21:15 2026-06-06 21:23
high 38000

Description

Fix remaining spec-review issues in auditGenerationAction by avoiding explicit undefined auditId and nested usage fields in helper call arguments.

Acceptance Criteria

  • #1 persistAuditStage callsites include auditId only by conditional spread
  • #2 recordOpenRouterUsage/recordAuditUsageEvent/capture helper callsites include optional auditId only by conditional spread
  • #3 stage usage helper args are built without explicit undefined token fields

Implementation Plan

  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

Implementation Notes

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.