pi-jev-governor
Decision governor for Pi routing plan strategy, model tier, tool permissions and outcome (finish, retry, replan) through Jev.
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
| Type | Question | Answers |
|---|---|---|
| Choice | plan_strategy | direct · plan_only · plan_then_execute |
| Choice | tier | small · normal · strong |
| Choice | outcome | finish · retry · replan |
| Choice | permission.action for this tool call | — |
How it works
- At agent start, ask plan_strategy and tier in one request.
- Gate tool calls with rules, then Jev, then human/fail-closed.
- Before settling, ask outcome.
- 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
A governor for the pi coding agent: routes plan strategy, model-tier routing…
wh000wh000/awesome-jev-live
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.
ProjectbetaTypeScriptOpenCode orchestrator that keeps a cheap sticky parent model and escalates to strong child subagents only when Jev flags a hard turn.
ProjectbetaTypeScriptAdaptive thinking-level router for Pi: Jev or local rules pick low/medium/high/xhigh at task start, on reasoning failures and when stable.
ProjectbetaTypeScriptCursor plugin whose hooks ask Jev whether subagent spawns, file reads, writes and shell commands are worth taking.
PluginbetaJavaScriptLocal Laya decision layer for DeepSeek Harness: routes prompts, gates risky tool calls and swaps models, all offline at no token cost.
ProjectbetaPrompt router for Claude Code, Codex and Antigravity that picks model, effort, skill and language per request via Jev.
ProjectbetaPython