refs writerThe pure-JS WRITE substrate for the reflog verbs. wtlog and reflog are BOTH ULOGs,
so the write side lives IN ulog.js (beside its each/drain readers) — no new
file — and the ref-store semantics live in the store lib. Generalises the ULOG-write
code inlined in bin/get.js (writeWtlog/appendWtlog) + ingest.js::writeUlog.
Pure JS over the abc ULOG container + io. Blocks the write verbs. Part of JS-046.
Method: Issues. (Review: no multiplying files — fold, don't add.)
wtlog.js/keeper.js are READ-only today. Native wt row format is
<ron60-ms>\t<verb>\t<uri> (sniff/AT.md); refs rows are set ?<br>#<sha>
with a bare-40hex val, verbs post/delete (keeper/REFS.h).ulog._feed(buf,off,verb,uri,ts) accepts an explicit ts → monotonic rows are
expressible; get.js::writeWtlog is the existing (non-crash-safe) precedent.bin/lib/ulog.js gains the WRITE side beside its each/drain readers:
append(bePath, rows) (port SNIFFAtNow monotonic ts, CLOCKBAD guard, crash-
safe temp+rename) + write/_stage/nowAfter. No separate wtwrite.js.bin/lib/store.js (renamed from keeper.js) gains the ref WRITES:
set(shard,key,sha)/tombstone(shard,key)/createShard, beside resolveRef.PUT.h).test/js/*: append rows → re-drain, assert order + ts strict-
increase; set/tombstone a ref → keeper.resolveRef round-trips; a mid-write
crash (kill before rename) leaves the OLD file intact. (be/test/ulog.js
+ be/test/store.js, ctest JABCulogLib/JABCstore.)3ce8aee5.)3ce8aee5 (jab-fork lineage 05e81ec): ULOG write side folded into
ulog.js (crash-safe _stage temp+rename, monotonic nowAfter, write/
append) + ref writers (createShard/set/tombstone) folded into
store.js (was keeper.js). Today at be/shared/{ulog,store}.js; the appender
later moved onto the native C ULOG family (abc._ulog_open/_append/_close,
an in-place booked append — see the ulog.js header). Unblocked JS-049..051.