-
-
Notifications
You must be signed in to change notification settings - Fork 105
Add RunLedger replay gate for agent regressions #10
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
Open
ZackMitchell910
wants to merge
2
commits into
AI-QL:main
Choose a base branch
from
ZackMitchell910:runledger/replay-gate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| name: runledger-gate | ||
| on: | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| evals: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11" | ||
| - name: Install RunLedger | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install runledger | ||
| - name: Run deterministic evals (replay) | ||
| run: runledger run evals/runledger --mode replay --baseline baselines/runledger-demo.json | ||
| - name: Upload artifacts | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: runledger-artifacts | ||
| path: runledger_out/** |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,3 +67,4 @@ tests/results/ | |
| npm-debug.log | ||
| npm-debug.log.* | ||
| vite-plugin-electron.log | ||
| runledger_out/ | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,113 @@ | ||
| { | ||
| "aggregates": { | ||
| "cases_error": 0, | ||
| "cases_fail": 0, | ||
| "cases_pass": 1, | ||
| "cases_total": 1, | ||
| "metrics": { | ||
| "cost_usd": { | ||
| "max": null, | ||
| "mean": null, | ||
| "min": null, | ||
| "p50": null, | ||
| "p95": null | ||
| }, | ||
| "steps": { | ||
| "max": null, | ||
| "mean": null, | ||
| "min": null, | ||
| "p50": null, | ||
| "p95": null | ||
| }, | ||
| "tokens_in": { | ||
| "max": null, | ||
| "mean": null, | ||
| "min": null, | ||
| "p50": null, | ||
| "p95": null | ||
| }, | ||
| "tokens_out": { | ||
| "max": null, | ||
| "mean": null, | ||
| "min": null, | ||
| "p50": null, | ||
| "p95": null | ||
| }, | ||
| "tool_calls": { | ||
| "max": 1.0, | ||
| "mean": 1.0, | ||
| "min": 1.0, | ||
| "p50": 1.0, | ||
| "p95": 1.0 | ||
| }, | ||
| "tool_errors": { | ||
| "max": 0.0, | ||
| "mean": 0.0, | ||
| "min": 0.0, | ||
| "p50": 0.0, | ||
| "p95": 0.0 | ||
| }, | ||
| "wall_ms": { | ||
| "max": 48.0, | ||
| "mean": 48.0, | ||
| "min": 48.0, | ||
| "p50": 48.0, | ||
| "p95": 48.0 | ||
| } | ||
| }, | ||
| "pass_rate": 1.0 | ||
| }, | ||
| "cases": [ | ||
| { | ||
| "assertions": { | ||
| "failed": 0, | ||
| "total": 2 | ||
| }, | ||
| "cost_usd": null, | ||
| "failed_assertions": null, | ||
| "failure_reason": null, | ||
| "id": "t1", | ||
| "replay": { | ||
| "cassette_path": "evals/runledger/cassettes/t1.jsonl", | ||
| "cassette_sha256": "3ca88ba1cde6952e1927e83ba82cc13948f96157d200ef01a7a15b5e586883e5" | ||
| }, | ||
| "status": "pass", | ||
| "steps": null, | ||
| "tokens_in": null, | ||
| "tokens_out": null, | ||
| "tool_calls": 1, | ||
| "tool_calls_by_name": { | ||
| "search_docs": 1 | ||
| }, | ||
| "tool_errors": 0, | ||
| "tool_errors_by_name": {}, | ||
| "wall_ms": 48 | ||
| } | ||
| ], | ||
| "generated_at": "2025-12-19T09:30:17.048738Z", | ||
| "policy_snapshot": { | ||
| "thresholds": { | ||
| "min_pass_rate": 1.0 | ||
| } | ||
| }, | ||
| "run": { | ||
| "ci": null, | ||
| "exit_status": "success", | ||
| "git_sha": null, | ||
| "mode": "replay", | ||
| "run_id": "20251219-093017-850a52" | ||
| }, | ||
| "runledger_version": "0.1.0", | ||
| "schema_version": 1, | ||
| "suite": { | ||
| "agent_command": [ | ||
| "python", | ||
| "evals/runledger/agent/agent.py" | ||
| ], | ||
| "cases_total": 1, | ||
| "name": "runledger-demo", | ||
| "suite_config_hash": null, | ||
| "suite_path": "evals/runledger/suite.yaml", | ||
| "tool_mode": "replay" | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| import json | ||
| import sys | ||
|
|
||
|
|
||
| def send(payload): | ||
| sys.stdout.write(json.dumps(payload) + "\n") | ||
| sys.stdout.flush() | ||
|
|
||
|
|
||
| def main(): | ||
| for line in sys.stdin: | ||
| line = line.strip() | ||
| if not line: | ||
| continue | ||
| msg = json.loads(line) | ||
| if msg.get("type") == "task_start": | ||
| ticket = msg.get("input", {}).get("ticket", "") | ||
| send({"type": "tool_call", "name": "search_docs", "call_id": "c1", "args": {"q": ticket}}) | ||
| elif msg.get("type") == "tool_result": | ||
| send({"type": "final_output", "output": {"category": "account", "reply": "Reset password instructions sent."}}) | ||
| break | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| main() |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| id: t1 | ||
| description: triage a login ticket | ||
| input: | ||
| ticket: reset password | ||
| cassette: cassettes/t1.jsonl | ||
| assertions: | ||
| - type: required_fields | ||
| fields: | ||
| - category | ||
| - reply |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| {"args": {"q": "reset password"}, "ok": true, "result": {"hits": [{"snippet": "Use the reset link.", "title": "Reset password"}]}, "tool": "search_docs"} |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| { | ||
| "type": "object", | ||
| "properties": { | ||
| "category": { | ||
| "type": "string" | ||
| }, | ||
| "reply": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "category", | ||
| "reply" | ||
| ] | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| suite_name: runledger-demo | ||
| agent_command: | ||
| - python | ||
| - agent/agent.py | ||
| mode: replay | ||
| cases_path: cases | ||
| tool_registry: | ||
| - search_docs | ||
| assertions: | ||
| - type: json_schema | ||
| schema_path: schema.json | ||
| budgets: | ||
| max_wall_ms: 20000 | ||
| max_tool_calls: 1 | ||
| max_tool_errors: 0 | ||
| regression: | ||
| min_pass_rate: 1.0 | ||
| baseline_path: ../../baselines/runledger-demo.json |
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.
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.
This baseline file contains hardcoded absolute local paths which will prevent it from being used in a CI environment or by other developers. Specifically:
cases[0].replay.cassette_path(line 71)suite.agent_command[1](line 105)suite.suite_path(line 110)These paths are specific to a single user's machine (
/mnt/c/Users/snowb/...). To ensure portability and allow the CI gate to function correctly, these paths should be relative to the project root, or the process that generates this baseline file should be configured to not include machine-specific paths.