fix(core): stamp admin-action audit filename in UTC, not local time#1128
Merged
Conversation
d2906e6 to
b4dc631
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
append_admin_action named admin-actions-<date>.jsonl from chrono::Local::now(), but every other date-stamped file (events-/incidents-/decisions-*.jsonl) and the reader (today_date_string) use UTC. In a non-UTC timezone across midnight (e.g. UK/BST after 00:00 local, still the previous UTC day) the audit entry landed on a different date than the rest of the system, splitting the day's audit trail and breaking the reader + the admin-audit tests on that boundary. Use UTC. Also align the ctl test helpers that locate the admin-actions file (capability/response/gdpr) from chrono::Local to chrono::Utc to match the writer; they passed only by luck when local==UTC by day and were the same boundary bug on the test side. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
b4dc631 to
21c0935
Compare
esteves-uk
approved these changes
Jun 27, 2026
maiconburn
added a commit
that referenced
this pull request
Jun 28, 2026
…#1132) Bump workspace version 0.15.29 -> 0.15.30 and roll [Unreleased] into [0.15.30]. Contents: - agent-guard now denies commands that disable InnerWarden itself (#1127) - innerwarden agent install-hook: enforcing PreToolUse hook for Claude Code (#1129) - admin-action audit filename in UTC, not local time (#1128) Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
append_admin_action(crates/core/src/audit.rs) namedadmin-actions-<date>.jsonlfromchrono::Local::now(). Every other date-stamped file InnerWarden writes —events-/incidents-/decisions-*.jsonl— and the readertoday_date_string()use UTC.In any non-UTC timezone that straddles midnight (e.g. UK/BST after 00:00 local, which is still the previous UTC day), the admin-audit entry landed on a different date than the rest of the system. Effects:
ctl::commands::ops::tests::cmd_tune_applies_raise_suggestion_and_writes_auditfails on that boundary (it asserts the UTC-named file exists) — currently red in CI for everyone on 2026-06-28.Fix
Use
chrono::Utc::now(), consistent with the rest of the date-stamped files. One line.Verify
cmd_tune_applies_raise_suggestion_and_writes_auditnow passes;innerwarden_coretests + clippy clean;cargo fmt --all --checkclean.🤖 Generated with Claude Code