Skip to content

A time mention is resolved against its document - #740

Merged
WaylandYang merged 3 commits into
devfrom
feat/a-time-mention-is-resolved-against-its-document
Sep 17, 2026
Merged

WaylandYang merged 3 commits into
devfrom
feat/a-time-mention-is-resolved-against-its-document

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Stacked on #736. Cuts 1 and 2 of 0045 (#724): a time mention is resolved against its document, by code, from an interpretation the model gives; upload time and file modification time are no longer document dates (#714).

What lands

Contract (utopia_extract::time, two calls, the model never computes a date):

  • Dating a document: from its opening the model transcribes the document's own date as digit parts (with the words, checked against the opening), the periods it names with their bounds ("fiscal 2027"), and its fiscal year end.
  • Interpreting mentions: for every time word of a document, with its sentence and the document's context, the model gives a shape (point, since, until, interval, as_of, duration, ended_unknown), a reference (the digit parts the words state; an anchor — the document, another mention, a named period — with an offset in count, unit and direction; a named period; or none) and a granularity.

Resolution (utopia-server::time_resolution, job resolve_time, enqueued after every open extraction and after a nod): dates the document once and stores the context on documents.time_context (the date goes to doc_time with source content when the document had none); interprets the document's distinct mentions in batches; computes intervals in code (calendar arithmetic with month-end clamping, quarters on the calendar or the fiscal year, truncation to the stated granularity, and the interval a shape implies); grades each mention A (written), B (computed from an anchor the document states) or C (unresolved, nothing written); writes valid_from / valid_to on the open statement from its when and ended mentions. Idempotent, so re-running re-resolves when an anchor turns up.

Ledger (migration 0064): time_mentions carries the role of the words (when | ended), the interpretation, the grade and the resolved interval with its precisions; documents.time_context; doc_time is NULL with source none for every document whose only date was the upload or the file modification time, and the writers no longer fill it; graph::set_open_validity writes the world-axis position of an open row.

Measured on the 25-document batch (NVDA filings, FDA releases, statistics bulletins)

Documents dated from their own text: the ten FDA release paragraphs to their release day, the three 8-Ks to their filing day, the earnings release to its dateline, the seven statistics-bulletin paragraphs to the reporting year 2024 (year precision); the trade-in notice paragraphs and the harbor test text carry no date and get none. Upload time is used nowhere.

51 time mentions on 985 open statements, after the second run of the interpretation call:

grade mentions examples
A, written 10 "May 12, 2026" → day; "1987", "1934" → year; "beginning in 2028" → since 2028
B, computed from an anchor the document states 23 "全年" → the reporting year as one bucket; "年末" → as of its end; "at the time" → the date the same sentence names; "this quarter" on a fiscal calendar → the three-month bucket
C, unresolved, nothing written 17 trial-relative words ("week 4", "at month 12", "at the end of the trial"); fiscal quarters of a document whose opening does not state its fiscal year end ("for the second quarter", "During the second quarter of fiscal 2027"); "last winter" in an undated text; "in the first half of 2027" (a half year is not a period the words bound)

33 statements now carry a world-axis position (there were 0); every written precision matches its value (the CHECK constraints hold). Between two runs of the same interpretation call at temperature 0 the model changed its reading of 6 of 51 mentions (a relative period given as a bare period name instead of an anchor); the prompt now says a relative period anchors to the document, and a count inside a named trial does not count from the document.

Not in this change

Extending the document's time context from later chunks (a fiscal year end stated deep in a filing; today only the opening seeds it, so fiscal quarters stay C when the opening is silent). Grades replacing the confidence gate in the temporal engine (0045 cut 3); re-resolution triggered by a person setting a document's date and the time-anchor review queue (cut 4); a null attestation column (facts.attested_from stays NOT NULL; undated documents attest nothing through attested_at); source connectors still pass modification times as doc_time with source source (S3, GitHub, Jira, WebDAV, Notion) — worth its own decision.

🤖 Generated with Claude Code

@WaylandYang
WaylandYang force-pushed the feat/extraction-reads-only-the-open-graph branch from 1713f69 to d97fb10 Compare September 17, 2026 13:45
Base automatically changed from feat/extraction-reads-only-the-open-graph to dev September 17, 2026 13:52
WaylandYang and others added 3 commits September 17, 2026 21:54
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
…does not

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: WaylandYang <wayland0916@gmail.com>
@WaylandYang
WaylandYang force-pushed the feat/a-time-mention-is-resolved-against-its-document branch from caa8ae2 to db2682c Compare September 17, 2026 13:54
@WaylandYang
WaylandYang merged commit 24a85df into dev Sep 17, 2026
4 checks passed
@WaylandYang
WaylandYang deleted the feat/a-time-mention-is-resolved-against-its-document branch September 17, 2026 14:02
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.

1 participant