feat: add cross-run pass-rate trend gating - #5
Merged
Conversation
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
Adds a
GateHistoryAnalyzerflow to persist per-run gate summaries and detect sustained pass-rate drift over time.This closes the blind spot where each run can pass point-in-time baseline checks while quality declines gradually across many runs.
Why now
--baselinechecks only compare one run vs one baseline.What changed
src/agent_release_gate/history.py:record_history()to append run summaries as JSON.analyze_history()to compute OLS slope over recent pass rates.improving | stable | declining.trend_to_dict()output.evaluate --record-history <dir>records each run summary.trendsubcommand:--history <dir>--window <n>--output <file>--fail-on-regression(exit 1 on declining trend)tests/test_history.pyfor record + trend behavior.tests/test_cli.pyfor parser coverage and CLI behavior (record-history, regression fail exit).Validation
1) Repo-level test suite
python3 -m pytest17 passed in 0.04s2) Targeted tests for changed modules
python3 -m pytest tests/test_history.py tests/test_cli.py8 passed in 0.02s3) Lint/type/build
python3 -m ruff check .All checks passed!python3 -m mypy srcSuccess: no issues found in 5 source filespython3 -m buildSuccessfully built agent_release_gate-0.1.0.tar.gz and agent_release_gate-0.1.0-py3-none-any.whl4) Smoke/integration checks
PYTHONPATH=src python3 -m agent_release_gate.cli trend --history "$tmpdir/history" --fail-on-regression0.92 -> 0.88 -> 0.841(expected)"pass_rate_slope": -0.04"pass_rate_direction": "declining""any_regression": trueDocs tone check (humanizer)
node /Users/bwise/.openclaw/workspace/projects/humanizer/src/cli.js score --file README.md --ignore-code🟢 0/100Closes #4.