Support for stream forking (Stream-Forked-From / Stream-Fork-Offset) per the Durable Streams protocol

Aperta
#16 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

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

Direzione di ricerca

Start by reading FEATURES.md and docs/durable-streams-spec.md, then compare the PUT /v1/stream/{name} behavior with the Durable Streams fork section and its Stream-Forked-From and Stream-Fork-Offset headers. Done means new streams inherit data through the requested offset, source deletion remains readable through active forks, direct source access returns 410 Gone, and garbage collection waits for the last fork.

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

Descrizione

The base Durable Streams protocol defines stream forking via PUT with Stream-Forked-From and Stream-Fork-Offset headers (copy-on-write, refcounted soft-delete on the source when forks are still active). This server doesn't implement it, and it isn't listed as a known gap anywhere I could find — not in FEATURES.md, and the vendored docs/durable-streams-spec.md doesn't include the fork section at all (its own §4.2 is "List streams").

Use case: we run per-conversation durable streams for a chat agent (StreamDB/state-protocol on top of prisma/streams). When a user edits an earlier message or regenerates a reply, the natural model is a branch: fork the conversation stream at the edited turn's offset, keep the original branch addressable, and let the new branch diverge. Without server-side fork support, we're limited to destructive supersede (delete-and-rewrite rows in place), which loses the ability to keep multiple branches alive or let a user switch back to an earlier one.

Proposed behavior (matching the protocol spec):

  • PUT /v1/stream/{name} with Stream-Forked-From: and Stream-Fork-Offset: creates a new stream that inherits all data from the source up to that offset.
  • Source and fork may implement inheritance via copy-on-write or pointer-stitching — implementation detail, not prescribed by the protocol.
  • Deleting a stream with active forks soft-deletes it (410 Gone to direct access) while forks can still read the inherited range; GC once the last referencing fork is deleted.

Alternatives considered: row-level supersede (what we do today) — works, but is destructive and can't represent multiple live branches of the same conversation, which is the actual UX we're after.

Happy to help test against a real implementation, or contribute if there's appetite for a PR — wanted to check whether this is a deliberate scope exclusion before writing one.

Lingua principale
Rust
Stelle
8
Fork
2
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 prisma/streams

Tutte le issue di prisma/streams

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.