You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add `workflow` rule category for process discipline checks; move
active-outcome/opportunity-count rules from coherence to workflow
- Add `active-node-parent-active` workflow rule: an active node's parent
must also be active
- Update `solution-quantity` best-practice to only apply when opportunity
status is exploring or active
- Check `allowSelfRef ⊆ hierarchy` in validate command, reporting
mismatches as config errors with a new configErrors result field
- Rename schemaErrors/schemaValidCount → nodeErrors/validCount for clarity
- Update docs/rules.md: add workflow category, clarify scope is
orthogonal to category, update examples
Copy file name to clipboardExpand all lines: docs/rules.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,12 +6,13 @@ For how rules fit into the broader schema metadata, see [docs/schemas.md](schema
6
6
7
7
## Rule Categories
8
8
9
-
Rules are grouped into three categories under `_metadata.rules`.
9
+
Rules are grouped into categories under `_metadata.rules`. Categories are informational — they determine how violations are labelled and grouped in output, but do not affect how the rule is evaluated. Use `scope` to control evaluation mode.
10
10
11
11
| Category | Purpose |
12
12
|---|---|
13
13
|`validation`| Structural correctness — a violation means the node is incorrect and should be fixed |
14
-
|`coherence`| Cross-node checks — for flagging conflicts or contradictions (often combined with `scope: 'global'` for multi-node/aggregate checks) |
14
+
|`coherence`| Cross-node checks — for flagging conflicts or contradictions between nodes |
15
+
|`workflow`| Process discipline checks — for keeping the tree in an operational working state (active counts, status consistency) |
15
16
|`bestPractice`| Advisory guidance — signals the space may benefit from additional work |
"description": "Only one outcome should be active at a time",
71
72
"scope": "global",
72
73
"check": "$count(nodes[resolvedType='outcome' and status='active']) <= 1"
73
74
},
74
75
{
75
-
"id": "active-opportunity-count",
76
-
"description": "Only one target opportunity should be active at a time",
77
-
"scope": "global",
78
-
"check": "$count(nodes[resolvedType='opportunity' and status='active']) <= 1"
76
+
"id": "active-node-parent-active",
77
+
"description": "An active node's parent should also be active",
78
+
"check": "current.status != 'active' or $exists(parent) = false or parent.status = 'active'"
79
79
}
80
80
],
81
81
"bestPractice": [
82
82
{
83
83
"id": "solution-quantity",
84
84
"description": "Explore multiple candidate solutions (aim for at least three) for the target opportunity",
85
85
"type": "opportunity",
86
-
"check": "$count(nodes[resolvedParentTitle=$$.current.title and resolvedType='solution']) >= 3"
86
+
"check": "(current.status != 'exploring' and current.status != 'active') or $count(nodes[resolvedParentTitle=$$.current.title and resolvedType='solution']) >= 3"
87
87
}
88
88
]
89
89
}
90
90
```
91
91
92
-
The coherence rules run against every node (no `type` filter) — each node in a space with two active outcomes will report a violation. The best-practice rule only runs against `opportunity` nodes, using `resolvedParentTitle` to count child solutions.
92
+
The first workflow rule uses `scope: 'global'` — evaluated once against the whole space, producing at most one violation. The second runs per-node with no `type` filter, checking every node. The best-practice rule only runs against `opportunity` nodes where status is `exploring` or `active`, using `resolvedParentTitle` to count child solutions.
"description": "Only one outcome should be active at a time",
@@ -21,14 +21,19 @@
21
21
"description": "Only one target opportunity should be active at a time",
22
22
"scope": "global",
23
23
"check": "$count(nodes[resolvedType='opportunity' and status='active']) <= 1"
24
+
},
25
+
{
26
+
"id": "active-node-parent-active",
27
+
"description": "An active node's parent should also be active",
28
+
"check": "current.status != 'active' or $exists(parent) = false or parent.status = 'active'"
24
29
}
25
30
],
26
31
"bestPractice": [
27
32
{
28
33
"id": "solution-quantity",
29
34
"description": "Explore multiple candidate solutions (aim for at least three) for the target opportunity",
30
35
"type": "opportunity",
31
-
"check": "$count(nodes[resolvedParentTitle=$$.current.title and resolvedType='solution']) >= 3"
36
+
"check": "(current.status != 'exploring' and current.status != 'active') or $count(nodes[resolvedParentTitle=$$.current.title and resolvedType='solution']) >= 3"
0 commit comments