Repository navigation
An end the timeline derived cites the fact that closed the row, and a corrected date says which end a person changed - #986
Conversation
… corrected interval carries the person's note Signed-off-by: dada-yan <BinjunYann@gmail.com>
…row instead of read from the audit, and its fact line names that end Signed-off-by: dada-yan <BinjunYann@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
…er is named without a verb that fits only people Maintainer edits on deeplethe#986. When the end of a row is written again, by a document stating it or by the timeline deriving one, the row no longer says a person corrected that end; the start's mark stays. The derived end reads superseded by X: took over was right for an inverse-functional property and wrong for a functional one or a value. Square brackets in a person's note are replaced, since a [2] there would read as a citation. CURRENT_SCHEMA_VERSION is 90. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
WaylandYang
left a comment
There was a problem hiding this comment.
Thank you. Writing which end a person changed on the row itself, in the same insert, is the sturdier form I hoped for after #976: a lost audit entry now loses the note and not the mark. The closer goes through the same cite, so one chunk keeps one number, the closing fact's number is registered before the line's own, and MCP carries the words without numbers.
I pushed one commit:
- A stale mark. rewrite_end_tx copied corrected_ends as it was. After a person reopened an end and a document then stated it, the row still read end corrected, and rule 4 told the model not to attribute a date the passage does state. When the end is written again the end's mark goes and the start's stays.
- The wording. took over is right for an inverse-functional property, where the successor is the subject. For a functional one it named the new object, so employer → Acme read as closed when Globex took over, and an attribute as closed when 35000 CNY took over. The line now reads superseded by X [m] in every case; rule 4, the design doc and the tests say the same.
- Brackets in a note. A person's note keeps its words but [ and ] become parentheses, since see [2] on the line would read as a citation.
- CURRENT_SCHEMA_VERSION is 90, as #975 landed with 0098.
With dev merged in: store 291, server 522, CLI 13, all passing.
On the bench: the drop in the chat check comes from answers now naming the successor, which the name check counts as a wrong name. That is the check's limit, not the answers'. If you want to tighten it, score the name the question asks for rather than any name present.
Worth a follow-up test: two successors starting on the closing date, a closer that was itself rewritten, and a closer with no live evidence. Landing it. Thanks again.
WaylandYang
left a comment
There was a problem hiding this comment.
Maintainer review: sound, landing.
dev reached 90 migrations with #986; this PR adds one more and the CLI test compares the constant with the number of files. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Wayland Yang <wayland0916@gmail.com>
Closes #970: step 2 as decided there, on top of #976 (step 1), with the three follow-ups from #976's review.
Problem
end derived) and a corrected interval (corrected) on graph fact lines, and rule 4 says neither is the cited passage's.[n]after a list item that carries such a date, for example "Li Si — from 2024-07-05 to 2025-09-01 [2]", where [2] is the handover memo, which states only the start.correcteddepends on the audit entry the correction route writes after the fact, which is best effort;Change
The fact that closed the row.
cite:(2024-07-05 → 2025-09-01, closed when Zhou Qi took over [3]). [3] opens the leadership update, which states 2025-09-01.temporal::desired_ends):LEFT JOIN LATERALingraph::entity_detailandpaths::details, only forend_derivedrows, on the record axis as the facts are read.EntityFactandPathEdgegainclosed_by_id,closed_by(the successor's name) andclosed_by_value(a new literal value). The line renders them withliteral_text.first_live_evidencequery:Evidence::loadtakes the shown facts and their closers together. The closer's chunk gets its number where the line prints it, so one chunk keeps one number: Zhou Qi's own line and Li Si's closer share it.ended, date unknown) has no row to cite and keepsend derived.closed when Zhou Qi took overwithout a number.Which end a person changed, written with the row. Migration
0099addsfacts.corrected_ends:start,endorboth, NULL when no person changed the interval.temporal::correct_intervalwrites it in the correction's own transaction. It compares the old row with the new interval: an end whose value or precision changed is marked, joined with the old row's marks, so a start and then an end makeboth.end_derived, and the timeline no longer redraws that end:a_revert_keeps_the_interval_a_person_correctedpins this. So a derived end the person kept is marked as theirs too. An end the passage stated and the person left alone stays unmarked, and stays the passage's.end_derived:rewrite_end_tx(a close or a new end),rehome_txandgraph::adopt.endwhenend_derivedis set.supersedeschain for an audit entry. The flag no longer depends on the audit.detailrecords the interval before (from) and after (to). The row the entry targets is still in the table, so itsend_derivedis known.The line and rule 4.
(2023-02-01 → 2024-07-05, start corrected: The charter date was the approval date);end corrected;correctedfor both.fact.time_correctedentry's on the chain. It is read only for marked rows, through Graph fact lines say when an end was derived by the timeline or an interval corrected by a person #976's partial index. It cites nothing, since it is a person's statement and not a passage, and it is flattened to one line and cut at 120 characters.closed when X took over [m]was set by the timeline when that fact began, so cite [m] for it, never the line's own [n];start correctedorend correctedmeans that date was changed by a person, andcorrectedmeans both;Docs.
docs/design/chat-and-mcp.mdfollows.CLI.
CURRENT_SCHEMA_VERSIONis 89: the 88 files on dev plus 0099. #975 holds 0098, so the numbers do not collide; whichever of the two lands second raises the constant to 90.Verification
Run in containers on a Linux host: Rust 1.98.1 and PostgreSQL 16 with pgvector.
New tests
time_text:closed when ….a_fact_says_where_its_dates_came_from:start, still after a close by hand;both;both, with the latest note.a_corrected_row_says_which_end_changed, its own binary, since it runs 0099 again over the whole database. It checks whatcorrect_intervalwrites, then clears the column. The backfill restores:start,bothandend, and nothing for a row closed by hand;bothfor an entry without the two intervals, and for a derived end the person kept;a_fact_line_says_when_a_date_is_not_the_passages:closed when Zhou Qi took over [k]. [k] is the update chunk, the same number as Zhou Qi's own line, and its entry carries Zhou Qi's sentence.start corrected: …, and the note is not a source.corrected: The handover was on 1 July.The new tests on dev
The control branch is dev plus every new test, with the new fields stubbed empty and
span()as on dev, so a correction printscorrected. The new tests fail:time_texttests fail.This branch (f9869d0)
cargo test --locked -p utopia-clipasses (13), the schema guard among them.graph_citation,time_text,chat_sourcesandapi::(227).cargo fmt --all --checkandcargo clippy --locked --workspace --all-targets -- -D warningsare clean.UTOPIA_TEST_REQUIRE_PDFTOTEXT=1 cargo test --locked --workspacepasses: 1256 passed, 0 failed.Measurement
The temporal bench with DeepSeek (
deepseek-chat), measured as step 1 was.The derived end. With a number of its own, DeepSeek cites it in some answers: "He held the role until 2025-09-01, when Zhou Qi took over [2]", where [2] opens the leadership update. Li Si's end is cited to a passage that states it in 6 of 14 clauses, against 3 of 12 on dev. The spread between runs is as wide as that difference.
The corrected dates.
correctedfor both ends. The one-end wording is covered by the tests but not exercised by this corpus.The chat count. The lower count on the branch comes from the bench's name check.