feat(runner): zero-trust cost re-metering + crash-safe whole-repo output#39
Open
isPANN wants to merge 1 commit into
Open
feat(runner): zero-trust cost re-metering + crash-safe whole-repo output#39isPANN wants to merge 1 commit into
isPANN wants to merge 1 commit into
Conversation
Meter cost from token usage × declared price (not a self-reported total), and make whole-repo runs durable so an early-stop/crash keeps the found bugs. - cost: submissions carry usage_totals (4 token buckets) + prices; the backend recomputes total_cost_usd/efficiency from them and ignores the self-reported figure (mirrors the zero-trust bug re-verification). whole-repo now surfaces its session-level 4-bucket usage (was dropped). - whole-repo durability: the agent appends each certificate to TRAJECTORY_DIR/certs.txt the moment it finds it; the trajectory is persisted every step (output_path); the runner harvests certs from BOTH the trajectory and the disk log (deduped). - fix trajectory loss: output_path was unset and trajectory_dir was never passed, so the --rm'd container dropped everything. Both are now wired, with TRAJECTORY_DIR exposed as a config knob. - versioned output: submission.json stays the stable "latest" pointer; a submission-<model>-<timestamp>.json archive is written beside it so runs don't clobber each other. - envelope self-describes: adds usage_totals, prices, agent_mode. - docs (submission.env.example, skill field table + SKILL.md), schemas, and tests updated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Two related runner improvements: meter cost from token usage × declared price (not a self-reported total), and make whole-repo runs durable so an early-stop/crash keeps the bugs already found.
Changes
Zero-trust cost metering (mirrors the existing zero-trust bug re-verification)
usage_totals(the 4 billed token buckets: input / output / cache_read / cache_write) + the declaredpricessnapshot.total_cost_usdand the efficiency metrics fromusage_totals × pricesand ignores the self-reported total. Legacy submissions without these fields fall back to the reported figure.Whole-repo durability
TRAJECTORY_DIR/certs.txtthe moment it finds it (new{{certs_file}}prompt slot); the runner harvests certificates from both the trajectory and that disk log (deduped by rule+source).output_pathwas unset andtrajectory_dirwas never passed, so the--rm'd container dropped the whole trajectory. Both are now wired, andoutput_pathmakes mini-swe-agent persist the trajectory after every step (crash-proof).TRAJECTORY_DIRis exposed as a config knob.Versioned output
submission.jsonstays the stable "latest" pointer (prb submitreads it); every run also writessubmission-<model>-<timestamp>.jsonbeside it, so runs don't clobber each other.usage_totals,prices,agent_mode.Docs / schema / tests
submission.env.example, the run-benchmark skill (field table + SKILL.md), and both JSON schemas updated.176 passed.Notes
benchmark/+config_repo.yamlare baked in).🤖 Generated with Claude Code