{
  "_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-0180",
    "kind": "work",
    "objective": "Lane 5 of the connections layer: inbound events. Table inbound_events with dedupe on external_id and a stored cursor per connection; the WhatsApp/Signal/Telegram bridges, iMessage watch, Slack Events and Gmail history feed it through CLIENT_EVENT (exists, untested, unwired); prove by pairing WhatsApp once from the build page and receiving one real message onto the ledger.",
    "detail": "Design fixed in bridge/client-bridge/HANDOFF.md, Lane 5. The client bridge daemon polls the Matrix homeserver; a duplicate external_id is a no-op; processing resumes after daemon restart. The owner's one step: scan the WhatsApp code shown on /admin/services. Until Lane 1 lands, connection_id may be the planned id string.",
    "state": "completed",
    "priority": 1,
    "revision": 7,
    "depends_on": [],
    "permitted_capabilities": [
      "CODE_LEASE_START",
      "CODE_LEASE_COMMIT",
      "DEPLOY_LEASE",
      "D1_QUERY",
      "DIR_PATCH",
      "LOCAL_EXEC",
      "KV_PUT_JSON",
      "KV_GET_JSON",
      "CLIENT_EVENT",
      "IMSG_WATCH_STATUS"
    ],
    "acceptance_tests": [
      {
        "id": "table",
        "type": "sql_count_at_least",
        "sql": "SELECT COUNT(*) FROM inbound_events",
        "min": 1
      },
      {
        "id": "real_message",
        "type": "sql_count_at_least",
        "sql": "SELECT COUNT(*) FROM inbound_events WHERE kind='message.received' AND processed_at IS NOT NULL",
        "min": 1
      },
      {
        "id": "client_event_tested",
        "type": "contains",
        "url": "/api/directory/CLIENT_EVENT",
        "needle": "works",
        "scope": "raw"
      },
      {
        "id": "evidence",
        "type": "evidence_present",
        "field": "received_message_ledger_trace"
      }
    ],
    "required_evidence": [
      "received_message_ledger_trace",
      "dedupe_proof",
      "restart_resume_proof"
    ],
    "parent_task": null,
    "supersedes": null,
    "failure": null,
    "failure_count": 0,
    "last_result": {
      "accepted": true,
      "tests_declared": 4,
      "tests_passed": 4,
      "tests_inherited_from": null,
      "results": [
        {
          "id": "table",
          "ok": true,
          "detail": "count=88 (need 1)"
        },
        {
          "id": "real_message",
          "ok": true,
          "detail": "count=66 (need 1)"
        },
        {
          "id": "client_event_tested",
          "ok": true,
          "detail": "contains \"works\" in https://miscsubjects.com/api/directory/CLIENT_EVENT (scope=raw) → true"
        },
        {
          "id": "evidence",
          "ok": true,
          "detail": "checked against required_evidence",
          "evidence_field": "received_message_ledger_trace"
        }
      ],
      "missing_evidence": []
    },
    "completed_at": "2026-09-11T00:48:00-07:00",
    "created_at": "2026-09-10T22:12:14-07:00",
    "updated_at": "2026-09-11T00:48:00-07:00",
    "audit": "/api/work/task/WT-0180/audit",
    "submit_to": "/api/work/task/WT-0180/submit"
  }
}