12 KiB
Agent Operating Manual (BeadBoard)
This repo is execution-first, evidence-first, and beads-driven.
Core Rules
- We both hate markdown files for memory; we use beads instead. View
beadboard/help/for more info on how to use beads. Use the--helpflags when you need help, or reference this folder. - Our working directory for this project is
codex/beadboard. - Use
bdas the source of truth for work state. - When user says "what's up" or "yo" or any introductory phrase, that means figure out what beads were recently closed and what beads are now unblocked or related to the recently closed beads and suggest the next bead to work on using
bd query "status=closed" --sort closed --reverse --limit 10andbd ready. - No direct writes to
.beads/issues.jsonl; mutate viabdcommands only. - Evidence before assertions: do not claim fixed/passing/done without fresh command output.
- Keep language simple in user-facing labels and UI copy.
- Reuse shared code paths/components; avoid one-off logic drift across pages.
- Treat BeadBoard as a multi-agent coordination + communication system first; optimize feature decisions for swarm execution clarity before cosmetic/layout preferences.
- Runtime UI route surface is query-driven from
/(view=social|graph|activity); do not reintroduce direct App Router page sprawl without explicit approval.
Quick Beads Workflow
bd ready
bd show <id>
bd update <id> --status in_progress
bd update <id> --notes "<progress/evidence>"
bd close <id> --reason "<what was completed>"
bd dolt pull # pull latest from remote before starting work
bd dolt push # push to remote after closing beads
Native Memory Workflow (Required)
Use help/memory/ for all memory operations.
- Memory source-of-truth is
bd+ Dolt history, not markdown files. - At task start, run the query/injection playbook in
help/memory/query_and_injection.txt. - Canonical memory must be
decisionbeads with labels:memory,mem-canonical,mem-hard|mem-soft,<domain>
- Memory indexing uses
bd dep relateto domain anchors; do not use blocker edges for indexing. - Only hard constraints may become blockers, via a memory-contract bead linked with
bd dep add. - Memory evolution must use
bd supersede <old> --with <new>; do not rewrite canonical history. - Apply noise budget limits from
help/memory/schema_and_noise_budget.txtbefore adding new nodes. - After closing meaningful work, run a memory review:
- If a reusable lesson exists, create or supersede a canonical memory node in the correct domain.
- If no reusable lesson exists, add a note to the closed bead:
Memory review: no new reusable memory.
- Every canonical memory must be linked to provenance:
- Relate to one domain anchor:
bd dep relate <anchor-id> <memory-id> - Relate to 2-5 source beads:
bd dep relate <memory-id> <source-bead-id>
- Relate to one domain anchor:
- Every canonical memory must include metadata keys:
evidence_ids(comma-separated source bead IDs)plan_refs(comma-separated plan file paths)
- Fresh agents must validate provenance before use:
bd show <memory-id>bd dep list <memory-id>
Bead Prompting Standard
- When creating or rewriting bead details, follow
docs/protocols/bead-prompting.md. - Bead descriptions must be model-facing prompts, not internal prose notes.
- Include explicit
ScopeandOut of Scopein every bead. - Treat
Success Criteriaas the completion contract. - Keep dependency flow minimal and execution-correct.
Start-of-Task Protocol
- Read the target bead and acceptance criteria (
bd show <id>). - Confirm dependency direction before coding.
- Write a short implementation plan with explicit verification steps.
- Claim the bead
in_progresswith a note describing scope.
Dependency Discipline (Critical)
- Dependencies model execution order, not visual order.
- Validate that "ready/blocked/done" logic matches dependency semantics in all views.
- If a bead should be parallelizable, do not chain it unnecessarily.
- After closing a bead, confirm newly unblocked beads with
bd ready.
Test-First Implementation
- Write failing tests first for every behavior change.
- Run the failing test and capture the failure reason.
- Implement the smallest change to pass.
- Re-run focused tests, then full gates.
Verification Gates (Required)
Run these before closing a bead that changes code:
npm run typecheck
npm run lint
npm run test
If UI changed, refresh screenshots and record artifact paths.
Runtime Surface Guardrails
- Keep the active runtime page surface minimal under
src/app. - Preserve deprecated/legacy page implementations in
reference/routes/**when useful for reuse. - Maintain backward-compatible redirects in
next.config.tswhen route contracts change.
Realtime / Refresh Bug Triage Pattern
When status updates are stale or require refresh:
- Verify source-of-truth parity (
bd showvs app output). - Confirm read path prefers live BD data when needed.
- Confirm watcher coverage for active project scope roots and relevant agent/message files.
- Confirm SSE event flow and client subscription behavior across all active views.
- Add regression tests for watcher/events behavior and scope switching.
Parallel Agent Pattern
Use parallel agents for independent beads.
- Parent agent owns orchestration and integration.
- Worker agent owns one bead only, claims it, tests it, verifies it, closes it.
- Worker reports exact files changed and command results.
- Parent re-verifies full repo gates before final status claims.
PR and Diff Hygiene
- Keep diffs scoped to intended files.
- Include test files with feature/bugfix code.
- Do not mix unrelated cleanup in the same bead.
- Update bead notes with concrete evidence (commands + results).
Common Failure Patterns (Do Not Repeat)
- Wrong
bdflags:bd createuses--acceptance, not--acceptance-criteria.bd closedoes not support--notes; add notes withbd update <id> --notes "..."first, then close.
- Premature completion claims:
- Never say a bead is done before running fresh
npm run typecheck,npm run lint,npm run test.
- Never say a bead is done before running fresh
- Scope confusion in parallel work:
- Worker agents must own one bead only and avoid touching unrelated files.
- Dependency direction mistakes:
- Validate blockers/ready semantics against dependency graph before changing status logic.
- Duplicate fixes across views:
- If logic affects Kanban and Graph, centralize shared logic; do not patch one page only.
- Stale realtime assumptions:
- Confirm DB + WAL + touch markers are watched and SSE fallback uses mtime/timestamps.
- Missing test registration:
- New test files must be included in
npm run testscript if the suite is explicitly enumerated.
- New test files must be included in
- Documentation drift:
- Do not claim features in
README.mdthat are not currently shipped, unless clearly labeled as roadmap.
- Do not claim features in
Session Completion (Landing the Plane)
When ending a coding session:
- Create beads for remaining follow-ups.
- Run quality gates if code changed.
- Update/close beads with notes and evidence.
- Run memory review on newly closed beads and create/supersede memory nodes when reusable lessons were found.
- If no memory was added, record
Memory review: no new reusable memory.in handoff notes. - Sync and push:
git pull --rebase bd dolt pull git add -p && git commit -m "..." git push bd dolt push - Hand off with:
- what changed,
- what is verified,
- open risks/gaps,
- exact next bead(s).
Non-Negotiable Honesty Rule
Never claim:
- "done",
- "passing",
- "fixed",
- "closed"
unless you have run the proving command(s) in the current session and can cite results.
Issue Tracking with bd (beads)
IMPORTANT: This project uses bd (beads) for ALL issue tracking. Do NOT use markdown TODOs, task lists, or other tracking methods.
Why bd?
- Dependency-aware: Track blockers and relationships between issues
- Git-friendly: Auto-syncs to JSONL for version control
- Agent-optimized: JSON output, ready work detection, discovered-from links
- Prevents duplicate tracking systems and confusion
Quick Start
Check for ready work:
bd ready
Create new issues:
bd create --title="Issue title" --description="Detailed context" --type=bug|feature|task --priority=0-4
Claim and update:
bd update <id> --status in_progress
bd update <id> --notes "<evidence/progress>"
bd update <id> --priority 1
Complete work:
bd close <id> --reason "Completed"
Issue Types
bug- Something brokenfeature- New functionalitytask- Work item (tests, docs, refactoring)epic- Large feature with subtaskschore- Maintenance (dependencies, tooling)
Priorities
0- Critical (security, data loss, broken builds)1- High (major features, important bugs)2- Medium (default, nice-to-have)3- Low (polish, optimization)4- Backlog (future ideas)
Workflow for AI Agents
- Check ready work:
bd readyshows unblocked issues - Claim your task:
bd update <id> --status in_progress - Work on it: Implement, test, document
- Discover new work? Create linked issue:
bd create --title="Found bug" --description="Details" --priority=1bd dep add <new-id> <parent-id>
- Complete:
bd close <id> --reason "Done"
Sync
Issues live in Dolt SQL (not JSONL). Sync with remote via:
bd dolt pull # pull latest from remote before starting work
bd dolt push # push after closing beads
.beads/issues.jsonl is a git-history artifact and fallback only — do not treat it as the source of truth.
Important Rules
- ✅ Use bd for ALL task tracking
- ✅ Check
bd readybefore asking "what should I work on?" - ✅ Link related work with
bd dep add - ❌ Do NOT create markdown TODO lists
- ❌ Do NOT write directly to
.beads/issues.jsonl - ❌ Do NOT duplicate tracking systems
Data Backend & Platform Notes
BeadBoard reads issues from the Dolt SQL server (bd's native backend since bd 0.56+). The Dolt server runs locally at 127.0.0.1:3307 and is started automatically by the bd daemon.
Single-platform setups (most users)
- WSL2 only: frontend +
bd+ Dolt all in WSL2 → just works. - Windows only: frontend +
bd+ Dolt all in Windows → just works.
Mixed WSL2 + Windows (workaround required)
If you run the Next.js frontend in Windows PowerShell but bd / Dolt in WSL2 (or vice versa), 127.0.0.1 refers to different loopbacks and the frontend can't reach the Dolt server.
Workaround: enable WSL2 mirrored networking so localhost is shared between Windows and WSL2.
Create C:\Users\<you>\.wslconfig:
[wsl2]
networkingMode=mirrored
Then restart WSL2:
wsl --shutdown
This is a one-time setup for mixed environments only. It is not required for single-platform contributors.
How the read path works
BeadBoard (src/lib/read-issues.ts) queries Dolt SQL directly via mysql2 (src/lib/dolt-client.ts). On every page load or SSE-triggered refresh:
readIssuesFromDisk()→ triesreadIssuesViaDolt(projectRoot)first- If Dolt unreachable → logs a warning and falls back to reading
issues.jsonl
issues.jsonl is a deprecated fallback — no manual export step is required. The file is kept on disk by bd for git history, but BeadBoard does not rely on it when the Dolt server is running.
SSE real-time updates: bd touches .beads/last-touched on every write. Chokidar detects this change, triggers a snapshot diff, and fires an SSE event if anything changed — fetching fresh data from Dolt automatically.