feat(vigil): Janet plugin bridge and hooks (slice 4 of 5) - #819
Draft
allen-munsch wants to merge 1 commit into
Draft
feat(vigil): Janet plugin bridge and hooks (slice 4 of 5)#819allen-munsch wants to merge 1 commit into
allen-munsch wants to merge 1 commit into
Conversation
Expose vigil/* Janet functions (live?, emit, list, get, set-state) to plugins via a process-global OnceLock bridge in the plugin worker, and register the three vigil lifecycle hooks (on-vigil-event, on-vigil-reap, on-vigil-observance) in the loader. The keeper's plugin event channel is installed into the bridge at startup so (vigil/emit ...) reaches the keeper router across the worker/runtime thread boundary.
allen-munsch
force-pushed
the
vigil/04-plugin-bridge
branch
from
August 26, 2026 01:51
8a964ba to
6fca7f0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Slice 4 of the vigil feature stack: the Janet plugin bridge and lifecycle hooks. This is the piece that lets Janet plugins interact with the running vigil-keeper at runtime.
vigil/live?,vigil/emit,vigil/list,vigil/get, andvigil/set-stateto Janet plugins via a process-globalOnceLockbridge in the plugin worker.on-vigil-event,on-vigil-reap,on-vigil-observance) in the loader soharness/register-hookaccepts them.(vigil/emit name data)reaches the keeper router across the worker/runtime thread boundary.Scope
src/plugin/worker.rs— thevigil_bridgemodule (statics, install functions, C functions,HARNESS_VIGIL_INITprelude) plus unit tests.src/plugin/loader.rs— three hook names appended toHOOK_NAMES.src/main.rs— installsvigil_plugin_tx+ vigil names after the keeper is created (behind#[cfg(feature = "plugin")], nested inside the existing#[cfg(feature = "vigil")]region).Stack
dirge vigilCLI (slice 1 of 5) #810 — slice 1: persistence +dirge vigilCLI--vigil-onceTesting
Local reproduction of the CI matrix before opening:
cargo build --bin dirgeforvigil,plugin,windows-default,no-plugin, and default feature sets — all clean.cargo clippy --bin dirgefor all-features, windows-default, no-plugin, and default — zero warnings.cargo fmt --all --check— clean.cargo test --bin dirge --all-features -- --skip sandbox::microvm --skip ui::relay_tests— 5925 passed, 0 failed.Known environment-dependent gaps (not caused by this change, and not exercised in CI):
sandbox::microvmOCI-image tests fail locally (podman/buildah environment).ui::relay_testsPTY integration tests hang locally under load; they are gated onsandbox-microvmand unrelated to the plugin bridge.Self-review notes
vigil_bridge::json_to_janetduplicates the existing freejson_to_janet(which goes through a depth-limitedjson_to_janet_depth). The bridge copy is recursive without a depth cap, so a pathologically nested value set viavigil/set-statecould recurse deeply. It's bounded by what a plugin sets, but reusing the depth-limited free function would be cleaner.OnceLock; that first line is stale and should be corrected.