kibi-core 0.1.9 → 0.1.10
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/src/checks.pl +1 -1
- package/src/kb.pl +13 -8
package/package.json
CHANGED
package/src/checks.pl
CHANGED
|
@@ -324,7 +324,7 @@ deprecated_adr_violation(violation(
|
|
|
324
324
|
)) :-
|
|
325
325
|
deprecated_no_successor(AdrId),
|
|
326
326
|
|
|
327
|
-
Description = "
|
|
327
|
+
Description = "Superseded/deprecated ADR has no successor — add a supersedes link from the replacement ADR",
|
|
328
328
|
|
|
329
329
|
format(string(Suggestion), "Create a new ADR and add: links: [{type: supersedes, target: ~w}]", [AdrId]),
|
|
330
330
|
|
package/src/kb.pl
CHANGED
|
@@ -554,12 +554,12 @@ conflicting(Adr1, Adr2) :-
|
|
|
554
554
|
Adr1 @< Adr2.
|
|
555
555
|
|
|
556
556
|
%% deprecated_still_used(+Adr, -Symbols)
|
|
557
|
-
% Deprecated/
|
|
557
|
+
% Deprecated/superseded ADRs that still constrain symbols.
|
|
558
558
|
deprecated_still_used(Adr, Symbols) :-
|
|
559
559
|
kb_entity(Adr, adr, Props),
|
|
560
560
|
memberchk(status=Status, Props),
|
|
561
561
|
normalize_term_atom(Status, StatusAtom),
|
|
562
|
-
memberchk(StatusAtom, [deprecated,
|
|
562
|
+
memberchk(StatusAtom, [deprecated, superseded]),
|
|
563
563
|
setof(Symbol, kb_relationship(constrained_by, Symbol, Adr), Symbols),
|
|
564
564
|
!.
|
|
565
565
|
deprecated_still_used(_, []).
|
|
@@ -569,9 +569,11 @@ deprecated_still_used(_, []).
|
|
|
569
569
|
%% ------------------------------------------------------------------
|
|
570
570
|
|
|
571
571
|
%% current_adr(+Id)
|
|
572
|
-
% True when Id is an ADR not superseded by any other ADR.
|
|
572
|
+
% True when Id is an accepted ADR not superseded by any other ADR.
|
|
573
573
|
current_adr(Id) :-
|
|
574
|
-
kb_entity(Id, adr,
|
|
574
|
+
kb_entity(Id, adr, Props),
|
|
575
|
+
memberchk(status=Status, Props),
|
|
576
|
+
normalize_term_atom(Status, accepted),
|
|
575
577
|
\+ kb_relationship(supersedes, _, Id).
|
|
576
578
|
|
|
577
579
|
%% superseded_by(+OldId, -NewId)
|
|
@@ -593,20 +595,23 @@ adr_chain_acc(Id, Visited, [Id|Rest]) :-
|
|
|
593
595
|
adr_chain_acc(Newer, [Id|Visited], Rest).
|
|
594
596
|
|
|
595
597
|
%% deprecated_no_successor(+OldId)
|
|
596
|
-
% Lint rule: ADR is
|
|
598
|
+
% Lint rule: ADR is superseded/deprecated but has no supersedes relationship pointing to it.
|
|
597
599
|
deprecated_no_successor(Id) :-
|
|
598
600
|
kb_entity(Id, adr, Props),
|
|
599
601
|
memberchk(status=Status, Props),
|
|
600
602
|
normalize_term_atom(Status, StatusAtom),
|
|
601
|
-
memberchk(StatusAtom, [
|
|
603
|
+
memberchk(StatusAtom, [superseded, deprecated]),
|
|
602
604
|
\+ kb_relationship(supersedes, _, Id).
|
|
603
605
|
|
|
604
606
|
%% current_req(+Id)
|
|
605
|
-
% Requirement is current when
|
|
607
|
+
% Requirement is current when not deprecated and not superseded by another requirement.
|
|
608
|
+
% Canonical statuses: open, in_progress, closed.
|
|
609
|
+
% Legacy statuses accepted for backwards compatibility: active, approved.
|
|
606
610
|
current_req(Id) :-
|
|
607
611
|
kb_entity(Id, req, Props),
|
|
608
612
|
memberchk(status=Status, Props),
|
|
609
|
-
normalize_term_atom(Status,
|
|
613
|
+
normalize_term_atom(Status, StatusAtom),
|
|
614
|
+
memberchk(StatusAtom, [open, in_progress, closed, active, approved]),
|
|
610
615
|
\+ kb_relationship(supersedes, _, Id).
|
|
611
616
|
|
|
612
617
|
%% contradicting_reqs(-ReqA, -ReqB, -Reason)
|