Skip to content

Conversation

@ultmaster
Copy link
Contributor

Summary

  • use a human-readable timestamp format for Python trace directories
  • verify trace directory names are 20-digit timestamps

Testing

  • npm run build-webview
  • npm run build-cli
  • npm run lint
  • npm test
  • python -m pip install -e .[dev]
  • python -m pytest python/tests

https://chatgpt.com/codex/tasks/task_e_686ceafcb96c832e9aa17ac3f6e15046

Copilot AI review requested due to automatic review settings July 8, 2025 10:21
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR switches Python trace directory names from nanosecond timestamps to a human-readable 20-digit format and adds a test to validate the new naming scheme.

  • Updated set_trace to use datetime.now().strftime("%Y%m%d%H%M%S%f") instead of time.time_ns().
  • Enhanced docstring to reflect the new YYYYMMDDHHMMSSffffff format.
  • Added test_trace_directory_name_format in the test suite.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
python/poml/api.py Import datetime, update timestamp generation and docstring, replacing time.time_ns()
python/tests/test_basic.py Import re and add a test to verify the 20-digit directory name format

@ultmaster ultmaster enabled auto-merge (squash) July 8, 2025 10:28
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Trace Directory Naming Conflict

The set_trace function's trace directory naming now uses microsecond precision instead of nanosecond precision. This change, combined with exist_ok=True during directory creation, allows multiple calls within the same microsecond to generate identical directory names. As a result, different trace sessions can unintentionally share the same directory, leading to mixed or overwritten trace data.

python/poml/api.py#L33-L36

poml/python/poml/api.py

Lines 33 to 36 in 1661d96

base.mkdir(parents=True, exist_ok=True)
ts = datetime.now().strftime("%Y%m%d%H%M%S%f")
run_dir = base / ts
run_dir.mkdir(parents=True, exist_ok=True)

Fix in CursorFix in Web


BugBot free trial expires on July 22, 2025
You have used $0.00 of your $50.00 spend limit so far. Manage your spend limit in the Cursor dashboard.

Was this report helpful? Give feedback by reacting with 👍 or 👎

@ultmaster ultmaster merged commit 0263db9 into main Jul 8, 2025
4 checks passed
@ultmaster ultmaster deleted the codex/use-timestamp-format-for-poml-traces branch August 27, 2025 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants