Skip to content

Document console_view's extra-argument exit and the unknown usage-reporting version - #65

Merged
dmccoystephenson merged 2 commits into
mainfrom
feature/readme-console-view-and-version-accuracy
Nov 11, 2026
Merged

dmccoystephenson merged 2 commits into
mainfrom
feature/readme-console-view-and-version-accuracy

Conversation

@dmccoystephenson

@dmccoystephenson dmccoystephenson commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

A Stage A documentation accuracy sweep was run against the source. Two gaps were found and are fixed here:

  • console_view.py exits with status 2 and prints the usage line when the environment ID is followed by further arguments (parseEnvironmentId requires exactly one argument). The README's Text rendering section and the module docstring said only "missing or is not an integer". Both now name the extra-argument case, and a main()-level test (test_a_further_argument_prints_the_usage_and_exits_two_without_reaching_viron) pins it. Before this, only parseEnvironmentId was tested for that case.
  • usage_reporting.py sends unknown as the version when version.txt is missing, cannot be opened or is empty (readVersion() or UNKNOWN_VERSION; readVersion catches only OSError, so an undecodable file instead disables reporting through buildClient). The README's Usage reporting section now says so. That behaviour was already covered by test_missing_version_file_reports_an_unknown_version.

No production behaviour is changed. Only a docstring in console_view.py is edited.

No tracking issue: the gaps were found during the sweep.

Deferred issues

Every open issue was left for later because each one needs an owner decision or is too large for this cycle:

Test plan

  • python3 -m py_compile *.py passes
  • python3 -m unittest discover -s tests passes locally: Ran 206 tests ... OK (Python 3.8; Viron is stubbed)
  • The Tests workflow is green on this PR

This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).

🤖 Generated with Claude Code


drafted by Claude on behalf of Daniel Stephenson

dmccoystephenson and others added 2 commits November 11, 2026 01:17
console_view.py exits 2 when the environment ID is followed by further
arguments, which the README and the module docstring did not mention; a
main()-level test now covers it. The README also now says that usage
reporting sends "unknown" as the version when version.txt cannot be read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
readVersion catches OSError alone; a version.txt that cannot be decoded
raises a ValueError that buildClient turns into a disabled client, so
"unreadable" overstated the fallback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dmccoystephenson

Copy link
Copy Markdown
Member Author

Self-review rubric (head 97c20e6):

  • Scope: PASS. All three files are needed: two README sentences, the matching console_view.py docstring, and one test that pins the newly documented exit path. There are no unrelated edits.
  • Tests-new: PASS. No new functions were added. The newly documented console_view.main() path is covered by test_a_further_argument_prints_the_usage_and_exits_two_without_reaching_viron. The unknown version fallback was already covered by test_missing_version_file_reports_an_unknown_version.
  • Tests-fix: not applicable, since this is not a bug fix. A mutation check was still run. Changing len(argv) != 2 to len(argv) < 2 in parseEnvironmentId made the new test and test_more_than_one_argument_gives_none fail. With the original code restored, all 15 tests in tests.test_console_view passed.
  • Sibling structure: PASS. The new test copies the layout of the neighbouring test_a_missing_argument_..._exits_two_without_reaching_viron.
  • Sibling renames: not applicable. Nothing was renamed.
  • Docs: PASS. README.md is updated. create_environments.bat, up.bat and down.bat are untouched and not affected.
  • Issue resolution: not applicable. There is no Closes #N, and the PR body says the gaps were found during the sweep.
  • Manual validation: PASS. python3 -m py_compile *.py passed. python3 -m unittest discover -s tests ran 206 tests, all OK, locally. The Tests workflow run 42986061408 is green on 97c20e6. No rendering or Viron-service code was changed, so the live Viron run is not applicable.

One finding was fixed during review:

  • README.md:304: the first draft said an unreadable version.txt falls back to unknown. readVersion catches only OSError. A file that cannot be decoded raises UnicodeDecodeError, a ValueError, which buildClient catches and answers with a disabled client. The wording was narrowed to "missing, cannot be opened or is empty" in 97c20e6, and the PR body was updated to match.

Out-of-diff observation, not acted on here: that decode-error path turns reporting off for the run and prints Could not configure usage reporting (...), rather than reporting unknown. Whether that difference is intended is not evident from the source. It was left out because changing it would be a code change in a docs cycle.

This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).


drafted by Claude on behalf of Daniel Stephenson

@dmccoystephenson
dmccoystephenson merged commit 7311d31 into main Nov 11, 2026
1 check passed
@dmccoystephenson
dmccoystephenson deleted the feature/readme-console-view-and-version-accuracy branch November 11, 2026 08:20
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