Skip to content

An empty ontology says what the documents still need, and no longer claims to cover them - #1083

Merged
WaylandYang merged 2 commits into
devfrom
fix/empty-ontology-says-what-to-do
Oct 4, 2026
Merged

WaylandYang merged 2 commits into
devfrom
fix/empty-ontology-says-what-to-do

Conversation

@WaylandYang

Copy link
Copy Markdown
Contributor

Why

Found in an end-to-end run on dev, on a fresh base with six documents and no ontology.

  • The ontology canvas said "No classes yet. Extraction adds them as documents arrive." That has not been true since extraction writes open statements (0044). Nothing arrives; a person or the agent has to add classes.
  • The Unmatched view said "No unmatched types — the ontology covers your corpus." while 22 kind words had no class. The sentence read ontology_misses (0003), which the open-graph extraction does not write to.

So the first thing a new base told its owner about the ontology was wrong twice, and nothing pointed at the step that turns statements into typed facts.

What changes

  • GET /kbs/{id}/questions/report gains uncovered: { kind_words, phrases }: kind words with no class and phrase shapes bound to no property (none or undecided). These are the two inputs the ontology agent reads (0061 decision 2).
  • The view says those numbers and what to do about them: "The documents use 2 kinds of thing the ontology has no place for. Ask the agent to propose classes and properties for them; nothing is added until you accept it." With nothing waiting it says so. It says nothing until the numbers have loaded, and they refresh after an adoption or a rejection.
  • The empty canvas says what classes are for and has a button, "See what the documents need", that opens that view.
  • The view's title and hint no longer speak of "unmatched from extraction". English and Chinese both.

No change to what the agent does or when it runs.

How it was checked

  • New store test an_empty_ontology_does_not_cover_the_corpus: nothing read yet, kind words with no class, bound against none and undecided, and another base's rows not counted.
  • In a browser on a real server: the empty canvas text and button, the button opening the view, and the sentence with the base's own count.
  • cargo clippy -p utopia-server -p utopia-store --all-targets -- -D warnings, cargo fmt --all --check, pnpm typecheck, pnpm test (228), pnpm build.

Before review

  • Every commit is signed off
  • fmt, clippy and the affected tests pass; pnpm build and pnpm test pass
  • SQL under crates/utopia-store/ was tested with UTOPIA_DATABASE_URL set
  • UI strings are in both en.ts and zh.ts

🤖 Generated with Claude Code

WaylandYang and others added 2 commits October 4, 2026 21:24
…laims to cover them

The ontology page of a base with no classes said "Extraction adds them as
documents arrive", which has not been true since extraction writes open
statements (0044), and its Unmatched view said "the ontology covers your
corpus" beside 22 kind words with no class: that sentence read 0003's
ontology_misses, a table the open-graph extraction does not write to.

The report the page already fetches now carries how many kind words have no
class and how many phrase shapes bind to no property, the two things the
agent reads. The view says those numbers and what to do, or says nothing is
waiting; the empty canvas says what classes are for and has a button to that
view.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Wayland Yang <wayland0916@gmail.com>
@WaylandYang
WaylandYang merged commit 51d22df into dev Oct 4, 2026
6 checks passed
@WaylandYang
WaylandYang deleted the fix/empty-ontology-says-what-to-do branch October 4, 2026 13:53
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.

1 participant