paper_trail_diff 0.14.0 → 0.16.0

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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +501 -0
  3. data/QUICKSTART.md +21 -4
  4. data/README.md +59 -56
  5. data/docs/architecture.md +32 -11
  6. data/docs/performance.md +125 -391
  7. data/docs/reference.md +470 -117
  8. data/docs/testing.md +83 -7
  9. data/lib/paper_trail_diff/activity_boundary.rb +83 -26
  10. data/lib/paper_trail_diff/activity_child_candidate_loader.rb +2 -1
  11. data/lib/paper_trail_diff/activity_collection_event_applier.rb +33 -1
  12. data/lib/paper_trail_diff/activity_event.rb +41 -10
  13. data/lib/paper_trail_diff/activity_event_route_finder.rb +31 -0
  14. data/lib/paper_trail_diff/activity_event_snapshot_refresher.rb +12 -1
  15. data/lib/paper_trail_diff/activity_history.rb +34 -9
  16. data/lib/paper_trail_diff/activity_range.rb +18 -3
  17. data/lib/paper_trail_diff/activity_root_snapshot_refresher.rb +43 -25
  18. data/lib/paper_trail_diff/activity_snapshot_sequence.rb +76 -37
  19. data/lib/paper_trail_diff/activity_target_candidate_loader.rb +5 -5
  20. data/lib/paper_trail_diff/activity_timeline_builder.rb +272 -111
  21. data/lib/paper_trail_diff/activity_transaction_grouper.rb +2 -1
  22. data/lib/paper_trail_diff/activity_tree_filter.rb +114 -0
  23. data/lib/paper_trail_diff/activity_version_collector.rb +7 -5
  24. data/lib/paper_trail_diff/activity_view.rb +69 -0
  25. data/lib/paper_trail_diff/analysis.rb +37 -6
  26. data/lib/paper_trail_diff/analysis_batch.rb +25 -31
  27. data/lib/paper_trail_diff/approximate_paths.rb +48 -0
  28. data/lib/paper_trail_diff/association_activity_edge.rb +6 -6
  29. data/lib/paper_trail_diff/association_discovery.rb +9 -1
  30. data/lib/paper_trail_diff/association_key.rb +56 -0
  31. data/lib/paper_trail_diff/association_traversal.rb +13 -4
  32. data/lib/paper_trail_diff/batch_boundary_resolver.rb +3 -4
  33. data/lib/paper_trail_diff/batch_preload.rb +53 -0
  34. data/lib/paper_trail_diff/batched_root_analyzer.rb +18 -14
  35. data/lib/paper_trail_diff/batched_root_versions.rb +38 -14
  36. data/lib/paper_trail_diff/branch_snapshot_refresher.rb +19 -16
  37. data/lib/paper_trail_diff/change_row.rb +133 -0
  38. data/lib/paper_trail_diff/collection_comparator.rb +5 -32
  39. data/lib/paper_trail_diff/configuration.rb +35 -12
  40. data/lib/paper_trail_diff/deleted_analysis_batch.rb +23 -19
  41. data/lib/paper_trail_diff/deleted_root_filter.rb +101 -0
  42. data/lib/paper_trail_diff/deprecation.rb +61 -0
  43. data/lib/paper_trail_diff/diagnostics.rb +86 -99
  44. data/lib/paper_trail_diff/endpoint.rb +26 -3
  45. data/lib/paper_trail_diff/errors.rb +3 -1
  46. data/lib/paper_trail_diff/fallback_paths.rb +38 -0
  47. data/lib/paper_trail_diff/historical_association_reifier.rb +2 -4
  48. data/lib/paper_trail_diff/historical_filter.rb +19 -10
  49. data/lib/paper_trail_diff/historical_snapshot_store.rb +57 -67
  50. data/lib/paper_trail_diff/live_endpoint_batch_loader.rb +1 -35
  51. data/lib/paper_trail_diff/nested_comparator.rb +19 -18
  52. data/lib/paper_trail_diff/paper_trail_adapter.rb +198 -166
  53. data/lib/paper_trail_diff/preloaded_endpoint_batch_loader.rb +13 -1
  54. data/lib/paper_trail_diff/prepared_activity_index.rb +17 -13
  55. data/lib/paper_trail_diff/prepared_edge_loader.rb +2 -1
  56. data/lib/paper_trail_diff/prepared_history.rb +15 -1
  57. data/lib/paper_trail_diff/prepared_history_loader.rb +2 -3
  58. data/lib/paper_trail_diff/prepared_record_index.rb +42 -7
  59. data/lib/paper_trail_diff/read_snapshot.rb +77 -0
  60. data/lib/paper_trail_diff/root_version_selection.rb +4 -2
  61. data/lib/paper_trail_diff/scope_condition.rb +157 -32
  62. data/lib/paper_trail_diff/scope_ranking.rb +23 -14
  63. data/lib/paper_trail_diff/scoped_analysis.rb +11 -0
  64. data/lib/paper_trail_diff/scoped_analysis_builder.rb +29 -11
  65. data/lib/paper_trail_diff/scoped_root_selection.rb +29 -16
  66. data/lib/paper_trail_diff/snapshot.rb +16 -1
  67. data/lib/paper_trail_diff/support.rb +29 -2
  68. data/lib/paper_trail_diff/time_range.rb +39 -16
  69. data/lib/paper_trail_diff/timeline_builder.rb +13 -7
  70. data/lib/paper_trail_diff/timeline_range.rb +9 -1
  71. data/lib/paper_trail_diff/timeline_snapshot_provider.rb +24 -17
  72. data/lib/paper_trail_diff/transaction_cut.rb +240 -0
  73. data/lib/paper_trail_diff/traversal_preparer.rb +134 -29
  74. data/lib/paper_trail_diff/version.rb +1 -1
  75. data/lib/paper_trail_diff/version_boundary.rb +41 -10
  76. data/lib/paper_trail_diff/version_query.rb +34 -10
  77. data/lib/paper_trail_diff/version_scope_filter.rb +9 -10
  78. data/lib/paper_trail_diff/version_sequence_diagnostics.rb +35 -17
  79. data/lib/paper_trail_diff/version_table.rb +60 -0
  80. data/lib/paper_trail_diff.rb +101 -57
  81. data/sig/generated/paper_trail_diff/activity_boundary.rbs +54 -19
  82. data/sig/generated/paper_trail_diff/activity_collection_event_applier.rbs +13 -0
  83. data/sig/generated/paper_trail_diff/activity_event.rbs +25 -4
  84. data/sig/generated/paper_trail_diff/activity_event_route_finder.rbs +14 -0
  85. data/sig/generated/paper_trail_diff/activity_event_snapshot_refresher.rbs +6 -0
  86. data/sig/generated/paper_trail_diff/activity_history.rbs +21 -6
  87. data/sig/generated/paper_trail_diff/activity_range.rbs +9 -2
  88. data/sig/generated/paper_trail_diff/activity_root_snapshot_refresher.rbs +21 -10
  89. data/sig/generated/paper_trail_diff/activity_snapshot_sequence.rbs +48 -9
  90. data/sig/generated/paper_trail_diff/activity_timeline_builder.rbs +138 -30
  91. data/sig/generated/paper_trail_diff/activity_tree_filter.rbs +73 -0
  92. data/sig/generated/paper_trail_diff/activity_version_collector.rbs +2 -0
  93. data/sig/generated/paper_trail_diff/activity_view.rbs +42 -0
  94. data/sig/generated/paper_trail_diff/analysis.rbs +24 -5
  95. data/sig/generated/paper_trail_diff/analysis_batch.rbs +8 -15
  96. data/sig/generated/paper_trail_diff/approximate_paths.rbs +23 -0
  97. data/sig/generated/paper_trail_diff/association_discovery.rbs +5 -0
  98. data/sig/generated/paper_trail_diff/association_key.rbs +29 -0
  99. data/sig/generated/paper_trail_diff/association_traversal.rbs +4 -0
  100. data/sig/generated/paper_trail_diff/batch_preload.rbs +29 -0
  101. data/sig/generated/paper_trail_diff/batched_root_analyzer.rbs +13 -10
  102. data/sig/generated/paper_trail_diff/batched_root_versions.rbs +14 -4
  103. data/sig/generated/paper_trail_diff/branch_snapshot_refresher.rbs +6 -0
  104. data/sig/generated/paper_trail_diff/change_row.rbs +86 -0
  105. data/sig/generated/paper_trail_diff/collection_comparator.rbs +2 -16
  106. data/sig/generated/paper_trail_diff/configuration.rbs +19 -3
  107. data/sig/generated/paper_trail_diff/deleted_analysis_batch.rbs +11 -8
  108. data/sig/generated/paper_trail_diff/deleted_root_filter.rbs +56 -0
  109. data/sig/generated/paper_trail_diff/deprecation.rbs +35 -0
  110. data/sig/generated/paper_trail_diff/diagnostics.rbs +37 -30
  111. data/sig/generated/paper_trail_diff/endpoint.rbs +11 -2
  112. data/sig/generated/paper_trail_diff/errors.rbs +3 -1
  113. data/sig/generated/paper_trail_diff/fallback_paths.rbs +22 -0
  114. data/sig/generated/paper_trail_diff/historical_filter.rbs +12 -2
  115. data/sig/generated/paper_trail_diff/historical_snapshot_store.rbs +33 -28
  116. data/sig/generated/paper_trail_diff/live_endpoint_batch_loader.rbs +0 -15
  117. data/sig/generated/paper_trail_diff/nested_comparator.rbs +10 -7
  118. data/sig/generated/paper_trail_diff/paper_trail_adapter.rbs +64 -52
  119. data/sig/generated/paper_trail_diff/preloaded_endpoint_batch_loader.rbs +9 -1
  120. data/sig/generated/paper_trail_diff/prepared_activity_index.rbs +11 -4
  121. data/sig/generated/paper_trail_diff/prepared_history.rbs +10 -0
  122. data/sig/generated/paper_trail_diff/prepared_record_index.rbs +20 -2
  123. data/sig/generated/paper_trail_diff/read_snapshot.rbs +43 -0
  124. data/sig/generated/paper_trail_diff/root_version_selection.rbs +2 -0
  125. data/sig/generated/paper_trail_diff/scope_condition.rbs +81 -15
  126. data/sig/generated/paper_trail_diff/scope_ranking.rbs +14 -6
  127. data/sig/generated/paper_trail_diff/scoped_analysis.rbs +6 -0
  128. data/sig/generated/paper_trail_diff/scoped_analysis_builder.rbs +14 -2
  129. data/sig/generated/paper_trail_diff/scoped_root_selection.rbs +16 -7
  130. data/sig/generated/paper_trail_diff/snapshot.rbs +8 -0
  131. data/sig/generated/paper_trail_diff/support.rbs +15 -0
  132. data/sig/generated/paper_trail_diff/time_range.rbs +24 -9
  133. data/sig/generated/paper_trail_diff/timeline_builder.rbs +6 -2
  134. data/sig/generated/paper_trail_diff/timeline_range.rbs +2 -0
  135. data/sig/generated/paper_trail_diff/timeline_snapshot_provider.rbs +17 -7
  136. data/sig/generated/paper_trail_diff/transaction_cut.rbs +126 -0
  137. data/sig/generated/paper_trail_diff/traversal_preparer.rbs +66 -8
  138. data/sig/generated/paper_trail_diff/version_boundary.rbs +22 -3
  139. data/sig/generated/paper_trail_diff/version_query.rbs +18 -2
  140. data/sig/generated/paper_trail_diff/version_scope_filter.rbs +4 -5
  141. data/sig/generated/paper_trail_diff/version_sequence_diagnostics.rbs +19 -9
  142. data/sig/generated/paper_trail_diff/version_table.rbs +30 -0
  143. data/sig/generated/paper_trail_diff.rbs +29 -26
  144. metadata +49 -11
  145. data/lib/paper_trail_diff/activity_grouping.rb +0 -38
  146. data/lib/paper_trail_diff/batch_safety.rb +0 -63
  147. data/lib/paper_trail_diff/time_activity_timeline_builder.rb +0 -223
  148. data/sig/generated/paper_trail_diff/activity_grouping.rbs +0 -22
  149. data/sig/generated/paper_trail_diff/batch_safety.rbs +0 -30
  150. data/sig/generated/paper_trail_diff/time_activity_timeline_builder.rbs +0 -92
