Skip to content

Fix daily credit accounting for advisory Decisions failures - #74317

Merged
pelikhan merged 1 commit into
mainfrom
pelikhan/credit-guardrail-accounting
Nov 3, 2026
Merged

pelikhan merged 1 commit into
mainfrom
pelikhan/credit-guardrail-accounting

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Why

Failed advisory Decisions requests can leave the Evaluations job successful while producing no response-usage file. The daily credit guardrail then replaces the entire historical run with a maximum-credit estimate, discarding available agent/detection usage and causing repeated startup blocks.

Changes

  • Apply the existing failed-Evaluations accounting policy when a successful wrapper job contains strict Decisions failure evidence matching the run and selected job attempt.
  • Preserve nonempty accounting precedence and fail-closed behavior for malformed, unreadable, stale, or unknown evidence. Previously estimated runs are re-inspected on the next scan.
  • Skip steering-issue creation when the daily credit guardrail blocks startup, allowing normal failure-report deduplication. Regenerate 53 locks, each with exactly one added condition.
  • Add regressions for failure evidence, accounting precedence, estimate replacement, and disabled/dry-run guardrails.

Scope and trade-offs

The zero-accounting fallback is an existing compatibility policy, not proof that the provider never charged the request. The runtime explicitly warns that provider billing remains unverified. Credit limits, models, endpoints, and credentials are unchanged; the upstream HTTP 400 cause is not resolved here.

This is the standalone accounting/steering alternative to the same changes included in #74292. It does not merge the evals state-persistence jobs; avoid merging both alternatives independently.

Validation

  • make fmt and make lint-cjs
  • Compiler build and go test ./pkg/workflow -run 'SteeringIssue|ActivationSteering' -count=1
  • Typecheck and 376 targeted JavaScript tests across component coverage, specification conformance, scanning, guardrail, and evals suites
  • make agent-report-progress, including impacted tests, lint, schema freshness, and 355-workflow compile/drift validation
  • Complete read-only security review of commit 2f75c0ba8722feb021acd783db5c42341c9043d2, including all source and generated locks: PASS, no confirmed vulnerabilities or material coverage gaps

No workflows were dispatched and no live billing reconciliation is claimed.

Documentation review

Source Change Security impact
AI Credits specification Defines the advisory failure evidence and billing caveat Invalid or unreadable accounting still fails closed; no executable snippets or permission changes
Safe outputs Documents steering suppression on credit blocks Reduces issue creation; credential recipients, permissions, sandbox, and approvals remain unchanged

Relates to #74243, #74198, #74175, #74237, and #74182.

Preserve known component usage when run-bound judge failure evidence qualifies for the existing failed-evaluations accounting policy. Skip steering issue creation for daily-credit-blocked runs. Add regression coverage and document the billing caveat.

Co-authored-by: Copilot App <[email protected]>
@pelikhan
pelikhan marked this pull request as ready for review November 3, 2026 00:47
Copilot AI adaptive review requested due to automatic review settings November 3, 2026 00:47
@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Nov 3, 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 Nov 3, 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.

Design Decision Gate 🏗️

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Design Decision Gate 🏗️ · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Test Quality Sentinel · sonnet50 · ~16 AIC · ⌖ ~21 AIC · ⊞ 12.7K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Ponytail Reviewer · routed: gpt56 max · ~4 AIC · ⌖ ~1 AIC · ⊞ 118 · ◷

Generated by Ponytail Reviewer for #74317

@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.

Review summary

No actionable blocking issues found in the changed lines. The Decisions failure fallback is identity-bound, preserves accounting precedence, and the steering issue condition is emitted after the guardrail step in the activation job. Specialist pass completed; its speculative concerns were not actionable from the diff.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.7K
Comment /review to run again

@pelikhan
pelikhan merged commit eca7d29 into main Nov 3, 2026
151 checks passed
@pelikhan
pelikhan deleted the pelikhan/credit-guardrail-accounting branch November 3, 2026 00:56

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.

🟡 Changes recommended

Unresolved documentation issues leave the marker’s reason_code field unclear and normative steering-issue requirements inconsistent with the new guardrail exception.

