Skip to content

fix: import Union in main.py and correct pytest directory in Makefile#407

Open
Dotify71 wants to merge 2 commits intofireform-core:mainfrom
Dotify71:fix/startup-and-tests
Open

fix: import Union in main.py and correct pytest directory in Makefile#407
Dotify71 wants to merge 2 commits intofireform-core:mainfrom
Dotify71:fix/startup-and-tests

Conversation

@Dotify71
Copy link
Copy Markdown

@Dotify71 Dotify71 commented Mar 31, 2026

This PR fixes two priority issues:

Advanced PDF Form Mapping (src/filler.py)

  • Previously, filler.py indiscriminately assigned the LLM string output to the Value (/V) property of all Widget types. This breaks when a PDF contains checkboxes or radio buttons (Field Type /Btn).
  • Implementation: Added conditional logic inside the loop passing through sorted_annots:
    • Detects if an annotation is a Button (/Btn).
    • Checks the generated LLM response for truthy values (yes, true, 1, x).
    • Dynamically extracts the correct internal ON state identifier directly from the PDF Appearance Dictionary (annot.AP.N).
    • Assigns both the Value (/V) and Appearance State (/AS) to accurately check the box on the final PDF layout, while assigning /Off when falsy.

Additional Notes for Mentors

While I'm incredibly sad that a time zone miscalculation caused me to miss the official GSoC portal deadline earlier tonight, I remain deeply passionate about FireForm. I wanted to execute this core feature from my proposal anyway to prove its viability and test my own skills. I plan to continue contributing to this repository as an active community member going forward!

Dushyant Acharya added 2 commits March 31, 2026 23:51
Implemented PDF /Btn dictionary parsing in filler.py to extract and dynamically map truthy LLM outputs to their specific 'ON' Appearance Mode instead of blindly appending strings. Also resolved broken backend pipeline in main.py by initializing the base Controller instead of the removed Fill class.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: make test runs src/test/ instead of tests/ — silently skips the real test suite [BUG]: 'Union' not defined in main.py

1 participant