Skip to content

Add bounded native workspace byte reads - #75

Draft
MiguelsPizza wants to merge 1 commit into
mainfrom
alex/workspace-range-reads
Draft

MiguelsPizza wants to merge 1 commit into
mainfrom
alex/workspace-range-reads

Conversation

@MiguelsPizza

@MiguelsPizza MiguelsPizza commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

A bounded shell read of a large browser file currently materializes the entire file through readFileBytes. Add an optional readFileRange(path, offset, length) capability and implement OPFS reads with native File.slice() under the existing locks. WorkspaceFileSystem validates the range and falls back for older backends, so existing proxies remain compatible.

This supplies the shared filesystem boundary for Rook's mounted-PDF fix and native range reads in Rook's just-bash fork. The separate upstream just-bash PR contains only byte conversion. This capability follows the File API slicing contract.

Validated all six package builds and the SDK check gate. Shell tests: 194 passing, plus eight real Chromium Worker/OPFS tests. The new browser regression instruments native Blob reads and forbids whole-file allocation; the SQL workspace regression verifies the legacy adapter fallback.

Expose an optional range capability so consumers can request a PDF prefix or suffix without materializing the full file. Keep OPFS reads under existing locks and preserve old WorkspaceFsLike implementations through the adapter's bounded fallback. Real browser tests check actual Blob read sizes; the SQL workspace regression exercises compatibility.

This branch has not been deployed

No deployments
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