@validation-os/core 0.15.6 → 0.16.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.
@@ -1,4 +1,4 @@
1
- import { r as Rung, l as MagnitudeBand, q as Result, F as Feasibility } from './types-B845UmLh.js';
1
+ import { u as Stage, n as QuestionType, s as Rung, l as MagnitudeBand, r as Result, F as Feasibility } from './types-DZIQEO4D.js';
2
2
 
3
3
  /**
4
4
  * Round to 2 decimals, matching the migration's `+(n).toFixed(2)`.
@@ -8,28 +8,100 @@ import { r as Rung, l as MagnitudeBand, q as Result, F as Feasibility } from './
8
8
  declare function round2(n: number): number;
9
9
 
10
10
  /**
11
- * The lens-aware ladder anchors (DEV-5879).
11
+ * The question-type-aware evidence ladder (DEV-5890).
12
12
  *
13
- * Source of truth: `skills/_shared/ontology.yaml` → `vocabularies.rung`. A
14
- * rung is an evidence TYPE; magnitude band (Low/Typical/High) is the intensity
15
- * within a type. The band applies to EVERY rung, so every rung looks up its
16
- * anchor through `RUNG_ANCHOR[rung][band]`.
13
+ * Source of truth: `skills/_shared/ontology.yaml` → `vocabularies.rung` +
14
+ * `vocabularies.question_type`. A rung is an evidence TYPE; magnitude band
15
+ * (Low/Typical/High) is the intensity within a type. The band applies to
16
+ * EVERY rung, so every rung looks up its anchor through the 3D table
17
+ * `RUNG_ANCHOR[questionType][rung][band]`.
17
18
  *
18
- * Talk: 3 / 6 / 10 (Opinion / Pitch-deck / Anecdotal merged)
19
- * Desk research: 15 / 15 / 15 (flat desk research has no meaningful bands,
20
- * but the field exists for uniformity)
21
- * Signed up: 30 / 50 / 70 (consumer lens's first do-rung)
22
- * Observed usage: 30 / 50 / 70 (consumer lens; was Prototype usage + Survey
23
- * at scale, now collapsed)
24
- * Signed intent: 30 / 50 / 70 (commercial/investor lens)
25
- * Paying users: 30 / 50 / 70 (commercial/investor lens)
19
+ * Seven sub-ladders, one per question type. Evidence types that are
20
+ * **non-evidence** for a question type carry anchor `0` across all bands
21
+ * they contribute `s=0` and are flagged at the UI/skill layer (not a write
22
+ * blocker). The `0` is structural, not a separate flag.
26
23
  *
27
- * The lens determines which "do" rungs are available; Talk + Desk work for
28
- * any lens. The rung-to-lens mapping is a grading guideline, not a schema
29
- * constraintany Rung can appear on any assumption.
24
+ * The rung vocabulary itself (`Talk`, `Desk research`, `Signed up`,
25
+ * `Observed usage`, `Signed intent`, `Paying users`) is unchanged across
26
+ * all sub-ladders the same six rungs exist in every sub-ladder, with
27
+ * different anchors (including `0` for non-evidence). This preserves the
28
+ * existing `Rung` type and all reading-row machinery.
29
+ *
30
+ * Research backing: EBM GRADE (evidence hierarchies are question-relative),
31
+ * Bayesian confirmation theory (probative value is hypothesis-relative),
32
+ * qualitative research methods (qual is the ceiling for mechanism/existence
33
+ * questions; saturation is a validity criterion), revealed preference
34
+ * (sustained usage is the cleanest utility signal; stated intent is
35
+ * non-evidence for WTP). See `docs/question-types.md`.
36
+ *
37
+ * W0 stays keyed by evidence type (within a question type), not by stage or
38
+ * question type — see `confidence.ts` → `W0_BY_RUNG`. The learning rate
39
+ * tracks the instrument's reliability, not the stakes or the claim kind.
40
+ * Empirical-Bayes per-question-type W0 tuning is flagged as v2 (out of scope).
30
41
  */
31
42
 
32
- declare const RUNG_ANCHOR: Record<Rung, Record<MagnitudeBand, number>>;
43
+ /**
44
+ * The 3D anchor table — `RUNG_ANCHOR[questionType][rung][band]`.
45
+ *
46
+ * Seven sub-ladders. `0` entries are the non-evidence set for that question
47
+ * type (the reading contributes `s=0`, flagged at the UI/skill layer). The
48
+ * shape — what's probative, what's the ceiling, what's non-evidence — is
49
+ * the decision; the exact values are illustrative anchors calibrated against
50
+ * the research backing (see `docs/question-types.md`).
51
+ *
52
+ * Per the spec table:
53
+ *
54
+ * | Question Type | Talk L/T/H | Desk L/T/H | Signed up L/T/H | Observed usage L/T/H | Signed intent L/T/H | Paying users L/T/H | Ceiling |
55
+ * |-------------------|--------------|--------------|-----------------|----------------------|----------------------|--------------------|-----------------------|
56
+ * | Existence | 10/20/30 | 15/15/15 | 0/0/0 | 20/35/50 | 0/0/0 | 0/0/0 | Observed usage High(50)|
57
+ * | Prevalence | 0/0/0 | 15/15/15 | 0/0/0 | 25/40/50 | 0/0/0 | 0/0/0 | Observed usage High(50)|
58
+ * | CausalEffect | 0/0/0 | 0/0/0 | 0/0/0 | 30/50/70 | 30/50/70 | 50/70/90 | Paying users High(90) |
59
+ * | WillingnessToPay | 0/0/0 | 0/0/0 | 30/50/70 | 0/0/0 | 50/70/85 | 75/88/99 | Paying users High(99) |
60
+ * | ValueUtility | 10/20/30 | 0/0/0 | 0/0/0 | 30/50/70 | 0/0/0 | 0/0/0 | Observed usage High(70)|
61
+ * | Regulatory | 0/0/0 | 30/50/70 | 0/0/0 | 0/0/0 | 0/0/0 | 0/0/0 | Desk research High(70)|
62
+ * | Feasibility | 0/0/0 | 15/15/15 | 0/0/0 | 30/50/70 | 0/0/0 | 0/0/0 | Observed usage High(70)|
63
+ */
64
+ type BandRecord = Record<MagnitudeBand, number>;
65
+ type RungAnchors = Record<Rung, BandRecord>;
66
+ /** The seven sub-ladders, keyed by question type. */
67
+ declare const RUNG_ANCHOR: Record<QuestionType, RungAnchors>;
68
+ /**
69
+ * Is a rung **non-evidence** for a question type? A derived predicate — the
70
+ * reading is allowed (not a write blocker) but contributes `s=0` and is
71
+ * flagged at the UI/skill layer for human review ("reclassify the assumption
72
+ * or drop the reading"). Non-evidence is `0` anchor across all bands, by
73
+ * construction.
74
+ */
75
+ declare function isNonEvidence(questionType: QuestionType, rung: Rung): boolean;
76
+ /**
77
+ * The ceiling anchor for a (question type × rung) — the strongest band
78
+ * (`High`). Used by the dashboard to label the ceiling on each sub-ladder and
79
+ * by `/experiment-design` to size the next test against the question type's
80
+ * ceiling.
81
+ */
82
+ declare function ceilingAnchor(questionType: QuestionType, rung: Rung): number;
83
+ /**
84
+ * The Risk threshold below which an assumption is "validated enough" for its
85
+ * stage (DEV-5890). Pragmatic encroachment + Bezos two-way vs one-way doors;
86
+ * Stage is the reversibility proxy. The threshold does NOT flip a status —
87
+ * Live assumptions stay Live and ranked forever (`docs/validated.md`). It is
88
+ * consumed by the dashboard's test-next surface, the `/assumptions audit`
89
+ * skill, and the `/experiment-design` skill. It does NOT enter the
90
+ * Confidence formula.
91
+ */
92
+ declare const RISK_THRESHOLD_BY_STAGE: Record<Stage, number>;
93
+ /**
94
+ * The Risk threshold for a given stage — the stopping rule for attention.
95
+ * Falls back to the tightest threshold (Maturity) when the stage is absent,
96
+ * so a missing stage never silently lowers the bar.
97
+ */
98
+ declare function riskThresholdForStage(stage: Stage | null | undefined): number;
99
+ /**
100
+ * Has the assumption cleared its stage's Risk threshold? "Cleared" = Risk is
101
+ * at or below the threshold — the belief has enough evidence for its stage's
102
+ * stopping bar. "Needs evidence" = above the threshold — testing-priority.
103
+ */
104
+ declare function hasClearedThreshold(risk: number, stage: Stage | null | undefined): boolean;
33
105
 
34
106
  /**
35
107
  * Assumption completeness — a derived readiness meter, never stored.
@@ -39,14 +111,20 @@ declare const RUNG_ANCHOR: Record<Rung, Record<MagnitudeBand, number>>;
39
111
  * hand-maintained tags. `Completeness %` is `filled slots / all slots`; a
40
112
  * fully-filled assumption reads 100 and is Live-ready, an empty draft reads low.
41
113
  *
42
- * Slots (each an equal fifth):
114
+ * Slots (each an equal sixth):
43
115
  * Description · Lens · Impact · Scoring justification · Dependencies traced
116
+ * · Question Type
117
+ *
118
+ * Question Type (DEV-5890) is the 6th slot: an assumption without a Question
119
+ * Type has `Completeness %` < 100 and cannot go Live. The grill infers the
120
+ * Question Type from the falsification test and confirms with the user
121
+ * (the gaming guard).
44
122
  *
45
123
  * Pure, no backend dependency — the same function the recompute pass stamps
46
124
  * into the derived tuple and the audit checks readiness against.
47
125
  */
48
126
  /** The structural slots whose presence makes an assumption Live-ready. */
49
- declare const COMPLETENESS_SLOTS: readonly ["Description", "Lens", "Impact", "Scoring justification", "Dependencies traced"];
127
+ declare const COMPLETENESS_SLOTS: readonly ["Description", "Lens", "Impact", "Scoring justification", "Dependencies traced", "Question Type"];
50
128
  type CompletenessSlot = (typeof COMPLETENESS_SLOTS)[number];
51
129
  /** The record shape completeness reads — an assumption's structural fields. */
52
130
  interface CompletenessInput {
@@ -56,6 +134,7 @@ interface CompletenessInput {
56
134
  "Scoring justification"?: unknown;
57
135
  dependsOnIds?: unknown;
58
136
  enablesIds?: unknown;
137
+ "Question Type"?: unknown;
59
138
  }
60
139
  /** Whether each slot is structurally present. */
61
140
  declare function completenessSlotPresence(record: CompletenessInput): Record<CompletenessSlot, boolean>;
@@ -70,10 +149,17 @@ declare function assumptionComplete(record: CompletenessInput): boolean;
70
149
  * Strength — the signed reading value `s` the Confidence average reads.
71
150
  *
72
151
  * Formula (`ontology.yaml` → `derivations.strength`):
73
- * rung anchor × magnitude band × sign(Result)
152
+ * `RUNG_ANCHOR[questionType][rung][band] × sign(Result)`
74
153
  * — Validated positive, Invalidated negative; 0 unless Validated/Invalidated.
75
154
  *
76
- * Every rung now carries a magnitude band (0.14); the lookup is the same for
155
+ * The anchor lookup is 3D (DEV-5890): keyed by the linked assumption's
156
+ * Question Type, the reading's Rung, and the row's Magnitude band. A rung
157
+ * that is non-evidence for the assumption's question type carries anchor 0
158
+ * across all bands, so the reading contributes `s=0` and is flagged at the
159
+ * UI/skill layer (not a write blocker). `isNonEvidence(questionType, rung)`
160
+ * is derived, never stored.
161
+ *
162
+ * Every rung carries a magnitude band (0.14); the lookup is the same for
77
163
  * testing and market rungs.
78
164
  */
79
165
 
@@ -83,6 +169,8 @@ declare function sign(result: Result): -1 | 0 | 1;
83
169
  * derivation module (and its record→input mappers) share. */
84
170
  declare function isConcluded(result: Result): boolean;
85
171
  interface StrengthInput {
172
+ /** The linked assumption's question type — sets the anchor sub-ladder. */
173
+ questionType: QuestionType;
86
174
  rung: Rung;
87
175
  result: Result;
88
176
  /** Magnitude band; defaults to "Typical" when absent. Applies to ALL rungs. */
@@ -90,6 +178,180 @@ interface StrengthInput {
90
178
  }
91
179
  declare function readingStrength(input: StrengthInput): number;
92
180
 
181
+ /**
182
+ * Question-type inference — the falsification-test rule (DEV-5890).
183
+ *
184
+ * The question type is set by what would prove the assumption WRONG, not by
185
+ * what evidence is cheap to gather. "Users will pay $50/mo" is falsified by
186
+ * offering it and watching them not pay → WillingnessToPay, regardless of how
187
+ * many interview quotes exist. The function is conservative: if the
188
+ * falsification test is ambiguous, it returns `Existence` (the most
189
+ * permissive sub-ladder) and flags for human review. The migration script
190
+ * runs this over all assumptions and produces a review queue for the ones it
191
+ * isn't confident on.
192
+ *
193
+ * The grill enforces the gaming guard: the inferred type (from the
194
+ * falsification bar) must match the stated type, or the assumption is rejected.
195
+ * This is the rule that stops a team reframing "will users pay?" as "do users
196
+ * express willingness to pay?" (existence question, qual ceiling) to avoid
197
+ * running a market test.
198
+ *
199
+ * Rules (matched in order; first match wins):
200
+ *
201
+ * - Falsified by "the regulation prohibits / the regulator rules against
202
+ * / the compliance audit fails" → Regulatory
203
+ * - Falsified by "they don't pay / don't sign up / don't commit / fake-door
204
+ * rate below X%" → WillingnessToPay
205
+ * - Falsified by "they stop using it / drop-off exceeds X / sustained usage
206
+ * falls below / retention" → ValueUtility
207
+ * - Falsified by "the treatment group doesn't differ from control / no
208
+ * causal effect / variant doesn't outperform" → CausalEffect
209
+ * - Falsified by "the rate is below X% / fewer than N of N / the proportion
210
+ * is below / the share is below" → Prevalence
211
+ * - Falsified by "they can't complete the flow / the system can't do X /
212
+ * can't be built" → Feasibility
213
+ * - Falsified by "no one reports this pain / no one describes this
214
+ * mechanism / no one reports caring" → Existence
215
+ * - Otherwise (ambiguous) → Existence (flagged for human review)
216
+ *
217
+ * Regulatory is matched first because a regulator ruling against is a
218
+ * distinctive falsification that shouldn't be misread as a willingness-to-pay
219
+ * or feasibility claim. WillingnessToPay precedes ValueUtility because "they
220
+ * pay" is the WTP falsification and "they stop using" is the ValueUtility
221
+ * falsification — the keywords are distinct but WTP is the more specific claim
222
+ * kind. CausalEffect precedes Prevalence because "rate below X%" appears in
223
+ * both prevalence bars and A/B conversion-rate bars; the A/B framing
224
+ * ("treatment group", "control", "variant", "outperform") is matched first.
225
+ *
226
+ * The function is a pure string-matching heuristic — no NLP, no external
227
+ * calls. The migration's review queue is the backstop for cases the
228
+ * heuristic misses.
229
+ */
230
+
231
+ /** The default question type for an ambiguous falsification test — the most
232
+ * permissive sub-ladder, and the migration's flagged-for-review default. */
233
+ declare const DEFAULT_QUESTION_TYPE: QuestionType;
234
+ /**
235
+ * Infer the Question Type from an assumption's description and falsification
236
+ * bar. The falsification bar (`wrongIfBar`) carries the signal — the
237
+ * description is only consulted as a fallback context. Returns the most
238
+ * permissive type (`Existence`) for an ambiguous bar; the migration's review
239
+ * queue is the backstop.
240
+ */
241
+ declare function inferQuestionType(description: string, wrongIfBar: string): QuestionType;
242
+ /** The set of question types the inference rule can return. Exported for
243
+ * the migration's "covered types" assertion. */
244
+ declare const INFERABLE_QUESTION_TYPES: readonly QuestionType[];
245
+ /** Whether an inferred question type should be flagged for human review.
246
+ * Conservative: only the confident matches are clean; the default
247
+ * (Existence-from-ambiguous) is always flagged. A match is "confident" if the
248
+ * bar matched a rule other than the Existence fallback. */
249
+ declare function needsReview(description: string, wrongIfBar: string, inferred: QuestionType): boolean;
250
+
251
+ /** A minimal assumption shape for migration input. */
252
+ interface MigrationAssumption {
253
+ id: string;
254
+ Description?: string;
255
+ /** The falsification test — the "we're wrong if" bar from the grill. */
256
+ wrongIfBar?: string;
257
+ /** The existing question type, if any (otherwise inferred). */
258
+ "Question Type"?: QuestionType | null;
259
+ /** Existing derived Confidence (for the delta report). */
260
+ derived?: {
261
+ confidence?: number;
262
+ } | null;
263
+ /** The assumption's Stage, for the threshold comparison in the summary. */
264
+ Stage?: string | null;
265
+ Impact?: number | null;
266
+ moot?: boolean;
267
+ dependsOnIds?: string[];
268
+ enablesIds?: string[];
269
+ }
270
+ /** A minimal reading shape for migration input. */
271
+ interface MigrationReading {
272
+ id: string;
273
+ /** The assumption id this reading's belief scores (single-belief migration). */
274
+ assumptionId: string;
275
+ Rung: Rung;
276
+ Result: Result;
277
+ magnitudeBand?: "Low" | "Typical" | "High" | null;
278
+ Source: string | null;
279
+ Representativeness: number;
280
+ Credibility: number;
281
+ Date: string | null;
282
+ experimentId: string | null;
283
+ /** Existing derived Strength (for the delta report). */
284
+ derived?: {
285
+ strength?: number;
286
+ } | null;
287
+ }
288
+ /** The output shape for a migrated assumption. */
289
+ interface MigratedAssumption extends MigrationAssumption {
290
+ "Question Type": QuestionType;
291
+ /** Whether the inferred question type was flagged for human review. */
292
+ questionTypeReviewNeeded: boolean;
293
+ /** The new derived Confidence (recomputed under the new sub-ladder). */
294
+ newConfidence: number;
295
+ /** The pre-migration Confidence (for the delta report). */
296
+ oldConfidence: number;
297
+ /** The Confidence delta (new − old). */
298
+ confidenceDelta: number;
299
+ /** The stage's Risk threshold (for the summary). */
300
+ riskThreshold: number;
301
+ }
302
+ /** The output shape for a migrated reading's belief. */
303
+ interface MigratedReading {
304
+ id: string;
305
+ assumptionId: string;
306
+ Rung: Rung;
307
+ /** The recomputed Strength (s) under the new sub-ladder. */
308
+ newStrength: number;
309
+ /** The pre-migration Strength (for diffing). */
310
+ oldStrength: number;
311
+ /** True if the rung is non-evidence for the linked assumption's question type. */
312
+ nonEvidence: boolean;
313
+ }
314
+ /** The full migration result. */
315
+ interface MigrationResult {
316
+ assumptions: MigratedAssumption[];
317
+ readings: MigratedReading[];
318
+ /** The number of readings flagged as non-evidence. */
319
+ nonEvidenceFlagCount: number;
320
+ /** The number of assumptions flagged for human review of their question type. */
321
+ reviewQueueCount: number;
322
+ /** Per-assumption Confidence deltas, sorted by |delta| descending. */
323
+ confidenceDeltas: {
324
+ id: string;
325
+ delta: number;
326
+ oldConfidence: number;
327
+ newConfidence: number;
328
+ }[];
329
+ /** Per-assumption ranking shifts in the Risk-ranked register (oldRank →
330
+ * newRank, 1-indexed; positive = moved down the ranking, negative = moved
331
+ * up). Sorted by |shift| descending. */
332
+ rankingShifts: {
333
+ id: string;
334
+ oldRank: number;
335
+ newRank: number;
336
+ shift: number;
337
+ }[];
338
+ }
339
+ /**
340
+ * Migrate an old-shape register to the new question-type-aware shape. Pure —
341
+ * no I/O. The caller reads the register, calls this, and writes the result;
342
+ * the backup is the caller's responsibility (write a dated copy of the input
343
+ * before calling `migrateRegister`).
344
+ *
345
+ * The migration:
346
+ * 1. Infers `Question Type` for each assumption from its falsification bar.
347
+ * 2. Recomputes each reading's `s` via `RUNG_ANCHOR[questionType][rung][band]`.
348
+ * 3. Flags readings whose rung is non-evidence for the linked assumption's
349
+ * question type (keeps the would-have-been `s` visible for diffing).
350
+ * 4. Recomputes each assumption's Confidence under the new sub-ladder.
351
+ * 5. Produces a summary report of Confidence deltas and flag counts.
352
+ */
353
+ declare function migrateRegister(assumptions: MigrationAssumption[], readings: MigrationReading[]): MigrationResult;
354
+
93
355
  declare function sourceQuality(representativeness: number, credibility: number): number;
94
356
 
95
357
  /**
@@ -148,6 +410,8 @@ interface ConfidenceReadingInput {
148
410
  source: string | null;
149
411
  rung: Rung;
150
412
  result: Result;
413
+ /** The linked assumption's question type — sets the anchor sub-ladder. */
414
+ questionType: QuestionType;
151
415
  representativeness: number;
152
416
  credibility: number;
153
417
  /** ISO date; used only as the dedupe tie-break (most recent wins). */
@@ -290,6 +554,8 @@ interface ExperimentConfidenceReadingInput {
290
554
  source: string | null;
291
555
  rung: Rung;
292
556
  result: Result;
557
+ /** The linked assumption's question type — sets the anchor sub-ladder. */
558
+ questionType: QuestionType;
293
559
  magnitudeBand?: MagnitudeBand;
294
560
  representativeness: number;
295
561
  credibility: number;
@@ -633,8 +899,10 @@ type index_CompletenessInput = CompletenessInput;
633
899
  type index_CompletenessSlot = CompletenessSlot;
634
900
  type index_ConfSign = ConfSign;
635
901
  type index_ConfidenceReadingInput = ConfidenceReadingInput;
902
+ declare const index_DEFAULT_QUESTION_TYPE: typeof DEFAULT_QUESTION_TYPE;
636
903
  type index_ExperimentConfidenceBarInput = ExperimentConfidenceBarInput;
637
904
  type index_ExperimentConfidenceReadingInput = ExperimentConfidenceReadingInput;
905
+ declare const index_INFERABLE_QUESTION_TYPES: typeof INFERABLE_QUESTION_TYPES;
638
906
  type index_ImpactAssumptionInput = ImpactAssumptionInput;
639
907
  type index_JourneyBeliefInput = JourneyBeliefInput;
640
908
  type index_JourneyEvent = JourneyEvent;
@@ -642,6 +910,11 @@ type index_JourneyEventKind = JourneyEventKind;
642
910
  type index_JourneyExperimentInput = JourneyExperimentInput;
643
911
  declare const index_KILL_LANE_THRESHOLD: typeof KILL_LANE_THRESHOLD;
644
912
  declare const index_MAX_STRENGTH: typeof MAX_STRENGTH;
913
+ type index_MigratedAssumption = MigratedAssumption;
914
+ type index_MigratedReading = MigratedReading;
915
+ type index_MigrationAssumption = MigrationAssumption;
916
+ type index_MigrationReading = MigrationReading;
917
+ type index_MigrationResult = MigrationResult;
645
918
  type index_MoveKind = MoveKind;
646
919
  type index_Mover = Mover;
647
920
  type index_MoverKind = MoverKind;
@@ -653,6 +926,7 @@ type index_NextMoveInput = NextMoveInput;
653
926
  type index_PortfolioBeliefInput = PortfolioBeliefInput;
654
927
  type index_PortfolioProgress = PortfolioProgress;
655
928
  type index_Progress = Progress;
929
+ declare const index_RISK_THRESHOLD_BY_STAGE: typeof RISK_THRESHOLD_BY_STAGE;
656
930
  declare const index_RUNG_ANCHOR: typeof RUNG_ANCHOR;
657
931
  type index_Scored = Scored;
658
932
  type index_StageExperimentInput = StageExperimentInput;
@@ -667,6 +941,7 @@ declare const index_assumptionComplete: typeof assumptionComplete;
667
941
  declare const index_assumptionCompleteness: typeof assumptionCompleteness;
668
942
  declare const index_beliefRisk: typeof beliefRisk;
669
943
  declare const index_beliefTestMeters: typeof beliefTestMeters;
944
+ declare const index_ceilingAnchor: typeof ceilingAnchor;
670
945
  declare const index_classifyStage: typeof classifyStage;
671
946
  declare const index_commitmentFactor: typeof commitmentFactor;
672
947
  declare const index_completenessSlotPresence: typeof completenessSlotPresence;
@@ -678,19 +953,25 @@ declare const index_derivedImpacts: typeof derivedImpacts;
678
953
  declare const index_emptyTestMeter: typeof emptyTestMeter;
679
954
  declare const index_experimentConfidence: typeof experimentConfidence;
680
955
  declare const index_experimentProgress: typeof experimentProgress;
956
+ declare const index_hasClearedThreshold: typeof hasClearedThreshold;
957
+ declare const index_inferQuestionType: typeof inferQuestionType;
681
958
  declare const index_isConcluded: typeof isConcluded;
959
+ declare const index_isNonEvidence: typeof isNonEvidence;
960
+ declare const index_migrateRegister: typeof migrateRegister;
682
961
  declare const index_missingCompletenessSlots: typeof missingCompletenessSlots;
962
+ declare const index_needsReview: typeof needsReview;
683
963
  declare const index_portfolioProgress: typeof portfolioProgress;
684
964
  declare const index_rankNextMoves: typeof rankNextMoves;
685
965
  declare const index_readingStrength: typeof readingStrength;
686
966
  declare const index_risk: typeof risk;
967
+ declare const index_riskThresholdForStage: typeof riskThresholdForStage;
687
968
  declare const index_round2: typeof round2;
688
969
  declare const index_scoreAndDedupe: typeof scoreAndDedupe;
689
970
  declare const index_sign: typeof sign;
690
971
  declare const index_sourceQuality: typeof sourceQuality;
691
972
  declare const index_w0ForRung: typeof w0ForRung;
692
973
  declare namespace index {
693
- export { type index_AssembleJourneyInput as AssembleJourneyInput, type index_Attribution as Attribution, type index_AttributionReadingInput as AttributionReadingInput, type index_BarLineInput as BarLineInput, type index_BeliefRisk as BeliefRisk, type index_BeliefStage as BeliefStage, type index_BeliefStageInput as BeliefStageInput, index_COMMITMENT_FOUND as COMMITMENT_FOUND, index_COMPLETENESS_SLOTS as COMPLETENESS_SLOTS, type index_CompletenessInput as CompletenessInput, type index_CompletenessSlot as CompletenessSlot, type index_ConfSign as ConfSign, type index_ConfidenceReadingInput as ConfidenceReadingInput, type index_ExperimentConfidenceBarInput as ExperimentConfidenceBarInput, type index_ExperimentConfidenceReadingInput as ExperimentConfidenceReadingInput, type index_ImpactAssumptionInput as ImpactAssumptionInput, type index_JourneyBeliefInput as JourneyBeliefInput, type index_JourneyEvent as JourneyEvent, type index_JourneyEventKind as JourneyEventKind, type index_JourneyExperimentInput as JourneyExperimentInput, index_KILL_LANE_THRESHOLD as KILL_LANE_THRESHOLD, index_MAX_STRENGTH as MAX_STRENGTH, type index_MoveKind as MoveKind, type index_Mover as Mover, type index_MoverKind as MoverKind, type index_NextMove as NextMove, type index_NextMoveAssumptionInput as NextMoveAssumptionInput, type index_NextMoveDecisionInput as NextMoveDecisionInput, type index_NextMoveExperimentInput as NextMoveExperimentInput, type index_NextMoveInput as NextMoveInput, type index_PortfolioBeliefInput as PortfolioBeliefInput, type index_PortfolioProgress as PortfolioProgress, type index_Progress as Progress, index_RUNG_ANCHOR as RUNG_ANCHOR, type index_Scored as Scored, type index_StageExperimentInput as StageExperimentInput, type index_StageKey as StageKey, type index_StrengthInput as StrengthInput, type index_TestMeter as TestMeter, type index_TrajectoryPoint as TrajectoryPoint, index_W0 as W0, index_W0_BY_RUNG as W0_BY_RUNG, index_assembleJourney as assembleJourney, index_assumptionComplete as assumptionComplete, index_assumptionCompleteness as assumptionCompleteness, index_beliefRisk as beliefRisk, index_beliefTestMeters as beliefTestMeters, index_classifyStage as classifyStage, index_commitmentFactor as commitmentFactor, index_completenessSlotPresence as completenessSlotPresence, index_confidence as confidence, index_confidenceAttribution as confidenceAttribution, index_confidenceTrajectory as confidenceTrajectory, index_deriveBeliefStage as deriveBeliefStage, index_derivedImpacts as derivedImpacts, index_emptyTestMeter as emptyTestMeter, index_experimentConfidence as experimentConfidence, index_experimentProgress as experimentProgress, index_isConcluded as isConcluded, index_missingCompletenessSlots as missingCompletenessSlots, index_portfolioProgress as portfolioProgress, index_rankNextMoves as rankNextMoves, index_readingStrength as readingStrength, index_risk as risk, index_round2 as round2, index_scoreAndDedupe as scoreAndDedupe, index_sign as sign, index_sourceQuality as sourceQuality, index_w0ForRung as w0ForRung };
974
+ export { type index_AssembleJourneyInput as AssembleJourneyInput, type index_Attribution as Attribution, type index_AttributionReadingInput as AttributionReadingInput, type index_BarLineInput as BarLineInput, type index_BeliefRisk as BeliefRisk, type index_BeliefStage as BeliefStage, type index_BeliefStageInput as BeliefStageInput, index_COMMITMENT_FOUND as COMMITMENT_FOUND, index_COMPLETENESS_SLOTS as COMPLETENESS_SLOTS, type index_CompletenessInput as CompletenessInput, type index_CompletenessSlot as CompletenessSlot, type index_ConfSign as ConfSign, type index_ConfidenceReadingInput as ConfidenceReadingInput, index_DEFAULT_QUESTION_TYPE as DEFAULT_QUESTION_TYPE, type index_ExperimentConfidenceBarInput as ExperimentConfidenceBarInput, type index_ExperimentConfidenceReadingInput as ExperimentConfidenceReadingInput, index_INFERABLE_QUESTION_TYPES as INFERABLE_QUESTION_TYPES, type index_ImpactAssumptionInput as ImpactAssumptionInput, type index_JourneyBeliefInput as JourneyBeliefInput, type index_JourneyEvent as JourneyEvent, type index_JourneyEventKind as JourneyEventKind, type index_JourneyExperimentInput as JourneyExperimentInput, index_KILL_LANE_THRESHOLD as KILL_LANE_THRESHOLD, index_MAX_STRENGTH as MAX_STRENGTH, type index_MigratedAssumption as MigratedAssumption, type index_MigratedReading as MigratedReading, type index_MigrationAssumption as MigrationAssumption, type index_MigrationReading as MigrationReading, type index_MigrationResult as MigrationResult, type index_MoveKind as MoveKind, type index_Mover as Mover, type index_MoverKind as MoverKind, type index_NextMove as NextMove, type index_NextMoveAssumptionInput as NextMoveAssumptionInput, type index_NextMoveDecisionInput as NextMoveDecisionInput, type index_NextMoveExperimentInput as NextMoveExperimentInput, type index_NextMoveInput as NextMoveInput, type index_PortfolioBeliefInput as PortfolioBeliefInput, type index_PortfolioProgress as PortfolioProgress, type index_Progress as Progress, index_RISK_THRESHOLD_BY_STAGE as RISK_THRESHOLD_BY_STAGE, index_RUNG_ANCHOR as RUNG_ANCHOR, type index_Scored as Scored, type index_StageExperimentInput as StageExperimentInput, type index_StageKey as StageKey, type index_StrengthInput as StrengthInput, type index_TestMeter as TestMeter, type index_TrajectoryPoint as TrajectoryPoint, index_W0 as W0, index_W0_BY_RUNG as W0_BY_RUNG, index_assembleJourney as assembleJourney, index_assumptionComplete as assumptionComplete, index_assumptionCompleteness as assumptionCompleteness, index_beliefRisk as beliefRisk, index_beliefTestMeters as beliefTestMeters, index_ceilingAnchor as ceilingAnchor, index_classifyStage as classifyStage, index_commitmentFactor as commitmentFactor, index_completenessSlotPresence as completenessSlotPresence, index_confidence as confidence, index_confidenceAttribution as confidenceAttribution, index_confidenceTrajectory as confidenceTrajectory, index_deriveBeliefStage as deriveBeliefStage, index_derivedImpacts as derivedImpacts, index_emptyTestMeter as emptyTestMeter, index_experimentConfidence as experimentConfidence, index_experimentProgress as experimentProgress, index_hasClearedThreshold as hasClearedThreshold, index_inferQuestionType as inferQuestionType, index_isConcluded as isConcluded, index_isNonEvidence as isNonEvidence, index_migrateRegister as migrateRegister, index_missingCompletenessSlots as missingCompletenessSlots, index_needsReview as needsReview, index_portfolioProgress as portfolioProgress, index_rankNextMoves as rankNextMoves, index_readingStrength as readingStrength, index_risk as risk, index_riskThresholdForStage as riskThresholdForStage, index_round2 as round2, index_scoreAndDedupe as scoreAndDedupe, index_sign as sign, index_sourceQuality as sourceQuality, index_w0ForRung as w0ForRung };
694
975
  }
695
976
 
696
- export { completenessSlotPresence as $, type AttributionReadingInput as A, type BarLineInput as B, COMPLETENESS_SLOTS as C, type NextMoveInput as D, type ExperimentConfidenceBarInput as E, type PortfolioProgress as F, type Progress as G, type StageExperimentInput as H, type ImpactAssumptionInput as I, type JourneyBeliefInput as J, KILL_LANE_THRESHOLD as K, type StageKey as L, MAX_STRENGTH as M, type NextMove as N, type StrengthInput as O, type PortfolioBeliefInput as P, type TrajectoryPoint as Q, RUNG_ANCHOR as R, type Scored as S, type TestMeter as T, W0_BY_RUNG as U, assembleJourney as V, W0 as W, beliefRisk as X, beliefTestMeters as Y, classifyStage as Z, commitmentFactor as _, type CompletenessSlot as a, confidence as a0, confidenceAttribution as a1, confidenceTrajectory as a2, deriveBeliefStage as a3, derivedImpacts as a4, emptyTestMeter as a5, experimentConfidence as a6, experimentProgress as a7, isConcluded as a8, portfolioProgress as a9, rankNextMoves as aa, risk as ab, round2 as ac, scoreAndDedupe as ad, sign as ae, w0ForRung as af, type CompletenessInput as b, assumptionCompleteness as c, assumptionComplete as d, type AssembleJourneyInput as e, type Attribution as f, type BeliefRisk as g, type BeliefStage as h, index as i, type BeliefStageInput as j, COMMITMENT_FOUND as k, type ConfSign as l, missingCompletenessSlots as m, type ConfidenceReadingInput as n, type ExperimentConfidenceReadingInput as o, type JourneyEvent as p, type JourneyEventKind as q, readingStrength as r, sourceQuality as s, type JourneyExperimentInput as t, type MoveKind as u, type Mover as v, type MoverKind as w, type NextMoveAssumptionInput as x, type NextMoveDecisionInput as y, type NextMoveExperimentInput as z };
977
+ export { type TrajectoryPoint as $, type AttributionReadingInput as A, type BarLineInput as B, COMPLETENESS_SLOTS as C, DEFAULT_QUESTION_TYPE as D, type ExperimentConfidenceBarInput as E, type MoveKind as F, type Mover as G, type MoverKind as H, INFERABLE_QUESTION_TYPES as I, type JourneyBeliefInput as J, KILL_LANE_THRESHOLD as K, type NextMoveAssumptionInput as L, MAX_STRENGTH as M, type NextMove as N, type NextMoveDecisionInput as O, type NextMoveExperimentInput as P, type NextMoveInput as Q, type PortfolioBeliefInput as R, type PortfolioProgress as S, type Progress as T, RISK_THRESHOLD_BY_STAGE as U, RUNG_ANCHOR as V, type Scored as W, type StageExperimentInput as X, type StageKey as Y, type StrengthInput as Z, type TestMeter as _, type CompletenessSlot as a, W0 as a0, W0_BY_RUNG as a1, assembleJourney as a2, beliefRisk as a3, beliefTestMeters as a4, ceilingAnchor as a5, classifyStage as a6, commitmentFactor as a7, completenessSlotPresence as a8, confidence as a9, confidenceAttribution as aa, confidenceTrajectory as ab, deriveBeliefStage as ac, derivedImpacts as ad, emptyTestMeter as ae, experimentConfidence as af, experimentProgress as ag, hasClearedThreshold as ah, inferQuestionType as ai, isConcluded as aj, isNonEvidence as ak, migrateRegister as al, needsReview as am, portfolioProgress as an, rankNextMoves as ao, risk as ap, riskThresholdForStage as aq, round2 as ar, scoreAndDedupe as as, sign as at, w0ForRung as au, type CompletenessInput as b, assumptionCompleteness as c, assumptionComplete as d, type AssembleJourneyInput as e, type Attribution as f, type BeliefRisk as g, type BeliefStage as h, index as i, type BeliefStageInput as j, COMMITMENT_FOUND as k, type ConfSign as l, missingCompletenessSlots as m, type ConfidenceReadingInput as n, type ExperimentConfidenceReadingInput as o, type ImpactAssumptionInput as p, type JourneyEvent as q, readingStrength as r, sourceQuality as s, type JourneyEventKind as t, type JourneyExperimentInput as u, type MigratedAssumption as v, type MigratedReading as w, type MigrationAssumption as x, type MigrationReading as y, type MigrationResult as z };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { R as Relation, C as Collection, A as AssumptionRecord, a as ReadingRecord, D as DecisionRecord, b as AssumptionDerived, E as ExperimentRecord, c as ExperimentDerived, d as AnyRecord } from './types-B845UmLh.js';
2
- export { e as AssumptionStatus, B as BarLine, f as BaseRecord, g as BeliefScore, h as DecisionStatus, i as ExperimentStatus, F as Feasibility, G as GlossaryAvoid, j as GlossaryRecord, k as GlossaryStatus, M as MARKET_RUNG_VALUES, l as MagnitudeBand, m as MarketRung, n as REGISTERS, o as RecordRef, p as Register, q as Result, r as Rung, S as SourceQualityPick, T as TESTING_RUNGS, s as TestingRung } from './types-B845UmLh.js';
3
- export { D as DataProvider, N as NotFoundError, S as StaleVersionError, i as isNotFoundError, a as isStaleVersionError } from './provider-biEHIhDh.js';
4
- import { A as AttributionReadingInput } from './index-DMPfDeEw.js';
5
- export { C as ASSUMPTION_PRESENCE_SLOTS, a as AssumptionPresenceSlot, b as CompletenessInput, c as assumptionCompleteness, d as assumptionPresenceComplete, i as derivation, m as missingPresenceSlots, s as recomputeSourceQuality, r as recomputeStrength } from './index-DMPfDeEw.js';
1
+ import { R as Relation, C as Collection, A as AssumptionRecord, a as ReadingRecord, D as DecisionRecord, b as AssumptionDerived, E as ExperimentRecord, c as ExperimentDerived, d as AnyRecord } from './types-DZIQEO4D.js';
2
+ export { e as AssumptionStatus, B as BarLine, f as BaseRecord, g as BeliefScore, h as DecisionStatus, i as ExperimentStatus, F as Feasibility, G as GlossaryAvoid, j as GlossaryRecord, k as GlossaryStatus, M as MARKET_RUNG_VALUES, l as MagnitudeBand, m as MarketRung, Q as QUESTION_TYPES, n as QuestionType, o as REGISTERS, p as RecordRef, q as Register, r as Result, s as Rung, S as STAGES, t as SourceQualityPick, u as Stage, T as TESTING_RUNGS, v as TestingRung } from './types-DZIQEO4D.js';
3
+ export { D as DataProvider, N as NotFoundError, S as StaleVersionError, i as isNotFoundError, a as isStaleVersionError } from './provider-BAip4ABo.js';
4
+ import { A as AttributionReadingInput } from './index-COstaDa6.js';
5
+ export { C as ASSUMPTION_PRESENCE_SLOTS, a as AssumptionPresenceSlot, b as CompletenessInput, c as assumptionCompleteness, d as assumptionPresenceComplete, i as derivation, m as missingPresenceSlots, s as recomputeSourceQuality, r as recomputeStrength } from './index-COstaDa6.js';
6
6
 
7
7
  /**
8
8
  * Relation config — the single table describing, for each linkable relation,
@@ -46,11 +46,14 @@ declare function recomputeDerived(input: RecomputeInput): Map<string, Assumption
46
46
  * Recompute the derived numbers for every experiment in the register.
47
47
  *
48
48
  * Groups readings by `experimentId`, filters each experiment's readings to its
49
- * `barLineAssumptionIds`, and calls {@link experimentConfidence}.
49
+ * `barLineAssumptionIds`, and calls {@link experimentConfidence}. DEV-5890:
50
+ * the assumption's Question Type is looked up from the assumptions register so
51
+ * Strength reads the right sub-ladder.
50
52
  */
51
53
  declare function recomputeExperimentDerived(input: {
52
54
  experiments: ExperimentRecord[];
53
55
  readings: ReadingRecord[];
56
+ assumptions?: AssumptionRecord[];
54
57
  }): Map<string, ExperimentDerived>;
55
58
 
56
59
  /**
@@ -66,6 +69,15 @@ declare function recomputeExperimentDerived(input: {
66
69
  * rationale vary per belief. `readingBeliefInputs` fans a row out into one
67
70
  * derivation input per belief, stamping the row-level fields onto each and
68
71
  * pairing the row rung with that belief's own Result.
72
+ *
73
+ * DEV-5890: each belief input also carries the linked assumption's
74
+ * `questionType`, looked up from the assumption register via the optional
75
+ * `assumptionsById` map. The question type sets the anchor sub-ladder
76
+ * (`RUNG_ANCHOR[questionType][rung][band]`). When the map is absent or a
77
+ * belief's assumption is missing, the question type defaults to
78
+ * `Existence` — the most permissive sub-ladder, and the migration default for
79
+ * ambiguous cases. The recompute pass always supplies the map; the dashboard's
80
+ * understanding layer supplies it when it can.
69
81
  */
70
82
 
71
83
  /**
@@ -75,14 +87,19 @@ declare function recomputeExperimentDerived(input: {
75
87
  type BeliefReadingInput = AttributionReadingInput & {
76
88
  assumptionId: string;
77
89
  };
90
+ /** A minimal assumption record shape — only what we need to read Question Type. */
91
+ interface AssumptionLike {
92
+ "Question Type"?: unknown;
93
+ }
78
94
  /**
79
95
  * Fan a reading row out into one derivation input per belief. Each input pairs
80
96
  * the ROW's rung / magnitude band / Source / source-quality picks / date /
81
- * experiment (which drives the commitment factor) with the belief's own Result.
82
- * The input's `id` is the row id within a single assumption's group each row
83
- * contributes one belief, so the id stays a stable dedupe fallback and
84
- * drill-through key.
97
+ * experiment (which drives the commitment factor) with the belief's own Result
98
+ * and the linked assumption's Question Type (looked up via the optional
99
+ * `assumptionsById` map; defaults to `Existence` when absent). The input's
100
+ * `id` is the row id — within a single assumption's group each row contributes
101
+ * one belief, so the id stays a stable dedupe fallback and drill-through key.
85
102
  */
86
- declare function readingBeliefInputs(r: AnyRecord): BeliefReadingInput[];
103
+ declare function readingBeliefInputs(r: AnyRecord, assumptionsById?: ReadonlyMap<string, any>): BeliefReadingInput[];
87
104
 
88
- export { AnyRecord, AssumptionDerived, AssumptionRecord, type BeliefReadingInput, Collection, DecisionRecord, ExperimentDerived, ExperimentRecord, RELATIONS, ReadingRecord, type RecomputeInput, Relation, type RelationEnd, type RelationSpec, readingBeliefInputs, recomputeDerived, recomputeExperimentDerived };
105
+ export { AnyRecord, AssumptionDerived, type AssumptionLike, AssumptionRecord, type BeliefReadingInput, Collection, DecisionRecord, ExperimentDerived, ExperimentRecord, RELATIONS, ReadingRecord, type RecomputeInput, Relation, type RelationEnd, type RelationSpec, readingBeliefInputs, recomputeDerived, recomputeExperimentDerived };