1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//! # Streaming Process Evidence
//!
//! Typed shapes for streaming event log evidence — online process monitoring.
//! A streaming evidence surface carries the same type law as batch evidence
//! but with an additional streaming-context marker.
//!
//! ## What this module IS
//!
//! - Structure-only typed markers for online vs. offline evidence collection.
//! - Zero-cost context tags that prevent an online monitoring window from being
//! silently substituted for an offline analysis log at the type level.
//! - A companion to [`crate::evidence`]: streaming context is orthogonal to the
//! `Raw → Admitted` lifecycle.
//!
//! ## What this module is NOT
//!
//! - **Not** a streaming runtime. No event ingestion, no window management, no
//! sliding-window logic. Those concerns graduate to `wasm4pm`.
//! - **Not** a replacement for [`crate::evidence::Evidence`]. Use
//! `ContextualEvidence<T, Context>` to add a collection-context tag to an
//! evidence value; the lifecycle law is unchanged.
//!
//! ## Graduation
//!
//! When you need to actually ingest events from a stream, manage windows, or
//! perform online conformance checking, graduate to `wasm4pm`. The context
//! markers here travel with the evidence into the engine.
use PhantomData;
/// Marker that this evidence is produced by a streaming source with a fixed
/// window size.
///
/// `WINDOW_SIZE` is a compile-time constant naming the maximum number of events
/// in a single evidence window. It is a structural constraint only — no buffer
/// is allocated here. Graduate to `wasm4pm` when windowed ingestion must run.
///
/// This is structure only. See [`crate::streaming`]. Graduate to `wasm4pm`
/// when streaming ingestion must be executed.
;
/// A streaming event evidence window of fixed size.
///
/// `SIZE` is a compile-time constant bounding the window. `T` is the element
/// type (e.g., an event shape). This is a structure-only envelope — no
/// elements are stored at this layer.
///
/// This is structure only. See [`crate::streaming`]. Graduate to `wasm4pm`
/// when window contents must be consumed by an online monitor.
/// Online monitoring context — evidence produced in real-time from a live event
/// stream.
///
/// Use as the `Context` type parameter of [`ContextualEvidence`] when the
/// evidence was collected during active process execution.
///
/// This is structure only. See [`crate::streaming`]. Graduate to `wasm4pm`
/// when online monitoring logic must execute.
;
/// Offline analysis context — evidence collected from a complete, static event
/// log.
///
/// Use as the `Context` type parameter of [`ContextualEvidence`] when the
/// evidence was collected from a finished log rather than a live stream.
///
/// This is structure only. See [`crate::streaming`]. Graduate to `wasm4pm`
/// when offline replay or conformance checking must execute.
;
/// Evidence tagged with its collection context.
///
/// `Context` is one of [`OnlineMonitoringContext`] or [`OfflineAnalysisContext`]
/// (or a custom context type). The tag is zero-cost — `PhantomData` only.
///
/// An `ContextualEvidence<T, OnlineMonitoringContext>` is a different type from
/// `ContextualEvidence<T, OfflineAnalysisContext>`, so a function that demands
/// offline evidence cannot accidentally receive an online window.
///
/// ## Type aliases
///
/// See [`OnlineEvidence`] and [`OfflineEvidence`] for the common case.
///
/// This is structure only. See [`crate::streaming`]. Graduate to `wasm4pm`
/// when context-dependent processing must execute.
/// Type alias for evidence collected in an online (live-stream) context.
///
/// Equivalent to `ContextualEvidence<T, OnlineMonitoringContext>`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::streaming::{OnlineEvidence, ContextualEvidence};
///
/// let ev: OnlineEvidence<u32> = ContextualEvidence::online(7u32);
/// assert_eq!(ev.inner, 7);
/// ```
pub type OnlineEvidence<T> = ;
/// Type alias for evidence collected in an offline (complete-log) context.
///
/// Equivalent to `ContextualEvidence<T, OfflineAnalysisContext>`.
///
/// # Examples
///
/// ```ignore
/// use wasm4pm_compat::streaming::{OfflineEvidence, ContextualEvidence};
///
/// let ev: OfflineEvidence<u32> = ContextualEvidence::offline(7u32);
/// assert_eq!(ev.inner, 7);
/// ```
pub type OfflineEvidence<T> = ;