Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-07-05 #43617

Description

@github-actions

Executive Summary

  • 4 runs sampled across 4 distinct workflows from the last 24h
  • Median first-request size: 17,643 chars | P95: 21,033 chars
  • Largest request: Copilot Agent PR Analysis at 27,299 chars (AIC 116.9) driven by two full inline variant output templates (~3,816 chars) and duplicated jq examples
  • Highest AIC run: Daily Code Metrics (245.4) adds 5,870 chars of shared viz/trend imports on every run
  • All workflows already have gh-proxy and cli-proxy enabled ✓
  • No blocked files; close-rate 0%; auto-pause not triggered

Highest-Leverage Changes

  1. [HIGH] copilot-agent-analysis.md: Collapse A/B experiment variant templates — Both structured (~3,067 chars) and prose (~749 chars) output templates are inlined in the prompt, but only one variant runs per execution. Move inactive variant or replace both with a single compact output spec. Estimated saving: ~2,000–2,500 chars.
  2. [HIGH] copilot-agent-analysis.md: Gate historical-rebuild instructions behind a conditional import — The cold-start rebuild instructions (§4.1, ~1,470 chars) are only needed when the cache is empty (rare). Use {{#runtime-import? shared/copilot-agent-analysis-history.md}} or an optional: import so they're absent on warm runs.
  3. [MEDIUM] daily-code-metrics.md: Audit shared/python-dataviz.md import for inline duplication — This shared import adds 3,870 chars of matplotlib guidance. The workflow body already mentions matplotlib-specific requirements (5 occurrences). Review overlap; strip duplicated chart-type specs from whichever side is redundant.
  4. [MEDIUM] copilot-agent-analysis.md: Remove jqschema/SKILL.md import — The jqschema skill (~992 chars) teaches schema discovery for unknown API shapes. Pre-fetched data is already at a known path with a *-schema.json file. This import adds no value; remove it.
  5. [MEDIUM] copilot-agent-analysis.md: Deduplicate jq examples between workflow body and shared base — The workflow body has 3 jq examples and shared/copilot-pr-analysis-base.md adds 4 more against the same file path. Remove the redundant in-body examples and rely on the shared base (~300 chars saved).

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.json (written by Step 4) — do 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 4
Median chars 17,643
P95 chars 21,033
Largest sampled request Copilot Agent PR Analysis (27,299 chars)
Merged optimizer PRs (7d) 4
Closed optimizer PRs (7d) 0
Optimizer PR close-rate (7d) 0%
Per-Run First-Request Metrics
Run Workflow AIC Chars Lines Dup% Headings Source
§28750739008 Copilot Agent PR Analysis 116.9 27,299 560 7.2% 45 prompt.txt
§28751029351 Daily Code Metrics 245.4 21,033 365 2.7% 30 prompt.txt
§28750490517 PR Code Quality Reviewer 88.7 14,253 221 3.1% 16 prompt.txt
§28750744185 PR Triage Agent 101.7 13,839 237 1.8% 21 prompt.txt

Note: API proxy event logs were not present in the MCP log artifacts; prompt.txt was used as the first-request source for all runs.

Repeated Ambient Context Signals
  • Runtime-injected boilerplate (not author-controlled): security policy (4 lines), safe-outputs instructions, and temporary-files/env-limitations blocks appear identically in all 4 runs — these are system-injected and cannot be reduced by workflow authors
  • shared/noop-reminder.md (411 chars) imported in 3/4 runs — expected and minimal
  • shared/reporting.md (497 chars) imported in all 4 runs — small, no action needed
  • copilot-agent-analysis.md: variant templates add ~3,816 chars for an experiment where only one branch executes; the "Important Brevity Guidelines" (360 chars) restates instructions already in the mission section
  • copilot-agent-analysis.md: jq commands appear in body (3×) and shared/copilot-pr-analysis-base.md (4×) for the same data file
Deterministic Analysis Output

Script: /tmp/gh-aw/ambient-context/analyze_requests.py (stdlib only)

  • copilot-agent-analysis: 45 headings, 14 code fences, 7.2% duplicate-line ratio (highest). Top section "Phase 6 discussion template" = 3,927 chars containing embedded markdown tables inside fenced code blocks.
  • daily-code-metrics: 30 headings, 6 code fences. Shared imports contribute 5,870 chars (python-dataviz.md 3,870 + trends.md 2,000); "Required Charts" section = 1,217 chars.
  • pr-code-quality-reviewer: 16 headings, grumpy-coder sub-agent = 1,111 chars (present and justified — haiku model). "Step 4: Write Review Comments" = 1,378 chars including a full example.
  • pr-triage-agent: cleanest at 13,839 chars, 1.8% dup ratio.
  • Cross-run: 10 fragments appear in all 4 runs — all are runtime-injected system context, not reducible by workflow authors.

Recommendations by Category

Workflow Markdown

  1. copilot-agent-analysis.md — Collapse A/B variant templates (HIGH): Replace the two full inline output templates (structured + prose, ~3,816 chars total) with a single compact output spec. Since only one variant is active per run, the inactive template is pure waste. Consider a shared shared/copilot-agent-output-spec.md that conditionally renders the active variant only — or simply trim each template to the essential column/field list rather than full markdown examples. Safe to implement; does not change report quality for the active variant.

  2. copilot-agent-analysis.md — Gate historical rebuild section (HIGH): Move §4.1 cold-start rebuild instructions (~1,470 chars) to an optional import {{#runtime-import? shared/copilot-agent-history-rebuild.md}}. The rebuild path is rare; most runs have data already in repo-memory. Needs manual review to confirm optional-import semantics don't affect the base-case flow.

  3. copilot-agent-analysis.md — Remove body-level jq examples (MEDIUM): The 3 jq examples in the workflow body (copilot-prs.json queries) are already covered by shared/copilot-pr-analysis-base.md (4 examples, same file). Remove the in-body duplicates. Safe immediately.

Skills

  1. copilot-agent-analysis.md — Drop jqschema/SKILL.md import (MEDIUM): Pre-fetched PR data is at a fixed path with a companion schema file; jqschema is designed for unknown API shapes. Import adds ~992 chars with no marginal value here. Safe to remove.

  2. daily-code-metrics.md — Audit shared/python-dataviz.md (MEDIUM): At 3,870 chars this import is the largest shared fragment in any sampled daily workflow. Review overlap with inline matplotlib guidance in the workflow body; strip whichever side is more generic. Needs manual review to confirm no chart-type detail is lost.

Agents

No new sub-agent additions recommended. The existing grumpy-coder inline agent in pr-code-quality-reviewer.md (1,111 chars, claude-haiku-4.5) is appropriately scoped and justified.

References

  • §28750739008 — Copilot Agent PR Analysis (largest request, 27,299 chars)
  • §28751029351 — Daily Code Metrics (highest AIC, 245.4)
  • §28750744185 — PR Triage Agent (cleanest baseline, 13,839 chars)

Generated by 🌫️ Daily Ambient Context Optimizer · 162.6 AIC · ⌖ 17 AIC · ⊞ 7.6K ·

  • expires on Jul 12, 2026, 12:19 PM UTC-08:00

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions