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
+8 -5
View File
@@ -203,11 +203,14 @@ Emili (2026-10-13): running from CLI shows only the final summary; LLM calls can
he wants (a) a line before each LLM call naming it, (b) the raw LLM output as it lands,
(c) the same for engines, (d) log-to-file always (flushed, `tail -f`-able) + screen output
only under a flag.
**Resolution (design in SCOPE.md §4):** one event format, two sinks: events `call|output|
state|final` always land in `runs/<ts>-<slug>/run.log` with explicit flush; a `--verbose`
flag tees the same stream to screen (flushed). Later, the same events drive the
OpenAI-compatible endpoint's streaming mode.
**Patch:** SCOPE.md §4; code/README.md next-steps; runner design only — no code yet.
**Resolution (DESIGN in SCOPE.md §4) — CLARIFIED by Emili the same day:** screen ≠ log. The
screen is the future **"thinking" output of floop-as-LLM** (a readable subset); the log is
the full technical record and stays a superset — they will diverge. **IMPLEMENTED (CLI part,
2026-10-13):** `floop/stream.py` (`RunStreams`: log always flushed; `think()` → screen iff
verbose), machine hooks on every LLM stage + engine + budget tick, child runs share the
parent's stream; `run_app.py --verbose`. Verified live: 8-call run shows reasoning inline.
**Remaining:** real token-level streaming (dspy/litellm path) and the endpoint SSE mode.
**Patch:** SCOPE.md §4; code/floop/stream.py; code/README.md next-steps.
### GAP-14 — no meta level: floop does not learn from its own behaviour
Emili (2026-10-13): after executing, floop should analyse its own answer — **offline, as a