Repository navigation
feat(cli): nirium verify --gateway repeatable with retry/backoff fallback - #265
Merged
Merged
Conversation
…back -g/--gateway is now repeatable and tried in order. A 404 retries the SAME gateway up to --retries times with a flat backoff (a fresh pin can take a moment to propagate, so a 404 there isn't necessarily wrong); any other failure (real error, timeout) moves straight to the next gateway instead. When every gateway 404s after exhausting retries, that's reported as availability: "not_yet_available" - distinct from a real hash mismatch, since the document was never actually fetched. 8 new tests against local HTTP servers covering: 404-then-200 recovery on retry, fallback to a second gateway, all-down (not-yet-available), a non-404 error skipping straight to the next gateway, mixed failures (gateway_error), the human-output distinction, and --retries/--timeout validation. Full suite 67/67, no change to existing verify behavior for a single gateway with no failures. Closes #135 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Eras256
approved these changes
Nov 7, 2026
Eras256
left a comment
Collaborator
There was a problem hiding this comment.
Approving — repeatable --gateway, backoff retry on 404, "not yet available" correctly separated from "hash mismatch" in both text and --json. CI green (4/4), exit codes unchanged as required.
…y-gateway # Conflicts: # packages/cli/CHANGELOG.md # packages/cli/package.json
Eras256
approved these changes
Nov 7, 2026
Eras256
left a comment
Collaborator
There was a problem hiding this comment.
Approving - conflict resolved cleanly against main, 84/84 tests pass locally, CI green (4/4). Ready to merge.
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.
Summary
-g, --gatewayonnirium verifyis now repeatable and tried in order as fallbacks, with--retries/--timeout:404retries the same gateway up to--retriestimes with a flat backoff - a fresh IPFS pin can take a moment to propagate, so a 404 there doesn't necessarily mean the CID is wrong.availability: "not_yet_available"- distinct from a hash mismatch, because nothing was actually fetched to compare against. A mix of real errors across gateways reportsgateway_errorinstead.NOT YET AVAILABLE, notMISMATCH, for the former case.Test plan
test/verify-retry-gateway.test.js(8 cases) against local HTTP servers (no real IPFS, no real network): 404-then-200 recovery via retry, fallback to a second gateway, all-gateways-down (not_yet_available), a non-404 error skipping retries and moving to the next gateway immediately, mixed failures (gateway_error), the human-readable distinction, and--retries/--timeoutinput validation.npm test- 67/67 (no anchor tests here; this branch is offmain, independent of feat(cli): nirium anchor - anchor a hash or small record to IPFS #263/feat(cli): nirium anchor --sign - attach an agent attestation #264).node --check bin/nirium.jsclean.Closes #135