Repository navigation
docs: state INPUT/OUTPUT/EXIT CODES for every shipped tool - #5
Merged
Merged
Conversation
An audit of the repository's entry points found that none of them stated what they
read, what they write, or what their exit codes mean. A caller could not distinguish
"all quantities matched" (0) from "one mismatched" (1) from "the records were absent"
without reading the source, which is the opposite of what a reproducibility artifact
should require.
Every statement added here was measured on this checkout rather than inferred from a
file's shape, because documenting I/O by inspection produces confident fiction:
exit codes were read with the ast module. main() in audit_round2_duplicates,
run_paid and run_smoke has a single `return 0`, so their failure mode is an
uncaught exception -- run_paid.py contains zero try blocks, verified -- not a
distinct non-zero code. machine_semantic_audit returns the boolean
status != "PASS", which SystemExit turns into 1. The round-2 census main() returns
2 only from `except ConcurrentRunBlocked` and 1 from stop-first-failure.
Two of the flagged files are not command-line tools and were not given exit codes:
stats/report.py has no __main__ and test_run_transport.py is a pytest module. Each
gets a ROLE block instead. Inventing an EXIT CODES section for a library would be the
same class of error as inventing runnability.
RUNNABILITY IS DOCUMENTED AS MEASURED, INCLUDING WHERE IT FAILS
--------------------------------------------------------------
Five round-2 scripts cannot run from this checkout: they import
ecm_tqag.judge_output_contract, official_credentials, official_outcomes,
official_transport, the v310_* modules and the round2 package, none of which are
present under src/ or experiments/six_arm/, so even --help fails at import. Section
10 already states the builder is not part of the release; each script now carries a
RUNNABILITY block naming exactly what is missing, so a reader is not sent chasing an
environment problem. run_paid.py and run_smoke.py need Pillow, which pyproject.toml
does not declare (dependencies = []), and run only from experiments/six_arm; with
Pillow present --help exits 0 and prints 31 and 16 lines respectively.
The pinned verifier was deliberately not edited
-----------------------------------------------
experiments/census_5arm_framef/MANIFEST.json pins verify_reported_quantities.py at
49090 bytes / sha256 20d68f6f... beside the eight released record files. Nothing
here regenerates that manifest and no test verifies it, so adding a docstring would
silently falsify a published integrity claim while every check still passed. Its
contract -- exit 0 on agreement, exit 1 on a mismatch or on an absent record with
"missing released record: records/<name>", --json emitting the ten recomputed tables
-- is documented in the new README section 8.1 instead. The pin is re-verified
unchanged after every step.
The receipt is regenerated because the digest is content-derived: adding a single
comment line was measured to move repo_tree_digest from 96445d36... to 81cd0d8f....
The receipt itself is excluded from that digest, so one pass is stable, which was
also measured rather than assumed.
Verified, comparing this tree against an untouched worktree of origin/main run the
same way:
pytest exit 0, identical result string on both trees
validate fixtures/packages exit 0, "status": "PASS", package_count 3, both trees
machine_semantic_audit PASS, 0 findings, 203 files, digest stable across two
consecutive regenerations
pinned verifier sha256 20d68f6f... and 49090 bytes, unchanged
ast.parse + docstring read all ten edited files parse and expose their contract
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
docs: state INPUT/OUTPUT/EXIT CODES for every shipped tool
Why
An audit of this repository's entry points found that none of them stated what they read, what they write, or what their exit codes mean. A caller could not distinguish "all quantities matched" (
0) from "one mismatched" (1) from "the records were absent" without reading the source — which is the opposite of what a reproducibility artifact should require.What was measured before writing
Every statement added was measured on this checkout, not inferred from a file's shape, because documenting I/O by inspection produces confident fiction:
tools/machine_semantic_audit.py--helpexit 0, 8 lines stdout, stdlib onlyrun_paid.py/run_smoke.py--helpexit 0 (31 / 16 lines) only with Pillow; exit 1ModuleNotFoundError: No module named 'PIL'without itrun_round2*_census.py--helpexit 1,ModuleNotFoundError: ecm_tqag.judge_output_contractaudit_round2_duplicates.py--helpexit 1,ModuleNotFoundError: ecm_tqag.official_outcomesverify_reported_quantities.pychecked: 119 mismatches: 0; exit 1missing released record: records/protocol.jsonwhen a record is hidden;--jsonemits 19758 bytes, 10 top-level keysExit codes were read with the
astmodule rather than guessed.main()inaudit_round2_duplicates,run_paidandrun_smokehas a singlereturn 0, so their failure mode is an uncaught exception (run_paid.pycontains zerotryblocks — verified), not a distinct non-zero code.machine_semantic_auditreturns the booleanstatus != "PASS", whichSystemExitturns into 1. The round-2 censusmain()returns 2 only fromexcept ConcurrentRunBlocked, and 1 from stop-first-failure.Two files are not CLIs and were not given exit codes
stats/report.pyhas no__main__;tests/test_run_transport.pyis a pytest module. Inventing an EXIT CODES section for a library would be the same class of error as inventing runnability, so each gets a ROLE block instead. For the test module the block records the invocation that actually works (cd experiments/six_arm && PYTHONPATH=.:../../src pytest tests/test_run_transport.py, 4 passed) and the fact thattestpaths = ["tests"]means CI's plainpytestnever collects it.Runnability documented as measured, including where it fails
Five round-2 scripts cannot run from this checkout: they import
ecm_tqag.judge_output_contract,official_credentials,official_outcomes,official_transport, thev310_*modules and theround2package — none present undersrc/orexperiments/six_arm/. Section 10 already states the builder is not part of the release; each script now names exactly what is missing so a reader is not sent chasing an environment problem.run_paid.py/run_smoke.pyneed Pillow, whichpyproject.tomldoes not declare (dependencies = []), and run only fromexperiments/six_arm.The pinned verifier was deliberately not edited
experiments/census_5arm_framef/MANIFEST.jsonpinsverify_reported_quantities.pyat 49090 bytes / sha25620d68f6f…beside the eight released record files. Nothing here regenerates that manifest and no test verifies it, so adding a docstring would silently falsify a published integrity claim while every check still passed. Its contract is documented in the new README §8.1 instead. The pin is re-verified unchanged after every step.The receipt is regenerated because the digest is content-derived: adding a single comment line was measured to move
repo_tree_digestfrom96445d36…to81cd0d8f…. The receipt itself is excluded from that digest, so one pass is stable — also measured.Test plan
Compared against an untouched worktree of
origin/main(ee9d015) run the same way, since a check that fails on the baseline cannot be blamed on the diff:machine_semantic_audit: PASS, 0 findings, 203 files, digest stable across two consecutive regenerations (421d39fd…)20d68f6f…, 49090 bytes — unchangedast.parseclean and expose their contractabsolute_private_path,secret,forbidden_baseline,revoked_artifact,human_workflow_claimOne false alarm worth recording:
ecm-tqag validate fixtures/packagesinitially appeared to fail. That was the check's fault, not the repository's — the bare command resolved to a console script in an unrelated virtualenv where the package is not installed, and it fails identically on the untouched baseline. Run against this repository'ssrc/it exits 0 with"status": "PASS",package_count 3, on both trees.Scope
Documentation only. No behaviour changed: 12 files, +327 / −1 (the single deletion is the receipt's digest line).