Preserve provider event identity through the shared WebSocket route #63

Open
opened 2026-10-04 17:46:43 +00:00 by kayg · 0 comments
Owner

Problem and evidence

RuntimeEvent in crates/agent/src/provider_runtime.rs:84-92 omits the provider event summary; watch batches then reconcile the complete inventory through refresh at :680-725. The stream serializer in crates/agent/src/lib.rs:2113-2155 reduces the event to legacy kind/action/actor_id/scope fields. It does not carry the complete generic host/instance/kind/native-resource identity or the provider summary to consumers. A lagged broadcast sends a resync hint.

Recommendation

Preserve bounded generic event identity and change data through the existing shared WebSocket event route, and let the server cache apply deltas while retaining hint-and-relist recovery for gaps. Route web, REST clients, CLI, MCP and future Apple clients through that one event path. Include loss, high-latency and connection-refused cases in the network-fault acceptance tests.

Payoff and estimate

Makes remote state and freshness truthful without polling every host or creating adapter-specific push routes. Estimate: 3–5 engineering days after generic resource DTOs, including bounded event and resync tests.

Priority: Next milestone (PLAN steps 5–6).

2026-10-04 owner decisions: Direct match: the owner chose event-driven server cache and one event route over the WebSocket for every adapter, with failure modes visible and tested. Keep the current bounded/resync behavior.

Report: arch-review report
Source: arch-review 2026-10-04

## Problem and evidence `RuntimeEvent` in `crates/agent/src/provider_runtime.rs:84-92` omits the provider event summary; watch batches then reconcile the complete inventory through `refresh` at `:680-725`. The stream serializer in `crates/agent/src/lib.rs:2113-2155` reduces the event to legacy `kind/action/actor_id/scope` fields. It does not carry the complete generic host/instance/kind/native-resource identity or the provider summary to consumers. A lagged broadcast sends a resync hint. ## Recommendation Preserve bounded generic event identity and change data through the existing shared WebSocket event route, and let the server cache apply deltas while retaining hint-and-relist recovery for gaps. Route web, REST clients, CLI, MCP and future Apple clients through that one event path. Include loss, high-latency and connection-refused cases in the network-fault acceptance tests. ## Payoff and estimate Makes remote state and freshness truthful without polling every host or creating adapter-specific push routes. Estimate: 3–5 engineering days after generic resource DTOs, including bounded event and resync tests. **Priority:** Next milestone (PLAN steps 5–6). **2026-10-04 owner decisions:** Direct match: the owner chose event-driven server cache and one event route over the WebSocket for every adapter, with failure modes visible and tested. Keep the current bounded/resync behavior. **Report:** [arch-review report](/mnt/hdd/infraternal/jobs/arch-review/report.md) **Source: arch-review 2026-10-04**
Commenting is not possible because the repository is archived.
No labels
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
kayg/infraternal-v0#63
No description provided.