Skip to content

Show property regression cases and their source evidence in the ontology workbench. - #1184

Merged
WaylandYang merged 2 commits into
deeplethe:devfrom
virtue039:feat/ontology-regression-workbench
Oct 10, 2026
Merged

WaylandYang merged 2 commits into
deeplethe:devfrom
virtue039:feat/ontology-regression-workbench

Conversation

@virtue039

Copy link
Copy Markdown
Contributor

Why

Property regression cases from #1178 now record alignment comparisons, but people cannot inspect them or add an expectation while reading its source. This is the workbench slice welcomed in the merge review, following #1103 and ADR 0061 cut 2.

What changes

  • Add a Viewer GET for live cases in the authorized KB, returning source/property labels and the saved comparison without writing or evaluating.
  • Add an ontology workbench list with expected and actual properties/directions, last comparison time, original decision time, origin/attribution, and expandable source evidence. Preserved human bindings are explicitly distinguished from independent matches.
  • Let an Editor add a case beside an open statement in the document viewer using the existing POST. The person chooses the expectation; literal objects offer forward attributes only. Typed projections never supply the source statement ID.
  • Refresh through the existing graph/review events and add a dated note to ADR 0061. No evaluator, evaluation job, version identity, dependency, or migration is introduced.

Review size

This is the single workbench workflow requested as the second slice of #1178. The 693 added lines include 189 test lines, 68 i18n lines and the dated ADR note. The authorized read API supplies the labels and saved results the view needs; the document action lets people record the expectation the view presents. Keeping these together delivers a usable source-to-case workflow rather than an endpoint without its consumer or a screen without its human input. The storage and alignment recording were already split out and merged in #1178.

How it was checked

  • Machine: macOS 26.5.1 / Apple Silicon (arm64), Rust 1.99.0, Node 20.19.5, pnpm 10.2.1, PostgreSQL 16.15 with pgvector 0.8.7. Checked commit c3777a507c85406a91f10a024e6fc693e01cc1b7 on top of upstream 5229278.
  • cargo fmt --all --check and cargo clippy --locked --workspace --all-targets -- -D warnings pass.
  • cargo test --locked --workspace: 1,487 passed, 6 ignored, with a fresh migrated PostgreSQL/pgvector database and UTOPIA_TEST_REQUIRE_DB=1, UTOPIA_TEST_REQUIRE_PDFTOTEXT=1.
  • pnpm install --frozen-lockfile, pnpm build, pnpm test: 268 tests pass.
  • node --test scripts/bench/lib.test.mjs: 15 tests pass.
  • One new API test covers Viewer reads, KB isolation, invalidated sources, displayed labels and unchanged stored comparison time. Existing document-read coverage now verifies eligibility and the original phrase. Three rendering tests cover comparison states, missing historical property labels and human decisions.
  • Local UI against a fixture database: a Viewer reads cases/evidence and returns to the document without an add button; an Editor selects a relation and reverse direction, then a forward literal attribute. Both saves succeed, and the workbench shows the source statement, manual attribution and unchecked state. Expected properties start empty. The fixture comparisons are seeded display examples, not model-accuracy measurements; no live model evaluation was run.

Before review

  • Every commit is signed off (git commit -s)
  • cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass
  • For changes under web/: pnpm build and pnpm test pass
  • SQL under crates/utopia-store/ was tested with UTOPIA_DATABASE_URL set
  • UI strings are in both web/src/i18n/en.ts and zh.ts
  • A change to a public API has its ADR in docs/decisions/

…gy edits against source statements.

Signed-off-by: Virtue039 <virtue039@qq.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.

Thank you for the second slice, and for the size note at the top: that is what the new CONTRIBUTING entry asks for. I built it on top of dev and ran it on a base migrated from rc8: the cases panel lists a match and a mismatch recorded by a real alignment run, the document viewer offers the action on open statements only and not on typed projections, and the API refuses an attribute for an entity object. Typecheck and the 268 web tests pass. One thing for a later slice, not this one: a case cannot yet say that a statement should bind to nothing, and the base I tried had exactly that (不再负责 bound to responsibleFor). Merging now. Thanks again.

@WaylandYang
WaylandYang merged commit bb5cde2 into deeplethe:dev Oct 10, 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