Repository navigation
The first base of a deployment starts with a vocabulary - #325
Merged
Merged
Conversation
WaylandYang
force-pushed
the
fix/the-first-base-gets-a-vocabulary
branch
from
September 4, 2026 20:59
64068f9 to
c7717e1
Compare
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: WaylandYang <wayland0916@gmail.com>
WaylandYang
force-pushed
the
fix/the-first-base-gets-a-vocabulary
branch
from
September 4, 2026 21:01
c7717e1 to
39ab0c1
Compare
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #322.
insert_general_kbcreated theGeneralbase during registration and installed nothing, while creating a base through the UI installs whatever was ticked — schema.org by default. So the first base of every deployment, the one a new user lands in and uploads their first document to, started with zero classes and zero properties.Both records had already decided this. 0008's status line: schema.org checked by default. 0009 decision 1: "schema.org is pre-checked in the create dialog". An empty ontology is a path 0009 supports — build the base first, model later — but it is a path someone chooses, and this base skipped the dialog where the choice is offered. What 0008 argues is what was lost: without domain and range the extraction prompt falls back to prose, direction cannot be pinned, and facts degrade to
related_to.The awkward part
insert_general_kbruns inside the registration transaction in the store layer.install_packsneedsAppState— it reads the embedded pack and goes through OWL import — so it cannot join that transaction. Registration now returnsRegistered { user, workspace, general_kb }, and the handler installs the pack after the commit.general_kbisSomeonly on the bootstrap path, so a second registration joining an existing workspace installs nothing.A failed install does not fail the registration. The transaction is already committed and the account exists; failing here would turn "the base has no vocabulary" into "you cannot sign up", and the former is recoverable — install a pack later and rerun type resolution (0009). It logs a warning instead.
One pack, not five:
DEFAULT_PACKis the same default the create dialog offers, so both paths now agree by construction rather than by coincidence.Verified
On a fresh database: register the first user, and the default base comes up with 915 classes and 1625 properties —
person,organization,product,eventall present. Registering a second user leaves it at 915, confirming the bootstrap-only path.Existing deployments need no backfill: migrations only roll forward here, and per 0009 an older base can install a pack and rerun type resolution to pick up types for entities already extracted.
cargo fmt --check,cargo clippy -D warnings,cargo test --workspacewithUTOPIA_TEST_REQUIRE_DB=1all pass.Checked while here
Whether the default pack would bring in unreadable keys — it does not. Measured across both packs: schema.org produces 0 opaque keys out of 915 classes and 1625 properties (its digit-bearing keys all carry meaning:
gtin12,emissions_co2,has_gs1_digital_link). Thebfo_0000144kind comes from IOF Core referencing BFO, and is filed separately as #324.🤖 Generated with Claude Code