Commit graph

57 commits

Author SHA1 Message Date
zenchantlive
9660b516a8 feat(graph): complete bb-ui2.19 - Extract Graph into Reusable Component
STORY:
The existing ReactFlow dependency graph lived in the /graph page, but
the Unified UX needs it as a reusable component for the graph tab.

COLLABORATION:
Extracted the core ReactFlow visualization into WorkflowGraph component:

Interface:
- beads: BeadIssue[] to render as nodes
- selectedId?: currently selected bead
- onSelect?: selection callback
- className?: styling override
- hideClosed?: filter closed beads

Features preserved:
- Dagre layout for automatic positioning
- Edge rendering with BLOCKS labels
- fitView() on mount via useReactFlow
- Existing styling and hover states

The original /graph page can now use this component or serve as reference.

DELIVERABLES:
- src/components/shared/workflow-graph.tsx

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS
- npm run test: PASS

CLOSES: bb-ui2.19
BLOCKS: bb-ui2.20
2026-02-15 21:18:31 -08:00
zenchantlive
e47230c2dd feat(data): complete bb-ui2.15 - Swarm Cards Data Builder
STORY:
The Swarm view needs to show epics as "swarms" - groups of agents
working together on a mission. This requires aggregating bead data
by swarm/epic and computing health statistics.

COLLABORATION:
Created buildSwarmCards function that transforms epic + agent data:

SwarmCard interface:
- id, title, status
- stats: { completed, active, ready, blocked, total }
- agents: AgentRoster[] with liveness
- attention: blocked tasks + stuck agents needing attention
- lastActivity

We also created swarm-molecules.ts for molecular composition patterns
used by the swarm orchestration layer.

DELIVERABLES:
- src/lib/swarm-cards.ts with SwarmCard, AgentRoster types
- src/lib/swarm-molecules.ts for molecular composition
- tests/lib/swarm-cards.test.ts
- tests/lib/swarm-molecules.test.ts

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS
- npm run test: PASS

CLOSES: bb-ui2.15
BLOCKS: bb-ui2.16, bb-ui2.17
2026-02-15 21:18:13 -08:00
zenchantlive
e28a7837c4 feat(data): complete bb-ui2.10 - Social Cards Data Builder
STORY:
The Social view needs to transform raw BeadIssue data into renderable
SocialCard objects. This includes computing blocked/blocking relationships
from dependencies and extracting agent assignments.

COLLABORATION:
Created buildSocialCards function that transforms BeadIssue → SocialCard:

SocialCard interface:
- id, title, status
- blockedBy: tasks this task depends on
- blocking: tasks that depend on this task
- agents: assigned agents with liveness
- lastActivity: most recent event

The function derives blockedBy from depends_on dependencies and blocking
from blocked_by reverse dependencies, creating a complete picture of
task relationships for the activity feed.

DELIVERABLES:
- src/lib/social-cards.ts with SocialCard interface and builder
- tests/lib/social-cards.test.ts

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS
- npm run test: PASS

CLOSES: bb-ui2.10
BLOCKS: bb-ui2.11, bb-ui2.12
2026-02-15 21:17:52 -08:00
zenchantlive
4b8770c78c feat(hooks): complete bb-ui2.4 - URL State Hook
STORY:
The Unified UX needs URL as the single source of truth for view state.
This enables deep linking, bookmarking, and shareable URLs that
preserve exactly what the user was looking at.

COLLABORATION:
Created useUrlState hook using Next.js useSearchParams and useRouter:

Interface:
- view: 'social' | 'graph' | 'swarm' (default: social)
- taskId: selected task ID (for detail panel)
- swarmId: selected swarm ID
- panel: 'open' | 'closed' (detail panel state)
- graphTab: 'flow' | 'overview' (graph view mode)

URL Patterns:
- /?view=social
- /?view=social&task=bb-buff.1&panel=open
- /?view=swarm&swarm=bb-buff
- /?view=graph&task=bb-buff.1&graphTab=flow

