Skip to content

Follow-up tests from the #975 and #986 reviews - #993

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:fix/follow-up-tests-for-marks-and-closers
Sep 29, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
Maya-Kid:fix/follow-up-tests-for-marks-and-closers

Conversation

@Maya-Kid

Copy link
Copy Markdown
Contributor

The tests asked for when #975 and #986 landed. Tests only; no code changes.

A row a person wrote survives step 0 (#975)

At merge, step 0 of materialization gained the guard step 2 has: it retires only computed rows (from_statement_id or implied). The new test a_moment_marks_its_state::a_row_a_person_wrote_is_kept_when_a_single_date_merged_into_it builds the case the way it arises:

  • The property is an event. A person writes a row for one day: both ends on that date, no from_statement_id.
  • Two statements of that day are bound to the property. On materialize, the one to the same object merges into the person's row: the row gains a source link but no from_statement_id. The other is written as a computed row (added 1, merged 1).
  • The property is changed to a state, and materialization runs again. The computed row is retired (retired 1). The person's row stays live with its date.

A bind_to helper binds a phrase to a property other than works_for.

The closer a derived end names (#986)

The new test a_fact_says_where_its_dates_came_from::a_closer_is_the_row_the_timeline_closed_with runs on leads, which is inverse functional (one lead per project):

  • Two successors start on the closing date. Zhou Qi and Sun Ba both take over Aurora on 2025-09-01. Li Si's row is closed that day. Its closer is Zhou Qi's row, which has the lower id. temporal::desired_ends also takes that row first when it sorts the candidates.
  • The closer was rewritten. On Helios, Qian Qi takes over from Zhou Qi, so Zhou Qi's row is closed and written again as a new row. Li Si's closer is that live row, under the same name. Zhou Qi's own closer is Qian Qi.

A closer with no live evidence (#986)

chat_graph_citation_tests::a_fact_line_says_when_a_date_is_not_the_passages now continues after Zhou Qi's document is deleted:

  • In entity_facts, neighbors and timeline, and on a paths_between hop, Li Si's line reads superseded by Zhou Qi without a number.
  • The line keeps its own number, which still opens the handover passage.
  • The source list has no entry for Zhou Qi's chunk.

Verification

Run in containers on a Linux host: Rust 1.98.1 and PostgreSQL 16 with pgvector.

Each new check was also run with the code it pins changed, one change at a time. Each fails there:

Change The check fails with
Step 0 without the guard the person's row retired too: retired: 2
The closer query ordered by n.id DESC the closer is Sun Ba
The closer query without its live-row filter the closer is Zhou Qi's old row
first_live_evidence reading deleted documents superseded by Zhou Qi [2]

On this branch:

  • cargo fmt --all --check and cargo clippy --locked --workspace --all-targets -- -D warnings are clean.
  • UTOPIA_TEST_REQUIRE_PDFTOTEXT=1 cargo test --locked --workspace passes: 1283 passed, 0 failed.
    • The store suite has 293 tests: 291 plus the two new ones.
    • The server has 522; the third case extends an existing test.

…ed end names

Signed-off-by: dada-yan <BinjunYann@gmail.com>

@WaylandYang WaylandYang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Thanks @Maya-Kid, these are the tests the two reviews asked for.

Reviewed at 83c2244. Tests only, and each one builds its case the way it arises in use. Running every new check against the code with the pinned behaviour changed, and showing what it fails with, is what I would ask for, so thank you for doing it unasked.

One note, no change needed: assert!(zhou_a < sun_a) relies on two ids made in a row being ordered. If that ever stops holding the assert fails loudly, which is the right way for it to go.

@WaylandYang
WaylandYang merged commit 05ce4dc into deeplethe:dev Sep 29, 2026
@Maya-Kid
Maya-Kid deleted the fix/follow-up-tests-for-marks-and-closers branch September 29, 2026 06:13
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.

2 participants