Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(cli): show ends a first line at every unicode break [N30]
Corey Olsonc725b15a2e1e
diff --git a/src/cli.js b/src/cli.jsindex e68814c9..96ff9b38 100644--- a/src/cli.js+++ b/src/cli.js@@ -340,15 +340,15 @@ const freezer = (ctx) => (item) => frozenCriterion(loadSpec(ctx.info.root, ctx.cconst NOTE_LINE = 120;/**- * A note's first line, cut to NOTE_LINE characters with … marking the cut. A line ends at any line- * break, CRLF included, and characters are counted as a reader sees them, so a cut never splits an- * emoji or an accented letter.+ * A note's first line, cut to NOTE_LINE characters with … marking the cut. A line ends at any break+ * Unicode makes mandatory (UAX #14): LF, VT, FF, CR, CRLF, NEL, LS and PS. Characters are counted+ * as a reader sees them, so a cut never splits an emoji or an accented letter.** @param {string} note* @returns {string}*/function firstLineOf(note) {- const line = note.split(/\r\n|[\n\r\u2028\u2029]/)[0];+ const line = note.split(/[\n\v\f\r\x85\u2028\u2029]/)[0];const characters = [...new Intl.Segmenter(undefined, { granularity: 'grapheme' }).segment(line)];return characters.length > NOTE_LINE ? `${characters.slice(0, NOTE_LINE).map((part) => part.segment).join('')}…` : line;}diff --git a/test/show.test.js b/test/show.test.jsindex f0c49190..57ff15d7 100644--- a/test/show.test.js+++ b/test/show.test.js@@ -33,6 +33,18 @@ const NOTES = [/** An earlier note of exactly 120 characters on one line: printed whole, with nothing to hint at. */const EXACT = `Too slow: ${'x'.repeat(110)}`;+/** Every break Unicode makes mandatory (UAX #14); each one ends a note's first line. */+const BREAKS = {+ LF: '\n',+ CR: '\r',+ CRLF: '\r\n',+ VT: String.fromCharCode(0x0b),+ FF: String.fromCharCode(0x0c),+ NEL: String.fromCharCode(0x85),+ LS: String.fromCharCode(0x2028),+ PS: String.fromCharCode(0x2029),+};+test('show prints the latest verdict in full and earlier ones as one line; --history and --json print every note [N30]', () => {const dir = realpathSync(mkdtempSync(join(tmpdir(), 'pullboard-show-')));dirs.push(dir);@@ -80,6 +92,8 @@ test('show prints the latest verdict in full and earlier ones as one line; --his};rounds('Greet', NOTES, ['a', 'b', 'c']);rounds('Greet fast', [EXACT, 'Accept: fast now.'], ['d', 'e']);+ const broken = Object.entries(BREAKS).map(([name, end]) => `Break ${name} first.${end}hidden after ${name}`);+ rounds('Greet on every break', [...broken, 'Accept: every break ends a line.'], ['1', '2', '3', '4', '5', '6', '7', '8', '9']);} finally {store.closeBoard(board);}@@ -111,4 +125,11 @@ test('show prints the latest verdict in full and earlier ones as one line; --hisassert.equal(whole.status, 0, whole.stderr);assert.ok(whole.stdout.includes(`REJECT TEST_FAILURE by web-2 at dddddddddddd: ${EXACT}\n`), 'a first line of exactly 120 characters is printed whole');assert.doesNotMatch(whole.stdout, /earlier verdicts shortened/, 'no hint when no earlier note was shortened');++ const breaks = run('show', '3');+ assert.equal(breaks.status, 0, breaks.stderr);+ Object.keys(BREAKS).forEach((name, round) => {+ assert.ok(breaks.stdout.includes(`REJECT TEST_FAILURE by web-2 at ${String(round + 1).repeat(12)}: Break ${name} first.\n`), `${name} ends the first line`);+ });+ assert.doesNotMatch(breaks.stdout, /hidden after/, 'nothing after any break is printed');});