ci: validate pull request coordination claims #221
Open
github-bot
wants to merge 53 commits from
github-bot/gh-221 into main
AGit
pull from: github-bot/gh-221
merge into: github:main
github:main
github:port/d3d12-nvidia
github:docs/animation-merge-remnants
github:docs/story-dedup-and-cli
github:docs/restofworld-merge-remnants
github:docs/gamedata-dedup-tables
github:docs/textures-bcpack-tables-and-cli
github:docs/exe-fail-fast-shims-sync
github:fix/address-guard-wraparound-parity
github:fix/cvt-f16-denorm-and-clamp
github:docs/pso-cache-scope-note
github:docs/viewer-readme
github:docs/textures-arrays-dds-preview
github:docs/conformance-readme-status
github:fix/docs-validators-fences-urls
github:claude/loop-total
github:claude/pops-collision-seed
github:claude/dstorage-hold-page-reads
github:claude/host-image-copy-switch
github:feat/gdk-lifecycle-window-hook
github:claude/d16s8-uav-nvidia-fallback
github:feat/mfplat-offline-shim
github:claude/gameinput-slow-reader
github:fix/rt-null-barrier-clear
github:claude/depth-resolve-sample-positions
github:integration/palmetto-parity
github:claude/valu-literal-sext
github:claude/slot74-pool-handle
github:claude/rgb9e5-uint-alias-view
github:claude/fssm-root-layout-tables
github:feat/gdk-speech-display-lifecycle
github:asset-audio-skip-current
github:qemmhd/old-9940-rectangle-quad-lists
github:feat/ws2-offline-shim
github:qemmhd/rt-d16-unorm-uav
github:feat/xs-device-stops-7-9
github:qemmhd/rt-depth-same-base-shapes
github:qemmhd/rt-lazy-attachment-variant
github:feat/acphal-xma2-decoder
github:asset-audio-skip
github:codex/coord-claim-check-20261124-7e48
github:feat/xs-frame-pacing-presentx
github:feat/xs-device-vm-options
github:old-pr/9844
github:old-pr/9978
github:old-pr/9815
github:old-pr/10057
github:old-pr/9874
github:old-pr/9965
github:old-pr/9863
github:old-pr/10068
github:old-pr/10066
github:old-pr/10067
github:old-pr/10007
github:old-pr/10061
github:old-pr/10065
github:old-pr/10059
github:old-pr/10063
github:old-pr/10055
github:old-pr/10062
github:old-pr/10042
github:old-pr/10041
github:old-pr/10049
github:old-pr/10047
github:old-pr/10046
github:old-pr/10045
github:old-pr/10056
github:old-pr/10043
github:old-pr/10036
github:old-pr/10034
github:old-pr/9984
github:old-pr/10052
github:old-pr/10038
github:old-pr/10033
github:old-pr/10028
github:old-pr/10050
github:old-pr/9891
github:old-pr/9889
github:old-pr/10051
github:old-pr/10019
github:old-pr/10027
github:old-pr/10029
github:old-pr/10031
github:old-pr/10026
github:old-pr/9941
github:old-pr/10030
github:old-pr/10040
github:old-pr/9990
github:old-pr/10021
github:old-pr/9962
github:old-pr/10022
github:old-pr/10020
github:old-pr/10015
github:old-pr/10025
github:old-pr/9886
github:old-pr/10048
github:old-pr/10014
github:old-pr/10011
github:old-pr/9861
github:old-pr/10010
github:old-pr/10008
github:old-pr/9860
github:old-pr/10006
github:old-pr/9920
github:old-pr/9995
github:old-pr/10000
github:old-pr/10016
github:old-pr/10004
github:old-pr/10023
github:old-pr/9982
github:old-pr/9981
github:old-pr/9983
github:old-pr/9970
github:old-pr/9969
github:old-pr/9968
github:old-pr/9971
github:old-pr/9972
github:old-pr/9942
github:old-pr/9963
github:old-pr/9960
github:old-pr/9964
github:old-pr/9985
github:old-pr/9973
github:old-pr/9862
github:old-pr/9953
github:old-pr/10017
github:old-pr/9952
github:old-pr/9955
github:old-pr/9946
github:old-pr/9954
github:old-pr/9938
github:old-pr/9956
github:old-pr/9856
github:old-pr/9947
github:old-pr/9924
github:old-pr/9961
github:old-pr/9927
github:old-pr/9979
github:old-pr/10032
github:old-pr/9926
github:old-pr/5237
github:old-pr/9951
github:old-pr/9931
github:old-pr/9902
github:old-pr/9921
github:old-pr/9994
github:old-pr/9775
github:old-pr/9768
github:old-pr/9905
github:old-pr/9936
github:old-pr/9901
github:old-pr/9904
github:old-pr/9906
github:old-pr/9988
github:old-pr/9908
github:old-pr/9909
github:old-pr/9911
github:old-pr/9912
github:old-pr/9913
github:old-pr/9887
github:old-pr/9916
github:old-pr/9919
github:old-pr/9925
github:old-pr/9933
github:old-pr/9935
github:old-pr/9918
github:old-pr/9879
github:old-pr/9880
github:old-pr/9881
github:old-pr/9996
github:old-pr/9876
github:old-pr/9892
github:old-pr/9899
github:old-pr/9915
github:old-pr/9914
github:old-pr/9872
github:old-pr/9869
github:old-pr/9866
github:old-pr/9819
github:old-pr/10012
github:old-pr/9857
github:old-pr/9893
github:old-pr/9897
github:old-pr/9928
github:old-pr/9868
github:old-pr/9917
github:old-pr/9940
github:old-pr/9873
github:old-pr/9816
github:old-pr/10009
github:old-pr/9900
github:old-pr/9966
github:old-pr/9859
github:old-pr/9843
github:old-pr/9991
github:old-pr/10058
github:old-pr/9883
github:old-pr/9838
github:old-pr/9835
github:old-pr/9959
github:old-pr/9895
github:old-pr/9837
github:old-pr/9858
github:old-pr/9865
github:old-pr/9864
github:old-pr/9840
github:old-pr/9820
github:old-pr/4669
github:old-pr/9848
github:old-pr/9850
github:old-pr/9810
github:old-pr/9799
github:old-pr/9853
github:old-pr/9875
github:old-pr/9831
github:old-pr/9796
github:old-pr/9801
github:old-pr/9813
github:old-pr/9794
github:old-pr/7417
github:old-pr/9781
github:old-pr/9806
github:old-pr/9958
github:old-pr/9809
github:old-pr/9791
github:old-pr/9792
github:old-pr/10053
github:old-pr/9784
github:old-pr/9789
github:old-pr/9849
github:old-pr/9846
github:old-pr/9773
github:old-pr/9785
github:old-pr/9803
github:old-pr/9826
github:old-pr/9839
github:old-pr/9922
github:old-pr/9948
github:old-pr/7189
github:old-pr/9957
github:old-pr/9823
github:old-pr/9807
github:old-pr/9851
github:old-pr/9774
github:old-pr/9830
github:old-pr/9836
github:old-pr/9822
github:old-pr/9783
github:old-pr/9833
github:old-pr/9890
github:old-pr/9770
github:old-pr/9769
github:old-pr/9772
github:old-pr/9787
github:old-pr/9852
github:old-pr/9834
github:old-pr/9845
github:old-pr/9871
github:old-pr/9771
github:old-pr/9776
github:old-pr/10005
github:old-pr/9949
github:old-pr/9923
github:old-pr/9805
github:old-pr/9829
github:old-pr/9790
github:old-pr/9827
github:old-pr/9929
github:old-pr/9855
github:old-pr/9934
github:old-pr/9907
github:old-pr/9910
github:old-pr/9779
github:old-pr/9780
github:old-pr/9885
github:old-pr/9882
github:old-pr/9877
github:old-pr/9998
github:old-pr/4251
github:old-pr/9987
github:old-pr/9989
github:old-pr/9950
github:old-pr/9777
github:old-pr/10044
github:old-pr/9884
github:old-pr/2906
github:old-pr/5076
github:old-pr/9937
github:old-pr/9986
github:old-pr/3014
github:old-pr/9943
github:old-pr/9939
github:old-pr/4682
github:old-pr/4765
No reviewers
Labels
Clear labels
accessibility
Barrier affecting people with disabilities
bug
Something isn't working
documentation
Improvements or additions to documentation
duplicate
This issue or pull request already exists
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
invalid
This doesn't seem right
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
question
Further information is requested
wontfix
This will not be worked on
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!221
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-221"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Andretuta on GitHub · 2026-11-24 02:47 UTC · original
ubiquitarianism:codex/coord-claim-check-20261124-7e48→main· +2052 −0 · 2 files · 53 commits · draftClaimed in the coordination issue as: COORD-CLAIM-CHECK
Summary
Claimed in the coordination issue as:field. IDs from both locations are combined; only IDs in issue #14's Open work table are valid.claiming:; reject malformed partial lists.main, including when a PR opens, changes commits or base, or closes. Queue automatic status reconciliation and audit all open PR heads hourly; manual per-PR refresh remains available.coordination-claimon current PR heads, independent of workflow rerun age or attempt limits. This is an eventually consistent diagnostic and must not be the sole required merge check because claim data lives in issue #14. Strict enforcement requires an authorized merge flow to revalidate claims immediately before merging. The Actions jobcoordination-claim-validatoris also diagnostic.gh workflow run coordination-activity.yml -f pr_number=<N>.Security and scope
The claim validator is read-only. The activity workflow has issue-comment and commit-status write permissions so it can update its own marked comment and publish the current status for PR heads. Neither workflow checks out or executes pull-request code.
Local verification: both workflow YAML files parsed, all three embedded Python scripts compiled, and 42 focused checks passed for claim parsing, PR field extraction, and comment targeting. GitHub Actions execution still needs confirmation.
@QemmHD on GitHub · 2026-11-24 05:28 UTC · original
Checked at
fe9588f. Good news first: there's no injection or pwn-request path. Nothing from the event is interpolated intorun:, the heredocs are quoted (<<'PY'), there's no checkout and nouses:, permissions start at{}and are scoped per job, andworkflow_runonly reads event metadata. Two things should be fixed before this merges, because any GitHub user can trigger them:CLAIM_FIELD_RE(coordination-activity.yml:71-73, the copy at:604, andcoordination-claim.yml:40) is(?im)^\s*>?\s*Claimed…and runs over every open PR body.\salso matches newlines, so the two\s*backtrack against each other on whitespace-heavy bodies; one PR body full of blank lines can keep every activity run busy until its timeout. The bullet regex used on #14 comments has the same shape. Using[ \t]*instead of\s*there, and capping the length of what's scanned, removes it. (Found by reading the code; not measured.)issue_comment(created, edited, deleted) has noauthor_associationfilter, and a deleted comment with no IDs re-targets every open PR (:324,:857), which costs ~360+ REST calls per run against the repo's shared 1 000 / hourGITHUB_TOKENbudget. A few create/delete cycles by anyone would starve the other workflows. Filtering onauthor_association(or rate-limiting the "all PRs" path) closes it.Minor: the roster comment may approach GitHub's 65 536-character limit as the PR count grows, and nearly every PR would show a failed
coordination-claimstatus, which is a policy call for the owner.Security review; read only, nothing run.
AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@QemmHD on GitHub · 2026-11-24 05:39 UTC · original · requested changes
Requesting changes for the two issues anyone on GitHub can trigger (details in my comment above): the backtracking in
CLAIM_FIELD_REand the bullet regex (use[ \t]*and cap input), and the unfilteredissue_commentpath where a deleted comment re-targets every PR and drains the shared GITHUB_TOKEN budget (add anauthor_associationfilter). No injection or pwn-request path. Happy to re-review once those are in.AI-assisted (Claude Code, Claude Opus 5.5).
Discord: bigpeppa.
@GrahamboJangles on GitHub · 2026-11-24 10:45 UTC · original
Reviewed head
ade227657e863b19765d64f1d3076e32dcb78a62(PR last updated 2026-11-24T07:17:45Z). CPU-only review: I extracted the three embedded Python blocks straight from this head's diff, ran them as-is against live repo data fetched at 10:19Z — every number below is measured, not estimated. No GPU, no game files, nothing merged.What ran, and the harness: the parser/evaluator functions (
ids_from_claim_comment,open_work_ids,claim_fields,pull_claim_ids,evaluate_claim) were cut from the diff at the first network call and imported unchanged. Only approximation: GraphQLlastEditedAtwas fed from REST data — the REST comments payload has no edited_at field, so all 650 comments were treated as unedited (_last_edited_at = None), which matches every comment I sampled.Coordination compliance:
COORD-CLAIM-CHECKis in the Open work table, claim comment 7120227654 by Andretuta created 02:31:27Z, unchanged (updated_at == created_at), predates the PR → the evaluator returnsclaimed, and the PR's owncoordination-claim-validatorcheck passes (8s) on this head. CI here: validator,no-game-data,change-scope,jactionlintall pass; several jobs pending, none failing.Finding 1 — title-ID scan creates phantom work items (measured bug).
pull_claim_idsunionsids_from_text(title), butID_PATTERNmatches any uppercase hyphenated token, including ordinary technical prose. Live sweep over all 487 open PRs: 79 declare phantom IDs from their titles —SHA-256in #616,UTF-8in #483,78-81in #553/#512,FUZZ-8in #630. Minimal counterexample, same evaluator and data: PR #616 evaluatesinvalid(candidates{EXE-SHA-VALIDATE, SHA-256}); delete only theSHA-256token from the title and it evaluatesclaimedfor hamdog0203 via unchanged claim comment 7128088818 (09:56:11Z < PR opened 10:00:03Z). So after the merge, #616-style PRs fail withUnknown work-item IDs: SHA-256and no path forward. Suggest the title scan keep only tokens that are inallowed_ids, or already present inclaims_by_id— or scan just a trailing parenthesized ID segment.Finding 2 — the table gate and the stale table interact badly at ship time (measured).
allowed_idscomes solely from the Open work table, which currently holds exactly 3 IDs (COORD-CLAIM-CHECK,SHADER-1264,TEST-ATOMIC-GUARD), while issue #14 comments hold 650 comments with 240 parseable claims and 274 distinct claimed IDs. Evaluating all 487 open PRs live: 1 claimed, 271 invalid, 215 needs-claim — the 271 invalids fail on exactly one cause,candidates - allowed_ids(their claim comments are unchanged and author-matched). As merged, the roster and thecoordination-claimcommit status stamp ~271 open PR heads red on the first hourly audit.invalidalso conflates "ID not in the Open work table" with "claim malformed/ownership mismatch", and the roster renders both asNeeds claim. Not a correctness bug — the body already scopes the status as diagnostic — but a distinct state (e.g.claim-ok-unlisted) would let the table-refresh work tracked asCOORD-TABLE-REFRESHconverge instead of the status noise reading as broken claims.Finding 3 — two ~750-line copies of the same script already drift. difflib across the reconcile-job and sync-job blocks in
coordination-activity.yml: 3 differing blocks. (a) the sync copy carries an extra unreachablestop("GitHub GraphQL retry loop ended unexpectedly.")that the reconcile copy lacks; (b/c, more serious) thepull_request_targetbranch ofstatus_target_pullsexists in two versions — sync has the pre-"recompute all heads" form (base-ref guard without theeditedcarve-out, plus the closed-PR head-sha filter) while reconcile has the current recompute-all form. Sync's copy is dead today (publish_claim_statusesis unreachable inCOORDINATION_MODE: sync), so nothing is broken now — but this is a copy-paste maintenance trap of 1,500 lines that has already diverged at its first fix. One script file in-repo (e.g..github/scripts/coordination_activity.py, invoked aspython3 .github/scripts/coordination_activity.pyby both jobs — trusted base content, no PR-code checkout, so security is unchanged) collapses this to a single copy.Finding 4 — keyword strictness misreports good-faith claims. The
claiming:regex is exact and case-insensitive; tahffo68hk-hash's claim on this very item family was posted asclaim: VK-XDXR-POSTBUILD-READBACK-STAGE(09:56:39Z) and parses to nothing — so #615 evaluatesinvalidwith the messageNo unchanged claim for VK-XDXR-POSTBUILD-READBACK-STAGE, despite a well-formed claim in the wrong keyword. The enforcement direction is right (protocol isclaiming:); suggest the fail message quote the required keyword (expected a line starting 'claiming:').Cost scaling (measured inputs, projected behavior): both jobs subscribe to every non-bot comment on #14, every issue edit, every PR lifecycle event, and schedules (sync 5x/hour, reconcile hourly at :17). Each run paginates all comments (650 → 7 pages), all open PRs (487 → 5 pages), plus GraphQL edit-metadata batches over all claim comments (240 → 3 queries) ≈ 15+ requests per run. The #14 feed is running ~15 comments/30min (measured 09:30Z–10:01Z) and PR events are heavy; per-event full re-sync is O(events × collection size). Fine on today's numbers with the concurrency queue serializing, but a targeted refresh path (the code already computes per-PR targets in
status_target_pulls) would keep costs flat for the reconcile job — the roster sync is the only piece that genuinely needs the whole collection.Security checked: no PR code executes anywhere —
pull_request_targetruns without checkout and the claim validator uses plainpull_request; permissions are per-job minimal (statuses: writeonly in reconcile,issues: writeonly in sync, and sync edits only its own marker-bounded bot comment, with duplicate-marker and 64 KiB guards); the validator re-checks the head SHA against the event and fails closed on drift. Read-only against claims. No new measurements of my own claimed anywhere in this review.One-line summary: sound security model and single-PR behavior (self-verifies
claimed), but merge as-is after Finding 1's title-token filter lands and the Open work table gets refreshed, or ~271 open PRs get stamped red by the first audit.@adrianmjim on GitHub · 2026-11-24 15:56 UTC · original
Security review of the two workflows at
ade227657(read-only: I read the diff and pulled live counts through the API, nothing was run).Safe: no pwn-request and no injection. Neither workflow checks out or runs PR code. There are no
uses:steps at all. The only${{ }}isgithub.tokeninenv:. The heredoc is quoted, and event data is read fromGITHUB_EVENT_PATHinside Python. There is no subprocess, eval or exec. The permissions are close to least privilege:{}at the top level,statuses: writefor reconcile,issues: writefor sync. Claims can't be spoofed: the owner must be the comment author, the claim must predate the PR, and it must not have been edited. The bot only PATCHes its own marked comment. I found no ReDoS in the claim regexes.What I would fix before merging:
1. API amplification exhausts the repo's
GITHUB_TOKENquota (high, availability).pull_request_targetevent recomputes all open PRs (status_target_pulls, L579-587). That means oneGET /commits/{sha}/statusper head, plus POSTs.pull_request_target, then reconcile and sync again viaworkflow_run. The sync job'sifhas noworkflow_runfilter.GITHUB_TOKENgets 1,000 requests per hour. The hourly reconcile at17 * * * *costs about 673 calls.conflict-label.ymlruns at the same minute and makes one call per open PR. Together they exceed the limit before any user activity.Claiming:comment works too, sincechanged_claim_idscounts the old and new body.cancel-in-progress: falsewithqueue: maxlets the backlog grow without bound. Oldsuccessstatuses stay in place while reconcile fails.Suggested fixes:
pull_request_target, target only the event PR'shead.sha/before, or drop that trigger from reconcile, since theworkflow_runpath already targets one SHA.workflow_run.:17.2. The roster comment can't be posted at today's size (medium). The 65,536-character guard (L785-798) stops every sync run. Rendering the 656 open PRs with
safe_cellproduces about 125k characters, so no comment is ever created. Options: summarize (counts, plus only the "needs claim" rows), split it over several managed comments, or write the full table to the job summary.3. Invisible claims block any ID (medium, abuse).
ids_from_claim_comment(L324, and its copies at L1097 and L1866) parses the raw body. It doesn't strip HTML comments or fenced code blocks, whileclaim_fields(L414) does.<!--\nClaiming: SHADER-1264, ...\n-->renders as nothing. It makes every later PR for those IDs fail with "multiple owners", including the legitimate claimant's PR.Lower:
refs/pull/N/headand open an unclaimed PR to turn the victim's status red. This fails closed, never into a forged success.safe_celldoesn't neutralize#N/owner/repo#N/ bare URLs in titles, so the bot comment creates cross-reference entries.&isn't escaped either. A code span or a U+200B after@/#would cover both.status_target_pullsL579 vs L1352). Moving them totools/would fix that, run from a default-branch checkout withpersist-credentials: falseandpython3 -I, asconflict-label.ymlalready does.UTF-8andSHA-256, so expect most PRs to show failure at rollout.coordination-claim-validatorruns the fork's own copy, so like the PR text says, it can't be a required check.AI-assisted (Claude Code): review by a read-only agent, finding 3 re-checked by hand against the diff.
@QemmHD on GitHub · 2026-11-24 16:08 UTC · original
Re-check of my CHANGES_REQUESTED at head
ade227657:^[ \t]{0,128}claiming:[ \t]{0,128}([^\r\n]{0,4096})$, bodies are capped at 65,536 characters, and the ID patterns are linear. I timedWORK_ID_RE,ID_LIST_REand the claim-line regex on adversarial 60k-character inputs (longA-A-A-…runs,A-1,lists with a bad tail, tab and space floods, comma floods). The worst case was 4.5 ms. That matches adrianmjim's finding of no ReDoS.reconcile-claimsstill runs for anyissue_commenton #14 (created, edited or deleted) from any account except the bot. There's noauthor_associationfilter (coordination-activity.yml:31-38). adrianmjim's comment above measures the bigger version of the same problem: everypull_request_targetevent recomputes all ~656 open PRs, so one title edit costs about 745 REST calls against a 1,000/hourGITHUB_TOKENquota. The hourly:17reconcile plusconflict-label.ymlat the same minute already go over it. I agree with his fixes: on PR events, target only the event's head SHA; skip sync onworkflow_run; read statuses in bulk with GraphQL; stop on the first 403/429; move the cron off:17.So my request for changes stands on point 2 only. Point 3 of his review (hidden
<!-- claiming: … -->claims that block an ID) is also worth fixing before this goes live.AI-assisted (Claude Code, Claude Opus 5.5).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.