structured-context 0.10.0 → 0.12.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/README.md +85 -25
- package/dist/api.d.ts +25 -5
- package/dist/api.js +22 -2
- package/dist/commands/diagram.d.ts +1 -0
- package/dist/commands/diagram.js +7 -1
- package/dist/commands/dump.d.ts +15 -2
- package/dist/commands/dump.js +18 -4
- package/dist/commands/miro-sync.d.ts +3 -0
- package/dist/commands/miro-sync.js +8 -0
- package/dist/commands/render.d.ts +4 -0
- package/dist/commands/render.js +64 -9
- package/dist/commands/schemas.d.ts +2 -2
- package/dist/commands/schemas.js +117 -24
- package/dist/commands/show.d.ts +1 -0
- package/dist/commands/show.js +7 -1
- package/dist/commands/spaces.d.ts +3 -1
- package/dist/commands/spaces.js +11 -4
- package/dist/commands/validate-file.js +20 -5
- package/dist/commands/validate.js +54 -21
- package/dist/config.d.ts +26 -13
- package/dist/config.js +104 -31
- package/dist/filter/augment-nodes.d.ts +3 -1
- package/dist/filter/augment-nodes.js +12 -7
- package/dist/filter/filter-nodes.js +1 -1
- package/dist/index.js +51 -35
- package/dist/load-space-graph.d.ts +42 -0
- package/dist/load-space-graph.js +53 -0
- package/dist/plugins/index.js +3 -1
- package/dist/plugins/loader.js +4 -4
- package/dist/plugins/markdown/extract-content-links.d.ts +23 -0
- package/dist/plugins/markdown/extract-content-links.js +123 -0
- package/dist/plugins/markdown/index.js +5 -5
- package/dist/plugins/markdown/parse-embedded.d.ts +6 -0
- package/dist/plugins/markdown/parse-embedded.js +50 -7
- package/dist/plugins/markdown/read-space.js +41 -5
- package/dist/plugins/markdown/render-directory.d.ts +11 -0
- package/dist/plugins/markdown/render-directory.js +130 -0
- package/dist/plugins/mermaid/index.d.ts +2 -0
- package/dist/plugins/mermaid/index.js +14 -0
- package/dist/plugins/{markdown → mermaid}/render-mermaid.js +17 -15
- package/dist/{integrations → plugins}/miro/cache.d.ts +1 -1
- package/dist/plugins/miro/index.d.ts +2 -0
- package/dist/plugins/miro/index.js +27 -0
- package/dist/{integrations → plugins}/miro/layout.d.ts +2 -2
- package/dist/{integrations → plugins}/miro/layout.js +3 -16
- package/dist/{integrations → plugins}/miro/styles.d.ts +2 -2
- package/dist/plugins/miro/sync.d.ts +7 -0
- package/dist/{integrations → plugins}/miro/sync.js +22 -39
- package/dist/plugins/util.d.ts +48 -1
- package/dist/plugins/util.js +143 -0
- package/dist/read/resolve-graph-edges.d.ts +1 -1
- package/dist/read/resolve-graph-edges.js +78 -27
- package/dist/read/wikilink-utils.d.ts +17 -0
- package/dist/read/wikilink-utils.js +40 -0
- package/dist/render/render.d.ts +4 -1
- package/dist/render/render.js +20 -16
- package/dist/schema/evaluate-rule.js +1 -0
- package/dist/schema/meta-schemas.d.ts +13 -0
- package/dist/schema/meta-schemas.js +50 -0
- package/dist/schema/metadata-contract.d.ts +343 -187
- package/dist/schema/metadata-contract.js +68 -30
- package/dist/schema/schema.d.ts +17 -9
- package/dist/schema/schema.js +283 -200
- package/dist/schema/validate-graph.d.ts +2 -1
- package/dist/schema/validate-graph.js +40 -23
- package/dist/schema/validate-rules.d.ts +5 -1
- package/dist/schema/validate-rules.js +20 -1
- package/dist/schemas/_knowledge_wiki.json +21 -21
- package/dist/schemas/_ost_strict.json +2 -2
- package/dist/schemas/_sctx_base.json +2 -2
- package/dist/schemas/_strategy_general.json +38 -38
- package/dist/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
- package/dist/schemas/generated/latest/_structured_context_schema_meta.json +229 -0
- package/dist/schemas/knowledge_wiki.json +10 -9
- package/dist/schemas/strategy_general.json +15 -14
- package/dist/schemas/strict_ost.json +17 -16
- package/dist/space-context.d.ts +27 -0
- package/dist/space-context.js +46 -0
- package/dist/space-graph.d.ts +9 -7
- package/dist/space-graph.js +7 -5
- package/dist/testing.d.ts +33 -0
- package/dist/testing.js +72 -0
- package/dist/types.d.ts +101 -8
- package/dist/validate.d.ts +15 -3
- package/dist/validate.js +55 -20
- package/docs/concepts.md +37 -4
- package/docs/config.md +10 -0
- package/docs/rules.md +49 -22
- package/docs/schemas.md +110 -35
- package/package.json +13 -8
- package/schemas/_knowledge_wiki.json +21 -21
- package/schemas/_ost_strict.json +2 -2
- package/schemas/_sctx_base.json +2 -2
- package/schemas/_strategy_general.json +38 -38
- package/schemas/generated/0.12.0/_structured_context_schema_meta.json +229 -0
- package/schemas/generated/latest/_structured_context_schema_meta.json +229 -0
- package/schemas/knowledge_wiki.json +10 -9
- package/schemas/strategy_general.json +15 -14
- package/schemas/strict_ost.json +17 -16
- package/dist/integrations/miro/sync.d.ts +0 -8
- package/dist/schemas/generated/_structured_context_schema_meta.json +0 -191
- package/schemas/generated/_structured_context_schema_meta.json +0 -191
- /package/dist/plugins/{markdown → mermaid}/render-mermaid.d.ts +0 -0
- /package/dist/{integrations → plugins}/miro/cache.js +0 -0
- /package/dist/{integrations → plugins}/miro/client.d.ts +0 -0
- /package/dist/{integrations → plugins}/miro/client.js +0 -0
- /package/dist/{integrations → plugins}/miro/styles.js +0 -0
|
@@ -4,14 +4,19 @@ import { resolveNodeType } from '../schema/schema';
|
|
|
4
4
|
* Assumes resolveGraphEdges has already been called to populate node.resolvedParents.
|
|
5
5
|
*/
|
|
6
6
|
export function validateGraph(nodes, metadata, unresolvedRefs = []) {
|
|
7
|
-
const refErrors = unresolvedRefs.map((u) => ({
|
|
7
|
+
const refErrors = unresolvedRefs.map((u) => ({
|
|
8
|
+
file: u.source?.file ?? u.label,
|
|
9
|
+
...(u.source?.line !== undefined ? { line: u.source.line } : {}),
|
|
10
|
+
parent: u.ref,
|
|
11
|
+
error: u.message,
|
|
12
|
+
}));
|
|
8
13
|
const violations = validateHierarchyStructure(nodes, metadata);
|
|
9
14
|
return { violations, refErrors };
|
|
10
15
|
}
|
|
11
16
|
/**
|
|
12
17
|
* Validate that resolved parents follow hierarchy level rules and relationship type constraints.
|
|
13
18
|
*
|
|
14
|
-
* For hierarchy edges (fieldOn:'child', source:'hierarchy'): validates level ordering.
|
|
19
|
+
* For hierarchy edges (fieldOn:'child', source:'hierarchy'): validates level ordering within the edge's hierarchy.
|
|
15
20
|
* For relationship edges (fieldOn:'child', source:'relationship'): validates parent type.
|
|
16
21
|
* For fieldOn:'parent' edges: validates child type, violation attributed to the field-owner node.
|
|
17
22
|
*
|
|
@@ -19,11 +24,12 @@ export function validateGraph(nodes, metadata, unresolvedRefs = []) {
|
|
|
19
24
|
*/
|
|
20
25
|
export function validateHierarchyStructure(nodes, metadata) {
|
|
21
26
|
const violations = [];
|
|
22
|
-
const
|
|
27
|
+
const hierarchies = metadata.hierarchies ?? [];
|
|
23
28
|
const relationships = metadata.relationships ?? [];
|
|
24
|
-
const allowSkipLevels = metadata.hierarchy?.allowSkipLevels ?? false;
|
|
25
29
|
const typeAliases = metadata.typeAliases;
|
|
26
|
-
const
|
|
30
|
+
const hierarchiesByName = new Map(hierarchies.map((h) => [h.name, h]));
|
|
31
|
+
const levelTypesByName = new Map(hierarchies.map((h) => [h.name, h.levels.map((level) => resolveNodeType(level.type, typeAliases))]));
|
|
32
|
+
const allHierarchyTypes = new Set([...levelTypesByName.values()].flat());
|
|
27
33
|
// Build type rules: (ownerType, field) → set of valid target types.
|
|
28
34
|
// For fieldOn:'child': owner=childType, target=parentType.
|
|
29
35
|
// For fieldOn:'parent': owner=parentType (field owner), target=childType.
|
|
@@ -38,18 +44,20 @@ export function validateHierarchyStructure(nodes, metadata) {
|
|
|
38
44
|
fieldMap.set(field, new Set());
|
|
39
45
|
fieldMap.get(field).add(target);
|
|
40
46
|
}
|
|
41
|
-
for (
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
for (const { levels } of hierarchies) {
|
|
48
|
+
for (let i = 1; i < levels.length; i++) {
|
|
49
|
+
const level = levels[i];
|
|
50
|
+
const parentLevel = levels[i - 1];
|
|
51
|
+
if (level.fieldOn === 'parent') {
|
|
52
|
+
addTypeRule(parentLevel.type, level.field, level.type);
|
|
53
|
+
if (level.selfRef)
|
|
54
|
+
addTypeRule(level.type, level.field, level.type);
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
addTypeRule(level.type, level.field, parentLevel.type);
|
|
58
|
+
if (level.selfRef)
|
|
59
|
+
addTypeRule(level.type, level.field, level.type);
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
}
|
|
55
63
|
for (const rel of relationships) {
|
|
@@ -107,15 +115,24 @@ export function validateHierarchyStructure(nodes, metadata) {
|
|
|
107
115
|
}
|
|
108
116
|
}
|
|
109
117
|
else {
|
|
110
|
-
// Hierarchy edge (fieldOn:'child', source:'hierarchy'): validate level ordering.
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
118
|
+
// Hierarchy edge (fieldOn:'child', source:'hierarchy'): validate level ordering within its hierarchy.
|
|
119
|
+
const edgeHierarchy = parentRef.hierarchy !== undefined ? hierarchiesByName.get(parentRef.hierarchy) : undefined;
|
|
120
|
+
if (!edgeHierarchy)
|
|
121
|
+
continue;
|
|
122
|
+
const levelTypes = levelTypesByName.get(edgeHierarchy.name);
|
|
123
|
+
const typeIndex = levelTypes.indexOf(nodeType);
|
|
124
|
+
const parentIndex = levelTypes.indexOf(parentType);
|
|
125
|
+
// A parent from another hierarchy is invalid; a parent of a type outside every hierarchy is not checked here.
|
|
126
|
+
if (typeIndex === -1 || (parentIndex === -1 && !allHierarchyTypes.has(parentType)))
|
|
114
127
|
continue;
|
|
115
|
-
const level = levels[typeIndex];
|
|
128
|
+
const level = edgeHierarchy.levels[typeIndex];
|
|
116
129
|
const canSelfRef = level.selfRef || level.selfRefField !== undefined;
|
|
130
|
+
const allowSkipLevels = edgeHierarchy.allowSkipLevels ?? false;
|
|
117
131
|
let isValidHierarchy = false;
|
|
118
|
-
if (parentIndex ===
|
|
132
|
+
if (parentIndex === -1) {
|
|
133
|
+
isValidHierarchy = false;
|
|
134
|
+
}
|
|
135
|
+
else if (parentIndex === typeIndex - 1) {
|
|
119
136
|
isValidHierarchy = true;
|
|
120
137
|
}
|
|
121
138
|
else if (canSelfRef && parentIndex === typeIndex) {
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { Rule, RuleViolation, SpaceNode } from '../types';
|
|
1
|
+
import type { Rule, RuleCategory, RuleSeverity, RuleViolation, SpaceNode } from '../types';
|
|
2
|
+
/** Default severity for each rule category. A rule's own `severity` field overrides this. */
|
|
3
|
+
export declare const DEFAULT_SEVERITY_BY_CATEGORY: Record<RuleCategory, RuleSeverity>;
|
|
4
|
+
/** Effective severity of a rule: its explicit `severity`, else its category default. */
|
|
5
|
+
export declare function ruleSeverity(rule: Rule): RuleSeverity;
|
|
2
6
|
/**
|
|
3
7
|
* Validate nodes against rules metadata.
|
|
4
8
|
* Returns a list of rule violations found.
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { buildEvalContext, evaluateExpression } from './evaluate-rule';
|
|
2
|
+
/** Default severity for each rule category. A rule's own `severity` field overrides this. */
|
|
3
|
+
export const DEFAULT_SEVERITY_BY_CATEGORY = {
|
|
4
|
+
validation: 'error',
|
|
5
|
+
coherence: 'warning',
|
|
6
|
+
workflow: 'warning',
|
|
7
|
+
'best-practice': 'info',
|
|
8
|
+
};
|
|
9
|
+
/** Effective severity of a rule: its explicit `severity`, else its category default. */
|
|
10
|
+
export function ruleSeverity(rule) {
|
|
11
|
+
return rule.severity ?? DEFAULT_SEVERITY_BY_CATEGORY[rule.category];
|
|
12
|
+
}
|
|
2
13
|
/**
|
|
3
14
|
* Validate nodes against rules metadata.
|
|
4
15
|
* Returns a list of rule violations found.
|
|
@@ -19,6 +30,7 @@ export async function validateRules(nodes, rules) {
|
|
|
19
30
|
}
|
|
20
31
|
// Evaluate each rule against applicable nodes
|
|
21
32
|
for (const rule of rules) {
|
|
33
|
+
const severity = ruleSeverity(rule);
|
|
22
34
|
if (rule.scope === 'global') {
|
|
23
35
|
// Global rules are evaluated once against the full node set.
|
|
24
36
|
// A sentinel node provides the evaluation context (nodes array is what matters).
|
|
@@ -27,7 +39,13 @@ export async function validateRules(nodes, rules) {
|
|
|
27
39
|
const context = buildEvalContext(sentinel, nodes, nodeIndex);
|
|
28
40
|
const result = await evaluateExpression(rule.check, context);
|
|
29
41
|
if (result !== true) {
|
|
30
|
-
violations.push({
|
|
42
|
+
violations.push({
|
|
43
|
+
file: '',
|
|
44
|
+
ruleId: rule.id,
|
|
45
|
+
category: rule.category,
|
|
46
|
+
severity,
|
|
47
|
+
description: rule.description,
|
|
48
|
+
});
|
|
31
49
|
}
|
|
32
50
|
}
|
|
33
51
|
}
|
|
@@ -41,6 +59,7 @@ export async function validateRules(nodes, rules) {
|
|
|
41
59
|
file: node.label,
|
|
42
60
|
ruleId: rule.id,
|
|
43
61
|
category: rule.category,
|
|
62
|
+
severity,
|
|
44
63
|
description: rule.description,
|
|
45
64
|
});
|
|
46
65
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json",
|
|
3
|
-
"$id": "sctx://_knowledge_wiki",
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/latest/_structured_context_schema_meta.json",
|
|
3
|
+
"$id": "sctx://core/_knowledge_wiki",
|
|
4
4
|
// Shared entity definitions for knowledge wiki schemas.
|
|
5
5
|
// Provides aliases, relationships, rules, and entity type $defs.
|
|
6
6
|
// This partial has no hierarchy — wiki entities are flat with no required parent links.
|
|
@@ -65,18 +65,18 @@
|
|
|
65
65
|
"source": {
|
|
66
66
|
"type": "object",
|
|
67
67
|
"description": "A processed summary of a raw source (article, paper, book, video, thread, podcast, etc.). Captures key information from the source in structured form with provenance.",
|
|
68
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
68
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
69
69
|
"properties": {
|
|
70
70
|
"type": { "const": "source" },
|
|
71
71
|
"summary": {
|
|
72
|
-
"$ref": "sctx://_sctx_base#/$defs/summary"
|
|
72
|
+
"$ref": "sctx://core/_sctx_base#/$defs/summary"
|
|
73
73
|
},
|
|
74
74
|
"url": {
|
|
75
75
|
"type": "string",
|
|
76
76
|
"description": "URL of the original source"
|
|
77
77
|
},
|
|
78
78
|
"local_copy": {
|
|
79
|
-
"$ref": "sctx://_sctx_base#/$defs/wikilink",
|
|
79
|
+
"$ref": "sctx://core/_sctx_base#/$defs/wikilink",
|
|
80
80
|
"description": "Wikilink to a local copy of the source (e.g. a saved PDF or clipped note)"
|
|
81
81
|
},
|
|
82
82
|
"author": {
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
},
|
|
99
99
|
"sources": {
|
|
100
100
|
"type": "array",
|
|
101
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
101
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
102
102
|
"description": "Wikilinks to other source pages that this one references or extends"
|
|
103
103
|
}
|
|
104
104
|
},
|
|
@@ -117,20 +117,20 @@
|
|
|
117
117
|
"concept": {
|
|
118
118
|
"type": "object",
|
|
119
119
|
"description": "A concept page — defines and frames a specific idea, mechanism, or domain term. May draw from multiple sources. The building blocks of the wiki's knowledge graph.",
|
|
120
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
120
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
121
121
|
"properties": {
|
|
122
122
|
"type": { "const": "concept" },
|
|
123
123
|
"summary": {
|
|
124
|
-
"$ref": "sctx://_sctx_base#/$defs/summary"
|
|
124
|
+
"$ref": "sctx://core/_sctx_base#/$defs/summary"
|
|
125
125
|
},
|
|
126
126
|
"sources": {
|
|
127
127
|
"type": "array",
|
|
128
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
128
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
129
129
|
"description": "Wikilinks to source pages that contributed to this concept"
|
|
130
130
|
},
|
|
131
131
|
"related": {
|
|
132
132
|
"type": "array",
|
|
133
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
133
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
134
134
|
"description": "Wikilinks to related concept or synthesis pages"
|
|
135
135
|
}
|
|
136
136
|
},
|
|
@@ -147,20 +147,20 @@
|
|
|
147
147
|
"entity": {
|
|
148
148
|
"type": "object",
|
|
149
149
|
"description": "A concrete entity — a person, organisation, product, model, or other named thing. The building blocks of the wiki's knowledge graph alongside concepts. Entities are distinct from concepts: a concept frames an idea or mechanism; an entity is a specific, identifiable thing in the world.",
|
|
150
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
150
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
151
151
|
"properties": {
|
|
152
152
|
"type": { "const": "entity" },
|
|
153
153
|
"summary": {
|
|
154
|
-
"$ref": "sctx://_sctx_base#/$defs/summary"
|
|
154
|
+
"$ref": "sctx://core/_sctx_base#/$defs/summary"
|
|
155
155
|
},
|
|
156
156
|
"sources": {
|
|
157
157
|
"type": "array",
|
|
158
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
158
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
159
159
|
"description": "Wikilinks to source pages that contributed to this entity page"
|
|
160
160
|
},
|
|
161
161
|
"related": {
|
|
162
162
|
"type": "array",
|
|
163
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
163
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
164
164
|
"description": "Wikilinks to related entity, concept, or synthesis pages"
|
|
165
165
|
}
|
|
166
166
|
},
|
|
@@ -177,20 +177,20 @@
|
|
|
177
177
|
"synthesis": {
|
|
178
178
|
"type": "object",
|
|
179
179
|
"description": "A synthesis page — connects multiple concepts and sources into a coherent model, framework, or thesis. The highest-value pages in a knowledge wiki. Must reference contributing sources.",
|
|
180
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
180
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
181
181
|
"properties": {
|
|
182
182
|
"type": { "const": "synthesis" },
|
|
183
183
|
"summary": {
|
|
184
|
-
"$ref": "sctx://_sctx_base#/$defs/summary"
|
|
184
|
+
"$ref": "sctx://core/_sctx_base#/$defs/summary"
|
|
185
185
|
},
|
|
186
186
|
"sources": {
|
|
187
187
|
"type": "array",
|
|
188
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
188
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
189
189
|
"description": "Wikilinks to source pages this synthesis draws from"
|
|
190
190
|
},
|
|
191
191
|
"concepts": {
|
|
192
192
|
"type": "array",
|
|
193
|
-
"items": { "$ref": "sctx://_sctx_base#/$defs/wikilink" },
|
|
193
|
+
"items": { "$ref": "sctx://core/_sctx_base#/$defs/wikilink" },
|
|
194
194
|
"description": "Wikilinks to concept pages this synthesis connects"
|
|
195
195
|
}
|
|
196
196
|
},
|
|
@@ -207,8 +207,8 @@
|
|
|
207
207
|
},
|
|
208
208
|
"note": {
|
|
209
209
|
"type": "object",
|
|
210
|
-
"description": "Personal notes, journal entries,
|
|
211
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
210
|
+
"description": "Personal notes, journal entries, talk notes, or rough thoughts not drawn from an external URL.",
|
|
211
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
212
212
|
"properties": {
|
|
213
213
|
"type": { "const": "note" },
|
|
214
214
|
"date": {
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
"index": {
|
|
231
231
|
"type": "object",
|
|
232
232
|
"description": "The wiki index — a catalog of all pages with links, summaries, and metadata. Updated by the agent on ingest. Used as the primary navigation entry point.",
|
|
233
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
233
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
234
234
|
"properties": {
|
|
235
235
|
"type": { "const": "index" }
|
|
236
236
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json",
|
|
3
|
-
"$id": "sctx://_ost_strict",
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/latest/_structured_context_schema_meta.json",
|
|
3
|
+
"$id": "sctx://core/_ost_strict",
|
|
4
4
|
// Shared definitions for the strict OST (Opportunity Solution Tree) schema.
|
|
5
5
|
// This schema follows Teresa Torres' canonical 4-level structure as described in
|
|
6
6
|
// "Continuous Discovery Habits" (2021) and at producttalk.org.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "
|
|
3
|
-
"$id": "sctx://_sctx_base",
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "sctx://core/_sctx_base",
|
|
4
4
|
"description": "Shared definitions for structured-context schemas",
|
|
5
5
|
"$defs": {
|
|
6
6
|
"title": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/_structured_context_schema_meta.json",
|
|
3
|
-
"$id": "sctx://_strategy_general",
|
|
2
|
+
"$schema": "https://raw.githubusercontent.com/mindsocket/structured-context/main/schemas/generated/latest/_structured_context_schema_meta.json",
|
|
3
|
+
"$id": "sctx://core/_strategy_general",
|
|
4
4
|
// Shared entity definitions for strategy-general schemas.
|
|
5
|
-
// Provides a
|
|
6
|
-
//
|
|
5
|
+
// Provides a hierarchy, aliases, relationships, and entity type $defs.
|
|
6
|
+
// Schemas that import this partial get its metadata; a $ref to its $defs alone brings none.
|
|
7
7
|
"$metadata": {
|
|
8
8
|
"hierarchy": {
|
|
9
9
|
"levels": [
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"$defs": {
|
|
46
46
|
"dashboard": {
|
|
47
47
|
"type": "object",
|
|
48
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
48
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
49
49
|
"properties": {
|
|
50
50
|
"type": { "const": "dashboard" }
|
|
51
51
|
},
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"ost_on_a_page": {
|
|
56
56
|
"type": "object",
|
|
57
|
-
"allOf": [{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" }],
|
|
57
|
+
"allOf": [{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" }],
|
|
58
58
|
"properties": {
|
|
59
59
|
"type": { "enum": ["ost_on_a_page", "space_on_a_page"] }
|
|
60
60
|
},
|
|
@@ -64,8 +64,8 @@
|
|
|
64
64
|
"vision": {
|
|
65
65
|
"type": "object",
|
|
66
66
|
"allOf": [
|
|
67
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
68
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
67
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
68
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
69
69
|
],
|
|
70
70
|
"properties": {
|
|
71
71
|
"type": { "const": "vision" }
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"mission": {
|
|
84
84
|
"type": "object",
|
|
85
85
|
"allOf": [
|
|
86
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
87
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
88
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
86
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
87
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
88
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
89
89
|
],
|
|
90
90
|
"properties": {
|
|
91
91
|
"type": { "const": "mission" }
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
"goal": {
|
|
104
104
|
"type": "object",
|
|
105
105
|
"allOf": [
|
|
106
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
107
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
108
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
106
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
107
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
108
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
109
109
|
],
|
|
110
110
|
"properties": {
|
|
111
111
|
"type": { "enum": ["goal", "outcome"] },
|
|
112
|
-
"priority": { "$ref": "sctx://_sctx_base#/$defs/priority" }
|
|
112
|
+
"priority": { "$ref": "sctx://core/_sctx_base#/$defs/priority" }
|
|
113
113
|
},
|
|
114
114
|
"required": ["type"],
|
|
115
115
|
"additionalProperties": true,
|
|
@@ -125,16 +125,16 @@
|
|
|
125
125
|
"opportunity": {
|
|
126
126
|
"type": "object",
|
|
127
127
|
"allOf": [
|
|
128
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
129
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
130
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
128
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
129
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
130
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
131
131
|
],
|
|
132
132
|
"properties": {
|
|
133
133
|
"type": { "const": "opportunity" },
|
|
134
|
-
"priority": { "$ref": "sctx://_sctx_base#/$defs/priority" },
|
|
135
|
-
"impact": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
136
|
-
"feasibility": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
137
|
-
"resources": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
134
|
+
"priority": { "$ref": "sctx://core/_sctx_base#/$defs/priority" },
|
|
135
|
+
"impact": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
136
|
+
"feasibility": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
137
|
+
"resources": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
138
138
|
"timeline": {
|
|
139
139
|
"type": "string",
|
|
140
140
|
"description": "Timeline estimate (e.g., S-M, M-L)"
|
|
@@ -158,16 +158,16 @@
|
|
|
158
158
|
"solution": {
|
|
159
159
|
"type": "object",
|
|
160
160
|
"allOf": [
|
|
161
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
162
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
163
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
161
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
162
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
163
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
164
164
|
],
|
|
165
165
|
"properties": {
|
|
166
166
|
"type": { "const": "solution" },
|
|
167
|
-
"priority": { "$ref": "sctx://_sctx_base#/$defs/priority" },
|
|
168
|
-
"impact": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
169
|
-
"feasibility": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
170
|
-
"resources": { "$ref": "sctx://_sctx_base#/$defs/assessment" },
|
|
167
|
+
"priority": { "$ref": "sctx://core/_sctx_base#/$defs/priority" },
|
|
168
|
+
"impact": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
169
|
+
"feasibility": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
170
|
+
"resources": { "$ref": "sctx://core/_sctx_base#/$defs/assessment" },
|
|
171
171
|
"timeline": {
|
|
172
172
|
"type": "string",
|
|
173
173
|
"description": "Timeline estimate (e.g., S-M, M-L)"
|
|
@@ -191,9 +191,9 @@
|
|
|
191
191
|
"experiment": {
|
|
192
192
|
"type": "object",
|
|
193
193
|
"allOf": [
|
|
194
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
195
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
196
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
194
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
195
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
196
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
197
197
|
],
|
|
198
198
|
"properties": {
|
|
199
199
|
"type": { "enum": ["experiment", "assumption_test", "test"] }
|
|
@@ -216,9 +216,9 @@
|
|
|
216
216
|
"assumption": {
|
|
217
217
|
"type": "object",
|
|
218
218
|
"allOf": [
|
|
219
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
220
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
221
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
219
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
220
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
221
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
222
222
|
],
|
|
223
223
|
"properties": {
|
|
224
224
|
"type": { "const": "assumption" },
|
|
@@ -242,9 +242,9 @@
|
|
|
242
242
|
"problem_statement": {
|
|
243
243
|
"type": "object",
|
|
244
244
|
"allOf": [
|
|
245
|
-
{ "$ref": "sctx://_sctx_base#/$defs/baseNodeProps" },
|
|
246
|
-
{ "$ref": "sctx://_sctx_base#/$defs/parentNodeProps" },
|
|
247
|
-
{ "$ref": "sctx://_sctx_base#/$defs/ostEntityProps" }
|
|
245
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/baseNodeProps" },
|
|
246
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/parentNodeProps" },
|
|
247
|
+
{ "$ref": "sctx://core/_sctx_base#/$defs/ostEntityProps" }
|
|
248
248
|
],
|
|
249
249
|
"properties": {
|
|
250
250
|
"type": { "const": "problem_statement" }
|