# Plan: CAPABILITIES.md — mark knowledge plane as WORKING with path:line evidence

## Source of truth
- Parent plan: `.kilo/plans/1793841013681-continuation-after-gate1.md` (item #7: "Update `docs/CAPABILITIES.md` — mark knowledge plane as `WORKING` with `path:line` evidence")
- Related context: `RECEIPT_KNOWLEDGE_PLANE.md` (receipt evidence for MemoryService), `docs/CAPABILITIES.md` (capability status table)

## Goal
Update `docs/CAPABILITIES.md` so the knowledge-plane CLI commands (`cyberbrain knowledge ingest /search`) carry accurate `WORKING` status with `path:line` evidence, per the CAPABILITIES.md rule ("code + test + command that reaches it").

## Current state (verified via read/grep)

- `cli.py:615-775` — `knowledge` command with `--action ingest|search|hybrid-search|graph-search|kg1` options registered via `@app.command()` at `cli.py:615`. `knowledge` subcommand is reachable.
- `cli.py:590-613` — `_get_memory_service()` builds a `MemoryService` wired with `AuditLog`, `SQLiteDatabase`, `EmbeddingConfig`.
- Knowledge plane code/tests exist: `tests/test_knowledge_plane.py`, `tests/test_knowledge_integration.py` (8 tests), `memory_service.py` full pipeline (register_file/chunk/embed/LanceDB/search).
- No test file reaches the CLI `knowledge` command itself (`grep` over `tests/` found zero CLI knowledge tests).

## Constraint per CAPABILITIES.md rule (docs/CAPABILITIES.md:3-5)
A capability is only `WORKING` if there is code, a test, and a command that reaches it. Otherwise `LIBRARY-ONLY`/`PARTIAL`.

- Knowledge plane library (`MemoryService`): code ✅ + tests ✅ → `WORKING` defensible at library level.
- Knowledge plane **CLI commands** (`cyberbrain knowledge ingest/search`): code ✅ + command ✅ + **no CLI test** ✅ → cannot be marked `WORKING` today.

## Decisions (to resolve)

### Decision A — CLI knowledge command status
Options:
1. Add CLI-level tests reaching `knowledge ingest`/`knowledge search` (via CliRunner), then mark `WORKING`. — requires `bash`/pytest to validate, which is currently denied by `.kilo/kilo.jsonc:83`.
2. Keep as `LIBRARY-ONLY`/`PARTIAL` with accurate `path:line` evidence until CLI tests are added. — safe now; no test dependency.

Recommendation (default unless owner objects): **Option 2** for this plan, since Gate 1 (pytest) is blocked by `.kilo/kilo.jsonc:83` (`"bash": "deny"`). Mark knowledge CLI rows as `PARTIAL`/`LIBRARY-ONLY` with correct `path:line`, and note "add CLI test to promote to WORKING" as a follow-up.

### Decision B — row placement
Replace the previously-added placeholder rows (CAPABILITIES.md:33-34) with accurate rows and update the "Any other command" row (line 35) to reflect registered commands (`approvals`, `doctor`, `knowledge`).

## Required edits (implementation agent)

1. `docs/CAPABILITIES.md` — update knowledge-plane command rows with verified `path:line` evidence:
   - `cyberbrain knowledge ingest /path/to/docs`: `cli.py:615-672` (register_file loop over directory + `register_file` via `memory_service` at `cli.py:657`), audit via `AuditLog` (`cli.py:590-613`).
   - `cyberbrain knowledge search "dotaz"`: `cli.py:674-709` (`semantic_search`/`hybrid_search` via `memory_service`, `cli.py:682-685`), ranked results printed at `cli.py:696-703`.
   - `Any other command`: `cli.py:64-67` registers only `approvals`, `doctor`, `knowledge` → update text from "only `approvals` and `doctor`".
2. Gate 1 verification: `pytest -q`, `ruff check src/cyberbrain26/`, `mypy src/cyberbrain26/` → green. Blocked by `.kilo/kilo.jsonc:83` (bash deny) — requires owner to allow `bash` for tester agent per `.kilo/agent/*.md`.
3. After tests for CLI knowledge commands exist and pass: promote status to `WORKING` in `docs/CAPABILITIES.md`.

## Evidence to cite
| Item | path:line |
|------|-----------|
| `knowledge` CLI command registered | `cli.py:615` |
| `knowledge` ingest action | `cli.py:642-672` |
| `knowledge` search/hybrid-search action | `cli.py:674-709` |
| `_get_memory_service()` | `cli.py:590-613` |
| Knowledge plane tests | `tests/test_knowledge_plane.py`, `tests/test_knowledge_integration.py` |
| MemoryService class | `src/cyberbrain26/knowledge_plane/memory_service.py:48` |

## Risks
- `.kilo/kilo.jsonc:83` (`"bash": "deny"`) blocks pytest/ruff/mypy execution → Gate 2 cannot be run locally; owner decision required before any test-file addition can be validated.
- Marking CLI commands `WORKING` without a CLI-reaching test violates CAPABILITIES.md rule 1.

## Open question (ask owner when switching to implementer)
Should I add CLI-level tests for `knowledge ingest`/`knowledge search` (to promote to `WORKING`), or keep the rows at `LIBRARY-ONLY`/`PARTIAL` pending bash access?
