From c9f693447cb06cda19fa30b08c135b885c7848f1 Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Sun, 27 Sep 2026 01:36:27 +0000 Subject: [PATCH] fix: align CI and docs with implemented tooling Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com> --- .github/workflows/ci.yml | 41 ++++++++++++------------ README.adoc | 60 ++++++++++------------------------- rust/pdftool_core/README.adoc | 45 +++++++++++++++++--------- 3 files changed, 67 insertions(+), 79 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 533b14c..3a4c55c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,31 +15,30 @@ on: pull_request: jobs: - core-fill-tests: + rust-core: + name: Rust core (tests, formatting, lint) runs-on: ubuntu-latest - + timeout-minutes: 15 steps: - uses: actions/checkout@v7.0.1 - - uses: denoland/setup-deno@v2.0.5 - with: - deno-version: v2.x - - uses: dtolnay/rust-toolchain@v1 - - run: deno task test:core-fill - - extension-build: + with: + toolchain: stable + components: rustfmt, clippy + - name: Check formatting + run: cargo fmt --manifest-path rust/pdftool_core/Cargo.toml -- --check + - name: Run unit tests + run: cargo test --manifest-path rust/pdftool_core/Cargo.toml --locked + - name: Run Clippy + run: cargo clippy --manifest-path rust/pdftool_core/Cargo.toml --locked --all-targets -- -D warnings + + workflow-lock: + name: Verify Actions lockfile runs-on: ubuntu-latest - + timeout-minutes: 5 steps: - uses: actions/checkout@v7.0.1 - - uses: denoland/setup-deno@v2.0.5 - with: - deno-version: v2.x - - - uses: dtolnay/rust-toolchain@v1 - - uses: jetli/wasm-pack-action@v0.4.0 - with: - version: "latest" - - - run: deno task build:wasm - - run: deno task build + - name: Install GNU awk + run: sudo apt-get update && sudo apt-get install -y gawk + - name: Verify workflow lockfile + run: ./scripts/check-lock-sync.sh diff --git a/README.adoc b/README.adoc index d0bdc74..24c0719 100644 --- a/README.adoc +++ b/README.adoc @@ -18,48 +18,35 @@ icons) operations * `+scripts/+` — build helpers for WASM and extension bundles -== Quick Start +== Current status -[arabic] -. Install dependencies (Deno-first): -+ -[source,bash] ----- -deno install ----- +The Rust PDF core is implemented and has unit tests. The browser-extension +frontend is a prototype: this checkout does not include an AffineScript compiler +configuration, JavaScript package manifest, or a reproducible extension bundle +pipeline. Therefore the previously documented `deno task build`, `deno task dev`, +and `deno task test:core-fill` commands are not available and the extension is +not currently release-ready. -[arabic] -. Build AffineScript output and bundle extension assets: -+ -[source,bash] ----- -deno task build ----- +== Rust core development -[arabic] -. Build the Rust WASM package: -+ -[source,bash] ----- -deno task build:wasm ----- +Run the implemented native checks from the repository root: -[arabic] -. Run the extension in Firefox via `+web-ext+`: -+ [source,bash] ---- -deno task dev +cargo fmt --manifest-path rust/pdftool_core/Cargo.toml -- --check +cargo test --manifest-path rust/pdftool_core/Cargo.toml --locked +cargo clippy --manifest-path rust/pdftool_core/Cargo.toml --locked --all-targets -- -D warnings ---- -[arabic] -. Run core fill fixture tests (error taxonomy + AcroForm writeback): -+ +Build the Rust WASM package (requires `wasm-pack` and the WASM Rust target): + [source,bash] ---- -deno task test:core-fill +scripts/build-wasm.sh ---- +See `+rust/pdftool_core/README.adoc+` for scope and known limitations. + == Notes * Rust `+fill_blocks+` now performs AcroForm-aware writeback for @@ -69,19 +56,6 @@ text/select and button widgets, and emits structured taxonomy errors Rust WASM boundary. * Source files include SPDX headers targeting MPL-2.0. -== Firefox Troubleshooting - -* If `+deno+` `+task+` `+dev+` fails with `+ECONNREFUSED+` -`+127.0.0.1:+`, verify Firefox is installed and runnable. -* Close stale Firefox instances launched by prior `+web-ext+` sessions, -then retry `+deno+` `+task+` `+dev+`. -* You can run `+web-ext+` directly with an explicit binary when needed: -+ -[source,bash] ----- -deno run -A npm:web-ext run --source-dir dist --firefox /usr/bin/firefox ----- - == Architecture See TOPOLOGY for a visual architecture map and completion dashboard. diff --git a/rust/pdftool_core/README.adoc b/rust/pdftool_core/README.adoc index 671a4b4..1d33ae9 100644 --- a/rust/pdftool_core/README.adoc +++ b/rust/pdftool_core/README.adoc @@ -1,25 +1,40 @@ -== pdftool_core += pdftool_core -Rust/WASM core for `+blocky-writer+`. +Rust/WASM core for `blocky-writer`. -=== Current scope +== Implemented -* Exposes `+detect_blocks(pdf_data)+` for block metadata extraction -(placeholder output for now). -* Exposes `+fill_blocks(pdf_data, blocks, fields)+` for writeback -(currently passthrough). +* `detect_blocks` parses PDF AcroForm widget annotations and returns their + labels and rectangles. It does not perform OCR or general-purpose visual + block detection. +* `fill_blocks` updates matching AcroForm field values and returns serialized + PDF bytes. It supports the field types and validation covered by the unit + tests; it is not a PDF renderer. +* Core parsing and writeback behavior is covered by Rust unit tests in + `src/lib.rs`. -=== Build +== Native development checks + +From the repository root: [source,bash] ---- -wasm-pack build --target web --out-dir pkg +cargo fmt --manifest-path rust/pdftool_core/Cargo.toml -- --check +cargo test --manifest-path rust/pdftool_core/Cargo.toml --locked +cargo clippy --manifest-path rust/pdftool_core/Cargo.toml --locked --all-targets -- -D warnings ---- -=== Next implementation milestones +== WebAssembly packaging + +Install Rust with the `wasm32-unknown-unknown` target and `wasm-pack`, then run: + +[source,bash] +---- +scripts/build-wasm.sh +---- -[arabic] -. Parse PDF page geometry and form widgets. -. Integrate OCR-backed fallback for scanned documents. -. Write field values back into PDF objects with deterministic -positioning. +The extension frontend currently has no checked-in compiler/package manifest or +reproducible bundle build. The `.affine` source files are a prototype and are +not presently wired into a verified extension build. Do not treat the frontend +as a release-ready browser extension until that toolchain and its integration +tests are established.