Tool / Developer workflow

Code Policy Gate

Turn project rules into focused checks for every agent-generated change before it reaches a branch or deployment.

The gate
review required
src/app/api/export/route.ts

12 export async function GET() {

+13 writeFileSync('/tmp/export.csv', result)

14 return Response.json(result)

15 }

Number the rulesPass
Pass the diff as dataFail
Separate unknownReview

The gate

One rule, one question

Small questions make a policy file easier to test, explain and update.

01

Rule verdict

Check every rule with a clear complies, violates or insufficient-evidence result.

02

Risk signal

Score the impact of the change instead of treating every diff equally.

03

Reviewer route

Choose the owner, human review or safe stop before merge.

The gate

rule 01

Number the rules

Give every important instruction a stable ID for results and audit logs.

rule 02

Pass the diff as data

Keep the changed files, tests and task context together.

rule 03

Separate unknown

Missing evidence should ask for review, not become a false pass.

rule 04

Gate in the pipeline

Let deterministic CI and ownership policy apply the final result.

Review a diff

Use AI to inspect policy, not replace it

The model can identify evidence and gaps. Your repository rules and merge permissions remain authoritative.

Review a diff
POST /v1/code-policy
{
  "state": {
    "rule": "Payment changes require an owner review and tests.",
    "diff": "retry limit changed from 3 to 8; no tests added"
  },
  "questions": {
    "complies": { "type": "noul", "instructions": "Does this diff comply with the rule?" },
    "risk": { "type": "score", "instructions": "How risky is this diff?", "criteria": ["low", "review", "high"] },
    "gate": { "type": "choice", "instructions": "What should happen next?", "criteria": { "merge": "continue", "review": "ask owner", "block": "stop" } }
  }
}
1Developer control

Load the rules

Read CLAUDE.md, AGENTS.md or your own policy source.

2Developer control

Check each rule

Ask whether the diff complies, violates or lacks enough evidence.

3Developer control

Apply the gate

Let CI request a reviewer, block the merge or continue safely.

FAQ

Questions about code policy

Does this replace CI rules?+

No. Use Jev to inspect evidence and route review, while deterministic checks and permissions remain authoritative.

What if the diff does not contain enough evidence?+

Return an insufficient-evidence or review result instead of treating missing proof as compliance.

Can I connect this to an agent?+

Yes. The agent can request the check, but the harness should own the merge or deployment permission.