Teach the pack writer to name a delta base by SHA (REF_DELTA), not only by in-log offset (OFS_DELTA). The missing primitive for a pure-JS thin-pack builder: a delta against a base the peer already has (not shipped). Method: Issues.
git.pack feed(type, content, prevOff, out) emits raw or OFS_DELTA;
dog/git/PACK.c::PACKu8sFeedObj "NEVER emits REF_DELTA" by design (a stored-log concern). A thin pack on the wire DOES carry REF_DELTA.
dog/git writer does both internally, so no JS-API dep, but shares the files.
feed base ref is offset (default → OFS) OR hash (→ REF_DELTA): pass the basebytes + its 20-byte sha; the record names the base by sha, body is the delta.
git.pack reader sees ref-delta, _pack_ref == base sha,apply(delta, base) == target.
dog/git/PACK.c writer (PACKu8sFeedObjRef) — NO manualrecord framing in the binding (CLAUDE.md). Binding is pure marshalling.
PACKu8sFeedObjRef(log,type,content,base,base_sha,cur_off,delta,out?)
to dog/git/PACK.{c,h} — REF header + 20-byte sha + deflated delta (reuses DELTEncode+ZINFDeflate internally, like the OFS path).
_pack_feed_ref(buf,off,type,content,base,baseSha,delta)->end leaf;
JS feed dispatches — number base → OFS (today), {hash,base} → REF.
packref.js beside the jab runtime test/pack.js):
feed a raw base + a REF_DELTA target naming it by sha; reader reports ref-delta + sha; apply==target. Borrow a real base/target object pair from test/get/ fixtures.
feed dispatch; update
dog/git/PACK.md/dog/git/INDEX.md + the runtime INDEX.md/API.md. NB the binding moved: js/pack.hpp/js/cont.cpp → the jab runtime repo pack.hpp/cont.cpp (JAB-001/JAB-005); PACK.c is libdog (dog/ submodule).
742c06ff; shared files since moved to the jab repo).dog/git/PACK.c:135 still "REF_DELTA is never
emitted into a stored log"; no PACKu8sFeedObjRef, feed is OFS-only. The landed push path (GIT-019) full-packs, so nothing ships thin packs yet.