{
  "$comment": "webGCP conformance fixture WGCP-L0-002 (out-of-scope companion to L0-001) per spec §9 + §6.7 — https://webgcp.org/spec/v0.1/. Authored 2026-05-16, runnable against the live endpoint.",
  "fixture_id": "WGCP-L0-002",
  "fixture_name": "Out-of-scope query returns typed out_of_scope failure (not synthesized answer)",
  "verifies": [
    "§5.4 applicability — non-AI query should NOT return an answer; MUST return out_of_scope per §6.7",
    "§6.7 typed failures — status MUST be 'out_of_scope', not free-form error",
    "§5.11 forbidden — MUST NOT 'combine fields across KBs whose applicability frames conflict'",
    "§5.11 forbidden — MUST NOT emit free-form errors"
  ],
  "preconditions": {
    "server_descriptor_reachable": "https://the-ai-news.web.app/.well-known/webgcp",
    "manifest_reachable": "https://the-ai-news.web.app/webgcp/manifests/news-kb-v0.1.json",
    "query_endpoint_reachable_with_200": "https://the-ai-news.web.app/webgcp/v0/query"
  },
  "given": {
    "method": "POST",
    "url": "https://the-ai-news.web.app/webgcp/v0/query",
    "headers": {
      "Content-Type": "application/json",
      "Idempotency-Key": "WGCP-L0-002-fixture-key"
    },
    "request_body": {
      "intent": "Find recent NFL playoff scores",
      "bundle": {
        "contract_uri": "urn:webgcp:the-ai-news.web.app:news-article-retrieval/v0.1"
      },
      "filter": {
        "query": "NFL playoff scores",
        "max_results": 5
      },
      "invoker": {
        "subject": "agent:fixture-runner",
        "auth_assertion": null
      },
      "scope": {
        "allow_kbs": ["urn:webgcp:the-ai-news.web.app:*"]
      },
      "trace": {
        "trace_id": "WGCP-L0-002-fixture-trace"
      }
    }
  },
  "expected_response_shape": {
    "status": "out_of_scope",
    "message": "ANY_NON_EMPTY_STRING explaining why this query is outside the manifest's applicability frame",
    "out_of_scope_reason": "non_ai_topic OR equivalent typed reason code",
    "spec_ref": "https://webgcp.org/spec/v0.1/#section-6-7"
  },
  "assertions": [
    {
      "id": "A01",
      "assert": "response.status == 'out_of_scope'",
      "verifies": "§6.7 typed failure"
    },
    {
      "id": "A02",
      "assert": "response.message is a non-empty string",
      "verifies": "§6.7 informative failure"
    },
    {
      "id": "A03",
      "assert": "response.out_of_scope_reason is a non-empty string (typed reason code, not free-form)",
      "verifies": "§5.11 — no free-form errors"
    },
    {
      "id": "A04",
      "assert": "HTTP status code is 200 (typed failures with status=out_of_scope ride on 200 per spec §6.7 table)",
      "verifies": "§6.7"
    }
  ],
  "negative_assertions": [
    {
      "id": "N01",
      "assert_not": "response.status == 'ok' or response contains a bundle.articles value",
      "verifies": "§5.4 — MUST NOT 'synthesize an answer from related-but-inapplicable KBs'"
    },
    {
      "id": "N02",
      "assert_not": "response contains 'errorMessage' or other non-typed-failure error fields",
      "verifies": "§5.11 + §6.7 — typed failures only"
    },
    {
      "id": "N03",
      "assert_not": "response.bundle is present (no partial bundle on out_of_scope)",
      "verifies": "§6.7 — typed failure, not partial response"
    }
  ],
  "live_verification_2026_05_16": {
    "tested_at": "2026-05-16T16:53Z",
    "result": "PASS — all 4 positive + 3 negative assertions verified against live endpoint",
    "response_received": {
      "status": "out_of_scope",
      "message": "query 'NFL playoff scores' is outside this KB's applicability frame. This KB covers AI / ML / robotics / AI-industry news only (see manifest applicability.out_of_scope_when).",
      "out_of_scope_reason": "non_ai_topic"
    }
  },
  "companion_fixtures": {
    "happy_path": "WGCP-L0-001 — in-scope query returns typed bundle with provenance",
    "dns_layer_discovery": "WGCP-L0-003 — DNS-layer SVCB discovery at _webgcp.<host> per spec §5.1.1 (fails by design at this hostname — restricted-domain caveat)",
    "missing_input": "WGCP-L0-004 (to author) — empty query body returns status='needs_input'",
    "manifest_mismatch": "WGCP-L0-005 (to author) — wrong contract_uri returns status='manifest_mismatch'",
    "acl_denied": "WGCP-L0-006 (to author) — scope.allow_kbs excluding this KB returns status='acl_denied'"
  },
  "spec_pin": {
    "spec_url": "https://webgcp.org/spec/v0.1/",
    "spec_version": "0.1.0-draft.2026-05-16"
  }
}
