The Harness
Reference

The harness, part by part

Vinaya is a series of deterministic checks and workflows that hold agentic and human development to the same discipline — an AI agent and a person answer to the identical rules before anything merges. Each ring below is read at build time from this repo’s own doctrine, not hand-written for this page.

The actors

role

Planner

agent

Turns an intent and a slice of tickets into a whole tranche — its tasks, and the dependencies between them.

Read the doctrine
role

Architect

agent

Declares a product goal as a Milestone, and names which tranches serve it — nothing else.

Read the doctrine
role

Developer

agent

The coding agent that executes a brief — writes the change, opens the pull request, and answers for it.

Read the doctrine
role

Operator

agent

Runs one already-planned task through the existing controller — starts it, reads its grounded status, reads why its pull request is red, presents the persisted escalation, and asks for authenticated continuation or cancellation. Never plans, codes, rules, approves, or merges.

Read the doctrine
role

Reviewer

agent

Judges an open pull request against the brief it came from, and says plainly whether it satisfies it.

Read the doctrine
role

Security Reviewer

agent

Checks an open pull request for what a correctness review misses — leaked secrets, unsafe configuration, exposed surfaces.

Read the doctrine
role

Archivist

human
agent

Closes out a merged pull request, recording what shipped and the intent it came from.

Read the doctrine
role

Tranche Archivist

human
agent

Closes out a finished tranche, so the next one starts from what is true now rather than what was true before.

Read the doctrine
role

Principal

human

The person accountable for what merges — the one seat holding authority the mechanism never grants an agent.

Read the doctrine

What actors do

contract

Planner → Developer

Carries a brief to the agent that executes it, so nothing the plan knew is left implicit.

Read the doctrine
contract

Developer → Reviewer

Carries finished work to its reviewer already accounted for, so review spends itself on judgement rather than on basics.

Read the doctrine
contract

Reviewer → Archivist

Carries a review’s actual findings into the permanent record, so a verdict says what was checked, not just that it passed.

Read the doctrine
contract

Archivist → Tranche Archivist

Carries each task’s close-out record up to the tranche close-out, so a phase can only be called finished once its parts genuinely are.

Read the doctrine
contract

Tranche Archivist → Planner

Carries a finished tranche’s real outcome to the planning of the next, so no plan is built on a product that no longer exists.

Read the doctrine
contract

Security → Archivist

Carries the security review's verdict and findings into the permanent record, so a recorded pass is a copied fact, not a claim.

Read the doctrine
contract

Architect → Planner

Carries a product goal's declared tranche intents down to the Planner, so a tranche's goal is derived rather than invented.

Read the doctrine
contract

Principal → Operator

Carries process authority down and content decisions up — the Principal tells the Operator which planned task to run, pause, or stop; the Operator brings the Principal the escalations only the Principal may rule.

Read the doctrine
contract

Planner → Operator

The Operator runs what the Planner cut — the Planner makes a task dispatchable, the Operator operates it, and every scope or strategy change routes back to the Planner, never through the Operator.

Read the doctrine

Hooks

ring 0

Editing a governed file

hook

Couples an edit to a governed code surface to its owning document, so the two cannot drift apart in one change.

Read the doctrine
ring 0

git commit

hook

Refuses a commit that does not build or pass its own checks, before the broken state exists at all.

Read the doctrine
ring 0

git push

hook

Refuses a push that would land straight on main, on the machine that attempted it.

Guards: publish the branch

Read the doctrine
ring 0

Creating a pull request, or editing its title/description

event

Refuses to open or edit a pull request until it carries everything a reviewer needs to judge it.

Guards: open a pull request, revise a pull request, grant a waiver

Read the doctrine
ring 0

Creating a task Issue, or editing its title/description

event

Refuses to open or edit a task Issue until it carries the full reasoning behind the task.

Guards: create a task issue

Read the doctrine
ring 0

Merging

event

Holds the merge on the forge side while anything the gates check is still failing.

Read the doctrine
ring 0

Starting the Planner's dispatch act

hook

Refuses to start work until every precondition for the task is checked live and found clear. Optionally (task 10, `PREMISE_FILE=<brief.md> vinaya check dispatch-readiness`), also re-asserts a local brief's `Premise:` pins against current on-disk state and fails on any pin that no longer holds.

Read the doctrine
ring 0

Opening a task PR whose surface includes real code

event

Refuses a code-carrying pull request whose description no longer matches what it changes.

Read the doctrine
ring 0

Opening a task PR

event

Runs the whole exit check before a pull request is created, so failures surface first.

Read the doctrine
ring 0

Spawning a check

hook

Governs which environment variables a spawned check's child process can see, instead of every check inheriting the full parent environment unconditionally.

Read the doctrine
ring 0

vinaya check

event

Resolves core-registered and config-registered checks into one deterministic table before anything runs, instead of letting a config entry run alongside the core check it collides with, unannounced.

