Skip to content

GitHub Rules

LoFi edited this page Jan 26, 2026 · 1 revision

GitHub Repository Rules

The Gate must be unbreakable.

To fully enforce "Physics over Law," you must configure your GitHub Repository to reject any code that does not pass LoFi Gate.

1. Branch Protection Rules

Go to Settings > Rules > Rulesets (or Branches in older repos) and create a rule for main:

Critical Settings

  • Require status checks to pass before merging
    • Search for your CI job (e.g., verify, test, or ci/circleci).
    • Why: This ensures lofi-gate verify actually ran and returned Exit Code 0.
  • Require branches to be up to date before merging
    • Why: Prevents logical conflicts that might break the build after merge.
  • Do not allow bypassing the above settings
    • Why: Even Admins should not break the build.

2. CI Configuration

Ensure your CI workflow (GitHub Actions) runs the gate and fails on error.

Example (.github/workflows/verify.yml):

name: Verify
on: [push, pull_request]

jobs:
  lofi-gate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Install
        run: pip install lofi-gate
      - name: Verify
        run: lofi-gate verify

3. The Result

When an Agent (or Human) opens a PR:

  1. GitHub Actions runs lofi-gate verify.
  2. If it fails (Red), the Merge button is disabled.
  3. The Agent must fix the code to turn it Green.

There is no negotiation. Only passing tests.

Clone this wiki locally