Skip to content

Add hourly auditor for recurring agentic workflow failures - #75695

Merged
pelikhan merged 1 commit into
mainfrom
copilot/add-auditor-agentic-workflow
Nov 7, 2026
Merged

pelikhan merged 1 commit into
mainfrom
copilot/add-auditor-agentic-workflow

Conversation

Copilot AI commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Add an hourly auditor that investigates new failing agentic runs and proposes a fix for the largest unresolved cluster. Avoid duplicate PRs and bound GitHub API usage through cached collection.

  • Collection: Separate job caches logs, checkpoints processed attempts, and tracks unfinished/deferred runs. Skip agent execution when no new non-intentional failures exist or evidence is incomplete.
  • Diagnosis: Audit up to three representative clusters; require an evidenced root cause before proposing one focused draft PR.
  • Deduplication: Compare all open PRs semantically and by stable root-cause fingerprint; refresh the listing before publication.
  • Output: Exclude **/*.lock.yml from generated fix PRs.
  • Coverage: Cold cache starts with the preceding hour. Discovery gaps over 24 hours and truncated queries fail closed; unobserved older reruns remain outside scope.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan November 7, 2026 14:56
@pelikhan
pelikhan marked this pull request as ready for review November 7, 2026 14:58
Copilot AI adaptive review requested due to automatic review settings November 7, 2026 14:58
@pelikhan
pelikhan merged commit 199e827 into main Nov 7, 2026
74 of 78 checks passed
@pelikhan
pelikhan deleted the copilot/add-auditor-agentic-workflow branch November 7, 2026 14:58
@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection results could not be parsed.

Review the workflow run logs to troubleshoot the error.

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

@github-actions

github-actions Bot commented Nov 7, 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 7, 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 · routed: gpt56 max · ~1 AIC · ⌖ ~2 AIC · ⊞ 6.3K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #75695

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification 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 PR Specification Reviewer · gpt56 · ~2 AIC · ⌖ ~1 AIC · ⊞ 1.6K · ◷

Generated by PR Specification Reviewer for #75695

@github-actions

github-actions Bot commented Nov 7, 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: opus55 medium · ~12 AIC · ⌖ ~2 AIC · ⊞ 7.7K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

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 critical issues can stall checkpoint advancement, leave failures uninvestigated, and expose the shell-capable agent to contributor text that bypasses integrity checks.

9 open issues
What changed in this PR

Adds an hourly gh-aw auditor to investigate recurring agentic workflow failures and propose one focused, deduplicated draft fix PR.

Changes:

  • Adds cached, attempt-aware collection with API budgets and deferred-run tracking.
  • Defines representative audits, root-cause fingerprints, all-author PR deduplication, and generated lock-file exclusion.
  • Adds collector regression tests to make test-scripts.

Validation included source inspection and isolated collector checks; workflow compilation and live execution were not performed.

File Description
scripts/​auditor-workflow.test.cjs Tests collection, checkpointing, pagination, batching, and activation guards.
Makefile Includes auditor tests in the script test target.
.github/​workflows/​auditor.md Defines collection, diagnosis, deduplication, and restricted PR publication.
.github/​workflows/​auditor.lock.yml Generates the executable Actions jobs and security configuration.

Review effort: Max (auto)

Comment on lines +156 to +159
openPRs.push(...response.data.map(pr => ({
number: pr.number, title: pr.title, body: pr.body, url: pr.html_url,
head: pr.head.sha, base: pr.base.ref, draft: pr.draft
})));
Comment on lines +223 to +225
report = cli(['aw', 'logs', (run.path || '').split('@')[0],
'--repo', repository, '--after-run-id', String(run.id - 1),
'--before-run-id', String(run.id + 1), '--count', '2',
Date.parse(report.runs[0].updated_at) !== Date.parse(run.updated_at)) {
throw new Error('Selected run missing or changed during collection');
}
if (!report.runs[0].intentional_failure) {
b.members.length - a.members.length ||
Number(b.signal_role === 'failure_boundary') - Number(a.signal_role === 'failure_boundary') ||
a.id.localeCompare(b.id));
const newFailures = fresh.filter(r => backlog.some(m => m.key === identity(r))).length;
Comment on lines +279 to +280
if (currentRate.used >= ceiling - 25 || currentRate.reset !== rate.reset) {
throw new Error('Shared API budget exhausted or reset; checkpoint unchanged');
if (!Number.isSafeInteger(r.id) || !Number.isInteger(r.run_attempt) ||
!Number.isFinite(Date.parse(r.updated_at))) throw new Error('Invalid run identity');
}
const eligible = agentic.filter(r => r.status === 'completed' && r.conclusion === 'failure');
const audited = cli(['aw', 'logs', (member.run.path || '').split('@')[0],
'--repo', repository, '--after-run-id', String(member.run.id - 1),
'--before-run-id', String(member.run.id + 1), '--count', '2',
'--artifacts', 'info,usage', '--audit', '--json', '--verbose',
Comment on lines +340 to +341
// Complete metadata/PR scope; evidence may be a declared FIFO batch.
// Never mark deferred attempts seen. Cache save must also succeed.
Comment on lines +427 to +428
messages, or query-local cluster IDs. Include the canonical tuple and
`<!-- auditor-root-cause:v1:<sha256> -->` in the PR body. Match exact fingerprints
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.2.2

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants