Docs

Gates

Mechanisms outside the registry

The gates Vinaya runs that are not among the 37 core checks: the commit-message hook, validated pull-request and Issue writes, the review workflows, post-merge archiving and the scheduled audits.

10 mechanisms
Ring 0
Ring 1
Ring 2

About gate mechanisms

vinaya check --plan lists the 37 core checks. Vinaya also gates work through mechanisms that are not checks of their own: a git hook, the validated pull-request and Issue write commands, two review workflows, and the Ring 2 jobs in vinaya-archivist.yml. Some of them run checks; none is a check itself.

MechanismRingFails red
commit-msg hook0Refuses the commit
Validated PR create/edit1Refuses the write
Validated Issue create/edit1Refuses the write
Trusted review workflow1Yes
Review-verdict retrigger1Evaluation job yes; retrigger job no
Post-merge task archive2Yes, on error
Tranche self-archive (two triggers)2No
Daily drift check2No
Daily tranche catch-up2No
Direct-main-push detection2Yes

How they run

  1. 1

    Ring 0 · on your machine

    The commit-msg hook runs beside the pre-commit and pre-push hooks that run the checks.

  2. 2

    Ring 1 · on writes and the pull request

    The validated write commands run in the CLI. vinaya-review.yml and vinaya-review-verdict.yml run on the forge.

  3. 3

    Ring 2 · after merge and on a schedule

    vinaya-archivist.yml runs on a push to main, on issues: closed, daily on a schedule (0 2 * * *, 02:00 UTC), and on workflow_dispatch.

Mechanisms

commit-msg hook

What it doesValidates the first line of the commit message against Type: Description or Type(scope): Description, where Type is one of Vinaya's commit types, in start case. The same type list backs the title grammar for pull requests and Issues.
Triggergit's commit-msg hook, which runs the CLI's commit-msg command with git's two arguments. It refuses first if the CLI build is missing.
Refuses or reportsRefuses a non-matching first line, printing the expected form and an example. Skips when git passes the source merge. Exits 2 on missing arguments.
Fails redExit 1 refuses the commit.
SettingsNone. The commit-message convention has no setting.

Validated PR create/edit

What it doesvinaya pr create and vinaya pr edit <n> grade the exact body and title before gh writes them, and refuse once with every finding together: retired brief markers (create only); title grammar, the configured briefSchema.pr sections and the branch grammar brief-shape also applies; bare digits (no Changesets exemption here); Premise: contains: pins absent from the base branch (create only); and every check with validates: 'body'. --validate-only grades without writing. The dev-review loop uses the same set of findings, and vinaya pr report --push runs the body checks before its gh pr edit.
TriggerThe command. On create no pull request number exists, so checks that need an open pull request are skipped. On edit the number is passed and the full body set runs.
Refuses or reportsRefuses with every finding and a retry command. A failure whose every error is pending (an unticked [principal] item) does not refuse. Create also refuses with no body; edit refuses with neither body nor title. A title-only edit checks only title grammar.
Fails redRefuses the write (exit 1); nothing reaches the forge. CI re-checks the same body.
SettingsbriefSchema (the required sections); checks (which validates: 'body' checks run); gateCutovers; rings.ring1_forgeWriteInterception: false empties the configured brief-schema sections and skips the validates: 'body' pass, while title grammar, bare digits and Premise own-additions still run.

Validated Issue create/edit

What it doesvinaya issue create, vinaya issue edit <n> and vinaya issue objectives edit validate a task Issue (one with a vinaya/tranche:* label, or a task-shaped body) before writing. Every group runs and the findings are combined: title grammar and the briefSchema.issue sections; the Milestone sibling fetch; the pinned-file collision peers; Issue content (blast radius, no brief content, rationale names docs, Surface, and more); the brief this write would freeze, graded with the brief-shape rules; and the five Issue checks. Edit also refuses a change to a frozen section, except from issue objectives edit.
TriggerThe command. --validate-only grades without writing.
Refuses or reportsRefuses once if any finding is not a warning; warnings are printed and do not block. On pass it ensures the tranche label exists, attaches the Milestone on create, then writes with gh. A task Issue on create needs --body-file.
Fails redRefuses the write (exit 1).
SettingsbriefSchema (the required sections); checks (which validates: 'issue' checks run); gateCutovers; rings.ring1_forgeWriteInterception: false empties the brief-schema sections, while the Issue content groups and the five Issue checks still run.

Trusted review workflow

What it doesRuns review-gate from default-branch code against current forge facts. The job (vinaya review gate) first reads comments and labels through the API. With no line-anchored VERDICT: comment and no vinaya/waiver:review label, it fails without checking out or building. Otherwise it checks out the default branch, builds the CLI and runs check review-gate with PR_NUMBER. The run name records the pull request number and head SHA. Concurrency is one run per pull request and head.
Triggerpull_request_target: opened, synchronize, reopened, labeled, unlabeled.
Refuses or reportsReports the required check vinaya review gate. It stays red until valid Code and Security verdicts, or an actor-verified waiver, bind to the current inputs.
Fails redYes.
Settingsprincipals and reviewPolicy, read from the default branch.

Review-verdict retrigger

What it doesA verdict arrives as a pull request comment, an issue_comment event the review workflow cannot receive. Job evaluate resolves the head, builds the default branch and runs check review-gate, with read-only permissions. Job retrigger (actions: write, runs no code) finds the vinaya-review.yml run titled Vinaya Review Gate PR #<n> @ <sha> that is not cancelled, and re-runs it with gh run rerun, so the required check updates itself. It retriggers on either verdict, so a later rejection can turn a green check red.
Triggerissue_comment: created, on a pull request, when the comment contains VERDICT.
Refuses or reportsevaluate reports its own result. retrigger exits 0 with a message when no number, head or matching run is found, and tolerates a declined rerun.
Fails redevaluate: yes. retrigger: no.
Settingsprincipals and reviewPolicy, read from the default branch.

Post-merge task archive

What it doesvinaya archive --merge-sha=<sha> finds the pull request for the merge, and skips if there is none or if provenance is already posted. It posts a provenance block comment on the pull request with a tokens line (or DANGLING (tokens): …), prints any dangling records, then closes the Issue named by Closes #N and confirms it is closed.
TriggerJob post-merge in vinaya-archivist.yml, on push to main.
Refuses or reportsFails when the Issue does not confirm CLOSED, or when the repository cannot be resolved.
Fails redYes; the step has no continue-on-error.
Settingsrings.ring2_asyncAudits: false makes it print that it is skipping and change nothing.

Tranche self-archive (both triggers)

What it doesRuns vinaya archive tranche <slug> --yes, which archives the tranche only when no task Issue in it is still open.
Trigger(1) A step of post-merge: it resolves the merged pull request's branch and takes the slug from task/<slug>/…. (2) Job issue-closed, on issues: closed for an Issue carrying a vinaya/tranche: label: it re-reads the labels from the forge, drops slugs with unsafe characters, and archives each tranche. This covers a last task closed without a merge.
Refuses or reportsarchive tranche refuses (exit 1) while task Issues remain open, which is the expected outcome on every close but the last.
Fails redNo; both steps are continue-on-error.
SettingsNone. Not gated by rings.ring2_asyncAudits.

Daily drift check

What it doesvinaya audit --only=dead-branches finds task branches whose remote tip commit is dated after their pull request was closed or merged. For each, it adds the vinaya/dead-branch-push label to the pull request and posts or updates one marker comment saying it is a notification, not a merge gate.
TriggerJob daily-drift ("Daily Drift Check (dead-branch pushes)"), on the daily schedule or workflow_dispatch.
Refuses or reportsReports only; nothing is reverted. A scan error is printed and never turns red.
Fails redNo; the step is continue-on-error.
Settingsrings.ring2_asyncAudits: false skips it.

Daily tranche catch-up

What it doesvinaya archive tranches --yes archives every finished tranche not yet archived, such as one that finished before the workflow existed or whose closing event was missed. Tranches with an open task Issue are skipped; archiving an archived tranche changes nothing.
TriggerA second step of daily-drift, on the same schedule.
Refuses or reportsArchives each finished tranche and skips the rest; refuses nothing.
Fails redNo; the step is continue-on-error.
SettingsNone. Not gated by rings.ring2_asyncAudits.

Direct-main-push detection

What it doesvinaya audit --only=direct-push --sha=<sha> asks the forge which merged pull requests introduced the commit, polling up to 6 times, 20 seconds apart, because the association can lag a merge. With none, it opens an incident Issue titled Direct push to main detected: <sha> with the vinaya/direct-main-push label, unless one is already open for that SHA.
TriggerJob direct-main-push-detection, on push to main or workflow_dispatch.
Refuses or reportsDetection only; nothing is reverted.
Fails redYes; exit 1 on a direct push.
SettingsNone. Never skipped by rings.ring2_asyncAudits: the flag lives in the same pushed content the audit judges.

Configuration

KeyMechanism it changes
rings.ring1_forgeWriteInterceptionfalse empties the configured brief-schema sections and skips the validates: 'body' pass on PR writes. Title grammar, bare digits, Premise own-additions, the Issue content groups and the five Issue checks still run.
rings.ring2_asyncAuditsfalse skips the post-merge task archive and the daily drift check.
briefSchemaThe sections the PR and Issue write paths require.
checksWhich validates: 'body' and validates: 'issue' checks the write paths run.
principals, reviewPolicyRead from the default branch by review-gate in both review workflows.
gateCutoversGrandfathering numbers read by the write-path gates.

What gets logged

The validated write commands run checks through the check runner, so they record gate · summary and gate · checked events like any check run.

The workflows and Ring 2 commands record no gate events of their own, because they are not checks. Their results live on the forge as check runs, pull request comments, labels and incident Issues: forge records, not the Log. Every CLI command also records an operation · completed event; see Events.

What's next