OverviewFilesCommitsIssuesDocsReleasesPeers

keet-daemon commits / ac7907d

CPP-PORT-DESIGN: R4c-3 split, R4c-3a done (CORESTORE lock)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ac7907dde754acf443730782456bc78a41298e30
by plankatron <fleeky@gmail.com> · 2026-10-06T21:28:22.000Z

Changed files (1) +42 -0

docs/CPP-PORT-DESIGN.md +42 -0
……@@ -3898,6 +3898,48 @@ injected per layer:
38983898 `_resolveTreeCache` replaces or deletes it synchronously before its promise fulfills, so
38993899 adopting it lands on the same hop as awaiting it.
39003900 - ctest 86/86.
3901- **R4c-3 split (2026-10-06).** CorestoreStorage's `_migrateStore` runs `migrations/0.store()` on
3902 every FRESH store (the head is version 0), so the migrations come before the store, and R4c-6 moves
3903 forward into R4c-3:
3904 - **R4c-3a:** device-file + fd-lock + the bare-fs slice.
3905 - **R4c-3b:** migrations/0 (store + core) and migrations/1.
3906 - **R4c-3c:** CorestoreStorage + HypercoreStorage + the async `l2_ops` gate.
3907 - **Limit:** a `wait: true` lock is a real pool job, so a caller still inside a `scaffold::Sync`
3908 scope would get `NoProgress`. Only async callers can wait until corestore converts (R4g).
3909 keetd's daemon passes no `wait`.
3910- **R4c-3a DONE 2026-10-06** (keetd b06c99c): the CORESTORE lock.
3911 - **`hc::bare_fs`** ports bare-fs 4.8.1's ops literally: open, close, read, write, stat, fstat,
3912 unlink, recursive mkdir, FileError, and the sync helpers.
3913 - Each op's native request runs inline and its completion is parked.
3914 - `await req` is on a THENABLE (bare-fs's FileRequest), so `js::thenable` adds one
3915 NewPromiseResolveThenableJob.
3916 - Then `done(err, result, cb)` runs: a callback is called there, or the promise settles.
3917 - **fs-native-extensions 1.5.0, Linux:**
3918 - `tryLock` / `unlock` are synchronous. EAGAIN means false; any other error throws.
3919 - `getAttr` has one derived promise, then `setAttr`.
3920 - `waitForLock` is a real `uv_queue_work` on the Real runtime and inline on the Virtual one.
3921 - **fd-lock 2.1.1:** ready-resource, `transfer`, suspend / resume. `return this._suspend()` is
3922 adopted.
3923 - **device-file 2.3.1:** verify and write, DEVICE_FILE errors with `fatal`, upserts, `validate`.
3924 `validate` of a missing file returns true, a JS quirk that is kept.
3925 - **scope-lock 1.2.4.**
3926 - **Gate `tools/df` (`r4c_df`):** 11 scripts, 21 runs, identical to Bare at pool = 1. They
3927 cover:
3928 - fresh / id change / upsert / contention / moved / modified / platform / create:false /
3929 transfer;
3930 - a CONTENDED wait: the harness holds the lock on its own fd and a timer releases it, so the
3931 order is forced; Real only, because a JS waitForLock at pool = 1 blocks the only pool thread;
3932 - `hops`: a ruler at the top of every fs completion. JS wraps bare-fs's `requestInit` and
3933 fs-native-extensions' callbacks before any fs call, since bare-fs pools its FileRequests;
3934 C++ uses `bare_fs::testOnCompletion`.
3935 - The JS trace is written once at exit, because a redirected stdout is itself bare-fs
3936 requests.
3937 - **Drill r4c3a: 12/13 red.** Survivors of the first run, fixed by scripts:
3938 - the uncontended `waitLock`;
3939 - three hop or completion-count mutants, invisible until `hops`.
3940 - **One equivalent:** open's thenable hop. Nothing else can share open's own completion
3941 checkpoint; close's hop IS rulered, as the last completion before `ready()`.
3942 - ctest 87/87.
39013943- **Then 4e-4** (`createProtocolStream` / `replicate`): the first gate that composes the stack
39023944 is a COMPOSED trace against JS (secret-stream + protomux + replicator), now meaningful.
39033945