feat(cli): write provider records to a file with --output
Commit
The compact snapshot exists to be saved and queried back:
Saving it had to go through a shell redirect, and the shell decides the
encoding. In Windows PowerShell 5.1 -- still the Windows PowerShell on a
stock Windows 11 -- > is Out-File, whose default is UTF-16LE, so that first
line produces a file the loader cannot read. Nothing on the reading side can
fix it: a UTF-16 artifact is UTF-16 all the way down. --output lets the command
write the file itself, with no shell in between.
The destination replaces stdout for the record stream only; progress, warnings and the SCIP omission note stay on stderr. It is opened after every flag combination has been judged, so a refused invocation cannot truncate an existing snapshot, and its close error fails the command rather than losing a final write in silence.
The records reach four different writers -- the streaming encoder, that encoder teed into a cache entry, the buffered write of a cache hit, and the buffered write of a targeted edge query served from the cache -- and each is covered, because a destination flag wired through some of them is a flag that silently keeps printing. Each was proven by sending it back to stdout and watching exactly one case fail.