@@ -36,6 +36,19 @@ module PaperTrailDiff
36
36
  # : (Array[Array[untyped]], ActivitySnapshotDelta?) -> bool
37
37
  def unsafe_nested_membership_delta?: (Array[Array[untyped]], ActivitySnapshotDelta?) -> bool
38
38
 
39
+ # A delta replaces a record's attributes and keeps its associations, so an
40
+ # edit to a key one of them follows, such as a comment's `reviewer_id`
41
+ # under `comments.reviewer`, would leave the old target in place. The
42
+ # branch is read again instead.
43
+ # : (Array[Array[untyped]], ActivitySnapshotDelta?) -> bool
44
+ def unsafe_owned_relationship_delta?: (Array[Array[untyped]], ActivitySnapshotDelta?) -> bool
45
+
46
+ # The record's own columns that decide what an association of it holds: a
47
+ # belongs_to's key and type, or those of the belongs_to a through starts
48
+ # from. A has_one or has_many follows the record's primary key.
49
+ # : (untyped) -> Array[untyped]
50
+ def owned_keys: (untyped) -> Array[untyped]
51
+
39
52
  # : (RecordSnapshot, Array[untyped], untyped, ActivitySnapshotDelta?, Array[untyped], SnapshotNormalizer, Array[untyped], ?direct: bool) -> [untyped, RecordSnapshot?]
40
53
  def route_event_state: (RecordSnapshot, Array[untyped], untyped, ActivitySnapshotDelta?, Array[untyped], SnapshotNormalizer, Array[untyped], ?direct: bool) -> [ untyped, RecordSnapshot? ]
41
54
 
@@ -7,19 +7,26 @@ module PaperTrailDiff
7
7
 
8
8
  attr_reader branches: Array[String]?
9
9
 
10
- # : (version: untyped, branches: Array[String]?) -> void
11
- def initialize: (version: untyped, branches: Array[String]?) -> void
10
+ # : (version: untyped, branches: Array[String]?, ?join: bool) -> void
11
+ def initialize: (version: untyped, branches: Array[String]?, ?join: bool) -> void
12
12
 
13
13
  # : () -> bool
14
14
  def root?: () -> bool
15
+
16
+ # Whether the version is of a through's join row, which links the root to
17
+ # a target without being one.
18
+ # : () -> bool
19
+ def join?: () -> bool
20
+
21
+ @join: bool
15
22
  end
16
23
 
17
24
  # Accumulates each version once while retaining every selected root branch.
18
25
  class ActivityEventRegistry
19
26
  def initialize: () -> untyped
20
27
 
21
- # : (Array[untyped], ?branch: String?) -> void
22
- def add: (Array[untyped], ?branch: String?) -> void
28
+ # : (Array[untyped], ?branch: String?, ?join: bool) -> void
29
+ def add: (Array[untyped], ?branch: String?, ?join: bool) -> void
23
30
 
24
31
  # : () -> Array[ActivityEvent]
25
32
  def to_a: () -> Array[ActivityEvent]
@@ -34,6 +41,20 @@ module PaperTrailDiff
34
41
 
35
42
  # Resolves the branch union that PT-AT exposes atomically for one transaction.
36
43
  class ActivityTransactionGroups
44
+ # A range ending at a version ends at the state before that version's
45
+ # transaction: PT-AT rebuilds its associations without the changes saved
46
+ # alongside it. A descendant version from that transaction, such as the
47
+ # child update behind a `touch: true` parent version, is therefore past the
48
+ # end. Kept, it would open a step whose change the closing state cannot
49
+ # show, and that change would be reported nowhere. A range ending at a time
50
+ # has no transaction to stop before.
51
+ # : (Array[ActivityEvent], untyped) -> Array[ActivityEvent]
52
+ def self.before_closing: (Array[ActivityEvent], untyped) -> Array[ActivityEvent]
53
+
54
+ # A version without a transaction shares one with nothing.
55
+ # : (untyped) -> Array[untyped]?
56
+ def self.transaction_key: (untyped) -> Array[untyped]?
57
+
37
58
  # : (Array[ActivityEvent]) -> void
38
59
  def initialize: (Array[ActivityEvent]) -> void
39
60
 
@@ -12,14 +12,28 @@ module PaperTrailDiff
12
12
  # : (untyped, AssociationTree, String, ?path: String) -> Array[Array[untyped]]
13
13
  def belongs_to_routes: (untyped, AssociationTree, String, ?path: String) -> Array[Array[untyped]]
14
14
 
15
+ # Whether a has_many through in the tree joins through, or reaches,
16
+ # records of the type. Its membership follows their keys, which a route
17
+ # to the record elsewhere in the tree does not update.
18
+ # : (untyped, AssociationTree, String) -> bool
19
+ def through_part?: (untyped, AssociationTree, String) -> bool
20
+
15
21
  private
16
22
 
17
23
  @belongs_to_routes: Hash[Array[untyped], Array[Array[untyped]]]
18
24
 
19
25
  @collection_routes: Hash[Array[untyped], Array[Array[untyped]]]
20
26
 
27
+ @through_parts: Hash[Array[untyped], bool]
28
+
21
29
  @traversal: AssociationTraversal
22
30
 
31
+ # : (untyped, AssociationTree, String, String) -> bool
32
+ def through_part_below?: (untyped, AssociationTree, String, String) -> bool
33
+
34
+ # : (untyped, String) -> bool
35
+ def through_reaches?: (untyped, String) -> bool
36
+
23
37
  # Timelines interleave event types, so every requested combination is
24
38
  # retained. Model, tree, and path are fixed per adapter, leaving one entry
25
39
  # per selected item type.
@@ -35,6 +35,12 @@ module PaperTrailDiff
35
35
 
36
36
  @route_finder: ActivityEventRouteFinder
37
37
 
38
+ # A through's membership follows the keys of the records it joins through
39
+ # or reaches, which a route to such a record elsewhere in the tree leaves
40
+ # alone, so the branch is read again instead.
41
+ # : (untyped, AssociationTree, Array[Array[untyped]], ActivityEvent, ActivitySnapshotDelta?) -> bool
42
+ def collection_safe?: (untyped, AssociationTree, Array[Array[untyped]], ActivityEvent, ActivitySnapshotDelta?) -> bool
43
+
38
44
  # : (untyped) -> untyped
