@validation-os/core 0.5.0 → 0.6.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.
@@ -0,0 +1,577 @@
1
+ import { k as MarketRung, j as MagnitudeBand, q as TestingRung, p as Rung, o as Result, F as Feasibility } from './types-BAyl0w2E.js';
2
+
3
+ /**
4
+ * Round to 2 decimals, matching the migration's `+(n).toFixed(2)`.
5
+ * Derived values are stored/displayed rounded; full precision is only used
6
+ * transiently inside a single computation.
7
+ */
8
+ declare function round2(n: number): number;
9
+
10
+ /**
11
+ * The evidence ladder anchors that feed Strength.
12
+ *
13
+ * Source of truth: `skills/_shared/ontology.yaml` → `vocabularies.rung`.
14
+ * Testing rungs carry a single anchor; Market rungs (the category formerly
15
+ * called "Goals", OPS-1305) carry a magnitude band (Low/Typical/High) picked
16
+ * from the absolute outcome. The anchors are unchanged by the rename.
17
+ */
18
+
19
+ declare const RUNG_ANCHOR: Record<TestingRung, number>;
20
+ declare const MARKET_RUNG_ANCHOR: Record<MarketRung, Record<MagnitudeBand, number>>;
21
+ declare function isMarketRung(rung: Rung): rung is MarketRung;
22
+
23
+ /**
24
+ * Assumption completeness — a derived readiness meter, never stored.
25
+ *
26
+ * Replaces the old Gaps / presence-field machinery (OPS-1305): an assumption's
27
+ * Draft-vs-Live readiness is the structural presence of its slots, not a set of
28
+ * hand-maintained tags. `Completeness %` is `filled slots / all slots`; a
29
+ * fully-filled assumption reads 100 and is Live-ready, an empty draft reads low.
30
+ *
31
+ * Slots (each an equal fifth):
32
+ * Description · Lens · Impact · Scoring justification · Dependencies traced
33
+ *
34
+ * Pure, no backend dependency — the same function the recompute pass stamps
35
+ * into the derived tuple and the audit checks readiness against.
36
+ */
37
+ /** The structural slots whose presence makes an assumption Live-ready. */
38
+ declare const COMPLETENESS_SLOTS: readonly ["Description", "Lens", "Impact", "Scoring justification", "Dependencies traced"];
39
+ type CompletenessSlot = (typeof COMPLETENESS_SLOTS)[number];
40
+ /** The record shape completeness reads — an assumption's structural fields. */
41
+ interface CompletenessInput {
42
+ Description?: unknown;
43
+ Lens?: unknown;
44
+ Impact?: unknown;
45
+ "Scoring justification"?: unknown;
46
+ dependsOnIds?: unknown;
47
+ enablesIds?: unknown;
48
+ }
49
+ /** Whether each slot is structurally present. */
50
+ declare function completenessSlotPresence(record: CompletenessInput): Record<CompletenessSlot, boolean>;
51
+ /** The slots that are absent or blank on a record. */
52
+ declare function missingCompletenessSlots(record: CompletenessInput): CompletenessSlot[];
53
+ /** Completeness as a whole-number percentage (0, 20, 40, 60, 80, 100). */
54
+ declare function assumptionCompleteness(record: CompletenessInput): number;
55
+ /** True when every slot is present — the structural precondition to be Live. */
56
+ declare function assumptionComplete(record: CompletenessInput): boolean;
57
+
58
+ /**
59
+ * Strength — the signed reading value `s` the Confidence average reads.
60
+ *
61
+ * Formula (`ontology.yaml` → `derivations.strength`):
62
+ * rung anchor (Market rungs: × magnitude band) × sign(Result)
63
+ * — Validated positive, Invalidated negative; 0 unless Validated/Invalidated.
64
+ */
65
+
66
+ declare function sign(result: Result): -1 | 0 | 1;
67
+ /** A reading counts toward Confidence only once concluded either way; an
68
+ * Inconclusive reading carries no signal. The single definition the whole
69
+ * derivation module (and its record→input mappers) share. */
70
+ declare function isConcluded(result: Result): boolean;
71
+ interface StrengthInput {
72
+ rung: Rung;
73
+ result: Result;
74
+ /** Only read for Market rungs; defaults to "Typical" when absent. */
75
+ magnitudeBand?: MagnitudeBand;
76
+ }
77
+ declare function readingStrength(input: StrengthInput): number;
78
+
79
+ declare function sourceQuality(representativeness: number, credibility: number): number;
80
+
81
+ /**
82
+ * Confidence — signed −100…100, 0 = no evidence.
83
+ *
84
+ * Formula (`ontology.yaml` → `derivations.confidence`):
85
+ * (w0·0 + Σ wi·si) / (w0 + Σ wi), w0 = 100,
86
+ * wi = |si| × Source quality, si = the reading's signed Strength.
87
+ *
88
+ * Only concluded Validated/Invalidated readings enter. Readings sharing a
89
+ * Source against one belief dedupe to the strongest (largest |si|, most
90
+ * recent on ties). Market-rung readings never dedupe (each closed commitment
91
+ * is its own unit). No corroboration bump.
92
+ */
93
+
94
+ /** The neutral prior weight — a hard floor per the guardrails. */
95
+ declare const W0 = 100;
96
+ interface ConfidenceReadingInput {
97
+ id: string;
98
+ /** The independence-dedupe key. Null falls back to the reading's own id. */
99
+ source: string | null;
100
+ rung: Rung;
101
+ result: Result;
102
+ representativeness: number;
103
+ credibility: number;
104
+ /** ISO date; used only as the dedupe tie-break (most recent wins). */
105
+ date?: string | null;
106
+ magnitudeBand?: MagnitudeBand;
107
+ }
108
+ interface Scored {
109
+ input: ConfidenceReadingInput;
110
+ strength: number;
111
+ sq: number;
112
+ /** The reading's weight in the average: |strength| × Source quality. */
113
+ weight: number;
114
+ }
115
+ /**
116
+ * Score every concluded reading and resolve the Source dedupe — the shared
117
+ * front half of the Confidence average. `confidence()` reduces the winners to
118
+ * a number; `confidenceAttribution()` reuses the same winners so the movers it
119
+ * reports always decompose the very number the drawer shows. Market rungs never
120
+ * dedupe (each closed commitment is its own unit).
121
+ */
122
+ declare function scoreAndDedupe(readings: ConfidenceReadingInput[]): Scored[];
123
+ declare function confidence(readings: ConfidenceReadingInput[]): number;
124
+
125
+ /**
126
+ * Confidence attribution — the "what's moving the number" half of the
127
+ * understanding layer (OPS-1276). Decomposes an assumption's Confidence into
128
+ * the experiments (and direct readings) contributing to it, ranked by how hard
129
+ * each pushes the number up or down.
130
+ *
131
+ * A winner's contribution is its signed share of the average:
132
+ * cᵢ = (weightᵢ · strengthᵢ) / den, den = w0 + Σ weight
133
+ * so Σ contributions = Σ(wᵢ·sᵢ)/den = Confidence (the w0·0 prior term is 0).
134
+ * The reveal therefore literally adds up to the hero number. Contributions are
135
+ * grouped by the reading's experiment (experiment-less readings — bare/found —
136
+ * fall into a "direct" bucket), then ranked by |contribution|. A reading's
137
+ * origin is an experiment or nothing; the retired Goal container is gone
138
+ * (OPS-1305).
139
+ */
140
+
141
+ interface AttributionReadingInput extends ConfidenceReadingInput {
142
+ /** The experiment that produced the reading, if any. */
143
+ experimentId?: string | null;
144
+ }
145
+ /** What a mover is anchored to — an experiment, or nothing (direct). */
146
+ type MoverKind = "experiment" | "direct";
147
+ interface Mover {
148
+ /** Stable grouping key: the experiment id, or "direct". */
149
+ key: string;
150
+ kind: MoverKind;
151
+ /** The experiment id when `kind === "experiment"`, else null. */
152
+ experimentId: string | null;
153
+ /** Signed push on Confidence; the whole set sums to `confidence`. */
154
+ contribution: number;
155
+ /** |contribution| — the rank key and the "how hard" magnitude. */
156
+ magnitude: number;
157
+ /** How many (deduped) readings back this mover. */
158
+ readingCount: number;
159
+ /** The winning readings' ids, for drill-through. */
160
+ readingIds: string[];
161
+ }
162
+ interface Attribution {
163
+ /** The same Confidence the derived box shows (from the same winners). */
164
+ confidence: number;
165
+ /** Movers ranked by |contribution|, strongest first. */
166
+ movers: Mover[];
167
+ }
168
+ declare function confidenceAttribution(readings: AttributionReadingInput[]): Attribution;
169
+
170
+ /**
171
+ * Progress-to-conclusion — how close a running experiment is to concluding
172
+ * (OPS-1276). An experiment concludes when every pre-registered bar line has
173
+ * been given a Bar verdict; progress is the count of settled bars against the
174
+ * total. Bar verdict is a report, never a Confidence input (nosql-schema.md),
175
+ * so reading it here is exactly its intended use.
176
+ */
177
+ interface BarLineInput {
178
+ /** null/"" until the bar is judged at closure. */
179
+ barVerdict?: string | null;
180
+ }
181
+ interface Progress {
182
+ /** Pre-registered bar lines on the experiment. */
183
+ total: number;
184
+ /** Bars that have a verdict. */
185
+ settled: number;
186
+ /** Bars still awaiting a verdict. */
187
+ toGo: number;
188
+ /** True once every bar is settled (and there is at least one). */
189
+ concluded: boolean;
190
+ }
191
+ declare function experimentProgress(bars: BarLineInput[]): Progress;
192
+
193
+ /**
194
+ * Confidence over time — the story of how the number got where it is
195
+ * (OPS-1276). At each date a concluded reading was dated, we recompute
196
+ * Confidence over every concluded reading up to and including that date, using
197
+ * the very same `confidence()` the derived box uses (so the last point equals
198
+ * the hero number). Undated concluded readings have no place on the timeline
199
+ * but still bear on the belief, so they are treated as always-present — folded
200
+ * into every point — which keeps the final point equal to today's Confidence.
201
+ */
202
+
203
+ interface TrajectoryPoint {
204
+ /** ISO date at which Confidence took this value. */
205
+ date: string;
206
+ confidence: number;
207
+ }
208
+ declare function confidenceTrajectory(readings: ConfidenceReadingInput[]): TrajectoryPoint[];
209
+
210
+ interface ImpactAssumptionInput {
211
+ id: string;
212
+ /** The hand-scored seed (0–100); null treated as 0. */
213
+ impact: number | null;
214
+ moot?: boolean;
215
+ /** Ids this assumption depends on. */
216
+ dependsOnIds: string[];
217
+ }
218
+ /**
219
+ * @param assumptions the full register (never a filtered slice — a filter
220
+ * silently drops dependents from the propagation).
221
+ * @param basedOnCounts id → number of standing decisions with a `Based on`
222
+ * link to that assumption. Each contributes +100 to S.
223
+ */
224
+ declare function derivedImpacts(assumptions: ImpactAssumptionInput[], basedOnCounts?: Record<string, number>): Map<string, number>;
225
+
226
+ declare function risk(derivedImpact: number, confidence: number): number;
227
+
228
+ interface PortfolioBeliefInput {
229
+ id: string;
230
+ /** Derived Impact — the belief's risk at Confidence ≤ 0 (0 when moot). */
231
+ derivedImpact: number;
232
+ /** The hand-scored seed Impact; the ever-identified floor when moot zeroes
233
+ * Derived Impact. Null/absent treated as 0. */
234
+ seedImpact: number | null;
235
+ /** The belief's current live Risk (stored `derived.risk`). */
236
+ risk: number;
237
+ /** Resolved — Invalidated (killed) or moot. Its live risk reads 0 (fully
238
+ * retired), whatever the stored Risk number says. */
239
+ resolved: boolean;
240
+ }
241
+ /** One belief's contribution to the burn-up. */
242
+ interface BeliefRisk {
243
+ /** Risk-ever-identified — the denominator's per-belief share. */
244
+ identified: number;
245
+ /** Live risk still carried (0 once resolved). */
246
+ live: number;
247
+ /** Risk bought down — the numerator's per-belief share. */
248
+ retired: number;
249
+ }
250
+ interface PortfolioProgress {
251
+ /** Σ risk-ever-identified — the burn-up denominator. */
252
+ identified: number;
253
+ /** Σ risk bought down — the burn-up numerator. */
254
+ retired: number;
255
+ /** Σ risk still live. */
256
+ live: number;
257
+ /** Retired ÷ identified as a percentage (0 when nothing is identified). */
258
+ percent: number;
259
+ /** Beliefs still in play (not resolved). */
260
+ liveCount: number;
261
+ /** Beliefs resolved (killed or moot). */
262
+ resolvedCount: number;
263
+ }
264
+ /** One belief's identified / live / retired risk — the rule in one place. */
265
+ declare function beliefRisk(b: PortfolioBeliefInput): BeliefRisk;
266
+ /**
267
+ * Roll every belief up into the portfolio burn-up. Pass the *whole* set
268
+ * (resolved rows included) — a filtered slice understates the denominator and
269
+ * makes fresh or retired risk read as backsliding.
270
+ */
271
+ declare function portfolioProgress(beliefs: PortfolioBeliefInput[]): PortfolioProgress;
272
+
273
+ /**
274
+ * Next-move ranking — the front door's single source of truth for "what should
275
+ * I do next" (build OPS-1304; placement OPS-1292; action vocabulary OPS-1291).
276
+ *
277
+ * Ranks *beliefs* — Model A: point at one belief, not a heterogeneous triage
278
+ * queue (OPS-1291) — by the method's Feasibility × Risk rule (`docs/method.md`,
279
+ * `ontology.yaml` → `derived_views.next_move`), and names the single act each
280
+ * belief's stage demands. A belief at Confidence ≤ −50 jumps into a distinct
281
+ * kill/re-test lane that sorts above the Feasibility × Risk order regardless of
282
+ * rank — the one place act-urgency beats belief-risk (`derived_views.kill_lane`).
283
+ *
284
+ * Computed fresh on read: a whole-set ordering, so it stays OUT of the OPS-1251
285
+ * on-write recompute — it reads the derived numbers (Risk, Confidence) those
286
+ * writes already keep current. Pure: no I/O, no caching, no weights framework —
287
+ * the enum→multiplier map below IS the formula (OPS-1292: "no weights /
288
+ * strategies / caching / framework").
289
+ */
290
+
291
+ /** The kill/re-test threshold — Confidence at or below this is the kill lane. */
292
+ declare const KILL_LANE_THRESHOLD = -50;
293
+ /**
294
+ * The acts the front door can name, one per belief-stage. The front door
295
+ * *names* all of them; only a subset are human step-in forms — the rest are
296
+ * agent-run / off-dashboard (OPS-1294). Which is which is a presentation
297
+ * concern the dashboard owns, not this ranking.
298
+ */
299
+ type MoveKind = "score-impact" | "design-experiment" | "record-reading" | "decide" | "retest";
300
+ /**
301
+ * One belief's next move. `move`/`score`/`reason` are the OPS-1292 output
302
+ * contract; the rest is context the front door renders (the risk chip, the kill
303
+ * banner, the step-in adaptation) — every field read from the inputs, nothing
304
+ * new computed here.
305
+ */
306
+ interface NextMove {
307
+ /** The act this belief's stage demands. */
308
+ move: MoveKind;
309
+ assumptionId: string;
310
+ /** The belief statement — the hero headline. */
311
+ title: string;
312
+ /** Feasibility × Risk. Kill-lane rows carry their Risk and sort first. */
313
+ score: number;
314
+ /** Plain-language "why this" — explains from the inputs, no jargon. */
315
+ reason: string;
316
+ /** The belief's live derived Risk (0–100). */
317
+ risk: number;
318
+ /** The belief's live derived Confidence (signed −100…100). */
319
+ confidence: number;
320
+ /** The feasibility that fed the score; null when no test plans it yet. */
321
+ feasibility: Feasibility | null;
322
+ /** Confidence ≤ −50 — the override lane. */
323
+ killLane: boolean;
324
+ }
325
+ /** A belief and its live derived numbers (the ranking's primary input). */
326
+ interface NextMoveAssumptionInput {
327
+ id: string;
328
+ title: string;
329
+ /** AssumptionStatus; `Invalidated` rows are already killed and drop out. */
330
+ status: string;
331
+ /** The hand-scored seed (0–100); null means unscored → "score impact". */
332
+ impact: number | null;
333
+ /** Mooted beliefs (Impact pinned to 0 by a decision) drop out of ranking. */
334
+ moot: boolean;
335
+ /** Derived Risk (already recomputed on write — read, never recomputed). */
336
+ risk: number;
337
+ /** Derived Confidence (already recomputed on write). */
338
+ confidence: number;
339
+ /** How many concluded (Validated/Invalidated) readings back this belief. */
340
+ concludedReadings: number;
341
+ }
342
+ /** An experiment, reduced to what stage + feasibility resolution needs. */
343
+ interface NextMoveExperimentInput {
344
+ /** ExperimentStatus — "Running" | "Closed". */
345
+ status: string;
346
+ feasibility: Feasibility | null;
347
+ /** The assumption ids this experiment's bar lines name. */
348
+ assumptionIds: string[];
349
+ }
350
+ /** A decision, reduced to which beliefs it rests on or resolves. */
351
+ interface NextMoveDecisionInput {
352
+ /** DecisionStatus; only standing (Active/Provisional) decisions count. */
353
+ status: string;
354
+ /** The assumption ids this decision rests on (`based on`) or resolves. */
355
+ assumptionIds: string[];
356
+ }
357
+ interface NextMoveInput {
358
+ assumptions: NextMoveAssumptionInput[];
359
+ experiments: NextMoveExperimentInput[];
360
+ decisions: NextMoveDecisionInput[];
361
+ }
362
+ /**
363
+ * Rank every unresolved belief into its next move (Model A). Returns a plain
364
+ * sorted list, most-pressing first: the kill lane on top (by Risk), then the
365
+ * rest by Feasibility × Risk, tie-broken by the most-negative Confidence
366
+ * (`derived_views.test_next_surface`), then by id for a stable order. The front
367
+ * door takes the head as the hero and the tail as "On deck" / manual override.
368
+ */
369
+ declare function rankNextMoves(input: NextMoveInput): NextMove[];
370
+
371
+ /** The four loop stages a belief travels, in order (OPS-1293). */
372
+ type StageKey = "framed" | "planned" | "tested" | "known";
373
+ /** Sign of a belief's Confidence — the Known meter's direction. */
374
+ type ConfSign = "pos" | "neg" | "zero";
375
+ /** One belief's test state, aggregated across every experiment aimed at it. */
376
+ interface TestMeter {
377
+ /** A bar line (or the convenience projection) names this belief. */
378
+ planned: boolean;
379
+ /** Pre-registered bars that have a verdict. */
380
+ settled: number;
381
+ /** Pre-registered bars in total. */
382
+ total: number;
383
+ }
384
+ /** A test's bar lines, reduced to what the meter needs (register-agnostic). */
385
+ interface StageExperimentInput {
386
+ /** Each bar line naming a belief, and whether it has settled (has a verdict). */
387
+ bars: {
388
+ assumptionId: string;
389
+ settled: boolean;
390
+ }[];
391
+ /** Beliefs this test plans via the convenience projection (bars may be unexpanded). */
392
+ plannedAssumptionIds: string[];
393
+ }
394
+ /** The reduced inputs one belief's stage is derived from. */
395
+ interface BeliefStageInput {
396
+ /** Framing completeness, 0–100 (`assumptionCompleteness`). */
397
+ framed: number;
398
+ /** Live derived Confidence (signed −100…100). */
399
+ confidence: number;
400
+ /** This belief's aggregated test state. */
401
+ test: TestMeter;
402
+ }
403
+ /** One belief's position on the spine plus its four meters. */
404
+ interface BeliefStage {
405
+ /** Where the belief sits: framed → planned → tested → known. */
406
+ stage: StageKey;
407
+ /** Meter 1 — framing completeness, 0–100. */
408
+ framed: number;
409
+ /** Meter 2 — a test has been designed against this belief. */
410
+ planned: boolean;
411
+ /** Meter 3 — pre-registered bars settled / total. */
412
+ tested: {
413
+ settled: number;
414
+ total: number;
415
+ };
416
+ /** Meter 4 — signed Known: the belief's Confidence. */
417
+ confidence: number;
418
+ /** Sign bucket for the Known gauge direction. */
419
+ confSign: ConfSign;
420
+ /** Confidence ≤ −50 — the kill/re-test overlay (the same lane as the front door). */
421
+ killZone: boolean;
422
+ }
423
+ /** An empty test state — a belief no experiment has named yet. */
424
+ declare function emptyTestMeter(): TestMeter;
425
+ /**
426
+ * For every belief, the state of the tests aimed at it — whether one is designed
427
+ * and how many of its pre-registered bars have settled, aggregated across all
428
+ * experiments. Factored out of the pipeline row-builder so the board and a
429
+ * single belief's rail agree by construction.
430
+ */
431
+ declare function beliefTestMeters(experiments: StageExperimentInput[]): Map<string, TestMeter>;
432
+ /**
433
+ * Classify a belief on the spine from its meters. The kill-zone overlay is
434
+ * *not* a stage — a belief whose evidence has turned is still structurally
435
+ * wherever its framing/tests put it (a re-test moves it backward via the Known
436
+ * meter, OPS-1300), so this stays pure status.
437
+ */
438
+ declare function classifyStage(framed: number, test: TestMeter): StageKey;
439
+ /** One belief's stage + four meters — the rail's data. */
440
+ declare function deriveBeliefStage(input: BeliefStageInput): BeliefStage;
441
+
442
+ /**
443
+ * The per-belief journey event log (OPS-1329) — the belief's life ordered into
444
+ * dated events: bet → score → experiment → readings → confidence-cross → now.
445
+ * It is the *story* half of the journey drill-in (the *rail* half is `stage.ts`).
446
+ *
447
+ * No new maths: Confidence at each point is read off `confidenceTrajectory`
448
+ * (the very numbers the understanding layer already shows), and the current
449
+ * number off `confidence()`. Nothing is invented — an event whose underlying
450
+ * datum is absent (no impact score, no experiment, no concluded reading, no
451
+ * kill-zone cross) is simply omitted, and no date is ever faked (an event with
452
+ * no real date carries `date: null` and takes its place by structural order).
453
+ *
454
+ * Pure and label-free: the dashboard journey view-model adds the copy. Computed
455
+ * fresh on read, out of the OPS-1251 on-write recompute.
456
+ */
457
+
458
+ /** The kinds of event a belief's life produces, in structural order. */
459
+ type JourneyEventKind = "bet" | "score" | "experiment" | "reading" | "confidence-cross" | "now";
460
+ /** One event in a belief's life. Label-free — the view-model adds the copy. */
461
+ interface JourneyEvent {
462
+ kind: JourneyEventKind;
463
+ /** ISO date, or null when no real date exists (never faked). */
464
+ date: string | null;
465
+ /** Confidence known at this event (reading / cross / now); null otherwise. */
466
+ confidence: number | null;
467
+ /** The reading's verdict, for `reading` events; null otherwise. */
468
+ result: Result | null;
469
+ /** The source record id (reading id, experiment id) when the event has one. */
470
+ refId: string | null;
471
+ }
472
+ /** The belief itself, reduced to what the log needs. */
473
+ interface JourneyBeliefInput {
474
+ /** When the bet was written — the `bet` event's date. */
475
+ createdAt: string | null;
476
+ /** Impact has been scored (a non-null seed) — emits the `score` event. */
477
+ impactScored: boolean;
478
+ }
479
+ /** A test aimed at this belief, reduced to what the log needs. */
480
+ interface JourneyExperimentInput {
481
+ id: string;
482
+ /** When the test was designed; null when unknown (event still emitted, undated). */
483
+ date: string | null;
484
+ }
485
+ interface AssembleJourneyInput {
486
+ belief: JourneyBeliefInput;
487
+ /** The belief's own readings (already filtered to this assumption). */
488
+ readings: AttributionReadingInput[];
489
+ /** The experiments testing this belief. */
490
+ experiments: JourneyExperimentInput[];
491
+ /** "Now" as an ISO date — passed in so the log stays pure. */
492
+ now: string;
493
+ }
494
+ /**
495
+ * Assemble one belief's chronological event log. Events sort by date, undated
496
+ * events anchored to the bet's date and ordered structurally; `now` is always
497
+ * last.
498
+ */
499
+ declare function assembleJourney(input: AssembleJourneyInput): JourneyEvent[];
500
+
501
+ /**
502
+ * The shared derivation module — pure functions, no I/O.
503
+ *
504
+ * The same module the dashboard, the API (derive-on-write), and Claude Code
505
+ * audits all call, so every writer computes the four derived numbers
506
+ * identically. Ported from `doshi-validation-os/migration/remodel.mjs` and
507
+ * kept in lock-step with `skills/_shared/ontology.yaml`.
508
+ */
509
+
510
+ type index_AssembleJourneyInput = AssembleJourneyInput;
511
+ type index_Attribution = Attribution;
512
+ type index_AttributionReadingInput = AttributionReadingInput;
513
+ type index_BarLineInput = BarLineInput;
514
+ type index_BeliefRisk = BeliefRisk;
515
+ type index_BeliefStage = BeliefStage;
516
+ type index_BeliefStageInput = BeliefStageInput;
517
+ declare const index_COMPLETENESS_SLOTS: typeof COMPLETENESS_SLOTS;
518
+ type index_CompletenessInput = CompletenessInput;
519
+ type index_CompletenessSlot = CompletenessSlot;
520
+ type index_ConfSign = ConfSign;
521
+ type index_ConfidenceReadingInput = ConfidenceReadingInput;
522
+ type index_ImpactAssumptionInput = ImpactAssumptionInput;
523
+ type index_JourneyBeliefInput = JourneyBeliefInput;
524
+ type index_JourneyEvent = JourneyEvent;
525
+ type index_JourneyEventKind = JourneyEventKind;
526
+ type index_JourneyExperimentInput = JourneyExperimentInput;
527
+ declare const index_KILL_LANE_THRESHOLD: typeof KILL_LANE_THRESHOLD;
528
+ declare const index_MARKET_RUNG_ANCHOR: typeof MARKET_RUNG_ANCHOR;
529
+ type index_MoveKind = MoveKind;
530
+ type index_Mover = Mover;
531
+ type index_MoverKind = MoverKind;
532
+ type index_NextMove = NextMove;
533
+ type index_NextMoveAssumptionInput = NextMoveAssumptionInput;
534
+ type index_NextMoveDecisionInput = NextMoveDecisionInput;
535
+ type index_NextMoveExperimentInput = NextMoveExperimentInput;
536
+ type index_NextMoveInput = NextMoveInput;
537
+ type index_PortfolioBeliefInput = PortfolioBeliefInput;
538
+ type index_PortfolioProgress = PortfolioProgress;
539
+ type index_Progress = Progress;
540
+ declare const index_RUNG_ANCHOR: typeof RUNG_ANCHOR;
541
+ type index_Scored = Scored;
542
+ type index_StageExperimentInput = StageExperimentInput;
543
+ type index_StageKey = StageKey;
544
+ type index_StrengthInput = StrengthInput;
545
+ type index_TestMeter = TestMeter;
546
+ type index_TrajectoryPoint = TrajectoryPoint;
547
+ declare const index_W0: typeof W0;
548
+ declare const index_assembleJourney: typeof assembleJourney;
549
+ declare const index_assumptionComplete: typeof assumptionComplete;
550
+ declare const index_assumptionCompleteness: typeof assumptionCompleteness;
551
+ declare const index_beliefRisk: typeof beliefRisk;
552
+ declare const index_beliefTestMeters: typeof beliefTestMeters;
553
+ declare const index_classifyStage: typeof classifyStage;
554
+ declare const index_completenessSlotPresence: typeof completenessSlotPresence;
555
+ declare const index_confidence: typeof confidence;
556
+ declare const index_confidenceAttribution: typeof confidenceAttribution;
557
+ declare const index_confidenceTrajectory: typeof confidenceTrajectory;
558
+ declare const index_deriveBeliefStage: typeof deriveBeliefStage;
559
+ declare const index_derivedImpacts: typeof derivedImpacts;
560
+ declare const index_emptyTestMeter: typeof emptyTestMeter;
561
+ declare const index_experimentProgress: typeof experimentProgress;
562
+ declare const index_isConcluded: typeof isConcluded;
563
+ declare const index_isMarketRung: typeof isMarketRung;
564
+ declare const index_missingCompletenessSlots: typeof missingCompletenessSlots;
565
+ declare const index_portfolioProgress: typeof portfolioProgress;
566
+ declare const index_rankNextMoves: typeof rankNextMoves;
567
+ declare const index_readingStrength: typeof readingStrength;
568
+ declare const index_risk: typeof risk;
569
+ declare const index_round2: typeof round2;
570
+ declare const index_scoreAndDedupe: typeof scoreAndDedupe;
571
+ declare const index_sign: typeof sign;
572
+ declare const index_sourceQuality: typeof sourceQuality;
573
+ declare namespace index {
574
+ 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_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_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_MARKET_RUNG_ANCHOR as MARKET_RUNG_ANCHOR, 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_assembleJourney as assembleJourney, index_assumptionComplete as assumptionComplete, index_assumptionCompleteness as assumptionCompleteness, index_beliefRisk as beliefRisk, index_beliefTestMeters as beliefTestMeters, index_classifyStage as classifyStage, 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_experimentProgress as experimentProgress, index_isConcluded as isConcluded, index_isMarketRung as isMarketRung, 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 };
575
+ }
576
+
577
+ export { derivedImpacts as $, type AttributionReadingInput as A, type BarLineInput as B, COMPLETENESS_SLOTS as C, type Progress as D, type StageExperimentInput as E, type StageKey as F, type StrengthInput as G, type TrajectoryPoint as H, type ImpactAssumptionInput as I, type JourneyBeliefInput as J, KILL_LANE_THRESHOLD as K, assembleJourney as L, MARKET_RUNG_ANCHOR as M, type NextMove as N, beliefRisk as O, type PortfolioBeliefInput as P, beliefTestMeters as Q, RUNG_ANCHOR as R, type Scored as S, type TestMeter as T, classifyStage as U, completenessSlotPresence as V, W0 as W, confidence as X, confidenceAttribution as Y, confidenceTrajectory as Z, deriveBeliefStage as _, type CompletenessSlot as a, emptyTestMeter as a0, experimentProgress as a1, isConcluded as a2, isMarketRung as a3, portfolioProgress as a4, rankNextMoves as a5, risk as a6, round2 as a7, scoreAndDedupe as a8, sign as a9, 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, type ConfSign as k, type ConfidenceReadingInput as l, missingCompletenessSlots as m, type JourneyEvent as n, type JourneyEventKind as o, type JourneyExperimentInput as p, type MoveKind as q, readingStrength as r, sourceQuality as s, type Mover as t, type MoverKind as u, type NextMoveAssumptionInput as v, type NextMoveDecisionInput as w, type NextMoveExperimentInput as x, type NextMoveInput as y, type PortfolioProgress as z };
package/dist/index.d.ts CHANGED
@@ -1,33 +1,8 @@
1
- import { R as Relation, C as Collection, A as AssumptionRecord, a as ReadingRecord, D as DecisionRecord, b as AssumptionDerived, c as AnyRecord } from './types-B3eI7ASx.js';
2
- export { d as AssumptionStatus, B as BarLine, e as BaseRecord, f as DecisionStatus, E as ExperimentRecord, g as ExperimentStatus, F as Feasibility, G as GOAL_RUNG_VALUES, h as GlossaryRecord, i as GlossaryStatus, j as GoalRecord, k as GoalRung, l as GoalStatus, M as MagnitudeBand, m as REGISTERS, n as RecordRef, o as Register, p as Result, q as Rung, S as SourceQualityPick, T as TESTING_RUNGS, r as TestingRung } from './types-B3eI7ASx.js';
3
- export { D as DataProvider, N as NotFoundError, S as StaleVersionError, i as isNotFoundError, a as isStaleVersionError } from './provider-hW8Hxf-n.js';
4
- import { A as AttributionReadingInput } from './index-CieW13mJ.js';
5
- export { i as derivation, s as recomputeSourceQuality, r as recomputeStrength } from './index-CieW13mJ.js';
6
-
7
- /**
8
- * Presence checks — the structural half of the assumption write guardrail.
9
- *
10
- * `5 Whys`, `Metric for truth`, and `Scoring justification` used to live as
11
- * body prose audited as *semantic* Gaps (the audit had to parse markdown and
12
- * guess). OPS-1273 promotes them to first-class fields, so their PRESENCE is a
13
- * cheap structural check: non-empty is required to move an assumption to
14
- * `Live` — the presence half of the Draft→Live gaps invariant (OPS-1251).
15
- *
16
- * These are pure functions with no backend dependency: the primitive the CRUD
17
- * write model is to block a Draft→Live write on (write-time enforcement lands
18
- * with the write slice, OPS-1256), and that the audit reports as an error-level
19
- * finding meanwhile (`presence-field-missing` in `ontology.yaml`).
20
- */
21
- /** The assumption fields whose presence is structurally required to go `Live`. */
22
- declare const ASSUMPTION_PRESENCE_FIELDS: readonly ["5 Whys", "Metric for truth", "Scoring justification"];
23
- type AssumptionPresenceField = (typeof ASSUMPTION_PRESENCE_FIELDS)[number];
24
- /** The presence fields that are absent or blank on a record. */
25
- declare function missingPresenceFields(record: Partial<Record<AssumptionPresenceField, unknown>>): AssumptionPresenceField[];
26
- /**
27
- * True when every presence field is non-blank — the structural precondition
28
- * for an assumption to be `Live`. A `Draft` may legally fail this.
29
- */
30
- declare function assumptionPresenceComplete(record: Partial<Record<AssumptionPresenceField, unknown>>): boolean;
1
+ import { R as Relation, C as Collection, A as AssumptionRecord, a as ReadingRecord, D as DecisionRecord, b as AssumptionDerived, c as AnyRecord } from './types-BAyl0w2E.js';
2
+ export { d as AssumptionStatus, B as BarLine, e as BaseRecord, f as DecisionStatus, E as ExperimentRecord, g as ExperimentStatus, F as Feasibility, G as GlossaryAvoid, h as GlossaryRecord, i as GlossaryStatus, M as MARKET_RUNG_VALUES, j as MagnitudeBand, k as MarketRung, l as REGISTERS, m as RecordRef, n as Register, o as Result, p as Rung, S as SourceQualityPick, T as TESTING_RUNGS, q as TestingRung } from './types-BAyl0w2E.js';
3
+ export { D as DataProvider, N as NotFoundError, S as StaleVersionError, i as isNotFoundError, a as isStaleVersionError } from './provider-DGr5Xq5U.js';
4
+ import { A as AttributionReadingInput } from './index-BlXH_thK.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-BlXH_thK.js';
31
6
 
32
7
  /**
33
8
  * Relation config — the single table describing, for each linkable relation,
@@ -78,4 +53,4 @@ declare function recomputeDerived(input: RecomputeInput): Map<string, Assumption
78
53
  /** Map a reading record (canonical Title-cased fields) to its derivation input. */
79
54
  declare function toReadingInput(r: AnyRecord): AttributionReadingInput;
80
55
 
81
- export { ASSUMPTION_PRESENCE_FIELDS, AnyRecord, AssumptionDerived, type AssumptionPresenceField, AssumptionRecord, Collection, DecisionRecord, RELATIONS, ReadingRecord, type RecomputeInput, Relation, type RelationEnd, type RelationSpec, assumptionPresenceComplete, missingPresenceFields, recomputeDerived, toReadingInput };
56
+ export { AnyRecord, AssumptionDerived, AssumptionRecord, Collection, DecisionRecord, RELATIONS, ReadingRecord, type RecomputeInput, Relation, type RelationEnd, type RelationSpec, recomputeDerived, toReadingInput };