Skip to content

fix(markdown): read episode timestamps as milliseconds in _iso - #623

Merged
gloryfromca merged 1 commit into
EverMind-AI:mainfrom
nurlanmnn:fix-markdown-iso-ms
Nov 23, 2026
Merged

gloryfromca merged 1 commit into
EverMind-AI:mainfrom
nurlanmnn:fix-markdown-iso-ms

Conversation

@nurlanmnn

Copy link
Copy Markdown
Contributor

Summary

_iso() in the markdown store always gets epoch milliseconds, but it used from_timestamp(), which treats values below 1e12 as seconds. So episodes from before 2001-09-09 failed to render (2000-01-01 raised year 31969 is out of range). It now uses from_timestamp_ms(), which was made for this case.

I only changed _iso. The ingest path also uses from_timestamp(), but the API schema says the seconds/ms guess there is on purpose for backward compat, so I left it alone.

Fixes #622

Area

  • Architecture method
  • Benchmark
  • Use case
  • Documentation
  • Developer experience
  • CI, build, or release

Verification

$ uv run pytest tests/unit/test_infra/test_markdown/test_stores.py
33 passed
# the new test_iso_renders_pre_2001_milliseconds fails on main with
# ValueError: year 31969 is out of range

$ uv run pytest tests/unit/test_infra/test_markdown tests/unit/test_core
516 passed

$ uv run ruff check src tests/unit/test_infra/test_markdown/test_stores.py
All checks passed!
$ uv run ruff format --check src tests/unit/test_infra/test_markdown/test_stores.py
423 files already formatted

Checklist

  • I kept the change scoped to the relevant area.
  • I am opening this from a separate branch, not pushing directly to main.
  • I updated docs, examples, or setup notes when behavior changed.
  • I added or updated tests when the change affects behavior.
  • I did not commit secrets, .env files, dependency folders, or generated output.
  • Active relative links in Markdown files resolve.

Notes for Reviewers

Small one-line fix plus a regression test. No docs needed since nothing user-facing changes for normal dates.

I used Claude Code and Codex to help find and fix this. I checked the change and ran the tests myself.

🤖 Generated with Claude Code

By submitting this pull request, I agree that my contribution is licensed under
the Apache License 2.0.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

Reviewed the repository rules, the PR diff, all _iso callers and their millisecond-domain model fields, the datetime helper contract/properties, and the introducing history. I also checked backward compatibility, architecture boundaries, and that the regression test adds coverage without weakening existing assertions. The strict millisecond conversion fixes pre-2001 timestamps while preserving current timestamps and display-timezone rendering.

Validation: all lint gates passed; tests/unit/test_infra/test_markdown/test_stores.py passed (33 tests), and tests/unit/test_properties/test_datetime_laws.py passed (7 tests). The full unit command could not collect because the unchanged base commit's test_nvidia_endpoint.py imports resolve_llm_config, which that base does not export; this is outside this PR's one-commit diff. The documented make wrapper was unavailable, so I ran its underlying uv commands directly.

@gloryfromca

Copy link
Copy Markdown
Member

Closing and reopening only to re-run CI: the earlier runs predate the workflow-pinning change on main and cannot be re-run. Nothing for you to change.

@gloryfromca gloryfromca reopened this Nov 23, 2026
_iso() always gets epoch milliseconds but used from_timestamp(), which treats values below 1e12 as seconds. Episodes from before 2001-09-09 then failed to render (e.g. 2000-01-01 raised 'year 31969 is out of range'). Use from_timestamp_ms(), which exists for this case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gloryfromca

Copy link
Copy Markdown
Member

Rebased your commit onto current main (no other change) so CI runs with the pinned workflows; approved the runs.

@gloryfromca gloryfromca left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No blockers; this can merge as far as I am concerned.

The rebase is patch-identical to the reviewed revision. I rechecked the current repository rules, diff, callers and history, backward compatibility, test coverage (including that no assertions were weakened), and architecture boundaries; current main made no relevant changes. Validation on this head: the markdown-store suite passed (33 tests), the datetime-property suite passed (7 tests), and Ruff check/format verification passed for both changed files.

@gloryfromca
gloryfromca merged commit f9cb732 into EverMind-AI:main Nov 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: markdown store misreads pre-2001 episode timestamps as seconds

2 participants