Skip to content

feat(web): complete archive, history, recovery, and fork session lifecycle #347

Description

@sowen1023

Parent

Problem

The Web workbench has a deliberately separate Web Session directory and a partial Session UI. It can create, select, rename, and archive Web Sessions, but archived entries disappear with no archive view or unarchive action. There is no reviewed Session deletion flow, no read-only browser for compatible terminal Pi history, and no real fork/branch operation.

Historical message editing or regeneration must not be simulated by changing browser labels or resending text while presenting it as an in-place mutation.

Value

  • Let users recover archived work and manage Session retention safely.
  • Make existing Pi history discoverable without merging authority or storage.
  • Establish honest branch/fork semantics for iterative work.

Approach constraints

  • Pi Session files and lifecycle remain authoritative; Web indexes are derived.
  • Keep Web-owned Sessions distinguishable from terminal/default Pi Sessions.
  • Historical terminal Sessions are observer-only until an explicit, serialized control-transfer design exists.
  • Deleting sidebar metadata, archiving a Session, and deleting persisted Session data are distinct operations.
  • Destructive deletion requires native reviewed confirmation and an exact canonical target.
  • Resend-as-new-message must remain visibly different from edit, regenerate, branch, or fork.
  • Fork is implemented only against accepted Pi Session semantics with parent provenance and side-effect boundaries.

Acceptance criteria

  • The sidebar has an archived view with bounded pagination/search.
  • Users can unarchive a Session and recover it in its original workspace grouping when valid.
  • Session deletion shows the exact persisted target, uses native confirmation, and has explicit success/failure evidence.
  • Compatible terminal/default Pi Sessions can be discovered and inspected read-only without copying them into Web storage.
  • Session origin, storage source, active controller, and read-only state are visible.
  • Resend-as-new-message is never presented as historical editing.
  • If fork is supported, the new Session records parent Session/turn provenance and does not replay prior side effects.
  • Unsupported edit/regenerate/fork actions remain absent rather than faked.
  • Archive, unarchive, delete, observer history, restart, and corrupt/missing Session cases are tested.
  • Bounded indexing and transcript projection remain enforced.
  • README documents Web-vs-terminal Session behavior.
  • bun run check and bun run test pass.

Related work

Out of scope

  • Simultaneous unordered TUI and Web writes.
  • A second canonical Session store.
  • Cloud Session synchronization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions