# CyberBrain26 — agent ramp-up notes

Only repo-specific facts that change how an agent works. See `.kilo/plans/CyberBrain26cil-031026-v2.md` for the active build plan; `.kilo/agent/orchestrator.md` for delegation rules.

## Commands that matter

```
pytest -q
ruff check
mypy src/cyberbrain26
```

Full suite: 747 passed. Gate 1 = all three green before any `src/` change.

## Config and environment (tests)

- `.kilo/kilo.jsonc`: `subagent_depth: 3`, `default_agent: promptmaster`, `mcp.cyberbrain26.enabled: false`
- Test fixtures rewrite `CYBERBRAIN_DB_PATH`, `CYBERBRAIN_WORKSPACES_ROOT`, `CYBERBRAIN_DATA_DIR` into `tmp_path`
- Ollama: `http://localhost:11434` (models: `phi3.5:latest`, `dolphin-cb26:latest`, `qwen3-embedding:0.6b`)

## Security / delegation (D6 invariant)

- `orchestrator` is the only agent with `task: allow`. All other subagents have `task: deny` by default.
- `bash`: only `orchestrator` and `tester` have exceptions; `edit`: `orchestrator` (markdown only) and `implementer` (`src/`/`tests/`). Changes to `src/`, `tests/`, `.github/`, `.kilo/kilo.jsonc`, `pyproject.toml` require owner approval.
- Cross-check before any subagent: read `src/cyberbrain26/security_plane/actions.py:242-272` (`ACTION_SCOPE_REQUIREMENTS`). If `declared_actions` missing → `REJECT_SCOPE_MISSING`, do not launch.
- Fail-closed: no silent fallbacks. `bubblewrap_provider.py:97-258` raises `RuntimeError` when sandbox missing.

## Gate sequence

1. Gate 1 (PŘED): `pytest -q`, `ruff check`, `mypy src/cyberbrain26` → green
2. Change (only with diff + approval)
3. Gate 2 (PO): same + diff + coverage → green
4. Gate 3: different model (LLM-as-judge), only after 1+2

Never mention `semgrep`; never claim hash audit chain exists. `AuditLog.record()` is `INSERT`; `clear()`/`prune_expired()` delete.

## Knowledge plane (current)

- `knowledge_plane/` has contracts (`KnowledgeDocument`, `KG1Node`), chunker (`TextChunker`), embedding (`EmbeddingService` with `qwen3-embedding:0.6b`, dim=1024), vector store (`KnowledgeVectorStore` over LanceDB), navigation (`KnowledgeNavigator`), repository (`SQLiteKnowledgeRepository`), and `MemoryService`.
- `KG1Node` uses Jurassic OiO-pattern `IPOMSQ` semantics (`business_semantics`, `domain_constraints`, `evidence`).
- End-to-end pipeline: file → chunk → embed → LanceDB → search exists via `MemoryService` but CLI entry points (`cyberbrain knowledge ingest/search`) still need integration (F2 target).

## Receipt (Rule 7)

Every claimed change needs `file:line` + one verifying command (`cat -A`, `git status --porcelain`, `grep -c`). No receipt = `REJECT_UNVERIFIED`. Agents without `bash` do not get write work.

## Rejection vocabulary (use verbatim)

`REJECT_UNVERIFIED`, `REJECT_SCOPE_MISSING`, `REJECT_CONTEXT_MISMATCH`, `REJECT_GATE_RED`, `REJECT_SECURITY_FINDING`, `REJECT_EXTERNAL_DEPENDENCY`, `REJECT_HYPOTHESIS_ONLY`, `REJECT_SUPERSEDED`.

## Current status (2026-11-03)

- Phase: F2 (minimal complete agent flow)
- Tests: 764 passed; ruff/mypy clean (87 files)
- Completed: R1 (embedding), R2 (test isolation), R3 (proxy server), R4 (customer discovery), R5 (audit chain HMAC — `compute_link` unused in production code)
- Pending: Gate 3 agent (`gate3-auditor` unavailable in Task tool), CLI integration for knowledge plane.

## Where to read more

- `.kilo/plans/CyberBrain26cil-031026-v2.md` — active build plan
- `.kilo/plans/1793751496381-jurassic-ai-research.md` — deep research summary for knowledge plane integration
- `.kilo/plans/1793751496381-orchestrator-autonomy-plan.md` — delegation rules and gate workflow
- `tests/` — 764 tests; `tests/test_kilo_agent_policy.py` for agent permissions; `tests/test_plan_authority.py` guards plan authority (AGENTS.md must not cite guards that don't exist)
- `docs/CAPABILITIES.md` — verified capabilities with `file:line` evidence
