Skip to content

feat(streaming): bounded file-header state machine, sources and checkpoints - #213

Merged
DrunkOnJava merged 4 commits into
mainfrom
codex/streaming-core
Oct 25, 2026
Merged

DrunkOnJava merged 4 commits into
mainfrom
codex/streaming-core

Conversation

@DrunkOnJava

@DrunkOnJava DrunkOnJava commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

The legacy reader loads entire files and sections. This adds the first bounded streaming core: the complete R13–R2000 file header (ODA v5.4.1 §3.2) is read by a hand-written byte-demand state machine with fixed storage, strict CRC/sentinel checks and explicit unsupported-layout errors. Grammar has no transport, allocator or I/O; pausable file/slice sources supply bytes. Portable checkpoints retain partial fields and failures and validate against a caller-supplied immutable source identity.

The identical grammar source compiles independently without std or an allocator on native and wasm32. The built entry point is exercised by a subprocess E2E driver and proptest schedule generator. Streaming E2E is now required in the live main ruleset. The committed ruleset exactly matches live policy and preserves all restrictions, with no admin bypass; the related drift issue #117 is verified and closed.

Scope: initial implementation for #205, #206, #207 and #210 under #204. These full-parser issues remain open. Existing DwgFile/browser APIs still load full files. R2004+ streaming containers, objects, decompression checkpoints, compiler replacement, browser runtime, a licensed multi-gigabyte corpus and independent reader comparisons remain unresolved. The compiler follows a measured handwritten baseline, per the requested sequencing. The canonical R2000 fixture's invalid header is tracked as #214; validation is not weakened to admit it.

Verification: all 23 PR checks passed on exact candidate e7c3df45bbb7c9af56de3297b342e080e32baf9f. Streaming E2E run 40235108179 passed 12 synthetic version/count combinations, 1,002 truncations, two hash-pinned real header oracles, 128 proptest schedules per real file, 98 fresh-process resume positions with zero earlier source reads, malformed/semantic/source mismatch rejection and failed-state restore. It also compiled the same no-allocator grammar on native and wasm32. The existing web/bundler/nodejs WASM wrapper builds passed. No new unit tests. Commands and artifact contract are in docs/streaming/README.md; the JSON/JSONL artifact records the executable SHA-256 and exact generated schedules.

Delivery/custody: squash-merged as ab1d42b029a34e9b030b68fa2c334c6728df2935, GitHub-verified signature. The merged tree exactly equals the tested candidate tree (f1ae400d1f64c35c03c3a2edd0099db561df9c27). Owner: this Codex chat; branch codex/streaming-core was automatically deleted on merge. The isolated worktree is retained clean for custody; no peer or release handoff. Main checkout and peer worktrees were preserved. Candidate verification and the separate post-merge main pipeline are distinct claims; no complete model, browser runtime, performance superiority or release-readiness claim is made.

Clean-room declaration. All new code was written from scratch using only this repository and ODA's public v5.4.1 specification. No Autodesk SDK, ODA SDK, LibreDWG, decompilation or other forbidden implementation source was consulted. Spec citations are in the grammar and audit. Real DWGs are fetched temporarily from pinned public URLs and are not committed. No external DWG reader implementation source was used.

Begin #205 with a pure state machine for ODA 5.4.1 section 3.2. Validate CRC, sentinel, locator identities and source ranges; reject unsupported container layouts explicitly. Exercise the built entry point with short reads, truncations and corrupt input in remote CI.
Add file and borrowed-slice adapters with explicit Pending and EOF, bounded one-poll delivery, and short-read handling. Pin two real R14/R2000 header inputs and check their independently recorded fields through the built executable. Refs #206, #211.
…esume

Version and validate compact state against the source identity. Save every mid-field checkpoint, restore in a new process, and trace source reads. Add proptest-generated child-process schedules and compile the identical grammar without std or an allocator on native and wasm32. Refs #207, #210.
Record exact file-header and checkpoint guarantees, reproducible E2E evidence and remaining migration gaps. Synchronize the ruleset file with current live restrictions and add Streaming E2E without restoring the old admin bypass. Refs #204, #117.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

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 ✅ Completed 2026-10-25T21:25:20.133962Z e7c3df4 Draft marked ready
ℹ️ 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.

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