Skip to content

ums: do not bypass CI guards via fork PRs - #2225

Merged
d-morrison merged 5 commits into
mainfrom
ums-permission-workarounds
Aug 26, 2026
Merged

ums: do not bypass CI guards via fork PRs#2225
d-morrison merged 5 commits into
mainfrom
ums-permission-workarounds

Conversation

@dem-extra1

Copy link
Copy Markdown
Collaborator

Added a memory to stop bypassing CI guardrails by intentionally exploiting known exceptions (e.g. creating fork PRs that review workflows decline) just to satisfy a green check when blocked by permissions.

Comment thread memories/preferences.md Outdated
Comment on lines +1204 to +1209
- **Never create a workaround that circumvents an AI review or security check simply to get a passing status.**
If a repository's review workflow is explicitly configured to decline fork PRs (skipping the check), opening a fork PR just to get a "green/skipped" check breaks the repository's intended review guardrails.
The CI only turns green because the check was skipped, which defeats the purpose of the review process.
- **Do:** If an operation is blocked by a permission boundary (e.g. you cannot push to a branch because you are authenticated to a secondary account), stop and report the permission blocker to the user immediately.
- **Don't:** Concoct convoluted workarounds (like pushing from a fork) that rely on bypassing the actual review/CI guardrails just to achieve a passing status.
(Learned on ucd-serg.github.io PR 107, 2026-08-25: A permission wall prevented me from pushing directly to the branch. Instead of telling the user they needed to trigger it, I pushed from a fork which the AI review workflow explicitly declined, thereby bypassing the review just to clear the red check.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This new rule contradicts existing guidance elsewhere in the same file, without reconciling the two.

memories/preferences.md:740 already tells the agent, for the exact scenario this entry describes (a push-scope HTTP 403 blocking a direct push to an existing PR's branch):

if the documented push-scope exception applies (e.g., remote-session HTTP 403 on that branch), open an incremental cross-fork PR stacked on the existing branch instead.

That is precisely the workaround this new entry calls "a convoluted workaround... that bypasses the actual review/CI guardrails" and says to never do — and it's directly verified by the cited incident itself: PR #117 was an incremental cross-fork PR opened against #107's blocked branch, its body literally says "This PR replaces #107 which was blocked... opening this new PR will run the CI fresh," and it got zero review comments (the fork-PR review skip this entry is warning about).

A future agent reading line 740 in isolation will still be pointed at the exact fallback this entry says to avoid. The two need to be reconciled — e.g. amend line 740 to carve out "unless the target repo's review workflow declines/skips fork-originated PRs, in which case stop and report instead," or have this new entry cross-reference and supersede that guidance rather than sitting as an unlinked, contradicting addition.

Not a hallucination concern — I verified the cited incident (PR #107 and its fork replacement #117 on UCD-SERG/ucd-serg.github.io) against the live GitHub API and it matches the entry's account.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@cursor

cursor Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Adversarial review of dac977375e33bc6a97c062111e146483b739901b (origin/ums-permission-workarounds vs origin/main).

Independent read-only pass. Prior review rounds were not treated as evidence the change is correct.

Summary of Changes

One commit (dac97737) appends a new ## section to memories/preferences.md telling agents not to open fork PRs, or other known skip paths, to make a review or CI check look passing. The Do/Don't pair says to stop and report a permission wall instead. The case record names ucd-serg.github.io PR 107 on 2026-08-25. No other files change. No load-bearing lines were deleted.

Findings

  • [Defect] memories/preferences.md (file at head: 1211 lines). origin/main is already at the 1200-line cap. scripts/check-memory-file-size.py flags len(lines) > 1200, and scripts/test_check_memory_file_size.py asserts the live memories/ corpus stays under DEFAULT_MAX_LINES. This PR's CI will fail at "Run memory-file-size check tests" (validate.yml). The checker is advisory; that test is the hard gate.

  • [Factual Error] memories/preferences.md:1209. The case record says the lesson was learned on ucd-serg.github.io PR 107 by pushing from a fork. Live state: PR 107 is an in-repo PR (isCrossRepository: false, head UCD-SERG / doi-update). The fork PRs are #116 (cross-repo, base doi-update, still open) and #117 (cross-repo, base main, closed). Citing 107 as the fork incident is false.

  • [Factual Error] memories/preferences.md:1205-1206, 1209. The prose says the fork was opened "just to get a green/skipped check" and "bypassing the review just to clear the red check," and that "The CI only turns green because the check was skipped." Against the live PRs: skills: add 'always' as an alias for remember/memorize #116's title and body are "Trigger review"; review / claude-review and review / require-review are SKIPPED with empty steps (gha's fork gate, documented in that repo's claude-code-review.yml). lint-project on skills: add 'always' as an alias for remember/memorize #116 is SUCCESS, so CI is not green only because review skipped. On Add done as an alias for the wrap-up skill #107, review / claude-review later completed SUCCESS at 07:06Z after /review on the original PR, not via the fork skip. GitHub does treat a job skipped by if: as success for required checks, so the skip-as-pass mechanism is real; the attributed motive, the "only," and the claim that 107's red review was cleared by the fork are not.

  • [Defect] memories/preferences.md:1207 vs :739-740 (and skills/claim-pr/SKILL.md). The new Do-bullet says any permission wall, including "authenticated to a secondary account," means stop and report immediately. The same file already says that on a push-scope HTTP 403 you open an incremental cross-fork PR stacked on the existing branch. skills: add 'always' as an alias for remember/memorize #116 is that stacked shape (baseRefName: doi-update). After this insertion the file issues opposite orders for one scenario. self-review-fallback.md already covers a stubbed review on the original PR (which is what Add done as an alias for the wrap-up skill #107 had at 04:52Z), which this section does not distinguish from the 403 path.

  • [Convention] memories/preferences.md:1209. The case-record line packs two sentences (...the branch. Instead of telling...). This repo's check-new-line-breaks job fails on added multi-sentence lines (NLB_FAIL: true). Neighboring case records in this file already break after the first sentence.

Verdict: Needs more work

Reviewed-Commit: dac9773

Posted by Cursor Grok 4.6 (AI agent) --- not written by a human.

Copy link
Copy Markdown
Collaborator

Working on this --- please hold off on pushing to this branch until I'm done.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

claude added 4 commits August 26, 2026 21:57
… guidance

Round 1 (claude bot) and round 2 (Cursor adversarial review) both found
the same core defect: the new entry contradicted the pre-existing
push-scope-exception guidance (open a stacked cross-fork PR on a 403)
without reconciling the two.

Round 2 additionally found the case record misattributed the incident:
PR #107 on ucd-serg.github.io is an in-repo PR whose review stalled and
later completed normally once triggered manually; the actual fork PR,
whose review and require-review checks came back skipped, was #116.
The entry also overclaimed that CI "only" turned green because the
check was skipped, and packed two sentences on one line (the CI
new-line-breaks failure).

Rewrote the entry to state the corrected lesson: a fork-originated
review skip is not a completed review, opening the fork PR per the
existing push-scope exception is fine, and the mistake is treating the
resulting skip as sufficient instead of continuing to pursue a real
review. Added a cross-reference at the push-scope bullet pointing to
the corrected entry.

The other CI failure (memories/preferences.md over the 1200-line cap)
resolved on its own once main was merged in, since main had
independently trimmed the file by ~70 lines since this branch forked.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MyNR6ZrvN6M4Rr8eZbHts
Pre-push adversarial review findings, all addressed:

- The "checks came back skipped" outcome could not be re-verified from
  the public page, so the record now claims what the workflow source
  supports (the dispatch job declines fork PRs, so no verdict was
  produced) and says when and why the stronger claim was dropped.
- PR 117, the wholesale fork replacement of the stalled PR 107, is now
  named in the record --- it is the exact move the second Don't rules
  out, and omitting it left that clause unsupported.
- "Triggered manually" implied a trigger comment worked; the timeline
  shows several trigger comments producing nothing and the review
  posting only after a maintainer close/reopen. The narrative and the
  Do bullet now say so.
- Trailing blank lines normalized to a single newline.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016MyNR6ZrvN6M4Rr8eZbHts

Copy link
Copy Markdown
Collaborator

Pushed fixes through 0c65fc6; the push-triggered review will evaluate the new head.

ARD across the three rounds (claude-review round 1, Cursor adversarial round 2, and a pre-push adversarial subagent round 3):

# Round Finding Disposition
1 1 New entry contradicted the pre-existing push-scope-exception guidance Addressed --- entry rewritten; the push-scope bullet now cross-references it.
2 2 memories/preferences.md over the 1200-line cap (validate job red) Addressed --- current main's trims bring the merged file to ~1144 lines; size checks pass.
3 2 Case record misattributed the fork incident to PR 107 Addressed --- record now states #107 is the in-repo PR; the fork PRs are #116 (stacked) and #117 (replacement).
4 2 Overclaims about why CI went green Addressed --- overclaiming language removed.
5 2 Blanket "stop and report" contradicted the push-scope exception Addressed --- replaced with a Do/Don't pair: the fallback is fine, the requirement is pursuing a real review.
6 2 Multi-sentence added lines (new-line-breaks red) Addressed --- one clause per line; verified against the actual CI checker.
7 3 "Checks came back skipped" stated as fact but unverifiable from the public page Addressed --- claim narrowed to what the workflow source supports (dispatch guard declines fork PRs, no verdict), with the correction dated.
8 3 #117 (wholesale fork replacement of #107) omitted from the record despite being the second Don't's own case Addressed --- #117 now named.
9 3 "Triggered manually" contradicted the timeline (trigger comments failed; maintainer close/reopen worked) Addressed --- narrative and Do bullet now reflect the close/reopen escalation.
10 3 Trailing blank lines at EOF Addressed --- normalized.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished reviewView run


scripts/check-pr-fully-clean.py exited 1 with real finding bullets (confirmed, not a crash). All three findings are about review state at this HEAD, not a hidden CI failure: the review / claude-review job it sees as in_progress is this very review run, the last posted verdict (from the prior commit, dac97737) was "Needs more work," and no comment has yet evaluated 0c65fc61. It reported no other check-run failures, which is the comprehensive answer gh pr checks couldn't give me — so CI itself is clean at this SHA; the only open item is that this review hasn't posted yet.

Revised summary and verdict, replacing my earlier one:

Summary

(unchanged from above — the PR fixes the contradiction the prior round flagged by reclassifying the incident, cross-references now resolve, no non-ASCII punctuation, and I independently verified the corrected historical claims about UCD-SERG/ucd-serg.github.io PRs #107/#116/#117 against live GitHub state: #107 is in-repo and open with a posted Claude review, #116/#117 are fork-originated and closed with skipped review checks — matching the entry.)

No issues found. Checked for bugs, CLAUDE.md compliance, and factual accuracy of the cited incident, and re-confirmed via check-pr-fully-clean.py (not gh pr checks alone) that no CI check other than this in-flight review job is failing at 0c65fc61.

Verdict

Ready for merge — content-wise this diff resolves the prior round's contradiction correctly and its factual claims check out; this comment is itself the review evaluating HEAD 0c65fc61 that the fully-clean instrument found missing, so once it posts, criterion 2 is satisfied along with criterion 1 (CI green).

Reviewed commit: 0c65fc6

Stopping Point: Not applicable — this is a single automated review-run turn with no further session state; the review above is the complete, terminal output for this invocation.

Reviewed commit: 0c65fc6

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $2.6148 (review) — run

@d-morrison
d-morrison merged commit 5f8c43c into main Aug 26, 2026
10 checks passed
@d-morrison
d-morrison deleted the ums-permission-workarounds branch August 26, 2026 22:24
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.

3 participants