Skip to content

fix(witan-core): write timestamps at millisecond precision - #462

Merged
blarghmatey merged 1 commit into
mainfrom
omnigraph-013-datetime-millis
Oct 8, 2026
Merged

blarghmatey merged 1 commit into
mainfrom
omnigraph-013-datetime-millis

Conversation

@blarghmatey

Copy link
Copy Markdown
Member

What are the relevant tickets?

N/A (witan task tk-write-datetime-values-at-millisecond-precision-0-9018b6, part of the omnigraph 0.13 upgrade, spec in #461 D7)

Description (What does it do?)

now_iso() returned datetime.now(UTC).isoformat(), which carries six fractional digits. omnigraph 0.12 and later refuse a DateTime with non-zero digits past the third, so every witan write that stamps a time would fail after the pin bump.

This makes now_iso() emit timespec="milliseconds". It is the only place witan generates a timestamp that reaches the graph (council's server.py, witan-code's indexer.py and bridge.py all go through it).

The paths that read a stored timestamp and send it back (created_at on re-keyed rows, closed_at/claimed_at/first_claimed_at merged in _update_task, store_merge loads of exported rows) are unchanged. 0.11 truncates to milliseconds on write, and both 0.11 and 0.13 return millisecond values on read, so nothing stored carries more than three digits.

Safe on 0.11, so it can merge ahead of the pin. The pin bump should also raise both servers' witan-core>= floors to the release carrying this: an older witan-core still imports fine, so check-core-floor will not catch it.

How can this be tested?

  • Against omnigraph 0.11.0: just test-witan-core 713 passed, just test-witan-council 1429 passed, just test-witan-code 682 passed.
  • Checked on scratch stores with both binaries. 0.11.0 accepts 2026-10-08T17:00:00.123456+00:00 and reads it back as 2026-10-08T17:00:00.123. 0.13.0 refuses that value (invalid DateTime literal ... fractional-second digits past the third must be zero), accepts .123+00:00, and reads it back as .123.

https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A

now_iso() emitted six fractional digits. omnigraph 0.12 and later refuse a
DateTime with non-zero digits past the third ("a DateTime has millisecond
precision; fractional-second digits past the third must be zero"), so every
write that stamps a time would fail after the 0.13 pin bump.

0.11 already truncates to milliseconds on write and both versions return
millisecond values on read, so stored data and the paths that re-send a
stored timestamp are unaffected.

Claude-Session: https://claude.ai/code/session_01Mfmuz4DTn557AV8V17o98A
Copilot AI balanced review requested due to automatic review settings October 8, 2026 18:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The focused change preserves UTC formatting, includes regression coverage, and has no identified blocking issues.

0 open findings

What changed in this PR

Updates witan-core’s shared timestamp helper for omnigraph 0.12+ compatibility while preserving UTC formatting.

Changes:

  • Emits timestamps with exactly three fractional digits.
  • Adds regression coverage for millisecond precision.
  • Records the compatibility fix in a changelog fragment.
File Description
packages/​witan-core/​witan_core/​timeutil.py Uses millisecond precision and documents why.
packages/​witan-core/​tests/​test_timeutil.py Checks for three fractional digits.
packages/​witan-core/​changelog.d/​20261008_131307_blarghmatey_omnigraph_013_datetime_millis.md Documents the timestamp compatibility fix.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@blarghmatey
blarghmatey merged commit 983144d into main Oct 8, 2026
21 checks passed
@blarghmatey
blarghmatey deleted the omnigraph-013-datetime-millis branch October 8, 2026 19:13
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.

2 participants