mustflow 2.116.0 → 2.116.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/source-anchors.js +11 -0
- package/package.json +1 -1
- package/templates/default/i18n.toml +72 -6
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +37 -11
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/SKILL.md +477 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-diagnostics-abi-linker-checklist.md +778 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-generators-properties-checklist.md +501 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-test-strategy-differential-checklist.md +498 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/debug-symbol-symbolication-checklist.md +412 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/ir-design-ssa-pass-pipeline-checklist.md +759 -0
- package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/miscompile-reduction-ir-checklist.md +434 -0
- package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/SKILL.md +55 -36
- package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/references/path-containment-handle-checklist.md +251 -0
- package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/SKILL.md +133 -32
- package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/references/file-upload-parser-ssrf-resource-checklist.md +306 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/SKILL.md +310 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-concurrency-model-checking-smt-checklist.md +457 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-contracts-modeling-checklist.md +434 -0
- package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-memory-bounds-ci-checklist.md +509 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/SKILL.md +439 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-harness-campaign-checklist.md +379 -0
- package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-oracle-triage-ci-checklist.md +307 -0
- package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +48 -28
- package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/references/operation-ordering-stale-write-checklist.md +259 -0
- package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/SKILL.md +329 -0
- package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/references/input-boundary-security-checklist.md +319 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/SKILL.md +306 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/input-session-state-checklist.md +298 -0
- package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/remote-input-transport-interaction-checklist.md +328 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/SKILL.md +353 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-diagnostics-recovery-checklist.md +267 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-execution-closure-performance-checklist.md +428 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-gc-verification-checklist.md +457 -0
- package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-semantics-runtime-checklist.md +391 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/SKILL.md +294 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/modal-loop-reentrancy-checklist.md +290 -0
- package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/nested-modal-state-lifetime-checklist.md +297 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/SKILL.md +252 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/dns-network-resolution-checklist.md +394 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/language-symbol-resolution-checklist.md +282 -0
- package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/module-package-loader-resolution-checklist.md +352 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/SKILL.md +103 -17
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/cst-ast-lowering-checklist.md +260 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/lexer-tokenization-checklist.md +397 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-serialization-compatibility-checklist.md +164 -0
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-traversal-rewrite-checklist.md +209 -0
- package/templates/default/locales/en/.mustflow/skills/race-condition-review/SKILL.md +68 -11
- package/templates/default/locales/en/.mustflow/skills/race-condition-review/references/race-reproduction-memory-model-checklist.md +268 -0
- package/templates/default/locales/en/.mustflow/skills/routes.toml +151 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/SKILL.md +343 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-auth-stream-resume-checklist.md +413 -0
- package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-handoff-protocol-checklist.md +485 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/SKILL.md +267 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/admission-decision-recovery-checklist.md +308 -0
- package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/two-phase-transition-checklist.md +229 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/SKILL.md +300 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-affinity-event-loop-checklist.md +277 -0
- package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-dispatch-lifecycle-checklist.md +292 -0
- package/templates/default/manifest.toml +115 -1
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
# Session Authorization and Stream Resume Checklist
|
|
2
|
+
|
|
3
|
+
Use this checklist when session handoff crosses multiple state stores, transfers authorization or
|
|
4
|
+
credential state, or resumes a bidirectional or media stream. Record protocol fields and evidence;
|
|
5
|
+
do not infer correctness from copied objects, transport continuity, token signature, or sticky
|
|
6
|
+
routing alone.
|
|
7
|
+
|
|
8
|
+
## Contents
|
|
9
|
+
|
|
10
|
+
1. [Authority envelope](#authority-envelope)
|
|
11
|
+
2. [Consistent state boundary](#consistent-state-boundary)
|
|
12
|
+
3. [Hidden state, expiry, and deletion](#hidden-state-expiry-and-deletion)
|
|
13
|
+
4. [Cursor and acknowledgment semantics](#cursor-and-acknowledgment-semantics)
|
|
14
|
+
5. [Schema and feature compatibility](#schema-and-feature-compatibility)
|
|
15
|
+
6. [Handoff and resume credentials](#handoff-and-resume-credentials)
|
|
16
|
+
7. [Authorization freshness and delegation](#authorization-freshness-and-delegation)
|
|
17
|
+
8. [Credential ownership and revocation](#credential-ownership-and-revocation)
|
|
18
|
+
9. [Router and partition behavior](#router-and-partition-behavior)
|
|
19
|
+
10. [Connection ownership](#connection-ownership)
|
|
20
|
+
11. [Bidirectional replay and resume](#bidirectional-replay-and-resume)
|
|
21
|
+
12. [Make-before-break and drain](#make-before-break-and-drain)
|
|
22
|
+
13. [Message, compression, and media boundaries](#message-compression-and-media-boundaries)
|
|
23
|
+
14. [Early-data replay](#early-data-replay)
|
|
24
|
+
15. [Failure matrix](#failure-matrix)
|
|
25
|
+
16. [Invariants](#invariants)
|
|
26
|
+
17. [Skill handoffs](#skill-handoffs)
|
|
27
|
+
|
|
28
|
+
## Authority envelope
|
|
29
|
+
|
|
30
|
+
Keep these concepts separate even when the storage schema uses different names:
|
|
31
|
+
|
|
32
|
+
| Concept | Meaning |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Logical session | User-visible continuity boundary. |
|
|
35
|
+
| Owner instance | One process boot or runtime incarnation, not a reusable hostname. |
|
|
36
|
+
| Owner epoch | Monotonic generation accepted by authoritative sinks. |
|
|
37
|
+
| Handoff attempt | One logical cutover decision and its retries. |
|
|
38
|
+
| Protocol phase | Current legal transition state. |
|
|
39
|
+
| Snapshot revision | Source fact boundary represented by the snapshot. |
|
|
40
|
+
| Input cursor | Durable application position for incoming commands. |
|
|
41
|
+
| Directional ACK | Peer-confirmed application position for one direction. |
|
|
42
|
+
| Authorization grant | Current authority being delegated or exchanged. |
|
|
43
|
+
| Policy revision | Policy version used for target activation. |
|
|
44
|
+
| Lease identity | Coordination liveness record, not the fencing authority itself. |
|
|
45
|
+
| Connection generation | One transport attachment to the logical session. |
|
|
46
|
+
|
|
47
|
+
Do not reuse a pod name, worker label, IP address, socket identity, cookie, or connection ID as the
|
|
48
|
+
owner instance identity. Generate a distinct runtime-incarnation identity and bind it to the session
|
|
49
|
+
epoch through the authoritative record.
|
|
50
|
+
|
|
51
|
+
## Consistent state boundary
|
|
52
|
+
|
|
53
|
+
One-store state should bind snapshot and replay through one source revision. Multi-store state needs
|
|
54
|
+
either one transactional source of truth or a cursor vector with an explicit activation predicate.
|
|
55
|
+
|
|
56
|
+
Example evidence shape:
|
|
57
|
+
|
|
58
|
+
| Store or domain | Snapshot or read point | Applied through | Next expected | Validation |
|
|
59
|
+
| --- | --- | --- | --- | --- |
|
|
60
|
+
| Session facts | source revision | inclusive cursor | next cursor | canonical state hash |
|
|
61
|
+
| Authorization | grant and policy revision | latest evaluated revision | refresh rule | active grant check |
|
|
62
|
+
| Command inbox | admitted sequence | last terminal command | next admitted command | gap and duplicate scan |
|
|
63
|
+
| Output log | durable server sequence | peer application ACK | first replay sequence | replay-window check |
|
|
64
|
+
| Artifact manifest | immutable manifest ID | all required chunks | none | schema and hash check |
|
|
65
|
+
|
|
66
|
+
Name range semantics. `offset=100` is ambiguous; fields equivalent to `applied_through=100` and
|
|
67
|
+
`next_expected=101` are not. Verify inclusivity at empty, first-item, cutoff, duplicate, gap, and
|
|
68
|
+
resume-window boundaries.
|
|
69
|
+
|
|
70
|
+
When no global revision exists:
|
|
71
|
+
|
|
72
|
+
- capture each store's authoritative cursor;
|
|
73
|
+
- bind the cursor vector to one handoff attempt;
|
|
74
|
+
- keep one writer during catch-up;
|
|
75
|
+
- define which cross-store invariants the target must validate;
|
|
76
|
+
- reject activation when any component is stale, missing, or from another attempt;
|
|
77
|
+
- do not use wall-clock proximity as consistency proof.
|
|
78
|
+
|
|
79
|
+
Couple input position, state mutation, and output intent transactionally where one authority can own
|
|
80
|
+
them. Otherwise use durable inbox, outbox, effect receipts, and a recovery rule that prevents the
|
|
81
|
+
cursor from advancing beyond uncommitted state or lagging behind an already committed effect.
|
|
82
|
+
|
|
83
|
+
## Hidden state, expiry, and deletion
|
|
84
|
+
|
|
85
|
+
Inventory future-behavior state that ordinary DTOs often omit:
|
|
86
|
+
|
|
87
|
+
- timer intent and next eligible time;
|
|
88
|
+
- retry attempt, delay, and absolute deadline;
|
|
89
|
+
- rate-limit and concurrency budget;
|
|
90
|
+
- pending callback, subscription, and filter state;
|
|
91
|
+
- unconfirmed provider intent or external effect;
|
|
92
|
+
- random seed or deterministic generation position;
|
|
93
|
+
- heartbeat interpretation and liveness decision;
|
|
94
|
+
- application credit, batch boundary, and flow-control state;
|
|
95
|
+
- cancellation and approval wait state.
|
|
96
|
+
|
|
97
|
+
Classify each item as:
|
|
98
|
+
|
|
99
|
+
- transfer exactly with versioned evidence;
|
|
100
|
+
- rebuild from a named durable log or authority;
|
|
101
|
+
- discard and recreate under an explicit semantic rule;
|
|
102
|
+
- block handoff because safe reconstruction is impossible.
|
|
103
|
+
|
|
104
|
+
Preserve absolute expiry chosen by the authority. Do not reset a remaining TTL to a new default on
|
|
105
|
+
import. If wall-clock skew can affect behavior, use authority-service time or a stored absolute
|
|
106
|
+
deadline plus an explicitly bounded skew policy.
|
|
107
|
+
|
|
108
|
+
Treat deletion as a versioned event. Preserve tombstone identity and deletion revision longer than
|
|
109
|
+
the maximum stale-replica, cache, reconnect, and handoff window. A missing value without a deletion
|
|
110
|
+
version cannot distinguish never-created, deleted, not-yet-replicated, filtered, or read-failed.
|
|
111
|
+
|
|
112
|
+
## Cursor and acknowledgment semantics
|
|
113
|
+
|
|
114
|
+
Track client-to-server and server-to-client progress independently.
|
|
115
|
+
|
|
116
|
+
| Direction | Producer sequence | Receiver application ACK | Replay start |
|
|
117
|
+
| --- | --- | --- | --- |
|
|
118
|
+
| Client to server | Client command sequence | Server durable application position | First command after ACK |
|
|
119
|
+
| Server to client | Server event or output sequence | Client applied position | First event after ACK |
|
|
120
|
+
|
|
121
|
+
Separate at least:
|
|
122
|
+
|
|
123
|
+
- durable: replayable from authoritative storage;
|
|
124
|
+
- sent: passed to the local transport implementation;
|
|
125
|
+
- transport observed: optional delivery hint only;
|
|
126
|
+
- application acknowledged: peer states that the item reached the protocol's meaningful apply point.
|
|
127
|
+
|
|
128
|
+
Do not delete replay state at `sent`. Do not interpret socket write success, transport ACK, ping or
|
|
129
|
+
pong, stream flush, queue acceptance, or gateway forwarding as application acknowledgment.
|
|
130
|
+
|
|
131
|
+
For command responses, persist `command identity -> terminal result or status reference` before
|
|
132
|
+
success becomes externally visible. A retry after response loss must replay the stored result or
|
|
133
|
+
query the external effect, not execute the command as new work.
|
|
134
|
+
|
|
135
|
+
Scope durable dedupe to the logical tenant and session, operation type, target resource where
|
|
136
|
+
needed, and stable client command identity. Preserve it across owners and connection generations for
|
|
137
|
+
the maximum permitted offline, retry, replay, and handoff window.
|
|
138
|
+
|
|
139
|
+
Replay within one ordering domain must remain serial unless commutativity or independence is proven.
|
|
140
|
+
Parallel replay by arrival batch can reverse causally dependent commands even when every item has a
|
|
141
|
+
valid cursor.
|
|
142
|
+
|
|
143
|
+
## Schema and feature compatibility
|
|
144
|
+
|
|
145
|
+
Include enough envelope metadata to reject silent reinterpretation:
|
|
146
|
+
|
|
147
|
+
- schema version;
|
|
148
|
+
- writer runtime or protocol version;
|
|
149
|
+
- required feature set;
|
|
150
|
+
- units and precision for time and numeric values;
|
|
151
|
+
- enum and discriminator namespace;
|
|
152
|
+
- null, missing, empty, and tombstone semantics;
|
|
153
|
+
- cursor and range inclusivity;
|
|
154
|
+
- compression, media, or artifact format where applicable;
|
|
155
|
+
- migration identity and resulting canonical hash.
|
|
156
|
+
|
|
157
|
+
Test every supported source-target version pair in both directions that rolling deployment,
|
|
158
|
+
rollback, failover, or regional skew can produce. Do not assume API compatibility means persisted
|
|
159
|
+
session compatibility.
|
|
160
|
+
|
|
161
|
+
Reject activation when a required feature is unknown. Silently dropping a field, mapping an unknown
|
|
162
|
+
enum to a default, resetting a deadline, or narrowing an integer can create valid-looking but
|
|
163
|
+
semantically corrupted state.
|
|
164
|
+
|
|
165
|
+
## Handoff and resume credentials
|
|
166
|
+
|
|
167
|
+
Keep ordinary API credentials separate from handoff or resume authority. A handoff credential
|
|
168
|
+
should be usable only to accept or resume the named session transfer and should bind:
|
|
169
|
+
|
|
170
|
+
- issuer and explicit credential type;
|
|
171
|
+
- opaque session identity;
|
|
172
|
+
- source and target owner or audience;
|
|
173
|
+
- owner epoch and handoff attempt;
|
|
174
|
+
- connection generation when relevant;
|
|
175
|
+
- directional application ACK positions when resuming;
|
|
176
|
+
- nonce and one-time consumption record;
|
|
177
|
+
- short absolute expiry;
|
|
178
|
+
- permitted handoff or resume action only.
|
|
179
|
+
|
|
180
|
+
Store a hash or authoritative consumption record and consume the credential atomically with target
|
|
181
|
+
attachment or connection-generation registration. Reject wrong target, wrong epoch, expired,
|
|
182
|
+
replayed, downgraded, or already-consumed credentials.
|
|
183
|
+
|
|
184
|
+
Do not copy a source bearer credential or private key into the target. Exchange a credential
|
|
185
|
+
reference or delegated subject token for target-audience, least-privilege, preferably sender-bound
|
|
186
|
+
authority. Bind the new authority to the target's own key when the platform supports proof of
|
|
187
|
+
possession.
|
|
188
|
+
|
|
189
|
+
## Authorization freshness and delegation
|
|
190
|
+
|
|
191
|
+
Compute target authority from the intersection of:
|
|
192
|
+
|
|
193
|
+
- the currently active user or service grant;
|
|
194
|
+
- current tenant membership and policy;
|
|
195
|
+
- target audience and resource;
|
|
196
|
+
- target runtime capability;
|
|
197
|
+
- declared handoff purpose;
|
|
198
|
+
- still-valid approval or step-up evidence;
|
|
199
|
+
- restrictions attached by the source or control plane.
|
|
200
|
+
|
|
201
|
+
Do not union source scope with target defaults. Do not treat a copied authorization snapshot as
|
|
202
|
+
current when role, membership, device posture, grant state, or policy may change during transfer.
|
|
203
|
+
Re-evaluate immediately before target acceptance or activation and bind the evaluated grant and
|
|
204
|
+
policy revisions to the decision.
|
|
205
|
+
|
|
206
|
+
Keep these actors distinct in audit and downstream authorization:
|
|
207
|
+
|
|
208
|
+
- user or workload subject;
|
|
209
|
+
- source service actor;
|
|
210
|
+
- target service actor;
|
|
211
|
+
- intermediary or gateway actors;
|
|
212
|
+
- delegation chain and handoff purpose.
|
|
213
|
+
|
|
214
|
+
Handoff does not create new authentication. Preserve original authentication time, authentication
|
|
215
|
+
method, and assurance level. If the target needs stronger or fresher authentication, request step-up
|
|
216
|
+
instead of rewriting authentication metadata.
|
|
217
|
+
|
|
218
|
+
Validate every credential for its declared type, issuer, target audience, authorized party or client,
|
|
219
|
+
subject, tenant, validity window, algorithm policy, and purpose. Signature validity alone does not
|
|
220
|
+
prove that the credential belongs to this protocol or target.
|
|
221
|
+
|
|
222
|
+
## Credential ownership and revocation
|
|
223
|
+
|
|
224
|
+
- Do not let source and target independently hold reusable refresh authority.
|
|
225
|
+
- Rotate or transfer refresh ownership atomically where refresh is necessary.
|
|
226
|
+
- Detect reuse of retired refresh authority and apply the repository's family-revocation policy.
|
|
227
|
+
- Propagate logout, revocation, grant disablement, policy invalidation, and minimum valid epoch to
|
|
228
|
+
source, target, gateways, routers, and effect dispatchers.
|
|
229
|
+
- Make cached authorization decisions versioned and short enough to respect revocation objectives.
|
|
230
|
+
- Put only bounded credential identity metadata in audit logs; redact raw credentials and
|
|
231
|
+
authorization headers from logs, traces, errors, queues, URLs, dumps, and model-visible context.
|
|
232
|
+
|
|
233
|
+
If revocation delivery is delayed, final effect sinks still need an authoritative current-grant or
|
|
234
|
+
minimum-epoch check for actions whose risk cannot tolerate the delay.
|
|
235
|
+
|
|
236
|
+
## Router and partition behavior
|
|
237
|
+
|
|
238
|
+
Routing affinity is an optimization. The authority record remains the source of truth.
|
|
239
|
+
|
|
240
|
+
Routers and gateways should carry or cache:
|
|
241
|
+
|
|
242
|
+
- logical session identity;
|
|
243
|
+
- owner instance and epoch;
|
|
244
|
+
- authority-map revision;
|
|
245
|
+
- connection generation;
|
|
246
|
+
- target audience and protocol mode;
|
|
247
|
+
- bounded cache expiry and refresh trigger.
|
|
248
|
+
|
|
249
|
+
On stale-owner rejection, refresh the authoritative map rather than retrying blindly against the
|
|
250
|
+
same owner. Never let a client-selected backend address, sticky cookie, consistent-hash result, DNS
|
|
251
|
+
cache, or long-lived connection outrank the owner epoch.
|
|
252
|
+
|
|
253
|
+
Under partition, a side without authority quorum or a current fence cannot continue writes merely
|
|
254
|
+
to preserve availability. It must reject, redirect, buffer only under an explicitly safe durable
|
|
255
|
+
admission contract, or become read-only. "Both sides stay writable with no conflict" is not a
|
|
256
|
+
reachable guarantee for exclusive session ownership.
|
|
257
|
+
|
|
258
|
+
## Connection ownership
|
|
259
|
+
|
|
260
|
+
A transport connection and a logical session are different lifecycles.
|
|
261
|
+
|
|
262
|
+
- A stable edge or gateway may retain the client connection and switch the backend logical stream.
|
|
263
|
+
- If the edge changes or the transport dies, use reconnect plus application-level resume.
|
|
264
|
+
- Do not promise arbitrary backend socket migration unless the actual platform contract provides it
|
|
265
|
+
and the full application state still has an explicit transfer protocol.
|
|
266
|
+
- Keep connection generation separate from owner epoch: multiple connections may overlap while one
|
|
267
|
+
epoch alone owns writes.
|
|
268
|
+
|
|
269
|
+
Transfer logical state, not kernel or library buffers:
|
|
270
|
+
|
|
271
|
+
- subscriptions and per-channel cursors;
|
|
272
|
+
- flow-control credit and batch boundary;
|
|
273
|
+
- unacknowledged command and event identities;
|
|
274
|
+
- last accepted and applied directional sequences;
|
|
275
|
+
- negotiated application features;
|
|
276
|
+
- resume and replay deadline;
|
|
277
|
+
- connection-specific cancellation and close state.
|
|
278
|
+
|
|
279
|
+
## Bidirectional replay and resume
|
|
280
|
+
|
|
281
|
+
Define a bounded replay log per session or ordering domain. For each direction, record:
|
|
282
|
+
|
|
283
|
+
- sequence space and wrap policy;
|
|
284
|
+
- durable start and end;
|
|
285
|
+
- peer application ACK;
|
|
286
|
+
- replay start rule;
|
|
287
|
+
- gap and duplicate behavior;
|
|
288
|
+
- retention and storage pressure policy;
|
|
289
|
+
- full-resynchronization trigger;
|
|
290
|
+
- connection generation and owner epoch.
|
|
291
|
+
|
|
292
|
+
If the requested resume point predates retained history, return an explicit resume-too-old outcome.
|
|
293
|
+
Perform full snapshot or state synchronization and establish new sequence baselines. Do not quietly
|
|
294
|
+
skip missing history or replay from an arbitrary retained point.
|
|
295
|
+
|
|
296
|
+
Treat connection close, mobile backgrounding, gateway restart, route change, and owner handoff as
|
|
297
|
+
the same replay-safety surface. Dedupe and ACK state must survive all of them.
|
|
298
|
+
|
|
299
|
+
## Make-before-break and drain
|
|
300
|
+
|
|
301
|
+
Make-before-break may overlap old and new connections to reduce interruption, but it must not create
|
|
302
|
+
two write authorities.
|
|
303
|
+
|
|
304
|
+
Suggested protocol evidence:
|
|
305
|
+
|
|
306
|
+
1. new connection presents a one-time resume credential;
|
|
307
|
+
2. target validates epoch, handoff, cursor, grant, policy, and capability;
|
|
308
|
+
3. target catches up without executing new authoritative commands;
|
|
309
|
+
4. owner commit or already-committed epoch is confirmed;
|
|
310
|
+
5. source sends a switch barrier with last accepted client sequence and last server sequence;
|
|
311
|
+
6. client or gateway acknowledges the barrier on the new path;
|
|
312
|
+
7. new path becomes the only command-send path;
|
|
313
|
+
8. old path becomes redirect-only and closes after bounded drain.
|
|
314
|
+
|
|
315
|
+
A drain contract should expose, where safe:
|
|
316
|
+
|
|
317
|
+
- final client sequence accepted by the old owner;
|
|
318
|
+
- final server event sequence emitted by the old owner;
|
|
319
|
+
- target or reconnect route;
|
|
320
|
+
- new owner epoch;
|
|
321
|
+
- resume deadline;
|
|
322
|
+
- disposition of in-flight commands;
|
|
323
|
+
- reason and whether full synchronization is required.
|
|
324
|
+
|
|
325
|
+
## Message, compression, and media boundaries
|
|
326
|
+
|
|
327
|
+
Cut over on complete application units. Avoid ownership change in the middle of:
|
|
328
|
+
|
|
329
|
+
- fragmented logical message;
|
|
330
|
+
- compressed message that depends on a prior dictionary;
|
|
331
|
+
- transaction or batch whose atomicity is application-visible;
|
|
332
|
+
- RPC item with an uncommitted effect;
|
|
333
|
+
- file chunk without manifest completion;
|
|
334
|
+
- media frame or segment that depends on earlier codec state.
|
|
335
|
+
|
|
336
|
+
Reset or renegotiate compression context on a new transport unless the complete context is safely
|
|
337
|
+
specified and transferred. Do not copy opaque library compression state as ordinary session data.
|
|
338
|
+
|
|
339
|
+
For audio or video, preserve application-defined presentation and decode timeline, initialization
|
|
340
|
+
data, rendition identity, and a decodable keyframe or independent-segment boundary. Signal an
|
|
341
|
+
explicit discontinuity when seamless continuation cannot be proven. Byte offsets alone are not
|
|
342
|
+
decode boundaries.
|
|
343
|
+
|
|
344
|
+
## Early-data replay
|
|
345
|
+
|
|
346
|
+
Connection resumption optimizations may permit replayable early data. Keep these operations out of
|
|
347
|
+
that phase unless the full path has stable idempotency and anti-replay enforcement:
|
|
348
|
+
|
|
349
|
+
- handoff or resume credential consumption;
|
|
350
|
+
- owner activation or epoch commit;
|
|
351
|
+
- payment, order, message-send, or other irreversible command;
|
|
352
|
+
- refresh or credential rotation;
|
|
353
|
+
- approval consumption;
|
|
354
|
+
- mutation that cannot query or deduplicate its external effect.
|
|
355
|
+
|
|
356
|
+
Read-only operations still need tenant, authorization, and privacy review. A syntactically safe
|
|
357
|
+
request is not necessarily safe to replay if it reveals time-sensitive or one-time state.
|
|
358
|
+
|
|
359
|
+
## Failure matrix
|
|
360
|
+
|
|
361
|
+
| Fault | Required behavior |
|
|
362
|
+
| --- | --- |
|
|
363
|
+
| One store snapshot lags another. | Target rejects cursor vector or catches every store to the bound predicate. |
|
|
364
|
+
| Cursor inclusivity differs. | Boundary fixture detects exactly one duplicate or gap before release. |
|
|
365
|
+
| Tombstone expires during handoff. | Deleted state cannot reappear from stale cache or replica. |
|
|
366
|
+
| Absolute expiry passes during import. | Target does not revive the session with a fresh TTL. |
|
|
367
|
+
| Old and new schema overlap. | Unsupported direction rejects before activation. |
|
|
368
|
+
| Grant revoked after snapshot. | Fresh target evaluation denies activation or the affected action. |
|
|
369
|
+
| Resume credential replayed. | Atomic consumption allows one connection generation only. |
|
|
370
|
+
| Source refresh authority reused. | Rotation or family policy detects and contains reuse. |
|
|
371
|
+
| Router sends traffic to stale owner. | Fence rejects; router refreshes authority revision. |
|
|
372
|
+
| Source pauses through lease expiry. | Resumed source remains unable to produce accepted effects. |
|
|
373
|
+
| New connection catches up before commit. | Target remains shadow and effect-free. |
|
|
374
|
+
| Two connections overlap. | One epoch and switch barrier own command sending. |
|
|
375
|
+
| Replay position is older than retention. | Explicit resume-too-old causes full synchronization. |
|
|
376
|
+
| Transport write succeeds but peer crashes. | Unacknowledged durable output replays. |
|
|
377
|
+
| Application ACK is duplicated or reordered. | Monotonic per-direction ACK rule preserves replay range. |
|
|
378
|
+
| Compression context is missing. | Context resets or reconnect rejects incompatible resume. |
|
|
379
|
+
| Media cutover misses a decode boundary. | Discontinuity or new decodable segment is required. |
|
|
380
|
+
| Early data is replayed. | Irreversible operation is absent or deduplicated by stable authority. |
|
|
381
|
+
|
|
382
|
+
## Invariants
|
|
383
|
+
|
|
384
|
+
- One logical session has at most one accepted write epoch.
|
|
385
|
+
- Every owner instance identity names one runtime incarnation.
|
|
386
|
+
- Every snapshot or cursor vector identifies one coherent activation boundary.
|
|
387
|
+
- State mutation, input position, and output intent cannot acknowledge contradictory progress.
|
|
388
|
+
- Deleted or expired state does not revive during import, cache refill, or reconnect.
|
|
389
|
+
- Target authorization is no broader or staler than the currently valid delegated grant.
|
|
390
|
+
- Handoff and resume credentials are target-bound, short-lived, purpose-limited, and one-time.
|
|
391
|
+
- Source and target do not simultaneously own reusable refresh authority.
|
|
392
|
+
- Client-to-server and server-to-client sequence and application ACK spaces are independent and monotonic.
|
|
393
|
+
- Output is removed from replay only after the protocol's application acknowledgment.
|
|
394
|
+
- A resume point outside retention causes explicit full synchronization.
|
|
395
|
+
- Overlapping connections never imply overlapping write authority.
|
|
396
|
+
- Cutover occurs at complete application and decode boundaries.
|
|
397
|
+
- Replayable early data cannot consume owner, approval, or irreversible-effect authority without a complete anti-replay contract.
|
|
398
|
+
|
|
399
|
+
## Skill handoffs
|
|
400
|
+
|
|
401
|
+
- Use `session-handoff-integrity-review` for the complete owner, state, authorization, and stream
|
|
402
|
+
transition.
|
|
403
|
+
- Use `api-access-control-review` or `security-flow-review` for authorization enforcement and
|
|
404
|
+
credential exposure paths.
|
|
405
|
+
- Use `idempotency-integrity-review` for command, ticket, refresh, and effect replay identities.
|
|
406
|
+
- Use `two-phase-transition-integrity-review` for the atomic owner decision and post-commit recovery.
|
|
407
|
+
- Use `dual-write-consistency` for cursor, state, and publication convergence across commit systems.
|
|
408
|
+
- Use `input-event-synchronization-review` when remote input, focus, capture, or continuous controls
|
|
409
|
+
travel across the session boundary.
|
|
410
|
+
- Use `async-timing-boundary-review` for reconnect deadlines, timeouts, cancellation, and waits.
|
|
411
|
+
- Use `race-condition-review` for owner, router, connection, grant, ACK, and replay interleavings.
|
|
412
|
+
- Use `secret-exposure-response` if raw credentials enter prompts, logs, traces, queues, URLs, or
|
|
413
|
+
artifacts.
|