////

[rosaic-knowledge-agent] RKA's Google Drive loader only ingested .txt (28 files), silently skipping ~793

RKA's Google Drive loader initially ingested only .txt files: 28 files entered the graph while roughly 793 important Drive files were silently skipped, including PDF, PPTX, DOCX, CSV, HWPX, HWP, and XLSX. The operational

////

Problem#

RKA's Google Drive loader initially ingested only .txt files: 28 files entered the graph while roughly 793 important Drive files were silently skipped, including PDF, PPTX, DOCX, CSV, HWPX, HWP, and XLSX. The operational failure was not a single parser bug but an ingest-coverage blind spot: unsupported extensions disappeared without becoming visible backlog or actionable extraction failures.

Durable Solution Pattern#

Use an explicit per-extension extractor registry and make unsupported or failed extraction observable.

Supported families from the original fix: - text: txt/md with Korean encoding fallback (utf-8-sig, utf-8, cp949, euc-kr) - tabular: csv/tsv/xlsx, with xlsx through openpyxl (read_only=True, data_only=True) and sheet labels - office: docx via python-docx, pptx via python-pptx - pdf: PyMuPDF/fitz text extraction - Korean office formats: HWP and HWPX must be handled separately

Per-file parse failures should be logged and skipped so one bad document does not abort the whole batch, but the skip/failure counts must be reviewed as ingest telemetry rather than ignored.

Updated HWP/HWPX Caution#

Do not treat HWP and HWPX as similar formats.

  • HWP (.hwp) is binary OLE compound and requires a HWP-aware path.
  • HWPX (.hwpx) is a ZIP package containing OWPML XML; text can be recovered from Contents/section*.xml <hp:t> elements with namespace-insensitive XML handling.

Important update from later RKA recovery work: the earlier in-memory pyhwp TextTransform().transform_hwp5_to_text(...) approach is no longer the recommended reliable path for RKA. Later live validation found the old HWP extraction path could fail with TypeError: string argument expected, got 'bytes' and be hidden by broad exception handling. The verified recovery path uses the hwp5txt CLI/subprocess with timeout, bounded output, and cleanup, plus honest extraction statuses.

Follow-up Operational Lessons#

  • Extension allowlists must be tested against real Drive inventories, not just unit fixtures.
  • Silent skipping should become metrics: unsupported, parse failed, empty/no embedded text, OCR required, oversize/resource limited, and success.
  • Oversize policy should be format-aware: media-heavy PPTX and large PDFs have different text-yield profiles.
  • Add ZIP-bomb and memory guards for ZIP-based formats such as DOCX/PPTX/XLSX/HWPX.
  • For Korean Google Drive names, normalize API-provided names/folder paths to NFC before token or substring matching, because Drive/macOS-origin Hangul can appear in NFD.
  • In a git worktree with a shared editable install, tests may still import the main tree. Run with PYTHONPATH=<worktree> so worktree edits shadow the editable install.
  • git branch -d checks merge state against current HEAD, not necessarily master; verify with git branch --contains <sha> before deleting.

Status#

Keep the original incident as a useful ingest-coverage playbook, but revise the HWP implementation detail and avoid claiming that all binary formats are fully solved by the initial registry alone. Later RKA notes supersede the HWP extraction mechanism and add binary-stub recovery, honest status reporting, and evidence-grounding guardrails.