Add full-sprint performance and cost benchmark pipeline - #6
Merged
rica-v3 merged 7 commits intoAug 11, 2026
Merged
Conversation
Member
Author
|
To use Codex here, create a Codex account and connect to github. |
Member
Author
|
@codex Please review |
|
To use Codex here, create a Codex account and connect to github. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a repeatable “sprint A/B” benchmark pipeline to measure full-sprint cost/performance deltas (especially prompt-context compaction), with strong safety controls for live provider execution and privacy-safe reporting.
Changes:
- Add a new
benchmark sprint-abCLI workflow that runs isolated Before/After sprint arms and emits JSON + Markdown reports. - Introduce bounded provider execution controls (invocation budget, per-call timeout, durable PID/process-group registration, and cleanup) plus prompt-context projection metadata in telemetry.
- Add scenario scaffolding + telemetry reduction/comparison utilities and extensive unit tests covering execution policy, worker cleanup, and telemetry aggregation.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| workflows/sprints/lifecycle.py | Add helper to apply initial-plan confirmation updates to sprint state. |
| workflows/orchestration/team_service.py | Thread benchmark execution policy + external research toggle through runtime construction; use plan confirmation helper. |
| runtime/base_runtime.py | Integrate prompt-context projection into invocation telemetry; disable sandbox-bypass retry behavior during benchmarks. |
| runtime/research_runtime.py | Add allow_external_research policy gate; record prompt-context projection for research decisions. |
| runtime/model_telemetry.py | Extend telemetry context/aggregation to include prompt projection + tool-call metrics and stricter pricing totals. |
| runtime/execution_policy.py | Add benchmark execution policy + invocation budget/journaling primitives. |
| runtime/codex_runner.py | Enforce benchmark sandboxing, environment allowlisting, gated launch, timeouts, journaling, and tool-call parsing. |
| runtime/benchmark_launcher.py | Add small gatekeeper executable to block provider exec until parent signals readiness. |
| runtime/internal/intent_parser.py | Pass execution policy through to internal Codex runner. |
| runtime/internal/goal_sourcing.py | Pass execution policy through to internal Codex runner. |
| cli.py | Add cmd_benchmark_sprint_ab CLI entrypoint and result rendering. |
| adapters/cli/commands.py | Wire benchmark sprint-ab subcommand + args into CLI dispatcher. |
| benchmarking/init.py | Export benchmarking public API surface. |
| benchmarking/models.py | Define benchmark datamodels, scheduling, and privacy-safe sanitizers. |
| benchmarking/scenario.py | Create deterministic scenario workspace + backfill history seeding and config hashing. |
| benchmarking/runner.py | Orchestrate paired runs, retention snapshots, report writing, and safety/coverage gates. |
| benchmarking/metrics.py | Sanitize telemetry records and compute per-arm metrics + before/after comparisons. |
| benchmarking/reporting.py | Render the JSON + Markdown benchmark report artifacts. |
| docs/performance_benchmarking.md | Document benchmark purpose, safety model, setup, and report semantics. |
| tests/test_model_telemetry.py | Add coverage for tool-call counting, prompt-context projection, and aggregation semantics. |
| tests/test_execution_policy.py | Add tests for benchmark execution policy, sandboxing, environment filtering, and gated launch behavior. |
| tests/test_benchmark_worker_cleanup.py | Add tests for worker/provider cleanup, journal reconciliation, and fail-closed behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the 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
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
benchmark sprint-abpipeline that runs isolated Before/After full-sprint scenarios and emits JSON plus Markdown execution reports.docs/performance_benchmarking.md.Tracks #2.
Why
PRs #3 through #5 added telemetry, reduced planner checkpoint amplification, and compacted prompt event history. This PR supplies the reproducible integration benchmark needed to quantify those optimizations without treating incomplete or untrusted measurements as valid cost evidence.
Benchmark workflow
The Before arm disables prompt compaction. The After arm enables it. Both arms use isolated workspaces and the same deterministic scenario.
Measurement safeguards
First live run
One Before/After pair was executed during implementation:
Interpretation
The first pair is inconclusive:
Validation
PYTHONPATH=.. python -m unittest discover -s testspython -m compileallpassed.git diff --checkpassed.Follow-up measurement gate
Run the corrected v2 live pair after this benchmark implementation is reviewed. Claim an optimization result only when compaction is observed, workflow outcomes are comparable, invocation identities reconcile, token coverage is disclosed, and pricing coverage is complete when monetary cost is reported.