Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-07-03 #43262

Description

@github-actions

Executive Summary

  • 4 runs sampled across 4 distinct workflows
  • Median first-request size: 15,534 chars; P95: 22,535 chars
  • System-injected infrastructure (safe-outputs, tool docs, github-context) accounts for 43–56% of every prompt, while the workflow-specific narrative drives the remainder
  • Highest-leverage opportunity: the daily-code-metrics report template embeds both conditional variant bodies simultaneously, inflating the prompt with dead content for the inactive variant

Highest-Leverage Changes

  1. Collapse the dual-variant report template in daily-code-metrics.md — both full_detail and executive_summary templates are inlined simultaneously; only the active variant should be rendered, saving ~1,250 chars (~5.5%)
  2. Compress the Required Charts section in daily-code-metrics.md from a verbose 6-row Markdown table to a compact numbered list, saving ~820 chars (~3.6%)
  3. Move Go file templates from linter-miner.md Step 5 into the linter-writer sub-agent body — the 3-file Go scaffold is loaded in every turn including planning turns that never use it, wasting ~1,500 chars (~9%) on the linter-miner prompt
  4. Trim linter-miner.md Guidelines section from 11 generic Go conventions to 3-4 gh-aw-specific linter rules; remove items already covered by the serena-go.md import, saving ~750 chars (~5%)
  5. Reduce verbose experiment chart descriptions in daily-code-metrics.md Required Charts — table cells contain multi-sentence chart specs; extract stable chart specs to a shared import

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 15,534
P95 chars 22,535
Largest sampled request 22,535 chars (Daily Code Metrics)
Merged optimizer PRs (7d) 5
Closed optimizer PRs (7d) 0
Optimizer PR close-rate (7d) 0%
Per-Run First-Request Metrics
Run Workflow Chars Lines Headings AIC Ambient Ctx Tokens Source
§28678275970 Daily Code Metrics 22,535 414 33 301 9,605 prompt.txt
§28676120195 Linter Miner 16,311 264 17 134 6,148 prompt.txt
§28674547373 Contribution Check 14,757 208 15 132 6,293 prompt.txt
§28679073551 Failure Investigator 12,335 178 15 100 5,186 prompt.txt
Repeated Ambient Context Signals
  • System block dominance: The <system> block is 42–56% of each prompt (6,851–9,512 chars), carrying identical security policy, safe-output boilerplate, and tool docs across all runs
  • Safe-outputs combined overhead: The <safe-outputs> + <safe-output-tools> blocks together consume 30–51% of each total prompt (6,836–8,359 chars), with the linter-miner PR tool spec alone at 4,878 chars
  • Duplicate image placeholders: daily-code-metrics loads both report variant templates simultaneously; ![Quality Score](URL_FROM_UPLOAD_ASSET) and ![Historical Trends](URL_FROM_UPLOAD_ASSET) each appear twice
  • Chart spec verbosity: The Required Charts table uses multi-sentence descriptions inside table cells — the least token-efficient prose container in Markdown
Deterministic Analysis Output

From analyze_requests.py on 4 sampled runs:

  • All 4 workflows have gh-proxy and cli-proxy enabled — no proxy gap
  • Duplicate line ratio: 0.009 (daily-code-metrics), 0.0 (others)
  • Duplicate paragraph ratio: 0.0 across all runs
  • Keyword density: ~21–28 safe-output-mentions per prompt — consistent with framework injection
  • Largest repeated non-trivial lines: ![Quality Score](URL_FROM_UPLOAD_ASSET) x2, ![Historical Trends](URL_FROM_UPLOAD_ASSET) x2

Recommendations by Category

Workflow Markdown

  1. [HIGH] Collapse dual-variant template in daily-code-metrics.md (lines 175–255)

    • Evidence: 84-line template with both variant bodies inlined; 2 image placeholders each appear twice due to {{#if}} block duplication; ~1,250 chars waste
    • Why it shrinks: Only one variant is active at runtime; the inactive block is dead weight
    • Impact: High | Safe immediately
  2. [MEDIUM] Replace Required Charts verbose table with compact list in daily-code-metrics.md (lines 135–150)

    • Evidence: 6-row Markdown table = 1,237 chars; equivalent numbered list ≈ 400 chars
    • Why it shrinks: Table delimiters inflate content ~3× over an equivalent list; saves ~820 chars
    • Impact: Medium | Needs review to preserve chart spec accuracy
  3. [MEDIUM] Move Go file templates from linter-miner.md Step 5 into linter-writer sub-agent body

    • Evidence: 3-file Go scaffold is 1,682 chars in orchestrator prompt; loaded on every turn including discussion-miner/code-pattern-scanner turns that never reference them
    • Why it shrinks: Confines template tokens to the single linter-writer dispatch turn; saves ~1,500 chars (~9%)
    • Impact: Medium | Needs review to confirm sub-agent has full template access

Skills

  1. [LOW] Trim linter-miner.md Guidelines from 11 generic Go rules to 3-4 gh-aw-specific rules
    • Evidence: 1,211-char section duplicates coverage from serena-go.md import and model training
    • Why it shrinks: Removes items redundant with existing imports; saves ~750 chars (~5%)
    • Impact: Low | Needs review to identify gh-aw-specific items to keep

Agents

  1. [MEDIUM] Audit linter-miner.md inline agent encapsulation
    • Evidence: linter-writer inline agent body contributes verbose file templates to orchestrator context every turn; 3 inline agents defined but Step 5 templates still live in the parent workflow
    • Why it shrinks: Proper sub-agent encapsulation ensures file templates appear only in the sub-agent context, not the orchestrator
    • Impact: Medium | Safe; improves token efficiency and separation of concerns

References

Generated by 🌫️ Daily Ambient Context Optimizer · 191.2 AIC · ⌖ 21.8 AIC · ⊞ 7.6K ·

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions