Repository navigation
feat(office/pdf_form_filler): deterministic multi-action AcroForm engine (#403) - #441
Merged
rosspeili merged 3 commits intoOct 16, 2026
Merged
Conversation
…ine (ARPAHLS#403) Refactor office/pdf_form_filler into a host-agnostic, deterministic AcroForm inspection, validation, and filling engine with multi-action dispatch (inspect, validate, fill). Key upgrades: - Remove hardcoded runtime Anthropic dependency and mandatory API key from BaseSkill initialization in favor of pure PyMuPDF AcroForm manipulation. - Implement dynamic XFA form detection guard (unsupported_xfa_form) to prevent corrupt mutations on LiveCycle forms. - Normalize radio button groups by grouping widgets sharing field_name, resolving on_state appearance dictionaries, and extracting spatial labels. - Enforce human confirmation safety gate requiring confirmed: true on fill before mutating files on disk, returning structured preview on needs_input. - Add optional vector page flattening (flatten: true via doc.bake()) to convert interactive widgets into immutable native vector/text graphics. - Provide backward-compatible shim for legacy one-shot prompt callers. - Sync catalog documentation, category hubs, pyproject extras, and CHANGELOG. Closes ARPAHLS#403
…sion to 0.1.2 (ARPAHLS#403) Align version to v0.1.2 as Slice 1 of RFC ARPAHLS#402 v0.2.0 epic. Provide stub anthropic module so test patches and empty forms succeed in CI environments lacking anthropic SDK packages.
…vendor test dependencies (ARPAHLS#403)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors
office/pdf_form_fillerfrom a single-prompt LLM wrapper into a host-agnostic, deterministic AcroForm engine powered solely by PyMuPDF (fitz), eliminating mandatory Anthropic runtime dependencies and API keys.Key Changes
inspect,validate, andfillactions for predictable workflows (skill.py).unsupported_xfa_formerror when non-AcroForm LiveCycle streams are detected (utils.py).field_name, resolves export values from appearance streams (/AP/N), and extracts spatial text labels (utils.py).confirmed: true; unconfirmed calls returnstatus: "needs_input"and a structured preview diff (skill.py).flatten: truebakes interactive widgets into permanent native graphics viadoc.bake()(utils.py).skill.py).Type of Change
skills/Checklist (all PRs)
Closes #403)python -m black --check .andflake8pass locally (0 warnings)pytest skills/(552 passed) andpytest tests/(571 passed) pass locally (1,123 tests total)CHANGELOG.mdupdated under[Unreleased] -> Changedscripts/sync_extras.py --checkpasses cleanlypytest tests/test_registry_docs.pyandpytest tests/test_card_ui_schema.pyNew or updated skill
Bundle and metadata
skills/office/pdf_form_filler/manifest.yaml: Bumped to0.2.0, action parameter schemas added, runtime deps reduced topymupdfrequirementsandpyproject.tomloptional extras synced viascripts/sync_extras.pyEffect, Directive, Assurance
skill.py(host-agnostic multi-action engine)instructions.mddocuments the 3-step deterministic protocol (inspect->validate->fill)card.jsonpresentation schema aligned with output keystest_skill.pyincludes 23 unit, simulation, and edge case testsSkillLoader.load_skill("office/pdf_form_filler")verified across loader import routesDocumentation and catalog
docs/skills/office/pdf_form_filler.mdupdated with v0.2.0 capabilities, usage snippet, and history entrydocs/skills/office/README.md) and root catalog (docs/skills/README.md) rows updateddocs/usage/install_extras.mdextras tables synced withpyproject.tomlConstitution and safety (skills only)
confirmed: true. Unconfirmed calls emitneeds_inputand never alter the file.unsupported_xfa_formto prevent corrupted outputs.flatten: truebakes interactive widgets into immutable native page graphics.Related Issues
Closes #403