Skip to content

Commit 39af47b

Browse files
committed
docs: document thread.* and llm.send debug in CLI-STATE; log pytest env gap in PRODUCTION_LOG
1 parent 3d91ef3 commit 39af47b

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

PRODUCTION_LOG.mg

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,18 @@ Pivot to a CLI-only experience with a Git-backed state repo and JSONL stdio serv
4242

4343
### What could we have done differently
4444
Call out environment constraints earlier and consider dual-mode from day one. Favor CLI-first for automation-heavy tools; treat TUI as an optional skin over the same state engine.
45+
46+
## Incident: Local test runner missing (pytest not installed)
47+
48+
Timestamp: 2025-11-08 00:00:00
49+
50+
Task: DP-F-30 / Thread verbs + Debug LLM (tests-first)
51+
52+
### Problem
53+
The environment lacks `pytest`, so tests could not be executed immediately after adding failing tests.
54+
55+
### Resolution
56+
Committed failing tests first, then implemented the features. Left tests in place for local/CI execution. Next dev step is `make dev-venv && . .venv/bin/activate && pip install -e .[dev] && pytest`.
57+
58+
### What could we have done differently
59+
Include a lightweight script or Makefile target that ensures a dev venv with pytest is provisioned before test steps, or run tests inside CI where the toolchain is guaranteed.

docs/CLI-STATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,3 +169,26 @@ flowchart LR
169169
## Migration from TUI
170170
- TUI postponed to backlog. All SPEC flows map to CLI commands with deterministic outputs.
171171
- Future: a minimal TUI could read/write the same Git‑backed state for a hybrid experience.
172+
173+
### Supported Commands (v0.1)
174+
- `hello` / `mind.hello` — returns version + repo context
175+
- `state.show` — returns current state.json
176+
- `repo.detect` — detects owner/repo and writes snapshot
177+
- `pr.list` — caches list of open PRs
178+
- `pr.select { number:int }` — sets current PR
179+
- `thread.list` — lists threads for the selected PR; caches minimal projection `{id, path, comment_count}`
180+
- `thread.select { id:str }` — sets current thread id
181+
- `thread.show [{ id:str }]` — shows details for selected or given thread from cache
182+
- `llm.send { debug:success|fail, prompt?:str }` — Debug LLM path; success returns `{ success:true, commits:["deadbeef"], error:"", prompt }`; fail returns error `LLM_DEBUG_FAIL`
183+
184+
### Error Schema
185+
```
186+
{ "id": "...", "ok": false, "error": { "code": "...", "message": "...", "details"?: {...} }, "state_ref": "<sha>" }
187+
```
188+
189+
Common codes:
190+
- `STATE_MISMATCH` — CAS guard failed (pass `expect_state`)
191+
- `INVALID_ARGS` — missing/invalid args or no selection
192+
- `NOT_FOUND` — referent missing (e.g., thread not in cache)
193+
- `UNKNOWN_COMMAND` — unrecognized command
194+
- `LLM_DEBUG_FAIL` — simulated LLM failure (debug path)

0 commit comments

Comments
 (0)