branchproof 0.7.0 → 0.9.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 (75) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +53 -0
  3. data/README.md +255 -21
  4. data/doc/Branchproof/Analyzer.md +2 -2
  5. data/doc/Branchproof/CLI.md +4 -0
  6. data/doc/Branchproof/ComparisonReport.md +4 -0
  7. data/doc/Branchproof/Constraints/Solver.md +21 -0
  8. data/doc/Branchproof/Constraints.md +98 -0
  9. data/doc/Branchproof/CoverageIndex.md +3 -0
  10. data/doc/Branchproof/DecisionSyntax.md +6 -4
  11. data/doc/Branchproof/DecisionTable.md +153 -0
  12. data/doc/Branchproof/DefaultInstrumentation.md +13 -0
  13. data/doc/Branchproof/DefaultRuntime.md +11 -0
  14. data/doc/Branchproof/DefaultSyntax.md +7 -0
  15. data/doc/Branchproof/ExceptionInstrumentation.md +9 -0
  16. data/doc/Branchproof/ExceptionRuntime.md +27 -0
  17. data/doc/Branchproof/ExceptionSyntax.md +9 -0
  18. data/doc/Branchproof/ExtendedAlternativeRuntime.md +19 -0
  19. data/doc/Branchproof/FocusedReport.md +5 -2
  20. data/doc/Branchproof/Instrumenter.md +1 -1
  21. data/doc/Branchproof/IterationInstrumentation.md +7 -0
  22. data/doc/Branchproof/IterationRuntime.md +21 -0
  23. data/doc/Branchproof/IterationSyntax.md +11 -0
  24. data/doc/Branchproof/Loader.md +0 -4
  25. data/doc/Branchproof/MinitestAdapter.md +0 -3
  26. data/doc/Branchproof/Report.md +18 -0
  27. data/doc/Branchproof/Runtime.md +60 -1
  28. data/doc/Branchproof/SavedReport.md +15 -0
  29. data/doc/Branchproof/Source.md +7 -1
  30. data/doc/Branchproof/ValueInstrumentation.md +7 -0
  31. data/doc/Branchproof/ValueRuntime.md +26 -0
  32. data/doc/Branchproof/ValueSyntax.md +26 -0
  33. data/doc/Branchproof.md +20 -3
  34. data/doc/CHANGELOG.md +53 -0
  35. data/doc/README.md +255 -21
  36. data/lib/branchproof/analyzer.rb +80 -44
  37. data/lib/branchproof/cli.rb +28 -19
  38. data/lib/branchproof/comparison.rb +207 -19
  39. data/lib/branchproof/comparison_report.rb +49 -1
  40. data/lib/branchproof/constraints.rb +363 -0
  41. data/lib/branchproof/coverage_index.rb +30 -1
  42. data/lib/branchproof/decision_syntax.rb +50 -24
  43. data/lib/branchproof/decision_table.rb +377 -0
  44. data/lib/branchproof/default_instrumentation.rb +140 -0
  45. data/lib/branchproof/default_runtime.rb +16 -0
  46. data/lib/branchproof/default_syntax.rb +94 -0
  47. data/lib/branchproof/evidence.rb +133 -31
  48. data/lib/branchproof/exception_instrumentation.rb +96 -0
  49. data/lib/branchproof/exception_runtime.rb +41 -0
  50. data/lib/branchproof/exception_syntax.rb +157 -0
  51. data/lib/branchproof/extended_alternative_runtime.rb +23 -0
  52. data/lib/branchproof/flow_instrumentation.rb +52 -23
  53. data/lib/branchproof/focused_report.rb +77 -9
  54. data/lib/branchproof/instrumenter.rb +93 -37
  55. data/lib/branchproof/iteration_instrumentation.rb +66 -0
  56. data/lib/branchproof/iteration_runtime.rb +79 -0
  57. data/lib/branchproof/iteration_syntax.rb +75 -0
  58. data/lib/branchproof/limits.rb +4 -1
  59. data/lib/branchproof/loader.rb +24 -7
  60. data/lib/branchproof/minimizer.rb +18 -13
  61. data/lib/branchproof/minitest_adapter.rb +11 -16
  62. data/lib/branchproof/records.rb +2 -0
  63. data/lib/branchproof/report.rb +301 -68
  64. data/lib/branchproof/runtime.rb +32 -30
  65. data/lib/branchproof/saved_report.rb +200 -14
  66. data/lib/branchproof/source.rb +140 -71
  67. data/lib/branchproof/value_instrumentation.rb +35 -0
  68. data/lib/branchproof/value_runtime.rb +73 -0
  69. data/lib/branchproof/value_syntax.rb +116 -0
  70. data/lib/branchproof/version.rb +1 -1
  71. data/lib/branchproof/worker.rb +1 -4
  72. data/lib/branchproof.rb +2 -0
  73. data/llms.txt +20 -3
  74. data/sig/branchproof.rbs +64 -1
  75. metadata +32 -1
data/sig/branchproof.rbs CHANGED
@@ -68,6 +68,23 @@ module Branchproof
68
68
  def self.flow_path: (String decision_id, Integer index) -> nil
