mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-09-04 04:01:07 +00:00
ConsoleProgressDisplay wrote every progress frame to sys.stdout. Progress is diagnostic output, so stderr is the correct stream for it — tqdm and most progress renderers default there for the same reason — and stdout must stay clean for programs that carry a machine-readable protocol on it. The stdio MCP servers put newline-delimited JSON-RPC on stdout, where an interleaved progress bar makes a response body unparseable (#1134). ConsoleProgressDisplay now takes an optional stream, defaulting to stderr. The stream is resolved per write rather than captured at construction, so a later rebinding of sys.stderr (pytest capture, for instance) is honoured. All writes and the four bare flushes route through it, and the emoji-capability probe now inspects that stream rather than stdout, so a cp1252 stderr still degrades correctly. The existing cp1252 tests in tests/deduplication/test_deduplication.py patched sys.stdout to assert emoji auto-disabling; they now patch the stream progress is actually written to. Their intent is unchanged. Closes #1134 (point 1 only; the SEMANTICA_KG_PATH persistence and README items remain with @akaszubski)