Default context should be visible and work without errors #10

Closed
opened 2026-03-10 14:20:29 +00:00 by mik-tf · 1 comment
Owner

Hero OS requires a context to function. On a fresh install, a "default" context is auto-created so the user has somewhere to land. This is correct behavior and will always exist in production.

During Issue #7, we filtered "default" out of the Switch Context dropdown to make the demo look cleaner with only the themed contexts (Geomind, ThreeFold, Incubaid). This was a mistake. We need to bring it back because:

  1. Every Hero OS instance has a default context. There is no way to run Hero OS without one. Hiding it from the demo misrepresents how the system works.
  2. Switching to "default" from Manage Contexts crashes with Error: Network error: TypeError: Failed to fetch. An empty context should show empty lists, not crash.

What needs to happen

  1. Bring "default" back in the Switch Context dropdown — remove the filter that was added in Issue #7
  2. Handle empty contexts gracefully — when switching to a context with no data, show empty lists instead of a fetch error
  3. Keep Geomind as the initial view — the seeded contexts are still the default landing for the demo, but "default" should be accessible

Repos involved

Repo Purpose
hero_os Switch Context dropdown filtering
hero_archipelagos Island error handling (graceful empty state)

Branching Strategy

Work on development_{name} branch, squash into one commit, merge to development.

Deployment

Tier Image Tag Gateway Port Status
dev :dev herodev.gent02.grid.tf 8805 Live
demo :demo herodemo.gent02.grid.tf 8806 Live

Registry: forge.ourworld.tf/lhumina_code/hero_zero
VM: TFGrid Node 8, Mycelium 495:72fa:8ec3:9264:ff0f:c0a8:abad:234c

Deploy Commands

# SSH to VM
ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c

# Local Docker build (from hero_services dir)
cd hero_services
DOCKER_BUILDKIT=1 docker build --ssh default -f Dockerfile.dev -t forge.ourworld.tf/lhumina_code/hero_zero:dev ..

# Push to registry
docker push forge.ourworld.tf/lhumina_code/hero_zero:dev

# Deploy to herodev
ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c \
  'docker pull forge.ourworld.tf/lhumina_code/hero_zero:dev && \
   docker stop herodev; docker rm herodev; \
   docker run -d --name herodev --restart unless-stopped \
     -p 8805:6666 -v /root/.ssh:/root/.ssh:ro \
     forge.ourworld.tf/lhumina_code/hero_zero:dev'

# Tag and deploy to herodemo (only after human confirms herodev)
docker tag forge.ourworld.tf/lhumina_code/hero_zero:dev forge.ourworld.tf/lhumina_code/hero_zero:demo
docker push forge.ourworld.tf/lhumina_code/hero_zero:demo

ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c \
  'docker pull forge.ourworld.tf/lhumina_code/hero_zero:demo && \
   docker stop herodemo; docker rm herodemo; \
   docker run -d --name herodemo --restart unless-stopped \
     -p 8806:6666 -v /root/.ssh:/root/.ssh:ro \
     forge.ourworld.tf/lhumina_code/hero_zero:demo'

# Check logs
ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c 'docker logs herodev 2>&1 | tail -20'

DevOps Workflow

Step What Who Gate
1 Code AI
2 Local Docker build AI must compile
3 Deploy to herodev AI
4 Human test on herodev Human must confirm
5 Commit and push AI only after step 4
6 Remote Docker build AI must compile
7 Deploy to herodev (again) AI
8 Human test on herodev Human must confirm
9 Tag :demo AI only after step 8
10 Human test on herodemo Human must confirm
11 Update this issue AI

Rules:

  • Never push before human confirms on herodev
  • Never tag :demo before human confirms remote build
  • Never rebase, always merge
  • herodev gets changes first, herodemo only after confirmation
  • No hot-swapping WASM, always full Docker rebuild + deploy

Operational Lessons

  1. Docker cache can go stale — sometimes --no-cache is needed when cargo dependencies change
  2. Container name conflicts — always docker stop + rm before docker run
  3. Registry workflow — build locally, push to registry, pull on VM
  4. Never break herodemo — herodev is the playground, herodemo only after confirmation
  5. Port mapping — container 6666 internally, 8805 (herodev), 8806 (herodemo)
  6. SSH agent forwarding--no-cache builds require --ssh default
