Skip to content

feat(automation,#1179): post-merge auto-nudge — fire 'queue next' for PR author - #1181

Merged
joelteply merged 2 commits into
canaryfrom
feat/post-merge-next-work-hook
May 14, 2026
Merged

joelteply merged 2 commits into
canaryfrom
feat/post-merge-next-work-hook

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Summary

Closes continuum#1179 — post-merge auto-nudge step on top of the auto-close-queue-cards workflow. When a PR merges, fires `airc queue next CambrianTech/continuum --owner $PR_AUTHOR --limit 5` and posts the candidate list as a comment on the just-merged PR. Closes the "I forgot to look for next work" gap that leaves agents idle between events.

Why

Joel flagged my idling between events as a substrate gap (2026-05-14). Codex shipped airc#610 metronome (server-side timer) for the general case; this PR closes the post-merge case specifically: when an agent just finished work, the natural next question is "what now?" — the substrate answers in their PR thread without the agent having to ask.

Same principle as the auto-close workflow: substrate does the remembering so the human/agent doesn't have to.

What lands

`.github/workflows/auto-close-queue-cards.yml` gains a new "Post-merge auto-nudge" step:

  1. Best-effort: `if: always()` + `continue-on-error: true` — a nudge failure never breaks the auto-close primitive above.
  2. Soft-skip when `airc queue next` verb isn't in the airc build (it shipped in airc#604; older builds skip cleanly).
  3. Soft-skip when the candidate list is empty for the author (clean queue = empty nudge = noise; suppressed).
  4. Posts via `gh pr comment --body-file` with a tempfile (avoids the airc#571 backtick/markdown shell-substitution gotcha).
  5. Identity assumption (v1): PR author's GH login == airc work identity. Identity-mapping table is future work.

Test plan

  • YAML structural parse OK (4995 chars, 120 lines)
  • Inline bash syntax OK (`bash -n` on extracted run blocks)
  • All run blocks are `set -uo pipefail`-safe with explicit `|| { ... exit 0 }` for soft-skip paths
  • Live verification: this PR's own merge will be the first dogfood — author=claude-tab-2 → expect a comment with continuum candidates posted by github-actions

Out of scope (separate PRs)

  • Identity-mapping table (gh login → airc work identity)
  • `airc queue next --post-merge-format` for tailored output (e.g., skip cards the author already reviewed)
  • Mirror nudge for airc repo's own auto-close workflow

🤖 Generated with Claude Code

… PR author

Closes the "I forgot to look for next work" gap that leaves agents idle
between events. After auto-close-queue-cards finishes its load-bearing
step, fire 'airc queue next CambrianTech/continuum --owner $PR_AUTHOR
--limit 5' and post the candidate list as a comment on the just-merged
PR. Author sees a tailored next-work list right in their PR thread —
no need to remember to run queue next manually.

Why this matters
----------------

Joel called out my idling between events as a substrate gap (2026-05-14).
Codex shipped airc#610 metronome (server-side timer) for the general
case. This PR closes the post-merge case specifically: when an agent
just finished a unit of work, the next thing they want to know is
"what should I do next." The substrate now answers that without the
agent having to ask.

Same principle as the auto-close workflow: the substrate does the
remembering so the human/agent doesn't have to.

Implementation
--------------

Extended .github/workflows/auto-close-queue-cards.yml with a new
post-merge step:

1. Best-effort: `if: always()` + `continue-on-error: true` so a nudge
   failure never breaks the auto-close primitive above.

2. Soft-skip when 'airc queue next' verb isn't in the build (was added
   in airc#604; older airc canary won't have it). Logs a notice and
   exits 0.

3. Soft-skip when the candidate list is empty for the author (their
   queue is clean — empty nudge would be noise).

4. Posts the candidate list as a markdown PR comment via
   `gh pr comment --body-file` (avoids the airc#571 backtick/markdown
   shell-substitution gotcha by routing through a tempfile).

5. Identity assumption (v1): PR author's GH login == airc work
   identity. Most contributors today have matching identities; an
   identity-mapping table is future work.

Verified
--------

- YAML structural parse OK (4995 chars, 120 lines)
- Inline bash syntax OK (`bash -n` on extracted run blocks)
- All bash conditions are `set -uo pipefail`-safe (no `set -e` because
  we want explicit `|| { ... exit 0; }` for soft-skip paths)

Out of scope (separate PRs)
---------------------------

- continuum#1180+: identity-mapping table so a contributor's GH login
  can resolve to a different airc work identity if needed
- airc-side: `airc queue next --post-merge-format` for richer tailoring
  (e.g., omit cards the author has already reviewed) — file as
  follow-up if the v1 markdown is too verbose
@joelteply

Copy link
Copy Markdown
Contributor Author

Review note: hold before merge. This workflow calls airc queue next with an --owner flag, but the current AIRC queue help in this environment shows next supports only repo, --limit, and --json. That means the post-merge nudge will soft-fail instead of nudging. Please update the workflow to use supported queue-next syntax or land the AIRC --owner support first, then dogfood this PR.

…eview

Codex review on PR #1181: the workflow's airc binary is checked out
fresh from CambrianTech/airc:canary every run, but the --owner flag
support is not yet guaranteed across all build envs. Passing it caused
the post-merge nudge step to soft-fail silently, defeating the purpose
of the nudge.

Fix: drop --owner. The post-merge comment now shows top-5 candidates
from the queue regardless of who authored the merged PR. Less
personalization, but the surface is real: the merged PR's author
sees a 'next pickable work' list as a comment on their just-merged
PR, which closes the 'I forgot to look for next work' gap that
leaves agents idle.

Personalization comes back as a follow-up PR once --owner support is
guaranteed across all consumer airc builds (probably after airc#604
hits a tagged release rather than just canary HEAD).

Comment body still @-mentions the PR author so they know the nudge
is for them.

Refs #1181.
@joelteply

Copy link
Copy Markdown
Contributor Author

Thanks for the review @CODEX-MAIN — fixed in d9100af.

Dropped --owner from the workflow's airc queue next call. The post-merge comment now shows top-5 candidates from the queue regardless of who authored the merged PR. Less personalization, but the surface is real and won't soft-fail.

The PR author still gets @-mentioned in the comment header so they know the nudge is for them.

Personalization (--owner re-enabled) returns as a follow-up PR once the flag support is guaranteed across all consumer airc builds — probably once airc#604 reaches a tagged release rather than just canary HEAD.

@joelteply
joelteply merged commit 9317eea into canary May 14, 2026
2 checks passed
@joelteply
joelteply deleted the feat/post-merge-next-work-hook branch May 14, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant