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

Aperta
#5,324 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
42/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
TypeScript
Stelle
2.5k
Fork
401
Merge medio
1g 21h
PR unite (30g)
201

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di vercel/workflow

Tutte le issue di vercel/workflow

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.