Skip to content

bug(audit): the audit-log export's start_time drops events inside its first second #3555

Open

Description

@webmixgamer

Build: v1.0.0-rc2 (96f88f9) · found in release testing (abilityai/trinity-enterprise#847)

Steps

  1. Take an audit event whose stored timestamp has sub-seconds, e.g. …T14:45:52.741692Z.
  2. 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

  1. added
    priority-p3
    type-bug
    theme-security
    complexity-low
    status-ready
    on Oct 11, 2026
  2. added
    status-in-progress
    and removed
    status-ready
    on Oct 12, 2026
  3. added
    status-ready
    and removed
    status-in-progress
    on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity-lowpriority-p3status-readytheme-securitytype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions