Skip to content

fix(tooling): prevent native audit worker recursion - #1895

Merged
gfyrag merged 1 commit into
release/v3.0from
fix/native-audit-worker-recursion
Sep 4, 2026
Merged

fix(tooling): prevent native audit worker recursion#1895
gfyrag merged 1 commit into
release/v3.0from
fix/native-audit-worker-recursion

Conversation

@gfyrag

@gfyrag gfyrag commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • define audit and challenge providers as inner leaf workers in their existing prompts
  • forbid nested ai-audit, ai-audit-challenge, and ai-audit-jira orchestration
  • document trusted outer-process ownership and add hostile-manifest prompt regressions

Root cause

The provider prompt marked AGENTS.md and docs/technical/agent-context.md as authoritative without first defining the provider as an already-launched leaf worker. Those repository routing docs tell outer agents to invoke the native audit and challenge launchers, so the provider could follow them recursively from its read-only sandbox.

Bugfix evidence

  • BEFORE_FIX=BUG_REPRODUCED: focused prompt-capture tests failed on the exact base because neither worker prompt defined or enforced the leaf role.
  • TEST_SENSITIVITY=PASS: temporarily removing the prohibition makes both focused regressions fail.
  • The zero-finding fixture runs scripts/ai-audit and then scripts/ai-audit-challenge; its fake provider records no nested-launcher attempt.

Validation

  • go test -race ./scripts/aiaudit ./scripts/aiauditchallenge -count=1
  • bash scripts/check-repo-invariants
  • bash scripts/agent-check
  • AI_REVIEW_BASE_SHA=3a8eda3636df48873558140161a852393b4adc6e bash scripts/agent-check-pr
  • git diff --check
  • exact candidate review: APPROVE, zero findings, residual risk LOW

No audit redesign, PR workflow change, runtime/product change, or Jira publication.

@NumaryBot

Copy link
Copy Markdown
Contributor

✅ Approve — automated review

The worker prompts clearly establish the non-recursive leaf role before repository guidance is loaded, and the added tests cover both audit and challenge prompts. No actionable defects were found.

No findings.

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.24%. Comparing base (3a8eda3) to head (38e7def).

Additional details and impacted files
@@              Coverage Diff              @@
##           release/v3.0    #1895   +/-   ##
=============================================
  Coverage         77.23%   77.24%           
=============================================
  Files               478      478           
  Lines             51258    51258           
=============================================
+ Hits              39591    39596    +5     
- Misses             8232     8234    +2     
+ Partials           3435     3428    -7     
Flag Coverage Δ
e2e 77.24% <ø> (+<0.01%) ⬆️
scenario 77.24% <ø> (+<0.01%) ⬆️
unit 77.24% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gfyrag
gfyrag merged commit 3322b0b into release/v3.0 Sep 4, 2026
17 checks passed
@gfyrag
gfyrag deleted the fix/native-audit-worker-recursion branch September 4, 2026 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants