feat: add JSON verifier output - #27
Merged
Merged
Conversation
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds a machine-readable JSON output mode to agentgate-verify. This helps CI and auditor tooling consume verification results without parsing text.
Changes:
- Adds
--format text|jsonflag tocmd/agentgate-verifyand emits a single JSON result object on stdout whenjsonis selected. - Documents
--format jsonin the README verifier section. - Adds tests for JSON output, default text equivalence, and invalid format handling.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Mentions --format json for script-friendly verifier output. |
| cmd/agentgate-verify/main.go | Adds --format flag, JSON result struct, and JSON encoder output path. |
| cmd/agentgate-verify/main_test.go | Adds coverage for JSON output success and mismatch cases, plus format validation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+148
to
+152
| rangeKind := "" | ||
| if manifest != nil { | ||
| if manifest.ResolvedTo == manifest.HeadSeq { | ||
| rangeKind = "full" | ||
| } else { |
| TotalReceipts int `json:"total_receipts"` | ||
| VerifiedCount int `json:"verified_count"` | ||
| FailedAtSeq uint64 `json:"failed_at_seq,omitempty"` | ||
| Reason string `json:"reason,omitempty"` |
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 #13.
What changed:
Verification:
All passed locally.