groundwork-mcp 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1113 @@
1
+ import { z } from 'zod';
2
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
+
4
+ type ID = string;
5
+ type SourceType = "interview" | "support" | "survey" | "analytics" | "observation";
6
+ type Sentiment = "negative" | "neutral" | "positive";
7
+ /** The id of a product area defined by the workspace. Experiments take theirs from their hypothesis. */
8
+ type ProductArea = string;
9
+ interface Insight {
10
+ id: ID;
11
+ title: string;
12
+ quote: string;
13
+ source: SourceType;
14
+ persona: string;
15
+ participant?: string;
16
+ tags: string[];
17
+ sentiment: Sentiment;
18
+ productArea?: ProductArea;
19
+ createdAt: string;
20
+ createdBy: string;
21
+ }
22
+ type HypothesisStatus = "draft" | "testing" | "validated" | "invalidated";
23
+ /** A 1–5 rating. 3 or more counts as high learning / easy to reverse. */
24
+ type Score = 1 | 2 | 3 | 4 | 5;
25
+ /**
26
+ * Where a hypothesis sits on Learning value × Reversibility, rated by the PM or the team.
27
+ * Source: Jeff Gothelf, "How to prioritize your backlog when effort is no longer the constraint".
28
+ */
29
+ interface Prioritization {
30
+ learning: Score;
31
+ reversibility: Score;
32
+ /** Why the learning score: what building it would teach us */
33
+ teaches: string;
34
+ /** Why the reversibility score: what undoing it would take */
35
+ toUndo: string;
36
+ ratedAt: string;
37
+ /** "coach" = rated while writing the hypothesis; "round" = rated in a prioritization round. */
38
+ ratedIn: "coach" | "round";
39
+ }
40
+ /** The PM's own definition of success: one number, a baseline, a bar and a timeframe. */
41
+ interface SuccessMetric {
42
+ name: string;
43
+ unit: string;
44
+ baseline: number;
45
+ target: number;
46
+ direction: "decrease" | "increase";
47
+ /** e.g. "over a 4-week pilot" */
48
+ timeframe: string;
49
+ }
50
+ interface Hypothesis {
51
+ id: ID;
52
+ title: string;
53
+ /** "We believe we will [achieve] [outcome]": the business result the team is after. */
54
+ outcome: string;
55
+ /** "…if [forWhom]": the users. */
56
+ forWhom: string;
57
+ /** "…[get] [benefit]": what the users gain, in their terms. */
58
+ benefit: string;
59
+ /** "…with [feature]": the product idea, written by the PM. */
60
+ feature: string;
61
+ /** Plain-language success statement. Composed from successMetric + guardrail when those are set. */
62
+ knowWhen: string;
63
+ /** What target users rely on today: competitors, workarounds, or doing nothing. */
64
+ alternatives?: string;
65
+ /** Why this solution wins against those alternatives. */
66
+ edge?: string;
67
+ successMetric?: SuccessMetric;
68
+ /** What must not get worse while chasing the success metric. */
69
+ guardrail?: string;
70
+ /** What must be true for this to work; the thing most likely to kill it. */
71
+ riskiestAssumption?: string;
72
+ /** Learning value × reversibility rating. Unset until the PM prioritizes it. */
73
+ priority?: Prioritization;
74
+ status: HypothesisStatus;
75
+ productArea?: ProductArea;
76
+ confidence: number;
77
+ insightIds: ID[];
78
+ owner: string;
79
+ createdAt: string;
80
+ updatedAt: string;
81
+ aiGenerated?: boolean;
82
+ }
83
+ type ExperimentMethod = "pilot" | "ab-test" | "prototype-test" | "survey" | "fake-door" | "concierge";
84
+ type ExperimentStatus = "planned" | "running" | "completed";
85
+ interface Metric {
86
+ name: string;
87
+ unit: string;
88
+ baseline: number;
89
+ /** For "decrease" metrics success means actual <= target; for "increase", actual >= target. */
90
+ target: number;
91
+ direction: "decrease" | "increase";
92
+ actual?: number;
93
+ }
94
+ type Verdict = "validated" | "invalidated" | "inconclusive";
95
+ interface Experiment {
96
+ id: ID;
97
+ hypothesisId: ID;
98
+ title: string;
99
+ method: ExperimentMethod;
100
+ description: string;
101
+ primaryMetric: Metric;
102
+ guardrails: Metric[];
103
+ sampleSize: string;
104
+ durationWeeks: number;
105
+ status: ExperimentStatus;
106
+ startDate?: string;
107
+ endDate?: string;
108
+ resultNotes?: string;
109
+ /** For small bets: the date to check whether it made a meaningful difference (YYYY-MM-DD). */
110
+ checkBackDate?: string;
111
+ verdict?: Verdict;
112
+ owner: string;
113
+ aiGenerated?: boolean;
114
+ }
115
+ interface Finding {
116
+ id: ID;
117
+ title: string;
118
+ summary: string;
119
+ experimentIds: ID[];
120
+ hypothesisIds: ID[];
121
+ insightIds: ID[];
122
+ confidence: "low" | "medium" | "high";
123
+ productArea?: ProductArea;
124
+ createdAt: string;
125
+ aiGenerated?: boolean;
126
+ }
127
+ type Priority = "must" | "should" | "could";
128
+ /**
129
+ * "draft" can still be edited in place. Only an "approved" requirement can be made "obsolete",
130
+ * e.g. when newer evidence supersedes it.
131
+ */
132
+ type RequirementStatus = "draft" | "awaiting-approval" | "approved" | "in-delivery" | "obsolete";
133
+ /**
134
+ * Stakeholder requirements state what a group of stakeholders needs, in their terms.
135
+ * Solution requirements state what the product must do to meet one or more of those needs,
136
+ * for a specific product and product area.
137
+ */
138
+ type RequirementKind = "stakeholder" | "solution";
139
+ /**
140
+ * Why a requirement was created directly, without hypotheses or experiments: the decision to
141
+ * build it was already made elsewhere. Unset for requirements derived from findings.
142
+ */
143
+ type RequirementOrigin = "tender" | "regulation" | "contract" | "customer-need";
144
+ /** Linear's workflow state categories. */
145
+ type DeliveryStateType = "triage" | "backlog" | "unstarted" | "started" | "completed" | "canceled";
146
+ /** The issue a requirement became in the team's delivery tool. */
147
+ interface Delivery {
148
+ tracker: "linear";
149
+ issueId: string;
150
+ /** e.g. "MER-142" */
151
+ identifier: string;
152
+ url?: string;
153
+ /** Linear's status for the issue, as of `syncedAt`. */
154
+ state: {
155
+ name: string;
156
+ type: DeliveryStateType;
157
+ };
158
+ sentAt: string;
159
+ syncedAt: string;
160
+ }
161
+ /** The Linear team approved requirements are sent to. Unset until a workspace owner connects Linear. */
162
+ interface DeliverySettings {
163
+ teamId?: string;
164
+ teamKey?: string;
165
+ teamName?: string;
166
+ }
167
+ interface Requirement {
168
+ id: ID;
169
+ /** Unset on requirements saved before the split; treat as "solution". */
170
+ kind?: RequirementKind;
171
+ title: string;
172
+ /** Stakeholder requirements: the need statement. Solution requirements: the user story. */
173
+ story: string;
174
+ /** Stakeholder requirements: who has the need, e.g. "Finance managers". */
175
+ stakeholder?: string;
176
+ /** Solution requirements: the product that delivers it, e.g. "Acme mobile app". */
177
+ product?: string;
178
+ /** Solution requirements: the stakeholder requirements this one helps meet. */
179
+ stakeholderIds?: ID[];
180
+ acceptanceCriteria: string[];
181
+ priority: Priority;
182
+ status: RequirementStatus;
183
+ productArea?: ProductArea;
184
+ /** Who needs to sign this off while it is awaiting approval. */
185
+ approver?: string;
186
+ approvedBy?: string;
187
+ approvedAt?: string;
188
+ findingIds: ID[];
189
+ /** Set when the requirement was created directly: decided, not validated by an experiment. */
190
+ origin?: RequirementOrigin;
191
+ /** Where the decision comes from, e.g. "Region North tender 2026, section 4.2". */
192
+ originNote?: string;
193
+ /** Customer evidence linked directly, not through findings. */
194
+ insightIds?: ID[];
195
+ /** Hypotheses this was committed from, e.g. one that landed in "Stay out of this box". */
196
+ hypothesisIds?: ID[];
197
+ /** Set when the requirement was made obsolete: the requirements that replaced it. */
198
+ obsoletedBy?: ID[];
199
+ obsoletedAt?: string;
200
+ createdAt: string;
201
+ /** Last time an existing requirement was rewritten, e.g. a draft updated from a new finding. */
202
+ updatedAt?: string;
203
+ aiGenerated?: boolean;
204
+ /** Set once the requirement was sent to Linear. */
205
+ delivery?: Delivery;
206
+ }
207
+ interface Activity {
208
+ id: ID;
209
+ at: string;
210
+ actor: string;
211
+ text: string;
212
+ kind: "insight" | "hypothesis" | "experiment" | "finding" | "requirement";
213
+ refId?: ID;
214
+ /** Set when a coding agent made the change: the name of the token it used, e.g. "Claude Code". */
215
+ via?: string;
216
+ }
217
+
218
+ /** A workspace's items, by collection. Shared by the local file store and the hosted app. */
219
+ interface Collections {
220
+ insights: Insight[];
221
+ hypotheses: Hypothesis[];
222
+ experiments: Experiment[];
223
+ findings: Finding[];
224
+ requirements: Requirement[];
225
+ activity: Activity[];
226
+ }
227
+ declare const COLLECTION_KIND: {
228
+ readonly insights: "insight";
229
+ readonly hypotheses: "hypothesis";
230
+ readonly experiments: "experiment";
231
+ readonly findings: "finding";
232
+ readonly requirements: "requirement";
233
+ readonly activity: "activity";
234
+ };
235
+ declare const COLLECTION_KEYS: (keyof Collections)[];
236
+ declare const emptyCollections: () => Collections;
237
+ interface Upsert {
238
+ id: string;
239
+ kind: string;
240
+ data: Record<string, unknown>;
241
+ }
242
+ /**
243
+ * The new, changed and removed items between two snapshots. Items are compared by object identity, which is
244
+ * cheap and right because every change makes a new object.
245
+ */
246
+ declare function diffCollections(before: Collections, after: Collections): {
247
+ upserts: Upsert[];
248
+ deletes: string[];
249
+ };
250
+
251
+ /** Requirements saved before the stakeholder / solution split are solution requirements. */
252
+ declare function kindOf(r: Pick<Requirement, "kind">): RequirementKind;
253
+ declare const isObsolete: (r: Pick<Requirement, "status">) => boolean;
254
+ /** Only approved requirements can be made obsolete. Drafts are updated in place instead. */
255
+ declare const canObsolete: (r: Pick<Requirement, "status">) => boolean;
256
+ declare const canUpdateInPlace: (r: Pick<Requirement, "status">) => boolean;
257
+ /** Only approved solution requirements go to a delivery tool, and only once. */
258
+ declare const canSendToDelivery: (r: Pick<Requirement, "kind" | "status" | "delivery">) => boolean;
259
+ /** New requirements, rewritten drafts and approved requirements made obsolete, decided together. */
260
+ interface RequirementChanges {
261
+ create: Requirement[];
262
+ update: {
263
+ id: ID;
264
+ patch: Partial<Requirement>;
265
+ }[];
266
+ obsolete: {
267
+ id: ID;
268
+ by: ID;
269
+ }[];
270
+ }
271
+
272
+ declare function metricPasses(m: Metric): boolean | undefined;
273
+ interface VerdictResult {
274
+ verdict: Verdict;
275
+ reason: string;
276
+ }
277
+ /** The heart of the experiment loop: compare results against the success criteria. */
278
+ declare function computeVerdict(exp: Experiment): VerdictResult;
279
+ declare function fmtMetric(m: Metric, v: number): string;
280
+ declare function targetLabel(m: Metric): string;
281
+
282
+ /**
283
+ * Every change to workspace items, as pure functions: a snapshot and a context in, the changed collections out.
284
+ * Groundwork's local MCP server and the hosted app both run these, so the rules (defaults, cascades, verdicts,
285
+ * status changes, activity entries) live in one place.
286
+ */
287
+ interface Ctx {
288
+ /** User id of the person acting. */
289
+ actor: string;
290
+ /** One timestamp for the whole change. */
291
+ now: string;
292
+ newId: () => string;
293
+ /** Set when an agent made the change: the name of the token it used, e.g. "Claude Code". */
294
+ via?: string;
295
+ }
296
+ interface Change<R = void> {
297
+ next: Partial<Collections>;
298
+ result: R;
299
+ }
300
+ /** The most common area among linked items, so new items inherit one from their evidence. */
301
+ declare function dominantArea(items: {
302
+ productArea?: ProductArea;
303
+ }[]): ProductArea | undefined;
304
+ type NewInsight = Omit<Insight, "id" | "createdAt" | "createdBy">;
305
+ declare function addInsights(s: Collections, c: Ctx, items: NewInsight[]): Change<Insight[]>;
306
+ declare function updateInsight(s: Collections, id: string, patch: Partial<Insight>): Change;
307
+ declare function deleteInsight(s: Collections, id: string): Change;
308
+ type NewHypothesis = Omit<Hypothesis, "id" | "createdAt" | "updatedAt" | "owner">;
309
+ declare function addHypotheses(s: Collections, c: Ctx, items: NewHypothesis[]): Change<Hypothesis[]>;
310
+ declare function updateHypothesis(s: Collections, c: Ctx, id: string, patch: Partial<Hypothesis>): Change;
311
+ declare function prioritizeMany(s: Collections, c: Ctx, ratings: {
312
+ id: string;
313
+ priority: Prioritization;
314
+ }[]): Change;
315
+ /** Deleting a hypothesis deletes its experiments too. */
316
+ declare function deleteHypothesis(s: Collections, id: string): Change;
317
+ type NewExperiment = Omit<Experiment, "id" | "owner">;
318
+ declare function addExperiment(s: Collections, c: Ctx, item: NewExperiment): Change<Experiment>;
319
+ declare function updateExperiment(s: Collections, id: string, patch: Partial<Experiment>): Change;
320
+ /** Starting an experiment moves a draft hypothesis to "testing". */
321
+ declare function startExperiment(s: Collections, c: Ctx, id: string): Change;
322
+ interface RecordedResult {
323
+ result: VerdictResult;
324
+ prevConfidence: number;
325
+ }
326
+ /** Record results, compute the verdict and move the hypothesis to validated or invalidated. */
327
+ declare function recordResults(s: Collections, c: Ctx, id: string, primaryActual: number, guardrailActuals: number[], notes: string): Change<RecordedResult | undefined>;
328
+ declare function deleteExperiment(s: Collections, id: string): Change;
329
+ type NewFinding = Omit<Finding, "id" | "createdAt">;
330
+ declare function addFindings(s: Collections, c: Ctx, items: NewFinding[]): Change<Finding[]>;
331
+ declare function updateFinding(s: Collections, id: string, patch: Partial<Finding>): Change;
332
+ declare function deleteFinding(s: Collections, id: string): Change;
333
+ type DerivedRequirement = Omit<Requirement, "id" | "createdAt" | "status">;
334
+ type DirectRequirement = Omit<Requirement, "id" | "createdAt" | "findingIds">;
335
+ /** Requirements derived from findings. They start as drafts. */
336
+ declare function addRequirements(s: Collections, c: Ctx, items: DerivedRequirement[]): Change<Requirement[]>;
337
+ /** A requirement created directly, bypassing hypotheses and experiments: the decision is already made. */
338
+ declare function createRequirement(s: Collections, c: Ctx, item: DirectRequirement): Change<Requirement>;
339
+ declare function updateRequirement(s: Collections, id: string, patch: Partial<Requirement>): Change;
340
+ declare function deleteRequirement(s: Collections, id: string): Change;
341
+ /** Ask someone to sign off a draft. */
342
+ declare function submitRequirement(s: Collections, c: Ctx, id: string, approver: string): Change<boolean>;
343
+ declare function approveRequirement(s: Collections, c: Ctx, id: string): Change<boolean>;
344
+ declare function sendBackRequirement(s: Collections, c: Ctx, id: string): Change<boolean>;
345
+ declare function obsoleteRequirement(s: Collections, c: Ctx, id: string, by?: string[]): Change<boolean>;
346
+ /** Save the outcome of deriving requirements: new ones, updated drafts, and approved ones made obsolete. */
347
+ declare function applyRequirementChanges(s: Collections, c: Ctx, { create, update, obsolete }: RequirementChanges): Change;
348
+ /** Record the Linear issue an approved requirement became, and move it to "in delivery". */
349
+ declare function markSentToDelivery(s: Collections, c: Ctx, id: string, delivery: Delivery): Change<boolean>;
350
+ declare function updateDeliveryStates(s: Collections, byRequirement: Record<string, Delivery>): Change;
351
+
352
+ type ops_Change<R = void> = Change<R>;
353
+ type ops_Ctx = Ctx;
354
+ type ops_DerivedRequirement = DerivedRequirement;
355
+ type ops_DirectRequirement = DirectRequirement;
356
+ type ops_NewExperiment = NewExperiment;
357
+ type ops_NewFinding = NewFinding;
358
+ type ops_NewHypothesis = NewHypothesis;
359
+ type ops_NewInsight = NewInsight;
360
+ type ops_RecordedResult = RecordedResult;
361
+ declare const ops_addExperiment: typeof addExperiment;
362
+ declare const ops_addFindings: typeof addFindings;
363
+ declare const ops_addHypotheses: typeof addHypotheses;
364
+ declare const ops_addInsights: typeof addInsights;
365
+ declare const ops_addRequirements: typeof addRequirements;
366
+ declare const ops_applyRequirementChanges: typeof applyRequirementChanges;
367
+ declare const ops_approveRequirement: typeof approveRequirement;
368
+ declare const ops_createRequirement: typeof createRequirement;
369
+ declare const ops_deleteExperiment: typeof deleteExperiment;
370
+ declare const ops_deleteFinding: typeof deleteFinding;
371
+ declare const ops_deleteHypothesis: typeof deleteHypothesis;
372
+ declare const ops_deleteInsight: typeof deleteInsight;
373
+ declare const ops_deleteRequirement: typeof deleteRequirement;
374
+ declare const ops_dominantArea: typeof dominantArea;
375
+ declare const ops_markSentToDelivery: typeof markSentToDelivery;
376
+ declare const ops_obsoleteRequirement: typeof obsoleteRequirement;
377
+ declare const ops_prioritizeMany: typeof prioritizeMany;
378
+ declare const ops_recordResults: typeof recordResults;
379
+ declare const ops_sendBackRequirement: typeof sendBackRequirement;
380
+ declare const ops_startExperiment: typeof startExperiment;
381
+ declare const ops_submitRequirement: typeof submitRequirement;
382
+ declare const ops_updateDeliveryStates: typeof updateDeliveryStates;
383
+ declare const ops_updateExperiment: typeof updateExperiment;
384
+ declare const ops_updateFinding: typeof updateFinding;
385
+ declare const ops_updateHypothesis: typeof updateHypothesis;
386
+ declare const ops_updateInsight: typeof updateInsight;
387
+ declare const ops_updateRequirement: typeof updateRequirement;
388
+ declare namespace ops {
389
+ export { type ops_Change as Change, type ops_Ctx as Ctx, type ops_DerivedRequirement as DerivedRequirement, type ops_DirectRequirement as DirectRequirement, type ops_NewExperiment as NewExperiment, type ops_NewFinding as NewFinding, type ops_NewHypothesis as NewHypothesis, type ops_NewInsight as NewInsight, type ops_RecordedResult as RecordedResult, ops_addExperiment as addExperiment, ops_addFindings as addFindings, ops_addHypotheses as addHypotheses, ops_addInsights as addInsights, ops_addRequirements as addRequirements, ops_applyRequirementChanges as applyRequirementChanges, ops_approveRequirement as approveRequirement, ops_createRequirement as createRequirement, ops_deleteExperiment as deleteExperiment, ops_deleteFinding as deleteFinding, ops_deleteHypothesis as deleteHypothesis, ops_deleteInsight as deleteInsight, ops_deleteRequirement as deleteRequirement, ops_dominantArea as dominantArea, ops_markSentToDelivery as markSentToDelivery, ops_obsoleteRequirement as obsoleteRequirement, ops_prioritizeMany as prioritizeMany, ops_recordResults as recordResults, ops_sendBackRequirement as sendBackRequirement, ops_startExperiment as startExperiment, ops_submitRequirement as submitRequirement, ops_updateDeliveryStates as updateDeliveryStates, ops_updateExperiment as updateExperiment, ops_updateFinding as updateFinding, ops_updateHypothesis as updateHypothesis, ops_updateInsight as updateInsight, ops_updateRequirement as updateRequirement };
390
+ }
391
+
392
+ declare const SOURCE: z.ZodEnum<{
393
+ interview: "interview";
394
+ support: "support";
395
+ survey: "survey";
396
+ analytics: "analytics";
397
+ observation: "observation";
398
+ }>;
399
+ declare const SENTIMENT: z.ZodEnum<{
400
+ negative: "negative";
401
+ neutral: "neutral";
402
+ positive: "positive";
403
+ }>;
404
+ declare const HYPOTHESIS_STATUS: z.ZodEnum<{
405
+ draft: "draft";
406
+ testing: "testing";
407
+ validated: "validated";
408
+ invalidated: "invalidated";
409
+ }>;
410
+ declare const METHOD: z.ZodEnum<{
411
+ survey: "survey";
412
+ pilot: "pilot";
413
+ "ab-test": "ab-test";
414
+ "prototype-test": "prototype-test";
415
+ "fake-door": "fake-door";
416
+ concierge: "concierge";
417
+ }>;
418
+ declare const EXPERIMENT_STATUS: z.ZodEnum<{
419
+ planned: "planned";
420
+ running: "running";
421
+ completed: "completed";
422
+ }>;
423
+ declare const PRIORITY: z.ZodEnum<{
424
+ must: "must";
425
+ should: "should";
426
+ could: "could";
427
+ }>;
428
+ declare const REQUIREMENT_KIND: z.ZodEnum<{
429
+ stakeholder: "stakeholder";
430
+ solution: "solution";
431
+ }>;
432
+ declare const REQUIREMENT_ORIGIN: z.ZodEnum<{
433
+ tender: "tender";
434
+ regulation: "regulation";
435
+ contract: "contract";
436
+ "customer-need": "customer-need";
437
+ }>;
438
+ declare const FINDING_CONFIDENCE: z.ZodEnum<{
439
+ low: "low";
440
+ medium: "medium";
441
+ high: "high";
442
+ }>;
443
+ declare const KIND: z.ZodEnum<{
444
+ insight: "insight";
445
+ hypothesis: "hypothesis";
446
+ experiment: "experiment";
447
+ finding: "finding";
448
+ requirement: "requirement";
449
+ }>;
450
+ type Kind = z.infer<typeof KIND>;
451
+ /** The input shapes for one id format. `id` validates a single item id. */
452
+ declare function makeSchemas(id: z.ZodString): {
453
+ id: z.ZodString;
454
+ insightInput: z.ZodObject<{
455
+ title: z.ZodString;
456
+ quote: z.ZodString;
457
+ source: z.ZodEnum<{
458
+ interview: "interview";
459
+ support: "support";
460
+ survey: "survey";
461
+ analytics: "analytics";
462
+ observation: "observation";
463
+ }>;
464
+ persona: z.ZodString;
465
+ participant: z.ZodOptional<z.ZodString>;
466
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
467
+ sentiment: z.ZodDefault<z.ZodEnum<{
468
+ negative: "negative";
469
+ neutral: "neutral";
470
+ positive: "positive";
471
+ }>>;
472
+ productArea: z.ZodOptional<z.ZodString>;
473
+ }, z.core.$strip>;
474
+ hypothesisInput: z.ZodObject<{
475
+ title: z.ZodString;
476
+ outcome: z.ZodString;
477
+ forWhom: z.ZodString;
478
+ benefit: z.ZodString;
479
+ feature: z.ZodString;
480
+ successMetric: z.ZodOptional<z.ZodObject<{
481
+ name: z.ZodString;
482
+ unit: z.ZodString;
483
+ baseline: z.ZodNumber;
484
+ target: z.ZodNumber;
485
+ direction: z.ZodEnum<{
486
+ decrease: "decrease";
487
+ increase: "increase";
488
+ }>;
489
+ timeframe: z.ZodString;
490
+ }, z.core.$strip>>;
491
+ guardrail: z.ZodOptional<z.ZodString>;
492
+ knowWhen: z.ZodOptional<z.ZodString>;
493
+ alternatives: z.ZodOptional<z.ZodString>;
494
+ edge: z.ZodOptional<z.ZodString>;
495
+ riskiestAssumption: z.ZodOptional<z.ZodString>;
496
+ confidence: z.ZodDefault<z.ZodNumber>;
497
+ insightIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
498
+ productArea: z.ZodOptional<z.ZodString>;
499
+ }, z.core.$strip>;
500
+ experimentInput: z.ZodObject<{
501
+ hypothesisId: z.ZodString;
502
+ title: z.ZodString;
503
+ method: z.ZodEnum<{
504
+ survey: "survey";
505
+ pilot: "pilot";
506
+ "ab-test": "ab-test";
507
+ "prototype-test": "prototype-test";
508
+ "fake-door": "fake-door";
509
+ concierge: "concierge";
510
+ }>;
511
+ description: z.ZodString;
512
+ primaryMetric: z.ZodObject<{
513
+ name: z.ZodString;
514
+ unit: z.ZodString;
515
+ baseline: z.ZodNumber;
516
+ target: z.ZodNumber;
517
+ direction: z.ZodEnum<{
518
+ decrease: "decrease";
519
+ increase: "increase";
520
+ }>;
521
+ }, z.core.$strip>;
522
+ guardrails: z.ZodDefault<z.ZodArray<z.ZodObject<{
523
+ name: z.ZodString;
524
+ unit: z.ZodString;
525
+ baseline: z.ZodNumber;
526
+ target: z.ZodNumber;
527
+ direction: z.ZodEnum<{
528
+ decrease: "decrease";
529
+ increase: "increase";
530
+ }>;
531
+ }, z.core.$strip>>>;
532
+ sampleSize: z.ZodDefault<z.ZodString>;
533
+ durationWeeks: z.ZodDefault<z.ZodNumber>;
534
+ checkBackDate: z.ZodOptional<z.ZodString>;
535
+ }, z.core.$strip>;
536
+ findingInput: z.ZodObject<{
537
+ title: z.ZodString;
538
+ summary: z.ZodString;
539
+ experimentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
540
+ hypothesisIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
541
+ insightIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
542
+ confidence: z.ZodDefault<z.ZodEnum<{
543
+ low: "low";
544
+ medium: "medium";
545
+ high: "high";
546
+ }>>;
547
+ productArea: z.ZodOptional<z.ZodString>;
548
+ }, z.core.$strip>;
549
+ requirementInput: z.ZodObject<{
550
+ kind: z.ZodDefault<z.ZodEnum<{
551
+ stakeholder: "stakeholder";
552
+ solution: "solution";
553
+ }>>;
554
+ title: z.ZodString;
555
+ story: z.ZodString;
556
+ stakeholder: z.ZodOptional<z.ZodString>;
557
+ product: z.ZodOptional<z.ZodString>;
558
+ stakeholderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
559
+ acceptanceCriteria: z.ZodArray<z.ZodString>;
560
+ priority: z.ZodDefault<z.ZodEnum<{
561
+ must: "must";
562
+ should: "should";
563
+ could: "could";
564
+ }>>;
565
+ findingIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
566
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
567
+ hypothesisIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
568
+ origin: z.ZodOptional<z.ZodEnum<{
569
+ tender: "tender";
570
+ regulation: "regulation";
571
+ contract: "contract";
572
+ "customer-need": "customer-need";
573
+ }>>;
574
+ originNote: z.ZodOptional<z.ZodString>;
575
+ productArea: z.ZodOptional<z.ZodString>;
576
+ }, z.core.$strip>;
577
+ PATCHES: {
578
+ readonly insight: z.ZodObject<{
579
+ title: z.ZodOptional<z.ZodString>;
580
+ quote: z.ZodOptional<z.ZodString>;
581
+ source: z.ZodOptional<z.ZodEnum<{
582
+ interview: "interview";
583
+ support: "support";
584
+ survey: "survey";
585
+ analytics: "analytics";
586
+ observation: "observation";
587
+ }>>;
588
+ persona: z.ZodOptional<z.ZodString>;
589
+ participant: z.ZodOptional<z.ZodOptional<z.ZodString>>;
590
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
591
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
592
+ sentiment: z.ZodOptional<z.ZodEnum<{
593
+ negative: "negative";
594
+ neutral: "neutral";
595
+ positive: "positive";
596
+ }>>;
597
+ }, z.core.$strip>;
598
+ readonly hypothesis: z.ZodObject<{
599
+ title: z.ZodOptional<z.ZodString>;
600
+ outcome: z.ZodOptional<z.ZodString>;
601
+ forWhom: z.ZodOptional<z.ZodString>;
602
+ benefit: z.ZodOptional<z.ZodString>;
603
+ feature: z.ZodOptional<z.ZodString>;
604
+ successMetric: z.ZodOptional<z.ZodOptional<z.ZodObject<{
605
+ name: z.ZodString;
606
+ unit: z.ZodString;
607
+ baseline: z.ZodNumber;
608
+ target: z.ZodNumber;
609
+ direction: z.ZodEnum<{
610
+ decrease: "decrease";
611
+ increase: "increase";
612
+ }>;
613
+ timeframe: z.ZodString;
614
+ }, z.core.$strip>>>;
615
+ guardrail: z.ZodOptional<z.ZodOptional<z.ZodString>>;
616
+ knowWhen: z.ZodOptional<z.ZodOptional<z.ZodString>>;
617
+ alternatives: z.ZodOptional<z.ZodOptional<z.ZodString>>;
618
+ edge: z.ZodOptional<z.ZodOptional<z.ZodString>>;
619
+ riskiestAssumption: z.ZodOptional<z.ZodOptional<z.ZodString>>;
620
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
621
+ status: z.ZodOptional<z.ZodEnum<{
622
+ draft: "draft";
623
+ testing: "testing";
624
+ validated: "validated";
625
+ invalidated: "invalidated";
626
+ }>>;
627
+ confidence: z.ZodOptional<z.ZodNumber>;
628
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
629
+ }, z.core.$strip>;
630
+ readonly experiment: z.ZodObject<{
631
+ title: z.ZodOptional<z.ZodString>;
632
+ method: z.ZodOptional<z.ZodEnum<{
633
+ survey: "survey";
634
+ pilot: "pilot";
635
+ "ab-test": "ab-test";
636
+ "prototype-test": "prototype-test";
637
+ "fake-door": "fake-door";
638
+ concierge: "concierge";
639
+ }>>;
640
+ description: z.ZodOptional<z.ZodString>;
641
+ primaryMetric: z.ZodOptional<z.ZodObject<{
642
+ name: z.ZodString;
643
+ unit: z.ZodString;
644
+ baseline: z.ZodNumber;
645
+ target: z.ZodNumber;
646
+ direction: z.ZodEnum<{
647
+ decrease: "decrease";
648
+ increase: "increase";
649
+ }>;
650
+ }, z.core.$strip>>;
651
+ checkBackDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
652
+ guardrails: z.ZodOptional<z.ZodArray<z.ZodObject<{
653
+ name: z.ZodString;
654
+ unit: z.ZodString;
655
+ baseline: z.ZodNumber;
656
+ target: z.ZodNumber;
657
+ direction: z.ZodEnum<{
658
+ decrease: "decrease";
659
+ increase: "increase";
660
+ }>;
661
+ }, z.core.$strip>>>;
662
+ sampleSize: z.ZodOptional<z.ZodString>;
663
+ durationWeeks: z.ZodOptional<z.ZodNumber>;
664
+ resultNotes: z.ZodOptional<z.ZodString>;
665
+ }, z.core.$strip>;
666
+ readonly finding: z.ZodObject<{
667
+ title: z.ZodOptional<z.ZodString>;
668
+ summary: z.ZodOptional<z.ZodString>;
669
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
670
+ experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
671
+ hypothesisIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
672
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
673
+ confidence: z.ZodOptional<z.ZodEnum<{
674
+ low: "low";
675
+ medium: "medium";
676
+ high: "high";
677
+ }>>;
678
+ }, z.core.$strip>;
679
+ readonly requirement: z.ZodObject<{
680
+ title: z.ZodOptional<z.ZodString>;
681
+ story: z.ZodOptional<z.ZodString>;
682
+ stakeholder: z.ZodOptional<z.ZodOptional<z.ZodString>>;
683
+ product: z.ZodOptional<z.ZodOptional<z.ZodString>>;
684
+ stakeholderIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
685
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
686
+ insightIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
687
+ hypothesisIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
688
+ origin: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
689
+ tender: "tender";
690
+ regulation: "regulation";
691
+ contract: "contract";
692
+ "customer-need": "customer-need";
693
+ }>>>;
694
+ originNote: z.ZodOptional<z.ZodOptional<z.ZodString>>;
695
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
696
+ priority: z.ZodOptional<z.ZodEnum<{
697
+ must: "must";
698
+ should: "should";
699
+ could: "could";
700
+ }>>;
701
+ findingIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
702
+ kind: z.ZodOptional<z.ZodEnum<{
703
+ stakeholder: "stakeholder";
704
+ solution: "solution";
705
+ }>>;
706
+ }, z.core.$strip>;
707
+ };
708
+ };
709
+ type Schemas = ReturnType<typeof makeSchemas>;
710
+ /** Readable ids used in files: a kind prefix and a number, e.g. INS-0007. */
711
+ declare const ID_PREFIX: {
712
+ readonly insight: "INS";
713
+ readonly hypothesis: "HYP";
714
+ readonly experiment: "EXP";
715
+ readonly finding: "FND";
716
+ readonly requirement: "REQ";
717
+ };
718
+ declare const LOCAL_ID: RegExp;
719
+ declare const localId: z.ZodString;
720
+ declare const localSchemas: {
721
+ id: z.ZodString;
722
+ insightInput: z.ZodObject<{
723
+ title: z.ZodString;
724
+ quote: z.ZodString;
725
+ source: z.ZodEnum<{
726
+ interview: "interview";
727
+ support: "support";
728
+ survey: "survey";
729
+ analytics: "analytics";
730
+ observation: "observation";
731
+ }>;
732
+ persona: z.ZodString;
733
+ participant: z.ZodOptional<z.ZodString>;
734
+ tags: z.ZodDefault<z.ZodArray<z.ZodString>>;
735
+ sentiment: z.ZodDefault<z.ZodEnum<{
736
+ negative: "negative";
737
+ neutral: "neutral";
738
+ positive: "positive";
739
+ }>>;
740
+ productArea: z.ZodOptional<z.ZodString>;
741
+ }, z.core.$strip>;
742
+ hypothesisInput: z.ZodObject<{
743
+ title: z.ZodString;
744
+ outcome: z.ZodString;
745
+ forWhom: z.ZodString;
746
+ benefit: z.ZodString;
747
+ feature: z.ZodString;
748
+ successMetric: z.ZodOptional<z.ZodObject<{
749
+ name: z.ZodString;
750
+ unit: z.ZodString;
751
+ baseline: z.ZodNumber;
752
+ target: z.ZodNumber;
753
+ direction: z.ZodEnum<{
754
+ decrease: "decrease";
755
+ increase: "increase";
756
+ }>;
757
+ timeframe: z.ZodString;
758
+ }, z.core.$strip>>;
759
+ guardrail: z.ZodOptional<z.ZodString>;
760
+ knowWhen: z.ZodOptional<z.ZodString>;
761
+ alternatives: z.ZodOptional<z.ZodString>;
762
+ edge: z.ZodOptional<z.ZodString>;
763
+ riskiestAssumption: z.ZodOptional<z.ZodString>;
764
+ confidence: z.ZodDefault<z.ZodNumber>;
765
+ insightIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
766
+ productArea: z.ZodOptional<z.ZodString>;
767
+ }, z.core.$strip>;
768
+ experimentInput: z.ZodObject<{
769
+ hypothesisId: z.ZodString;
770
+ title: z.ZodString;
771
+ method: z.ZodEnum<{
772
+ survey: "survey";
773
+ pilot: "pilot";
774
+ "ab-test": "ab-test";
775
+ "prototype-test": "prototype-test";
776
+ "fake-door": "fake-door";
777
+ concierge: "concierge";
778
+ }>;
779
+ description: z.ZodString;
780
+ primaryMetric: z.ZodObject<{
781
+ name: z.ZodString;
782
+ unit: z.ZodString;
783
+ baseline: z.ZodNumber;
784
+ target: z.ZodNumber;
785
+ direction: z.ZodEnum<{
786
+ decrease: "decrease";
787
+ increase: "increase";
788
+ }>;
789
+ }, z.core.$strip>;
790
+ guardrails: z.ZodDefault<z.ZodArray<z.ZodObject<{
791
+ name: z.ZodString;
792
+ unit: z.ZodString;
793
+ baseline: z.ZodNumber;
794
+ target: z.ZodNumber;
795
+ direction: z.ZodEnum<{
796
+ decrease: "decrease";
797
+ increase: "increase";
798
+ }>;
799
+ }, z.core.$strip>>>;
800
+ sampleSize: z.ZodDefault<z.ZodString>;
801
+ durationWeeks: z.ZodDefault<z.ZodNumber>;
802
+ checkBackDate: z.ZodOptional<z.ZodString>;
803
+ }, z.core.$strip>;
804
+ findingInput: z.ZodObject<{
805
+ title: z.ZodString;
806
+ summary: z.ZodString;
807
+ experimentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
808
+ hypothesisIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
809
+ insightIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
810
+ confidence: z.ZodDefault<z.ZodEnum<{
811
+ low: "low";
812
+ medium: "medium";
813
+ high: "high";
814
+ }>>;
815
+ productArea: z.ZodOptional<z.ZodString>;
816
+ }, z.core.$strip>;
817
+ requirementInput: z.ZodObject<{
818
+ kind: z.ZodDefault<z.ZodEnum<{
819
+ stakeholder: "stakeholder";
820
+ solution: "solution";
821
+ }>>;
822
+ title: z.ZodString;
823
+ story: z.ZodString;
824
+ stakeholder: z.ZodOptional<z.ZodString>;
825
+ product: z.ZodOptional<z.ZodString>;
826
+ stakeholderIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
827
+ acceptanceCriteria: z.ZodArray<z.ZodString>;
828
+ priority: z.ZodDefault<z.ZodEnum<{
829
+ must: "must";
830
+ should: "should";
831
+ could: "could";
832
+ }>>;
833
+ findingIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
834
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
835
+ hypothesisIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
836
+ origin: z.ZodOptional<z.ZodEnum<{
837
+ tender: "tender";
838
+ regulation: "regulation";
839
+ contract: "contract";
840
+ "customer-need": "customer-need";
841
+ }>>;
842
+ originNote: z.ZodOptional<z.ZodString>;
843
+ productArea: z.ZodOptional<z.ZodString>;
844
+ }, z.core.$strip>;
845
+ PATCHES: {
846
+ readonly insight: z.ZodObject<{
847
+ title: z.ZodOptional<z.ZodString>;
848
+ quote: z.ZodOptional<z.ZodString>;
849
+ source: z.ZodOptional<z.ZodEnum<{
850
+ interview: "interview";
851
+ support: "support";
852
+ survey: "survey";
853
+ analytics: "analytics";
854
+ observation: "observation";
855
+ }>>;
856
+ persona: z.ZodOptional<z.ZodString>;
857
+ participant: z.ZodOptional<z.ZodOptional<z.ZodString>>;
858
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
859
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
860
+ sentiment: z.ZodOptional<z.ZodEnum<{
861
+ negative: "negative";
862
+ neutral: "neutral";
863
+ positive: "positive";
864
+ }>>;
865
+ }, z.core.$strip>;
866
+ readonly hypothesis: z.ZodObject<{
867
+ title: z.ZodOptional<z.ZodString>;
868
+ outcome: z.ZodOptional<z.ZodString>;
869
+ forWhom: z.ZodOptional<z.ZodString>;
870
+ benefit: z.ZodOptional<z.ZodString>;
871
+ feature: z.ZodOptional<z.ZodString>;
872
+ successMetric: z.ZodOptional<z.ZodOptional<z.ZodObject<{
873
+ name: z.ZodString;
874
+ unit: z.ZodString;
875
+ baseline: z.ZodNumber;
876
+ target: z.ZodNumber;
877
+ direction: z.ZodEnum<{
878
+ decrease: "decrease";
879
+ increase: "increase";
880
+ }>;
881
+ timeframe: z.ZodString;
882
+ }, z.core.$strip>>>;
883
+ guardrail: z.ZodOptional<z.ZodOptional<z.ZodString>>;
884
+ knowWhen: z.ZodOptional<z.ZodOptional<z.ZodString>>;
885
+ alternatives: z.ZodOptional<z.ZodOptional<z.ZodString>>;
886
+ edge: z.ZodOptional<z.ZodOptional<z.ZodString>>;
887
+ riskiestAssumption: z.ZodOptional<z.ZodOptional<z.ZodString>>;
888
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
889
+ status: z.ZodOptional<z.ZodEnum<{
890
+ draft: "draft";
891
+ testing: "testing";
892
+ validated: "validated";
893
+ invalidated: "invalidated";
894
+ }>>;
895
+ confidence: z.ZodOptional<z.ZodNumber>;
896
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
897
+ }, z.core.$strip>;
898
+ readonly experiment: z.ZodObject<{
899
+ title: z.ZodOptional<z.ZodString>;
900
+ method: z.ZodOptional<z.ZodEnum<{
901
+ survey: "survey";
902
+ pilot: "pilot";
903
+ "ab-test": "ab-test";
904
+ "prototype-test": "prototype-test";
905
+ "fake-door": "fake-door";
906
+ concierge: "concierge";
907
+ }>>;
908
+ description: z.ZodOptional<z.ZodString>;
909
+ primaryMetric: z.ZodOptional<z.ZodObject<{
910
+ name: z.ZodString;
911
+ unit: z.ZodString;
912
+ baseline: z.ZodNumber;
913
+ target: z.ZodNumber;
914
+ direction: z.ZodEnum<{
915
+ decrease: "decrease";
916
+ increase: "increase";
917
+ }>;
918
+ }, z.core.$strip>>;
919
+ checkBackDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
920
+ guardrails: z.ZodOptional<z.ZodArray<z.ZodObject<{
921
+ name: z.ZodString;
922
+ unit: z.ZodString;
923
+ baseline: z.ZodNumber;
924
+ target: z.ZodNumber;
925
+ direction: z.ZodEnum<{
926
+ decrease: "decrease";
927
+ increase: "increase";
928
+ }>;
929
+ }, z.core.$strip>>>;
930
+ sampleSize: z.ZodOptional<z.ZodString>;
931
+ durationWeeks: z.ZodOptional<z.ZodNumber>;
932
+ resultNotes: z.ZodOptional<z.ZodString>;
933
+ }, z.core.$strip>;
934
+ readonly finding: z.ZodObject<{
935
+ title: z.ZodOptional<z.ZodString>;
936
+ summary: z.ZodOptional<z.ZodString>;
937
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
938
+ experimentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
939
+ hypothesisIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
940
+ insightIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
941
+ confidence: z.ZodOptional<z.ZodEnum<{
942
+ low: "low";
943
+ medium: "medium";
944
+ high: "high";
945
+ }>>;
946
+ }, z.core.$strip>;
947
+ readonly requirement: z.ZodObject<{
948
+ title: z.ZodOptional<z.ZodString>;
949
+ story: z.ZodOptional<z.ZodString>;
950
+ stakeholder: z.ZodOptional<z.ZodOptional<z.ZodString>>;
951
+ product: z.ZodOptional<z.ZodOptional<z.ZodString>>;
952
+ stakeholderIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
953
+ acceptanceCriteria: z.ZodOptional<z.ZodArray<z.ZodString>>;
954
+ insightIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
955
+ hypothesisIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
956
+ origin: z.ZodOptional<z.ZodOptional<z.ZodEnum<{
957
+ tender: "tender";
958
+ regulation: "regulation";
959
+ contract: "contract";
960
+ "customer-need": "customer-need";
961
+ }>>>;
962
+ originNote: z.ZodOptional<z.ZodOptional<z.ZodString>>;
963
+ productArea: z.ZodOptional<z.ZodOptional<z.ZodString>>;
964
+ priority: z.ZodOptional<z.ZodEnum<{
965
+ must: "must";
966
+ should: "should";
967
+ could: "could";
968
+ }>>;
969
+ findingIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
970
+ kind: z.ZodOptional<z.ZodEnum<{
971
+ stakeholder: "stakeholder";
972
+ solution: "solution";
973
+ }>>;
974
+ }, z.core.$strip>;
975
+ };
976
+ };
977
+
978
+ declare function hasSuccessMetric(m?: SuccessMetric): m is SuccessMetric;
979
+ /** "week-1 activation rises from 38 to 55% or more over a 4-week prototype test" */
980
+ declare function describeSuccess(m: SuccessMetric): string;
981
+ /** The plain-language success statement, from the success metric and the guardrail. Empty without a metric. */
982
+ declare function composeKnowWhen(d: {
983
+ successMetric?: SuccessMetric;
984
+ guardrail?: string;
985
+ }): string;
986
+ /** "We believe we will [outcome] if [forWhom] get [benefit] with [feature]." */
987
+ declare function composeStatement(h: {
988
+ outcome: string;
989
+ forWhom: string;
990
+ benefit: string;
991
+ feature: string;
992
+ }): string;
993
+
994
+ interface Graph {
995
+ insights: Insight[];
996
+ hypotheses: Hypothesis[];
997
+ experiments: Experiment[];
998
+ findings: Finding[];
999
+ requirements: Requirement[];
1000
+ }
1001
+ interface Trail {
1002
+ /** Solution requirements: the stakeholder requirements they help meet. */
1003
+ stakeholderRequirements: Requirement[];
1004
+ findings: Finding[];
1005
+ experiments: Experiment[];
1006
+ hypotheses: Hypothesis[];
1007
+ insights: Insight[];
1008
+ }
1009
+ /** Walk a requirement back to every piece of evidence behind it. */
1010
+ declare function trailForRequirement(r: Requirement, g: Graph): Trail;
1011
+ /** All node ids connected (upstream and downstream) to a given node. */
1012
+ declare function connectedIds(id: string, g: Graph): Set<string>;
1013
+ declare function evidenceStrength(t: Trail): {
1014
+ score: number;
1015
+ label: "Strong" | "Moderate" | "Weak";
1016
+ };
1017
+
1018
+ /** The folder inside a project that holds everything Groundwork writes. */
1019
+ declare const DIR = "groundwork";
1020
+ declare const CONFIG_FILE = "config.yml";
1021
+ declare const SCHEMA_VERSION = 1;
1022
+ declare const configSchema: z.ZodObject<{
1023
+ schemaVersion: z.ZodDefault<z.ZodNumber>;
1024
+ name: z.ZodString;
1025
+ productAreas: z.ZodDefault<z.ZodArray<z.ZodObject<{
1026
+ id: z.ZodString;
1027
+ label: z.ZodString;
1028
+ }, z.core.$strip>>>;
1029
+ products: z.ZodDefault<z.ZodArray<z.ZodString>>;
1030
+ people: z.ZodDefault<z.ZodArray<z.ZodObject<{
1031
+ id: z.ZodString;
1032
+ name: z.ZodString;
1033
+ role: z.ZodDefault<z.ZodEnum<{
1034
+ owner: "owner";
1035
+ editor: "editor";
1036
+ viewer: "viewer";
1037
+ }>>;
1038
+ email: z.ZodOptional<z.ZodString>;
1039
+ }, z.core.$strip>>>;
1040
+ migrated: z.ZodOptional<z.ZodString>;
1041
+ }, z.core.$strip>;
1042
+ type Config = z.infer<typeof configSchema>;
1043
+ type Person = Config["people"][number];
1044
+ /**
1045
+ * Where the project is: $GROUNDWORK_DIR, else the nearest folder above the working directory that has a
1046
+ * groundwork/config.yml, else the working directory itself (a new project).
1047
+ */
1048
+ declare function findRoot(cwd?: string): string;
1049
+ declare const configPath: (root: string) => string;
1050
+ declare const isInitialized: (root: string) => boolean;
1051
+ declare function defaultConfig(root: string): Config;
1052
+ declare class ConfigError extends Error {
1053
+ }
1054
+ declare function readConfig(root: string): Config;
1055
+ declare function writeConfig(root: string, config: Config): void;
1056
+ /**
1057
+ * Who is acting: $GROUNDWORK_USER (a person id), else the person whose email matches git's, else the only person
1058
+ * listed. Unknown people act as "me", which is fine for a one-person folder.
1059
+ */
1060
+ declare function resolveActor(root: string, config: Config): {
1061
+ id: string;
1062
+ person?: Person;
1063
+ };
1064
+
1065
+ /**
1066
+ * Items as files: groundwork/<collection>/<ID>-<slug>.md, YAML frontmatter for the fields, and a Markdown body
1067
+ * that is yours. Groundwork keeps the body as `notes` and never rewrites it.
1068
+ */
1069
+ type ItemCollection = Exclude<keyof Collections, "activity">;
1070
+ declare const COLLECTIONS: Record<Kind, ItemCollection>;
1071
+ interface FileProblem {
1072
+ file: string;
1073
+ message: string;
1074
+ }
1075
+ interface Loaded {
1076
+ items: Collections;
1077
+ /** Item id -> file path relative to the project root. */
1078
+ paths: Map<string, string>;
1079
+ problems: FileProblem[];
1080
+ }
1081
+ declare function parseItem(text: string): {
1082
+ data: Record<string, unknown>;
1083
+ notes: string;
1084
+ };
1085
+ declare function renderItem(item: Record<string, unknown>): string;
1086
+ declare function load(root: string): Loaded;
1087
+ /**
1088
+ * The operations make new items with temporary ids. Give each a readable id (INS-0008…) in creation order, and
1089
+ * point every link at the new ids. Returns the new collections and the temporary -> final id map.
1090
+ */
1091
+ declare function assignIds(before: Collections, after: Collections): {
1092
+ items: Collections;
1093
+ renamed: Map<string, string>;
1094
+ };
1095
+ /** Write what changed between two snapshots: changed items rewritten, new ones created, removed ones deleted. */
1096
+ declare function save(root: string, loaded: Loaded, after: Collections): string[];
1097
+
1098
+ interface Problem {
1099
+ level: "error" | "warning";
1100
+ file: string;
1101
+ message: string;
1102
+ }
1103
+ /** Every problem in a project: unreadable files, invalid fields, broken or wrong-kind links, unknown areas. */
1104
+ declare function validate(loaded: Loaded, config: Config): Problem[];
1105
+
1106
+ declare const INSTRUCTIONS = "Groundwork keeps this product's evidence and decisions as linked Markdown files in the groundwork/ folder, as a chain:\ninsight -> hypothesis -> experiment -> finding -> requirement.\n\n- Insight: evidence from a real person: what they said or did (quote), where it came from (source) and who they are (persona). Not opinions or ideas. Never store full names or contact details; use a role and an optional participant ref like P07.\n- Hypothesis: \"We believe we will [outcome] if [forWhom] get [benefit] with [feature]\", built on insights (insightIds), ideally with a successMetric (baseline, target, timeframe).\n- Experiment: tests exactly one hypothesis (hypothesisId) with one primary metric and optional guardrails. Lifecycle: planned -> start_experiment -> record_experiment_results (Groundwork computes the verdict and updates the hypothesis).\n- Finding: what was learned, linked to the experiments, hypotheses and insights behind it.\n- Requirement: \"stakeholder\" (a need, in the stakeholder's words) or \"solution\" (what the product must do). Justified by findingIds, or, when decided elsewhere, by an origin (tender, regulation, contract, customer-need).\n\nHow to work:\n1. Call get_workspace first: it gives product areas, products and people (for approvers).\n2. Before creating anything, search_items for duplicates and for evidence to link. Prefer linking to existing items over creating near-duplicates.\n3. Always link evidence: hypotheses to insights, experiments to a hypothesis, findings to experiments/hypotheses/insights, requirements to findings.\n4. Ask the user before deleting items or approving requirements, unless they already told you to.\n5. Use these tools rather than editing the files directly: they keep ids unique and links valid. Each result includes the item's file: mention it so the user can open it.\n6. The Markdown body under an item's frontmatter is the user's own notes. Read it, but don't overwrite it.";
1107
+ interface ServerOptions {
1108
+ /** The project folder (the one that holds groundwork/). */
1109
+ root: string;
1110
+ }
1111
+ declare function buildServer({ root }: ServerOptions): McpServer;
1112
+
1113
+ export { type Activity, COLLECTIONS, COLLECTION_KEYS, COLLECTION_KIND, CONFIG_FILE, type Collections, type Config, ConfigError, DIR, type Delivery, type DeliverySettings, type DeliveryStateType, EXPERIMENT_STATUS, type Experiment, type ExperimentMethod, type ExperimentStatus, FINDING_CONFIDENCE, type Finding, type Graph, HYPOTHESIS_STATUS, type Hypothesis, type HypothesisStatus, type ID, ID_PREFIX, INSTRUCTIONS, type Insight, KIND, type Kind, LOCAL_ID, type Loaded, METHOD, type Metric, PRIORITY, type Person, type Prioritization, type Priority, type Problem, type ProductArea, REQUIREMENT_KIND, REQUIREMENT_ORIGIN, type Requirement, type RequirementChanges, type RequirementKind, type RequirementOrigin, type RequirementStatus, SCHEMA_VERSION, SENTIMENT, SOURCE, type Schemas, type Score, type Sentiment, type SourceType, type SuccessMetric, type Trail, type Upsert, type Verdict, type VerdictResult, assignIds, buildServer, canObsolete, canSendToDelivery, canUpdateInPlace, composeKnowWhen, composeStatement, computeVerdict, configPath, configSchema, connectedIds, defaultConfig, describeSuccess, diffCollections, emptyCollections, evidenceStrength, findRoot, fmtMetric, hasSuccessMetric, isInitialized, isObsolete, kindOf, load, localId, localSchemas, makeSchemas, metricPasses, ops, parseItem, readConfig, renderItem, resolveActor, save, targetLabel, trailForRequirement, validate, writeConfig };