kbs 0.2.1 → 0.3.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 (134) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +68 -1
  3. data/README.md +52 -25
  4. data/lib/kbs/agenda.rb +208 -0
  5. data/lib/kbs/alpha_memory.rb +55 -7
  6. data/lib/kbs/alpha_network.rb +83 -0
  7. data/lib/kbs/beta_memory.rb +54 -19
  8. data/lib/kbs/blackboard/audit_log.rb +26 -25
  9. data/lib/kbs/blackboard/engine.rb +49 -40
  10. data/lib/kbs/blackboard/fact.rb +17 -21
  11. data/lib/kbs/blackboard/memory.rb +116 -40
  12. data/lib/kbs/blackboard/message_queue.rb +39 -28
  13. data/lib/kbs/blackboard/persistence/hybrid_store.rb +20 -9
  14. data/lib/kbs/blackboard/persistence/redis_store.rb +59 -51
  15. data/lib/kbs/blackboard/persistence/sqlite_store.rb +29 -32
  16. data/lib/kbs/blackboard/persistence/store.rb +11 -1
  17. data/lib/kbs/blackboard/redis_message_queue.rb +16 -7
  18. data/lib/kbs/condition.rb +39 -2
  19. data/lib/kbs/decompiler.rb +300 -124
  20. data/lib/kbs/dsl/condition_helpers.rb +8 -6
  21. data/lib/kbs/dsl/knowledge_base.rb +73 -93
  22. data/lib/kbs/dsl/pattern_evaluator.rb +38 -15
  23. data/lib/kbs/dsl/rule_builder.rb +118 -40
  24. data/lib/kbs/dsl/variable.rb +51 -6
  25. data/lib/kbs/dsl.rb +10 -3
  26. data/lib/kbs/engine.rb +395 -77
  27. data/lib/kbs/errors.rb +38 -0
  28. data/lib/kbs/exists_node.rb +12 -0
  29. data/lib/kbs/fact.rb +5 -19
  30. data/lib/kbs/fact_registry.rb +51 -0
  31. data/lib/kbs/introspection.rb +93 -0
  32. data/lib/kbs/join_indexing.rb +104 -0
  33. data/lib/kbs/join_node.rb +93 -57
  34. data/lib/kbs/join_test_builder.rb +80 -0
  35. data/lib/kbs/join_tests.rb +66 -0
  36. data/lib/kbs/memory_index.rb +75 -0
  37. data/lib/kbs/negation_node.rb +6 -82
  38. data/lib/kbs/network_node.rb +31 -0
  39. data/lib/kbs/pattern_matching.rb +27 -0
  40. data/lib/kbs/production_node.rb +50 -6
  41. data/lib/kbs/quantifier_node.rb +140 -0
  42. data/lib/kbs/rule.rb +26 -13
  43. data/lib/kbs/rule_source.rb +74 -0
  44. data/lib/kbs/rule_step.rb +27 -0
  45. data/lib/kbs/token.rb +60 -10
  46. data/lib/kbs/tracer.rb +80 -0
  47. data/lib/kbs/truth_maintenance.rb +82 -0
  48. data/lib/kbs/version.rb +1 -1
  49. data/lib/kbs/working_memory.rb +25 -3
  50. data/lib/kbs.rb +17 -4
  51. metadata +22 -129
  52. data/.envrc +0 -3
  53. data/.github/workflows/deploy-github-pages.yml +0 -52
  54. data/COMMITS.md +0 -196
  55. data/Rakefile +0 -8
  56. data/docs/advanced/custom-persistence.md +0 -775
  57. data/docs/advanced/debugging.md +0 -726
  58. data/docs/advanced/index.md +0 -8
  59. data/docs/advanced/performance.md +0 -865
  60. data/docs/advanced/testing.md +0 -827
  61. data/docs/api/blackboard.md +0 -1157
  62. data/docs/api/engine.md +0 -1047
  63. data/docs/api/facts.md +0 -1212
  64. data/docs/api/index.md +0 -12
  65. data/docs/api/rules.md +0 -1104
  66. data/docs/architecture/blackboard.md +0 -544
  67. data/docs/architecture/index.md +0 -277
  68. data/docs/architecture/network-structure.md +0 -343
  69. data/docs/architecture/rete-algorithm.md +0 -737
  70. data/docs/assets/css/custom.css +0 -83
  71. data/docs/assets/images/blackboard-architecture.svg +0 -136
  72. data/docs/assets/images/compiled-network.svg +0 -101
  73. data/docs/assets/images/fact-assertion-flow.svg +0 -117
  74. data/docs/assets/images/fact-rule-relationship.svg +0 -65
  75. data/docs/assets/images/fact-structure.svg +0 -42
  76. data/docs/assets/images/inference-cycle.svg +0 -47
  77. data/docs/assets/images/kb-components.svg +0 -43
  78. data/docs/assets/images/kbs.jpg +0 -0
  79. data/docs/assets/images/pattern-matching-trace.svg +0 -136
  80. data/docs/assets/images/rete-network-layers.svg +0 -96
  81. data/docs/assets/images/rule-structure.svg +0 -44
  82. data/docs/assets/images/system-layers.svg +0 -69
  83. data/docs/assets/images/trading-signal-network.svg +0 -139
  84. data/docs/assets/js/mathjax.js +0 -17
  85. data/docs/examples/index.md +0 -223
  86. data/docs/guides/blackboard-memory.md +0 -589
  87. data/docs/guides/dsl.md +0 -1321
  88. data/docs/guides/facts.md +0 -652
  89. data/docs/guides/getting-started.md +0 -385
  90. data/docs/guides/index.md +0 -23
  91. data/docs/guides/negation.md +0 -529
  92. data/docs/guides/pattern-matching.md +0 -561
  93. data/docs/guides/persistence.md +0 -451
  94. data/docs/guides/variable-binding.md +0 -491
  95. data/docs/guides/writing-rules.md +0 -914
  96. data/docs/index.md +0 -155
  97. data/docs/installation.md +0 -156
  98. data/docs/quick-start.md +0 -221
  99. data/docs/what-is-a-fact.md +0 -694
  100. data/docs/what-is-a-knowledge-base.md +0 -350
  101. data/docs/what-is-a-rule.md +0 -833
  102. data/examples/.gitignore +0 -1
  103. data/examples/README.md +0 -531
  104. data/examples/advanced_example.rb +0 -270
  105. data/examples/advanced_example_dsl.rb +0 -224
  106. data/examples/ai_enhanced_kbs.rb +0 -523
  107. data/examples/ai_enhanced_kbs_dsl.rb +0 -538
  108. data/examples/blackboard_demo.rb +0 -50
  109. data/examples/blackboard_demo_dsl.rb +0 -50
  110. data/examples/car_diagnostic.rb +0 -64
  111. data/examples/car_diagnostic_dsl.rb +0 -54
  112. data/examples/concurrent_inference_demo.rb +0 -362
  113. data/examples/concurrent_inference_demo_dsl.rb +0 -362
  114. data/examples/csv_trading_system.rb +0 -559
  115. data/examples/csv_trading_system_dsl.rb +0 -525
  116. data/examples/iot_demo_using_dsl.rb +0 -83
  117. data/examples/portfolio_rebalancing_system.rb +0 -651
  118. data/examples/portfolio_rebalancing_system_dsl.rb +0 -613
  119. data/examples/redis_trading_demo.rb +0 -177
  120. data/examples/redis_trading_demo_dsl.rb +0 -177
  121. data/examples/rule_source_demo.rb +0 -123
  122. data/examples/run_all.rb +0 -50
  123. data/examples/run_all_dsl.rb +0 -49
  124. data/examples/sample_stock_data.csv +0 -46
  125. data/examples/stock_trading_advanced.rb +0 -469
  126. data/examples/stock_trading_advanced_dsl.rb +0 -404
  127. data/examples/temp_dsl.txt +0 -9392
  128. data/examples/timestamped_trading.rb +0 -286
  129. data/examples/timestamped_trading_dsl.rb +0 -258
  130. data/examples/trading_demo.rb +0 -334
  131. data/examples/trading_demo_dsl.rb +0 -322
  132. data/examples/working_demo.rb +0 -176
  133. data/examples/working_demo_dsl.rb +0 -160
  134. data/mkdocs.yml +0 -181
