Skip to content

Remove orphaned pdfium modules and guard against unwired files - #3

Merged
tonythethompson merged 1 commit into
mainfrom
freebuff/66f2b7380a9e348266955432
Oct 28, 2026
Merged

tonythethompson merged 1 commit into
mainfrom
freebuff/66f2b7380a9e348266955432

Conversation

@tonythethompson

Copy link
Copy Markdown
Collaborator

Follow-up to the architecture/tech-debt audit of main (06631b8). Fixes the issues the audit found, without touching any compiled code path.

P1 — dead code

  • Deleted crates/pdf-engine/src/rendering.rs (333 lines) and crates/pdf-engine/src/fileops.rs (604 lines). Neither was ever referenced by a mod declaration in any commit, so ~937 lines of pdfium-based code silently bypassed cargo fmt, cargo clippy, and cargo test — it references the non-existent pdfium_render dependency and could never compile.
  • Added scripts/check-module-wiring.py: walks each crate's module tree from lib.rs/main.rs, resolves plain and #[path = "..."] mod declarations, and fails if any src/**/*.rs file is unreachable (or a declared module file is missing). Verified to flag exactly these two orphans before deletion (exit 1) and to pass afterwards (pdf-engine 14, pdfree 14, viewer-core 9 — all reachable, exit 0).

P2 — CI

In .github/workflows/ci.yml:

  • New Check module wiring step right after Python setup, so orphaned files fail fast before the expensive native bootstrap.
  • Swatinem/rust-cache@v2 (with .tools in cache-directories) to stop rebuilding native deps from scratch every run.
  • concurrency group cancelling superseded PR runs, never main pushes.
  • No existing check was modified or removed; YAML validated with a parser.

P3 — documentation drift

  • README's false "No remote repository is configured by this prototype" now names the GitHub remote and what CI runs.
  • Print turned out to be fully implemented (toolbar, context menu, Ctrl+P → sibling copy → ShellExecuteW "print") but undocumented — added to the README controls paragraph and docs/feature-matrix.md.
  • Verified and left alone: docs/architecture.md's "legacy draft APIs remain for compatibility" claim is still true (save_as/rename_and_save still accept draft annotations; the coordinator rejects them when the journal is active).

Backlog

  • Added item 9 to docs/backlog.md: dependency advisory checking (cargo audit/cargo deny) — deliberately not added as a required check in this PR since it can't be verified against the locked graph without a Windows toolchain.

Verification limits

Wiring script (before/after), py_compile, YAML parse, and a repo-wide grep confirming zero remaining references to the deleted files. cargo fmt/clippy/test could not run in the audit VM (no Rust toolchain, Windows/MSVC-only project) — CI on this PR is the first real compile check, though risk is minimal since no compiled file changed.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com

The audit found crates/pdf-engine/src/rendering.rs and fileops.rs were
never declared by any `mod`, so 937 lines of pdfium-based code silently
bypassed fmt, clippy, and tests. Delete them, add a CI wiring check that
fails when a source file is unreachable from its crate root, cache Rust
and native build deps, cancel superseded PR runs, and correct the stale
README repo claim plus document Print.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-27T21:37:47.492987Z
We couldn’t complete this review. Comment @codex review to try again.
b9d655b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@tonythethompson
tonythethompson merged commit dfdf7bf into main Oct 28, 2026
1 check passed
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