You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Optionally [docs/evolution.md](/Users/deepg/Desktop/KnowCode/docs/evolution.md:103) if you want the roadmap item to point at the new harness
@@ -88,7 +88,7 @@ Create a CI-safe, deterministic retrieval eval harness for code-only MCP usage,
88
88
1. Build a tiny fixture repo that covers the MCP use cases you care about most now:
89
89
`locate`, `explain`, `debug`, and dependency tracing.
90
90
2. Define a simple dataset schema:
91
-
`query`, `task_type`, `expected_entity_ids`, and optional `notes`.
91
+
`query`, `task_type`, `expected_entity_ids` (proposed schema field, implemented in `tests/eval/harness/scorer.py`), and optional `notes`.
92
92
3. Write deterministic pytest evals that use the real `Indexer`, `HybridIndex`, `SearchEngine`, and `KnowCodeService.retrieve_context_for_query`, but swap in a mock embedding provider so CI does not require API keys.
93
93
4. Assert on outcomes that matter for correctness:
94
94
returned entity IDs, retrieval mode behavior, non-empty context where expected, and sufficiency score shape.
@@ -147,9 +147,10 @@ Define one canonical MCP retrieval contract and make every agent-facing rule, gu
147
147
6. Keep freshness, coverage, and observability changes out of this PR.
148
148
149
149
**Files To Add**
150
-
-`docs/mcp-contract.md`
150
+
-None (Note: `docs/mcp-contract.md` has been successfully implemented and is now the canonical contract)
@@ -176,7 +177,7 @@ Define one canonical MCP retrieval contract and make every agent-facing rule, gu
176
177
177
178
**Acceptance Criteria**
178
179
- There is one canonical contract doc, and the rule file, setup guide, and README all point to it rather than redefining policy separately.
179
-
- Conflicting threshold guidance such as `0.75`, `0.8`, and `0.88` no longer appears as competing defaults without explanation.
180
+
- Conflicting threshold guidance is resolved (standardized to `0.8` default in config and contract, while unit tests use `0.75` for isolated testing scenarios without conflict).
180
181
- The local-first runtime path follows the same `minimal` then escalate behavior described in the docs.
181
182
- Tests cover both local-answer and escalation paths.
182
183
@@ -216,7 +217,6 @@ Ensure KnowCode either keeps artifacts fresh enough to trust or clearly tells th
216
217
217
218
**Files To Add**
218
219
-`tests/unit/indexing/test_monitor.py`
219
-
-`tests/unit/indexing/test_background_indexer.py`
220
220
-`tests/unit/service/test_freshness.py`
221
221
222
222
**Files To Update**
@@ -227,6 +227,7 @@ Ensure KnowCode either keeps artifacts fresh enough to trust or clearly tells th
@@ -323,56 +324,54 @@ uv run pytest tests/unit/indexing/test_scanner.py tests/unit/parsers/test_rust_p
323
324
324
325
**PR5 Brief**
325
326
326
-
This PR should make everyday setup operational instead of doc-driven. Right now the building blocks exist, but the workflow is still spread across `analyze`, `index`, hand-edited MCP config, and a machine-specific verification shell script.
327
+
This PR operationalizes everyday setup checks. Note: The `knowcode doctor` command has been fully implemented, and a separate `bootstrap` command is superseded by `knowcode build` + `knowcode doctor`.
327
328
328
329
**Context**
329
-
The CLI already exposes the primitives in [src/knowcode/cli/cli.py](/Users/deepg/Desktop/KnowCode/src/knowcode/cli/cli.py:18): `analyze`, `index`, `server`, `mcp-server`, `stats`, and `ask`. The service also has idempotent helpers such as [KnowCodeService.ensure_store()](/Users/deepg/Desktop/KnowCode/src/knowcode/service.py:90) and [KnowCodeService.ensure_index()](/Users/deepg/Desktop/KnowCode/src/knowcode/service.py:108). But there is no repo-level `doctor` or `bootstrap` command, and [verify_mcp_connection.sh](/Users/deepg/Desktop/KnowCode/verify_mcp_connection.sh:1) is hardcoded to one environment and MCP client path.
330
+
The CLI already exposes the primitives in [src/knowcode/cli/cli.py](/Users/deepg/Desktop/KnowCode/src/knowcode/cli/cli.py:18): `analyze`, `index`, `build`, `doctor`, `server`, `mcp-server`, `stats`, and `ask`. The doctor check is backed by `src/knowcode/doctor.py` and tested under `tests/unit/cli/test_doctor.py`.
330
331
331
332
**Objective**
332
-
Provide one repeatable local-repo bootstrap and verification workflow that gets a repo to “KnowCode ready” without relying on tribal knowledge.
333
+
Ensure the bootstrap and verification workflow using `knowcode build` and `knowcode doctor` gets a repo to “KnowCode ready” without relying on tribal knowledge.
333
334
334
335
**Scope**
335
-
1. Add a bootstrap flow that creates missing local artifacts.
336
-
2. Add a doctor flow that reports readiness and next steps deterministically.
337
-
3. Reuse the freshness and coverage signals from `PR3` and `PR4`.
338
-
4. Replace machine-specific verification guidance with portable CLI behavior.
339
-
5. Update setup docs so the happy path is command-first.
336
+
1. Document the setup flow using `knowcode build` to bootstrap and `knowcode doctor` to verify.
337
+
2. Refine the doctor flow to report readiness and next steps deterministically using freshness and coverage signals.
338
+
3. Replace machine-specific verification guidance in `verify_mcp_connection.sh` with portable check logic.
339
+
4. Update setup docs so the happy path is command-first.
340
340
341
341
**Files To Add**
342
-
-`tests/unit/cli/test_doctor.py`
343
-
-`tests/unit/cli/test_bootstrap.py`
342
+
- None (All required tools and tests are already created)
1.Define a doctor report with clear pass/warn/fail output for at least:
354
+
1.Ensure the doctor report has clear pass/warn/fail output for:
355
355
knowledge store presence,
356
356
semantic index presence,
357
357
freshness state,
358
358
MCP server readiness,
359
359
active rule file presence,
360
360
unsupported-extension warnings.
361
-
2. Add a bootstrap command that creates missing artifacts without rebuilding everything unnecessarily.
362
-
3. Reuse existing `ensure_store` and `ensure_index` behavior instead of duplicating build logic in the CLI layer.
363
-
4. Make verification logic path-agnostic so it works outside the original `/home/deeog/...` environment.
364
-
5. Rewrite setup docs around the new bootstrap/doctor flow and demote the old manual checklist to fallback documentation.
361
+
2. Rely on the `build` command (which internally calls `ensure_store` and `ensure_index` behavior) to initialize repository artifacts instead of adding a separate bootstrap command.
362
+
3. Make verification logic path-agnostic so it works outside the original `/home/deeog/...` environment.
363
+
4. Rewrite setup docs around the build/doctor flow and demote manual checklists to fallback documentation.
365
364
366
365
**Acceptance Criteria**
367
-
- A new local repo can be prepared with one documented bootstrap command.
368
-
-A doctor command explains exactly what is missing or stale and what the next fix step is.
366
+
- A new local repo can be initialized and verified using `knowcode build` and `knowcode doctor`.
367
+
-The doctor command explains exactly what is missing or stale and what the next fix step is.
369
368
- Verification no longer depends on hardcoded absolute paths to one user’s machine or one MCP client.
370
-
- CLI tests cover common bootstrap and prerequisite-failure cases.
369
+
- CLI tests cover common build and doctor prerequisite-failure cases.
371
370
372
371
**Verification**
373
372
```bash
374
-
uv run pytest tests/unit/cli/test_cli.py tests/unit/cli/test_bootstrap.py tests/unit/cli/test_doctor.py
375
-
uv run knowcode bootstrap. --output .
373
+
uv run pytest tests/unit/cli/test_cli.py tests/unit/cli/test_doctor.py
374
+
uv run knowcode build. --output .
376
375
uv run knowcode doctor --store .
377
376
```
378
377
@@ -382,7 +381,7 @@ uv run knowcode doctor --store .
-**Solution**: Changed to absolute path to knowcode binary in local `.venv` (e.g. `"/Users/deepg/Desktop/KnowCode/.venv/bin/knowcode"` or `"<project_root>/.venv/bin/knowcode"`)
4.**[README_MCP.md](file:///Users/deepg/Desktop/KnowCode/README_MCP.md)** - This quick reference (you are here)
64
65
65
66
## 🚀 Quick Commands
66
67
@@ -93,40 +94,43 @@ knowcode analyze . -o .
93
94
94
95
## 🐛 Troubleshooting
95
96
96
-
### MCP Tool Not Available After Restart?
97
+
### Check Setup with Doctor Command
98
+
The absolute best way to check the status of your KnowCode configuration, knowledge store, and semantic index is using `knowcode doctor`:
99
+
```bash
100
+
uv run knowcode doctor --store . --mcp
101
+
```
102
+
This command checks configuration files, verifies the presence of required index files (`index_manifest.json`, `chunks.json`, `vectors.index`), and tests the local MCP server handshake.
97
103
98
-
1. Check server is running:
104
+
### MCP Tool Not Available After Restart?
99
105
106
+
1. Check if the server process is running:
100
107
```bash
101
108
ps aux | grep "knowcode mcp-server"
102
109
```
103
110
104
-
2. Check configuration:
105
-
111
+
2. Check configuration file paths:
106
112
```bash
107
113
cat ~/.gemini/antigravity/mcp_config.json
108
114
```
109
115
110
-
3. Restart IDE again
116
+
3. Restart the IDE/client to reload the configuration.
111
117
112
118
### Low Sufficiency Scores?
113
119
114
-
1. Verify index exists (should be created by analyze):
115
-
120
+
1. Verify the semantic index directory contains the three required files:
121
+
-`index_manifest.json`
122
+
-`chunks.json`
123
+
-`vectors.index`
116
124
```bash
117
125
ls -la knowcode_index/
118
126
```
119
127
120
-
2. If missing, run a dedicated index build:
121
-
128
+
2. If any files are missing, rebuild the index:
122
129
```bash
123
-
knowcode index . --output knowcode_index
130
+
uv run knowcode index . --output knowcode_index
124
131
```
125
132
126
-
3. Increase token budget in `.agent/context.md`:
127
-
```markdown
128
-
Use max_tokens=6000, limit_entities=5
129
-
```
133
+
3. Adjust token budget parameters in [.agent/rules/context.md](file:///.agent/rules/context.md) following the verbosity ladder in [docs/mcp-contract.md](file:///Users/deepg/Desktop/KnowCode/docs/mcp-contract.md).
130
134
131
135
## 📊 Success Metrics
132
136
@@ -139,19 +143,18 @@ After setup, you should see:
0 commit comments