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
@@ -919,6 +919,56 @@ export const dict = {
'contextRail.surface.git.description': 'Commits, branches et pull requests',
'contextRail.surface.terminal.description': 'Terminal intégré',
'contextRail.surface.diff.description': 'Passer en revue les modifications',
'contextPanel.mode.walkthrough': 'Parcours',
'contextRail.surface.walkthrough.description': 'Un parcours de vos modifications guidé par l’IA',
'walkthrough.scope.all': 'Tout non validé',
'walkthrough.scope.group.workingTree': 'Copie de travail',
'walkthrough.scope.group.committed': 'Validé',
'walkthrough.scope.staged': 'Indexées',
'walkthrough.scope.working': 'Non indexées',
'walkthrough.scope.branch': 'Cette branche',
'walkthrough.scope.selectorAria': 'Choisir ce qui est examiné',
'walkthrough.scope.pullRequest': 'PR n° {number}',
'walkthrough.action.generate': 'Générer le parcours',
'walkthrough.action.regenerate': 'Régénérer',
'walkthrough.action.cancel': 'Annuler',
'walkthrough.action.next': 'Étape suivante',
'walkthrough.action.previous': 'Étape précédente',
'walkthrough.action.refresh': 'Actualiser',
'walkthrough.action.open': 'Parcours IA',
'walkthrough.stage.collecting': 'Collecte des modifications',
'walkthrough.stage.asking': 'En attente du modèle',
'walkthrough.stage.assembling': 'Assemblage du parcours',
'walkthrough.empty.title': 'Aucun parcours pour l’instant',
'walkthrough.empty.description': 'Construisez un parcours de lecture guidé à travers ces modifications. Cela appelle le petit modèle et consomme des jetons, donc rien ne se lance sans votre demande.',
'walkthrough.stale.banner': 'Le code a changé après cette revue. Étapes obsolètes : {count}',
'walkthrough.stop.staleAll': 'Tout le code décrit par cette étape a changé.',
'walkthrough.stop.stalePartial': 'Une partie du code décrit par cette étape a changé. Fragments manquants : {count}',
'walkthrough.stop.staleShort': 'Obsolète',
'walkthrough.stop.noCode': 'Le code de cette étape est absent du diff actuel.',
'walkthrough.uncovered.title': 'Modifications non traitées par la revue : {count}',
'walkthrough.uncovered.description': 'La revue les a jugées courantes. Dépliez pour les vérifier vous-même.',
'walkthrough.toc.moreFiles': 'Autres fichiers : {count}',
'walkthrough.toc.uncovered': 'Non traité : {count}',
'walkthrough.toc.resize': 'Redimensionner la colonne du sommaire',
'walkthrough.importance.critical': 'Critique',
'walkthrough.importance.context': 'Contexte',
'walkthrough.blocked.noModel.title': 'Aucun petit modèle disponible',
'walkthrough.blocked.noModel.description': 'Connectez-vous à un fournisseur de modèles pour générer une revue.',
'walkthrough.blocked.emptyDiff.title': 'Rien à examiner',
'walkthrough.blocked.emptyDiff.description': 'Il n’y a encore aucune modification dans cette portée.',
'walkthrough.blocked.contextTooSmall.title': 'Ce diff est trop volumineux pour le modèle actuel',
'walkthrough.blocked.contextTooSmall.description': '{model} accepte environ {available} k caractères et ce diff en demande environ {required} k. Rien n’est tronqué : choisissez un modèle au contexte plus large.',
'walkthrough.blocked.structuredOutput.title': 'Ce modèle ne produit pas de sortie structurée',
'walkthrough.blocked.structuredOutput.description': '{model} ne prend pas en charge les réponses structurées nécessaires à un parcours.',
'walkthrough.blocked.chooseModel': 'Choisissez le petit modèle',
'walkthrough.blocked.outputExhausted.title': 'Le modèle a épuisé son budget de réponse',
'walkthrough.blocked.outputExhausted.description': '{model} a dépensé toute sa marge de sortie en raisonnement et n’a rien renvoyé. Les modèles de raisonnement le font souvent sur de gros diffs : essayez un modèle qui réfléchit moins, ou une portée plus étroite.',
'walkthrough.blocked.outputExhausted.descriptionUnknownModel': 'Le petit modèle a dépensé toute sa marge de sortie en raisonnement et n’a rien renvoyé. Les modèles de raisonnement le font souvent sur de gros diffs : essayez un modèle qui réfléchit moins, ou une portée plus étroite.',
'walkthrough.blocked.onlyGenerated.title': 'Seuls des fichiers générés ont changé',
'walkthrough.blocked.onlyGenerated.description': 'Toutes les modifications concernent des fichiers de verrouillage ou d’autres sorties générées, que la revue ignore délibérément.',
'walkthrough.blocked.contextTooSmall.descriptionUnknownModel': 'Le petit modèle accepte environ {available} k caractères et ce diff en demande environ {required} k. Rien n’est tronqué : choisissez un modèle au contexte plus large.',
'walkthrough.blocked.structuredOutput.descriptionUnknownModel': 'Le petit modèle ne prend pas en charge les réponses structurées nécessaires à un parcours.',
'contextRail.surface.plan.description': 'Voir le plan actuel',
'contextRail.surface.pr.description': 'Créer, relire et fusionner la pull request de la branche actuelle',
'contextRail.surface.notes.description': 'Notes, tâches et plans du projet',