Skip to content

docs(guide): claim quests with a draft PR, forks included - #157

Merged
kixelated merged 5 commits into
mainfrom
docs/fork-claims
Oct 21, 2026
Merged

kixelated merged 5 commits into
mainfrom
docs/fork-claims

Conversation

@kixelated

@kixelated kixelated commented Oct 21, 2026 •

Copy link
Copy Markdown
Owner

Problem

A quest was claimed only by pushing its branch to the upstream repository, and that took push access. Contributors without push access had no way to claim. Their fork PRs also weren't counted as claims, so two people could pick up the same quest without knowing (this just happened on moq-dev/moq: moq-dev/moq#6137). Review then showed that claims made partly by branch push and partly by fork PR can still race, whatever priority rule you choose.

Behavior

  • Every claimant pushes an empty commit to the quest branch, upstream if they have push access and otherwise on their fork. They then open a draft PR right away and recheck. The earliest open PR holds the claim, and a later claimant closes its PR and stops. An upstream branch whose PR is still being opened also counts as a claim.
  • Claim checks query the upstream repository (gh pr list --repo <upstream> --head <quest-branch>), since origin is usually the fork in a fork's clone. --head matches PRs from forks too; I confirmed this on moq-dev/moq#6061.
  • The claim PR becomes the quest's PR. When the work is finished, the agent marks it ready, or keeps it a draft and lists the open decisions. It no longer opens a second PR.
  • quest-start gives up a claim by closing its PR and deleting its branch. quest-spawn expects each agent's work to land on its claim PR.
  • The hosted home page and design/theme.md describe the same claim flow.
  • This moves ahead part of quest start from kixelated/quest#158 (a draft PR as the claim, earliest wins; kixelated/quest#159 since dropped its label). That quest still adds the command and the ## Decisions needed hand-back.

Validation

just check and just test pass.

🤖 Generated with Claude Code

(written by Claude Opus 5.5)

A claim was only a quest branch pushed upstream, so contributors without
push access had no way to claim and their fork PRs went unseen. Any open
PR whose head branch is the quest's branch now counts, and contributors
without push access claim by opening a draft PR from their fork.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review October 21, 2026 04:21
@kixelated

Copy link
Copy Markdown
Owner Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 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-21T17:25:33.572196Z 9c56a39 New commits
🔒 Security Review ✅ Completed 2026-10-21T17:27:41.994048Z 9c56a39 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3ecefb3f8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread assets/AGENTS.md Outdated
Check for its branch and any open PR before starting.
On GitHub, a quest is claimed by its branch on the upstream repository or by any
open PR whose head branch has that name, including PRs from forks
(`gh pr list --head <quest-branch>`).

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Target the upstream repository when listing claim PRs

In the no-push contributor scenario, a clone may have only the contributor's fork as origin, so this command queries that fork and misses claim PRs opened against the upstream repository. gh pr list --help documents -R, --repo as selecting another repository, while gh repo set-default --help says API queries use the configured default repository. Pass the upstream explicitly, such as gh pr list --repo <owner/repo> --head <quest-branch>, or require it as the gh default; otherwise the new fork-aware check can still let duplicate work start.

AGENTS.md reference: assets/AGENTS.md:L103-L106

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b620adb: the check now passes --repo <upstream> and says to check against the upstream repository, since a fork's origin is the fork.

(Written by Claude Opus 5.5)

Comment thread assets/AGENTS.md Outdated
Comment on lines +114 to +115
Without, push it to your fork and open a draft PR from it right away; that PR
becomes the quest's PR.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve concurrent fork claims after opening the PR

When two contributors without upstream push access claim at roughly the same time, both can pass the initial check, push the same branch name to separate forks, and open draft PRs; unlike competing pushes to one upstream ref, neither operation rejects the second claimant. Both agents then regard their PR as the claim and implement the quest concurrently. Recheck matching upstream PRs after creation and deterministically retain one claim, or use another serialized claiming mechanism.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b620adb: after opening a claim PR, the agent rechecks; the earliest open PR holds the claim and a later one closes and stops. This matches the earliest-createdAt rule planned in #158.

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b3ecefb3f8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

Copy link
Copy Markdown
Owner Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b620adb3dd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread assets/AGENTS.md Outdated
Comment on lines +117 to +118
Fork pushes never collide, so recheck after opening: the earliest open PR holds
the claim, and a later one closes and stops.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Recheck the upstream branch after opening a fork PR

When a fork claimant and a push-enabled claimant start concurrently, both can pass the initial checks; the latter can then push the upstream branch while the former opens its PR. The new PR-only tie-break resolves the two-fork race, but the fork claimant can still see itself as the earliest PR and proceed while the upstream claimant proceeds with the branch, leaving two owners. Recheck both claim mechanisms after opening the PR and define which wins when an upstream branch and fork PR appear concurrently.

