yarramate 0.9.0 → 0.10.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.
@@ -9,6 +9,7 @@ export interface ProjectionDefinition {
9
9
  readonly documents?: readonly string[];
10
10
  readonly kinds?: readonly string[];
11
11
  readonly statuses?: readonly LifecycleStatus[];
12
+ readonly excludeStatuses?: readonly LifecycleStatus[];
12
13
  readonly states?: readonly string[];
13
14
  readonly owners?: readonly string[];
14
15
  readonly constraints?: readonly string[];
@@ -65,6 +65,9 @@ export function evaluateProjection(graph, projection, profileContext) {
65
65
  (projection.query.statuses === undefined ||
66
66
  (status !== undefined &&
67
67
  projection.query.statuses.includes(status))) &&
68
+ (projection.query.excludeStatuses === undefined ||
69
+ status === undefined ||
70
+ !projection.query.excludeStatuses.includes(status)) &&
68
71
  (projection.query.owners === undefined ||
69
72
  (owner !== undefined &&
70
73
  projection.query.owners.includes(owner))) &&
@@ -80,8 +83,12 @@ export function evaluateProjection(graph, projection, profileContext) {
80
83
  if (subject.type !== 'relationship')
81
84
  continue;
82
85
  const relationship = graph.claims.find((claim) => claim.id === subject.id);
86
+ const relationshipStatus = claimValue(graph.claims, subject.id, 'yarramate/lifecycle/status');
83
87
  if (relationship === undefined ||
84
88
  !('ref' in relationship.object) ||
89
+ (projection.query.excludeStatuses !== undefined &&
90
+ relationshipStatus !== undefined &&
91
+ projection.query.excludeStatuses.includes(relationshipStatus)) ||
85
92
  (projection.query.relationshipKinds !== undefined &&
86
93
  !projection.query.relationshipKinds.some((selectedKind) => selectedKind === relationship.predicate ||
87
94
  (projection.query.kindMatching === 'descendants' &&
@@ -93,6 +100,20 @@ export function evaluateProjection(graph, projection, profileContext) {
93
100
  }
94
101
  const sourceSelected = initiallySelectedConceptIds.has(relationship.subject);
95
102
  const targetSelected = initiallySelectedConceptIds.has(relationship.object.ref);
103
+ // excludeStatuses also vetoes connected expansion: an excluded
104
+ // concept is never pulled in as a neighbour, and edges touching
105
+ // one are dropped rather than left dangling.
106
+ const endpointExcluded = (id) => {
107
+ if (projection.query.excludeStatuses === undefined)
108
+ return false;
109
+ const endpointStatus = claimValue(graph.claims, id, 'yarramate/lifecycle/status');
110
+ return (endpointStatus !== undefined &&
111
+ projection.query.excludeStatuses.includes(endpointStatus));
112
+ };
113
+ if (endpointExcluded(relationship.subject) ||
114
+ endpointExcluded(relationship.object.ref)) {
115
+ continue;
116
+ }
96
117
  if ((relationshipMode === 'between' &&
97
118
  sourceSelected &&
98
119
  targetSelected) ||
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yarramate",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Tool-neutral semantic architecture engine and guided methodology",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -49,6 +49,14 @@
49
49
  "enum": ["planned", "current", "retired"]
50
50
  }
51
51
  },
52
+ "excludeStatuses": {
53
+ "description": "Drop concepts carrying one of these lifecycle statuses while keeping concepts that declare no status at all - 'everything except retired' for viewpoint projections, where a bare statuses filter would wrongly drop unstatused actors and motivation elements.",
54
+ "type": "array",
55
+ "uniqueItems": true,
56
+ "items": {
57
+ "enum": ["planned", "current", "retired"]
58
+ }
59
+ },
52
60
  "states": {
53
61
  "type": "array",
54
62
  "minItems": 1,