Versions 175 to 318
new file, 221 lines
1+// Recover each past hold's lines from a project's raw log (#19): the held agent's own lines survive in its draft
4+// node --max-old-space-size=8192 scripts/autosettle/replay.ts <log.ndjson> <cases.json> <out.json>
6+// <log.ndjson> is GET /p/<project>/export (one raw log entry per line; owner-only). <cases.json> comes from
7+// extract.ts, which says which settles to look for and what was kept. For each settle, the engine rebuilds three
8+// files from the log: the held agent's at its refused push (its base plus its draft), its base, and theirs' version.
9+// git merge-file --diff3 cuts them into blocks as a pull would, and the blocks pair with the settle's in order.
10+
18+
34+ settler: { agent: string; heldMessage?: string; settleVersion: number; settleMessage?: string };
39+
43+ "usage: node --max-old-space-size=8192 scripts/autosettle/replay.ts <log.ndjson> <cases.json> <out.json>",
52+
81+
89+ if (base === 0 && (e.type === "sync" || e.type === "join") && typeof e.version === "number") base = e.version;
105+
122+ merged = execFileSync("git", ["merge-file", "-p", "--diff3", path("yours"), path("base"), path("theirs")], {
152+
164+ for (const c of group) results.push({ ...c, yours: null, notes: "the settle or theirs isn't in this log" });
171+ if (e.type === "refused" && e.agent === c0.settler.agent && (e.collisions ?? []).some((x) => x.file === c0.file)) {
176+ // No refusal on record (older holds): the draft just before the agent's first pull past theirs.
184+ if (e.agent === c0.settler.agent && e.type === "sync" && (e.version ?? 0) >= c0.theirs.version) {
193+ for (const c of group) results.push({ ...c, yours: null, notes: `no shared version ${base} in this log` });
200+ if (found.length !== group.length) notes.push(`git found ${found.length} blocks for ${group.length} settled`);
- MCP
- compare on this site's /mcp
- CLI
- abso diff 175 318 scripts/autosettle/replay.ts --json
- JSON
- /christopher/abso-core/compare/175..318?file=scripts%2Fautosettle%2Freplay.ts&format=json