Skip to content

Reduce ambient prompt surface in high-traffic workflows#40695

Merged
pelikhan merged 4 commits into
mainfrom
copilot/daily-ambient-context-optimizer
Jun 22, 2026
Merged

Reduce ambient prompt surface in high-traffic workflows#40695
pelikhan merged 4 commits into
mainfrom
copilot/daily-ambient-context-optimizer

Conversation

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Daily ambient-context sampling found avoidable prompt bloat in Design Decision Gate and Code Scanning Fixer, plus a missing gh-proxy optimization in Matt Pocock Skills Reviewer. This change removes duplicated/unreachable prompt content so the compiled workflows carry less ambient context without changing their intended behavior.

  • Design Decision Gate

    • Replaced the inline ADR draft skeleton in Step 4a with a reference to the imported adr-writer template.
    • Removed duplicate ADR guidance sections (ADR Quality Standards, Examples of ADR-Worthy Decisions) already covered by the imported agent.
  • ADR writer agent

    • Removed the RFC 2119 / normative-spec section and its related validation rules from .github/agents/adr-writer.agent.md.
    • Kept the narrative Michael Nygard ADR structure used by design-decision-gate.
  • Code Scanning Fixer

    • Removed the unused repo-memory declaration from workflow frontmatter.
    • Removed redundant tail sections restating security guidance, cache format, error handling, and operational notes already covered earlier in the prompt.
  • Matt Pocock Skills Reviewer

    • Added tools.github.mode: gh-proxy to align the workflow with the repo’s token-optimization guidance.
  • Compiled workflow updates

    • Recompiled the affected lockfiles so the generated workflows reflect the prompt-surface reductions.
tools:
  cli-proxy: true
  github:
    mode: gh-proxy

workflow-run: https://github.com/github/gh-aw/actions/runs/27921358081

Generated by 👨‍🍳 PR Sous Chef · 28 AIC · ⌖ 1.05 AIC · ⊞ 17.3K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update daily ambient context optimizer findings Reduce ambient prompt surface in high-traffic workflows Jun 21, 2026
Copilot AI requested a review from pelikhan June 21, 2026 23:07
@pelikhan pelikhan marked this pull request as ready for review June 21, 2026 23:23
Copilot AI review requested due to automatic review settings June 21, 2026 23:23
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

No test files were added or modified in this PR. Test Quality Sentinel skipped. PR #40695 ('Reduce ambient prompt surface in high-traffic workflows') contains only workflow markdown files and compiled lock YAMLs (.github/workflows/.md, .github/workflows/.lock.yml, .github/agents/*.md) — no Go or JavaScript test files were changed.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #40695 does not have the 'implementation' label (has_implementation_label=false) and has 0 new lines of code in business logic directories (requires_adr_by_default_volume=false, ≤100 threshold). The 7 changed files are shell/python skill scripts, not business logic directories.

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.

Pull request overview

This PR reduces prompt/ambient context size in several high-traffic gh-aw agent workflows by removing duplicated guidance and switching one workflow to tools.github.mode: gh-proxy, then recompiling the generated .lock.yml workflows to reflect those changes.

Changes:

  • Simplifies Design Decision Gate prompt content by delegating ADR drafting structure and duplicated guidance to the imported adr-writer agent.
  • Streamlines Code Scanning Fixer by removing unused repo-memory wiring and redundant prompt tail sections, reducing compiled workflow surface area and jobs.
  • Updates Matt Pocock Skills Reviewer to use tools.github.mode: gh-proxy (and recompiles), aligning GitHub reads with the repo’s token-optimization guidance.
Show a summary per file
File Description
.github/workflows/mattpocock-skills-reviewer.md Adds tools.github.mode: gh-proxy to enable proxied GitHub reads via pre-authenticated gh.
.github/workflows/mattpocock-skills-reviewer.lock.yml Recompiled output reflecting gh-proxy/CLI proxy wiring and updated generated prompt assembly.
.github/workflows/design-decision-gate.md Removes inline ADR skeleton + duplicated ADR guidance, replacing with a reference to the imported adr-writer template.
.github/workflows/design-decision-gate.lock.yml Recompiled output to reflect prompt-surface reductions.
.github/workflows/code-scanning-fixer.md Removes unused repo-memory declaration and redundant prompt tail sections.
.github/workflows/code-scanning-fixer.lock.yml Recompiled output removing repo-memory prompt injection and generated repo-memory push job/config.
.github/agents/adr-writer.agent.md Removes RFC 2119/normative-spec section and related validation guidance, keeping the narrative ADR structure used by the gate.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 7/7 changed files
  • Comments generated: 0

@github-actions github-actions Bot mentioned this pull request Jun 21, 2026

@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 /zoom-out and /improve-codebase-architecture — approving with two advisory notes.

📋 Key Themes & Highlights

