Skip to content

[q] use git file version stamps for round-robin selection #31692

@github-actions

Description

@github-actions

Q Workflow Optimization Report

Triggered by: @pelikhan via /q use git file version stamps to implement round robin scheme on PR #31669

Analysis

spec-extractor

The current round-robin scheme stores a last_index counter in /tmp/gh-aw/cache-memory/spec-extractor/rotation.json. This has a key weakness: cache-memory is ephemeral and can be reset, causing the rotation to restart from index 0 unexpectedly.

The fix uses git log --format="%at" -1 -- pkg/<pkg>/README.md to get the last commit timestamp for each package's README.md. Packages are then sorted ascending (oldest or missing first) and the first 4 are selected. This is stateless — git history is the state.

Changes Made

.github/workflows/spec-extractor.md

  • Replaced rotation.json load/save logic with git timestamp lookup per package
  • Removed LAST_INDEX / NEXT_INDEX variables (no longer needed)
  • Added associative array PKG_TS mapping package → unix timestamp of last README.md commit
  • Selection: sort by timestamp ascending, pick first 4 (least-recently-updated)
  • Context file: now shows a table of packages + their timestamps instead of index values
  • Phase 3 prompt: removed instruction to write rotation.json; updated success criteria

Expected Improvements

  • Round-robin is now stateless — derived purely from git history
  • New packages (no README.md yet) always get timestamp=0 and are processed first
  • No risk of rotation resetting due to cache-memory eviction
  • Deterministic and reproducible from any git checkout

Validation

  • spec-extractor compiled successfully (no errors, no warnings)

Note: .lock.yml will be regenerated automatically after merge.

🎩 Equipped by Q · ● 7.2M ·

  • expires on May 14, 2026, 1:30 PM UTC

Note

This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 25737278783 -n agent -D /tmp/agent-25737278783

# Fetch the bundle into a local branch
git fetch /tmp/agent-25737278783/aw-q-spec-extractor-git-stamp-roundrobin.bundle refs/heads/q/spec-extractor-git-stamp-roundrobin:refs/heads/q/spec-extractor-git-stamp-roundrobin-46d23b6c2afb4d79
git checkout q/spec-extractor-git-stamp-roundrobin-46d23b6c2afb4d79

# Push the branch to origin
git push origin q/spec-extractor-git-stamp-roundrobin-46d23b6c2afb4d79

# Create the pull request
gh pr create --title '[q] use git file version stamps for round-robin selection' --base main --head q/spec-extractor-git-stamp-roundrobin-46d23b6c2afb4d79 --repo github/gh-aw

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