Skip to content

feat: bootstrap mode + setup status/preflight endpoints#29

Merged
lan17 merged 10 commits intomainfrom
lev/bootstrap
Feb 26, 2026
Merged

feat: bootstrap mode + setup status/preflight endpoints#29
lan17 merged 10 commits intomainfrom
lev/bootstrap

Conversation

@lan17
Copy link
Copy Markdown
Owner

@lan17 lan17 commented Feb 24, 2026

Summary

This PR delivers onboarding bootstrap/runtime setup foundations in backend API:

  • Adds bootstrap mode startup path so HomeSec can start API/UI without a loaded runtime config.
  • Adds setup gating so runtime/data endpoints return 503 SETUP_REQUIRED in bootstrap mode while setup/config routes stay available.
  • Adds setup endpoints:
    • GET /api/v1/setup/status
    • POST /api/v1/setup/preflight
    • POST /api/v1/setup/finalize
  • Adds setup service + response models and wires setup routes into router registration.
  • Implements finalize orchestration for bootstrap mode:
    • merges canonical config sections with safe defaults,
    • validates and atomically writes config via ConfigManager.replace_config,
    • requests graceful restart so supervisor can relaunch in normal mode.
  • Adds app/CLI restart plumbing (request_restart, restart exit code handling).
  • Extends bootstrap dependency matrix coverage and adds dedicated setup service/route tests.
  • Regenerates UI API artifacts for the new setup endpoints.

Why

Onboarding requires a first-run flow where the control plane starts before pipeline configuration is complete, then finalizes configuration and transitions out of setup mode cleanly.

Notion Tickets

Validation

  • make check
    • backend lint/format/typecheck/tests: pass
    • UI api:check/lint/tests/build: pass

Notes

  • Current branch head: 05c6e20
  • Working tree has no tracked file changes pending commit.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 87.62887% with 48 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.74%. Comparing base (6e36ab7) to head (d7ace59).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/homesec/app.py 42.22% 26 Missing ⚠️
src/homesec/services/setup.py 91.52% 20 Missing ⚠️
src/homesec/api/dependencies.py 94.44% 1 Missing ⚠️
src/homesec/api/server.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
+ Coverage   82.56%   82.74%   +0.17%     
==========================================
  Files         104      107       +3     
  Lines        9010     9382     +372     
==========================================
+ Hits         7439     7763     +324     
- Misses       1571     1619      +48     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lan17 lan17 merged commit 9b7160f into main Feb 26, 2026
4 checks passed
@lan17 lan17 deleted the lev/bootstrap branch February 26, 2026 03:48
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