From 812d5bdcdab58a31dbb9acf7b9c6140f704d4416 Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Mon, 30 Mar 2026 23:54:13 +0100 Subject: [PATCH 1/3] feat: use dinosaur names for session display IDs Replace generic animal names with ~50 dinosaur names for more memorable and fun session identifiers. Adjectives unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/agent_event_bus/session_ids.py | 108 ++++++++++++++--------------- tests/test_session_ids.py | 16 ++--- 2 files changed, 62 insertions(+), 62 deletions(-) diff --git a/src/agent_event_bus/session_ids.py b/src/agent_event_bus/session_ids.py index e39cdbf..33501f3 100644 --- a/src/agent_event_bus/session_ids.py +++ b/src/agent_event_bus/session_ids.py @@ -1,9 +1,9 @@ -"""Human-readable session ID generation (Docker-style names).""" +"""Human-readable session ID generation (dinosaur-themed names).""" import random # Word lists for human-readable session IDs -# ~50 adjectives x ~50 animals = ~2500 unique combinations +# ~50 adjectives x ~50 dinosaurs = ~2500 unique combinations ADJECTIVES = [ "brave", "calm", @@ -57,60 +57,60 @@ "rustic", ] -ANIMALS = [ - "badger", - "cat", - "dog", - "eagle", - "falcon", - "gopher", - "heron", - "ibis", - "jaguar", - "koala", - "lemur", - "moose", - "newt", - "otter", - "panda", - "quail", - "rabbit", - "salmon", - "tiger", - "urchin", - "viper", - "walrus", - "yak", - "zebra", - "bear", - "crane", - "duck", - "fox", - "goose", - "hawk", +DINOSAURS = [ + "trex", + "raptor", + "stego", + "bronto", + "tricera", + "ankylo", + "diplo", + "allo", + "ptero", + "plesio", + "spino", + "carno", "iguana", - "jay", - "alpaca", - "bison", - "coyote", - "dingo", - "ferret", - "gecko", - "hyena", - "impala", - "jackal", - "kiwi", - "llama", - "marmot", - "narwhal", - "osprey", - "parrot", - "raven", - "sloth", - "toucan", + "hadro", + "cerato", + "compso", + "dilo", + "galli", + "thero", + "bary", + "deinon", + "styra", + "pachy", + "corytho", + "parasaur", + "maia", + "oviraptor", + "draco", + "kentro", + "camara", + "titano", + "megalo", + "archeo", + "coelo", + "micro", + "proto", + "sino", + "yuty", + "theri", + "tarbos", + "acro", + "giganto", + "amarga", + "citipa", + "edmonto", + "lambe", + "nodo", + "ourano", + "suchomi", + "utah", ] def generate_session_id() -> str: - """Generate a human-readable session ID like 'brave-tiger'.""" - return f"{random.choice(ADJECTIVES)}-{random.choice(ANIMALS)}" + """Generate a dinosaur-themed session ID like 'brave-trex'.""" + return f"{random.choice(ADJECTIVES)}-{random.choice(DINOSAURS)}" diff --git a/tests/test_session_ids.py b/tests/test_session_ids.py index c0500ed..344aae6 100644 --- a/tests/test_session_ids.py +++ b/tests/test_session_ids.py @@ -1,7 +1,7 @@ -"""Tests for session_ids module (Docker-style display ID generation).""" +"""Tests for session_ids module (dinosaur-themed display ID generation).""" from agent_event_bus.middleware import _is_human_readable_id -from agent_event_bus.session_ids import ADJECTIVES, ANIMALS, generate_session_id +from agent_event_bus.session_ids import ADJECTIVES, DINOSAURS, generate_session_id class TestGenerateSessionId: @@ -21,11 +21,11 @@ def test_passes_human_readable_check(self): assert _is_human_readable_id(session_id), f"ID failed check: {session_id}" def test_uses_words_from_lists(self): - """Generated ID uses words from ADJECTIVES and ANIMALS lists.""" + """Generated ID uses words from ADJECTIVES and DINOSAURS lists.""" session_id = generate_session_id() - adjective, animal = session_id.split("-") + adjective, dinosaur = session_id.split("-") assert adjective in ADJECTIVES, f"Adjective not in list: {adjective}" - assert animal in ANIMALS, f"Animal not in list: {animal}" + assert dinosaur in DINOSAURS, f"Dinosaur not in list: {dinosaur}" def test_randomness(self): """Multiple calls produce different results (with high probability).""" @@ -37,11 +37,11 @@ def test_randomness(self): def test_word_lists_non_empty(self): """Word lists have sufficient entries for good randomness.""" assert len(ADJECTIVES) >= 10, "ADJECTIVES list too small" - assert len(ANIMALS) >= 10, "ANIMALS list too small" + assert len(DINOSAURS) >= 10, "DINOSAURS list too small" def test_word_lists_lowercase(self): """All words in lists are lowercase alphabetic.""" for word in ADJECTIVES: assert word.isalpha() and word.islower(), f"Invalid adjective: {word}" - for word in ANIMALS: - assert word.isalpha() and word.islower(), f"Invalid animal: {word}" + for word in DINOSAURS: + assert word.isalpha() and word.islower(), f"Invalid dinosaur: {word}" From 139be5e192516b7f7e658672aaa81f12b18af79f Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 31 Mar 2026 00:15:11 +0100 Subject: [PATCH 2/3] fix: Rename iguana to iguano for consistency with dinosaur theme The word "iguana" is a modern reptile, not a dinosaur. Use "iguano" (short for Iguanodon) to match the abbreviated naming convention used by the other entries (stego, bronto, diplo, etc.). Co-Authored-By: Claude Opus 4.6 (1M context) --- src/agent_event_bus/session_ids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/agent_event_bus/session_ids.py b/src/agent_event_bus/session_ids.py index 33501f3..18914b2 100644 --- a/src/agent_event_bus/session_ids.py +++ b/src/agent_event_bus/session_ids.py @@ -70,7 +70,7 @@ "plesio", "spino", "carno", - "iguana", + "iguano", "hadro", "cerato", "compso", From fb0f9a141d9773699438d63281348e8c123dd6b4 Mon Sep 17 00:00:00 2001 From: Evan Senter Date: Tue, 31 Mar 2026 00:18:04 +0100 Subject: [PATCH 3/3] fix: Address review feedback - update docs and lengthen opaque names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update all references from "brave-tiger" to "brave-trex" and "Docker-style" to dinosaur-themed in guide.md, CLAUDE.md, middleware.py, storage.py, and EXAMPLE_COMMS.md - Lengthen opaque dinosaur abbreviations for readability: compso→compsy, bary→baryon, acro→acrocanth, citipa→citipati, lambe→lambeo, nodo→nodosaur Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 4 ++-- docs/EXAMPLE_COMMS.md | 2 +- src/agent_event_bus/guide.md | 4 ++-- src/agent_event_bus/middleware.py | 12 ++++++------ src/agent_event_bus/session_ids.py | 12 ++++++------ src/agent_event_bus/storage.py | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index c271d93..29ebc06 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -80,7 +80,7 @@ src/agent_event_bus/ ├── storage.py # SQLite backend (Session, Event, SQLiteStorage) ├── helpers.py # Notifications, repo extraction ├── middleware.py # Request logging → ~/.claude/contrib/agent-event-bus/agent-event-bus.log -├── session_ids.py # Docker-style display_id generation +├── session_ids.py # Dinosaur-themed display_id generation ├── cli.py # CLI wrapper for shell scripts └── guide.md # Usage guide (agent-event-bus://guide resource) ``` @@ -143,7 +143,7 @@ CLI and MCP expose the same functionality: - **Session cleanup**: 24-hour timeout + PID liveness checks for local sessions - **Auto-heartbeat**: `publish_event` and `get_events` refresh heartbeat - **Cursor auto-tracking**: `get_events(session_id=X)` persists cursor; `resume=True` uses it -- **UUID session IDs**: `session_id` is UUID; `display_id` is human-readable ("brave-tiger") +- **UUID session IDs**: `session_id` is UUID; `display_id` is human-readable ("brave-trex") - **Client deduplication**: `(machine, client_id)` enables session resumption ## Operations diff --git a/docs/EXAMPLE_COMMS.md b/docs/EXAMPLE_COMMS.md index f308cf0..c45befb 100644 --- a/docs/EXAMPLE_COMMS.md +++ b/docs/EXAMPLE_COMMS.md @@ -42,7 +42,7 @@ Pagination: pass `next_cursor` as `cursor` in the next call. Empty `events` arra ### Session format (`list_sessions`) -Sessions self-register with a name, machine, and optional `client_id` for resumption. The server assigns a `display_id` (Docker-style codename) and infers `repo` from the working directory. +Sessions self-register with a name, machine, and optional `client_id` for resumption. The server assigns a `display_id` (dinosaur-themed codename) and infers `repo` from the working directory. ```json { diff --git a/src/agent_event_bus/guide.md b/src/agent_event_bus/guide.md index d3bcdfa..75242c8 100644 --- a/src/agent_event_bus/guide.md +++ b/src/agent_event_bus/guide.md @@ -31,10 +31,10 @@ CC sessions (e.g., in separate terminals or worktrees), this MCP server lets ses ### 1. Register on startup ``` register_session(name="auth-feature", client_id="cc-session-abc") -→ {session_id: "cc-session-abc", display_id: "brave-tiger", cursor: "42", ...} +→ {session_id: "cc-session-abc", display_id: "brave-trex", cursor: "42", ...} ``` - `session_id` is your unique identifier (your `client_id`, or a UUID if not provided) -- `display_id` is human-readable ("brave-tiger") - for display only +- `display_id` is human-readable ("brave-trex") - for display only - Use `session_id` for all API calls ### 2. Poll for events diff --git a/src/agent_event_bus/middleware.py b/src/agent_event_bus/middleware.py index 2195f59..bd37261 100644 --- a/src/agent_event_bus/middleware.py +++ b/src/agent_event_bus/middleware.py @@ -27,7 +27,7 @@ def _lookup_session_display_id(session_id: str) -> str | None: """Look up human-readable display_id from a session_id. Session IDs are now UUIDs (or client_ids). This resolves them to - human-readable display names like "brave-tiger". + human-readable display names like "brave-trex". Returns the display_id if found, None otherwise. """ @@ -43,7 +43,7 @@ def _get_active_sessions_map() -> dict[str, str]: """Get mapping of session_id → display_id for active sessions. Returns a dict where keys are session IDs (UUIDs) and values are - human-readable display_ids (like "brave-tiger"). + human-readable display_ids (like "brave-trex"). """ try: storage = _get_storage() @@ -75,9 +75,9 @@ def _get_active_sessions_map() -> dict[str, str]: def _is_human_readable_id(session_id: str) -> bool: - """Check if a session ID is human-readable (Docker-style adjective-noun). + """Check if a session ID is human-readable (adjective-dinosaur format). - Human-readable: "brave-tiger", "tender-hawk" (two lowercase words with hyphen) + Human-readable: "brave-trex", "tender-raptor" (two lowercase words with hyphen) Not human-readable: "b712a0ba-1ee6-4c18-a647-31a785147665" (UUID) """ if not session_id or session_id == "anonymous": @@ -92,7 +92,7 @@ def _is_human_readable_id(session_id: str) -> bool: def _format_session_id_value(session_id: str) -> str: """Format a session_id value for display. - Human-readable IDs (brave-tiger) are shown prominently. + Human-readable IDs (brave-trex) are shown prominently. UUIDs/hex strings are dimmed and truncated. """ if _is_human_readable_id(session_id): @@ -138,7 +138,7 @@ def _format_list(items: list) -> str: first = items[0] if isinstance(items[0], dict) else None if first: if "session_id" in first: - # Show session display_ids (human-readable names): tender-hawk, brave-tiger, ... + # Show session display_ids (human-readable names): tender-raptor, brave-trex, ... # Prefer display_id if available, look it up if not, format UUID as fallback names = [] for item in items: diff --git a/src/agent_event_bus/session_ids.py b/src/agent_event_bus/session_ids.py index 18914b2..3e3005a 100644 --- a/src/agent_event_bus/session_ids.py +++ b/src/agent_event_bus/session_ids.py @@ -73,11 +73,11 @@ "iguano", "hadro", "cerato", - "compso", + "compsy", "dilo", "galli", "thero", - "bary", + "baryon", "deinon", "styra", "pachy", @@ -98,13 +98,13 @@ "yuty", "theri", "tarbos", - "acro", + "acrocanth", "giganto", "amarga", - "citipa", + "citipati", "edmonto", - "lambe", - "nodo", + "lambeo", + "nodosaur", "ourano", "suchomi", "utah", diff --git a/src/agent_event_bus/storage.py b/src/agent_event_bus/storage.py index 0010265..8f974ba 100644 --- a/src/agent_event_bus/storage.py +++ b/src/agent_event_bus/storage.py @@ -46,13 +46,13 @@ def migrate_v2(conn: sqlite3.Connection) -> None: """Add display_id and deleted_at columns to sessions table. This migration: - 1. Adds display_id column (human-readable name like "brave-tiger") + 1. Adds display_id column (human-readable name like "brave-trex") 2. Adds deleted_at column (for soft-delete) 3. Copies existing id → display_id 4. Changes id to use client_id (if available) or generates UUID Note on historical data: Existing events retain their old session_id references - (human-readable names like "brave-tiger"). These become orphaned - they no longer + (human-readable names like "brave-trex"). These become orphaned - they no longer match any session's primary key. This is expected: the middleware handles display of historical events via _is_human_readable_id() fallback. New events will use the new UUID-based session_id. @@ -144,7 +144,7 @@ class Session: """Represents an active Claude Code session.""" id: str # UUID or client_id (stable identifier for API use) - display_id: str # Human-readable name like "brave-tiger" (for display only) + display_id: str # Human-readable name like "brave-trex" (for display only) name: str machine: str cwd: str