Commit Graph
14 Commits
Author SHA1 Message Date
bchanot ca31b787b6 fix(domain): V1-2.2 second review round, linear walks, bounds, CSS loaders
Verifier ECARTS(3) and security PASS on 8294d54: one indexed walk per
view chain in sheet.edit, a set for referenced drawings, released
preview parses, xml:base and CSS loaders refused, fail-closed PI scan,
PI drawings rejected by the preview, the builder naming its cap.
2026-10-29 13:58:32 +01:00
bchanot 8294d5471c fix(anatomy): V1-2.2 review findings, PIs and HTML refused, bounds
Security audit (PASS, 2 MEDIUM, 2 LOW) and verifier (ECARTS 6) on
741c25c: processing instructions and HTML fetchers refused, active
content under a long title classified, linear review groups, full
fixpoint check, bounded preview drawings, missing cap fixtures and
property checks, record wordings.
2026-10-29 13:38:33 +01:00
bchanot 8ae756534c feat(domain): V1-2.2 wasm facade, contract types, module proofs
PreviewBuilder, PreviewSheet and clean_svg on the browser module, the
31 ts-rs types and their index, the glue interface, and the proofs on
the shipped module; the module stays under its 600 KB budget.
2026-10-29 13:14:22 +01:00
bchanot 9e688b6801 feat(domain): R4.6 ExportSession (incremental export, OD-2): rasters decoded and written on arrival, chunked file handed out in parts, views composed by the core, raster_size_of (O4); wasm ExportSession and CoreExportSession; R4 digests re-frozen (catalog and page tree written last, B2) 2026-10-19 01:15:43 +02:00
bchanot 50c8fe0b33 feat(domain): R4.5e wasm proof export, resources per page, N-1 and TS-engine read-back, cost comparison
export_pdf_for_test on the proofs build (ExportInput JSON + base64 rasters): the 14 O2
runs give the native digests through wasm; the frozen O11 scanner reads every R4 PDF and
the N-1 Zod readers accept its envelope; a stripped R4 PDF answers attachment_stripped;
the TypeScript engine reads the R4 PDFs back to the R3 outcome; E2 size ≤ R3 + 5 %. Page
resources list the images the page draws (listing every embed cost 9 MB on CAP). Node,
stub rasters, TS → Rust: demo 198 → 36 ms, L 772 → 57 ms, CAP 5.7 s → 0.22 s; files
236 KB, 386 KB, 1.6 MB against 243 KB, 463 KB, 2.2 MB. Module with the writer linked
(proofs build): 531.6 KB gzip; shipped unchanged at 426 KB until R4.6 links it.
2026-10-18 23:21:05 +02:00
bchanot 71bcb742c9 feat(domain): R4.4 scaffold of the pdf writer module (feature pdf-write, text contract, test targets) 2026-10-18 21:31:10 +02:00
bchanot 52471dbbc0 feat(domain): R4.3a FileBytes sink and the bytes entries of the wasm facade
FileBytes gathers a file chunk by chunk in linear memory (capacity reserved from the
announced size, refused above the PDF cap); SheetHandle.import_pdf_bytes and
restore_copy_bytes consume it, so the worker streams file.stream() and the file lives
once, never as a JavaScript ArrayBuffer nor as a JSON-wrapped string. restore_copy:
strict UTF-8, one BOM, the OD-3 budget, draft.restore's kinds. Node: same envelopes as
import_pdf on the 51 O8 cases; rescue-copy parity with draft.restore.
2026-10-18 17:45:39 +02:00
bchanot 6ee04c96c5 feat(domain): R4.2e OD-3 value cap (400,000), rescue-copy guard, 1 GiB linear ceiling, budget measurements
json_js::MAX_JSON_VALUES from the R4.2e measurements (CAP envelope 39,652 values, 612-leaf
export 23,803; ~100 B of tree per value, a 16 MiB dense document 784 MiB with the cap off,
16 MiB with it); draft.restore refuses an over-budget copy as invalid; --max-memory 1 GiB
proven to trap on the proofs build; cargo pdf_budget prints the value table, the Node
budget suite prints the per-class cost (fresh instance, W4 asserted).
2026-10-18 16:06:36 +02:00
bchanot f8579bc19a feat(domain): R4.2d attachment probe, import_pdf and SheetHandle.import_pdf on the wasm facade
locate_attachment (shared 16 MiB budget, JS-path steps in the TypeScript order, OD-3 cap
hook off until measured), pdf::import, facade import_pdf with the PdfImportKind kinds
(ts-rs exported). cargo: O7 144 inputs (locate, read, archive rows) and O8 51 cases equal
to the R3 path, 3 OD-4 differences declared (lone surrogate in an overwritten duplicate
value). Node through the shipped module: the same O8 outcomes, every reference PDF.
Module 421.7 KB gzip (W1 budget 600 KB).
2026-10-18 15:55:46 +02:00
bchanot 21d34fb9a7 feat(domain): R4.2 scaffold of the pdf reader module (feature pdf-read, miniz_oxide)
Module layout of plan §B.1.1 for the reader (read/{scan,strings,stamp,inflate,probe},
json_js), shared constants and types, index_of; feature-gated test targets; the wasm
facade enables the feature; rust-check runs the gated clippy and tests.
2026-10-18 15:29:58 +02:00
bchanot 343d6f4c1f feat(workspace): R2.4 core runtime — lazy load, poison on trap, offline re-instantiation, per-generation sheet handles
packages/core-wasm: browser-safe CoreRuntime (synchronous calls once ready;
a WebAssembly.RuntimeError poisons the instance, the call answers internal,
a fresh instance comes from the kept compiled module and a glue record
imported in advance; at most 3 recoveries per page; retry after a load
failure), SheetSession (handle rebuilt per instance generation, never
called on a dropped one; invalid_sheet without poisoning), Node source.
crates/wasm: SheetHandle (sheet held in the module memory). Two builds:
pkg/ shipped without trap exports (checked), pkg-proofs/ for the trap
tests; BUILD_STAMP (hash of the Rust sources) refused when missing or
stale by the vitest global setup instead of skipping. Failure envelope
carries a numeric found version; compact JS-number output.
2026-10-14 00:12:04 +02:00
bchanot f2cf93668e chore(workspace): native Rust toolchain as the primary path, builder image as the reproducible alternative
scripts/rust-check.sh and scripts/wasm-build.sh (moved from docker/) run
natively on the user-level rustup toolchain pinned by rust-toolchain.toml;
scripts/rust-env.sh puts ~/.cargo/bin on PATH for non-interactive shells.
Root scripts: rust:check and wasm:build native, rust:check:docker and
wasm:build:docker through docker/rust-run.sh, check:all = scripts/check-all.sh,
the whole pre-merge gate in one command (rust check, types drift, wasm build,
pnpm check, application image, worker:test, worker:image started read-only).
The native check now runs the worker's unit tests (cargo test --workspace);
the sandbox tests stay feature-gated and Docker-only.
2026-10-13 01:19:13 +02:00
bchanot 11813f5560 fix(worker): security audit of R0 — no core dumps, tkill/tgkill limited to SIGABRT on self, mmap without PROT_EXEC, Broken outcome for a broken child environment, frame vs canvas check, unsafe denied with local allows, sandbox tests and derivation on the release profile (syscall marker); wasm proof exports behind a feature; ci: release-images hardened (typed input via env, advisories gate, ephemeral builder, env secrets + logout, ref gate, pinned checkout) 2026-10-13 00:18:53 +02:00
bchanot 2a38fa37b5 chore(workspace): Rust workspace R0 — builder image, core crate (JS-compatible JSON, report contracts, facade), wasm facade, core-wasm package with proofs 2026-10-13 00:01:25 +02:00