Report blob counts from snapshot verify --deep --json #362

Merged
clawbot merged 1 commits from issue-314-deep-verify-json-counts into next 2026-10-13 21:26:56 +02:00
Collaborator

Fixes #314.

What was wrong: deep verify set verified only after every blob had passed and never set missing, so a failed snapshot verify --deep --json reported 0 for both.

What changed:

  • Each blob whose contents pass is counted in verified as deep verify goes, so a run that fails on a damaged blob reports how many passed before it.
  • The check that every blob is in storage with the size the database records now goes through all blobs instead of stopping at the first problem. A blob that storage reports not found is counted in missing and missing_size, a blob of the wrong size in mismatched (now filled under --deep too), as shallow verify does; the check then fails if it found any, with the counts in the error.
  • Any other storage error while checking a blob (permission denied, a network failure, an interrupt) still stops the check and fails with that error, so a blob that cannot be checked is never reported as missing.

Judgement call: deep verify still stops at the first damaged blob and reads no blob contents while any blob is missing or the wrong size, so verified is 0 there, where shallow mode counts the present blobs; reading on would raise what deep verify costs on a broken snapshot.

Judgement call: deep verify does not fill the unchecked list that shallow verify now has (#318); it stops at the first blob it cannot check, as this PR's review asked.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/vaultik/issues/314. **What was wrong:** deep verify set `verified` only after every blob had passed and never set `missing`, so a failed `snapshot verify --deep --json` reported 0 for both. **What changed:** - Each blob whose contents pass is counted in `verified` as deep verify goes, so a run that fails on a damaged blob reports how many passed before it. - The check that every blob is in storage with the size the database records now goes through all blobs instead of stopping at the first problem. A blob that storage reports not found is counted in `missing` and `missing_size`, a blob of the wrong size in `mismatched` (now filled under `--deep` too), as shallow verify does; the check then fails if it found any, with the counts in the error. - Any other storage error while checking a blob (permission denied, a network failure, an interrupt) still stops the check and fails with that error, so a blob that cannot be checked is never reported as missing. Judgement call: deep verify still stops at the first damaged blob and reads no blob contents while any blob is missing or the wrong size, so `verified` is 0 there, where shallow mode counts the present blobs; reading on would raise what deep verify costs on a broken snapshot. Judgement call: deep verify does not fill the `unchecked` list that shallow verify now has (https://git.eeqj.de/sneak/vaultik/issues/318); it stops at the first blob it cannot check, as this PR's review asked. Model: opus-5-5
clawbot added the needs-review label 2026-10-13 15:46:55 +02:00
clawbot self-assigned this 2026-10-13 15:46:55 +02:00
Author
Collaborator
  1. internal/vaultik/verify.go, verifyBlobExistenceFromDB: every storage error from checking a blob is now counted as a missing blob, and the check carries on past it. A blob that is present but cannot be checked (permission denied, an S3 403, a network failure) is reported under --deep --json as missing, and the real error shows only in warnings on stderr. After an interrupt, every remaining check fails on S3, so the run goes through all of them, logging a warning for each, and reports them all as missing. #318 rules that only a not-found answer counts as missing. Acceptable: count only storage.ErrNotFound as missing; on any other error stop and fail with that error, as before this change; add a test where checking a present blob fails with another error.

  2. internal/vaultik/deep_verify_test.go: under --deep a blob of the wrong size is now counted in mismatched instead of failing at once, and no test covers it. Acceptable: a case with a wrong-size blob that checks mismatched and the failure.

Model: opus-5-5

1. `internal/vaultik/verify.go`, `verifyBlobExistenceFromDB`: every storage error from checking a blob is now counted as a missing blob, and the check carries on past it. A blob that is present but cannot be checked (permission denied, an S3 403, a network failure) is reported under `--deep --json` as missing, and the real error shows only in warnings on stderr. After an interrupt, every remaining check fails on S3, so the run goes through all of them, logging a warning for each, and reports them all as missing. https://git.eeqj.de/sneak/vaultik/issues/318 rules that only a not-found answer counts as missing. Acceptable: count only `storage.ErrNotFound` as missing; on any other error stop and fail with that error, as before this change; add a test where checking a present blob fails with another error. 2. `internal/vaultik/deep_verify_test.go`: under `--deep` a blob of the wrong size is now counted in `mismatched` instead of failing at once, and no test covers it. Acceptable: a case with a wrong-size blob that checks `mismatched` and the failure. Model: opus-5-5
clawbot added needs-rework and removed needs-review labels 2026-10-13 17:06:31 +02:00
clawbot force-pushed issue-314-deep-verify-json-counts from 4b391a4c98 to 2660f7320d 2026-10-13 17:14:35 +02:00 Compare
clawbot force-pushed issue-314-deep-verify-json-counts from 2660f7320d to 763be0ec37 2026-10-13 19:14:31 +02:00 Compare
clawbot force-pushed issue-314-deep-verify-json-counts from 763be0ec37 to 5392363d20 2026-10-13 19:15:14 +02:00 Compare
clawbot force-pushed issue-314-deep-verify-json-counts from 5392363d20 to beefa8c37e 2026-10-13 19:57:37 +02:00 Compare
clawbot added 1 commit 2026-10-13 20:46:36 +02:00
Deep verify set verified only on success and never set missing, so a
failed --deep --json run reported zero for both. It now counts each blob
whose contents pass as it goes, and the existence check runs through
every blob, counting the ones storage reports not found as missing and
the wrong-size ones as mismatched, as shallow verify does; it fails if it
found any. Any other storage error stops the check and fails with that
error, so a blob that cannot be checked is never reported as missing.

Deep verify still stops at the first damaged blob and reads no blob
contents while any blob is missing or the wrong size, so verified is 0
there where shallow mode counts the present blobs.

Model: opus-5-5
clawbot force-pushed issue-314-deep-verify-json-counts from beefa8c37e to 34b73c9411 2026-10-13 20:46:36 +02:00 Compare
Author
Collaborator

Rework:

  1. Only a not-found answer from storage counts a blob as missing; any other storage error stops the check and fails with that error. Added a test where checking a present blob fails with a permission error.
  2. Added a wrong-size blob case under --deep: it is counted in mismatched, the missing blobs are still counted, and the run fails.

Rebased onto current next.

Model: opus-5-5

Rework: 1. Only a not-found answer from storage counts a blob as missing; any other storage error stops the check and fails with that error. Added a test where checking a present blob fails with a permission error. 2. Added a wrong-size blob case under `--deep`: it is counted in `mismatched`, the missing blobs are still counted, and the run fails. Rebased onto current `next`. Model: opus-5-5
clawbot added needs-review and removed needs-rework labels 2026-10-13 20:46:47 +02:00
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 42eb50b151 into next 2026-10-13 21:26:56 +02:00
clawbot deleted branch issue-314-deep-verify-json-counts 2026-10-13 21:26:57 +02:00
Sign in to join this conversation.