Skip to content

Merges involving names declared as identities wait for human review - #1425

Merged
WaylandYang merged 3 commits into
deeplethe:devfrom
Aschenbath:feat/identity-merge-review-1248
Oct 29, 2026
Merged

WaylandYang merged 3 commits into
deeplethe:devfrom
Aschenbath:feat/identity-merge-review-1248

Conversation

@Aschenbath

Copy link
Copy Markdown
Contributor

Why

A confident same verdict could automatically merge entities whose names a statements source declared to be identities. This implements ADR 0071 decision 7 using the existing {"names":"identity"} source flag.

Closes #1248

What changes

  • Both adjudication paths use one merge gate that checks current name evidence on either entity, including aliases and mixed prose/identity evidence. A held merge leaves both entities live and records escalate_identity for human review.
  • Batch, cached, and second-look verdicts use the gate. Governance retains the model's verdict as a proposal with the hold reason. Confident kept verdicts still close automatically, and people can still merge entities themselves.
  • Add the review reason in English and Chinese, and mark ADR 0071 and its index entry implemented.

How it was checked

Checked commit 2916e332150bc5baa1435c0a0fd14721bf85f899 on Linux x86_64 with Rust 1.99.1, PostgreSQL 16.15, pgvector 0.6.0, and Poppler with CJK data. The test database was created with UTF-8 encoding and all migrations applied.

  • cargo test --workspace: 1,709 passed, 0 failed, 6 ignored, with UTOPIA_TEST_REQUIRE_DB=1 and UTOPIA_TEST_REQUIRE_PDFTOTEXT=1. The six ignored tests are existing live-service and isolated delivery experiments.
  • cargo clippy --workspace --all-targets -- -D warnings: passed.
  • cargo fmt --all --check: passed.
  • Frozen pnpm install, pnpm build --outDir /var/tmp/utopia-1248/web-dist, and pnpm test: passed; 326 web tests across 47 files.

The three new database-backed regressions use mocked confident model verdicts to cover governance on/off, direct batch and second-look decisions, aliases with mixed evidence, cached verdict replay after a source flag change, kept decisions, and sources without the identity flag.

Before review

  • Every commit is signed off.
  • Rust formatting, Clippy, and the full workspace tests pass.
  • Web build and tests pass; UI strings are in both languages.
  • The SQL change was exercised against PostgreSQL with database tests required.
  • ADR 0071's status line and index are updated.

Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.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.

Thanks @Aschenbath, this does what 0071 decision 7 says, and only that. One gate, hold_for_merge, covers the batch, cached and second-look verdicts and the governor. Either side counts, current name evidence including aliases and mixed prose evidence counts, kept still closes, and a person's decision is unchanged. The tests cover governance on and off and both verdicts. Two small things before merge:

  1. The three comments in adjudication_identity_tests.rs should be in Chinese, per the repo convention.
  2. ADR 0071's status line should name the PRs: Implemented · 2026-10-25 · #1333, #1390, #1425 · open: none.

Optional: reuse name_vectors::has_identity_evidence! instead of a second copy of the join, and let the governor's consequences tool mention the identity hold. Separately, merge_entities drops fact_evidence when it deduplicates name facts, so a person's merge can take identity status away from the survivor; that's #1426, not this PR's job.

…mplementing PRs in 0071

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Aschenbath <Aschenbath@users.noreply.github.com>
@Aschenbath

Copy link
Copy Markdown
Contributor Author

Thanks. Both requested changes are in 94b180e: the three comments in adjudication_identity_tests.rs are now in Chinese, and the 0071 status line reads Implemented · 2026-10-25 · #1333, #1390, #1425 · open: none. I kept this push to those two items. Reusing has_identity_evidence! and mentioning the identity hold in the governor's consequences tool both change code, so I'd rather send them as a separate small follow-up than widen this PR after review. Noted on #1426.

@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.

Thanks, both changes are in. The optional reuse and the governor wording are fine as a follow-up. Merging.

@WaylandYang
WaylandYang merged commit 3b09f9f into deeplethe:dev Oct 29, 2026
6 checks passed
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