39
45
  def record_after: (untyped) -> untyped
40
46
 
@@ -24,14 +24,19 @@ module PaperTrailDiff
24
24
 
25
25
  # Builds activity steps while retaining root snapshots for combined analysis.
26
26
  class ActivityHistoryBuilder
27
- # : (Array[untyped], Array[ActivityEvent], untyped, ?current: untyped, ?include_step: untyped, ?snapshots: bool) -> void
28
- def initialize: (Array[untyped], Array[ActivityEvent], untyped, ?current: untyped, ?include_step: untyped, ?snapshots: bool) -> void
27
+ # `closing` is the snapshot after the last event when the range closes on
28
+ # the current record. Any other range ends at a root event, or at events
29
+ # after a window whose steps are not reported, so nothing reads it.
30
+ # : (Array[untyped], Array[ActivityEvent], untyped, view: ActivityView, ?current: untyped, ?include_step: untyped, ?closing: RecordSnapshot?) -> void
31
+ def initialize: (Array[untyped], Array[ActivityEvent], untyped, view: ActivityView, ?current: untyped, ?include_step: untyped, ?closing: RecordSnapshot?) -> void
29
32
 
30
33
  # : () -> ActivityHistory
31
34
  def call: () -> ActivityHistory
32
35
 
33
36
  private
34
37
 
38
+ @closing: RecordSnapshot?
39
+
35
40
  @current: untyped
36
41
 
37
42
  @events: Array[ActivityEvent]
@@ -40,6 +45,8 @@ module PaperTrailDiff
40
45
 
41
46
  @include_step: untyped
42
47
 
48
+ @passed_reported: bool
49
+
43
50
  @previous_boundary: ActivityBoundary?
44
51
 
45
52
  @previous_event: ActivityEvent?
@@ -52,20 +59,28 @@ module PaperTrailDiff
52
59
 
53
60
  @selected_last_snapshot: RecordSnapshot?
54
61
 
55
- @snapshots: bool
56
-
57
62
  @snapshotter: untyped
58
63
 
59
64
  @steps: Array[ActivityStep]
60
65
 
66
+ @view: ActivityView
67
+
61
68
  # : () -> void
62
69
  def reset: () -> void
63
70
 
71
+ # : () -> ActivityTreeFilter
72
+ def filter: () -> ActivityTreeFilter
73
+
64
74
  # : () -> ActivitySnapshotSequence
65
75
  def sequence: () -> ActivitySnapshotSequence
66
76
 
67
- # : (ActivityEvent, RecordSnapshot?) -> void
68
- def consume: (ActivityEvent, RecordSnapshot?) -> void
77
+ # A left-out event bounds nothing. A reported step it would have opened
78
+ # still moves the reported range's end past it, to the next boundary.
79
+ # : (ActivityEvent, RecordSnapshot?, bool) -> void
80
+ def consume: (ActivityEvent, RecordSnapshot?, bool) -> void
81
+
82
+ # : (ActivityEvent) -> void
83
+ def pass: (ActivityEvent) -> void
69
84
 
70
85
  # : (RecordSnapshot?) -> void
71
86
  def capture_first: (RecordSnapshot?) -> void
@@ -13,8 +13,9 @@ module PaperTrailDiff
13
13
  # : (untyped) -> bool
14
14
  def include?: (untyped) -> bool
15
15
 
16
- # Narrows an Active Record version relation by timestamp. Exact tie-breaking
17
- # remains in #include? so this works for integer, UUID, and custom version IDs.
16
+ # Narrows an Active Record version relation by timestamp, and to the
17
+ # start's transaction. Exact tie-breaking remains in #include? so this
18
+ # works for integer, UUID, and custom version IDs.
18
19
  # : (untyped) -> untyped
19
20
  def scope: (untyped) -> untyped
20
21
 
@@ -33,10 +34,16 @@ module PaperTrailDiff
33
34
 
34
35
  @end_key: Array[untyped]?
35
36
 
37
+ @opening_transaction: Array[untyped]?
38
+
36
39
  @start_key: Array[untyped]?
37
40
 
38
41
  @start_time: untyped
39
42
 
43
+ # A range starting at a version starts before that version's transaction,
44
+ # where PT-AT reads its associations. A version saved earlier in it, such
45
+ # as the child update behind a `touch: true` parent version, is a change
46
+ # inside the range.
40
47
  # : (untyped, Array[untyped]) -> bool
41
48
  def after_start?: (untyped, Array[untyped]) -> bool
42
49
 
@@ -3,8 +3,8 @@
3
3
  module PaperTrailDiff
4
4
  # Advances scalar-only root events while retaining already reconstructed associations.
5
5
  class ActivityRootSnapshotRefresher
6
- # : (tree: AssociationTree, traversal: AssociationTraversal, normalizer: SnapshotNormalizer, record_after: untyped, changeset: untyped, partial_snapshotter: untyped) -> void
7
- def initialize: (tree: AssociationTree, traversal: AssociationTraversal, normalizer: SnapshotNormalizer, record_after: untyped, changeset: untyped, partial_snapshotter: untyped) -> void
6
+ # : (tree: AssociationTree, traversal: AssociationTraversal, normalizer: SnapshotNormalizer, record_after: untyped, changeset: untyped, partial_snapshotter: untyped, ?record_transition: untyped) -> void
7
+ def initialize: (tree: AssociationTree, traversal: AssociationTraversal, normalizer: SnapshotNormalizer, record_after: untyped, changeset: untyped, partial_snapshotter: untyped, ?record_transition: untyped) -> void
8
8
 
9
9
  # : (untyped, untyped, RecordSnapshot?, ActivityEvent) -> [bool, RecordSnapshot?]
10
10
  def call: (untyped, untyped, RecordSnapshot?, ActivityEvent) -> [ bool, RecordSnapshot? ]
@@ -19,6 +19,8 @@ module PaperTrailDiff
19
19
 
20
20
  @record_after: untyped
21
21
 
