feat(stream): thinking + run log for CLI (GAP-13 CLI part)

RunStreams: run.log always (flushed, tail -f-able) with full technical detail; thinking stream to screen under --verbose (flushed, [T] lines, > depth prefixes). Machine hooks on INIT/MISSING/ROUTE/EXPERT/ANSWER + budget ticks; child runs share the parent's stream; engine emits its raw output. Verified live: 8-call train run inline, fresh-question run 69.6s (proxy caches identical temp-0 prompts; noted).
This commit is contained in:
2026-10-13 17:50:57 +02:00
parent 550128c9bb
commit 6733cb660e
7 changed files with 163 additions and 19 deletions
+11 -1
View File
@@ -10,11 +10,21 @@ is the real v0.1 shape; only the formal layer is missing.
```bash
cd floop/code
.venv/bin/python run_app.py "What information do I need to plan a trip to Tokyo?" # any question
.venv/bin/python run_app.py --verbose "..." # + "thinking" on screen, flushed
FLOOP_LM=ollama-cloud .venv/bin/python run_app.py "..." # cloud LM instead of local
```
- **Always**: `runs/<ts>-<slug>/run.log` (gitignored), written with explicit flush —
`tail -f runs/<latest>/run.log` from another terminal shows progress live.
- **`--verbose`**: the **thinking stream** also prints to the screen, flushed. Thinking is
floop's future user-facing "thinking" output (what floop-as-LLM will stream); it is a
SUBSET of the log — the log keeps all technical detail (budget, provenance, raw payloads),
thinking stays readable. They will diverge over time (Emili, 2026-10-13).
- Screen thinking lines carry the `[T]` marker; recursion depth shows as `>` prefixes.
- The same events will drive the OpenAI-compatible endpoint's streaming mode (SCOPE.md §4).
`config.yaml` holds the budget knobs and the two LM providers (no keys in code:
`ollama-cloud` reads `OLLAMA_API_KEY` from the environment).
`ollama-cloud` reads `OLLAMA_API_KEY` from the environment). Logs live in `runs/`.
## What is real vs stub (the honest map)