Backend integration uses centralized transports and feature-scoped semantic clients. This is an application-client capability, not an activity or web requirement. Web, native, CLI, worker, and local tools may adopt it.
Returns the centralized backend-client capability rules.
Renders the backend-integration capability as text or JSON.
| Transport | Use | Avoid when |
|---|---|---|
| HTTP | Finite commands, queries, snapshots, uploads | Both peers need ongoing messages |
| SSE | Server progress and event streams with browser reconnection | The client must send stream messages |
| WebSocket | Bidirectional or latency-sensitive protocols | Request/response or one-way events are sufficient |
| Polling | Simple infrequent status refresh | Latency or request volume makes it wasteful |
A stream defines protocol version, event identity, ordering, correlation, replay or resume token, heartbeat, backpressure behavior, reconnect/backoff, terminal events, cancellation, and authoritative resynchronization. A queryable snapshot is the recovery authority after missed or invalid events.
Loopback HTTP does not imply trust. Local web applications document origin allowlists, authentication or capability tokens, CSRF posture, port discovery, protocol versions, process ownership, startup readiness, and shutdown behavior. Native IPC may implement the same semantic-client interface without leaking its transport into workflows.
Dev-std validates declared transport, feature, source, and signoff paths. Project lint validates forbidden raw transport construction and dependency direction. Tests exercise normalized failures, cancellation, retries, reconnect, resynchronization, and protocol-version mismatch.
The canonical implementation evidence lives in
docs/templates/web/lit-activity/src/transport/ and the
feature-scoped project client. It demonstrates a replaceable demo/HTTP
transport boundary without allowing activities or views to construct raw
network requests. Clean-copy validation and maintainer commands are
documented in Build Documentation.