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
// Reference witness: the pm4py filter×artifact compatibility matrix
// (check_filter_shape), COVERAGE.md §2 — interop filter law.
//
// Law: an ObjectType filter is only valid over an object-centric artifact; every
// other filter dimension is valid over any artifact. A mismatch (ObjectType over
// a flat artifact) is refused as DimensionShapeMismatch. This witnesses the full
// matrix — all four "always-valid" filters admit on a flat log, ObjectType admits
// only on object-centric, and the flat×ObjectType cell is refused.
use wasm4pm_compat::interop::{check_filter_shape, FilterShape, InteropRefusal, Pm4pyShape};
#[test]
fn non_object_type_filters_are_valid_on_any_artifact() {
for filter in [
FilterShape::Activity,
FilterShape::Timeframe,
FilterShape::Variant,
FilterShape::Attribute,
] {
assert_eq!(
check_filter_shape(Pm4pyShape::EventLog, filter),
Ok(()),
"{filter:?} is valid over a flat event log"
);
assert_eq!(
check_filter_shape(Pm4pyShape::ObjectCentricLog, filter),
Ok(()),
"{filter:?} is valid over an object-centric log too"
);
}
}
#[test]
fn object_type_filter_requires_object_centric_artifact() {
// Valid: ObjectType over an object-centric log.
assert_eq!(
check_filter_shape(Pm4pyShape::ObjectCentricLog, FilterShape::ObjectType),
Ok(()),
"ObjectType filter admits on an object-centric log"
);
// Refused: ObjectType over a flat artifact → DimensionShapeMismatch.
for flat in [
Pm4pyShape::EventLog,
Pm4pyShape::PetriNet,
Pm4pyShape::Bpmn,
Pm4pyShape::ProcessTree,
] {
assert_eq!(
check_filter_shape(flat, FilterShape::ObjectType),
Err(InteropRefusal::DimensionShapeMismatch),
"ObjectType filter over flat {flat:?} is a dimension mismatch"
);
}
}