Skip to content

feat(pdf-parser): add table correction toggle#106

Merged
kimhongyeon merged 6 commits into
mainfrom
feat/review-table-option
Jun 28, 2026
Merged

feat(pdf-parser): add table correction toggle#106
kimhongyeon merged 6 commits into
mainfrom
feat/review-table-option

Conversation

@kimhongyeon

Copy link
Copy Markdown
Member

Affected Package(s)

  • @heripo/pdf-parser
  • @heripo/document-processor
  • @heripo/model
  • @heripo/logger
  • @heripo/shared (internal)
  • demo-web
  • docs
  • Other (root configs, CI, etc.)

Summary

Add a dedicated tableCorrectionEnabled option so review assistance can run without generating table-correction work items. This keeps the existing parser behavior backward compatible while letting demo-web disable table correction by default for lighter demo runs.

Changes

  • Added tableCorrectionEnabled to PDFCorrectionOptions, NormalizedPDFCorrectionOptions, PDF_CORRECTION_DEFAULTS, and normalizePDFCorrectionOptions().
  • Passed tableCorrectionEnabled through PostDoclingCorrectionPipeline into ReviewAssistanceRunnerOptions.
  • Added ReviewAssistanceWorkSchedulerOptions.skipTableItems and used it to omit table work items while preserving text OCR, text integrity, footnote, picture, and layout tasks.
  • Added demo-web task schema and worker support for correction.tableCorrectionEnabled.
  • Set DEFAULT_FORM_VALUES.correction.tableCorrectionEnabled to false in demo-web.
  • Added tests for option normalization, pipeline forwarding, and scheduler table-item inclusion/skipping behavior.

Breaking Changes

  • None
  • If any, describe migration steps:

Checklist

  • I followed the Code of Conduct (see CODE_OF_CONDUCT.md)
  • I ran: pnpm lint pnpm typecheck pnpm build pnpm test
  • Tests added/updated; coverage remains 100%
  • Docs/README updated if needed
  • No external side effects (network/file/process/time) in tests — use mocks

Related Issues

Closes #

…ptions

Add tableCorrectionEnabled boolean option (default: true) that controls
whether table-correction work items are generated during review assistance.

- PDFCorrectionOptions: new optional tableCorrectionEnabled field
- NormalizedPDFCorrectionOptions: required tableCorrectionEnabled field
- PDF_CORRECTION_DEFAULTS: tableCorrectionEnabled defaults to true
- normalizePDFCorrectionOptions(): normalizes the new field

Backward compatible — existing callers without the option get true.
…nner

- ReviewAssistanceRunnerOptions: add tableCorrectionEnabled field
- PostDoclingCorrectionPipeline: pass tableCorrectionEnabled to runner
- ReviewAssistanceWorkScheduler.build(): accept skipTableItems option,
  skip table work items when set (called with !tableCorrectionEnabled)

Tests updated: makeOptions() default includes tableCorrectionEnabled: true,
pipeline test verifies false is forwarded, new test for explicit false.
- Zod schema: tableCorrectionEnabled defaults to true (UI option)
- task-worker.ts: passes tableCorrectionEnabled from options to PDF
  correction options, defaulting to true for backward compatibility
…leItems

- Verifies table work items are excluded when skipTableItems: true
- Verifies table work items are included when skipTableItems: false
- Verifies table work items are included by default (no options)
@kimhongyeon kimhongyeon self-assigned this Jun 28, 2026
@kimhongyeon kimhongyeon added the enhancement New feature or request label Jun 28, 2026
@kimhongyeon kimhongyeon merged commit e896a9a into main Jun 28, 2026
1 check passed
@kimhongyeon kimhongyeon deleted the feat/review-table-option branch June 28, 2026 05:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant