feat(cli): report the version from both command-line tools - #144
Conversation
`sixsentences --version` and `six-community --version` both failed, so the first thing a bug report asks for was only reachable by reading `pyproject.toml` inside a container. Both now read the installed distribution metadata. argparse resolves an eager `version` action while it consumes the option, so the engine answers before its required subcommand is enforced; Typer needs a root callback with an eager option to do the same. `sixsentences_server.__version__` was a second hard-coded literal that nothing validated — `release.py validate` checks the version across pyproject files, lockfiles, the changelog, the citation metadata and the Companion, but not that string. It now derives from the installed distribution the same way the engine already did, so there is one source and nothing to keep in step by hand. Closes #89 Signed-off-by: L4XB <L4XB@users.noreply.github.com>
|
I have read and agree to the SixSentences CLA v1.0. |
Self-reviewRecorded under the founding-maintainer exception in
ChecksEvery required context is green. The one failing check, Merging. |
Every pull request showed a failed check named "Publish CLA status" beside the
green "CLA / acceptance" it had just produced:
Canceling since a higher priority waiting request for cla-144 exists
CLA acceptance verified for @L4XB on pull request #144.
##[error]The operation was canceled.
The run had already done its work. It was cancelled during cleanup, and GitHub
reports a cancelled run as a failed check.
Two events seconds apart share the concurrency group: opening the pull request
fires `pull_request_target`, and posting the acceptance sentence fires
`issue_comment`. That is not an unlucky ordering — CONTRIBUTING.md instructs the
author to post that sentence on the pull request they just opened, so the
comment reliably lands mid-run. The workflow cancelled itself on the one
sequence the documentation asks every contributor to perform, and showed a red X
next to the word CLA to the people least equipped to read it.
The runs queue now, as issue-claims.yml already does for the same reason. They
are idempotent: each reads the head commit and the comments live and publishes a
status for that exact commit, so serialized runs converge rather than fight, and
the reminder stays behind its marker check. A test plays the real sequence —
open, remind, remind again, accept, re-run — and asserts one reminder and a
stable verdict.
Queueing is also the safer of the two. Cancelling left a window where a
half-finished run could publish a stale verdict; serialized runs mean the one
that finishes last is the one that saw the newest state.
Closes #146
Signed-off-by: L4XB <L4XB@users.noreply.github.com>
Summary
Neither command-line tool could say which version it was.
sixsentences --versionexited 2 with the following arguments are required: command, and
six-community --versionexited 2 with No such option: --version. The answerto the first question in every bug report involved reading
pyproject.tomlinside a container.
Both now report it, from the installed distribution metadata.
Behavior and compatibility
sixsentences --versionsixsentences 0.2.0a1, exit 0six-community --versionsix-community 0.2.0a1, exit 0Two details the issue asked to check rather than assume:
required=Truesubcommands.--versionworks. argparseresolves an eager
versionaction while it consumes the option string, so itexits before the required-subcommand check at the end of parsing. Pinned by
test_version_flag_answers_before_a_subcommand_is_demanded.is_eager=True; without one theoption does not exist at the root at all. The callback carries no required
parameters, so
no_args_is_helpstill prints help and exits 2, and everysubcommand is still reachable —
test_the_root_callback_does_not_swallow_a_subcommandcovers that. Its docstring now gives
six-community --helpa description lineit did not have.
The second literal
services/api/src/sixsentences_server/__init__.pyheld__version__ = "0.2.0a1"as a hard-coded string, and nothing validated it.
release.py validatechecks version agreement across
pyproject.toml,uv.lock, the API project andits lock,
package.jsonfor web and extension,CITATION.cff,CHANGELOG.md,the release notes and the Companion plist — but not that line. It reaches users
through
GET /health, the MCP server identity, the methods paragraph aresearcher cites, and the generator field of exported documents, so a stale
value there is not cosmetic.
It now derives from the installed distribution, exactly as
sixsentences/__init__.pyalready did, and falls back to0+unknownfor asource tree imported without installation — an honest answer rather than a
plausible wrong one. No new literal was added anywhere.
Public API, schema, migrations, rollback: none.
--versionis additive;reverting the commit restores the previous behaviour with no state to undo.
Validation
Engine (Python 3.14 locally, CI covers 3.12–3.14):
API:
Web, browser extension, macOS Companion and the self-hosting definition are
untouched by this change.
One thing worth splitting out
The audit command
CONTRIBUTING.mddocuments cannot pass on a machine set upthe way
CONTRIBUTING.mdsays to set it up.uv sync --project services/apicreates
services/api/.venv,included_files()walks it, and the first symlinkit meets ends the run:
CI does not hit it because the
apijob setsUV_PROJECT_ENVIRONMENT=/tmp/sixsentences-api-env, which puts the environmentoutside the audited tree.
.venvis simply missing fromIGNORED_DIRSalongside
.mypy_cache,.pytest_cache,.ruff_cacheand__pycache__.Filed separately rather than fixed here: it is a behaviour change in a gate, and
it has nothing to do with
--version.Review boundaries
public in
GET /health; nothing new is exposed, and no credential, path orconfiguration value is printed. Authentication, tenancy, capability URLs,
uploads, retention, deletion, browser state and logs are untouched.
importlib.metadatais stdlibno research-facing behavior changed. The methods paragraph and export
generator field now carry the installed version instead of a literal that
nothing checked, which makes provenance more accurate, not less.
Source-release hygiene
CHANGELOG.mdis updated for user-visible changes.Signed-off-bytrailer.CLA.mdand posted its exact acceptance sentence as a standalone pull-request comment.Visual evidence
No UI change.
Closes #89