Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-07-19 #46667

Description

@github-actions

Executive Summary

  • 4 runs sampled across 4 distinct workflows (Daily Cache Strategy Analyzer, PR Sous Chef, Agent Persona Explorer, Changeset Generator)
  • Median first-request size: 22,047 chars | P95: 24,031 chars
  • All 4 runs lacked API proxy event logs; prompt.txt used as request source
  • Highest-leverage finding: daily-cache-strategy-analyzer.md has 37 headings and 16.2% duplicate lines — high structural fragmentation inflating every run. It also lacks gh-proxy and cli-proxy. pr-sous-chef.md is the largest workflow source (28,658 chars) with a 5,715-char inline nudge catalog that embeds full shell examples and is loaded on every run.

Highest-Leverage Changes

  1. [workflow-md] Consolidate fragmented phases in daily-cache-strategy-analyzer.md — 37 headings / 16.2% dup-line ratio. Merge parallel sub-sections (2.1/2.2/2.3 into one detection block) and deduplicate repeated table templates. Est. ~2,500 char saving per run. (high)
  2. [workflow-md] Enable gh-proxy + cli-proxy in daily-cache-strategy-analyzer.md — both are absent, meaning every gh CLI call goes through the slower unauthenticated path. Add tools: { github: { mode: gh-proxy }, cli-proxy: true }. (high, safe immediately)
  3. [workflow-md] Trim the ## Required nudges section in pr-sous-chef.md — at 5,715 chars, this is the largest single section across all samples. Shell examples with multi-checkout notes (~800 chars) and step-by-step push instructions are repeated verbatim from the system preamble. Summarize to bullet references; keep the make fmt + add_comment essentials only. Est. ~2,000 char saving. (high)
  4. [workflow-md] Reduce ## Token efficiency rules in pr-sous-chef.md — 2,262 chars of 10-point instructions, several of which restate safeoutputs guidance already in the system preamble (rules 10–11 duplicate the safe-output terminal guarantee). Remove redundant rules; keep only workflow-specific ones (rules 1–9). Est. ~600 char saving. (medium)
  5. [workflow-md] Collapse parallel detection sub-sections in agent-persona-explorer.md — 25 headings with 9.2% dup-line ratio. Phase 2/3 sub-sections follow the same template. Merge into a single structured block. Est. ~1,000 char saving. (medium)
  6. [workflow-md] Add gh-proxy to changeset.mdcli-proxy: true is set but tools.github.mode: gh-proxy is absent, leaving GitHub API calls unoptimized. (low, safe immediately)

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 22,047
P95 chars 24,031
Largest sampled request 24,031 (PR Sous Chef, run 29693331475)
Merged optimizer PRs (7d) 0
Closed optimizer PRs (7d) 0
Optimizer PR close-rate (7d) N/A (<3 settled PRs)
Per-Run First-Request Metrics
Run Workflow Chars Lines Headings Dup-line% Input tokens
29699070953 Daily Cache Strategy Analyzer 22,047 491 37 16.2% 760,393
29693331475 PR Sous Chef 24,031 282 11 4.5% 94,700
29693386293 Agent Persona Explorer 20,226 361 25 9.2% 68,770
29701390965 Changeset Generator 18,781 320 18 9.3% 43,495

Note: request_source = prompt.txt for all runs — no API proxy event logs were present in the downloaded artifacts.

Repeated Ambient Context Signals

Cross-run repeated fragments (all 4 runs):

  • Immutable security policy block (~4 lines, ~400 chars) — system-injected, not reducible
  • Temporary files instruction — system-injected

Per-run internal duplication:

  • daily-cache-strategy-analyzer.md: table row templates (| Workflow | Miss Streak | ... |) appear twice; for run_dir in /tmp/gh-aw/aw-mcp/logs/run-*/ shell pattern repeated twice; parallel sub-sections 2.1/2.2/2.3 share identical structural templates (~300 chars each)
  • agent-persona-explorer.md: Phase 2 and Phase 3 sub-sections follow the same 5-item action pattern duplicated verbatim
  • pr-sous-chef.md: Safe-output push instructions (~800 chars) repeat content from the system <safe-output-tools> preamble already injected at runtime

Safe-outputs block size: ~3,466 chars injected per run (14–19% of total prompt). This is system-managed and not reducible from workflow markdown.

Deterministic Analysis Output

Script: /tmp/gh-aw/ambient-context/analyze_requests.py

Key findings:

  • Average heading count: 22.75 (high; ideal ≤ 12 for focused workflows)
  • Average dup-line ratio: 9.9% across the sample
  • No inline agents (## agent:) or imported skill refs (SKILL.md) found in any sampled prompt — skill loading is either absent or already compiled out
  • daily-cache-strategy-analyzer.md has the highest fragmentation (37 headings) with the highest dup ratio (16.2%) despite having 760K input tokens — the token cost is dominated by tool-output accumulation across turns, not just the initial prompt
  • pr-sous-chef.md has the largest workflow source file (28,658 chars) but relatively clean dup ratio (4.5%)
  • Code fences: 4–13 per prompt; daily-cache-strategy-analyzer.md leads with 13 (each fence adds parse overhead)

Recommendations by Category

Workflow Markdown

  1. daily-cache-strategy-analyzer.md — consolidate detection phases (high impact, needs review): Merge sections 2.1, 2.2, 2.3 into a single ## Phase 2: Detect Cache Issues block. Remove duplicate table templates. Target: ≤20 headings. Est. saving ~2,500 chars.
  2. daily-cache-strategy-analyzer.md — add gh-proxy and cli-proxy (high impact, safe immediately): The workflow uses agenticworkflows logs but lacks proxy settings. Add under tools:: github: { mode: gh-proxy } and cli-proxy: true.
  3. pr-sous-chef.md — trim ## Required nudges section (high impact, needs review): Condense the 5,715-char section by removing inline shell examples that duplicate system preamble guidance. Keep step headings and essential constraints only.
  4. pr-sous-chef.md — remove redundant safe-output rules from ## Token efficiency rules (medium impact, safe immediately): Rules 10–11 restate the system-level terminal guarantee already injected at runtime. Remove them and renumber the section.
  5. agent-persona-explorer.md — deduplicate phase templates (medium impact, needs review): Phase 2 and Phase 3 use the same 5-step action template. Consolidate into a shared pattern reference.
  6. changeset.md — add tools.github.mode: gh-proxy (low impact, safe immediately): cli-proxy: true is set; add github: { mode: gh-proxy } to complete proxy coverage.

Skills

No skill imports were detected in any sampled prompt. Skill loading appears to be either absent or already well-scoped. No recommendations at this time.

Agents

No inline agents (## agent:) were found in any sampled prompt. No inline agent recommendations.

References

Generated by 🌫️ Daily Ambient Context Optimizer · 125.2 AIC · ⌖ 14.9 AIC · ⊞ 7.8K ·

  • expires on Jul 26, 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