Read the doctrine
ring 0

Pushing a task branch that matches no planned task

hook

Refuses to push a task branch whose name matches no task row derived from the forge.

Read the doctrine
ring 0

Pushing to a branch whose pull request already resolved

hook

Refuses a push to a task branch whose most recent pull request is already merged or closed.

Guards: open a pull request, revise a pull request, grant a waiver

Read the doctrine
ring 0

A task branch's first push

hook

Re-runs the dispatch-readiness gate once, on a task branch's first push, before its pull request exists.

Read the doctrine
ring 0

A task branch's first push

hook

Assigns the task's Issue to the authenticated pusher on the branch's genuinely first push — visibility automation, deliberately not a gate.

Read the doctrine
ring 0

Committing or pushing while checked out on the default branch

hook

Refuses a commit or push whose current branch IS the repo's default branch — mechanizing the worktree-plus-PR rule at ring 0 for every adopter, not just this repository's own hand-written pre-push script (the `git push` row above, `repo-own`, predates this check and covers a different class: a push whose destination *ref* is the default branch, not a local checkout parked on it). Registered in `coreCheckRegistry()` (task 9), so `vinaya init` ships it to every adopter through the generated `check --all --local` hooks — closing the gap where this rule previously reached only this repo's own maintainers.

Read the doctrine
ring 0

Committing when the token-metering adapter is wired but unreachable

hook

Refuses a commit when the token-metering probe finds a wiring point resolved — a transcript pointer naming a path — but cannot reach what it names. A host never wired to meter at all still passes unchanged.

Read the doctrine
ring 0

Committing a check bin that nobody can execute

hook

Refuses a staged executable whose index mode is not `100755`, on the machine that staged it.

Read the doctrine

The actions

action

publish the branch

reaches github

Pushing local commits up to GitHub, where the rest of the mechanism can finally see them.

Read the doctrine
action

create a task issue

reaches github

Opening the Issue that a task exists as — its scope, its reasoning and its dependencies, written down before anyone starts.

Read the doctrine
action

open a pull request

reaches github

Proposing finished work for review, carrying the account of what changed and which intent it came from.

Read the doctrine
action

revise a pull request

reaches github

Editing a pull request after it exists — its code, its title or its description, whether or not review already happened.

Read the doctrine
action

grant a waiver

reaches github

Deliberately excusing a rule for one case — an authority the mechanism grants to a person, never to an agent.

Read the doctrine
action

commit the work

stays local

Recording a change locally — the last moment it costs nothing to catch a mistake.

Read the doctrine
action

author the brief

stays local

Dispatching one intent as instructions someone can execute: what to build, what is out of scope, and what done means.

Read the doctrine
action

produce the verdict

stays local

Judging finished work against the brief it came from, and saying plainly whether it passes.

Read the doctrine
action

post the provenance comment

stays local

Writing the permanent record of a merged task — what shipped, from what intent, checked by whom.

Read the doctrine
action

write the retrospective

stays local

Closing out a finished phase of work by recording what actually happened and what it taught.

Read the doctrine
action

create the milestone

stays local

Declaring a product goal as a Milestone — free-text title, prose goal, an optional Release: field as the version's sole authority, and an optional list of which tranches serve it.

Read the doctrine

Branch Rules

ring 1

Brief validation

ci

Re-checks in CI that a pull request’s title and brief sections are properly formed.

Read the doctrine
ring 1

PR-report density

ci

Re-checks that a pull request's `## Summary` and `## Scope` sections are each exactly one paragraph, per the canonical PR-body form.

Read the doctrine
ring 1

Closes linkage

ci

Re-checks that a pull request names the Issue it closes.

Read the doctrine
ring 1

Writing to pull requests or Issues through the raw API

event

Re-checks, in CI, that whatever landed on a pull request or Issue satisfies the CLI's validated-write shape rules — the actual backstop against a raw write, since no ring-0 hook can refuse one at the point it happens.

Read the doctrine
ring 1

Single-plan-PR guard

ci

Re-checks that no two open pull requests are planning the same work at once.

Read the doctrine
ring 1

Coherence check

ci

Re-checks every task’s recorded state against what actually merged.

Read the doctrine
ring 1

Documentation gate

ci

Re-checks that a change carrying real code also updates the docs explaining it.

Read the doctrine
ring 1

Test-plan state

ci

Re-checks that the pull request's `[principal]` test-plan boxes are genuinely ticked.

Read the doctrine
ring 1

Principal Test Plan wait

ci

Owns the merge condition an unticked `[principal]` Test Plan item represents, as its own independent check — the Principal wants every merge condition to be its own check, so that all green means mergeable, rather than a reviewer having to notice this reason buried among `review-gate`'s own several possible failures.

Read the doctrine
ring 1

Typecheck + unit tests

ci

