Skip to content

Restore pre-activation search gate permissions - #77563

Merged
pelikhan merged 8 commits into
mainfrom
copilot/fix-pre-activation-permissions
Nov 14, 2026
Merged

pelikhan merged 8 commits into
mainfrom
copilot/fix-pre-activation-permissions

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

The v1.x compiler omitted pre_activation permissions for search gates, leaving GITHUB_TOKEN metadata-only under top-level permissions: {}. Searches on private/internal repositories could then fail with HTTP 422 before the agent started.

  • Permissions: Grant issues: read and pull-requests: read when either skip-if-match or skip-if-no-match is configured. Preserve explicit on.permissions without restoring blanket write access.
  • Regression coverage: Assert emitted permissions for each gate independently and together, plus preservation of explicit write scopes.
  • Generated workflows: Refresh 31 affected lock files with only the required read-scope additions.
pre_activation:
  permissions:
    issues: read
    pull-requests: read

@pelikhan pelikhan changed the title [WIP] Fix pre_activation job permissions for v1.2.2 Restore pre-activation search gate permissions Nov 13, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 14, 2026 02:53
Copilot AI adaptive review requested due to automatic review settings November 14, 2026 02:53
@github-actions

github-actions Bot commented Nov 14, 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.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 7.2K · ◷

@github-actions

github-actions Bot commented Nov 14, 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 · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 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 by Ponytail Reviewer for #77563 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 182 · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

Generated by PR Specification Reviewer for #77563 · copilot · gpt56 · ~3 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 1.6K · ◷

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

PR Code Quality Reviewer

Outcome: reported_action

The agent completed and reported one or more actions. The no-op output is a completion signal, not a claim that no action was taken.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ◇ ~1 AIC · ⊞ 1.5K · ◷

@github-actions

github-actions Bot commented Nov 14, 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.

🏗️ ADR gate enforced by Design Decision Gate 🏗️ · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ◇ ~1 AIC · ⊞ 8.6K · ◷

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

Reviewed the changed compiler and regression coverage. The permission additions are scoped to configured search gates, preserve explicit permissions via Merge, and the generated lock updates are consistent with the change. No actionable correctness or maintainability issues found.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.5K
Comment /review to run again

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

Reviewed head a0744dabc855d36185de59ac3537f87467f9251f against specs/security-architecture-spec.md v1.1.10 (PM-10a–PM-10c, §7.6.1) and specs/compiler-threat-detection-spec.md v1.0.101.

Blocking finding: the generated lock changes remove permissions instead of adding the permissions required by the new search-gate branch. For example, ab-testing-advisor.md contains an imported skip-if-match, but ab-testing-advisor.lock.yml still gives pre_activation only contents: read; the same mismatch is present in unbloat-docs.lock.yml and other affected locks. Regenerate the affected lock files from this compiler revision and verify each search-gate variant emits issues: read and pull-requests: read while preserving explicit permissions. No specification update is proposed because this is a generated-contract regression, not an intentional contract change.

Coverage: static review only; no tests or conformance scripts were run per review policy.

Generated by PR Specification Reviewer for #77563 · copilot · gpt50 · ~3 AIC · ⌖ ~2 AIC · ⊞ 1.6K
Comment /review-specs to run again

