Skip to content

feat(plugins): live ShellExecutor hot-reload, skipped_plugins UX, sha256 integrity check#3166

Merged
bug-ops merged 2 commits intomainfrom
plugins-shell-hot-reload
Apr 18, 2026
Merged

feat(plugins): live ShellExecutor hot-reload, skipped_plugins UX, sha256 integrity check#3166
bug-ops merged 2 commits intomainfrom
plugins-shell-hot-reload

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 18, 2026

Implements three deferred features from PR #3145 (issue #3128).

Summary

Changes

feat(plugins): ShellExecutor live-rebuild (#3146)

  • Add ShellPolicy, ShellPolicyHandle (ArcSwap<ShellPolicy>) to zeph-tools
  • find_blocked_command return type: Option<&str>Option<String>
  • Wire ShellPolicyHandle into LifecycleState, SharedAgentDeps, acp/daemon/runner
  • reload_config calls handle.rebuild() on blocked_commands change; allowed_commands still emits WARN + restart banner
  • Add arc-swap as direct workspace dep (was already transitive)

feat(plugins): skipped_plugins UX (#3147)

  • zeph plugin list --overlay flag with formatted output
  • /plugins overlay and /plugins list --overlay slash commands
  • PluginListOverlay TUI palette entry

feat(security): sha256 integrity check (#3148)

  • IntegrityRegistry in crates/zeph-plugins/src/integrity.rs
  • Registry at <data_root>/.plugin-integrity.toml (outside plugins_dir, avoids TOCTOU)
  • Atomic save (tmp + rename), chmod 0o600 on unix
  • Strict from_utf8 throughout manager.rs (replaces from_utf8_lossy)
  • Missing entries permitted with debug! (forward-compat with pre-feature installs)
  • default_integrity_registry_path() helper in zeph-config

Test plan

  • cargo nextest run --config-file .github/nextest.toml --workspace --lib --bins — 8356 passed
  • cargo +nightly fmt --check — clean
  • cargo clippy --workspace -- -D warnings — clean
  • hot_reload_rebuilds_shell_blocklist e2e test covers reload_configrebuild() path
  • list_installed_ignores_non_directory_entries regression: stray files in plugins_dir not surfaced as plugins
  • overlay_ignores_integrity_registry_file: .plugin-integrity.toml not surfaced as plugin
  • Live testing per /Users/rabax/Dev/zeph/.local/testing/playbooks/plugins.md scenarios A–E

Closes #3146, #3147, #3148

@github-actions github-actions Bot added enhancement New feature or request size/XL Extra large PR (500+ lines) documentation Improvements or additions to documentation rust Rust code changes core zeph-core crate dependencies Dependency updates and removed enhancement New feature or request size/XL Extra large PR (500+ lines) labels Apr 18, 2026
@bug-ops bug-ops enabled auto-merge (squash) April 18, 2026 11:47
@github-actions github-actions Bot added enhancement New feature or request size/XL Extra large PR (500+ lines) labels Apr 18, 2026
@bug-ops bug-ops force-pushed the plugins-shell-hot-reload branch from e29a6f4 to b41d45a Compare April 18, 2026 11:52
bug-ops added 2 commits April 18, 2026 14:02
…256 integrity check

Implements three deferred features from PR #3145 (issue #3128).

Replaces the static blocked_commands Vec in ShellExecutor with an
ArcSwap<ShellPolicy> handle. When reload_config detects a change in
blocked_commands via the plugin overlay, it calls handle.rebuild() to
swap in the new policy atomically — no restart required. allowed_commands
changes still require a restart and emit a WARN banner.

- Add arc-swap as explicit workspace dependency (was already transitive)
- Add ShellPolicy, ShellPolicyHandle, compute_blocked_commands to zeph-tools
- find_blocked_command return type: Option<&str> -> Option<String>
- Wire ShellPolicyHandle into SharedAgentDeps, LifecycleState, acp/daemon/runner
- Add hot_reload_rebuilds_shell_blocklist e2e test

Surfaces ResolvedOverlay::source_plugins and skipped_plugins in user-facing
commands so partial-apply failures are diagnosable without debug logs.

- zeph plugin list --overlay: new --overlay flag with format_overlay_section output
- /plugins overlay slash command
- PluginListOverlay TUI palette entry ("plugin:overlay")

Records a sha256 digest of each .plugin.toml at install time in a registry
at <data_root>/.plugin-integrity.toml (outside plugins_dir to prevent TOCTOU).
At startup and hot-reload, the digest is verified before the overlay is applied;
mismatches are added to skipped_plugins with an "integrity mismatch" reason.

- New IntegrityRegistry in crates/zeph-plugins/src/integrity.rs
- Atomic save via tmp+rename; chmod 0o600 on unix
- default_integrity_registry_path() helper in zeph-config
- Strict from_utf8 throughout manager.rs (replaces from_utf8_lossy)
- Missing entries permitted with debug log (forward-compat with existing installs)
- Regression test: list_installed_ignores_non_directory_entries

Closes #3146, #3147, #3148
@bug-ops bug-ops force-pushed the plugins-shell-hot-reload branch from b41d45a to 0e72d4e Compare April 18, 2026 12:02
@bug-ops bug-ops merged commit 2a527f4 into main Apr 18, 2026
32 checks passed
@bug-ops bug-ops deleted the plugins-shell-hot-reload branch April 18, 2026 12:08
bug-ops added a commit that referenced this pull request Apr 18, 2026
- specs/027-runtime-layer: ArcSwap hot-reload, skipped_plugins diagnostics, sha256 integrity
- specs/006-tools: ShellPolicyHandle, find_blocked_command return type
- specs/010-security: plugin manifest integrity section
- specs/039-background-task-supervisor: two-phase drain shutdown invariant
- book/guides/custom-skills: overlay flag, integrity check, hot-reload behavior
- book/reference/security: plugin manifest integrity section
- book/reference/cli: zeph plugin subcommand and --overlay flag
bug-ops added a commit that referenced this pull request Apr 18, 2026
* release: prepare v0.19.2

- Bump version from 0.19.1 to 0.19.2 in all manifests
- Update CHANGELOG.md with v0.19.2 release section
- Refresh all crate READMEs and root README (test badge: 8647)
- Update user documentation in book/ for new features
- Update specifications in specs/ to reflect implemented changes
- Accept updated splash snapshot for v0.19.2

* docs: update specs and book for #3166 and #3167

- specs/027-runtime-layer: ArcSwap hot-reload, skipped_plugins diagnostics, sha256 integrity
- specs/006-tools: ShellPolicyHandle, find_blocked_command return type
- specs/010-security: plugin manifest integrity section
- specs/039-background-task-supervisor: two-phase drain shutdown invariant
- book/guides/custom-skills: overlay flag, integrity check, hot-reload behavior
- book/reference/security: plugin manifest integrity section
- book/reference/cli: zeph plugin subcommand and --overlay flag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core zeph-core crate dependencies Dependency updates documentation Improvements or additions to documentation enhancement New feature or request rust Rust code changes size/XL Extra large PR (500+ lines)

Projects

None yet

1 participant