Re-runs the type checker and the unit tests for every package this change can reach.

Read the doctrine
ring 1

Conventions

ci

States where formatting/naming conventions stand in this repo: currently unenforced.

Read the doctrine
ring 1

AI review

ci

Requires independent review verdicts to exist on every pull request before merge.

Read the doctrine
ring 1

Review gate

ci

Holds the merge until the required review verdicts actually exist.

Read the doctrine
ring 1

Implementation exists

ci

Re-checks that every gate the doctrine describes has real code behind it.

Read the doctrine
ring 1

No orphan hook/CLI

ci

Re-checks that every hook and CLI in the repo is one the doctrine claims, and that a row scaffolded to fix that stays visibly incomplete until a human finishes it.

Read the doctrine
ring 1

No seventh way into GitHub

ci

Re-checks that no route into GitHub exists beyond the ones the doctrine gates.

Read the doctrine
ring 1

Cited forge numbers resolve

ci

Re-checks that every Issue and PR number cited in the docs resolves to a real one.

Read the doctrine
ring 1

Role/contract integrity

ci

Re-checks that every role and contract the doctrine references is really defined.

Read the doctrine
ring 1

Doctrine-registry parity

ci

Re-checks that every row this page marks `product` actually ships as a real, adopter-runnable check, not just a documented claim.

Read the doctrine
ring 1

reader-resolvable-prose

ci

Re-checks reader-facing doctrine, durable specs and configured source comments for unresolvable citations and coined vocabulary.

Read the doctrine
ring 1

retired-vocabulary

ci

Re-checks that no doctrine page claims a retired mechanism is still live.

Read the doctrine
ring 1

doctrine-portability

ci

Re-checks that shipped doctrine doesn't cite a path that exists only in the authoring repository.

Read the doctrine
ring 1

doctrine-no-procedures

ci

Re-checks that doctrine (`roles/*.md`, `contracts/*.md`, …) describes commands rather than scripting them (task 9/task 10's rule).

Read the doctrine
ring 1

No new on-disk state

ci

Blocks a diff that creates a new on-disk state file duplicating what the forge already derives.

Read the doctrine
ring 1

workspace-escape

ci

Re-checks that no source file's constructed filesystem reference reaches outside its own workspace package, or points at a path that does not exist.

Read the doctrine
ring 1

changeset-coverage

ci

Re-checks that a diff touching a published package's own shipped files also carries a changeset in the same diff.

Read the doctrine
ring 1

quoted-command

ci

Re-checks that a doc's explicitly marked quote of a command or config line still matches, verbatim, the file it names as its source.

Read the doctrine
ring 1

Bare code-fact digits in a PR body

ci

Re-checks that a pull request's narrative prose carries no bare `<path>.<ext>:<digits>` code-fact pointer outside a fenced code span or a `Premise:` pin.

Read the doctrine
ring 1

Evidence-block freshness

ci

Re-checks that a PR's Evidence block still matches a fresh recompute at the PR's current head.

Read the doctrine
ring 1

Documentation gate

ci

Re-checks C5 doc-coverage — the SAME code→doc binding the push-time row above enforces — again at PR create/edit time, not only on push.

Read the doctrine
ring 1

Surface-scope

ci

Re-checks that a task branch's changed files stay inside its own Issue's declared `## Surface` — never inside a declared `out:` glob.

Read the doctrine
ring 1

PR-body premise reassertion

ci

Re-checks, in CI, that a pull request body's `Premise:` pins still hold against the PR's own current tree — not only at Step 0, authoring time.

Read the doctrine

Audits

ring 2

Post-merge archivist

event

Records what each merged task shipped, from what intent, and checked by whom.

Read the doctrine
ring 2

Coherence oracle, full sweep

event

Sweeps the whole forge for drift, including work old enough that nobody is watching it.

Read the doctrine
ring 2

Docs coherence gate

event

Checks that every link and reference in the docs still points at something real.

Read the doctrine
ring 2

Staleness audits

event

Flags documentation that has fallen behind the decisions it is meant to follow.

Read the doctrine
ring 2

Direct-main-push detection

event

Catches pushes that reached main anyway, including from writers the hooks cannot reach.

Read the doctrine
ring 2

Dead-branch-push audit

event

Catches commits still landing on a branch whose pull request already resolved.

Read the doctrine
ring 2

Token self-report

event

Collects a role's exact token usage on **one** host, by reading that host's own session transcript, and emits the line the PR-body token report is built from. The obligation to report tokens is host-agnostic doctrine; this row is only the adapter that satisfies its collection step on today's shipped reference host, never the requirement itself — an adopter on another harness collects by their own means and ships no equivalent of this row.

Read the doctrine
ring 2

Published lifecycle audit

event

Runs the full shipped-command lifecycle against the real published `@attalabs/vinaya` npm artifact — never this workspace's own source.

Read the doctrine