Skip to content

Deduplicate derived guard-policy accept entries - #80757

Open
gh-aw-bot wants to merge 9 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-11-24
Open

gh-aw-bot wants to merge 9 commits into
mainfrom
copilot/spdd-daily-spec-work-plan-2026-11-24

Conversation

@gh-aw-bot

@gh-aw-bot gh-aw-bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

GP-07 requires derived safe-output accept entries to be deduplicated, but duplicate repository patterns were emitted more than once. The related specifications also lacked alignment with the current implementation.

  • Guard-policy derivation: Deduplicate transformed accept entries while preserving first-seen order. Repository-scope normalization remains unchanged.
  • Specifications: Correct GP-07 traceability, document runtime sink visibility, and distinguish compiler-side support from external gateway enforcement.
  • Safeguards: Document the advisory fork precondition and the workflow-security fixture count assertions.

For example, ["github/*", "github/*"] now derives accept: ["private:github"].

Copilot AI linked an issue Nov 24, 2026 that may be closed by this pull request
1 of 7 tasks
gh-aw-bot and others added 3 commits November 24, 2026 16:13
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@gh-aw-bot gh-aw-bot changed the title [WIP] Dedupe guard-policy accept entries for GP-07 Deduplicate derived guard-policy accept entries Nov 24, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 24, 2026 19:03
Copilot AI adaptive review requested due to automatic review settings November 24, 2026 19:03
@github-actions

github-actions Bot commented Nov 24, 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 · ~6 AIC · ⌖ ~2 AIC · ⊞ 5.1K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Generated by Ponytail Reviewer for #80757 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 176 · history

@github-actions

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

The [aw] No-Op Runs tracker omits agent messages. The category uses structured run status, not interpretation of agent prose.

No-op message

Completed PR #80757 review: no findings; review submitted and review-history recorded.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt56 · ~2 AIC · ⌖ ~2 AIC · ⊞ 1.7K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Specification Reviewer completed successfully!

PR Specification 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.

The [aw] No-Op Runs tracker omits agent messages. The category uses structured run status, not interpretation of agent prose.

No-op message

Specification review completed for PR #80757 at head abf810f; applicable changed contracts and evidence are aligned, with no actionable findings or specification updates required.

Generated by PR Specification Reviewer for #80757 · copilot · gpt56 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.8K · history

@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 7.4K · 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.

Reviewed the changed lines and found no merge-blocking correctness, security, performance, or maintainability issues. The deduplication helper operates on a freshly constructed local accept list, and the added tests cover both []any and []string inputs while preserving first-seen order.

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

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (review-history)
{"id":"ldg-6507b19c-9fa2-464e-9b59-f5db1f338ca6","parents":[],"payload":{"id":"ldg-070acc65-ecbe-4e78-bdad-646da3216064","operation":"append","value":{"finding_count":0,"head_sha":"abf810feeed074da8eb159d24db3acc7bb8bf527","outcome":"no_findings"}},"sha":"sha256:3c5f048e8fd262e8fd00254aacc7182316f5a93bcc5e6fde4c505926259d599e","timestamp":"2026-11-24T19:11:37.742Z","type":"ledger_append","version":1}
History

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.

🟢 Approval recommended

No active review issues are reported for the safe-output deduplication change.

No open issues 🎉

What changed in this PR

This PR fixes GP-07 compliance in gh-aw by deduplicating derived safe-output accept entries while preserving first-seen order. Repository-scope normalization remains unchanged.

Changes:

  • Deduplicate transformed accept entries and add regression tests for both supported array representations.
  • Align guard-policy specifications with runtime sink visibility and compiler-versus-gateway responsibilities.
  • Document advisory fork prerequisites and workflow-security fixture count assertions.
File Description
specs/​workflow-security/​README.md Documents fixture count assertions against compiled output.
specs/​advisory-handoff/​README.md Clarifies the advisory fork prerequisite and recovery hint.
scratchpad/​guard-policies-specification.md Updates deduplication requirements, sink visibility examples, and GP-07 traceability.
scratchpad/​github-mcp-access-control-specification.md Clarifies implementation status and conformance boundaries.
pkg/​workflow/​safeoutputs_guard_policy_test.go Adds duplicate-pattern regression cases for []any and []string.
pkg/​workflow/​mcp_github_config.go Deduplicates derived accept entries while retaining their original order.

Review effort: Balanced (adaptive)

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

What this change does: It removes duplicate derived accept entries in first-seen order and updates the related specifications.

Should fix

  1. Reuse the existing sliceutil.Deduplicate helper. It already handles repeated entries in the same order, so the new helper duplicates code that must otherwise be maintained separately.

Verdict: fix 1 first.
Lean: -11 lines possible.

Generated by ✂️ Ponytail Reviewer for #80757 · codex · routed: gpt61 medium · ~5 AIC · ⌖ ~1 AIC · ⊞ 176
Comment /ponytail to run again

Comment thread pkg/workflow/mcp_github_config.go Outdated
}
}

func deduplicateAcceptEntries(entries []string) []string {

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.

Reuse sliceutil.Deduplicate(acceptList) from pkg/sliceutil/sliceutil.go; it already removes repeated entries in first-seen order, so this duplicate helper can be deleted.

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.

Replaced the local helper with sliceutil.Deduplicate, which preserves first-seen order and does not mutate the input. Addressed in 174bb47.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Peek at saved memory (spec-review-history)
{"id":"ldg-eaa66984-dbcc-49b7-af43-e0e8f7e4cda3","parents":[],"payload":{"id":"ldg-2c90c7f5-1e55-4e36-a564-c346ffaa3d88","operation":"append","value":{"finding_count":0,"head_sha":"abf810feeed074da8eb159d24db3acc7bb8bf527","outcome":"aligned"}},"sha":"sha256:9143002afefef765cf483eca8a46d37e336b8c76d12aa57e910eaa694b31990d","timestamp":"2026-11-24T19:12:57.641Z","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.

Summary

The top-level guard-policy dedup is correct, and the two new cases cover both []any and []string input with first-seen order. The targeted TestDeriveSafeOutputsGuardPolicyFromGitHub run passes.

One gap blocks approval: GP-07 requires no duplicate accept entries in any derived write-sink policy, but the enclave paths still skip dedup. Details are in the inline comment on writeSinkAcceptLabelsForRepos.

Other notes
  • deduplicateAcceptEntries reuses the input backing array. Safe today, but a fresh slice avoids surprising callers.
  • The workflow-security paragraph splits a lead-in from its code block. Moving it above the lead-in fixes the flow.
  • Spec wording checks out: the counts in fixtures/cross-repo.md are asserted by check.py, and the advisory fork precondition matches errAdvisoryForkMissing.

@copilot please address the inline comments.

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

Comment thread pkg/workflow/mcp_github_config.go Outdated

writeSink := map[string]any{
"accept": acceptList,
"accept": deduplicateAcceptEntries(acceptList),

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.

[/diagnosing-bugs] The dedup only covers deriveSafeOutputsGuardPolicyFromGitHub. The enclave write-sink paths still emit duplicates: writeSinkAcceptLabelsForRepos (line 210, used at lines 188 and 207) builds accept from raw repo lists without deduplicating, and GP-07 says derived write-sink policies MUST NOT contain duplicate accept entries. Fix: call deduplicateAcceptEntries inside writeSinkAcceptLabelsForRepos so every writer gets it, then add a regression case with a duplicated enclave repo list. @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.

Deduplication now runs in writeSinkAcceptLabelsForRepos, covering enclave write-sink policies; added a duplicate static-enclave regression case. Addressed in 174bb47.

Comment thread pkg/workflow/mcp_github_config.go Outdated

func deduplicateAcceptEntries(entries []string) []string {
seen := make(map[string]struct{}, len(entries))
deduplicated := entries[: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] entries[:0] reuses the caller's backing array, so this helper overwrites the input slice while it runs. Current callers pass freshly built slices, so there is no bug today, but any caller that reuses its input will see it mutated. Fix: deduplicated := make([]string, 0, len(entries)). @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.

Removed the in-place helper and use sliceutil.Deduplicate, which returns a new slice without mutating caller data. Addressed in 174bb47.

The compile-only seed uses fictitious credentials and a fake dependency.
Never dispatch it. Compile a copy into a new temporary directory:

The expected checkout-token and GitHub App safe-output counts in the header of

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.

[/grill-with-docs] This new paragraph is inserted between the Compile a copy into a new temporary directory: lead-in (line 834) and its bash block, so the lead-in now introduces prose instead of the commands. Move the paragraph above the lead-in sentence. @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.

Moved the fixture-count paragraph above the sentence introducing the compile commands. Addressed in 174bb47.

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

✅ Test Quality Score: 90/100 — Excellent

Analyzed 2 test(s): 2 design, 0 implementation, 0 violation(s).

📊 Metrics (2 tests)
Metric Value
Analyzed 2 (Go: 2, JS: 0)
✅ Design 2 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 2 (100%)
Duplicate clusters 0
Inflation YES (28 test vs 13 production lines added, 2.15:1; see notes)
🚨 Violations 0
Test File Classification Issues
duplicate allowed repos as []any pkg/workflow/safeoutputs_guard_policy_test.go:114 behavioral_contract / high_value / design_test None
duplicate allowed repos as []string pkg/workflow/safeoutputs_guard_policy_test.go:128 behavioral_contract / high_value / design_test None
i️ Notes
  • Scope: one Go test file changed. The two new rows are table entries in the existing TestDeriveSafeOutputsGuardPolicyFromGitHub, covering duplicate allowed-repos values in both []any and []string forms. No new test functions were added.
  • Inflation: the 2.15:1 ratio is flagged per the formula, which zeroes the inflation term. The rows are exact-output table cases rather than padding, and the ratio alone does not fail the PR.
  • Behavioral value: each row asserts the full write-sink policy with assert.Equal. Without the deduplication in deduplicateAcceptEntries, both rows would return repeated accept entries and fail.
  • Verification limit: go test was denied in this run, so findings come from static review of the diff and production code, not an executed test run.
  • Not scored: scratchpad and specs Markdown changes, and the production change in mcp_github_config.go.

Verdict

✅ passed. 0% implementation tests (threshold: 30%).

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 7.4K · history
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.

✅ Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). No violations.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~4 AIC · ⌖ ~2 AIC · ⊞ 7.4K
Comment /review to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator Author

@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/mcp_github_config.go:674): address unresolved feedback - Review comment
  3. Review (pkg/workflow/mcp_github_config.go:664): address unresolved feedback - Review comment
  4. Review (pkg/workflow/mcp_github_config.go:676): address unresolved feedback - Review comment
  5. Review (specs/workflow-security/README.md:836): 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": "abf810feeed074da8eb159d24db3acc7bb8bf527",
  "kind": "requested",
  "schema_version": "1",
  "state": "5b94b4a92152f90fbc89a994b1e75459cb144bf6d91fa279d4ecca2d34a655b9",
  "work": [
    "31bcc5835f4f8229e388c1cda8517bdb2a9f6e268a27665b88fa6db1f7b266e5",
    "3ad226ba844e7e3f9678fe3df939c6359d33686a56249956a9a2b0681e39d9f8",
    "625b5511f6c3267fd08e7314fd8a1b9a514da6b1bd50356c0a5f631922ad81a0",
    "637cc7e565a2c527e9a04110d59768a52c5d6a58f1b23f01d29a4c2ee4a60f22"
  ],
  "workflow": "pr-sous-chef"
}

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

gh-aw-bot and others added 5 commits November 24, 2026 19:45
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
…ec-work-plan-2026-11-24

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

[spdd] Daily spec work plan - 2026-11-24

3 participants