Skip to content

Record authoritative zero AIC evidence for pre-flight noops - #70344

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-pre-flight-noops-aic
Oct 20, 2026
Merged

pelikhan merged 4 commits into
mainfrom
copilot/fix-pre-flight-noops-aic

Conversation

Copilot AI commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Pre-flight noops skip model execution but leave successful agent jobs with empty accounting, causing the daily AIC guardrail to charge the configured max-ai-credits fallback.

  • Zero-use evidence: The shared harness pre-flight check atomically records not_started execution evidence scoped to the component, run ID, and attempt. Existing artifact collection and guardrail logic consume it.
  • Fail-closed accounting: Noops emitted after execution begins do not downgrade evidence. Invalid metadata or write failures cannot manufacture zero-use proof.
  • Regression coverage: Covers successful noop accounting, skipped engine invocation, metadata validation, write failures, and missing accounting after execution starts.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pre-flight noops to produce zero AIC accounting Record authoritative zero AIC evidence for pre-flight noops Oct 19, 2026
Copilot AI requested a review from pelikhan October 19, 2026 19:58
@pelikhan
pelikhan marked this pull request as ready for review October 19, 2026 20:11
Copilot AI max review requested due to automatic review settings October 19, 2026 20:11
@github-actions

github-actions Bot commented Oct 19, 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 · gpt56 · 5.75 AIC · ⌖ 5.51 AIC · ⊞ 14.7K · ◷

Generated by Ponytail Reviewer for #70344

@github-actions

github-actions Bot commented Oct 19, 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 · 11 AIC · ⌖ 15.1 AIC · ◇ 4.48 AIC · ⊞ 12.6K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 19, 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 🏗️ · opus55 · 10.2 AIC · ⌖ 31.9 AIC · ◇ 15.9 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 19, 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

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — approving. This is a well-scoped, fail-closed fix with solid regression coverage.

📋 Key Themes & Highlights

Verification performed

  • Traced the new not_started evidence write in harness_retry_runner.cjs through to the consumer in daily_aic_component_coverage.cjs (provesExecutionNotStarted) — field names, versioning, and the run_id/run_attempt scoping all line up correctly.
  • Confirmed the ["agent", "detection", "evals"] component allow-list matches the three call sites that emit this evidence protocol from the Go compiler (compiler_yaml_main_job.go, evals_steps.go, threat_detection_steps.go).
  • Confirmed Number.isSafeInteger correctly rejects the 9007199254740992 (2^53) boundary test case, and that non-integer/zero/negative run metadata is rejected.

