other

Audit: Mission Control missing task display IDs

2026-04-08

Audit: Mission Control missing task display IDs

Date: 2026-04-08 15:42 PDT

Findings summary

Root cause

There were two separate causes.

1. UI create flow bypassed numbered ID assignment

File: mission-control/components/tasks/TasksWorkspace.tsx

The create flow built a local task with createTaskId() but no displayId, then saved the entire task array through PUT /api/tasks.

2. Server list writes did not normalize missing display IDs

Files: mission-control/app/api/tasks/route.ts, mission-control/lib/tasks-store.ts

PUT /api/tasks accepted a full task list and wrote it without assigning missing displayId values. The store normalized tags and inferred project IDs, but did not backfill numbering at list-write time.

3. Capture script also bypassed numbering

File: mission-control/scripts/capture-task.mjs

The CLI/chat capture path wrote directly to data/tasks.json and did not set displayId on new tasks.

Fix

Centralized display ID normalization in the task store

File changed: mission-control/lib/tasks-store.ts

Added list-level normalization that:

This now runs on:

Fixed the UI save round-trip

Files changed:

Changes:

Fixed the capture script

File changed: mission-control/scripts/capture-task.mjs

Changes:

Backfill performed

Data file changed: mission-control/data/tasks.json Backup created: mission-control/data/tasks.json.bak-20260408-153524

Backfilled only tasks missing displayId. Existing JAM IDs were preserved exactly. No renumbering.

Assignments made:

Numbering rule used:

Validation

Storage validation

Confirmed after backfill:

API validation

Validated the exact UI-style save path by sending a full-list PUT /api/tasks payload with a temporary task missing displayId. Result:

Capture-path validation

Validated scripts/capture-task.mjs with a temporary task. Result:

UI validation

Validated against the live app after rebuild/restart.

Observed:

Build and service refresh

Notes

Exact files changed

Ready for review

Yes