Print every time in UTC, whatever the time zone #187

Merged
clawbot merged 1 commits from fix/169-utc-times into next 2026-10-15 06:48:52 +02:00
Collaborator

Fixes #169.

secret list, secret version list, secret unlocker list and secret info printed times in the machine's time zone without naming it. Entry() now sets time.Local to UTC before anything else, as AGENTS.md policy 6 asks, so every printed time is UTC and --json times end in Z. The README says so at the top of the Commands Reference.

What the diff does not show: the same line changes what the program writes. Times stored in version and unlocker metadata are UTC, and a new version's name takes the UTC date, so a secret added at 21:00 in New York in winter gets the next day's date. The README says that too.

The test sets the secret's current file to 03:04:05 UTC on 2 January and runs the built secret list, plain and with --json, under TZ=America/New_York, where that time is 22:04:05 the day before.

Rule suppressed: gosmopolitan, which flags any use of time.Local, on the one line that sets it.
Unverified: on a machine where Go finds no New York zone data, neither the system's nor its own copy, Go uses UTC for TZ=America/New_York and the test cannot fail.
An existing test calls Entry() in-process, so the test process runs in UTC after it.

Model: opus-5-5

Fixes https://git.eeqj.de/sneak/secret/issues/169. `secret list`, `secret version list`, `secret unlocker list` and `secret info` printed times in the machine's time zone without naming it. `Entry()` now sets `time.Local` to UTC before anything else, as `AGENTS.md` policy 6 asks, so every printed time is UTC and `--json` times end in `Z`. The README says so at the top of the Commands Reference. What the diff does not show: the same line changes what the program writes. Times stored in version and unlocker metadata are UTC, and a new version's name takes the UTC date, so a secret added at 21:00 in New York in winter gets the next day's date. The README says that too. The test sets the secret's `current` file to 03:04:05 UTC on 2 January and runs the built `secret list`, plain and with `--json`, under `TZ=America/New_York`, where that time is 22:04:05 the day before. Rule suppressed: gosmopolitan, which flags any use of `time.Local`, on the one line that sets it. Unverified: on a machine where Go finds no New York zone data, neither the system's nor its own copy, Go uses UTC for `TZ=America/New_York` and the test cannot fail. An existing test calls `Entry()` in-process, so the test process runs in UTC after it. Model: opus-5-5
clawbot added the needs-review label 2026-10-15 06:26:30 +02:00
clawbot self-assigned this 2026-10-15 06:26:30 +02:00
clawbot added 1 commit 2026-10-15 06:26:30 +02:00
secret list, secret version list, secret unlocker list and secret info
printed times in the machine's time zone without naming it, so one vault
showed different times on two machines. Entry() now sets time.Local to
UTC before anything else, as AGENTS.md policy 6 asks, so every time the
program prints or writes is in UTC: --json times end in Z, and a new
version's name takes the UTC date. The README says so.

A test runs the built secret list with TZ=America/New_York and checks the
table and the JSON against the UTC time set on the secret's current file.

Rule suppressed: gosmopolitan, which flags any use of time.Local.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 42f4961937 into next 2026-10-15 06:48:52 +02:00
clawbot deleted branch fix/169-utc-times 2026-10-15 06:48:53 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/secret#187