Skip to content

feat(vigil): core runtime and --vigil-once headless driver (slice 2 of 5) - #809

Closed
allen-munsch wants to merge 2 commits into
dirge-code:mainfrom
allen-munsch:vigil/02-core-runtime
Closed

feat(vigil): core runtime and --vigil-once headless driver (slice 2 of 5)#809
allen-munsch wants to merge 2 commits into
dirge-code:mainfrom
allen-munsch:vigil/02-core-runtime

Conversation

@allen-munsch

Copy link
Copy Markdown
Collaborator

What

Slice 2 of 5 for the vigil runtime (issue #760, ELEGY-1). This adds the core runtime — triggers (toll/watcher/harbinger), the reaper event loop, rite gate evaluation, commands-mode dispatch, and the VigilKeeper public API — plus the headless --vigil-once driver.

Stacked on top of #807 (slice 1: persistence + dirge vigil CLI), which must merge first. Because these are sequential fork PRs rather than a native GitHub stack, this diff currently includes slice 1's changes; it will shrink to just the runtime once #807 lands.

Scope

  • src/extras/vigil/{mod,types,reaper,toll,watcher,harbinger,rite,dispatch,tests}.rs — runtime modules and their tests
  • src/main.rs — keeper startup, wake channel, on-vigil-observance dispatch, --vigil-once headless driver with hook drain
  • src/cli.rs--vigil, --vigil-config, --vigil-once, --vigil-once-command
  • Cargo.toml / Cargo.lockvigil = ["dep:notify"], notify 7 optional
  • .osv-scanner.toml — RUSTSEC-2024-0384 ignore for instant (transitive via notify)

Notes / known gaps

  • vigil stays opt-in (not in default features).
  • Plugin-bridge (vigil_plugin_tx) and TUI observer wiring are deliberately deferred to later slices; the headless path has a live caller, so nothing here is #[allow(dead_code)]-gated beyond the pre-existing vigils_dir() helper slice 3 will consume.
  • 33 new runtime tests (45 vigil tests total pass locally), plus fmt/clippy (all-features and windows-default) and both build variants are clean.

Self-review concerns

  • The keeper's plugin/observer hooks are stubbed with _ bindings; if the reviewer would rather see those slices land before merging a runtime slice, I can reorder.
  • notify 7 is pulled in for watcher; worth a second look at whether pulling a whole watch crate for one trigger type is justified versus a hand-rolled poll.

First slice of the vigil phase-5 decomposition: config types + SQLite
store + CLI CRUD, independent of the runtime/keeper/triggers.

- vigil_db: VigilStore (open/upsert/get/remove/set_status,
  list_non_resting) with Active/Paused/Resting status
- config: VigilEntry/VigilTrigger/VigilRite/VigilCommand/SocketMode,
  gated on the `vigil` feature (opt-in, NOT in default)
- cli: `dirge vigil` subcommand with VigilAction + VigilAddTrigger
- main: handle_vigil_command + build_vigil_entry dispatch
- tests: vigil_db store CRUD/status + build_vigil_entry parsing +
  config serde shape
- docs/config.md: document the `vigils` top-level key
…f 5)

Toll/watcher/harbinger triggers, the reaper event loop, rite gate
evaluation, commands-mode dispatch, and the VigilKeeper public API.
Adds --vigil, --vigil-config, --vigil-once, --vigil-once-command CLI
flags and wires the headless --vigil-once path (keeper startup, wake
channel, on-vigil-observance dispatch, hook drain before exit).

vigil remains opt-in (not in default features).
@allen-munsch
allen-munsch marked this pull request as draft August 23, 2026 15:16
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