Skip to content

Merge evals state persistence and integrate AIC accounting - #74292

Closed
pelikhan wants to merge 2 commits into
mainfrom
merge-evals-state-persistence
Closed

pelikhan wants to merge 2 commits into
mainfrom
merge-evals-state-persistence

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Evals now use the standalone Decisions API rather than an agent engine, so persisting their results no longer needs a separate write-enabled job. This removes a runner allocation and redundant artifact download while preserving the accounting evidence needed by the daily credit guardrail.

Changes

  • Move checkout, Git credential configuration, and state persistence into evals; remove the push_evals_state job and conclusion dependency. Push local results only after successful redaction and when not cancelled.
  • Give evals contents: write for persistence while keeping agent jobs read-only. Dry-run compilation omits persistence and retains contents: read.
  • Integrate the Credit guardrail accounting changes: accept run/selected-attempt-bound failed Decisions markers when advisory execution leaves the job successful, preserve other components' recorded usage, and replace whole-run estimates on subsequent scans. Nonempty usage wins; malformed or unreadable accounting remains fail-closed. The compatibility fallback explicitly warns that provider billing remains unverified.
  • Skip steering-issue creation when the daily credit guardrail blocks startup. Update failure reporting and documentation, and regenerate affected workflow locks.

Validation

  • make build, make fmt, and make agent-report-progress passed, including lint, impacted tests, schema freshness, and workflow drift checks.
  • Focused Go evals/steering/transport regression tests passed.
  • JavaScript typecheck and 423 tests across accounting, guardrail, evals, and failure-reporting suites passed.
  • All 355 workflows compiled. Reviewed all 200 merged evals jobs for guarded persistence and accounting uploads; all 53 incremental accounting lock changes only add the steering guardrail condition.

No workflows were dispatched.

