Files
msd-core/tests/phase-id-card.test.cjs
BeeHiggs 0967358b8b enhance(#3638): render bracket phase IDs on progress, stats, manager and statusline surfaces (epic #612 PR-5) (#4111)
* enhance(#3638): render bracket IDs on display surfaces

Gate progress, stats, manager, and statusline projections on the bracket convention; validate phase_id_convention and single-source the convention card.

Forward note: the uat.cts bracket co-change remains deliberately deferred to its owning slice.

* chore(#3638): point the changeset at PR #4111

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(#3638): close bracket display review gaps

* docs(#3638): register phase display modules

* chore(#3638): re-trigger CI after macOS shard SIGTERM

`full test (macos-latest, 24, shard 3/3)` failed on 20ce98cd1 in
`tests/lint-compiled-artifact-sync.test.cjs` — the spawned
`scripts/lint-compiled-artifact-sync.cjs` was killed at 60024ms
(`exited null (signal SIGTERM)`, stdout and stderr both empty), 24ms past
the test's own `TSC_COMPILE_TIMEOUT_MS`. That is the failure mode the
constant's comment already documents ("under CI shard load that compile
can exceed the budget, dying to a SIGTERM with empty piped stdout").

No content change; this empty commit exists only to re-run the matrix,
since re-running a job needs write access on the upstream repository.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Tom Boucher <trekkie@nomorestars.com>
2026-09-15 04:47:47 -04:00

59 lines
2.0 KiB
JavaScript

'use strict';
/** ADR-612 PR-5: the bracket convention card has one runtime source. */
const { describe, test } = require('node:test');
const assert = require('node:assert/strict');
const fs = require('node:fs');
const path = require('node:path');
const { normalizeEol } = require('../gsd-core/bin/lib/text-lines.cjs');
const {
phaseIdCard,
PHASE_ID_CARD,
PHASE_ID_LEGEND,
} = require('../gsd-core/bin/lib/phase-id-card.cjs');
const REFERENCE_PATH = path.join(
__dirname,
'..',
'gsd-core',
'references',
'phase-id-convention.md',
);
describe('#3638: phase ID convention card single source', () => {
test('the runtime card labels every identity dimension', () => {
const rendered = phaseIdCard();
assert.match(rendered, /^\[GSD\.02\] 05\.03-01/m);
assert.match(rendered, /plan\s+01/);
assert.match(rendered, /subphase\s+03/);
assert.match(rendered, /phase\s+05/);
assert.match(rendered, /milestone\s+02/);
assert.match(rendered, /project\s+GSD/);
assert.match(PHASE_ID_LEGEND, /no 'Phase' word, no vX\.Y/);
assert.equal(PHASE_ID_CARD.split('\n').length, 7);
});
test('an optional title composes without mutating the canonical card', () => {
assert.equal(
phaseIdCard({ title: 'Bracket convention:' }),
`Bracket convention:\n\n${PHASE_ID_CARD}\n\n${PHASE_ID_LEGEND}`,
);
assert.equal(phaseIdCard(), `${PHASE_ID_CARD}\n\n${PHASE_ID_LEGEND}`);
});
test('the reference card block is generated byte-for-byte from the runtime source', () => {
const reference = normalizeEol(fs.readFileSync(REFERENCE_PATH, 'utf8'));
const opener = '<!-- PHASE-ID-CARD:START -->\n```text\n';
const closer = '\n```\n<!-- PHASE-ID-CARD:END -->';
const start = reference.indexOf(opener);
const end = reference.indexOf(closer, start + opener.length);
assert.notEqual(start, -1, 'generated card opener must remain present');
assert.notEqual(end, -1, 'generated card closer must remain present');
assert.equal(reference.slice(start + opener.length, end), phaseIdCard());
});
});