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
@@ -1092,6 +1092,56 @@ export const dict: Record<I18nKey, string> = {
'contextRail.surface.git.description': 'コミット・ブランチ・プルリクエスト',
'contextRail.surface.terminal.description': '内蔵ターミナル',
'contextRail.surface.diff.description': '作業中の変更をレビュー',
'contextPanel.mode.walkthrough': 'ウォークスルー',
'contextRail.surface.walkthrough.description': 'AI による変更のガイド付きウォークスルー',
'walkthrough.scope.all': '未コミットすべて',
'walkthrough.scope.group.workingTree': '作業ツリー',
'walkthrough.scope.group.committed': 'コミット済み',
'walkthrough.scope.staged': 'ステージ済み',
'walkthrough.scope.working': '未ステージ',
'walkthrough.scope.branch': 'このブランチ',
'walkthrough.scope.selectorAria': 'レビュー対象を選択',
'walkthrough.scope.pullRequest': 'PR #{number}',
'walkthrough.action.generate': 'ウォークスルーを生成',
'walkthrough.action.regenerate': '再生成',
'walkthrough.action.cancel': 'キャンセル',
'walkthrough.action.next': '次のステップ',
'walkthrough.action.previous': '前のステップ',
'walkthrough.action.refresh': '更新',
'walkthrough.action.open': 'AI ウォークスルー',
'walkthrough.stage.collecting': '変更を集めています',
'walkthrough.stage.asking': 'モデルの応答を待っています',
'walkthrough.stage.assembling': 'ウォークスルーを組み立てています',
'walkthrough.empty.title': 'ウォークスルーはまだありません',
'walkthrough.empty.description': 'この変更を読み進めるためのガイドを作成します。スモールモデルを呼び出してトークンを消費するため、実行は明示的な操作時のみです。',
'walkthrough.stale.banner': 'このレビュー後にコードが変更されました。古くなったステップ: {count}',
'walkthrough.stop.staleAll': 'このステップが説明していたコードはすべて変更されました。',
'walkthrough.stop.stalePartial': 'このステップが説明していたコードの一部が変更されました。失われた箇所: {count}',
'walkthrough.stop.staleShort': '古い内容',
'walkthrough.stop.noCode': 'このステップのコードは現在の差分にありません。',
'walkthrough.uncovered.title': 'レビューが扱わなかった変更: {count}',
'walkthrough.uncovered.description': 'レビューは定型的と判断しました。展開してご自身で確認できます。',
'walkthrough.toc.moreFiles': 'その他のファイル: {count}',
'walkthrough.toc.uncovered': '未対応: {count}',
'walkthrough.toc.resize': '目次の列幅を変更',
'walkthrough.importance.critical': '重要',
'walkthrough.importance.context': '補足',
'walkthrough.blocked.noModel.title': '利用できるスモールモデルがありません',
'walkthrough.blocked.noModel.description': 'レビューを生成するにはモデルプロバイダーにサインインしてください。',
'walkthrough.blocked.emptyDiff.title': 'レビュー対象がありません',
'walkthrough.blocked.emptyDiff.description': 'この範囲にはまだ変更がありません。',
'walkthrough.blocked.contextTooSmall.title': 'この差分は現在のモデルには大きすぎます',
'walkthrough.blocked.contextTooSmall.description': '{model} が扱えるのは約 {available} 千文字ですが、この差分には約 {required} 千文字が必要です。切り詰めは行いません。コンテキストの大きいモデルを選んでください。',
'walkthrough.blocked.structuredOutput.title': 'このモデルは構造化出力に対応していません',
'walkthrough.blocked.structuredOutput.description': '{model} はウォークスルーに必要な構造化応答をサポートしていません。',
'walkthrough.blocked.chooseModel': 'スモールモデルを選択',
'walkthrough.blocked.outputExhausted.title': 'モデルの出力枠が尽きました',
'walkthrough.blocked.outputExhausted.description': '{model} は出力枠をすべて推論に使い、回答を返しませんでした。推論モデルは大きな差分でよくこうなります。推論の少ないモデルを選ぶか、対象範囲を絞ってください。',
'walkthrough.blocked.outputExhausted.descriptionUnknownModel': 'スモールモデルは出力枠をすべて推論に使い、回答を返しませんでした。推論モデルは大きな差分でよくこうなります。推論の少ないモデルを選ぶか、対象範囲を絞ってください。',
'walkthrough.blocked.onlyGenerated.title': '生成ファイルのみが変更されています',
'walkthrough.blocked.onlyGenerated.description': 'ここでの変更はロックファイルなどツールが生成した出力だけで、レビューは意図的にこれらを対象外にしています。',
'walkthrough.blocked.contextTooSmall.descriptionUnknownModel': 'スモールモデルが扱えるのは約 {available} 千文字ですが、この差分には約 {required} 千文字が必要です。切り詰めは行いません。コンテキストの大きいモデルを選んでください。',
'walkthrough.blocked.structuredOutput.descriptionUnknownModel': 'スモールモデルはウォークスルーに必要な構造化応答をサポートしていません。',
'contextRail.surface.plan.description': '現在のプランを表示',
'contextRail.surface.pr.description': '現在のブランチのプルリクエストを作成・確認・マージ',
'contextRail.surface.notes.description': 'プロジェクトのノート・ToDo・プラン',