feat(pi-session-deck): add session identity layer with Git/PR resolution#93
Open
robhowley wants to merge 8 commits into
Open
feat(pi-session-deck): add session identity layer with Git/PR resolution#93robhowley wants to merge 8 commits into
robhowley wants to merge 8 commits into
Conversation
- add SessionIdentityRecord type and identity store (~/.pi/session-deck/identity/) - add atomic identity writer (mkdirp + write + rename) - add Git info resolver (worktree, branch, remote, root) and PR URL resolver (gh CLI + remote fallback) - add identity collector gathering sessionManager + Git + process fields - add identity runtime with 45s periodic refresh, lifecycle caching - add joined session reader merging presence + identity by runtimeId - add /session-deck --identity flag and identity column in output - update index.ts to start identity runtime on session_start, refresh on /new - add 3 new test files (git, writer, reader) covering 16 identity tests - bump to v0.3.0
…avoid real config file in tests - add optional configPath parameter to loadConfig() - update config-logger test to pass non-existent path, isolating from real ~/.pi/agent/yolo-seatbelt.json
… EOF corrections - fix missing newline at end of 4 test files - reformat long import lines - add optional configPath param to loadConfig
…ain edits - Restore CHANGELOG.md and package.json to main (no manual edits) - Restore README.md to main, then cleanly add description, commands, and 'What it provides' section without architecture file tree
…dic identity refreshes
The 45s periodic refresh in runtime.ts was calling refreshIdentity('periodic') without a\nsessionManager reference, causing collector.ts to fall back to sessionId=null and\nsessionFile=null on every periodic refresh. Now sessionManager is captured once on\nthe initial startup call and reused across all subsequent periodic refreshes.
…StartedAt, diagnostics, PR fallback, tests Issue 1: Store sessionManager in runtime state so periodic refreshes don't lose session context. Issue 2: Preserve sessionStartedAt across refreshes via existingRecord passer. Issue 3: Emit granular diagnostics from collector (session_id_missing, not_git_repo, detached_head, pr_ambiguous, etc.). Issue 4: PR fallback now returns null+pr_ambiguous instead of constructing fake .../pull/<branch> URLs. Issue 5: Add identity-collector.test.ts (6 tests) and identity-runtime.test.ts (10 tests) covering periodic refresh, /new, sessionStartedAt preservation, and singleton behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Session Identity Layer (P2)
Adds a persistent session identity layer to pi-session-deck, stored separately from heartbeat presence data. Enables the deck to show Git context, PR URLs, and session metadata for each runtime.
New modules
identity/types.tsSessionIdentityRecordtype (14 fields)identity/store.ts~/.pi/session-deck/identity/identity/writer.tsidentity/git.tsidentity/collector.tsidentity/runtime.tsidentity/reader.tsreadJoinedSessionView()merges presence + identity by runtimeIdidentity/command.ts--identityflag,registerSessionDeckCommand, joined renderChanges
index.ts— start identity runtime onsession_start, refresh on/newpackage.json— v0.3.0 with identity descriptionCHANGELOG.md,README.md— identity layer docs__tests__/session-deck/identity-*.test.ts— 3 new test files (16 tests)Acceptance criteria
/newupdates sessionId/sessionFile but keeps runtimeId