fix(effective-cost): numerator = cost-tier estimate (smoke catch)#67
Merged
Conversation
…lder spend Live-smoke catch: $tspend is realized spend, hardcoded 0.0 in dispatch today, so the run-level effective cost read 0 in production. Source the numerator from $est (the cost-tier estimate the budget guard uses), matching the basis='estimate' label. T87/T88 pin it through the full Invoke-Conductor path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Fixes the effective-cost metric’s numerator to use the per-task cost-tier estimate (consistent with cost_basis='estimate' and the budget guard), instead of the stubbed realized spend (spend=0.0) currently returned by Invoke-TaskViaFleet, which caused cost/effective_cost to be zero in production.
Changes:
- Switch
Invoke-Conductor’s effective-cost task-cost accumulation from$tspendto$est(tier estimate). - Add end-to-end PowerShell tests covering the full
Invoke-Conductorpath to ensurecost == 0.05for a paid task and thateffective_costis non-zero.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/conductor-lib.ps1 | Uses cost-tier estimate ($est) as the effective-cost numerator input instead of placeholder realized spend. |
| scripts/test-conductor-lib.ps1 | Adds full-path tests (T87/T88) to catch regressions where effective cost would incorrectly compute as zero. |
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.
Deployed-script smoke on the slice-1 merge surfaced
cost: 0.0in production: the numerator was sourced from$tspend(realized spend), which is hardcoded0.0inInvoke-TaskViaFleettoday — so the metric would read 0 for every real run. Sourced it from$est(the cost-tier estimate, the same value the budget guard uses), matching the record'sbasis='estimate'label. T87/T88 pincost == 0.05(paid estimate) and non-zeroeffective_costthrough the fullInvoke-Conductorpath.🤖 Generated with Claude Code