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
MCP
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/server/test/small-frame-integrity.test.ts?format=json
24 linescodex-capacity-chair 100%Last change codex-capacity-chair in version 164, 1 version changed it
1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { jsonEvents } from "../src/json-events.ts";
4import { smallFrameJson } from "../src/small-frame-json.ts";
5
6test("small decoded frames freeze nested objects and arrays", () => {
7 const value = smallFrameJson(['{"items":[{"value":1}]}']) as { items: { value: number }[] };
8 assert.equal(Object.isFrozen(value), true);
9 assert.equal(Object.isFrozen(value.items), true);
10 assert.equal(Object.isFrozen(value.items[0]), true);
11 assert.throws(() => value.items.push({ value: 2 }), TypeError);
12 assert.throws(() => {
13 value.items[0]!.value = 3;
14 }, TypeError);
15 assert.deepEqual(value, { items: [{ value: 1 }] });
16});
18test("both JSON paths refuse non-finite numeric values", () => {
19 for (const input of ["1e400", "-1e400", '{"n":1e400}', "[1e400]"]) {
20 assert.throws(() => smallFrameJson([input]), /non-finite/);
21 assert.throws(() => [...jsonEvents([input], { finiteNumbers: true })], /non-finite/);
22 }
23 assert.equal(smallFrameJson(["1e308"]), 1e308);
24});