Fresh hero_osis install has no Context records — root context list is empty after --start #38
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_osis#38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Symptom
A freshly installed/started
hero_osis(viamake startorhero_osis --start) defaults to running with therootcontext (perServerClidefault), but noContextrecords exist in storage. As a result, the OSIS admin UI (and the OSIS island in hero_os, once #37 is fixed) shows an empty contexts list with no obvious next step for new users.Reproduction
The
resultis the empty string —base.context.listreturns no SIDs because noContextobjects have been persisted to the root context's storage. The runtime context exists (it's serving requests), but there is noContextrecord describing itself.Why this is confusing
--contexts root) AND thebase.Contextrecord describing it. Users only see the second one.make mock/make seedtargets seed contexts (root, default, geomind, …) but only run as foreground processes (cargo run) and use a separate data dir (./data/mock-db). The hero_proc-managedmake startflow has no equivalent and ships zero seed data.make mock, but on a hero_proc-managed install that command doesn't persist into the right data dir.Proposed fix
Pick one or combine:
Option A — auto-bootstrap a self-describing root Context on first start. When the server boots a context whose
base.context.listis empty, create aContext { sid: "root", name: "root" }record (and one per--contextsvalue). Idempotent — only creates if missing. Probably belongs in the base domain init.Option B — ship a default seed. Add a minimal
data/default/{root}/base/context_root.toml(and similar for any default contexts) and havemake start/hero_osis --startapply it via--seed-dirif no records exist yet. Document the path so users can extend it.Option C — improve the empty-state UX. At minimum, change contexts.rs:58-63 so the empty case doesn't suggest
make mock(which only works in dev-foreground mode); instead, show a one-click "Create root context" button that issuesbase.context.set.Recommend A + C together: A fixes the default install, C handles every other empty-state path.
Acceptance criteria
make starton a clean install,base.context.listreturns at least therootSID.rootin the contexts list out of the box.make mock/make seedflows continue to work for fuller seed sets.