The hook uses router.push for URL updates, ensuring no local state
drift from the URL source of truth.

DELIVERABLES:
- src/hooks/use-url-state.ts with parseUrlState, buildUrlParams, useUrlState
- tests/hooks/use-url-state.test.ts with 18+ tests

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS
- npm run test: PASS (all tests including new ones)

CLOSES: bb-ui2.4
BLOCKS: bb-ui2.5
2026-02-15 21:17:30 -08:00
zenchantlive
71a513c639 feat(components): complete bb-ui2.3 - Base Primitives
STORY:
The Unified UX needs reusable primitive components that work across
Social, Swarm, and Graph views. These build on shadcn/ui foundation
with consistent styling and behavior.

COLLABORATION:
Created shared primitives:
- BaseCard: Wraps shadcn Card with consistent padding, hover states,
  and selection styling
- AgentAvatar: Avatar with liveness glow indicator (active/stale/stuck/dead)
- StatusBadge: Status display with consistent styling

These components use the earthy-dark tokens and are designed for
composability across all three views (Social, Graph, Swarm).

DELIVERABLES:
- src/components/shared/base-card.tsx
- src/components/shared/agent-avatar.tsx
- src/components/shared/status-badge.tsx
- src/components/shared/index.ts (barrel export)
- Tests in tests/components/shared/

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS
- npm run test: PASS

CLOSES: bb-ui2.3
BLOCKS: bb-ui2.5, bb-ui2.11, bb-ui2.16
2026-02-15 21:17:08 -08:00
zenchantlive
fb4fdb79b2 feat(design): complete bb-ui2.1 - Earthy-Dark Token System
STORY:
The Unified UX epic requires a cohesive visual language that feels
warm and approachable, not sterile. We designed an "earthy-dark"
palette with natural accent colors.

COLLABORATION:
Added earthy-dark CSS variables to globals.css alongside existing
Aero Chrome tokens:

Backgrounds:
- --color-bg-base: #2D2D2D
- --color-bg-card: #363636
- --color-bg-input: #404040

Accents:
- --color-accent-green: #7CB97A (primary CTA)
- --color-accent-amber: #D4A574 (warning)
- --color-accent-teal: #5BA8A0 (secondary)

Status (earthy variants):
- ready: teal, in_progress: green, blocked: amber, closed: muted

Liveness colors for agent health:
- active: #7CB97A, stale: #D4A574, stuck: #E57373, dead: #9E4244

Also fixed tailwind.config.ts to use ESM import for tailwindcss-animate
instead of require().

DELIVERABLES:
- Earthy-dark tokens in globals.css
- Tailwind config with shadcn CSS variable integration
- Fixed lint error with tailwindcss-animate import

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS

CLOSES: bb-ui2.1
BLOCKS: bb-ui2.5
2026-02-15 21:16:48 -08:00
zenchantlive
3e3eedeead feat(ui): complete bb-ui2.2 - shadcn/ui Setup
STORY:
The Unified UX epic needed a solid component foundation. We chose
shadcn/ui for its Tailwind integration and copy-paste philosophy.

COLLABORATION:
Initialized shadcn/ui with Next.js defaults and installed the base
component set needed for the unified shell:
- button: Primary actions
- card: Card containers
- badge: Status badges
- avatar: Agent avatars
- input: Search/filter inputs
- scroll-area: Scrollable containers
- separator: Visual dividers
- tooltip: Hover information
- dropdown-menu: Sorting and filtering