Key Themes

  • code-scanning-fixer repo-memory removal: Correctly identified as dead infrastructure, not just prompt bloat. The push_repo_memory job removal is safe because the agent never reads/writes security-alert-burndown/**. Optional cleanup of the memory/campaigns branch if it was ever populated.
  • adr-writer RFC 2119 removal: A global behavioral change framed narrowly in the PR description. All future ADRs from any caller will be narrative-only. Intentional, but worth calling out as a permanent direction change.

Positive Highlights

  • design-decision-gateadr-writer delegation is clean and well-verified: the import at line 46 provides all the content the removed sections covered, including Examples of ADR-Worthy Decisions (line 190 of adr-writer.agent.md) and quality standards.
  • gh-proxy addition in mattpocock-skills-reviewer was the right call — closes the only token-optimization gap in that workflow.
  • ✅ All removed tail sections in code-scanning-fixer (Security Guidelines, Cache Memory Format, Error Handling, Important Notes) are genuinely covered inline in the 8-step agent instructions.
  • ✅ Lockfiles are correctly recompiled and reflect all source changes.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · 156.3 AIC · ⌖ 11.8 AIC · ⊞ 6.4K

- id: campaigns
branch-name: memory/campaigns
file-glob: [security-alert-burndown/**]
edit:

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.

[/zoom-out] The repo-memory: campaigns removal eliminates an entire compiled push_repo_memory infrastructure job (~90 lockfile lines). The agent's steps use only cache-memory (fixed-alerts.jsonl) and never reference security-alert-burndown/**, so the removal is safe as stated.

💡 Optional follow-up

If the memory/campaigns git branch was ever populated by an earlier version of this workflow, that data is now orphaned (nothing reads or writes it). Consider a one-off:

gh api repos/{owner}/{repo}/git/refs/heads/memory/campaigns -X DELETE

or document that the branch is safe to ignore.

The PR framing of this as "prompt bloat reduction" slightly undersells it — this is more accurately "dead infrastructure removal." Correct either way.


---

*ADR created by [adr-writer agent]. Review and finalize before changing status from Draft to Accepted.*

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.

[/improve-codebase-architecture] This removal is cross-cutting: RFC 2119 Part 2 is gone for all callers of adr-writer, not only design-decision-gate. Future ADRs from any workflow using this agent will permanently be narrative-only.

💡 Suggestion

The PR description says "Kept the narrative Michael Nygard ADR structure used by design-decision-gate" — framing this as a local change. But the impact is global: if a future caller needs machine-checkable normative requirements, they would need to either restore Part 2 or maintain their own template.

Consider explicitly documenting the direction change — either in the PR description or in a CONTEXT note here — so future maintainers understand this was a deliberate simplification, not an accidental omission.


*This is a DRAFT ADR generated by the [Design Decision Gate]({run_url}) workflow. The PR author must review, complete, and finalize this document before the PR can merge.*
```
Generate a draft ADR file using the imported `adr-writer` template. Fill the Michael Nygard sections (`Context`, `Decision`, `Alternatives Considered`, `Consequences`) with evidence grounded in the PR.

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.

[/zoom-out] ✅ Clean delegation. The adr-writer import at line 46 brings the full Michael Nygard template, Writing Quality Standards, and Examples of ADR-Worthy Decisions — covering everything the removed inline skeleton and ADR Quality Standards section provided. Collision-avoidance numbering (PR number as NNNN) is preserved at lines 280–282, so no regression there.

echo "Pre-fetched PR diff (${LINES} lines) and metadata"
tools:
cli-proxy: true
github:

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.

[/zoom-out] ✅ Good catch. gh-proxy mode was the only missing token-optimization for this workflow. The lockfile confirms the cli-proxy container is now properly wired into the manifest, consistent with the repo's gh-proxy guidance.

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot merge main and recompile

Copilot AI and others added 2 commits June 21, 2026 23:50
…-context-optimizer

# Conflicts:
#	.github/workflows/code-scanning-fixer.lock.yml

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

Copilot AI commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and recompile

Done. Merged main, resolved the conflict in the auto-generated code-scanning-fixer.lock.yml, and recompiled all workflows. Commit: Merge main and recompile code-scanning-fixer lockfile.

@github-actions

Copy link
Copy Markdown
Contributor

@copilot review all comments and address unresolved review feedback.

Generated by 👨‍🍳 PR Sous Chef · 28 AIC · ⌖ 1.05 AIC · ⊞ 17.3K ·

@github-actions

Copy link
Copy Markdown
Contributor

@copilot please refresh the branch, rerun checks, and summarize any remaining blockers.

Generated by 👨‍🍳 PR Sous Chef · 28 AIC · ⌖ 1.05 AIC · ⊞ 17.3K ·

Copilot AI requested a review from pelikhan June 21, 2026 23:53
@pelikhan pelikhan merged commit a401853 into main Jun 22, 2026
25 checks passed
@pelikhan pelikhan deleted the copilot/daily-ambient-context-optimizer branch June 22, 2026 00:13
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.

3 participants