{
  "_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-0373",
    "kind": "work",
    "objective": "Pin the tool-result shape with a test: the model gets the answer, not the envelope",
    "detail": "GOAL\nLock in the behaviour that stopped models drowning in wrapper text, so nobody undoes it by accident.\n\nBACKGROUND\nfunctions/api/console/talk.js has a function resultText(out, shape). The build's capability door\nanswers with seventeen fields wrapped around the answer (_self, plan, forms, next, trace, status,\nresult…). resultText must hand the model the ANSWER only, unless shape === 'full'.\n\nWHAT TO ADD\nOne new test file: functions/_lib/tool_result_shape.test.mjs\n\nUse node:test and node:assert/strict. Do not import talk.js (it is a Cloudflare route and pulls in\nbindings). Instead read the file as text, cut out the resultText function and evaluate it, the same\nway you would test a pure function — or copy it verbatim into the test with a comment saying it is\ncopied and must stay identical.\n\nThe test must cover:\n1. An envelope { _self: {...}, plan: {}, forms: {}, status: 200, ran: true, result: '[{\"x\":1}]' }\n   with shape 'answer' returns exactly '[{\"x\":1}]'.\n2. The same envelope with shape 'full' returns a string containing '_self'.\n3. A failed envelope { _self:{}, status: 500, error: 'no such table', result: '' } returns JSON\n   that contains the error text.\n4. A plain string is returned unchanged.\n5. null returns an empty string.\n\nHOW TO CHECK IT BEFORE YOU FINISH\n  node --test --test-reporter=spec functions/_lib/tool_result_shape.test.mjs\nIt must pass and the reporter must print the test names.\n\nDO NOT\n- Do not change talk.js.\n- Do not touch any other file.\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:25-07:00",
    "updated_at": "2026-09-19T19:11:25-07:00",
    "audit": "/api/work/task/WT-0373/audit",
    "submit_to": "/api/work/task/WT-0373/submit"
  }
}