paper_trail_diff 0.17.0 → 0.18.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 (215) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +663 -0
  3. data/QUICKSTART.md +12 -14
  4. data/README.md +32 -30
  5. data/docs/architecture.md +65 -29
  6. data/docs/performance.md +161 -46
  7. data/docs/reference.md +495 -394
  8. data/docs/testing.md +9 -15
  9. data/lib/paper_trail_diff/activity_belongs_to_event_applier.rb +42 -9
  10. data/lib/paper_trail_diff/activity_boundary.rb +15 -6
  11. data/lib/paper_trail_diff/activity_child_candidate_loader.rb +91 -18
  12. data/lib/paper_trail_diff/activity_collection_event_applier.rb +14 -15
  13. data/lib/paper_trail_diff/activity_collection_record_updater.rb +18 -8
  14. data/lib/paper_trail_diff/activity_collection_route_updater.rb +12 -25
  15. data/lib/paper_trail_diff/activity_event.rb +53 -34
  16. data/lib/paper_trail_diff/activity_event_record_normalizer.rb +12 -26
  17. data/lib/paper_trail_diff/activity_event_record_resolver.rb +45 -32
  18. data/lib/paper_trail_diff/activity_event_snapshot_refresher.rb +26 -33
  19. data/lib/paper_trail_diff/activity_history.rb +28 -34
  20. data/lib/paper_trail_diff/activity_relationship.rb +3 -26
  21. data/lib/paper_trail_diff/activity_root_snapshot_refresher.rb +14 -8
  22. data/lib/paper_trail_diff/activity_snapshot_delta.rb +2 -3
  23. data/lib/paper_trail_diff/activity_snapshot_sequence.rb +92 -25
  24. data/lib/paper_trail_diff/activity_timeline_builder.rb +128 -77
  25. data/lib/paper_trail_diff/activity_transaction_applier.rb +49 -0
  26. data/lib/paper_trail_diff/activity_tree_filter.rb +70 -57
  27. data/lib/paper_trail_diff/activity_tree_places.rb +76 -0
  28. data/lib/paper_trail_diff/activity_version_collector.rb +45 -32
  29. data/lib/paper_trail_diff/activity_view.rb +2 -0
  30. data/lib/paper_trail_diff/analysis.rb +6 -5
  31. data/lib/paper_trail_diff/analysis_batch.rb +21 -17
  32. data/lib/paper_trail_diff/association_activity_edge.rb +99 -85
  33. data/lib/paper_trail_diff/association_activity_selection.rb +46 -14
  34. data/lib/paper_trail_diff/association_discovery.rb +4 -4
  35. data/lib/paper_trail_diff/association_key.rb +10 -18
  36. data/lib/paper_trail_diff/association_traversal.rb +72 -92
  37. data/lib/paper_trail_diff/batch_boundary_resolver.rb +1 -7
  38. data/lib/paper_trail_diff/batch_preload.rb +2 -3
  39. data/lib/paper_trail_diff/batched_root_analyses.rb +60 -25
  40. data/lib/paper_trail_diff/batched_root_analyzer.rb +5 -5
  41. data/lib/paper_trail_diff/batched_root_versions.rb +7 -30
  42. data/lib/paper_trail_diff/branch_snapshot_refresher.rb +19 -14
  43. data/lib/paper_trail_diff/candidate_table.rb +160 -0
  44. data/lib/paper_trail_diff/change_attribution.rb +35 -28
  45. data/lib/paper_trail_diff/collection_identity_index.rb +68 -24
  46. data/lib/paper_trail_diff/collection_transition.rb +3 -3
  47. data/lib/paper_trail_diff/comparison_batch.rb +13 -6
  48. data/lib/paper_trail_diff/database_time.rb +85 -0
  49. data/lib/paper_trail_diff/deleted_analysis_batch.rb +22 -23
  50. data/lib/paper_trail_diff/deleted_root_filter.rb +10 -6
  51. data/lib/paper_trail_diff/diagnostics.rb +26 -86
  52. data/lib/paper_trail_diff/endpoint.rb +37 -5
  53. data/lib/paper_trail_diff/engine.rb +1 -1
  54. data/lib/paper_trail_diff/errors.rb +0 -6
  55. data/lib/paper_trail_diff/exact_column_type.rb +96 -0
  56. data/lib/paper_trail_diff/historical_snapshot_store.rb +88 -83
  57. data/lib/paper_trail_diff/instrumentation.rb +0 -8
  58. data/lib/paper_trail_diff/live_endpoint_batch_loader.rb +1 -4
  59. data/lib/paper_trail_diff/live_graph_collector.rb +1 -3
  60. data/lib/paper_trail_diff/nested_comparator.rb +42 -10
  61. data/lib/paper_trail_diff/paper_trail_adapter.rb +55 -98
  62. data/lib/paper_trail_diff/prepared_activity_index.rb +235 -179
  63. data/lib/paper_trail_diff/prepared_child_candidates.rb +13 -3
  64. data/lib/paper_trail_diff/prepared_edge_loader.rb +11 -49
  65. data/lib/paper_trail_diff/prepared_history.rb +27 -177
  66. data/lib/paper_trail_diff/prepared_history_loader.rb +39 -57
  67. data/lib/paper_trail_diff/prepared_record_index.rb +221 -147
  68. data/lib/paper_trail_diff/prepared_snapshot_builder.rb +47 -42
  69. data/lib/paper_trail_diff/prepared_state_association_reader.rb +85 -62
  70. data/lib/paper_trail_diff/recorded_changes.rb +34 -10
  71. data/lib/paper_trail_diff/recorded_owner.rb +67 -0
  72. data/lib/paper_trail_diff/root_version_selection.rb +6 -2
  73. data/lib/paper_trail_diff/scope_condition.rb +120 -80
  74. data/lib/paper_trail_diff/scope_ranking.rb +14 -32
  75. data/lib/paper_trail_diff/scoped_analysis.rb +11 -6
  76. data/lib/paper_trail_diff/scoped_analysis_builder.rb +17 -11
  77. data/lib/paper_trail_diff/scoped_root_selection.rb +91 -85
  78. data/lib/paper_trail_diff/selection_window.rb +31 -0
  79. data/lib/paper_trail_diff/snapshot.rb +60 -58
  80. data/lib/paper_trail_diff/snapshot_members.rb +115 -0
  81. data/lib/paper_trail_diff/snapshot_normalizer.rb +0 -11
  82. data/lib/paper_trail_diff/step.rb +1 -5
  83. data/lib/paper_trail_diff/stored_form.rb +146 -0
  84. data/lib/paper_trail_diff/stored_json_values.rb +8 -5
  85. data/lib/paper_trail_diff/stored_time_precision.rb +67 -33
  86. data/lib/paper_trail_diff/stored_values.rb +35 -3
  87. data/lib/paper_trail_diff/support.rb +185 -35
  88. data/lib/paper_trail_diff/time_of_day.rb +13 -2
  89. data/lib/paper_trail_diff/time_range.rb +85 -11
  90. data/lib/paper_trail_diff/time_version_range.rb +5 -1
  91. data/lib/paper_trail_diff/timeline_builder.rb +5 -11
  92. data/lib/paper_trail_diff/timeline_range.rb +56 -19
  93. data/lib/paper_trail_diff/timeline_snapshot_provider.rb +31 -7
  94. data/lib/paper_trail_diff/total_order.rb +19 -5
  95. data/lib/paper_trail_diff/transaction_anchors.rb +138 -0
  96. data/lib/paper_trail_diff/transaction_cut.rb +67 -327
  97. data/lib/paper_trail_diff/transaction_ends.rb +194 -0
  98. data/lib/paper_trail_diff/traversal_preparer.rb +12 -24
  99. data/lib/paper_trail_diff/{approximate_paths.rb → unreadable_paths.rb} +8 -9
  100. data/lib/paper_trail_diff/value_objects.rb +8 -6
  101. data/lib/paper_trail_diff/version.rb +1 -1
  102. data/lib/paper_trail_diff/version_association_candidate_scope.rb +28 -4
  103. data/lib/paper_trail_diff/version_boundary.rb +0 -29
  104. data/lib/paper_trail_diff/version_query.rb +49 -1
  105. data/lib/paper_trail_diff/version_scope_filter.rb +74 -5
  106. data/lib/paper_trail_diff/version_sequence_diagnostics.rb +4 -31
  107. data/lib/paper_trail_diff/version_table.rb +8 -1
  108. data/lib/paper_trail_diff.rb +56 -110
  109. data/sig/generated/paper_trail_diff/activity_belongs_to_event_applier.rbs +24 -2
  110. data/sig/generated/paper_trail_diff/activity_boundary.rbs +6 -0
  111. data/sig/generated/paper_trail_diff/activity_child_candidate_loader.rbs +46 -5
  112. data/sig/generated/paper_trail_diff/activity_collection_event_applier.rbs +7 -4
  113. data/sig/generated/paper_trail_diff/activity_collection_record_updater.rbs +11 -2
  114. data/sig/generated/paper_trail_diff/activity_collection_route_updater.rbs +8 -6
  115. data/sig/generated/paper_trail_diff/activity_event.rbs +27 -18
  116. data/sig/generated/paper_trail_diff/activity_event_record_normalizer.rbs +7 -11
  117. data/sig/generated/paper_trail_diff/activity_event_record_resolver.rbs +26 -8
  118. data/sig/generated/paper_trail_diff/activity_event_snapshot_refresher.rbs +10 -2
  119. data/sig/generated/paper_trail_diff/activity_history.rbs +23 -26
  120. data/sig/generated/paper_trail_diff/activity_relationship.rbs +0 -6
  121. data/sig/generated/paper_trail_diff/activity_root_snapshot_refresher.rbs +5 -0
  122. data/sig/generated/paper_trail_diff/activity_snapshot_sequence.rbs +53 -10
  123. data/sig/generated/paper_trail_diff/activity_timeline_builder.rbs +64 -38
  124. data/sig/generated/paper_trail_diff/activity_transaction_applier.rbs +28 -0
  125. data/sig/generated/paper_trail_diff/activity_tree_filter.rbs +46 -38
  126. data/sig/generated/paper_trail_diff/activity_tree_places.rbs +45 -0
  127. data/sig/generated/paper_trail_diff/activity_version_collector.rbs +21 -11
  128. data/sig/generated/paper_trail_diff/analysis.rbs +6 -5
  129. data/sig/generated/paper_trail_diff/analysis_batch.rbs +8 -6
  130. data/sig/generated/paper_trail_diff/association_activity_edge.rbs +58 -45
  131. data/sig/generated/paper_trail_diff/association_activity_selection.rbs +20 -3
  132. data/sig/generated/paper_trail_diff/association_discovery.rbs +2 -2
  133. data/sig/generated/paper_trail_diff/association_key.rbs +2 -11
  134. data/sig/generated/paper_trail_diff/association_traversal.rbs +43 -44
  135. data/sig/generated/paper_trail_diff/batch_boundary_resolver.rbs +0 -2
  136. data/sig/generated/paper_trail_diff/batched_root_analyses.rbs +40 -17
  137. data/sig/generated/paper_trail_diff/batched_root_analyzer.rbs +2 -2
  138. data/sig/generated/paper_trail_diff/batched_root_versions.rbs +2 -11
  139. data/sig/generated/paper_trail_diff/branch_snapshot_refresher.rbs +12 -8
  140. data/sig/generated/paper_trail_diff/candidate_table.rbs +97 -0
  141. data/sig/generated/paper_trail_diff/change_attribution.rbs +21 -19
  142. data/sig/generated/paper_trail_diff/collection_identity_index.rbs +33 -13
  143. data/sig/generated/paper_trail_diff/collection_transition.rbs +2 -2
  144. data/sig/generated/paper_trail_diff/comparison_batch.rbs +5 -0
  145. data/sig/generated/paper_trail_diff/database_time.rbs +48 -0
  146. data/sig/generated/paper_trail_diff/deleted_analysis_batch.rbs +13 -15
  147. data/sig/generated/paper_trail_diff/deleted_root_filter.rbs +4 -0
  148. data/sig/generated/paper_trail_diff/diagnostics.rbs +13 -31
  149. data/sig/generated/paper_trail_diff/endpoint.rbs +14 -1
  150. data/sig/generated/paper_trail_diff/errors.rbs +0 -8
  151. data/sig/generated/paper_trail_diff/exact_column_type.rbs +51 -0
  152. data/sig/generated/paper_trail_diff/historical_snapshot_store.rbs +51 -31
  153. data/sig/generated/paper_trail_diff/instrumentation.rbs +0 -5
  154. data/sig/generated/paper_trail_diff/nested_comparator.rbs +21 -0
  155. data/sig/generated/paper_trail_diff/paper_trail_adapter.rbs +18 -29
  156. data/sig/generated/paper_trail_diff/prepared_activity_index.rbs +149 -94
  157. data/sig/generated/paper_trail_diff/prepared_child_candidates.rbs +10 -2
  158. data/sig/generated/paper_trail_diff/prepared_edge_loader.rbs +4 -21
  159. data/sig/generated/paper_trail_diff/prepared_history.rbs +22 -79
  160. data/sig/generated/paper_trail_diff/prepared_history_loader.rbs +24 -32
  161. data/sig/generated/paper_trail_diff/prepared_record_index.rbs +137 -63
  162. data/sig/generated/paper_trail_diff/prepared_snapshot_builder.rbs +22 -13
  163. data/sig/generated/paper_trail_diff/prepared_state_association_reader.rbs +41 -28
  164. data/sig/generated/paper_trail_diff/recorded_changes.rbs +19 -3
  165. data/sig/generated/paper_trail_diff/recorded_owner.rbs +39 -0
  166. data/sig/generated/paper_trail_diff/root_version_selection.rbs +4 -1
  167. data/sig/generated/paper_trail_diff/scope_condition.rbs +65 -52
  168. data/sig/generated/paper_trail_diff/scope_ranking.rbs +10 -23
  169. data/sig/generated/paper_trail_diff/scoped_analysis.rbs +11 -6
  170. data/sig/generated/paper_trail_diff/scoped_analysis_builder.rbs +7 -2
  171. data/sig/generated/paper_trail_diff/scoped_root_selection.rbs +49 -43
  172. data/sig/generated/paper_trail_diff/selection_window.rbs +19 -0
  173. data/sig/generated/paper_trail_diff/snapshot.rbs +37 -38
  174. data/sig/generated/paper_trail_diff/snapshot_members.rbs +58 -0
  175. data/sig/generated/paper_trail_diff/snapshot_normalizer.rbs +0 -4
  176. data/sig/generated/paper_trail_diff/stored_form.rbs +63 -0
  177. data/sig/generated/paper_trail_diff/stored_json_values.rbs +0 -2
  178. data/sig/generated/paper_trail_diff/stored_time_precision.rbs +33 -20
  179. data/sig/generated/paper_trail_diff/stored_values.rbs +18 -2
  180. data/sig/generated/paper_trail_diff/support.rbs +96 -16
  181. data/sig/generated/paper_trail_diff/time_of_day.rbs +4 -0
  182. data/sig/generated/paper_trail_diff/time_range.rbs +49 -4
  183. data/sig/generated/paper_trail_diff/time_version_range.rbs +3 -0
  184. data/sig/generated/paper_trail_diff/timeline_builder.rbs +3 -6
  185. data/sig/generated/paper_trail_diff/timeline_range.rbs +29 -8
  186. data/sig/generated/paper_trail_diff/timeline_snapshot_provider.rbs +17 -4
  187. data/sig/generated/paper_trail_diff/total_order.rbs +9 -3
  188. data/sig/generated/paper_trail_diff/transaction_anchors.rbs +80 -0
  189. data/sig/generated/paper_trail_diff/transaction_cut.rbs +43 -176
  190. data/sig/generated/paper_trail_diff/transaction_ends.rbs +124 -0
  191. data/sig/generated/paper_trail_diff/traversal_preparer.rbs +6 -11
  192. data/sig/generated/paper_trail_diff/{approximate_paths.rbs → unreadable_paths.rbs} +6 -7
  193. data/sig/generated/paper_trail_diff/value_objects.rbs +4 -2
  194. data/sig/generated/paper_trail_diff/version_association_candidate_scope.rbs +16 -2
  195. data/sig/generated/paper_trail_diff/version_boundary.rbs +0 -14
  196. data/sig/generated/paper_trail_diff/version_query.rbs +26 -0
  197. data/sig/generated/paper_trail_diff/version_scope_filter.rbs +28 -2
  198. data/sig/generated/paper_trail_diff/version_sequence_diagnostics.rbs +4 -15
  199. data/sig/generated/paper_trail_diff/version_table.rbs +4 -0
  200. data/sig/generated/paper_trail_diff.rbs +22 -23
  201. metadata +28 -20
  202. data/lib/paper_trail_diff/activity_target_candidate_loader.rb +0 -123
  203. data/lib/paper_trail_diff/fallback_paths.rb +0 -35
  204. data/lib/paper_trail_diff/habtm_transaction_owners.rb +0 -70
  205. data/lib/paper_trail_diff/historical_association_reifier.rb +0 -161
  206. data/lib/paper_trail_diff/historical_filter.rb +0 -210
  207. data/lib/paper_trail_diff/own_window.rb +0 -35
  208. data/lib/paper_trail_diff/prepared_association_reifier.rb +0 -51
  209. data/sig/generated/paper_trail_diff/activity_target_candidate_loader.rbs +0 -74
  210. data/sig/generated/paper_trail_diff/fallback_paths.rbs +0 -22
  211. data/sig/generated/paper_trail_diff/habtm_transaction_owners.rbs +0 -41
  212. data/sig/generated/paper_trail_diff/historical_association_reifier.rbs +0 -58
  213. data/sig/generated/paper_trail_diff/historical_filter.rbs +0 -96
  214. data/sig/generated/paper_trail_diff/own_window.rbs +0 -22
  215. data/sig/generated/paper_trail_diff/prepared_association_reifier.rbs +0 -27