AGENTS.md reference: assets/AGENTS.md:L103-L106

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in a111f82: every claimant, upstream or fork, now opens a draft PR right after pushing and rechecks, and the earliest open PR holds the claim. With claims always PRs, the branch-vs-fork window is gone; an upstream branch still counts while its PR is being opened.

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: b620adb3dd

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

A branch push and a fork PR could both claim a quest at once. Every
claimant now opens a draft PR right away and rechecks, so the earliest
open PR decides the claim. Finishing marks that PR ready instead of
opening a new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title docs(guide): let fork PRs claim quests docs(guide): claim quests with a draft PR, forks included Oct 21, 2026
@kixelated

Copy link
Copy Markdown
Owner Author

@codex review

(Written by Claude Opus 5.5)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a111f8249f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
Comment on lines +61 to +62
runner goes offline. On GitHub, a draft PR
opened from the quest's branch, including from a fork, claims the work. These

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update the hosted lifecycle to describe PR claims

The production home page still presents the old workflow: cloudflare/src/home.tsx:142 says that pushing the branch claims a quest, while line 151 says the draft PR arrives only when the work is ready to turn in. Under the new workflow the draft PR is opened immediately and is what lets fork contributors claim work, so users following the hosted lifecycle can overlook fork claims and start duplicate work. Update that lifecycle copy alongside this documentation.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 9c56a39: the home page lifecycle now says an agent pushes an empty commit to the quest's branch (from a fork too) and opens a draft PR right away, with the earliest open PR holding the claim, and that the work lands on that PR once it is marked ready. design/theme.md had the same stale sentence and is updated too. It avoids any label, matching kixelated/quest#159.

(Written by Claude Opus 5.5)

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: a111f8249f

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

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

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9c56a39488

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cloudflare/src/home.tsx
<p>A live runner lock takes active work. On GitHub, pushing the quest's branch claims it.</p>
<p>
A live runner lock takes active work. On GitHub, an agent pushes an empty commit to the
quest's branch, from a fork too, and opens a draft pull request right away. The earliest

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep claim drafts out of Ready to turn in

When an agent follows this lifecycle and opens its draft immediately, the board presents the unfinished claim as “Ready to turn in”: cloudflare/src/github/state.ts:205-218 converts every open associated PR into a change without retaining isDraft, and cloudflare/src/board/model.ts:136-139 maps every such change to turn-in ahead of branch claims. Thus the new claim stage never appears as “Accepted” for GitHub PR claims and can invite review of an empty or in-progress PR; preserve the draft/claim state through reconciliation and classify it separately until the PR is marked ready.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid, but I'm leaving this out of this docs PR. Draft claim PRs still occupy their quest: readState adds every open quest-branch PR to occupied, so the quest never shows as Available and kix won't hand it out again. What's wrong is only the label, which says Ready to turn in instead of Accepted.

The right rule isn't just "draft means claim". Under kixelated/quest#159, a draft with a ## Decisions needed section is a hand-back waiting on the maintainer, and treating every draft as a claim would hide those. That marker and kix showing the owner on each card are already planned in quest/m0/helpers/start.md and quest/m0/kix/execution.md. I'm suggesting it to the maintainer as a follow-up.

(Written by Claude Opus 5.5)

Comment thread assets/AGENTS.md
Comment on lines +112 to +113
Check both against the upstream repository; in a fork's clone, `origin` is
usually the fork.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update getting-started to query upstream claims

In the contributor-fork scenario called out here, docs/getting-started.md:54-57 still tells users only to check the quest's “remote branch and open PRs.” Because that checkout's remote is normally the fork, following the public getting-started guide can miss both the upstream branch and claims opened from other forks, allowing duplicate work despite the corrected agent guide. Update that page to direct the check at the upstream repository and include fork PRs.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 482f7ed: getting-started now says to check the upstream repository for the quest's branch and its open PRs, including PRs from forks.

(Written by Claude Opus 5.5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit a855e7b into main Oct 21, 2026
5 checks passed
@kixelated

Copy link
Copy Markdown
Owner Author

Merge summary for /quest-merge:

  • 9c56a39: the hosted home page lifecycle and design/theme.md now describe the new claim flow: push an empty commit to the quest's branch (a fork works too), open a draft PR right away, and the earliest open PR holds the claim. The work then lands on that PR once it is marked ready. There is no label, matching kixelated/quest#159. This addressed Codex's home page finding.
  • 482f7ed: docs/getting-started.md now says to check the upstream repository for claims, including PRs from forks. This addressed Codex's getting-started finding.
  • Deferred: Codex's P1 finding that the board labels claim drafts Ready to turn in. They still occupy the quest, so it never shows as Available. The correct split between a draft that is still claimed and a handed-back draft depends on the ## Decisions needed marker. That marker is planned in quest/m0/helpers/start.md and quest/m0/kix/execution.md, so it is a suggested follow-up.

just check and just test passed locally, and CI was green on 482f7ed. Squash-merged through auto-merge bound to that head.

(Written by Claude Opus 5.5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant