JS SDK: no way to read a binary file back (fs.read refuses it as Binary)
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, rust
Direzione di ricerca
Read the existing fs.read implementation and read_range in layerfs-content, then follow the path through layerfs-store-service/src/read/reads.rs to the layerfs-api handler. The issue leaves the public API shape, byte cap, and whether the method should exist undecided, so those owner decisions must be settled before implementation. Done means a decision and, if approved, a bounded binary read with a Linux SDK test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Split from #413. Writes are fixed by #416; this issue is about reading.
Problem
The JS SDK can write a binary file but cannot read it back. fs.read reads text in windows (at most 2000 lines / 48 KiB per call) and refuses a file with NUL or invalid UTF-8 as Binary. No other SDK call returns a file's raw bytes. fs.stat gives only its size.
This means a binary file round-trip through the fs surface is impossible. For example, the Magpie LayerFS plugin (magpie-community/plugins#318) has to skip binary files on checkout and list them as not materialized.
Decision needed (owner)
Whether to add a byte read to the public SDK, and in what shape. It would be a new public method, and once released it has to be kept.
A possible shape (not decided)
fs.read_bytes(ref, path, offset = 0, length?) → { bytes: Buffer, size, hasMore }:
- One bounded range per call, capped like
fs.read's window. A whole-file read would hold a large file in memory. - Reads at the same immutable snapshot as
fs.read(a Branch, Commit or Layer), so paging through a file is consistent. NotFile/IsDirectory/NoSuchPathrefusals as forfs.read. Anoffsetpast the end returns emptybyteswithhasMore: false.- Built on the existing
read_rangeinlayerfs-content, throughlayerfs-store-service/src/read/reads.rsand a smalllayerfs-apihandler. No storage format change. - The binding already returns
SdkValue::Bytesas aBuffer, and the dsh port's encoding carriesBuffer. So no binding or port change is expected. - Rough size: +45 to +65 production lines (mostly core), plus a Linux SDK test.
Questions for the decision
- A new method, or an option on
fs.read(for exampleencoding: "bytes")?fs.readis line-based, so a separate method seems cleaner. - The per-call cap: the same 48 KiB as
fs.read, or larger, since bytes need no line scanning? - Is it needed at all, or should binary access go through a mounted Workspace (
workspace.mount+ exec) instead?
- Lingua principale
- Rust
- Stelle
- 2.1k
- Fork
- 110
- Merge medio
- 23h 52m
- PR unite (30g)
- 138
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Ephemeral-AI-Lab/layerfs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Ephemeral-AI-Lab/layerfs#689 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Ephemeral-AI-Lab/layerfs#643 ·
I maintainer di solito rispondono entro 1 giorno
-
`branch.publish` accepts a stale base and overwrites `main` (lost update)Forse già presa @mengmengmengqiang l’ha presa oggi. Apertaapi/calls bug core/history
Ephemeral-AI-Lab/layerfs#691 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 8/100
Ephemeral-AI-Lab/layerfs#684 · 10 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 5/5 Più di una settimana Idoneità per principianti 15/100
Ephemeral-AI-Lab/layerfs#683 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Ephemeral-AI-Lab/layerfs
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
pop-os/cosmic-settings#2296 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
jonathanong/no-mistakes#3431 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Eyevinn/open-live-ingest#36 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno