Skip to content

Dashboard report snapshots per scope #786

Description

@SaulMoro

Parent

#752 (item 1, remainder)

What to build

Dashboard report snapshots are kept per scope. The report sends deltas: for each session it compares the current totals with the last reported ones, kept in machine-level reported-*.json snapshots keyed by session. Once #785 is done, no scope reports another scope's sessions. One case still breaks: a session whose events belong to two scopes, for example after a cd into another project mid-session.

session X: events in scope A (3 prompts) and scope B (2 prompts)

shared snapshot                         per-scope snapshot
A reports 3 → snapshot[X] = 3           A: snapshot_A[X] = 3
B: delta = 2 − 3 → wrong                B: delta = 2 − 0 = 2

Move the snapshots next to each scope's data. The first time a scope needs its snapshot, it seeds it from the shared one, so nothing already reported is sent again. After that, the shared file is not read. The user scope's data home is the machine-level directory, so it keeps the existing file.

Acceptance criteria

  • A session split across two scopes is reported correctly to both teams.
  • The first pull after the upgrade sends no delta for sessions that were already reported.
  • A scope's later pulls read and write only its own snapshot.
  • Verified with the real CLI (Claude; git, gitlab, github providers); data-directory design and CHANGELOG updated.

Blocked by

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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