Skip to content

feat(rds-agent): unified role/service policy, agent settings file, timeout policy (W2.1) - #45

Merged
rldyourmnd merged 2 commits into
mainfrom
w2-1-agent-policy-settings
Sep 27, 2026
Merged

rldyourmnd merged 2 commits into
mainfrom
w2-1-agent-policy-settings

Conversation

@rldyourmnd

Copy link
Copy Markdown
Contributor

Summary

W2.1 closure — the agent's policy surface moves from implicit flag-soup to a unified, versioned settings model.

  • Service gate: AgentPolicy.services — explicit gateable set (tcp/desktop/sync) over the always-on ping/info control plane. Disabled services are refused by name in serve_stream before grant machinery runs; Info and directory announcements advertise exactly the effective set.
  • AgentSettings v1 JSON (--agent-config): role xor explicit services, disabled_services, peers, authority, limits, timeouts. Strict parsing (16 KiB, deny_unknown_fields), validation before identity creation/binding, file-then-flag precedence mirroring EndpointSettings. New flags: --role, repeatable --service/--no-service, --handshake-timeout, --hello-timeout.
  • TimeoutPolicy: handshake/hello deadlines are validated policy fields (1s..=1h), not hard-coded constants.

Docs: new agent-configuration.md + examples/agent-access.json; capability matrix, endpoint/deployment docs, README and remediation ledger updated.

Test plan

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo clippy --workspace --all-targets --features rds-desktop/x11 -- -D warnings
  • cargo test --workspace — 0 failures
  • cargo deny check — not installed locally; covered by CI supply-chain lane

Generated with Devin

Comment thread crates/rds-agent/tests/service_policy.rs Fixed
@rldyourmnd
rldyourmnd force-pushed the w2-1-agent-policy-settings branch from 94b5026 to fc4948b Compare September 27, 2026 04:24
…licy

Add a deployment-level service gate to AgentPolicy: an explicit gateable
set (tcp/desktop/sync) on top of the always-on ping/info control plane,
refused by name in serve_stream before grant machinery runs. Info and
directory announcements now advertise exactly the effective set.

Replace the hard-coded handshake/hello constants with a validated
TimeoutPolicy (1s..=1h) and validate the whole policy before the agent
accepts connections.

Add crates/rds-agent/src/settings.rs: a versioned (schema_version 1)
AgentSettings JSON document — role xor explicit services, disabled
services, peers, authority, limits, timeouts — with strict parsing
(16 KiB bound, deny_unknown_fields), preflight validation before any
identity/binding side effects, and EndpointSettings-style file-then-flag
precedence. Wire --agent-config/--role/--service/--no-service and the
timeout flags through main.rs, converting defaulted options to Option so
file values survive when flags are absent.

Tests: settings units (parse/validate/roles/precedence), binary preflight
(invalid config fails before key creation and bind), and an e2e
service-policy suite covering refusal, Info honesty, and DesktopV2.
Add docs/agent-configuration.md covering the v1 settings schema — roles,
explicit/disabled services, peers, authority, limits, timeouts — with
bounds, file/flag precedence and examples, plus examples/agent-access.json.

Update the capability matrix (deployment-gated services), endpoint and
deployment docs (cross-references, systemd/config usage), README feature
summary, and mark W2.1 implemented in the remediation ledger with this
wave's entry.
@rldyourmnd
rldyourmnd force-pushed the w2-1-agent-policy-settings branch from fc4948b to affc8ea Compare September 27, 2026 04:25
@rldyourmnd
rldyourmnd merged commit 8957934 into main Sep 27, 2026
23 checks passed
@rldyourmnd
rldyourmnd deleted the w2-1-agent-policy-settings branch September 27, 2026 04:41
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.

2 participants