Context: Forge M05 (content-addressed blob storage) is planned against VoidLibrary main. Four gaps were identified while writing the contract:
Crypto: Hasher state export/import.Void::Crypto::Hasher cannot serialize/restore its state, so resumable uploads cannot resume hashing across requests (v1 plans restart-only).
System: open_file no-follow/exclusive flags. Beyond CreateNew, there is no no-follow/exclusive open; Forge pre-checks symlink_status (race-prone).
System: FilePort free-space query. No API; Forge uses std::filesystem::space.
System: rename_noreplace / hard-link.FilePort lacks an atomic no-replace rename or hard-link; Forge relies on a per-digest lock for identical-content overwrite.
Also: Storage is not yet in Forge's VoidLibrary module list; that is a Forge configuration change, not a library gap.
Expected: native primitives for at least (1) and (2), since both affect correctness/security; (3) and (4) are robustness improvements.
Context: Forge M05 (content-addressed blob storage) is planned against VoidLibrary main. Four gaps were identified while writing the contract:
1. **Crypto: Hasher state export/import.** `Void::Crypto::Hasher` cannot serialize/restore its state, so resumable uploads cannot resume hashing across requests (v1 plans restart-only).
2. **System: `open_file` no-follow/exclusive flags.** Beyond `CreateNew`, there is no no-follow/exclusive open; Forge pre-checks `symlink_status` (race-prone).
3. **System: `FilePort` free-space query.** No API; Forge uses `std::filesystem::space`.
4. **System: `rename_noreplace` / hard-link.** `FilePort` lacks an atomic no-replace rename or hard-link; Forge relies on a per-digest lock for identical-content overwrite.
Also: `Storage` is not yet in Forge's VoidLibrary module list; that is a Forge configuration change, not a library gap.
Expected: native primitives for at least (1) and (2), since both affect correctness/security; (3) and (4) are robustness improvements.
Additional M05 detail: FilePort::lock_directory is a non-blocking flock(LOCK_EX|LOCK_NB). Forge M05 needs one exclusive per-upload session lock held across intake and seal; a second acquisition from the same process fails with EWOULDBLOCK. A blocking/reentrant lock option, or documented ownership semantics, would remove the workaround. Also, a bounded list_dir (or prefix iteration) would avoid unbounded vectors on large stores.
Additional M05 detail: `FilePort::lock_directory` is a non-blocking `flock(LOCK_EX|LOCK_NB)`. Forge M05 needs one exclusive per-upload session lock held across intake and seal; a second acquisition from the same process fails with EWOULDBLOCK. A blocking/reentrant lock option, or documented ownership semantics, would remove the workaround. Also, a bounded `list_dir` (or prefix iteration) would avoid unbounded vectors on large stores.
Partial progress on main (merge 06e5bd5): Void::Storage::FilePort now exposes rename_noreplace() (atomic RENAME_NOREPLACE with a link+unlink fallback), hard_link(), and available_space() (statvfs), implemented by the POSIX port and the fault-injecting proxy, with tests covering no-replace semantics, hard links, free space and O_NOFOLLOW open rejection. Note open_file already applies O_NOFOLLOW and CreateNew is O_CREAT|O_EXCL, so the no-follow/exclusive open request is covered. Remaining from this issue: Crypto Hasher state export/import.
Partial progress on `main` (merge `06e5bd5`): `Void::Storage::FilePort` now exposes `rename_noreplace()` (atomic `RENAME_NOREPLACE` with a link+unlink fallback), `hard_link()`, and `available_space()` (statvfs), implemented by the POSIX port and the fault-injecting proxy, with tests covering no-replace semantics, hard links, free space and `O_NOFOLLOW` open rejection. Note `open_file` already applies `O_NOFOLLOW` and `CreateNew` is `O_CREAT|O_EXCL`, so the no-follow/exclusive open request is covered. Remaining from this issue: Crypto `Hasher` state export/import.
All four capabilities are now on main: (1) Hasher::export_state()/import_state() for the built-in backend (versioned self-describing state covering SHA-1/256/512 and BLAKE2b-256/512, validated on import with fail-closed rejection of malformed input; the OpenSSL provider returns unsupported_algorithm since it has no portable state export); (2) open_file already applies O_NOFOLLOW and CreateNew is O_CREAT|O_EXCL; (3) FilePort::available_space() (statvfs); (4) FilePort::rename_noreplace() (atomic RENAME_NOREPLACE with link+unlink fallback) and hard_link(). Verified with the Storage and Crypto suites and the full -Werror regression (1920 tests, 1916 passed, 4 skipped). Closing as done.
All four capabilities are now on `main`: (1) `Hasher::export_state()`/`import_state()` for the built-in backend (versioned self-describing state covering SHA-1/256/512 and BLAKE2b-256/512, validated on import with fail-closed rejection of malformed input; the OpenSSL provider returns `unsupported_algorithm` since it has no portable state export); (2) `open_file` already applies `O_NOFOLLOW` and `CreateNew` is `O_CREAT|O_EXCL`; (3) `FilePort::available_space()` (statvfs); (4) `FilePort::rename_noreplace()` (atomic RENAME_NOREPLACE with link+unlink fallback) and `hard_link()`. Verified with the Storage and Crypto suites and the full `-Werror` regression (1920 tests, 1916 passed, 4 skipped). Closing as done.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Context: Forge M05 (content-addressed blob storage) is planned against VoidLibrary main. Four gaps were identified while writing the contract:
Void::Crypto::Hashercannot serialize/restore its state, so resumable uploads cannot resume hashing across requests (v1 plans restart-only).open_fileno-follow/exclusive flags. BeyondCreateNew, there is no no-follow/exclusive open; Forge pre-checkssymlink_status(race-prone).FilePortfree-space query. No API; Forge usesstd::filesystem::space.rename_noreplace/ hard-link.FilePortlacks an atomic no-replace rename or hard-link; Forge relies on a per-digest lock for identical-content overwrite.Also:
Storageis not yet in Forge's VoidLibrary module list; that is a Forge configuration change, not a library gap.Expected: native primitives for at least (1) and (2), since both affect correctness/security; (3) and (4) are robustness improvements.
Additional M05 detail:
FilePort::lock_directoryis a non-blockingflock(LOCK_EX|LOCK_NB). Forge M05 needs one exclusive per-upload session lock held across intake and seal; a second acquisition from the same process fails with EWOULDBLOCK. A blocking/reentrant lock option, or documented ownership semantics, would remove the workaround. Also, a boundedlist_dir(or prefix iteration) would avoid unbounded vectors on large stores.Partial progress on
main(merge06e5bd5):Void::Storage::FilePortnow exposesrename_noreplace()(atomicRENAME_NOREPLACEwith a link+unlink fallback),hard_link(), andavailable_space()(statvfs), implemented by the POSIX port and the fault-injecting proxy, with tests covering no-replace semantics, hard links, free space andO_NOFOLLOWopen rejection. Noteopen_filealready appliesO_NOFOLLOWandCreateNewisO_CREAT|O_EXCL, so the no-follow/exclusive open request is covered. Remaining from this issue: CryptoHasherstate export/import.All four capabilities are now on
main: (1)Hasher::export_state()/import_state()for the built-in backend (versioned self-describing state covering SHA-1/256/512 and BLAKE2b-256/512, validated on import with fail-closed rejection of malformed input; the OpenSSL provider returnsunsupported_algorithmsince it has no portable state export); (2)open_filealready appliesO_NOFOLLOWandCreateNewisO_CREAT|O_EXCL; (3)FilePort::available_space()(statvfs); (4)FilePort::rename_noreplace()(atomic RENAME_NOREPLACE with link+unlink fallback) andhard_link(). Verified with the Storage and Crypto suites and the full-Werrorregression (1920 tests, 1916 passed, 4 skipped). Closing as done.