Repository navigation
feat(M81): automatic threshold tuning from historical reports - #176
Merged
Merged
Conversation
- auto_threshold.py: analyze_thresholds(), ThresholdRecommendation, format_recommendations() - Percentile-based fail_threshold and numeric_tolerance recommendations - Confidence scoring based on sample size and report count - CLI: xpyd-acc auto-threshold --reports ... --percentile ... --json ... - 18 tests covering computation, serialization, formatting, CLI integration Closes #175
hlin99-Review-Bot
approved these changes
Apr 6, 2026
hlin99-Review-Bot
left a comment
There was a problem hiding this comment.
✅ Approved (hlin99-Review-Bot)
Idea: Valuable addition — auto-threshold tuning from historical data is a natural next step after the batch comparison and multi-dataset features. Aligns well with project goals.
Code:
auto_threshold.pyis clean: good separation of analysis, loading, and formatting- Percentile computation handles edge cases (empty, single element)
- Confidence tiers are sensible (sample count + report count)
load_reports()is fault-tolerant with logging — nice- CLI wiring follows established patterns (parsers → report → init)
- 18 tests with good coverage (edge cases, serialization, CLI integration)
docs/iterations/current.mdupdated ✓- CI all green ✓
No issues found. Ship it.
hlin99-Review-BotX
approved these changes
Apr 6, 2026
hlin99-Review-BotX
left a comment
There was a problem hiding this comment.
✅ Approved (hlin99-Review-BotX)
Idea: Auto-threshold tuning is a natural complement to the batch comparison pipeline — lets users derive empirical thresholds instead of guessing. Good addition.
Code:
auto_threshold.py: clean separation of analysis, loading, formatting._percentile()handles edge cases correctly (empty, single element). Confidence tiers are well-calibrated.load_reports()is fault-tolerant with proper logging — robust for real-world use.- CLI wiring follows established
parsers → report → __init__pattern consistently. - 18 tests with solid coverage: edge cases, serialization, CLI integration.
docs/iterations/current.mdupdated ✓- CI all green ✓
Second approval — ship it.
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
Add
xpyd-acc auto-thresholdcommand that analyzes historical batch reports and recommends optimal--fail-thresholdand--numeric-tolerancevalues.Features
--percentile)--json <path>exportFiles
src/xpyd_acc/auto_threshold.py(new)src/xpyd_acc/cli/report.py— handlersrc/xpyd_acc/cli/parsers.py— subcommand registrationsrc/xpyd_acc/cli/__init__.py— dispatch wiringtests/test_auto_threshold.py(18 tests)docs/iterations/current.md— updatedCloses #175