22
+ @record_transition: untyped
23
+
22
24
  @relationship_reflections: Hash[String, Array[untyped]]
23
25
 
24
26
  @traversal: AssociationTraversal
@@ -27,11 +29,18 @@ module PaperTrailDiff
27
29
 
28
30
  @unsupported_branches: Hash[String, Array[String]]
29
31
 
30
- # : (RecordSnapshot, untyped, untyped) -> snapshot_attributes?
31
- def advanced_attributes: (RecordSnapshot, untyped, untyped) -> snapshot_attributes?
32
-
32
+ # The columns the version changed, from its changeset and from the states
33
+ # either side of it. The changeset leaves out columns that `only:` or
34
+ # `ignore:` exclude and keys written without a version, which the states
35
+ # hold.
33
36
  # : (untyped, untyped) -> Array[String]
34
- def branches_to_refresh: (untyped, untyped) -> Array[String]
37
+ def changed_columns: (untyped, untyped) -> Array[String]
38
+
39
+ # : (untyped) -> untyped
40
+ def recorded_class: (untyped) -> untyped
41
+
42
+ # : (untyped, Array[String]) -> Array[String]
43
+ def branches_to_refresh: (untyped, Array[String]) -> Array[String]
35
44
 
36
45
  # : (untyped) -> Array[String]
37
46
  def unsupported_branches: (untyped) -> Array[String]
@@ -41,11 +50,13 @@ module PaperTrailDiff
41
50
  # : (untyped) -> bool
42
51
  def direct_versioned_reflection?: (untyped) -> bool
43
52
 
44
- # : (RecordSnapshot, untyped) -> bool
45
- def same_record?: (RecordSnapshot, untyped) -> bool
53
+ # The snapshot names the record's class, which for an STI subclass is not
54
+ # the base class the version names.
55
+ # : (RecordSnapshot, untyped, untyped) -> bool
56
+ def same_record?: (RecordSnapshot, untyped, untyped) -> bool
46
57
 
47
- # : (untyped, untyped) -> Array[String]
48
- def changed_relationship_branches: (untyped, untyped) -> Array[String]
58
+ # : (untyped, Array[String]) -> Array[String]
59
+ def changed_relationship_branches: (untyped, Array[String]) -> Array[String]
49
60
 
50
61
  # : (untyped) -> Array[untyped]
51
62
  def root_relationship_reflections: (untyped) -> Array[untyped]
@@ -1,13 +1,44 @@
1
1
  # Generated from lib/paper_trail_diff/activity_snapshot_sequence.rb with RBS::Inline
2
2
 
3
3
  module PaperTrailDiff
4
- # Optional full/partial snapshot operations consumed by the activity sequence.
4
+ # Prepares the snapshot store for an activity build, one root at a time.
5
+ # Before that, it reads the live record a range closes on.
5
6
  class ActivitySnapshotProvider
6
- # : (snapshotter: untyped, refresher: untyped, preparer: untyped, ?activity_index: untyped) -> void
7
- def initialize: (snapshotter: untyped, refresher: untyped, preparer: untyped, ?activity_index: untyped) -> void
7
+ # `snapshotter` reads a full snapshot with a given history, and `refresher`
8
+ # builds the incremental refresher for one root's snapshots.
9
+ # : (store: HistoricalSnapshotStore, snapshotter: untyped, refresher: untyped) -> void
10
+ def initialize: (store: HistoricalSnapshotStore, snapshotter: untyped, refresher: untyped) -> void
11
+
12
+ # Roots a batch prepared together share its history, so consecutive ones
13
+ # share these snapshots too, and the caches their refresher builds. They
14
+ # are the same for any root with that history, so reusing them depends on
15
+ # nothing but the history.
16
+ # : (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedActivitySnapshots
17
+ def prepare: (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedActivitySnapshots
8
18
 
9
- # : (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
10
- def prepare: (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
19
+ # : (untyped, untyped) -> RecordSnapshot?
20
+ def call: (untyped, untyped) -> RecordSnapshot?
21
+
22
+ @last: PreparedActivitySnapshots?
23
+
24
+ @refresher: untyped
25
+
26
+ @snapshotter: untyped
27
+
28
+ @store: HistoricalSnapshotStore
29
+ end
30
+
31
+ # One root's full and incremental snapshots during an activity build. Each
32
+ # read passes along the history prepared for this root, so none depends on
33
+ # which root was prepared last.
34
+ class PreparedActivitySnapshots
35
+ attr_reader history: PreparedHistory?
36
+
37
+ # : (PreparedHistory?, store: HistoricalSnapshotStore, snapshotter: untyped, refresher: untyped) -> void
38
+ def initialize: (PreparedHistory?, store: HistoricalSnapshotStore, snapshotter: untyped, refresher: untyped) -> void
39
+
40
+ # : () -> PreparedActivityIndex?
41
+ def activity_index: () -> PreparedActivityIndex?
11
42
 
12
43
  # : (untyped, untyped) -> RecordSnapshot?
13
44
  def call: (untyped, untyped) -> RecordSnapshot?
@@ -18,16 +49,24 @@ module PaperTrailDiff
18
49
  # : (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
19
50
  def advance_root: (untyped, untyped, RecordSnapshot?, event: ActivityEvent) -> RecordSnapshot?
20
51
 
21
- # : () -> PreparedActivityIndex?
22
- def activity_index: () -> PreparedActivityIndex?
52
+ # The branches a refresh rebuilds, with this root's history.
53
+ # : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer) -> RecordSnapshot?
54
+ def custom: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer) -> RecordSnapshot?
23
55
 
24
- @activity_index: untyped
56
+ # : (untyped, habtm_version: untyped) -> untyped
57
+ def association_reader: (untyped, habtm_version: untyped) -> untyped
25
58
 
26
- @preparer: untyped
59
+ # : (untyped) -> [Hash[untyped, untyped], Hash[untyped, untyped]]?
60
+ def record_transition: (untyped) -> [ Hash[untyped, untyped], Hash[untyped, untyped] ]?
61
+
62
+ # : (untyped, ?direct: bool) -> [bool, untyped]
63
+ def record_after: (untyped, ?direct: bool) -> [ bool, untyped ]
27
64
 
28
65
  @refresher: untyped
29
66
 
30
67
  @snapshotter: untyped
68
+
69
+ @store: HistoricalSnapshotStore
31
70
  end
32
71
 
33
72
  # Builds chronological snapshots, refreshing only branches affected by prior events.
@@ -1,17 +1,26 @@
1
1
  # Generated from lib/paper_trail_diff/activity_timeline_builder.rb with RBS::Inline
2
2
 
3
3
  module PaperTrailDiff
4
- # Compares adjacent root and selected-descendant activity boundaries.
4
+ # Compares adjacent root and selected-descendant activity boundaries, between
5
+ # explicit endpoints or over a wall-clock window. Both replay the range's
6
+ # events into steps the same way, and close on the live row the same way.
7
+ # They differ in what they report and what closes them: explicit endpoints
8
+ # report every step between them and close on the endpoint asked for; a
9
+ # window reports only the events inside it, and closes on a final destroy,
10
+ # or on the live row when nothing recorded follows it.
5
11
  class ActivityTimelineBuilder
6
- include ActivityGrouping
7
-
8
- # : (untyped, range: TimelineRange, tree: AssociationTree, snapshotter: untyped, snapshots: bool, group: Symbol?) -> void
9
- def initialize: (untyped, range: TimelineRange, tree: AssociationTree, snapshotter: untyped, snapshots: bool, group: Symbol?) -> void
12
+ # : (untyped, range: TimelineRange, tree: AssociationTree, snapshotter: untyped, view: ActivityView) -> void
13
+ def initialize: (untyped, range: TimelineRange, tree: AssociationTree, snapshotter: untyped, view: ActivityView) -> void
10
14
 
11
15
  # : () -> Array[ActivityStep]
12
16
  def build: () -> Array[ActivityStep]
13
17
 
14
- # Builds all three version-bounded views from one activity snapshot pass.
18
+ # The window the range covers once its edges have moved to transactions.
19
+ # : () -> TimeRange?
20
+ def window: () -> TimeRange?
21
+
22
+ # Builds the endpoint diff, the root timeline, and the activity from one
23
+ # activity snapshot pass.
15
24
  # : () -> Analysis
16
25
  def analyze: () -> Analysis
17
26
 
@@ -21,14 +30,14 @@ module PaperTrailDiff
21
30
 
22
31
  @record: untyped
23
32
 
24
- @snapshots: bool
25
-
26
33
  @snapshotter: untyped
27
34
 
28
35
  @to: untyped
29
36
 
30
37
  @tree: AssociationTree
31
38
 
39
+ @view: ActivityView
40
+
32
41
  # : () -> Array[ActivityStep]
33
42
  def no_steps: () -> Array[ActivityStep]
34
43
 
@@ -40,6 +49,10 @@ module PaperTrailDiff
40
49
  # : () -> Array[ActivityStep]
41
50
  def build_between_versions: () -> Array[ActivityStep]
42
51
 
52
+ # Activity from the first to the last of the root versions.
53
+ # : (Array[untyped]) -> ActivityHistory
54
+ def version_history: (Array[untyped]) -> ActivityHistory
55
+
43
56
  # : () -> Array[ActivityStep]
44
57
  def build_to_current: () -> Array[ActivityStep]
45
58
 
@@ -48,14 +61,22 @@ module PaperTrailDiff
48
61
 
49
62
  # The explicit live endpoint and a batch's live closing endpoint use the
50
63
  # same selected plan. A version filter can close earlier, on its successor.
51
- # : () -> [RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary?]
52
- def current_history: () -> [ RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary? ]
64
+ # : () -> [RootVersionPlan, ActivityHistory, RecordSnapshot?, ActivityBoundary?]
65
+ def current_history: () -> [ RootVersionPlan, ActivityHistory, RecordSnapshot?, ActivityBoundary? ]
53
66
 
54
- # Without a closing boundary nothing reads the events or the closing pair,
55
- # so their mutations cannot change an answer.
67
+ # Events up to the instant the current record was read. A range that a
68
+ # version filter closes earlier ends at that version, with no snapshot.
69
+ # : (RootVersionPlan, RecordSnapshot?, untyped) -> ActivityHistory
70
+ def history_until: (RootVersionPlan, RecordSnapshot?, untyped) -> ActivityHistory
71
+
72
+ # Without a closing boundary nothing reads the closing pair, so its
73
+ # mutations cannot change an answer.
56
74
  # mutant:disable
57
- # : (RootVersionPlan) -> [RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary?]
58
- def empty_history: (RootVersionPlan) -> [ RootVersionPlan, Array[ActivityEvent], ActivityHistory, RecordSnapshot?, ActivityBoundary? ]
75
+ # : (RootVersionPlan) -> [RootVersionPlan, ActivityHistory, RecordSnapshot?, ActivityBoundary?]
76
+ def empty_history: (RootVersionPlan) -> [ RootVersionPlan, ActivityHistory, RecordSnapshot?, ActivityBoundary? ]
77
+
78
+ # : (untyped) -> ActivityBoundary
79
+ def current_boundary: (untyped) -> ActivityBoundary
59
80
 
60
81
  # : () -> [RecordSnapshot?, untyped]
61
82
  def capture_current: () -> [ RecordSnapshot?, untyped ]
@@ -63,33 +84,120 @@ module PaperTrailDiff
63
84
  # : () -> void
64
85
  def validate_current_range!: () -> void
65
86
 
66
- # : (Array[untyped], ?range_start: untyped, ?range_end: untyped) -> Array[ActivityEvent]
67
- def collect_events: (Array[untyped], ?range_start: untyped, ?range_end: untyped) -> Array[ActivityEvent]
68
-
69
- # : (Array[untyped], ?end_at: untyped) -> void
70
- def prepare_history: (Array[untyped], ?end_at: untyped) -> void
71
-
72
87
  # Appends the transition into an explicit closing boundary, which is either
73
88
  # a requested current record or the absence a final root destroy leaves.
74
- # Either follows the root versions, which are themselves events.
75
- # : (ActivityHistory, Array[ActivityEvent], ActivityBoundary?, RecordSnapshot?) -> Array[ActivityStep]
76
- def activity_steps: (ActivityHistory, Array[ActivityEvent], ActivityBoundary?, RecordSnapshot?) -> Array[ActivityStep]
89
+ # Either follows the root versions, which are themselves events, so the
90
+ # last boundary the history kept opens it.
91
+ # : (ActivityHistory, ActivityBoundary?, RecordSnapshot?) -> Array[ActivityStep]
92
+ def activity_steps: (ActivityHistory, ActivityBoundary?, RecordSnapshot?) -> Array[ActivityStep]
77
93
 
78
94
  # A destroyed root has no later version, but its own event states that
79
95
  # nothing follows it, so the removal can still close the timeline.
80
96
  # : (Array[untyped]) -> ActivityBoundary?
81
97
  def destroyed_boundary: (Array[untyped]) -> ActivityBoundary?
82
98
 
83
- # : (Array[untyped], Array[ActivityEvent], ?current: untyped) -> ActivityHistory
84
- def event_history: (Array[untyped], Array[ActivityEvent], ?current: untyped) -> ActivityHistory
85
-
86
99
  # Only the activity view gains the closing removal. The endpoint diff and
87
100
  # the root timeline keep their `compare` and `timeline` semantics, under
88
101
  # which the state at a destroy version is the state before the deletion.
89
- # : (RootVersionPlan, Array[ActivityEvent], ActivityHistory) -> Analysis
90
- def build_analysis: (RootVersionPlan, Array[ActivityEvent], ActivityHistory) -> Analysis
102
+ # : (RootVersionPlan, ActivityHistory) -> Analysis
103
+ def build_analysis: (RootVersionPlan, ActivityHistory) -> Analysis
91
104
 
92
- # : () -> TimeActivityTimelineBuilder
93
- def time_builder: () -> TimeActivityTimelineBuilder
105
+ # : () -> Array[ActivityStep]
106
+ def window_steps: () -> Array[ActivityStep]
107
+
108
+ # : () -> Analysis
109
+ def analyze_window: () -> Analysis
110
+
111
+ # A window with a closing step ends at what closed it: the live row, or
112
+ # nothing after a destroy, where no live row is read. One that ends before
113
+ # a later event ends at the state that event found.
114
+ # : (ActivityHistory, ActivityStep?, RecordSnapshot?) -> RecordSnapshot?
115
+ def window_final_snapshot: (ActivityHistory, ActivityStep?, RecordSnapshot?) -> RecordSnapshot?
116
+
117
+ # : () -> [ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped]
118
+ def window_history: () -> [ ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped ]
119
+
120
+ # Nothing reads a window's closing step, live snapshot, or capture time
121
+ # when it reported nothing, so mutations of those cannot change an answer.
122
+ # mutant:disable
123
+ # : (RootVersionPlan) -> [ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped]
124
+ def empty_window: (RootVersionPlan) -> [ ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped ]
125
+
126
+ # A window with no selected event reports nothing. Any other has a
127
+ # boundary after its last one: the plan refuses a window that has no later
128
+ # version, ends on no destroy, and does not close on the live row.
129
+ # : (RootVersionPlan, untyped) -> [ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped]
130
+ def window_replay: (RootVersionPlan, untyped) -> [ ActivityHistory, RootVersionPlan, ActivityStep?, RecordSnapshot?, untyped ]
131
+
132
+ # One live read serves both the closing activity step and the endpoint the
133
+ # analysis reports, which would otherwise reconstruct the graph twice.
134
+ # : (RootVersionPlan) -> RecordSnapshot?
135
+ def window_live_snapshot: (RootVersionPlan) -> RecordSnapshot?
136
+
137
+ # Root versions inside the window that the plan does not report are context
138
+ # rather than mutations: the version appended to reveal the last selected
139
+ # change, and anything a filter excluded but the replay still walks. Neither
140
+ # may be counted as a selected mutation. Descendant events are not filtered,
141
+ # so window membership is the whole test for them.
142
+ # : (Array[ActivityEvent], RootVersionPlan) -> Array[ActivityEvent]
143
+ def selected_events: (Array[ActivityEvent], RootVersionPlan) -> Array[ActivityEvent]
144
+
145
+ # A window either closes on the absence its final destruction leaves, or on
146
+ # current state when it reaches past everything recorded. Both are boundaries
147
+ # no version can supply.
148
+ #
149
+ # Everything recorded means on every requested path, not only the root's
150
+ # own versions. When an association changed after the window, its last
151
+ # step already ends at that change, at the state the window left; closing
152
+ # on current state would add the later change to a window it was not in.
153
+ # : (ActivityHistory, ActivityEvent, RootVersionPlan, untyped, RecordSnapshot?, Array[ActivityEvent]) -> ActivityStep?
154
+ def window_closing: (ActivityHistory, ActivityEvent, RootVersionPlan, untyped, RecordSnapshot?, Array[ActivityEvent]) -> ActivityStep?
155
+
156
+ # : (ActivityHistory, ActivityEvent) -> ActivityStep
157
+ def window_destroyed_step: (ActivityHistory, ActivityEvent) -> ActivityStep
158
+
159
+ # The last boundary reached is where current state is compared from, which
160
+ # is the final event rather than the final root version once descendants
161
+ # have moved since it. A selected event is a boundary the history kept.
162
+ # : (ActivityHistory, untyped, untyped, RecordSnapshot?) -> ActivityStep
163
+ def window_current_step: (ActivityHistory, untyped, untyped, RecordSnapshot?) -> ActivityStep
164
+
165
+ # : (ActivityEvent) -> bool
166
+ def terminal_destroy?: (ActivityEvent) -> bool
167
+
168
+ # : () -> void
169
+ def reject_live_habtm!: () -> void
170
+
171
+ # : () -> Array[String]?
172
+ def root_recorded: () -> Array[String]?
173
+
174
+ # A window prepares from its start, explicit endpoints from their first
175
+ # version.
176
+ # : (Array[untyped], ?end_at: untyped) -> untyped
177
+ def prepare_history: (Array[untyped], ?end_at: untyped) -> untyped
178
+
179
+ # A window collects from its start, explicit endpoints from their first
180
+ # version. Explicit endpoints also stop before the rest of the closing
181
+ # version's transaction (see ActivityTransactionGroups.before_closing); a
182
+ # window keeps every event it collected and reports only those inside it.
183
+ # : (Array[untyped], untyped, range_end: untyped) -> Array[ActivityEvent]
184
+ def collect_events: (Array[untyped], untyped, range_end: untyped) -> Array[ActivityEvent]
185
+
186
+ # Events after the last root version read the root from the live record
187
+ # when the range closes on it. Explicit endpoints report every step, as
188
+ # their range includes every version.
189
+ # : (Array[untyped], Array[ActivityEvent], untyped, ?current: untyped, ?closing: RecordSnapshot?) -> ActivityHistory
190
+ def replay: (Array[untyped], Array[ActivityEvent], untyped, ?current: untyped, ?closing: RecordSnapshot?) -> ActivityHistory
191
+
192
+ # The step from the last boundary the history reached to one that closes
193
+ # the range.
194
+ # : (ActivityHistory, ActivityBoundary, ActivityBoundary, RecordSnapshot?) -> ActivityStep
195
+ def step_from_last: (ActivityHistory, ActivityBoundary, ActivityBoundary, RecordSnapshot?) -> ActivityStep
196
+
197
+ # : (Array[ActivityStep]) -> Array[ActivityStep]
198
+ def present: (Array[ActivityStep]) -> Array[ActivityStep]
199
+
200
+ # : (RootVersionPlan, ActivityHistory, final: RecordSnapshot?, steps: Array[ActivityStep], ?closing_snapshot: RecordSnapshot?, ?captured_at: untyped) -> Analysis
201
+ def analysis: (RootVersionPlan, ActivityHistory, final: RecordSnapshot?, steps: Array[ActivityStep], ?closing_snapshot: RecordSnapshot?, ?captured_at: untyped) -> Analysis
94
202
  end
95
203
  end
@@ -0,0 +1,73 @@
1
+ # Generated from lib/paper_trail_diff/activity_tree_filter.rb with RBS::Inline
2
+
3
+ module PaperTrailDiff
4
+ # Leaves out the events of records that were outside the root's tree.
5
+ #
6
+ # A record found in the tree at one time in a range brings every version it
7
+ # saved in the range, including those it saved while it belonged elsewhere:
8
+ # a comment edited on another article before it moved to this one, or after
9
+ # it left a scope. Such a version changes nothing the root shows. As a
10
+ # boundary it would open a step of its own, and inside a transaction, where
11
+ # a change surfaces one event late, that step would take the credit for the
12
+ # root's own change.
13
+ #
14
+ # PT-AT reads associations as they were before a transaction, so a record
15
+ # is judged by two snapshots: the one at its transaction's first event, and
16
+ # the one after its last, which is the next event's or what the range
17
+ # closes on. A record in neither was outside the tree throughout.
18
+ #
19
+ # The root's own events are always kept, and so are the versions of a
20
+ # through's join rows, which a snapshot does not hold, and an event whose
21
+ # step is not reported, which only bounds one that is.
22
+ class ActivityTreeFilter
23
+ # `closing` is the snapshot after the last event: the current record's,
24
+ # or nil when nothing follows, as after the root's destruction.
25
+ # : (Array[ActivityEvent], reported: untyped, closing: RecordSnapshot?) -> void
26
+ def initialize: (Array[ActivityEvent], reported: untyped, closing: RecordSnapshot?) -> void
27
+
28
+ # Yields each event of the sequence with its snapshot, and whether to keep
29
+ # it, in order.
30
+ # : (untyped) { (ActivityEvent, RecordSnapshot?, bool) -> void } -> void
31
+ def call: (untyped) { (ActivityEvent, RecordSnapshot?, bool) -> void } -> void
32
+
33
+ private
34
+
35
+ @closing: RecordSnapshot?
36
+
37
+ @ends: Array[Integer]
38
+
39
+ @reported: untyped
40
+
41
+ @starts: Array[Integer]
42
+
43
+ @types: Hash[String, Array[String?]]
44
+
45
+ # : (ActivityEvent, Integer, Array[[ActivityEvent, RecordSnapshot?]]) -> bool
46
+ def keep?: (ActivityEvent, Integer, Array[[ ActivityEvent, RecordSnapshot? ]]) -> bool
47
+
48
+ # : (ActivityEvent) -> bool
49
+ def reported?: (ActivityEvent) -> bool
50
+
51
+ # Where each event's transaction starts, and the position just past its
52
+ # last event. Two transactions can interleave, so a transaction's events
53
+ # need not be adjacent.
54
+ # : (Array[ActivityEvent]) -> [Array[Integer], Array[Integer]]
55
+ def spans: (Array[ActivityEvent]) -> [ Array[Integer], Array[Integer] ]
56
+
57
+ # A version saved outside a transaction is a transaction of its own,
58
+ # keyed by its position.
59
+ # : (Array[ActivityEvent]) -> Array[Array[untyped] | Integer]
60
+ def transaction_keys: (Array[ActivityEvent]) -> Array[Array[untyped] | Integer]
61
+
62
+ # : (RecordSnapshot?, ActivityEvent) -> bool
63
+ def holds?: (RecordSnapshot?, ActivityEvent) -> bool
64
+
65
+ # : (AssociationSnapshot, Array[String?], untyped) -> bool
66
+ def contains?: (AssociationSnapshot, Array[String?], untyped) -> bool
67
+
68
+ # A version names its record's base class, and a snapshot the record's
69
+ # own class, which may be any subclass of it.
70
+ # : (String) -> Array[String?]
71
+ def types: (String) -> Array[String?]
72
+ end
73
+ end
@@ -6,6 +6,8 @@ module PaperTrailDiff
6
6
  # : (untyped, root_versions: Array[untyped], tree: AssociationTree, ?range_start: untyped, ?range_end: untyped, ?prepared: PreparedActivityIndex?) -> void
7
7
  def initialize: (untyped, root_versions: Array[untyped], tree: AssociationTree, ?range_start: untyped, ?range_end: untyped, ?prepared: PreparedActivityIndex?) -> void
8
8
 
9
+ # A tie between version tables, or between ids that do not count up,
10
+ # raises rather than building a timeline in an arbitrary order.
9
11
  # : () -> Array[ActivityEvent]
10
12
  def call: () -> Array[ActivityEvent]
11
13