@@ -0,0 +1,48 @@
1
+ # Generated from lib/paper_trail_diff/database_time.rb with RBS::Inline
2
+
3
+ module PaperTrailDiff
4
+ # Reads a date, or text, given for a datetime column as the database keeps
5
+ # it: in Active Record's default time zone, not Time.zone.
6
+ #
7
+ # Active Record leaves a date assigned to a datetime column on the instance
8
+ # as it was given when time zone aware attributes are off, or when
9
+ # `update_columns` writes it, and PaperTrail stores it from there. The
10
+ # database keeps midnight in its own zone, and `where` sends text or a date
11
+ # to the database as it is. Read through the attribute instead, a date
12
+ # would be midnight in Time.zone, or not a time at all.
13
+ module DatabaseTime
14
+ # A date as JSON writes one, with no time.
15
+ DATE_TEXT: ::Regexp
16
+
17
+ # The same date in stored text: YAML writes it as a bare value at the
18
+ # end of its line, JSON as quoted text.
19
+ STORED_DATE: ::Regexp
20
+
21
+ # A stored value of a datetime column, with a date in it read as
22
+ # midnight where the database keeps it. A change's values are a pair.
23
+ # : (untyped) -> untyped
24
+ def self.stored: (untyped) -> untyped
25
+
26
+ # A date or text given for a datetime column, as the database reads it
27
+ # when `where` sends it: in its own time zone, unless the text names its
28
+ # offset. Anything else, and text that names no time, is returned as it
29
+ # is.
30
+ # : (untyped) -> untyped
31
+ def self.cast: (untyped) -> untyped
32
+
33
+ # Whether a version's stored attributes hold a date with no time for a
34
+ # model with a datetime column, which only then is read again.
35
+ # : (untyped, untyped) -> bool
36
+ def self.stored_date?: (untyped, untyped) -> bool
37
+
38
+ # A Date; the packaged signatures name only core types.
39
+ # : (untyped) -> Time
40
+ def self.midnight: (untyped) -> Time
41
+
42
+ # : () -> bool
43
+ def self.local?: () -> bool
44
+
45
+ # : (String) -> untyped
46
+ def self.written_date: (String) -> untyped
47
+ end
48
+ end
@@ -5,10 +5,8 @@ module PaperTrailDiff
5
5
  class DeletedAnalysisBatch
6
6
  # `context_required` reads a root that did not change in the window from
7
7
  # the version after it, so its associations' activity can be reported.
8
- # `traversal` names the requested paths, which decide where a window's
9
- # edges move (see TransactionCut).
10
- # : (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, version_scope: untyped, context_required: bool, traversal: AssociationTraversal?) -> void
11
- def initialize: (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, version_scope: untyped, context_required: bool, traversal: AssociationTraversal?) -> void
8
+ # : (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, version_scope: untyped, context_required: bool, reach: untyped) -> void
9
+ def initialize: (untyped, identities: Array[Array[String]], time_range: TimeRange?, analyzer: untyped, history_preparer: untyped, version_scope: untyped, context_required: bool, reach: untyped) -> void
12
10
 
13
11
  # : () -> Hash[Array[String], Analysis?]
14
12
  def call: () -> Hash[Array[String], Analysis?]
@@ -28,22 +26,22 @@ module PaperTrailDiff
28
26
 
29
27
  @model: untyped
30
28
 
31
- @time_range: TimeRange?
29
+ @reach: untyped
32
30
 
33
- @traversal: AssociationTraversal?
31
+ @time_range: TimeRange?
34
32
 
35
33
  @version_scope: untyped
36
34
 
37
- # A root destroyed before the window had no state inside it to read, so
38
- # only the others take the version after the window as context. Every
39
- # root replays the whole of its window for activity on associations: one
40
- # whose destroy saved in a transaction that crossed the window's start
41
- # has the destroy inside its moved window.
42
- # : (Array[untyped], Array[untyped], Hash[Array[String], TimeRange]) -> Hash[Array[String], RootVersionPlan]
43
- def plans: (Array[untyped], Array[untyped], Hash[Array[String], TimeRange]) -> Hash[Array[String], RootVersionPlan]
35
+ # A root destroyed before the range had no state inside it to read, so
36
+ # only the others take the version after the range as context. Every
37
+ # root replays the whole of its range for activity on associations. The
38
+ # range is the window, or the window widened to where the transactions
39
+ # open at its start began, which can hold a destroy that one of them saved.
40
+ # : (Array[untyped], Array[untyped], TimeRange?) -> Hash[Array[String], RootVersionPlan]
41
+ def plans: (Array[untyped], Array[untyped], TimeRange?) -> Hash[Array[String], RootVersionPlan]
44
42
 
45
- # : (Array[untyped], bool, Hash[Array[String], TimeRange]) -> Hash[Array[String], RootVersionPlan]
46
- def plans_for: (Array[untyped], bool, Hash[Array[String], TimeRange]) -> Hash[Array[String], RootVersionPlan]
43
+ # : (Array[untyped], bool, TimeRange?) -> Hash[Array[String], RootVersionPlan]
44
+ def plans_for: (Array[untyped], bool, TimeRange?) -> Hash[Array[String], RootVersionPlan]
47
45
 
48
46
  # These records supply identity and model metadata only. Every reported
49
47
  # value comes from the batched historical plan; no per-root reify or live
@@ -33,6 +33,10 @@ module PaperTrailDiff
33
33
  # : () -> untyped
34
34
  def model: () -> untyped
35
35
 
36
+ # Whether the relation selects each root its destroy recorded, by id.
37
+ # : (Array[String]) -> Hash[String, bool]
38
+ def selected: (Array[String]) -> Hash[String, bool]
39
+
36
40
  # : (Hash[String, untyped]?) -> bool
37
41
  def selected?: (Hash[String, untyped]?) -> bool
38
42
 
@@ -42,14 +42,14 @@ module PaperTrailDiff
42
42
 
43
43
  # Performs read-only checks for known PaperTrail/PT-AT reconstruction hazards.
44
44
  #
45
- # The endpoints are a comparison's: two versions, or a version and the
46
- # current record, in either order. Two current records read no history, so
45
+ # The endpoints are a comparison's: two versions in time order, or a
46
+ # version and the current record, in either order. Two current records read no history, so
47
47
  # nothing is checked.
48
48
  class HistoryDiagnostics
49
49
  STOPPING_CODES: untyped
50
50
 
51
- # : (untyped, untyped, associations: association_option, ?allow_approximate: bool) -> void
52
- def initialize: (untyped, untyped, associations: association_option, ?allow_approximate: bool) -> void
51
+ # : (untyped, untyped, associations: association_option) -> void
52
+ def initialize: (untyped, untyped, associations: association_option) -> void
53
53
 
54
54
  # : () -> DiagnosticReport
55
55
  def call: () -> DiagnosticReport
@@ -62,8 +62,6 @@ module PaperTrailDiff
62
62
  # : (untyped) -> void
63
63
  def inspect_associations: (untyped) -> void
64
64
 
65
- @allow_approximate: bool
66
-
67
65
  @issues: Array[DiagnosticIssue]
68
66
 
69
67
  @preparer: TraversalPreparer
@@ -74,46 +72,30 @@ module PaperTrailDiff
74
72
 
75
73
  @versions: Array[untyped]
76
74
 
77
- # The endpoints that are versions, in the order given.
75
+ # The endpoints that are versions, in the order given. Endpoints that
76
+ # `compare` rejects whatever their history raise as it would.
78
77
  # : (untyped, untyped) -> Array[untyped]
79
78
  def validated_versions: (untyped, untyped) -> Array[untyped]
80
79
 
81
80
  # : (Array[Array[untyped]]) -> void
82
81
  def inspect_polymorphic_targets: (Array[Array[untyped]]) -> void
83
82
 
84
- # Accepted, but read the way `allow_approximate:` describes.
85
- # : (untyped) -> void
86
- def inspect_approximate_paths: (untyped) -> void
87
-
88
- # : (untyped, Array[Array[untyped]]) -> void
89
- def inspect_habtm: (untyped, Array[Array[untyped]]) -> void
90
-
91
- # PT-AT does not record which owner a HABTM member belongs to, so a
92
- # transaction that more than one owner recorded members in cannot be read.
93
- # : (untyped, Array[Array[untyped]]) -> void
94
- def inspect_shared_transactions: (untyped, Array[Array[untyped]]) -> void
95
-
96
83
  # With the current record as one endpoint there is one version, and the
97
84
  # sequence runs on from it.
98
- # : (untyped) -> void
99
- def inspect_version_sequence: (untyped) -> void
100
-
101
- # Only a path PT-AT reads can lose a change between tied versions, and a
102
- # traversal that does not resolve reads nothing at all.
103
- # : (untyped) -> bool
104
- def fallback_selected?: (untyped) -> bool
85
+ # : () -> void
86
+ def inspect_version_sequence: () -> void
105
87
 
106
88
  # : (untyped) -> void
107
89
  def inspect_checkpoint_timestamp: (untyped) -> void
108
90
 
109
- # : (Array[String]) -> void
110
- def inspect_transaction_metadata: (Array[String]) -> void
111
-
112
91
  # : (untyped) -> bool
113
92
  def synchronized_timestamp_disabled?: (untyped) -> bool
114
93
 
115
- # : (Symbol, String, ?String?, ?untyped) -> void
116
- def add_error: (Symbol, String, ?String?, ?untyped) -> void
94
+ # : (String) -> DiagnosticReport
95
+ def report_stateless: (String) -> DiagnosticReport
96
+
97
+ # : (Symbol, String, ?String?) -> void
98
+ def add_error: (Symbol, String, ?String?) -> void
117
99
 
118
100
  # : (Symbol, String, ?String?) -> void
119
101
  def add_warning: (Symbol, String, ?String?) -> void
@@ -22,7 +22,9 @@ module PaperTrailDiff
22
22
  def self.validate!: (untyped) -> void
23
23
 
24
24
  # The record a method reads the history of: a record, saved or destroyed,
25
- # of a model PaperTrail versions.
25
+ # of a model PaperTrail versions, or one PaperTrail rebuilt. A saved
26
+ # record's history ends at its row, so unsaved changes to it have no place
27
+ # in it, with or without a window.
26
28
  # : (untyped) -> void
27
29
  def self.validate_root!: (untyped) -> void
28
30
 
@@ -68,6 +70,17 @@ module PaperTrailDiff
68
70
  def self.validate_record!: (untyped) -> void
69
71
  end
70
72
 
73
+ # Whether a history can be read: of a model, and from a version given.
74
+ module ReadableHistory
75
+ # : (untyped) -> void
76
+ def self.check_model!: (untyped) -> void
77
+
78
+ # A version read with `select` can lack the column its state, or its
79
+ # changes, are in.
80
+ # : (untyped, ?String) -> void
81
+ def self.check_version!: (untyped, ?String) -> void
82
+ end
83
+
71
84
  # Whether a value is a version, a record, or neither, answered once for
72
85
  # each Active Record class (see Support.per_model).
73
86
  module EndpointKind
@@ -47,10 +47,6 @@ module PaperTrailDiff
47
47
  class BatchLimitExceededError < Error
48
48
  end
49
49
 
50
- # Historical candidate loading exceeded its explicitly bounded work budget.
51
- class FilterLimitExceededError < Error
52
- end
53
-
54
50
  # Raised when a requested ActiveRecord association does not exist.
55
51
  class UnknownAssociationError < Error
56
52
  end
@@ -72,8 +68,4 @@ module PaperTrailDiff
72
68
  # or a polymorphic type names no class.
73
69
  class IncompleteAssociationHistoryError < Error
74
70
  end
75
-
76
- # Raised when current-ended activity cannot be reconstructed for a selected association.
77
- class UnsupportedLiveActivityError < Error
78
- end
79
71
  end
@@ -0,0 +1,51 @@
1
+ # Generated from lib/paper_trail_diff/exact_column_type.rb with RBS::Inline
2
+
3
+ module PaperTrailDiff
4
+ # The kind of value a column holds when its database compares it exactly
5
+ # as Ruby compares the attribute's values, which is what lets ScopeCondition
6
+ # and ScopeRanking decide a scope in Ruby. Each adapter lists the SQL types
7
+ # it compares that way, so a type it does not list, such as PostgreSQL's
8
+ # character(n) or citext, and an adapter it does not know, leave a scope
9
+ # that compares them unreadable rather than being trusted.
10
+ module ExactColumnType
11
+ # Kinds by SQL type, without its size, precision or scale. Integers,
12
+ # booleans and dates compare alike everywhere listed. Text compares
13
+ # exactly only where the database compares strings byte by byte by
14
+ # default: MySQL and SQL Server ignore case and trailing spaces, and
15
+ # PostgreSQL pads character(n). A datetime is listed where it keeps the
16
+ # value Active Record writes; SQL Server's datetime rounds it to 1/300 s.
17
+ # A time of day is not listed: in memory it keeps the date it was given,
18
+ # which the database drops.
19
+ MYSQL_TYPES: untyped
20
+
21
+ SQL_TYPES: untyped
22
+
23
+ # The Active Model type that casts each kind's values in Ruby, named so
24
+ # that loading needs no Active Model. An attribute type of another class,
25
+ # such as one that serializes or encrypts the column, reads no kind.
26
+ RUBY_TYPES: untyped
27
+
28
+ # Rails wraps a time-zone-aware attribute's type, by default every
29
+ # datetime's, in this delegator; the time it stores is the wrapped type's.
30
+ TIME_ZONE_TYPE: ::String
31
+
32
+ # nil for anything but a column of the model's own table whose SQL type
33
+ # its adapter lists and whose attribute type reads that kind. Text with
34
+ # its own collation compares as that collation says, so it reads none.
35
+ # : (untyped, String?) -> Symbol?
36
+ def self.kind: (untyped, String?) -> Symbol?
37
+
38
+ # : (untyped, Symbol) -> bool
39
+ def self.casts?: (untyped, Symbol) -> bool
40
+
41
+ # The type of the value a column stores, under an enum or time zone
42
+ # wrapper. An enum stores what its subtype casts.
43
+ # : (untyped) -> untyped
44
+ def self.stored_type: (untyped) -> untyped
45
+
46
+ # A type is listed with its size where that changes its kind, as MySQL's
47
+ # tinyint(1) holds a boolean.
48
+ # : (String, String) -> Symbol?
49
+ def self.sql_kind: (String, String) -> Symbol?
50
+ end
51
+ end
@@ -9,11 +9,18 @@ module PaperTrailDiff
9
9
  # : (traversal: AssociationTraversal, normalizer: SnapshotNormalizer, preparer: untyped) -> void
10
10
  def initialize: (traversal: AssociationTraversal, normalizer: SnapshotNormalizer, preparer: untyped) -> void
11
11
 
12
- # A `start_at` is a window's (see PreparedHistoryLoader); a range of
13
- # versions starts at its first.
12
+ # A `start_at` is a window's, already moved back to its reach (see
13
+ # PreparedHistoryLoader); a range of versions starts at its first.
14
14
  # : (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedHistory?
15
15
  def prepare: (untyped, Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedHistory?
16
16
 
17
+ # Where a range of the record's ending at the version ends (see
18
+ # TransactionCut.range_end). A batch's history has asked already, and a
19
+ # root read alone reads no other record whose saves could take effect
20
+ # before its transaction's.
21
+ # : (untyped, untyped) -> untyped
22
+ def range_end_of: (untyped, untyped) -> untyped
23
+
17
24
  # A `start_at` is a window's, as for `prepare`. A window's roots may have
18
25
  # no version in it, when only their descendants changed there.
19
26
  # : (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
@@ -25,10 +32,26 @@ module PaperTrailDiff
25
32
  # : (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
26
33
  def prepare_deleted_batch: (Array[untyped], Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
27
34
 
35
+ # Where the earliest transaction open at a window's start began (see
36
+ # AssociationTraversal#reach_before). A window is read from there: a root
37
+ # destroyed just before it, by a transaction that went on to save its
38
+ # tree inside, is reported in the window.
39
+ # : (untyped, untyped) -> untyped
40
+ def reach_before: (untyped, untyped) -> untyped
41
+
28
42
  # `history` is the one `prepare` returned for this root, if any.
43
+ # A snapshot read for a timeline whose transactions overlapped reads each
44
+ # record as that timeline places its transactions (see
45
+ # PreparedRecordIndex#reading), so it is kept apart from one read without.
29
46
  # : (untyped, untyped, ?history: PreparedHistory?) -> RecordSnapshot?
30
47
  def call: (untyped, untyped, ?history: PreparedHistory?) -> RecordSnapshot?
31
48
 
49
+ # A version compared alone reads as a timeline reads it: each record as
50
+ # it stood before every transaction that had not ended at the version
51
+ # (see TransactionEnds).
52
+ # : (untyped) -> RecordSnapshot?
53
+ def at_version: (untyped) -> RecordSnapshot?
54
+
32
55
  # : (untyped, untyped, ?history: PreparedHistory?) -> RecordSnapshot?
33
56
  def uncached: (untyped, untyped, ?history: PreparedHistory?) -> RecordSnapshot?
34
57
 
@@ -41,8 +64,11 @@ module PaperTrailDiff
41
64
  # : (untyped) -> PreparedRecordState?
42
65
  def root_state: (untyped) -> PreparedRecordState?
43
66
 
44
- # : (untyped, habtm_version: untyped, ?history: PreparedHistory?) -> untyped
45
- def association_reader: (untyped, habtm_version: untyped, ?history: PreparedHistory?) -> untyped
67
+ # A member's snapshot at `path`, with the associations `tree` selects
68
+ # below it as the version reads them. Callers pass the root's history; a
69
+ # batch's for the version is the rest.
70
+ # : (PreparedRecordState, untyped, tree: AssociationTree, path: String, incoming: untyped, normalizer: SnapshotNormalizer, ?history: PreparedHistory?) -> RecordSnapshot
71
+ def member: (PreparedRecordState, untyped, tree: AssociationTree, path: String, incoming: untyped, normalizer: SnapshotNormalizer, ?history: PreparedHistory?) -> RecordSnapshot
46
72
 
47
73
  private
48
74
 
@@ -68,15 +94,24 @@ module PaperTrailDiff
68
94
 
69
95
  @tree: AssociationTree
70
96
 
71
- # A batch's history for the version wins over the one a caller passes.
72
- # : (untyped, PreparedHistory?) -> PreparedHistory?
73
- def history_for: (untyped, PreparedHistory?) -> PreparedHistory?
97
+ # The history a root is read from: the one its batch prepared for it,
98
+ # then the one a caller passes, then a batch's for the version. A batch
99
+ # prepares one history per class of its roots, and a boundary can be a
100
+ # version of a root of another class that stands in this root's tree,
101
+ # whose history never loaded this root's associations.
102
+ # : (untyped, untyped, PreparedHistory?) -> PreparedHistory?
103
+ def history_for: (untyped, untyped, PreparedHistory?) -> PreparedHistory?
104
+
105
+ # A history read to its root versions is read to where their
106
+ # transactions take effect (see TransactionCut.range_end).
107
+ # : (Array[untyped]) -> untyped
108
+ def range_end: (Array[untyped]) -> untyped
74
109
 
75
110
  # : (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]
76
111
  def batch_payload: (Array[untyped], Array[untyped]) -> Hash[Symbol, untyped]
77
112
 
78
- # : (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
79
- def register_batch: (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> void
113
+ # : (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedHistory
114
+ def register_batch: (Array[untyped], Array[untyped], ?live_records: Array[untyped], ?start_at: untyped, ?end_at: untyped) -> PreparedHistory
80
115
 
81
116
  # Snapshot reads find the history by root version, and `prepare` by root.
82
117
  # : (PreparedHistory, Array[untyped], Array[untyped]) -> void
@@ -85,33 +120,18 @@ module PaperTrailDiff
85
120
  # : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot?
86
121
  def snapshot_from_version: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot?
87
122
 
88
- # Read from prepared history where it can be, as a version is, without
89
- # instantiating the root's members. Only the fallback, which writes the
90
- # members it rebuilds onto the root, needs a record of its own.
91
- # : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot?
92
- def snapshot_from_live_root: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot?
123
+ # Read from prepared history, as a version is, without instantiating the
124
+ # root's members.
125
+ # : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot
126
+ def snapshot_from_live_root: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, history: PreparedHistory?) -> RecordSnapshot
93
127
 
94
128
  # The state of the root's row, read once for the call: every snapshot
95
- # that starts from the row starts from the same state. Reading it writes
96
- # nothing to the row, so it is read from the loaded record itself, whose
97
- # columns the current snapshot reads too.
129
+ # that starts from the row starts from the same state. A batch loaded the
130
+ # row already; otherwise it is read here, from the record whose columns
131
+ # the current snapshot reads too.
98
132
  # : (untyped) -> PreparedRecordState
99
133
  def live_state: (untyped) -> PreparedRecordState
100
134
 
101
- # Rebuilding a version's associations writes them onto the record, so each
102
- # snapshot that does gets its own copy of the root's row, built from the
103
- # row's stored values without a query.
104
- # : (untyped) -> untyped
105
- def live_root: (untyped) -> untyped
106
-
107
- # A batch loaded the row already; otherwise it is read once, so every
108
- # snapshot of the call starts from the same row.
109
- # : (untyped, identity) -> untyped
110
- def loaded_root: (untyped, identity) -> untyped
111
-
112
- # : (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, habtm_version: untyped, history: PreparedHistory?) -> RecordSnapshot?
113
- def normalize: (untyped, untyped, tree: AssociationTree, normalizer: SnapshotNormalizer, habtm_version: untyped, history: PreparedHistory?) -> RecordSnapshot?
114
-
115
135
  # : (untyped, untyped) -> Array[untyped]
116
136
  def snapshot_key: (untyped, untyped) -> Array[untyped]
117
137
  end
@@ -5,10 +5,5 @@ module PaperTrailDiff
5
5
  module Instrumentation
6
6
  # : (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped
7
7
  def self?.instrument: (String | Symbol, Hash[Symbol, untyped]) { () -> untyped } -> untyped
8
-
9
- # Reports a condition rather than timing work: nothing failed, but the
10
- # result may be incomplete and only the application can judge that.
11
- # : (String | Symbol, Hash[Symbol, untyped]) -> void
12
- def self?.notify: (String | Symbol, Hash[Symbol, untyped]) -> void
13
8
  end
14
9
  end
@@ -46,6 +46,24 @@ module PaperTrailDiff
46
46
  # : (untyped) -> untyped
47
47
  def self.comparable: (untyped) -> untyped
48
48
 
49
+ # The comparable value as a Hash key: two values Support.same? reads
50
+ # alike are one key, as the attribute diff and the walk through a hash
51
+ # read them. A Hash looks its keys up with `eql?`, which also tells an
52
+ # Integer from a BigDecimal of the same value, so every number is read as
53
+ # a rational beside whether it is a Float, at any depth. One that is not
54
+ # finite has no rational: an infinity keeps its sign, and every NaN is one
55
+ # key, as a database stores it.
56
+ # : (untyped) -> untyped
57
+ def self.countable: (untyped) -> untyped
58
+
59
+ # : (Numeric) -> untyped
60
+ def self.number_key: (Numeric) -> untyped
61
+
62
+ # The number as a rational, or as it is when it has none: a complex
63
+ # number or an infinity. A NaN, which equals nothing, reads as nil.
64
+ # : (untyped) -> untyped
65
+ def self.rational: (untyped) -> untyped
66
+
49
67
  # The hash keyed by name, each value as the block returns it. Two keys
50
68
  # with one name, such as `:a` and `"a"`, cannot both be kept.
51
69
  # : (Hash[untyped, untyped]) { (untyped) -> untyped } -> Hash[String, untyped]
@@ -81,6 +99,9 @@ module PaperTrailDiff
81
99
  # : (Hash[untyped, untyped], Hash[untyped, untyped], Array[String], nested_changes) -> void
82
100
  def walk: (Hash[untyped, untyped], Hash[untyped, untyped], Array[String], nested_changes) -> void
83
101
 
102
+ # : (untyped, untyped, Array[String], nested_changes) -> void
103
+ def visit: (untyped, untyped, Array[String], nested_changes) -> void
104
+
84
105
  # : (Hash[untyped, untyped]) -> Hash[String, untyped]
85
106
  def normalize_keys: (Hash[untyped, untyped]) -> Hash[String, untyped]
86
107
 
@@ -6,10 +6,10 @@ module PaperTrailDiff
6
6
  # the only place allowed to know about both PaperTrail and the pure engine.
7
7
  # Reconstruction logic lives in the collaborators it wires together.
8
8
  class PaperTrailAdapter
9
- # `recorded_changes:` reads what each activity boundary's version recorded.
10
- # `allow_approximate:` accepts association paths read with PT-AT.
11
- # : (associations: association_option, ignore: ignore_option, ?recorded_changes: bool, ?allow_approximate: bool) -> void
12
- def initialize: (associations: association_option, ignore: ignore_option, ?recorded_changes: bool, ?allow_approximate: bool) -> void
9
+ # `recorded_changes:` reads what each activity boundary's version
10
+ # recorded, as activity does unless told not to.
11
+ # : (associations: association_option, ignore: ignore_option, ?recorded_changes: bool?) -> void
12
+ def initialize: (associations: association_option, ignore: ignore_option, ?recorded_changes: bool?) -> void
13
13
 
14
14
  # : (untyped, untyped) -> Diff
15
15
  def compare: (untyped, untyped) -> Diff
@@ -18,12 +18,6 @@ module PaperTrailDiff
18
18
  # : (Array[comparison_input]) -> comparison_results
19
19
  def compare_many: (Array[comparison_input]) -> comparison_results
20
20
 
21
- # : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[Step]
22
- def timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped) -> Array[Step]
23
-
24
- # : (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?) -> Array[ActivityStep]
25
- def activity_timeline: (untyped, from: untyped, to: untyped, within: untyped, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?) -> Array[ActivityStep]
26
-
27
21
  # : (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?) -> Analysis
28
22
  def analyze: (untyped, from: untyped, to: untyped, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?) -> Analysis
29
23
 
@@ -35,8 +29,8 @@ module PaperTrailDiff
35
29
  # caller reporting on a population does not have to rediscover which of its
36
30
  # members changed. The roots the relation could not reach come back named
37
31
  # rather than dropped -- see `PaperTrailDiff.analyze_scope`.
38
- # : (untyped, limit: Integer?, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?historical_filter: untyped, ?max_filter_versions: Integer, ?include_deleted: bool) -> ScopedAnalysis
39
- def analyze_scope: (untyped, limit: Integer?, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?historical_filter: untyped, ?max_filter_versions: Integer, ?include_deleted: bool) -> ScopedAnalysis
32
+ # : (untyped, limit: Integer?, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool) -> ScopedAnalysis
33
+ def analyze_scope: (untyped, limit: Integer?, within: untyped, ?activity: bool, ?version_scope: untyped, ?snapshots: bool, ?group: Symbol?, ?include_deleted: bool) -> ScopedAnalysis
40
34
 
41
35
  private
42
36
 
@@ -55,6 +49,10 @@ module PaperTrailDiff
55
49
  # : (Array[untyped], within: untyped, activity: bool, version_scope: untyped, view: ActivityView) -> Hash[identity, Analysis]
56
50
  def analyze_batch: (Array[untyped], within: untyped, activity: bool, version_scope: untyped, view: ActivityView) -> Hash[identity, Analysis]
57
51
 
52
+ # The window as the models' version tables keep times.
53
+ # : (untyped, Array[untyped]) -> TimeRange?
54
+ def time_range: (untyped, Array[untyped]) -> TimeRange?
55
+
58
56
  # Analysis reads association history, so a request it would refuse is
59
57
  # refused before the first selection query rather than once analysis starts.
60
58
  # : (untyped) -> void
@@ -74,8 +72,8 @@ module PaperTrailDiff
74
72
  # : (untyped, Array[Array[String]], Hash[Symbol, untyped]) -> Hash[Array[String], Analysis?]
75
73
  def analyze_deleted: (untyped, Array[Array[String]], Hash[Symbol, untyped]) -> Hash[Array[String], Analysis?]
76
74
 
77
- # : (untyped, limit: Integer?, within: untyped, activity: bool, version_scope: untyped, historical_filter: untyped, max_filter_versions: Integer, include_deleted: bool, view: ActivityView) -> ScopedAnalysisBuilder
78
- def scoped_builder: (untyped, limit: Integer?, within: untyped, activity: bool, version_scope: untyped, historical_filter: untyped, max_filter_versions: Integer, include_deleted: bool, view: ActivityView) -> ScopedAnalysisBuilder
75
+ # : (untyped, limit: Integer?, within: untyped, activity: bool, version_scope: untyped, include_deleted: bool, view: ActivityView) -> ScopedAnalysisBuilder
76
+ def scoped_builder: (untyped, limit: Integer?, within: untyped, activity: bool, version_scope: untyped, include_deleted: bool, view: ActivityView) -> ScopedAnalysisBuilder
79
77
 
80
78
  @activity_snapshotter: ActivitySnapshotProvider
81
79
 
@@ -91,7 +89,7 @@ module PaperTrailDiff
91
89
 
92
90
  @normalizer: SnapshotNormalizer
93
91
 
94
- @recorded: IgnorePolicy?
92
+ @recorded_changes: bool?
95
93
 
96
94
  @snapshot_pool: SnapshotPool
97
95
 
@@ -101,26 +99,17 @@ module PaperTrailDiff
101
99
 
102
100
  @traversal_preparer: TraversalPreparer
103
101
 
104
- # The result may still be correct -- nothing the path reaches may have
105
- # changed -- and the gem cannot tell which, since not seeing the change is
106
- # the symptom. So it reports the condition and leaves the judgement to the
107
- # application.
108
- # : (untyped, untyped) -> void
109
- def notify_ambiguous_association_boundary: (untyped, untyped) -> void
110
-
111
- # Loaded history orders two versions that share a timestamp by id, but
112
- # PT-AT places association changes by timestamp alone, so only a path it
113
- # reads can lose a change between them. A request the preparer refuses
114
- # raises here, before anything is reported.
115
- # : (untyped, untyped) -> bool
116
- def ambiguous_association_boundary?: (untyped, untyped) -> bool
117
-
118
102
  # With neither a window nor endpoints, a range is the record's whole
119
103
  # history through its current saved state; a missing endpoint takes that
120
104
  # side of the same default.
121
105
  # : (untyped, untyped, untyped, untyped) -> [untyped, untyped]
122
106
  def default_range: (untyped, untyped, untyped, untyped) -> [ untyped, untyped ]
123
107
 
108
+ # The current record, or a destroyed one's last version, which a window
109
+ # also ends at: its history stops at the destroy.
110
+ # : (untyped) -> untyped
111
+ def default_end: (untyped) -> untyped
112
+
124
113
  # A window with nothing recorded after its last change ends at the live
125
114
  # record, which holds the state that change produced -- whether the window
126
115
  # ended a moment ago or long before. Explicit endpoints name their own end.