data/lib/kbs/tracer.rb ADDED
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KBS
4
+ # Writes a line for each change the engine makes while an item is
5
+ # being watched:
6
+ #
7
+ # :facts ==> fact :sensor, id: 1 a fact entered working memory
8
+ # <== fact :sensor, id: 1 a fact left it
9
+ # :activations ==> Activation 0 hot: ... a rule match went on the agenda
10
+ # <== Activation 0 hot: ... a match was withdrawn before it fired
11
+ # :rules FIRE 1 hot: ... a rule fired; the number counts firings
12
+ #
13
+ # An activation is written as its rule's priority, the rule's name, and
14
+ # one entry per condition: the matched fact, or * for a negated or
15
+ # exists condition.
16
+ class Tracer
17
+ ITEMS = %i[facts activations rules].freeze
18
+
19
+ # Where the lines go: anything that responds to puts.
20
+ attr_accessor :output
21
+
22
+ def initialize(output = $stdout)
23
+ @output = output
24
+ @watched = Set.new
25
+ @firings = 0
26
+ end
27
+
28
+ # Starts watching the given items, or every item when none is given.
29
+ def watch(*items)
30
+ @watched.merge(self.class.validated(items))
31
+ self
32
+ end
33
+
34
+ # Stops watching the given items, or every item when none is given.
35
+ def unwatch(*items)
36
+ @watched.subtract(self.class.validated(items))
37
+ self
38
+ end
39
+
40
+ def watching?(item)
41
+ @watched.include?(item)
42
+ end
43
+
44
+ def watched
45
+ ITEMS.select { |item| @watched.include?(item) }
46
+ end
47
+
48
+ def fact_added(fact)
49
+ @output.puts "==> #{fact}" if watching?(:facts)
50
+ end
51
+
52
+ def fact_removed(fact)
53
+ @output.puts "<== #{fact}" if watching?(:facts)
54
+ end
55
+
56
+ def activation_added(activation)
57
+ @output.puts "==> Activation #{activation}" if watching?(:activations)
58
+ end
59
+
60
+ def activation_removed(activation)
61
+ @output.puts "<== Activation #{activation}" if watching?(:activations)
62
+ end
63
+
64
+ def rule_fired(activation)
65
+ @firings += 1
66
+ @output.puts "FIRE #{@firings} #{activation.description}" if watching?(:rules)
67
+ end
68
+
69
+ # The items named, or every item when none is; raises ArgumentError
70
+ # for an item that cannot be watched.
71
+ def self.validated(items)
72
+ return ITEMS if items.empty?
73
+
74
+ unknown = items - ITEMS
75
+ raise ArgumentError, "cannot watch #{unknown.inspect}; use #{ITEMS.inspect}" unless unknown.empty?
76
+
77
+ items
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ module KBS
4
+ # Records which partial matches logically support which facts.
5
+ #
6
+ # A fact asserted by a rule with `logical` conditions is supported by
7
+ # the token that matched those conditions. A fact may have several such
8
+ # supports. When a support token is removed, each fact it supported
9
+ # loses that support, and a fact with none left is handed back to be
10
+ # retracted. A fact with no recorded support is unconditional: it stays
11
+ # until someone retracts it.
12
+ class TruthMaintenance
13
+ def initialize
14
+ @supports = {}
15
+ @dependents = {}.compare_by_identity
16
+ end
17
+
18
+ # Records that `token` supports `fact`.
19
+ def support(fact, token)
20
+ (@supports[fact] ||= Set.new.compare_by_identity) << token
21
+ (@dependents[token] ||= Set.new) << fact
22
+ end
23
+
24
+ # Whether `fact` stays only as long as a supporting match does.
25
+ def supported?(fact)
26
+ @supports.key?(fact)
27
+ end
28
+
29
+ # The tokens that support `fact`.
30
+ def supports_of(fact)
31
+ @supports[fact].to_a
32
+ end
33
+
34
+ # The facts that `token` supports.
35
+ def dependents_of(token)
36
+ @dependents[token].to_a
37
+ end
38
+
39
+ # The facts that have `fact` in one of their supporting matches.
40
+ def facts_depending_on(fact)
41
+ @dependents.each_with_object([]) do |(token, facts), found|
42
+ found.concat(facts.to_a) if token.facts.include?(fact)
43
+ end.uniq
44
+ end
45
+
46
+ # Makes `fact` unconditional, or forgets it once it is retracted.
47
+ def release(fact)
48
+ tokens = @supports.delete(fact)
49
+ tokens&.each do |token|
50
+ facts = @dependents[token]
51
+ next unless facts
52
+
53
+ facts.delete(fact)
54
+ @dependents.delete(token) if facts.empty?
55
+ end
56
+ end
57
+
58
+ # A support token went away.
59
+ #
60
+ # @return [Array] the facts left with no support, to be retracted
61
+ def withdraw(token)
62
+ facts = @dependents.delete(token)
63
+ return [] unless facts
64
+
65
+ facts.select do |fact|
66
+ tokens = @supports[fact]
67
+ tokens.delete(token)
68
+ @supports.delete(fact) if tokens.empty?
69
+ tokens.empty?
70
+ end
71
+ end
72
+
73
+ def clear
74
+ @supports.clear
75
+ @dependents.clear
76
+ end
77
+
78
+ def size
79
+ @supports.size
80
+ end
81
+ end
82
+ end
data/lib/kbs/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KBS
4
- VERSION = "0.2.1"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -1,14 +1,31 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module KBS
4
+ # The set of facts the engine knows, with observers told of each change.
4
5
  class WorkingMemory
5
- attr_reader :facts
6
-
7
6
  def initialize
8
- @facts = []
7
+ @facts = Set.new
9
8
  @observers = []
10
9
  end
11
10
 
11
+ # @return [Array<KBS::Fact>] the facts, in the order they were added.
12
+ # A copy: changing it does not change working memory.
13
+ def facts
14
+ @facts.to_a
15
+ end
16
+
17
+ def each_fact(&)
18
+ @facts.each(&)
19
+ end
20
+
21
+ def size
22
+ @facts.size
23
+ end
24
+
25
+ def include?(fact)
26
+ @facts.include?(fact)
27
+ end
28
+
12
29
  def add_fact(fact)
13
30
  @facts << fact
14
31
  notify_observers(:add, fact)
@@ -21,6 +38,11 @@ module KBS
21
38
  fact
22
39
  end
23
40
 
41
+ # Forgets every fact without telling the observers.
42
+ def clear
43
+ @facts.clear
44
+ end
45
+
24
46
  def add_observer(observer)
25
47
  @observers << observer
26
48
  end
data/lib/kbs.rb CHANGED
@@ -1,22 +1,35 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require_relative 'kbs/version'
4
+ require_relative 'kbs/errors'
4
5
 
5
6
  # Core RETE classes
7
+ require_relative 'kbs/pattern_matching'
6
8
  require_relative 'kbs/fact'
7
9
  require_relative 'kbs/working_memory'
10
+ require_relative 'kbs/fact_registry'
11
+ require_relative 'kbs/truth_maintenance'
8
12
  require_relative 'kbs/token'
13
+ require_relative 'kbs/memory_index'
9
14
  require_relative 'kbs/alpha_memory'
15
+ require_relative 'kbs/alpha_network'
10
16
  require_relative 'kbs/beta_memory'
17
+ require_relative 'kbs/network_node'
18
+ require_relative 'kbs/join_tests'
19
+ require_relative 'kbs/join_test_builder'
20
+ require_relative 'kbs/join_indexing'
11
21
  require_relative 'kbs/join_node'
22
+ require_relative 'kbs/quantifier_node'
12
23
  require_relative 'kbs/negation_node'
24
+ require_relative 'kbs/exists_node'
25
+ require_relative 'kbs/tracer'
26
+ require_relative 'kbs/agenda'
13
27
  require_relative 'kbs/production_node'
14
28
  require_relative 'kbs/condition'
15
29
  require_relative 'kbs/rule'
30
+ require_relative 'kbs/rule_step'
31
+ require_relative 'kbs/introspection'
16
32
  require_relative 'kbs/engine'
17
33
  require_relative 'kbs/decompiler'
34
+ require_relative 'kbs/rule_source'
18
35
  require_relative 'kbs/dsl'
19
-
20
- module KBS
21
- class Error < StandardError; end
22
- end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -23,48 +23,6 @@ dependencies:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
25
  version: '1.6'
26
- - !ruby/object:Gem::Dependency
27
- name: minitest
28
- requirement: !ruby/object:Gem::Requirement
29
- requirements:
30
- - - "~>"
31
- - !ruby/object:Gem::Version
32
- version: '5.16'
33
- type: :development
34
- prerelease: false
35
- version_requirements: !ruby/object:Gem::Requirement
36
- requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '5.16'
40
- - !ruby/object:Gem::Dependency
41
- name: simplecov
42
- requirement: !ruby/object:Gem::Requirement
43
- requirements:
44
- - - "~>"
45
- - !ruby/object:Gem::Version
46
- version: '0.22'
47
- type: :development
48
- prerelease: false
49
- version_requirements: !ruby/object:Gem::Requirement
50
- requirements:
51
- - - "~>"
52
- - !ruby/object:Gem::Version
53
- version: '0.22'
54
- - !ruby/object:Gem::Dependency
55
- name: redis
56
- requirement: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - "~>"
59
- - !ruby/object:Gem::Version
60
- version: '5.0'
61
- type: :development
62
- prerelease: false
63
- version_requirements: !ruby/object:Gem::Requirement
64
- requirements:
65
- - - "~>"
66
- - !ruby/object:Gem::Version
67
- version: '5.0'
68
26
  description: |
