@medicine-wheel/transformation-tracker 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 +87 -0
- package/dist/community.d.ts +53 -0
- package/dist/community.d.ts.map +1 -0
- package/dist/community.js +97 -0
- package/dist/community.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/prompts.d.ts +26 -0
- package/dist/prompts.d.ts.map +1 -0
- package/dist/prompts.js +124 -0
- package/dist/prompts.js.map +1 -0
- package/dist/reciprocity-ledger.d.ts +60 -0
- package/dist/reciprocity-ledger.d.ts.map +1 -0
- package/dist/reciprocity-ledger.js +98 -0
- package/dist/reciprocity-ledger.js.map +1 -0
- package/dist/relational-shift.d.ts +69 -0
- package/dist/relational-shift.d.ts.map +1 -0
- package/dist/relational-shift.js +123 -0
- package/dist/relational-shift.js.map +1 -0
- package/dist/researcher.d.ts +49 -0
- package/dist/researcher.d.ts.map +1 -0
- package/dist/researcher.js +118 -0
- package/dist/researcher.js.map +1 -0
- package/dist/schemas.d.ts +439 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +90 -0
- package/dist/schemas.js.map +1 -0
- package/dist/seven-generations.d.ts +52 -0
- package/dist/seven-generations.d.ts.map +1 -0
- package/dist/seven-generations.js +165 -0
- package/dist/seven-generations.js.map +1 -0
- package/dist/types.d.ts +134 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +12 -0
- package/dist/types.js.map +1 -0
- package/dist/validity.d.ts +27 -0
- package/dist/validity.d.ts.map +1 -0
- package/dist/validity.js +102 -0
- package/dist/validity.js.map +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @medicine-wheel/transformation-tracker — Reciprocity Ledger Module
|
|
4
|
+
*
|
|
5
|
+
* Manages the reciprocity ledger: tracking giving and receiving
|
|
6
|
+
* across the research process. Wilson's relational accountability
|
|
7
|
+
* demands balanced reciprocity — what you take, you must give back.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.logGiving = logGiving;
|
|
11
|
+
exports.logReceiving = logReceiving;
|
|
12
|
+
exports.balanceCheck = balanceCheck;
|
|
13
|
+
exports.reciprocityDebt = reciprocityDebt;
|
|
14
|
+
/**
|
|
15
|
+
* Log a giving entry to the reciprocity ledger.
|
|
16
|
+
* Records something the researcher has given back to the community,
|
|
17
|
+
* land, spirit, or future generations.
|
|
18
|
+
*/
|
|
19
|
+
function logGiving(log, entry) {
|
|
20
|
+
const givingEntry = { ...entry, type: 'giving' };
|
|
21
|
+
return {
|
|
22
|
+
...log,
|
|
23
|
+
reciprocityLedger: [...log.reciprocityLedger, givingEntry],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Log a receiving entry to the reciprocity ledger.
|
|
28
|
+
* Records something the researcher has received from the community,
|
|
29
|
+
* land, spirit, or ancestors.
|
|
30
|
+
*/
|
|
31
|
+
function logReceiving(log, entry) {
|
|
32
|
+
const receivingEntry = { ...entry, type: 'receiving' };
|
|
33
|
+
return {
|
|
34
|
+
...log,
|
|
35
|
+
reciprocityLedger: [...log.reciprocityLedger, receivingEntry],
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Check whether reciprocity is balanced.
|
|
40
|
+
* Balance is assessed per-category and overall.
|
|
41
|
+
*/
|
|
42
|
+
function balanceCheck(log) {
|
|
43
|
+
const categories = ['human', 'land', 'spirit', 'future'];
|
|
44
|
+
const categoryBalances = [];
|
|
45
|
+
for (const category of categories) {
|
|
46
|
+
const giving = log.reciprocityLedger.filter((e) => e.type === 'giving' && e.category === category).length;
|
|
47
|
+
const receiving = log.reciprocityLedger.filter((e) => e.type === 'receiving' && e.category === category).length;
|
|
48
|
+
const balanced = giving > 0 && receiving > 0 && giving / receiving >= 0.5 && giving / receiving <= 2.0;
|
|
49
|
+
categoryBalances.push({ category, giving, receiving, balanced });
|
|
50
|
+
}
|
|
51
|
+
const totalGiving = log.reciprocityLedger.filter((e) => e.type === 'giving').length;
|
|
52
|
+
const totalReceiving = log.reciprocityLedger.filter((e) => e.type === 'receiving').length;
|
|
53
|
+
const overallBalanced = totalGiving > 0 &&
|
|
54
|
+
totalReceiving > 0 &&
|
|
55
|
+
totalGiving / totalReceiving >= 0.5 &&
|
|
56
|
+
totalGiving / totalReceiving <= 2.0;
|
|
57
|
+
return {
|
|
58
|
+
overallBalanced,
|
|
59
|
+
totalGiving,
|
|
60
|
+
totalReceiving,
|
|
61
|
+
categoryBalances,
|
|
62
|
+
summary: overallBalanced
|
|
63
|
+
? 'Reciprocity is balanced overall.'
|
|
64
|
+
: totalGiving === 0 && totalReceiving === 0
|
|
65
|
+
? 'No reciprocity entries. Begin tracking what you give and receive.'
|
|
66
|
+
: totalGiving < totalReceiving
|
|
67
|
+
? 'Reciprocity imbalance: receiving more than giving. Consider what you can return.'
|
|
68
|
+
: 'Reciprocity imbalance: giving more than receiving. Be open to receiving.',
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Identify reciprocity debts — areas where receiving outpaces giving.
|
|
73
|
+
* These represent relational obligations that need to be honored.
|
|
74
|
+
*/
|
|
75
|
+
function reciprocityDebt(log) {
|
|
76
|
+
const categories = ['human', 'land', 'spirit', 'future'];
|
|
77
|
+
const debts = [];
|
|
78
|
+
for (const category of categories) {
|
|
79
|
+
const giving = log.reciprocityLedger.filter((e) => e.type === 'giving' && e.category === category);
|
|
80
|
+
const receiving = log.reciprocityLedger.filter((e) => e.type === 'receiving' && e.category === category);
|
|
81
|
+
if (receiving.length > giving.length) {
|
|
82
|
+
debts.push({
|
|
83
|
+
category,
|
|
84
|
+
deficit: receiving.length - giving.length,
|
|
85
|
+
receivedFrom: [...new Set(receiving.map((e) => e.relatedTo))],
|
|
86
|
+
suggestion: `You have received ${receiving.length} time(s) from ${category} relations but given back only ${giving.length} time(s). Consider ways to reciprocate.`,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
hasDebts: debts.length > 0,
|
|
92
|
+
debts,
|
|
93
|
+
summary: debts.length === 0
|
|
94
|
+
? 'No reciprocity debts detected.'
|
|
95
|
+
: `Reciprocity debts in ${debts.length} category/categories: ${debts.map((d) => d.category).join(', ')}.`,
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=reciprocity-ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reciprocity-ledger.js","sourceRoot":"","sources":["../src/reciprocity-ledger.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAUH,8BASC;AAOD,oCASC;AAMD,oCAoCC;AAMD,0CA6BC;AA3GD;;;;GAIG;AACH,SAAgB,SAAS,CACvB,GAAsB,EACtB,KAAqC;IAErC,MAAM,WAAW,GAAqB,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IACnE,OAAO;QACL,GAAG,GAAG;QACN,iBAAiB,EAAE,CAAC,GAAG,GAAG,CAAC,iBAAiB,EAAE,WAAW,CAAC;KAC3D,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAC1B,GAAsB,EACtB,KAAqC;IAErC,MAAM,cAAc,GAAqB,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACzE,OAAO;QACL,GAAG,GAAG;QACN,iBAAiB,EAAE,CAAC,GAAG,GAAG,CAAC,iBAAiB,EAAE,cAAc,CAAC;KAC9D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAsB;IACjD,MAAM,UAAU,GAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE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AyC;aACnK,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC;QAC1B,KAAK;QACL,OAAO,EAAE,KAAK,CAAC,MAAM,KAAK,CAAC;YACzB,CAAC,CAAC,gCAAgC;YAClC,CAAC,CAAC,wBAAwB,KAAK,CAAC,MAAM,yBAAyB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;KAC5G,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/transformation-tracker — Relational Shift Module
|
|
3
|
+
*
|
|
4
|
+
* Tracks changes in relational strength and quality over time.
|
|
5
|
+
* In Wilson's framework, strengthened relations are a primary
|
|
6
|
+
* indicator of valid research.
|
|
7
|
+
*/
|
|
8
|
+
import type { TransformationLog, RelationalShift } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Record a relational shift in the transformation log.
|
|
11
|
+
* Captures the before/after state and what catalyzed the change.
|
|
12
|
+
*/
|
|
13
|
+
export declare function trackRelationalChange(log: TransformationLog, shift: RelationalShift): TransformationLog;
|
|
14
|
+
/**
|
|
15
|
+
* Get the before/after state for a specific relation.
|
|
16
|
+
* Returns the most recent shift for the given relation ID.
|
|
17
|
+
*/
|
|
18
|
+
export declare function beforeAfter(log: TransformationLog, relationId: string): RelationalShiftSummary | null;
|
|
19
|
+
/**
|
|
20
|
+
* Compute aggregate relational strength changes across all tracked relations.
|
|
21
|
+
* Returns overall direction of relational health.
|
|
22
|
+
*/
|
|
23
|
+
export declare function strengthDelta(log: TransformationLog): StrengthDeltaResult;
|
|
24
|
+
/**
|
|
25
|
+
* Count and describe new relations formed during the research.
|
|
26
|
+
* New relations are detected by relation IDs that appear only in
|
|
27
|
+
* "after" states with no prior "before" baseline.
|
|
28
|
+
*/
|
|
29
|
+
export declare function newRelationsFormed(log: TransformationLog): NewRelationsResult;
|
|
30
|
+
/** Summary of a relation's full shift history */
|
|
31
|
+
export interface RelationalShiftSummary {
|
|
32
|
+
relationId: string;
|
|
33
|
+
originalState: {
|
|
34
|
+
strength: number;
|
|
35
|
+
description: string;
|
|
36
|
+
};
|
|
37
|
+
currentState: {
|
|
38
|
+
strength: number;
|
|
39
|
+
description: string;
|
|
40
|
+
};
|
|
41
|
+
totalShifts: number;
|
|
42
|
+
netStrengthChange: number;
|
|
43
|
+
catalysts: string[];
|
|
44
|
+
}
|
|
45
|
+
/** Aggregate relational strength delta result */
|
|
46
|
+
export interface StrengthDeltaResult {
|
|
47
|
+
totalShifts: number;
|
|
48
|
+
averageDelta: number;
|
|
49
|
+
strengthened: number;
|
|
50
|
+
weakened: number;
|
|
51
|
+
unchanged: number;
|
|
52
|
+
summary: string;
|
|
53
|
+
}
|
|
54
|
+
/** New relation descriptor */
|
|
55
|
+
export interface NewRelationDescriptor {
|
|
56
|
+
relationId: string;
|
|
57
|
+
currentStrength: number;
|
|
58
|
+
description: string;
|
|
59
|
+
catalyst: string;
|
|
60
|
+
direction: string;
|
|
61
|
+
formedAt: string;
|
|
62
|
+
}
|
|
63
|
+
/** Result of new relations analysis */
|
|
64
|
+
export interface NewRelationsResult {
|
|
65
|
+
count: number;
|
|
66
|
+
relations: NewRelationDescriptor[];
|
|
67
|
+
summary: string;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=relational-shift.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relational-shift.d.ts","sourceRoot":"","sources":["../src/relational-shift.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAErE;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,iBAAiB,EACtB,KAAK,EAAE,eAAe,GACrB,iBAA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AAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @medicine-wheel/transformation-tracker — Relational Shift Module
|
|
4
|
+
*
|
|
5
|
+
* Tracks changes in relational strength and quality over time.
|
|
6
|
+
* In Wilson's framework, strengthened relations are a primary
|
|
7
|
+
* indicator of valid research.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.trackRelationalChange = trackRelationalChange;
|
|
11
|
+
exports.beforeAfter = beforeAfter;
|
|
12
|
+
exports.strengthDelta = strengthDelta;
|
|
13
|
+
exports.newRelationsFormed = newRelationsFormed;
|
|
14
|
+
/**
|
|
15
|
+
* Record a relational shift in the transformation log.
|
|
16
|
+
* Captures the before/after state and what catalyzed the change.
|
|
17
|
+
*/
|
|
18
|
+
function trackRelationalChange(log, shift) {
|
|
19
|
+
return {
|
|
20
|
+
...log,
|
|
21
|
+
relationalShifts: [...log.relationalShifts, shift],
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the before/after state for a specific relation.
|
|
26
|
+
* Returns the most recent shift for the given relation ID.
|
|
27
|
+
*/
|
|
28
|
+
function beforeAfter(log, relationId) {
|
|
29
|
+
const shifts = log.relationalShifts
|
|
30
|
+
.filter((s) => s.relationId === relationId)
|
|
31
|
+
.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
|
|
32
|
+
if (shifts.length === 0)
|
|
33
|
+
return null;
|
|
34
|
+
const first = shifts[0];
|
|
35
|
+
const last = shifts[shifts.length - 1];
|
|
36
|
+
return {
|
|
37
|
+
relationId,
|
|
38
|
+
originalState: first.before,
|
|
39
|
+
currentState: last.after,
|
|
40
|
+
totalShifts: shifts.length,
|
|
41
|
+
netStrengthChange: last.after.strength - first.before.strength,
|
|
42
|
+
catalysts: shifts.map((s) => s.catalyst),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Compute aggregate relational strength changes across all tracked relations.
|
|
47
|
+
* Returns overall direction of relational health.
|
|
48
|
+
*/
|
|
49
|
+
function strengthDelta(log) {
|
|
50
|
+
if (log.relationalShifts.length === 0) {
|
|
51
|
+
return {
|
|
52
|
+
totalShifts: 0,
|
|
53
|
+
averageDelta: 0,
|
|
54
|
+
strengthened: 0,
|
|
55
|
+
weakened: 0,
|
|
56
|
+
unchanged: 0,
|
|
57
|
+
summary: 'No relational shifts tracked yet.',
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const relationMap = new Map();
|
|
61
|
+
for (const shift of log.relationalShifts) {
|
|
62
|
+
const existing = relationMap.get(shift.relationId) || [];
|
|
63
|
+
existing.push(shift);
|
|
64
|
+
relationMap.set(shift.relationId, existing);
|
|
65
|
+
}
|
|
66
|
+
let strengthened = 0;
|
|
67
|
+
let weakened = 0;
|
|
68
|
+
let unchanged = 0;
|
|
69
|
+
let totalDelta = 0;
|
|
70
|
+
for (const [, shifts] of relationMap) {
|
|
71
|
+
const sorted = shifts.sort((a, b) => a.timestamp.localeCompare(b.timestamp));
|
|
72
|
+
const first = sorted[0];
|
|
73
|
+
const last = sorted[sorted.length - 1];
|
|
74
|
+
const delta = last.after.strength - first.before.strength;
|
|
75
|
+
totalDelta += delta;
|
|
76
|
+
if (delta > 0.05)
|
|
77
|
+
strengthened++;
|
|
78
|
+
else if (delta < -0.05)
|
|
79
|
+
weakened++;
|
|
80
|
+
else
|
|
81
|
+
unchanged++;
|
|
82
|
+
}
|
|
83
|
+
const averageDelta = totalDelta / relationMap.size;
|
|
84
|
+
return {
|
|
85
|
+
totalShifts: log.relationalShifts.length,
|
|
86
|
+
averageDelta,
|
|
87
|
+
strengthened,
|
|
88
|
+
weakened,
|
|
89
|
+
unchanged,
|
|
90
|
+
summary: `${relationMap.size} relations tracked: ${strengthened} strengthened, ${weakened} weakened, ${unchanged} stable. Average delta: ${averageDelta.toFixed(3)}.`,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Count and describe new relations formed during the research.
|
|
95
|
+
* New relations are detected by relation IDs that appear only in
|
|
96
|
+
* "after" states with no prior "before" baseline.
|
|
97
|
+
*/
|
|
98
|
+
function newRelationsFormed(log) {
|
|
99
|
+
const firstAppearance = new Map();
|
|
100
|
+
for (const shift of log.relationalShifts) {
|
|
101
|
+
if (!firstAppearance.has(shift.relationId)) {
|
|
102
|
+
firstAppearance.set(shift.relationId, shift);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
const newRelations = [...firstAppearance.values()]
|
|
106
|
+
.filter((s) => s.before.strength === 0 && s.before.description === '')
|
|
107
|
+
.map((s) => ({
|
|
108
|
+
relationId: s.relationId,
|
|
109
|
+
currentStrength: s.after.strength,
|
|
110
|
+
description: s.after.description,
|
|
111
|
+
catalyst: s.catalyst,
|
|
112
|
+
direction: s.direction,
|
|
113
|
+
formedAt: s.timestamp,
|
|
114
|
+
}));
|
|
115
|
+
return {
|
|
116
|
+
count: newRelations.length,
|
|
117
|
+
relations: newRelations,
|
|
118
|
+
summary: newRelations.length === 0
|
|
119
|
+
? 'No new relations formed yet.'
|
|
120
|
+
: `${newRelations.length} new relation(s) formed during this research cycle.`,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=relational-shift.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relational-shift.js","sourceRoot":"","sources":["../src/relational-shift.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAQH,sDAQC;AAMD,kCAqBC;AAMD,sCA8CC;AAOD,gDA0BC;AA5HD;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,GAAsB,EACtB,KAAsB;IAEtB,OAAO;QACL,GAAG,GAAG;QACN,gBAAgB,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,EAAE,KAAK,CAAC;KACnD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,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|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @medicine-wheel/transformation-tracker — Researcher Module
|
|
3
|
+
*
|
|
4
|
+
* Tracks researcher self-reflection, understanding snapshots,
|
|
5
|
+
* and growth detection across the research cycle.
|
|
6
|
+
*/
|
|
7
|
+
import type { DirectionName } from '@medicine-wheel/ontology-core';
|
|
8
|
+
import type { TransformationLog, GrowthSnapshot } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* Add a reflection entry to the transformation log.
|
|
11
|
+
* Reflections capture the researcher's evolving relationship
|
|
12
|
+
* with the research — Wilson's internal transformation signal.
|
|
13
|
+
*/
|
|
14
|
+
export declare function logReflection(log: TransformationLog, prompt: string, response: string, direction: DirectionName): TransformationLog;
|
|
15
|
+
/**
|
|
16
|
+
* Capture a point-in-time snapshot of the researcher's understanding.
|
|
17
|
+
* Snapshots form the basis for growth detection over time.
|
|
18
|
+
*/
|
|
19
|
+
export declare function snapshotUnderstanding(log: TransformationLog, snapshot: GrowthSnapshot): TransformationLog;
|
|
20
|
+
/**
|
|
21
|
+
* Compare two snapshots to detect growth signals.
|
|
22
|
+
* Returns a summary of changes across all measured dimensions.
|
|
23
|
+
*/
|
|
24
|
+
export declare function compareSnapshots(before: GrowthSnapshot, after: GrowthSnapshot): SnapshotComparison;
|
|
25
|
+
/**
|
|
26
|
+
* Analyze the full transformation log for genuine growth signals.
|
|
27
|
+
* Wilson says growth must be relational, not just intellectual.
|
|
28
|
+
*/
|
|
29
|
+
export declare function detectGrowth(log: TransformationLog): GrowthSignal;
|
|
30
|
+
/** Result of comparing two growth snapshots */
|
|
31
|
+
export interface SnapshotComparison {
|
|
32
|
+
relationsGrowth: number;
|
|
33
|
+
alignmentGrowth: number;
|
|
34
|
+
newInsights: string[];
|
|
35
|
+
resolvedQuestions: string[];
|
|
36
|
+
newQuestions: string[];
|
|
37
|
+
understandingShifted: boolean;
|
|
38
|
+
directionShifted: boolean;
|
|
39
|
+
overallGrowth: number;
|
|
40
|
+
}
|
|
41
|
+
/** Growth signal analysis result */
|
|
42
|
+
export interface GrowthSignal {
|
|
43
|
+
detected: boolean;
|
|
44
|
+
relationalGrowth: number;
|
|
45
|
+
intellectualGrowth: number;
|
|
46
|
+
reciprocityGrowth: number;
|
|
47
|
+
summary: string;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=researcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"researcher.d.ts","sourceRoot":"","sources":["../src/researcher.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EAEf,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,iBAAiB,EACtB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,aAAa,GACvB,iBAAiB,CAanB;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,iBAAiB,EACtB,QAAQ,EAAE,cAAc,GACvB,iBAAiB,CAKnB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,cAAc,GACpB,kBAAkB,CA4BpB;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,iBAAiB,GAAG,YAAY,CAsCjE;AAID,+CAA+C;AAC/C,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,oBAAoB,EAAE,OAAO,CAAC;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,oCAAoC;AACpC,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @medicine-wheel/transformation-tracker — Researcher Module
|
|
4
|
+
*
|
|
5
|
+
* Tracks researcher self-reflection, understanding snapshots,
|
|
6
|
+
* and growth detection across the research cycle.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.logReflection = logReflection;
|
|
10
|
+
exports.snapshotUnderstanding = snapshotUnderstanding;
|
|
11
|
+
exports.compareSnapshots = compareSnapshots;
|
|
12
|
+
exports.detectGrowth = detectGrowth;
|
|
13
|
+
/**
|
|
14
|
+
* Add a reflection entry to the transformation log.
|
|
15
|
+
* Reflections capture the researcher's evolving relationship
|
|
16
|
+
* with the research — Wilson's internal transformation signal.
|
|
17
|
+
*/
|
|
18
|
+
function logReflection(log, prompt, response, direction) {
|
|
19
|
+
const reflection = {
|
|
20
|
+
id: `ref-${log.reflections.length + 1}-${Date.now()}`,
|
|
21
|
+
timestamp: new Date().toISOString(),
|
|
22
|
+
prompt,
|
|
23
|
+
response,
|
|
24
|
+
direction,
|
|
25
|
+
depth: estimateDepth(response),
|
|
26
|
+
};
|
|
27
|
+
return {
|
|
28
|
+
...log,
|
|
29
|
+
reflections: [...log.reflections, reflection],
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Capture a point-in-time snapshot of the researcher's understanding.
|
|
34
|
+
* Snapshots form the basis for growth detection over time.
|
|
35
|
+
*/
|
|
36
|
+
function snapshotUnderstanding(log, snapshot) {
|
|
37
|
+
return {
|
|
38
|
+
...log,
|
|
39
|
+
snapshots: [...log.snapshots, snapshot],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Compare two snapshots to detect growth signals.
|
|
44
|
+
* Returns a summary of changes across all measured dimensions.
|
|
45
|
+
*/
|
|
46
|
+
function compareSnapshots(before, after) {
|
|
47
|
+
const relationsGrowth = after.relationsCount - before.relationsCount;
|
|
48
|
+
const alignmentGrowth = after.wilsonAlignment - before.wilsonAlignment;
|
|
49
|
+
const newInsights = after.keyInsights.filter((i) => !before.keyInsights.includes(i));
|
|
50
|
+
const resolvedQuestions = before.openQuestions.filter((q) => !after.openQuestions.includes(q));
|
|
51
|
+
const newQuestions = after.openQuestions.filter((q) => !before.openQuestions.includes(q));
|
|
52
|
+
return {
|
|
53
|
+
relationsGrowth,
|
|
54
|
+
alignmentGrowth,
|
|
55
|
+
newInsights,
|
|
56
|
+
resolvedQuestions,
|
|
57
|
+
newQuestions,
|
|
58
|
+
understandingShifted: before.understanding !== after.understanding,
|
|
59
|
+
directionShifted: before.direction !== after.direction,
|
|
60
|
+
overallGrowth: computeOverallGrowth(relationsGrowth, alignmentGrowth, newInsights.length, resolvedQuestions.length),
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Analyze the full transformation log for genuine growth signals.
|
|
65
|
+
* Wilson says growth must be relational, not just intellectual.
|
|
66
|
+
*/
|
|
67
|
+
function detectGrowth(log) {
|
|
68
|
+
if (log.snapshots.length < 2) {
|
|
69
|
+
return {
|
|
70
|
+
detected: false,
|
|
71
|
+
relationalGrowth: 0,
|
|
72
|
+
intellectualGrowth: 0,
|
|
73
|
+
reciprocityGrowth: 0,
|
|
74
|
+
summary: 'Insufficient snapshots — at least two required to detect growth.',
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
const first = log.snapshots[0];
|
|
78
|
+
const last = log.snapshots[log.snapshots.length - 1];
|
|
79
|
+
const comparison = compareSnapshots(first, last);
|
|
80
|
+
const relationalGrowth = normalizeScore(comparison.relationsGrowth / Math.max(first.relationsCount, 1));
|
|
81
|
+
const intellectualGrowth = normalizeScore((comparison.newInsights.length + comparison.resolvedQuestions.length) /
|
|
82
|
+
Math.max(first.keyInsights.length + first.openQuestions.length, 1));
|
|
83
|
+
const givingCount = log.reciprocityLedger.filter((e) => e.type === 'giving').length;
|
|
84
|
+
const receivingCount = log.reciprocityLedger.filter((e) => e.type === 'receiving').length;
|
|
85
|
+
const reciprocityGrowth = normalizeScore((givingCount + receivingCount) / Math.max(log.snapshots.length, 1));
|
|
86
|
+
const detected = relationalGrowth > 0.1 || intellectualGrowth > 0.1 || reciprocityGrowth > 0.1;
|
|
87
|
+
return {
|
|
88
|
+
detected,
|
|
89
|
+
relationalGrowth,
|
|
90
|
+
intellectualGrowth,
|
|
91
|
+
reciprocityGrowth,
|
|
92
|
+
summary: detected
|
|
93
|
+
? `Growth detected: relational=${relationalGrowth.toFixed(2)}, intellectual=${intellectualGrowth.toFixed(2)}, reciprocity=${reciprocityGrowth.toFixed(2)}`
|
|
94
|
+
: 'No significant growth detected yet. Continue deepening relational engagement.',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
// ── Internal Helpers ────────────────────────────────────────────────────────
|
|
98
|
+
function estimateDepth(response) {
|
|
99
|
+
const wordCount = response.split(/\s+/).length;
|
|
100
|
+
const hasQuestions = /\?/.test(response);
|
|
101
|
+
const hasRelationalLanguage = /relat|connect|together|reciproc|obligat|account/i.test(response);
|
|
102
|
+
let depth = Math.min(wordCount / 500, 0.5);
|
|
103
|
+
if (hasQuestions)
|
|
104
|
+
depth += 0.2;
|
|
105
|
+
if (hasRelationalLanguage)
|
|
106
|
+
depth += 0.3;
|
|
107
|
+
return Math.min(depth, 1);
|
|
108
|
+
}
|
|
109
|
+
function computeOverallGrowth(relations, alignment, insights, resolved) {
|
|
110
|
+
return normalizeScore((Math.max(relations, 0) * 0.3) +
|
|
111
|
+
(Math.max(alignment, 0) * 0.3) +
|
|
112
|
+
(insights * 0.1) +
|
|
113
|
+
(resolved * 0.1));
|
|
114
|
+
}
|
|
115
|
+
function normalizeScore(value) {
|
|
116
|
+
return Math.max(0, Math.min(1, value));
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=researcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"researcher.js","sourceRoot":"","sources":["../src/researcher.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAcH,sCAkBC;AAMD,sDAQC;AAMD,4CA+BC;AAMD,oCAsCC;AAtHD;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,GAAsB,EACtB,MAAc,EACd,QAAgB,EAChB,SAAwB;IAExB,MAAM,UAAU,GAAe;QAC7B,EAAE,EAAE,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE;QACrD,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,MAAM;QACN,QAAQ;QACR,SAAS;QACT,KAAK,EAAE,aAAa,CAAC,QAAQ,CAAC;KAC/B,CAAC;IACF,OAAO;QACL,GAAG,GAAG;QACN,WAAW,EAAE,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,UAAU,CAAC;KAC9C,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,GAAsB,EACtB,QAAwB;IAExB,OAAO;QACL,GAAG,GAAG;QACN,SAAS,EAAE,CAAC,GAAG,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC;KACxC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,MAAsB,EACtB,KAAqB;IAErB,MAAM,eAAe,GAAG,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC;IACrE,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;IACvE,MAAM,WAAW,GA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