feat(supervisor): auto-start hero_db on hero_proc startup #99
No reviewers
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_proc!99
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_auto_start_hero_db"
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?
Summary
hero_proc_servernow ensures thehero_dbservice (contextcore) is up at startup. Idempotent, honours operator intent, surfaces a clear error to the logs DB whenhero_dbis not registered, and can be opted out of viaHERO_PROC_NO_AUTOSTART_DB=1.Related Issue
Closes #95
Changes
crates/hero_proc_server/src/supervisor/auto_start_db.rs(new):ensure_hero_db_autostart(&Supervisor)plus a puredecide_action(db, env_opt_out) -> Option<HeroDbState>for testability. Branches: NotRegistered (error log), NotStartIntent (warn), AlreadyActive (no-op), NeedsStart (callsautostart_one_service).crates/hero_proc_server/src/supervisor/mod.rs:pub mod auto_start_db;, widenedautostart_one_servicetopub(crate), insertedauto_start_db::ensure_hero_db_autostart(&self).await;inSupervisor::run()afterautostart_services()and beforeautostart_process_jobs().crates/hero_proc_integration_test/tests/hero_db_autostart.rs(new): 2 end-to-end tests — happy path (registered + start → job dispatched) and missing-registration path (nohero_dbrow → error log entry with sourcehero_proc.auto_start_db).crates/hero_proc_integration_test/src/harness.rs: addedstart_with_seed<F>(seed: F)so integration tests can pre-seed the DB after the harness wipes it. Also added aCARGO_TARGET_DIR/.cargo/config.tomllookup branch so the harness picks up the freshly-built binary instead of a stale one onPATH.crates/hero_proc_server/CLAUDE.md: short paragraph noting where the policy lives and that it is additive and non-panicking.Test Results
cargo test --workspace --no-fail-fast -- --test-threads=1:hero_proc_lib::db::integration_tests::tests::logging_api_end_to_end_filters_and_cleanup— reproduces on cleandevelopment)7 new tests in this branch, all passing:
supervisor::auto_start_db::testscovering every branch ofdecide_action.hero_db_autostartcovering the happy path and the missing-registration error log.