Skip to content

repo: enforce the contribution rules with GitHub settings #123

Closed

Description

@TusanHomichi

Existing issue check

  • I searched open and closed issues. No issue tracks the repository's GitHub configuration.

Problem or outcome

Repository settings currently enforce nothing in AGENTS.md / CONTRIBUTING.md. Audit (read-only, 2026-10-15; report sha256 8fa0a801…):

Outcome

GitHub enforces what the guidance already says, at the strongest rung available (AGENTS.md: "the codebase is memory"):

  1. main ruleset. Requires a pull request with every review thread resolved; squash is the only merge method. Required checks are fmt-clippy-test (pr-gate) plus build-x86_64 and build-aarch64 (release builds on PRs), from GitHub Actions, and the branch must be up to date. History is linear, with no force push and no deletion. Admins can bypass by merging a PR, never by pushing directly.
  2. v* tag ruleset. Release tags cannot be deleted, updated, or force-moved. Immutable releases are on for future releases (the release workflow already uploads to a draft and publishes last).
  3. Security. Secret scanning with push protection, Dependabot security updates, and CodeQL default setup (actions, JavaScript/TypeScript, Rust).
  4. Actions. Only GitHub-owned actions are allowed, and they must be SHA-pinned. Actions cannot approve PRs. All outside contributors need approval before their fork PRs run.
  5. Merge settings. Squash only, with auto-merge and update-branch on. The empty wiki is turned off.

Out of scope here: the org-level 2FA requirement, which needs admin:org scope and the owner's own login. Also out of scope: a release environment and dependabot.yml, which are repository changes for their own PRs.

Acceptance criteria

  • Each setting above reads back as intended via the API, recorded below with before/after.
  • CodeQL's first default-setup run succeeds under the SHA-pinning policy. If the policy breaks it, pinning enforcement is reverted, and that is recorded.
  • CONTRIBUTING.md names the required checks, so renaming a gate job is a known ruleset change (separate small PR).

Revert

Every change is a repository setting: rulesets can be disabled or deleted (gh api -X DELETE repos/FieldmouseWorks/consolebook/rulesets/<id>), and each flag reverts with the same endpoint that set it.

Execution record

  • Authority: the maintainer, 2026-10-15, in a local session: "you have access to my github as much as you need it. can you set it up ideally for this project?" Applied by the integrator. No owner effort budget.
  • Next action: apply items 1–5 and read them back.

Activity

  1. TusanHomichi commented on Oct 15, 2026

    @TusanHomichi
    MemberAuthor

    Applied on 2026-10-15 by the integrator. Each setting was read back through the API after it was written. The before-state is the audit summarized in the issue body.

    Setting Before After (read back)
    Merge methods merge commit, rebase, squash squash only
    Auto-merge / update branch off / off on / on
    Wiki on (no pages; consolebook.wiki.git does not exist) off
    Ruleset main: pull requests with green gates (id 25173621) none active. Requires a PR (0 approvals) with every thread resolved, squash only. Required checks fmt-clippy-test, build-x86_64, build-aarch64 (GitHub Actions, app 15368), branch up to date. Linear history, no force push, no deletion. The admin role bypasses only by merging a PR
    Ruleset release tags are permanent (id 25173622) none active on refs/tags/v*: no deletion, update, or force move; no bypass
    Immutable releases off on (enabled: true). Covers future releases; v0.1.0 and v0.2.0 are unchanged
    Secret scanning / push protection disabled / disabled enabled / enabled
    Dependabot security updates disabled enabled (alerts were already on)
    CodeQL default setup not configured configured (actions, javascript-typescript, python, rust; default suite)
    Actions allowed all, no SHA pinning GitHub-owned only, SHA pinning required
    Actions may approve PRs yes no (default token permission stays read)
    Fork PR approval first-time contributors all external contributors

    SHA pinning under GitHub-managed workflows: GitHub does not document whether the pinning policy exempts dynamic workflows, so I observed it instead. The first CodeQL default-setup run, 38767238018, ran under the policy and succeeded in all four analyses (Rust, JavaScript/TypeScript, Python, Actions). The policy stays on. Dependabot's own runs have not happened yet, because there are no open alerts. If one fails on the policy, that is the first place to look.

    CodeQL first-run triage: 49 alerts, all Rust: 30 critical and 19 high. All were dismissed, each with its reason and a comment, and each can be reopened:

    • 42 used in tests: invented passwords and usernames in integration tests (rust/hard-coded-cryptographic-value ×29, rust/cleartext-logging ×13).
    • 1 false positive: secrets.rs:123, the constant dummy password hashed only to equalize login timing for unknown usernames.
    • 4 won't fix: main.rs:349–363. recover prints the one-time reset code to the local operator by design (ADR 0004). A username is not a secret.
    • 2 won't fix: http.rs:218,228. Secure follows the configured public URL (ADR 0025): it is set for https, and left unset so plain-HTTP localhost works.

    Open alerts after triage: 0.

    Follow-up, not done here: every new test file that declares its own test password will raise the same two rules again. One shared test-credential helper would make that a single, deliberately dismissed location (rung 1). An advanced CodeQL setup that skips tests/ is the alternative. I'll file this separately with this evidence.

    Remaining for this issue: a small PR that names the required checks in CONTRIBUTING.md, so that renaming a gate job is understood to be a ruleset change.

  2. TusanHomichi commented on Oct 15, 2026

    @TusanHomichi
    MemberAuthor

    Authority update (2026-10-15): the maintainer granted standing permission to manage PRs end to end: "you have standing permission to manage PRs end to end and that includes merging and cleaning up old branches". The integrator merges once required checks are green on the current head and every review thread is resolved (squash only; no admin bypass of a failing check), then verifies the merged revision and removes the branch and worktree. Deployments and releases are not covered.

  3. TusanHomichi commented on Oct 15, 2026

    @TusanHomichi
    MemberAuthor

    Merged in #128 as 82c0cb0baa35819f780a3332531edbbafbf85df6 (squash, single parent 6042dec). The merged tree cc442713 is identical to the PR head ccb7699e. That head was the candidate 2450f73 rebased onto #127, as the up-to-date rule requires. Evidence by revision: local full proof on 2450f73 (7/7 gates, 61/61 browser tests, receipt sha256 fbca63c8…); hosted fmt-clippy-test, build-x86_64, build-aarch64, and CodeQL passed on the exact rebased head ccb7699e. These were the first two PRs merged under the new ruleset, and the required checks, the up-to-date rule, and branch auto-delete all behaved as configured. Branch and worktree removed. Authority: the maintainer's standing PR permission (2026-10-15).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions