@medicine-wheel/relational-index 0.2.2

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 ADDED
@@ -0,0 +1,76 @@
1
+ # @medicine-wheel/relational-index
2
+
3
+ Four-source epistemic dimensional indexing for the **Medicine Wheel Developer Suite**.
4
+
5
+ Wilson's epistemology recognises multiple sources of knowing — Land, Dream, Code, and Vision each teach differently. This package enables querying, traversal, and cross-dimensional mapping across those epistemic sources.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @medicine-wheel/relational-index
11
+ ```
12
+
13
+ ## Quick Start
14
+
15
+ ```typescript
16
+ import {
17
+ createIndex,
18
+ addEntry,
19
+ queryBySource,
20
+ dimensionBalance,
21
+ measureSpiralDepth,
22
+ indexHealth,
23
+ } from '@medicine-wheel/relational-index';
24
+
25
+ // Create an empty index
26
+ const index = createIndex();
27
+
28
+ // Add entries from different epistemic sources
29
+ const withLand = addEntry(index, {
30
+ unitId: 'territory-walk-01',
31
+ source: 'land',
32
+ direction: 'east',
33
+ epistemicWeight: 0.8,
34
+ circleDepth: 1,
35
+ accountableTo: ['community-elders'],
36
+ tags: ['territory', 'morning'],
37
+ timestamp: new Date().toISOString(),
38
+ });
39
+
40
+ // Query by source
41
+ const landEntries = queryBySource(withLand, 'land');
42
+
43
+ // Check dimensional balance
44
+ const balance = dimensionBalance(withLand);
45
+
46
+ // Measure spiral depth
47
+ const depth = measureSpiralDepth(withLand);
48
+
49
+ // Get overall health
50
+ const health = indexHealth(withLand);
51
+ ```
52
+
53
+ ## Modules
54
+
55
+ | Module | Purpose |
56
+ |--------|---------|
57
+ | `index-manager` | Create, add, remove, rebuild index |
58
+ | `query` | Query by source, direction, weight, depth, cross-dimensional |
59
+ | `dimensions` | Land, Dream, Code, Vision views and balance |
60
+ | `cross-dimensional` | Convergences, tensions, coverage gaps |
61
+ | `spiral-depth` | Deepening detection, stagnation alerts |
62
+ | `metrics` | Index health, balance scores, recommendations |
63
+
64
+ ## Wilson Alignment
65
+
66
+ This package implements the epistemic sophistication Wilson's framework demands:
67
+
68
+ - **Land**: Embodied, place-based knowledge — walking the territory
69
+ - **Dream**: Intuitive, liminal knowledge — vision and dreaming
70
+ - **Code**: Implementation knowledge — algorithms and structure
71
+ - **Vision**: Aspirational knowledge — intention and future
72
+
73
+ ## License
74
+
75
+ MIT
76
+
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Cross-Dimensional Analysis — mapping relationships between epistemic sources.
3
+ *
4
+ * Wilson's epistemology holds that Land, Dream, Code, and Vision each
5
+ * teach differently. This module finds where those ways of knowing
6
+ * converge, where they are in tension, and where coverage is lacking.
7
+ */
8
+ import type { RelationalIndex, CrossDimensionalMap, Convergence, Tension, DimensionGap } from './types.js';
9
+ /** Build the complete cross-dimensional map for the index */
10
+ export declare function mapAcrossDimensions(index: RelationalIndex): CrossDimensionalMap;
11
+ /** Find convergences — points where multiple epistemic dimensions agree */
12
+ export declare function findConvergences(index: RelationalIndex): Convergence[];
13
+ /** Detect tensions — points where dimensions conflict or diverge */
14
+ export declare function detectTensions(index: RelationalIndex): Tension[];
15
+ /** Identify coverage gaps — epistemic dimensions that are underrepresented */
16
+ export declare function coverageGaps(index: RelationalIndex): DimensionGap[];
17
+ //# sourceMappingURL=cross-dimensional.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-dimensional.d.ts","sourceRoot":"","sources":["../src/cross-dimensional.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,WAAW,EACX,OAAO,EACP,YAAY,EAEb,MAAM,YAAY,CAAC;AAIpB,6DAA6D;AAC7D,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,eAAe,GAAG,mBAAmB,CAM/E;AAED,2EAA2E;AAC3E,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,WAAW,EAAE,CA+BtE;AAED,oEAAoE;AACpE,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,EAAE,CA8BhE;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,EAAE,CA2BnE"}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.mapAcrossDimensions = mapAcrossDimensions;
4
+ exports.findConvergences = findConvergences;
5
+ exports.detectTensions = detectTensions;
6
+ exports.coverageGaps = coverageGaps;
7
+ const ALL_SOURCES = ['land', 'dream', 'code', 'vision'];
8
+ /** Build the complete cross-dimensional map for the index */
9
+ function mapAcrossDimensions(index) {
10
+ return {
11
+ convergences: findConvergences(index),
12
+ tensions: detectTensions(index),
13
+ gaps: coverageGaps(index),
14
+ };
15
+ }
16
+ /** Find convergences — points where multiple epistemic dimensions agree */
17
+ function findConvergences(index) {
18
+ const tagMap = new Map();
19
+ for (const entry of index.entries.values()) {
20
+ for (const tag of entry.tags) {
21
+ if (!tagMap.has(tag))
22
+ tagMap.set(tag, new Map());
23
+ const sourceMap = tagMap.get(tag);
24
+ const ids = sourceMap.get(entry.source) ?? [];
25
+ ids.push(entry.unitId);
26
+ sourceMap.set(entry.source, ids);
27
+ }
28
+ }
29
+ const convergences = [];
30
+ for (const [tag, sourceMap] of tagMap) {
31
+ const dims = Array.from(sourceMap.keys());
32
+ if (dims.length < 2)
33
+ continue;
34
+ const entryIds = Array.from(sourceMap.values()).flat();
35
+ const strength = dims.length / ALL_SOURCES.length;
36
+ convergences.push({
37
+ dimensions: dims,
38
+ entries: entryIds,
39
+ strength,
40
+ description: `Tag '${tag}' converges across ${dims.join(', ')}`,
41
+ });
42
+ }
43
+ return convergences;
44
+ }
45
+ /** Detect tensions — points where dimensions conflict or diverge */
46
+ function detectTensions(index) {
47
+ const tagMap = new Map();
48
+ for (const entry of index.entries.values()) {
49
+ for (const tag of entry.tags) {
50
+ const list = tagMap.get(tag) ?? [];
51
+ list.push({ source: entry.source, unitId: entry.unitId, weight: entry.epistemicWeight });
52
+ tagMap.set(tag, list);
53
+ }
54
+ }
55
+ const tensions = [];
56
+ for (const [tag, grouped] of tagMap) {
57
+ const sources = new Set(grouped.map(g => g.source));
58
+ if (sources.size < 2)
59
+ continue;
60
+ const weights = grouped.map(g => g.weight);
61
+ const range = Math.max(...weights) - Math.min(...weights);
62
+ if (range > 0.5) {
63
+ tensions.push({
64
+ dimensions: [...sources],
65
+ conflict: `Tag '${tag}' shows weight divergence (range: ${range.toFixed(2)}) across ${[...sources].join(', ')}`,
66
+ entries: grouped.map(g => g.unitId),
67
+ });
68
+ }
69
+ }
70
+ return tensions;
71
+ }
72
+ /** Identify coverage gaps — epistemic dimensions that are underrepresented */
73
+ function coverageGaps(index) {
74
+ const totalEntries = index.entries.size;
75
+ if (totalEntries === 0) {
76
+ return ALL_SOURCES.map(source => ({
77
+ source,
78
+ severity: 1,
79
+ description: `No entries in any dimension — '${source}' is unrepresented`,
80
+ }));
81
+ }
82
+ const expected = totalEntries / ALL_SOURCES.length;
83
+ const gaps = [];
84
+ for (const source of ALL_SOURCES) {
85
+ const count = index.dimensions[source].entries.length;
86
+ if (count < expected * 0.25) {
87
+ const severity = count === 0 ? 1 : Math.min(1, 1 - count / expected);
88
+ const label = count === 0 ? 'absent' : 'severely underrepresented';
89
+ gaps.push({
90
+ source,
91
+ severity,
92
+ description: `'${source}' dimension is ${label} (${count}/${totalEntries} entries, expected ~${Math.round(expected)})`,
93
+ });
94
+ }
95
+ }
96
+ return gaps;
97
+ }
98
+ //# sourceMappingURL=cross-dimensional.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cross-dimensional.js","sourceRoot":"","sources":["../src/cross-dimensional.ts"],"names":[],"mappings":";;AAmBA,kDAMC;AAGD,4CA+BC;AAGD,wCA8BC;AAGD,oCA2BC;AA1GD,MAAM,WAAW,GAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;A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QAAQ,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;YACrE,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,2BAA2B,CAAC;YACnE,IAAI,CAAC,IAAI,CAAC;gBACR,MAAM;gBACN,QAAQ;gBACR,WAAW,EAAE,IAAI,MAAM,kBAAkB,KAAK,KAAK,KAAK,IAAI,YAAY,uBAAuB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG;aACvH,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Dimensions — epistemic dimension views and balance analysis.
3
+ *
4
+ * Provides focused views into each of Wilson's four epistemic sources
5
+ * and measures the balance across all dimensions.
6
+ */
7
+ import type { RelationalIndex, DimensionIndex } from './types.js';
8
+ /** Get the Land dimension view — embodied, place-based knowledge */
9
+ export declare function landIndex(index: RelationalIndex): DimensionIndex;
10
+ /** Get the Dream dimension view — intuitive, liminal knowledge */
11
+ export declare function dreamIndex(index: RelationalIndex): DimensionIndex;
12
+ /** Get the Code dimension view — implementation, algorithmic knowledge */
13
+ export declare function codeIndex(index: RelationalIndex): DimensionIndex;
14
+ /** Get the Vision dimension view — aspirational, future-oriented knowledge */
15
+ export declare function visionIndex(index: RelationalIndex): DimensionIndex;
16
+ /**
17
+ * Assess whether all four epistemic dimensions are represented.
18
+ *
19
+ * Returns a score from 0 to 1 where 1 means perfectly balanced
20
+ * and 0 means only a single dimension has entries.
21
+ */
22
+ export declare function dimensionBalance(index: RelationalIndex): number;
23
+ //# sourceMappingURL=dimensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../src/dimensions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC;AAInF,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,CAEhE;AAED,kEAAkE;AAClE,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,CAEjE;AAED,0EAA0E;AAC1E,wBAAgB,SAAS,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,CAEhE;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,cAAc,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAa/D"}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.landIndex = landIndex;
4
+ exports.dreamIndex = dreamIndex;
5
+ exports.codeIndex = codeIndex;
6
+ exports.visionIndex = visionIndex;
7
+ exports.dimensionBalance = dimensionBalance;
8
+ const ALL_SOURCES = ['land', 'dream', 'code', 'vision'];
9
+ /** Get the Land dimension view — embodied, place-based knowledge */
10
+ function landIndex(index) {
11
+ return index.dimensions.land;
12
+ }
13
+ /** Get the Dream dimension view — intuitive, liminal knowledge */
14
+ function dreamIndex(index) {
15
+ return index.dimensions.dream;
16
+ }
17
+ /** Get the Code dimension view — implementation, algorithmic knowledge */
18
+ function codeIndex(index) {
19
+ return index.dimensions.code;
20
+ }
21
+ /** Get the Vision dimension view — aspirational, future-oriented knowledge */
22
+ function visionIndex(index) {
23
+ return index.dimensions.vision;
24
+ }
25
+ /**
26
+ * Assess whether all four epistemic dimensions are represented.
27
+ *
28
+ * Returns a score from 0 to 1 where 1 means perfectly balanced
29
+ * and 0 means only a single dimension has entries.
30
+ */
31
+ function dimensionBalance(index) {
32
+ const counts = ALL_SOURCES.map(s => index.dimensions[s].entries.length);
33
+ const total = counts.reduce((a, b) => a + b, 0);
34
+ if (total === 0)
35
+ return 0;
36
+ // Compute balance as 1 minus normalised standard deviation
37
+ const mean = total / ALL_SOURCES.length;
38
+ const variance = counts.reduce((sum, c) => sum + (c - mean) ** 2, 0) / ALL_SOURCES.length;
39
+ const stdDev = Math.sqrt(variance);
40
+ const normalisedStdDev = mean > 0 ? stdDev / mean : 0;
41
+ return Math.max(0, Math.min(1, 1 - normalisedStdDev));
42
+ }
43
+ //# sourceMappingURL=dimensions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimensions.js","sourceRoot":"","sources":["../src/dimensions.ts"],"names":[],"mappings":";;AAWA,8BAEC;AAGD,gCAEC;AAGD,8BAEC;AAGD,kCAEC;AAQD,4CAaC;AAzCD,MAAM,WAAW,GAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE3E,oEAAoE;AACpE,SAAgB,SAAS,CAAC,KAAsB;IAC9C,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,kEAAkE;AAClE,SAAgB,UAAU,CAAC,KAAsB;IAC/C,OAAO,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;AAChC,CAAC;AAED,0EAA0E;AAC1E,SAAgB,SAAS,CAAC,KAAsB;IAC9C,OAAO,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC;AAC/B,CAAC;AAED,8EAA8E;AAC9E,SAAgB,WAAW,CAAC,KAAsB;IAChD,OAAO,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC;AACjC,CAAC;AAED;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,KAAsB;IACrD,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAEhD,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,CAAC,CAAC;IAE1B,2DAA2D;IAC3D,MAAM,IAAI,GAAG,KAAK,GAAG,WAAW,CAAC,MAAM,CAAC;IACxC,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,GAAG,WAAW,CAAC,MAAM,CAAC;IAC1F,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAEtD,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;AACxD,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Index Manager — create, mutate, and rebuild relational indices.
3
+ *
4
+ * Provides the foundational CRUD operations for the relational index.
5
+ * All mutations return new index instances (immutable pattern).
6
+ */
7
+ import type { RelationalIndex, IndexEntry } from './types.js';
8
+ /** Create an empty relational index with initialised dimension shells */
9
+ export declare function createIndex(): RelationalIndex;
10
+ /** Add an entry to the index, returning an updated index */
11
+ export declare function addEntry(index: RelationalIndex, entry: IndexEntry): RelationalIndex;
12
+ /** Remove an entry by unitId, returning an updated index */
13
+ export declare function removeEntry(index: RelationalIndex, unitId: string): RelationalIndex;
14
+ /** Recompute dimension aggregates from the current entry set */
15
+ export declare function rebuildDimensions(index: RelationalIndex): RelationalIndex;
16
+ //# sourceMappingURL=index-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-manager.d.ts","sourceRoot":"","sources":["../src/index-manager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EACV,eAAe,EACf,UAAU,EAIX,MAAM,YAAY,CAAC;AAIpB,yEAAyE;AACzE,wBAAgB,WAAW,IAAI,eAAe,CAW7C;AAED,4DAA4D;AAC5D,wBAAgB,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,GAAG,eAAe,CAMnF;AAED,4DAA4D;AAC5D,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,eAAe,CAMnF;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,eAAe,GAAG,eAAe,CAkBzE"}
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createIndex = createIndex;
4
+ exports.addEntry = addEntry;
5
+ exports.removeEntry = removeEntry;
6
+ exports.rebuildDimensions = rebuildDimensions;
7
+ const ALL_SOURCES = ['land', 'dream', 'code', 'vision'];
8
+ /** Create an empty relational index with initialised dimension shells */
9
+ function createIndex() {
10
+ const dimensions = {};
11
+ for (const source of ALL_SOURCES) {
12
+ dimensions[source] = { source, entries: [], depth: 0, weight: 0 };
13
+ }
14
+ return {
15
+ entries: new Map(),
16
+ dimensions,
17
+ crossMap: { convergences: [], tensions: [], gaps: [] },
18
+ };
19
+ }
20
+ /** Add an entry to the index, returning an updated index */
21
+ function addEntry(index, entry) {
22
+ const entries = new Map(index.entries);
23
+ entries.set(entry.unitId, entry);
24
+ const updated = { ...index, entries };
25
+ return rebuildDimensions(updated);
26
+ }
27
+ /** Remove an entry by unitId, returning an updated index */
28
+ function removeEntry(index, unitId) {
29
+ const entries = new Map(index.entries);
30
+ entries.delete(unitId);
31
+ const updated = { ...index, entries };
32
+ return rebuildDimensions(updated);
33
+ }
34
+ /** Recompute dimension aggregates from the current entry set */
35
+ function rebuildDimensions(index) {
36
+ const dimensions = {};
37
+ for (const source of ALL_SOURCES) {
38
+ const dimEntries = Array.from(index.entries.values()).filter(e => e.source === source);
39
+ const depth = dimEntries.length > 0
40
+ ? dimEntries.reduce((sum, e) => sum + e.circleDepth, 0) / dimEntries.length
41
+ : 0;
42
+ const weight = dimEntries.length > 0
43
+ ? dimEntries.reduce((sum, e) => sum + e.epistemicWeight, 0) / dimEntries.length
44
+ : 0;
45
+ dimensions[source] = { source, entries: dimEntries, depth, weight };
46
+ }
47
+ const crossMap = rebuildCrossMap(index.entries, dimensions);
48
+ return { ...index, dimensions, crossMap };
49
+ }
50
+ // ── Internal ────────────────────────────────────────────────────
51
+ function rebuildCrossMap(entries, dimensions) {
52
+ const gaps = ALL_SOURCES
53
+ .filter(s => dimensions[s].entries.length === 0)
54
+ .map(s => ({
55
+ source: s,
56
+ severity: 1,
57
+ description: `No entries in the '${s}' dimension`,
58
+ }));
59
+ // Detect convergences: entries sharing the same tags across different sources
60
+ const tagMap = new Map();
61
+ for (const entry of entries.values()) {
62
+ for (const tag of entry.tags) {
63
+ const list = tagMap.get(tag) ?? [];
64
+ list.push(entry);
65
+ tagMap.set(tag, list);
66
+ }
67
+ }
68
+ const convergences = Array.from(tagMap.entries())
69
+ .filter(([, grouped]) => {
70
+ const sources = new Set(grouped.map(e => e.source));
71
+ return sources.size > 1;
72
+ })
73
+ .map(([tag, grouped]) => {
74
+ const dims = [...new Set(grouped.map(e => e.source))];
75
+ return {
76
+ dimensions: dims,
77
+ entries: grouped.map(e => e.unitId),
78
+ strength: Math.min(dims.length / ALL_SOURCES.length, 1),
79
+ description: `Tag '${tag}' bridges ${dims.join(', ')} dimensions`,
80
+ };
81
+ });
82
+ // Detect tensions: entries in different sources sharing a tag but with opposing weights
83
+ const tensions = Array.from(tagMap.entries())
84
+ .filter(([, grouped]) => {
85
+ const sources = new Set(grouped.map(e => e.source));
86
+ if (sources.size < 2)
87
+ return false;
88
+ const weights = grouped.map(e => e.epistemicWeight);
89
+ const max = Math.max(...weights);
90
+ const min = Math.min(...weights);
91
+ return max - min > 0.5;
92
+ })
93
+ .map(([tag, grouped]) => ({
94
+ dimensions: [...new Set(grouped.map(e => e.source))],
95
+ conflict: `Tag '${tag}' has divergent epistemic weights across dimensions`,
96
+ entries: grouped.map(e => e.unitId),
97
+ }));
98
+ return { convergences, tensions, gaps };
99
+ }
100
+ //# sourceMappingURL=index-manager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-manager.js","sourceRoot":"","sources":["../src/index-manager.ts"],"names":[],"mappings":";;AAiBA,kCAWC;AAGD,4BAMC;AAGD,kCAMC;AAGD,8CAkBC;AArDD,MAAM,WAAW,GAAsB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAE3E,yEAAyE;AACzE,SAAgB,WAAW;IACzB,MAAM,UAAU,GAAG,EAA6C,CAAC;IACjE,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE,CAAC;QACjC,UAAU,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IACpE,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,GAAG,EAAE;QAClB,UAAU;QACV,QAAQ,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;KACvD,CAAC;AACJ,CAAC;AAED,4DAA4D;AAC5D,SAAgB,QAAQ,CAAC,KAAsB,EAAE,KAAiB;IAChE,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjC,MAAM,OAAO,GAAoB,EAAE,GAAG,KAAK,EAAE,OAAO,EAAE,CAAC;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GAAG,GAAG,GAAG,CAAC;IACzB,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;QACxB,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACpD,QAAQ,EAAE,QAAQ,GAAG,qDAAqD;QAC1E,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;KACpC,CAAC,CAAC,CAAC;IAEN,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;AAC1C,CAAC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @medicine-wheel/relational-index
3
+ *
4
+ * Four-source epistemic dimensional indexing for the Medicine Wheel
5
+ * Developer Suite. Enables querying, traversal, and cross-dimensional
6
+ * mapping across Wilson's four epistemic sources: Land, Dream, Code, Vision.
7
+ */
8
+ export type { EpistemicSource, IndexEntry, DimensionIndex, CrossDimensionalMap, Convergence, Tension, DimensionGap, RelationalIndex, SpiralDepthMetrics, Refinement, RelationalPath, IndexHealth, } from './types.js';
9
+ export { createIndex, addEntry, removeEntry, rebuildDimensions, } from './index-manager.js';
10
+ export { queryBySource, queryByDirection, queryByWeight, queryByDepth, queryCrossDimensional, } from './query.js';
11
+ export { landIndex, dreamIndex, codeIndex, visionIndex, dimensionBalance, } from './dimensions.js';
12
+ export { mapAcrossDimensions, findConvergences, detectTensions, coverageGaps, } from './cross-dimensional.js';
13
+ export { measureSpiralDepth, compareCircles, detectDeepening, detectStagnation, } from './spiral-depth.js';
14
+ export { indexHealth, dimensionBalance as metricsDimensionBalance, coverageGaps as metricsCoverageGaps, } from './metrics.js';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,eAAe,EACf,UAAU,EACV,cAAc,EACd,mBAAmB,EACnB,WAAW,EACX,OAAO,EACP,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,UAAU,EACV,cAAc,EACd,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,WAAW,EACX,QAAQ,EACR,WAAW,EACX,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,UAAU,EACV,SAAS,EACT,WAAW,EACX,gBAAgB,GACjB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,cAAc,EACd,YAAY,GACb,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,gBAAgB,GACjB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,WAAW,EACX,gBAAgB,IAAI,uBAAuB,EAC3C,YAAY,IAAI,mBAAmB,GACpC,MAAM,cAAc,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * @medicine-wheel/relational-index
4
+ *
5
+ * Four-source epistemic dimensional indexing for the Medicine Wheel
6
+ * Developer Suite. Enables querying, traversal, and cross-dimensional
7
+ * mapping across Wilson's four epistemic sources: Land, Dream, Code, Vision.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.metricsCoverageGaps = exports.metricsDimensionBalance = exports.indexHealth = exports.detectStagnation = exports.detectDeepening = exports.compareCircles = exports.measureSpiralDepth = exports.coverageGaps = exports.detectTensions = exports.findConvergences = exports.mapAcrossDimensions = exports.dimensionBalance = exports.visionIndex = exports.codeIndex = exports.dreamIndex = exports.landIndex = exports.queryCrossDimensional = exports.queryByDepth = exports.queryByWeight = exports.queryByDirection = exports.queryBySource = exports.rebuildDimensions = exports.removeEntry = exports.addEntry = exports.createIndex = void 0;
11
+ // Index Manager
12
+ var index_manager_js_1 = require("./index-manager.js");
13
+ Object.defineProperty(exports, "createIndex", { enumerable: true, get: function () { return index_manager_js_1.createIndex; } });
14
+ Object.defineProperty(exports, "addEntry", { enumerable: true, get: function () { return index_manager_js_1.addEntry; } });
15
+ Object.defineProperty(exports, "removeEntry", { enumerable: true, get: function () { return index_manager_js_1.removeEntry; } });
16
+ Object.defineProperty(exports, "rebuildDimensions", { enumerable: true, get: function () { return index_manager_js_1.rebuildDimensions; } });
17
+ // Query
18
+ var query_js_1 = require("./query.js");
19
+ Object.defineProperty(exports, "queryBySource", { enumerable: true, get: function () { return query_js_1.queryBySource; } });
20
+ Object.defineProperty(exports, "queryByDirection", { enumerable: true, get: function () { return query_js_1.queryByDirection; } });
21
+ Object.defineProperty(exports, "queryByWeight", { enumerable: true, get: function () { return query_js_1.queryByWeight; } });
22
+ Object.defineProperty(exports, "queryByDepth", { enumerable: true, get: function () { return query_js_1.queryByDepth; } });
23
+ Object.defineProperty(exports, "queryCrossDimensional", { enumerable: true, get: function () { return query_js_1.queryCrossDimensional; } });
24
+ // Dimensions
25
+ var dimensions_js_1 = require("./dimensions.js");
26
+ Object.defineProperty(exports, "landIndex", { enumerable: true, get: function () { return dimensions_js_1.landIndex; } });
27
+ Object.defineProperty(exports, "dreamIndex", { enumerable: true, get: function () { return dimensions_js_1.dreamIndex; } });
28
+ Object.defineProperty(exports, "codeIndex", { enumerable: true, get: function () { return dimensions_js_1.codeIndex; } });
29
+ Object.defineProperty(exports, "visionIndex", { enumerable: true, get: function () { return dimensions_js_1.visionIndex; } });
30
+ Object.defineProperty(exports, "dimensionBalance", { enumerable: true, get: function () { return dimensions_js_1.dimensionBalance; } });
31
+ // Cross-Dimensional
32
+ var cross_dimensional_js_1 = require("./cross-dimensional.js");
33
+ Object.defineProperty(exports, "mapAcrossDimensions", { enumerable: true, get: function () { return cross_dimensional_js_1.mapAcrossDimensions; } });
34
+ Object.defineProperty(exports, "findConvergences", { enumerable: true, get: function () { return cross_dimensional_js_1.findConvergences; } });
35
+ Object.defineProperty(exports, "detectTensions", { enumerable: true, get: function () { return cross_dimensional_js_1.detectTensions; } });
36
+ Object.defineProperty(exports, "coverageGaps", { enumerable: true, get: function () { return cross_dimensional_js_1.coverageGaps; } });
37
+ // Spiral Depth
38
+ var spiral_depth_js_1 = require("./spiral-depth.js");
39
+ Object.defineProperty(exports, "measureSpiralDepth", { enumerable: true, get: function () { return spiral_depth_js_1.measureSpiralDepth; } });
40
+ Object.defineProperty(exports, "compareCircles", { enumerable: true, get: function () { return spiral_depth_js_1.compareCircles; } });
41
+ Object.defineProperty(exports, "detectDeepening", { enumerable: true, get: function () { return spiral_depth_js_1.detectDeepening; } });
42
+ Object.defineProperty(exports, "detectStagnation", { enumerable: true, get: function () { return spiral_depth_js_1.detectStagnation; } });
43
+ // Metrics
44
+ var metrics_js_1 = require("./metrics.js");
45
+ Object.defineProperty(exports, "indexHealth", { enumerable: true, get: function () { return metrics_js_1.indexHealth; } });
46
+ Object.defineProperty(exports, "metricsDimensionBalance", { enumerable: true, get: function () { return metrics_js_1.dimensionBalance; } });
47
+ Object.defineProperty(exports, "metricsCoverageGaps", { enumerable: true, get: function () { return metrics_js_1.coverageGaps; } });
48
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAkBH,gBAAgB;AAChB,uDAK4B;AAJ1B,+GAAA,WAAW,OAAA;AACX,4GAAA,QAAQ,OAAA;AACR,+GAAA,WAAW,OAAA;AACX,qHAAA,iBAAiB,OAAA;AAGnB,QAAQ;AACR,uCAMoB;AALlB,yGAAA,aAAa,OAAA;AACb,4GAAA,gBAAgB,OAAA;AAChB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AACZ,iHAAA,qBAAqB,OAAA;AAGvB,aAAa;AACb,iDAMyB;AALvB,0GAAA,SAAS,OAAA;AACT,2GAAA,UAAU,OAAA;AACV,0GAAA,SAAS,OAAA;AACT,4GAAA,WAAW,OAAA;AACX,iHAAA,gBAAgB,OAAA;AAGlB,oBAAoB;AACpB,+DAKgC;AAJ9B,2HAAA,mBAAmB,OAAA;AACnB,wHAAA,gBAAgB,OAAA;AAChB,sHAAA,cAAc,OAAA;AACd,oHAAA,YAAY,OAAA;AAGd,eAAe;AACf,qDAK2B;AAJzB,qHAAA,kBAAkB,OAAA;AAClB,iHAAA,cAAc,OAAA;AACd,kHAAA,eAAe,OAAA;AACf,mHAAA,gBAAgB,OAAA;AAGlB,UAAU;AACV,2CAIsB;AAHpB,yGAAA,WAAW,OAAA;AACX,qHAAA,gBAAgB,OAA2B;AAC3C,iHAAA,YAAY,OAAuB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Metrics — health, balance, and coverage assessment for the relational index.
3
+ *
4
+ * Provides composite scores and actionable recommendations.
5
+ */
6
+ import type { RelationalIndex, IndexHealth, DimensionGap } from './types.js';
7
+ /**
8
+ * Compute overall health of the relational index.
9
+ * Combines dimension balance, convergence richness, gap penalties,
10
+ * and entry coverage into a single 0–1 score with recommendations.
11
+ */
12
+ export declare function indexHealth(index: RelationalIndex): IndexHealth;
13
+ /**
14
+ * Measure balance across the four epistemic sources.
15
+ * Delegates to the dimensions module.
16
+ */
17
+ export declare function dimensionBalance(index: RelationalIndex): number;
18
+ /**
19
+ * Identify what epistemic dimensions are missing or underrepresented.
20
+ * Delegates to the cross-dimensional module.
21
+ */
22
+ export declare function coverageGaps(index: RelationalIndex): DimensionGap[];
23
+ //# sourceMappingURL=metrics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,YAAY,EAAmB,MAAM,YAAY,CAAC;AAI9F;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,GAAG,WAAW,CA6B/D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,GAAG,MAAM,CAE/D;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,YAAY,EAAE,CAEnE"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.indexHealth = indexHealth;
4
+ exports.dimensionBalance = dimensionBalance;
5
+ exports.coverageGaps = coverageGaps;
6
+ const dimensions_js_1 = require("./dimensions.js");
7
+ const cross_dimensional_js_1 = require("./cross-dimensional.js");
8
+ /**
9
+ * Compute overall health of the relational index.
10
+ * Combines dimension balance, convergence richness, gap penalties,
11
+ * and entry coverage into a single 0–1 score with recommendations.
12
+ */
13
+ function indexHealth(index) {
14
+ const balance = (0, dimensions_js_1.dimensionBalance)(index);
15
+ const gaps = (0, cross_dimensional_js_1.coverageGaps)(index);
16
+ const entryCount = index.entries.size;
17
+ const convergenceCount = index.crossMap.convergences.length;
18
+ const tensionCount = index.crossMap.tensions.length;
19
+ const gapCount = gaps.length;
20
+ // Score components
21
+ const balanceScore = balance;
22
+ const gapPenalty = gapCount > 0 ? Math.max(0, 1 - gapCount * 0.25) : 1;
23
+ const convergenceBonus = Math.min(convergenceCount * 0.1, 0.2);
24
+ const baseScore = entryCount > 0 ? 0.5 : 0;
25
+ const score = Math.min(1, Math.max(0, baseScore + (balanceScore * 0.3) + (gapPenalty * 0.2) + convergenceBonus));
26
+ const recommendations = generateRecommendations(balance, gaps, entryCount, convergenceCount);
27
+ return {
28
+ score,
29
+ dimensionBalance: balance,
30
+ entryCount,
31
+ convergenceCount,
32
+ tensionCount,
33
+ gapCount,
34
+ recommendations,
35
+ };
36
+ }
37
+ /**
38
+ * Measure balance across the four epistemic sources.
39
+ * Delegates to the dimensions module.
40
+ */
41
+ function dimensionBalance(index) {
42
+ return (0, dimensions_js_1.dimensionBalance)(index);
43
+ }
44
+ /**
45
+ * Identify what epistemic dimensions are missing or underrepresented.
46
+ * Delegates to the cross-dimensional module.
47
+ */
48
+ function coverageGaps(index) {
49
+ return (0, cross_dimensional_js_1.coverageGaps)(index);
50
+ }
51
+ // ── Internal ────────────────────────────────────────────────────
52
+ function generateRecommendations(balance, gaps, entryCount, convergenceCount) {
53
+ const recs = [];
54
+ if (entryCount === 0) {
55
+ recs.push('Index is empty — add entries across all four epistemic sources to begin.');
56
+ return recs;
57
+ }
58
+ if (balance < 0.5) {
59
+ recs.push('Dimension balance is low — consider adding entries to underrepresented sources.');
60
+ }
61
+ for (const gap of gaps) {
62
+ recs.push(`Address '${gap.source}' dimension gap: ${gap.description}`);
63
+ }
64
+ if (convergenceCount === 0 && entryCount > 4) {
65
+ recs.push('No cross-dimensional convergences detected — use shared tags to bridge epistemic sources.');
66
+ }
67
+ if (recs.length === 0) {
68
+ recs.push('Index health is good — all four epistemic sources are represented and interconnected.');
69
+ }
70
+ return recs;
71
+ }
72
+ //# sourceMappingURL=metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.js","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":";;AAcA,kCA6BC;AAMD,4CAEC;AAMD,oCAEC;AArDD,mDAA8E;AAC9E,iEAA6E;AAE7E;;;;GAIG;AACH,SAAgB,WAAW,CAAC,KAAsB;IAChD,MAAM,OAAO,GAAG,IAAA,gCAAuB,EAAC,KAAK,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,IAAA,mCAAmB,EAAC,KAAK,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;IACtC,MAAM,gBAAgB,GAAG,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,MA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B,CAC9B,OAAe,EACf,IAAoB,EACpB,UAAkB,EAClB,gBAAwB;IAExB,MAAM,IAAI,GAAa,EAAE,CAAC;IAE1B,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI,CAAC,0EAA0E,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,GAAG,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;IAC/F,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,IAAI,CAAC,YAAY,GAAG,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IACzE,CAAC;IAED,IAAI,gBAAgB,KAAK,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;QAC7C,IAAI,CAAC,IAAI,CAAC,2FAA2F,CAAC,CAAC;IACzG,CAAC;IAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtB,IAAI,CAAC,IAAI,CAAC,uFAAuF,CAAC,CAAC;IACrG,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Query — retrieve entries from the relational index by various criteria.
3
+ *
4
+ * All query functions are pure: they read from the index without mutation.
5
+ */
6
+ import type { DirectionName } from '@medicine-wheel/ontology-core';
7
+ import type { RelationalIndex, IndexEntry, EpistemicSource } from './types.js';
8
+ /** Retrieve all entries from one epistemic source */
9
+ export declare function queryBySource(index: RelationalIndex, source: EpistemicSource): IndexEntry[];
10
+ /** Retrieve all entries aligned with a given Medicine Wheel direction */
11
+ export declare function queryByDirection(index: RelationalIndex, direction: DirectionName): IndexEntry[];
12
+ /** Retrieve entries whose epistemic weight meets or exceeds a threshold */
13
+ export declare function queryByWeight(index: RelationalIndex, minWeight: number): IndexEntry[];
14
+ /** Retrieve entries whose circle depth meets or exceeds a threshold */
15
+ export declare function queryByDepth(index: RelationalIndex, minDepth: number): IndexEntry[];
16
+ /**
17
+ * Retrieve entries that bridge multiple epistemic sources.
18
+ * Returns entries whose tags overlap with entries from each of the requested sources.
19
+ */
20
+ export declare function queryCrossDimensional(index: RelationalIndex, sources: EpistemicSource[]): IndexEntry[];
21
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE/E,qDAAqD;AACrD,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,GAAG,UAAU,EAAE,CAE3F;AAED,yEAAyE;AACzE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,EAAE,CAE/F;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,GAAG,UAAU,EAAE,CAErF;AAED,uEAAuE;AACvE,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,EAAE,CAEnF;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,eAAe,EAAE,GACzB,UAAU,EAAE,CAkCd"}
package/dist/query.js ADDED
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.queryBySource = queryBySource;
4
+ exports.queryByDirection = queryByDirection;
5
+ exports.queryByWeight = queryByWeight;
6
+ exports.queryByDepth = queryByDepth;
7
+ exports.queryCrossDimensional = queryCrossDimensional;
8
+ /** Retrieve all entries from one epistemic source */
9
+ function queryBySource(index, source) {
10
+ return index.dimensions[source].entries;
11
+ }
12
+ /** Retrieve all entries aligned with a given Medicine Wheel direction */
13
+ function queryByDirection(index, direction) {
14
+ return Array.from(index.entries.values()).filter(e => e.direction === direction);
15
+ }
16
+ /** Retrieve entries whose epistemic weight meets or exceeds a threshold */
17
+ function queryByWeight(index, minWeight) {
18
+ return Array.from(index.entries.values()).filter(e => e.epistemicWeight >= minWeight);
19
+ }
20
+ /** Retrieve entries whose circle depth meets or exceeds a threshold */
21
+ function queryByDepth(index, minDepth) {
22
+ return Array.from(index.entries.values()).filter(e => e.circleDepth >= minDepth);
23
+ }
24
+ /**
25
+ * Retrieve entries that bridge multiple epistemic sources.
26
+ * Returns entries whose tags overlap with entries from each of the requested sources.
27
+ */
28
+ function queryCrossDimensional(index, sources) {
29
+ if (sources.length < 2) {
30
+ return sources.length === 1 ? queryBySource(index, sources[0]) : [];
31
+ }
32
+ // Build tag→source mapping
33
+ const tagSources = new Map();
34
+ for (const entry of index.entries.values()) {
35
+ for (const tag of entry.tags) {
36
+ const set = tagSources.get(tag) ?? new Set();
37
+ set.add(entry.source);
38
+ tagSources.set(tag, set);
39
+ }
40
+ }
41
+ // Find tags that span all requested sources
42
+ const bridgeTags = new Set();
43
+ for (const [tag, srcs] of tagSources) {
44
+ if (sources.every(s => srcs.has(s))) {
45
+ bridgeTags.add(tag);
46
+ }
47
+ }
48
+ // Return entries with at least one bridge tag
49
+ const seen = new Set();
50
+ const result = [];
51
+ for (const entry of index.entries.values()) {
52
+ if (!seen.has(entry.unitId) && entry.tags.some(t => bridgeTags.has(t))) {
53
+ seen.add(entry.unitId);
54
+ result.push(entry);
55
+ }
56
+ }
57
+ return result;
58
+ }
59
+ //# sourceMappingURL=query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":";;AASA,sCAEC;AAGD,4CAEC;AAGD,s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34 @@
1
+ /**
2
+ * Spiral Depth — measuring whether understanding genuinely deepens
3
+ * through successive circles of revisiting.
4
+ *
5
+ * In Wilson's framework, knowledge deepens through relational spirals:
6
+ * each return to a topic should carry new understanding. If circling
7
+ * without deepening, that is stagnation, not learning.
8
+ */
9
+ import type { RelationalIndex, SpiralDepthMetrics, Refinement, IndexEntry } from './types.js';
10
+ /**
11
+ * Compute spiral depth metrics across the entire relational index.
12
+ * Examines circleDepth values to assess overall deepening.
13
+ */
14
+ export declare function measureSpiralDepth(index: RelationalIndex): SpiralDepthMetrics;
15
+ /**
16
+ * Compare an entry's current state with a previous circle's observation.
17
+ * Returns a description of what changed.
18
+ */
19
+ export declare function compareCircles(entry: IndexEntry, previousCircle: IndexEntry): {
20
+ depthDelta: number;
21
+ weightDelta: number;
22
+ description: string;
23
+ };
24
+ /**
25
+ * Detect whether a series of refinements shows genuine deepening.
26
+ * Returns true if the trend is upward.
27
+ */
28
+ export declare function detectDeepening(refinements: Refinement[]): boolean;
29
+ /**
30
+ * Detect whether a series of refinements shows stagnation.
31
+ * Returns true if depth is flat or oscillating without progress.
32
+ */
33
+ export declare function detectStagnation(refinements: Refinement[]): boolean;
34
+ //# sourceMappingURL=spiral-depth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spiral-depth.d.ts","sourceRoot":"","sources":["../src/spiral-depth.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE9F;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,kBAAkB,CAgC7E;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,UAAU,EACjB,cAAc,EAAE,UAAU,GACzB;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,CAgBlE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAUlE;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,OAAO,CAenE"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.measureSpiralDepth = measureSpiralDepth;
4
+ exports.compareCircles = compareCircles;
5
+ exports.detectDeepening = detectDeepening;
6
+ exports.detectStagnation = detectStagnation;
7
+ /**
8
+ * Compute spiral depth metrics across the entire relational index.
9
+ * Examines circleDepth values to assess overall deepening.
10
+ */
11
+ function measureSpiralDepth(index) {
12
+ const entries = Array.from(index.entries.values());
13
+ if (entries.length === 0) {
14
+ return {
15
+ totalCircles: 0,
16
+ averageDepth: 0,
17
+ deepeningRate: 0,
18
+ stagnationAlert: false,
19
+ deepestUnit: '',
20
+ };
21
+ }
22
+ const totalCircles = Math.max(...entries.map(e => e.circleDepth));
23
+ const averageDepth = entries.reduce((sum, e) => sum + e.circleDepth, 0) / entries.length;
24
+ // Sort by timestamp to compute deepening rate
25
+ const sorted = [...entries].sort((a, b) => a.timestamp.localeCompare(b.timestamp));
26
+ const deepeningRate = computeDeepeningRate(sorted);
27
+ const stagnationAlert = deepeningRate <= 0 && entries.length > 3;
28
+ const deepestEntry = entries.reduce((best, e) => e.circleDepth > best.circleDepth ? e : best);
29
+ return {
30
+ totalCircles,
31
+ averageDepth,
32
+ deepeningRate,
33
+ stagnationAlert,
34
+ deepestUnit: deepestEntry.unitId,
35
+ };
36
+ }
37
+ /**
38
+ * Compare an entry's current state with a previous circle's observation.
39
+ * Returns a description of what changed.
40
+ */
41
+ function compareCircles(entry, previousCircle) {
42
+ const depthDelta = entry.circleDepth - previousCircle.circleDepth;
43
+ const weightDelta = entry.epistemicWeight - previousCircle.epistemicWeight;
44
+ let description;
45
+ if (depthDelta > 0 && weightDelta > 0) {
46
+ description = `Deepened by ${depthDelta} circle(s) with increasing weight — genuine spiral progress`;
47
+ }
48
+ else if (depthDelta > 0 && weightDelta <= 0) {
49
+ description = `Deeper by ${depthDelta} circle(s) but weight unchanged or decreased — structural deepening without epistemic gain`;
50
+ }
51
+ else if (depthDelta === 0) {
52
+ description = 'Same circle depth — no spiral movement detected';
53
+ }
54
+ else {
55
+ description = `Depth decreased by ${Math.abs(depthDelta)} — possible regression or context shift`;
56
+ }
57
+ return { depthDelta, weightDelta, description };
58
+ }
59
+ /**
60
+ * Detect whether a series of refinements shows genuine deepening.
61
+ * Returns true if the trend is upward.
62
+ */
63
+ function detectDeepening(refinements) {
64
+ if (refinements.length < 2)
65
+ return false;
66
+ const sorted = [...refinements].sort((a, b) => a.circle - b.circle);
67
+ let increases = 0;
68
+ for (let i = 1; i < sorted.length; i++) {
69
+ if (sorted[i].depth > sorted[i - 1].depth)
70
+ increases++;
71
+ }
72
+ return increases / (sorted.length - 1) > 0.5;
73
+ }
74
+ /**
75
+ * Detect whether a series of refinements shows stagnation.
76
+ * Returns true if depth is flat or oscillating without progress.
77
+ */
78
+ function detectStagnation(refinements) {
79
+ if (refinements.length < 3)
80
+ return false;
81
+ const sorted = [...refinements].sort((a, b) => a.circle - b.circle);
82
+ const depths = sorted.map(r => r.depth);
83
+ // Check if range is very small relative to mean
84
+ const min = Math.min(...depths);
85
+ const max = Math.max(...depths);
86
+ const mean = depths.reduce((a, b) => a + b, 0) / depths.length;
87
+ if (mean === 0)
88
+ return true;
89
+ const range = max - min;
90
+ return range / mean < 0.1;
91
+ }
92
+ // ── Internal ────────────────────────────────────────────────────
93
+ function computeDeepeningRate(sortedEntries) {
94
+ if (sortedEntries.length < 2)
95
+ return 0;
96
+ let totalDelta = 0;
97
+ for (let i = 1; i < sortedEntries.length; i++) {
98
+ totalDelta += sortedEntries[i].circleDepth - sortedEntries[i - 1].circleDepth;
99
+ }
100
+ return totalDelta / (sortedEntries.length - 1);
101
+ }
102
+ //# source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GAAG,CAAC;AAC5B,CAAC;AAED,mEAAmE;AAEnE,SAAS,oBAAoB,CAAC,aAA2B;IACvD,IAAI,aAAa,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,CAAC,CAAC;IAEvC,IAAI,UAAU,GAAG,CAAC,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC9C,UAAU,IAAI,aAAa,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,aAAa,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,WAAW,CAAC;IAChF,CAAC;IAED,OAAO,UAAU,GAAG,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * @medicine-wheel/relational-index — Types
3
+ *
4
+ * Core type definitions for four-source epistemic dimensional indexing.
5
+ * Wilson's epistemology recognises multiple sources of knowing:
6
+ * Land — embodied, place-based knowledge
7
+ * Dream — intuitive, liminal, visionary knowledge
8
+ * Code — implementation, algorithmic, structural knowledge
9
+ * Vision — aspirational, intentional, future-oriented knowledge
10
+ */
11
+ import type { DirectionName } from '@medicine-wheel/ontology-core';
12
+ /** The four epistemic sources from Wilson's framework */
13
+ export type EpistemicSource = 'land' | 'dream' | 'code' | 'vision';
14
+ /** A single entry in the relational index */
15
+ export interface IndexEntry {
16
+ /** Unique identifier for the indexed unit */
17
+ unitId: string;
18
+ /** Epistemic source classification */
19
+ source: EpistemicSource;
20
+ /** Medicine Wheel direction alignment */
21
+ direction: DirectionName;
22
+ /** Weight reflecting epistemic significance (0–1) */
23
+ epistemicWeight: number;
24
+ /** Depth in the spiral — how many circles of revisiting */
25
+ circleDepth: number;
26
+ /** Entities or communities this entry is accountable to */
27
+ accountableTo: string[];
28
+ /** Freeform tags for cross-referencing */
29
+ tags: string[];
30
+ /** ISO 8601 timestamp */
31
+ timestamp: string;
32
+ }
33
+ /** Aggregated view of one epistemic dimension */
34
+ export interface DimensionIndex {
35
+ /** The epistemic source this dimension represents */
36
+ source: EpistemicSource;
37
+ /** All entries in this dimension */
38
+ entries: IndexEntry[];
39
+ /** Average circle depth across entries */
40
+ depth: number;
41
+ /** Average epistemic weight across entries */
42
+ weight: number;
43
+ }
44
+ /** Map of relationships across epistemic dimensions */
45
+ export interface CrossDimensionalMap {
46
+ /** Where multiple dimensions agree or reinforce each other */
47
+ convergences: Convergence[];
48
+ /** Where dimensions are in tension or conflict */
49
+ tensions: Tension[];
50
+ /** Dimensions that are underrepresented or absent */
51
+ gaps: DimensionGap[];
52
+ }
53
+ /** A point where multiple epistemic dimensions converge */
54
+ export interface Convergence {
55
+ /** Which dimensions participate in this convergence */
56
+ dimensions: EpistemicSource[];
57
+ /** Entry IDs involved */
58
+ entries: string[];
59
+ /** Convergence strength (0–1) */
60
+ strength: number;
61
+ /** Human-readable description of the convergence */
62
+ description: string;
63
+ }
64
+ /** A tension between epistemic dimensions */
65
+ export interface Tension {
66
+ /** Which dimensions are in tension */
67
+ dimensions: EpistemicSource[];
68
+ /** Description of the conflict */
69
+ conflict: string;
70
+ /** Entry IDs involved in the tension */
71
+ entries: string[];
72
+ }
73
+ /** A gap in epistemic dimension coverage */
74
+ export interface DimensionGap {
75
+ /** The underrepresented source */
76
+ source: EpistemicSource;
77
+ /** Severity of the gap (0–1, higher = more severe) */
78
+ severity: number;
79
+ /** Human-readable description */
80
+ description: string;
81
+ }
82
+ /** The top-level relational index across all four epistemic sources */
83
+ export interface RelationalIndex {
84
+ /** All entries keyed by unitId */
85
+ entries: Map<string, IndexEntry>;
86
+ /** Dimension-level aggregations */
87
+ dimensions: Record<EpistemicSource, DimensionIndex>;
88
+ /** Cross-dimensional relationship map */
89
+ crossMap: CrossDimensionalMap;
90
+ }
91
+ /** Metrics for spiral depth analysis */
92
+ export interface SpiralDepthMetrics {
93
+ /** Total number of circles completed */
94
+ totalCircles: number;
95
+ /** Average depth across all entries */
96
+ averageDepth: number;
97
+ /** Rate of deepening between successive circles (positive = deepening) */
98
+ deepeningRate: number;
99
+ /** Whether the index is circling without genuine progress */
100
+ stagnationAlert: boolean;
101
+ /** Unit ID with the greatest circle depth */
102
+ deepestUnit: string;
103
+ }
104
+ /** A single refinement observation for detecting deepening vs stagnation */
105
+ export interface Refinement {
106
+ /** Identifier for this refinement */
107
+ id: string;
108
+ /** Circle number (1-based) */
109
+ circle: number;
110
+ /** Depth measurement at this refinement */
111
+ depth: number;
112
+ /** Timestamp of the refinement */
113
+ timestamp: string;
114
+ }
115
+ /** A path through the relational index connecting entries across dimensions */
116
+ export interface RelationalPath {
117
+ /** Ordered entry IDs forming the path */
118
+ nodes: string[];
119
+ /** Epistemic dimensions traversed along the path */
120
+ dimensions: EpistemicSource[];
121
+ /** Cumulative epistemic weight along the path */
122
+ totalWeight: number;
123
+ /** Human-readable description of the path */
124
+ description: string;
125
+ }
126
+ /** Overall health assessment of a relational index */
127
+ export interface IndexHealth {
128
+ /** Overall health score (0–1) */
129
+ score: number;
130
+ /** Balance across dimensions (0–1, 1 = perfectly balanced) */
131
+ dimensionBalance: number;
132
+ /** Total number of entries */
133
+ entryCount: number;
134
+ /** Number of convergences detected */
135
+ convergenceCount: number;
136
+ /** Number of tensions detected */
137
+ tensionCount: number;
138
+ /** Number of dimension gaps */
139
+ gapCount: number;
140
+ /** Recommendations for improving index health */
141
+ recommendations: string[];
142
+ }
143
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAInE,yDAAyD;AACzD,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC;AAInE,6CAA6C;AAC7C,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7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AA8D;IAC9D,gBAAgB,EAAE,MAAM,CAAC;IACzB,8BAA8B;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,sCAAsC;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,iDAAiD;IACjD,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B"}
package/dist/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@medicine-wheel/relational-index",
3
+ "version": "0.2.2",
4
+ "description": "Four-source epistemic dimensional indexing for the Medicine Wheel Developer Suite — Land, Dream, Code, Vision traversal with cross-dimensional mapping and spiral depth metrics",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js",
11
+ "require": "./dist/index.js",
12
+ "default": "./dist/index.js"
13
+ },
14
+ "./types": {
15
+ "types": "./dist/types.d.ts",
16
+ "import": "./dist/types.js",
17
+ "require": "./dist/types.js",
18
+ "default": "./dist/types.js"
19
+ }
20
+ },
21
+ "sideEffects": false,
22
+ "files": [
23
+ "dist",
24
+ "README.md"
25
+ ],
26
+ "scripts": {
27
+ "build": "tsc",
28
+ "dev": "tsc --watch",
29
+ "lint": "tsc --noEmit",
30
+ "clean": "rm -rf dist",
31
+ "prepublishOnly": "npm run clean && npm run build"
32
+ },
33
+ "keywords": [
34
+ "medicine-wheel",
35
+ "relational-index",
36
+ "epistemic",
37
+ "four-directions",
38
+ "indigenous-research",
39
+ "wilson",
40
+ "land",
41
+ "dream",
42
+ "code",
43
+ "vision",
44
+ "spiral-depth"
45
+ ],
46
+ "author": "IAIP Collaborative - Shawinigan, QC",
47
+ "license": "MIT",
48
+ "dependencies": {
49
+ "@medicine-wheel/ontology-core": "^0.2.2"
50
+ },
51
+ "devDependencies": {
52
+ "@types/node": "^20.10.0",
53
+ "typescript": "^5.3.0"
54
+ }
55
+ }