Rework edit prediction CLI (#44562)

This PR restructures the commands of the Edit Prediction CLI (now called
`ep`), to support some flows that are important for the training
process:
* generating zeta2 prompt and expected output, without running
predictions
* scoring outputs that are generated by a system other than the
production code (to evaluate the model during training)

To achieve this, we've restructured the CLI commands so that they all
take as input, and produce as output, a consistent, uniform data format:
a set of one or more `Example` structs, expressible either as the
original markdown format, or as a JSON lines. The `Example` struct
starts with the basic fields that are in human-readable eval format, but
contain a number of optional fields that are filled in by different
steps in the processing pipeline (`context`, `predict`, `format-prompt`,
and `score`).

### To do

* [x] Adjust the teacher model output parsing to use the full buffer
contents
* [x] Move udiff to cli
* [x] Align `format-prompt` with Zeta2's production code
* [x] Change score output to assume same provider
* [x] Move pretty reporting to `eval` command
* [x] Store cursor point in addition to cursor offset
* [x] Rename `edit_prediction_cli2` -> `edit_prediction_cli` (nuke the
old one)

Release Notes:

- N/A

---------

Co-authored-by: Oleksiy Syvokon <oleksiy@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Ben Kunkle <ben@zed.dev>
This commit is contained in:
Max Brunsfeld
2025-12-10 17:36:51 -08:00
committed by GitHub
parent 37077a8ebb
commit 25d74480aa
44 changed files with 2502 additions and 4801 deletions

30
Cargo.lock generated
View File

@@ -3111,16 +3111,6 @@ dependencies = [
"uuid",
]
[[package]]
name = "cloud_zeta2_prompt"
version = "0.1.0"
dependencies = [
"anyhow",
"cloud_llm_client",
"indoc",
"serde",
]
[[package]]
name = "cmake"
version = "0.1.54"
@@ -5119,7 +5109,6 @@ dependencies = [
"clock",
"cloud_api_types",
"cloud_llm_client",
"cloud_zeta2_prompt",
"collections",
"copilot",
"credentials_provider",
@@ -5150,8 +5139,6 @@ dependencies = [
"serde",
"serde_json",
"settings",
"smol",
"strsim",
"strum 0.27.2",
"telemetry",
"telemetry_events",
@@ -5162,6 +5149,7 @@ dependencies = [
"workspace",
"worktree",
"zed_actions",
"zeta_prompt",
"zlog",
]
@@ -5175,11 +5163,10 @@ dependencies = [
"clap",
"client",
"cloud_llm_client",
"cloud_zeta2_prompt",
"collections",
"debug_adapter_extension",
"dirs 4.0.0",
"edit_prediction",
"edit_prediction_context",
"extension",
"fs",
"futures 0.3.31",
@@ -5209,9 +5196,10 @@ dependencies = [
"sqlez",
"sqlez_macros",
"terminal_view",
"toml 0.8.23",
"util",
"wasmtime",
"watch",
"zeta_prompt",
"zlog",
]
@@ -5239,6 +5227,7 @@ dependencies = [
"text",
"tree-sitter",
"util",
"zeta_prompt",
"zlog",
]
@@ -5260,7 +5249,6 @@ dependencies = [
"buffer_diff",
"client",
"cloud_llm_client",
"cloud_zeta2_prompt",
"codestral",
"command_palette_hooks",
"copilot",
@@ -5291,6 +5279,7 @@ dependencies = [
"util",
"workspace",
"zed_actions",
"zeta_prompt",
]
[[package]]
@@ -20933,6 +20922,13 @@ dependencies = [
"syn 2.0.106",
]
[[package]]
name = "zeta_prompt"
version = "0.1.0"
dependencies = [
"serde",
]
[[package]]
name = "zip"
version = "0.6.6"