kibi-core 0.26.1 → 0.28.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.
- package/package.json +1 -1
- package/schema/entities.pl +12 -0
- package/src/cases.pl +311 -0
- package/src/checks.pl +357 -17
- package/src/claim_obligations.pl +16 -1
- package/src/code_certificates.pl +4 -0
- package/src/discovery.pl +65 -23
- package/src/intervals.pl +35 -14
- package/src/kb.pl +288 -36
- package/src/kb_consistency.pl +15 -0
- package/src/logic_ir.pl +130 -161
- package/src/model_check.pl +54 -6
- package/src/requirement_proof.pl +535 -14
- package/src/rule_registry.pl +6 -0
- package/src/status.pl +16 -0
- package/src/units.pl +1 -3
package/src/rule_registry.pl
CHANGED
|
@@ -28,6 +28,7 @@ known_rule('deprecated-adr-no-successor').
|
|
|
28
28
|
known_rule('superseded-requirement-open').
|
|
29
29
|
known_rule('scenario-feasibility').
|
|
30
30
|
known_rule('scenario-feasibility-unknown').
|
|
31
|
+
known_rule('scenario-outcome-mismatch').
|
|
31
32
|
known_rule('exception-claim-keys').
|
|
32
33
|
known_rule('numeric-string-value').
|
|
33
34
|
known_rule('rule-key-arguments-missing').
|
|
@@ -86,6 +87,7 @@ rule_enforcement_class('deprecated-adr-no-successor', canonical).
|
|
|
86
87
|
rule_enforcement_class('superseded-requirement-open', canonical).
|
|
87
88
|
rule_enforcement_class('scenario-feasibility', canonical).
|
|
88
89
|
rule_enforcement_class('scenario-feasibility-unknown', advisory).
|
|
90
|
+
rule_enforcement_class('scenario-outcome-mismatch', canonical).
|
|
89
91
|
rule_enforcement_class('exception-claim-keys', canonical).
|
|
90
92
|
rule_enforcement_class('numeric-string-value', advisory).
|
|
91
93
|
rule_enforcement_class('rule-key-arguments-missing', advisory).
|
|
@@ -144,6 +146,7 @@ rule_implementation('deprecated-adr-no-successor', prolog).
|
|
|
144
146
|
rule_implementation('superseded-requirement-open', prolog).
|
|
145
147
|
rule_implementation('scenario-feasibility', prolog).
|
|
146
148
|
rule_implementation('scenario-feasibility-unknown', prolog).
|
|
149
|
+
rule_implementation('scenario-outcome-mismatch', prolog).
|
|
147
150
|
rule_implementation('exception-claim-keys', prolog).
|
|
148
151
|
rule_implementation('numeric-string-value', prolog).
|
|
149
152
|
rule_implementation('rule-key-arguments-missing', prolog).
|
|
@@ -198,6 +201,7 @@ rule_predicate('deprecated-adr-no-successor', check_deprecated_adrs).
|
|
|
198
201
|
rule_predicate('superseded-requirement-open', check_superseded_requirement_open).
|
|
199
202
|
rule_predicate('scenario-feasibility', check_scenario_feasibility).
|
|
200
203
|
rule_predicate('scenario-feasibility-unknown', check_scenario_feasibility_unknown).
|
|
204
|
+
rule_predicate('scenario-outcome-mismatch', check_scenario_outcome_mismatch).
|
|
201
205
|
rule_predicate('exception-claim-keys', check_exception_claim_keys).
|
|
202
206
|
rule_predicate('numeric-string-value', check_numeric_string_values).
|
|
203
207
|
rule_predicate('rule-key-arguments-missing', check_rule_key_arguments_missing).
|
|
@@ -235,6 +239,7 @@ rule_predicate_arity('deprecated-adr-no-successor', 1).
|
|
|
235
239
|
rule_predicate_arity('superseded-requirement-open', 1).
|
|
236
240
|
rule_predicate_arity('scenario-feasibility', 1).
|
|
237
241
|
rule_predicate_arity('scenario-feasibility-unknown', 1).
|
|
242
|
+
rule_predicate_arity('scenario-outcome-mismatch', 1).
|
|
238
243
|
rule_predicate_arity('exception-claim-keys', 1).
|
|
239
244
|
rule_predicate_arity('numeric-string-value', 1).
|
|
240
245
|
rule_predicate_arity('rule-key-arguments-missing', 1).
|
|
@@ -276,6 +281,7 @@ rule_description('deprecated-adr-no-successor', 'Deprecated ADRs must have a suc
|
|
|
276
281
|
rule_description('superseded-requirement-open', 'A requirement that another requirement supersedes must have status closed, and supersedes links between requirements must not form a cycle').
|
|
277
282
|
rule_description('scenario-feasibility', 'A scenario that expects success must not assume property values that cannot hold, alone or together, with what current requirements require through typed property values or rules, unless an approved exception requirement waives that requirement or the listed clauses').
|
|
278
283
|
rule_description('scenario-feasibility-unknown', 'Advisory: a scenario that expects success assumes nothing, assumes values that contradict each other, assumes a property value no governing requirement constrains comparably (type, unit or operator mismatch, or conflicting requirements), leaves a governing rule\'s conditions undecided, or conflicts only with constraints whose validity window may not cover it, so its feasibility cannot be decided').
|
|
284
|
+
rule_description('scenario-outcome-mismatch', 'A scenario that expects rejection or error must assume a value or situation a current requirement forbids: when every assumption is governed by current requirements and they permit all of them together, the knowledge base predicts success and the scenario exercises no failure side').
|
|
279
285
|
rule_description('exception-claim-keys', 'An exception requirement\'s exempts_claims must name claim keys of a requirement it exempts, and requires an exempts link').
|
|
280
286
|
rule_description('numeric-string-value', 'Advisory: a property value stores a numeric-looking string where the comparison is numeric (ordering operator, or an int/number fact on the same property); the finding names the fact and the typed value, without converting it').
|
|
281
287
|
rule_description('rule-key-arguments-missing', 'Advisory: an opposing rule pair stays unresolved only because a body predicate declares no key_arguments; the finding names the predicate and the key positions that would decide the pair').
|
package/src/status.pl
CHANGED
|
@@ -203,7 +203,23 @@ kb_snapshot_time(SnapshotTime) :-
|
|
|
203
203
|
% made kb_status_json quadratic (paths x entities) and could wedge large KBs
|
|
204
204
|
% for minutes whenever mtime churn (e.g. a git checkout) marked whole lanes
|
|
205
205
|
% newer than the snapshot.
|
|
206
|
+
% The source -> entity id index reads every entity, so it is kept per KB
|
|
207
|
+
% generation (whose key names the attached store's graph): status runs it on
|
|
208
|
+
% each freshness probe while the KB is unchanged. Inside a transaction it is
|
|
209
|
+
% built afresh.
|
|
206
210
|
entity_source_id_index(Index) :-
|
|
211
|
+
( \+ rdf_db:rdf_active_transaction(_),
|
|
212
|
+
kb:index_verification_key(status_source_index, Key)
|
|
213
|
+
-> ( kb:kb_status_source_index_memo(Key, Index0)
|
|
214
|
+
-> Index = Index0
|
|
215
|
+
; compute_entity_source_id_index(Index),
|
|
216
|
+
retractall(kb:kb_status_source_index_memo(_, _)),
|
|
217
|
+
assertz(kb:kb_status_source_index_memo(Key, Index))
|
|
218
|
+
)
|
|
219
|
+
; compute_entity_source_id_index(Index)
|
|
220
|
+
).
|
|
221
|
+
|
|
222
|
+
compute_entity_source_id_index(Index) :-
|
|
207
223
|
findall(RelativeSource-Id,
|
|
208
224
|
( kb_entity(Id, _Type, Props),
|
|
209
225
|
entity_source_property(Props, RawSource),
|
package/src/units.pl
CHANGED
|
@@ -120,13 +120,11 @@ numeric_value_type(number).
|
|
|
120
120
|
|
|
121
121
|
known_unit(Unit, BaseUnit, Factor) :-
|
|
122
122
|
atom(Unit),
|
|
123
|
-
Unit \== '',
|
|
124
123
|
( unit_symbol(Unit, BaseUnit, Factor)
|
|
125
124
|
-> true
|
|
126
125
|
; downcase_atom(Unit, Lower),
|
|
127
126
|
unit_word(Lower, BaseUnit, Factor)
|
|
128
|
-
)
|
|
129
|
-
!.
|
|
127
|
+
).
|
|
130
128
|
|
|
131
129
|
% Integers (including big integers) stay exact. Floats have binary noise
|
|
132
130
|
% rounded away (0.1 h * 3600 = 360.00000000000006) before deciding whether the
|