Skip to content

init UX: silently adopts pre-existing .rstack/ with stale runs — no warning, no --fresh/--archive option #99

@richardsongunde

Description

@richardsongunde

Summary

npx rstack-agents init on a directory that already contains .rstack/ reports only .rstack/ (already exists) and proceeds. If that folder holds runs from earlier sessions (or another person's experiments), the user's first impression is that init 'pulled old data into a fresh project' — there is no signal distinguishing 'I created a fresh workspace' from 'I adopted an existing one with N stale runs'.

This is exactly what a business user hits: they expect init = clean slate, then open the Business Hub and see runs/approvals/events they never created.

Observed

  • ensureStateDir() in src/integrations/init.js only pushes .rstack/ (already exists) to the skipped list.
  • The report never mentions how many existing runs/approvals were found.
  • There is no --fresh (archive existing runs and start clean) or even a hint that .rstack/runs/ contains prior history.

Proposal

  1. When .rstack/ exists, count runs/ entries and surface it in the init report, e.g.:
    .rstack/ (already exists — 2 prior runs preserved; use --fresh to archive them)
  2. Add --fresh: move existing runs/, approvals.jsonl, memory/, registry/ into .rstack/archive/<timestamp>/ (never delete), then initialize clean.
  3. Document in README that init is adopt-don't-overwrite, and that prior run state is preserved by design.

Related: #98 (stale runs are also live-written by new sessions, which compounds the confusion).
Happy to submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions