terraphim / terraphim/terraphim-ai

Evaluate: Tree-structured session storage (Pi pattern) for terraphim_persistence

Offen
#683 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

enhancement
Vorherrschende Sprache
Rust
Sterne
62
Forks
5
Ø Merge
2 Std. 27 Min.
Gemergte PRs (30 T.)
1

Beschreibung

Parent Epic

#682 -- Evaluate Pi architectural patterns

Pattern

Pi (badlogic/pi-mono) uses tree-structured JSONL for session storage. Each entry has id and parentId fields, enabling in-place branching without creating new files. A visual /tree navigator lets users jump to any point and continue from there. All branches are preserved in a single file.

Current State

  • terraphim_persistence (#637-#642) plans to use Persistable trait + DeviceStorage with SQLite/redb backends
  • Claude Code uses linear JSONL with lossy auto-compaction (no branching within a session)
  • ADF session persistence (#639) captures Claude Code's --output-format stream-json output as linear JSONL
  • terraphim-agent sessions import reads linear JSONL from ~/.claude/projects/

Evaluation Questions

  1. Does tree-structured JSONL improve debugging and replay for ADF agent sessions? Current linear format loses context on compaction. Tree format preserves all branches.
  2. Is the id/parentId overhead justified? Each entry gains two fields. Measure storage and parse overhead for typical 500-2000 message sessions.
  3. Can tree structure coexist with Claude Code's linear format? terraphim-agent imports Claude Code sessions. If we adopt tree format internally, we need a conversion layer.
  4. Does the tree structure enable new capabilities? E.g., comparing different agent approaches on the same prompt, replaying from a checkpoint with different models.

Acceptance Criteria

  • Document trade-offs (storage overhead, parsing complexity, tooling requirements)
  • Prototype tree-structured session format for terraphim_persistence
  • Benchmark parse performance vs linear JSONL for 1000+ entry sessions
  • Decision: adopt, adapt, or reject with rationale

References

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Start with terraphim_persistence (#637) and ADF session persistence (#639), then read the linked Pi session format. Prototype the id/parentId JSONL approach and compare parsing and storage for 1000+ entries against the current linear format. Document trade-offs and finish with an adopt, adapt, or reject decision.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
rust
Bereich
backend
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.