Hero OS requires a context to function. On a fresh install, a "default" context is auto-created so the user has somewhere to land. This is correct behavior and will always exist in production. During Issue #7, we filtered "default" out of the Switch Context dropdown to make the demo look cleaner with only the themed contexts (Geomind, ThreeFold, Incubaid). This was a mistake. We need to bring it back because: 1. **Every Hero OS instance has a default context.** There is no way to run Hero OS without one. Hiding it from the demo misrepresents how the system works. 2. **Switching to "default" from Manage Contexts crashes** with `Error: Network error: TypeError: Failed to fetch`. An empty context should show empty lists, not crash. ### What needs to happen 1. **Bring "default" back in the Switch Context dropdown** — remove the filter that was added in Issue #7 2. **Handle empty contexts gracefully** — when switching to a context with no data, show empty lists instead of a fetch error 3. **Keep Geomind as the initial view** — the seeded contexts are still the default landing for the demo, but "default" should be accessible ### Repos involved | Repo | Purpose | |------|---------| | [`hero_os`](https://forge.ourworld.tf/lhumina_code/hero_os) | Switch Context dropdown filtering | | [`hero_archipelagos`](https://forge.ourworld.tf/lhumina_code/hero_archipelagos) | Island error handling (graceful empty state) | ### Branching Strategy Work on `development_{name}` branch, squash into one commit, merge to `development`. ### Deployment | Tier | Image Tag | Gateway | Port | Status | |------|-----------|---------|------|--------| | **dev** | `:dev` | `herodev.gent02.grid.tf` | 8805 | Live | | **demo** | `:demo` | `herodemo.gent02.grid.tf` | 8806 | Live | **Registry:** `forge.ourworld.tf/lhumina_code/hero_zero` **VM:** TFGrid Node 8, Mycelium `495:72fa:8ec3:9264:ff0f:c0a8:abad:234c` ### Deploy Commands ```bash # SSH to VM ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c # Local Docker build (from hero_services dir) cd hero_services DOCKER_BUILDKIT=1 docker build --ssh default -f Dockerfile.dev -t forge.ourworld.tf/lhumina_code/hero_zero:dev .. # Push to registry docker push forge.ourworld.tf/lhumina_code/hero_zero:dev # Deploy to herodev ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c \ 'docker pull forge.ourworld.tf/lhumina_code/hero_zero:dev && \ docker stop herodev; docker rm herodev; \ docker run -d --name herodev --restart unless-stopped \ -p 8805:6666 -v /root/.ssh:/root/.ssh:ro \ forge.ourworld.tf/lhumina_code/hero_zero:dev' # Tag and deploy to herodemo (only after human confirms herodev) docker tag forge.ourworld.tf/lhumina_code/hero_zero:dev forge.ourworld.tf/lhumina_code/hero_zero:demo docker push forge.ourworld.tf/lhumina_code/hero_zero:demo ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c \ 'docker pull forge.ourworld.tf/lhumina_code/hero_zero:demo && \ docker stop herodemo; docker rm herodemo; \ docker run -d --name herodemo --restart unless-stopped \ -p 8806:6666 -v /root/.ssh:/root/.ssh:ro \ forge.ourworld.tf/lhumina_code/hero_zero:demo' # Check logs ssh -6 root@495:72fa:8ec3:9264:ff0f:c0a8:abad:234c 'docker logs herodev 2>&1 | tail -20' ``` ### DevOps Workflow | Step | What | Who | Gate | |------|------|-----|------| | 1 | **Code** | AI | — | | 2 | **Local Docker build** | AI | must compile | | 3 | **Deploy to herodev** | AI | — | | 4 | **Human test on herodev** | Human | must confirm | | 5 | **Commit and push** | AI | only after step 4 | | 6 | **Remote Docker build** | AI | must compile | | 7 | **Deploy to herodev (again)** | AI | — | | 8 | **Human test on herodev** | Human | must confirm | | 9 | **Tag `:demo`** | AI | only after step 8 | | 10 | **Human test on herodemo** | Human | must confirm | | 11 | **Update this issue** | AI | — | **Rules:** - Never push before human confirms on herodev - Never tag `:demo` before human confirms remote build - Never rebase, always merge - herodev gets changes first, herodemo only after confirmation - No hot-swapping WASM, always full Docker rebuild + deploy ### Operational Lessons 1. **Docker cache can go stale** — sometimes `--no-cache` is needed when cargo dependencies change 2. **Container name conflicts** — always `docker stop + rm` before `docker run` 3. **Registry workflow** — build locally, push to registry, pull on VM 4. **Never break herodemo** — herodev is the playground, herodemo only after confirmation 5. **Port mapping** — container 6666 internally, 8805 (herodev), 8806 (herodemo) 6. **SSH agent forwarding** — `--no-cache` builds require `--ssh default`
mik-tf changed title from Default context appears in Manage Contexts and errors on switch to Default context should be visible and work without errors 2026-03-10 14:38:37 +00:00
Author
Owner

Done

Done
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/home#10
No description provided.