Skip to content

[ambient-context] Daily Ambient Context Optimizer - 2026-06-29 #42340

Description

@github-actions

Executive Summary

  • 4 runs sampled across 4 distinct workflows (PR Code Quality Reviewer, Test Quality Sentinel, Impeccable Skills Reviewer, PR Description Updater†)
  • Median first-request size: 12,162 chars | P95: 13,913 chars
  • Largest request: 21,886 chars (Test Quality Sentinel, 8,130 ambient context tokens)
  • The <system> block (runtime-injected) is 6,818–6,900 chars per run (31–68% of total); of that, <safe-outputs> alone is 3,481 chars — and is further duplicated in workflow-owned content via shared/pr-code-review-config.md
  • Test Quality Sentinel's workflow-owned prompt content is 15,048 chars — dominated by Steps 3–4 (6,083 chars) that can be significantly compressed
  • Request source: prompt.txt (API proxy event logs not present in downloaded run artifacts)

pr-description-updater.md not found locally — likely upstream-managed; excluded from workflow-md recommendations.

Highest-Leverage Changes

  1. Compress Test Quality Sentinel Steps 3–4 (6,083 chars → ~3,000 chars; saves ~3,000 chars): Replace the verbose multi-classification rubrics (Step 4) and exhaustive assertion-pattern lists (Step 3) with compact bullet tables. Highest single reduction available.
  2. Condense Test Quality Sentinel Guidelines + Step 6 (3,247 chars → ~1,800 chars; saves ~1,400 chars): Calibration guidelines and scoring formula explanation contain redundant detail that can be halved without removing logic.
  3. Remove ### Safe Output Usage from shared/pr-code-review-config.md (saves 768 chars, safe immediately): Fully duplicates the runtime-injected <safe-outputs> block present in every run.
  4. Compress Test Quality Sentinel Step 8 (1,308 chars → ~600 chars): The verdict conditions repeat thresholds already stated in Step 6; consolidate to a 3-bullet summary.
  5. Verify proxy settings on all active agentic workflows: All 4 sampled workflows already have cli-proxy: true and tools.github.mode: gh-proxy; confirm any newly added workflows follow the same pattern.

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 12,162
P95 chars 13,913
Largest sampled request 21,886 chars (Test Quality Sentinel)
Merged optimizer PRs (7d) 5
Closed optimizer PRs (7d) 0
Optimizer PR close-rate (7d) 0% (5/5 settled)
Per-Run First-Request Metrics
Run Workflow Chars Lines Hdgs Sys% Ambient Ctx (tok) AIC
§28397842942 Test Quality Sentinel 21,886 315 14 31% 8,130 81.21
§28397842941 PR Code Quality Reviewer 13,913 224 17 50% 5,172 124.69
§28397842944 Impeccable Skills Reviewer 10,411 171 13 66% 4,939 43.51
§28399695001 PR Description Updater 9,979 155 11 68% 4,707 89.23

Source: prompt.txt (compiled prompt). Sys% = system-block share of total chars. Ambient Ctx from agent_usage.json.

Repeated Ambient Context Signals
  • ### Safe Output Usage (768 chars from shared/pr-code-review-config.md) appears verbatim in PR Code Quality Reviewer prompt — full duplicate of the <safe-outputs> runtime block (3,481 chars already present in every run)
  • ## Report Structure Guidelines (247 chars from shared/reporting.md) appears in 3 of 4 runs — already compact; no action needed
  • ## Workflow Run References appears in 3 of 4 runs from shared/reporting.md — compact; no action needed
  • Test Quality Sentinel Step 4 (3,574 chars) has three quality-classification rubrics, each with 3 sub-bullets plus "Red Flags"; can be collapsed to a single compact table
  • Test Quality Sentinel Step 3 (2,509 chars) lists Go assertion patterns with full examples and JS patterns separately — both can be expressed as 3-line bullet lists
  • System block overhead: <safe-outputs> (3,481 chars) + <mcp-clis> (1,083 chars) = 4,564 chars in every run; runtime-injected, not directly reducible from workflow .md files
Deterministic Analysis Output

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

Top sections by size (workflow-owned content only):

  • TQS Step 4 AI Quality Review: 3,574 chars
  • TQS Step 3 AST Structural Analysis: 2,509 chars
  • TQS Step 6 Scoring: 1,781 chars
  • TQS Guidelines: 1,467 chars
  • TQS Step 8 Submit Review: 1,308 chars
  • PCQR Step 4 Write Comments: 1,377 chars
  • PCQR Safe Output Usage (import): 768 chars ← duplicate

Duplicate line ratio: all runs ≤ 0.51% (very low; no bulk line repetition within single prompts)

Keyword density (lines mentioning):

Workflow tools skills agents safe_outputs
Test Quality Sentinel 14 0 14 20
PR Code Quality Reviewer 5 0 7 18
Impeccable Skills Reviewer 7 6 3 19
PR Description Updater 3 0 1 18

High safe_outputs counts across all runs confirm the system-block duplication finding.

Recommendations by Category

Workflow Markdown

1. Compress Test Quality Sentinel Steps 3–4 · test-quality-sentinel.md · HIGH · needs manual review

Step 4 (3,574 chars) contains three classification rubrics each with 3 labelled sub-bullets plus "Red Flags". Step 3 (2,509 chars) lists Go testify/stdlib assertion forms and JS vitest forms in verbose prose. Both can be rewritten as compact reference tables, saving ~3,000 chars (~13% of full .md). Minimum safe size guard: current .md is 23,100 chars; well within the 40% limit.

2. Condense Test Quality Sentinel Guidelines + Step 6 · test-quality-sentinel.md · MEDIUM · needs manual review

Guidelines (1,467 chars) repeat calibration notes already implied by the Step 4 rubric. Step 6 (1,781 chars) includes a formula + threshold table; thresholds can be condensed to a single line. Combined target: ~1,000 char reduction.

3. Compress Test Quality Sentinel Step 8 · test-quality-sentinel.md · LOW · likely safe

Step 8 (1,308 chars) restates verdict conditions covered by Steps 4 and 6. Replace with a 3-bullet summary pointing back to score thresholds.

Skills

4. Remove ### Safe Output Usage from shared/pr-code-review-config.md · MEDIUM · safe immediately

This 768-char section is a verbatim subset of the runtime-injected <safe-outputs> block (3,481 chars), which already appears before any workflow content in every run. Removing it saves 768 chars on every PR review run that imports pr-code-review-config.md or pr-review-base.md. No unique information is lost.

Agents

5. Confirm proxy settings on all active agentic workflows · LOW · safe

All 4 sampled workflows already enable cli-proxy: true and tools.github.mode: gh-proxy. This is a standing hygiene check: new workflows added without these settings will incur unnecessary raw-CLI overhead. Add to the workflow authoring checklist.

References

  • §28397842942 — Test Quality Sentinel (largest, 21,886 chars)
  • §28397842941 — PR Code Quality Reviewer (highest AIC, 124.69)
  • §28399695001 — PR Description Updater (most system-dominated, 68%)

Generated by 🌫️ Daily Ambient Context Optimizer · 236.8 AIC · ⌖ 28.1 AIC · ⊞ 7.6K ·

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

Metadata

Metadata

Type

No type
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