Skip to content

Fix/token permissions id 20260911 - #70

Closed
hyperpolymath wants to merge 3 commits into
mainfrom
fix/token-permissions-id-20260911
Closed

hyperpolymath wants to merge 3 commits into
mainfrom
fix/token-permissions-id-20260911

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Changes

RSR Quality Checklist

Required

  • Tests pass (just test or equivalent)
  • Code is formatted (just fmt or equivalent)
  • Linter is clean (no new warnings or errors)
  • No banned language patterns (no TypeScript, no npm/bun, no Go/Python)
  • No unsafe blocks without // SAFETY: comments
  • No banned functions (believe_me, unsafeCoerce, Obj.magic, Admitted, sorry)
  • SPDX license headers present on all new/modified source files
  • No secrets, credentials, or .env files included

As Applicable

  • .machine_readable/STATE.a2ml updated (if project state changed)
  • .machine_readable/ECOSYSTEM.a2ml updated (if integrations changed)
  • .machine_readable/META.a2ml updated (if architectural decisions changed)
  • Documentation updated for user-facing changes
  • TOPOLOGY.md updated (if architecture changed)
  • CHANGELOG or release notes updated
  • New dependencies reviewed for license compatibility (MPL-2.0 / MPL-2.0)
  • ABI/FFI changes validated (src/interface/abi/ and src/interface/ffi/ consistent)

Testing

Screenshots

hyperpolymath and others added 3 commits September 11, 2026 10:00
Removing rust-ci.yml workflow since this repository has no Rust code
(Cargo.toml not present). The reusable rust-ci-reusable.yml already guards
itself by detecting Cargo.toml presence, but repos without Rust code
shouldn't trigger unnecessary workflow runs.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
Apply principle of least privilege for GITHUB_TOKEN:
- Change top-level permissions to read-only
- Jobs inherit read permissions, can escalate as needed

This resolves Scorecard TokenPermissionsID alerts.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
- Add Optimus-Branch.json for branch protection
- Add Immutable-Tags.json for tag protection
- Remove deprecated branches: from settings.yml
- Keep labels and repository metadata

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
@coderabbitai

coderabbitai Bot commented Sep 12, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: d12cf17e-81b3-4fea-aa87-b814527961a2

📥 Commits

Reviewing files that changed from the base of the PR and between 58a0a95 and a465947.

📒 Files selected for processing (6)
  • .github/rulesets/Immutable-Tags.json
  • .github/rulesets/Optimus-Branch.json
  • .github/settings.yml
  • .github/workflows/dependabot-automerge.yml
  • .github/workflows/rhodibot.yml
  • .github/workflows/rust-ci.yml

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath enabled auto-merge (squash) September 14, 2026 00:52
@hyperpolymath

Copy link
Copy Markdown
Owner Author

Closing this PR unlanded, as part of a decision on the whole fix/token-permissions-id-20260911 family (21 PRs). Not a rejection of least-privilege permissions — a decision to fix the generator instead of 21 branches.

Why the family is not landable

The sweep narrows contents: write to contents: read at the workflow level on workflows that genuinely write — git push, gh pr merge --auto, gh release create, create-pull-request. Where the writing job has no permissions: block of its own and authenticates with GITHUB_TOKEN, the narrowing silently removes a permission the workflow needs.

It is silent in the worst way. The diff is valid YAML and fails no check, so the PR shows green; the damage fires on the next write, which may be weeks later and in a different workflow than the one reviewed. Where the push is written git push … || echo "::warning::", a denied push emits a warning rather than a failure and the run stays green forever.

In several files the sweep rewrote the value and left the justifying comment attached to it, so the patch states its own requirement and then removes it:

 permissions:
-  contents: write # needed to enable auto-merge
+  contents: read # needed to enable auto-merge

Root cause — in the rule, not in these branches

hypatia's workflow_audit.ex:463 tests:

Regex.match?(~r/^permissions:/m, content)

anchored at column 0. A job-level permissions: block is indented, so the rule structurally cannot see it. It can therefore only ever rewrite workflow-level permissions, and cannot tell a workflow that needs the write from one that does not. The rule runs across the estate, which is why this arrived as a 21-PR family rather than one bad patch.

The estate already gets this right in three places (standards/signed-push-smoke.yml, KnotTheory.jl/release.yml, gitbot-fleet/inbox-steward.yml), all using per-job elevation — so this is generator inconsistency, not policy.

What happens instead

Nothing here is lost: the intended permissions hardening is deferred to a correct generator, not abandoned.

🤖 Generated with Claude Code

https://claude.ai/code/session_014QN8x5x4kNKY8EYCFsCmWB

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.

2 participants