bin/*.js helper consolidation + clarity cleanup
The JS be status/be get extensions duplicate small helpers across 12 files and carry some dead/awkward code. Consolidate into shared libs and remove the cruft — pure bin/*.js, NO behavior change (the be-bin-* / be-js-get-* parity tests stay byte-for-byte green). Disjoint from JS-042/JS-044 (touches no js/ C, adds no bindings). Found by the bin/*.js review. Method: Issues.
isFullSha ×6 (wtlog/keeper/classify/dag/subs/wire), join ×8,
dirname ×5 (TWO divergent semantics — a latent bug), dateCol/verbCol/writeStdout (status.js & get.js), shQuote≡shq (status.js/wire.js), the ULOG-drain watermark incantation ×6.
keeper.js hexToBytes reimplements the hex.decode binding;
dag.rowFor inlines the ts logic already in dag.commitTs.
get.js:136 isDir, keeper.js:141 dirname (unused); the
keeper.js ref-delta fallback (indexPackByWalk/frameSha/hashlet60FromBytes /keyFor, ~90 lines) is unreachable on the hot path (pack.scan does it natively) and only log-and-skips. Stale comments keeper.js:88-93,166-173.
lib/path.js (join/dirname/basename, ONE semantics) + lib/sha.js
(isFullSha + hashlet/hex helpers); shared render/ulog helpers; all bin/*.js import them.
hexToBytes → hex.decode; dag.rowFor calls dag.commitTs; remove the twodead funcs; delete-or-gate the keeper ref-delta fallback; fix stale comments.
be-bin-* and be-js-get-* stay byte-for-byte green.bin/*.js ONLY — keep disjoint from JS-042's js/io.cpp. No new bindings
(use existing JABC). Comment budget per CLAUDE.md.
lib/path.js dirname settles on ONE return value — verify each caller's
expectation first (be.js/ignore.js use .//, checkout.js/keeper.js ""//) and preserve behavior.
guard, or delete with a one-line note (it only log-and-skips today).
hex.decode swap; dag.commitTs reuse; dead-func removal; ref-delta gate;comment fixes.
ctest -R 'be-bin|be-js-get' green (parity unchanged); no regressions.land AFTER this to avoid a reconcile; flag the order.
be-bin-sub-status-parity fix (dag.commitTs sub-tip ts) may beuncommitted in the main tree at fork time; if that test reads red on your base, it is PRE-EXISTING, not your change — note it, don't chase it.
cbad5786 (FF onto ff7a378e): 4 new shared libs (bin/lib/path.js/
sha.js/ulog.js/render.js), 12 callers repointed; hexToBytes→hex.decode, dag.rowFor→dag.commitTs, dead funcs gone. Net −177 lines; status.js/ refs.js output BYTE-IDENTICAL. Parity green (the 1 be-bin-sub-status-parity red is the native SUBS-030 adv verb = JS-045, not this change).
wire-cloned packs carry REF_DELTA (pack.scan throws), so it's GATED + deduplicated, not deleted (deleting collapsed status to 1327 unk). REF_DELTA records are still log-and-skipped → a JS-034 REF-base resolve leaf would index them fully.