Fix legacy daily AIC accounting gaps - #61313
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Legacy evidence checks can bypass fail-closed signals and perform unnecessary artifact downloads.
Get a fresh assessment by requesting another Copilot review.
Review tier: Balanced
Findings: 1
Open (3)
What changed in this PR
Fixes legacy daily AI Credits accounting gaps that can cascade into blocked workflow runs.
Changes:
- Handles missing accounting for failed agent jobs.
- Recognizes legacy deterministic sample replays as zero-cost.
- Adds regression tests and a patch changeset.
| File | Description |
|---|---|
daily_aic_component_coverage.cjs |
Adds legacy zero-cost accounting paths. |
check_daily_aic_workflow_guardrail.cjs |
Inspects legacy agent artifacts for execution evidence. |
daily_aic_component_coverage.test.cjs |
Adds regression coverage. |
.changeset/patch-daily-aic-legacy-artifacts.md |
Documents the patch. |
| return { | ||
| artifactInspected: true, | ||
| preHarnessFailure: AWF_STARTUP_FAILURE_MARKER.test(logText) && !ENGINE_HARNESS_MARKER.test(logText), | ||
| sampleReplay: /"driver"\s*:\s*"apply_samples"/.test(logText), |
| logComponentAIC(runId, name, job, 0, "legacy_pre_harness_failure"); | ||
| continue; | ||
| } | ||
| if (!selected && name === "agent" && job.conclusion === "success" && candidateStates[0].state === "empty" && legacyAgentEvidence?.sampleReplay) { |
Comment on lines
+240
to
+248
| for (const file of ["agent/token_usage.jsonl", "agent_usage.jsonl", "agent_usage.json"]) { | ||
| const accountingPath = path.join(downloadRoot, file); | ||
| if (!fs.existsSync(accountingPath)) continue; | ||
| try { | ||
| if (fs.readFileSync(accountingPath, "utf8").trim()) return noEvidence; | ||
| } catch { | ||
| return noEvidence; | ||
| } | ||
| } |
This was referenced Sep 17, 2026
Contributor
|
🎉 This pull request is included in a new release. Release: |
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.



Fix daily AI Credits guardrail cascades caused by legacy runs that lack modern execution evidence.
Validation:
npx vitest run daily_aic_component_coverage.test.cjs(57 tests passed)npm run typecheckmake agent-report-progressFixes #61312
Fixes #61137