GitHub and Jira write their timestamps to the second - #691
Conversation
deeplethe#610 提案的第一刀。一个来源可以在 config 里写 "precision": "instant", 连接器就把 created_at / updated_at 写成完整 RFC 3339(与 deeplethe#351 后 change_line 用的同一形式),下游 facts.valid_from_precision 跟着变成 "second"。缺省仍是 day,旧来源的形状不变。 四件事: - Source::precision() 读 config.precision,缺省 day,typo 不翻转 - time_text::world 接受 Some("instant"),输出与无精度路径一致但语义 不同——给抽取器的精度字段是 second,不是 day - github_issues::render_with 接 precision 参数,render() 保持 day 精度 作为旧别名 - ingest_sources::sync_github_issues 把 source.precision() 传给 render_with 测试:721 个全过,3 个新加(time_text 的 instant 路径与跨午夜回归, models 的 precision 默认与 typo 政策,github_issues 的 instant 精度 端到端——含注释/历史/抬头三个时间点)。 设计稿:.roadmap-proposals/instant-precision.md 留待维护者回复的 5 个问题:默认、迁移、typo 政策、doc_time 单独、 JQL 游标。 Signed-off-by: rollroyces <rollroyces@users.noreply.github.com>
816cff1 to
7622d6f
Compare
WaylandYang
left a comment
There was a problem hiding this comment.
@rollroyces thanks for picking up the roadmap item and for mapping every site so carefully. Before this can merge there is a decision to settle and a few things to fix.
The day cut is a recorded decision. 0013 decision 6 cuts connector timestamps to the day on purpose: precision = day says the day is known, both connectors are resyncable so nothing is lost, and world time renders in UTC by design, so a UTC+8 reader seeing 2026-09-05 is expected. It adds instant only when someone needs local business days or a source whose events cluster around midnight, and 0016 repeats that trigger. The PR doesn't name such a case yet. If you have one, please describe it in an issue; that is what moves this forward.
When it lands, it doesn't need a knob. The CHECK constraint and the extraction side already take seconds (migration 0033, parse_time), so the remaining piece is rendering: a source that has the instant can write the instant. A per-source precision key that defaults to day keeps the old shape for everyone who doesn't know the key exists, and it brings rules of its own (typos fall back to day, hour/minute/second collapse to instant). Please write the instant directly in both github_issues and jira_issues (the JQL cursor can stay as it is), and update 0013's status line and decision 6 plus the README roadmap line in the same PR.
To fix in the current diff
time_text::world:Some("instant") | NoneandSome(_)both returninstant(t). The comment saysparse_timetells them apart, but the strings are identical, so the new arm can go.- The PR body and checklist say
render()is kept as a back-compat alias; the code removes it. The removal note is left as a///paragraph on top of the next function's doc comment (github_issues.rs:201). - The comments cite #610 as the proposal. #610 is about an upload's written date, a separate question.
.roadmap-proposals/instant-precision.mdshouldn't go into the repo. Design notes live indocs/decisions/, and here the place is 0013 itself.
Worth a line in the description: GitHub sync is incremental (since), so after deploy only issues updated later are re-rendered and re-extracted. A base carries day-precision and second-precision documents side by side until a full resync, which re-extracts every issue.
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
|
@rollroyces thanks for tracing every timestamp site. Your end-to-end claim holds: we checked it with a scripted extraction endpoint, and a rendered
🤖 Generated with Claude Code |
GitHub and Jira issue connectors write their timestamps to the second (
2026-08-18T16:18:27Z) instead of cutting them to the UTC day, so a fact extracted from "Opened by X on …" or a history line starts at the moment the event happened.Why
0013 §6 deliberately cut connector timestamps to the day until three pieces existed: the precision ladder with its truncation CHECK, the prompt rule for zoned clock times, and a rendering branch. 0024 delivered all three, and its §3 names a ticket's
updated_atas a time that reaches the second, but the connectors kept writing%Y-%m-%d. That cut has two real costs:What changed
github_issues::renderandjira_issues::renderwrite every timestamp (opened/reported, closed/resolved, history lines, comment headers) throughtime_text::world(t, Some("second")). Jira's milliseconds are not written; the extractor reads the second back.Decisions on the questions this PR first raised
The first version of this PR added
config.precision(defaultday) and a design doc with five open questions. After review:daydefault. Precision is a property of the data. A default ofdaywould keep the cut this PR set out to remove, and nothing in the UI exposes the key.Document date:in the prompt stays a day. It anchors relative phrases like "last March", and the full instant is already stored indocuments.doc_time. Changing it would affect every document and would need a recall-bench round.%Y-%m-%d %H:%Mfrom our ownlast_sync_atclock, independent of how the body is rendered.The design doc under
.roadmap-proposals/is removed; this repository keeps such reasoning indocs/decisions, and 0024 already decided the substance.Verification
a_time_in_the_document_reads_back_to_the_second(GitHub): an event at2026-09-05T23:59:59Zis rendered with that string, andutopia_extract::parse_timereads it back atsecondprecision.a_time_in_the_document_is_written_to_the_second(Jira):+0000and+0800timestamps with milliseconds render as…Zto the second.labeledat2026-09-05T23:59:59Z / secondfrom a document rendered this way, versus2026-09-05T00:00:00Z / daybefore. That run used the first version of the renderer, which writes the same strings.utopia-server280 passed,utopia-core23 passed on a migrated database;clippy --workspace --all-targets -D warningsand fmt are clean.🤖 Generated with Claude Code