branchproof 0.7.0 → 0.8.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 (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +35 -0
  3. data/README.md +212 -11
  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/FocusedReport.md +5 -2
  13. data/doc/Branchproof/Loader.md +0 -4
  14. data/doc/Branchproof/MinitestAdapter.md +0 -3
  15. data/doc/Branchproof/Report.md +18 -0
  16. data/doc/Branchproof/Runtime.md +4 -0
  17. data/doc/Branchproof/SavedReport.md +15 -0
  18. data/doc/Branchproof.md +4 -1
  19. data/doc/CHANGELOG.md +35 -0
  20. data/doc/README.md +212 -11
  21. data/lib/branchproof/analyzer.rb +80 -44
  22. data/lib/branchproof/cli.rb +28 -19
  23. data/lib/branchproof/comparison.rb +207 -19
  24. data/lib/branchproof/comparison_report.rb +49 -1
  25. data/lib/branchproof/constraints.rb +363 -0
  26. data/lib/branchproof/coverage_index.rb +30 -1
  27. data/lib/branchproof/decision_syntax.rb +31 -15
  28. data/lib/branchproof/decision_table.rb +377 -0
  29. data/lib/branchproof/evidence.rb +51 -31
  30. data/lib/branchproof/flow_instrumentation.rb +17 -17
  31. data/lib/branchproof/focused_report.rb +77 -9
  32. data/lib/branchproof/instrumenter.rb +45 -34
  33. data/lib/branchproof/limits.rb +4 -1
  34. data/lib/branchproof/loader.rb +18 -6
  35. data/lib/branchproof/minimizer.rb +18 -13
  36. data/lib/branchproof/minitest_adapter.rb +11 -16
  37. data/lib/branchproof/records.rb +2 -0
  38. data/lib/branchproof/report.rb +301 -68
  39. data/lib/branchproof/runtime.rb +22 -30
  40. data/lib/branchproof/saved_report.rb +200 -14
  41. data/lib/branchproof/source.rb +90 -48
  42. data/lib/branchproof/version.rb +1 -1
  43. data/lib/branchproof/worker.rb +1 -4
  44. data/lib/branchproof.rb +2 -0
  45. data/llms.txt +4 -1
  46. data/sig/branchproof.rbs +47 -1
  47. metadata +6 -1
data/sig/branchproof.rbs CHANGED
@@ -89,12 +89,53 @@ module Branchproof
89
89
 
90
90
  class Analyzer
91
91
  CRITERION: String
92
- def initialize: (inventory: record, evidence: record, limits: limits) -> void
92
+ def initialize: (inventory: record, evidence: record, limits: limits, ?reachability: bool) -> void
93
93
  def call: () -> record
94
94
  def pair?: (decision_id: String, condition_index: Integer, left: record, right: record) -> bool
95
95
  def missing: (decision_id: String, condition_index: Integer) -> record?
96
96
  end
97
97
 
98
+ module Constraints
99
+ VERSION: Integer
100
+ NUMERIC_OPERATORS: Array[String]
101
+ COMPARISON_OPERATORS: Array[String]
102
+ OPERATORS: Array[String]
103
+ LITERAL_TYPES: Array[String]
104
+ SUBJECT_KINDS: Array[String]
105
+ REASONS: Array[String]
106
+
107
+ class Solver
108
+ def initialize: () -> void
109
+ def add: (record? constraint, bool truth) -> String?
110
+ def add_prepared: (record constraint, bool truth) -> String?
111
+ end
112
+
113
+ def self.for_node: (untyped node) -> record?
114
+ def self.usable?: (untyped constraint) -> bool
115
+ def self.message: (untyped reason) -> String
116
+ end
117
+
118
+ module DecisionTable
119
+ SCHEMA_VERSION: Integer
120
+ CONSTRAINT_ANALYSIS_VERSION: Integer
121
+ TRUE_VALUE: String
122
+ FALSE_VALUE: String
123
+ DONT_CARE: String
124
+ CONDITION_VALUES: Array[String]
125
+ VALUE_LABELS: Hash[String, String]
126
+ REACHABILITY_STATUSES: Array[String]
127
+ COVERAGE_STATUSES: Array[String]
128
+ TABLE_STATUSES: Array[String]
129
+ NOT_CALCULATED_REASONS: Array[String]
130
+ DEFAULT_MAX_CONDITIONS: Integer
131
+ DEFAULT_MAX_RULES: Integer
132
+
133
+ def self.build: (decision: record, ?vectors: Array[record], ?limits: limits, ?reachability: bool) -> record
134
+ def self.rule_id: (String decision_id, Array[String] values, bool outcome) -> String
135
+ def self.coverage_entry: (record table) -> record
136
+ def self.unsupported_coverage_entry: () -> record
137
+ end
138
+
98
139
  class Minimizer
99
140
  def initialize: (analysis: record, evidence: record, limits: limits) -> void
100
141
  def call: (objective: Symbol, decision_ids: Array[String]) -> record
@@ -109,10 +150,14 @@ module Branchproof
109
150
  class Report
110
151
  SCHEMA_VERSION: String
111
152
  CRITERION_VERSION: String
153
+ VIEWS: Array[Symbol]
112
154
  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
155
  def self.from_document: (document: document, ?level: Integer?, ?view: Symbol, ?missing_only: bool) -> Report
114
156
  def diagnostic_message: (Hash[Symbol | String, untyped] diagnostic) -> String
115
157
  def condition_explanation: (decision_id: String, condition_id: String) -> String
158
+ def decision_table_requirement: (untyped value) -> String?
159
+ def decision_table_reachability: (document rule) -> String
160
+ def decision_table_expected_heading: (document decision) -> String
116
161
  def write: (io: _WriteIO, format: Symbol | String) -> nil
117
162
  def exit_code: () -> Integer
118
163
  end
@@ -122,6 +167,7 @@ module Branchproof
122
167
  attr_reader conditions: Array[record]
123
168
  attr_reader alternatives: Array[record]
124
169
  attr_reader tests: Array[record]
170
+ attr_reader decision_tables: Array[record]
125
171
  end
126
172
 
127
173
  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.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucian Ghinda
@@ -70,8 +70,11 @@ 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
75
78
  - doc/Branchproof/Error.md
76
79
  - doc/Branchproof/Evidence.md
77
80
  - doc/Branchproof/FlowInstrumentation.md
@@ -100,8 +103,10 @@ files:
100
103
  - lib/branchproof/cli.rb
101
104
  - lib/branchproof/comparison.rb
102
105
  - lib/branchproof/comparison_report.rb
106
+ - lib/branchproof/constraints.rb
103
107
  - lib/branchproof/coverage_index.rb
104
108
  - lib/branchproof/decision_syntax.rb
109
+ - lib/branchproof/decision_table.rb
105
110
  - lib/branchproof/evidence.rb
106
111
  - lib/branchproof/flow_instrumentation.rb
107
112
  - lib/branchproof/focused_report.rb