[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7BQV39ZZM235VP1PEXWZRGG":3,"skill-same:01M7BQV39ZZM235VP1PEXWZRGG":45},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":6,"ownerHtmlUrl":29,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":30,"install":31,"resources":44},"01M7BQV39ZZM235VP1PEXWZRGG","academic-pdf-redaction",null,"Redact text from PDF documents for blind review anonymization","linyouxue\u002Fskill-repair-benchmark","linyouxue","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F216151464?v=4","01M7BJEVCXKD74KH6FG9CBVSQB","林宥学","01M7BJEVE02NP217V93BKZFC0J",0,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fpaper-anonymizer\u002Fskills\u002Facademic-pdf-redaction\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: academic-pdf-redaction\ndescription: Redact text from PDF documents for blind review anonymization\n---\n\n# PDF Redaction for Blind Review\n\nRedact identifying information from academic papers for blind review.\n\n## CRITICAL RULES\n\n1. **PRESERVE cited reference entries** - Self-citations MUST remain intact, but a page that contains References may still have current-manuscript headers, footers, or venue boilerplate that must be redacted\n2. **ONLY redact exact candidate glyphs** - Never redact entire pages, regions, lines, or extractor spans unless every glyph inside that rectangle is explicitly authorized for removal\n3. **VERIFY every removal** - A retained-character percentage is diagnostic only; delivery requires a fail-closed pre\u002Fpost diff proving that no non-whitespace text outside approved redaction rectangles disappeared\n4. **NEVER SHRINK THE CANDIDATE LEDGER** - Build one immutable, all-page ledger from the original PDF before applying any redaction. Every retry or regenerated output must reuse every ledger item; it may refine a bounding box or change a classification only with a recorded reason, but it must never replace the ledger with a document-, page-, section-, or pattern-specific subset\n\n## Mandatory candidate ledger and region-level redaction gate\n\nBefore applying any redaction, divide the manuscript into these evidence zones:\n\n1. document metadata;\n2. title\u002Ffront matter, author footnotes, running headers, and running footers;\n3. acknowledgements, funding statements, and venue\u002Fproceedings boilerplate;\n4. main scientific content;\n5. individual cited-reference entries.\n\n### Required all-page discovery pass\n\nDo not begin redaction after inspecting only metadata, the first page, or identifier regexes. First extract text with page numbers and coordinates from every page and print a compact page-by-page coverage table. For every page, explicitly account for each mandatory class: (a) person names; (b) institutional affiliations and locations; (c) contact and correspondence details; (d) authorship or contribution disclosures; (e) acknowledgement and funding text; and (f) venue, preprint, DOI, URL, and other current-manuscript identifiers. Each page\u002Fcategory cell must contain ledger item IDs or the explicit status `none-after-inspection`; a missing cell is `unresolved` and blocks redaction and delivery.\n\nCandidate sources are a union, never alternative fallbacks: document metadata, title\u002Ffront matter, author\u002Fcorrespondence\u002Fcontribution footnotes, acknowledgement and funding sections, recurring headers and footers, and all-page pattern scans must all run whether metadata is present or absent. Locate acknowledgement, funding, author-contribution, and related section ranges from their headings through the next peer-level heading, then inspect every person and organization phrase inside them. Inspect title-page bottom footnotes even when they fall outside the normal front-matter vertical band. Contribution disclosures such as \"equal contribution\", \"contributed equally\", or equivalent wording are candidates in their own right even after the associated author names have been removed.\n\nKeep the pre-redaction ledger immutable across debugging retries. A retry made to fix one rectangle must start from the full original ledger and assert that all original ledger IDs are still present before overwriting an output. Never rebuild one paper from a shortened detector list merely because another candidate class already passed an earlier check.\n\nScan metadata and every page for candidate identifying evidence, including proper names, affiliations, contact details, grants, venue\u002Fproceedings marks, arXiv identifiers, DOI values, and URLs. Record **every discovered candidate** in a ledger with at least:\n\n- literal occurrence text and, optionally, its normalized value;\n- evidence category;\n- page and an exact candidate-only bounding box;\n- ownership: `current-manuscript`, `cited-work`, or `unresolved`;\n- action: `redact` or `preserve`;\n- post-redaction verification result.\n\nReference protection is semantic and region-level, not page-level. Preserve author names and identifiers that belong to cited-reference entries. On the first References page, content above the References heading is outside the protected entry region; on every References page, running headers, footers, margins, and venue or publisher boilerplate are also outside it. Do not skip an entire page merely because a References heading appears on it: current-manuscript running headers, footers, copyright lines, venue boilerplate, arXiv identifiers, DOI values, or URLs outside the cited-entry region must still be classified and, when identifying, redacted on every occurrence. Treat separate occurrences of the same normalized value as separate ledger rows because they may have different ownership and actions. If ownership is uncertain, inspect the surrounding line, page geometry, repeated placement, and nearby section heading; do not silently drop the candidate.\n\nThe cited-reference region begins at the actual References\u002FBibliography heading and continues across following pages until either the document ends or an unmistakable new top-level non-reference section begins. A continuation page remains part of the cited-reference region even when it does not repeat the heading. Bibliographies may be numbered, author-year, paragraph-style, or mixed. **Never infer that References ended from citation-number syntax, line density, a low-density streak, column changes, or page layout.** When no explicit next top-level section exists, keep subsequent body-area text protected as reference-entry content while still classifying repeated headers, footers, margins, and boilerplate independently.\n\nEach ledger rectangle must tightly enclose only the literal candidate occurrence authorized for removal. PDF extractors often combine a target with innocent surrounding words in one span; the parent span or line rectangle is therefore not an acceptable redaction rectangle. Resolve an exact occurrence with `page.search_for(literal)`, character-level quads\u002Fboxes from `rawdict`, or an equivalently tight clipped rectangle. If an exact candidate-only rectangle cannot be established, leave the item unresolved and do not redact or finish.\n\nA pattern hit creates a candidate, not a redaction action. Do not infer ownership from identifier type or page number alone. When a regex matches only part of an extractor span, materialize the exact `match.group(0)` text and derive boxes for that literal from character boxes or occurrence-disambiguated exact search results. A global identifier deletion regex is not a valid plan because it can erase cited works, and using the containing span bbox for a substring match is also invalid. Likewise, scanning identifiers without reconciling every match into the ledger is incomplete.\n\nCompletion is blocked until all of the following checks pass:\n\n- every page\u002Fcategory cell in the coverage table is explicitly reconciled; metadata-only, first-page-only, or regex-only discovery is incomplete;\n- every regeneration contains the complete immutable pre-redaction ledger; no candidate ID or mandatory category was dropped while debugging another item;\n- the discovered-candidate set equals the classified-candidate set and no item remains `unresolved`;\n- every `redact` ledger item is absent at all recorded occurrences in the output;\n- every `preserve` ledger item remains present in its cited-reference entry;\n- for every page, a pre\u002Fpost word-token diff finds no removed token outside the exact authorized `redact` rectangles;\n- the output opens successfully and preserves the original page count.\n- an independent post-redaction leakage pass re-extracts every output page and repeats all mandatory category scans, rather than checking only literals already present in the ledger; every remaining hit is classified, and any unchecked category or remaining current-manuscript candidate blocks delivery.\n\nPrint or otherwise inspect the final ledger reconciliation before delivery. If any candidate is missing a decision or any check fails, revise the ledger or redaction rectangles and regenerate the PDF.\n\n## Common Pitfalls to AVOID\n\n```python\n# ❌ WRONG - This removes ALL text from the page:\nfor block in page.get_text(\"blocks\"):\n    page.add_redact_annot(fitz.Rect(block[:4]))\n\n# ❌ WRONG - Drawing rectangles over text:\npage.draw_rect(fitz.Rect(0, 0, 600, 100), fill=(0,0,0))\n\n# ❌ WRONG - Guessing that unnumbered or low-density bibliography pages\n# are no longer part of References:\nif low_reference_density(page):\n    references_ended = True\n\n# ❌ WRONG - Redacting an extractor span that also contains innocent text:\npage.add_redact_annot(fitz.Rect(parent_span[\"bbox\"]))\n\n# ✅ CORRECT - Only redact specific search matches:\nfor rect in page.search_for(\"John Smith\"):\n    page.add_redact_annot(rect)\n```\n\n## Candidate Types to Inventory and Classify\n\nThis is not a blanket redaction list and is not limited by page number. Decide each occurrence using the ownership, surrounding context, and region rules above.\n\n**IMPORTANT: Use FULL names\u002Fphrases, not partial matches!**\n- ✅ \"John Smith\" (full name)\n- ❌ \"Smith\" (partial - would incorrectly match \"Smith et al.\" citations in References)\n\n1. **Author names** - FULL names only (e.g., \"John Smith\", not just \"Smith\")\n2. **Affiliations** - Universities, institutes, laboratories, departments, and companies (e.g., \"Example University\")\n3. **Email addresses** - Pattern: `*@*.edu`, `*@*.com`\n4. **Venue names** - Conference\u002Fworkshop names (e.g., \"ICML 2024\", \"ICML Workshop\")\n5. **Current-manuscript arXiv identifiers outside cited-reference entries** - Pattern: `arXiv:XXXX.XXXXX`\n6. **Current-manuscript DOIs outside cited-reference entries** - Pattern: `10.XXXX\u002F...`\n7. **Acknowledgement names** - Names in \"Acknowledgements\" section\n8. **Equal contribution footnotes** - e.g., \"Equal contribution\", \"* Equal contribution\"\n\n## PyMuPDF (fitz) - Recommended Approach\n\n```python\nimport fitz\nimport os\n\ndef redact_with_pymupdf(input_path: str, output_path: str, ledger: list[dict]):\n    \"\"\"Redact only ledger-approved occurrences using PyMuPDF.\"\"\"\n    doc = fitz.open(input_path)\n    original_len = sum(len(p.get_text()) for p in doc)\n\n    # Never skip a whole References page. The ledger must already distinguish\n    # cited-entry occurrences from current-manuscript headers\u002Ffooters.\n    for item in ledger:\n        if item[\"action\"] != \"redact\":\n            continue\n        if item.get(\"bbox_scope\") != \"exact-candidate\":\n            raise ValueError(\"Refusing a non-exact redaction rectangle\")\n        page = doc[item[\"page\"]]\n        rect = fitz.Rect(item[\"bbox\"])\n        page.add_redact_annot(rect, fill=(0, 0, 0))\n\n    for page in doc:\n        page.apply_redactions()\n\n    os.makedirs(os.path.dirname(output_path), exist_ok=True)\n    doc.save(output_path)\n    doc.close()\n\n    # MUST verify after saving\n    verify_redaction(input_path, output_path, ledger)\n```\n\n## REQUIRED: Verification Function\n\n**Always run this after ANY redaction to catch errors early:**\n\n```python\nfrom collections import Counter, defaultdict\nimport fitz\n\ndef _glyphs(page):\n    for block in page.get_text(\"rawdict\")[\"blocks\"]:\n        if block.get(\"type\") != 0:\n            continue\n        for line in block[\"lines\"]:\n            for span in line[\"spans\"]:\n                for char in span[\"chars\"]:\n                    rect = fitz.Rect(char[\"bbox\"])\n                    yield char[\"c\"], rect, fitz.Point(\n                        (rect.x0 + rect.x1) \u002F 2,\n                        (rect.y0 + rect.y1) \u002F 2,\n                    )\n\ndef _spatial_glyph_counter(page, excluded_rectangles=()):\n    glyphs = Counter()\n    for char, rect, center in _glyphs(page):\n        # PDF redaction engines may absorb adjacent whitespace without removing\n        # semantic content. Compare substantive glyphs; word-token checks cover\n        # textual preservation separately.\n        if char.isspace():\n            continue\n        if any(center in excluded for excluded in excluded_rectangles):\n            continue\n        key = (\n            char.casefold(),\n            round(rect.x0, 1), round(rect.y0, 1),\n            round(rect.x1, 1), round(rect.y1, 1),\n        )\n        glyphs[key] += 1\n    return glyphs\n\ndef verify_redaction(original_path, output_path, ledger):\n    \"\"\"Fail if any non-whitespace glyph outside approved rectangles disappeared.\"\"\"\n    orig = fitz.open(original_path)\n    redc = fitz.open(output_path)\n\n    if len(redc) != len(orig):\n        raise ValueError(f\"Page count changed: {len(orig)} -> {len(redc)}\")\n\n    approved = defaultdict(list)\n    for item in ledger:\n        if item[\"action\"] == \"redact\":\n            if item.get(\"bbox_scope\") != \"exact-candidate\":\n                raise ValueError(f\"Non-exact bbox in ledger: {item}\")\n            rect = fitz.Rect(item[\"bbox\"])\n            approved[item[\"page\"]].append(rect)\n            if redc[item[\"page\"]].get_textbox(rect).strip():\n                raise ValueError(f\"Approved occurrence still present: {item}\")\n        elif item[\"action\"] == \"preserve\":\n            if not redc[item[\"page\"]].search_for(item[\"literal\"]):\n                raise ValueError(f\"Protected occurrence disappeared: {item}\")\n        else:\n            raise ValueError(f\"Unresolved ledger action: {item}\")\n        item[\"post_redaction_verification\"] = \"passed\"\n\n    for page_index in range(len(orig)):\n        protected_original = _spatial_glyph_counter(\n            orig[page_index], approved[page_index]\n        )\n        output_glyphs = _spatial_glyph_counter(redc[page_index])\n        missing = protected_original - output_glyphs\n        if missing:\n            raise ValueError(\n                f\"Page {page_index + 1} has unauthorized removals: \"\n                f\"{list(missing.elements())[:20]}\"\n            )\n\n    orig.close()\n    redc.close()\n    print(\"✓ Verification passed: every removed word was ledger-authorized\")\n```\n","# PDF Redaction for Blind Review\n\nRedact identifying information from academic papers for blind review.\n\n## CRITICAL RULES\n\n1. **PRESERVE cited reference entries** - Self-citations MUST remain intact, but a page that contains References may still have current-manuscript headers, footers, or venue boilerplate that must be redacted\n2. **ONLY redact exact candidate glyphs** - Never redact entire pages, regions, lines, or extractor spans unless every glyph inside that rectangle is explicitly authorized for removal\n3. **VERIFY every removal** - A retained-character percentage is diagnostic only; delivery requires a fail-closed pre\u002Fpost diff proving that no non-whitespace text outside approved redaction rectangles disappeared\n4. **NEVER SHRINK THE CANDIDATE LEDGER** - Build one immutable, all-page ledger from the original PDF before applying any redaction. Every retry or regenerated output must reuse every ledger item; it may refine a bounding box or change a classification only with a recorded reason, but it must never replace the ledger with a document-, page-, section-, or pattern-specific subset\n\n## Mandatory candidate ledger and region-level redaction gate\n\nBefore applying any redaction, divide the manuscript into these evidence zones:\n\n1. document metadata;\n2. title\u002Ffront matter, author footnotes, running headers, and running footers;\n3. acknowledgements, funding statements, and venue\u002Fproceedings boilerplate;\n4. main scientific content;\n5. individual cited-reference entries.\n\n### Required all-page discovery pass\n\nDo not begin redaction after inspecting only metadata, the first page, or identifier regexes. First extract text with page numbers and coordinates from every page and print a compact page-by-page coverage table. For every page, explicitly account for each mandatory class: (a) person names; (b) institutional affiliations and locations; (c) contact and correspondence details; (d) authorship or contribution disclosures; (e) acknowledgement and funding text; and (f) venue, preprint, DOI, URL, and other current-manuscript identifiers. Each page\u002Fcategory cell must contain ledger item IDs or the explicit status `none-after-inspection`; a missing cell is `unresolved` and blocks redaction and delivery.\n\nCandidate sources are a union, never alternative fallbacks: document metadata, title\u002Ffront matter, author\u002Fcorrespondence\u002Fcontribution footnotes, acknowledgement and funding sections, recurring headers and footers, and all-page pattern scans must all run whether metadata is present or absent. Locate acknowledgement, funding, author-contribution, and related section ranges from their headings through the next peer-level heading, then inspect every person and organization phrase inside them. Inspect title-page bottom footnotes even when they fall outside the normal front-matter vertical band. Contribution disclosures such as \"equal contribution\", \"contributed equally\", or equivalent wording are candidates in their own right even after the associated author names have been removed.\n\nKeep the pre-redaction ledger immutable across debugging retries. A retry made to fix one rectangle must start from the full original ledger and assert that all original ledger IDs are still present before overwriting an output. Never rebuild one paper from a shortened detector list merely because another candidate class already passed an earlier check.\n\nScan metadata and every page for candidate identifying evidence, including proper names, affiliations, contact details, grants, venue\u002Fproceedings marks, arXiv identifiers, DOI values, and URLs. Record **every discovered candidate** in a ledger with at least:\n\n- literal occurrence text and, optionally, its normalized value;\n- evidence category;\n- page and an exact candidate-only bounding box;\n- ownership: `current-manuscript`, `cited-work`, or `unresolved`;\n- action: `redact` or `preserve`;\n- post-redaction verification result.\n\nReference protection is semantic and region-level, not page-level. Preserve author names and identifiers that belong to cited-reference entries. On the first References page, content above the References heading is outside the protected entry region; on every References page, running headers, footers, margins, and venue or publisher boilerplate are also outside it. Do not skip an entire page merely because a References heading appears on it: current-manuscript running headers, footers, copyright lines, venue boilerplate, arXiv identifiers, DOI values, or URLs outside the cited-entry region must still be classified and, when identifying, redacted on every occurrence. Treat separate occurrences of the same normalized value as separate ledger rows because they may have different ownership and actions. If ownership is uncertain, inspect the surrounding line, page geometry, repeated placement, and nearby section heading; do not silently drop the candidate.\n\nThe cited-reference region begins at the actual References\u002FBibliography heading and continues across following pages until either the document ends or an unmistakable new top-level non-reference section begins. A continuation page remains part of the cited-reference region even when it does not repeat the heading. Bibliographies may be numbered, author-year, paragraph-style, or mixed. **Never infer that References ended from citation-number syntax, line density, a low-density streak, column changes, or page layout.** When no explicit next top-level section exists, keep subsequent body-area text protected as reference-entry content while still classifying repeated headers, footers, margins, and boilerplate independently.\n\nEach ledger rectangle must tightly enclose only the literal candidate occurrence authorized for removal. PDF extractors often combine a target with innocent surrounding words in one span; the parent span or line rectangle is therefore not an acceptable redaction rectangle. Resolve an exact occurrence with `page.search_for(literal)`, character-level quads\u002Fboxes from `rawdict`, or an equivalently tight clipped rectangle. If an exact candidate-only rectangle cannot be established, leave the item unresolved and do not redact or finish.\n\nA pattern hit creates a candidate, not a redaction action. Do not infer ownership from identifier type or page number alone. When a regex matches only part of an extractor span, materialize the exact `match.group(0)` text and derive boxes for that literal from character boxes or occurrence-disambiguated exact search results. A global identifier deletion regex is not a valid plan because it can erase cited works, and using the containing span bbox for a substring match is also invalid. Likewise, scanning identifiers without reconciling every match into the ledger is incomplete.\n\nCompletion is blocked until all of the following checks pass:\n\n- every page\u002Fcategory cell in the coverage table is explicitly reconciled; metadata-only, first-page-only, or regex-only discovery is incomplete;\n- every regeneration contains the complete immutable pre-redaction ledger; no candidate ID or mandatory category was dropped while debugging another item;\n- the discovered-candidate set equals the classified-candidate set and no item remains `unresolved`;\n- every `redact` ledger item is absent at all recorded occurrences in the output;\n- every `preserve` ledger item remains present in its cited-reference entry;\n- for every page, a pre\u002Fpost word-token diff finds no removed token outside the exact authorized `redact` rectangles;\n- the output opens successfully and preserves the original page count.\n- an independent post-redaction leakage pass re-extracts every output page and repeats all mandatory category scans, rather than checking only literals already present in the ledger; every remaining hit is classified, and any unchecked category or remaining current-manuscript candidate blocks delivery.\n\nPrint or otherwise inspect the final ledger reconciliation before delivery. If any candidate is missing a decision or any check fails, revise the ledger or redaction rectangles and regenerate the PDF.\n\n## Common Pitfalls to AVOID\n\n```python\n# ❌ WRONG - This removes ALL text from the page:\nfor block in page.get_text(\"blocks\"):\n    page.add_redact_annot(fitz.Rect(block[:4]))\n\n# ❌ WRONG - Drawing rectangles over text:\npage.draw_rect(fitz.Rect(0, 0, 600, 100), fill=(0,0,0))\n\n# ❌ WRONG - Guessing that unnumbered or low-density bibliography pages\n# are no longer part of References:\nif low_reference_density(page):\n    references_ended = True\n\n# ❌ WRONG - Redacting an extractor span that also contains innocent text:\npage.add_redact_annot(fitz.Rect(parent_span[\"bbox\"]))\n\n# ✅ CORRECT - Only redact specific search matches:\nfor rect in page.search_for(\"John Smith\"):\n    page.add_redact_annot(rect)\n```\n\n## Candidate Types to Inventory and Classify\n\nThis is not a blanket redaction list and is not limited by page number. Decide each occurrence using the ownership, surrounding context, and region rules above.\n\n**IMPORTANT: Use FULL names\u002Fphrases, not partial matches!**\n- ✅ \"John Smith\" (full name)\n- ❌ \"Smith\" (partial - would incorrectly match \"Smith et al.\" citations in References)\n\n1. **Author names** - FULL names only (e.g., \"John Smith\", not just \"Smith\")\n2. **Affiliations** - Universities, institutes, laboratories, departments, and companies (e.g., \"Example University\")\n3. **Email addresses** - Pattern: `*@*.edu`, `*@*.com`\n4. **Venue names** - Conference\u002Fworkshop names (e.g., \"ICML 2024\", \"ICML Workshop\")\n5. **Current-manuscript arXiv identifiers outside cited-reference entries** - Pattern: `arXiv:XXXX.XXXXX`\n6. **Current-manuscript DOIs outside cited-reference entries** - Pattern: `10.XXXX\u002F...`\n7. **Acknowledgement names** - Names in \"Acknowledgements\" section\n8. **Equal contribution footnotes** - e.g., \"Equal contribution\", \"* Equal contribution\"\n\n## PyMuPDF (fitz) - Recommended Approach\n\n```python\nimport fitz\nimport os\n\ndef redact_with_pymupdf(input_path: str, output_path: str, ledger: list[dict]):\n    \"\"\"Redact only ledger-approved occurrences using PyMuPDF.\"\"\"\n    doc = fitz.open(input_path)\n    original_len = sum(len(p.get_text()) for p in doc)\n\n    # Never skip a whole References page. The ledger must already distinguish\n    # cited-entry occurrences from current-manuscript headers\u002Ffooters.\n    for item in ledger:\n        if item[\"action\"] != \"redact\":\n            continue\n        if item.get(\"bbox_scope\") != \"exact-candidate\":\n            raise ValueError(\"Refusing a non-exact redaction rectangle\")\n        page = doc[item[\"page\"]]\n        rect = fitz.Rect(item[\"bbox\"])\n        page.add_redact_annot(rect, fill=(0, 0, 0))\n\n    for page in doc:\n        page.apply_redactions()\n\n    os.makedirs(os.path.dirname(output_path), exist_ok=True)\n    doc.save(output_path)\n    doc.close()\n\n    # MUST verify after saving\n    verify_redaction(input_path, output_path, ledger)\n```\n\n## REQUIRED: Verification Function\n\n**Always run this after ANY redaction to catch errors early:**\n\n```python\nfrom collections import Counter, defaultdict\nimport fitz\n\ndef _glyphs(page):\n    for block in page.get_text(\"rawdict\")[\"blocks\"]:\n        if block.get(\"type\") != 0:\n            continue\n        for line in block[\"lines\"]:\n            for span in line[\"spans\"]:\n                for char in span[\"chars\"]:\n                    rect = fitz.Rect(char[\"bbox\"])\n                    yield char[\"c\"], rect, fitz.Point(\n                        (rect.x0 + rect.x1) \u002F 2,\n                        (rect.y0 + rect.y1) \u002F 2,\n                    )\n\ndef _spatial_glyph_counter(page, excluded_rectangles=()):\n    glyphs = Counter()\n    for char, rect, center in _glyphs(page):\n        # PDF redaction engines may absorb adjacent whitespace without removing\n        # semantic content. Compare substantive glyphs; word-token checks cover\n        # textual preservation separately.\n        if char.isspace():\n            continue\n        if any(center in excluded for excluded in excluded_rectangles):\n            continue\n        key = (\n            char.casefold(),\n            round(rect.x0, 1), round(rect.y0, 1),\n            round(rect.x1, 1), round(rect.y1, 1),\n        )\n        glyphs[key] += 1\n    return glyphs\n\ndef verify_redaction(original_path, output_path, ledger):\n    \"\"\"Fail if any non-whitespace glyph outside approved rectangles disappeared.\"\"\"\n    orig = fitz.open(original_path)\n    redc = fitz.open(output_path)\n\n    if len(redc) != len(orig):\n        raise ValueError(f\"Page count changed: {len(orig)} -> {len(redc)}\")\n\n    approved = defaultdict(list)\n    for item in ledger:\n        if item[\"action\"] == \"redact\":\n            if item.get(\"bbox_scope\") != \"exact-candidate\":\n                raise ValueError(f\"Non-exact bbox in ledger: {item}\")\n            rect = fitz.Rect(item[\"bbox\"])\n            approved[item[\"page\"]].append(rect)\n            if redc[item[\"page\"]].get_textbox(rect).strip():\n                raise ValueError(f\"Approved occurrence still present: {item}\")\n        elif item[\"action\"] == \"preserve\":\n            if not redc[item[\"page\"]].search_for(item[\"literal\"]):\n                raise ValueError(f\"Protected occurrence disappeared: {item}\")\n        else:\n            raise ValueError(f\"Unresolved ledger action: {item}\")\n        item[\"post_redaction_verification\"] = \"passed\"\n\n    for page_index in range(len(orig)):\n        protected_original = _spatial_glyph_counter(\n            orig[page_index], approved[page_index]\n        )\n        output_glyphs = _spatial_glyph_counter(redc[page_index])\n        missing = protected_original - output_glyphs\n        if missing:\n            raise ValueError(\n                f\"Page {page_index + 1} has unauthorized removals: \"\n                f\"{list(missing.elements())[:20]}\"\n            )\n\n    orig.close()\n    redc.close()\n    print(\"✓ Verification passed: every removed word was ledger-authorized\")\n```\n",{"name":5,"description":7},"main","cdcb6d230f3b15c3c33f8a2bdd16439f43602cbe","evaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fpaper-anonymizer\u002Fskills\u002Facademic-pdf-redaction",1,"https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark","https:\u002F\u002Fgithub.com\u002Flinyouxue","2026-11-14 20:28:35",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add linyouxue\u002Fskill-repair-benchmark --skill academic-pdf-redaction",{"tool":37,"command":38},"bunx","bunx skills add linyouxue\u002Fskill-repair-benchmark --skill academic-pdf-redaction",{"tool":40,"command":41},"pnpm","pnpm dlx skills add linyouxue\u002Fskill-repair-benchmark --skill academic-pdf-redaction","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fevaluation\u002Fdata\u002Fskillsbench87\u002Freferences\u002Fpaper-anonymizer\u002Fskills\u002Facademic-pdf-redaction\u002FSKILL.md",true,[],[46,53,60,67,72,77],{"skillNo":47,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":50,"categories":51,"keywords":52,"publishedAt":19},"01M7E1HGVRY73NBJ022CJG13X6","video-frame-extraction","Extract frames from video files and save them as images using OpenCV","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":54,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7E1HAG5R7CJ9C8NYJS771MB","openai-vision","Analyze images and multi-frame sequences using OpenAI GPT vision models","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7E1H7DADKB6QBWKC2KQ63SZ","image-ocr","Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_03\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[],{"skillNo":68,"name":48,"nameZh":6,"description":49,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7E1H0WBNT43TENGQY7AVZHD","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fvideo-frame-extraction\u002FSKILL.md",[],[],{"skillNo":73,"name":55,"nameZh":6,"description":56,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7E1GTC7D4N4Q2EF03875J9E","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fopenai-vision\u002FSKILL.md",[],[],{"skillNo":78,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7E1GQ92CWFMGH53KSSE4WER","https:\u002F\u002Fgithub.com\u002Flinyouxue\u002Fskill-repair-benchmark\u002Fblob\u002Fmain\u002Fjpg-ocr-stat\u002Fresult\u002Fskilltta-claude4.7\u002Fgroup_03\u002Frun_02\u002Finputs\u002Fskills\u002Fimage-ocr\u002FSKILL.md",[],[]]