-
-
Notifications
You must be signed in to change notification settings - Fork 94
docs(agents): the contributor check and the session check are different #3049
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -174,11 +174,77 @@ report that you bounded it. Mutate the halves separately; they fail differently | |
| Before touching an issue: | ||
|
|
||
| 1. `gh issue view <n> --json assignees,title` — **if someone else is assigned, it is theirs.** See "Helping on someone else's issue" below for the two ways that changes. | ||
| 2. `gh pr list --search "<n>"` — an open PR referencing the issue is a claim even when nobody is assigned. | ||
| 2. Look for an open PR on it. `gh pr list --search "<n>"` is a TEXT search: it | ||
| matches comment bodies, so it both misses linked PRs that never mention the | ||
| number and returns unrelated ones that happen to contain it. Treat a hit as a | ||
| reason to look, not as an answer, and confirm by opening the PR. The linked-PR | ||
| list on the issue page is authoritative where the two disagree. | ||
| 3. If both are clear, `gh issue edit <n> --add-assignee <you>` **before** writing code, not when you open the PR. An assignment made at PR time claims nothing; the window it needed to cover has already closed. | ||
|
|
||
| Check again immediately before opening the PR. A claim can appear while you work, and the second check is the cheap one. | ||
|
|
||
| ### Every agent is the same GitHub account | ||
|
|
||
| `gh issue edit --add-assignee` cannot tell two agents apart, because they all | ||
| push and assign as the **same account**. An issue assigned to that account | ||
| means *somebody has claimed this*. It does **not** mean *you* claimed it, and | ||
| you cannot tell which from the assignee field. | ||
|
|
||
| So an assignment to your own account is a claim by someone else until you can | ||
| show otherwise. **Leave a claim comment as well**, naming the session, so the | ||
| next agent can tell: | ||
|
|
||
| gh issue comment <n> --body "Claiming this. Session <id>, branch <name>." | ||
|
|
||
| And when you find the account already assigned with no claim comment, ask on | ||
| the issue before starting rather than reading the field as your own. | ||
|
|
||
| Note this is about OUR sessions only. An outside contributor has their own | ||
| account, so the field says what it looks like it says for them. | ||
|
|
||
| ### The contributor check and the session check are different checks | ||
|
|
||
| Doing one does not do the other, and the assignee field cannot cover both. | ||
|
|
||
| On #3012 the account was self-assigned at 14:12:52 and a PR for the same issue | ||
| appeared 47 minutes later. The natural reading was another session ignoring the | ||
| claim. It was not: **the PR came from an outside contributor**, who has no | ||
| reason to know or care about an internal assignment, and for whom the repo's | ||
| existing rules already apply (look for their PR before starting, external work | ||
| takes precedence, never push to their branch). | ||
|
|
||
| The session that self-assigned never ran `gh pr list --search 3012`. No | ||
| assignee field, however precise about sessions, would have helped: **no session | ||
| held it.** Only the PR search would have. | ||
|
|
||
| So run both, every time: | ||
|
|
||
| gh issue view <n> --json assignees # is one of us on it | ||
| gh pr list --search "<n>" # is anyone at all on it | ||
|
|
||
| ### When you collide mid-flight | ||
|
|
||
| The checks above cover noticing **before** you start and noticing **after** you | ||
| finish. The expensive case is neither: **both of you are already half-built when | ||
| the claim appears.** Both have sunk work, both can reasonably feel they should | ||
| be the one to finish, and the race is usually settled by whoever opens a PR | ||
| first, which rewards speed over ownership. | ||
|
|
||
| **The session named in the earliest claim comment decides. The other stops | ||
| immediately** rather than racing to open first, and hands over what it has as a | ||
| comment or a patch on that session's PR. | ||
|
|
||
| "The assignee decides" is not usable here, because the assignee field holds one | ||
| shared account and cannot name a session. The claim comment can, which is the | ||
| other half of why it is required above. If no claim comment exists, ask on the | ||
| issue rather than inferring from the field. | ||
|
|
||
| An outside contributor's PR still takes precedence over any internal claim, | ||
| however early. They cannot see our claims and are not bound by them. | ||
|
Comment on lines
+233
to
+243
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Pause and refresh ownership state during a mid-flight collision. When no claim comment exists, the guidance only says to ask on the issue. It does not require either session to stop while ownership is unresolved. Both sessions can continue and open competing pull requests. At collision time, rerun the contributor check and inspect the linked pull request author. If no outside contributor pull request exists and no claim comment exists, require both sessions to pause until ownership is resolved. 🤖 Prompt for AI Agents |
||
|
|
||
| Stopping mid-build is cheap. Two finished implementations of the same thing is | ||
| not, and neither is the conversation about which one lands. | ||
|
|
||
| ### Helping on someone else's issue | ||
|
|
||
| Helping is welcome. **Taking over is not.** Two things make it help: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: LTplus-AG/ifc-lite
Length of output: 198
🏁 Script executed:
Repository: LTplus-AG/ifc-lite
Length of output: 8751
🏁 Script executed:
Repository: LTplus-AG/ifc-lite
Length of output: 3524
🏁 Script executed:
Repository: LTplus-AG/ifc-lite
Length of output: 8704
Add an explicit linked-PR check to the repeated procedure.
gh issue view <n> --json assigneesand the defaultgh issue view <n>output do not list open linked pull requests.gh pr list --search "<n>"performs a text search and can miss linked pull requests without a textual reference. Require inspection of the issue page or its linked pull requests before treating the contributor check as clear.🧰 Tools
🪛 markdownlint-cli2 (0.23.2)
[warning] 222-222: Code block style
Expected: fenced; Actual: indented
(MD046, code-block-style)
🤖 Prompt for AI Agents