yibie/jev-engineering-zh
A Chinese translation (with original source notes) of a design essay synthesizing TypeSafe founder Diogo Almeida's notes on 'Jev,' a typed decision model that drives a coding-agent harness. It argues coding agents are simple loops whose real leverage lies in how context is assembled each turn, and works through six problems inherited from KV-cache-driven, append-only context design: costly model routing, tool-schema bloat, lossy compaction, rare sub-agents, destructive session restarts, and the built-in-capabilities tradeoff. It proposes fixes including query-aware context scoring/visibility tiers, cost-aware routing that accounts for cache reprocessing, tiered tool disclosure, conditional AGENTS.md loading, and shared read-only background retrieval.
What it claims
This is a full Chinese translation of a 12-page design essay ("2026 Jev 工程实践工作笔记") synthesizing TypeSafe founder Diogo Almeida's notes on building a coding-agent harness around Jev, a decision model returning typed choice, score, and noul outputs each with a probability. The central claim the summary names but does not quantify: routing "simple" work to cheap models loses money not because cheap models are weak, but because moving context down and back reprocesses tokens. The essay carries the arithmetic, an independent measurement, and a policy-DSL sketch that the summary omits.
What the page adds beyond the summary
The routing arithmetic, with prices. Using Opus ($5 in / $25 out per Mtok) and Sonnet ($3 / $15): pure Opus costs 25Y + 5Z; the Opus→Sonnet→Opus path costs 3X + 20Y + 8Z (X = context tokens, Y = output, Z = tokens read mid-work). For a session shape of X=0.65, Y=0.12, Z=0.23, pure Opus = 4.15 vs routed = 6.19 — the frontier-only path is ~two-thirds the cost of the "cheaper" route. The lesson: routing priced per-token rather than per-context-rebuild is wrong.
A retrieval-dominance measurement. The essay's own token-share table estimates reads/search/command-output at ~two-thirds of processed tokens, with code-writing under one-tenth. Independently, Microsoft's fastcontext project reports that on GPT-5.4 trajectories, reads and searches were 56.2% of tool-call turns and 46.5% of main-agent tokens. This grounds the claim that the biggest efficiency win is smarter retrieval, not better models or diff formats.
A permission policy as programmable query (the "exec" policy example): deny if a command touches ~/.ssh or .env*; deny if script contents contain network egress and task.scope != "deploy"; ask if writing outside repo root; allow read-only sets. Notably it proposes reading Python/shell file contents before execution, not just approving command names.
Repo structure the reader should know: two documents ship. The root is the formalized compiled notes (tabled "six symptoms," seven figures). source-notes/ holds the author's raw notes, containing material the compiled version drops — SLOP subtask decomposition, the original tweets cited in Appendix 2, and the author's reasoning chain. Read together they show the notes→essay editing process.
Provenance and limits
- Independent compilation, not affiliated with or endorsed by TypeSafe. The core argument, routing math, six symptoms, and proposed features come from Almeida's notes given to the compiler.
- Model prices are "as used in the notes; may have changed." The token-share table is an illustrative estimate, not measured; only the fastcontext figures are external data.
- This is a design/synthesis document — there is no code, no implementation, no benchmark of a built harness. Referenced tools (headroom, rtk, ast-grep, ast-outline, fastcontext, fff; recursive language models per A. Zhang 2025) are pointers, not deliverables here.
- Original source:
assets/original.pdf, plusassets/original-text.txtand 7 figures cropped at 300 DPI infigures/.
Read this if you want the concrete economic argument against naive model routing and the case for query-aware, addressable context; skip it if you need working code.
Technologies named here
- Opus
- Jev
- Sonnet
- Claude Code
- GPT-5.4
- Codex
- AGENTS.md
- Model Context Protocol
- Headroom
- rtk
- ast-grep
- ast-outline
- fastcontext
- fff
Techniques named here
- Jev 决策调用
- KV cache 复用与失效
- 按上下文重建定价的路由
- 查询感知的压缩 / 可见性阶梯
- 分级工具披露
- 条件化 AGENTS.md 指令
- 可编程权限策略
- 意图到工具调用的中介
- 子目标去重
- 共享只读后台检索
- 按文件敏感度/信任路由
- 读写显式区分的并发控制
Also named here
- Diogo Almeida
Related in coding-agents
