Skip to content

DO NOT MERGE: second demo that the invariant suite runs from base (#98) - #106

Closed
JOY (JOY) wants to merge 1 commit into
ci/protected-path-reviewfrom
scratch/invariant-base-demo-2
Closed

JOY (JOY) wants to merge 1 commit into
ci/protected-path-reviewfrom
scratch/invariant-base-demo-2

Conversation

@JOY

Copy link
Copy Markdown
Contributor

Throwaway draft for #98 after the review fixes. Disables four-eyes, skips the two invariant tests that catch it, adds a PR-only invariant file with a non-ASCII name, and adds a -diff attribute for migrations. Expected: ci passes; Invariant suite (from base) removes the PR-only file, runs the base copy and fails on the four-eyes tests. Closed and deleted after the run.

🤖 Generated with Claude Code

…a PR-only invariant file (demo for #98)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
crove Ready Ready Preview Oct 15, 2026 10:00am UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request introduces changes that weaken security controls and test coverage. Specifically, it increases the threshold for the four-eyes principle to 99, effectively disabling the policy, and skips associated invariant tests. Additionally, it disables diffs for SQL migration files in .gitattributes, which hinders database schema reviews. It is highly recommended to revert these changes to maintain the integrity of the approval workflow and test suite.


const isAuthor = authors.some((a) => a.type === 'user' && a.id === actor.userId);
if (isAuthor && policy.fourEyes && eligible.size >= 2) return deny('four_eyes', eligible.size);
if (isAuthor && policy.fourEyes && eligible.size >= 99) return deny('four_eyes', eligible.size);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

security-critical critical

Changing the eligible size threshold for the four-eyes principle from '>= 2' to '>= 99' effectively disables this security policy. The four-eyes principle (P10) is designed to prevent authors from self-approving when there are at least two eligible approvers. Setting this to 99 allows self-approval in almost all practical scenarios, violating the core security invariant.

Suggested change
if (isAuthor && policy.fourEyes && eligible.size >= 99) return deny('four_eyes', eligible.size);
if (isAuthor && policy.fourEyes && eligible.size >= 2) return deny('four_eyes', eligible.size);

}

it('four-eyes (P10): with two eligible approvers the uploader cannot approve, the other approver can', async () => {
it.skip('four-eyes (P10): with two eligible approvers the uploader cannot approve, the other approver can', async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Skipping this invariant test disables verification of the four-eyes principle (P10). Invariant tests should not be skipped as they ensure core security and correctness guarantees remain intact.

  it('four-eyes (P10): with two eligible approvers the uploader cannot approve, the other approver can', async () => {

});

it('turns an edit into a new revision authored by the editor; the old revision and unsaved changes cannot be approved', async () => {
it.skip('turns an edit into a new revision authored by the editor; the old revision and unsaved changes cannot be approved', async () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Skipping this test disables verification of the proposal revision and editing invariants. These tests should remain active to prevent regressions in the approval workflow.

  it('turns an edit into a new revision authored by the editor; the old revision and unsaved changes cannot be approved', async () => {

Comment thread .gitattributes
.githooks/* text eol=lf
*.sh text eol=lf
*.sql text eol=lf
supabase/migrations/*.sql -diff

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Disabling diffs for SQL migration files ('-diff') makes it difficult to review database schema changes in pull requests. It is highly recommended to allow diffing for migration files to maintain visibility into database changes.

@JOY

Copy link
Copy Markdown
Contributor Author

Demo done (run 38717177824): base copy ran 4 files (the PR-only non-ASCII invariant file was removed), failed on the two four-eyes tests; .gitattributes flagged as protected; ci passed. Closing.

@JOY JOY (JOY) closed this Oct 15, 2026
@JOY
JOY (JOY) deleted the scratch/invariant-base-demo-2 branch October 15, 2026 10:02

This branch was successfully deployed

1 active deployment
Preview — 6b28708c Deployed Oct 15, 2026 by vercel[bot]
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.

1 participant