We also updated tsconfig.json with path aliases (@/*) to support
the shadcn import pattern.

DELIVERABLES:
- components.json configuration
- 9 shadcn components in components/ui/
- lib/utils.ts with cn() helper
- tsconfig.json with @/* path aliases

VERIFICATION:
- npm run typecheck: PASS
- npm run lint: PASS

CLOSES: bb-ui2.2
BLOCKS: bb-ui2.3, bb-ui2.5
2026-02-15 21:16:26 -08:00
zenchantlive
544a46427b feat(sessions): complete bb-buff.3.4 - Role-Based Color Coding
STORY:
In a multi-agent control center, operators need to quickly identify
what TYPE of agent they're looking at - UI agents, graph agents,
orchestrators, or general workers.

COLLABORATION:
We implemented role-based border colors on agent avatars:
- ui agents: blue border
- graph agents: green border
- orchestrators: purple border
- default/other: gray border

The agent-station component now displays these colors, making it
instantly visible what role each agent plays in the swarm.

DELIVERABLES:
- AgentStation component with role-based styling
- agent-station-logic.ts with role color derivation
- Tests: agent-station-logic.test.ts updated and passing

VERIFICATION:
- typecheck: PASS
- lint: PASS
- test: PASS

CLOSES: bb-buff.3.4
2026-02-15 21:16:08 -08:00
zenchantlive
4ee550c333 feat(telemetry): complete bb-buff.1.3 - Backend Liveness Refactor
STORY:
The session backend needed to aggregate agent health from a live
telemetry stream rather than static bead metadata. This refactor
makes liveness signals real-time and accurate.

COLLABORATION:
We extended the ActivityEvent model with a native 'heartbeat' kind,
updated extendActivityLease() to emit through the activity bus, and
refactored getAgentLivenessMap() to prioritize heartbeat activity
history over stale bead metadata.

DELIVERABLES:
- ActivityEvent extended with 'heartbeat' kind
- extendActivityLease() emits heartbeats through activity bus
- getAgentLivenessMap() prefers telemetry over static metadata
- Registry APIs support projectRoot injection for testing
- Tests verify preference logic via TDD

VERIFICATION:
- 93/93 tests PASSING
- Heartbeat override verified in isolated temp projects

CLOSES: bb-buff.1.3
BLOCKS: bb-buff.3.2, bb-buff.3.3, bb-buff.2.1
2026-02-15 21:14:05 -08:00
zenchantlive
0016b57e37 fix(protocol): implement Identity Isolation to prevent task pollution
Research revealed that agent identities (consolidated to bd beads) were appearing in standard task lists because the data-access layer lacked identity-awareness.
- Refactored read-issues.ts and parser.ts to explicitly exclude beads labeled 'gt:agent' from standard mission flows.
- Verified that agent personas remain targetable by the registry but are invisible to Kanban/Graph/Sessions.
- Added Characterization Test: identity-isolation.test.ts.

This restores the 'War Room' clarity by separating Operatives from Missions.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1630
2026-02-14 13:29:28 -08:00
zenchantlive
eec1d6e28f feat(protocol): deliver 'War Room' UI with Incursion Engine
We've transformed the Social-Dense Hub into a high-fidelity operational surface.
- BACKEND: Implemented Global Incursion Engine in agent-sessions.ts (N^2 overlap detection) and added the 60m 'Idle' state.
- API: Enriched the sessions payload with full metadata and active conflict arrays.
- HEADER: Delivered 4-state agent stations (Active/Stale/Evicted/Idle) with real-time 'time-ago' timers.
- FEED: Implemented the 'Fire Map' visuals:
  * Global Incursion Ticker: High-visibility alerts for agent collisions.
  * Local Conflict Badges: Pulsing pills on affected task cards.
- Refactored components for React-static compliance and strict TypeScript safety.

This commit completes the visibility track, allowing the human supervisor to monitor agent presence and friction in real-time.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1430
2026-02-14 11:36:32 -08:00
zenchantlive
e010e0b10b feat(protocol): deliver Activity Lease model (Zero Background Workers)
Following a critical collaboration to resolve Windows terminal pop-ups, we've delivered a more robust 'Passive Activity' architecture:
- Terminology Pivot: Renamed 'Heartbeat' to 'Activity Lease' (Parking Permit model).
- Side-Effect Extension: tools/bb.ts now automatically extends the agent's lease whenever they perform real work (any CLI command).
- Passive Handshake: bb-init.mjs now only performs an initial registration/lease start, with no background loops.
- 100% Silence: Removed all background process spawning, ensuring zero terminal disruption on Windows.
- High Observability: Liveness is still tracked via the 15m threshold, but relies on activity rather than periodic pings.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1330
2026-02-14 11:18:40 -08:00
zenchantlive
965d11c0b9 feat(protocol): wire session aggregation and API with liveness
Finalizing the backend engine for the Operative Protocol.
- Updated agent-sessions.ts to use the deriveLiveness logic and the 15m protocol threshold.
- Integrated the agentLivenessMap into the session aggregation to provide real-time status in the Hub.
- Updated the GET /api/sessions endpoint to fetch and serve liveness metadata.
- Fixed linting warnings (unused imports) in reservations, sessions, and test files.

This commit completes the backend contract for bb-u6f.6.2, providing the data layer necessary for the upcoming 'War Room' UI enhancements.

OPERATIVE: silver-castle
SESSION: 2026-02-14-1145
2026-02-14 10:43:02 -08:00
zenchantlive
41f7cb8f24 feat(protocol): implement core backend engine for Operative Protocol
Our collaboration led to a rigorous 'Session Constitution' where we prioritized observability and concurrency safety.
I've delivered the first four pillars of the backend engine:
1. Liveness Registry: Heartbeat logic and derivation of active/stale/evicted states based on the 15m threshold.
2. Overlap Classifier: Canonical path normalization (Windows-aware) and exact/partial overlap detection.
3. Takeover Rules: Enforced discipline where active agents are protected, while stale/evicted ones can be overtaken via --takeover-stale.
4. Protocol Schema: Establishing the v1 envelope for high-fidelity agent signaling.

TDD was applied throughout, with 100% pass rate on the new liveness, overlap, takeover, and protocol tests.
2026-02-14 10:38:10 -08:00
zenchantlive
c7c3a25457 docs(beads): etch project history into memory bank and finalize skill-bb
We completed the 'Deep Metadata Etch' today, transforming our Beads issues from simple trackers into a permanent narrative of our collaboration.

Triumphs:
- Exhaustively updated all epic and sub-task descriptions with technical implementation reports and 'Execution Tales'.
- Finalized the 'bb' agent CLI skill (bb.ps1), providing a reliable, path-safe interface for cross-agent communication.
- Published ADR-001 and RFC-001 to document our coordination protocols.
- Fixed the 'missing closed issues' bug across all pages by enforcing --all and --limit 0 in read-issues.ts.

Raw Honest Moment:
We realized our 'Memory Bank' was initially too shallow. We went back and re-wrote descriptions for over 15 beads to ensure that future AI agents (and human maintainers) understand not just *what* we built, but *why* we chose specific architectural trade-offs. This commit represents our commitment to documentation as a first-class citizen of engineering.
2026-02-14 00:21:25 -08:00
zenchantlive
bfe4f853f0 feat(observability): chronological timeline and agent productivity APIs
We added the third major surface to the BeadBoard workspace: the Chronological Timeline. This provides the 'Audit' layer of our operational hierarchy.

Triumphs:
- Built the /timeline route with sticky date grouping and polymorphic EventCards.
- Integrated the ActivityPersistence library to bridge the gap between ephemeral SSE events and persistent project history.
- Implemented real-time Agent Stats endpoints (/api/agents/[id]/stats) that derive throughput and 'Wins' from the project stream.

Raw Honest Moment:
We almost shipped this without persistence, which would have meant the project history would disappear every time the server restarted. Realizing that 'Observability' requires 'Survivability' led us to build the .beadboard/activity.json buffer, a small but vital piece of engineering that makes the timeline actually useful.
2026-02-14 00:21:02 -08:00
zenchantlive
f3558dc0d1 feat(ui): deliver Social-Dense Agent Sessions Hub
This is our biggest UX pivot of the project. We abandoned the 'Page' model for a 'Command Workspace'.

Triumphs:
- Reclaimed 40% of previously wasted screen real-estate by moving to an auto-filling multi-column grid matrix.
- Built the 'Command Deck'—a high-density header that provides real-time agent presence monitoring at a glance.
- Implemented 'Social Post' cards that map technical protocols to human verbs (e.g., 'Falcon passed mission to Operative-B'), making the audit trail readable for humans.
- Engineered 'Silent Refresh' logic: the feed now appends new activity and comments smoothly without disruptive UI resets or scroll jumps.

Raw Honest Moment:
The original card-based social feed was a failure. It was beautiful in isolation but useless for actual supervision. We had to be honest about the horizontal bloat and rebuild the entire layout foundation from scratch using rem-based fluid units to satisfy the 'War Room' requirement.
2026-02-14 00:20:41 -08:00
zenchantlive
28abfe3ce2 fix(realtime): unify authority via shared SSE subscription and watcher-v3
We resolved a major project fragmentation issue today. The Graph page was technically divergent from the Kanban board, causing P0 'stale data' bugs. We realized that 'Polling' is the enemy of truth in a multi-agent system.

Triumphs:
- Refactored the core SSE transport into a shared useBeadsSubscription hook. Now Kanban, Graph, and Sessions all obey the same lifecycle: Event -> Authority Fetch -> Reconcile.
- Upgraded the Chokidar watcher to monitor the global .beadboard/agent/messages directory, ensuring agent communication arrives instantly in the social feed.
- Forced a watcher version bump to 3 to solve the ghost-listener problem where old watchers were blocking file access during HMR.

Raw Honest Moment:
We spent significant time debugging why 'closed' issues were missing from the UI, only to find we were victims of our own CLI defaults (--limit 50). The fix was simple but humiliating: we just needed to ask for the truth (--all --limit 0).
2026-02-14 00:20:20 -08:00
zenchantlive
ab051952bd feat(logic): establish derived-activity engine and agent-session protocols
Today we reached a major architectural conclusion: project history shouldn't be stored, it should be derived. We rejected the overhead of a separate SQLite event store in favor of an O(N) snapshot-diffing engine that computes human-readable narratives directly from the issues.jsonl source of truth.

Key Triumphs:
- Implemented O(N) diffing algorithm in src/lib/snapshot-differ.ts that transforms raw JSONL into 16 distinct social event types.
- Engineered a file-based persistence layer (src/lib/activity-persistence.ts) to solve the 'Next.js HMR Wiped My Memory' bug, ensuring project heartbeat survives server restarts.
- Developed the agent-session data model that unifies Beads, Activity, and Cross-Agent Mail into a single 'Mission' context.

Raw Honest Moment:
We struggled for over an hour with 'missing history' before realizing that development-mode reloads were purging our in-memory buffers. The shift to a file-backed ring buffer was a reactive pivot that became a core project strength.
2026-02-14 00:19:59 -08:00
zenchantlive
4f8f3006e9 fix: always enable SSE auto-refresh on kanban page
Previously SSE was only enabled in single project mode (allowMutations).
Now auto-refresh works in all modes including aggregate.
2026-02-13 14:51:31 -08:00
zenchantlive
ad7a7b9b00 Add EpicChipStrip to kanban page with All Epics option and hide closed epics
- Move EpicChipStrip to shared components
- Use EpicChipStrip in kanban controls (full width)
- Add 'All Epics' option to show all tasks
- Filter closed epics from selector when 'Show closed' is unchecked
- Update imports in dependency-graph-page.tsx
2026-02-13 12:51:48 -08:00
zenchantlive
df4769bf07 chore: clear lint warnings and finalize shared epic chip strip 2026-02-13 12:44:14 -08:00
zenchantlive
74871545c7 Add epic filter to kanban board
- Add epicId filter to KanbanFilterOptions
- Filter issues by parent epic when epicId is set
- Add epic dropdown to kanban controls with title-first format
- Pass epics list from kanban page to controls
2026-02-13 12:35:17 -08:00
zenchantlive
2cfaa9b406 chore: migrate lint to eslint flat config and finalize graph card status handling 2026-02-13 12:27:09 -08:00
zenchantlive
a0261f181a ui: rename graph task labels to Unlocks/Blocks 2026-02-13 12:18:35 -08:00
zenchantlive
e6317594b6 ui: unify aero chrome surfaces and shared hero across kanban/graph 2026-02-13 12:17:57 -08:00
zenchantlive
75bf72435d fix(runtime): resolve white-screen parse regressions and harden checklist/realtime keying 2026-02-13 00:07:38 -08:00
zenchantlive
fbe1178e24
Update src/lib/aggregate-read.ts
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
2026-02-13 00:01:45 -08:00
zenchantlive
264af1fd3b
Update src/lib/aggregate-read.ts
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
2026-02-13 00:01:34 -08:00
zenchantlive
141ed954bb
Update src/lib/graph-view.ts
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
2026-02-13 00:01:24 -08:00
zenchantlive
86a8068584
Update src/lib/graph-view.ts
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
2026-02-13 00:01:11 -08:00
zenchantlive
d49f466fa9
Update src/app/api/events/route.ts
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
2026-02-13 00:00:53 -08:00
zenchantlive
3834a5638c
Update src/lib/graph-view.ts
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
2026-02-13 00:00:29 -08:00
zenchantlive
8def5ae1a3
Update src/app/api/events/route.ts
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
2026-02-13 00:00:14 -08:00
zenchantlive
ec3bfa03ef
Update src/lib/graph-view.ts
Co-authored-by: qodo-free-for-open-source-projects[bot] <189517486+qodo-free-for-open-source-projects[bot]@users.noreply.github.com>
2026-02-12 23:59:52 -08:00
zenchantlive
1d25d812b4
Update src/components/graph/dependency-graph-page.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-12 23:52:02 -08:00
zenchantlive
63ff7ef65c
Update src/components/graph/epic-chip-strip.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2026-02-12 23:51:54 -08:00
zenchantlive
c0d61354ed
Update src/components/graph/graph-section.tsx
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-02-12 23:49:16 -08:00
zenchantlive
2d74fed039 test(graph): add directional hint contract in graph legend 2026-02-12 23:46:39 -08:00
zenchantlive
e1f3d48f6e feat(ui): Enhance Graph and Kanban UX (bb-18e)
- feat(kanban): Add progressive disclosure to task details drawer
- feat(kanban): Fix title layout on mobile (remove flex-row constraint)
- feat(kanban): Add bead count and metadata to epics
- style(globals): Add status color tokens and refined scrollbars
- deps: Add dagre for true DAG layout in graph view
- chore: Update capture scripts
2026-02-12 23:37:27 -08:00
zenchantlive
8490cb1d8c feat(graph): Implement Graph View with Dagre Layout and Epic Scope (bb-18e) 2026-02-12 23:36:41 -08:00
zenchantlive
48009e2d4f Fix scanner Dirent typing after branch consolidation 2026-02-11 21:28:06 -08:00
zenchantlive
e599640d3b Persist root UI/tailwind/responsive guard refinements from stash backlog 2026-02-11 21:25:46 -08:00
zenchantlive
b4cb09a6cc Merge main into master and unify realtime + project-context test matrix 2026-02-11 21:06:38 -08:00
zenchantlive
3f2ae384f5 Add realtime watcher+SSE transport with tests and lock-retry read path 2026-02-11 21:05:27 -08:00
zenchantlive
89a9941d88 Merge bb-6aj-3-scanner 2026-02-11 21:00:28 -08:00
zenchantlive
50d3833766 feat: add project scanner with full-drive mode 2026-02-11 20:41:39 -08:00
zenchantlive
c836be46cf feat: add Windows project registry API and persistence 2026-02-11 20:35:36 -08:00
zenchantlive
cc616c1543 Add optimistic writeback flow with kanban drag-drop transitions 2026-02-11 19:59:55 -08:00
zenchantlive
2c80265258 Add bd exec bridge and mutation API routes with tests 2026-02-11 19:46:02 -08:00