@pelikhan
pelikhan marked this pull request as ready for review November 3, 2026 00:26
Copilot AI adaptive review requested due to automatic review settings November 3, 2026 00:26
@@ -20,7 +20,7 @@ const GITHUB_API_VERSION = "2022-11-28";
const FAILED_JOBS_ISSUE_EXPIRES_HOURS = 24 * 7; // 1 week
const MAX_FAILED_STEP_NUMBER = 10000;
const MAX_FAILED_STEPS_REPORTED = 10;
const STATE_PUSH_JOB_IDS = new Set(["push_ledger_changes", "push_repo_memory", "push_evals_state", "push_experiment_state"]);
const STATE_PUSH_JOB_IDS = new Set(["push_ledger_changes", "push_repo_memory", "evals", "push_evals_state", "push_experiment_state"]);
Comment thread pkg/workflow/evals_job.go
@@ -108,6 +121,9 @@ func (c *Compiler) buildEvalsJobPermissions(data *WorkflowData) (*WorkflowData,
brokeredInference := usesTokenBrokerInference(evalsAuthData)
copilotRequestsEnabled := evalsAuthData.AI == "copilot" && hasCopilotRequestsWritePermission(data) && !brokeredInference
perms := NewPermissionsContentsRead()
if !c.dryRun {
perms.Set(PermissionContents, PermissionWrite)

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

The evals job exposes a repository-write token to the inference endpoint and untrusted-output processing, while early checkout or credential-setup failures can prevent evaluation from running.

2 open issues
What changed in this PR

This PR consolidates Decisions-based evaluation and Git-backed state persistence into evals, removes the separate persistence job, and updates daily AI Credits accounting and startup guardrails.

Changes:

  • Move checkout, Git credentials, and redaction-guarded persistence into evals, retaining read-only dry-run behavior.
  • Add run/attempt-bound advisory Decisions failure accounting and regression coverage.
  • Suppress steering issues when the credit guardrail blocks startup; update failure reporting, documentation, and generated workflows.

This pull request requires changes.

The following findings remain unresolved:

  • Critical, 2 votes — pkg/workflow/evals_job.go:124: The write-scoped github.token becomes the Decisions credential and remains available to steps processing untrusted output. Separate inference credentials from repository-write credentials or isolate persistence in another job.
  • Critical, 2 votes — pkg/workflow/evals_job.go:103: Early checkout and credential setup leave the write token in .git/config during evaluation. Setup failures also prevent evaluation from running. Move these steps immediately before persistence under the same guard.
  • Moderate, 2 votes — actions/setup/js/daily_aic_component_coverage.cjs:282: A persistence failure can make successful Decisions execution with missing usage count as zero. Require run/attempt-bound judge-failure or not-started evidence; retain conclusion-only fallback only for legacy evals.
  • Moderate, 1 vote — pkg/workflow/evals_job.go:34: Merging persistence changes the meaning of an evals failure. Accounting must retain the conservative estimate when the judge succeeds without usage but the subsequent push fails.
  • Moderate, 2 votes — actions/setup/js/report_failed_jobs.cjs:23: push_experiment_state does not match the generated push_experiments_state job ID, so experiments-push Git errors are omitted from failure issues.
  • Nit, 2 votes — docs/src/content/docs/reference/artifacts.md:358: Persistence branches use sanitized workflow IDs, such as evals/videoanalyzer, rather than raw IDs.
File Description
pkg/​workflow/​evals_steps_test.go Test evals write permissions and agent read-only isolation.
pkg/​workflow/​evals_job.go Merge checkout, credentials, and guarded persistence into evals.
pkg/​workflow/​evals_job_test.go Cover accounting uploads, persistence ordering, and setup restoration.
pkg/​workflow/​compiler_steering_issue.go Gate steering creation on the credit guardrail.
pkg/​workflow/​compiler_steering_issue_test.go Cover guardrail-enabled, disabled, and dry-run conditions.
pkg/​workflow/​compiler_jobs.go Remove the separate evals persistence job and dependency.
pkg/​workflow/​compiler_jobs_state_test.go Cover merged persistence, GHES, and dry-run behavior.
docs/​src/​content/​docs/​specs/​ai-credits-specification.md Document Decisions accounting and advisory-failure compatibility.
docs/​src/​content/​docs/​reference/​safe-outputs.md Document steering suppression when startup is blocked.
docs/​src/​content/​docs/​reference/​artifacts.md Document merged persistence and dry-run permissions.
actions/​setup/​js/​report_failed_jobs.test.cjs Cover persistence error details from evals jobs.
actions/​setup/​js/​report_failed_jobs.cjs Include evals in state-persistence error reporting.
actions/​setup/​js/​push_evals_state.cjs Update comments for locally produced redacted results.
actions/​setup/​js/​daily_aic_spec_conformance.test.cjs Cover replacement of whole-run estimates with component accounting.
actions/​setup/​js/​daily_aic_component_coverage.test.cjs Cover failure-evidence binding, usage precedence, and invalid accounting.
actions/​setup/​js/​daily_aic_component_coverage.cjs Recognize run/attempt-bound advisory Decisions failures.
.github/​workflows/​workflow-skill-extractor.lock.yml Regenerate merged evals persistence.
.github/​workflows/​weekly-safe-outputs-spec-review.lock.yml Add the steering guardrail condition.
.github/​workflows/​video-analyzer.lock.yml Regenerate merged evals persistence.
.github/​workflows/​ubuntu-image-analyzer.lock.yml Add the steering guardrail condition.
.github/​workflows/​sub-issue-closer.lock.yml Regenerate merged evals persistence.
.github/​workflows/​stale-pr-cleanup.lock.yml Regenerate merged evals persistence.
.github/​workflows/​spec-extractor.lock.yml Add the steering guardrail condition.
.github/​workflows/​slide-deck-maintainer.lock.yml Add the steering guardrail condition.
.github/​workflows/​semantic-function-refactor.lock.yml Regenerate merged evals persistence.
.github/​workflows/​schema-feature-coverage.lock.yml Regenerate merged evals persistence.
.github/​workflows/​research.lock.yml Regenerate merged evals persistence.
.github/​workflows/​repo-tree-map.lock.yml Regenerate merged evals persistence.
.github/​workflows/​q.lock.yml Add the steering guardrail condition.
.github/​workflows/​linter-miner.lock.yml Add the steering guardrail condition.
.github/​workflows/​layout-spec-maintainer.lock.yml Add the steering guardrail condition.
.github/​workflows/​issue-triage-agent.lock.yml Regenerate merged evals persistence.
.github/​workflows/​github-mcp-tools-report.lock.yml Add the steering guardrail condition.
.github/​workflows/​eslint-monster.lock.yml Regenerate merged evals persistence.
.github/​workflows/​duplicate-code-detector.lock.yml Regenerate merged evals persistence.
.github/​workflows/​draft-pr-cleanup.lock.yml Regenerate merged evals persistence.
.github/​workflows/​dev.lock.yml Regenerate merged evals persistence.
.github/​workflows/​deepsec-security-scan.lock.yml Regenerate merged evals persistence.
.github/​workflows/​dead-code-remover.lock.yml Add the steering guardrail condition.
.github/​workflows/​daily-work-queues-report.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-token-consumption-report.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-syntax-error-quality.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-squid-image-scan.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-spec-coverage-kiro.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-schema-audit-cursor.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-safe-outputs-conformance.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-reliability-review.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-regulatory.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-pr-review-cursor.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-observability-report.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-graft-intelligence.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-grader-audit.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-evals-report.md Recognize consolidated and legacy persistence failures.
.github/​workflows/​daily-cli-tools-tester.lock.yml Regenerate merged evals persistence.
.github/​workflows/​daily-ambient-context-optimizer.lock.yml Regenerate merged evals persistence.
.github/​workflows/​copilot-centralization-drilldown.lock.yml Regenerate merged evals persistence.
.github/​workflows/​contribution-check.lock.yml Regenerate merged evals persistence.
.github/​workflows/​commit-changes-analyzer.lock.yml Regenerate merged evals persistence.
.github/​workflows/​cli-consistency-checker.lock.yml Regenerate merged evals persistence.
.github/​workflows/​artifacts-summary.lock.yml Regenerate merged evals persistence.
.github/​aw/​jobs.md Update evals responsibilities, dependencies, and credentials.

Review effort: Max (auto)

Comment thread pkg/workflow/evals_job.go
Comment on lines +103 to +107
" with:\n",
" persist-credentials: false\n",
" sparse-checkout: .\n",
)
steps = append(steps, c.generateGitConfigurationSteps()...)
Comment thread pkg/workflow/evals_job.go
Comment on lines +124 to +126
if !c.dryRun {
perms.Set(PermissionContents, PermissionWrite)
}
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.

4 participants