Skip to content

Add bounded ZIP64 archive extraction crate - #129

Open
0thernet wants to merge 5 commits into
rust-canonical-foundationsfrom
rust-archive-foundations
Open

0thernet wants to merge 5 commits into
rust-canonical-foundationsfrom
rust-archive-foundations

Conversation

@0thernet

Copy link
Copy Markdown
Member

Outcome

Add rust/oh-archive, a bounded ZIP64 archive extraction crate with WASM and
N-API bindings. The crate extracts selected entries from untrusted ZIP archives
with regex patterns while enforcing entry count, per-entry, and total-byte
limits. It rejects encrypted files, path-traversal names, and unsupported
compression methods.

Also register the new artifact surfaces in costs.json, split the Rust build
scripts by crate, and add the implementation plan under plans/rust-foundations.md.

Contract impact

No persisted or exchanged bytes change. The crate is additive and not yet
consumed by any TypeScript path.

Verification

  • cargo test -p oh-archive passes.
  • cargo clippy -- -D warnings passes.
  • bun run rust:build produces loadable WASM artifacts for both canonical and archive crates.
  • bun run check:cost-surfaces passes with the new rust:archive-wasm and rust:archive-napi surfaces.
  • No credentials or private data included.

Add rust/oh-archive with WASM and N-API bindings. The crate extracts
selected entries from untrusted ZIP archives with regex patterns while
enforcing entry count, per-entry, and total-byte limits. It rejects
encrypted files, path-traversal names, and unsupported compression methods.

Also register the new artifact surfaces in costs.json, split the Rust build
scripts by crate, and update the rust workspace/README/plan.
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
oh-computer Ready Ready Preview Sep 17, 2026 7:43pm UTC

Request Review

Add rust/oh-sqlite with an N-API binding. The crate copies a SQLite database
plus its -wal and -journal sidecars into a private output directory, verifies
ownership/permissions, checks the SQLite magic header, and enforces per-file
and total byte limits. The original files are never modified.

Also register rust:sqlite-napi in costs.json, fix rust:check to run from the
rust/ directory, and simplify archive N-API error serialization.
Implement the projection semantics from src/projection.ts in Rust:
- Dataset, fact, rule pack, and query types with serde support
- Naive materialization loop with work-unit and round bounds
- Proof tree generation with depth/node/byte budgets
- Query evaluation with canonical-JSON tuple keys
- WASM binding for Convex/Bun consumers
- New engine identity: oh.projection.rust.v1

Includes unit tests for transitive closure and budget enforcement.
- oh-archive::strict ports the Textbutler X-archive ZIP contract to Rust:
  EOCD/ZIP64 end records, central-directory validation, local-header
  consistency, data-descriptor checks, CRC-32, compression-ratio caps,
  NFC names, and pattern-selected in-memory extraction.
- oh-archive-strict-wasm exposes it through a raw extern-C ABI with no
  wasm-bindgen imports, so consumers can vendor the .wasm binary directly.
- oh-archive-wasm gains read_zip_entries_strict_js returning
  { name, bytes } objects for bindgen-based callers.
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