feat(walkthrough): guided AI walkthrough for diffs, branches, and PRs (#2572)

A diff is ordered by file path, which is almost never the order in which a
change makes sense. This adds a Walkthrough surface that reorders it: the model
groups related hunks into stops, explains what each group changes about
behavior, and orders the stops so each builds on the last. It explains and
orders; judging code stays with the existing Review action.

Reviews uncommitted work (all, staged, unstaged), a branch against its base, or
a pull request. Generation is always user-initiated — nothing runs on a timer,
on a file change, or as a side effect of opening a panel.

Invariants worth preserving:

- Hunk identity is derived on the server and only there. Ids are content
  hashes, so an anchor that no longer resolves is proof the code it described
  changed, and staleness needs no heuristics. The client matches ids to ids and
  never recomputes them; two implementations would have to agree forever.
- The digest is never truncated. A diff that does not fit the model's context
  is refused with an actionable reason, because a walkthrough written against
  half a diff reads as confident and is wrong.
- Nothing disappears. Lockfiles and other generated output are excluded from
  the model's input by name — never by size — and everything no stop covers is
  listed at the end, so "have I seen all of it" stays answerable.
- Cost is explicit. Results are content-addressed, so returning the working
  tree to an earlier state costs nothing; generation outlives its request, so a
  refresh detaches the client rather than discarding paid-for work, and only an
  explicit cancel stops it.

Supporting changes to shared modules:

- git: expose the existing getRangeDiff as GET /api/git
  listUntrackedPaths and getUntrackedDiffs. The latter resolve the repository
  once for a batch instead of per file, taking a panel
  ~340ms on an 80-file working tree.
- small-model: structured output across four wire forma
  and abort signal, and an onOverflow policy so an oversized prompt fails
  loudly instead of being silently clipped. A provider
  remembered so the prompt-side fallback goes first next time.
- models.dev metadata: surface structured_output as tri
  false blocks a model, a missing field does not, because the catalog omits it
  for roughly half of all models.

Desktop and tablet only: VS Code serves Git through its
these routes, and the mobile shell does not consume the surface registry.

Docs: packages/docs walkthrough page in English and all eight locales.
This commit is contained in:
Bohdan Triapitsyn
2026-08-02 16:22:55 +03:00
committed by GitHub
parent b1ec34162e
commit 34d0ff7383
99 changed files with 7316 additions and 53 deletions
+50
View File
@@ -1096,6 +1096,56 @@ export const dict: Record<I18nKey, string> = {
"contextRail.surface.git.description": "Commits, ramas y pull requests",
"contextRail.surface.terminal.description": "Terminal integrada",
"contextRail.surface.diff.description": "Revisar cambios en curso",
"contextPanel.mode.walkthrough": "Recorrido",
"contextRail.surface.walkthrough.description": "Un recorrido por tus cambios guiado por IA",
"walkthrough.scope.all": "Todo sin confirmar",
"walkthrough.scope.group.workingTree": "Árbol de trabajo",
"walkthrough.scope.group.committed": "Confirmado",
"walkthrough.scope.staged": "Preparados",
"walkthrough.scope.working": "Sin preparar",
"walkthrough.scope.branch": "Esta rama",
"walkthrough.scope.selectorAria": "Elegir qué revisar",
"walkthrough.scope.pullRequest": "PR n.º {number}",
"walkthrough.action.generate": "Generar recorrido",
"walkthrough.action.regenerate": "Regenerar",
"walkthrough.action.cancel": "Cancelar",
"walkthrough.action.next": "Paso siguiente",
"walkthrough.action.previous": "Paso anterior",
"walkthrough.action.refresh": "Actualizar",
"walkthrough.action.open": "Recorrido con IA",
"walkthrough.stage.collecting": "Reuniendo los cambios",
"walkthrough.stage.asking": "Esperando al modelo",
"walkthrough.stage.assembling": "Montando el recorrido",
"walkthrough.empty.title": "Todavía no hay recorrido",
"walkthrough.empty.description": "Crea una ruta de lectura guiada por estos cambios. Esto llama al modelo pequeño y consume tokens, así que solo se ejecuta cuando lo pides.",
"walkthrough.stale.banner": "El código cambió después de esta revisión. Pasos desactualizados: {count}",
"walkthrough.stop.staleAll": "Todo el código que describía este paso ha cambiado.",
"walkthrough.stop.stalePartial": "Parte del código que describía este paso ha cambiado. Fragmentos perdidos: {count}",
"walkthrough.stop.staleShort": "Desactualizado",
"walkthrough.stop.noCode": "El código de este paso no está en el diff actual.",
"walkthrough.uncovered.title": "Cambios que la revisión omitió: {count}",
"walkthrough.uncovered.description": "La revisión los consideró rutinarios. Despliega para revisarlos tú mismo.",
"walkthrough.toc.moreFiles": "Más archivos: {count}",
"walkthrough.toc.uncovered": "Sin cubrir: {count}",
"walkthrough.toc.resize": "Cambiar el ancho de la columna de contenidos",
"walkthrough.importance.critical": "Crítico",
"walkthrough.importance.context": "Contexto",
"walkthrough.blocked.noModel.title": "No hay ningún modelo pequeño disponible",
"walkthrough.blocked.noModel.description": "Inicia sesión en un proveedor de modelos para generar una revisión.",
"walkthrough.blocked.emptyDiff.title": "Nada que revisar",
"walkthrough.blocked.emptyDiff.description": "Todavía no hay cambios en este ámbito.",
"walkthrough.blocked.contextTooSmall.title": "Este diff es demasiado grande para el modelo actual",
"walkthrough.blocked.contextTooSmall.description": "{model} admite unos {available} mil caracteres y este diff necesita unos {required} mil. No se recorta nada: elige un modelo con más contexto.",
"walkthrough.blocked.structuredOutput.title": "Este modelo no puede generar salida estructurada",
"walkthrough.blocked.structuredOutput.description": "{model} no admite las respuestas estructuradas que necesita un recorrido.",
"walkthrough.blocked.chooseModel": "Elige el modelo pequeño",
"walkthrough.blocked.outputExhausted.title": "El modelo se quedó sin presupuesto de respuesta",
"walkthrough.blocked.outputExhausted.description": "{model} gastó todo su margen de salida razonando y no devolvió nada. Los modelos de razonamiento suelen hacerlo con diffs grandes: prueba con un modelo que razone menos o revisa un ámbito más reducido.",
"walkthrough.blocked.outputExhausted.descriptionUnknownModel": "El modelo pequeño gastó todo su margen de salida razonando y no devolvió nada. Los modelos de razonamiento suelen hacerlo con diffs grandes: prueba con un modelo que razone menos o revisa un ámbito más reducido.",
"walkthrough.blocked.onlyGenerated.title": "Solo cambiaron archivos generados",
"walkthrough.blocked.onlyGenerated.description": "Todos los cambios son archivos de bloqueo u otra salida generada por herramientas, que la revisión omite a propósito.",
"walkthrough.blocked.contextTooSmall.descriptionUnknownModel": "El modelo pequeño admite unos {available} mil caracteres y este diff necesita unos {required} mil. No se recorta nada: elige un modelo con más contexto.",
"walkthrough.blocked.structuredOutput.descriptionUnknownModel": "El modelo pequeño no admite las respuestas estructuradas que necesita un recorrido.",
"contextRail.surface.plan.description": "Ver el plan actual",
"contextRail.surface.pr.description": "Crea, revisa y fusiona el pull request de la rama actual",
"contextRail.surface.notes.description": "Notas, tareas y planes del proyecto",