You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit de3eb88
Browse filesBrowse the repository at this point in the historyBrowse files
fix(scripts): refuse a logless check-test-completeness run instead of reporting exit 1 (#13152)
A gate that cannot measure must not answer in the vocabulary of a verdict. Run
with no turbo-test-log, check-test-completeness exited 1 and printed its usage
banner -- indistinguishable at a glance from a finding, and the bare form is
exactly what the gate family `scripts/pm/dispatch-gates.mjs` derives prints. Six
devs on six unrelated cards each re-derived that it was an invocation error.
A missing or unreadable log now answers with the repo's own PREREQUISITE NOT MET
/ exit 3 refusal convention (check-dual-build-cjs-loads, check-half-states),
naming what it needs and saying that nothing was measured. A malformed command
line keeps exit 1: a typo in the caller's own line is not an absent prerequisite,
and nothing emits one.
CI behaviour is unchanged: both call sites in ci.yml pass the argument and guard
the file's existence first, and neither branches on the exit code. Verified by
running both CI shapes before and after -- byte-identical output, same codes.
The argv classification is now a pure exported function, so the exit-code
contract is pinned by the self-test that already runs on every invocation rather
than asserted in a comment.
Claude-Session: https://claude.ai/code/session_01CPrUz21stTFhJRUirdc4yw
Co-authored-by: Claude <noreply@anthropic.com>
'backstop: a reported failure was charged as silent',
709
865
);
710
866
867
+
// -- The invocation contract: a refusal must not wear a verdict's code. ----
868
+
// ⛔ This block exists to make the regression LOUD, not to describe it. The
869
+
// defect it pins was measured six times in one session: the bare invocation
870
+
// -- the one the derived gate family prints -- answered exit 1 plus a usage
871
+
// banner, which reads as a finding. If a later edit sends it back to exit 1,
872
+
// these cases red on the very next invocation of this script.
873
+
eq(invocationVerdict([]).verdict.exit,EXIT_PREREQUISITE_NOT_MET,'bare invocation: not the refusal code');
874
+
eq(invocationVerdict([]).verdict.exit===EXIT_FINDINGS,false,'bare invocation: regressed to a finding code');
875
+
eq(invocationVerdict([]).paths,null,'bare invocation: handed back paths to work from anyway');
876
+
eq(invocationVerdict([]).verdict.lines.some((l)=>l.includes('PREREQUISITE NOT MET')),true,'bare invocation: no refusal headline');
877
+
eq(invocationVerdict([]).verdict.lines.some((l)=>l.includes('Nothing was measured')),true,'bare invocation: does not say nothing was measured');
878
+
eq(invocationVerdict([]).verdict.lines.some((l)=>l.includes('NOT a finding')),true,'bare invocation: does not say it is not a finding');
879
+
// ⭐ The DUAL, and it is what makes the four assertions above readings rather
880
+
// than a classifier that can only ever refuse: the same function returns
881
+
// "proceed" for a well-formed line, and returns the path it was given.
882
+
eq(invocationVerdict(['t.log']).verdict,null,'well-formed invocation: refused a usable command line');
883
+
eq(invocationVerdict(['t.log']).paths.logPath,'t.log','well-formed invocation: lost the log path');
884
+
eq(invocationVerdict(['t.log','--scheduled','s.txt','--package-list','p.json']).paths.packageListPath,'p.json','well-formed invocation: lost a flag value');
885
+
// A named log that cannot be read is the same fact as no log at all.
886
+
eq(unreadableLogVerdict('/nope.log','ENOENT').exit,EXIT_PREREQUISITE_NOT_MET,'unreadable log: not the refusal code');
887
+
eq(unreadableLogVerdict('/nope.log','ENOENT').lines.some((l)=>l.includes('NOT a finding')),true,'unreadable log: does not say it is not a finding');
888
+
// ⛔ The deliberate boundary, pinned so it is a decision and not a leftover:
889
+
// a malformed command line is NOT a prerequisite and keeps exit 1.
0 commit comments