You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(audit): the audit-log export's start_time drops events inside its first second #3555
Build: v1.0.0-rc2 (96f88f9) · found in release testing (abilityai/trinity-enterprise#847)
Steps
Take an audit event whose stored timestamp has sub-seconds, e.g. …T14:45:52.741692Z.
GET /api/audit-log/export?start_time=…T14:45:52Z&end_time=…
Expected: the event is included — start_time is documented as an inclusive lower bound. Actual: the event is missing; the same call with start_time=…T14:40:00Z returns it.
Cause:src/backend/db/audit.py compares the stored text timestamp with the caller's bound as strings (timestamp >= start_time), and "…52.741692Z" < "…52Z" because . sorts before Z. The upper bound over-includes by the same second. Same family as Architectural Invariant #16 (ISO-string comparisons).
Impact: low — off by under a second at each edge, but it is the compliance export; chained exports put boundary events in the earlier window.
Fix direction: normalise both bounds to the stored format (microseconds + Z) before comparing, or compare as timestamps.
Acceptance criteria
An event inside the start_time second is included.
An event after end_time inside the same second is excluded (or the second-granular semantics are documented).
A test covers sub-second stored timestamps against second-precision bounds.
Activity
fix: widen audit upper bounds to the unit they state and survive edge…