Skip to content

Commit 9d13278

Browse files
committed
pm: the child-run helper in post-stamped carries no self-test compound name
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5kXwEA8abP4hMhtodW
1 parent 848fbb8 commit 9d13278

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

‎scripts/pm/post-stamped.mjs‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,11 +4180,11 @@ async function main(argv) {
41804180
// ---------------------------------------------------------------------------
41814181

41824182
/** How long a child `--self-test` this self-test spawns may run before it is cut and named (#33603). */
4183-
const CHILD_SELF_TEST_TIMEOUT_MS = 120_000;
4183+
const CHILD_RUN_TIMEOUT_MS = 120_000;
41844184

41854185
/** Why a spawned child self-test did not pass, in one line: a timeout or signal, and the child's own ✗ lines. Pure. */
4186-
function childSelfTestDetail(result) {
4187-
const cut = result?.error?.code === 'ETIMEDOUT' ? `timed out after ${CHILD_SELF_TEST_TIMEOUT_MS} ms` : result?.error ? `did not run (${result.error.code ?? result.error.message})` : null;
4186+
function childRunDetail(result) {
4187+
const cut = result?.error?.code === 'ETIMEDOUT' ? `timed out after ${CHILD_RUN_TIMEOUT_MS} ms` : result?.error ? `did not run (${result.error.code ?? result.error.message})` : null;
41884188
const failures = `${result?.stdout ?? ''}\n${result?.stderr ?? ''}`.split('\n').map((l) => l.trim()).filter((l) => l.startsWith('✗ ') && !/ self-test: /u.test(l)).slice(0, 6);
41894189
return [cut, result?.signal ? `signal ${result.signal}` : null, `exit ${result?.status ?? 'none'}`, failures.join(' | ') || null].filter(Boolean).join('; ');
41904190
}
@@ -5813,10 +5813,10 @@ export function selfTest() {
58135813
t('⭐ a card BODY is untouched — the check is a record\'s, and a record is a comment', judgeBody(REC(CONTRACT_REVIEW_TIER_NAME), { mode: 'body' }, NOW_MS).ok);
58145814
t('the CLI carries --tier-evidence=PATH on a comment, and leaves it null when absent', parseOptions(['--comment=1', `--tier-evidence=${atTier}`]).options.tierEvidence === atTier && parseOptions(['--comment=1']).options.tierEvidence === null);
58155815
t('⛔ --tier-evidence with --body, or with no path, is refused', parseOptions(['--body=1', '--tier-evidence=x']).ok === false && parseOptions(['--comment=1', '--tier-evidence=']).ok === false);
5816-
const verifier = spawnSync(process.execPath, [fileURLToPath(new URL('./verify-review-tier.mjs', import.meta.url)), '--self-test'], { encoding: 'utf8', timeout: CHILD_SELF_TEST_TIMEOUT_MS });
5817-
t('the verifier\'s own --self-test runs HERE, so CI runs it inside check:pm-post-stamped: exit 0 and its success line', verifier.status === 0 && /✓ verify-review-tier self-test: \d+ cases pass/u.test(verifier.stdout), childSelfTestDetail(verifier));
5818-
t('a child self-test that hangs is cut at its timeout and named, and a failing one relays its own ✗ lines', /timed out after \d+ ms/u.test(childSelfTestDetail({ status: null, signal: 'SIGTERM', error: { code: 'ETIMEDOUT' }, stdout: '', stderr: '' })) &&
5819-
childSelfTestDetail({ status: 1, signal: null, error: undefined, stdout: ' ✓ a\n', stderr: ' ✗ case b\n ✗ case c\n✗ verify-review-tier self-test: 2 failure(s)\n' }).includes('✗ case b | ✗ case c'));
5816+
const verifier = spawnSync(process.execPath, [fileURLToPath(new URL('./verify-review-tier.mjs', import.meta.url)), '--self-test'], { encoding: 'utf8', timeout: CHILD_RUN_TIMEOUT_MS });
5817+
t('the verifier\'s own --self-test runs HERE, so CI runs it inside check:pm-post-stamped: exit 0 and its success line', verifier.status === 0 && /✓ verify-review-tier self-test: \d+ cases pass/u.test(verifier.stdout), childRunDetail(verifier));
5818+
t('a child self-test that hangs is cut at its timeout and named, and a failing one relays its own ✗ lines', /timed out after \d+ ms/u.test(childRunDetail({ status: null, signal: 'SIGTERM', error: { code: 'ETIMEDOUT' }, stdout: '', stderr: '' })) &&
5819+
childRunDetail({ status: 1, signal: null, error: undefined, stdout: ' ✓ a\n', stderr: ' ✗ case b\n ✗ case c\n✗ verify-review-tier self-test: 2 failure(s)\n' }).includes('✗ case b | ✗ case c'));
58205820
const own = readFileSync(SELF_PATH, 'utf8');
58215821
t('structural: the transcript judge is imported from verify-review-tier.mjs, ⛔ never restated here', /import \{[^}]*\bverifyReviewTranscriptFile\b[^}]*\} from '\.\/verify-review-tier\.mjs';/u.test(own) && !/function\s+(judgeReviewTranscript|verifyReviewTranscriptFile)\b/u.test(own));
58225822
} finally {

0 commit comments

Comments
 (0)