Copilot · GitHub

Copilot AI linked an issue

Aug 2, 2026

that may be closed by this pull request

Closed

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI changed the title [WIP] Add gate for agent job based on custom setup job Add first-class agent job gating via jobs.agent.needs and jobs.agent.if

Aug 2, 2026

Closed

@pelikhan

pelikhan marked this pull request as ready for review

August 2, 2026 17:34

Copilot AI review requested due to automatic review settings

August 2, 2026 17:34

github-actions[bot]

github-actions[bot]

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

github-actions[bot]

Open

@pelikhan

Closed

… bypass for builtin job augmentation
- Strip 'if: ' prefix from jobs.<built-in>.if values before storing in Job.If,
  matching the Job.If contract (bare expression only) and preventing 'if: if: ...'
  in the compiled output
- Report the actual field name (.if or .needs) in the 'cannot augment' error so
  authors can identify the misconfigured field
- Add guardIfAgainstStatusFuncBypass helper that inserts explicit
  needs.<compiler-job>.result == 'success' guards when user condition contains a
  status function (always/failure/cancelled/success), preventing bypass of
  compiler-managed activation/pre_activation permission checks
- Add ifExpressionContainsStatusFunc helper for string-based status function
  detection (the expression parser tokenises failure() as an ExpressionNode
  literal, so AST-based detection is not reliable here)
- Add tests for prefix stripping, field-specific error messages, and status
  function bypass guarding
- Update ADR-49814: status changed from Draft to Accepted, guard mechanism documented
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

@github-actions

…Augmentations; strengthen integration test if assertion
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

@pelikhan

@pelikhan

pelikhan deleted the copilot/feature-agent-job-level-if branch

August 2, 2026 19:53

Closed

Merged

Merged

Open

github-actions Bot added a commit that referenced this pull request

Aug 3, 2026
Document jobs.agent.needs/if built-in job gating (#49814) in syntax-agentic.md,
and split token-optimization.md (423 -> 384 lines) by extracting OpenTelemetry/
AgenticOps and harness-experience-learning content into a new
token-optimization-observability.md, bringing it back under the 400-line target.

Closed

Read the original on github.com ↗