Skip to content

Add co-located route.test.ts for the 17 routes currently uncovered, prioritized by data-leak risk (/api/audit, /api/auto #416

@itsmiso-ai

Description

@itsmiso-ai

Parent umbrella issue: #408
Source audit: Weekly tech debt audit: dispatch - 2026-06-17
Source audit date: 2026-06-17

Original recommendation

P2 — Add co-located route.test.ts for the 17 routes currently uncovered, prioritized by data-leak risk (/api/audit, /api/automation/*, /api/issues/untriaged).

Matched top finding

Roughly a third of API routes (mostly older ones) have no co-located route.test.ts. Several of the unauthenticated list/read routes (/api/audit, /api/repos, /api/automation/events, /api/automation/workflows, /api/issues/untriaged) leak data without auth and would benefit from regression coverage. The PR-fix-queue and PR-followup ingestion routes have route-level coverage gaps too.

Evidence:

  • find src/app/api -name 'route.test.ts' | wc -l → 31
  • find src/app/api -name 'route.ts' | wc -l → 48
  • Routes without co-located tests (selected):
    • /api/audit/route.ts (unauthenticated, returns all AuditLog rows)
    • /api/repos/route.ts (unauthenticated GET)
    • /api/automation/events/route.ts (unauthenticated GET)
    • /api/automation/workflows/route.ts (unauthenticated GET)
    • /api/automation/workflows/[id]/route.ts (unauthenticated GET)
    • /api/pr-fix-queue/mark/route.ts (mutating, has auth)
    • /api/pr-fix-queue/queued/route.ts (auth)
    • /api/pr-fix-queue/enqueue/route.ts (auth)
    • /api/pr-followup/sync/route.ts (auth)
    • /api/pr-followup/webhook/route.ts (auth, has signature verification)
    • /api/issues/reconcile/route.ts (auth)
    • /api/issues/untriaged/route.ts (unauthenticated GET)
    • /api/issues/[issueId]/pr-health/refresh/route.ts (auth)
    • /api/agent-runs/route.ts (auth)
    • /api/health/route.ts (unauthenticated)
    • /api/auth/logout/route.ts (intentionally no auth)
    • /api/auth/[...nextauth]/route.ts (NextAuth-managed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditAudit, review, or investigation work.priority/p2Normal priority.status/backlogNot ready for worker pickup yet.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions