diff --git a/assets/config.default.yaml b/assets/config.default.yaml index 8659b28..292862f 100644 --- a/assets/config.default.yaml +++ b/assets/config.default.yaml @@ -13,3 +13,4 @@ wake: llm: base_url: "" # OpenAI-compatible endpoint (V12) model: "" + stream: true # set false for endpoints that break on SSE diff --git a/docs/llm-progress/decisions.md b/docs/llm-progress/decisions.md new file mode 100644 index 0000000..4090b68 --- /dev/null +++ b/docs/llm-progress/decisions.md @@ -0,0 +1,216 @@ +# `llm-progress` — decisions this Matter made + +This file records the calls that adding a progress line to `retro`, `wake`, and +`brief` forced. The wip Matter `llm-progress` set the intent. It left the +details below to the Builder, or it required that this file record them. + +Status: Steps 01-05 are done. Step 06 records this file and the smoke check. The three verbs show a one-line +status on stderr while they wait on the LLM. The line shows only on a terminal. +The e2e suite needed no output changes. Two defaults are not confirmed by Beau +yet. The first section lists them. + +## Two defaults wait for Beau + +Beau confirmed two calls on 2026-10-02 (the standard-library TTY check, and +wake interactive phases only). The workplan set the rest at planning time, and +the executor and verifier made the implementation calls. Beau has not confirmed +these two: + +- `brief` shows phases only. It does not stream the brief text to stdout. +- No progress shows when stderr is not a terminal, even with `--verbose`. + +The code follows both defaults. The `--verbose` rule is a small edit to change. +Streaming the brief text to stdout is not. It is a real feature, which touches +stdout against stderr, `--json`, and the order of `Clear` against the output. +The workplan put it out of scope. + +## The reporter lives in `internal/progress`, behind a context + +`progress.New(streams, flags)` returns a `*Reporter`. `WithReporter` and +`FromContext` carry it in the `context.Context`. `Summarize`, `RunAuto`, +`RunInteractive`, and `Synthesize` keep their signatures, so no caller and no +test needed an edit. + +Every method of `*Reporter` is safe on a nil receiver. `New` returns nil when +progress is off. It also returns nil for nil streams or a nil `streams.Err`. A +verb never checks for nil. This is also why no unit test or +e2e test sees the reporter (see the test gap below). + +`llm-progress` waited only for `llm-streaming/step-01`. That Step added the +observer seam. The phase events come from there. `Reporter.Observer()` returns +an `llm.Observer` that only updates state under a mutex, as the `llm-streaming` +brief requires. + +## The terminal check uses the standard library + +`New` returns a reporter only when `streams.Err` is an `*os.File` whose `Stat()` +mode has `os.ModeCharDevice`. `TERM=dumb` also turns progress off. Beau chose +the standard-library check on 2026-10-02. The repo takes no `golang.org/x/term` +dependency for this. + +Observation, not a Beau decision: a character device is not always a terminal. +`/dev/null` is one, so `2>/dev/null` turns the reporter on. It then writes +harmlessly to `/dev/null`. A fix for the width limit below would need `x/term` +or a `TIOCGWINSZ` call, so this call can come back. + +## No progress with `--json`, or without a terminal, even with `--verbose` + +`New` returns nil when `--json` is set. It also returns nil when stderr is not a +terminal. `--verbose` does not override either rule. The e2e tests run the +binary with stderr in a `bytes.Buffer`, so the reporter is off there. Their +expected output did not change. + +The no-terminal rule with `--verbose` is one of the two unconfirmed defaults. +A user who pipes stderr to a file and passes `--verbose` gets no status lines. + +## One line, redrawn in place + +The line is `