2 open issues
What changed in this PR

Updates gh-aw’s daily credit guardrail to preserve recorded usage when verified advisory Decisions failures leave no evaluation accounting. This is the standalone accounting/steering alternative to #74292; evaluation state persistence is unchanged.

Changes:

  • Accept strict run- and attempt-bound failure evidence under the existing zero-accounting policy, preserving usage precedence and fail-closed handling.
  • Suppress steering issues when the credit guardrail blocks startup and regenerate 53 workflow locks.
  • Add regression tests and document the fallback, steering behavior, and unverified provider-billing caveat.
File Description
pkg/​workflow/​compiler_steering_issue.go Emit the credit-block condition for steering creation.
pkg/​workflow/​compiler_steering_issue_test.go Cover enabled, disabled, and dry-run guardrails.
docs/​src/​content/​docs/​specs/​ai-credits-specification.md Specify advisory failure accounting and conformance coverage.
docs/​src/​content/​docs/​reference/​safe-outputs.md Document steering suppression on credit blocks.
actions/​setup/​js/​daily_aic_spec_conformance.test.cjs Test replacement of historical whole-run estimates.
actions/​setup/​js/​daily_aic_component_coverage.test.cjs Test failure evidence, identity checks, and usage precedence.
actions/​setup/​js/​daily_aic_component_coverage.cjs Recognize verified advisory Decisions failures.
.github/​workflows/​weekly-safe-outputs-spec-review.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​weekly-editors-health-check.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​weekly-blog-post-writer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​update-astro.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​unbloat-docs.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​ubuntu-image-analyzer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​tidy.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​technical-doc-writer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​spec-extractor.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​spec-enforcer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​smoke-project.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​slide-deck-maintainer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​refiner.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​q.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​purelock.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​linter-miner.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​layout-spec-maintainer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​instructions-janitor.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​hourly-ci-cleaner.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​go-logger.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​glossary-maintainer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​github-mcp-tools-report.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​functional-pragmatist.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​evoskill-evolver.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​eslint-miner.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​dictation-prompt.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​developer-docs-consolidator.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​dependabot-burner.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​dead-code-remover.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-yamllint-fixer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-workflow-updater.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-trajectory-grader-implementer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-safeoutputs-git-simulator.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-safe-output-integrator.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-rendering-scripts-verifier.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-go-test-parallelizer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-elixir-credo-snippet-audit.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-documentation-diagram.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-doc-updater.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-doc-healer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-compiler-threat-spec-optimizer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-community-attribution.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-code-debt-aider.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-caveman-optimizer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-astrostylelite-markdown-spellcheck.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-architecture-diagram.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​daily-agent-of-the-day-blog-writer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​code-simplifier.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​code-scanning-fixer.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​cloclo.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​ci-coach.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​avenger.lock.yml Skip steering creation on credit blocks.
.github/​workflows/​archivx-agentic-workflows-analyzer.lock.yml Skip steering creation on credit blocks.

Review effort: Max (auto)


Set `steer: true` to create a run-scoped issue during the activation job, before the agent starts. Users can add comments containing the keyword `steer` while the run is in progress. The injected prompt identifies the exact issue and instructs the agent to read relevant user-authored comments with the GitHub MCP `issue_read` tool.

When the daily AI Credits guardrail blocks agent startup, no steering issue is created. Failure reporting uses its normal existing-issue deduplication instead.
| Explicit execution-not-started artifact | No selected accounting and version-1 component execution evidence matching run ID, job attempt, component, and `state: not_started` |
| Legacy failed Agent before accounting | Verified coverage, no selected accounting, failed conclusion, missing raw file, no execution-evidence file, and no inspected legacy Agent artifact |
| Failed Evaluations before accounting | Verified coverage, failed conclusion, and no selected accounting |
| Advisory Decisions failure before accounting | Verified coverage, successful job conclusion, no selected accounting, and `evals/evals_status.json` identifying the same run and selected job attempt with engine `decisions`, status `not_evaluated`, reason `judge_failed`, execution outcome `failure`, and execution state `started` |
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.0

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.

2 participants