Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-08-07 #51180

Description

@github-actions

Executive Summary

  • 4 runs sampled across 3 distinct workflows: PR Code Quality Reviewer (2), Design Decision Gate, Matt Pocock Skills Reviewer.
  • Median first-request size 16,311 chars; P95 ~30,738 chars.
  • No API-proxy event-logs.jsonl/events.jsonl or Copilot session-state events.jsonl artifacts were present in this environment for the sampled runs, so prompt.txt was used as the best-available (compilation-debug) approximation of the first request. Treat char-based findings as directionally reliable, not token-exact.
  • Largest driver: Design Decision Gate (33,055 chars) — nearly double the other workflows — due to three large inline <details> report templates repeated per branch (ADR Required / ADR Verified / Implementation Diverges) plus verbose step-by-step instructions.
  • All three sampled workflows already have cli-proxy: true and tools.github.mode: gh-proxy enabled — good baseline hygiene, no proxy-enablement gap found in this sample.

Highest-Leverage Changes

  1. Move Design Decision Gate's three large inline report templates (ADR Required/Verified/Diverges, ~45/16/25 lines) into on-demand ## skill: blocks so only the one applicable template loads per run.
  2. Consolidate the repeated <details><summary>📋 What to do next</summary> block pattern (found duplicated across sampled requests) into a shared skill fragment.
  3. Trim "Mandatory Efficiency Rules" / "Turn Budget Allocation" preamble in Design Decision Gate — largely generic guardrail text duplicated in spirit across workflows; move to a shared imported skill instead of inlining in each workflow body.
  4. Reduce the size of the single inline agent: blocks (grumpy-coder in PR Code Quality Reviewer, pr-triage in Matt Pocock Skills Reviewer) to only what's needed for their narrow judging task, or confirm they're still earning their keep given they add to every run's first request.

CI-Validation Checklist for Implementing Agents

Any agent implementing workflow-file recommendations must complete every item below before opening a PR:

  • Run make recompile for every modified .github/workflows/*.md file — zero compilation errors required
  • Confirm no target workflow file is reduced by more than 40% of its current character count
  • Run make agent-report-progress before the final commit and confirm it passes
  • Check the blocked_files list in /tmp/gh-aw/ambient-context/closed-pr-targets.jsondo not re-attempt changes to any file that appears in a closed ambient-context optimization PR from the last 14 days
  • Include a smoke-test result or dry-run output in the PR description for every changed workflow spec
  • Document all generated .lock.yml changes in the PR body
  • Do not submit as a draft PR

Key Metrics

Metric Value
Sampled runs 4
Distinct workflows 3
Median chars 16,311
P95 chars 30,738
Largest sampled request 33,055 chars (Design Decision Gate, run 31210669962)
Merged optimizer PRs (7d) 3
Closed optimizer PRs (7d) 1
Optimizer PR close-rate (7d) 25%
Per-Run First-Request Metrics
Run Workflow Conclusion AIC Chars Lines Headings Inline agents
§31210616628 PR Code Quality Reviewer failure 205.08 15,012 206 ~14 1
§31210669962 Design Decision Gate failure 76.46 33,055 719 ~30 0
§31212341287 PR Code Quality Reviewer success 54.10 15,012 206 ~14 1
31212340574 Matt Pocock Skills Reviewer success 41.06 17,610 281 ~20 1
Repeated Ambient Context Signals
  • The <summary>📋 What to do next</summary> details-block header recurs across sampled requests, indicating a copy-pasted report-formatting pattern rather than a shared, centrally-maintained fragment.
  • Design Decision Gate's preamble ("Current Context and Operating Constraints", "Turn Budget Allocation", "Mandatory Stopping Criteria", "Mandatory Efficiency Rules") totals ~60 lines of generic guardrail text that duplicates concepts already present in other reviewer workflows (turn budgets, stopping criteria) — a strong candidate for shared-skill extraction.
  • Three near-identical inline report templates in Design Decision Gate (ADR Required / ADR Verified / Implementation Diverges) are all present in the compiled prompt even though only one branch executes per run — classic "load everything, use one" bloat.
Deterministic Analysis Output

From analyze_requests.py (stdlib-only, /tmp/gh-aw/ambient-context/request-analysis.json):

  • Aggregate: 4 runs, 3 distinct workflows, median 16,311 chars, p95 ~30,738 chars.
  • Design Decision Gate's (preamble) section alone accounts for 26,308 of its 33,055 total chars — most content sits before the first heading is reached in raw-char terms across the sample, driven by long step-by-step Markdown instructions rather than skill imports (imported_skill_ref_count was 0 for all sampled runs — no ## skill: usage detected, meaning content is fully inlined rather than lazily loaded).
  • Duplicate-line ratios were low per-run (no gross intra-request repetition), so the main opportunity is cross-workflow duplication of guardrail/report-template boilerplate, not within-request repetition.

Recommendations by Category

Workflow Markdown

  • Design Decision Gate (.github/workflows/design-decision-gate.md, 19,990 chars source): Extract the three ADR report templates (ADR Required/Verified/Diverges, ~86 combined lines) into a ## skill: block loaded conditionally per branch instead of inlining all three. Evidence: (preamble) + template sections total >28k of the 33k compiled request chars. Impact: high. Safe for immediate application with make recompile verification; keep template content, only relocate.
  • Design Decision Gate: Move "Mandatory Efficiency Rules"/"Turn Budget Allocation"/"Mandatory Stopping Criteria" (~60 lines) into a shared imported skill fragment usable by other reviewer workflows. Evidence: these are generic controls not tied to ADR logic. Impact: medium. Needs manual review to confirm equivalent enforcement after extraction.

Skills

  • Introduce a shared ## skill: fragment for the "What to do next" <details> report pattern observed duplicated across sampled first requests, so reviewer-style workflows reference one maintained copy instead of re-authoring it per workflow. Evidence: repeated fragment detected in aggregate analysis. Impact: medium, safe for immediate application (pure extraction, no logic change).
  • None of the sampled workflows show any ## skill: imports in the compiled prompt (imported_skill_ref_count: 0), confirming content is fully inlined. Recommend auditing whether existing skills under .github/skills/ could replace inlined guidance in Design Decision Gate and Matt Pocock Skills Reviewer rather than duplicating instructions inline. Impact: medium, needs manual review.

Agents

  • Review whether the single inline agent: grumpy-coder (PR Code Quality Reviewer) and agent: pr-triage (Matt Pocock Skills Reviewer) definitions are minimal — each is loaded unconditionally in every run's first request. If their scope can be trimmed to only the fields needed for their specific judging task, first-request size drops accordingly. Evidence: both workflows carry exactly one inline agent block loaded in full each run. Impact: low-medium, needs manual review to avoid weakening the review logic.

References

Generated by 🌫️ Daily Ambient Context Optimizer · auto · 53.5 AIC · ⊞ 12.5K ·

  • expires on Aug 14, 2026, 12:09 PM UTC-08:00

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions