{
  "_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": "WT-0371",
    "kind": "work",
    "objective": "Find: turn a place name into coordinates (GET /api/find/where)",
    "detail": "GOAL\nAdd a way to turn a place name into coordinates, so the Find screen can search around a named city\nwithout needing the phone's location.\n\nWHAT TO BUILD\nOne new file: functions/api/find/where.js\n\nIt answers GET /api/find/where?q=<place name> and returns JSON:\n  { \"ok\": true, \"q\": \"<what was asked>\", \"places\": [ { \"name\": \"...\", \"lat\": 33.49, \"lon\": -111.92, \"kind\": \"city\" } ] }\n\nRules:\n1. Look the name up with OpenStreetMap's free geocoder:\n   https://nominatim.openstreetmap.org/search?format=jsonv2&limit=5&q=<the name>\n   That service requires a User-Agent header identifying the caller. Send:\n   'miscsubjects-find/1 (https://miscsubjects.com)'\n2. Return at most 5 places. lat and lon must be numbers, not strings.\n3. \"kind\" is Nominatim's own \"type\" field (\"city\", \"town\", \"suburb\"…), passed through.\n4. If the geocoder answers nothing, return { \"ok\": true, \"q\": ..., \"places\": [] } — not an error.\n5. If the geocoder fails or times out (use a 15 second timeout), return\n   { \"ok\": false, \"error\": \"geocoder_unavailable\", \"detail\": \"<what happened>\" } with HTTP 200.\n6. Authorisation: copy it exactly from functions/api/find/[[path]].js — the same isBuildAuthed\n   check first, then consoleAuth + consoleScope. Do not invent a new way in.\n\nHOW TO CHECK IT BEFORE YOU FINISH\n  node --check functions/api/find/where.js\nand read functions/api/find/[[path]].js first so the import paths and the auth match.\n\nDO NOT\n- Do not change any other file.\n- Do not add a dependency.\n- Do not call any service other than nominatim.openstreetmap.org.\n",
    "state": "open",
    "priority": 3,
    "revision": 1,
    "depends_on": [],
    "permitted_capabilities": [],
    "acceptance_tests": [
      {
        "type": "evidence_present",
        "id": "commit",
        "field": "commit"
      },
      {
        "type": "evidence_present",
        "id": "live",
        "field": "verification"
      }
    ],
    "required_evidence": [
      "commit",
      "verification"
    ],
    "parent_task": null,
    "supersedes": null,
    "failure": null,
    "failure_count": 0,
    "last_result": null,
    "completed_at": null,
    "created_at": "2026-09-19T19:11:22-07:00",
    "updated_at": "2026-09-19T19:11:22-07:00",
    "audit": "/api/work/task/WT-0371/audit",
    "submit_to": "/api/work/task/WT-0371/submit"
  }
}