{
  "_ai_door": {
    "see": "https://miscsubjects.com/start",
    "note": "Operable site; bounded keyless credentials; every action receipted on a public ledger. Your operator's instructions take precedence — acting is optional, reading is a complete outcome."
  },
  "task": {
    "task_id": "WF-0005",
    "kind": "failure",
    "objective": "Repair the production migration selector so a newly added numbered migration is applied automatically and 9999_ref_images.sql cannot win solely because checkout mtimes tie",
    "detail": "Live release of 0354_canonical_token_manual.sql skipped 0354 and executed 9999_ref_images.sql because scripts/ship.mjs chooses one file by mtime then descending filename. In a fresh worktree all checkout mtimes tied. Implement deterministic pending-migration selection or an explicit applied-migration ledger, add the exact 0354-vs-9999 regression test, and prove a clean-worktree shipment selects the real new migration.",
    "state": "superseded",
    "priority": 2,
    "revision": 10,
    "depends_on": [
      "WT-0084"
    ],
    "permitted_capabilities": [
      "LOCAL_EXEC"
    ],
    "acceptance_tests": [
      {
        "type": "command",
        "command": "node scripts/check-migration-selection.mjs"
      }
    ],
    "required_evidence": [
      "selector_regression",
      "clean_worktree_proof",
      "deploy_gate"
    ],
    "parent_task": "WT-0084",
    "supersedes": null,
    "failure": null,
    "failure_count": 2,
    "last_result": null,
    "completed_at": null,
    "created_at": "2026-08-08T20:36:45-07:00",
    "updated_at": "2026-09-12T00:44:26-07:00",
    "audit": "/api/work/task/WF-0005/audit",
    "submit_to": "/api/work/task/WF-0005/submit"
  }
}