- MCP
- blame on this site's /mcp
- CLI
- abso blame worker/project/test/unseen.test.ts --json
- JSON
- /christopher/abso-core/blame/worker/project/test/unseen.test.ts?format=json
54 linesengine 98% · rename 2%Last change rename in version 100,
54 lines from 4 changes in 4 versions.
engine75Comments only: take issue numbers out of the engine's comments, so they read for anyone.Compare1// Text the engine keeps and prints can't hold characters a reader can't see:
2// a version message with an escape sequence would run in
engine73Messages and notes can't hold characters a reader can't see: publish, land, amend, pluck and drop messages, starting notes, line notes and announcements are refused when they hold control characters other than tab and newline (CRLF passes), or zero-width, bidirectional or tag characters. It's the same list the website's announcements and Issues use.Compare3// every terminal that shows `abso log` or news.
5import assert from "node:assert/strict";
6import { test } from "node:test";
7import { answer } from "../http.ts";
8import type { ProjectCalls } from "../project-api.ts";
9import { unseenIn } from "../unseen.ts";
11const ESC = String.fromCharCode(0x1b);
12const BEL = String.fromCharCode(0x07);
13const CSI = String.fromCharCode(0x9b);
14const RLO = String.fromCharCode(0x202e);
15const CR = String.fromCharCode(0x0d);
17test("unseenIn: ESC, C1, BEL and bidi overrides are found; newline, tab and CRLF pass", () => {
18 assert.equal(unseenIn(`Fix the parser\n\nDetails\twith a tab${CR}\nand CRLF.`), null);
19 assert.equal(unseenIn(`ok ${ESC}]52;c;aGk=${BEL}`), "a control character at character 4");
20 assert.equal(unseenIn(`${CSI}31m`), "a control character at character 1");
21 assert.equal(unseenIn(`a${CR}b`), "a control character at character 2");
22 assert.match(unseenIn(`abc${RLO}def`)!, /bidirectional embedding or override/);
23 assert.equal(unseenIn(`emoji 🎉 counts as one character ${ESC}`), "a control character at character 33");
engine81unseenIn compares a carriage return's next character in the same list it walks, so a CR not followed by a newline is found after emoji too. Tests with emoji before CR and CRLF.Compare24 assert.equal(unseenIn(`😀😀😀\nB${CR}X`), "a control character at character 6", "a lone CR after emoji is found");
25 assert.equal(unseenIn(`😀😀😀${CR}\nB`), null, "CRLF after emoji passes");
engine73Messages and notes can't hold characters a reader can't see: publish, land, amend, pluck and drop messages, starting notes, line notes and announcements are refused when they hold control characters other than tab and newline (CRLF passes), or zero-width, bidirectional or tag characters. It's the same list the website's announcements and Issues use.Compare26});
rename100abso publish is now abso push, abso sync is now abso pull (abso 427)
Commands, help, flags, messages, MCP tool names and descriptions, hook text, README, SKILL.md and tests say push and pull; "shared" stays the noun ("Pushed version N"). No aliases, no notices. A queued push that was "pulled" is now "turned back", so pull means one thing.
push -f/--force/-u/--all/--tags and pull --rebase/--ff-only/--squash refuse with one plain line naming the abso way; push and pull take no remote or branch.
Kept as stored: log entry kinds (publish, sync, pulled), HTTP route paths, the pipeline trigger on: publish, the yours (unpublished) marker, npm-publish.Compare28test("push, amend, land, starting notes and announcements refuse unseen characters before the engine sees them", () => {
engine73Messages and notes can't hold characters a reader can't see: publish, land, amend, pluck and drop messages, starting notes, line notes and announcements are refused when they hold control characters other than tab and newline (CRLF passes), or zero-width, bidirectional or tag characters. It's the same list the website's announcements and Issues use.Compare29 // A stand-in for the engine: it records each call that gets through.
30 const calls: string[] = [];
31 const project = new Proxy({} as ProjectCalls, {
32 get:
33 (_, name) =>
34 (...args: unknown[]) => {
35 if (name === "exists") return true;
36 calls.push(`${String(name)} ${JSON.stringify(args[1])}`);
37 return { ok: true };
38 },
39 });
40 const osc8 = `Fix ${ESC}]8;;https://example.invalid${BEL}here${ESC}]8;;${BEL}`;
41 const refused = answer(project, "publish", "ann", { message: osc8 });
42 assert.equal(refused.status, 400);
43 assert.match(JSON.stringify(refused.body), /the message holds a control character at character 5/);
44 assert.equal(answer(project, "amend", "ann", { message: `Two ${ESC}[2J` }).status, 400);
45 assert.equal(answer(project, "land", "ann", { message: `Land ${CSI}1m` }).status, 400);
46 assert.equal(answer(project, "starting", "ann", { text: `on ${RLO}this` }).status, 400);
47 assert.equal(answer(project, "announce", "ann", { text: `hi ${BEL}` }).status, 400);
48 assert.deepEqual(calls, [], "none reached the engine");
50 const windows = `Two${CR}\n${CR}\nWritten on Windows.`;
51 assert.equal(answer(project, "publish", "ann", { message: windows }).status, 200);
52 assert.equal(answer(project, "starting", "ann", { text: "on the parser" }).status, 200);
53 assert.deepEqual(calls, [`publish ${JSON.stringify(windows)}`, 'starting "on the parser"']);
54});