Symptom
scripts/cast-vote.py's module docstring carries an Exit codes table, and the tool's own text says
the counter's refusal is the authority and that the caller scripts against these codes. The table
enumerates four causes of rc 2, but the module returns 2 from five sites, and its rc 0
row describes a review that was posted while one of the tool's own rc 0 paths posts nothing.
Measured on master 75095ef6 (grep -n 'return 2' scripts/cast-vote.py → lines 311, 316, 324, 327,
353; the table is at lines 54–64).
Measured
rc 2 site (master) |
cause |
in the table? |
| 311 |
--body-file could not be read (OSError) |
no |
| 316 |
preflight refused: no cycle id / more than one / malformed --cycle / --cycle disagrees |
yes |
| 324 |
the vote count could not be read (the counter raised) |
no |
| 327 |
this cycle already has a counted vote or a veto here |
yes |
| 353 |
gh failed |
yes |
The rc 0 row reads "the review is posted and check-vote-count.py counts it", while
--dry-run (documented in Usage, and in --help as "run every check, post nothing") returns 0
without posting anything — assert rc == 0 in tests/test_cast_vote.py::test_dry_run_posts_nothing.
Both gaps are pre-existing: master's table has the same four listed causes and the same dry-run
path, so neither is introduced by the current work on this file (PR #1308 touches the veto and
none rows, which this measured as accurate).
Why it matters
A caller scripting on the exit code reads this table as the contract: 0 is what a wrapper uses to
decide whether a vote went out, and an unlisted 2 reads as "not one of the documented refusals".
This repo's own rule is that a derived claim is not written where it can be measured — here the
table can be measured against the return statements, so the two rows can be kept in step by
naming the two missing causes (and by saying that --dry-run exits 0 having posted nothing).
Expected
- the
rc 2 row names the two remaining causes — an unreadable --body-file, and a vote count that
could not be read — or states explicitly why they are deliberately out of scope;
- the
rc 0 row no longer implies a post on every 0 (mention the dry run).
Either is a prose change to one docstring; the cheaper check is that the enumerated causes match
grep -n 'return 2', which is what made this measurable in the first place.
Symptom
scripts/cast-vote.py's module docstring carries an Exit codes table, and the tool's own text saysthe counter's refusal is the authority and that the caller scripts against these codes. The table
enumerates four causes of
rc 2, but the module returns2from five sites, and itsrc 0row describes a review that was posted while one of the tool's own
rc 0paths posts nothing.Measured on master
75095ef6(grep -n 'return 2' scripts/cast-vote.py→ lines 311, 316, 324, 327,353; the table is at lines 54–64).
Measured
rc 2site (master)--body-filecould not be read (OSError)preflightrefused: no cycle id / more than one / malformed--cycle/--cycledisagreesghfailedThe
rc 0row reads "the review is posted andcheck-vote-count.pycounts it", while--dry-run(documented in Usage, and in--helpas "run every check, post nothing") returns0without posting anything —
assert rc == 0intests/test_cast_vote.py::test_dry_run_posts_nothing.Both gaps are pre-existing: master's table has the same four listed causes and the same dry-run
path, so neither is introduced by the current work on this file (PR #1308 touches the
vetoandnonerows, which this measured as accurate).Why it matters
A caller scripting on the exit code reads this table as the contract:
0is what a wrapper uses todecide whether a vote went out, and an unlisted
2reads as "not one of the documented refusals".This repo's own rule is that a derived claim is not written where it can be measured — here the
table can be measured against the
returnstatements, so the two rows can be kept in step bynaming the two missing causes (and by saying that
--dry-runexits0having posted nothing).Expected
rc 2row names the two remaining causes — an unreadable--body-file, and a vote count thatcould not be read — or states explicitly why they are deliberately out of scope;
rc 0row no longer implies a post on every0(mention the dry run).Either is a prose change to one docstring; the cheaper check is that the enumerated causes match
grep -n 'return 2', which is what made this measurable in the first place.