Repository navigation
fix(loop): find our PRs by authorship, and read hasWorkflows off disk - #37
Merged
Merged
Conversation
Two corrections to #36, both from watching the first real runs. **A PR is ours because we wrote it.** #36 made `assignee:<bot>` the gate for PRs as well as tickets, which forced a migration — every PR open at cutover had to have the bot added — and left all three carrying two assignees, the reviewer's and ours, with the field meaning two things at once. `author:<bot>` was the answer already sitting there: exact, indexed, no write, no migration. So the loop now writes no PR assignee at all, on creation or after. That frees the field for the one thing it could not express before, pointing the other way: **assigning the bot to a PR it did not write is how a human hands one over**, and unassigning withdraws it. Preflight gains a second, disjoint PR query (`assignee:<bot> -author:<bot>`) for exactly that case. Tickets are unchanged — assignment is still their queue. **hasWorkflows is a filesystem check.** `mcp__github__list_workflows` is not in the routine's MCP build; four consecutive runs journalled its absence under⚠️ Failed, every time for a fact sitting on disk. Every repo in `repos` is cloned into the run before Claude starts, so `.github/workflows/*.yml` answers it exactly, for free, and cannot 403. The general rule, now in why.md: when the run already holds the checkout, read the checkout. The failure was harmless — an absent hasWorkflows reads as "this repo has CI", so the gate stayed closed — but a recurring⚠️ Failed line trains a reader to skim the section that exists to be read. Not changed: the survey-vs-journal weekday mismatch reported last night. At the real cron time (`0 8 * * *`) UTC and Vancouver agree year-round — 08:00Z is 01:00 PDT and 00:00 PST, the same weekday either way. It diverged only because the run was fired by hand at 04:19Z. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
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
Two corrections to #36, both learned from watching the first real runs.
1. A PR is ours because we wrote it, not because it is assigned to us.
#36 made
assignee:<bot>the gate for PRs as well as tickets. That forced a migration — every PR open at cutover needed the bot added by hand — and left all three carrying two assignees, yours and the bot's, with the field meaning two things at once.author:<bot>was the answer already sitting there: exact, indexed, no write, no migration. The loop now sets no PR assignee at all, on creation or after.That frees the field for the one thing it could not express before, and it points the other way:
preflightgains a second, disjoint query (assignee:<bot> -author:<bot>) for exactly that case. Tickets are unchanged — assignment is still their queue and still your kill switch.is:pr is:open author:<bot> draft:false review:approvedis:pr is:open author:<bot> updated:>=<last-run>is:pr is:open author:<bot> draft:trueis:pr is:open author:<bot> draft:false -reviewed-by:<bot>is:pr is:open assignee:<bot> -author:<bot>2.
hasWorkflowsis a filesystem check, not an API call.mcp__github__list_workflowsis not in the routine's MCP build. Four consecutive runs journalled its absence under⚠️ Failed— every time for a fact sitting on disk. Every repo inreposis cloned into the run before Claude starts, sols .github/workflows/*.ymlanswers it exactly, for free, and cannot 403.The general rule, now in
why.md: when the run already holds the checkout, read the checkout.The failure was harmless — an absent
hasWorkflowsreads as this repo has CI, so the gate stayed closed rather than opening — but a recurring⚠️ Failedline trains a reader to skim the one section that exists to be read.Not changed, deliberately
The survey-vs-journal weekday mismatch the nightly run reported. At the real cron time (
0 8 * * *) UTC and Vancouver agree year-round — 08:00Z is 01:00 PDT and 00:00 PST, the same weekday either way. It diverged only because I fired that run by hand at 04:19Z. Verified for both DST and standard time.Test results
claude plugin validate ./workflow --strictis:pr … assignee:query remains except the intended delegation one(why: docs/why.md#…)citation resolvesManual verification
sydevs-botas a leftover assignee from feat(fields): ticket state is a Stage field; a PR's state is its draft flag #36's migration — I am removing it after this merges, so the field starts clean.⚠️ Failedshould no longer carry thelist_workflowsline, and the 👀 rows should still list #676, #679 and #681 — now found by author rather than assignment.🤖 Generated with Claude Code