pi-jev-code

September 17, 2026 · View on GitHub

What v0.5.2 fixes

v0.5.2 fixes a v0.5.1 runtime regression where the tool-result hook referenced looksLikeSearchCommand without importing/exporting it from the extracted shell-policy module. The search classifier is now exported from src/policy.js, imported by src/index.ts, and covered by a regression test including heredoc handling.

Single-agent Jev coprocessor for Pi coding sessions. Your normal Pi model remains the only coding agent; there are no planners, subagents, reviewers, task graphs, or orchestration.

What v0.5.1 changes

v0.5.1 is a calibration/observability patch based on a full real coding session plus its v0.5 telemetry:

  1. Strong explicit evidence can resolve an epistemic-only pre-edit block for the same target. If a blocked edit causes the agent to run jev_evidence, and Jev strongly supports that premise (supported >= 0.85, confidence >= 0.70, non-ambiguous), a retry is no longer blocked solely because insufficient_evidence / needs_more_context remain above the soft threshold. Hard scope, target, design, and requirement concerns still block normally.
  2. Block outcomes are observable. preedit_resolution records connect a block to EVIDENCE_ADDED, EVIDENCE_ACCEPTED, EVENTUALLY_APPLIED, or SUPERSEDED, making block usefulness measurable instead of inferential.
  3. Shell mutation accounting covers package installs and formatter/fixer runs. Commands such as pnpm install, pnpm format, eslint --fix, and prettier --write now advance the edit version when they succeed. Deterministic install/format/fix runs do not pay for a Jev pre-edit judgment; dependency-changing commands (add/remove/update), raw redirects, patches, and similar semantic mutations still do. Heredoc payload text is ignored for command classification, so a git commit message mentioning tests no longer becomes a fake verification run.
  4. Automatic search ranking only pays for real repository paths. Parsed candidates that do not resolve to existing paths are dropped before Jev ranking, preventing test-output decorations and separators from becoming fake file candidates.
  5. unresolved_ambiguity telemetry is fixed. It now reads the actual requirement_ambiguity answer rather than a nonexistent answer id.

The final diff hook is explicitly documented as a post-agent-turn audit: PASS is post-hoc confirmation; REVIEW/FAIL can trigger a same-agent follow-up.

What v0.5 adds

v0.5 adds append-only Jev observability telemetry without putting telemetry into the model context. The semantic behavior remains based on the v0.4 full-slice review.

What v0.4 changed

v0.4 was based on a full real coding slice review. It fixes four problems exposed by that run:

  1. Final review now covers committed work. At each real user prompt the extension snapshots git rev-parse HEAD. Jev reviews the diff from that baseline commit to the current working tree, so commits created mid-task are still reviewed. New untracked source/docs files are included too (session-export HTML and generated/vendor directories are ignored).
  2. Pre-edit checks see the cumulative result. For Pi edit calls the extension reconstructs the full target file after the proposed edit and includes the cumulative task diff. Splitting a questionable large write into several small edits no longer hides the resulting file from Jev.
  3. Repository evidence is captured from normal shell reads. Non-mutating cat, sed -n, head, tail, git show/diff/log/status, ls, etc. are added to the recent evidence set, not just Pi read calls and searches. Explicit jev_evidence / jev_decide results are also fed back into later gates.
  4. Search ranking uses the immediate search intent. Automatic ranking sees both the overall user task and the actual rg/grep/find command. Generated/vendor paths are ignored unless the search explicitly targets them.

It also fixes a false mutation classification where commands such as cat package.json 2>/dev/null were treated as writes.

Automatic behavior

Search-result reranking

Parseable rg, grep, git grep, find, and fd results are semantically ranked by Jev after candidate paths are verified to exist in the current repository. The result is appended directly to the tool output.

Pre-edit semantic gate

Before built-in write/edit and common mutating shell commands, Jev sees:

  • the current task,
  • the proposed resulting file/change,
  • the cumulative baseline-to-current task diff,
  • recent repository evidence,
  • explicit Jev evidence checks,
  • recent tests/build/typecheck/lint output.

Hard semantic concerns (out_of_scope, target_mismatch, unsupported_design, requirement_ambiguity) block at 0.80. Pure epistemic concerns (insufficient_evidence, needs_more_context, unclear scope/target) block only at 0.90. A strong explicit jev_evidence support result associated with the same blocked target may resolve an epistemic-only retry; it never overrides a hard concern.

Final diff review

The automatic review is now task baseline → current state, including commits made during the task. It classifies the changed-file scope and treats documentation-only work specially: deliberately deferred executable implementation is not automatically considered a missing test/behavior.

The review also asks unverified_claim: whether a consequential technical/factual claim in the diff still lacks repository evidence or verification. This targets the useful issue that the real slice eventually discovered (an ADR's ESLint guard claim) more directly than a generic test_gap flag.

The automatic diff review runs after an edited agent turn. PASS is a post-hoc audit confirmation; REVIEW/FAIL can trigger a same-agent follow-up. Up to three automatic diff reviews can run in one user task; the third is the capped final audit. No other agent is created.

Explicit tools

  • jev_rank — semantic ranking for custom/LSP candidate sets.
  • jev_evidence — supported / contradicted / insufficient check for a concrete claim.
  • jev_diff — explicit baseline-to-current semantic review.
  • jev_decide — generic batched closed-choice judgments.

Installation / update

Requirements: Pi >= 0.85, Node >= 20, TYPESAFE_API_KEY.

This package still uses the official @typesafe-ai/sdk. Pi loads local-path packages in place, so the npm runtime dependencies must exist in the package directory.

For a fresh install:

cd /path/to/pi-jev-code
./install.sh
pi install "$(pwd)"

For an existing local install that already has node_modules, replace the package files with v0.5.1 and reload Pi. No runtime dependency versions changed. If node_modules is missing:

cd /path/to/pi-jev-code
npm install --omit=dev

Then:

export TYPESAFE_API_KEY='...'
pi

or use /reload if Pi already points to the same directory.

Status / toggles

/jev-code
/jev-code status
/jev-code preedit on|off
/jev-code rank on|off
/jev-code diff on|off

The footer/status line shows automatic Jev activity such as Jev: ranking search…, Jev: checking edit…, and Jev: final diff….

Notes

  • Automatic TypeSafe/API failures fail open with a warning rather than making the repository uneditable.
  • Pre-edit thresholds are still heuristics; calibrate them from real session logs over time.
  • The automatic search parser is intentionally conservative. Use jev_rank for structured LSP candidate sets or unusual output formats.

Observability telemetry (v0.5.1)

Observability is on by default and does not add telemetry text to the model context. The extension appends one JSON object per line to:

.pi/jev-code/telemetry.jsonl

Each new user task receives a fresh taskId. Records include:

  • task_start — task hash/text preview, task baseline commit, package version.
  • search_rank — candidate relevance probabilities, sufficiency, selected best path, latency.
  • preedit — every automatic pre-edit PASS/BLOCK, all risk probabilities, target, stable checkId, evidence/verification counts, hard/soft block state, latency.
  • preedit_resolution — follow-up outcome for blocked targets (EVIDENCE_ADDED, EVIDENCE_ACCEPTED, EVENTUALLY_APPLIED, SUPERSEDED).
  • mutation_applied — confirms that a passed pre-edit check actually executed; linked by checkId when Pi exposes the tool-call id (with a deterministic fallback otherwise).
  • verification — test/lint/typecheck/build execution after the current edit version.
  • evidence_check / decision — explicit jev_evidence and jev_decide outcomes.
  • final_diff — PASS/REVIEW/FAIL, coverage, flags, changed files and edit version.
  • error — Jev checks skipped due to API/runtime failure.

Large source excerpts, diffs, and tool outputs are not written to telemetry. They are represented by hashes and compact metadata so the log stays cheap and avoids duplicating repository contents.

Inspect current-task telemetry counters from Pi:

/jev-code telemetry

Disable/re-enable persistent telemetry:

/jev-code telemetry off
/jev-code telemetry on

The log is intentionally append-only across slices. This makes it possible to measure later whether blocked edits were subsequently corrected, whether close PASSes correlate with later failures, whether low-sufficiency rankings triggered broader searches, and whether final-review concerns predicted another edit/test cycle.