Skip to content

docs: publish this project's exit-code contract, and flag the family collision - #34

Merged
webdevsamran merged 2 commits into
mainfrom
docs/exit-code-contract
Sep 9, 2026
Merged

docs: publish this project's exit-code contract, and flag the family collision#34
webdevsamran merged 2 commits into
mainfrom
docs/exit-code-contract

Conversation

@webdevsamran

Copy link
Copy Markdown
Owner

These four sibling projects each call their exit codes a public contract — CI gates and onboarding scripts branch on them — and none documented the full set in one place.

Stage C of the plan says to flag the cross-project collision rather than fix it by extracting a shared library. A shared library would couple four independent release cycles, and one of these projects deliberately ships with no dependencies at all.

docs/exit-codes.md now states this project's own codes, and test_exit_codes_documented.py fails if the document and the code disagree in either direction. A documented contract that is wrong is worse than an undocumented one, because wrappers get written from the document.

Verifying the collision changed two things about the plan's description

The plan said "only 0 agrees". Right in substance — 0 means success in all four, though devrepro-doctor names it READY rather than OK.

It also said devrepro-doctor is "the inverse of AVL/LAHB on 2/3/4". It is not an inversion. api-verity-lab has usage=2, internal=4; devrepro-doctor has usage=4, internal=3. The meanings rotate rather than swap — and calling it an inverse would have put a wrong statement into a document about correctness.

The genuinely dangerous collision is code 1

Project Exit 1 means A gate should
api-verity-lab findings detected fail
devrepro-doctor READY_WITH_WARNINGS pass
tooltrace-bench error fail
local-ai-hardware-bench validation error fail

A wrapper that treats any non-zero status as failure blocks on a DevRepro run that reported the machine as usable.

The second is code 2: an operator mistake in two of them, and devrepro-doctor's most important verdict — the machine cannot build this project — in the third.

Verification

ruff · ruff format --check · mypy · full suite green · every link in the new document resolves · drift test verified by renaming a documented code and watching it fail.

…collision

These four sibling projects each call their exit codes a public contract -- CI
gates and onboarding scripts branch on them -- and none documented the full set
in one place. Stage C of the plan says to *flag* the cross-project collision
rather than fix it by extracting a shared library, because that would couple
four independent release cycles and one of these projects deliberately ships
with no dependencies at all.

docs/exit-codes.md now states this project's own codes, and
test_exit_codes_documented.py fails if the document and the code disagree in
either direction. A documented contract that is wrong is worse than an
undocumented one, because wrappers get written from the document.

Verifying the collision rather than repeating the plan's description of it
changed two things about that description.

The plan said "only 0 agrees". Right in substance: 0 means success in all four,
though devrepro-doctor names it READY rather than OK.

It also said devrepro-doctor is "the inverse of AVL/LAHB on 2/3/4". It is not
an inversion. api-verity-lab has usage=2 and internal=4; devrepro-doctor has
usage=4 and internal=3. The meanings rotate rather than swap, and calling it an
inverse would have put a wrong statement into a document about correctness.

The genuinely dangerous collision is code 1:

    api-verity-lab           1 = findings detected      (a gate should fail)
    devrepro-doctor          1 = READY_WITH_WARNINGS    (a gate should pass)
    tooltrace-bench          1 = error
    local-ai-hardware-bench  1 = validation error

A wrapper that treats any non-zero status as failure blocks on a DevRepro run
that reported the machine as usable. The second is code 2: an operator mistake
in two of them, and devrepro-doctor's most important verdict -- the machine
cannot build this project -- in the third.

Verified: ruff, ruff format, mypy, full suite green, every link in the new
document resolves.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…nk inside the site

Two mistakes of mine, both of which only showed up on Linux CI.

The test opened `docs/exit-codes.md`. This repository's file is
`docs/EXIT-CODES.md` -- the name mkdocs.yml has always referenced. Windows
resolves those to the same file, so the test passed locally and failed across
the entire Python matrix in CI. The path now matches what git tracks.

The same case-insensitivity meant my generator's write to `docs/exit-codes.md`
landed on the existing `EXIT-CODES.md` rather than creating a second file,
which is the only reason this is a naming fix rather than a duplicate document.

The docs build then failed separately: `mkdocs build --strict` rejects a
relative link that leaves the documentation tree, and I had linked
`../devrepro/core/exit_codes.py`. My earlier check confirmed every link
resolved on the filesystem, which was true and beside the point -- mkdocs asks
a different question. An absolute GitHub URL satisfies both renderers.

Also corrects requirements-docs.txt, whose comment claimed the pin was "below
9.7" for licensing reasons and that "9.6.x remains ISC". Three things wrong
with that: the pin had already been moved to >=9.7.7 by the Dependabot bump in
number 17, crossing the very boundary the comment declared; mkdocs-material is
MIT at 9.5, 9.6, 9.7.0 and 9.7.7 by PyPI's own classifiers; and there is no ISC
line. The pin is fine on reproducibility grounds and now says so. The lesson
worth keeping is that an automated bump walked straight through a stated
constraint, because the constraint lived in a comment nothing enforced.
@webdevsamran
webdevsamran merged commit 4d72b42 into main Sep 9, 2026
18 checks passed
@webdevsamran
webdevsamran deleted the docs/exit-code-contract branch September 9, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant