feat(guardian): add review quality metrics tracking#108
Merged
Conversation
Append-only JSONL log per review (model, PR, tokens, findings, lgtm). Two new CLI commands: `guardian-rate` to annotate findings_applied, `guardian-stats` to print a Rich precision-trend table. `guardian_review.py` gains `--pr` and `--metrics` flags and calls `record_review()` automatically after each run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Owner
Author
|
/guardian review |
Workflow now restores guardian_metrics.jsonl from origin/data/guardian-metrics before each review and pushes the updated file back after. Uses git worktree to avoid disturbing the PR branch checkout; creates the orphan branch on first run. Requires contents:write permission. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Contributor
|
LGTM — no defects found in this diff. I have verified the following:
|
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 #106
Summary
src/cgis/guardian/metrics.py— append-only JSONL log:record_review(),rate_review(),load_reviews()scripts/guardian_review.py— new--prand--metricsargs; auto-callsrecord_review()after each runsrc/cgis/cli.py— two new commands:guardian-rate(annotate findings_applied) andguardian-stats(Rich precision table)tests/unit/test_guardian_metrics.py— 11 unit tests; 100% coverageTest plan
make format && make lint && make type-check && make pytest && make doc-coverage— all green (321 passed)python scripts/guardian_review.py --pr 107 --metrics guardian_metrics.jsonland verify entry is appendedcgis guardian-statsand verify table prints🤖 Generated with Claude Code