P0-S2a: Stat-by-fd helper and accurate sizes
Background
stat currently returns only basic type info. To support file I/O and tests, file sizes must be accurate post-write/truncate using overlay-aware size calculation.
Goal
Provide a VFS helper to stat by descriptor and update bindings to return accurate file size and type.
Design
- Add
stat_by_fd(fd) -> (size, type) that checks overlay first, then backend.
- Update
get_type/stat to call helper and map to WASI types.
- Ensure directory kinds remain correct and unaffected.
Constraints
- Deterministic outcome across nodes.
Acceptance Criteria
- File size reflects content length after writes/appends/truncates.
- Unit tests cover size changes; existing FS operation tests remain green.
References
P0-S2a: Stat-by-fd helper and accurate sizes
Background
statcurrently returns only basic type info. To support file I/O and tests, file sizes must be accurate post-write/truncate using overlay-aware size calculation.Goal
Provide a VFS helper to stat by descriptor and update bindings to return accurate file size and type.
Design
stat_by_fd(fd) -> (size, type)that checks overlay first, then backend.get_type/statto call helper and map to WASI types.Constraints
Acceptance Criteria
References