Task Answer

org.webgcp/task-answer — webGCP extension, version 0.1 (draft)

1. Purpose

A host implementing this extension accepts one task in a webGCP §6.4-shaped envelope and returns exactly one of three typed outcomes:

Behind the door the host runs an escalator: an evaluation call picks the cheapest plausible starting rung, and structured insufficiency codes from each rung drive append-only escalation. That machinery is deliberately not part of this contract — only the outcome shapes, the provenance rules, and the discovery surface are normative.

2. Discovery

A host declares the extension in its /.well-known/webgcp descriptor and advertises the endpoint and the bundle contract:

{
  "endpoints":  { "answer": "https://<host>/webgcp/v0/answer", ... },
  "bundle_contracts_available": [
    { "contract_uri": "urn:webgcp:<host>:task-answer/v0.1",
      "url": "https://<host>/webgcp/bundles/task-answer-v0.1.json" } ],
  "extensions": {
    "org.webgcp/task-answer": {
      "version": "0.1",
      "spec": "https://webgcp.org/extensions/task-answer/v0.1-draft/" } }
}

3. Request

POST /webgcp/v0/answer
{
  "filter": { "query": "<the task text>" },          // required
  "budget": { "max_tokens": 150000, "budget_usd": 1.0 }, // optional, clamped by the host
  "bundle": { "contract_uri": "urn:webgcp:<host>:task-answer/v0.1" }  // optional pin
}

A pinned contract_uri the host does not serve returns the §6.7 manifest_mismatch typed failure. A missing or empty filter.query returns invalid_request (HTTP 400) — never kb_unavailable.

4. Outcomes

HTTPstatusdispositionmeaning
200okansweredbundle.task_answer.value.answer holds the answer; value.answered_at_rung names the tier that produced it
200okdirectivevalue.directive holds the committed path (an estimate-then-spawn wire, a deliberation referral, or a verifier-seat referral); value.exhausted is true when the ladder ran out without an answer
200needs_inputclarify holds exactly ONE question; answer it and re-submit
200manifest_mismatch / out_of_scope§6.7 typed failures
400invalid_requestmalformed envelope (caller's fault, typed)
503kb_unavailablebackend fault OR a governance refusal upstream (e.g. the host's daily metered spend quota) — typed, never silent

Free-form error / errorMessage fields never appear; the typed union above is the whole failure surface.

5. Provenance

Every task_answer bundle carries _meta with:

6. Security posture

7. Known limitations and deferred work