agent-doc-log-time 0.34.69

Log timestamp and low-level ops-log formatting helpers for agent-doc
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented0 out of 9 items with examples
  • Size
  • Source code size: 11.6 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 313.35 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • btakita/agent-doc
    5 1 24
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • btakita

Module: log_time

Human-readable log timestamps (#opslogts) and low-level ops-log line formatting. Operators read the supervisor session log and .agent-doc/logs/ops.log to verify reported issues, and a bare Unix epoch like 1781771180 is not legible. This module formats every log entry's timestamp as ISO-8601 UTC and parses it back, with no external date dependency (Howard Hinnant's civil-date algorithms).

Spec

  • [format_log_timestamp] renders a Unix epoch (seconds) as YYYY-MM-DDTHH:MM:SSZ (UTC).
  • [parse_log_timestamp] is the matching reader: it accepts either a bare Unix epoch (pre-#opslogts log lines and cycles.jsonl timestamps) or an ISO-8601 UTC string and returns epoch seconds. This backward compatibility keeps the staleness / accretion / startup-miss / gate_verify scanners working across the format switch — old [<epoch>] lines still parse, and parse(format(x)) == x round-trips.
  • [current_log_timestamp] samples the system clock and returns the current timestamp in the same ISO-8601 UTC format.
  • [format_ops_log_tracking_suffix] renders the appended doc=<stem>[ session=<id>][ turn=<cycle_id>] suffix without knowing how callers found those values.
  • [format_ops_log_line] renders the final bracketed ops-log line.

Agentic Contracts

  • Formatting/parsing helpers are pure and deterministic for unit testing; no I/O and no orchestration dependencies.
  • Clock helpers fail closed to Unix epoch 0 when the system clock is before UNIX_EPOCH.
  • parse_log_timestamp fails closed (None) on garbage rather than mapping it to 0, so a malformed line is skipped, not mis-windowed.