Frozen state: start cold rebuilds and inspection from the latest whole copy

オープン
#5,324 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Read the implementation of recoverStateContext, createRunStateHydrator, and workflow inspect, along with the events API and the whole-copy format described in #5215. First trace how each reader currently pages and applies events; then investigate descending pagination, skip-step-inputs, multi-log inputs, and StateSrcV1 hook payloads. Done means the three readers can start from the latest usable whole copy while replay still reads the full log.

索引モデルが issue の本文から書いたものです。

説明

Follow-up from #5215.

Frozen state is now written whole each time it doubles, and after every 1,000 changes, so a rebuild never has to apply more than about the value's own size of changes. But every reader still reads the run's log from the start:

  • cold recovery (recoverStateContext) pages through every event from the beginning;
  • the o11y hydrator (createRunStateHydrator) and workflow inspect do the same.

So the whole copies bound the apply work, not the read. On a 180-turn eve session, a cold rebuild at turn 180 took 228 ms: 60 ms parsing and 168 ms applying, both proportional to the whole log.

Proposal: have these readers read the log newest-first until they reach the latest whole copy of each version they need, then apply forward from there. A cold read is then bounded by about twice the value's size rather than the length of the run. Replay is unaffected: it reads the full log anyway.

Open questions:

  • the events API needs to support descending pages with skip-step-inputs;
  • a step input can refer to more than one log, so the reader has to keep going until every needed log has reached a whole copy;
  • hook payloads that hold strings a patch refers to (StateSrcV1) may come before that whole copy.

🤖 Generated with Claude Code

主要言語
TypeScript
スター
2.5k
フォーク
401
平均マージ
1日 21時間
マージ済み PR(30日)
201

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

vercel/workflow のほかの issue

vercel/workflow の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。