diff --git a/.planning/phases/01-session-discovery/01-CONTEXT.md b/.planning/phases/01-session-discovery/01-CONTEXT.md index 51cd5cd..bf9fc5d 100644 --- a/.planning/phases/01-session-discovery/01-CONTEXT.md +++ b/.planning/phases/01-session-discovery/01-CONTEXT.md @@ -15,8 +15,8 @@ CLI one-shot (`vmux list`) qui détecte toutes les sessions Claude Code actives ### Détection des sessions - **D-01:** Scanner `/proc` pour trouver les PID des processus Claude Code actifs, puis enrichir avec les fichiers JSONL dans `~/.claude/projects/`. Un JSONL sans PID correspondant = session terminée, ignorée. -- **D-02:** Utiliser `sessions-index.json` (présent dans chaque dossier projet sous `~/.claude/projects/`) comme source de métadonnées riches (sessionId, gitBranch, projectPath, summary, created, modified). Format vérifié sur le poste. -- **D-03:** Le matching PID → session se fait via le cwd du processus (`/proc/PID/cwd` → readlink) croisé avec le `projectPath` du sessions-index. +- **D-02:** ~~sessions-index.json~~ AMENDÉ : sessions-index.json est absent dans 85% des projets (découverte recherche). Utiliser uniquement les fichiers JSONL comme source de métadonnées. Le matching PID → JSONL se fait via l'encoding du cwd en nom de dossier. +- **D-03:** Le matching PID → session se fait via : `/proc/PID/cwd` → readlink → encoder le chemin (remplacer `/` par `-`) → chercher le dossier correspondant dans `~/.claude/projects/` → lire les fichiers JSONL dedans. ### Détection d'état - **D-04:** Se baser uniquement sur le JSONL (tail-read de la dernière entrée) pour déterminer l'état. Pas de lecture CPU en Phase 1. diff --git a/.planning/phases/01-session-discovery/01-VALIDATION.md b/.planning/phases/01-session-discovery/01-VALIDATION.md index 152c177..3c3612d 100644 --- a/.planning/phases/01-session-discovery/01-VALIDATION.md +++ b/.planning/phases/01-session-discovery/01-VALIDATION.md @@ -38,11 +38,11 @@ created: 2026-03-23 | Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status | |---------|------|------|-------------|-----------|-------------------|-------------|--------| -| 01-01-01 | 01 | 1 | DISC-01 | unit | `go test ./internal/proc/...` | ❌ W0 | ⬜ pending | -| 01-01-02 | 01 | 1 | DISC-02 | unit | `go test ./internal/session/...` | ❌ W0 | ⬜ pending | -| 01-01-03 | 01 | 1 | DISC-03 | unit | `go test ./internal/session/...` | ❌ W0 | ⬜ pending | -| 01-02-01 | 02 | 1 | STATE-01 | unit | `go test ./internal/state/...` | ❌ W0 | ⬜ pending | -| 01-02-02 | 02 | 1 | STATE-02 | unit | `go test ./internal/state/...` | ❌ W0 | ⬜ pending | +| 01-01-01 | 01 | 1 | DISC-01 | unit | `go test -run TestFindClaudeProcesses ./...` | ❌ W0 | ⬜ pending | +| 01-01-02 | 01 | 1 | DISC-02 | unit | `go test -run TestEncodePath ./...` | ❌ W0 | ⬜ pending | +| 01-01-03 | 01 | 1 | DISC-03 | unit | `go test -run TestEncodePath ./...` | ❌ W0 | ⬜ pending | +| 01-02-01 | 02 | 1 | STATE-01 | unit | `go test -run TestDetectState ./...` | ❌ W0 | ⬜ pending | +| 01-02-02 | 02 | 1 | STATE-02 | unit | `go test -run TestExtractPreview ./...` | ❌ W0 | ⬜ pending | *Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*