Skip to content

pi-jev-governor

Decision governor for Pi routing plan strategy, model tier, tool permissions and outcome (finish, retry, replan) through Jev.

Projectbeta

Overview

pi-jev-governor routes four critical decisions of the Pi coding agent through a Jev Decisions API. At agent start, plan_strategy chooses direct, plan_only or a read-only plan_then_execute phase, and tier picks a small, normal or strong model with compatibility guards; both share one request. On each tool call, permission.action applies deterministic rules, then Jev adjudication, then a human or fail-closed fallback. Before settling, outcome decides finish, retry or replan, with a shared hard cap of two automatic corrections.

A recorded demo shows knowledge questions dropping to a flash model, risky refactors triggering a read-only planning phase on a max model, and architecture questions staying analysis-only. On 458 MATH-500 text problems via the OpenCode integration of the same API, the README reports up to 45% cost reduction with no accuracy loss, framing Jev's value as cost allocation. It has no bundled runtime dependencies and does not modify Pi. Documentation is in English and Chinese.

What the decision model decides

TypeQuestionAnswers
Choiceplan_strategydirect · plan_only · plan_then_execute
Choicetiersmall · normal · strong
Choiceoutcomefinish · retry · replan
Choicepermission.action for this tool call—

How it works

  1. At agent start, ask plan_strategy and tier in one request.
  2. Gate tool calls with rules, then Jev, then human/fail-closed.
  3. Before settling, ask outcome.
  4. Allow at most two automatic corrections.

Strengths

  • Up to 45% cost reduction without accuracy loss in the README's benchmark.
  • Bounded corrections prevent loops.
  • No changes to Pi itself.

Caveats

  • Benchmark ran on the OpenCode integration, not plan_strategy.
  • Requires access to the Jev Decisions API.

Getting started

Install the extension into Pi; see scripts/run.sh for launching with model choices.

At a glance

Type
Project
Status
beta
Language
TypeScript
Runtime
Pi extension
Has code
yes

Use cases and integrations

How curated lists describe it

Frequently asked questions

Which decisions are governed?

Plan strategy, model tier, tool permission and outcome.

How many automatic corrections are allowed?

At most two, shared between planning revisions and execution corrections.

Was it benchmarked?

Yes, on MATH-500 via the OpenCode integration, showing up to 45% cost reduction.

Related projects

  • OpenCode V2 server plugin that uses Jev to route requests between Plan, Build and custom agents and hand off unfinished work.

    ProjectbetaTypeScript
  • OpenCode orchestrator that keeps a cheap sticky parent model and escalates to strong child subagents only when Jev flags a hard turn.

    ProjectbetaTypeScript
  • Adaptive thinking-level router for Pi: Jev or local rules pick low/medium/high/xhigh at task start, on reasoning failures and when stable.

    ProjectbetaTypeScript
  • Cursor plugin whose hooks ask Jev whether subagent spawns, file reads, writes and shell commands are worth taking.

    PluginbetaJavaScript
  • Local Laya decision layer for DeepSeek Harness: routes prompts, gates risky tool calls and swaps models, all offline at no token cost.

    Projectbeta
  • Prompt router for Claude Code, Codex and Antigravity that picks model, effort, skill and language per request via Jev.

    ProjectbetaPython