Skip to content

feat(board): ignore quest branches left at a merged PR's head - #217

Merged
kixelated merged 3 commits into
mainfrom
quest/m0/kix/merged-claims
Oct 24, 2026
Merged

kixelated merged 3 commits into
mainfrom
quest/m0/kix/merged-claims

Conversation

@kixelated

@kixelated kixelated commented Oct 24, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/kix/merged-claims.md.

Problem

The kix board and inbox counted every observed quest/* branch as a claim. Since kixelated/quest#192, quest unblocked --unclaimed skips a branch whose tip is the head of a merged PR. So in a repository that keeps head branches after merge, the board showed landed quests as Claimed while the CLI offered them.

Change

  • quest/core gains landed(tip, pulls), the one definition of the rule. It returns the merged PR whose head is the branch's tip, if any. A branch at a merged PR's head holds nothing. A branch whose PR closed unmerged, or that got commits after its merge, still holds its quest. The CLI's mergedPull() (which returns that PR's URL since kixelated/quest#214) and the Worker both call it.
  • The Worker's occupancy query now reads each quest ref's target { oid } and associatedPullRequests(states:MERGED, first:10, newest first) { headRefOid }. reconcile drops landed refs before it records claims.
  • The fake GitHub (cloudflare/dev/github.ts), on the Repo.branches model from kixelated/quest#213, gets two optional Pull fields: merged (the PR reports MERGED; its merge endpoint sets it) and head (the commit a closed PR ended at once its branch moved on). A branch kept after its PR closed is just a listed branch. Refs now return their tips and the heads of the PRs from them that merged. The shared seed world is unchanged.
  • cloudflare/GITHUB.md documents the rule.
  • Deletes the quest and its link from quest/m0/kix/README.md.

Validation

  • A new seeded test in cloudflare/test/seed.test.ts covers three branches: one left at a merged head shows Available on the board, one whose PR closed unmerged shows Claimed, and one pushed to after its merge shows Claimed and is not offered in the inbox. With the Worker filter disabled, the test fails.
  • just check and just test pass locally.

Choices made without asking

  • Webhook invalidation unchanged. A push to an existing quest/ branch still doesn't invalidate candidates, as before. A push to a landed branch therefore becomes a claim on the next occupancy pass, not immediately. quest start replacing a landed branch opens its draft PR right away, and that pull_request opened event already invalidates.
  • Up to 10 merged PRs per ref, newest first. A landed tip is the head of the latest merged PR, so this bounds the query, at about 1000 nodes per page of 100 refs.
  • Test world edited per test. The test changes its own world through a new seeded(edit) hook rather than growing the shared seed world. This keeps fake-GitHub changes small next to quest/m0/kix/github-fake.md.

Follow-ups

  • quest start claims by pushing to origin and then opening the PR. Here its first push failed with a bare failed to push some refs, and a manual retry of the same push succeeded. The error printed only stderr, which hid git's porcelain status line. Consider including stdout in that error so the cause is visible.

🤖 Generated with Claude Code

(written by Claude Opus 5.5)

kixelated and others added 2 commits October 23, 2026 23:03
The Worker counted every observed quest/* branch as a claim, while the CLI
already skipped a branch whose tip is the head of a merged PR. The rule now
lives in quest/core as `landed`, which both use: the occupancy pass reads each
quest branch's tip and its merged PRs' heads, and drops landed branches. A
branch whose PR closed unmerged, or with commits pushed after its merge, still
claims its quest.

The fake GitHub models merged PRs and branches kept after their PR closed,
and the seeded test covers all three cases.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Ignore merged branches on the board feat(board): ignore quest branches left at a merged PR's head Oct 24, 2026
@kixelated
kixelated marked this pull request as ready for review October 24, 2026 06:21
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T16:16:22.693714Z 8346d7f New commits
🔒 Security Review ✅ Completed 2026-10-24T16:18:15.630049Z 8346d7f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Resolves conflicts with #213 and #214:

- `landed` in quest/core now returns the merged PR it finds, so the CLI's
  `mergedPull` (renamed in #214 to return the PR's URL) keeps using the one
  shared rule, and the Worker checks it for undefined.
- The fake GitHub's merged-claims additions now build on #213's
  `Repo.branches` model: a quest ref is any listed `quest/*` branch or open
  upstream PR's branch, at its tip, with the PRs from it that merged. A kept
  branch is just a listed branch; a closed PR's optional `head` pins the commit
  it ended at once its branch moves on. The fake's merge endpoint marks the
  PR merged.
- The seeded test lists the kept branches itself, and checks the inbox
  against the quest a pushed branch claims, since #215's agent cards now show
  every queued job's quest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated

Copy link
Copy Markdown
Collaborator Author

Landing summary

Landing head 8346d7f with a squash merge.

Changes since the last reviewed head (f355b40)

  • Merged main (no rebase) to pick up kixelated/quest#213, kixelated/quest#214, kixelated/quest#215, kixelated/quest#216, and the rest of main. Two conflicts were resolved by hand:
    • src/cli/claims.ts: A branch named after an epic never blocks its claims #214 renamed merged() to the exported mergedPull(), which returns the merged PR's URL. To keep one definition of the merged-head rule, landed() in src/core/claim.ts now returns the merged PR it finds (or undefined). mergedPull() reads the URL from it, and the Worker checks it against undefined.
    • cloudflare/dev/github.ts: the fake-GitHub additions now build on test(cloudflare): run publication end to end against the seeded GitHub fake #213's Repo.branches model. A quest ref is any listed quest/* branch or open upstream PR's branch, at its tip, with the heads of the PRs from it that merged. A kept branch is just a listed branch, so the kept field is gone. A new optional Pull.head pins the commit a closed PR ended at once its branch moves on. The fake's merge endpoint now also marks the PR merged.
  • Since feat(kix): show what agents are working on as summary cards #215, the inbox shows a card for every queued job's quest, so the seeded test's inbox check moved from "Keep working offline", which has a queued job, to "Export a project as a ZIP archive", which a pushed-after-merge branch claims. The test still fails with the Worker's landed filter disabled.
  • just check and just test pass locally. The required checks pass on 8346d7f. Codex reviewed 8346d7f, triggered by the new commits, and raised no findings. quest check --base origin/main, run from a build of main, passes.

(Written by Claude Opus 5.5)

@kixelated
kixelated merged commit cc7a266 into main Oct 24, 2026
13 checks passed
@kixelated
kixelated deleted the quest/m0/kix/merged-claims branch October 24, 2026 16:22
kixelated added a commit that referenced this pull request Oct 24, 2026
Keep main's merged flag on the fake's pull requests (#217) for both its
REST merge and the merge mutation, and document both meanings of a
listed upstream branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant