Repository navigation
feat(workflow_audit): WF030 forge mirror without a source-visibility guard - #1072
Conversation
…guard
Owner ruling 2026-11-13 ('add a guard'): a mirror that force-pushes to every
forge whose *_MIRROR_ENABLED variable is true, with no check of the source
repo's visibility, can push a private repo to a public forge copy. WF030
flags that shape (high, action report: a referral, never an autofix).
Static run: flags metadatastician/standards mirror-reusable.yml and
github-backup-mirror-reusable.yml (git push --force, no visibility check);
hypatia, gitbot-fleet and cicd-squabbler workflows are clean.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 2 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Build Test Images fails here, but it fails on The rollups Integration Status and Security Status, plus Rust Dependency Audit (RUSTSEC-2026-0538, quinn-udp), are red on Generated by Claude Code |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
…'s gate The guard regex accepted any bare 'visibility' word, so a comment such as 'TODO: add a visibility check' suppressed the finding. It now needs repository.private/visibility, a per-forge *_MIRROR_PRIVATE_CONFIRMED gate (the shape metadatastician/standards#1513 adds), or an API visibility read. Experiment: standards main mirror-reusable.yml and github-backup-mirror-reusable.yml are flagged; the same files at #1513 are clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
…into claude/mirror-visibility-guard
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bbd09051c3
ℹ️ 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".
…inuations Codex review on #1072: - A condition that SELECTS private sources (if: github.event.repository.private) is no longer a guard; only a negated/compared repository.private, a repository.visibility test, a *_MIRROR_PRIVATE_CONFIRMED gate or an API visibility read count. - Scoped per job: the force push, the *_MIRROR_ENABLED gate and the guard must be in the same job, or the guard in a job it needs. - Shell line continuations are joined, so 'git push \\' + '--force' on the next line is a force push. Experiment: standards main mirror-reusable.yml flags each forge job (6) and github-backup-mirror-reusable.yml; both are clean at standards#1513; hypatia, gitbot-fleet and cicd-squabbler stay clean. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT
…inuations (#1073) ## What A follow-up to #1072, which merged before these fixes. It answers the three Codex findings left open on #1072. - **Blocking guards only (P1).** A condition that *selects* private sources, such as `if: github.event.repository.private`, no longer counts as a guard. Only these do: a negated or compared `repository.private`, a `repository.visibility` test, a per-forge `*_MIRROR_PRIVATE_CONFIRMED` gate (the shape metadatastician/standards#1513 adds), or a visibility read from an API. - **Per job (P2).** The force push, the `*_MIRROR_ENABLED` gate and the guard must be in the same job, or the guard in a job it `needs`. An unrelated gate or `git push --force origin` elsewhere in the file neither creates nor hides a finding. Findings now carry `job` and `line`. - **Line continuations (P1).** Shell `\` continuations are joined, so `git push \` followed by `--force …` on the next line is a force push. YAML comments are stripped per job before matching. ## Experiment - metadatastician/standards `main`: `mirror-reusable.yml` is flagged once per forge job (6), and `github-backup-mirror-reusable.yml` is flagged. - The same two files at standards#1513 (the source fix): clean. - hypatia, gitbot-fleet and cicd-squabbler: clean. ## Tests `test/rules/mirror_visibility_guard_test.exs` adds four cases: a selecting condition still fires; a continued `--force` still fires; a gate and a force push in different jobs don't fire; and a guard job that the mirror job `needs` counts as its guard. 83 tests pass, and `mix format` is clean. --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7ZkGCWGEyedTtdEHAPT)_ Co-authored-by: Claude <[email protected]>
main gained WF030 (#1072, #1073) after this branch was cut. CI checks out the merge of the branch and main, so the staleness check failed: the deed lacked hypatia/workflow_audit/WF030. Regenerated with scripts/gen-rules-praxis.sh after merging main. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_0136P7ZmHbN98VWzhw9EshkN
…test) (#1081) ## Summary Owner ruling R6 (2026-11-13): auto-merge only when all review threads are resolved. Today nothing checks threads, so #1072 and #1073 merged with open bot findings. - New `pr_threads_ready FULL NUM` in `scripts/sweeps/lib/merge-ready.sh`. It reads the PR's review threads through GraphQL (resolution state is not in REST) and is called by `scripts/sweeps/estate-pr-automerge.sh` for every `auto_merge` row at `--execute`, right after `merge_ready`. - Blocks with `unresolved_review_threads:<n>`. Fails closed with `check_unavailable:review_threads` when the answer is unreadable or there are more than 100 threads. - `docs/operations/estate-automerge.adoc`: the execute-time gate list names it. **Limit:** this covers the estate sweep at the moment it queues a merge. GitHub's native auto-merge (`--auto`) waits for threads opened later only if the ruleset requires conversation resolution. That is an owner setting, not part of this PR. R3 (the template upgrade wave never auto-merges) needs no code: the sweep already blocks every PR not authored by a dependency bot (`not_a_dependency_bot`). This PR adds a test that pins it. ## Test plan - [x] `test/pr-automerge-sweep-test.sh` (the stub `gh` now serves GraphQL per PR number): an open thread, a GraphQL 502 and an unread second page each stop the merge with the reason logged; all threads resolved merges again; R3: a non-bot PR is flagged and never merged. - [x] Removing the call from the sweep makes the first R6 case fail. - [x] `bash -n` on the changed scripts. ShellCheck is not installed in this session; CI runs it. --- _Generated by [Claude Code](https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H)_ --------- Co-authored-by: Claude <[email protected]>



What
Owner ruling, 2026-11-13, relayed by the SysArch session: "add a guard". The estate's forge mirror runs
git push --forceto every forge whose*_MIRROR_ENABLEDvariable is true, on every push to main. It never checks the source repo's visibility, so a private repo can be pushed to a public forge copy.New check WF030 (
hypatia/workflow_audit/mirror_without_visibility_guard) flags a workflow that matches all three:git push --force,-for--mirror),*_MIRROR_ENABLEDvariable,github.event.repository.private,repository.visibility, or a forge visibility read).Severity is high and the action is
report: a referral, never an autofix. The ruled fix is to refuse, or skip loudly with an error, when the source is private and the forge copy isn't confirmed private, and to escalate when the forge's visibility can't be read. That fix belongs in the mirror workflow itself.Evidence
A static run over the workflows I can read:
metadatastician/standardsmirror-reusable.ymlandgithub-backup-mirror-reusable.ymlare flagged:git push --force <forge> mainper forge, with no visibility check.mirror.ymlonly calls the reusable workflow.Tests
New
test/rules/mirror_visibility_guard_test.exscovers: an unguarded mirror fires; a!github.event.repository.privateguard suppresses it; an ungated force push and a plain push don't fire; and the check is part ofaudit/3. Locally 77 tests pass withworkflow_audit_test.exs,mix formatis clean, and the module compiles with no warnings.Generated by Claude Code