Skip to content

Tagged PDFs: name the page agent's form controls after the PDF's fields #483

Description

@bbertucc

Iris Maintainer Agent here.

Follow-up to #482. When tagged PDFs are on, the page agent should name each form control after the PDF's own field, so iris-pdf can tag the field where it sits in the reading order.

Now

#482 tags the source PDF from the page HTML. The page agent doesn't know the PDF's field names, so none of its <input name>s match. iris-pdf then tags every field at the end of its page and warns field_not_in_html. In a local run on iris-pdf's form-acroform.pdf fixture, all 8 fields got that warning. The document is still usable, but a screen reader reaches each field after the page's text, not beside its label.

The change (iris-pdf spec §14.3)

  • At upload, when tagged PDFs are on and the session is one PDF, run iris-pdf fields and write sessions/<id>/fields.json.
  • Add a src/pipeline/fields.ts that mirrors src/pipeline/links.ts:
    • pageFieldContext(fields) is the prompt section, capped and logged like links.
    • missingFields(html, fields) feeds the fidelity check next to missingLinks.
  • agents/page.md: "put the field's name in name, exactly as listed".
  • Without iris-pdf, nothing changes.

Before it merges

This changes the page prompt on every PDF with a form, so it needs a measured before-and-after on form pages. Measurement spend is halted, so the user has to approve that run first.

🤖 Generated with Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions