CLI Output Determinism Policy (v1) — 2025-12-01
Scope: StellaOps.Cli JSON/table/markdown outputs for advisory verbs and auth doctor.
Rules
- Time: All timestamps UTC; no local timezone conversion.
- Locale:
en-US,InvariantCulturefor number/date formatting. - Ordering: Sort collections by stable key (id/name) before rendering; JSON keys stable-sorted.
- Width: Table renderer clamps to width 80; no ANSI when
--output jsonor non-TTY. - Seeds: Randomness forbidden; no wall-clock in hashes; use provided deterministic IDs.
Tests
- Golden fixtures stored under
src/Cli/__Tests/StellaOps.Cli.Tests/Fixtures/output-determinism/. - Hash check: two consecutive runs of the same command with identical inputs must produce identical SHA256 of stdout.
- Locale guard: integration test forces
CultureInfo("fr-FR")and asserts output matches fixtures.
Failure handling
- Any drift fails CI; diff is printed with unified format.
- Add new fields behind explicit versioned spec entry in
cli-spec-v1.yaml.