Positive highlights

  • ✅ Fail-closed by construction: evidence is only ever written in the exact pre-flight branch that proves no model ran; a post-attempt noop never downgrades started evidence (verified against daily_aic_component_coverage.cjs's guardrail logic).
  • ✅ Atomic write: .tmp + rename avoids partial/corrupt evidence files, and write failures are caught and logged rather than silently manufacturing false zero-use proof.
  • ✅ Regression coverage is thorough: covers the happy path (harness_retry_runner.test.cjs), invalid metadata matrix, write-failure-preserves-prior-evidence, post-attempt noop non-downgrade, and the guardrail consumer side (daily_aic_component_coverage.test.cjs) plus an end-to-end harness spawn test (copilot_harness.test.cjs).

Minor, non-blocking note

  • Left one inline comment on harness_retry_runner.cjs about the hard-coded component allow-list duplicating names already defined on the Go compiler side — worth a shared constant someday, but not a correctness issue today.

@copilot please address the review comments above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 74.6 AIC · ⌖ 15.9 AIC · ⊞ 10.1K
Comment /matt to run again

const component = env.GH_AW_AWF_EXECUTION_COMPONENT;
const runId = Number(env.GITHUB_RUN_ID);
const runAttempt = Number(env.GITHUB_RUN_ATTEMPT);
if (evidenceFile && ["agent", "detection", "evals"].includes(component || "") && Number.isSafeInteger(runId) && runId > 0 && Number.isSafeInteger(runAttempt) && runAttempt > 0) {

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.

[/codebase-design] The ["agent", "detection", "evals"] allow-list duplicates the three component names already encoded via generateComponentExecutionEvidenceStep call sites in pkg/workflow (compiler_yaml_main_job.go, evals_steps.go, threat_detection_steps.go). Not a blocker, but if a fourth component is ever added, this list is an easy place to forget to update.

💡 Suggestion

Consider exporting a shared KNOWN_EXECUTION_COMPONENTS constant (or generating this list from the same source the Go compiler step names come from) so the two sides can't drift silently.

@copilot please address this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the fixed component allow-list in favor of generic component-identifier validation, so new compiler components don’t require a duplicate JS list. Added future-component regression coverage in harness_retry_runner.test.cjs (90c37e3).

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

Execution evidence is not yet reliable across sandbox boundaries and nested harness invocations.

2 open issues
What changed in this PR

Adds run-scoped zero-use evidence so daily AI-credit accounting can recognize pre-flight noops without charging fallback credits.

Changes:

  • Atomically records not_started evidence after validating execution metadata.
  • Adds regression coverage for noop accounting, skipped model invocation, and failure cases.
File Description
actions/​setup/​js/​harness_retry_runner.test.cjs Tests evidence creation, validation, and preservation.
actions/​setup/​js/​harness_retry_runner.cjs Records execution evidence for pre-flight noops.
actions/​setup/​js/​daily_aic_component_coverage.test.cjs Tests zero-credit accounting and missing-usage rejection.
actions/​setup/​js/​copilot_harness.test.cjs Verifies noop evidence without invoking the engine.

Review effort: Max

* @returns {boolean}
*/
function shouldSkipForNoopSafeOutputs({ safeOutputsPath, hasNoopInSafeOutputs, log }) {
function shouldSkipForNoopSafeOutputs({ safeOutputsPath, hasNoopInSafeOutputs, log, env = process.env }) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Captured execution metadata before child-env construction, stripped it from harness/engine children, and isolated it in the safe-outputs test setup. The runner-side preflight now records noops before sandbox execution (90c37e3).

Comment on lines +35 to +37
fs.mkdirSync(path.dirname(evidenceFile), { recursive: true });
fs.writeFileSync(`${evidenceFile}.tmp`, JSON.stringify({ version: 1, component, run_id: runId, run_attempt: runAttempt, state: "not_started" }) + "\n");
fs.renameSync(`${evidenceFile}.tmp`, evidenceFile);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Moved the preflight check to the runner-side AWF wrapper so it records evidence on the host before sandbox execution. Regression coverage verifies this transport and that a noop emitted after execution starts cannot downgrade evidence (90c37e3).

@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. Review (actions/setup/js/harness_retry_runner.cjs:32): [/codebase-design] The ["agent", "detection", "evals"] allow-list duplicates the three component names already encoded via generateComponentExecutionEvidenceStep call sites in pkg/workflow (compiler_yaml_main_job.go, evals_steps.go, threat_detection_steps.go). Not a blocker, but if a fourth component is ever added, this list is an easy place to forget to update. - Record authoritative zero AIC evidence for pre-flight noops #70344 (comment)
  3. Review (actions/setup/js/harness_retry_runner.cjs:23): The evidence variables are exported into AWF and inherited by engine subprocesses. Where the evidence file is shared and writable, a nested noop harness can therefore replace the outer run's started record with valid not_started evidence after the model has already run. This also happens when the agent runs the existing helper and Claude/Codex noop tests: they inherit the live metadata instead of redirecting it. If usage accounting is missing, the guardrail accepts this false zero-use proof. Capture the evidence configuration in each harness before constructing child environments, pass it explicitly to this helper, and prevent engine children from inheriting it. Also isolate these variables in actions/setup/js/scripts/test_safeoutputs_setup.mjs. - Record authoritative zero AIC evidence for pre-flight noops #70344 (comment)
  4. Review (actions/setup/js/harness_retry_runner.cjs:37): The harness writes inside the sandbox, but artifact collection reads the runner's /tmp/gh-aw/agent_execution.json. That path is not a shared writable output in several supported configurations: Cloud Hypervisor's default write policy excludes it and its .tmp sibling (pkg/workflow/sandbox.go:338–350); NVX does not collect it (nvx_assets.cjs:9–10,304–310); and on ARC/DinD, runner /tmp/gh-aw is not daemon-visible (copilot_engine_execution.go:433). Successful pre-flight noops therefore leave the runner's evidence as started and still incur fallback AIC. Record the transition on the host from a trusted pre-flight result, or provide writable, collected evidence transport for these configurations, with regression coverage. - Record authoritative zero AIC evidence for pre-flight noops #70344 (comment)
  5. Fix failing check agent (FAILURE): https://github.com/github/gh-aw/actions/runs/39317215622/job/118282626363.
  6. Fix failing check conclusion (FAILURE): https://github.com/github/gh-aw/actions/runs/39317215622/job/118284592088.
  7. Fix failing check JS Tests (shard 2/4) (FAILURE): https://github.com/github/gh-aw/actions/runs/39317215626/job/118282062037.

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: b8463dd
Sous-chef work: 043185828d65a534dd8b2b6b4d00e0d47bf21a2940d3f277c0ed15da7f668648 2ef8676790d1384208eac846480d0b4e2b5beac892482d70d73843cfa2dc6ab3 34f38971738f6a752a646bd7797a6c8d47fb096e4eb6f91e946a91255433c8c4 51e2287c3d1ee41b7e13769862add61dcd292a623cf943abc5968c984e246bcf a6853bcd15065a54d385e8ac107aa4fe096094e61af2a5768e6198753feb78f8 b9df3d6ebf12a70c50f8a6d80ae42d8167167aa3720b199c53f0293bc4a697f8
Sous-chef state: 0169e1b103cfc46af91b4c2415f2f20bee77c94c1a5024e14562e04e07331b2b

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 21.2 AIC · ⌖ 8.31 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 19, 2026 21:03
…t-noops-aic

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 requested a review from gh-aw-bot October 19, 2026 21:42
@pelikhan
pelikhan merged commit 7363a87 into main Oct 20, 2026
42 checks passed
@pelikhan
pelikhan deleted the copilot/fix-pre-flight-noops-aic branch October 20, 2026 01:36
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.92.6

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.

Pre-flight noops should produce zero AIC accounting

4 participants