69
69
  def self.flow_finish: (String decision_id, untyped value, ?Integer? default_path) -> untyped
70
70
  def self.flow_receiver: (String decision_id, untyped receiver) -> untyped
71
+ def self.flow_assignment_receiver: (String decision_id, untyped receiver) -> untyped
72
+ def self.flow_assignment_path: (String decision_id, Integer index) -> nil
73
+ def self.flow_assignment_finish: (String decision_id, untyped value, ?Integer? default_path) -> untyped
74
+ def self.exception_enter: (String decision_id, Integer unhandled_index) -> nil
75
+ def self.exception_path: (String decision_id, Integer index) -> nil
76
+ def self.exception_value: (String decision_id, untyped value, Integer index) -> untyped
77
+ def self.exception_finish: (String decision_id, untyped value) -> untyped
78
+ def self.exception_unhandled: (String decision_id) -> nil
79
+ def self.exception_leave: (String decision_id) -> nil
80
+ def self.default_binding: (String decision_id, Integer index) -> nil
81
+ def self.set_alternative_count: (String decision_id, Integer count) -> nil
82
+ def self.value_path: (String decision_id, untyped value, Symbol domain) -> untyped
83
+ def self.dispatch_path: (String decision_id, untyped value, bool raised) -> untyped
84
+ def self.flow_iteration_begin: (String decision_id, untyped receiver, ?Integer alternative_count) -> untyped
85
+ def self.flow_iteration_callback: (String decision_id, ?Integer alternative_count) -> nil
86
+ def self.flow_iteration_finish: (String decision_id, untyped value, ?Integer? default_path) -> untyped
87
+ def self.flow_iteration_leave: (String decision_id) -> nil
71
88
  def self.context: (?test_id: String?, ?phase: String?) -> nil
72
89
  def self.snapshot: () -> record
73
90
  def self.diagnostics: () -> Array[record]
@@ -89,12 +106,53 @@ module Branchproof
89
106
 
90
107
  class Analyzer
91
108
  CRITERION: String
92
- def initialize: (inventory: record, evidence: record, limits: limits) -> void
109
+ def initialize: (inventory: record, evidence: record, limits: limits, ?reachability: bool) -> void
93
110
  def call: () -> record
94
111
  def pair?: (decision_id: String, condition_index: Integer, left: record, right: record) -> bool
95
112
  def missing: (decision_id: String, condition_index: Integer) -> record?
96
113
  end
97
114
 
115
+ module Constraints
116
+ VERSION: Integer
117
+ NUMERIC_OPERATORS: Array[String]
118
+ COMPARISON_OPERATORS: Array[String]
119
+ OPERATORS: Array[String]
120
+ LITERAL_TYPES: Array[String]
121
+ SUBJECT_KINDS: Array[String]
122
+ REASONS: Array[String]
123
+
124
+ class Solver
125
+ def initialize: () -> void
126
+ def add: (record? constraint, bool truth) -> String?
127
+ def add_prepared: (record constraint, bool truth) -> String?
128
+ end
129
+
130
+ def self.for_node: (untyped node) -> record?
131
+ def self.usable?: (untyped constraint) -> bool
132
+ def self.message: (untyped reason) -> String
133
+ end
134
+
135
+ module DecisionTable
136
+ SCHEMA_VERSION: Integer
137
+ CONSTRAINT_ANALYSIS_VERSION: Integer
138
+ TRUE_VALUE: String
139
+ FALSE_VALUE: String
140
+ DONT_CARE: String
141
+ CONDITION_VALUES: Array[String]
142
+ VALUE_LABELS: Hash[String, String]
143
+ REACHABILITY_STATUSES: Array[String]
144
+ COVERAGE_STATUSES: Array[String]
145
+ TABLE_STATUSES: Array[String]
146
+ NOT_CALCULATED_REASONS: Array[String]
147
+ DEFAULT_MAX_CONDITIONS: Integer
148
+ DEFAULT_MAX_RULES: Integer
149
+
150
+ def self.build: (decision: record, ?vectors: Array[record], ?limits: limits, ?reachability: bool) -> record
151
+ def self.rule_id: (String decision_id, Array[String] values, bool outcome) -> String
152
+ def self.coverage_entry: (record table) -> record
153
+ def self.unsupported_coverage_entry: () -> record
154
+ end
155
+
98
156
  class Minimizer
99
157
  def initialize: (analysis: record, evidence: record, limits: limits) -> void
100
158
  def call: (objective: Symbol, decision_ids: Array[String]) -> record
@@ -109,10 +167,14 @@ module Branchproof
109
167
  class Report
110
168
  SCHEMA_VERSION: String
111
169
  CRITERION_VERSION: String
170
+ VIEWS: Array[Symbol]
112
171
  def initialize: (inventory: document, evidence: document, analysis: document?, minima: Array[document], baseline: document, diagnostics: Array[document], ?level: Integer, ?missing_only: bool, ?view: Symbol, ?run_metadata: document, ?saved_document: document?) -> void
113
172
  def self.from_document: (document: document, ?level: Integer?, ?view: Symbol, ?missing_only: bool) -> Report
114
173
  def diagnostic_message: (Hash[Symbol | String, untyped] diagnostic) -> String
115
174
  def condition_explanation: (decision_id: String, condition_id: String) -> String
175
+ def decision_table_requirement: (untyped value) -> String?
176
+ def decision_table_reachability: (document rule) -> String
177
+ def decision_table_expected_heading: (document decision) -> String
116
178
  def write: (io: _WriteIO, format: Symbol | String) -> nil
117
179
  def exit_code: () -> Integer
118
180
  end
@@ -122,6 +184,7 @@ module Branchproof
122
184
  attr_reader conditions: Array[record]
123
185
  attr_reader alternatives: Array[record]
124
186
  attr_reader tests: Array[record]
187
+ attr_reader decision_tables: Array[record]
125
188
  end
126
189
 
127
190
  class FocusedReport
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: branchproof
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucian Ghinda
@@ -70,13 +70,26 @@ files:
70
70
  - doc/Branchproof/CLI.md
71
71
  - doc/Branchproof/Comparison.md
72
72
  - doc/Branchproof/ComparisonReport.md
73
+ - doc/Branchproof/Constraints.md
74
+ - doc/Branchproof/Constraints/Solver.md
73
75
  - doc/Branchproof/CoverageIndex.md
74
76
  - doc/Branchproof/DecisionSyntax.md
77
+ - doc/Branchproof/DecisionTable.md
78
+ - doc/Branchproof/DefaultInstrumentation.md
79
+ - doc/Branchproof/DefaultRuntime.md
80
+ - doc/Branchproof/DefaultSyntax.md
75
81
  - doc/Branchproof/Error.md
76
82
  - doc/Branchproof/Evidence.md
83
+ - doc/Branchproof/ExceptionInstrumentation.md
84
+ - doc/Branchproof/ExceptionRuntime.md
85
+ - doc/Branchproof/ExceptionSyntax.md
86
+ - doc/Branchproof/ExtendedAlternativeRuntime.md
77
87
  - doc/Branchproof/FlowInstrumentation.md
78
88
  - doc/Branchproof/FocusedReport.md
79
89
  - doc/Branchproof/Instrumenter.md
90
+ - doc/Branchproof/IterationInstrumentation.md
91
+ - doc/Branchproof/IterationRuntime.md
92
+ - doc/Branchproof/IterationSyntax.md
80
93
  - doc/Branchproof/Limits.md
81
94
  - doc/Branchproof/Loader.md
82
95
  - doc/Branchproof/Minimizer.md
@@ -90,6 +103,9 @@ files:
90
103
  - doc/Branchproof/RuntimeFlow.md
91
104
  - doc/Branchproof/SavedReport.md
92
105
  - doc/Branchproof/Source.md
106
+ - doc/Branchproof/ValueInstrumentation.md
107
+ - doc/Branchproof/ValueRuntime.md
108
+ - doc/Branchproof/ValueSyntax.md
93
109
  - doc/Branchproof/Worker.md
94
110
  - doc/CHANGELOG.md
95
111
  - doc/README.md
@@ -100,12 +116,24 @@ files:
100
116
  - lib/branchproof/cli.rb
101
117
  - lib/branchproof/comparison.rb
102
118
  - lib/branchproof/comparison_report.rb
119
+ - lib/branchproof/constraints.rb
103
120
  - lib/branchproof/coverage_index.rb
104
121
  - lib/branchproof/decision_syntax.rb
122
+ - lib/branchproof/decision_table.rb
123
+ - lib/branchproof/default_instrumentation.rb
124
+ - lib/branchproof/default_runtime.rb
125
+ - lib/branchproof/default_syntax.rb
105
126
  - lib/branchproof/evidence.rb
127
+ - lib/branchproof/exception_instrumentation.rb
128
+ - lib/branchproof/exception_runtime.rb
129
+ - lib/branchproof/exception_syntax.rb
130
+ - lib/branchproof/extended_alternative_runtime.rb
106
131
  - lib/branchproof/flow_instrumentation.rb
107
132
  - lib/branchproof/focused_report.rb
108
133
  - lib/branchproof/instrumenter.rb
134
+ - lib/branchproof/iteration_instrumentation.rb
135
+ - lib/branchproof/iteration_runtime.rb
136
+ - lib/branchproof/iteration_syntax.rb
109
137
  - lib/branchproof/limits.rb
110
138
  - lib/branchproof/loader.rb
111
139
  - lib/branchproof/minimizer.rb
@@ -118,6 +146,9 @@ files:
118
146
  - lib/branchproof/runtime_flow.rb
119
147
  - lib/branchproof/saved_report.rb
120
148
  - lib/branchproof/source.rb
149
+ - lib/branchproof/value_instrumentation.rb
150
+ - lib/branchproof/value_runtime.rb
151
+ - lib/branchproof/value_syntax.rb
121
152
  - lib/branchproof/version.rb
122
153
  - lib/branchproof/worker.rb
123
154
  - lib/mcdc.rb