feat(merge-retrospective): auto-fill retrospective stubs on issue open - #775
Open
tvna wants to merge 2 commits into
Open
feat(merge-retrospective): auto-fill retrospective stubs on issue open#775tvna wants to merge 2 commits into
tvna wants to merge 2 commits into
Conversation
Adds an issues:opened/labeled-triggered anthropics/claude-code-action dispatch (.github/workflows/merge-retrospective-autofill.yml) that runs merge-retrospective's content-filling procedure against a freshly-opened bare stub, so it no longer depends on an interactive agent remembering to invoke the skill or a human explicitly asking. Reuses the existing ANTHROPIC_API_KEY/GITHUB_TOKEN pattern already shipped by ranking-the-open-queue-weekly.yml -- no new secret. Refs #769
…ding workflow_dispatch against merge-retrospective-autofill.yml on this feature branch 404s: GitHub only recognizes a workflow once it exists on the default branch, regardless of the dispatch ref. Confirmed live against real open bare-stub issue #751 (with explicit user go-ahead). Records this as the concrete reason live proof is unreachable before merge, alongside the pre-existing ANTHROPIC_API_KEY billing risk. Refs #769
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #775 +/- ##
=======================================
Coverage 98.87% 98.88%
=======================================
Files 60 60
Lines 11324 11392 +68
=======================================
+ Hits 11197 11265 +68
Misses 127 127 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This was referenced Aug 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/merge-retrospective-autofill.yml, anissues: opened/labeled-triggeredanthropics/claude-code-action@v1dispatch that runs
skills/merge-retrospective/SKILL.md's content-fillingprocedure against a freshly-opened bare stub retrospective issue, so the
retrospective actually gets filled in without depending on an agent
remembering to invoke the skill or a human asking.
Facts
skills/merge-retrospective/SKILL.md's own trigger is a descriptionstring with no deterministic enforcement;
.github/scripts/gitapex_post_merge_retro.pyalready opens a bare, marker-text-carrying,
retrospective-labelled stubfor every merged PR unattended, but nothing previously filled it in
short of an interactive session remembering to, or a human explicitly
asking (as happened for PR refactor(skill-metadata): dedupe find_requires_cycle with its test #762 -> issue chore(retrospective): merge retrospective for PR #762 #763).
.github/workflows/ranking-the-open-queue-weekly.ymlalready ships aworking blueprint for a headless
anthropics/claude-code-action@v1dispatch from GitHub Actions using the existing
secrets.ANTHROPIC_API_KEY(already provisioned, documented in
CONTRIBUTING.md) and a localghcr.io/github/github-mcp-servercontainer fedsecrets.GITHUB_TOKEN.This PR reuses that exact pattern -- no new secret.
issues: opened/labeled(not a scheduledsweep) so it fires the instant
gitapex_post_merge_retro.py's own stub-creatingPOST succeeds -- see the design doc's "Decision" section for why this is
both faster and simpler than a cron-based race against that same event.
workflow_dispatch(with anissue_numberinput) covers manualrecovery from a missed webhook.
contents: read,issues: writeonly, both workflow- andjob-level -- no
pull-requests: writeanywhere.claude_args: --allowedToolslists exactly five read/issue-scoped tools(
mcp__github__issue_read,mcp__github__issue_write,mcp__github__search_issues,mcp__github__search_commits,mcp__github__pull_request_read) and excludes every merge-capable tool.A deterministic job-level
if:pre-filter (the same stub-marker literalgitapex_stale_retro_stub_autoclose.pyalready uses) means the agent step neverruns at all for an already-enriched issue or an unrelated
retrospective-labelled issue.python3 .github/scripts/gitapex_gate_routine_scope_enforcement.py --skills-root skills docs/superpowers/specs/2026-08-05-merge-retrospective-autofill-routine.md->
PASS(the design doc cites the--allowedToolsallowlist above asits concrete scoping mechanism for
skills/merge-retrospective'sdeclared
capabilityAssumption: Broad).actionlintv1.7.12 (matching.github/workflows/lint.yml's pinnedversion) against every file in
.github/workflows/-> clean, zerofindings.
python3 .github/scripts/gitapex_gate_hidden_characters.py->OK, nohidden characters in any tracked file.
python3 .github/scripts/gitapex_gate_provenance_disclosure.py --diff-added docs/superpowers/specs/2026-08-05-merge-retrospective-autofill-routine.md->
PASS.uv run pytest -q(full suite, including the 6 new drift-guard tests intests/test_gitapex_merge_retrospective_autofill.py) -> 2683 passed.uv run mypy .github/scripts tests hooks skills/battle-testing-a-skill/scripts skills/scorer-gated-skill-edits/scripts skills/evaluating-skill-quality/scripts skills/auditing-agent-product-scope/scripts evals/scripts->
Success: no issues found in 120 source files(the new test module isadded to
pyproject.toml's existing Tier B untyped-test-moduleallowlist, matching every other
tests/*.pyfile's own establishedconvention -- none of them carry return-type annotations either).
uv run ruff check .anduv run ruff format --check .-> both clean.ranking-the-open-queue-weekly.ymlvia
mcp__github__actions_list(2026-08-05): every run 2026-07-28through 2026-08-03 failed fast (~15-30s), the same shape that doc's own
2026-07-28 investigation root-caused to an Anthropic Console billing
block (
"Credit balance is too low"). This PR's new workflow reuses theidentical
ANTHROPIC_API_KEY, so its first live dispatch is exposed tothe same pre-existing, external, owner-side blocker -- disclosed
explicitly in the design doc's "Status" section rather than glossed
over, per this repository's live-proof-over-plan-time-intent standard.
go-ahead):
mcp__github__actions_run_triggerrun_workflowagainstmerge-retrospective-autofill.ymlon this branch, targeting real openbare-stub issue chore(retrospective): merge retrospective for PR #747 #751. It failed with
404 Not Foundon the dispatchcall itself -- confirms GitHub's documented behavior that
workflow_dispatchonly recognizes a workflow once it exists on therepository's default branch. Live verification (either via a real PR
merge or a post-merge
workflow_dispatch) is only reachable after thisPR merges, not before -- see the design doc's "Status" section, updated
with this finding.
Assumptions
Console billing block observed through 2026-08-03 is still in effect as
of this PR -- this session did not re-run
ranking-the-open-queue-weekly.ymlwith
show_full_output: trueto re-confirm the exact current errorshape, since re-enabling that flag for a check not otherwise needed
would be unnecessary output exposure. The identical fast-failure shape
across every run to date is the basis for this inference, not a
freshly-observed error message.
issues: opened/labeledwebhook delivery is reliable enough inpractice that a pure event trigger (no scheduled backstop) satisfies
issue feat(merge-retrospective): trigger retrospective content-fill automatically on PR merge, without relying on agent memory #769's "runs shortly after its stub is opened" criterion; the
existing
stale-retro-stub-autoclose.yml48h close remains the ultimatefallback if a webhook is ever missed, which is pre-existing degraded
behavior this PR does not change.
Risk / blast radius
Low-to-moderate. The new workflow can only read a PR's history and
read/update one already-open issue (
issues: write, nopull-requests: write, no merge-capable tool in its--allowedToolslist) -- worst case on a prompt-injection attempt from untrusted PR/issue
content is a wrongly-classified repair entry in a retrospective issue
body, not a repository-write or merge action. If the workflow
misbehaves, disabling it (or reverting this PR) leaves the pre-existing
behavior (bare stub, closed after 48h by
stale-retro-stub-autoclose.yml)fully intact -- no other workflow depends on this one.
Rollback
git revertthis PR's merge commit. No secrets, schema, or persistedstate are introduced (the workflow reuses the existing
ANTHROPIC_API_KEYand
GITHUB_TOKEN); reverting removes the workflow file, the design doc,the CONTRIBUTING.md cross-reference, the new test file, and its
pyproject.tomlmypy-override entry, with no follow-up steps.Verification
Issue #769's Acceptance Criteria Map, restated:
workflow_dispatchattempt against issue #751 confirmed this is not reachable before merge (GitHub 404s a dispatch for a workflow not yet on the default branch); the sharedANTHROPIC_API_KEYmay also still carry the pre-existing billing block described above. See the design doc's "Status" section for the full finding and the recommended post-merge verification step.permissions:and--allowedTools(both reproduced in the design doc and this PR body)issues: writeonly;--allowedToolslists five read/issue-scoped tools, no merge-capable one;tests/test_gitapex_merge_retrospective_autofill.py::test_workflow_never_grants_pull_requests_writeand::test_workflow_has_no_merge_capable_stepboth pass and will fail CI on any future regression.Skill audit evidence
docs/superpowers/specs/2026-08-05-merge-retrospective-autofill-routine.mdagainst
gitapex_gate_routine_scope_enforcement.py's actual scoping-citationrequirements (confirmed
PASSabove, not assumed), cross-checked itsfactual claims against live GitHub Actions run history for
ranking-the-open-queue-weekly.ymlrather than trusting the prior designdoc's own account, and revised the workflow's prompt wording after
discovering that a literal
mcp__github__merge_pull_requestmention (alegitimate prohibition) would otherwise falsely trip a substring-based
merge-capability drift test -- caught during this same review pass, not
after the fact.
Checklist
uv run pytest -q-> 2683 passed)CONTRIBUTING.mdcross-referenceskills/*/SKILL.mdtouched, only a new design doc (see Skill audit evidence above)evals/*/split.mdKept-edit-log entry addedskills/*/SKILL.mdStop-boundary bullet or dispatch branch added or increasedRelated Issue
Closes #769
Generated by Claude Code