Skip to content

PDF import: take the warnings a patched hayro-interpret adds - #1

Merged
ymote merged 1 commit into
mainfrom
fix/hayro-warning-variants
Oct 11, 2026
Merged

ymote merged 1 commit into
mainfrom
fix/hayro-warning-variants

Conversation

@ymote

@ymote ymote commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

OctoSense links VectorCraft beside PdfCraft. A consumer workspace doesn't get a dependency's [patch] sections, so OctoSense's own workspace patches in PdfCraft's hardened PDF stack: hayro, hayro-interpret, hayro-syntax, hayro-jbig2 and lopdf. That patch reaches every crate in the workspace, vectorcraft-pdf included.

Upstream PdfCraft's hayro-interpret now has a third InterpreterWarning, ContentTruncated: page content cut at its safety budget (storytold/pdfcraft#669, storytold/pdfcraft#797). vectorcraft-pdf's warning sink matched crates.io's two variants exhaustively, so it stopped compiling there (E0004) when OctoSense moved its pdfcraft pin to upstream main (OctoSense-org/OctoSense#502).

The change

crates/pdf/src/import.rs gets a wildcard arm. It reports any further warning as "part of a page's content could not be read and was skipped".

  • Against crates.io's hayro-interpret 0.7.0, which this workspace uses, the arm is unreachable.
  • #[allow(unreachable_patterns)] keeps clippy -D warnings clean.
  • Nothing changes in VectorCraft's own builds.

No ROADMAP.md line: this is a compatibility fix with no milestone change, and it keeps the next upstream merge clean.

Checks run on 0daf404

On a Linux x86_64 host with Rust 1.99.0, in a fresh clone of this branch, I ran the steps of cargo xtask ci (xtask/src/main.rs cmd_ci) one at a time. The host has no wasm32 target, so wasm ran on the Mac.

Step Result
cargo fmt --all -- --check pass
cargo clippy --workspace --all-targets -- -D warnings pass
cargo test --workspace pass: 4,052 passed, 0 failed, 3 ignored
cargo xtask assets pass ("all 318 asset files attributed")
cargo xtask brands pass
cargo xtask layers pass (25 crates)
cargo xtask wasm (macOS, Rust 1.97.1) pass, all 19 crates ok

In OctoSense, with PdfCraft's hayro-interpret patched in:

  • vectorcraft-pdf compiles;
  • cargo test --locked -p octosense-vector-service passes;
  • the shell's host_tools suite passes with craft-engines.

Not merged: it waits for the maintainer. The fork has no GitHub Actions.

vectorcraft-pdf matched hayro-interpret's two InterpreterWarning variants
exhaustively. A workspace that links PdfCraft beside VectorCraft patches
in PdfCraft's hardened hayro-interpret for both ([patch] reaches every
crate), and that copy now adds ContentTruncated: page content cut at its
safety budget (storytold/pdfcraft#669, storytold/pdfcraft#797). So
vectorcraft-pdf stopped compiling there (OctoSense, moving its pdfcraft
pin to upstream main). A wildcard arm now reports any further warning as
part of a page skipped; against crates.io's hayro-interpret the arm is
unreachable and allowed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@r9s-codereview

Copy link
Copy Markdown

🤖 AI Code Review

Claude CLI exited with code 1:

✅ No significant issues found.


Tokens used: 0 | Powered by r9s.ai

@ymote

ymote commented Oct 11, 2026

Copy link
Copy Markdown
Owner Author

Merged on the local evidence in the description: the steps of cargo xtask ci on 0daf404 (fmt, clippy -D warnings, 4,052 tests, assets, brands, layers, wasm). The fork has no GitHub Actions. The maintainer approved this merge.

@ymote
ymote merged commit 2cd3a1c into main Oct 11, 2026
2 checks passed
ymote added a commit to OctoSense-org/OctoSense that referenced this pull request Oct 11, 2026
Moves the pdfcraft engine and its patched PDF stack from 615ff308 to
51f09eea: ymote/pdfcraft's merge of storytold/pdfcraft main (f22b5d42,
318 commits, ymote/pdfcraft#2) plus the fork's 4 MiB cap on the total of
decoded page-label prefixes (ymote/pdfcraft#3), which upstream's code
had dropped. All ten pdfcraft pins in the root Cargo.toml move, #501's
pdfcraft-edit included.

- The lock pins hayro-jbig2 to the engine's hardened copy. Its patch
  had been unused: crates.io's 0.3.1 outranked the vendored 0.3.0, so
  JBIG2 images were decoded without the engine's bounds on bitmap and
  dictionary pixels and on decoding steps that never advance. That
  also drops second copies of fearless_simd and hayro-ccitt.
  tests/skill.rs now fails if any of the five patches goes unused or
  isn't at the engine's revision.
- vectorcraft moves to 2cd3a1ca (ymote/vectorcraft#1), whose PDF import
  takes the warning the engine's hayro-interpret adds (ContentTruncated).
  The patch reaches vectorcraft-pdf too, which otherwise stops
  compiling. Only the vector skill's revision lines change.
- The pdf skill is regenerated: twelve new engine commands, each
  classified from its implementation in skill/safety-rules.json, and
  fill_sign_add is file now (its new `path` reads an image signature).
  ADR 0013's count of generated ids follows (4,569).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ymote added a commit to OctoSense-org/OctoSense that referenced this pull request Oct 11, 2026
Moves the pdfcraft engine and its patched PDF stack from 615ff308 to
51f09eea: ymote/pdfcraft's merge of storytold/pdfcraft main (f22b5d42,
318 commits, ymote/pdfcraft#2) plus the fork's 4 MiB cap on the total of
decoded page-label prefixes (ymote/pdfcraft#3), which upstream's code
had dropped. All ten pdfcraft pins in the root Cargo.toml move, #501's
pdfcraft-edit included.

- The lock pins hayro-jbig2 to the engine's hardened copy. Its patch
  had been unused: crates.io's 0.3.1 outranked the vendored 0.3.0, so
  JBIG2 images were decoded without the engine's bounds on bitmap and
  dictionary pixels and on decoding steps that never advance. That
  also drops second copies of fearless_simd and hayro-ccitt.
  tests/skill.rs now fails if any of the five patches goes unused or
  isn't at the engine's revision.
- vectorcraft moves to 2cd3a1ca (ymote/vectorcraft#1), whose PDF import
  takes the warning the engine's hayro-interpret adds (ContentTruncated).
  The patch reaches vectorcraft-pdf too, which otherwise stops
  compiling. Only the vector skill's revision lines change.
- The pdf skill is regenerated: twelve new engine commands, each
  classified from its implementation in skill/safety-rules.json, and
  fill_sign_add is file now (its new `path` reads an image signature).
  ADR 0013's count of generated ids follows (4,569).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant