fix(history): an empty record is not a failed match - #66
Merged
Conversation
With a reviewed baseline committed and no change reports beside it -- the state of this repository today, since data/changes/ does not exist until the watch records a revision -- `history --all` exited 5 and printed "no record matched None". `--all` asks for nothing by name, so nothing coming back is a statement about what has been committed, not a request that failed, and a script reading exit 5 was told the request was wrong. It now exits 0 and names the directory that holds no reports. The report says that neither an empty match nor an empty report set means the document has not changed: it means the committed record does not cover it. `--match` selecting nothing still exits 5.
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.
What was wrong
Found by smoke-testing the four new verbs together on
mainafter #65 merged,which is the check the brief asks for after a burst of merges.
data/changes/does not exist in this repository — the watch has not recorded arevision yet — but
data/parsed/is committed. In exactly that state:Two things wrong with that.
--allasks for nothing by name, so nothing coming back is a statementabout what has been committed, not a request that failed. Exiting 5 tells a
script the request was wrong when the record is simply empty — the same shape as
the defects this verb was written to avoid, on the other side of the fence.
{args.match!r}rendersNonewhen--allwas used, so the message names amatch nobody made.
What changed
history --allwith no committed reports exits 0 and says which directoryholds no reports, and that this is a statement about what has been committed
rather than about whether the document has changed.
--matchselectingnothing still exits 5.
set means the document has not changed — it means the committed record does
not cover it. The old wording, "No record matched.", was the only thing a
reader saw and it was not true for
--all.How it was verified
Full gate green:
ruff check,ruff format --check,mypy(strict),pytest,coverage 93.86% against an 85% floor. Two tests added.
The added test builds the repository's actual state — a reviewed baseline
committed with an empty
changes/beside it — rather than an empty directory,because with neither present an earlier guard fires first and the test would
have passed without exercising this path at all.
Negative control: reverting the
--allbranch (if False:, read back atcli.py:324) turnstest_all_with_no_committed_reports_is_not_a_failed_matchred. Restored from a pre-edit byte copy (
diffclean) and re-run green.Prepared with AI assistance; reviewed before submission.