69
27
  A comprehensive Ruby implementation of a Knowledge-Based System featuring:
70
28
 
@@ -83,93 +41,13 @@ executables: []
83
41
  extensions: []
84
42
  extra_rdoc_files: []
85
43
  files:
86
- - ".envrc"
87
- - ".github/workflows/deploy-github-pages.yml"
88
44
  - CHANGELOG.md
89
- - COMMITS.md
90
45
  - LICENSE.txt
91
46
  - README.md
92
- - Rakefile
93
- - docs/advanced/custom-persistence.md
94
- - docs/advanced/debugging.md
95
- - docs/advanced/index.md
96
- - docs/advanced/performance.md
97
- - docs/advanced/testing.md
98
- - docs/api/blackboard.md
99
- - docs/api/engine.md
100
- - docs/api/facts.md
101
- - docs/api/index.md
102
- - docs/api/rules.md
103
- - docs/architecture/blackboard.md
104
- - docs/architecture/index.md
105
- - docs/architecture/network-structure.md
106
- - docs/architecture/rete-algorithm.md
107
- - docs/assets/css/custom.css
108
- - docs/assets/images/blackboard-architecture.svg
109
- - docs/assets/images/compiled-network.svg
110
- - docs/assets/images/fact-assertion-flow.svg
111
- - docs/assets/images/fact-rule-relationship.svg
112
- - docs/assets/images/fact-structure.svg
113
- - docs/assets/images/inference-cycle.svg
114
- - docs/assets/images/kb-components.svg
115
- - docs/assets/images/kbs.jpg
116
- - docs/assets/images/pattern-matching-trace.svg
117
- - docs/assets/images/rete-network-layers.svg
118
- - docs/assets/images/rule-structure.svg
119
- - docs/assets/images/system-layers.svg
120
- - docs/assets/images/trading-signal-network.svg
121
- - docs/assets/js/mathjax.js
122
- - docs/examples/index.md
123
- - docs/guides/blackboard-memory.md
124
- - docs/guides/dsl.md
125
- - docs/guides/facts.md
126
- - docs/guides/getting-started.md
127
- - docs/guides/index.md
128
- - docs/guides/negation.md
129
- - docs/guides/pattern-matching.md
130
- - docs/guides/persistence.md
131
- - docs/guides/variable-binding.md
132
- - docs/guides/writing-rules.md
133
- - docs/index.md
134
- - docs/installation.md
135
- - docs/quick-start.md
136
- - docs/what-is-a-fact.md
137
- - docs/what-is-a-knowledge-base.md
138
- - docs/what-is-a-rule.md
139
- - examples/.gitignore
140
- - examples/README.md
141
- - examples/advanced_example.rb
142
- - examples/advanced_example_dsl.rb
143
- - examples/ai_enhanced_kbs.rb
144
- - examples/ai_enhanced_kbs_dsl.rb
145
- - examples/blackboard_demo.rb
146
- - examples/blackboard_demo_dsl.rb
147
- - examples/car_diagnostic.rb
148
- - examples/car_diagnostic_dsl.rb
149
- - examples/concurrent_inference_demo.rb
150
- - examples/concurrent_inference_demo_dsl.rb
151
- - examples/csv_trading_system.rb
152
- - examples/csv_trading_system_dsl.rb
153
- - examples/iot_demo_using_dsl.rb
154
- - examples/portfolio_rebalancing_system.rb
155
- - examples/portfolio_rebalancing_system_dsl.rb
156
- - examples/redis_trading_demo.rb
157
- - examples/redis_trading_demo_dsl.rb
158
- - examples/rule_source_demo.rb
159
- - examples/run_all.rb
160
- - examples/run_all_dsl.rb
161
- - examples/sample_stock_data.csv
162
- - examples/stock_trading_advanced.rb
163
- - examples/stock_trading_advanced_dsl.rb
164
- - examples/temp_dsl.txt
165
- - examples/timestamped_trading.rb
166
- - examples/timestamped_trading_dsl.rb
167
- - examples/trading_demo.rb
168
- - examples/trading_demo_dsl.rb
169
- - examples/working_demo.rb
170
- - examples/working_demo_dsl.rb
171
47
  - lib/kbs.rb
48
+ - lib/kbs/agenda.rb
172
49
  - lib/kbs/alpha_memory.rb
50
+ - lib/kbs/alpha_network.rb
173
51
  - lib/kbs/beta_memory.rb
174
52
  - lib/kbs/blackboard.rb
175
53
  - lib/kbs/blackboard/audit_log.rb
@@ -192,15 +70,29 @@ files:
192
70
  - lib/kbs/dsl/rule_builder.rb
193
71
  - lib/kbs/dsl/variable.rb
194
72
  - lib/kbs/engine.rb
73
+ - lib/kbs/errors.rb
74
+ - lib/kbs/exists_node.rb
195
75
  - lib/kbs/fact.rb
76
+ - lib/kbs/fact_registry.rb
77
+ - lib/kbs/introspection.rb
78
+ - lib/kbs/join_indexing.rb
196
79
  - lib/kbs/join_node.rb
80
+ - lib/kbs/join_test_builder.rb
81
+ - lib/kbs/join_tests.rb
82
+ - lib/kbs/memory_index.rb
197
83
  - lib/kbs/negation_node.rb
84
+ - lib/kbs/network_node.rb
85
+ - lib/kbs/pattern_matching.rb
198
86
  - lib/kbs/production_node.rb
87
+ - lib/kbs/quantifier_node.rb
199
88
  - lib/kbs/rule.rb
89
+ - lib/kbs/rule_source.rb
90
+ - lib/kbs/rule_step.rb
200
91
  - lib/kbs/token.rb
92
+ - lib/kbs/tracer.rb
93
+ - lib/kbs/truth_maintenance.rb
201
94
  - lib/kbs/version.rb
202
95
  - lib/kbs/working_memory.rb
203
- - mkdocs.yml
204
96
  homepage: https://github.com/madbomber/kbs
205
97
  licenses:
206
98
  - MIT
@@ -208,6 +100,7 @@ metadata:
208
100
  homepage_uri: https://github.com/madbomber/kbs
209
101
  source_code_uri: https://github.com/madbomber/kbs
210
102
  changelog_uri: https://github.com/madbomber/kbs/blob/main/CHANGELOG.md
103
+ rubygems_mfa_required: 'true'
211
104
  rdoc_options: []
212
105
  require_paths:
213
106
  - lib
@@ -215,14 +108,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
215
108
  requirements:
216
109
  - - ">="
217
110
  - !ruby/object:Gem::Version
218
- version: 3.2.0
111
+ version: '4.0'
219
112
  required_rubygems_version: !ruby/object:Gem::Requirement
220
113
  requirements:
221
114
  - - ">="
222
115
  - !ruby/object:Gem::Version
223
116
  version: '0'
224
117
  requirements: []
225
- rubygems_version: 4.0.7
118
+ rubygems_version: 4.0.23
226
119
  specification_version: 4
227
120
  summary: Knowledge-Based System with RETE inference, Blackboard architecture, and
228
121
  AI integration
data/.envrc DELETED
@@ -1,3 +0,0 @@
1
- # kbs/.envrc
2
-
3
- export RR=`pwd`
@@ -1,52 +0,0 @@
1
- name: Deploy KBS Documentation to GitHub Pages
2
- on:
3
- push:
4
- branches:
5
- - main
6
- - develop
7
- paths:
8
- - "docs/**"
9
- - "mkdocs.yml"
10
- - ".github/workflows/deploy-github-pages.yml"
11
- workflow_dispatch:
12
-
13
- permissions:
14
- contents: write
15
- pages: write
16
- id-token: write
17
-
18
- jobs:
19
- deploy:
20
- runs-on: ubuntu-latest
21
- steps:
22
- - name: Checkout code
23
- uses: actions/checkout@v4
24
- with:
25
- fetch-depth: 0
26
-
27
- - name: Setup Python
28
- uses: actions/setup-python@v5
29
- with:
30
- python-version: 3.x
31
-
32
- - name: Install dependencies
33
- run: |
34
- pip install mkdocs
35
- pip install mkdocs-material
36
- pip install mkdocs-macros-plugin
37
- pip install mike
38
-
39
- - name: Configure Git
40
- run: |
41
- git config --local user.email "action@github.com"
42
- git config --local user.name "GitHub Action"
43
-
44
- - name: Deploy to GitHub Pages
45
- run: |
46
- if [ "${{ github.ref }}" = "refs/heads/main" ]; then
47
- echo "Deploying from main branch"
48
- mkdocs gh-deploy --force --clean
49
- else
50
- echo "Deploying from develop branch"
51
- mkdocs gh-deploy --force --clean
52
- fi