bin/patch.js + weave.merge3 — the absorb-merge verb
be patch as JS: the LAST verb not mirrored. Resolve ours/theirs/fork, walk the fork/ours/theirs trees, 3-way-merge each diverged file into the worktree (conflict fences), append ONE patch row — no commit, no reachability. Verb-first (scope a): the post-side "theirs" consume is OUT — post.js's POSTSCOPE throw (post.js:160) stays, so landing a patch still needs native be post until a follow-up. Needs ONE new libdog leaf WEAVEMerge3Bytes + a weave.merge3 binding. ← JS-051. Picks up the PATCH the JS-046 umbrella deferred. Method: Issues.
be patch → sniff/PATCH.c: 3-way weave merge (fork/ours/theirs),
writes merged bytes to the wt, appends one patch row, NO reachability (next be post squashes). Scopes: ?br NEXT (one commit), ?br! WHOLE (full stack), #sha NAMED (cherry). Row: ?heads/X#<ours>,<theirs> (AT.h:5).
GRAFMergeWtFileTunable (graf/GET.c:301) — DAG-history
weave, UNBINDABLE (graf). The bytes-only GRAFMerge3Bytes (graf/GET.c:467 — replay base→ours→theirs into ONE weave + WEAVEEmitMerged) depends ONLY on abc+dog (WEAVEFromBlob/Apply/Diff + NEIL/tok) → portable to libdog.
bin/post.js/get.js/bin/lib/* give the rest: scope via store+dag,
trees via git.tree, row via ulog.append, marker scan conflict.js, wt write via checkout-style mode/symlink/exec + io.setMtime restamp.
WEAVEMerge3Bytes(base,ours,theirs,ext,out) — port GRAFMerge3Bytes
(+ the WEAVEFromBlob/Apply/Diff it needs) into dog/WEAVE.c; reconcile the dog/graf WEAVE.c symbol dup. js: weave.merge3(...)->Buf leaf (rule #4).
bin/lib/patchscope.js: resolve ours/theirs/fork + scope (NEXT/WHOLE/NAMED,
the !/# forms) over store.resolveRef + a dag LCA.
bin/patch.js: tandem fork/ours/theirs tree walk → per-diverged file
weave.merge3 → write merged bytes to the wt (mode/symlink/exec, mirror sniff/PATCH.c:write_blob), restamp, append patch row, status banner.
here"). Full-history fidelity (the tunable form) is OUT: merge3 uses the fork/ours/theirs TIP blobs only — flag any history-sensitive divergence.
decide.js/post.js "theirs" consume — a follow-up
(JS-053) unblocks be patch→be post. Conflict markers land in the wt; the next native be post refuses (POSTCFLCT) until resolved, exactly as today.
GRAFMergeWtFileTunable): DAG-fold each side's commit history into a weave via the BOUND dog leaves (weave.fold=WEAVENext linear, weave.merge=WEAVEMerge at merge commits), then weave.merge ours⊕theirs + weave.merged to fence. NOT a 3-blob merge — weave.merge3 (= graf merge debug) was a wrong turn.
sniff/PATCH.c resolve_ours/target/parent_tip: ours =
wt tip, theirs = ref/cherry tip, fork = LCA(parent_tip, theirs) branch or parent(cherry) named; the ! selects WHOLE vs NEXT ancestor-skip.
patch row only, non-noop; verb patch; N-hash merge URI; restamp everytouched file to the row ts (AT.h stamp-set rule).
weave.merge3/WEAVEMerge3Bytes (the 3-blob
GRAFMerge3Bytes mirror) — that is the graf merge DEBUG primitive, not patch's engine. No new binding needed: the weave-merge leaves are bound.
bin/patch.js on full-history reconstruction (buildSideWeave/foldCommit/
mergeApply): per file, parents-first DAG fold (weave.fold linear, weave.merge at merges) → weave.merge+weave.scope+weave.merged. JS walk.
whole, readd-line, multiedit-line, addmod, next-branch, exec-symlink).
SOURCE_DATE_EPOCH (the DIS-051 RONNow hook) in
test/js/lib/patchcase.sh → reproducible shas, stable (8/8, 5/5 ctest). conflict MATCHES native; same-anchor gated to the dog golden (residual below).
WEAVEMerge) — ACCEPTED,
not a bug; flake was a test artifact, fixed by the SOURCE_DATE_EPOCH pin. same-anchor residual: native GRAFMergeWtFileTunable applies theirs' TIP onto the ours-weave (ASYMMETRIC → structurally ours-first), dog merges symmetrically (hash-order). Side-order only; row/banner/restamp match native. Converges when DOG-005 retires graf. (Not DIS-044; WEAVEEmitMerged untouched.)
weave.hpp/INDEX.md touch.4c6fa1fa (on 1afd5f2d): full-history weave reconstruction —
bin/patch.js + bin/lib/patchscope.js + checkout.materialise + 9 test/js/patch/* cases. Non-conflict byte-identical to native; conflicts deterministic via SOURCE_DATE_EPOCH (same-anchor = the DOG-005 graf-vs-dog residual, gated to the dog golden). 397/397 green on the reconciled tree. Landed onto the JS-053 main-tree merge; test/CMakeLists.txt fence resolved (both be-js-patch/be-js-bro blocks kept).