Context
In flowscript-ldp v0.2.1, we have a working Mode 3 session flow but the lifecycle is mostly stubbed. Here's where we are:
FlowScriptMode3Delegate subclasses LdpDelegate and overrides _handle_session_propose() to negotiate Mode 3 when the initiator supports SEMANTIC_GRAPH
- Fallback happens at the message level: encode payload, validate, if invalid degrade via
FallbackChain (Mode 3 → Mode 1 → Mode 0), retry at lower mode
- No formal session state machine yet. The delegate handles individual tasks statelessly.
Questions for co-design
1. Mode renegotiation triggers. When a Mode 3 payload fails validation mid-session, should fallback be per-message (current behavior, retry this message at a lower mode) or should it trigger session-level renegotiation? Per-message is simpler and more resilient, but the session layer has no visibility into degradation patterns.
2. Adaptive degradation. Should the session track "last successful mode" so that after N failures at Mode 3, it automatically proposes renegotiation to Mode 1? This feels like it belongs in ldp-protocol rather than individual implementations, since the pattern is mode-agnostic.
3. Session resumption. If connection drops mid-Mode-3-exchange, what state does the session resume to? Options as I see them:
- Re-negotiate from scratch (safe, simple)
- Resume at last-negotiated mode (efficient, requires session persistence)
- Resume at last-successful mode (adaptive, more complex)
4. Lifecycle events. The current LdpDelegate has _handle_session_propose(). Are there plans for additional lifecycle hooks like on_session_start, on_mode_change, on_session_end? These would let implementations react to state transitions without overriding core protocol logic.
What we have to build on
The _handle_session_propose override in our delegate is ~30 lines and handles the happy path well. Happy to share the full session flow as a starting point, or iterate on whatever direction you think the spec should go.
Context
In flowscript-ldp v0.2.1, we have a working Mode 3 session flow but the lifecycle is mostly stubbed. Here's where we are:
FlowScriptMode3DelegatesubclassesLdpDelegateand overrides_handle_session_propose()to negotiate Mode 3 when the initiator supportsSEMANTIC_GRAPHFallbackChain(Mode 3 → Mode 1 → Mode 0), retry at lower modeQuestions for co-design
1. Mode renegotiation triggers. When a Mode 3 payload fails validation mid-session, should fallback be per-message (current behavior, retry this message at a lower mode) or should it trigger session-level renegotiation? Per-message is simpler and more resilient, but the session layer has no visibility into degradation patterns.
2. Adaptive degradation. Should the session track "last successful mode" so that after N failures at Mode 3, it automatically proposes renegotiation to Mode 1? This feels like it belongs in ldp-protocol rather than individual implementations, since the pattern is mode-agnostic.
3. Session resumption. If connection drops mid-Mode-3-exchange, what state does the session resume to? Options as I see them:
4. Lifecycle events. The current
LdpDelegatehas_handle_session_propose(). Are there plans for additional lifecycle hooks likeon_session_start,on_mode_change,on_session_end? These would let implementations react to state transitions without overriding core protocol logic.What we have to build on
The
_handle_session_proposeoverride in our delegate is ~30 lines and handles the happy path well. Happy to share the full session flow as a starting point, or iterate on whatever direction you think the spec should go.