Skip to content

fix(ci): enforce provenance for non-metadata external edits#540

Merged
JSONbored merged 5 commits into
mainfrom
codex/propose-fix-for-ci-vulnerability
May 28, 2026
Merged

fix(ci): enforce provenance for non-metadata external edits#540
JSONbored merged 5 commits into
mainfrom
codex/propose-fix-for-ci-vulnerability

Conversation

@JSONbored
Copy link
Copy Markdown
Owner

Motivation

  • The prior content-policy logic treated any file with a baseContent as an existing entry and exempted it from full direct-PR provenance checks, which allowed external contributors to modify executable fields (e.g. installCommand, usageSnippet, downloadUrl, repo links, or MDX body) while preserving a trusted submittedBy and bypassing provenance validation.
  • The change tightens the exemption so only safe metadata-only edits (disclosed safetyNotes/privacyNotes) with an unchanged MDX body may skip full provenance validation.

Description

  • Add existingEntryHasOnlyMetadataUpdates(entry) to compare fields vs baseFields and require unchanged MDX body before granting the existing-entry provenance exemption in validatePrProvenance in scripts/ci/validate-content-policy.mjs.
  • Record baseFields, contentBody, and baseContentBody for each entry when building the report so comparisons are reliable during validation in scripts/ci/validate-content-policy.mjs.
  • Change the provenance validation loop so existing-entry exemption only applies when existingEntryHasOnlyMetadataUpdates returns true; otherwise full direct-PR submitter checks are enforced.
  • Add a regression test blocks external executable content updates on existing entries with stale provenance to tests/submission-workflows.test.ts that verifies executable instructions cannot be changed by external PRs while preserving stale submittedBy provenance.

Testing

  • Ran pnpm exec vitest run tests/submission-workflows.test.ts and all tests passed (44 tests).
  • The added regression test verifies that changing executable fields on an existing entry triggers provenance validation failures.

Codex Task

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@JSONbored, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 21 minutes and 38 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 1ea0c7a5-87de-43a9-a429-451dba0506d1

📥 Commits

Reviewing files that changed from the base of the PR and between 1fd2685 and bbf6383.

📒 Files selected for processing (2)
  • scripts/ci/validate-content-policy.mjs
  • tests/submission-workflows.test.ts
✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch codex/propose-fix-for-ci-vulnerability

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 and usage tips.

@JSONbored JSONbored self-assigned this May 27, 2026
@JSONbored JSONbored merged commit 8c395cd into main May 28, 2026
20 of 21 checks passed
@JSONbored JSONbored deleted the codex/propose-fix-for-ci-vulnerability branch May 28, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant