Repository navigation
feat(report-lane-outcome): record each run's list-price cost as costUsd - #872
Conversation
The lane-outcome record gains an optional costUsd: the execution file's result message total_cost_usd, the CLI's own list-price estimate, on every outcome. It is not billing. The schema, docs/lane-outcome.md Fields and the classify and outcome-step tests cover it; the legacy tokens are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 1m 41s —— View job Code review complete
No findings. The change is small, consistent, and well covered:
Spot-checked the author's verification claims against the diff (guard parity, omitted legacy token, truncation behavior, schema/doc agreement) — all consistent with what's described. Did not independently re-run the test suites; the described
findings: 0 claude-lane-summary: lane=claude-review sha=1de56320b0cb377c1ed341437790fb217b8f2b8b run=40024600208 |
|
Claude finished @kyle-sexton's task in 1m 8s —— View job Security review —
|
|
claude-security-review has reviewed this pull request through 1de5632; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through 1de5632; a later push is reviewed from there. |
…and pr-review-cli contracts (#856) No related issue: G6 part 2 of the lane-funding plan (owner-approved 2026-10-23). ## Summary Registers `intake-triage.yml@d02b8697e092705153f0996549b05f95a446bb52` and `pr-review-cli.yml@d02b8697e092705153f0996549b05f95a446bb52` (ci-workflows [v0.65.0](https://github.com/melodic-software/ci-workflows/releases/tag/v0.65.0)), so claude-code-plugins' intake and review callers can re-pin to the release whose lane-outcome record carries `costUsd`. ## Fix v0.65.0 changes only report-lane-outcome's `classify.cjs` ([ci-workflows#872](melodic-software/ci-workflows#872)). Both reusables reach that action through `$/`. Neither workflow file changed since its last registered SHA (`git log 2fe38c03..v0.65.0 -- .github/workflows/intake-triage.yml` and `git log v0.64.2..v0.65.0 -- .github/workflows/pr-review-cli.yml` list no commits), so both contracts copy their prior entries forward verbatim. ## Verification - `node --test runner-policy.test.mjs` in `components/runner-policy`: 341 pass. That count includes the new copy-forward test, which checks both entries deep-equal their prior SHAs' entries and that exactly two contracts name the new SHA. - Left out: nothing. ## Related - Same shape as [#853](#853) (v0.64.2). - Next: the standards sync into claude-code-plugins, then that repository's caller re-pin. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: G6 part 2 of the lane-funding plan (owner-approved 2026-10-23).
Summary
The lane-outcome record now carries an optional
costUsd: the run's cost at list price, as the Claude Code CLI estimates it in the result message'stotal_cost_usd. It is an estimate for attribution and trends, not what was billed. Until now that value stayed in run-claude-cli's runner-local JSONL, so nothing outside the runner could read per-run spend. The claude-code-plugins morning brief will read it to print a per-role spend line.Fix
readRunRecordreadstotal_cost_usdfrom the execution file's result message, keeping it only when it is a finite number of at least 0, the same guardrun-claude-cli/lane.cjsapplies.runFactscarries it andfactRecordwrites it ascostUsdon every outcome, failures included, and omits it when unknown. Both emit paths (the claude-code-action review lanes and run-claude-cli callers) go throughreadRunRecord, so both gain the field.key=valuetokens are unchanged: nocost=token.schemas/lane-outcome.v1.schema.jsonaddscostUsd(number,minimum: 0) and describes it as a list-price estimate, not billing.docs/lane-outcome.md§ Fields adds its row. This is an optional field added within v1, which § Compatibility allows.Verification
node --test .github/actions/report-lane-outcome/classify.test.cjs: 43 pass. New cases:costUsdcomes fromtotal_cost_usdand drops a negative, string, null, boolean or object value; the record carries it on a success and on a credit-stop failure and omits it when unknown; no legacy token mentions cost; past 1,024 charactersmodelsis dropped andcostUsdis kept.node --test .github/actions/report-lane-outcome/outcome-step.test.cjs: 34 pass. New: the action step writescostUsdon a success and a failure, and the record validates against the schema; the schema rejects a negative and a stringcostUsd. Withclassify.cjsreverted to main, 5 of the 77 report-lane-outcome tests fail.node --test .github/actions/run-claude-cli/lane.test.cjs: 72 pass;node --test .github/scripts/*.test.cjs: 644 pass;markdownlint-cli2 docs/lane-outcome.md: 0 issues.Related
🤖 Generated with Claude Code