Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed

Versions 2 to 318

Compare

+27 −0 in 1 place
new file, 27 lines
1+import assert from "node:assert/strict";
2+import { test } from "node:test";
3+import { LOG_PART_CHARACTERS, logParts, streamedLogParts } from "../src/engine-project.ts";
4+
5+test("streamed canonical rows exactly match legacy serialization and boundaries", () => {
6+ for (const offset of [-2, -1, 0, 1, 2]) {
7+ const value = { text: "x".repeat(LOG_PART_CHARACTERS - 9 + offset) + '😀\ud800\n"', rest: [null, false, 3] };
8+ assert.deepEqual([...streamedLogParts(value)], logParts(JSON.stringify(value)));
9+ }
10+ const value = { files: Array.from({ length: 100 }, (_, i) => `${i}:` + "中".repeat(20000)) };
11+ assert.deepEqual([...streamedLogParts(value)], logParts(JSON.stringify(value)));
12+});
14+test("canonical row streaming never stringifies a whole object or a large string", (t) => {
15+ const stringify = JSON.stringify;
16+ t.mock.method(JSON, "stringify", (value: unknown) => {
17+ assert.ok(typeof value !== "object", "whole-object serialization is forbidden");
18+ if (typeof value === "string") assert.ok(value.length <= 16384);
19+ return stringify(value);
20+ });
21+ let length = 0;
22+ for (const part of streamedLogParts({ text: "x".repeat(6_000_000) })) {
23+ assert.ok(part.length <= LOG_PART_CHARACTERS);
24+ length += part.length;
25+ }
26+ assert.equal(length, 6_000_011);
27+});
MCP
compare on this site's /mcp
CLI
abso diff 2 318 server/test/streamed-log-append.test.ts --json
JSON
/christopher/abso-core/compare/2..318?file=server%2Ftest%2Fstreamed-log-append.test.ts&format=json