{
  "_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-0411",
    "kind": "work",
    "objective": "Close the ledger: make a missed entry impossible rather than unlikely, starting with the audit log an agent can currently edit",
    "detail": "Owner question 2026-09-20: an architecture where no matter who acts - owner, coding agent, model, cron, webhook - it lands on the ledger with no possibility of a miss. Measured today, that is not met. The /api/dispatch lane is well covered. The rest is uneven and there are named holes. Most severe, in order. (a) LEDGER_EXEC runs raw SQL against the events database with no governed-table check, and events, events_stats and invocations are not in GOVERNED_TABLES - so a DELETE or UPDATE against the audit log itself is accepted, and the dispatch row recording it is written into the table being edited. The fix belongs at ledgerExec in functions/_lib/fn_runners.js, which is owner-protected, so it needs the owner's hand or an unlock. (b) logEvent cannot fail loudly: its whole body sits in one bare catch that returns null, and exactly one of its 245 call sites checks the return. functions/api/event_log_ingest.js already shows the right shape - it answers 503 when the write is unacked. (c) The ledger's own off switches - ledger.raw.capture, ledger.traffic.capture, controls_state, gates_disabled - live in the settings table, which nothing governs, and are writable by D1_EXEC and by DELETE /api/settings/<key>. A gate turned off exits 0, which reads as a pass. (d) Five admin write routes and about thirty API routes write D1 with no ledger call at all, covered only by a raw arrival that records the request bytes and not the outcome. (e) LOCAL_EXEC is dispatched with noLog true in one live call site, and noLog is a plain option any caller can pass. (f) The Mac bridge executes shell and only reports if MISC_INGEST_URL is set, fire and forget, never awaited. (g) traffic/store.js documents eight tables as governed and append-only - none of them are in GOVERNED_TABLES. (h) No gate looks for the whole class: a file under functions/api or functions/admin that writes D1 and contains no ledger call.",
    "state": "open",
    "priority": 1,
    "revision": 1,
    "depends_on": [],
    "permitted_capabilities": [],
    "acceptance_tests": [
      {
        "id": "commit",
        "type": "evidence_present",
        "field": "commit"
      },
      {
        "id": "verification",
        "type": "evidence_present",
        "field": "verification"
      },
      {
        "id": "gap_closed",
        "type": "evidence_present",
        "field": "gap_closed"
      }
    ],
    "required_evidence": [
      "commit",
      "verification",
      "gap_closed"
    ],
    "parent_task": null,
    "supersedes": null,
    "failure": null,
    "failure_count": 0,
    "last_result": null,
    "completed_at": null,
    "created_at": "2026-09-20T12:39:18-07:00",
    "updated_at": "2026-09-20T12:39:18-07:00",
    "audit": "/api/work/task/WT-0411/audit",
    "submit_to": "/api/work/task/WT-0411/submit"
  }
}