jetstream v2 in zig stream.waow.tech

main: lift serve configuration into internal/runtime/cli master

The 65-branch flag chain, its 44 option locals and the environment merge now live in cli.parseServe, returning a typed ServeConfig. main.zig 1263 -> 1018 lines; `pub fn main` 856 -> 611, and what is left is construction and lifecycle rather than argument dispatch. Two bugs the extraction introduced, both caught by the contract suites rather than by unit tests: - A blanket identifier rewrite renamed variables *inside string literals*, so "--cursor-lookback=" became "--cfg.cursor-lookback=" and five flags silently stopped parsing. The environment contract caught it; nothing in the unit tests would have. - Moving the parse out of main made env_serve_args die at function exit while the config still borrowed into it -- every JETSTREAM_*-supplied value dangled, surfacing as BadPathName. Ownership now lives in Parsed, which the caller frees. This is the same borrowed-data-outliving-its-owner shape that has bitten this codebase before. environment, listener, logging and status contracts all pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>


+455 -354
3 changed files