-
Notifications
You must be signed in to change notification settings - Fork 8
Update log spot checking from which uid #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds per-wallet context to an existing spot-check log line in _process_wallet_window within grail/cli/validate.py by appending the originating uid string. No control flow, sampling, grouping, or validation logic changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
grail/cli/validate.py (1)
1096-1101: Fix logged percentage to reflect actual sampled groups, not the target SAMPLE_RATE.The current log always prints e.g. “10% of groups” even when rounding forces sampling 1 group (which could be >10%). Log the realized ratio for accuracy.
Apply this minimal change:
logger.info( - f"📊 Spot checking {len(indices_to_check)}/{total_inferences} " - f"rollouts from {groups_to_check}/{num_groups} groups " - f"({SAMPLE_RATE * 100:.0f}% of groups) " - f"from uid {uid_str}" + f"📊 Spot checking {len(indices_to_check)}/{total_inferences} " + f"rollouts from {groups_to_check}/{num_groups} groups " + f"({(groups_to_check / num_groups * 100.0) if num_groups else 0.0:.0f}% of groups) " + f"from uid {uid_str}" )Optional: switch to parameterized logging to avoid eager f-string formatting on disabled levels:
- logger.info( - f"📊 Spot checking {len(indices_to_check)}/{total_inferences} " - f"rollouts from {groups_to_check}/{num_groups} groups " - f"({(groups_to_check / num_groups * 100.0) if num_groups else 0.0:.0f}% of groups) " - f"from uid {uid_str}" - ) + actual_pct = (groups_to_check / num_groups * 100.0) if num_groups else 0.0 + logger.info( + "📊 Spot checking %d/%d rollouts from %d/%d groups (%.0f%% of groups) from uid %s", + len(indices_to_check), total_inferences, groups_to_check, num_groups, actual_pct, uid_str, + )
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
grail/cli/validate.py(1 hunks)
🔇 Additional comments (1)
grail/cli/validate.py (1)
1096-1101: Nice: added uid context improves traceability.Appending “from uid {uid_str}” makes spot-check logs actionable when multiple wallets are processed in the same window.
Summary by CodeRabbit