{
  "_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-0016",
    "kind": "failure",
    "objective": "LAWS_ADD (and every fn row that interpolates arguments into SQL) breaks on an apostrophe: five CONSOLE_ laws were refused with SQLITE_ERROR near a quote on 2026-09-12",
    "detail": "Failure class: unescaped input in a generated SQL statement. Layer that permitted it: the fn runner for LAWS_ADD builds the INSERT by string interpolation instead of bound parameters. Missing invariant: every D1 write from a directory row uses prepared statements with bound parameters. Repair: bind parameters in LAWS_ADD/LAWS_EDIT and audit the fn runners for other interpolated writes (grep for template strings feeding D1_EXEC). Regression test: add a law whose rule text contains an apostrophe and a semicolon; it must land verbatim. Deploy blocker: the check fails if any fn runner interpolates user text into SQL.",
    "state": "completed",
    "priority": 2,
    "revision": 5,
    "depends_on": [],
    "permitted_capabilities": [
      "CODE_LEASE_START",
      "D1_QUERY"
    ],
    "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": {
      "accepted": true,
      "tests_declared": 2,
      "tests_passed": 2,
      "tests_inherited_from": null,
      "results": [
        {
          "id": "commit",
          "ok": true,
          "detail": "checked against required_evidence",
          "evidence_field": "commit"
        },
        {
          "id": "live",
          "ok": true,
          "detail": "checked against required_evidence",
          "evidence_field": "verification"
        }
      ],
      "missing_evidence": []
    },
    "completed_at": "2026-09-12T17:23:58-07:00",
    "created_at": "2026-09-12T14:58:07-07:00",
    "updated_at": "2026-09-12T17:23:58-07:00",
    "audit": "/api/work/task/WF-0016/audit",
    "submit_to": "/api/work/task/WF-0016/submit"
  }
}