Files
Willie e32f2164c9 fix: suppress update notice in all structured-output modes
UpdateNotification() wrote to stdout via fmt.Printf, corrupting JSON
output when --json was passed to commands like search.  Machine
consumers got invalid JSON with trailing human-readable text.

Three-layer fix:
1. Move UpdateNotification output to os.Stderr (safety net for any
   caller that bypasses the main.go guard).
2. Add isStructuredOutput() that detects all machine-readable modes:
   --json, -j, and --format json/sarif/markdown.
3. Skip the update check and trailing newline entirely in main()
   when structured output is requested, honouring the contract that
   stdout = pure structured data and stderr = empty.

Tests:
- Unit: isStructuredOutput table test (9 cases)
- Unit: UpdateNotification writes only to stderr
- Integration: versioned binary (1.0.0) with seeded cache (9.9.9)
  exercises the real update path for search --json, list -j, and
  audit --format json — asserts valid JSON stdout + empty stderr.

Closes #129
2026-04-13 16:00:18 +08:00
..