Child of GIT-001; depends on GIT-002/GIT-004. js/pack.hpp is a third copy of pack-log logic: JABCPackFeedOfs (:23) is a hand-rolled replica of keeper's pack_feed_ofs, JABCpackFeed (:58) re-implements the raw-vs-OFS_DELTA decision (inflate base, DELTEncode, size compare, emit header+ofs varint+deflate), and JABCpackNext (:120) re-inflates to learn a record's compressed length. Once GIT-002 lands the writer and GIT-004 the resolver in dog/git, the binding must hold NO pack-log logic — it only marshals JS typed arrays into u8s and calls the dog/git functions. See PackLog, INDEX, CLAUDE.
JABCpackFeed's delta-or-raw block is a line-for-line copy of KEEPPackFeed's inner emit (keeper/KEEP.c:1709-1766); the landed PACKu8sFeedOfs dedup was necessary but insufficient — the surrounding inflate-base / DELTEncode / size-compare / emit-hdr+deflate sequence is still duplicated.malloc scratch: JABCpackFeed/JABCpackNext malloc base + delta buffers, against CLAUDE §5 (resource allocation at the top of the call chain; BASS carve for scratch).binto and basec re-derive the identical base range (js/pack.hpp:77/:83); and PACKu8sFeedObjHdr's return is ignored in the OFS arm (:90) but checked in the raw arm (:102), so a near-full buffer can emit a partial OFS header, fail the deflate, and let the raw fallback write a SECOND header over the advanced head — latent double-header corruption, masked today only because JS sizes the buffer to fit.js/pack.hpp to pure marshalling over the dog/git pack-log core, holding zero delta/encode/inflate decisions.JABCPackFeedOfs, the inline feed delta-decision, the re-inflate record-end scan) once GIT-002/GIT-004 land.binto/basec base-range dup and the latent double-header corruption from the ignored OFS-arm return.js/pack.hpp entry resolves a typed array to a u8s (the one boundary touch, JABCBytesOf) and calls a dog/git PACK function; zero delta/encode/inflate decisions in the binding.Buf/Uint8Array; no malloc in the binding.hit/hash bindings (the "wh128 layer above" noted in pack.hpp).JABCPackFeedOfs outright — it is replaced by PACKu8sFeedOfs (GIT-002); the binding never open-codes a varint.—
_pack_feed at the dog/git writer (GIT-002): pass type, content, resolved base bytes + base offset; the dog/git function decides raw|OFS_DELTA and emits, checking every header/varint/deflate return (closing the ignored-return gap). Delete the inline inflate/DELTEncode/compare block and the binto/basec dup.JABCpackNext's re-inflate-to-measure and the JS-composed seek+delt.apply chain.JABCPackFeedOfs; keep the thin drains (_pack_count/_type/_size/_baseoff/_ref/_inflate) as marshalling over PACKDrain*.js/test/pack.js green; add a cross-impl vector — a log written by keeper round-trips byte-identically when read back through the JABC binding (and vice versa), proving keeper + binding share one format.d8fec51a on beagle.new: js/pack.hpp is pure marshalling — _pack_feed→
PACKu8sFeedObj, _pack_resolve→PACKResolveOfs, _pack_next→new PACKRecordEnd (dog/git/PACK.c:184, decl PACK.h:136 — record-extent now owned in dog/git). Deleted JABCPackFeedOfs, the inline inflate/DELTEncode/compare emit block, the binto/basec dup, JABCpackNext's re-inflate, and all malloc/free (scratch is JS-owned). Double-header corruption structurally gone (writer owns the emit + checks every return). Cross-impl vector (JABCpack): a chain written via the binding resolves byte-identically through the dog/git chase. 413/413, ASan/LSan clean.