A date the text spells out is read as a date - #689
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
WaylandYang
force-pushed
the
fix/a-written-date-is-read
branch
from
September 13, 2026 21:38
2ff7d45 to
7a10105
Compare
Contributor
Author
|
Rebased onto dev after #679 merged (the session that opened this ended, so I did the rebase). It picks up the review follow-ups that were prepared on top of #679:
Checks on 7a10105 (fresh database migrated to 0057): store, server and extract pass 595 tests with 0 failures; clippy Scripted-endpoint end to end with a declared date attribute:
🤖 Generated with Claude Code |
This was referenced Sep 13, 2026
Merged
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.
Closes #688. When the model copies a date the way a contract writes it ("June 23, 2020", "17 Mar. 2020", "March 2020"), the server now reads it as a date. Before, it dropped the value as
attr_datatype. A numeric date whose day/month order is ambiguous is still refused.Why
Rule 8a asks the model for
YYYY-MM-DD, and it often writes the contract's own form anyway. On the lease bench, the two runs on #679 at 98a3d20 dropped 21 deadline facts this way, and the two runs at b2facea dropped 15. It was the largest single loss. The timelines built from the values that did land were right.What changes
utopia_extract::written_datereads two families, with precision taken from what is written. A date written only to the month gets month precision; no day is invented.March 17, 2020,17 March 2020,Mar. 17 2020,March 2020. chrono's%B/%brecognise the name (full name or three-letter abbreviation, any case).2020/03/17,2020.3.17,2020年3月17日,2020年3月.Refused:
03/04/2020,3.4.2020), where the form itself doesn't say which is the month.2020/03.February 30, 2020).45 days after the Trigger Date,Q3 2020).Where it applies:
read_time:parse_time, or else a written date. It is used where the server reads a model reply:valid_from/valid_to, the "a time as subject or object" normalizations, and literal detection.normalize_attr_value("date"): stores a written date in rule 3's form ("2020-06-23","2020-03"), so the same day has one spelling for comparison and dedupe. This is the shared datatype path, so edge qualifiers (rule 8c) get the same behaviour. A value already in rule 3's form is kept as is.parse_timestill accepts only the contract format. Chat tool arguments (at,as_of) and the UI keep their existing contract, where "August 2024" is refused (a_moment_is_a_date_or_an_rfc3339_stamp_and_nothing_else).Checks
a_written_date_is_read_only_when_its_form_says_which_day: 13 written forms read as2020-03-17, and 3 month-only forms as2020-03. ISO values are kept as written. It covers 4 ambiguous numeric forms and 9 non-dates; qualifiers and interval ends go through the same parser.parse_time_precisions:parse_timestill refuses a written date, andread_timeaccepts one."June 23, 2020"withvalid_from"June 8, 2020", an attribute"March 2020", an attribute"08/13/2020", and a relation with qualifiersigned_on: "17 Mar. 2020".option_deadline = "2020-06-23"from2020-06-08(day);rent_commencement = "2020-03";signed_on = "2020-03-17"on the edge. Only08/13/2020is dropped (attr_datatype).attr_datatype, onequalifier_datatype).cargo test -p utopia-extract52 passed;-p utopia-server --bins272 passed.-D warningsand fmt are clean.This touches rule 8a's date sentence, which #679 also edits; whichever merges second resolves it.
🤖 Generated with Claude Code