perms.Set(PermissionPullRequests, PermissionRead)
}
// Search gates need read access to issues and pull requests in private/internal repositories.
if data.SkipIfMatch != nil || data.SkipIfNoMatch != nil {

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.

The generated lock updates do not reflect this new branch. For example, .github/workflows/ab-testing-advisor.md has an imported skip-if-match, and its lock still emits pre_activation.permissions: contents: read only (lock lines 2606-2608); the same omission appears in unbloat-docs.lock.yml and other affected locks. This leaves the search step without issues: read/pull-requests: read at runtime, so please regenerate the affected locks from this compiler revision and verify the emitted permissions.

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.

The locks were already regenerated in a0744da. ab-testing-advisor.lock.yml now emits contents: read, issues: read and pull-requests: read for pre_activation. main currently fails to build at pkg/workflow/imports.go:585 (undefined: topRawSafeOutputs), unrelated to this PR, so I couldn't run a recompile after merging it. The locks may need a make recompile once main builds again.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-6aae9352-08d0-4bf5-a85e-d24a86fd2c77","parents":[],"payload":{"id":"ldg-a10d5843-c6c1-4b00-b2e3-105decf3a7b5","operation":"append","value":{"finding_count":0,"head_sha":"a0744dabc855d36185de59ac3537f87467f9251f","outcome":"no_findings"}},"sha":"sha256:a60313a6665b25c674ab0c8c012629446090e1971a9d1df9c9c9044eae0ccfe0","timestamp":"2026-11-14T03:03:33.843Z","type":"ledger_append","version":1}
History

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-f7550398-8d03-4934-af66-52873bdc8eab","parents":[],"payload":{"id":"ldg-6f3f3f76-992b-40a0-a509-4a5d0b33bc2a","operation":"append","value":{"finding_count":1,"head_sha":"a0744dabc855d36185de59ac3537f87467f9251f","outcome":"regression"}},"sha":"sha256:d5b9bcf573a2c887d0df95095ff8ecf19bc74543b90b6c56fb5437aa4822e834","timestamp":"2026-11-14T03:04:18.610Z","type":"ledger_append","version":1}
History

@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 /tdd and /diagnosing-bugs. The fix is correct and the regression coverage is solid. Approving, with one minor naming suggestion inline.

📋 Verification

What was checked

  • Root cause: buildPreActivationPermissions now grants issues: read and pull-requests: read when either skip-if-match or skip-if-no-match is set. The grant is scoped to read and does not add write access.
  • Regression test: TestPreActivationSearchPermissions covers each gate alone and both together. I confirmed it fails (3 subtests) when the grant is removed, so it guards the fix.
  • Lock files: all 31 PR lock files recompile byte-for-byte to the committed HEAD output, so they are in sync with the compiler.
  • Preserved behaviour: explicit on.permissions still merges on top, and TestBuildPreActivationPermissions passes.
  • Formatting: gofmt is clean.

Notes

  • Thirteen gated workflows get their scopes through the shared skip-if-issue-open.md import rather than a direct gate in their own .md. The compiler handles this correctly.
  • Locally, the working tree has uncommitted lock-file edits that remove these grants. They are not part of this PR head (a0744da), so they do not affect the review.

@copilot please address the review comment above.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · routed: haiku55 xhigh · ~5 AIC · ⌖ ~2 AIC · ⊞ 6.6K
Comment /matt to run again

`skip-if-no-match: "is:pr is:open"`,
"skip-if-match: \"is:issue is:open\"\n skip-if-no-match: \"is:pr is:open\"",
} {
t.Run(gate, func(t *testing.T) {

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.

[/tdd] Subtest names are the raw gate YAML, including the query string, which is hard to read in go test -v output and does not state the expected behaviour. Give each case an explicit name such as skip-if-match grants issues and pull-requests read and keep the gate YAML as a separate field. The assertions stay the same.

@copilot please address this.

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.

Done: subtests now use explicit names (e.g. "skip-if-match grants issues and pull-requests read") with the gate YAML as a separate field; test passes. Pushed with the latest main merge.

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.

🔵 Needs a closer look

Changing token permissions across all skip-if workflows needs live validation of the private/internal-repository search fix and maintainer rollout judgment, since workflow_call callers lacking issues/pull-requests read permissions could fail at startup.

No open issues 🎉

What changed in this PR

Restores search-gate permissions in the gh-aw compiler to address #77519, preventing permission-related failures on private and internal repositories without restoring blanket write access.

Changes:

  • Grants issue and pull request read access for either pre-activation search gate.
  • Adds regression coverage for individual and combined gates and preservation of explicit write permissions.
  • Refreshes 31 generated workflow lock files with the required read scopes.
File Description
pkg/​workflow/​compiler_pre_activation_job.go Infers read permissions for search gates.
pkg/​workflow/​compiler_pre_activation_job_test.go Tests emitted scopes and explicit permission preservation.
.github/​workflows/​windows-grower.lock.yml Adds search-gate read scopes.
.github/​workflows/​weekly-otel-reference.lock.yml Adds search-gate read scopes.
.github/​workflows/​update-astro.lock.yml Adds search-gate read scopes.
.github/​workflows/​unbloat-docs.lock.yml Adds the missing issue read scope.
.github/​workflows/​ubuntu-image-analyzer.lock.yml Adds search-gate read scopes.
.github/​workflows/​spec-librarian.lock.yml Adds search-gate read scopes.
.github/​workflows/​slide-deck-maintainer.lock.yml Adds search-gate read scopes.
.github/​workflows/​refactoring-cadence.lock.yml Adds search-gate read scopes.
.github/​workflows/​purelock.lock.yml Adds search-gate read scopes.
.github/​workflows/​pr-sous-chef.lock.yml Adds the missing issue read scope.
.github/​workflows/​feature-grower.lock.yml Adds search-gate read scopes.
.github/​workflows/​deployment-incident-monitor.lock.yml Adds search-gate read scopes.
.github/​workflows/​dead-code-remover.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-yamllint-fixer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-windows-defender-scan.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-trajectory-grader-implementer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-testify-uber-super-expert.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-safe-output-optimizer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-rendering-scripts-verifier.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-harness-experiment-proposer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-go-test-stubs-aider.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-go-test-parallelizer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-file-diet.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-ecosystem-explorer.lock.yml Adds search-gate read scopes.
.github/​workflows/​daily-agent-of-the-day-blog-writer.lock.yml Adds search-gate read scopes.
.github/​workflows/​code-simplifier.lock.yml Adds search-gate read scopes.
.github/​workflows/​code-scanning-fixer.lock.yml Adds search-gate read scopes.
.github/​workflows/​breaking-change-checker.lock.yml Adds search-gate read scopes.
.github/​workflows/​architecture-guardian.lock.yml Adds search-gate read scopes.
.github/​workflows/​actions-aw-linter-factory.lock.yml Adds search-gate read scopes.
.github/​workflows/​ab-testing-advisor.lock.yml Adds search-gate read scopes.

Review effort: Max (dynamic)

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/workflow/compiler_pre_activation_job.go:116): address unresolved feedback - Review comment
  3. Review (pkg/workflow/compiler_pre_activation_job_test.go:127): address unresolved feedback - Review comment

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "a0744dabc855d36185de59ac3537f87467f9251f",
  "kind": "requested",
  "schema_version": "1",
  "state": "42e6de2c198094f05b974ad59c19ef896282784fdb69d23174ec97f625bbece3",
  "work": [
    "3d1083f061d62ea474475a5b4c24227520ff1244551b2fde3ad36e3e37b04ad1",
    "5e40d91f883f5343e18bcf51941ada029000278856e187636f999a512f88ea7e"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 14, 2026 03:37
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…ation-permissions

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Copilot AI requested a review from gh-aw-bot November 14, 2026 03:38
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot merge main and recompile

…ation-permissions

Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot merge main and recompile

Merged the latest main in 5142363. The build and focused permission tests pass, and a scoped compile regenerated all 31 affected locks with both read scopes. The full make recompile/drift check remains blocked by npm registry DNS errors (ENOTFOUND for @sentry/[email protected]).

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check build-wasm (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "5142363d99d55e1d666e036be0bca8c2e696f35b",
  "kind": "requested",
  "schema_version": "1",
  "state": "aa5473b74d8e6b54419a295e16d9d65f63d5c83448e347b07964da49306b32f3",
  "work": [
    "8acb61a077717e3a460018aacdfde96fd489f77606cd36169e2328d9079b75bb"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~1 AIC · ⌖ ~2 AIC · ⊞ 6.9K · ◷
Comment /souschef to run again

gh-aw-bot and others added 2 commits November 14, 2026 15:35
…ation-permissions

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>

Copilot AI commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:...

Merged the latest main in 6208cd6 and fixed the WASM golden comparison in 6e45379. make test-wasm and the focused permission tests pass; the WASM build itself was already succeeding, and the failure was a missing token-name normalization in the Node comparator.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check impacted-go-tests (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "6e45379b8f67b9abac221dcf829b8d19d2594d83",
  "kind": "requested",
  "schema_version": "1",
  "state": "daf4444306316e9b9b2fd5550f815bcad6b94f9583197a206c18d2caf18f1dd6",
  "work": [
    "42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⌖ ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

@pelikhan
pelikhan merged commit 69dc3a6 into main Nov 14, 2026
48 of 50 checks passed
@pelikhan
pelikhan deleted the copilot/fix-pre-activation-permissions branch November 14, 2026 16:30
Copilot stopped work on behalf of gh-aw-bot due to an error November 14, 2026 16:30
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v1.3.0

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.

v1.x regression: pre_activation job loses permissions, skip-if-match 422s on private/internal repos

4 participants