Say the default --diff is the staged diff, which is what it became - #363
Merged
Conversation
CommitLore — record lintTrailers: clean — 1 commit in Active constraints for the paths this PR touchesLimits (74)
Ruled out (166)
Warnings (45)
Trailer violations fail this check. Active constraints are informational — they are what the repository already decided, not a verdict on this PR. |
MongLong0214
force-pushed
the
fix-capture-help
branch
from
August 1, 2026 04:30
bff9927 to
b1c71f7
Compare
`capture --help` told the caller `--diff` defaults to empty. It once did, and that was the defect: prepare hashes `git diff --cached`, an empty diff hashes to something else, and every draft came back `source-mismatch` with `no record staged`. Line 97 was rewritten to read the staged diff when the flag is omitted. The sentence describing the old behaviour stayed where it was. The cost is not untidiness. `--help` is the only place a caller learns what happens when they leave a flag off, and this one told them omitting `--diff` sends nothing -- so the correct call reads like the broken one, and they pass a file that then has to match the staged bytes exactly or be refused as a genuine mismatch. The flag exists for callers who really do have different bytes; the help text turned it into an obligation. The assertion lives beside #303's, which is the same failure in a different sentence: user-facing text that names something the product does not have. That one named a package; this one named a default. Neither had a test because neither string was read by anything. Two of the four cases are the claim and two are its teeth -- the code still has to reach for `git diff --cached` for the sentence to be worth asserting. If the default moves, both halves fail together and the wording gets re-decided instead of drifting again. Record-Id: r-diffdefault Limit: the test reads the option string out of the source rather than out of `--help` output, so a change to how commander renders descriptions would not be caught Ruled-out: Asserting on spawned `capture --help` output | the suite would rebuild the CLI for one string, and the option line is the thing under test either way Ruled-out: Leaving the string and documenting the real default only in the skill | the skill is read by agents and `--help` by people, and the two would disagree Certainty: firm Blast: local Undo: easy Verified: with the fix reverted the two claim cases fail and the two teeth cases pass; with it applied all 6 pass; typecheck clean; dist rebuilt from source and committed Unverified: whether any other option description in the CLI has drifted the same way -- only `--diff` was checked
MongLong0214
force-pushed
the
fix-capture-help
branch
from
August 1, 2026 04:43
b1c71f7 to
4ac8163
Compare
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.
Closes #359.
capture --helpdocumented--diffas defaulting to empty. It once did, and that was the defect — prepare hashesgit diff --cached, so an empty diff never matched and every draft came backsource-mismatch.src/commands/capture.ts:97was rewritten to read the staged diff; the help string it contradicts was left behind.A caller reading "defaults to empty" concludes they must pass
--difffor verification to see anything. The opposite is true: omitting it is the correct call, and a supplied file that differs from the staged bytes is a real mismatch and is refused.Test
Four cases in
test/help-text-honesty.test.ts, which already holds #303 — the same failure in a different sentence (user-facing text naming something the product does not have; that one named a package, this one named a default). Two cases assert the claim, two are its teeth: the code must still reach forgit diff --cachedfor the sentence to be worth asserting. If the default moves, both halves fail together.Verified
npm run typechecknpm run builddist/rebuilt from source and committedFound while restructuring the commit skill for #340, which documents the actual behaviour.