Skip to content

Distinguish estimated credits from recorded daily AIC usage - #66043

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-daily-aic-reports
Oct 6, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/fix-daily-aic-reports

Conversation

Copilot AI commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The daily AIC guardrail can count a cancelled run at its full per-run limit when accounting is unavailable. Cached fallback values could then block later runs while the report described the total as credits already consumed.

  • Accounting: Preserve recorded-versus-estimated provenance in the scan cache. Retry estimates and older cache entries without provenance so later accounting can replace them.
  • Reporting: Show recorded and estimated credits separately in the activation summary and exceeded-limit report. Explain that estimates are not measured consumption and stop counting when their runs leave the rolling 24-hour window.
  • Guardrail: Keep estimates in the threshold calculation, preserving conservative enforcement.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix fallback estimates for cancelled runs in guardrail reports Distinguish estimated credits from recorded daily AIC usage Oct 6, 2026
Copilot AI requested a review from pelikhan October 6, 2026 06:14
@pelikhan
pelikhan marked this pull request as ready for review October 6, 2026 06:16
Copilot AI balanced review requested due to automatic review settings October 6, 2026 06:16
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed for PR #66043: has_implementation_label=false and default_business_additions=6 (<=100 threshold, no custom .design-gate.yml). Gate exits without action.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #66043

@github-actions

github-actions Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch PR file list

🧪 Test quality analysis by Test Quality Sentinel

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

Provenance, retry behavior, conservative enforcement, reporting, and generated workflow propagation are consistent and tested.

Review effort: Balanced
Findings: None

What changed in this PR

Separates recorded AIC usage from conservative estimates while retaining both in guardrail enforcement.

Changes:

  • Tracks provenance and retries unresolved cached estimates.
  • Reports recorded and estimated credits separately.
  • Propagates estimated totals through activation and conclusion reporting.
File Description
actions/​setup/​js/​daily_aic_{scan,cache_helpers}.cjs Tracks and reconciles accounting provenance.
actions/​setup/​js/​check_daily_aic_workflow_guardrail.cjs Calculates and reports estimated AIC.
actions/​setup/​js/​handle_agent_failure.cjs and reporting template Clarifies exceeded-limit reporting.
Related JavaScript and Go tests Covers retry, reporting, and output propagation.
pkg/​workflow/​compiler_activation_outputs.go Exposes the estimated-credit output.
pkg/​workflow/​notify_comment_conclusion_helpers.go Passes estimates to conclusion reporting.
.github/​workflows/​*.lock.yml (319 generated files) Propagates the new output through compiled workflows.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (pr-code-quality-reviewer)
reviewed_at: 2026-10-06T06:19:14.618+00:00
review_event: COMMENT
top_themes:
  - No blocking issues found in daily AIC provenance/reconciliation changes
files_reviewed:
  - actions/setup/js/check_daily_aic_workflow_guardrail.cjs
  - actions/setup/js/check_daily_aic_workflow_guardrail.test.cjs
  - actions/setup/js/daily_aic_cache_helpers.cjs
  - actions/setup/js/daily_aic_scan.cjs
  - actions/setup/js/daily_aic_scan.test.cjs
  - actions/setup/js/handle_agent_failure.cjs
  - actions/setup/js/handle_agent_failure_daily_aic_workflow.test.cjs
  - actions/setup/md/daily_workflow_aic_exceeded.md
  - pkg/workflow/compiler_activation_outputs.go
  - pkg/workflow/daily_aic_workflow_guardrail_test.go
  - pkg/workflow/notify_comment_conclusion_helpers.go
comment_count: 0

Note

This comment is managed by comment memory.

Expand the saved memory block to view or edit the persistent context for this thread.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 30.5 AIC · ⌖ 5.94 AIC · ⊞ 21.1K · ◷
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

No blocking issues found in the changed lines.

Notes

I checked the risky parts of this change: cache precedence between recorded and estimated observations, retry behavior for legacy/provenance-less cache entries, the activation summary breakdown, and the new estimated-AIC plumbing into the conclusion report. The updated tests cover the edge cases I would normally expect to break here, and I did not find a changed-line correctness issue that should block merge.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 30.5 AIC · ⌖ 5.94 AIC · ⊞ 21.1K
Comment /review to run again

@github-actions github-actions Bot mentioned this pull request Oct 6, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the diff (11 real content files; remaining 319 files are mechanical .lock.yml bumps from recompilation). The change correctly threads source ("recorded" vs "estimated") provenance through the scan cache, guardrail summary, and conclusion report.

Verified via direct node execution (sandbox network blocked npm install for vitest with a self-signed-cert error) that readScanCache provenance precedence works as intended: a recorded entry is never overwritten by a later estimated observation for the same run attempt, while among same-provenance entries the most recent observed_at wins. Also ran go build ./... and go test ./pkg/workflow/... -run TestDailyAIC — all pass.

No blocking issues found on the changed lines.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • codeload.github.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "codeload.github.com"

See Network Configuration for more information.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 92.6 AIC · ⌖ 13.1 AIC · ⊞ 8.2K

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check agent (FAILURE): https://github.com/github/gh-aw/actions/runs/37422812203/job/112136159075.
  3. Fix failing check build-wasm (FAILURE): https://github.com/github/gh-aw/actions/runs/37422812525/job/112135945717.
  4. Fix failing check conclusion (FAILURE): https://github.com/github/gh-aw/actions/runs/37422812203/job/112141436533.
  5. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/37422812525/job/112135945458.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: 8c9b259
Sous-chef work: 34f38971738f6a752a646bd7797a6c8d47fb096e4eb6f91e946a91255433c8c4 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac 51e2287c3d1ee41b7e13769862add61dcd292a623cf943abc5968c984e246bcf 8acb61a077717e3a460018aacdfde96fd489f77606cd36169e2328d9079b75bb
Sous-chef state: 4925d930f46b1e981446f435bee5781f49ee763a6ac342c9f6e47a88cd9f9ec5

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 11.4 AIC · ⌖ 7.68 AIC · ⊞ 1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 6, 2026 07:14
…-reports

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged latest main with make merge-main and committed the refreshed WASM golden fixtures (9cfaf67, 5cc63b2), fixing the shared TestWasmGolden_AllEngines failure behind build-wasm and impacted-go-tests. The agent job timed out after its 15-minute Copilot CLI limit; conclusion failed as a consequence, so neither has a code fix in this PR. Local validation passed; CI needs a human re-trigger. No review thread was exposed for this issue-level comment, so there was no thread to resolve.

Copilot AI requested a review from gh-aw-bot October 6, 2026 07:25
@pelikhan
pelikhan merged commit 185d115 into main Oct 6, 2026
44 checks passed
@pelikhan
pelikhan deleted the copilot/fix-daily-aic-reports branch October 6, 2026 11:50
@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.91.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Daily AIC guardrail reports fallback estimates for cancelled runs as consumed usage

4 participants