@validation-os/core 0.15.6 → 0.16.1
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/dist/{chunk-HMAHBGOJ.js → chunk-TCKAMOAK.js} +412 -11
- package/dist/chunk-TCKAMOAK.js.map +1 -0
- package/dist/derivation/index.d.ts +2 -2
- package/dist/derivation/index.js +25 -1
- package/dist/{index-DMPfDeEw.d.ts → index-DhQyc0Gj.d.ts} +335 -24
- package/dist/index.d.ts +29 -12
- package/dist/index.js +58 -25
- package/dist/index.js.map +1 -1
- package/dist/{provider-biEHIhDh.d.ts → provider-BAip4ABo.d.ts} +1 -1
- package/dist/testing.d.ts +2 -2
- package/dist/{types-B845UmLh.d.ts → types-DZIQEO4D.d.ts} +42 -7
- package/package.json +1 -1
- package/dist/chunk-HMAHBGOJ.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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,128 @@ 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
|
|
11
|
+
* The question-type-aware evidence ladder (DEV-5890).
|
|
12
12
|
*
|
|
13
|
-
* Source of truth: `skills/_shared/ontology.yaml` → `vocabularies.rung
|
|
14
|
-
* rung is an evidence TYPE; magnitude band
|
|
15
|
-
* within a type. The band applies to
|
|
16
|
-
* anchor through
|
|
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
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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
|
-
|
|
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
|
+
* The threshold is the max Risk you can have and still "stop testing" for
|
|
93
|
+
* this stage. Later stages have LOWER thresholds because you need to drive
|
|
94
|
+
* Risk down further (more evidence) before acting on a one-way door.
|
|
95
|
+
* Discovery = 30: stop testing when Risk ≤ 30 (two-way door, little evidence
|
|
96
|
+
* needed). Maturity = 5: stop testing when Risk ≤ 5 (one-way door, lots of
|
|
97
|
+
* evidence needed). The bar being LOWER means the STANDARD is HIGHER — like
|
|
98
|
+
* a high-jump bar: a lower number means you have to clear more.
|
|
99
|
+
*/
|
|
100
|
+
declare const RISK_THRESHOLD_BY_STAGE: Record<Stage, number>;
|
|
101
|
+
/**
|
|
102
|
+
* The minimum Confidence floor for "cleared" (DEV-5890 fix). A belief with
|
|
103
|
+
* Impact below the stage's Risk threshold could read Risk ≤ threshold with
|
|
104
|
+
* ZERO evidence (Risk = Impact × (1 − 0/100) = Impact). Without a Confidence
|
|
105
|
+
* floor, a low-Impact belief gets a free pass. The floor requires at least
|
|
106
|
+
* some evidence before "cleared" is honest. Tightens with stage, mirroring
|
|
107
|
+
* the Risk threshold.
|
|
108
|
+
*/
|
|
109
|
+
declare const CONFIDENCE_FLOOR_BY_STAGE: Record<Stage, number>;
|
|
110
|
+
/**
|
|
111
|
+
* The Risk threshold for a given stage — the stopping rule for attention.
|
|
112
|
+
* Falls back to the tightest threshold (Maturity) when the stage is absent,
|
|
113
|
+
* so a missing stage never silently lowers the bar.
|
|
114
|
+
*/
|
|
115
|
+
declare function riskThresholdForStage(stage: Stage | null | undefined): number;
|
|
116
|
+
/**
|
|
117
|
+
* The minimum Confidence floor for a given stage. Falls back to the tightest
|
|
118
|
+
* (Maturity) when absent.
|
|
119
|
+
*/
|
|
120
|
+
declare function confidenceFloorForStage(stage: Stage | null | undefined): number;
|
|
121
|
+
/**
|
|
122
|
+
* Has the assumption cleared its stage's threshold? "Cleared" requires BOTH:
|
|
123
|
+
* 1. Risk ≤ the stage's Risk threshold (enough evidence to drive Risk down)
|
|
124
|
+
* 2. Confidence ≥ the stage's Confidence floor (at least some real evidence)
|
|
125
|
+
*
|
|
126
|
+
* The Confidence floor prevents a low-Impact belief from being "cleared" with
|
|
127
|
+
* zero evidence — Risk = Impact × (1 − 0/100) = Impact, so a belief with
|
|
128
|
+
* Impact below the threshold would read "cleared" without any readings. The
|
|
129
|
+
* floor requires at least a minimum Confidence signal before "cleared" is
|
|
130
|
+
* honest. "Needs evidence" = either condition fails — testing-priority.
|
|
131
|
+
*/
|
|
132
|
+
declare function hasClearedThreshold(risk: number, stage: Stage | null | undefined, confidence?: number): boolean;
|
|
33
133
|
|
|
34
134
|
/**
|
|
35
135
|
* Assumption completeness — a derived readiness meter, never stored.
|
|
@@ -39,14 +139,20 @@ declare const RUNG_ANCHOR: Record<Rung, Record<MagnitudeBand, number>>;
|
|
|
39
139
|
* hand-maintained tags. `Completeness %` is `filled slots / all slots`; a
|
|
40
140
|
* fully-filled assumption reads 100 and is Live-ready, an empty draft reads low.
|
|
41
141
|
*
|
|
42
|
-
* Slots (each an equal
|
|
142
|
+
* Slots (each an equal sixth):
|
|
43
143
|
* Description · Lens · Impact · Scoring justification · Dependencies traced
|
|
144
|
+
* · Question Type
|
|
145
|
+
*
|
|
146
|
+
* Question Type (DEV-5890) is the 6th slot: an assumption without a Question
|
|
147
|
+
* Type has `Completeness %` < 100 and cannot go Live. The grill infers the
|
|
148
|
+
* Question Type from the falsification test and confirms with the user
|
|
149
|
+
* (the gaming guard).
|
|
44
150
|
*
|
|
45
151
|
* Pure, no backend dependency — the same function the recompute pass stamps
|
|
46
152
|
* into the derived tuple and the audit checks readiness against.
|
|
47
153
|
*/
|
|
48
154
|
/** The structural slots whose presence makes an assumption Live-ready. */
|
|
49
|
-
declare const COMPLETENESS_SLOTS: readonly ["Description", "Lens", "Impact", "Scoring justification", "Dependencies traced"];
|
|
155
|
+
declare const COMPLETENESS_SLOTS: readonly ["Description", "Lens", "Impact", "Scoring justification", "Dependencies traced", "Question Type"];
|
|
50
156
|
type CompletenessSlot = (typeof COMPLETENESS_SLOTS)[number];
|
|
51
157
|
/** The record shape completeness reads — an assumption's structural fields. */
|
|
52
158
|
interface CompletenessInput {
|
|
@@ -56,6 +162,7 @@ interface CompletenessInput {
|
|
|
56
162
|
"Scoring justification"?: unknown;
|
|
57
163
|
dependsOnIds?: unknown;
|
|
58
164
|
enablesIds?: unknown;
|
|
165
|
+
"Question Type"?: unknown;
|
|
59
166
|
}
|
|
60
167
|
/** Whether each slot is structurally present. */
|
|
61
168
|
declare function completenessSlotPresence(record: CompletenessInput): Record<CompletenessSlot, boolean>;
|
|
@@ -70,10 +177,17 @@ declare function assumptionComplete(record: CompletenessInput): boolean;
|
|
|
70
177
|
* Strength — the signed reading value `s` the Confidence average reads.
|
|
71
178
|
*
|
|
72
179
|
* Formula (`ontology.yaml` → `derivations.strength`):
|
|
73
|
-
* rung
|
|
180
|
+
* `RUNG_ANCHOR[questionType][rung][band] × sign(Result)`
|
|
74
181
|
* — Validated positive, Invalidated negative; 0 unless Validated/Invalidated.
|
|
75
182
|
*
|
|
76
|
-
*
|
|
183
|
+
* The anchor lookup is 3D (DEV-5890): keyed by the linked assumption's
|
|
184
|
+
* Question Type, the reading's Rung, and the row's Magnitude band. A rung
|
|
185
|
+
* that is non-evidence for the assumption's question type carries anchor 0
|
|
186
|
+
* across all bands, so the reading contributes `s=0` and is flagged at the
|
|
187
|
+
* UI/skill layer (not a write blocker). `isNonEvidence(questionType, rung)`
|
|
188
|
+
* is derived, never stored.
|
|
189
|
+
*
|
|
190
|
+
* Every rung carries a magnitude band (0.14); the lookup is the same for
|
|
77
191
|
* testing and market rungs.
|
|
78
192
|
*/
|
|
79
193
|
|
|
@@ -83,6 +197,8 @@ declare function sign(result: Result): -1 | 0 | 1;
|
|
|
83
197
|
* derivation module (and its record→input mappers) share. */
|
|
84
198
|
declare function isConcluded(result: Result): boolean;
|
|
85
199
|
interface StrengthInput {
|
|
200
|
+
/** The linked assumption's question type — sets the anchor sub-ladder. */
|
|
201
|
+
questionType: QuestionType;
|
|
86
202
|
rung: Rung;
|
|
87
203
|
result: Result;
|
|
88
204
|
/** Magnitude band; defaults to "Typical" when absent. Applies to ALL rungs. */
|
|
@@ -90,6 +206,180 @@ interface StrengthInput {
|
|
|
90
206
|
}
|
|
91
207
|
declare function readingStrength(input: StrengthInput): number;
|
|
92
208
|
|
|
209
|
+
/**
|
|
210
|
+
* Question-type inference — the falsification-test rule (DEV-5890).
|
|
211
|
+
*
|
|
212
|
+
* The question type is set by what would prove the assumption WRONG, not by
|
|
213
|
+
* what evidence is cheap to gather. "Users will pay $50/mo" is falsified by
|
|
214
|
+
* offering it and watching them not pay → WillingnessToPay, regardless of how
|
|
215
|
+
* many interview quotes exist. The function is conservative: if the
|
|
216
|
+
* falsification test is ambiguous, it returns `Existence` (the most
|
|
217
|
+
* permissive sub-ladder) and flags for human review. The migration script
|
|
218
|
+
* runs this over all assumptions and produces a review queue for the ones it
|
|
219
|
+
* isn't confident on.
|
|
220
|
+
*
|
|
221
|
+
* The grill enforces the gaming guard: the inferred type (from the
|
|
222
|
+
* falsification bar) must match the stated type, or the assumption is rejected.
|
|
223
|
+
* This is the rule that stops a team reframing "will users pay?" as "do users
|
|
224
|
+
* express willingness to pay?" (existence question, qual ceiling) to avoid
|
|
225
|
+
* running a market test.
|
|
226
|
+
*
|
|
227
|
+
* Rules (matched in order; first match wins):
|
|
228
|
+
*
|
|
229
|
+
* - Falsified by "the regulation prohibits / the regulator rules against
|
|
230
|
+
* / the compliance audit fails" → Regulatory
|
|
231
|
+
* - Falsified by "they don't pay / don't sign up / don't commit / fake-door
|
|
232
|
+
* rate below X%" → WillingnessToPay
|
|
233
|
+
* - Falsified by "they stop using it / drop-off exceeds X / sustained usage
|
|
234
|
+
* falls below / retention" → ValueUtility
|
|
235
|
+
* - Falsified by "the treatment group doesn't differ from control / no
|
|
236
|
+
* causal effect / variant doesn't outperform" → CausalEffect
|
|
237
|
+
* - Falsified by "the rate is below X% / fewer than N of N / the proportion
|
|
238
|
+
* is below / the share is below" → Prevalence
|
|
239
|
+
* - Falsified by "they can't complete the flow / the system can't do X /
|
|
240
|
+
* can't be built" → Feasibility
|
|
241
|
+
* - Falsified by "no one reports this pain / no one describes this
|
|
242
|
+
* mechanism / no one reports caring" → Existence
|
|
243
|
+
* - Otherwise (ambiguous) → Existence (flagged for human review)
|
|
244
|
+
*
|
|
245
|
+
* Regulatory is matched first because a regulator ruling against is a
|
|
246
|
+
* distinctive falsification that shouldn't be misread as a willingness-to-pay
|
|
247
|
+
* or feasibility claim. WillingnessToPay precedes ValueUtility because "they
|
|
248
|
+
* pay" is the WTP falsification and "they stop using" is the ValueUtility
|
|
249
|
+
* falsification — the keywords are distinct but WTP is the more specific claim
|
|
250
|
+
* kind. CausalEffect precedes Prevalence because "rate below X%" appears in
|
|
251
|
+
* both prevalence bars and A/B conversion-rate bars; the A/B framing
|
|
252
|
+
* ("treatment group", "control", "variant", "outperform") is matched first.
|
|
253
|
+
*
|
|
254
|
+
* The function is a pure string-matching heuristic — no NLP, no external
|
|
255
|
+
* calls. The migration's review queue is the backstop for cases the
|
|
256
|
+
* heuristic misses.
|
|
257
|
+
*/
|
|
258
|
+
|
|
259
|
+
/** The default question type for an ambiguous falsification test — the most
|
|
260
|
+
* permissive sub-ladder, and the migration's flagged-for-review default. */
|
|
261
|
+
declare const DEFAULT_QUESTION_TYPE: QuestionType;
|
|
262
|
+
/**
|
|
263
|
+
* Infer the Question Type from an assumption's description and falsification
|
|
264
|
+
* bar. The falsification bar (`wrongIfBar`) carries the signal — the
|
|
265
|
+
* description is only consulted as a fallback context. Returns the most
|
|
266
|
+
* permissive type (`Existence`) for an ambiguous bar; the migration's review
|
|
267
|
+
* queue is the backstop.
|
|
268
|
+
*/
|
|
269
|
+
declare function inferQuestionType(description: string, wrongIfBar: string): QuestionType;
|
|
270
|
+
/** The set of question types the inference rule can return. Exported for
|
|
271
|
+
* the migration's "covered types" assertion. */
|
|
272
|
+
declare const INFERABLE_QUESTION_TYPES: readonly QuestionType[];
|
|
273
|
+
/** Whether an inferred question type should be flagged for human review.
|
|
274
|
+
* Conservative: only the confident matches are clean; the default
|
|
275
|
+
* (Existence-from-ambiguous) is always flagged. A match is "confident" if the
|
|
276
|
+
* bar matched a rule other than the Existence fallback. */
|
|
277
|
+
declare function needsReview(description: string, wrongIfBar: string, inferred: QuestionType): boolean;
|
|
278
|
+
|
|
279
|
+
/** A minimal assumption shape for migration input. */
|
|
280
|
+
interface MigrationAssumption {
|
|
281
|
+
id: string;
|
|
282
|
+
Description?: string;
|
|
283
|
+
/** The falsification test — the "we're wrong if" bar from the grill. */
|
|
284
|
+
wrongIfBar?: string;
|
|
285
|
+
/** The existing question type, if any (otherwise inferred). */
|
|
286
|
+
"Question Type"?: QuestionType | null;
|
|
287
|
+
/** Existing derived Confidence (for the delta report). */
|
|
288
|
+
derived?: {
|
|
289
|
+
confidence?: number;
|
|
290
|
+
} | null;
|
|
291
|
+
/** The assumption's Stage, for the threshold comparison in the summary. */
|
|
292
|
+
Stage?: string | null;
|
|
293
|
+
Impact?: number | null;
|
|
294
|
+
moot?: boolean;
|
|
295
|
+
dependsOnIds?: string[];
|
|
296
|
+
enablesIds?: string[];
|
|
297
|
+
}
|
|
298
|
+
/** A minimal reading shape for migration input. */
|
|
299
|
+
interface MigrationReading {
|
|
300
|
+
id: string;
|
|
301
|
+
/** The assumption id this reading's belief scores (single-belief migration). */
|
|
302
|
+
assumptionId: string;
|
|
303
|
+
Rung: Rung;
|
|
304
|
+
Result: Result;
|
|
305
|
+
magnitudeBand?: "Low" | "Typical" | "High" | null;
|
|
306
|
+
Source: string | null;
|
|
307
|
+
Representativeness: number;
|
|
308
|
+
Credibility: number;
|
|
309
|
+
Date: string | null;
|
|
310
|
+
experimentId: string | null;
|
|
311
|
+
/** Existing derived Strength (for the delta report). */
|
|
312
|
+
derived?: {
|
|
313
|
+
strength?: number;
|
|
314
|
+
} | null;
|
|
315
|
+
}
|
|
316
|
+
/** The output shape for a migrated assumption. */
|
|
317
|
+
interface MigratedAssumption extends MigrationAssumption {
|
|
318
|
+
"Question Type": QuestionType;
|
|
319
|
+
/** Whether the inferred question type was flagged for human review. */
|
|
320
|
+
questionTypeReviewNeeded: boolean;
|
|
321
|
+
/** The new derived Confidence (recomputed under the new sub-ladder). */
|
|
322
|
+
newConfidence: number;
|
|
323
|
+
/** The pre-migration Confidence (for the delta report). */
|
|
324
|
+
oldConfidence: number;
|
|
325
|
+
/** The Confidence delta (new − old). */
|
|
326
|
+
confidenceDelta: number;
|
|
327
|
+
/** The stage's Risk threshold (for the summary). */
|
|
328
|
+
riskThreshold: number;
|
|
329
|
+
}
|
|
330
|
+
/** The output shape for a migrated reading's belief. */
|
|
331
|
+
interface MigratedReading {
|
|
332
|
+
id: string;
|
|
333
|
+
assumptionId: string;
|
|
334
|
+
Rung: Rung;
|
|
335
|
+
/** The recomputed Strength (s) under the new sub-ladder. */
|
|
336
|
+
newStrength: number;
|
|
337
|
+
/** The pre-migration Strength (for diffing). */
|
|
338
|
+
oldStrength: number;
|
|
339
|
+
/** True if the rung is non-evidence for the linked assumption's question type. */
|
|
340
|
+
nonEvidence: boolean;
|
|
341
|
+
}
|
|
342
|
+
/** The full migration result. */
|
|
343
|
+
interface MigrationResult {
|
|
344
|
+
assumptions: MigratedAssumption[];
|
|
345
|
+
readings: MigratedReading[];
|
|
346
|
+
/** The number of readings flagged as non-evidence. */
|
|
347
|
+
nonEvidenceFlagCount: number;
|
|
348
|
+
/** The number of assumptions flagged for human review of their question type. */
|
|
349
|
+
reviewQueueCount: number;
|
|
350
|
+
/** Per-assumption Confidence deltas, sorted by |delta| descending. */
|
|
351
|
+
confidenceDeltas: {
|
|
352
|
+
id: string;
|
|
353
|
+
delta: number;
|
|
354
|
+
oldConfidence: number;
|
|
355
|
+
newConfidence: number;
|
|
356
|
+
}[];
|
|
357
|
+
/** Per-assumption ranking shifts in the Risk-ranked register (oldRank →
|
|
358
|
+
* newRank, 1-indexed; positive = moved down the ranking, negative = moved
|
|
359
|
+
* up). Sorted by |shift| descending. */
|
|
360
|
+
rankingShifts: {
|
|
361
|
+
id: string;
|
|
362
|
+
oldRank: number;
|
|
363
|
+
newRank: number;
|
|
364
|
+
shift: number;
|
|
365
|
+
}[];
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Migrate an old-shape register to the new question-type-aware shape. Pure —
|
|
369
|
+
* no I/O. The caller reads the register, calls this, and writes the result;
|
|
370
|
+
* the backup is the caller's responsibility (write a dated copy of the input
|
|
371
|
+
* before calling `migrateRegister`).
|
|
372
|
+
*
|
|
373
|
+
* The migration:
|
|
374
|
+
* 1. Infers `Question Type` for each assumption from its falsification bar.
|
|
375
|
+
* 2. Recomputes each reading's `s` via `RUNG_ANCHOR[questionType][rung][band]`.
|
|
376
|
+
* 3. Flags readings whose rung is non-evidence for the linked assumption's
|
|
377
|
+
* question type (keeps the would-have-been `s` visible for diffing).
|
|
378
|
+
* 4. Recomputes each assumption's Confidence under the new sub-ladder.
|
|
379
|
+
* 5. Produces a summary report of Confidence deltas and flag counts.
|
|
380
|
+
*/
|
|
381
|
+
declare function migrateRegister(assumptions: MigrationAssumption[], readings: MigrationReading[]): MigrationResult;
|
|
382
|
+
|
|
93
383
|
declare function sourceQuality(representativeness: number, credibility: number): number;
|
|
94
384
|
|
|
95
385
|
/**
|
|
@@ -148,6 +438,8 @@ interface ConfidenceReadingInput {
|
|
|
148
438
|
source: string | null;
|
|
149
439
|
rung: Rung;
|
|
150
440
|
result: Result;
|
|
441
|
+
/** The linked assumption's question type — sets the anchor sub-ladder. */
|
|
442
|
+
questionType: QuestionType;
|
|
151
443
|
representativeness: number;
|
|
152
444
|
credibility: number;
|
|
153
445
|
/** ISO date; used only as the dedupe tie-break (most recent wins). */
|
|
@@ -290,6 +582,8 @@ interface ExperimentConfidenceReadingInput {
|
|
|
290
582
|
source: string | null;
|
|
291
583
|
rung: Rung;
|
|
292
584
|
result: Result;
|
|
585
|
+
/** The linked assumption's question type — sets the anchor sub-ladder. */
|
|
586
|
+
questionType: QuestionType;
|
|
293
587
|
magnitudeBand?: MagnitudeBand;
|
|
294
588
|
representativeness: number;
|
|
295
589
|
credibility: number;
|
|
@@ -629,12 +923,15 @@ type index_BeliefStage = BeliefStage;
|
|
|
629
923
|
type index_BeliefStageInput = BeliefStageInput;
|
|
630
924
|
declare const index_COMMITMENT_FOUND: typeof COMMITMENT_FOUND;
|
|
631
925
|
declare const index_COMPLETENESS_SLOTS: typeof COMPLETENESS_SLOTS;
|
|
926
|
+
declare const index_CONFIDENCE_FLOOR_BY_STAGE: typeof CONFIDENCE_FLOOR_BY_STAGE;
|
|
632
927
|
type index_CompletenessInput = CompletenessInput;
|
|
633
928
|
type index_CompletenessSlot = CompletenessSlot;
|
|
634
929
|
type index_ConfSign = ConfSign;
|
|
635
930
|
type index_ConfidenceReadingInput = ConfidenceReadingInput;
|
|
931
|
+
declare const index_DEFAULT_QUESTION_TYPE: typeof DEFAULT_QUESTION_TYPE;
|
|
636
932
|
type index_ExperimentConfidenceBarInput = ExperimentConfidenceBarInput;
|
|
637
933
|
type index_ExperimentConfidenceReadingInput = ExperimentConfidenceReadingInput;
|
|
934
|
+
declare const index_INFERABLE_QUESTION_TYPES: typeof INFERABLE_QUESTION_TYPES;
|
|
638
935
|
type index_ImpactAssumptionInput = ImpactAssumptionInput;
|
|
639
936
|
type index_JourneyBeliefInput = JourneyBeliefInput;
|
|
640
937
|
type index_JourneyEvent = JourneyEvent;
|
|
@@ -642,6 +939,11 @@ type index_JourneyEventKind = JourneyEventKind;
|
|
|
642
939
|
type index_JourneyExperimentInput = JourneyExperimentInput;
|
|
643
940
|
declare const index_KILL_LANE_THRESHOLD: typeof KILL_LANE_THRESHOLD;
|
|
644
941
|
declare const index_MAX_STRENGTH: typeof MAX_STRENGTH;
|
|
942
|
+
type index_MigratedAssumption = MigratedAssumption;
|
|
943
|
+
type index_MigratedReading = MigratedReading;
|
|
944
|
+
type index_MigrationAssumption = MigrationAssumption;
|
|
945
|
+
type index_MigrationReading = MigrationReading;
|
|
946
|
+
type index_MigrationResult = MigrationResult;
|
|
645
947
|
type index_MoveKind = MoveKind;
|
|
646
948
|
type index_Mover = Mover;
|
|
647
949
|
type index_MoverKind = MoverKind;
|
|
@@ -653,6 +955,7 @@ type index_NextMoveInput = NextMoveInput;
|
|
|
653
955
|
type index_PortfolioBeliefInput = PortfolioBeliefInput;
|
|
654
956
|
type index_PortfolioProgress = PortfolioProgress;
|
|
655
957
|
type index_Progress = Progress;
|
|
958
|
+
declare const index_RISK_THRESHOLD_BY_STAGE: typeof RISK_THRESHOLD_BY_STAGE;
|
|
656
959
|
declare const index_RUNG_ANCHOR: typeof RUNG_ANCHOR;
|
|
657
960
|
type index_Scored = Scored;
|
|
658
961
|
type index_StageExperimentInput = StageExperimentInput;
|
|
@@ -667,30 +970,38 @@ declare const index_assumptionComplete: typeof assumptionComplete;
|
|
|
667
970
|
declare const index_assumptionCompleteness: typeof assumptionCompleteness;
|
|
668
971
|
declare const index_beliefRisk: typeof beliefRisk;
|
|
669
972
|
declare const index_beliefTestMeters: typeof beliefTestMeters;
|
|
973
|
+
declare const index_ceilingAnchor: typeof ceilingAnchor;
|
|
670
974
|
declare const index_classifyStage: typeof classifyStage;
|
|
671
975
|
declare const index_commitmentFactor: typeof commitmentFactor;
|
|
672
976
|
declare const index_completenessSlotPresence: typeof completenessSlotPresence;
|
|
673
977
|
declare const index_confidence: typeof confidence;
|
|
674
978
|
declare const index_confidenceAttribution: typeof confidenceAttribution;
|
|
979
|
+
declare const index_confidenceFloorForStage: typeof confidenceFloorForStage;
|
|
675
980
|
declare const index_confidenceTrajectory: typeof confidenceTrajectory;
|
|
676
981
|
declare const index_deriveBeliefStage: typeof deriveBeliefStage;
|
|
677
982
|
declare const index_derivedImpacts: typeof derivedImpacts;
|
|
678
983
|
declare const index_emptyTestMeter: typeof emptyTestMeter;
|
|
679
984
|
declare const index_experimentConfidence: typeof experimentConfidence;
|
|
680
985
|
declare const index_experimentProgress: typeof experimentProgress;
|
|
986
|
+
declare const index_hasClearedThreshold: typeof hasClearedThreshold;
|
|
987
|
+
declare const index_inferQuestionType: typeof inferQuestionType;
|
|
681
988
|
declare const index_isConcluded: typeof isConcluded;
|
|
989
|
+
declare const index_isNonEvidence: typeof isNonEvidence;
|
|
990
|
+
declare const index_migrateRegister: typeof migrateRegister;
|
|
682
991
|
declare const index_missingCompletenessSlots: typeof missingCompletenessSlots;
|
|
992
|
+
declare const index_needsReview: typeof needsReview;
|
|
683
993
|
declare const index_portfolioProgress: typeof portfolioProgress;
|
|
684
994
|
declare const index_rankNextMoves: typeof rankNextMoves;
|
|
685
995
|
declare const index_readingStrength: typeof readingStrength;
|
|
686
996
|
declare const index_risk: typeof risk;
|
|
997
|
+
declare const index_riskThresholdForStage: typeof riskThresholdForStage;
|
|
687
998
|
declare const index_round2: typeof round2;
|
|
688
999
|
declare const index_scoreAndDedupe: typeof scoreAndDedupe;
|
|
689
1000
|
declare const index_sign: typeof sign;
|
|
690
1001
|
declare const index_sourceQuality: typeof sourceQuality;
|
|
691
1002
|
declare const index_w0ForRung: typeof w0ForRung;
|
|
692
1003
|
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 };
|
|
1004
|
+
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, index_CONFIDENCE_FLOOR_BY_STAGE as CONFIDENCE_FLOOR_BY_STAGE, 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_confidenceFloorForStage as confidenceFloorForStage, 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
1005
|
}
|
|
695
1006
|
|
|
696
|
-
export {
|
|
1007
|
+
export { type TestMeter as $, type AttributionReadingInput as A, type BarLineInput as B, COMPLETENESS_SLOTS as C, DEFAULT_QUESTION_TYPE as D, type ExperimentConfidenceBarInput as E, type MigrationResult as F, type MoveKind as G, type Mover as H, INFERABLE_QUESTION_TYPES as I, type JourneyBeliefInput as J, KILL_LANE_THRESHOLD as K, type MoverKind as L, MAX_STRENGTH as M, type NextMove as N, type NextMoveAssumptionInput as O, type NextMoveDecisionInput as P, type NextMoveExperimentInput as Q, type NextMoveInput as R, type PortfolioBeliefInput as S, type PortfolioProgress as T, type Progress as U, RISK_THRESHOLD_BY_STAGE as V, RUNG_ANCHOR as W, type Scored as X, type StageExperimentInput as Y, type StageKey as Z, type StrengthInput as _, type CompletenessSlot as a, type TrajectoryPoint as a0, W0 as a1, W0_BY_RUNG as a2, assembleJourney as a3, beliefRisk as a4, beliefTestMeters as a5, ceilingAnchor as a6, classifyStage as a7, commitmentFactor as a8, completenessSlotPresence as a9, confidence as aa, confidenceAttribution as ab, confidenceFloorForStage as ac, confidenceTrajectory as ad, deriveBeliefStage as ae, derivedImpacts as af, emptyTestMeter as ag, experimentConfidence as ah, experimentProgress as ai, hasClearedThreshold as aj, inferQuestionType as ak, isConcluded as al, isNonEvidence as am, migrateRegister as an, needsReview as ao, portfolioProgress as ap, rankNextMoves as aq, risk as ar, riskThresholdForStage as as, round2 as at, scoreAndDedupe as au, sign as av, w0ForRung as aw, 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, CONFIDENCE_FLOOR_BY_STAGE as l, missingCompletenessSlots as m, type ConfSign as n, type ConfidenceReadingInput as o, type ExperimentConfidenceReadingInput as p, type ImpactAssumptionInput as q, readingStrength as r, sourceQuality as s, type JourneyEvent as t, type JourneyEventKind as u, type JourneyExperimentInput as v, type MigratedAssumption as w, type MigratedReading as x, type MigrationAssumption as y, type MigrationReading 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-
|
|
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
|
|
3
|
-
export { D as DataProvider, N as NotFoundError, S as StaleVersionError, i as isNotFoundError, a as isStaleVersionError } from './provider-
|
|
4
|
-
import { A as AttributionReadingInput } from './index-
|
|
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-
|
|
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-DhQyc0Gj.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-DhQyc0Gj.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
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
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 };
|