Skip to content

[q] Fix Daily Graft Intelligence commit lookup: non-shallow checkout + graph caching #49235

Description

@github-actions

Q Workflow Optimization Report

Issue Found

Daily Graft Intelligence (.github/workflows/daily-graft-intelligence.md)

  • Reported issue ([graft-intelligence] Daily Graft Intelligence — 2026-07-30 #49198): the daily report only shows 1 commit for the 24h window even when more commits landed.
  • Root cause confirmed live: this workflow used the compiler default shallow clone (fetch-depth: 1). git log --since="24 hours ago" against a 1-commit-deep checkout can only ever see the single most recent commit, regardless of how many commits actually landed in the window.
  • Verified in this sandbox: git log --oneline --since="24 hours ago" on the shallow default checkout returns exactly 1 commit, matching the symptom described in the issue.
  • Additionally, the shared shared/mcp/graft.md step ran a full graft build on every single run with no caching, even though the graph changes incrementally day to day.
Changes Made

daily-graft-intelligence.md

  • Added checkout: with fetch-depth: 0 so the workflow performs a full (non-shallow) clone. This lets git log --since correctly enumerate every commit in the reporting window instead of being capped at whatever the shallow depth happens to include.

shared/mcp/graft.md

  • Added an actions/cache restore step (graft-graph-<repo>-<sha> key, with a repo-scoped restore-keys fallback) before building the Graft graph.
  • The build step now skips the expensive graft build pass on an exact cache hit, still running graft check to validate the restored graph against the current commit.
  • Added an actions/cache/save step (only on cache miss) so the built graph is persisted for future runs.
  • Updated the header comment to document the caching behavior and the checkout: fetch-depth: 0 usage requirement for importing workflows.

Expected Improvements

  • Fixes the reported bug: the daily report will now see the full commit history for the 24h window instead of just 1 commit.
  • Reduces cost/runtime: most daily runs will restore a cached Graft graph and skip the full graft build pass, only re-validating with the cheap graft check.

Validation

Compiled successfully using the local gh-aw compile binary (no errors; one expected shell-injection-prevention warning for the cache-hit expression, which is normal compiler behavior):

  • ✅ daily-graft-intelligence.md

Note: .lock.yml will be regenerated automatically after merge; it was intentionally excluded from this PR per repo convention.

References


Warning

Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 30592715428 -n agent -D /tmp/agent-30592715428

# Create a new branch
git checkout -b q/fix-graft-commit-lookup-shallow-checkout-43b16d65bcc95398 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-30592715428/aw-q-fix-graft-commit-lookup-shallow-checkout.patch

# Push the branch and create the pull request
git push origin q/fix-graft-commit-lookup-shallow-checkout-43b16d65bcc95398
gh pr create --title '[q] Fix Daily Graft Intelligence commit lookup: non-shallow checkout + graph caching' --base main --head q/fix-graft-commit-lookup-shallow-checkout-43b16d65bcc95398 --repo github/gh-aw

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • proxy.golang.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "proxy.golang.org"

See Network Configuration for more information.

🎩 Equipped by Q · auto · 126.3 AIC · ⌖ 8.39 AIC · ⊞ 11.4K ·
Comment /q to run again

  • expires on Aug 1, 2026, 4:22 PM UTC-08:00

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions