Skip to content

Component Test Entrypoints

Use this page to choose the smallest useful validation loop for the component you touched. Start with the narrow loop, then expand only when the change crosses boundaries. Use sb dev review before release work or broad refactors.

Component Loops

Component Primary source areas Narrow loop Broader loop
Agent Runtime brain/agent/, brain/agent_runtime/, brain/background_sessions/ pytest -q tests/agent tests/infra/test_background_sessions.py pytest -q tests/infra/test_gateway_runtime.py -k "runtime or session"; npm run test in serve-ui/ for UI reducers
Chat And Sessions brain/chat/, brain/serve/chat_runtime.py, serve-ui/src/pages/ChatPage.tsx pytest -q tests/chat tests/infra/test_serve_stream_contract.py pytest -q tests/infra/test_*serve*.py tests/chat/test_chat_runtime.py; npm run test in serve-ui/
Context, Knowledge, Memory brain/context/, brain/retrieve/, brain/ingest/, brain/memory/ pytest -q tests/context tests/memory -k "context or memory or retrieval" pytest -q tests/infra tests -k "context or ingest or file_hash or citation"
Domain Agents brain/data_agent/, brain/grounded/, brain/meeting/, brain/marketing/, brain/travel/ pytest -q tests/data_agent tests/meeting tests/marketer tests/travel tests/antahkarana pytest -q tests -k "golden or grounded or travel or marketing or meeting or domain"
Integrations / MCP / A2A brain/integrations/, brain/connectors/, brain/mcp/, brain/a2a/ pytest -q tests/mcp tests/a2a tests/connectors pytest -q tests -k "mcp or integration or a2a or connector"; npm run test in serve-ui/ for UI changes
Kernel Tools brain/kernel/, brain/kernel/tools/, brain/agent/toolsets/ pytest -q tests/kernel tests/tools tests/agent -k "tool or budget or timeout or outcome" sb tools --help; make docs for tool docs
Model / Developer Capability brain/runtime/, brain/db/, brain/cli/, brain/context/, brain/background_sessions/, brain/policies/, brain/providers/, brain/quality/, brain/memory/, brain/serve/, serve-ui/ pytest -q tests/infra/test_*serve*.py -k "context or session or policy or approval or provider or quality or memory" npm run test; npm run build; pytest -q tests/chat tests/infra/test_background_sessions.py
Providers / Routing brain/providers/, brain/routing/, brain/profile/ pytest -q tests/providers tests/chat -k "local or provider" pytest -q tests/chat tests/infra/test_*serve*.py tests/providers -k "fallback or provider"
Quality / Observability / Autotune brain/obs/, brain/quality/, brain/eval/, brain/autotune/ pytest -q tests/quality tests/traces tests/autotune tests/improvement pytest -q tests -k "trace or quality or autotune or replay or eval"; npm run test in serve-ui/ for dashboards
Serve UI Daemon brain/serve/, serve-ui/, brain/daemon/, mac/SecondBrainMac/ pytest -q tests/infra/test_*serve*.py tests/infra/test_daemon.py npm run test; npm run build; Mac build only when mac/ changes
State And Governance brain/db/, brain/state/, brain/policies/, brain/security/ pytest -q tests/infra -k "db or migration or topology" pytest -q tests -k "approval or policy or command_safety or permissions"
Workflows / Automations brain/workflows/, brain/tasks/, brain/work_graph/, brain/automations/ pytest -q tests/workflow tests/tasks tests/work_graph -k "workflow or task or automation" pytest -q tests/infra/test_*serve*.py tests -k "automation"; npm run test in serve-ui/
Workforce brain/workforce/, ops/workforces/, brain/serve/routers/workforces.py, serve-ui/src/pages/OperationsPage.tsx pytest -q tests/workforce tests/infra/test_workforce_cli.py tests/infra/test_workforces_api.py; npm run test -- OperationsPage.test.tsx in serve-ui/ pytest -q tests/workflow tests/tasks tests/work_graph tests/infra/test_background_sessions.py -k "workflow or task or automation or background"; npm run build in serve-ui/

Contributor Maintenance Loops

Area Narrow loop Broader loop
Docs pytest -q tests/codebase/test_docs_index.py make docs; sb codebase docs-index --write
CLI schema workflow pytest -q tests/infra/test_cli_schema_sync.py sb ui-schema --check; sb ui-schema --write-default when command surfaces change

Escalation Rule

Prefer this order:

  1. Run the narrow component loop.
  2. Run adjacent contract or UI loops when the change crosses a boundary.
  3. Run make docs for docs or CLI/help changes.
  4. Run sb dev review before release work, broad refactors, or changes that touch multiple runtime surfaces.