@sonnechasser/ntrp 1.3.5 → 1.3.6
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/LICENSE +24 -0
- package/README.md +4 -2
- package/dist/index.js +983 -923
- package/dist/mcp/server.js +719 -48
- package/package.json +6 -3
- package/dist/ai/findings-stream-smoke.js +0 -185
- package/dist/ai/findings-stream-smoke.js.map +0 -1
- package/dist/ai/guardrails-smoke.js +0 -25584
- package/dist/ai/guardrails-smoke.js.map +0 -1
- package/dist/conversation/deepdive-smoke.js +0 -3416
- package/dist/conversation/deepdive-smoke.js.map +0 -1
- package/dist/conversation/loop-guard-smoke.js +0 -37627
- package/dist/conversation/loop-guard-smoke.js.map +0 -1
- package/dist/demo/whimsy-smoke.js +0 -692
- package/dist/demo/whimsy-smoke.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/investigation/quality-eval-cli.js +0 -24564
- package/dist/investigation/quality-eval-cli.js.map +0 -1
- package/dist/investigation/verbosity-cli.js +0 -24373
- package/dist/investigation/verbosity-cli.js.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/services/exports-registry-smoke.js +0 -1205
- package/dist/services/exports-registry-smoke.js.map +0 -1
- package/dist/services/transcript-smoke.js +0 -1101
- package/dist/services/transcript-smoke.js.map +0 -1
- package/dist/strategist/strategist-smoke.js +0 -3073
- package/dist/strategist/strategist-smoke.js.map +0 -1
- package/dist/whimsy/time-bank-smoke.js +0 -36126
- package/dist/whimsy/time-bank-smoke.js.map +0 -1
|
@@ -1,3073 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
process.noDeprecation = true;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __esm = (fn, res) => function __init() {
|
|
5
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
// src/ui/spinner.ts
|
|
9
|
-
import ora from "ora";
|
|
10
|
-
var init_spinner = __esm({
|
|
11
|
-
"src/ui/spinner.ts"() {
|
|
12
|
-
"use strict";
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
// src/ai/llm/thread-compat.ts
|
|
17
|
-
var init_thread_compat = __esm({
|
|
18
|
-
"src/ai/llm/thread-compat.ts"() {
|
|
19
|
-
"use strict";
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// src/io/context.ts
|
|
24
|
-
var init_context = __esm({
|
|
25
|
-
"src/io/context.ts"() {
|
|
26
|
-
"use strict";
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// src/output/formatters.ts
|
|
31
|
-
var init_formatters = __esm({
|
|
32
|
-
"src/output/formatters.ts"() {
|
|
33
|
-
"use strict";
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
// src/config/store.ts
|
|
38
|
-
import { readFileSync, writeFileSync, existsSync, mkdirSync, chmodSync } from "fs";
|
|
39
|
-
import { homedir } from "os";
|
|
40
|
-
import { join, resolve } from "path";
|
|
41
|
-
function ntrpHome() {
|
|
42
|
-
return NTRP_DIR;
|
|
43
|
-
}
|
|
44
|
-
function getMemoryDir() {
|
|
45
|
-
const dir = join(NTRP_DIR, "memory");
|
|
46
|
-
if (!existsSync(dir)) {
|
|
47
|
-
mkdirSync(dir, { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
return dir;
|
|
50
|
-
}
|
|
51
|
-
var NTRP_DIR, CONFIG_PATH;
|
|
52
|
-
var init_store = __esm({
|
|
53
|
-
"src/config/store.ts"() {
|
|
54
|
-
"use strict";
|
|
55
|
-
NTRP_DIR = process.env.NTRP_HOME ? resolve(process.env.NTRP_HOME) : join(homedir(), ".ntrp");
|
|
56
|
-
CONFIG_PATH = join(NTRP_DIR, "config.json");
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// src/services/terminal-capture.ts
|
|
61
|
-
var init_terminal_capture = __esm({
|
|
62
|
-
"src/services/terminal-capture.ts"() {
|
|
63
|
-
"use strict";
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
// src/output/redact-write.ts
|
|
68
|
-
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
69
|
-
import { dirname } from "path";
|
|
70
|
-
var init_redact_write = __esm({
|
|
71
|
-
"src/output/redact-write.ts"() {
|
|
72
|
-
"use strict";
|
|
73
|
-
init_terminal_capture();
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
// src/output/path-safety.ts
|
|
78
|
-
import { homedir as homedir2 } from "os";
|
|
79
|
-
import { resolve as resolve2, sep } from "path";
|
|
80
|
-
var NTRP_HOME;
|
|
81
|
-
var init_path_safety = __esm({
|
|
82
|
-
"src/output/path-safety.ts"() {
|
|
83
|
-
"use strict";
|
|
84
|
-
init_store();
|
|
85
|
-
NTRP_HOME = ntrpHome();
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
// src/services/export-kinds.ts
|
|
90
|
-
var init_export_kinds = __esm({
|
|
91
|
-
"src/services/export-kinds.ts"() {
|
|
92
|
-
"use strict";
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
// src/ui/theme.ts
|
|
97
|
-
import chalk from "chalk";
|
|
98
|
-
var STATUS, TOKENS, BADGE_TONE_COLORS;
|
|
99
|
-
var init_theme = __esm({
|
|
100
|
-
"src/ui/theme.ts"() {
|
|
101
|
-
"use strict";
|
|
102
|
-
init_formatters();
|
|
103
|
-
STATUS = {
|
|
104
|
-
green: "#22c55e",
|
|
105
|
-
yellow: "#eab308",
|
|
106
|
-
red: "#ef4444",
|
|
107
|
-
neutral: "#64748b"
|
|
108
|
-
};
|
|
109
|
-
TOKENS = {
|
|
110
|
-
accent: "#14b8a6",
|
|
111
|
-
accentBright: "#2dd4bf",
|
|
112
|
-
border: "#334155",
|
|
113
|
-
borderMuted: "#1e293b",
|
|
114
|
-
dim: "#64748b",
|
|
115
|
-
text: "#e2e8f0",
|
|
116
|
-
info: "#3b82f6",
|
|
117
|
-
...STATUS,
|
|
118
|
-
success: STATUS.green,
|
|
119
|
-
warning: STATUS.yellow,
|
|
120
|
-
error: STATUS.red
|
|
121
|
-
};
|
|
122
|
-
BADGE_TONE_COLORS = {
|
|
123
|
-
success: TOKENS.success,
|
|
124
|
-
warning: TOKENS.warning,
|
|
125
|
-
error: TOKENS.error,
|
|
126
|
-
info: TOKENS.info,
|
|
127
|
-
accent: TOKENS.accent
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
// src/services/handoff-skill.ts
|
|
133
|
-
import { mkdirSync as mkdirSync3 } from "fs";
|
|
134
|
-
import { basename, join as join2 } from "path";
|
|
135
|
-
import { homedir as homedir3 } from "os";
|
|
136
|
-
import chalk2 from "chalk";
|
|
137
|
-
var init_handoff_skill = __esm({
|
|
138
|
-
"src/services/handoff-skill.ts"() {
|
|
139
|
-
"use strict";
|
|
140
|
-
init_redact_write();
|
|
141
|
-
init_store();
|
|
142
|
-
init_theme();
|
|
143
|
-
init_export_kinds();
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
// src/services/exports-registry.ts
|
|
148
|
-
import {
|
|
149
|
-
appendFileSync,
|
|
150
|
-
copyFileSync,
|
|
151
|
-
cpSync,
|
|
152
|
-
existsSync as existsSync2,
|
|
153
|
-
mkdirSync as mkdirSync4,
|
|
154
|
-
readFileSync as readFileSync2,
|
|
155
|
-
readdirSync,
|
|
156
|
-
renameSync,
|
|
157
|
-
rmSync,
|
|
158
|
-
statSync,
|
|
159
|
-
writeFileSync as writeFileSync3
|
|
160
|
-
} from "fs";
|
|
161
|
-
import { basename as basename2, dirname as dirname2, join as join3, resolve as resolve3, sep as sep2 } from "path";
|
|
162
|
-
import { randomUUID } from "crypto";
|
|
163
|
-
var init_exports_registry = __esm({
|
|
164
|
-
"src/services/exports-registry.ts"() {
|
|
165
|
-
"use strict";
|
|
166
|
-
init_redact_write();
|
|
167
|
-
init_store();
|
|
168
|
-
init_path_safety();
|
|
169
|
-
init_export_kinds();
|
|
170
|
-
init_handoff_skill();
|
|
171
|
-
init_export_kinds();
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
// src/services/context-doc.ts
|
|
176
|
-
import { writeFileSync as writeFileSync4 } from "fs";
|
|
177
|
-
var init_context_doc = __esm({
|
|
178
|
-
"src/services/context-doc.ts"() {
|
|
179
|
-
"use strict";
|
|
180
|
-
init_context2();
|
|
181
|
-
init_formatters();
|
|
182
|
-
init_store();
|
|
183
|
-
init_exports_registry();
|
|
184
|
-
init_terminal_capture();
|
|
185
|
-
}
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
// src/services/transcript.ts
|
|
189
|
-
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync as writeFileSync5, rmSync as rmSync2 } from "fs";
|
|
190
|
-
import { join as join4 } from "path";
|
|
191
|
-
var init_transcript = __esm({
|
|
192
|
-
"src/services/transcript.ts"() {
|
|
193
|
-
"use strict";
|
|
194
|
-
init_context2();
|
|
195
|
-
init_terminal_capture();
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
// src/cli/context.ts
|
|
200
|
-
import { basename as basename3, join as join5, resolve as resolve4, sep as sep3 } from "path";
|
|
201
|
-
import { existsSync as existsSync4, mkdirSync as mkdirSync5, writeFileSync as writeFileSync6, readFileSync as readFileSync4, readdirSync as readdirSync2, statSync as statSync2, rmSync as rmSync3 } from "fs";
|
|
202
|
-
import { homedir as homedir4 } from "os";
|
|
203
|
-
import { randomUUID as randomUUID2 } from "crypto";
|
|
204
|
-
function isAnalysisReady(ctx) {
|
|
205
|
-
if (ctx.stage !== "analyzed" && ctx.stage !== "delivered" || ctx.analysis.completed.length === 0) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
if (!ctx.dataset) return false;
|
|
209
|
-
const counts = ctx.dataset.counts ?? {};
|
|
210
|
-
return Object.values(counts).some((n) => n > 0);
|
|
211
|
-
}
|
|
212
|
-
function defaultSessionAnalysis(primary = "gtm_health") {
|
|
213
|
-
return { primary, completed: [] };
|
|
214
|
-
}
|
|
215
|
-
var STALE_SESSION_MS;
|
|
216
|
-
var init_context2 = __esm({
|
|
217
|
-
"src/cli/context.ts"() {
|
|
218
|
-
"use strict";
|
|
219
|
-
init_thread_compat();
|
|
220
|
-
init_context();
|
|
221
|
-
init_context_doc();
|
|
222
|
-
init_transcript();
|
|
223
|
-
STALE_SESSION_MS = 14 * 24 * 60 * 60 * 1e3;
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
// src/config/profile.ts
|
|
228
|
-
import { readFileSync as readFileSync5, writeFileSync as writeFileSync7, existsSync as existsSync5, mkdirSync as mkdirSync6 } from "fs";
|
|
229
|
-
import { join as join6 } from "path";
|
|
230
|
-
var NTRP_DIR2, PROFILE_PATH;
|
|
231
|
-
var init_profile = __esm({
|
|
232
|
-
"src/config/profile.ts"() {
|
|
233
|
-
"use strict";
|
|
234
|
-
init_store();
|
|
235
|
-
NTRP_DIR2 = ntrpHome();
|
|
236
|
-
PROFILE_PATH = join6(NTRP_DIR2, "profile.json");
|
|
237
|
-
}
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
// src/db/connection.ts
|
|
241
|
-
import { dirname as dirname3, join as join7, resolve as resolve5 } from "path";
|
|
242
|
-
var NTRP_DIR3, DEFAULT_DB_PATH, DB_PATH_PINNED;
|
|
243
|
-
var init_connection = __esm({
|
|
244
|
-
"src/db/connection.ts"() {
|
|
245
|
-
"use strict";
|
|
246
|
-
init_store();
|
|
247
|
-
NTRP_DIR3 = process.env.NTRP_HOME ? resolve5(process.env.NTRP_HOME) : join7(process.env.HOME ?? "", ".ntrp");
|
|
248
|
-
DEFAULT_DB_PATH = process.env.NTRP_DB_PATH ? resolve5(process.env.NTRP_DB_PATH) : join7(NTRP_DIR3, "ntrp.duckdb");
|
|
249
|
-
DB_PATH_PINNED = !!process.env.NTRP_DB_PATH;
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
|
|
253
|
-
// src/db/queries.ts
|
|
254
|
-
var init_queries = __esm({
|
|
255
|
-
"src/db/queries.ts"() {
|
|
256
|
-
"use strict";
|
|
257
|
-
init_connection();
|
|
258
|
-
init_formatters();
|
|
259
|
-
init_connection();
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
|
|
263
|
-
// src/services/session-analysis.ts
|
|
264
|
-
var init_session_analysis = __esm({
|
|
265
|
-
"src/services/session-analysis.ts"() {
|
|
266
|
-
"use strict";
|
|
267
|
-
init_queries();
|
|
268
|
-
init_profile();
|
|
269
|
-
init_formatters();
|
|
270
|
-
}
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// src/baselines/metrics-benchmarks.ts
|
|
274
|
-
function motionBenchmarkLabel(motion) {
|
|
275
|
-
return MOTION_LABELS[motion ?? "mid_market"];
|
|
276
|
-
}
|
|
277
|
-
var METRICS_BENCHMARKS, MOTION_LABELS;
|
|
278
|
-
var init_metrics_benchmarks = __esm({
|
|
279
|
-
"src/baselines/metrics-benchmarks.ts"() {
|
|
280
|
-
"use strict";
|
|
281
|
-
METRICS_BENCHMARKS = {
|
|
282
|
-
plg: {
|
|
283
|
-
nrr: { green: 110, yellow: 100 },
|
|
284
|
-
grr: { green: 85, yellow: 75 },
|
|
285
|
-
win_rate: { green: 25, yellow: 15 },
|
|
286
|
-
pipeline_coverage: { green: 4, yellow: 2.5 },
|
|
287
|
-
magic_number: { green: 1, yellow: 0.75 },
|
|
288
|
-
payback_months: { green: 12, yellow: 18 }
|
|
289
|
-
},
|
|
290
|
-
smb_velocity: {
|
|
291
|
-
nrr: { green: 105, yellow: 95 },
|
|
292
|
-
grr: { green: 88, yellow: 78 },
|
|
293
|
-
win_rate: { green: 22, yellow: 12 },
|
|
294
|
-
pipeline_coverage: { green: 3.5, yellow: 2 },
|
|
295
|
-
magic_number: { green: 0.9, yellow: 0.6 },
|
|
296
|
-
payback_months: { green: 14, yellow: 20 }
|
|
297
|
-
},
|
|
298
|
-
mid_market: {
|
|
299
|
-
nrr: { green: 100, yellow: 90 },
|
|
300
|
-
grr: { green: 90, yellow: 80 },
|
|
301
|
-
win_rate: { green: 20, yellow: 12 },
|
|
302
|
-
pipeline_coverage: { green: 3, yellow: 2 },
|
|
303
|
-
magic_number: { green: 0.75, yellow: 0.5 },
|
|
304
|
-
payback_months: { green: 16, yellow: 22 }
|
|
305
|
-
},
|
|
306
|
-
enterprise: {
|
|
307
|
-
nrr: { green: 95, yellow: 85 },
|
|
308
|
-
grr: { green: 92, yellow: 82 },
|
|
309
|
-
win_rate: { green: 15, yellow: 8 },
|
|
310
|
-
pipeline_coverage: { green: 2.5, yellow: 1.5 },
|
|
311
|
-
magic_number: { green: 0.6, yellow: 0.4 },
|
|
312
|
-
payback_months: { green: 18, yellow: 24 }
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
MOTION_LABELS = {
|
|
316
|
-
plg: "PLG",
|
|
317
|
-
smb_velocity: "SMB Velocity",
|
|
318
|
-
mid_market: "Mid-Market",
|
|
319
|
-
enterprise: "Enterprise"
|
|
320
|
-
};
|
|
321
|
-
}
|
|
322
|
-
});
|
|
323
|
-
|
|
324
|
-
// src/data/metric-definitions.ts
|
|
325
|
-
function pctBand(metric, motion) {
|
|
326
|
-
const m = motion ?? "mid_market";
|
|
327
|
-
const t = METRICS_BENCHMARKS[m][metric];
|
|
328
|
-
return `${motionBenchmarkLabel(m)} green \u2265${t.green}${metric === "pipeline_coverage" ? "x" : "%"}, yellow \u2265${t.yellow}${metric === "pipeline_coverage" ? "x" : "%"}`;
|
|
329
|
-
}
|
|
330
|
-
function monthsBand(motion) {
|
|
331
|
-
const m = motion ?? "mid_market";
|
|
332
|
-
const t = METRICS_BENCHMARKS[m].payback_months;
|
|
333
|
-
return `${motionBenchmarkLabel(m)} green \u2264${t.green}mo, yellow \u2264${t.yellow}mo`;
|
|
334
|
-
}
|
|
335
|
-
function magicBand(motion) {
|
|
336
|
-
const m = motion ?? "mid_market";
|
|
337
|
-
const t = METRICS_BENCHMARKS[m].magic_number;
|
|
338
|
-
return `${motionBenchmarkLabel(m)} green \u2265${t.green}, yellow \u2265${t.yellow}`;
|
|
339
|
-
}
|
|
340
|
-
var VITALS, SAAS, METRIC_DEFINITIONS, BY_ID, ALIAS_INDEX, SAAS_METRIC_IDS;
|
|
341
|
-
var init_metric_definitions = __esm({
|
|
342
|
-
"src/data/metric-definitions.ts"() {
|
|
343
|
-
"use strict";
|
|
344
|
-
init_metrics_benchmarks();
|
|
345
|
-
VITALS = [
|
|
346
|
-
{
|
|
347
|
-
id: "freshness",
|
|
348
|
-
kind: "vital",
|
|
349
|
-
label: "Freshness",
|
|
350
|
-
group: "Vital Signs",
|
|
351
|
-
tagline: "Does the CRM report which records are still active?",
|
|
352
|
-
how_computed: "NTRP computes a weighted average of people, organizations, and opportunities with recent activity. Open opportunities must also not be past-due. Default windows: people and organizations 90 days, opportunities 30 days. Weights are 35 / 30 / 35.",
|
|
353
|
-
formula_lines: [
|
|
354
|
-
"freshness = people%\xD70.35 + orgs%\xD70.30 + opps%\xD70.35",
|
|
355
|
-
"people/orgs fresh if activity within 90d",
|
|
356
|
-
"opps fresh if activity within 30d AND not past-due"
|
|
357
|
-
],
|
|
358
|
-
meaning: "Board question: how much of this pipeline is real versus fiction? Dollar value equals the sum of amount on stale opportunities: pipeline at risk.",
|
|
359
|
-
expert_read: "Cut by owner and by stage first. Freshness reds concentrate on people or process. They rarely spread evenly. In a long-cycle enterprise motion, 30 quiet days can be normal cadence. In a velocity motion, 30 quiet days is a dead deal. A sudden cliff usually means a broken integration or a departed rep. It is not gradual decay. Check this false positive: bulk-imported records that nobody has touched yet.",
|
|
360
|
-
deepdive: [
|
|
361
|
-
"Status bands: green 80 or more, yellow 60 or more, red below 60. Motion presets can change the windows.",
|
|
362
|
-
'Dollar translation: sum of amount on stale open opportunities \u2192 "pipeline at risk".',
|
|
363
|
-
"Layer 1 of the gating stack. A red score here limits trust in later layers.",
|
|
364
|
-
"Trigger play: Clean Dead Pipeline (clean-dead-pipeline) when the score is below 60.",
|
|
365
|
-
"Levers: stale-deal alert at N quiet days. Weekly hygiene scrub. Enrichment refresh on quiet records. Signal-triggered reactivation for paid dormant accounts."
|
|
366
|
-
],
|
|
367
|
-
visual: {
|
|
368
|
-
kind: "bars",
|
|
369
|
-
caption: "Example component mix. Higher bars are fresher.",
|
|
370
|
-
bars: [
|
|
371
|
-
{ label: "People", value: 72, tone: "yellow" },
|
|
372
|
-
{ label: "Organizations", value: 81, tone: "green" },
|
|
373
|
-
{ label: "Opportunities", value: 44, tone: "red" }
|
|
374
|
-
]
|
|
375
|
-
},
|
|
376
|
-
play_id: "clean-dead-pipeline",
|
|
377
|
-
dollar_label: "pipeline at risk",
|
|
378
|
-
audience: {
|
|
379
|
-
board: "Freshness answers whether the pipeline number is real. Low freshness means forecast risk. Stale deals inflate coverage and hide the true gap.",
|
|
380
|
-
ops: "Score equals weighted recency across people, organizations, and opportunities. Cut by owner and stage. Set a stale-deal alert and a weekly scrub. Play: Clean Dead Pipeline."
|
|
381
|
-
},
|
|
382
|
-
aliases: ["data freshness", "stale", "zombie deals", "crm freshness"]
|
|
383
|
-
},
|
|
384
|
-
{
|
|
385
|
-
id: "flow_rate",
|
|
386
|
-
kind: "vital",
|
|
387
|
-
label: "Flow Rate",
|
|
388
|
-
group: "Vital Signs",
|
|
389
|
-
tagline: "How fast do deals move, and where do they stop?",
|
|
390
|
-
how_computed: "NTRP sets a base score from average open-deal age versus max_days. It then applies a penalty of up to 20 for the share of stuck deals. A deal is stuck when it has no update beyond stuck_days, or a past-due close. Status uses average open age, not the score alone.",
|
|
391
|
-
formula_lines: [
|
|
392
|
-
"base = 100 \xD7 (1 \u2212 avgOpenAge / max_days)",
|
|
393
|
-
"score = base \u2212 stuckSharePenalty (\u226420)",
|
|
394
|
-
"stuck = no update > stuck_days OR past-due close"
|
|
395
|
-
],
|
|
396
|
-
meaning: "Board question: is next quarter slipping because deals are stuck? Dollar value equals the amount stuck in pipeline.",
|
|
397
|
-
expert_read: "Cut by stage age, not only deal age. Find the stage where deals stop. That is usually one stage. Compare stuck-deal age to this company's own median cycle. Do not use a generic norm. Stuck deals plus past-due close dates signal optimistic forecasting. That is a credibility problem before it is a revenue problem.",
|
|
398
|
-
deepdive: [
|
|
399
|
-
"Status uses average open age. Green is 45 days or less. Yellow is 90 days or less. Else red. Defaults: max_days 120, stuck_days 60.",
|
|
400
|
-
'Dollar translation: sum of amount on stuck deals \u2192 "stuck in pipeline".',
|
|
401
|
-
"Layer 2 of the gating stack, with Drop Rate.",
|
|
402
|
-
"Trigger play: Unstick the Pipeline (unstick-pipeline) when the score is weak.",
|
|
403
|
-
"Levers: stage-age report. Past-due close cleanup. Progression plans on stuck deals. Forecast hygiene on optimistic close dates."
|
|
404
|
-
],
|
|
405
|
-
visual: {
|
|
406
|
-
kind: "funnel",
|
|
407
|
-
caption: "Example stage ages. Find the stage where deals stop.",
|
|
408
|
-
funnel: [
|
|
409
|
-
{ label: "Discovery", widthPct: 100 },
|
|
410
|
-
{ label: "Qualify", widthPct: 78 },
|
|
411
|
-
{ label: "Propose", widthPct: 55 },
|
|
412
|
-
{ label: "Negotiate", widthPct: 22 },
|
|
413
|
-
{ label: "Closed", widthPct: 12 }
|
|
414
|
-
]
|
|
415
|
-
},
|
|
416
|
-
play_id: "unstick-pipeline",
|
|
417
|
-
dollar_label: "stuck in pipeline",
|
|
418
|
-
audience: {
|
|
419
|
-
board: "Flow Rate is velocity risk. Stuck pipeline with past-due closes is a credibility problem for the forecast before it is a revenue miss.",
|
|
420
|
-
ops: "Find the stage with collapsing advancement and age. Clear past-due closes. Write progression plans on stuck deals. Play: Unstick the Pipeline."
|
|
421
|
-
},
|
|
422
|
-
aliases: ["flow rate", "deal velocity", "stuck deals", "stuck pipeline"]
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
id: "drop_rate",
|
|
426
|
-
kind: "vital",
|
|
427
|
-
label: "Drop Rate",
|
|
428
|
-
group: "Vital Signs",
|
|
429
|
-
tagline: "Where do leads drop between systems?",
|
|
430
|
-
how_computed: "NTRP blends cross-system retention and opportunity retention. Cross-system retention is marketing people also present in sales. Opportunity retention is open opportunities that are not abandoned. Default weights: cross-system 60 percent, opportunity retention 40 percent. Abandoned means open opportunities with no activity in 30 days.",
|
|
431
|
-
formula_lines: [
|
|
432
|
-
"score = crossSystemRetention\xD70.6 + oppRetention\xD70.4",
|
|
433
|
-
"cross-system = marketing people also in sales CRM",
|
|
434
|
-
"abandoned = open opps with no activity in 30d"
|
|
435
|
-
],
|
|
436
|
-
meaning: "Board question: how much pipeline did we pay for and never work? Dollar value = droppedCount \xD7 conversionRate \xD7 avgDealSize \u2014 est. lost at handoff.",
|
|
437
|
-
expert_read: "This is almost always a systems failure. Causes include routing rules, unassigned territories, dead rep queues, or a sync gap between marketing and CRM. It is not lazy reps. First cut by lead source. The leak usually concentrates in one or two sources. The cheapest pipeline this business can buy is the leads it already paid for.",
|
|
438
|
-
deepdive: [
|
|
439
|
-
"Status bands: green 80 or more, yellow 60 or more, red below 60.",
|
|
440
|
-
'Dollar translation: dropped \xD7 conversion \xD7 avg deal (fallback: drop% \xD7 open pipeline) \u2192 "est. lost at handoff".',
|
|
441
|
-
"Layer 2 of the gating stack, with Flow Rate.",
|
|
442
|
-
"Trigger play: Fix the Handoff Gap (fix-handoff-gap) when drop is high.",
|
|
443
|
-
"Levers: source-level handoff audit. Routing and sync repair. Time-to-first-touch SLA. Weekly marketing-only-leads report."
|
|
444
|
-
],
|
|
445
|
-
visual: {
|
|
446
|
-
kind: "funnel",
|
|
447
|
-
caption: "Example handoff funnel. The leak is usually one or two sources.",
|
|
448
|
-
funnel: [
|
|
449
|
-
{ label: "Marketing leads", widthPct: 100 },
|
|
450
|
-
{ label: "In sales CRM", widthPct: 62 },
|
|
451
|
-
{ label: "Assigned + touched", widthPct: 41 },
|
|
452
|
-
{ label: "Active opportunities", widthPct: 28 }
|
|
453
|
-
]
|
|
454
|
-
},
|
|
455
|
-
play_id: "fix-handoff-gap",
|
|
456
|
-
dollar_label: "est. lost at handoff",
|
|
457
|
-
audience: {
|
|
458
|
-
board: "Drop Rate prices the handoff leak. Budget is already spent on leads that never reach a working rep. This is usually a systems failure, not a people failure.",
|
|
459
|
-
ops: "Audit by source. Fix routing, sync, and dead queues. Set a time-to-first-touch measure. Play: Fix the Handoff Gap."
|
|
460
|
-
},
|
|
461
|
-
aliases: ["drop rate", "handoff", "handoff gap", "lead leak", "marketing sales handoff"]
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
id: "signal_to_noise",
|
|
465
|
-
kind: "vital",
|
|
466
|
-
label: "Signal:Noise",
|
|
467
|
-
group: "Vital Signs",
|
|
468
|
-
tagline: "How much activity is aimed at deals that can still close?",
|
|
469
|
-
how_computed: "Over a 90-day lookback, NTRP computes (signal activities / all activities) \xD7 100. Signal is activity linked to an open opportunity, a pipeline person, or a pipeline organization.",
|
|
470
|
-
formula_lines: [
|
|
471
|
-
"score = (signalCount / activityCount) \xD7 100",
|
|
472
|
-
"signal = linked to open opp / pipeline person / pipeline org",
|
|
473
|
-
"lookback = trailing 90 days"
|
|
474
|
-
],
|
|
475
|
-
meaning: "Board question: are we burning capacity on dead accounts? Dollar value = noiseCount \xD7 hours_per_activity \xD7 rep_hourly_cost \u2014 misdirected effort.",
|
|
476
|
-
expert_read: "Cut by rep and by account status. Noise usually means reps work dead accounts they already know. Targeting and account lists are stale. Persistent noise is a coverage-model problem, not a coaching problem. Check whether activity is logged against closed or unlinked records. That is often a hygiene artifact.",
|
|
477
|
-
deepdive: [
|
|
478
|
-
"Status bands: green 65 or more, yellow 40 or more, red below 40.",
|
|
479
|
-
"Dollar defaults: 0.25 hours/activity \xD7 $75/hr (config: hours_per_activity, rep_hourly_cost).",
|
|
480
|
-
"Layer 3 of the gating stack. Trust Freshness, Flow Rate, and Drop Rate before you read activity efficiency.",
|
|
481
|
-
"Trigger play: Retarget Misdirected Effort (retarget-effort) when the score is low.",
|
|
482
|
-
"Levers: refresh account lists. Signal-based targeting. Stop logging against closed or unlinked records. Coverage-model redesign."
|
|
483
|
-
],
|
|
484
|
-
visual: {
|
|
485
|
-
kind: "split",
|
|
486
|
-
caption: "Example activity mix. Signal versus noise.",
|
|
487
|
-
bars: [
|
|
488
|
-
{ label: "Signal", value: 38, tone: "green" },
|
|
489
|
-
{ label: "Noise", value: 62, tone: "red" }
|
|
490
|
-
]
|
|
491
|
-
},
|
|
492
|
-
play_id: "retarget-effort",
|
|
493
|
-
dollar_label: "misdirected effort",
|
|
494
|
-
audience: {
|
|
495
|
-
board: "Signal:Noise prices wasted capacity. Persistent noise is usually a coverage-model problem, not a coaching problem. Reps work dead accounts they already know.",
|
|
496
|
-
ops: "Score equals the percent of activities linked to live pipeline. Cut by rep and account status. Refresh targeting. Play: Retarget Misdirected Effort."
|
|
497
|
-
},
|
|
498
|
-
aliases: ["signal to noise", "signal:noise", "s/n", "activity efficiency", "noise"]
|
|
499
|
-
},
|
|
500
|
-
{
|
|
501
|
-
id: "thread_depth",
|
|
502
|
-
kind: "vital",
|
|
503
|
-
label: "Thread Depth",
|
|
504
|
-
group: "Vital Signs",
|
|
505
|
-
tagline: "How fragile is the pipeline if one champion stops?",
|
|
506
|
-
how_computed: "Percent of open deals with at least multi_thread_threshold distinct people active in the last 90 days. The default threshold is 2. People include opportunity-direct contacts and same-organization activity.",
|
|
507
|
-
formula_lines: [
|
|
508
|
-
"score = % open deals with \u22652 active people (90d)",
|
|
509
|
-
"people counted via opp contacts + same-org activity",
|
|
510
|
-
"threshold configurable (default 2)"
|
|
511
|
-
],
|
|
512
|
-
meaning: "Board question: how much revenue is lost if one contact changes jobs? Dollar value equals the sum of amount on single-threaded deals.",
|
|
513
|
-
expert_read: "Weight by deal size. One single-threaded mega-deal outweighs ten small ones. Single-threading late in the cycle is far more dangerous than early. In enterprise motions, Thread Depth is a leading indicator of slipped quarters. Champions change jobs. There is no second contact.",
|
|
514
|
-
deepdive: [
|
|
515
|
-
"Status bands: green 65 or more, yellow 40 or more, red below 40.",
|
|
516
|
-
'Dollar translation: sum of amount on single-threaded deals \u2192 "single-threaded".',
|
|
517
|
-
"Layer 4 of the gating stack. Read this last, after the upstream vital signs.",
|
|
518
|
-
"Trigger play: Multi-Thread Your Deals (multi-thread-deals) when depth is low.",
|
|
519
|
-
"Levers: buying-committee map. Warm internal referral first. CRM contact roles. Mid-stage single-thread alerts. Champion job-change signals."
|
|
520
|
-
],
|
|
521
|
-
visual: {
|
|
522
|
-
kind: "bars",
|
|
523
|
-
caption: "Example: multi-threaded versus single-threaded open deals",
|
|
524
|
-
bars: [
|
|
525
|
-
{ label: "Multi-threaded", value: 34, tone: "green" },
|
|
526
|
-
{ label: "Single-threaded", value: 66, tone: "red" }
|
|
527
|
-
]
|
|
528
|
-
},
|
|
529
|
-
play_id: "multi-thread-deals",
|
|
530
|
-
dollar_label: "single-threaded",
|
|
531
|
-
audience: {
|
|
532
|
-
board: "Thread Depth is resilience risk. One single-threaded mega-deal outweighs ten small ones. Late-cycle single-threading is a leading indicator of slipped quarters.",
|
|
533
|
-
ops: "Score equals the percent of open deals with 2 or more active contacts in 90 days. Map the buying committee. Alert on mid-stage singles. Play: Multi-Thread Your Deals."
|
|
534
|
-
},
|
|
535
|
-
aliases: ["thread depth", "multithreading", "multi-thread", "single-threaded", "buying committee"]
|
|
536
|
-
}
|
|
537
|
-
];
|
|
538
|
-
SAAS = [
|
|
539
|
-
// —— Revenue ——
|
|
540
|
-
{
|
|
541
|
-
id: "arr",
|
|
542
|
-
kind: "saas",
|
|
543
|
-
label: "ARR",
|
|
544
|
-
group: "Revenue",
|
|
545
|
-
tagline: "How big is the revenue engine, and from where?",
|
|
546
|
-
how_computed: "Sum of amount on closed-won opportunities in the dataset. This is pipeline-inferred ARR when a pure subscription ledger is not available.",
|
|
547
|
-
formula_lines: [
|
|
548
|
-
"ARR \u2248 \u03A3 amount on closed-won opportunities",
|
|
549
|
-
"New + Expansion = growth \xB7 Churned + Contraction = leakage"
|
|
550
|
-
],
|
|
551
|
-
meaning: "Board question: how fast are we growing, and from where? Always decompose growth into new versus expansion. The mix is the story.",
|
|
552
|
-
expert_read: "Always decompose growth into new versus expansion. The mix is the story. Prefer this company's own trailing history over any external prior. A number below its reliability_gate is a hypothesis, not a fact.",
|
|
553
|
-
deepdive: [
|
|
554
|
-
"Companion metrics: New ARR, Expansion ARR, Churned ARR, Contraction ARR.",
|
|
555
|
-
"Estimation method may be ledger, pipeline_inferred, or snapshot. Read confidence and reliability_gate.",
|
|
556
|
-
"Cross-check with Freshness before you trust ARR growth stories that rest on zombie deals."
|
|
557
|
-
],
|
|
558
|
-
visual: {
|
|
559
|
-
kind: "waterfall",
|
|
560
|
-
caption: "Example ARR walk. Growth versus leakage.",
|
|
561
|
-
waterfall: [
|
|
562
|
-
{ label: "Starting", delta: 100, cumulative: 100 },
|
|
563
|
-
{ label: "+ New", delta: 18, cumulative: 118 },
|
|
564
|
-
{ label: "+ Expansion", delta: 12, cumulative: 130 },
|
|
565
|
-
{ label: "\u2212 Contraction", delta: -4, cumulative: 126 },
|
|
566
|
-
{ label: "\u2212 Churned", delta: -8, cumulative: 118 }
|
|
567
|
-
]
|
|
568
|
-
},
|
|
569
|
-
audience: {
|
|
570
|
-
board: "ARR is the size of the engine. The story is the mix: new versus expansion growth, and how much leakage (churn plus contraction) reduced it.",
|
|
571
|
-
ops: "NTRP computes \u03A3 closed-won amounts. This is pipeline-inferred when there is no ledger. Decompose into new, expansion, churned, and contraction before you brief anyone."
|
|
572
|
-
},
|
|
573
|
-
aliases: ["annual recurring revenue", "revenue"]
|
|
574
|
-
},
|
|
575
|
-
{
|
|
576
|
-
id: "new_arr",
|
|
577
|
-
kind: "saas",
|
|
578
|
-
label: "New ARR",
|
|
579
|
-
group: "Revenue",
|
|
580
|
-
tagline: "How much growth came from new customers?",
|
|
581
|
-
how_computed: "Closed-won tagged New Business. If tags are missing, first closed-won deal per organization.",
|
|
582
|
-
formula_lines: [
|
|
583
|
-
"New ARR = \u03A3 closed-won tagged New Business",
|
|
584
|
-
"fallback: first closed-won deal per organization"
|
|
585
|
-
],
|
|
586
|
-
meaning: "Board question: is growth coming from the top of funnel, or from the installed base?",
|
|
587
|
-
expert_read: "Rising New ARR with falling Expansion usually means land-and-expand is underpowered. The lever is packaging or CS motion, not only sales capacity.",
|
|
588
|
-
deepdive: [
|
|
589
|
-
"Pair with Expansion ARR. The mix shows which motion carries growth.",
|
|
590
|
-
"Tag quality matters. Untagged deals use the first-deal-per-organization heuristic."
|
|
591
|
-
],
|
|
592
|
-
visual: {
|
|
593
|
-
kind: "bars",
|
|
594
|
-
caption: "Example growth mix",
|
|
595
|
-
bars: [
|
|
596
|
-
{ label: "New ARR", value: 60, tone: "accent" },
|
|
597
|
-
{ label: "Expansion ARR", value: 40, tone: "green" }
|
|
598
|
-
]
|
|
599
|
-
},
|
|
600
|
-
audience: {
|
|
601
|
-
board: "New ARR is net-new logos. Read it next to Expansion ARR. A healthy mix beats a one-sided engine.",
|
|
602
|
-
ops: "Prefer CRM New Business tags. Otherwise use the first closed-won per organization. Watch tag hygiene."
|
|
603
|
-
},
|
|
604
|
-
aliases: ["new business arr", "new logo arr"]
|
|
605
|
-
},
|
|
606
|
-
{
|
|
607
|
-
id: "expansion_arr",
|
|
608
|
-
kind: "saas",
|
|
609
|
-
label: "Expansion ARR",
|
|
610
|
-
group: "Revenue",
|
|
611
|
-
tagline: "How much extra revenue comes from existing customers?",
|
|
612
|
-
how_computed: "Closed-won tagged Expansion. If tags are missing, later closed-won deals per organization after the first win.",
|
|
613
|
-
formula_lines: [
|
|
614
|
-
"Expansion ARR = \u03A3 closed-won tagged Expansion",
|
|
615
|
-
"fallback: later closed-won deals per organization"
|
|
616
|
-
],
|
|
617
|
-
meaning: "Board question: is the installed base compounding?",
|
|
618
|
-
expert_read: "Expansion is the cheapest growth. Weak Expansion with strong New ARR is a land-only motion. The usual lever is packaging, CS capacity, or product attach.",
|
|
619
|
-
deepdive: [
|
|
620
|
-
"Feeds NRR as the upside term.",
|
|
621
|
-
"Compare to Contraction. Net expansion equals expansion minus contraction."
|
|
622
|
-
],
|
|
623
|
-
visual: {
|
|
624
|
-
kind: "bars",
|
|
625
|
-
caption: "Example: expansion versus contraction",
|
|
626
|
-
bars: [
|
|
627
|
-
{ label: "Expansion", value: 70, tone: "green" },
|
|
628
|
-
{ label: "Contraction", value: 25, tone: "yellow" }
|
|
629
|
-
]
|
|
630
|
-
},
|
|
631
|
-
audience: {
|
|
632
|
-
board: "Expansion ARR is installed-base compounding. It is the cheapest growth when it works.",
|
|
633
|
-
ops: "Tagged Expansion or subsequent wins per organization. Pair with Contraction before you celebrate net expansion."
|
|
634
|
-
},
|
|
635
|
-
aliases: ["upsell", "upsell arr", "cross-sell"]
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
id: "churned_arr",
|
|
639
|
-
kind: "saas",
|
|
640
|
-
label: "Churned ARR",
|
|
641
|
-
group: "Revenue",
|
|
642
|
-
tagline: "How much revenue left?",
|
|
643
|
-
how_computed: "NTRP sums historical closed-won amounts for organizations that have historical wins, no win in the trailing 12 months, and no active open opportunity.",
|
|
644
|
-
formula_lines: [
|
|
645
|
-
"Churned ARR = \u03A3 historical wins for orgs with",
|
|
646
|
-
" no win in trailing 12mo AND no active open opp"
|
|
647
|
-
],
|
|
648
|
-
meaning: "Board question: how leaky is the bucket before expansion hides it? With Contraction, this is the GRR downside.",
|
|
649
|
-
expert_read: "Pipeline-inferred churn is a hypothesis. Confirm with billing status when that data is available. A spike often clusters in one segment or cohort.",
|
|
650
|
-
deepdive: [
|
|
651
|
-
"Feeds GRR and NRR as the churn term.",
|
|
652
|
-
"Cut by segment or motion before you treat it as a company-wide PMF problem."
|
|
653
|
-
],
|
|
654
|
-
visual: {
|
|
655
|
-
kind: "bars",
|
|
656
|
-
caption: "Example leakage mix",
|
|
657
|
-
bars: [
|
|
658
|
-
{ label: "Churned", value: 55, tone: "red" },
|
|
659
|
-
{ label: "Contraction", value: 30, tone: "yellow" }
|
|
660
|
-
]
|
|
661
|
-
},
|
|
662
|
-
audience: {
|
|
663
|
-
board: "Churned ARR is full logo loss. With Contraction it sets the floor of the business (GRR).",
|
|
664
|
-
ops: "Heuristic: historical winners with no trailing-12 win and no open opportunity. Validate against billing when you can."
|
|
665
|
-
},
|
|
666
|
-
aliases: ["churn", "logo churn", "churned revenue"]
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
id: "contraction_arr",
|
|
670
|
-
kind: "saas",
|
|
671
|
-
label: "Contraction ARR",
|
|
672
|
-
group: "Revenue",
|
|
673
|
-
tagline: "How much less did existing customers buy?",
|
|
674
|
-
how_computed: "Organizations with 2 or more wins where the latest amount is less than the prior. NTRP sums the negative deltas.",
|
|
675
|
-
formula_lines: [
|
|
676
|
-
"Contraction = \u03A3 (prior \u2212 latest) where latest < prior",
|
|
677
|
-
"requires \u22652 closed-won deals per organization"
|
|
678
|
-
],
|
|
679
|
-
meaning: "Board question: are we shrinking inside the base while logos stay?",
|
|
680
|
-
expert_read: "Contraction is often packaging, seat-reduction, or downgrade. The owner is different from logo churn. The same NRR can be a churn problem or a no-expansion problem.",
|
|
681
|
-
deepdive: [
|
|
682
|
-
"Feeds GRR and NRR.",
|
|
683
|
-
"This metric needs multi-deal history per organization. Thin history understates contraction."
|
|
684
|
-
],
|
|
685
|
-
visual: {
|
|
686
|
-
kind: "waterfall",
|
|
687
|
-
caption: "Example: contraction reduces the base",
|
|
688
|
-
waterfall: [
|
|
689
|
-
{ label: "Prior", delta: 100, cumulative: 100 },
|
|
690
|
-
{ label: "Latest", delta: -18, cumulative: 82 }
|
|
691
|
-
]
|
|
692
|
-
},
|
|
693
|
-
audience: {
|
|
694
|
-
board: "Contraction is silent shrink inside retained logos. It is often packaging or seats, not a cancelled contract.",
|
|
695
|
-
ops: "Requires 2 or more wins per organization with a down-round. Pair with Expansion for net expansion."
|
|
696
|
-
},
|
|
697
|
-
aliases: ["downgrade", "seat reduction", "contraction"]
|
|
698
|
-
},
|
|
699
|
-
// —— Retention ——
|
|
700
|
-
{
|
|
701
|
-
id: "nrr",
|
|
702
|
-
kind: "saas",
|
|
703
|
-
label: "Net Revenue Retention",
|
|
704
|
-
group: "Retention",
|
|
705
|
-
tagline: "Would this business grow if sales stopped selling?",
|
|
706
|
-
how_computed: "startingArr = ARR + Churned + Contraction \u2212 Expansion. NRR = ((starting \u2212 Churned \u2212 Contraction + Expansion) / starting) \xD7 100.",
|
|
707
|
-
formula_lines: [
|
|
708
|
-
"starting = ARR + churned + contraction \u2212 expansion",
|
|
709
|
-
"NRR = (starting \u2212 churned \u2212 contraction + expansion) / starting \xD7 100",
|
|
710
|
-
"NRR = 100% + expansion% \u2212 contraction% \u2212 churn%"
|
|
711
|
-
],
|
|
712
|
-
meaning: "Board question: would this business grow if sales stopped selling? A value above 100% means growth from existing customers.",
|
|
713
|
-
expert_read: "Decompose before you judge. The same 95% can be a churn problem (product/PMF) or a no-expansion problem (packaging/motion). Those have different owners. Priors by segment: about 97% SMB, about 108% mid-market, about 118% enterprise medians. 110% or more is a strong signal at any stage.",
|
|
714
|
-
deepdive: [
|
|
715
|
-
"Always show the waterfall: +expansion \u2212contraction \u2212churn.",
|
|
716
|
-
"GRR is the floor. NRR adds expansion on top.",
|
|
717
|
-
"On pipeline-only data, treat NRR as a hypothesis. Check confidence and reliability_gate."
|
|
718
|
-
],
|
|
719
|
-
visual: {
|
|
720
|
-
kind: "waterfall",
|
|
721
|
-
caption: "Example NRR walk from 100%",
|
|
722
|
-
waterfall: [
|
|
723
|
-
{ label: "100%", delta: 100, cumulative: 100 },
|
|
724
|
-
{ label: "+ Expansion", delta: 14, cumulative: 114 },
|
|
725
|
-
{ label: "\u2212 Contraction", delta: -4, cumulative: 110 },
|
|
726
|
-
{ label: "\u2212 Churn", delta: -6, cumulative: 104 }
|
|
727
|
-
]
|
|
728
|
-
},
|
|
729
|
-
audience: {
|
|
730
|
-
board: "NRR above 100% means the base compounds without new logos. Decompose before you judge. The same number can have different owners.",
|
|
731
|
-
ops: "NRR = 100 + expansion \u2212 contraction \u2212 churn. Motion benchmarks calibrate green and yellow bands. Check reliability_gate on pipeline-inferred data."
|
|
732
|
-
},
|
|
733
|
-
aliases: ["net revenue retention", "net retention", "ndr"],
|
|
734
|
-
benchmarkHint: (motion) => pctBand("nrr", motion)
|
|
735
|
-
},
|
|
736
|
-
{
|
|
737
|
-
id: "grr",
|
|
738
|
-
kind: "saas",
|
|
739
|
-
label: "Gross Revenue Retention",
|
|
740
|
-
group: "Retention",
|
|
741
|
-
tagline: "How leaky is the bucket before expansion hides it?",
|
|
742
|
-
how_computed: "GRR = ((startingArr \u2212 Churned \u2212 Contraction) / startingArr) \xD7 100. Expansion is excluded on purpose.",
|
|
743
|
-
formula_lines: [
|
|
744
|
-
"starting = ARR + churned + contraction \u2212 expansion",
|
|
745
|
-
"GRR = (starting \u2212 churned \u2212 contraction) / starting \xD7 100"
|
|
746
|
-
],
|
|
747
|
-
meaning: "Board question: how leaky is the bucket before expansion hides it? Prior: above 90% is healthy. Above 95% is strong for enterprise.",
|
|
748
|
-
expert_read: "GRR is the honesty metric. Expansion can make NRR look fine while GRR erodes. Always read both.",
|
|
749
|
-
deepdive: [
|
|
750
|
-
"GRR never includes Expansion. That is the point.",
|
|
751
|
-
"Owners: product and CS for churn. Packaging for contraction."
|
|
752
|
-
],
|
|
753
|
-
visual: {
|
|
754
|
-
kind: "gauge",
|
|
755
|
-
caption: "Example GRR. This is the floor of the business.",
|
|
756
|
-
gauge: 92
|
|
757
|
-
},
|
|
758
|
-
audience: {
|
|
759
|
-
board: "GRR is the floor: churn plus contraction only. Expansion cannot hide a leaky bucket here.",
|
|
760
|
-
ops: "Exclude Expansion by design. Pair with NRR. Diagnose churn versus contraction separately."
|
|
761
|
-
},
|
|
762
|
-
aliases: ["gross revenue retention", "gross retention"],
|
|
763
|
-
benchmarkHint: (motion) => pctBand("grr", motion)
|
|
764
|
-
},
|
|
765
|
-
// —— Pipeline ——
|
|
766
|
-
{
|
|
767
|
-
id: "pipeline_coverage",
|
|
768
|
-
kind: "saas",
|
|
769
|
-
label: "Pipeline Coverage",
|
|
770
|
-
group: "Pipeline",
|
|
771
|
-
tagline: "Is next quarter already at risk?",
|
|
772
|
-
how_computed: "Open pipeline amount divided by trailing-90-day closed-won amount.",
|
|
773
|
-
formula_lines: [
|
|
774
|
-
"Coverage = openPipeline / trailing_90d_won",
|
|
775
|
-
"required \u2248 1 / win_rate (discount for time left)"
|
|
776
|
-
],
|
|
777
|
-
meaning: "Board question: is next quarter already at risk? Priors scale with cycle length: about 3x for velocity/SMB, 4 to 5x for enterprise.",
|
|
778
|
-
expert_read: "Coverage has no meaning without win rate. Required coverage is about 1 / win rate, discounted for time left in the period. Inflated stages and zombie deals fake coverage. Cross-check with Freshness before you trust it.",
|
|
779
|
-
deepdive: [
|
|
780
|
-
"Always pair with Win Rate and Freshness.",
|
|
781
|
-
"Weighted Pipeline is the credibility-adjusted companion."
|
|
782
|
-
],
|
|
783
|
-
visual: {
|
|
784
|
-
kind: "gauge",
|
|
785
|
-
caption: "Example coverage versus a 3x target",
|
|
786
|
-
gauge: 72,
|
|
787
|
-
bars: [
|
|
788
|
-
{ label: "Open pipeline", value: 75, tone: "accent" },
|
|
789
|
-
{ label: "Trailing won (scaled)", value: 25, tone: "neutral" }
|
|
790
|
-
]
|
|
791
|
-
},
|
|
792
|
-
audience: {
|
|
793
|
-
board: "Coverage answers whether next quarter already has too little pipeline. Fake coverage from zombies is worse than an honest gap.",
|
|
794
|
-
ops: "open / trailing-90d won. Required \u2248 1/win_rate. Cross-check Freshness before you brief."
|
|
795
|
-
},
|
|
796
|
-
aliases: ["coverage", "pipeline coverage", "pipe coverage"],
|
|
797
|
-
benchmarkHint: (motion) => pctBand("pipeline_coverage", motion)
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
id: "weighted_pipeline",
|
|
801
|
-
kind: "saas",
|
|
802
|
-
label: "Weighted Pipeline",
|
|
803
|
-
group: "Pipeline",
|
|
804
|
-
tagline: "What is the pipeline worth after stage probability?",
|
|
805
|
-
how_computed: "Sum of amount \xD7 stage probability for open deals. NTRP uses CRM Probability when present. Else it uses stage defaults.",
|
|
806
|
-
formula_lines: [
|
|
807
|
-
"Weighted = \u03A3 (amount \xD7 stageProbability)",
|
|
808
|
-
"trust \u2264 stage discipline deserves"
|
|
809
|
-
],
|
|
810
|
-
meaning: "Board question: what should we forecast from open pipeline?",
|
|
811
|
-
expert_read: "Trust this number only as much as stage discipline deserves. Inflated late stages make Weighted Pipeline a fiction.",
|
|
812
|
-
deepdive: [
|
|
813
|
-
"Compare to unweighted open pipeline. A large gap means optimistic stages.",
|
|
814
|
-
"Pair with Flow Rate for stuck late stages."
|
|
815
|
-
],
|
|
816
|
-
visual: {
|
|
817
|
-
kind: "bars",
|
|
818
|
-
caption: "Example: open versus weighted",
|
|
819
|
-
bars: [
|
|
820
|
-
{ label: "Open pipeline", value: 100, tone: "neutral" },
|
|
821
|
-
{ label: "Weighted", value: 42, tone: "accent" }
|
|
822
|
-
]
|
|
823
|
-
},
|
|
824
|
-
audience: {
|
|
825
|
-
board: "Weighted Pipeline is the credibility-adjusted forecast input. It is only as good as stage discipline.",
|
|
826
|
-
ops: "\u03A3 amount \xD7 probability. Audit stage probabilities when weighted is far below open."
|
|
827
|
-
},
|
|
828
|
-
aliases: ["weighted pipe", "probability-weighted pipeline"]
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
id: "pipeline_created",
|
|
832
|
-
kind: "saas",
|
|
833
|
-
label: "Pipeline Created (90d)",
|
|
834
|
-
group: "Pipeline",
|
|
835
|
-
tagline: "How much new pipeline did we generate recently?",
|
|
836
|
-
how_computed: "Sum of amounts for opportunities created in the last 90 days.",
|
|
837
|
-
formula_lines: ["Pipeline Created = \u03A3 amount where created_at within 90d"],
|
|
838
|
-
meaning: "Board question: is the top of funnel still filling?",
|
|
839
|
-
expert_read: "Falling created pipeline with flat coverage is a future miss. Coverage is lagging. Created is leading.",
|
|
840
|
-
deepdive: [
|
|
841
|
-
"This is a leading indicator for next-quarter coverage.",
|
|
842
|
-
"Cut by source or segment to find where creation stalled."
|
|
843
|
-
],
|
|
844
|
-
visual: {
|
|
845
|
-
kind: "bars",
|
|
846
|
-
caption: "Example: created versus needed",
|
|
847
|
-
bars: [
|
|
848
|
-
{ label: "Created (90d)", value: 55, tone: "yellow" },
|
|
849
|
-
{ label: "Target pace", value: 80, tone: "green" }
|
|
850
|
-
]
|
|
851
|
-
},
|
|
852
|
-
audience: {
|
|
853
|
-
board: "Pipeline Created is a leading indicator. When coverage lags, the miss is already in motion.",
|
|
854
|
-
ops: "\u03A3 amounts on opportunities created in 90 days. Cut by source when it dips."
|
|
855
|
-
},
|
|
856
|
-
aliases: ["pipe gen", "pipeline generation", "created pipeline"]
|
|
857
|
-
},
|
|
858
|
-
{
|
|
859
|
-
id: "pipeline_velocity",
|
|
860
|
-
kind: "saas",
|
|
861
|
-
label: "Pipeline Velocity",
|
|
862
|
-
group: "Pipeline",
|
|
863
|
-
tagline: "Revenue throughput per day. Four levers, one number.",
|
|
864
|
-
how_computed: "(openOpps \xD7 avgDeal \xD7 winRate) / avgCycleDays. Requires 3 or more dated closed-won deals. Unit: $/day.",
|
|
865
|
-
formula_lines: [
|
|
866
|
-
"Velocity = (openOpps \xD7 avgDeal \xD7 winRate) / avgCycleDays",
|
|
867
|
-
"four levers: #opps \xB7 deal size \xB7 win rate \xB7 cycle days"
|
|
868
|
-
],
|
|
869
|
-
meaning: "Board question: which lever moved when throughput changed? This is the most decision-ready pipeline metric.",
|
|
870
|
-
expert_read: "When velocity changes, name which lever moved. A win-rate rise on falling opportunity volume is qualification tightening, not improvement.",
|
|
871
|
-
deepdive: [
|
|
872
|
-
"Needs 3 or more dated wins. Otherwise this metric is unavailable.",
|
|
873
|
-
"Pairs with Flow Rate (cycle) and Win Rate (conversion)."
|
|
874
|
-
],
|
|
875
|
-
visual: {
|
|
876
|
-
kind: "levers",
|
|
877
|
-
caption: "Four levers. Name which one moved.",
|
|
878
|
-
levers: ["# Open opps", "Avg deal size", "Win rate", "Cycle days"]
|
|
879
|
-
},
|
|
880
|
-
audience: {
|
|
881
|
-
board: "Velocity is throughput. When it moves, name the lever: volume, size, win rate, or cycle.",
|
|
882
|
-
ops: "(opps \xD7 avgDeal \xD7 winRate) / cycleDays. Diagnose the moved lever before you recommend a play."
|
|
883
|
-
},
|
|
884
|
-
aliases: ["velocity", "pipeline velocity", "throughput"]
|
|
885
|
-
},
|
|
886
|
-
// —— Sales efficiency ——
|
|
887
|
-
{
|
|
888
|
-
id: "win_rate",
|
|
889
|
-
kind: "saas",
|
|
890
|
-
label: "Win Rate",
|
|
891
|
-
group: "Sales Efficiency",
|
|
892
|
-
tagline: "Of decided deals, how often do we win?",
|
|
893
|
-
how_computed: "closed-won / (won + lost) \xD7 100.",
|
|
894
|
-
formula_lines: ["Win Rate = won / (won + lost) \xD7 100"],
|
|
895
|
-
meaning: "Board question: are we converting the pipeline we create? Priors: 25\u201335% SMB, 18\u201325% mid-market, 12\u201318% enterprise on qualified opportunities.",
|
|
896
|
-
expert_read: "A rising win rate on falling opportunity volume is qualification tightening, not improvement. Check the denominator.",
|
|
897
|
-
deepdive: [
|
|
898
|
-
"Required coverage is about 1 / win rate.",
|
|
899
|
-
"Cut by segment or source before company-wide coaching."
|
|
900
|
-
],
|
|
901
|
-
visual: {
|
|
902
|
-
kind: "split",
|
|
903
|
-
caption: "Example decided deals",
|
|
904
|
-
bars: [
|
|
905
|
-
{ label: "Won", value: 28, tone: "green" },
|
|
906
|
-
{ label: "Lost", value: 72, tone: "red" }
|
|
907
|
-
]
|
|
908
|
-
},
|
|
909
|
-
audience: {
|
|
910
|
-
board: "Win Rate is conversion of decided deals. A rising win rate with falling volume is often tighter qualification, not better selling.",
|
|
911
|
-
ops: "won/(won+lost). Check the denominator. Motion benchmarks set green and yellow bands."
|
|
912
|
-
},
|
|
913
|
-
aliases: ["close rate", "winrate", "win %"],
|
|
914
|
-
benchmarkHint: (motion) => pctBand("win_rate", motion)
|
|
915
|
-
},
|
|
916
|
-
{
|
|
917
|
-
id: "avg_deal_size",
|
|
918
|
-
kind: "saas",
|
|
919
|
-
label: "Avg Deal Size",
|
|
920
|
-
group: "Sales Efficiency",
|
|
921
|
-
tagline: "What does a typical win look like?",
|
|
922
|
-
how_computed: "Mean amount on closed-won opportunities.",
|
|
923
|
-
formula_lines: ["Avg Deal = mean(closed-won amount)"],
|
|
924
|
-
meaning: "Board question: are we selling the motion we think we are?",
|
|
925
|
-
expert_read: "Deal size drifting down while volume rises often means mix shift into a lower segment. That is not always a problem. It does change coverage math.",
|
|
926
|
-
deepdive: [
|
|
927
|
-
"Feeds Pipeline Velocity and LTV proxy.",
|
|
928
|
-
"Cut by segment. Averages hide bimodal motions."
|
|
929
|
-
],
|
|
930
|
-
visual: {
|
|
931
|
-
kind: "bars",
|
|
932
|
-
caption: "Example size mix by segment",
|
|
933
|
-
bars: [
|
|
934
|
-
{ label: "SMB", value: 30, tone: "neutral" },
|
|
935
|
-
{ label: "Mid-market", value: 55, tone: "accent" },
|
|
936
|
-
{ label: "Enterprise", value: 90, tone: "green" }
|
|
937
|
-
]
|
|
938
|
-
},
|
|
939
|
-
audience: {
|
|
940
|
-
board: "Avg Deal Size should match the motion you claim. Mix shift changes coverage and capacity math.",
|
|
941
|
-
ops: "Mean closed-won amount. Segment before you coach on size."
|
|
942
|
-
},
|
|
943
|
-
aliases: ["average deal size", "asp", "acv"]
|
|
944
|
-
},
|
|
945
|
-
{
|
|
946
|
-
id: "avg_sales_cycle",
|
|
947
|
-
kind: "saas",
|
|
948
|
-
label: "Avg Sales Cycle",
|
|
949
|
-
group: "Sales Efficiency",
|
|
950
|
-
tagline: "How long from create to close on wins?",
|
|
951
|
-
how_computed: "Mean days from created_at to close date on dated closed-won deals.",
|
|
952
|
-
formula_lines: ["Avg Cycle = mean(close_date \u2212 created_at) on dated wins"],
|
|
953
|
-
meaning: "Board question: is the cycle stretching? That is the earliest soft signal of deal-quality decay.",
|
|
954
|
-
expert_read: "Cycle stretching past the motion's norm is the earliest soft signal of deal-quality decay. Pair with Flow Rate stuck stages.",
|
|
955
|
-
deepdive: [
|
|
956
|
-
"Feeds Pipeline Velocity as the denominator.",
|
|
957
|
-
"Needs dated wins. Missing close dates understate or omit this metric."
|
|
958
|
-
],
|
|
959
|
-
visual: {
|
|
960
|
-
kind: "bars",
|
|
961
|
-
caption: "Example cycle versus motion norm",
|
|
962
|
-
bars: [
|
|
963
|
-
{ label: "Your cycle", value: 78, tone: "yellow" },
|
|
964
|
-
{ label: "Motion norm", value: 55, tone: "green" }
|
|
965
|
-
]
|
|
966
|
-
},
|
|
967
|
-
audience: {
|
|
968
|
-
board: "Cycle stretch is an early soft signal that quality or process is slipping. This appears before the miss shows in bookings.",
|
|
969
|
-
ops: "Mean create to close on dated wins. Investigate the stage that aged."
|
|
970
|
-
},
|
|
971
|
-
aliases: ["sales cycle", "cycle length", "time to close"]
|
|
972
|
-
},
|
|
973
|
-
{
|
|
974
|
-
id: "stage_conversion",
|
|
975
|
-
kind: "saas",
|
|
976
|
-
label: "Stage Conversion",
|
|
977
|
-
group: "Sales Efficiency",
|
|
978
|
-
tagline: "Where in the stage model does advancement collapse?",
|
|
979
|
-
how_computed: "From metadata.stage_history stage advances when present. Otherwise a win-rate proxy.",
|
|
980
|
-
formula_lines: [
|
|
981
|
-
"Preferred: advancement rates from stage_history",
|
|
982
|
-
"Fallback: win-rate proxy when history is missing"
|
|
983
|
-
],
|
|
984
|
-
meaning: "Board question: which single stage is starving everything downstream?",
|
|
985
|
-
expert_read: "Find the one stage where conversion collapses. That is the process problem. Everything downstream is starvation.",
|
|
986
|
-
deepdive: [
|
|
987
|
-
"Best with stage_history metadata. Otherwise treat this as a proxy.",
|
|
988
|
-
"Pairs with Flow Rate stage-age cuts."
|
|
989
|
-
],
|
|
990
|
-
visual: {
|
|
991
|
-
kind: "funnel",
|
|
992
|
-
caption: "Example: find the collapse",
|
|
993
|
-
funnel: [
|
|
994
|
-
{ label: "Stage 1\u21922", widthPct: 100 },
|
|
995
|
-
{ label: "Stage 2\u21923", widthPct: 72 },
|
|
996
|
-
{ label: "Stage 3\u21924", widthPct: 28 },
|
|
997
|
-
{ label: "Stage 4\u2192Close", widthPct: 18 }
|
|
998
|
-
]
|
|
999
|
-
},
|
|
1000
|
-
audience: {
|
|
1001
|
-
board: "Stage Conversion names the bottleneck stage. One collapse starves every stage after it.",
|
|
1002
|
-
ops: "Prefer stage_history advances. Fix the collapse stage before you coach downstream reps."
|
|
1003
|
-
},
|
|
1004
|
-
aliases: ["stage conversion", "stage advance", "conversion by stage"]
|
|
1005
|
-
},
|
|
1006
|
-
// —— Unit economics ——
|
|
1007
|
-
{
|
|
1008
|
-
id: "ltv_proxy",
|
|
1009
|
-
kind: "saas",
|
|
1010
|
-
label: "LTV (Proxy)",
|
|
1011
|
-
group: "Unit Economics",
|
|
1012
|
-
tagline: "Rough lifetime value from deal size and GRR.",
|
|
1013
|
-
how_computed: "avgDeal / ((100 \u2212 GRR) / 100) when GRR is below 100. This metric is unavailable when GRR is 100% or more, or missing.",
|
|
1014
|
-
formula_lines: [
|
|
1015
|
-
"LTV \u2248 avgDeal / churnRate",
|
|
1016
|
-
"churnRate = (100 \u2212 GRR) / 100 (requires GRR < 100)"
|
|
1017
|
-
],
|
|
1018
|
-
meaning: "Board question: what is a customer roughly worth over their life?",
|
|
1019
|
-
expert_read: "This is a proxy, not a cohort LTV. Use it for direction, not capital allocation.",
|
|
1020
|
-
deepdive: [
|
|
1021
|
-
"Unavailable when GRR is 100 or more, or missing.",
|
|
1022
|
-
"Pairs with CAC for LTV:CAC when spend data exists."
|
|
1023
|
-
],
|
|
1024
|
-
visual: {
|
|
1025
|
-
kind: "gauge",
|
|
1026
|
-
caption: "Example LTV proxy. Directional only.",
|
|
1027
|
-
gauge: 68
|
|
1028
|
-
},
|
|
1029
|
-
audience: {
|
|
1030
|
-
board: "LTV Proxy is directional from deal size and GRR. It is not a cohort LTV. Use it for orientation, not capital decisions.",
|
|
1031
|
-
ops: "avgDeal / ((100\u2212GRR)/100). Needs GRR below 100. Prefer cohort math when billing data arrives."
|
|
1032
|
-
},
|
|
1033
|
-
aliases: ["ltv", "lifetime value"]
|
|
1034
|
-
},
|
|
1035
|
-
{
|
|
1036
|
-
id: "cac",
|
|
1037
|
-
kind: "saas",
|
|
1038
|
-
label: "CAC",
|
|
1039
|
-
group: "Unit Economics",
|
|
1040
|
-
tagline: "Customer acquisition cost. This metric needs spend data.",
|
|
1041
|
-
how_computed: "This metric requires campaign or sales spend data. It is currently unavailable on CRM-only datasets.",
|
|
1042
|
-
formula_lines: ["CAC = sales & marketing spend / new customers", "(requires spend data \u2014 not in CRM-only exports)"],
|
|
1043
|
-
meaning: "Board question: what does a new logo cost to win?",
|
|
1044
|
-
expert_read: "Without spend, NTRP cannot invent CAC. Connect campaign spend or finance exports to unlock unit economics.",
|
|
1045
|
-
deepdive: [
|
|
1046
|
-
"Always unavailable on CRM-only demos. That is expected.",
|
|
1047
|
-
"Unlocks LTV:CAC, Payback, and Magic Number when spend lands."
|
|
1048
|
-
],
|
|
1049
|
-
visual: { kind: "none", caption: "Needs campaign spend or a finance export" },
|
|
1050
|
-
audience: {
|
|
1051
|
-
board: "CAC is locked until spend data is connected. CRM alone cannot price acquisition.",
|
|
1052
|
-
ops: "Bring campaign or S&M spend. Until then, unit-econ metrics stay unavailable by design."
|
|
1053
|
-
},
|
|
1054
|
-
aliases: ["customer acquisition cost", "acquisition cost"]
|
|
1055
|
-
},
|
|
1056
|
-
{
|
|
1057
|
-
id: "ltv_cac_ratio",
|
|
1058
|
-
kind: "saas",
|
|
1059
|
-
label: "LTV:CAC Ratio",
|
|
1060
|
-
group: "Unit Economics",
|
|
1061
|
-
tagline: "Does acquisition spend return enough value?",
|
|
1062
|
-
how_computed: "LTV proxy divided by CAC. Unavailable without spend (CAC).",
|
|
1063
|
-
formula_lines: ["LTV:CAC = LTV_proxy / CAC", "(requires CAC)"],
|
|
1064
|
-
meaning: "Board question: do we earn enough lifetime value per dollar spent to acquire?",
|
|
1065
|
-
expert_read: "In the efficiency era, boards weigh LTV:CAC and payback as heavily as growth. Classic rule of thumb is 3x or more. Motion and gross margin matter.",
|
|
1066
|
-
deepdive: ["Blocked on CAC. See LTV Proxy and CAC."],
|
|
1067
|
-
visual: { kind: "none", caption: "This metric needs CAC (spend data)" },
|
|
1068
|
-
audience: {
|
|
1069
|
-
board: "LTV:CAC is the acquisition ROI story. It is available once spend is connected.",
|
|
1070
|
-
ops: "LTV_proxy / CAC. Unlocks with spend import."
|
|
1071
|
-
},
|
|
1072
|
-
aliases: ["ltv cac", "ltv/cac", "ltv to cac"]
|
|
1073
|
-
},
|
|
1074
|
-
{
|
|
1075
|
-
id: "payback_months",
|
|
1076
|
-
kind: "saas",
|
|
1077
|
-
label: "Payback Months",
|
|
1078
|
-
group: "Unit Economics",
|
|
1079
|
-
tagline: "How many months to recover CAC?",
|
|
1080
|
-
how_computed: "This metric requires CAC and spend. Lower is better.",
|
|
1081
|
-
formula_lines: ["Payback \u2248 CAC / (monthly gross profit per customer)", "(requires spend data)"],
|
|
1082
|
-
meaning: "Board question: how fast does acquisition spend return? Efficiency-era prior: under 18 months is often healthy.",
|
|
1083
|
-
expert_read: "Boards now weigh payback (under 18 months) as heavily as growth in many motions.",
|
|
1084
|
-
deepdive: ["Blocked on CAC. Benchmarks exist per motion once data lands."],
|
|
1085
|
-
visual: { kind: "none", caption: "This metric needs CAC (spend data)" },
|
|
1086
|
-
audience: {
|
|
1087
|
-
board: "Payback is how fast CAC returns. Efficiency-era boards often want under 18 months.",
|
|
1088
|
-
ops: "Requires CAC. Motion green and yellow bands apply when available."
|
|
1089
|
-
},
|
|
1090
|
-
aliases: ["payback", "cac payback"],
|
|
1091
|
-
benchmarkHint: (motion) => monthsBand(motion)
|
|
1092
|
-
},
|
|
1093
|
-
{
|
|
1094
|
-
id: "magic_number",
|
|
1095
|
-
kind: "saas",
|
|
1096
|
-
label: "Magic Number",
|
|
1097
|
-
group: "Unit Economics",
|
|
1098
|
-
tagline: "Sales efficiency: net new ARR per sales dollar.",
|
|
1099
|
-
how_computed: "This metric requires sales spend. Classic form: net new ARR (quarter) / prior-quarter S&M spend.",
|
|
1100
|
-
formula_lines: [
|
|
1101
|
-
"Magic Number \u2248 Net New ARR(q) / S&M spend(q\u22121)",
|
|
1102
|
-
"(requires spend data)"
|
|
1103
|
-
],
|
|
1104
|
-
meaning: "Board question: how efficiently does sales spend produce net new ARR? Prior: above 0.75 is often healthy. Above 1 is strong.",
|
|
1105
|
-
expert_read: "In the efficiency era, a magic number above 0.75 is weighed alongside growth. Without spend, NTRP keeps this unavailable. NTRP does not invent it.",
|
|
1106
|
-
deepdive: ["Blocked on spend. Benchmarks per motion are ready when data lands."],
|
|
1107
|
-
visual: { kind: "none", caption: "This metric needs S&M spend data" },
|
|
1108
|
-
audience: {
|
|
1109
|
-
board: "Magic Number prices sales efficiency. It is available once S&M spend is connected.",
|
|
1110
|
-
ops: "Net new ARR / prior S&M. Motion benchmarks apply when spend lands."
|
|
1111
|
-
},
|
|
1112
|
-
aliases: ["sales magic number", "sales efficiency magic number"],
|
|
1113
|
-
benchmarkHint: (motion) => magicBand(motion)
|
|
1114
|
-
}
|
|
1115
|
-
];
|
|
1116
|
-
METRIC_DEFINITIONS = [...VITALS, ...SAAS];
|
|
1117
|
-
BY_ID = new Map(METRIC_DEFINITIONS.map((m) => [m.id, m]));
|
|
1118
|
-
ALIAS_INDEX = (() => {
|
|
1119
|
-
const idx = /* @__PURE__ */ new Map();
|
|
1120
|
-
for (const m of METRIC_DEFINITIONS) {
|
|
1121
|
-
idx.set(m.id.toLowerCase(), m.id);
|
|
1122
|
-
idx.set(m.label.toLowerCase(), m.id);
|
|
1123
|
-
for (const a of m.aliases ?? []) {
|
|
1124
|
-
idx.set(a.toLowerCase(), m.id);
|
|
1125
|
-
}
|
|
1126
|
-
}
|
|
1127
|
-
idx.set("signal-to-noise", "signal_to_noise");
|
|
1128
|
-
idx.set("signal:noise", "signal_to_noise");
|
|
1129
|
-
idx.set("flow-rate", "flow_rate");
|
|
1130
|
-
idx.set("drop-rate", "drop_rate");
|
|
1131
|
-
idx.set("thread-depth", "thread_depth");
|
|
1132
|
-
return idx;
|
|
1133
|
-
})();
|
|
1134
|
-
SAAS_METRIC_IDS = SAAS.map((m) => m.id);
|
|
1135
|
-
}
|
|
1136
|
-
});
|
|
1137
|
-
|
|
1138
|
-
// src/services/metric-explainers.ts
|
|
1139
|
-
var init_metric_explainers = __esm({
|
|
1140
|
-
"src/services/metric-explainers.ts"() {
|
|
1141
|
-
"use strict";
|
|
1142
|
-
init_metric_definitions();
|
|
1143
|
-
}
|
|
1144
|
-
});
|
|
1145
|
-
|
|
1146
|
-
// src/conversation/handoff-draft.ts
|
|
1147
|
-
function isShipIntent(input) {
|
|
1148
|
-
const line = input.trim();
|
|
1149
|
-
if (/\?\s*$/.test(line) || QUESTION_LEAD_RE.test(line)) return false;
|
|
1150
|
-
return SHIP_INTENT_RE.test(line);
|
|
1151
|
-
}
|
|
1152
|
-
var QUESTION_LEAD_RE, SHIP_INTENT_RE;
|
|
1153
|
-
var init_handoff_draft = __esm({
|
|
1154
|
-
"src/conversation/handoff-draft.ts"() {
|
|
1155
|
-
"use strict";
|
|
1156
|
-
init_profile();
|
|
1157
|
-
init_session_analysis();
|
|
1158
|
-
init_metric_explainers();
|
|
1159
|
-
QUESTION_LEAD_RE = /^\s*(what|why|how|when|where|who|which|is|are|was|were|do|does|did|explain|tell me|help me understand)\b/i;
|
|
1160
|
-
SHIP_INTENT_RE = /\b(ship|export|deliver|write[- ]?up|board memo|action plan|turn (this|it|that) into|(draft|create|make|build|prepare|generate|send)\s+(me\s+)?(a\s+|the\s+)?hand[- ]?off|hand[- ]?off\s+(prompt|doc|document|plan))\b/i;
|
|
1161
|
-
}
|
|
1162
|
-
});
|
|
1163
|
-
|
|
1164
|
-
// src/ai/llm/providers.ts
|
|
1165
|
-
var init_providers = __esm({
|
|
1166
|
-
"src/ai/llm/providers.ts"() {
|
|
1167
|
-
"use strict";
|
|
1168
|
-
init_store();
|
|
1169
|
-
}
|
|
1170
|
-
});
|
|
1171
|
-
|
|
1172
|
-
// src/config/llm-config.ts
|
|
1173
|
-
var init_llm_config = __esm({
|
|
1174
|
-
"src/config/llm-config.ts"() {
|
|
1175
|
-
"use strict";
|
|
1176
|
-
init_providers();
|
|
1177
|
-
init_store();
|
|
1178
|
-
}
|
|
1179
|
-
});
|
|
1180
|
-
|
|
1181
|
-
// src/ai/llm/gate.ts
|
|
1182
|
-
var init_gate = __esm({
|
|
1183
|
-
"src/ai/llm/gate.ts"() {
|
|
1184
|
-
"use strict";
|
|
1185
|
-
init_llm_config();
|
|
1186
|
-
}
|
|
1187
|
-
});
|
|
1188
|
-
|
|
1189
|
-
// src/ai/repl-api.ts
|
|
1190
|
-
var init_repl_api = __esm({
|
|
1191
|
-
"src/ai/repl-api.ts"() {
|
|
1192
|
-
"use strict";
|
|
1193
|
-
init_gate();
|
|
1194
|
-
}
|
|
1195
|
-
});
|
|
1196
|
-
|
|
1197
|
-
// src/cli/repl-globals.ts
|
|
1198
|
-
var init_repl_globals = __esm({
|
|
1199
|
-
"src/cli/repl-globals.ts"() {
|
|
1200
|
-
"use strict";
|
|
1201
|
-
}
|
|
1202
|
-
});
|
|
1203
|
-
|
|
1204
|
-
// src/cli/prompts.ts
|
|
1205
|
-
import { createInterface } from "readline/promises";
|
|
1206
|
-
import { clearLine, cursorTo } from "readline";
|
|
1207
|
-
import { StringDecoder } from "string_decoder";
|
|
1208
|
-
import chalk3 from "chalk";
|
|
1209
|
-
var init_prompts = __esm({
|
|
1210
|
-
"src/cli/prompts.ts"() {
|
|
1211
|
-
"use strict";
|
|
1212
|
-
init_repl_globals();
|
|
1213
|
-
init_theme();
|
|
1214
|
-
}
|
|
1215
|
-
});
|
|
1216
|
-
|
|
1217
|
-
// src/pipeline/segments.ts
|
|
1218
|
-
var init_segments = __esm({
|
|
1219
|
-
"src/pipeline/segments.ts"() {
|
|
1220
|
-
"use strict";
|
|
1221
|
-
init_connection();
|
|
1222
|
-
init_queries();
|
|
1223
|
-
}
|
|
1224
|
-
});
|
|
1225
|
-
|
|
1226
|
-
// src/baselines/defaults.ts
|
|
1227
|
-
var init_defaults = __esm({
|
|
1228
|
-
"src/baselines/defaults.ts"() {
|
|
1229
|
-
"use strict";
|
|
1230
|
-
}
|
|
1231
|
-
});
|
|
1232
|
-
|
|
1233
|
-
// src/baselines/profile-presets.ts
|
|
1234
|
-
var init_profile_presets = __esm({
|
|
1235
|
-
"src/baselines/profile-presets.ts"() {
|
|
1236
|
-
"use strict";
|
|
1237
|
-
}
|
|
1238
|
-
});
|
|
1239
|
-
|
|
1240
|
-
// src/baselines/resolve.ts
|
|
1241
|
-
var init_resolve = __esm({
|
|
1242
|
-
"src/baselines/resolve.ts"() {
|
|
1243
|
-
"use strict";
|
|
1244
|
-
init_defaults();
|
|
1245
|
-
init_profile_presets();
|
|
1246
|
-
}
|
|
1247
|
-
});
|
|
1248
|
-
|
|
1249
|
-
// src/vitals/shared.ts
|
|
1250
|
-
var init_shared = __esm({
|
|
1251
|
-
"src/vitals/shared.ts"() {
|
|
1252
|
-
"use strict";
|
|
1253
|
-
}
|
|
1254
|
-
});
|
|
1255
|
-
|
|
1256
|
-
// src/vitals/freshness.ts
|
|
1257
|
-
var init_freshness = __esm({
|
|
1258
|
-
"src/vitals/freshness.ts"() {
|
|
1259
|
-
"use strict";
|
|
1260
|
-
init_defaults();
|
|
1261
|
-
init_shared();
|
|
1262
|
-
}
|
|
1263
|
-
});
|
|
1264
|
-
|
|
1265
|
-
// src/vitals/flow-rate.ts
|
|
1266
|
-
var init_flow_rate = __esm({
|
|
1267
|
-
"src/vitals/flow-rate.ts"() {
|
|
1268
|
-
"use strict";
|
|
1269
|
-
init_defaults();
|
|
1270
|
-
init_shared();
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
|
|
1274
|
-
// src/vitals/drop-rate.ts
|
|
1275
|
-
var init_drop_rate = __esm({
|
|
1276
|
-
"src/vitals/drop-rate.ts"() {
|
|
1277
|
-
"use strict";
|
|
1278
|
-
init_defaults();
|
|
1279
|
-
init_shared();
|
|
1280
|
-
}
|
|
1281
|
-
});
|
|
1282
|
-
|
|
1283
|
-
// src/vitals/signal-to-noise.ts
|
|
1284
|
-
var init_signal_to_noise = __esm({
|
|
1285
|
-
"src/vitals/signal-to-noise.ts"() {
|
|
1286
|
-
"use strict";
|
|
1287
|
-
init_defaults();
|
|
1288
|
-
init_store();
|
|
1289
|
-
init_shared();
|
|
1290
|
-
}
|
|
1291
|
-
});
|
|
1292
|
-
|
|
1293
|
-
// src/vitals/thread-depth.ts
|
|
1294
|
-
var init_thread_depth = __esm({
|
|
1295
|
-
"src/vitals/thread-depth.ts"() {
|
|
1296
|
-
"use strict";
|
|
1297
|
-
init_defaults();
|
|
1298
|
-
init_shared();
|
|
1299
|
-
}
|
|
1300
|
-
});
|
|
1301
|
-
|
|
1302
|
-
// src/vitals/health-score.ts
|
|
1303
|
-
var LAYERS;
|
|
1304
|
-
var init_health_score = __esm({
|
|
1305
|
-
"src/vitals/health-score.ts"() {
|
|
1306
|
-
"use strict";
|
|
1307
|
-
init_segments();
|
|
1308
|
-
init_resolve();
|
|
1309
|
-
init_freshness();
|
|
1310
|
-
init_flow_rate();
|
|
1311
|
-
init_drop_rate();
|
|
1312
|
-
init_signal_to_noise();
|
|
1313
|
-
init_thread_depth();
|
|
1314
|
-
init_connection();
|
|
1315
|
-
init_queries();
|
|
1316
|
-
LAYERS = [
|
|
1317
|
-
{ layer: 1, signs: ["freshness"] },
|
|
1318
|
-
{ layer: 2, signs: ["flow_rate", "drop_rate"] },
|
|
1319
|
-
{ layer: 3, signs: ["signal_to_noise"] },
|
|
1320
|
-
{ layer: 4, signs: ["thread_depth"] }
|
|
1321
|
-
];
|
|
1322
|
-
}
|
|
1323
|
-
});
|
|
1324
|
-
|
|
1325
|
-
// src/pipeline/divergence.ts
|
|
1326
|
-
var init_divergence = __esm({
|
|
1327
|
-
"src/pipeline/divergence.ts"() {
|
|
1328
|
-
"use strict";
|
|
1329
|
-
}
|
|
1330
|
-
});
|
|
1331
|
-
|
|
1332
|
-
// src/db/schema.ts
|
|
1333
|
-
var init_schema = __esm({
|
|
1334
|
-
"src/db/schema.ts"() {
|
|
1335
|
-
"use strict";
|
|
1336
|
-
init_connection();
|
|
1337
|
-
}
|
|
1338
|
-
});
|
|
1339
|
-
|
|
1340
|
-
// src/metrics/classify-source.ts
|
|
1341
|
-
var init_classify_source = __esm({
|
|
1342
|
-
"src/metrics/classify-source.ts"() {
|
|
1343
|
-
"use strict";
|
|
1344
|
-
}
|
|
1345
|
-
});
|
|
1346
|
-
|
|
1347
|
-
// src/metrics/helpers.ts
|
|
1348
|
-
var init_helpers = __esm({
|
|
1349
|
-
"src/metrics/helpers.ts"() {
|
|
1350
|
-
"use strict";
|
|
1351
|
-
init_metrics_benchmarks();
|
|
1352
|
-
}
|
|
1353
|
-
});
|
|
1354
|
-
|
|
1355
|
-
// src/metrics/coverage.ts
|
|
1356
|
-
var init_coverage = __esm({
|
|
1357
|
-
"src/metrics/coverage.ts"() {
|
|
1358
|
-
"use strict";
|
|
1359
|
-
init_helpers();
|
|
1360
|
-
init_classify_source();
|
|
1361
|
-
}
|
|
1362
|
-
});
|
|
1363
|
-
|
|
1364
|
-
// src/metrics/context.ts
|
|
1365
|
-
var init_context3 = __esm({
|
|
1366
|
-
"src/metrics/context.ts"() {
|
|
1367
|
-
"use strict";
|
|
1368
|
-
init_metrics_benchmarks();
|
|
1369
|
-
init_profile();
|
|
1370
|
-
init_health_score();
|
|
1371
|
-
init_queries();
|
|
1372
|
-
init_classify_source();
|
|
1373
|
-
init_coverage();
|
|
1374
|
-
}
|
|
1375
|
-
});
|
|
1376
|
-
|
|
1377
|
-
// src/metrics/revenue.ts
|
|
1378
|
-
var init_revenue = __esm({
|
|
1379
|
-
"src/metrics/revenue.ts"() {
|
|
1380
|
-
"use strict";
|
|
1381
|
-
init_helpers();
|
|
1382
|
-
init_formatters();
|
|
1383
|
-
}
|
|
1384
|
-
});
|
|
1385
|
-
|
|
1386
|
-
// src/metrics/retention.ts
|
|
1387
|
-
var init_retention = __esm({
|
|
1388
|
-
"src/metrics/retention.ts"() {
|
|
1389
|
-
"use strict";
|
|
1390
|
-
init_revenue();
|
|
1391
|
-
init_helpers();
|
|
1392
|
-
init_metrics_benchmarks();
|
|
1393
|
-
}
|
|
1394
|
-
});
|
|
1395
|
-
|
|
1396
|
-
// src/metrics/pipeline.ts
|
|
1397
|
-
var init_pipeline = __esm({
|
|
1398
|
-
"src/metrics/pipeline.ts"() {
|
|
1399
|
-
"use strict";
|
|
1400
|
-
init_helpers();
|
|
1401
|
-
init_formatters();
|
|
1402
|
-
init_metrics_benchmarks();
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
|
|
1406
|
-
// src/metrics/sales-efficiency.ts
|
|
1407
|
-
var init_sales_efficiency = __esm({
|
|
1408
|
-
"src/metrics/sales-efficiency.ts"() {
|
|
1409
|
-
"use strict";
|
|
1410
|
-
init_helpers();
|
|
1411
|
-
init_formatters();
|
|
1412
|
-
init_metrics_benchmarks();
|
|
1413
|
-
}
|
|
1414
|
-
});
|
|
1415
|
-
|
|
1416
|
-
// src/metrics/unit-economics.ts
|
|
1417
|
-
var init_unit_economics = __esm({
|
|
1418
|
-
"src/metrics/unit-economics.ts"() {
|
|
1419
|
-
"use strict";
|
|
1420
|
-
init_formatters();
|
|
1421
|
-
}
|
|
1422
|
-
});
|
|
1423
|
-
|
|
1424
|
-
// src/metrics/confidence.ts
|
|
1425
|
-
var init_confidence = __esm({
|
|
1426
|
-
"src/metrics/confidence.ts"() {
|
|
1427
|
-
"use strict";
|
|
1428
|
-
}
|
|
1429
|
-
});
|
|
1430
|
-
|
|
1431
|
-
// src/metrics/periods.ts
|
|
1432
|
-
var init_periods = __esm({
|
|
1433
|
-
"src/metrics/periods.ts"() {
|
|
1434
|
-
"use strict";
|
|
1435
|
-
init_helpers();
|
|
1436
|
-
}
|
|
1437
|
-
});
|
|
1438
|
-
|
|
1439
|
-
// src/metrics/compute.ts
|
|
1440
|
-
var init_compute = __esm({
|
|
1441
|
-
"src/metrics/compute.ts"() {
|
|
1442
|
-
"use strict";
|
|
1443
|
-
init_segments();
|
|
1444
|
-
init_queries();
|
|
1445
|
-
init_context3();
|
|
1446
|
-
init_revenue();
|
|
1447
|
-
init_retention();
|
|
1448
|
-
init_pipeline();
|
|
1449
|
-
init_sales_efficiency();
|
|
1450
|
-
init_unit_economics();
|
|
1451
|
-
init_confidence();
|
|
1452
|
-
init_periods();
|
|
1453
|
-
init_context3();
|
|
1454
|
-
}
|
|
1455
|
-
});
|
|
1456
|
-
|
|
1457
|
-
// src/metrics/insights.ts
|
|
1458
|
-
var init_insights = __esm({
|
|
1459
|
-
"src/metrics/insights.ts"() {
|
|
1460
|
-
"use strict";
|
|
1461
|
-
init_coverage();
|
|
1462
|
-
}
|
|
1463
|
-
});
|
|
1464
|
-
|
|
1465
|
-
// src/ai/explore-mode.ts
|
|
1466
|
-
var init_explore_mode = __esm({
|
|
1467
|
-
"src/ai/explore-mode.ts"() {
|
|
1468
|
-
"use strict";
|
|
1469
|
-
init_context2();
|
|
1470
|
-
}
|
|
1471
|
-
});
|
|
1472
|
-
|
|
1473
|
-
// src/ai/llm/models-cache.ts
|
|
1474
|
-
var CACHE_TTL_MS;
|
|
1475
|
-
var init_models_cache = __esm({
|
|
1476
|
-
"src/ai/llm/models-cache.ts"() {
|
|
1477
|
-
"use strict";
|
|
1478
|
-
init_store();
|
|
1479
|
-
CACHE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
1480
|
-
}
|
|
1481
|
-
});
|
|
1482
|
-
|
|
1483
|
-
// src/ai/llm/catalog.ts
|
|
1484
|
-
var ENTRIES, byId;
|
|
1485
|
-
var init_catalog = __esm({
|
|
1486
|
-
"src/ai/llm/catalog.ts"() {
|
|
1487
|
-
"use strict";
|
|
1488
|
-
init_models_cache();
|
|
1489
|
-
ENTRIES = [
|
|
1490
|
-
{
|
|
1491
|
-
id: "claude-opus-4-6",
|
|
1492
|
-
provider: "anthropic",
|
|
1493
|
-
tier: "high",
|
|
1494
|
-
status: "active",
|
|
1495
|
-
successor_id: null,
|
|
1496
|
-
supports_tools: true,
|
|
1497
|
-
max_context_tokens: 2e5,
|
|
1498
|
-
display_name: "Claude Opus 4.6",
|
|
1499
|
-
relative_cost: 3
|
|
1500
|
-
},
|
|
1501
|
-
{
|
|
1502
|
-
id: "claude-sonnet-4-5-20250929",
|
|
1503
|
-
provider: "anthropic",
|
|
1504
|
-
tier: "medium",
|
|
1505
|
-
status: "active",
|
|
1506
|
-
successor_id: null,
|
|
1507
|
-
supports_tools: true,
|
|
1508
|
-
max_context_tokens: 2e5,
|
|
1509
|
-
display_name: "Claude Sonnet 4.5",
|
|
1510
|
-
relative_cost: 2
|
|
1511
|
-
},
|
|
1512
|
-
{
|
|
1513
|
-
id: "claude-haiku-4-5-20251001",
|
|
1514
|
-
provider: "anthropic",
|
|
1515
|
-
tier: "low",
|
|
1516
|
-
status: "active",
|
|
1517
|
-
successor_id: null,
|
|
1518
|
-
supports_tools: true,
|
|
1519
|
-
max_context_tokens: 2e5,
|
|
1520
|
-
display_name: "Claude Haiku 4.5",
|
|
1521
|
-
relative_cost: 1
|
|
1522
|
-
},
|
|
1523
|
-
{
|
|
1524
|
-
id: "gpt-4.1",
|
|
1525
|
-
provider: "openai",
|
|
1526
|
-
tier: "high",
|
|
1527
|
-
status: "active",
|
|
1528
|
-
successor_id: null,
|
|
1529
|
-
supports_tools: true,
|
|
1530
|
-
max_context_tokens: 1047576,
|
|
1531
|
-
display_name: "GPT-4.1",
|
|
1532
|
-
relative_cost: 3
|
|
1533
|
-
},
|
|
1534
|
-
{
|
|
1535
|
-
id: "gpt-4.1-mini",
|
|
1536
|
-
provider: "openai",
|
|
1537
|
-
tier: "medium",
|
|
1538
|
-
status: "active",
|
|
1539
|
-
successor_id: null,
|
|
1540
|
-
supports_tools: true,
|
|
1541
|
-
max_context_tokens: 1047576,
|
|
1542
|
-
display_name: "GPT-4.1 Mini",
|
|
1543
|
-
relative_cost: 2
|
|
1544
|
-
},
|
|
1545
|
-
{
|
|
1546
|
-
id: "gpt-4.1-nano",
|
|
1547
|
-
provider: "openai",
|
|
1548
|
-
tier: "low",
|
|
1549
|
-
status: "active",
|
|
1550
|
-
successor_id: null,
|
|
1551
|
-
supports_tools: true,
|
|
1552
|
-
max_context_tokens: 1047576,
|
|
1553
|
-
display_name: "GPT-4.1 Nano",
|
|
1554
|
-
relative_cost: 1
|
|
1555
|
-
}
|
|
1556
|
-
];
|
|
1557
|
-
byId = new Map(ENTRIES.map((e) => [e.id, e]));
|
|
1558
|
-
}
|
|
1559
|
-
});
|
|
1560
|
-
|
|
1561
|
-
// src/ai/llm/surfaces.ts
|
|
1562
|
-
var init_surfaces = __esm({
|
|
1563
|
-
"src/ai/llm/surfaces.ts"() {
|
|
1564
|
-
"use strict";
|
|
1565
|
-
}
|
|
1566
|
-
});
|
|
1567
|
-
|
|
1568
|
-
// src/ai/llm/session-state.ts
|
|
1569
|
-
var init_session_state = __esm({
|
|
1570
|
-
"src/ai/llm/session-state.ts"() {
|
|
1571
|
-
"use strict";
|
|
1572
|
-
init_llm_config();
|
|
1573
|
-
init_catalog();
|
|
1574
|
-
init_surfaces();
|
|
1575
|
-
}
|
|
1576
|
-
});
|
|
1577
|
-
|
|
1578
|
-
// src/conversation/recommended-action.ts
|
|
1579
|
-
var init_recommended_action = __esm({
|
|
1580
|
-
"src/conversation/recommended-action.ts"() {
|
|
1581
|
-
"use strict";
|
|
1582
|
-
init_repl_api();
|
|
1583
|
-
init_phase();
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
|
|
1587
|
-
// src/conversation/phase.ts
|
|
1588
|
-
import chalk4 from "chalk";
|
|
1589
|
-
function sessionHasData(ctx) {
|
|
1590
|
-
const counts = ctx.dataset?.counts ?? {};
|
|
1591
|
-
return Object.values(counts).some((n) => (n ?? 0) > 0);
|
|
1592
|
-
}
|
|
1593
|
-
function resolveConversationPhase(ctx) {
|
|
1594
|
-
if (ctx.deliverIntent) return "deliver";
|
|
1595
|
-
if (ctx.computeInProgress) return "compute";
|
|
1596
|
-
if (ctx.strategistState && ctx.strategistState.step !== "awaiting_analysis" && ctx.strategistState.step !== "awaiting_connect") {
|
|
1597
|
-
return "strategize";
|
|
1598
|
-
}
|
|
1599
|
-
if (isAnalysisReady(ctx)) return "explore";
|
|
1600
|
-
const scope = ctx.scope;
|
|
1601
|
-
if (scope?.confirmed_at) {
|
|
1602
|
-
if (!sessionHasData(ctx)) return "awaiting_data";
|
|
1603
|
-
if (ctx.stage !== "analyzed") return "awaiting_data";
|
|
1604
|
-
}
|
|
1605
|
-
if (scope?.intent_summary && !scope.confirmed_at) return "scope";
|
|
1606
|
-
return "orient";
|
|
1607
|
-
}
|
|
1608
|
-
var init_phase = __esm({
|
|
1609
|
-
"src/conversation/phase.ts"() {
|
|
1610
|
-
"use strict";
|
|
1611
|
-
init_context2();
|
|
1612
|
-
init_repl_api();
|
|
1613
|
-
init_explore_mode();
|
|
1614
|
-
init_session_state();
|
|
1615
|
-
init_theme();
|
|
1616
|
-
init_recommended_action();
|
|
1617
|
-
}
|
|
1618
|
-
});
|
|
1619
|
-
|
|
1620
|
-
// src/conversation/gap-audit.ts
|
|
1621
|
-
var init_gap_audit = __esm({
|
|
1622
|
-
"src/conversation/gap-audit.ts"() {
|
|
1623
|
-
"use strict";
|
|
1624
|
-
init_connection();
|
|
1625
|
-
init_queries();
|
|
1626
|
-
init_profile();
|
|
1627
|
-
init_compute();
|
|
1628
|
-
init_insights();
|
|
1629
|
-
init_phase();
|
|
1630
|
-
}
|
|
1631
|
-
});
|
|
1632
|
-
|
|
1633
|
-
// src/strategies/library.ts
|
|
1634
|
-
import { writeFileSync as writeFileSync8 } from "fs";
|
|
1635
|
-
import { join as join8 } from "path";
|
|
1636
|
-
import { stringify as stringifyYaml } from "yaml";
|
|
1637
|
-
var init_library = __esm({
|
|
1638
|
-
"src/strategies/library.ts"() {
|
|
1639
|
-
"use strict";
|
|
1640
|
-
init_store();
|
|
1641
|
-
}
|
|
1642
|
-
});
|
|
1643
|
-
|
|
1644
|
-
// src/io/types.ts
|
|
1645
|
-
var init_types = __esm({
|
|
1646
|
-
"src/io/types.ts"() {
|
|
1647
|
-
"use strict";
|
|
1648
|
-
}
|
|
1649
|
-
});
|
|
1650
|
-
|
|
1651
|
-
// src/io/errors.ts
|
|
1652
|
-
var init_errors = __esm({
|
|
1653
|
-
"src/io/errors.ts"() {
|
|
1654
|
-
"use strict";
|
|
1655
|
-
init_types();
|
|
1656
|
-
}
|
|
1657
|
-
});
|
|
1658
|
-
|
|
1659
|
-
// src/services/strategist.ts
|
|
1660
|
-
import { createHash } from "crypto";
|
|
1661
|
-
var init_strategist = __esm({
|
|
1662
|
-
"src/services/strategist.ts"() {
|
|
1663
|
-
"use strict";
|
|
1664
|
-
init_schema();
|
|
1665
|
-
init_queries();
|
|
1666
|
-
init_health_score();
|
|
1667
|
-
init_divergence();
|
|
1668
|
-
init_gap_audit();
|
|
1669
|
-
init_library();
|
|
1670
|
-
init_errors();
|
|
1671
|
-
init_types();
|
|
1672
|
-
init_formatters();
|
|
1673
|
-
init_formatters();
|
|
1674
|
-
}
|
|
1675
|
-
});
|
|
1676
|
-
|
|
1677
|
-
// src/ai/llm/types.ts
|
|
1678
|
-
var init_types2 = __esm({
|
|
1679
|
-
"src/ai/llm/types.ts"() {
|
|
1680
|
-
"use strict";
|
|
1681
|
-
}
|
|
1682
|
-
});
|
|
1683
|
-
|
|
1684
|
-
// src/config/install.ts
|
|
1685
|
-
import { randomUUID as randomUUID3 } from "crypto";
|
|
1686
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync6, unlinkSync, writeFileSync as writeFileSync9 } from "fs";
|
|
1687
|
-
import { join as join9 } from "path";
|
|
1688
|
-
var init_install = __esm({
|
|
1689
|
-
"src/config/install.ts"() {
|
|
1690
|
-
"use strict";
|
|
1691
|
-
init_store();
|
|
1692
|
-
}
|
|
1693
|
-
});
|
|
1694
|
-
|
|
1695
|
-
// src/config/progress-migrate.ts
|
|
1696
|
-
import { existsSync as existsSync7, readFileSync as readFileSync7, renameSync as renameSync2, writeFileSync as writeFileSync10 } from "fs";
|
|
1697
|
-
import { join as join10 } from "path";
|
|
1698
|
-
var init_progress_migrate = __esm({
|
|
1699
|
-
"src/config/progress-migrate.ts"() {
|
|
1700
|
-
"use strict";
|
|
1701
|
-
init_store();
|
|
1702
|
-
}
|
|
1703
|
-
});
|
|
1704
|
-
|
|
1705
|
-
// src/whimsy/usage-backfill.ts
|
|
1706
|
-
var init_usage_backfill = __esm({
|
|
1707
|
-
"src/whimsy/usage-backfill.ts"() {
|
|
1708
|
-
"use strict";
|
|
1709
|
-
}
|
|
1710
|
-
});
|
|
1711
|
-
|
|
1712
|
-
// src/config/progress.ts
|
|
1713
|
-
import { existsSync as existsSync8, mkdirSync as mkdirSync8, readFileSync as readFileSync8, unlinkSync as unlinkSync2, writeFileSync as writeFileSync11 } from "fs";
|
|
1714
|
-
import { join as join11 } from "path";
|
|
1715
|
-
var init_progress = __esm({
|
|
1716
|
-
"src/config/progress.ts"() {
|
|
1717
|
-
"use strict";
|
|
1718
|
-
init_install();
|
|
1719
|
-
init_progress_migrate();
|
|
1720
|
-
init_store();
|
|
1721
|
-
init_usage_backfill();
|
|
1722
|
-
}
|
|
1723
|
-
});
|
|
1724
|
-
|
|
1725
|
-
// src/whimsy/usage-stats.ts
|
|
1726
|
-
var init_usage_stats = __esm({
|
|
1727
|
-
"src/whimsy/usage-stats.ts"() {
|
|
1728
|
-
"use strict";
|
|
1729
|
-
init_progress();
|
|
1730
|
-
}
|
|
1731
|
-
});
|
|
1732
|
-
|
|
1733
|
-
// src/ai/llm/errors.ts
|
|
1734
|
-
var init_errors2 = __esm({
|
|
1735
|
-
"src/ai/llm/errors.ts"() {
|
|
1736
|
-
"use strict";
|
|
1737
|
-
init_types2();
|
|
1738
|
-
}
|
|
1739
|
-
});
|
|
1740
|
-
|
|
1741
|
-
// src/ai/llm/adapters/anthropic.ts
|
|
1742
|
-
import Anthropic from "@anthropic-ai/sdk";
|
|
1743
|
-
var init_anthropic = __esm({
|
|
1744
|
-
"src/ai/llm/adapters/anthropic.ts"() {
|
|
1745
|
-
"use strict";
|
|
1746
|
-
init_errors2();
|
|
1747
|
-
init_types2();
|
|
1748
|
-
}
|
|
1749
|
-
});
|
|
1750
|
-
|
|
1751
|
-
// src/ai/llm/adapters/openai-compat.ts
|
|
1752
|
-
import OpenAI from "openai";
|
|
1753
|
-
var init_openai_compat = __esm({
|
|
1754
|
-
"src/ai/llm/adapters/openai-compat.ts"() {
|
|
1755
|
-
"use strict";
|
|
1756
|
-
init_errors2();
|
|
1757
|
-
init_types2();
|
|
1758
|
-
}
|
|
1759
|
-
});
|
|
1760
|
-
|
|
1761
|
-
// src/ai/llm/http.ts
|
|
1762
|
-
var init_http = __esm({
|
|
1763
|
-
"src/ai/llm/http.ts"() {
|
|
1764
|
-
"use strict";
|
|
1765
|
-
}
|
|
1766
|
-
});
|
|
1767
|
-
|
|
1768
|
-
// src/ai/llm/ranking.ts
|
|
1769
|
-
var init_ranking = __esm({
|
|
1770
|
-
"src/ai/llm/ranking.ts"() {
|
|
1771
|
-
"use strict";
|
|
1772
|
-
}
|
|
1773
|
-
});
|
|
1774
|
-
|
|
1775
|
-
// src/ai/llm/discovery.ts
|
|
1776
|
-
var init_discovery = __esm({
|
|
1777
|
-
"src/ai/llm/discovery.ts"() {
|
|
1778
|
-
"use strict";
|
|
1779
|
-
init_llm_config();
|
|
1780
|
-
init_http();
|
|
1781
|
-
init_models_cache();
|
|
1782
|
-
init_providers();
|
|
1783
|
-
init_ranking();
|
|
1784
|
-
}
|
|
1785
|
-
});
|
|
1786
|
-
|
|
1787
|
-
// src/ai/llm/heal.ts
|
|
1788
|
-
var init_heal = __esm({
|
|
1789
|
-
"src/ai/llm/heal.ts"() {
|
|
1790
|
-
"use strict";
|
|
1791
|
-
init_store();
|
|
1792
|
-
init_discovery();
|
|
1793
|
-
init_models_cache();
|
|
1794
|
-
}
|
|
1795
|
-
});
|
|
1796
|
-
|
|
1797
|
-
// src/ai/llm/resolver.ts
|
|
1798
|
-
var init_resolver = __esm({
|
|
1799
|
-
"src/ai/llm/resolver.ts"() {
|
|
1800
|
-
"use strict";
|
|
1801
|
-
init_llm_config();
|
|
1802
|
-
init_catalog();
|
|
1803
|
-
init_session_state();
|
|
1804
|
-
}
|
|
1805
|
-
});
|
|
1806
|
-
|
|
1807
|
-
// src/ai/pseudonymize.ts
|
|
1808
|
-
import { createHmac, randomBytes } from "crypto";
|
|
1809
|
-
import { existsSync as existsSync9, mkdirSync as mkdirSync9, readFileSync as readFileSync9, rmSync as rmSync4, chmodSync as chmodSync2 } from "fs";
|
|
1810
|
-
import { join as join12 } from "path";
|
|
1811
|
-
var init_pseudonymize = __esm({
|
|
1812
|
-
"src/ai/pseudonymize.ts"() {
|
|
1813
|
-
"use strict";
|
|
1814
|
-
init_store();
|
|
1815
|
-
}
|
|
1816
|
-
});
|
|
1817
|
-
|
|
1818
|
-
// src/ai/lexicon-seed.ts
|
|
1819
|
-
import { existsSync as existsSync10 } from "fs";
|
|
1820
|
-
var init_lexicon_seed = __esm({
|
|
1821
|
-
"src/ai/lexicon-seed.ts"() {
|
|
1822
|
-
"use strict";
|
|
1823
|
-
init_profile();
|
|
1824
|
-
init_connection();
|
|
1825
|
-
init_pseudonymize();
|
|
1826
|
-
}
|
|
1827
|
-
});
|
|
1828
|
-
|
|
1829
|
-
// src/ai/llm/failover.ts
|
|
1830
|
-
var init_failover = __esm({
|
|
1831
|
-
"src/ai/llm/failover.ts"() {
|
|
1832
|
-
"use strict";
|
|
1833
|
-
init_usage_stats();
|
|
1834
|
-
init_anthropic();
|
|
1835
|
-
init_openai_compat();
|
|
1836
|
-
init_catalog();
|
|
1837
|
-
init_discovery();
|
|
1838
|
-
init_errors2();
|
|
1839
|
-
init_heal();
|
|
1840
|
-
init_models_cache();
|
|
1841
|
-
init_providers();
|
|
1842
|
-
init_types2();
|
|
1843
|
-
init_resolver();
|
|
1844
|
-
init_pseudonymize();
|
|
1845
|
-
init_lexicon_seed();
|
|
1846
|
-
}
|
|
1847
|
-
});
|
|
1848
|
-
|
|
1849
|
-
// src/ai/privacy.ts
|
|
1850
|
-
import { homedir as homedir5 } from "os";
|
|
1851
|
-
import { join as join13 } from "path";
|
|
1852
|
-
var AUDIT_DIR;
|
|
1853
|
-
var init_privacy = __esm({
|
|
1854
|
-
"src/ai/privacy.ts"() {
|
|
1855
|
-
"use strict";
|
|
1856
|
-
init_terminal_capture();
|
|
1857
|
-
AUDIT_DIR = join13(homedir5(), ".ntrp", "audit");
|
|
1858
|
-
}
|
|
1859
|
-
});
|
|
1860
|
-
|
|
1861
|
-
// src/ai/web-search.ts
|
|
1862
|
-
var init_web_search = __esm({
|
|
1863
|
-
"src/ai/web-search.ts"() {
|
|
1864
|
-
"use strict";
|
|
1865
|
-
init_store();
|
|
1866
|
-
init_privacy();
|
|
1867
|
-
}
|
|
1868
|
-
});
|
|
1869
|
-
|
|
1870
|
-
// src/ai/tool-schemas.ts
|
|
1871
|
-
var init_tool_schemas = __esm({
|
|
1872
|
-
"src/ai/tool-schemas.ts"() {
|
|
1873
|
-
"use strict";
|
|
1874
|
-
init_web_search();
|
|
1875
|
-
}
|
|
1876
|
-
});
|
|
1877
|
-
|
|
1878
|
-
// src/ai/untrusted.ts
|
|
1879
|
-
var UNTRUSTED_MARKER_NAME, UNTRUSTED_MARKER_END_NAME, MARKER_SPOOF_PATTERN;
|
|
1880
|
-
var init_untrusted = __esm({
|
|
1881
|
-
"src/ai/untrusted.ts"() {
|
|
1882
|
-
"use strict";
|
|
1883
|
-
UNTRUSTED_MARKER_NAME = "EXTERNAL_UNTRUSTED_CONTENT";
|
|
1884
|
-
UNTRUSTED_MARKER_END_NAME = "END_EXTERNAL_UNTRUSTED_CONTENT";
|
|
1885
|
-
MARKER_SPOOF_PATTERN = new RegExp(
|
|
1886
|
-
`<{2,}\\s*/?\\s*(?:${UNTRUSTED_MARKER_NAME}|${UNTRUSTED_MARKER_END_NAME})[^>]*>{2,}`,
|
|
1887
|
-
"gi"
|
|
1888
|
-
);
|
|
1889
|
-
}
|
|
1890
|
-
});
|
|
1891
|
-
|
|
1892
|
-
// src/ai/tool-arg-validate.ts
|
|
1893
|
-
var init_tool_arg_validate = __esm({
|
|
1894
|
-
"src/ai/tool-arg-validate.ts"() {
|
|
1895
|
-
"use strict";
|
|
1896
|
-
}
|
|
1897
|
-
});
|
|
1898
|
-
|
|
1899
|
-
// src/ai/tool-handlers.ts
|
|
1900
|
-
var init_tool_handlers = __esm({
|
|
1901
|
-
"src/ai/tool-handlers.ts"() {
|
|
1902
|
-
"use strict";
|
|
1903
|
-
init_connection();
|
|
1904
|
-
init_privacy();
|
|
1905
|
-
init_web_search();
|
|
1906
|
-
init_untrusted();
|
|
1907
|
-
init_tool_schemas();
|
|
1908
|
-
init_tool_arg_validate();
|
|
1909
|
-
}
|
|
1910
|
-
});
|
|
1911
|
-
|
|
1912
|
-
// src/ai/loop-guard.ts
|
|
1913
|
-
var init_loop_guard = __esm({
|
|
1914
|
-
"src/ai/loop-guard.ts"() {
|
|
1915
|
-
"use strict";
|
|
1916
|
-
}
|
|
1917
|
-
});
|
|
1918
|
-
|
|
1919
|
-
// src/ai/thread.ts
|
|
1920
|
-
var PRUNED_TOOL_RESULT;
|
|
1921
|
-
var init_thread = __esm({
|
|
1922
|
-
"src/ai/thread.ts"() {
|
|
1923
|
-
"use strict";
|
|
1924
|
-
PRUNED_TOOL_RESULT = JSON.stringify({
|
|
1925
|
-
pruned: true,
|
|
1926
|
-
note: "Old tool result cleared to free context \u2014 call the tool again if you still need it."
|
|
1927
|
-
});
|
|
1928
|
-
}
|
|
1929
|
-
});
|
|
1930
|
-
|
|
1931
|
-
// src/data/playbook.ts
|
|
1932
|
-
import { existsSync as existsSync11, readFileSync as readFileSync10, appendFileSync as appendFileSync2 } from "fs";
|
|
1933
|
-
import { join as join14 } from "path";
|
|
1934
|
-
function playsPath() {
|
|
1935
|
-
return join14(getMemoryDir(), PLAYS_FILE);
|
|
1936
|
-
}
|
|
1937
|
-
function getCustomPlays() {
|
|
1938
|
-
const path = playsPath();
|
|
1939
|
-
if (!existsSync11(path)) return [];
|
|
1940
|
-
const out = [];
|
|
1941
|
-
for (const line of readFileSync10(path, "utf-8").split("\n")) {
|
|
1942
|
-
const trimmed = line.trim();
|
|
1943
|
-
if (!trimmed) continue;
|
|
1944
|
-
try {
|
|
1945
|
-
const play = JSON.parse(trimmed);
|
|
1946
|
-
out.push({ ...play, source: "learned" });
|
|
1947
|
-
} catch {
|
|
1948
|
-
}
|
|
1949
|
-
}
|
|
1950
|
-
return out;
|
|
1951
|
-
}
|
|
1952
|
-
function getAllPlays() {
|
|
1953
|
-
return [...PLAYBOOK, ...getCustomPlays()];
|
|
1954
|
-
}
|
|
1955
|
-
function getPlaybook() {
|
|
1956
|
-
return getAllPlays();
|
|
1957
|
-
}
|
|
1958
|
-
function matchTriggeredPlays(vitals2, layers) {
|
|
1959
|
-
const bySign = new Map(vitals2.map((v) => [v.vital_sign, v]));
|
|
1960
|
-
const out = [];
|
|
1961
|
-
for (const layer of layers) {
|
|
1962
|
-
for (const sign of layer.signs) {
|
|
1963
|
-
const vital = bySign.get(sign);
|
|
1964
|
-
if (!vital) continue;
|
|
1965
|
-
const fires = vital.status === "red" || vital.score < VITAL_TRIGGER_THRESHOLDS[sign];
|
|
1966
|
-
if (!fires) continue;
|
|
1967
|
-
for (const play of getAllPlays()) {
|
|
1968
|
-
if (play.trigger_vital_sign === sign) {
|
|
1969
|
-
out.push({ play, vital, layer: layer.layer });
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
}
|
|
1974
|
-
return out;
|
|
1975
|
-
}
|
|
1976
|
-
var PLAYBOOK, PLAYS_FILE, VITAL_TRIGGER_THRESHOLDS;
|
|
1977
|
-
var init_playbook = __esm({
|
|
1978
|
-
"src/data/playbook.ts"() {
|
|
1979
|
-
"use strict";
|
|
1980
|
-
init_store();
|
|
1981
|
-
PLAYBOOK = [
|
|
1982
|
-
{
|
|
1983
|
-
id: "multi-thread-deals",
|
|
1984
|
-
name: "Multi-Thread Your Deals",
|
|
1985
|
-
trigger_vital_sign: "thread_depth",
|
|
1986
|
-
trigger_condition: "thread_depth score < 2 (most deals have 1 active contact or less)",
|
|
1987
|
-
why: "Deals with one contact fail when that contact stops, changes role, or loses budget. Each deal needs 2 or more active contacts. Late-stage deals with one contact are a sign of a slipped quarter.",
|
|
1988
|
-
steps: [
|
|
1989
|
-
"List deals that have one contact. Sort the list by amount. Start with the largest deal.",
|
|
1990
|
-
"Map the buying committee for each deal: champion, economic buyer, and technical evaluator.",
|
|
1991
|
-
"Ask the current contact for a second contact. A warm intro is better than a cold intro.",
|
|
1992
|
-
"Log each new contact and role on the opportunity so Thread Depth is measured.",
|
|
1993
|
-
"Set an alert when a mid-stage or later deal has one active contact."
|
|
1994
|
-
],
|
|
1995
|
-
tools_that_help: ["Buying-committee enrichment (waterfall)", "Job-change signal tracking", "CRM contact roles", "Single-thread alerts"],
|
|
1996
|
-
expected_outcome: "Thread Depth score rises above the threshold. Deals with one contact drop by 50% or more in 2 weeks. No late-stage deal has one thread."
|
|
1997
|
-
},
|
|
1998
|
-
{
|
|
1999
|
-
id: "clean-dead-pipeline",
|
|
2000
|
-
name: "Clean Dead Pipeline",
|
|
2001
|
-
trigger_vital_sign: "freshness",
|
|
2002
|
-
trigger_condition: "freshness score < 60",
|
|
2003
|
-
why: "Stale accounts and zombie deals inflate the pipeline number but deliver no revenue. They corrupt the forecast. They hide the real coverage math. You cannot fix what the CRM reports as false. Clearing them is also the cheapest pipeline you will source. Those records are already paid for.",
|
|
2004
|
-
steps: [
|
|
2005
|
-
"Split stale deals into two groups: deals you can save, and deals that are already dead.",
|
|
2006
|
-
"For deals you can save: contact them in 48 hours with a reason to talk, or close them lost.",
|
|
2007
|
-
"For dead records that are paid for: route them to a signal-triggered reactivation track.",
|
|
2008
|
-
"For stale organizations: verify ICP fit before more work. Archive records that do not fit.",
|
|
2009
|
-
"Set a stale-deal alert at N quiet days. Calibrate N to this motion's cycle."
|
|
2010
|
-
],
|
|
2011
|
-
tools_that_help: ["CRM bulk update", "Signal-based reactivation triggers", "Enrichment refresh (waterfall)", "Pipeline hygiene cadence"],
|
|
2012
|
-
expected_outcome: "Freshness score rises 20 points or more. The forecast matches reality. The reactivation track produces meetings at a fraction of cold-acquisition cost."
|
|
2013
|
-
},
|
|
2014
|
-
{
|
|
2015
|
-
id: "fix-handoff-gap",
|
|
2016
|
-
name: "Fix the Handoff Gap",
|
|
2017
|
-
trigger_vital_sign: "drop_rate",
|
|
2018
|
-
trigger_condition: "drop_rate score indicates more than 30% of marketing leads do not reach sales",
|
|
2019
|
-
why: "Every lead that marketing generates but sales never sees is wasted budget and lost revenue. The marketing to sales handoff is the main leak in most GTM motions. It is almost always a systems failure, not a people failure.",
|
|
2020
|
-
steps: [
|
|
2021
|
-
"Audit the leak by source. Find which lead sources never reach the CRM or a rep queue.",
|
|
2022
|
-
"Trace the routing path: assignment rules, territory, inactive-rep queues, and the marketing to CRM sync.",
|
|
2023
|
-
"Repair routing gaps. Reassign orphaned queues. Dedupe and enrich records so routing has the fields it needs.",
|
|
2024
|
-
"Set the SLA for time-to-first-touch on handed-off leads. Assign an owner to the report.",
|
|
2025
|
-
"Set a weekly report for marketing-only leads. Set an alert when any source handoff rate drops."
|
|
2026
|
-
],
|
|
2027
|
-
tools_that_help: ["Lead routing audit", "Enrichment waterfall (routing fields)", "SLA dashboard", "Handoff-degradation alerts"],
|
|
2028
|
-
expected_outcome: "Drop Rate improves 15 points or more. Marketing-only lead count drops by 60% or more. Time-to-first-touch is inside the SLA."
|
|
2029
|
-
},
|
|
2030
|
-
{
|
|
2031
|
-
id: "retarget-effort",
|
|
2032
|
-
name: "Retarget Misdirected Effort",
|
|
2033
|
-
trigger_vital_sign: "signal_to_noise",
|
|
2034
|
-
trigger_condition: "signal_to_noise score < 50% (majority of activities not linked to pipeline)",
|
|
2035
|
-
why: "When reps spend more than half their time on activities with no open pipeline, they burn hours that could close deals. Persistent noise is a targeting-system problem. Reps work the accounts they can see because the lists are stale. It is not a coaching problem.",
|
|
2036
|
-
steps: [
|
|
2037
|
-
"Cut noisy activity by rep and account status. Name what dominates: dead accounts, closed deals, or unlinked admin.",
|
|
2038
|
-
"Rebuild rep focus lists from ICP fit and live signals. Do not rebuild them from memory.",
|
|
2039
|
-
"Route signals to reps in the channel they already use, so the next action is the scored account.",
|
|
2040
|
-
"Set the ratio target: 80% of weekly activities touch open pipeline or scored accounts. Report it by rep.",
|
|
2041
|
-
"Automate or delete noise work such as logging, list building, and manual research."
|
|
2042
|
-
],
|
|
2043
|
-
tools_that_help: ["Activity reports by rep", "ICP/propensity scoring", "Signal routing to rep channels", "Enrichment automation"],
|
|
2044
|
-
expected_outcome: "Signal-to-Noise improves to 70% or more. Rep hours move from dead accounts to scored pipeline."
|
|
2045
|
-
},
|
|
2046
|
-
{
|
|
2047
|
-
id: "unstick-pipeline",
|
|
2048
|
-
name: "Unstick the Pipeline",
|
|
2049
|
-
trigger_vital_sign: "flow_rate",
|
|
2050
|
-
trigger_condition: "flow_rate score < 50 (high average deal age or many stuck deals)",
|
|
2051
|
-
why: "Stuck deals block revenue. They also lower rep morale. A deal that has not moved in 14 days or more is dead or needs action. Calibrate 14 days to this motion's cycle. Stuck deals with past-due close dates hurt forecast trust before they hurt revenue.",
|
|
2052
|
-
steps: [
|
|
2053
|
-
"List stuck deals sorted by amount. Find the stage where they cluster.",
|
|
2054
|
-
"For each stuck deal, name the blocker. Stuck is a symptom. The blocker is the work.",
|
|
2055
|
-
"Write a next action with a deadline for each deal. Close deals that have no next action.",
|
|
2056
|
-
"Add exit criteria and a required next-step field to the stage where deals cluster.",
|
|
2057
|
-
"Set an aging alert at the motion-calibrated threshold. Escalate past 2 times median stage duration."
|
|
2058
|
-
],
|
|
2059
|
-
tools_that_help: ["Deal inspection reports", "Stage exit criteria", "Aging alerts", "Manager escalation workflow"],
|
|
2060
|
-
expected_outcome: "Flow Rate score improves 15 points or more. Stuck deal count drops by 40% or more in 2 weeks. Conversion at the stall stage improves."
|
|
2061
|
-
},
|
|
2062
|
-
{
|
|
2063
|
-
id: "reduce-logo-churn",
|
|
2064
|
-
name: "Reduce Logo Churn",
|
|
2065
|
-
trigger_metric: "grr",
|
|
2066
|
-
trigger_lens: "revenue_metrics",
|
|
2067
|
-
trigger_condition: "GRR below motion benchmark or churned ARR elevated",
|
|
2068
|
-
why: "Revenue that leaves existing customers is the most expensive problem. You already paid to acquire them.",
|
|
2069
|
-
steps: [
|
|
2070
|
-
"Identify churned accounts and at-risk accounts from retention metrics.",
|
|
2071
|
-
"Segment churn by deal size, tenure, and product usage.",
|
|
2072
|
-
"Start save plays for accounts that show contraction signals.",
|
|
2073
|
-
"Audit the renewal process: timing, stakeholders, and success criteria.",
|
|
2074
|
-
"Set early-warning triggers 90 days before renewal."
|
|
2075
|
-
],
|
|
2076
|
-
tools_that_help: ["CS platform", "Renewal calendar", "NPS/CSAT surveys"],
|
|
2077
|
-
expected_outcome: "GRR moves toward the motion benchmark within 2 quarters."
|
|
2078
|
-
},
|
|
2079
|
-
{
|
|
2080
|
-
id: "accelerate-expansion",
|
|
2081
|
-
name: "Accelerate Expansion",
|
|
2082
|
-
trigger_metric: "nrr",
|
|
2083
|
-
trigger_lens: "revenue_metrics",
|
|
2084
|
-
trigger_condition: "NRR below 100% with low expansion ARR",
|
|
2085
|
-
why: "Growth from the installed base costs less than new logo acquisition. Low expansion means unused wallet share.",
|
|
2086
|
-
steps: [
|
|
2087
|
-
"List accounts with single-product adoption and upsell potential.",
|
|
2088
|
-
"Map expansion triggers: seat growth, new use cases, and tier upgrades.",
|
|
2089
|
-
"Assign expansion targets to CS and AE teams by account tier.",
|
|
2090
|
-
"Make packaged upsell offers with a clear ROI.",
|
|
2091
|
-
"Track expansion pipeline apart from new business."
|
|
2092
|
-
],
|
|
2093
|
-
tools_that_help: ["Account plans", "Usage analytics", "Expansion playbooks"],
|
|
2094
|
-
expected_outcome: "Expansion ARR grows 20% or more quarter over quarter."
|
|
2095
|
-
},
|
|
2096
|
-
{
|
|
2097
|
-
id: "fix-renewal-process",
|
|
2098
|
-
name: "Fix the Renewal Process",
|
|
2099
|
-
trigger_metric: "contraction_arr",
|
|
2100
|
-
trigger_lens: "revenue_metrics",
|
|
2101
|
-
trigger_condition: "Contraction ARR > 0",
|
|
2102
|
-
why: "Downgrades are usually a process failure. Causes include late engagement, wrong stakeholders, or missing value proof.",
|
|
2103
|
-
steps: [
|
|
2104
|
-
"List all contraction events. Categorize the root cause.",
|
|
2105
|
-
"Set a standard renewal timeline: 120, 90, 60, and 30-day checkpoints.",
|
|
2106
|
-
"Engage the economic buyer before the renewal date.",
|
|
2107
|
-
"Make an ROI recap deck template for every renewal.",
|
|
2108
|
-
"Escalate contractions above 20% to leadership review."
|
|
2109
|
-
],
|
|
2110
|
-
tools_that_help: ["Renewal workflow", "QBR templates", "Value realization reports"],
|
|
2111
|
-
expected_outcome: "Contraction ARR drops 50% or more within 2 quarters."
|
|
2112
|
-
},
|
|
2113
|
-
{
|
|
2114
|
-
id: "rebalance-pipeline-mix",
|
|
2115
|
-
name: "Rebalance Pipeline Mix",
|
|
2116
|
-
trigger_metric: "pipeline_coverage",
|
|
2117
|
-
trigger_lens: "revenue_metrics",
|
|
2118
|
-
trigger_condition: "Pipeline coverage red while win rate is healthy",
|
|
2119
|
-
why: "A strong win rate with weak coverage means qualification works. Top-of-funnel does not feed the machine.",
|
|
2120
|
-
steps: [
|
|
2121
|
-
"Compare pipeline created vs closed-won by source and segment.",
|
|
2122
|
-
"Identify segments with coverage below the benchmark.",
|
|
2123
|
-
"Move marketing and SDR effort toward under-covered segments.",
|
|
2124
|
-
"Set weekly pipeline-created targets by rep.",
|
|
2125
|
-
"Review discounting and stage inflation that hide a thin pipeline."
|
|
2126
|
-
],
|
|
2127
|
-
tools_that_help: ["Pipeline analytics", "Marketing attribution", "Capacity planning"],
|
|
2128
|
-
expected_outcome: "Pipeline coverage reaches the motion benchmark within 90 days."
|
|
2129
|
-
},
|
|
2130
|
-
{
|
|
2131
|
-
id: "compress-sales-cycle",
|
|
2132
|
-
name: "Compress the Sales Cycle",
|
|
2133
|
-
trigger_metric: "avg_sales_cycle",
|
|
2134
|
-
trigger_lens: "revenue_metrics",
|
|
2135
|
-
trigger_condition: "Avg sales cycle exceeds profile sales_cycle_days by 50% or more",
|
|
2136
|
-
why: "Deals that age past this motion's norm tie up capacity. They also push revenue into future quarters.",
|
|
2137
|
-
steps: [
|
|
2138
|
-
"Analyze cycle time by stage. Find where deals stall longest.",
|
|
2139
|
-
"Set stage-exit criteria with required next steps.",
|
|
2140
|
-
"Add mutual action plans for deals past midpoint.",
|
|
2141
|
-
"Escalate deals that exceed 2 times median cycle to manager review.",
|
|
2142
|
-
"Remove low-probability aged deals to free rep capacity."
|
|
2143
|
-
],
|
|
2144
|
-
tools_that_help: ["Stage duration reports", "MAP templates", "Deal coaching"],
|
|
2145
|
-
expected_outcome: "Median cycle time drops 20% or more within one quarter."
|
|
2146
|
-
},
|
|
2147
|
-
{
|
|
2148
|
-
id: "improve-magic-number",
|
|
2149
|
-
name: "Improve Magic Number",
|
|
2150
|
-
trigger_metric: "magic_number",
|
|
2151
|
-
trigger_lens: "revenue_metrics",
|
|
2152
|
-
trigger_condition: "Magic number below motion benchmark (when spend data is available)",
|
|
2153
|
-
why: "A low magic number means you buy growth at too high a cost. Burn rate outpaces sustainable unit economics.",
|
|
2154
|
-
steps: [
|
|
2155
|
-
"Calculate magic number by channel and segment.",
|
|
2156
|
-
"Cut spend on channels with magic number below 0.5.",
|
|
2157
|
-
"Increase spend on the highest-efficiency acquisition motions.",
|
|
2158
|
-
"Align CAC targets to motion-specific payback thresholds.",
|
|
2159
|
-
"Review rep ramp time and quota attainment curves."
|
|
2160
|
-
],
|
|
2161
|
-
tools_that_help: ["Finance model", "Channel ROI dashboard", "CAC by source"],
|
|
2162
|
-
expected_outcome: "Magic number moves toward the benchmark within 2 quarters."
|
|
2163
|
-
}
|
|
2164
|
-
];
|
|
2165
|
-
PLAYS_FILE = "plays.jsonl";
|
|
2166
|
-
VITAL_TRIGGER_THRESHOLDS = {
|
|
2167
|
-
freshness: 60,
|
|
2168
|
-
flow_rate: 50,
|
|
2169
|
-
drop_rate: 70,
|
|
2170
|
-
signal_to_noise: 50,
|
|
2171
|
-
thread_depth: 60
|
|
2172
|
-
};
|
|
2173
|
-
}
|
|
2174
|
-
});
|
|
2175
|
-
|
|
2176
|
-
// src/memory/play-outcomes.ts
|
|
2177
|
-
import { existsSync as existsSync12, readFileSync as readFileSync11, appendFileSync as appendFileSync3 } from "fs";
|
|
2178
|
-
import { join as join15 } from "path";
|
|
2179
|
-
import { randomUUID as randomUUID4 } from "crypto";
|
|
2180
|
-
var init_play_outcomes = __esm({
|
|
2181
|
-
"src/memory/play-outcomes.ts"() {
|
|
2182
|
-
"use strict";
|
|
2183
|
-
init_store();
|
|
2184
|
-
}
|
|
2185
|
-
});
|
|
2186
|
-
|
|
2187
|
-
// src/workflows/registry.ts
|
|
2188
|
-
var init_registry = __esm({
|
|
2189
|
-
"src/workflows/registry.ts"() {
|
|
2190
|
-
"use strict";
|
|
2191
|
-
}
|
|
2192
|
-
});
|
|
2193
|
-
|
|
2194
|
-
// src/ai/prompt-parts.ts
|
|
2195
|
-
import { existsSync as existsSync13, readFileSync as readFileSync12 } from "fs";
|
|
2196
|
-
import { join as join16 } from "path";
|
|
2197
|
-
var init_prompt_parts = __esm({
|
|
2198
|
-
"src/ai/prompt-parts.ts"() {
|
|
2199
|
-
"use strict";
|
|
2200
|
-
init_profile();
|
|
2201
|
-
init_store();
|
|
2202
|
-
init_playbook();
|
|
2203
|
-
init_play_outcomes();
|
|
2204
|
-
init_registry();
|
|
2205
|
-
init_untrusted();
|
|
2206
|
-
}
|
|
2207
|
-
});
|
|
2208
|
-
|
|
2209
|
-
// src/ai/strategist-prompt.ts
|
|
2210
|
-
var init_strategist_prompt = __esm({
|
|
2211
|
-
"src/ai/strategist-prompt.ts"() {
|
|
2212
|
-
"use strict";
|
|
2213
|
-
init_prompt_parts();
|
|
2214
|
-
}
|
|
2215
|
-
});
|
|
2216
|
-
|
|
2217
|
-
// src/ai/json-response.ts
|
|
2218
|
-
function stripJsonFences(text) {
|
|
2219
|
-
const trimmed = text.trim();
|
|
2220
|
-
const fenced = trimmed.match(/```(?:json)?\s*([\s\S]*?)\s*```/i);
|
|
2221
|
-
if (fenced) return fenced[1].trim();
|
|
2222
|
-
return trimmed.replace(/```(?:json)?\s*/gi, "").replace(/```/g, "").trim();
|
|
2223
|
-
}
|
|
2224
|
-
var init_json_response = __esm({
|
|
2225
|
-
"src/ai/json-response.ts"() {
|
|
2226
|
-
"use strict";
|
|
2227
|
-
}
|
|
2228
|
-
});
|
|
2229
|
-
|
|
2230
|
-
// src/ai/strategist-validate.ts
|
|
2231
|
-
function parseJsonObjectFromText(text) {
|
|
2232
|
-
const cleaned = stripJsonFences(text);
|
|
2233
|
-
const start = cleaned.indexOf("{");
|
|
2234
|
-
if (start === -1) return null;
|
|
2235
|
-
let depth = 0;
|
|
2236
|
-
let inString = false;
|
|
2237
|
-
let escaped = false;
|
|
2238
|
-
let end = -1;
|
|
2239
|
-
for (let i = start; i < cleaned.length; i++) {
|
|
2240
|
-
const ch = cleaned[i];
|
|
2241
|
-
if (escaped) {
|
|
2242
|
-
escaped = false;
|
|
2243
|
-
continue;
|
|
2244
|
-
}
|
|
2245
|
-
if (ch === "\\") {
|
|
2246
|
-
if (inString) escaped = true;
|
|
2247
|
-
continue;
|
|
2248
|
-
}
|
|
2249
|
-
if (ch === '"') {
|
|
2250
|
-
inString = !inString;
|
|
2251
|
-
continue;
|
|
2252
|
-
}
|
|
2253
|
-
if (inString) continue;
|
|
2254
|
-
if (ch === "{") depth++;
|
|
2255
|
-
else if (ch === "}") {
|
|
2256
|
-
depth--;
|
|
2257
|
-
if (depth === 0) {
|
|
2258
|
-
end = i;
|
|
2259
|
-
break;
|
|
2260
|
-
}
|
|
2261
|
-
}
|
|
2262
|
-
}
|
|
2263
|
-
if (end === -1) return null;
|
|
2264
|
-
try {
|
|
2265
|
-
const parsed = JSON.parse(cleaned.slice(start, end + 1));
|
|
2266
|
-
return parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null;
|
|
2267
|
-
} catch {
|
|
2268
|
-
return null;
|
|
2269
|
-
}
|
|
2270
|
-
}
|
|
2271
|
-
function extractNumbers(text) {
|
|
2272
|
-
const out = [];
|
|
2273
|
-
for (const match of text.matchAll(NUMBER_RE)) {
|
|
2274
|
-
const base = Number(match[1].replace(/,/g, ""));
|
|
2275
|
-
if (!Number.isFinite(base)) continue;
|
|
2276
|
-
const suffix = match[2]?.toLowerCase();
|
|
2277
|
-
out.push(suffix ? base * (SUFFIX_MULTIPLIER[suffix] ?? 1) : base);
|
|
2278
|
-
}
|
|
2279
|
-
return out;
|
|
2280
|
-
}
|
|
2281
|
-
function numbersMatch(a, b) {
|
|
2282
|
-
if (a === b) return true;
|
|
2283
|
-
if (a === 0 || b === 0) return Math.abs(a - b) < 0.5;
|
|
2284
|
-
return Math.abs(a - b) / Math.max(Math.abs(a), Math.abs(b)) <= 0.02;
|
|
2285
|
-
}
|
|
2286
|
-
function baselineAppearsInEvidence(value, evidenceNumbers) {
|
|
2287
|
-
const valueNumbers = extractNumbers(value);
|
|
2288
|
-
if (valueNumbers.length === 0) return false;
|
|
2289
|
-
return valueNumbers.some((v) => evidenceNumbers.some((e) => numbersMatch(v, e)));
|
|
2290
|
-
}
|
|
2291
|
-
function isKnownInstrument(measuredBy) {
|
|
2292
|
-
const lower = measuredBy.toLowerCase();
|
|
2293
|
-
return INSTRUMENT_TOKENS.some((token) => lower.includes(token));
|
|
2294
|
-
}
|
|
2295
|
-
function parseIsoDate(value) {
|
|
2296
|
-
if (typeof value !== "string") return null;
|
|
2297
|
-
const match = value.trim().match(ISO_DATE_RE);
|
|
2298
|
-
if (!match) return null;
|
|
2299
|
-
const date = /* @__PURE__ */ new Date(`${match[1]}-${match[2]}-${match[3]}T00:00:00Z`);
|
|
2300
|
-
return Number.isNaN(date.getTime()) ? null : date;
|
|
2301
|
-
}
|
|
2302
|
-
function toIso(date) {
|
|
2303
|
-
return date.toISOString().slice(0, 10);
|
|
2304
|
-
}
|
|
2305
|
-
function addDays(date, days) {
|
|
2306
|
-
const out = new Date(date);
|
|
2307
|
-
out.setUTCDate(out.getUTCDate() + days);
|
|
2308
|
-
return out;
|
|
2309
|
-
}
|
|
2310
|
-
function normalizeDate(value, today2, fallbackDays) {
|
|
2311
|
-
const parsed = parseIsoDate(value);
|
|
2312
|
-
if (parsed && parsed.getTime() >= today2.getTime()) {
|
|
2313
|
-
return { iso: toIso(parsed), repaired: false };
|
|
2314
|
-
}
|
|
2315
|
-
return { iso: toIso(addDays(today2, fallbackDays)), repaired: true };
|
|
2316
|
-
}
|
|
2317
|
-
function str(value) {
|
|
2318
|
-
return typeof value === "string" ? value.trim() : "";
|
|
2319
|
-
}
|
|
2320
|
-
function strArray(value) {
|
|
2321
|
-
if (!Array.isArray(value)) return [];
|
|
2322
|
-
return value.map(str).filter(Boolean);
|
|
2323
|
-
}
|
|
2324
|
-
function num(value, fallback2) {
|
|
2325
|
-
const n = typeof value === "number" ? value : Number(value);
|
|
2326
|
-
return Number.isFinite(n) ? n : fallback2;
|
|
2327
|
-
}
|
|
2328
|
-
function enumValue(value, allowed, fallback2) {
|
|
2329
|
-
return typeof value === "string" && allowed.includes(value) ? value : fallback2;
|
|
2330
|
-
}
|
|
2331
|
-
function hasNumber(text) {
|
|
2332
|
-
return extractNumbers(text).length > 0;
|
|
2333
|
-
}
|
|
2334
|
-
function validateOutcome(raw, label, evidenceNumbers, today2, fallbackDays) {
|
|
2335
|
-
if (!raw || typeof raw !== "object") {
|
|
2336
|
-
return { outcome: null, measurable: false, notes: [`${label}: missing \u2014 excluded from targets`] };
|
|
2337
|
-
}
|
|
2338
|
-
const record = raw;
|
|
2339
|
-
const metric = str(record.metric);
|
|
2340
|
-
const baseline = str(record.baseline);
|
|
2341
|
-
const targetRange = str(record.target_range);
|
|
2342
|
-
const measuredBy = str(record.measured_by);
|
|
2343
|
-
if (!metric) {
|
|
2344
|
-
return { outcome: null, measurable: false, notes: [`${label}: no metric named \u2014 excluded from targets`] };
|
|
2345
|
-
}
|
|
2346
|
-
const notes = [];
|
|
2347
|
-
let measurable = true;
|
|
2348
|
-
if (!hasNumber(baseline)) {
|
|
2349
|
-
measurable = false;
|
|
2350
|
-
notes.push(`${label} "${metric}": baseline is not a number \u2014 demoted to assumption`);
|
|
2351
|
-
} else if (!baselineAppearsInEvidence(baseline, evidenceNumbers)) {
|
|
2352
|
-
measurable = false;
|
|
2353
|
-
notes.push(`${label} "${metric}": baseline ${baseline} not found in grounded evidence \u2014 demoted to assumption`);
|
|
2354
|
-
}
|
|
2355
|
-
if (!hasNumber(targetRange)) {
|
|
2356
|
-
measurable = false;
|
|
2357
|
-
notes.push(`${label} "${metric}": target range has no number \u2014 demoted to assumption`);
|
|
2358
|
-
}
|
|
2359
|
-
if (!measuredBy || !isKnownInstrument(measuredBy)) {
|
|
2360
|
-
measurable = false;
|
|
2361
|
-
notes.push(`${label} "${metric}": measured_by "${measuredBy || "(empty)"}" is not a known instrument \u2014 demoted to assumption`);
|
|
2362
|
-
}
|
|
2363
|
-
const checkDate = normalizeDate(record.check_date, today2, fallbackDays);
|
|
2364
|
-
if (checkDate.repaired) {
|
|
2365
|
-
notes.push(`${label} "${metric}": check date repaired to ${checkDate.iso}`);
|
|
2366
|
-
}
|
|
2367
|
-
return {
|
|
2368
|
-
outcome: {
|
|
2369
|
-
metric,
|
|
2370
|
-
baseline: baseline || "unknown",
|
|
2371
|
-
target_range: targetRange || "unquantified",
|
|
2372
|
-
check_date: checkDate.iso,
|
|
2373
|
-
measured_by: measuredBy || "unspecified"
|
|
2374
|
-
},
|
|
2375
|
-
measurable,
|
|
2376
|
-
notes
|
|
2377
|
-
};
|
|
2378
|
-
}
|
|
2379
|
-
function validateMilestones(raw, today2, issues, workstreamTitle) {
|
|
2380
|
-
const out = [];
|
|
2381
|
-
if (Array.isArray(raw)) {
|
|
2382
|
-
for (const item of raw) {
|
|
2383
|
-
if (!item || typeof item !== "object") continue;
|
|
2384
|
-
const record = item;
|
|
2385
|
-
const label = str(record.label);
|
|
2386
|
-
const verification = str(record.verification);
|
|
2387
|
-
if (!label) continue;
|
|
2388
|
-
const due = normalizeDate(record.due, today2, 14);
|
|
2389
|
-
if (due.repaired) {
|
|
2390
|
-
issues.push(`Milestone "${label}" (${workstreamTitle}): due date repaired to ${due.iso}`);
|
|
2391
|
-
}
|
|
2392
|
-
if (!verification) {
|
|
2393
|
-
issues.push(`Milestone "${label}" (${workstreamTitle}): no verification method \u2014 flagged`);
|
|
2394
|
-
}
|
|
2395
|
-
out.push({ label, due: due.iso, verification: verification || "Verification method not specified \u2014 define before activating" });
|
|
2396
|
-
}
|
|
2397
|
-
}
|
|
2398
|
-
return out;
|
|
2399
|
-
}
|
|
2400
|
-
function validateDeliverables(raw, today2) {
|
|
2401
|
-
const out = [];
|
|
2402
|
-
if (Array.isArray(raw)) {
|
|
2403
|
-
for (const item of raw) {
|
|
2404
|
-
if (!item || typeof item !== "object") continue;
|
|
2405
|
-
const record = item;
|
|
2406
|
-
const label = str(record.label);
|
|
2407
|
-
if (!label) continue;
|
|
2408
|
-
out.push({
|
|
2409
|
-
label,
|
|
2410
|
-
kind: enumValue(record.kind, ["artifact", "process_change", "decision"], "artifact"),
|
|
2411
|
-
due: normalizeDate(record.due, today2, 21).iso
|
|
2412
|
-
});
|
|
2413
|
-
}
|
|
2414
|
-
}
|
|
2415
|
-
return out;
|
|
2416
|
-
}
|
|
2417
|
-
function validateContingency(raw, today2) {
|
|
2418
|
-
if (!raw || typeof raw !== "object") return null;
|
|
2419
|
-
const record = raw;
|
|
2420
|
-
const trigger = str(record.trigger);
|
|
2421
|
-
const fallback2 = str(record.fallback);
|
|
2422
|
-
if (!trigger || !fallback2) return null;
|
|
2423
|
-
return {
|
|
2424
|
-
trigger,
|
|
2425
|
-
trigger_check_date: normalizeDate(record.trigger_check_date, today2, 21).iso,
|
|
2426
|
-
fallback: fallback2
|
|
2427
|
-
};
|
|
2428
|
-
}
|
|
2429
|
-
function validPlayIds(value) {
|
|
2430
|
-
const allowed = new Set(getPlaybook().map((play) => play.id));
|
|
2431
|
-
return strArray(value).filter((id) => allowed.has(id));
|
|
2432
|
-
}
|
|
2433
|
-
function validateStrategistPlan(raw, opts) {
|
|
2434
|
-
const today2 = parseIsoDate(opts.todayIso) ?? /* @__PURE__ */ new Date();
|
|
2435
|
-
const evidenceNumbers = extractNumbers(opts.evidenceText);
|
|
2436
|
-
const issues = [];
|
|
2437
|
-
const demotedAssumptions = [];
|
|
2438
|
-
let measurableTargets = 0;
|
|
2439
|
-
let totalTargets = 0;
|
|
2440
|
-
const rawWorkstreams = Array.isArray(raw.workstreams) ? raw.workstreams : [];
|
|
2441
|
-
const workstreams = [];
|
|
2442
|
-
for (const [index, item] of rawWorkstreams.entries()) {
|
|
2443
|
-
if (!item || typeof item !== "object") continue;
|
|
2444
|
-
const record = item;
|
|
2445
|
-
const title = str(record.title) || `Workstream ${index + 1}`;
|
|
2446
|
-
const outcomeCheck = validateOutcome(record.expected_outcome, "Expected outcome", evidenceNumbers, today2, 30);
|
|
2447
|
-
totalTargets += outcomeCheck.outcome ? 1 : 0;
|
|
2448
|
-
if (outcomeCheck.measurable) measurableTargets++;
|
|
2449
|
-
for (const note of outcomeCheck.notes) issues.push(`${title}: ${note}`);
|
|
2450
|
-
if (outcomeCheck.outcome && !outcomeCheck.measurable) {
|
|
2451
|
-
demotedAssumptions.push(
|
|
2452
|
-
`Unverified expectation (${title}): ${outcomeCheck.outcome.metric} ${outcomeCheck.outcome.baseline} -> ${outcomeCheck.outcome.target_range} \u2014 quantify against grounded data before treating as a target`
|
|
2453
|
-
);
|
|
2454
|
-
}
|
|
2455
|
-
const leadingIndicators = [];
|
|
2456
|
-
if (Array.isArray(record.leading_indicators)) {
|
|
2457
|
-
for (const li of record.leading_indicators) {
|
|
2458
|
-
const check = validateOutcome(li, "Leading indicator", evidenceNumbers, today2, 14);
|
|
2459
|
-
if (!check.outcome) continue;
|
|
2460
|
-
totalTargets++;
|
|
2461
|
-
if (check.measurable) {
|
|
2462
|
-
measurableTargets++;
|
|
2463
|
-
leadingIndicators.push(check.outcome);
|
|
2464
|
-
} else {
|
|
2465
|
-
for (const note of check.notes) issues.push(`${title}: ${note}`);
|
|
2466
|
-
demotedAssumptions.push(
|
|
2467
|
-
`Unverified indicator (${title}): ${check.outcome.metric} \u2014 not measurable as stated`
|
|
2468
|
-
);
|
|
2469
|
-
}
|
|
2470
|
-
}
|
|
2471
|
-
}
|
|
2472
|
-
let milestones = validateMilestones(record.milestones, today2, issues, title);
|
|
2473
|
-
if (milestones.length === 0 && outcomeCheck.outcome) {
|
|
2474
|
-
milestones = [{
|
|
2475
|
-
label: `Outcome check: ${outcomeCheck.outcome.metric}`,
|
|
2476
|
-
due: outcomeCheck.outcome.check_date,
|
|
2477
|
-
verification: `${outcomeCheck.outcome.measured_by} shows ${outcomeCheck.outcome.target_range}`
|
|
2478
|
-
}];
|
|
2479
|
-
issues.push(`${title}: no dated milestones \u2014 derived one from the expected outcome`);
|
|
2480
|
-
}
|
|
2481
|
-
if (!outcomeCheck.outcome && milestones.length === 0) {
|
|
2482
|
-
issues.push(`${title}: no measurable outcome and no milestones \u2014 workstream demoted to assumption`);
|
|
2483
|
-
demotedAssumptions.push(`Dropped workstream "${title}" \u2014 had no measurable outcome or dated milestone`);
|
|
2484
|
-
continue;
|
|
2485
|
-
}
|
|
2486
|
-
const contingency = validateContingency(record.contingency, today2);
|
|
2487
|
-
if (!contingency) {
|
|
2488
|
-
issues.push(`${title}: contingency missing or incomplete \u2014 flagged for definition at first review`);
|
|
2489
|
-
}
|
|
2490
|
-
workstreams.push({
|
|
2491
|
-
order: num(record.order, workstreams.length + 1),
|
|
2492
|
-
title,
|
|
2493
|
-
problem: str(record.problem) || "Problem statement not captured",
|
|
2494
|
-
rationale: str(record.rationale) || "Sequence rationale not captured",
|
|
2495
|
-
play_ids: validPlayIds(record.play_ids),
|
|
2496
|
-
actions: strArray(record.actions),
|
|
2497
|
-
effort_hours: Math.max(0, num(record.effort_hours, 8)),
|
|
2498
|
-
milestones,
|
|
2499
|
-
deliverables: validateDeliverables(record.deliverables, today2),
|
|
2500
|
-
expected_outcome: outcomeCheck.outcome ?? {
|
|
2501
|
-
metric: "unspecified",
|
|
2502
|
-
baseline: "unknown",
|
|
2503
|
-
target_range: "unquantified",
|
|
2504
|
-
check_date: toIso(addDays(today2, 30)),
|
|
2505
|
-
measured_by: "unspecified"
|
|
2506
|
-
},
|
|
2507
|
-
leading_indicators: leadingIndicators,
|
|
2508
|
-
contingency: contingency ?? {
|
|
2509
|
-
trigger: "Define trigger at first review",
|
|
2510
|
-
trigger_check_date: toIso(addDays(today2, 21)),
|
|
2511
|
-
fallback: "Define fallback at first review"
|
|
2512
|
-
}
|
|
2513
|
-
});
|
|
2514
|
-
}
|
|
2515
|
-
if (workstreams.length === 0) return null;
|
|
2516
|
-
workstreams.sort((a, b) => a.order - b.order);
|
|
2517
|
-
workstreams.forEach((ws, i) => {
|
|
2518
|
-
ws.order = i + 1;
|
|
2519
|
-
});
|
|
2520
|
-
const capped = workstreams.slice(0, 5);
|
|
2521
|
-
if (workstreams.length > 5) {
|
|
2522
|
-
issues.push(`Plan proposed ${workstreams.length} workstreams \u2014 capped to 5 (focus beats coverage)`);
|
|
2523
|
-
}
|
|
2524
|
-
const rawConfidence = Math.min(1, Math.max(0, num(raw.confidence, 0.6)));
|
|
2525
|
-
const confidence = Math.max(0.2, rawConfidence - demotedAssumptions.length * 0.05);
|
|
2526
|
-
const plan = {
|
|
2527
|
-
title: str(raw.title) || "Untitled Strategy",
|
|
2528
|
-
objective: str(raw.objective) || "Objective not restated",
|
|
2529
|
-
summary_30k: str(raw.summary_30k) || str(raw.hypothesis) || "Executive summary not captured",
|
|
2530
|
-
hypothesis: str(raw.hypothesis) || "If the workstreams execute in order, the objective metrics should move within their target ranges.",
|
|
2531
|
-
target_segment: str(raw.target_segment) || "Whole pipeline",
|
|
2532
|
-
priority: enumValue(raw.priority, ["low", "medium", "high"], "medium"),
|
|
2533
|
-
review_cadence: str(raw.review_cadence) || "Weekly",
|
|
2534
|
-
confidence,
|
|
2535
|
-
constraints: strArray(raw.constraints),
|
|
2536
|
-
assumptions: [...strArray(raw.assumptions), ...demotedAssumptions],
|
|
2537
|
-
risks: strArray(raw.risks),
|
|
2538
|
-
workstreams: capped
|
|
2539
|
-
};
|
|
2540
|
-
return { plan, issues, measurableTargets, totalTargets };
|
|
2541
|
-
}
|
|
2542
|
-
function buildGroundedFallbackPlan(input) {
|
|
2543
|
-
const today2 = parseIsoDate(input.todayIso) ?? /* @__PURE__ */ new Date();
|
|
2544
|
-
const triggered2 = matchTriggeredPlays(input.vitals, LAYERS);
|
|
2545
|
-
const issues = [
|
|
2546
|
-
"LLM plan JSON invalid \u2014 using grounded fallback from triggered plays and live vitals"
|
|
2547
|
-
];
|
|
2548
|
-
const sources = triggered2.length > 0 ? triggered2.slice(0, 3) : input.vitals.slice().sort((a, b) => a.score - b.score).slice(0, 2).map((vital) => {
|
|
2549
|
-
const play = getPlaybook().find((p) => p.trigger_vital_sign === vital.vital_sign) ?? getPlaybook()[0];
|
|
2550
|
-
return { play, vital, layer: 1 };
|
|
2551
|
-
});
|
|
2552
|
-
const workstreams = sources.map(({ play, vital }, index) => {
|
|
2553
|
-
const score = Math.round(vital.score);
|
|
2554
|
-
const dollar = vital.dollar_value != null && vital.dollar_value > 0 ? `$${Math.round(vital.dollar_value).toLocaleString("en-US")}` : null;
|
|
2555
|
-
const baseline = dollar ?? String(score);
|
|
2556
|
-
const targetLow = vital.dollar_value != null && vital.dollar_value > 0 ? `$${Math.round(vital.dollar_value * 0.4).toLocaleString("en-US")}` : String(Math.min(100, score + 20));
|
|
2557
|
-
const targetHigh = vital.dollar_value != null && vital.dollar_value > 0 ? `$${Math.round(vital.dollar_value * 0.6).toLocaleString("en-US")}` : String(Math.min(100, score + 35));
|
|
2558
|
-
const checkDate = toIso(addDays(today2, 21 + index * 7));
|
|
2559
|
-
const outcome = {
|
|
2560
|
-
metric: vital.vital_sign,
|
|
2561
|
-
baseline,
|
|
2562
|
-
target_range: `${baseline} -> ${targetLow}-${targetHigh}`,
|
|
2563
|
-
check_date: checkDate,
|
|
2564
|
-
measured_by: `${vital.vital_sign} vital sign`
|
|
2565
|
-
};
|
|
2566
|
-
return {
|
|
2567
|
-
order: index + 1,
|
|
2568
|
-
title: play.name,
|
|
2569
|
-
problem: `${vital.vital_sign} score ${score} (${vital.status})${dollar ? ` \u2014 ${dollar} ${vital.dollar_label ?? ""}`.trimEnd() : ""}`,
|
|
2570
|
-
rationale: index === 0 ? "Layer-order first: clean or unblock the gating vital before downstream work" : "Next in dependency order after the prior workstream",
|
|
2571
|
-
play_ids: [play.id],
|
|
2572
|
-
actions: play.steps.slice(0, 3),
|
|
2573
|
-
effort_hours: 8 + index * 4,
|
|
2574
|
-
milestones: [
|
|
2575
|
-
{
|
|
2576
|
-
label: `Check ${vital.vital_sign} movement`,
|
|
2577
|
-
due: checkDate,
|
|
2578
|
-
verification: `${vital.vital_sign} score moves toward ${targetLow}-${targetHigh} (baseline ${baseline})`
|
|
2579
|
-
}
|
|
2580
|
-
],
|
|
2581
|
-
deliverables: [
|
|
2582
|
-
{
|
|
2583
|
-
label: `${play.name} triage list`,
|
|
2584
|
-
kind: "artifact",
|
|
2585
|
-
due: toIso(addDays(today2, 7 + index * 7))
|
|
2586
|
-
}
|
|
2587
|
-
],
|
|
2588
|
-
expected_outcome: outcome,
|
|
2589
|
-
leading_indicators: [],
|
|
2590
|
-
contingency: {
|
|
2591
|
-
trigger: `${vital.vital_sign} flat or worse at first check`,
|
|
2592
|
-
trigger_check_date: checkDate,
|
|
2593
|
-
fallback: "Descope to the single highest-dollar entity cohort and re-run /strategy review"
|
|
2594
|
-
}
|
|
2595
|
-
};
|
|
2596
|
-
});
|
|
2597
|
-
const gating = input.gatingVitalSign ?? sources[0]?.vital.vital_sign ?? "freshness";
|
|
2598
|
-
const varLabel = input.totalValueAtRisk != null && input.totalValueAtRisk > 0 ? `$${Math.round(input.totalValueAtRisk).toLocaleString("en-US")} at risk` : "material pipeline dollars at risk";
|
|
2599
|
-
const plan = {
|
|
2600
|
-
title: "Grounded recovery plan",
|
|
2601
|
-
objective: input.objective,
|
|
2602
|
-
summary_30k: `${gating} is the gating pressure (${varLabel}). This fallback sequences ${workstreams.length} playbook workstream(s) in layer order so data trust and handoffs unlock pipeline movement. Treat baselines as live vital readings; refine with /strategy after the first review.`,
|
|
2603
|
-
hypothesis: "If plays execute in layer order against the live vital scores, the objective metrics should move into the stated ranges within one review cycle.",
|
|
2604
|
-
target_segment: "Whole pipeline",
|
|
2605
|
-
priority: "high",
|
|
2606
|
-
review_cadence: "Weekly",
|
|
2607
|
-
confidence: 0.45,
|
|
2608
|
-
constraints: ["Generated without a validated LLM plan JSON \u2014 confirm capacity before staffing"],
|
|
2609
|
-
assumptions: ["Outcome ranges are heuristic halves/increments of live vitals, not model-authored forecasts"],
|
|
2610
|
-
risks: ["Fallback plans lack stress-test revisions \u2014 run /strategy once the engine emits valid JSON"],
|
|
2611
|
-
workstreams
|
|
2612
|
-
};
|
|
2613
|
-
return {
|
|
2614
|
-
plan,
|
|
2615
|
-
issues,
|
|
2616
|
-
measurableTargets: workstreams.length,
|
|
2617
|
-
totalTargets: workstreams.length
|
|
2618
|
-
};
|
|
2619
|
-
}
|
|
2620
|
-
var NUMBER_RE, SUFFIX_MULTIPLIER, INSTRUMENT_TOKENS, ISO_DATE_RE;
|
|
2621
|
-
var init_strategist_validate = __esm({
|
|
2622
|
-
"src/ai/strategist-validate.ts"() {
|
|
2623
|
-
"use strict";
|
|
2624
|
-
init_playbook();
|
|
2625
|
-
init_health_score();
|
|
2626
|
-
init_json_response();
|
|
2627
|
-
NUMBER_RE = /\$?\s*(\d[\d,]*\.?\d*)\s*(m|k|b|million|thousand|billion)?\b/gi;
|
|
2628
|
-
SUFFIX_MULTIPLIER = {
|
|
2629
|
-
k: 1e3,
|
|
2630
|
-
thousand: 1e3,
|
|
2631
|
-
m: 1e6,
|
|
2632
|
-
million: 1e6,
|
|
2633
|
-
b: 1e9,
|
|
2634
|
-
billion: 1e9
|
|
2635
|
-
};
|
|
2636
|
-
INSTRUMENT_TOKENS = [
|
|
2637
|
-
// vital signs + components
|
|
2638
|
-
"freshness",
|
|
2639
|
-
"flow_rate",
|
|
2640
|
-
"flow rate",
|
|
2641
|
-
"drop_rate",
|
|
2642
|
-
"drop rate",
|
|
2643
|
-
"signal_to_noise",
|
|
2644
|
-
"signal-to-noise",
|
|
2645
|
-
"signal to noise",
|
|
2646
|
-
"thread_depth",
|
|
2647
|
-
"thread depth",
|
|
2648
|
-
"health score",
|
|
2649
|
-
"vital",
|
|
2650
|
-
"gating",
|
|
2651
|
-
"score",
|
|
2652
|
-
// SaaS metrics lane
|
|
2653
|
-
"arr",
|
|
2654
|
-
"nrr",
|
|
2655
|
-
"grr",
|
|
2656
|
-
"net revenue retention",
|
|
2657
|
-
"gross revenue retention",
|
|
2658
|
-
"win rate",
|
|
2659
|
-
"pipeline coverage",
|
|
2660
|
-
"weighted pipeline",
|
|
2661
|
-
"velocity",
|
|
2662
|
-
"deal size",
|
|
2663
|
-
"sales cycle",
|
|
2664
|
-
"conversion",
|
|
2665
|
-
"ltv",
|
|
2666
|
-
"cac",
|
|
2667
|
-
"payback",
|
|
2668
|
-
"magic number",
|
|
2669
|
-
"churn",
|
|
2670
|
-
"expansion",
|
|
2671
|
-
"retention",
|
|
2672
|
-
// countable pipeline entities + states
|
|
2673
|
-
"count",
|
|
2674
|
-
"stale",
|
|
2675
|
-
"stuck",
|
|
2676
|
-
"single-threaded",
|
|
2677
|
-
"single threaded",
|
|
2678
|
-
"zombie",
|
|
2679
|
-
"dollar",
|
|
2680
|
-
"pipeline at risk",
|
|
2681
|
-
"opportunit",
|
|
2682
|
-
"deal",
|
|
2683
|
-
"activity",
|
|
2684
|
-
"activities",
|
|
2685
|
-
"contact",
|
|
2686
|
-
"lead",
|
|
2687
|
-
"account",
|
|
2688
|
-
"segment",
|
|
2689
|
-
"handoff",
|
|
2690
|
-
"past-due",
|
|
2691
|
-
"past due",
|
|
2692
|
-
// the review instrument itself
|
|
2693
|
-
"strategy review",
|
|
2694
|
-
"metric_readings",
|
|
2695
|
-
"vital_sign_readings",
|
|
2696
|
-
"entity count"
|
|
2697
|
-
];
|
|
2698
|
-
ISO_DATE_RE = /^(\d{4})-(\d{2})-(\d{2})/;
|
|
2699
|
-
}
|
|
2700
|
-
});
|
|
2701
|
-
|
|
2702
|
-
// src/ai/strategist.ts
|
|
2703
|
-
function describePlanValidationFailure(text, evidenceText, todayIso) {
|
|
2704
|
-
const raw = parseJsonObjectFromText(text);
|
|
2705
|
-
if (!raw) {
|
|
2706
|
-
if (text.includes("{") && !text.trim().endsWith("}")) {
|
|
2707
|
-
return "JSON object appears truncated (increase brevity: \u22643 workstreams) or incomplete";
|
|
2708
|
-
}
|
|
2709
|
-
return "not parseable as a JSON object (prose or truncated output)";
|
|
2710
|
-
}
|
|
2711
|
-
const result = validateStrategistPlan(raw, { evidenceText, todayIso });
|
|
2712
|
-
if (!result) {
|
|
2713
|
-
return "JSON parsed but no usable workstreams remained after measurability checks (need \u22651 workstream with measurable outcome or dated milestone)";
|
|
2714
|
-
}
|
|
2715
|
-
return "unknown validation failure";
|
|
2716
|
-
}
|
|
2717
|
-
var init_strategist2 = __esm({
|
|
2718
|
-
"src/ai/strategist.ts"() {
|
|
2719
|
-
"use strict";
|
|
2720
|
-
init_types2();
|
|
2721
|
-
init_failover();
|
|
2722
|
-
init_surfaces();
|
|
2723
|
-
init_llm_config();
|
|
2724
|
-
init_repl_api();
|
|
2725
|
-
init_tool_schemas();
|
|
2726
|
-
init_web_search();
|
|
2727
|
-
init_tool_handlers();
|
|
2728
|
-
init_loop_guard();
|
|
2729
|
-
init_thread();
|
|
2730
|
-
init_strategist_prompt();
|
|
2731
|
-
init_strategist_validate();
|
|
2732
|
-
init_strategist_prompt();
|
|
2733
|
-
}
|
|
2734
|
-
});
|
|
2735
|
-
|
|
2736
|
-
// src/ui/layout.ts
|
|
2737
|
-
var init_layout = __esm({
|
|
2738
|
-
"src/ui/layout.ts"() {
|
|
2739
|
-
"use strict";
|
|
2740
|
-
}
|
|
2741
|
-
});
|
|
2742
|
-
|
|
2743
|
-
// src/output/strategy-brief.ts
|
|
2744
|
-
import chalk5 from "chalk";
|
|
2745
|
-
var init_strategy_brief = __esm({
|
|
2746
|
-
"src/output/strategy-brief.ts"() {
|
|
2747
|
-
"use strict";
|
|
2748
|
-
init_theme();
|
|
2749
|
-
init_layout();
|
|
2750
|
-
}
|
|
2751
|
-
});
|
|
2752
|
-
|
|
2753
|
-
// src/output/llm-attribution.ts
|
|
2754
|
-
import chalk6 from "chalk";
|
|
2755
|
-
var init_llm_attribution = __esm({
|
|
2756
|
-
"src/output/llm-attribution.ts"() {
|
|
2757
|
-
"use strict";
|
|
2758
|
-
init_catalog();
|
|
2759
|
-
}
|
|
2760
|
-
});
|
|
2761
|
-
|
|
2762
|
-
// src/whimsy/time-milestones.ts
|
|
2763
|
-
var init_time_milestones = __esm({
|
|
2764
|
-
"src/whimsy/time-milestones.ts"() {
|
|
2765
|
-
"use strict";
|
|
2766
|
-
}
|
|
2767
|
-
});
|
|
2768
|
-
|
|
2769
|
-
// src/whimsy/time-perspectives.ts
|
|
2770
|
-
var TIME_PERSPECTIVES;
|
|
2771
|
-
var init_time_perspectives = __esm({
|
|
2772
|
-
"src/whimsy/time-perspectives.ts"() {
|
|
2773
|
-
"use strict";
|
|
2774
|
-
TIME_PERSPECTIVES = [
|
|
2775
|
-
{ id: "dsotm", category: "music", reference_hours: 0.74, label: "Dark Side of the Moon", template: "\u2248 {ratio}\xD7 through {label}", min_ratio: 1, max_ratio: 200 },
|
|
2776
|
-
{ id: "rush_2112", category: "music", reference_hours: 0.33, label: "2112", template: "\u2248 {ratio}\xD7 through {label}", min_ratio: 2, max_ratio: 200 },
|
|
2777
|
-
{ id: "bohemian_rhapsody", category: "music", reference_hours: 0.1, label: "Bohemian Rhapsody", template: "\u2248 {ratio}\xD7 through {label}", min_ratio: 5, max_ratio: 500 },
|
|
2778
|
-
{ id: "stairway", category: "music", reference_hours: 0.13, label: "Stairway to Heaven", template: "\u2248 {ratio}\xD7 through {label}", min_ratio: 5, max_ratio: 400 },
|
|
2779
|
-
{ id: "podcast_binge", category: "music", reference_hours: 0.75, label: "hour-long podcast episodes", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 2, max_ratio: 300 },
|
|
2780
|
-
{ id: "abbey_road", category: "music", reference_hours: 0.8, label: "Abbey Road", template: "\u2248 {ratio}\xD7 through {label}", min_ratio: 1, max_ratio: 200 },
|
|
2781
|
-
{ id: "iron_maiden_set", category: "music", reference_hours: 2, label: "an Iron Maiden marathon set", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 50 },
|
|
2782
|
-
{ id: "festival_set", category: "music", reference_hours: 1.5, label: "main-stage festival sets", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 100 },
|
|
2783
|
-
{ id: "jazz_club", category: "music", reference_hours: 3, label: "late-night jazz sets", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 80 },
|
|
2784
|
-
{ id: "ring_cycle", category: "music", reference_hours: 15, label: "Wagner's Ring Cycle", template: "\u2248 {pct}% of {label}", min_ratio: 0.1, max_ratio: 2 },
|
|
2785
|
-
{ id: "shrek", category: "film", reference_hours: 1.5, label: "Shrek (the first one)", template: "\u2248 {ratio}\xD7 watching {label}", min_ratio: 1, max_ratio: 150 },
|
|
2786
|
-
{ id: "blockbuster", category: "film", reference_hours: 2.1, label: "average blockbusters", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 100 },
|
|
2787
|
-
{ id: "dune_two", category: "film", reference_hours: 2.75, label: "Dune: Part Two", template: "\u2248 {ratio}\xD7 in theater for {label}", min_ratio: 1, max_ratio: 100 },
|
|
2788
|
-
{ id: "scorsese", category: "film", reference_hours: 3.5, label: "Goodfellas", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 80 },
|
|
2789
|
-
{ id: "godfather", category: "film", reference_hours: 6.5, label: "the Godfather saga", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 20 },
|
|
2790
|
-
{ id: "lotr_extended", category: "film", reference_hours: 11.4, label: "the LOTR extended trilogy", template: "Longer than all of {label}", min_ratio: 1, max_ratio: 50 },
|
|
2791
|
-
{ id: "cooking_brisket", category: "film", reference_hours: 12, label: "low-and-slow brisket cooks", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 30 },
|
|
2792
|
-
{ id: "the_office", category: "film", reference_hours: 68, label: "The Office (full series)", template: "\u2248 {ratio}\xD7 bingeing {label}", min_ratio: 5, max_ratio: 200 },
|
|
2793
|
-
{ id: "marvel_marathon", category: "film", reference_hours: 50, label: "an MCU Phase One marathon", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 30 },
|
|
2794
|
-
{ id: "around_world", category: "film", reference_hours: 1920, label: "Around the World in 80 Days (fictionally)", template: "\u2248 {pct}% of {label}", min_ratio: 0.3, max_ratio: 1 },
|
|
2795
|
-
{ id: "soccer_match", category: "sports", reference_hours: 1.75, label: "Premier League matches", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 150 },
|
|
2796
|
-
{ id: "marathon", category: "sports", reference_hours: 2, label: "marathons at world-record pace", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 80 },
|
|
2797
|
-
{ id: "baseball_game", category: "sports", reference_hours: 3, label: "nine-inning baseball games", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 80 },
|
|
2798
|
-
{ id: "superbowl", category: "sports", reference_hours: 3.5, label: "Super Bowls", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 80 },
|
|
2799
|
-
{ id: "nfl_game", category: "sports", reference_hours: 3.25, label: "NFL games (with commercials)", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 50 },
|
|
2800
|
-
{ id: "wimbledon", category: "sports", reference_hours: 5, label: "Wimbledon finals", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 30 },
|
|
2801
|
-
{ id: "tour_stage", category: "sports", reference_hours: 4.5, label: "Tour de France stages", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 60 },
|
|
2802
|
-
{ id: "olympics", category: "sports", reference_hours: 250, label: "Summer Olympics broadcast hours", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 2, max_ratio: 10 },
|
|
2803
|
-
{ id: "moon_light", category: "cosmos", reference_hours: 1.3 / 3600, label: "a beam of light Earth \u2192 Moon", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1e3, max_ratio: 1e6 },
|
|
2804
|
-
{ id: "iss_orbit", category: "cosmos", reference_hours: 1.5, label: "ISS orbits", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 2, max_ratio: 200 },
|
|
2805
|
-
{ id: "light_sun", category: "cosmos", reference_hours: 8.3, label: "solar light crossing to Earth", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 200 },
|
|
2806
|
-
{ id: "sleep_cycle", category: "cosmos", reference_hours: 8, label: "full nights of sleep", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 150 },
|
|
2807
|
-
{ id: "red_eye", category: "cosmos", reference_hours: 5.5, label: "transcontinental red-eyes", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 100 },
|
|
2808
|
-
{ id: "mayfly", category: "cosmos", reference_hours: 24, label: "a mayfly's entire adult life", template: "\u2248 {pct}% of {label}", min_ratio: 0.1, max_ratio: 2 },
|
|
2809
|
-
{ id: "earth_rotation", category: "cosmos", reference_hours: 24, label: "Earth rotations", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.1, max_ratio: 50 },
|
|
2810
|
-
{ id: "jupiter_storm", category: "cosmos", reference_hours: 150, label: "Jupiter's Great Red Spot rotation", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 15 },
|
|
2811
|
-
{ id: "lunar_month", category: "cosmos", reference_hours: 708, label: "a lunar cycle", template: "\u2248 {pct}% of {label}", min_ratio: 0.05, max_ratio: 2 },
|
|
2812
|
-
{ id: "mars_transit", category: "cosmos", reference_hours: 5110, label: "a one-way Mars transit (optimistic)", template: "\u2248 {pct}% of {label}", min_ratio: 1e-3, max_ratio: 5 },
|
|
2813
|
-
{ id: "calendar_year", category: "cosmos", reference_hours: 8760, label: "all the hours in a calendar year", template: "\u2248 {pct}% of {label}", min_ratio: 0.05, max_ratio: 0.2 },
|
|
2814
|
-
{ id: "standup", category: "gtm", reference_hours: 0.25, label: "daily standups", template: "\u2248 {ratio}\xD7 skipped {label}", min_ratio: 4, max_ratio: 500 },
|
|
2815
|
-
{ id: "quick_sync", category: "gtm", reference_hours: 0.5, label: "avoided 'quick syncs'", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 2, max_ratio: 200 },
|
|
2816
|
-
{ id: "pipeline_review", category: "gtm", reference_hours: 1, label: "weekly pipeline reviews", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 200 },
|
|
2817
|
-
{ id: "forecast_call", category: "gtm", reference_hours: 1.5, label: "forecast calls", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 150 },
|
|
2818
|
-
{ id: "pivot_spiral", category: "gtm", reference_hours: 2, label: "spreadsheet pivot-table spirals", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 100 },
|
|
2819
|
-
{ id: "win_loss", category: "gtm", reference_hours: 4, label: "win/loss interview blocks", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 50 },
|
|
2820
|
-
{ id: "crm_cleanup", category: "gtm", reference_hours: 6, label: "CRM hygiene sprints", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.5, max_ratio: 40 },
|
|
2821
|
-
{ id: "qbr_prep", category: "gtm", reference_hours: 8, label: "QBR prep blocks", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 20 },
|
|
2822
|
-
{ id: "board_deck", category: "gtm", reference_hours: 12, label: "board deck builds", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 0.3, max_ratio: 30 },
|
|
2823
|
-
{ id: "semester", category: "gtm", reference_hours: 400, label: "a college semester of analyst coverage", template: "\u2248 {ratio}\xD7 {label}", min_ratio: 1, max_ratio: 5 },
|
|
2824
|
-
{ id: "business_year", category: "gtm", reference_hours: 2e3, label: "a full-time analyst year", template: "\u2248 {pct}% of {label}", min_ratio: 0.2, max_ratio: 1 }
|
|
2825
|
-
];
|
|
2826
|
-
}
|
|
2827
|
-
});
|
|
2828
|
-
|
|
2829
|
-
// src/whimsy/time-bank-whimsy.ts
|
|
2830
|
-
var init_time_bank_whimsy = __esm({
|
|
2831
|
-
"src/whimsy/time-bank-whimsy.ts"() {
|
|
2832
|
-
"use strict";
|
|
2833
|
-
}
|
|
2834
|
-
});
|
|
2835
|
-
|
|
2836
|
-
// src/whimsy/perspective-rotation.ts
|
|
2837
|
-
var PERSPECTIVE_ROTATE_CALENDAR_MS;
|
|
2838
|
-
var init_perspective_rotation = __esm({
|
|
2839
|
-
"src/whimsy/perspective-rotation.ts"() {
|
|
2840
|
-
"use strict";
|
|
2841
|
-
PERSPECTIVE_ROTATE_CALENDAR_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
2842
|
-
}
|
|
2843
|
-
});
|
|
2844
|
-
|
|
2845
|
-
// src/whimsy/time-bank.ts
|
|
2846
|
-
import chalk7 from "chalk";
|
|
2847
|
-
var init_time_bank = __esm({
|
|
2848
|
-
"src/whimsy/time-bank.ts"() {
|
|
2849
|
-
"use strict";
|
|
2850
|
-
init_progress();
|
|
2851
|
-
init_theme();
|
|
2852
|
-
init_time_milestones();
|
|
2853
|
-
init_time_perspectives();
|
|
2854
|
-
init_time_bank_whimsy();
|
|
2855
|
-
init_perspective_rotation();
|
|
2856
|
-
init_usage_stats();
|
|
2857
|
-
}
|
|
2858
|
-
});
|
|
2859
|
-
|
|
2860
|
-
// src/conversation/strategist-flow.ts
|
|
2861
|
-
import chalk8 from "chalk";
|
|
2862
|
-
function isStrategistIntent(input) {
|
|
2863
|
-
const line = input.trim();
|
|
2864
|
-
if (!line) return false;
|
|
2865
|
-
if (isShipIntent(line)) return false;
|
|
2866
|
-
return STRATEGIST_INTENT_RE.test(line);
|
|
2867
|
-
}
|
|
2868
|
-
function extractObjectiveSeed(input) {
|
|
2869
|
-
const cleaned = input.trim().replace(/^(hey|ok|okay|please|can you|could you|help me|let'?s|i want to|i'?d like to|i need to)\s+/i, "").replace(/^(build|draft|make|create|put together)\s+(me\s+)?(a\s+|the\s+)?(game\s?plan|battle\s?plan|strategy|plan|roadmap)\s*(to|for|around|on)?\s*/i, "").replace(/^strategize\s+(about|around|on|for)?\s*/i, "").trim();
|
|
2870
|
-
return cleaned.length >= 8 ? cleaned : input.trim();
|
|
2871
|
-
}
|
|
2872
|
-
var STRATEGIST_INTENT_RE;
|
|
2873
|
-
var init_strategist_flow = __esm({
|
|
2874
|
-
"src/conversation/strategist-flow.ts"() {
|
|
2875
|
-
"use strict";
|
|
2876
|
-
init_spinner();
|
|
2877
|
-
init_context2();
|
|
2878
|
-
init_handoff_draft();
|
|
2879
|
-
init_repl_api();
|
|
2880
|
-
init_theme();
|
|
2881
|
-
init_prompts();
|
|
2882
|
-
init_health_score();
|
|
2883
|
-
init_divergence();
|
|
2884
|
-
init_strategist();
|
|
2885
|
-
init_strategist2();
|
|
2886
|
-
init_strategy_brief();
|
|
2887
|
-
init_llm_attribution();
|
|
2888
|
-
init_time_bank();
|
|
2889
|
-
init_formatters();
|
|
2890
|
-
STRATEGIST_INTENT_RE = /\b(strateg(y|ize|ic)|game\s?plan|battle\s?plan|roadmap|(build|draft|make|create|put together)\s+(me\s+)?(a\s+|the\s+)?plan\b|plan\s+(to|for)\s+(fix|improv|reduc|recover|hit|reach|get|grow|turn)|how\s+(should|do|can)\s+we\s+(fix|approach|tackle|attack|prioritize|sequence|turn\s+(this|it)\s+around)|what\s+should\s+we\s+(do|fix|tackle|prioritize|focus\s+on)\s+(first|next)|what\s+order\s+should|where\s+(do|should)\s+we\s+start)\b/i;
|
|
2891
|
-
}
|
|
2892
|
-
});
|
|
2893
|
-
|
|
2894
|
-
// src/strategist/strategist-smoke.ts
|
|
2895
|
-
init_strategist_flow();
|
|
2896
|
-
init_phase();
|
|
2897
|
-
init_context2();
|
|
2898
|
-
init_strategist_validate();
|
|
2899
|
-
init_strategist2();
|
|
2900
|
-
init_playbook();
|
|
2901
|
-
init_health_score();
|
|
2902
|
-
var failures = [];
|
|
2903
|
-
function assert(cond, msg) {
|
|
2904
|
-
if (!cond) failures.push(msg);
|
|
2905
|
-
}
|
|
2906
|
-
assert(isStrategistIntent("how should we fix drop rate before the board?"), "strategist intent: how should we fix");
|
|
2907
|
-
assert(isStrategistIntent("build me a game plan to recover pipeline"), "strategist intent: game plan");
|
|
2908
|
-
assert(isStrategistIntent("what should we prioritize first"), "strategist intent: prioritize");
|
|
2909
|
-
assert(!isStrategistIntent("ship a board deck"), "ship intent must not match strategist");
|
|
2910
|
-
assert(!isStrategistIntent("what is our NRR?"), "descriptive question must not match strategist");
|
|
2911
|
-
var seed = extractObjectiveSeed("help me build a plan to fix stale pipeline");
|
|
2912
|
-
assert(seed.includes("stale pipeline"), "objective seed strips lead-in verbs");
|
|
2913
|
-
function mockCtx(partial) {
|
|
2914
|
-
return {
|
|
2915
|
-
sessionId: "2026-07-03-test",
|
|
2916
|
-
sessionFile: "/tmp/test.json",
|
|
2917
|
-
oneShot: false,
|
|
2918
|
-
execution: { mode: "interactive", output: "terminal", color: true, progress: true, quiet: false },
|
|
2919
|
-
snapshot: { computeResult: null, divergences: [] },
|
|
2920
|
-
messages: [],
|
|
2921
|
-
conversation: [],
|
|
2922
|
-
stage: "analyzed",
|
|
2923
|
-
deliverables: [],
|
|
2924
|
-
analysis: defaultSessionAnalysis(),
|
|
2925
|
-
wizardDepth: 0,
|
|
2926
|
-
attachments: [],
|
|
2927
|
-
deliverIntent: false,
|
|
2928
|
-
computeInProgress: false,
|
|
2929
|
-
dataset: { counts: { opportunities: 10 } },
|
|
2930
|
-
...partial
|
|
2931
|
-
};
|
|
2932
|
-
}
|
|
2933
|
-
assert(
|
|
2934
|
-
resolveConversationPhase(mockCtx({ strategistState: { step: "objective_confirm", objective: "fix freshness" } })) === "strategize",
|
|
2935
|
-
"objective_confirm \u2192 strategize phase"
|
|
2936
|
-
);
|
|
2937
|
-
assert(
|
|
2938
|
-
resolveConversationPhase(
|
|
2939
|
-
mockCtx({
|
|
2940
|
-
strategistState: { step: "awaiting_analysis", objective: "fix pipeline" },
|
|
2941
|
-
stage: "new",
|
|
2942
|
-
scope: { intent_summary: "health", primary_lens: "gtm_health", confirmed_at: (/* @__PURE__ */ new Date()).toISOString() }
|
|
2943
|
-
})
|
|
2944
|
-
) === "awaiting_data",
|
|
2945
|
-
"awaiting_analysis rides normal funnel (not strategize)"
|
|
2946
|
-
);
|
|
2947
|
-
var evidence = JSON.stringify({
|
|
2948
|
-
vital_signs: { freshness: { score: 29, dollar_value: 31e5 } }
|
|
2949
|
-
});
|
|
2950
|
-
var today = "2026-07-03";
|
|
2951
|
-
var validPlan = {
|
|
2952
|
-
title: "Q4 Pipeline Recovery",
|
|
2953
|
-
objective: "Cut stale pipeline before board",
|
|
2954
|
-
summary_30k: "Freshness gates everything.",
|
|
2955
|
-
hypothesis: "Cleaning stale deals unlocks flow fixes.",
|
|
2956
|
-
target_segment: "Enterprise pipeline",
|
|
2957
|
-
priority: "high",
|
|
2958
|
-
review_cadence: "Weekly",
|
|
2959
|
-
confidence: 0.7,
|
|
2960
|
-
constraints: ["6 rep-hours/week"],
|
|
2961
|
-
assumptions: [],
|
|
2962
|
-
risks: ["Rep capacity"],
|
|
2963
|
-
workstreams: [
|
|
2964
|
-
{
|
|
2965
|
-
order: 1,
|
|
2966
|
-
title: "Clean dead pipeline",
|
|
2967
|
-
problem: "Stale deals block trust in the pipeline number",
|
|
2968
|
-
rationale: "Freshness is the gating vital sign",
|
|
2969
|
-
play_ids: ["clean-dead-pipeline"],
|
|
2970
|
-
actions: ["Pull stale list", "Re-engage or close"],
|
|
2971
|
-
effort_hours: 12,
|
|
2972
|
-
milestones: [{ label: "Stale list triaged", due: "2026-07-17", verification: "stale count < 40" }],
|
|
2973
|
-
deliverables: [{ label: "Re-engagement sequence", kind: "artifact", due: "2026-07-24" }],
|
|
2974
|
-
expected_outcome: {
|
|
2975
|
-
metric: "freshness score",
|
|
2976
|
-
baseline: "29",
|
|
2977
|
-
target_range: "45\u201355",
|
|
2978
|
-
check_date: "2026-08-01",
|
|
2979
|
-
measured_by: "freshness vital sign score"
|
|
2980
|
-
},
|
|
2981
|
-
leading_indicators: [
|
|
2982
|
-
{
|
|
2983
|
-
metric: "stale deal count",
|
|
2984
|
-
baseline: "120",
|
|
2985
|
-
target_range: "80\u201390",
|
|
2986
|
-
check_date: "2026-07-20",
|
|
2987
|
-
measured_by: "freshness entity_details stale count"
|
|
2988
|
-
}
|
|
2989
|
-
],
|
|
2990
|
-
contingency: {
|
|
2991
|
-
trigger: "stale count flat by week 2",
|
|
2992
|
-
trigger_check_date: "2026-07-20",
|
|
2993
|
-
fallback: "Descope to top-2 segments only"
|
|
2994
|
-
}
|
|
2995
|
-
}
|
|
2996
|
-
]
|
|
2997
|
-
};
|
|
2998
|
-
var validated = validateStrategistPlan(validPlan, { evidenceText: evidence + " score 29 dollar 3100000 stale 120", todayIso: today });
|
|
2999
|
-
assert(validated !== null, "valid plan parses");
|
|
3000
|
-
assert(validated.plan.workstreams.length === 1, "valid plan keeps workstream");
|
|
3001
|
-
assert(validated.measurableTargets >= 1, "valid plan has measurable targets");
|
|
3002
|
-
assert(isKnownInstrument("freshness vital sign score"), "freshness is known instrument");
|
|
3003
|
-
var vaguePlan = {
|
|
3004
|
-
...validPlan,
|
|
3005
|
-
workstreams: [
|
|
3006
|
-
{
|
|
3007
|
-
...validPlan.workstreams[0],
|
|
3008
|
-
expected_outcome: {
|
|
3009
|
-
metric: "team morale",
|
|
3010
|
-
baseline: "low",
|
|
3011
|
-
target_range: "much better",
|
|
3012
|
-
check_date: "2026-08-01",
|
|
3013
|
-
measured_by: "gut feel"
|
|
3014
|
-
}
|
|
3015
|
-
}
|
|
3016
|
-
]
|
|
3017
|
-
};
|
|
3018
|
-
var demoted = validateStrategistPlan(vaguePlan, { evidenceText: evidence, todayIso: today });
|
|
3019
|
-
assert(demoted !== null, "vague plan still returns structure");
|
|
3020
|
-
assert(demoted.plan.assumptions.length > 0, "vague outcome demoted to assumptions");
|
|
3021
|
-
var vitals = ["freshness", "flow_rate", "thread_depth"].map((sign) => ({
|
|
3022
|
-
vital_sign: sign,
|
|
3023
|
-
score: sign === "freshness" ? 29 : sign === "flow_rate" ? 40 : 70,
|
|
3024
|
-
status: sign === "freshness" ? "red" : "yellow",
|
|
3025
|
-
dollar_value: sign === "freshness" ? 31e5 : null,
|
|
3026
|
-
dollar_label: sign === "freshness" ? "pipeline at risk" : null
|
|
3027
|
-
}));
|
|
3028
|
-
var triggered = matchTriggeredPlays(vitals, LAYERS);
|
|
3029
|
-
assert(triggered.length >= 1, "keyless skeleton triggers at least one play");
|
|
3030
|
-
assert(triggered[0].layer === 1, "first triggered play respects LAYERS order (freshness first)");
|
|
3031
|
-
var nums = extractNumbers("$3.1M stale pipeline, 120 deals");
|
|
3032
|
-
assert(nums.some((n) => n >= 3e6), "extractNumbers parses $3.1M");
|
|
3033
|
-
assert(
|
|
3034
|
-
describePlanValidationFailure("not json at all", evidence, today).includes("not parseable"),
|
|
3035
|
-
"describePlanValidationFailure: prose \u2192 not parseable"
|
|
3036
|
-
);
|
|
3037
|
-
assert(
|
|
3038
|
-
describePlanValidationFailure('{"title":"x","workstreams":[]}', evidence, today).includes("no usable workstreams"),
|
|
3039
|
-
"describePlanValidationFailure: empty workstreams \u2192 demoted message"
|
|
3040
|
-
);
|
|
3041
|
-
assert(
|
|
3042
|
-
describePlanValidationFailure('{"title":"cut off", "workstreams": [{"title":', evidence, today).includes("truncated"),
|
|
3043
|
-
"describePlanValidationFailure: truncated JSON \u2192 truncated message"
|
|
3044
|
-
);
|
|
3045
|
-
var fallback = buildGroundedFallbackPlan({
|
|
3046
|
-
objective: "Cut stale pipeline in half before Q4",
|
|
3047
|
-
vitals: ["freshness", "flow_rate", "drop_rate", "signal_to_noise", "thread_depth"].map(
|
|
3048
|
-
(sign) => ({
|
|
3049
|
-
vital_sign: sign,
|
|
3050
|
-
score: sign === "freshness" ? 29 : sign === "flow_rate" ? 40 : 70,
|
|
3051
|
-
status: sign === "freshness" ? "red" : sign === "flow_rate" ? "red" : "yellow",
|
|
3052
|
-
dollar_value: sign === "freshness" ? 31e5 : sign === "flow_rate" ? 12e5 : null,
|
|
3053
|
-
dollar_label: sign === "freshness" ? "pipeline at risk" : sign === "flow_rate" ? "stuck in pipeline" : null
|
|
3054
|
-
})
|
|
3055
|
-
),
|
|
3056
|
-
todayIso: today,
|
|
3057
|
-
gatingVitalSign: "freshness",
|
|
3058
|
-
totalValueAtRisk: 43e5
|
|
3059
|
-
});
|
|
3060
|
-
assert(fallback.plan.workstreams.length >= 1, "grounded fallback has workstreams");
|
|
3061
|
-
assert(fallback.plan.objective.includes("stale pipeline"), "grounded fallback keeps objective");
|
|
3062
|
-
assert(
|
|
3063
|
-
fallback.plan.workstreams.some((ws) => ws.play_ids.includes("clean-dead-pipeline")),
|
|
3064
|
-
"grounded fallback links freshness play"
|
|
3065
|
-
);
|
|
3066
|
-
assert(fallback.issues.some((i) => i.includes("grounded fallback")), "grounded fallback records issue");
|
|
3067
|
-
if (failures.length > 0) {
|
|
3068
|
-
console.error("FAIL strategist-smoke:");
|
|
3069
|
-
for (const f of failures) console.error(" -", f);
|
|
3070
|
-
process.exit(1);
|
|
3071
|
-
}
|
|
3072
|
-
console.log("PASS strategist-smoke");
|
|
3073
|
-
//# sourceMappingURL=strategist-smoke.js.map
|