@medicine-wheel/gap-analysis 0.26.1 → 0.26.3
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 +65 -28
- package/dist/index.d.ts +70 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,41 +1,52 @@
|
|
|
1
1
|
# @medicine-wheel/gap-analysis
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
A gap analysis looks for what is missing. It measures what is true now against
|
|
4
|
+
a prior state that existed, names the difference, and lists elimination steps
|
|
5
|
+
you can verify. Root cause, incidents, regressions, troubleshooting: when
|
|
6
|
+
something worked and stopped, the technique can be useful.
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
It is not part of the creative orientation. This package lets the analysis
|
|
9
|
+
happen, then turns the work to the creative orientation.
|
|
10
|
+
|
|
11
|
+
One question confirms that an analysis fits:
|
|
8
12
|
|
|
9
13
|
> **Is there a prior state you are restoring?**
|
|
10
14
|
|
|
11
|
-
**Yes, and you can evidence it.**
|
|
12
|
-
|
|
15
|
+
**Yes, and you can evidence it.** Open the analysis: baseline, observation, the
|
|
16
|
+
difference between them, and elimination steps you can verify.
|
|
13
17
|
|
|
14
|
-
**No
|
|
18
|
+
**No, you cannot name a state that actually existed.** Then the difference has
|
|
15
19
|
nothing to be measured against, and
|
|
16
20
|
[`@medicine-wheel/creative-orientation`](https://www.npmjs.com/package/@medicine-wheel/creative-orientation)
|
|
17
21
|
will point you toward structural tension instead. A feeling of urgency is not
|
|
18
22
|
evidence.
|
|
19
23
|
|
|
20
|
-
That requirement — a baseline with evidence — is what separates a fire from a
|
|
21
|
-
creating act, and it is why this package carries the name it does.
|
|
22
|
-
|
|
23
24
|
> [!WARNING]
|
|
24
25
|
> **Experimental alpha.** Part of the Medicine Wheel Developer Suite, which is
|
|
25
26
|
> under active development. APIs change between patch versions and all packages
|
|
26
27
|
> move in lockstep — pin exact versions. See
|
|
27
28
|
> [ALPHA.md](https://github.com/jgwill/medicine-wheel/blob/main/ALPHA.md).
|
|
28
29
|
|
|
29
|
-
##
|
|
30
|
+
## What it is for
|
|
31
|
+
|
|
32
|
+
A gap analysis looks for what is missing, and its main job here is to teach
|
|
33
|
+
the model using it. A model that has found what is missing is pulled toward
|
|
34
|
+
filling each missing item, one task per item. That is not what we are doing.
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
one is the **right** move — oscillating back to a baseline is the goal when you
|
|
34
|
-
are below the baseline.
|
|
36
|
+
So the package lets the analysis happen, then names that pull and turns the
|
|
37
|
+
work to the creative orientation:
|
|
35
38
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
1. **Findings become current reality.** What the analysis found is kept as
|
|
40
|
+
facts about today. It is not turned into a list of tasks.
|
|
41
|
+
2. **The pull is named.** The reflection says, in plain words, that the next
|
|
42
|
+
impulse is to fill each missing item, and that this is not what we are doing.
|
|
43
|
+
3. **The desired outcome is asked for on its own terms.** What do we want to
|
|
44
|
+
create, stated as something that will exist? It is not derived from the
|
|
45
|
+
findings.
|
|
46
|
+
4. **The chart follows.** Current reality (including the findings) and the
|
|
47
|
+
desired outcome go into a structural tension chart. Its action steps
|
|
48
|
+
resolve tension toward the outcome. Some findings will matter to it, and
|
|
49
|
+
others will not.
|
|
39
50
|
|
|
40
51
|
## The question at the door
|
|
41
52
|
|
|
@@ -43,9 +54,9 @@ Every analysis carries an orientation reading taken when it was opened, via
|
|
|
43
54
|
`@medicine-wheel/creative-orientation`. The question is always the same: *is a
|
|
44
55
|
prior state actually being restored?*
|
|
45
56
|
|
|
46
|
-
Opening an analysis **requires a baseline with evidence**. That requirement
|
|
47
|
-
|
|
48
|
-
it
|
|
57
|
+
Opening an analysis **requires a baseline with evidence**. That requirement
|
|
58
|
+
separates a restore from a creating act, and a feeling of urgency cannot
|
|
59
|
+
satisfy it.
|
|
49
60
|
|
|
50
61
|
```ts
|
|
51
62
|
import { openGapAnalysis, addStep, doorAdvice } from '@medicine-wheel/gap-analysis';
|
|
@@ -66,6 +77,31 @@ analysis = addStep(analysis, {
|
|
|
66
77
|
});
|
|
67
78
|
```
|
|
68
79
|
|
|
80
|
+
## The turn
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
import { turnToCreativeOrientation } from '@medicine-wheel/gap-analysis';
|
|
84
|
+
|
|
85
|
+
const turn = turnToCreativeOrientation(analysis);
|
|
86
|
+
turn.currentReality; // the findings, as facts about today
|
|
87
|
+
turn.reflection; // names the pull to fill each missing item
|
|
88
|
+
turn.nextStep; // { tool: 'create_structural_tension_chart',
|
|
89
|
+
// needs: ['desired_outcome', 'direction'], question }
|
|
90
|
+
|
|
91
|
+
const withOutcome = turnToCreativeOrientation(analysis, {
|
|
92
|
+
desiredOutcome: 'every release publishes its image from the tag, with no one remembering a flag',
|
|
93
|
+
});
|
|
94
|
+
withOutcome.chartDraft;
|
|
95
|
+
// { desired_outcome, current_reality, action_steps: [] }
|
|
96
|
+
// No action step is taken from the findings. Add a direction and create the chart.
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
A desired outcome phrased as removing something is still placed in the draft,
|
|
100
|
+
with `desiredOutcomeAdvice` beside it.
|
|
101
|
+
|
|
102
|
+
The MCP server (`@medicine-wheel/mcp`) carries the same turn as the tool
|
|
103
|
+
`turn_to_creative_orientation`, called after `open_gap_analysis`.
|
|
104
|
+
|
|
69
105
|
## It advises; it never refuses
|
|
70
106
|
|
|
71
107
|
If you open an analysis without evidence for the baseline, you get the analysis
|
|
@@ -81,18 +117,19 @@ check is a wish; the fire is out only when something says so.
|
|
|
81
117
|
## Where it sits
|
|
82
118
|
|
|
83
119
|
```
|
|
84
|
-
creative-orientation ......... the
|
|
85
|
-
├── gap-analysis .........
|
|
86
|
-
└──
|
|
120
|
+
creative-orientation ......... the question asked first
|
|
121
|
+
├── gap-analysis ......... a prior state is being restored: looks for what is missing
|
|
122
|
+
│ └── turnToCreativeOrientation ... findings become current reality
|
|
123
|
+
└── structural-tension ... desired outcome, current reality stated as fact, action steps
|
|
87
124
|
```
|
|
88
125
|
|
|
89
|
-
Gap analysis is a
|
|
90
|
-
|
|
91
|
-
to
|
|
126
|
+
Gap analysis is a technique the creative orientation does not include. The
|
|
127
|
+
orientation question comes first, and after an analysis the turn brings the
|
|
128
|
+
work back to a structural tension chart.
|
|
92
129
|
|
|
93
130
|
## Status
|
|
94
131
|
|
|
95
|
-
|
|
132
|
+
Small on purpose. `turnToCreativeOrientation` arrived in 0.26.3.
|
|
96
133
|
|
|
97
134
|
## License
|
|
98
135
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @medicine-wheel/gap-analysis
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* A gap analysis looks for what is missing. It measures an observation against
|
|
5
|
+
* a baseline that existed, names the difference, and lists elimination steps
|
|
6
|
+
* that can be verified. That technique can be useful, for instance when
|
|
7
|
+
* something worked and stopped. It is not part of the creative orientation.
|
|
5
8
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
9
|
+
* The package has a second job, and it is the main one: to teach the model
|
|
10
|
+
* using it. A model that has found what is missing is pulled toward filling
|
|
11
|
+
* each missing item. `turnToCreativeOrientation` comes after the analysis. It
|
|
12
|
+
* keeps the findings as current reality, names that pull, and asks for the
|
|
13
|
+
* desired outcome on its own terms, so that a structural tension chart can
|
|
14
|
+
* follow.
|
|
10
15
|
*
|
|
11
|
-
* It carries one question at its door
|
|
12
|
-
* restored?
|
|
16
|
+
* It carries one question at its door (is a prior state actually being
|
|
17
|
+
* restored?) and asks it through `@medicine-wheel/creative-orientation`.
|
|
13
18
|
* It **advises and proceeds**. It never refuses. A package that blocks you is
|
|
14
19
|
* a package you learn to route around.
|
|
15
20
|
*
|
|
@@ -77,4 +82,62 @@ export declare function isClosed(analysis: GapAnalysis): boolean;
|
|
|
77
82
|
* correctly-framed work is noise, and noise is how checks get switched off.
|
|
78
83
|
*/
|
|
79
84
|
export declare function doorAdvice(analysis: GapAnalysis): string | null;
|
|
85
|
+
/** One finding of an analysis, kept as a fact about today. */
|
|
86
|
+
export interface CurrentRealityFact {
|
|
87
|
+
/** The part of the analysis the fact comes from. */
|
|
88
|
+
from: 'observation' | 'baseline' | 'difference' | 'root-cause' | 'step-done' | 'steps-open';
|
|
89
|
+
/** The fact, stated about today. Never phrased as a task. */
|
|
90
|
+
fact: string;
|
|
91
|
+
}
|
|
92
|
+
export interface TurnOptions {
|
|
93
|
+
/**
|
|
94
|
+
* What we want to create, stated as something that will exist. It is named
|
|
95
|
+
* on its own terms and is not derived from the findings. Without it, the
|
|
96
|
+
* turn asks for it.
|
|
97
|
+
*/
|
|
98
|
+
desiredOutcome?: string;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Input for `create_structural_tension_chart`, except the direction, which
|
|
102
|
+
* the caller chooses.
|
|
103
|
+
*/
|
|
104
|
+
export interface ChartDraft {
|
|
105
|
+
desired_outcome: string;
|
|
106
|
+
current_reality: string;
|
|
107
|
+
/** Always empty: no action step is taken from the findings. */
|
|
108
|
+
action_steps: string[];
|
|
109
|
+
}
|
|
110
|
+
export interface TurnNextStep {
|
|
111
|
+
tool: 'create_structural_tension_chart';
|
|
112
|
+
/** What the chart still needs before it can be created. */
|
|
113
|
+
needs: Array<'desired_outcome' | 'direction'>;
|
|
114
|
+
/** The question the desired outcome answers. */
|
|
115
|
+
question: string;
|
|
116
|
+
}
|
|
117
|
+
export interface CreativeOrientationTurn {
|
|
118
|
+
analysisId: string;
|
|
119
|
+
/** The findings, as facts about today. */
|
|
120
|
+
currentReality: CurrentRealityFact[];
|
|
121
|
+
/** Names the pull to fill each missing item, and says that is not what we are doing. */
|
|
122
|
+
reflection: string;
|
|
123
|
+
nextStep: TurnNextStep;
|
|
124
|
+
/** Present only when a desired outcome was given. */
|
|
125
|
+
chartDraft?: ChartDraft;
|
|
126
|
+
/** Present when the desired outcome given is phrased as removing something. */
|
|
127
|
+
desiredOutcomeAdvice?: string;
|
|
128
|
+
}
|
|
129
|
+
export declare const DESIRED_OUTCOME_QUESTION: "What do we want to create, stated as something that will exist?";
|
|
130
|
+
/**
|
|
131
|
+
* The turn after a gap analysis.
|
|
132
|
+
*
|
|
133
|
+
* Returns the findings as current-reality facts (never as tasks), the
|
|
134
|
+
* reflection that names the pull to fill each missing item, and the next step:
|
|
135
|
+
* `create_structural_tension_chart`, which needs a desired outcome. With a
|
|
136
|
+
* desired outcome, it also returns a draft chart input whose action steps are
|
|
137
|
+
* empty, because no action step is taken from the findings.
|
|
138
|
+
*
|
|
139
|
+
* It advises and proceeds. A desired outcome phrased as removing something is
|
|
140
|
+
* still placed in the draft, with advice beside it.
|
|
141
|
+
*/
|
|
142
|
+
export declare function turnToCreativeOrientation(analysis: GapAnalysis, options?: TurnOptions): CreativeOrientationTurn;
|
|
80
143
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,QAAQ;IACvB,sDAAsD;IACtD,WAAW,EAAE,MAAM,CAAC;IACpB,oEAAoE;IACpE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WA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G,WAAW,GAAG,YAAY,CAAC;IAC5F,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,iCAAiC,CAAC;IACxC,2DAA2D;IAC3D,KAAK,EAAE,KAAK,CAAC,iBAAiB,GAAG,WAAW,CAAC,CAAC;IAC9C,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,0CAA0C;IAC1C,cAAc,EAAE,kBAAkB,EAAE,CAAC;IACrC,wFAAwF;IACxF,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC;IACvB,qDAAqD;IACrD,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,+EAA+E;IAC/E,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,wBAAwB,EACnC,iEAA0E,CAAC;AA6C7E;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,WAAgB,GACxB,uBAAuB,CAqCzB"}
|
package/dist/index.js
CHANGED
|
@@ -1,22 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DESIRED_OUTCOME_QUESTION = void 0;
|
|
3
4
|
exports.openGapAnalysis = openGapAnalysis;
|
|
4
5
|
exports.addStep = addStep;
|
|
5
6
|
exports.markDone = markDone;
|
|
6
7
|
exports.isClosed = isClosed;
|
|
7
8
|
exports.doorAdvice = doorAdvice;
|
|
9
|
+
exports.turnToCreativeOrientation = turnToCreativeOrientation;
|
|
8
10
|
/**
|
|
9
11
|
* @medicine-wheel/gap-analysis
|
|
10
12
|
*
|
|
11
|
-
*
|
|
13
|
+
* A gap analysis looks for what is missing. It measures an observation against
|
|
14
|
+
* a baseline that existed, names the difference, and lists elimination steps
|
|
15
|
+
* that can be verified. That technique can be useful, for instance when
|
|
16
|
+
* something worked and stopped. It is not part of the creative orientation.
|
|
12
17
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
18
|
+
* The package has a second job, and it is the main one: to teach the model
|
|
19
|
+
* using it. A model that has found what is missing is pulled toward filling
|
|
20
|
+
* each missing item. `turnToCreativeOrientation` comes after the analysis. It
|
|
21
|
+
* keeps the findings as current reality, names that pull, and asks for the
|
|
22
|
+
* desired outcome on its own terms, so that a structural tension chart can
|
|
23
|
+
* follow.
|
|
17
24
|
*
|
|
18
|
-
* It carries one question at its door
|
|
19
|
-
* restored?
|
|
25
|
+
* It carries one question at its door (is a prior state actually being
|
|
26
|
+
* restored?) and asks it through `@medicine-wheel/creative-orientation`.
|
|
20
27
|
* It **advises and proceeds**. It never refuses. A package that blocks you is
|
|
21
28
|
* a package you learn to route around.
|
|
22
29
|
*
|
|
@@ -85,4 +92,87 @@ function isClosed(analysis) {
|
|
|
85
92
|
function doorAdvice(analysis) {
|
|
86
93
|
return (0, creative_orientation_1.worthSaying)(analysis.orientation) ? analysis.orientation.advice ?? null : null;
|
|
87
94
|
}
|
|
95
|
+
exports.DESIRED_OUTCOME_QUESTION = 'What do we want to create, stated as something that will exist?';
|
|
96
|
+
function asSentence(text) {
|
|
97
|
+
const trimmed = text.trim();
|
|
98
|
+
return /[.!?]$/.test(trimmed) ? trimmed : `${trimmed}.`;
|
|
99
|
+
}
|
|
100
|
+
function withNote(text, label, note) {
|
|
101
|
+
const base = text.trim().replace(/[.]$/, '');
|
|
102
|
+
return note?.trim() ? `${base} (${label}: ${note.trim()}).` : `${base}.`;
|
|
103
|
+
}
|
|
104
|
+
function findingsAsFacts(analysis) {
|
|
105
|
+
const facts = [
|
|
106
|
+
{ from: 'observation', fact: `Observed now: ${withNote(analysis.current.description, 'source', analysis.current.source)}` },
|
|
107
|
+
{ from: 'baseline', fact: `Before: ${withNote(analysis.baseline.description, 'evidence', analysis.baseline.evidence)}` },
|
|
108
|
+
{ from: 'difference', fact: `The analysis found: ${asSentence(analysis.difference)}` },
|
|
109
|
+
];
|
|
110
|
+
if (analysis.rootCause?.trim()) {
|
|
111
|
+
facts.push({ from: 'root-cause', fact: `Named cause: ${asSentence(analysis.rootCause)}` });
|
|
112
|
+
}
|
|
113
|
+
const steps = analysis.steps ?? [];
|
|
114
|
+
for (const step of steps.filter(s => s.done === true)) {
|
|
115
|
+
facts.push({ from: 'step-done', fact: `Done: ${withNote(step.action, 'verified by', step.verifiedBy)}` });
|
|
116
|
+
}
|
|
117
|
+
const open = steps.filter(s => s.done !== true).length;
|
|
118
|
+
if (open > 0) {
|
|
119
|
+
facts.push({
|
|
120
|
+
from: 'steps-open',
|
|
121
|
+
fact: `The analysis lists ${open} open elimination step${open === 1 ? '' : 's'}. They stay with the analysis and are not carried into a chart.`,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
return facts;
|
|
125
|
+
}
|
|
126
|
+
function reflectionFor(analysis) {
|
|
127
|
+
return [
|
|
128
|
+
`This gap analysis found what is missing: ${asSentence(analysis.difference)}`,
|
|
129
|
+
'The pull now is to fill each missing item, one task per item, until nothing is missing. That is not what we are doing.',
|
|
130
|
+
'The findings are kept as current reality, stated as fact. They are not a list of tasks.',
|
|
131
|
+
`Next comes the desired outcome, named on its own terms. ${exports.DESIRED_OUTCOME_QUESTION} It does not come from the findings.`,
|
|
132
|
+
'Then a structural tension chart holds current reality and the desired outcome, and its action steps resolve the tension toward that outcome. Some findings will matter to it, and others will not.',
|
|
133
|
+
].join(' ');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* The turn after a gap analysis.
|
|
137
|
+
*
|
|
138
|
+
* Returns the findings as current-reality facts (never as tasks), the
|
|
139
|
+
* reflection that names the pull to fill each missing item, and the next step:
|
|
140
|
+
* `create_structural_tension_chart`, which needs a desired outcome. With a
|
|
141
|
+
* desired outcome, it also returns a draft chart input whose action steps are
|
|
142
|
+
* empty, because no action step is taken from the findings.
|
|
143
|
+
*
|
|
144
|
+
* It advises and proceeds. A desired outcome phrased as removing something is
|
|
145
|
+
* still placed in the draft, with advice beside it.
|
|
146
|
+
*/
|
|
147
|
+
function turnToCreativeOrientation(analysis, options = {}) {
|
|
148
|
+
if (!analysis ||
|
|
149
|
+
typeof analysis.difference !== 'string' ||
|
|
150
|
+
!analysis.current?.description?.trim() ||
|
|
151
|
+
!analysis.baseline?.description?.trim()) {
|
|
152
|
+
throw new Error('The turn needs a gap analysis as openGapAnalysis returns it: baseline, current and difference.');
|
|
153
|
+
}
|
|
154
|
+
const currentReality = findingsAsFacts(analysis);
|
|
155
|
+
const desiredOutcome = options.desiredOutcome?.trim() || undefined;
|
|
156
|
+
const turn = {
|
|
157
|
+
analysisId: analysis.id,
|
|
158
|
+
currentReality,
|
|
159
|
+
reflection: reflectionFor(analysis),
|
|
160
|
+
nextStep: {
|
|
161
|
+
tool: 'create_structural_tension_chart',
|
|
162
|
+
needs: desiredOutcome ? ['direction'] : ['desired_outcome', 'direction'],
|
|
163
|
+
question: exports.DESIRED_OUTCOME_QUESTION,
|
|
164
|
+
},
|
|
165
|
+
};
|
|
166
|
+
if (desiredOutcome) {
|
|
167
|
+
turn.chartDraft = {
|
|
168
|
+
desired_outcome: desiredOutcome,
|
|
169
|
+
current_reality: currentReality.map(f => f.fact).join(' '),
|
|
170
|
+
action_steps: [],
|
|
171
|
+
};
|
|
172
|
+
const reading = (0, creative_orientation_1.readOrientation)({ outcome: desiredOutcome, restores: null });
|
|
173
|
+
if ((0, creative_orientation_1.worthSaying)(reading))
|
|
174
|
+
turn.desiredOutcomeAdvice = reading.advice;
|
|
175
|
+
}
|
|
176
|
+
return turn;
|
|
177
|
+
}
|
|
88
178
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAsFA,0CA+BC;AAGD,0BAQC;AAED,4BAKC;AAGD,4BAEC;AAQD,gCAEC;AA+GD,8DAwCC;AA7SD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,+EAK8C;AA8C9C,SAAS,SAAS;IAChB,OAAO,OAAO,IAAI,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AACvE,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAC7B,QAAkB,EAClB,OAAoB,EACpB,UAAkB,EAClB,UAA0B,EAAE;IAE5B,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CACb,sFAAsF;YACpF,oFAAoF,CACvF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,EAAE,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,KAAK,GAAmB;QAC5B,OAAO,EAAE,UAAU;QACnB,QAAQ,EAAE,QAAQ,CAAC,WAAW;QAC9B,QAAQ,EAAE,QAAQ,CAAC,QAAQ;KAC5B,CAAC;IAEF,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CA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AM,CAAC;IACvE,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medicine-wheel/gap-analysis",
|
|
3
|
-
"version": "0.26.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.26.3",
|
|
4
|
+
"description": "A gap analysis looks for what is missing: evidenced baseline, observation, difference, verifiable elimination steps. Useful when something worked and stopped (root cause, incidents, regressions, troubleshooting). It is not part of the creative orientation: turnToCreativeOrientation follows the analysis, keeps its findings as current reality, names the pull to fill each missing item, and asks for the desired outcome of a structural tension chart.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"directory": "src/gap-analysis"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@medicine-wheel/creative-orientation": "^0.26.
|
|
48
|
+
"@medicine-wheel/creative-orientation": "^0.26.3"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"typescript": "^5.7.0"
|