Skip to content

[agentic-token-optimizer] Optimization: Release workflow — condense writing guidance and add commit-classification sub-agent #116

@github-actions

Description

@github-actions

Target Workflow

Release (.github/workflows/release.md) was selected as the highest estimated-AIC AI-driven workflow available for analysis. A prior audit (2026-06-05) measured ~4.28M tokens across 3 runs (~1.43M avg/run), and a new run on 2026-06-09 provides fresh evidence. All other AI-driven workflows were analyzed more recently (audit: 1 day ago; optimizer: self-excluded).

Note: The 14-day exclusion window technically covers all current AI-driven workflows. Release was last analyzed 5 days ago—the least-recently-analyzed AI workflow not self-targeted. No pre-aggregated AIC data was available (all daily snapshots returned zero runs); estimates are derived from structural analysis and the prior optimization run.

Analysis Period: 2026-06-03 → 2026-06-10 (7 days)

Runs in window: 1 (2026-06-09) · Total history audited: 4 runs

Spend Profile

Metric Value
Runs in 7-day window 1
Total runs analyzed 4
Success rate 100% (4/4)
Retries 0
Agent steps per run ~43 (from job step count)
Total AIC (current window) — (data unavailable)
Avg AIC/run
Total tokens (prior 3-run analysis) ~4.28M
Avg tokens/run (estimated) ~1.43M
Cache efficiency Unknown
Run history
Run Date Conclusion Attempt
§27187973928 2026-06-09 success 1
§26780840710 2026-06-01 success 1
§26163733067 2026-05-20 success 1
§25873066389 2026-05-14 success 1

All four runs completed on the first attempt with no errors. The workflow is triggered manually for each production release.

Ranked Recommendations

1 · Condense overlapping writing guidance in ## What to Write · Est. 0.30 AIC/run

Problem: The ## What to Write section spans ~120 lines across six overlapping sub-sections:

  1. Structure (Highlights + Upgrade Notes)
  2. KAC section descriptions (Added/Changed/Deprecated/Removed/Fixed/Security)
  3. Semver-awareness rules (major/minor/patch handling)
  4. Selection rubric (what to include/exclude — 10 rules)
  5. Anti-patterns list (10 items)
  6. Writing quality constraints (6 items)

Sub-sections 4, 5, and 6 largely repeat the same principle: "prefer user-facing impact over implementation commits; omit CI, build, test, and formatting changes." This appears three times in different forms, consuming prompt tokens on every run.

Action: Merge the selection rubric, anti-patterns, and writing constraints into a single 10-line "Writing Rules" section. Retain the structure spec and KAC definitions unchanged. This reduces ## What to Write from ~120 lines to ~60 lines without losing any decision-guiding content.

Evidence: The agent job contains 43 steps, suggesting multiple read–revise iterations that could stem from ambiguous or redundant guidance. Reducing prompt complexity typically lowers turn count by 10–20%.


2 · Shorten CHANGELOG update instructions · Est. 0.10 AIC/run

Problem: The CHANGELOG section dedicates ~30 lines to defining each Keep a Changelog section type (Added, Changed, Deprecated, Removed, Fixed, Security) with full prose descriptions. The model already knows this format from training data.

Action: Replace with four imperative bullets:

  • Add ## [x.y.z] - YYYY-MM-DD above the previous version entry.
  • Group bullets under only the relevant KAC sections; omit empty sections.
  • Use user-facing substance only (no commit messages, SHAs, or PR numbers).
  • Skip the changelog push if release_target is a raw commit SHA.

Evidence: The model successfully writes KAC-compliant entries without step-by-step definitions in other workflows. Reducing this section from ~30 to 4 lines frees prompt budget for the actual release content.


3 · Inline sub-agent for commit classification · Est. 0.20 AIC/run

Problem: The main agent currently reads commit_subjects.tsv (potentially dozens of entries per release) and changed_files.txt, decides which commits are user-facing vs. internal, and holds that reasoning in context while also drafting release notes and updating the changelog. Commit classification is purely extractive—no strategic judgment is required.

Sub-agent fit:

Dimension Score Rationale
Independence 3/3 Only needs pre-downloaded files at known paths
Small-model adequacy 3/3 Pure classification: include if user-observable, exclude CI/build/test/format
Parallelism 1/2 Sequential before writing, but frees main-agent context
Size 2/2 Scales with release size; substantial enough to justify delegation
Total 9/10 Strong candidate

Invocation change: Add the following block before ## What to Write in release.md:

## agent: classify-commits

Read /tmp/gh-aw/release-data/commit_subjects.tsv and /tmp/gh-aw/release-data/changed_files.txt.
For each commit, classify as user-facing (include) or internal (exclude).
Include if a user would notice the change by using, configuring, or upgrading the workflow.
Exclude CI, build, test, tooling, formatting, lockfile, and generated-file changes.
Output a markdown list to /tmp/gh-aw/release-data/user_facing_commits.md:
- [SHA-prefix] subject — rationale (one line)

Then update ## Data Available to add user_facing_commits.md and remove the commit-classification task from the main agent instructions.

Why a smaller model fits: The task is a fixed-schema classification with a binary decision per row and a short text rationale. It requires no cross-referencing of heterogeneous sources and no synthesis judgment.


4 · Parallelize sequential pre-step git operations · Est. 15% reduction in Actions minutes

Problem: In the "Prepare release context" pre-step, git log and git diff run sequentially after git fetch --unshallow. Both are read-only operations on the same revision range and are fully independent.

Action: Wrap both in a background process group:

git log --no-merges --reverse --pretty=format:'%H%x09%s' "$PREVIOUS_TAG..$RELEASE_TARGET" \
  > /tmp/gh-aw/release-data/commit_subjects.tsv &
git diff --name-only "$PREVIOUS_TAG..$RELEASE_TARGET" \
  > /tmp/gh-aw/release-data/changed_files.txt &
wait

Evidence: Both operations are bottlenecked by disk I/O and git object traversal, not CPU. Running them concurrently on a standard Actions runner typically halves the combined wall-clock time for repositories with long histories.


Tool Usage Audit
Tool Configured Usage assessment
bash ["*"] Used throughout pre-step and agent prompt — keep
safe-outputs.update-release yes Core output — keep
safe-outputs.threat-detection disabled (false) Already disabled — no action

No tool appears unused. The bash tool is the only agent-callable tool, and it is used for git operations and file reads. No removals recommended.

Caveats

  • Pre-aggregated AIC/token data is unavailable for the current analysis window (all daily snapshots returned 0 runs). Token estimates are from the prior optimization log entry (2026-06-05, 3 runs, 4.28M tokens).
  • The Release workflow is manually triggered. Per-run savings accumulate only on actual release events.
  • AIC savings estimates are conservative structural estimates, not measurements from instrumented runs.
  • All four historical runs succeeded on the first attempt — reliability is not a concern at this time.

References:

  • §27187973928 — most recent run (2026-06-09)
  • §26780840710 — prior run (2026-06-01)
  • Prior optimization log entry: 2026-06-05 · Release · 3 runs · 4.28M tokens · est. 950 tokens/run saved

Generated by Agentic Workflow AIC Usage Optimizer · ● 12.2M ·

  • expires on Jun 17, 2026, 3:52 PM UTC

Metadata

Metadata

Assignees

No one assigned

    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