feat: dynamic policy listing, network/package caps, SSH fleet orchestration, TUI approval widget#3
Merged
Merged
Conversation
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
Completes four work items (P3, P2a, P2b, P1) on
feat/p1-p2-p3-completion. Each is an isolated commit; the full workspace builds, tests, and passesclippy -D warnings.P3 — Dynamic policy listing (
cd6f63b)PolicyEvaluator::rules(&self) -> &[PolicyRule]getter (+ unit test).show_policy()in the TUI to enumeratedefault_policy().rules()dynamically — prints each rule's priority, id, effect, enabled-state, a rendered condition expression, and description (via a new recursivedescribe_condition()helper). No more hardcoded table.P2a — Network & package capabilities (
2934e9e)network.rsandpackages.rswere already fully implemented (realinvoke(), correct manifests, registered inall_capabilities()); no stubs. The gap was test coverage — existing tests only exercisedvalidate_argsvia a panicking dummy executor.MockExecutorand 8 newinvoke()/invoke_inverse()tests coveringNetworkConnections(ss/netstat),NetworkInterfaces(ip/ifconfig),PackageList(apt list),PackageUpgrade(apt upgrade/install), and the intentional non-recoverable inverse ofPackageUpgrade.P2b — SSH multi-host orchestration (
2f105e6)sentinel-fleet::fleet_execmodule:HostConfig([user@]host[:port]parsing),FleetConfig,FleetResult, aHostExecutortrait, and the productionSshHostExecutor(agentless — shells out tosshviatokio::process, no native dep).execute_on_fleet()/execute_on_fleet_with()fan out across hosts in parallel viaJoinSetand aggregatehostname → CapabilityResult, with per-host error isolation (one bad host never aborts the rest).sentinel fleet <goal> --hosts h1,h2 --capability <id> --args <json>subcommand prints per-host results + a summary.P1 — TUI interactive approval widget (
d3a527d)app.rs: newAppState { Normal, ApprovingPlan(PlanStep) }, anApprovalOutcome { Approve, Abort }enum, and anApprovalRequest(PlanStep+oneshotresponder). The agent emits requests on anmpscchannel that the TUI polls each event (poll_approval);begin_approval/submit_approvalmanage the modal lifecycle and reply to the agent.event_handler.rs: while a modal is active it owns all input —y/Yapproves,n/N/Escaborts, any other key is ignored.ui.rs: renders a centered, bordered modal (withClear) showing capability id, risk tier, action description, arguments, and anApprove? [y] / [n/Esc]prompt.app.rs+event_handler.rs.The CLI
sentinel runkeeps its existing stdiny/Napproval path unchanged (per spec).Notes / scope
SshHostExecutoris exercised via theHostExecutormock in tests (a live SSH host can't run in CI). Running thefleetsubcommand here yields isolated per-host failures becausesshisn't installed in the sandbox — which itself demonstrates the error-isolation path.ApprovalRequests is the remaining integration point (the TUI is not yet driven by the live reasoning loop).Testing
cargo build --workspace— cleancargo test --workspace— all passing (policy 60, capabilities 68, fleet 45, tui 38, agent-llm 53 + 6 integration)cargo clippy --workspace --all-targets -- -D warnings— no warningsPlease review; do not merge without sign-off.
https://claude.ai/code/session_01PrvrHsArvuyDmDvn5Cuvri
Generated by Claude Code