Skip to content

fix(cli): print [Verified] once a checksum matches, as documented - #628

Merged
linroid merged 1 commit into
mainfrom
fix/cli-verified-line
Oct 23, 2026
Merged

linroid merged 1 commit into
mainfrom
fix/cli-verified-line

Conversation

@linroid

@linroid linroid commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Found while testing --checksum with the CLI. cli/README.md says:

With --checksum, Ketch hashes the file once the last byte is saved. … A match prints [Verified]

but it never did. Across every download in this test run, none printed [Verified] (or the [Completed] Saved to … line from the same branch):

ketch --checksum sha256:88f1b7… http://…/v.bin
Download completed: v.bin            # verified, but nothing says so

Why

downloadUntilDone cancels the progress monitor as soon as task.await() returns. That is when the task turns Completed, so the monitor almost never got to print the completed state, where ProgressPrinter printed [Verified]. The line depended on a race the monitor nearly always lost.

What changes

  • downloadUntilDone reads the task's final state itself and, on success, prints [Verified] <algorithm> matches before Download completed: <path>. This covers both a checksum the user gave and a digest the server published (Repr-Digest), which Ketch also verifies.
  • ProgressPrinter no longer prints Completed or Failed states, which the command reports itself, so neither can appear twice if the monitor does win the race.

Now:

[Verified] SHA-256 matches
Download completed: v.bin

Verification

  • ketch from this branch prints the line for --checksum and for a server-published Repr-Digest.
  • New DownloadCommandTest.download_matchingChecksum_saysItWasVerified; the test helper takes a checksum.
  • ./gradlew :cli:test --tests '*DownloadCommandTest*' --tests '*ProgressLineTest*' passes.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-23T16:39:03.936267Z 858185c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 23, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

`ketch --checksum sha256:… <url>` never printed the [Verified] line the CLI
README promises: downloadUntilDone cancelled the progress monitor as soon
as the download ended, before it printed the completed state. The command
now reads the final state itself and prints the line, for a checksum the
user gave or one the server published, before "Download completed"; the
monitor no longer prints completed or failed states, which the command
reports.
@linroid
linroid force-pushed the fix/cli-verified-line branch from 858185c to 3c47018 Compare October 23, 2026 17:20
@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Test Results

 2 200 files  ±0   2 228 suites  ±0   57m 24s ⏱️ - 1m 6s
15 342 tests +1  15 074 ✅ +1  268 💤 ±0  0 ❌ ±0 
18 701 runs  +1  18 433 ✅ +1  268 💤 ±0  0 ❌ ±0 

Results for commit 3c47018. ± Comparison against base commit 8aa7a91.

♻️ This comment has been updated with latest results.

@linroid
linroid merged commit 0599fdb into main Oct 23, 2026
24 of 27 checks passed
@linroid
linroid deleted the fix/cli-verified-line branch October 23, 2026 18:56
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