Redesign gt seance: ZFC-compliant literal seance with predecessors (gt-7qvd7)

Major redesign based on design review:

1. REMOVED: Claude Code internal parsing (ZFC violation)
   - Deleted internal/claude/sessions.go (parsed ~/.claude/projects/)
   - This coupled us to Claude Code's undocumented internal format

2. ADDED: Event-based session discovery
   - gt prime now emits session_start events to ~/gt/.events.jsonl
   - Events include role, session_id, topic, cwd
   - Discovery reads our own event stream (ZFC-compliant)

3. ADDED: --talk flag for actual seances
   - gt seance --talk <session-id> spawns: claude --fork-session --resume <id>
   - --fork-session creates a new session (read-only, no grave disturbance)
   - You literally talk to your predecessor: "Where did you put X?"

4. ADDED: One-shot prompt mode
   - gt seance --talk <id> -p "Where is the config?"
   - Uses claude --print for quick questions

The name "seance" is now literal - you commune with the dead (past sessions).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gastown/crew/joe
2025-12-31 00:27:59 -08:00
committed by Steve Yegge
parent 35586b57e5
commit 189db8a80e
5 changed files with 261 additions and 470 deletions

View File

@@ -46,6 +46,10 @@ const (
TypeBoot = "boot"
TypeHalt = "halt"
// Session events (for seance discovery)
TypeSessionStart = "session_start"
TypeSessionEnd = "session_end"
// Witness patrol events
TypePatrolStarted = "patrol_started"
TypePolecatChecked = "polecat_checked"
@@ -269,3 +273,22 @@ func HaltPayload(services []string) map[string]interface{} {
"services": services,
}
}
// SessionPayload creates a payload for session start/end events.
// sessionID: Claude Code session UUID
// role: Gas Town role (e.g., "gastown/crew/joe", "deacon")
// topic: What the session is working on
// cwd: Working directory
func SessionPayload(sessionID, role, topic, cwd string) map[string]interface{} {
p := map[string]interface{}{
"session_id": sessionID,
"role": role,
}
if topic != "" {
p["topic"] = topic
}
if cwd != "" {
p["cwd"] = cwd
}
return p
}