Skip to content

Each scope reports only the dashboard sessions recorded in it #785

Description

@SaulMoro

Parent

#752 (items 1 and 4)

What to build

Each scope reports only the dashboard sessions recorded in it. Today every scope reads one machine-wide event stream and tells its own sessions apart by a cwd string prefix. That breaks in three ways: Copilot sends no cwd, a symlinked or /tmp vs /private/tmp path never matches, and the user scope excludes nothing, so it reports every project's sessions.

 hook event
-  → events.jsonl { cwd?, … }
+  → events.jsonl { scope: <dataHome key of the resolved scope>, cwd?, … }

 report for scope S
-  keep events whose cwd starts with S's root      (user scope: keep everything)
+  keep events whose scope is S
+  events written before this change (no scope):
+    project → its cwd, realpath'd, is under the project root
+    user    → never

The event stream stays machine-wide: the teamai dashboard UI, stats --by-repo, session save and the contribute check read across scopes, and the data-directory design documents it as a machine-level singleton. The hook dispatcher already knows the scope when it writes, since #769 hands every handler the config it resolved.

Also: document how to remove a skill entry that was pushed before #748 from stats/<user>.yaml on teamai-reports by hand. Those events carry no cwd, so nothing can attribute them after the fact. Docs only, no command.

Acceptance criteria

  • A user-scope pull does not report a session recorded in project P; P's own pull still does.
  • A Copilot session in P is reported by P.
  • A session started under a symlinked path of P is reported by P.
  • Old events without a scope go to their project, never to the user scope.
  • The dead excludeProjectRoots path is gone.
  • The usage guide (both languages) explains the manual stats/<user>.yaml cleanup; data-directory design and CHANGELOG updated.
  • Verified with the real CLI (Claude; git, gitlab, github providers).

Blocked by

None (can start immediately).

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