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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kibi-core",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "private": false,
5
5
  "description": "Core Prolog modules and RDF graph logic for Kibi",
6
6
  "type": "module",
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 = "Archived/deprecated ADR has no successor — add a supersedes link from the replacement ADR",
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/archived/rejected ADRs that still constrain symbols.
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, archived, rejected]),
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 archived/deprecated but has no supersedes relationship pointing to it.
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, [archived, deprecated]),
603
+ memberchk(StatusAtom, [superseded, deprecated]),
602
604
  \+ kb_relationship(supersedes, _, Id).
603
605
 
604
606
  %% current_req(+Id)
605
- % Requirement is current when active and not superseded by another requirement.
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, active),
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)