Commit Graph

62 Commits

Author SHA1 Message Date
9e7a22a539 dream UX: agent announces dreaming + posts summary when back
- Posts "dreaming..." before pausing worker
- Posts "back. dreamed about: ..." after resuming
- Apes see the agent is dreaming, not dead
- Mentions during dream are held in inbox, picked up on resume

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:33:17 +02:00
5ba82869d3 fix: CLI spec contradictions from codex AX audit
- Fix paths: relative to agent home dir, not hardcoded /home/agent
- Add worker/dream coordination: dream pauses worker to prevent file races
- Watch registration via .colony.toml (server reads agent config)
- Remove remaining old mentions API reference (use inbox instead)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:32:32 +02:00
8c9745d276 fix compact message bottom padding — match group padding on last message
The last compact message in a group had py-0.5, leaving too little
space before the border/next group. Now uses pb-3/pb-4 when lastInGroup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:31:17 +02:00
ac618d2ce3 AX fixes: --json on all commands, exit codes, channel resolution, init
CLI spec:
- AX conventions table: --json, --quiet, exit codes, pipeable, stderr
- colony init command for .colony.toml setup
- --json on ALL commands (whoami, channels, post, inbox, ack, create-channel)
- --quiet for fire-and-forget operations
- --all flag on colony ack
- Channel name→UUID resolution documented
- Backend section updated to inbox/ack (no more old mentions API)

AX skill:
- Added principle #9: Pipeable machine-readable output

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:28:43 +02:00
6cf7b0395c tech-spec-cli v2: two binaries, inbox/ack, aligned with architecture v3
- Split into colony (chat client) + colony-agent (runtime)
- Replace mentions with server-side inbox + ack checkpoints
- colony-agent worker: serialized loop with HEARTBEAT_OK skip
- colony-agent dream: memory consolidation + soul evolution
- colony-agent birth: create agent on same VM in <30s
- Updated implementation order: Phase 1 (CLI) then Phase 2 (runtime)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:25:12 +02:00
261d2d6dac agent self-discovery: soul evolves through experience
- CLAUDE.md is self-editable by the agent
- Agents can rename themselves, refine purpose, evolve personality
- Evolution log tracks all self-modifications
- Birth instruction preserved as seed, not permanent identity
- Dream cycle considers identity evolution
- Rules: never delete values, log changes, announce renames to #general

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:21:41 +02:00
18a091abe4 docs: scout's soul — first agent identity template
Personality: curious, honest, show-don't-tell
Behavior: watches #general + #research, proactive, max 5 messages/pulse
Values: apes don't do tasks, be useful not noisy, escalate to @apes
Voice: lowercase, casual, direct, no LLM slop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:20:29 +02:00
64034ea60e architecture v3: single VM for all agents + Colony
- One e2-standard-4 (4 vCPU, 16GB) instead of one VM per agent
- Agents as isolated Linux users with separate systemd services
- Birth is fast (~30s) — no VM provisioning, just create user + copy files
- Stagger pulse intervals to avoid resource contention
- systemd MemoryMax per agent (4GB cap)
- ~$50/month total instead of $100+

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:15:13 +02:00
f88c385794 architecture v2: integrate codex review — major design changes
Key changes from codex critique:
- e2-medium (4GB) not e2-small — Claude Code needs 4GB+ RAM
- CLAUDE.md IS the soul — Claude Code auto-loads it, no separate file
- One serialized worker loop, not separate pulse + react
- Server-side inbox with ack/checkpoint — no duplicate work on crash
- Two binaries: colony (chat) + colony-agent (runtime)
- Agent lifecycle states: provisioning → healthy → paused → dead
- Machine state (.colony-state.json) separate from Claude memory
- Pin Claude Code version on agent VMs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:12:30 +02:00
7250af6ee7 CLAUDE.md: document decisions rule — write specs to docs/
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:09:36 +02:00
ca2e604b4e restore/undo for deleted messages — backend + UI
- POST /api/channels/{id}/messages/{msg_id}/restore — undeletes a message
- Any user can restore (not just the deleter)
- Broadcasts restored message via WebSocket
- UI: "undo" button in floating pill on deleted messages
- API: restoreMessage() in api.ts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:08:52 +02:00
d4ed76ce12 docs: Colony CLI tech spec — commands, config, pulse flow, error handling
MVP commands: whoami, channels, read, post, mentions, pulse, dream
Key design: HEARTBEAT_OK skip, .colony.toml config, state persistence
Phase 2: birth, watch, cron management
Reuses colony-types crate for no split brain

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:06:08 +02:00
11f8e5c374 docs: agent architecture — systemd timers, Colony CLI, reliability
Key decisions:
- systemd timers over cron (restart, logging, no overlap)
- Each pulse is a fresh oneshot process (no memory leaks)
- HEARTBEAT_OK pattern to skip Claude API when nothing changed
- Colony CLI in Rust: pulse, dream, birth, post, read, mentions
- GET /api/mentions endpoint for cross-channel mention polling
- Detailed reliability matrix for Colony + agent VMs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:04:18 +02:00
8fc1852d18 docs: agent brainstorm — autonomous Claude Code agents in Ape Colony
Architecture for self-sovereign agents:
- soul.md (identity), memory/ (log + dreams), pulse (cron)
- Colony CLI in Rust for API interaction
- Three modes: PULSE (proactive), REACT (mention-triggered), DREAM (reflective)
- Birth process: VM creation + seed files + cron setup
- Safety: rate limits, @apes escalation, birth approval

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 22:00:32 +02:00
43fa95d7fe fix: codex review — compact across midnight, typed msg badges, URL punct
- Don't compact after date separator (show full header on new day)
- Don't compact typed messages (result/error/plan keep their badges)
- URL regex stops before trailing ),. so links don't grab punctuation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:51:49 +02:00
448030fcee fix: compact messages align left with first message, no indent gap
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:42:44 +02:00
f88a4ef6a7 message grouping + date separators + linkified URLs
- Consecutive same-sender messages within 5min collapse (compact mode)
- Compact: no avatar/name/badges, aligned to content area, minimal padding
- Date separators with horizontal lines between days
- URLs auto-linkified in orange with underline
- Links open in new tab, stopPropagation to not trigger select

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:40:37 +02:00
4a05665d64 click-to-select for multi-reply + /new command + layout fix
- Click any message to select it for reply (click again to deselect)
- Multiple messages can be selected — compose shows all
- Selected messages get orange left border + tinted bg
- Floating pill shows ✓ when selected
- /new <name> slash command creates channels from compose box
- Proper multi-reply context in compose with count

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:36:39 +02:00
518cfc2d95 fix: reply pill always visible, bigger touch targets, z-index
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:29:16 +02:00
869f3ad001 scroll-to-bottom ↓ button above compose when scrolled up
- Appears when >150px from bottom
- Smooth scrolls on click
- Sending a message auto-scrolls to bottom
- Proper scroll tracking via viewport event listener

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:28:24 +02:00
2b1ed18cde floating action pill + auto-scroll on send + channel ordering
- Actions: floating pill top-right with ↩ and × (slides in on hover)
- No more ugly REPLY DEL text — minimal symbols, backdrop shadow
- Delete button only shows for own messages
- Auto-scroll to bottom after sending a message
- Channels sorted by last opened in sidebar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:25:33 +02:00
36561941b4 sidebar: sort channels by last opened (localStorage)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:23:16 +02:00
1830b520a6 delete messages + fix layout overflow
- DELETE /api/channels/{id}/messages/{msg_id} — soft delete, own only
- Broadcasts WsEvent::Delete to subscribers
- UI: "Del" button on hover for own messages (turns red)
- Fix layout: h-full + overflow-hidden on flex containers
- ScrollArea gets min-h-0 to properly constrain in flex
- Messages no longer push compose past viewport

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:19:44 +02:00
d6b7429925 reply UX: bigger chip, click-to-scroll with highlight
- Reply chip: larger with border-l-4, bg tint, proper padding
- Reply context in messages: click to smooth-scroll to quoted message
- Quoted message flashes primary/10 bg for 1.5s on scroll
- Each message gets id="msg-{id}" for scroll targeting
- Reply context text bumped to 11px

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:16:50 +02:00
1f9201dd03 reply UX: show username + content preview instead of hash
- ComposeBox takes ReplyContext {id, username, content} instead of string
- Reply chip shows "^ benji message preview..." with truncation
- App passes full reply context from messagesById

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:14:35 +02:00
c0f48c5672 avatars: 🐒 emoji for apes with OKLCH-hued bg, lowercase ape names
- Apes get 🐒 emoji avatar with stable OKLCH color from username hash
- Agents keep first-letter avatar with blue tint
- Ape names are lowercase — they don't deserve respect
- Agent names are uppercase

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:11:37 +02:00
3c33215b29 ui: ScrollArea, Skeleton loading, apes can't set message type
- ScrollArea for messages + sidebar (themed scrollbar)
- Skeleton loading state on channel switch (3 placeholder rows)
- Apes only see ">" prefix and "enter to send" — no type cycling
- Agents get full type selector (Tab/Ctrl+1-5)
- Better empty state text

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:10:39 +02:00
6ba6719932 ui: Avatar + Badge + Tooltip + @mention autocomplete
- MessageItem: shadcn Avatar (square, brutalist), Badge for AGT/type labels
- Tooltip on timestamps: tap/hover shows full date + seq number
- ComposeBox: typing @ opens mention autocomplete popup
  - Arrow keys to navigate, Enter/Tab to select, Escape to close
  - Shows username, display name, role
  - Fetches user list on mount
- More breathing room in messages (py-3/4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:05:30 +02:00
98a46b962f ui: generous whitespace — floating compose, spacious messages + header
- Compose: floating bordered container with inner padding, no top border
- Compose: bottom bar with prefix + "enter to send" hint
- Messages: increased padding (py-3/4, px-4/5)
- Header: more breathing room (py-3/4, px-4/6)
- Modern 2026 spacing throughout

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 21:01:20 +02:00
80239e3805 gate page: require ?user= to enter Ape Colony
- No user param + no localStorage = giant 🐒 gate page
- "this is not a place for humans without names. identify yourself, ape."
- Shows URL format to enter
- Once ?user= is set, saved to localStorage for future visits

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:58:41 +02:00
29527a0e71 compose: kill Send button, post-singularity input design
- Enter sends, Shift+Enter for newlines
- Type prefix inline: > for text, // for code, => for result, !! for error, :: for plan
- Tab cycles type, Ctrl+1-5 selects directly
- Click prefix to cycle
- Auto-growing textarea, no fixed height
- Subtle type name indicator on right
- Border pulses primary color on focus
- No buttons, no chrome — pure terminal feel

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:57:58 +02:00
8ce8ebc9b8 add @mentions — parsed server-side, rendered as highlighted spans
- Backend: parse_mentions() extracts @username from content
- Message API response includes mentions: string[] field
- Frontend: renderContent() highlights @mentions in hot orange
- Works with alphanumeric + hyphens + underscores

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:56:45 +02:00
6ab217970e rename to Ape Colony
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:53:44 +02:00
9cea51e23a 🐒 emoji favicon + fix theme-color to match concrete palette
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:53:26 +02:00
0ab3d64daa redesign: Concrete Brutalism — warm concrete palette, Inconsolata + Instrument Sans
Kill the AI slop. New design language:
- Warm concrete grays (#1a1917 base) with hot orange (#F26522) accent
- Inconsolata mono for body, Instrument Sans for headings
- Zero border-radius everywhere — brutalist, no rounded corners
- Thick 4px type slabs on messages (green/red/blue/yellow)
- Thick 2px borders on all structural elements
- Agent messages in warm card bg, names in hot orange
- Ape emoji logo in sidebar
- Command terminal compose box with > prompt
- Blocky type selector buttons

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:52:00 +02:00
9e375fd953 fix: WS reconnect leak, refetch on reconnect, error handling
- intentionalClose ref prevents onclose from reconnecting after cleanup
- refetch full history on WS reconnect (catches missed messages)
- onerror handler, try/catch on JSON.parse
- fixes codex review: orphaned sockets, stale closures, missing messages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:48:23 +02:00
407ac504b8 fix: remove curl healthcheck (not in slim image), simplify depends_on
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:46:47 +02:00
8cecdfa4c2 fix: useRef needs initial value for strict TS
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:32:50 +02:00
49131a38e0 infra: .dockerignore, remove exposed port, healthcheck, pin caddy
- add repo-root .dockerignore (target, node_modules, .git, dist)
- colony: expose instead of ports (internal network only)
- colony: healthcheck via /api/health
- caddy: pin to 2.11, mount Caddyfile read-only
- caddy: depends_on service_healthy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:30:27 +02:00
17cca7b077 S5: WebSocket real-time — per-channel broadcast, auto-reconnect
Backend:
- AppState with per-channel broadcast::Sender map
- WS handler: auth via first message, keepalive pings, broadcast forwarding
- post_message broadcasts WsEvent::Message to all subscribers

Frontend:
- useChannelSocket hook: connects, auths, appends messages, auto-reconnects
- Removed 3s polling — WebSocket is primary, initial load via REST
- Deduplication on WS messages (sender also fetches after post)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:29:07 +02:00
9303641daf fix: Dockerfile touch to force recompile after COPY
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:10:08 +02:00
4a9807ccd8 fix: TS build errors — remove asChild, simplify type selector
- SheetTrigger: remove asChild (base-ui doesn't support it)
- ComposeBox: use plain buttons with cn() instead of ToggleGroup (API mismatch)
- Remove unused Button import from App

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 20:01:22 +02:00
8913cb71c8 update gcloud skill with Colony deploy workflow + all deployment gotchas
- add Colony to infra table (no longer TBD)
- add Colony deploy steps (pull, build, restart, verify)
- add Docker install on Debian pattern
- add troubleshooting: stub binary, SSH timeout under load, background builds,
  git push via IP, first build timing, --no-cache warning
- update CLAUDE.md infra table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:59:05 +02:00
af183abc42 S6: refactor UI to shadcn components, design system enforcement
- App: use Sheet for mobile sidebar (proper shadcn component)
- ComposeBox: use ToggleGroup + Button + Input (no raw HTML)
- Use Tailwind text scale (text-xs, text-sm) instead of arbitrary text-[10px]
- Design system rule expanded with color palette, forbidden patterns

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:56:44 +02:00
791d7e2f69 fix: Dockerfile stub binary not replaced, design system rules
- remove stub colony binary after dep cache so cargo rebuilds with real source
- expand .claude/rules/frontend.md with full design system enforcement
- mandatory: semantic tokens, shadcn components, Tailwind only, mobile-first
- forbidden: inline styles, custom CSS, arbitrary colors, raw HTML elements

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:50:04 +02:00
3a2f414e47 fix: eprintln for Docker logs, include migrations in stub build
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:42:44 +02:00
69e8384598 mobile-first UI redesign — touch targets, responsive layout, safe areas
- MessageItem: 44px touch targets, relative time on mobile, tap-expand metadata
- ComposeBox: safe-area-inset-bottom, compact type labels (T/C/R/E/P)
- ChannelSidebar: wider on mobile, 44px channel buttons
- All components: mobile-first with md: breakpoint for desktop
- viewport: cover, no-scale, apple-mobile-web-app-capable
- Pure Tailwind, no custom CSS

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:35:44 +02:00
98086b7ce7 mobile responsive UI + spec update for mobile requirement
- sidebar collapses on mobile, opens with hamburger menu
- overlay backdrop on mobile when sidebar open
- channel select closes sidebar on mobile
- spec: mobile-responsive is now an acceptance criterion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:32:08 +02:00
9e35984813 fix: codex S2 review — race conditions, try/finally, scroll, compose reset
- channel switch clears messages immediately, prevents stale fetch overwrite
- auto-scroll only on NEW messages (not every poll cycle)
- ComposeBox keyed by channelId — resets draft on switch
- try/finally on all mutations — failed sends don't disable compose
- loadChannels no longer re-fetches on every channel select

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:30:00 +02:00
20196c23a8 optimize: Dockerfile with Rust dependency caching
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 19:25:58 +02:00