Resolve time mention dependencies independently of model reply order - #1087
Merged
WaylandYang merged 2 commits intoOct 5, 2026
Merged
Conversation
Signed-off-by: Floating-Y <118035379+Floating-Y@users.noreply.github.com>
WaylandYang
approved these changes
Oct 5, 2026
WaylandYang
left a comment
Contributor
There was a problem hiding this comment.
Thanks @Floating-Y. The dependency order was the reply's order, which the model does not promise, and an anchor computed in one batch was thrown away before the next. Resolving all received interpretations to a fixed point, with the loop ending when a pass makes no progress, is the right structure: chains of any length resolve, and cycles, self-references and missing anchors stay at grade C as before. Keeping "received" apart from "computed" is what lets the retry ask only for what was not answered. Landing it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The resolver introduced in #740 could leave a valid relative time mention at grade C solely because of the model's reply order. For a chain
0 → 1 → 2starting on 2024-01-01, reply order[0,1,2]resolved mention 2 to 2024-01-03 at grade B, while[0,2,1]left it undated at grade C. Both replies parsed completely.The old scheduler evaluated mention dependencies once in reply order and discarded computed anchors between batches. The existing retry asks only for unanswered IDs, so it could not repair an interpretation already received with an unavailable dependency.
What changes
resolve_interpretationsfunction used by both production and regression tests. Revisit pending interpretations while progress is made; stop when a pass makes no progress and leave the remaining interpretations at grade C.This resolves dependencies among known interpretations within one document-resolution run. It does not implement the undated-event waiting mechanism proposed in #1075, expand model-visible context, or add cross-document matching. There are no migrations, public fields, dependencies, or unrelated time-feature changes. The pending-set approach requires at most O(n²) single-interpretation evaluations.
How it was checked
[0,2,1]left mention 2 at grade C.cargo test --locked --offline --workspace: 1437 passed, 0 failed, 6 ignored, with a dedicated temporary PostgreSQL database andUTOPIA_TEST_REQUIRE_DB=1.cargo fmt --all --checkandcargo clippy --locked --offline --workspace --all-targets -- -D warningspassed.pnpm install --frozen-lockfileandpnpm buildpassed. No web files changed.Initial database-backed mock-endpoint checks failed, and an initial workspace run was stopped after related failures, because Windows system proxy handling intercepted loopback requests. Reruns passed with process-local
NO_PROXY=localhost,127.0.0.1,::1; no application code or global proxy settings were changed. The six default-ignored tests were not run: two live-service tests and four opt-in delivery/crash tests.Before review
git commit -s)cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warningsandcargo test --workspacepass