@productbrain/cli 0.1.0-beta.3107 → 0.1.0-beta.3109

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.
@@ -6,41 +6,6 @@
6
6
  * node scripts/sync-scoreboard-core.mjs
7
7
  * A content-hash drift gate (scripts/check-mcp-lib-drift.mjs) fails CI if this drifts.
8
8
  */
9
- /**
10
- * Flywheel scoreboard — the DIAGNOSIS LAYER (spec §2d), SHARED SSOT.
11
- *
12
- * This is the layer that turns a raw number into the agent closing the loop. It is a PURE
13
- * mapping (no I/O — no fs, no node, no Convex runtime) from the data-layer payload
14
- * (M1/M2/M3/materialization, from the internal `scoreboard` action) PLUS the CLI-computed M5
15
- * local-drift, to per-metric diagnoses: `{ status, reading, cause, nextAction }`.
16
- *
17
- * WHY THIS LIVES IN ITS OWN WORKSPACE PACKAGE (`@product-brain/scoreboard-core`): the diagnosis
18
- * is consumed by BOTH the `pb` CLI (`packages/cli`, pretty + --json) AND the Cortex page
19
- * (`src/routes/(app)/w/[slug]/scoreboard`). A shared workspace package is the repo's convention
20
- * for framework-agnostic logic two non-Convex surfaces share (mirrors `@product-brain/doc-ast`).
21
- * The CLI cannot import across the monorepo boundary at publish time, so it consumes this body
22
- * through a committed copy guarded by a content-hash drift check (the same pattern mcp-server uses
23
- * for `convex/lib/flags_core.ts` → `src/flags.ts`). The SvelteKit app imports it directly.
24
- *
25
- * NOTHING HERE TOUCHES fs/node/Convex — the CLI-only `computeLocalDrift` (which stats
26
- * `.productbrain/`) stays in `packages/cli/src/scoreboard/localDrift.ts`. `diagnoseM5` itself is
27
- * pure (it maps a LocalDriftM5 → diagnosis) and lives here; only the fs *collection* of that
28
- * LocalDriftM5 is CLI-only.
29
- *
30
- * HONESTY OVER FLATTERY (spec §0, §2c). The hard rules this layer encodes:
31
- * - NO flip threshold is pinned yet (DEC-1282). Where a flip would decide ok/degraded, we
32
- * render `awaiting` ("threshold unpinned — pin against live distribution"), NEVER an
33
- * invented number. The RAW reading is always shown.
34
- * - M4 (WP-487 Slice 2, FEAT-1374: the organic rework meter) is now IN the data payload —
35
- * raw distribution only, `unmeasured` with nothing served yet, `awaiting` otherwise (no
36
- * first-time-good floor is pinned), NEVER a fake green, NEVER a causality claim.
37
- * - A STANDING `unmeasured` line for coaching/moat quality (TEN-2377): four green tiles ≠ a
38
- * healthy moat. The board must not imply moat health.
39
- * - Every `degraded`/`awaiting` carries a concrete `nextAction`.
40
- *
41
- * Pure + exported so the diagnosis unit tests assert the awaiting/unmeasured/degraded mapping
42
- * without any network or filesystem.
43
- */
44
9
  /** A metric's diagnosis status. */
45
10
  export type DiagnosisStatus = 'ok' | 'degraded' | 'awaiting' | 'unmeasured';
46
11
  export interface MetricDiagnosis {
@@ -67,12 +32,8 @@ export interface M1Payload {
67
32
  draftShare: number | null;
68
33
  windowMs: number;
69
34
  servedRowCount: number;
70
- /**
71
- * TEN-2449: rows that WERE rendered but fell outside M1's covered serve (`orient/cli/brief`).
72
- * Optional so an older payload fails SOFT. When this is > 0 and the mix is empty, the operator
73
- * has been serving — just not on the one path M1 measures — and the diagnosis must say so
74
- * rather than repeat "drive a serve".
75
- */
35
+ /** TEN-2449: rows rendered but outside M1's covered serve (`orient/cli/brief`). Optional so an
36
+ * older payload fails SOFT; when >0 with an empty mix, say so instead of "drive a serve". */
76
37
  excludedOutOfCoverage?: number;
77
38
  }
78
39
  export interface M2Payload {
@@ -131,11 +92,9 @@ export interface M4Payload {
131
92
  };
132
93
  }
133
94
  /**
134
- * WP-499 Slice B (TEN-2743, §2.5): advisories/verdicts/detection-coverage/override-rate.
135
- * Mirrors `convex/scoreboard/aggregates.ts`'s `CoherenceResult` structurally (not imported,
136
- * same convention as the other *Payload shapes above). NO thresholds baked in (DEC-1282)
137
- * `humanBar.meets` is the one legitimate bar-comparison field, read as-is from the server,
138
- * never a second verdict computed here.
95
+ * WP-499 Slice B (TEN-2743, §2.5): advisories/verdicts/detection-coverage/override-rate. Mirrors
96
+ * `convex/scoreboard/aggregates.ts`'s `CoherenceResult` structurally. NO thresholds baked in
97
+ * (DEC-1282) `humanBar.meets` is read as-is from the server, never a second local verdict.
139
98
  */
140
99
  export interface CoherencePayload {
141
100
  openConflictCount: number;
@@ -143,8 +102,8 @@ export interface CoherencePayload {
143
102
  reviewed: number;
144
103
  real: number;
145
104
  falseAlarm: number;
146
- /** PR #422 review (Codex, P2): reviewed/real/falseAlarm/humanBar above are a SAMPLE, not
147
- * a complete count, whenever this is true — render a qualifier, never present as complete. */
105
+ /** PR #422 review (P2): reviewed/real/falseAlarm/humanBar above are a SAMPLE (not complete)
106
+ * whenever true — render a qualifier, never present as complete. */
148
107
  reviewedTruncated: boolean;
149
108
  humanBar: {
150
109
  meets: boolean;
@@ -174,73 +133,57 @@ export interface ScoreboardPayload {
174
133
  coherence: CoherencePayload;
175
134
  }
176
135
  /**
177
- * The CLI-computed M5 local-pull drift (A5). Produced by computeLocalDrift() (NOT the data
178
- * layer — DEC-1284). `null` fields mean the local `.productbrain/` projection (or the server
179
- * materialization) was unavailable; the diagnosis fails soft to `awaiting`.
136
+ * The CLI-computed M5 local-pull drift (A5). Produced by computeLocalDrift() (NOT the data layer
137
+ * — DEC-1284). `null` fields mean local/server data was unavailable; fails soft to `awaiting`.
180
138
  */
181
139
  export interface LocalDriftM5 {
182
- /** Newest mtime across the local `.productbrain/` projection files, ms epoch. Null = absent. */
183
140
  localProjectionMtime: number | null;
184
- /** Server-side projection generation time (materialization.latestMaterializedAt). */
185
141
  serverMaterializedAt: number | null;
186
- /** How far the local pull lags the server projection, ms (server − local). Null when undeterminable. */
187
142
  localLagMs: number | null;
188
- /** Absolute age of the local projection vs now, ms. Null when the projection is absent. */
189
143
  localAgeMs: number | null;
190
- /** Set when `.productbrain/` could not be located/stat'd — diagnosis = awaiting, not a fake ok. */
191
144
  unavailableReason?: string;
192
145
  }
193
146
  /**
194
- * M1 — retrieval truth-state mix. The no-domain-share flip (INS-1775 floor) is UNPINNED, so the
195
- * status is `awaiting` whenever there is data to judge (we never invent the 50% floor). With zero
196
- * serves it is `unmeasured` (nothing served yet). The named cause for a high no-domain share is
197
- * "domains unratified".
147
+ * M1 — retrieval truth-state mix. The no-domain-share flip (INS-1775 floor) is UNPINNED `awaiting`
148
+ * whenever there is data (never invent the 50% floor); `unmeasured` with zero serves.
198
149
  */
199
150
  export declare function diagnoseM1(m1: M1Payload): MetricDiagnosis;
200
151
  /**
201
- * M2 — ranking agreement (tests the unify integrity). This one HAS a clean structural signal:
202
- * post-unify, full parity (divergentBuckets === 0) is the EXPECTED steady state that's `ok`.
203
- * A non-zero divergence IS the regression signal — `degraded` — and the M2-magnitude flip stays
204
- * unpinned, but the structural ok/degraded does not need a number (0 vs non-0 is exact).
152
+ * M2 — ranking agreement. A clean structural signal: post-unify full parity (0 divergent buckets)
153
+ * is the EXPECTED steady state (`ok`); non-zero divergence is the regression signal (`degraded`)
154
+ * exact, no number to pin.
205
155
  */
206
156
  export declare function diagnoseM2(m2: M2Payload): MetricDiagnosis;
207
157
  /**
208
- * M3 — draft-to-SSOT rate. The in-session-ratify floor (ASM-45 rolling-20 window) is UNPINNED,
209
- * so a judged reading is `awaiting`. Zero captures in the window → `unmeasured`.
158
+ * M3 — draft-to-SSOT rate. The in-session-ratify floor (ASM-45 rolling-20 window) is PINNED
159
+ * per DEC-1513 (`M3_IN_SESSION_FLOOR`) a determinable reading renders a real `ok`/`degraded`
160
+ * verdict. Zero captures → `unmeasured`. An undeterminable rate (null) fails soft to `awaiting`.
210
161
  */
211
162
  export declare function diagnoseM3(m3: M3Payload): MetricDiagnosis;
212
163
  /**
213
164
  * M4 — organic rework meter (WP-487 Slice 2, FEAT-1374). Joins served governance against
214
- * later-reported rework signals within a frozen 72h window (TEN-2728) and reports RAW
215
- * distribution + a false-attribution counter-metric never a verdict (DEC-1282 unchanged for
216
- * M4) and never a causality claim (spec §6: this is association, not "context served CAUSED
217
- * first-time-good"). `unmeasured` when nothing has been served in the window yet (no coverage
218
- * population to judge, mirrors diagnoseM1's zero-mix gate); `awaiting` whenever there IS data,
219
- * since no first-time-good floor is pinned yet — the raw share is always shown, never replaced
220
- * by an invented threshold.
165
+ * later-reported rework signals in a frozen 72h window (TEN-2728); RAW distribution + a
166
+ * false-attribution counter, never a verdict (DEC-1282) and never causality (association only).
167
+ * `unmeasured` with nothing served; `awaiting` otherwise (no floor pinned yet).
221
168
  */
222
169
  export declare function diagnoseM4(m4: M4Payload): MetricDiagnosis;
223
170
  /**
224
171
  * M5 — projection staleness, computed as LOCAL-PULL drift at the CLI (DEC-1284). The staleness-age
225
- * flip is UNPINNED, so a determinable reading is `awaiting`. When the local `.productbrain/`
226
- * projection (or the server materialization) is unavailable, the status is `unmeasured` with the
227
- * reason — fail-soft, never a fake ok.
172
+ * floor is PINNED per DEC-1513 (`M5_LOCAL_AGE_FLOOR_DAYS`) — a determinable reading renders a real
173
+ * `ok`/`degraded` verdict. Unavailable local/server data `unmeasured` with the reason, fail-soft.
228
174
  */
229
175
  export declare function diagnoseM5(m5: LocalDriftM5): MetricDiagnosis;
230
176
  /**
231
177
  * M5 (server view) — the Cortex page has NO local filesystem, so it cannot compute the spec's
232
178
  * local-pull drift (DEC-1284). It reads only the server-side projection-generation building block
233
- * (`materialization.latestMaterializedAt` / age) the public action already returns adding NO new
234
- * truth (spec §2d). This is deliberately a DIFFERENT, HONEST framing from `diagnoseM5`: it is
235
- * SERVER-generation age, never claimed to be the local-pull staleness the CLI measures. The
236
- * staleness-age flip is UNPINNED → `awaiting` when there is a materialization; `unmeasured` when
179
+ * (`materialization.latestMaterializedAt` / age) adding NO new truth (spec §2d). Deliberately a
180
+ * DIFFERENT, HONEST framing from `diagnoseM5`: SERVER-generation age, never local-pull staleness.
181
+ * The staleness-age floor is PINNED per DEC-1513 (`M5_SERVER_AGE_FLOOR_DAYS`); `unmeasured` when
237
182
  * the workspace has never materialized.
238
183
  */
239
184
  export declare function diagnoseM5FromServer(materialization: MaterializationPayload): MetricDiagnosis;
240
- /**
241
- * The STANDING coaching/moat-quality `unmeasured` line (TEN-2377). It is NOT a tile with a number —
242
- * it is a permanent honesty marker so four green tiles are never read as "the moat is healthy".
243
- */
185
+ /** The STANDING coaching/moat-quality `unmeasured` line (TEN-2377) — a permanent honesty marker
186
+ * so four green tiles are never read as "the moat is healthy". */
244
187
  export declare function diagnoseCoachingMoat(): MetricDiagnosis;
245
188
  /** The full diagnosis bundle the CLI renders + emits in --json. */
246
189
  export interface ScoreboardDiagnosis {
@@ -252,15 +195,9 @@ export interface ScoreboardDiagnosis {
252
195
  /** Standing honesty marker — coaching/moat quality is unmeasured. */
253
196
  moat: MetricDiagnosis;
254
197
  }
255
- /**
256
- * diagnose — the whole mapping: data-layer payload + CLI-computed M5 local-drift → per-metric
257
- * diagnoses + the standing M4-awaiting + coaching-unmeasured lines. Pure.
258
- */
198
+ /** diagnose — data-layer payload + CLI-computed M5 local-drift → per-metric diagnoses. Pure. */
259
199
  export declare function diagnose(payload: ScoreboardPayload, m5: LocalDriftM5): ScoreboardDiagnosis;
260
- /**
261
- * diagnoseFromServer the Cortex-page mapping: it has the public action payload but NO local fs,
262
- * so M5 is the server-generation-age view (`diagnoseM5FromServer`) rather than the CLI local-pull
263
- * drift. Everything else is identical to `diagnose`. Pure, browser-safe.
264
- */
200
+ /** diagnoseFromServer — Cortex has NO local fs, so M5 uses `diagnoseM5FromServer`'s
201
+ * server-generation-age view instead of local-pull drift. Otherwise identical to `diagnose`. */
265
202
  export declare function diagnoseFromServer(payload: ScoreboardPayload): ScoreboardDiagnosis;
266
203
  //# sourceMappingURL=diagnose.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/scoreboard/diagnose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,mCAAmC;AACnC,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,UAAU,GAAG,UAAU,GAAG,Y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E,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,EAAE,EAAE,eAAe,CAAC;IACpB,qEAAqE;IACrE,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,OAAO,EAAE,iBAAiB,EAAE,EAAE,EAAE,YAAY,GAAG,mBAAmB,CAS1F;AAED;iGACiG;AACjG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,mBAAmB,CASlF"}
@@ -6,29 +6,51 @@
6
6
  * node scripts/sync-scoreboard-core.mjs
7
7
  * A content-hash drift gate (scripts/check-mcp-lib-drift.mjs) fails CI if this drifts.
8
8
  */
9
- // User-facing copy carries NO raw Chain IDs (chain-id-leak guard): the CLI prints `cause` /
10
- // `nextAction` / `reading` verbatim to any workspace's terminal, so an ID here would leak our
11
- // internal governance refs cross-tenant. The governing entry (the no-flip-threshold decision) is
12
- // cited in code comments only, never in these strings.
9
+ /**
10
+ * Flywheel scoreboard the DIAGNOSIS LAYER (spec §2d), SHARED SSOT.
11
+ *
12
+ * This is the layer that turns a raw number into the agent closing the loop. It is a PURE
13
+ * mapping (no I/O — no fs, no node, no Convex runtime) from the data-layer payload
14
+ * (M1/M2/M3/materialization, from the internal `scoreboard` action) PLUS the CLI-computed M5
15
+ * local-drift, to per-metric diagnoses: `{ status, reading, cause, nextAction }`.
16
+ *
17
+ * WHY THIS LIVES IN ITS OWN WORKSPACE PACKAGE (`@product-brain/scoreboard-core`): the diagnosis
18
+ * is consumed by BOTH the `pb` CLI (`packages/cli`, pretty + --json) AND the Cortex page
19
+ * (`src/routes/(app)/w/[slug]/scoreboard`). A shared workspace package is the repo's convention
20
+ * for framework-agnostic logic two non-Convex surfaces share (mirrors `@product-brain/doc-ast`).
21
+ * The CLI cannot import across the monorepo boundary at publish time, so it consumes this body
22
+ * through a committed copy guarded by a content-hash drift check (the same pattern mcp-server uses
23
+ * for `convex/lib/flags_core.ts` → `src/flags.ts`). The SvelteKit app imports it directly.
24
+ *
25
+ * NOTHING HERE TOUCHES fs/node/Convex — the CLI-only `computeLocalDrift` (which stats
26
+ * `.productbrain/`) stays in `packages/cli/src/scoreboard/localDrift.ts`. `diagnoseM5` itself is
27
+ * pure (it maps a LocalDriftM5 → diagnosis) and lives here; only the fs *collection* of that
28
+ * LocalDriftM5 is CLI-only.
29
+ *
30
+ * HONESTY OVER FLATTERY (spec §0, §2c). The hard rules this layer encodes:
31
+ * - Most flip thresholds remain UNPINNED (DEC-1282): `awaiting`, NEVER an invented number;
32
+ * the RAW reading is always shown. **Exception (DEC-1513, 2026-07-26):** M3's in-session
33
+ * floor and M5's two age floors ARE pinned (`./floors.ts`) — `diagnoseM3`/`diagnoseM5`/
34
+ * `diagnoseM5FromServer` render a real `ok`/`degraded` verdict. DEC-1282's
35
+ * advisory-never-blocking semantics still hold — a pinned floor only changes `status`.
36
+ * - M4 (WP-487 Slice 2, FEAT-1374: the organic rework meter) is now IN the data payload —
37
+ * raw distribution only, `unmeasured` with nothing served yet, `awaiting` otherwise (no
38
+ * first-time-good floor is pinned), NEVER a fake green, NEVER a causality claim.
39
+ * - A STANDING `unmeasured` line for coaching/moat quality (TEN-2377): four green tiles ≠ a
40
+ * healthy moat. The board must not imply moat health.
41
+ * - Every `degraded`/`awaiting` carries a concrete `nextAction`.
42
+ *
43
+ * Pure + exported so the diagnosis unit tests assert the awaiting/unmeasured/degraded mapping
44
+ * without any network or filesystem.
45
+ */
46
+ import { M3_IN_SESSION_FLOOR, M5_LOCAL_AGE_FLOOR_DAYS, M5_SERVER_AGE_FLOOR_DAYS } from './floors.js';
47
+ // User-facing copy carries NO raw Chain IDs (chain-id-leak guard) — the CLI prints `cause`/
48
+ // `nextAction`/`reading` verbatim to any tenant's terminal; IDs are cited in comments only.
13
49
  const UNPINNED = 'threshold unpinned — pin against the live distribution';
14
- // WP-527 (Lane T Slice 2): PROPOSED (not pinned) floor values, drafted from the observed
15
- // distributions in docs/evals/PRESS-RELEASE-EVAL.md's Product-OS calibration runs a proposal for
16
- // founder accept, never a committed threshold, and never evidence about any OTHER workspace calling
17
- // this shared function (no workspaceId here PB is multi-tenant); the `cause` strings say
18
- // "Product-OS calibration" explicitly so the number is never misread as the caller's own history.
19
- // Status stays `awaiting` regardless (never ok/degraded from a proposal), per DEC-1282.
20
- // VISIBILITY GAP: reaches the `pb scoreboard` CLI (formatters/scoreboard.ts renders cause/
21
- // nextAction) but NOT Cortex — +page.svelte:171 renders only tile.reading + a static tooltip.
22
- // Surfacing PROPOSED state there is real, disclosed follow-up work, out of WP-527's scope.
23
- // M3 in-session-ratify: observed 0% in every Product-OS run so far — a conservative early bar.
24
- const M3_PROPOSED_IN_SESSION_FLOOR = 0.1;
25
- // M5 has TWO INCOMPARABLE age instruments (diagnoseM5's local-pull drift vs diagnoseM5FromServer's
26
- // server-generation age) — each gets its OWN single-observation calibration below, never a
27
- // cross-instrument "trend" (the bug this fixed: Run 1's local-age and Run 3's materialization-age
28
- // are different measurements, not two points on one series). Local-pull: only on-record reading is
29
- // 14.1d (Run 1). Server-generation: only on-record reading is ~5.1d (Run 3's materialization age).
30
- const M5_PROPOSED_LOCAL_AGE_FLOOR_DAYS = 10;
31
- const M5_PROPOSED_SERVER_AGE_FLOOR_DAYS = 7;
50
+ // DEC-1513 (2026-07-26) pinned M3's and M5's floors see ./floors.ts for values/rationale/
51
+ // how-to-tune. VISIBILITY GAP (carried from WP-527): reaches the `pb scoreboard` CLI but NOT
52
+ // Cortex (+page.svelte:171 renders only tile.reading) disclosed follow-up, out of scope here.
53
+ const DAY_MS = 1000 * 60 * 60 * 24;
32
54
  function pct(n) {
33
55
  return n === null ? 'n/a' : `${(n * 100).toFixed(0)}%`;
34
56
  }
@@ -43,17 +65,14 @@ function ms(n) {
43
65
  return `${(h / 24).toFixed(1)}d`;
44
66
  }
45
67
  /**
46
- * M1 — retrieval truth-state mix. The no-domain-share flip (INS-1775 floor) is UNPINNED, so the
47
- * status is `awaiting` whenever there is data to judge (we never invent the 50% floor). With zero
48
- * serves it is `unmeasured` (nothing served yet). The named cause for a high no-domain share is
49
- * "domains unratified".
68
+ * M1 — retrieval truth-state mix. The no-domain-share flip (INS-1775 floor) is UNPINNED `awaiting`
69
+ * whenever there is data (never invent the 50% floor); `unmeasured` with zero serves.
50
70
  */
51
71
  export function diagnoseM1(m1) {
52
72
  const reading = `served=${m1.mix.total} · audited=${pct(m1.auditedShare)} · draft=${pct(m1.draftShare)} · ` +
53
73
  `no-domain=${pct(m1.noDomainShare)} (window ${ms(m1.windowMs)})`;
54
74
  if (m1.mix.total === 0) {
55
- // TEN-2449: M1 counts ONE serve shape (`orient/cli/brief`). Naming start_pb here would loop
56
- // the operator forever: that surface is uninstrumented, so serving it can never move M1.
75
+ // TEN-2449: M1 counts ONE serve shape; naming start_pb would loop the operator forever.
57
76
  const outOfCoverage = m1.excludedOutOfCoverage ?? 0;
58
77
  return {
59
78
  metric: 'M1',
@@ -77,10 +96,9 @@ export function diagnoseM1(m1) {
77
96
  };
78
97
  }
79
98
  /**
80
- * M2 — ranking agreement (tests the unify integrity). This one HAS a clean structural signal:
81
- * post-unify, full parity (divergentBuckets === 0) is the EXPECTED steady state that's `ok`.
82
- * A non-zero divergence IS the regression signal — `degraded` — and the M2-magnitude flip stays
83
- * unpinned, but the structural ok/degraded does not need a number (0 vs non-0 is exact).
99
+ * M2 — ranking agreement. A clean structural signal: post-unify full parity (0 divergent buckets)
100
+ * is the EXPECTED steady state (`ok`); non-zero divergence is the regression signal (`degraded`)
101
+ * exact, no number to pin.
84
102
  */
85
103
  export function diagnoseM2(m2) {
86
104
  const reading = `divergentBuckets=${m2.divergentBuckets} · fullParity=${m2.fullParity}${m2.task ? ` · task="${m2.task}"` : ''}`;
@@ -105,8 +123,9 @@ export function diagnoseM2(m2) {
105
123
  };
106
124
  }
107
125
  /**
108
- * M3 — draft-to-SSOT rate. The in-session-ratify floor (ASM-45 rolling-20 window) is UNPINNED,
109
- * so a judged reading is `awaiting`. Zero captures in the window → `unmeasured`.
126
+ * M3 — draft-to-SSOT rate. The in-session-ratify floor (ASM-45 rolling-20 window) is PINNED
127
+ * per DEC-1513 (`M3_IN_SESSION_FLOOR`) a determinable reading renders a real `ok`/`degraded`
128
+ * verdict. Zero captures → `unmeasured`. An undeterminable rate (null) fails soft to `awaiting`.
110
129
  */
111
130
  export function diagnoseM3(m3) {
112
131
  const reading = `captured=${m3.capturedCount} · in-session=${pct(m3.inSessionRatifiedRate)} · ` +
@@ -121,27 +140,34 @@ export function diagnoseM3(m3) {
121
140
  nextAction: 'capture in-session (pb capture), then re-read after the human accepts in Cortex',
122
141
  };
123
142
  }
143
+ if (m3.inSessionRatifiedRate === null) {
144
+ return {
145
+ metric: 'M3',
146
+ label: 'Draft-to-SSOT rate',
147
+ status: 'awaiting',
148
+ reading,
149
+ cause: `in-session ratify rate undeterminable — pinned floor ${pct(M3_IN_SESSION_FLOOR.value)} cannot be compared`,
150
+ nextAction: 'capture in-session (pb capture), then re-read once a rate is computable',
151
+ };
152
+ }
153
+ const meets = m3.inSessionRatifiedRate >= M3_IN_SESSION_FLOOR.value;
124
154
  return {
125
155
  metric: 'M3',
126
156
  label: 'Draft-to-SSOT rate',
127
- status: 'awaiting',
157
+ status: meets ? 'ok' : 'degraded',
128
158
  reading,
129
- // ASM-45 (the draft-graveyard hypothesis + rolling-20-session design) governs this metric
130
- // cited in comments; the user strings stay ID-free.
131
- cause: `in-session ratify floor ${UNPINNED} (rolling-20-session design) PROPOSED pin ${pct(M3_PROPOSED_IN_SESSION_FLOOR)}, awaiting founder accept (Product-OS calibration baseline, not this workspace's own history)`,
132
- // Round 1 scoped `cause` but left `nextAction` — the formatter prints this verbatim too.
133
- nextAction: `pin the in-session floor (Product-OS calibration proposal ${pct(M3_PROPOSED_IN_SESSION_FLOOR)}, not derived from this workspace, awaiting founder accept); if the rate stays below it, the draft-graveyard pattern is confirmed → accept/promote captures in Cortex`,
159
+ // ASM-45 + DEC-1513 govern this metric cited in comments only (chain-id-leak guard).
160
+ cause: meets
161
+ ? `in-session ratify rate ${pct(m3.inSessionRatifiedRate)} meets the pinned floor ${pct(M3_IN_SESSION_FLOOR.value)} (rolling-20-session design)`
162
+ : `in-session ratify rate ${pct(m3.inSessionRatifiedRate)} is below the pinned floor ${pct(M3_IN_SESSION_FLOOR.value)} (rolling-20-session design) — the draft-graveyard pattern is confirmed`,
163
+ nextAction: meets ? '' : 'accept/promote captures in Cortex to raise the in-session ratify rate',
134
164
  };
135
165
  }
136
166
  /**
137
167
  * M4 — organic rework meter (WP-487 Slice 2, FEAT-1374). Joins served governance against
138
- * later-reported rework signals within a frozen 72h window (TEN-2728) and reports RAW
139
- * distribution + a false-attribution counter-metric never a verdict (DEC-1282 unchanged for
140
- * M4) and never a causality claim (spec §6: this is association, not "context served CAUSED
141
- * first-time-good"). `unmeasured` when nothing has been served in the window yet (no coverage
142
- * population to judge, mirrors diagnoseM1's zero-mix gate); `awaiting` whenever there IS data,
143
- * since no first-time-good floor is pinned yet — the raw share is always shown, never replaced
144
- * by an invented threshold.
168
+ * later-reported rework signals in a frozen 72h window (TEN-2728); RAW distribution + a
169
+ * false-attribution counter, never a verdict (DEC-1282) and never causality (association only).
170
+ * `unmeasured` with nothing served; `awaiting` otherwise (no floor pinned yet).
145
171
  */
146
172
  export function diagnoseM4(m4) {
147
173
  const reading = `served=${m4.servedCount} (decided=${m4.decidedCount}, pending=${m4.pendingObservationCount}, ` +
@@ -164,18 +190,15 @@ export function diagnoseM4(m4) {
164
190
  label: 'Organic rework meter (first-time-good)',
165
191
  status: 'awaiting',
166
192
  reading,
167
- // No first-time-good floor is pinned yet (this WP's job was to make a baseline possible, not
168
- // to claim one — WP-C spec §5/§9). No causality claim: a served row followed by rework within
169
- // the window is an ASSOCIATION, never asserted as "the served context caused the rework".
193
+ // No first-time-good floor pinned yet (WP-C spec §5/§9). ASSOCIATION only, never causality.
170
194
  cause: `first-time-good floor ${UNPINNED}; a high false-attribution rate means many rework signals have no served-context evidence to join against — read the share with that caveat, not as a verdict`,
171
195
  nextAction: 'pin the first-time-good floor once a predeclared observation window completes (WP-C spec §9); if false-attribution stays high, the pb-reported signal may be missing real rework events a CI/git signal would catch (spec §6 tripwire)',
172
196
  };
173
197
  }
174
198
  /**
175
199
  * M5 — projection staleness, computed as LOCAL-PULL drift at the CLI (DEC-1284). The staleness-age
176
- * flip is UNPINNED, so a determinable reading is `awaiting`. When the local `.productbrain/`
177
- * projection (or the server materialization) is unavailable, the status is `unmeasured` with the
178
- * reason — fail-soft, never a fake ok.
200
+ * floor is PINNED per DEC-1513 (`M5_LOCAL_AGE_FLOOR_DAYS`) — a determinable reading renders a real
201
+ * `ok`/`degraded` verdict. Unavailable local/server data `unmeasured` with the reason, fail-soft.
179
202
  */
180
203
  export function diagnoseM5(m5) {
181
204
  if (m5.unavailableReason || m5.localProjectionMtime === null) {
@@ -188,11 +211,8 @@ export function diagnoseM5(m5) {
188
211
  nextAction: 'run from a worktree with a materialized .productbrain/ (pb handshake), then re-read',
189
212
  };
190
213
  }
191
- // The local projection exists, but with NO server materialization (e.g. missing/expired
192
- // setup_receipt) there is no reference to diff against — the local-pull DRIFT (server−local,
193
- // this metric's whole definition) is undeterminable. Report `unmeasured` (honesty over flattery)
194
- // rather than `awaiting` with a `local-lag=n/a` that implies the drift is merely awaiting a
195
- // threshold. local-age is still surfaced as the one signal we can honestly read.
214
+ // No server materialization the local-pull DRIFT (server−local) is undeterminable
215
+ // `unmeasured`, not `awaiting` with a misleading local-lag=n/a. local-age is still surfaced.
196
216
  if (m5.serverMaterializedAt === null || m5.localLagMs === null) {
197
217
  return {
198
218
  metric: 'M5',
@@ -206,22 +226,36 @@ export function diagnoseM5(m5) {
206
226
  const lag = m5.localLagMs;
207
227
  const age = m5.localAgeMs;
208
228
  const reading = `local-lag=${ms(lag)} (server−local) · local-age=${ms(age)}`;
229
+ if (age === null) {
230
+ // Type-level fail-soft — undeterminable, never a fake ok/degraded.
231
+ return {
232
+ metric: 'M5',
233
+ label: 'Projection staleness (local-pull drift)',
234
+ status: 'awaiting',
235
+ reading,
236
+ cause: `local-age undeterminable — pinned staleness floor ${M5_LOCAL_AGE_FLOOR_DAYS.value}d cannot be compared`,
237
+ nextAction: 're-run pb handshake to re-pull the projection, then re-read',
238
+ };
239
+ }
240
+ const ageDays = age / DAY_MS;
241
+ const meets = ageDays <= M5_LOCAL_AGE_FLOOR_DAYS.value;
209
242
  return {
210
243
  metric: 'M5',
211
244
  label: 'Projection staleness (local-pull drift)',
212
- status: 'awaiting',
245
+ status: meets ? 'ok' : 'degraded',
213
246
  reading,
214
- cause: `staleness-age threshold ${UNPINNED} — PROPOSED pin ${M5_PROPOSED_LOCAL_AGE_FLOOR_DAYS}d, awaiting founder accept (Product-OS calibration: one on-record local-age reading, not a trend); this is the one metric where PB can be staler than the never-drifting CLAUDE.md file`,
215
- nextAction: 're-run pb handshake to re-pull the projection if the lag/age looks high',
247
+ cause: meets
248
+ ? `local-age ${ms(age)} is at/under the pinned staleness floor ${M5_LOCAL_AGE_FLOOR_DAYS.value}d`
249
+ : `local-age ${ms(age)} exceeds the pinned staleness floor ${M5_LOCAL_AGE_FLOOR_DAYS.value}d — this is the one metric where PB can be staler than the never-drifting CLAUDE.md file`,
250
+ nextAction: meets ? '' : 're-run pb handshake to re-pull the projection',
216
251
  };
217
252
  }
218
253
  /**
219
254
  * M5 (server view) — the Cortex page has NO local filesystem, so it cannot compute the spec's
220
255
  * local-pull drift (DEC-1284). It reads only the server-side projection-generation building block
221
- * (`materialization.latestMaterializedAt` / age) the public action already returns adding NO new
222
- * truth (spec §2d). This is deliberately a DIFFERENT, HONEST framing from `diagnoseM5`: it is
223
- * SERVER-generation age, never claimed to be the local-pull staleness the CLI measures. The
224
- * staleness-age flip is UNPINNED → `awaiting` when there is a materialization; `unmeasured` when
256
+ * (`materialization.latestMaterializedAt` / age) adding NO new truth (spec §2d). Deliberately a
257
+ * DIFFERENT, HONEST framing from `diagnoseM5`: SERVER-generation age, never local-pull staleness.
258
+ * The staleness-age floor is PINNED per DEC-1513 (`M5_SERVER_AGE_FLOOR_DAYS`); `unmeasured` when
225
259
  * the workspace has never materialized.
226
260
  */
227
261
  export function diagnoseM5FromServer(materialization) {
@@ -236,35 +270,44 @@ export function diagnoseM5FromServer(materialization) {
236
270
  };
237
271
  }
238
272
  const age = materialization.materializationAgeMs;
273
+ if (age === null) {
274
+ // Type-level fail-soft — undeterminable, never a fake ok/degraded.
275
+ return {
276
+ metric: 'M5',
277
+ label: 'Projection staleness (server generation age)',
278
+ status: 'awaiting',
279
+ reading: 'server-generation age=n/a (browser view: local-pull drift is CLI-only)',
280
+ cause: `server-generation age undeterminable — pinned staleness floor ${M5_SERVER_AGE_FLOOR_DAYS.value}d cannot be compared`,
281
+ nextAction: 're-run pb handshake to re-generate the projection, then re-read',
282
+ };
283
+ }
284
+ const ageDays = age / DAY_MS;
285
+ const meets = ageDays <= M5_SERVER_AGE_FLOOR_DAYS.value;
239
286
  return {
240
287
  metric: 'M5',
241
288
  label: 'Projection staleness (server generation age)',
242
- status: 'awaiting',
289
+ status: meets ? 'ok' : 'degraded',
243
290
  reading: `server-generation age=${ms(age)} (browser view: local-pull drift is CLI-only)`,
244
- cause: `staleness-age threshold ${UNPINNED} — PROPOSED pin ${M5_PROPOSED_SERVER_AGE_FLOOR_DAYS}d, awaiting founder accept (Product-OS calibration: one on-record server-generation-age reading, not a trend); this is the one metric where PB can be staler than the never-drifting CLAUDE.md file`,
245
- nextAction: 're-run pb handshake to re-generate the projection if the age looks high',
291
+ cause: meets
292
+ ? `server-generation age ${ms(age)} is at/under the pinned staleness floor ${M5_SERVER_AGE_FLOOR_DAYS.value}d`
293
+ : `server-generation age ${ms(age)} exceeds the pinned staleness floor ${M5_SERVER_AGE_FLOOR_DAYS.value}d — this is the one metric where PB can be staler than the never-drifting CLAUDE.md file`,
294
+ nextAction: meets ? '' : 're-run pb handshake to re-generate the projection',
246
295
  };
247
296
  }
248
- /**
249
- * The STANDING coaching/moat-quality `unmeasured` line (TEN-2377). It is NOT a tile with a number —
250
- * it is a permanent honesty marker so four green tiles are never read as "the moat is healthy".
251
- */
297
+ /** The STANDING coaching/moat-quality `unmeasured` line (TEN-2377) — a permanent honesty marker
298
+ * so four green tiles are never read as "the moat is healthy". */
252
299
  export function diagnoseCoachingMoat() {
253
300
  return {
254
301
  metric: 'MOAT',
255
302
  label: 'Coaching / moat quality',
256
303
  status: 'unmeasured',
257
- // The standing-unmeasured tension is TEN-2377; the real instrument is ASM-46's
258
- // blind-padding-rate test. Both cited in comments, kept out of the user-facing strings.
304
+ // TEN-2377 / ASM-46's blind-padding-rate test cited in comments only.
259
305
  reading: 'structurally unmeasured',
260
306
  cause: 'the coach skips decision/standard/business-rule (the WHY-moat types) — a counter would flatter the board',
261
307
  nextAction: 'do NOT read four green tiles as a healthy moat; the real instrument is the blind-padding-rate test',
262
308
  };
263
309
  }
264
- /**
265
- * diagnose — the whole mapping: data-layer payload + CLI-computed M5 local-drift → per-metric
266
- * diagnoses + the standing M4-awaiting + coaching-unmeasured lines. Pure.
267
- */
310
+ /** diagnose — data-layer payload + CLI-computed M5 local-drift → per-metric diagnoses. Pure. */
268
311
  export function diagnose(payload, m5) {
269
312
  return {
270
313
  m1: diagnoseM1(payload.m1),
@@ -275,11 +318,8 @@ export function diagnose(payload, m5) {
275
318
  moat: diagnoseCoachingMoat(),
276
319
  };
277
320
  }
278
- /**
279
- * diagnoseFromServer the Cortex-page mapping: it has the public action payload but NO local fs,
280
- * so M5 is the server-generation-age view (`diagnoseM5FromServer`) rather than the CLI local-pull
281
- * drift. Everything else is identical to `diagnose`. Pure, browser-safe.
282
- */
321
+ /** diagnoseFromServer — Cortex has NO local fs, so M5 uses `diagnoseM5FromServer`'s
322
+ * server-generation-age view instead of local-pull drift. Otherwise identical to `diagnose`. */
283
323
  export function diagnoseFromServer(payload) {
284
324
  return {
285
325
  m1: diagnoseM1(payload.m1),
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../src/scoreboard/diagnose.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoLH,4FAA4F;AAC5F,8FAA8F;AAC9F,iGAAiG;AACjG,uDAAuD;AACvD,MAAM,QAAQ,GAAG,wDAAwD,CAAC;AAE1E,yFAAyF;AACzF,mGAAmG;AACnG,oGAAoG;AACpG,2FAA2F;AAC3F,kGAAkG;AAClG,wFAAwF;AACxF,2FAA2F;AAC3F,8FAA8F;AAC9F,2FAA2F;AAC3F,+FAA+F;AAC/F,MAAM,4BAA4B,GAAG,GAAG,CAAC;AACzC,mGAAmG;AACnG,2FAA2F;AAC3F,kGAAkG;AAClG,mGAAmG;AACnG,mGAAmG;AACnG,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAC5C,MAAM,iCAAiC,GAAG,CAAC,CAAC;AAE5C,SAAS,GAAG,CAAC,CAAgB;IAC3B,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACzD,CAAC;AAED,SAAS,EAAE,CAAC,CAAgB;IAC1B,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IAC7B,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACrD,IAAI,CAAC,GAAG,EAAE;QAAE,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACtC,OAAO,GAAG,CAAC,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AAO,CAAC,EAAE,CAAC;QAC1B,EAAE,EAAE,UAAU,CAAC,EAAE,CAAC;QAClB,IAAI,EAAE,oBAAoB,EAAE;KAC7B,CAAC;AACJ,CAAC;AAED;iGACiG;AACjG,MAAM,UAAU,kBAAkB,CAAC,OAA0B;IAC3D,OAAO;QACL,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,EAAE,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1B,EAAE,EAAE,oBAAoB,CAAC,OAAO,CAAC,eAAe,CAAC;QACjD,IAAI,EAAE,oBAAoB,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Asserts the pure metric→{status,reading,cause,nextAction} mapping, with explicit coverage of
5
5
  * the awaiting / unmeasured / degraded / ok states and the honesty invariants:
6
- * - No flip threshold is pinned (DEC-1282) → judged readings are `awaiting`, never an invented
7
- * number, and the raw reading is always present.
6
+ * - Most flip thresholds remain unpinned (DEC-1282) → judged readings are `awaiting`, never an
7
+ * invented number, and the raw reading is always present. M3's in-session-ratify floor and
8
+ * M5's two age floors are the pinned exception (DEC-1513, WP-525) — see below.
8
9
  * - M4 (WP-487 Slice 2, FEAT-1374: the organic rework meter) reports raw distribution only —
9
10
  * `unmeasured` with nothing served yet, `awaiting` otherwise, never a fake green, never a
10
11
  * causality claim.
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.test.d.ts","sourceRoot":"","sources":["../../src/scoreboard/diagnose.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
1
+ {"version":3,"file":"diagnose.test.d.ts","sourceRoot":"","sources":["../../src/scoreboard/diagnose.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
@@ -3,8 +3,9 @@
3
3
  *
4
4
  * Asserts the pure metric→{status,reading,cause,nextAction} mapping, with explicit coverage of
5
5
  * the awaiting / unmeasured / degraded / ok states and the honesty invariants:
6
- * - No flip threshold is pinned (DEC-1282) → judged readings are `awaiting`, never an invented
7
- * number, and the raw reading is always present.
6
+ * - Most flip thresholds remain unpinned (DEC-1282) → judged readings are `awaiting`, never an
7
+ * invented number, and the raw reading is always present. M3's in-session-ratify floor and
8
+ * M5's two age floors are the pinned exception (DEC-1513, WP-525) — see below.
8
9
  * - M4 (WP-487 Slice 2, FEAT-1374: the organic rework meter) reports raw distribution only —
9
10
  * `unmeasured` with nothing served yet, `awaiting` otherwise, never a fake green, never a
10
11
  * causality claim.
@@ -76,38 +77,56 @@ describe('diagnoseM2', () => {
76
77
  });
77
78
  });
78
79
  describe('diagnoseM3', () => {
79
- it('is awaiting when there are captures (floor unpinned)', () => {
80
+ it('is degraded when the in-session ratify rate is below the pinned floor (DEC-1513)', () => {
80
81
  const m3 = {
81
82
  capturedCount: 8,
82
83
  everRatifiedCount: 3,
83
84
  inSessionRatifiedCount: 1,
84
85
  everRatifiedRate: 0.375,
85
- inSessionRatifiedRate: 0.125,
86
+ inSessionRatifiedRate: 0.05, // below the 10% pinned floor
86
87
  sessionWindow: 20,
87
88
  sessionsConsidered: 12,
88
89
  };
89
90
  const d = diagnoseM3(m3);
90
- expect(d.status).toBe('awaiting');
91
+ expect(d.status).toBe('degraded');
91
92
  expect(d.reading).toContain('captured=8');
92
- expect(d.cause).toMatch(/unpinned/i);
93
- // WP-527 (Lane T Slice 2): a PROPOSED (not pinned) floor value now rides alongside the
94
- // unpinned status — the tile must never claim ok/degraded from a proposal (status stays
95
- // `awaiting` above), but the candidate number + "awaiting founder accept" must be visible.
96
- expect(d.cause).toMatch(/PROPOSED pin 10%/);
97
- expect(d.cause).toMatch(/awaiting founder accept/);
98
- expect(d.nextAction).toMatch(/10%/);
99
- // PR #477 review round 1 (codex P2): this is a SHARED function with no workspaceId — the
100
- // calibration number must never read as if it came from the calling workspace's own
101
- // history (a different tenant would see the same "every measured run" claim wrongly).
102
- expect(d.cause).toMatch(/Product-OS calibration/);
103
- expect(d.cause).toMatch(/not this workspace's own history/);
104
- // PR #477 review round 2 (codex P2): round 1 only scoped `cause` — `nextAction` must be
105
- // scoped too, since the CLI formatter prints it verbatim to every tenant just the same.
106
- expect(d.nextAction).toMatch(/not derived from this workspace/);
107
- // chain-id-leak guard: the user-facing strings carry no raw Chain IDs.
93
+ expect(d.cause).toMatch(/pinned floor/i);
94
+ expect(d.cause).toMatch(/10%/);
95
+ expect(d.cause).not.toMatch(/awaiting founder accept|PROPOSED pin/);
96
+ expect(d.nextAction).toMatch(/accept\/promote/i);
97
+ // chain-id-leak guard: the user-facing strings carry no raw Chain IDs (DEC-1513 is cited
98
+ // in code comments only, per this file's header — never interpolated into the string).
108
99
  expect(d.cause).not.toMatch(/\b[A-Z]{2,5}-\d+\b/);
109
100
  expect(d.nextAction).not.toMatch(/\b[A-Z]{2,5}-\d+\b/);
110
101
  });
102
+ it('is ok when the in-session ratify rate meets the pinned floor (DEC-1513)', () => {
103
+ const m3 = {
104
+ capturedCount: 8,
105
+ everRatifiedCount: 3,
106
+ inSessionRatifiedCount: 1,
107
+ everRatifiedRate: 0.375,
108
+ inSessionRatifiedRate: 0.125, // above the 10% pinned floor
109
+ sessionWindow: 20,
110
+ sessionsConsidered: 12,
111
+ };
112
+ const d = diagnoseM3(m3);
113
+ expect(d.status).toBe('ok');
114
+ expect(d.nextAction).toBe('');
115
+ expect(d.cause).toMatch(/pinned floor/i);
116
+ });
117
+ it('fails soft to awaiting when the in-session rate is undeterminable (null) despite captures', () => {
118
+ const m3 = {
119
+ capturedCount: 8,
120
+ everRatifiedCount: 3,
121
+ inSessionRatifiedCount: 1,
122
+ everRatifiedRate: 0.375,
123
+ inSessionRatifiedRate: null,
124
+ sessionWindow: 20,
125
+ sessionsConsidered: 12,
126
+ };
127
+ const d = diagnoseM3(m3);
128
+ expect(d.status).toBe('awaiting');
129
+ });
111
130
  it('is unmeasured with zero captures', () => {
112
131
  const m3 = {
113
132
  capturedCount: 0,
@@ -197,28 +216,37 @@ describe('diagnoseM5', () => {
197
216
  expect(d.status).toBe('unmeasured');
198
217
  expect(d.reading).toContain('no .productbrain/');
199
218
  });
200
- it('is awaiting (threshold unpinned) when local drift is determinable', () => {
219
+ it('is degraded when local-age exceeds the pinned floor (DEC-1513, real: ~14.1d > 10d)', () => {
220
+ // 10d, not 7d: this is the LOCAL-pull instrument's own single-observation calibration
221
+ // (PR #477 review fix, codex P2 — a prior draft mixed local-age and server-generation-age
222
+ // readings as if they were one series; each instrument now gets its own honest number).
223
+ const DAY = 1000 * 60 * 60 * 24;
201
224
  const m5 = {
202
225
  localProjectionMtime: 1_000,
203
226
  serverMaterializedAt: 2_000,
204
227
  localLagMs: 1_000,
205
- localAgeMs: 5_000,
228
+ localAgeMs: 14.1 * DAY,
206
229
  };
207
230
  const d = diagnoseM5(m5);
208
- expect(d.status).toBe('awaiting');
209
- expect(d.cause).toMatch(/unpinned/i);
231
+ expect(d.status).toBe('degraded');
232
+ expect(d.cause).toMatch(/pinned staleness floor 10d/);
210
233
  // The CLAUDE.md-can't-drift framing is preserved.
211
234
  expect(d.cause).toMatch(/CLAUDE\.md/);
212
- // WP-527 (Lane T Slice 2): PROPOSED (not pinned) floor value, status stays `awaiting`.
213
- // 10d, not 7d: this is the LOCAL-pull instrument's own single-observation calibration
214
- // (PR #477 review fix, codex P2 — a prior draft mixed local-age and server-generation-age
215
- // readings as if they were one series; each instrument now gets its own honest number).
216
- expect(d.cause).toMatch(/PROPOSED pin 10d/);
217
- expect(d.cause).toMatch(/awaiting founder accept/);
218
- expect(d.cause).toMatch(/Product-OS calibration/);
219
- expect(d.cause).toMatch(/not a trend/);
235
+ expect(d.cause).not.toMatch(/awaiting founder accept|PROPOSED pin|unpinned/i);
220
236
  expect(d.cause).not.toMatch(/\b[A-Z]{2,5}-\d+\b/);
221
237
  });
238
+ it('is ok when local-age is at/under the pinned floor (DEC-1513)', () => {
239
+ const DAY = 1000 * 60 * 60 * 24;
240
+ const m5 = {
241
+ localProjectionMtime: 1_000,
242
+ serverMaterializedAt: 2_000,
243
+ localLagMs: 1_000,
244
+ localAgeMs: 5 * DAY,
245
+ };
246
+ const d = diagnoseM5(m5);
247
+ expect(d.status).toBe('ok');
248
+ expect(d.nextAction).toBe('');
249
+ });
222
250
  it('is unmeasured (not awaiting) when the local projection exists but there is no server reference', () => {
223
251
  // Local projection present, but no server materialization to diff against → the local-pull
224
252
  // DRIFT (server−local) is undeterminable, so the honest status is unmeasured, not a misleading
@@ -236,23 +264,33 @@ describe('diagnoseM5', () => {
236
264
  });
237
265
  });
238
266
  describe('diagnoseM5FromServer', () => {
239
- it('is awaiting (threshold unpinned) with its OWN server-generation-age PROPOSED value, distinct from diagnoseM5', () => {
240
- // PR #477 review fix (codex P2): diagnoseM5 (local-pull drift) and diagnoseM5FromServer
241
- // (server-generation age) are two DIFFERENT instruments a shared "trend" number between
242
- // them was miscalibration. Each carries its own single-observation proposal.
267
+ // PR #477 review fix (codex P2): diagnoseM5 (local-pull drift) and diagnoseM5FromServer
268
+ // (server-generation age) are two DIFFERENT instruments, each with its own pinned floor
269
+ // (DEC-1513) 7d here, 10d for diagnoseM5 above. Never a shared "trend" number.
270
+ it('is ok when server-generation age is under its OWN pinned floor (DEC-1513, real: ~5.1d < 7d)', () => {
271
+ const DAY = 1000 * 60 * 60 * 24;
243
272
  const materialization = {
244
273
  latestMaterializedAt: 1_000,
245
- materializationAgeMs: 2_000,
274
+ materializationAgeMs: 5.1 * DAY,
246
275
  now: 3_000,
247
276
  };
248
277
  const d = diagnoseM5FromServer(materialization);
249
- expect(d.status).toBe('awaiting');
250
- expect(d.cause).toMatch(/unpinned/i);
251
- expect(d.cause).toMatch(/PROPOSED pin 7d/);
252
- expect(d.cause).toMatch(/Product-OS calibration/);
253
- expect(d.cause).toMatch(/server-generation-age reading/);
278
+ expect(d.status).toBe('ok');
279
+ expect(d.cause).toMatch(/pinned staleness floor 7d/);
280
+ expect(d.nextAction).toBe('');
254
281
  expect(d.cause).not.toMatch(/\b[A-Z]{2,5}-\d+\b/);
255
282
  });
283
+ it('is degraded when server-generation age exceeds its OWN pinned floor (DEC-1513)', () => {
284
+ const DAY = 1000 * 60 * 60 * 24;
285
+ const materialization = {
286
+ latestMaterializedAt: 1_000,
287
+ materializationAgeMs: 8 * DAY,
288
+ now: 3_000,
289
+ };
290
+ const d = diagnoseM5FromServer(materialization);
291
+ expect(d.status).toBe('degraded');
292
+ expect(d.cause).not.toMatch(/awaiting founder accept|PROPOSED pin|unpinned/i);
293
+ });
256
294
  });
257
295
  describe('diagnoseCoachingMoat', () => {
258
296
  it('is a standing unmeasured line — four green tiles != healthy moat (TEN-2377)', () => {
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.test.js","sourceRoot":"","sources":["../../src/scoreboard/diagnose.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,UAAU,EACV,oBAAoB,EACpB,oBAAoB,GAQrB,MAAM,eAAe,CAAC;AAEvB,MAAM,UAAU,GAAc;IAC5B,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACrD,aAAa,EAAE,GAAG;IAClB,YAAY,EAAE,GAAG;IACjB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;IAClC,cAAc,EAAE,EAAE;CACnB,CAAC;AAEF,MAAM,OAAO,GAAc;IACzB,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAA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AAC,CAAC;QAC1C,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * SYNCED from packages/scoreboard-core/src/floors.ts — DO NOT EDIT HERE.
3
+ * Canonical SSOT for the flywheel scoreboard diagnosis (consumed by BOTH the published
4
+ * `pb` CLI and the Cortex page). The CLI cannot import the workspace package at publish time
5
+ * (tsc, no bundler), so it carries this committed copy. Edit the source, then run:
6
+ * node scripts/sync-scoreboard-core.mjs
7
+ * A content-hash drift gate (scripts/check-mcp-lib-drift.mjs) fails CI if this drifts.
8
+ */
9
+ /**
10
+ * Pinned scoreboard floors — DEC-1513 (founder accepted 2026-07-26, WP-525 kernel truth
11
+ * sweep).
12
+ *
13
+ * HOW TO TUNE: edit a `value` below and open ONE PR. This file is the single place these
14
+ * three numbers live — `packages/scoreboard-core/src/index.ts` imports and reads them,
15
+ * never redefines or re-derives them. After editing, run:
16
+ * node scripts/sync-scoreboard-core.mjs
17
+ * to re-sync the published CLI copies (packages/cli/src/scoreboard/{diagnose,floors}.ts).
18
+ * `npm run check:mcp-lib-drift` (part of CI) fails the PR if a copy falls out of sync.
19
+ *
20
+ * NAMED SUCCESSOR (not built): a single shared, global calibration accepted from
21
+ * Product-OS's OWN observed distribution (docs/evals/PRESS-RELEASE-EVAL.md) — it is NOT
22
+ * proven to generalize to every tenant workspace. DEC-1513 accepts these three values as
23
+ * the workspace-wide floor with that explicit caveat; a future PER-WORKSPACE override is
24
+ * the named next step, not shipped here.
25
+ *
26
+ * DEC-1282 still governs the SEMANTICS: a diagnosis is advisory-never-blocking. Pinning
27
+ * these floors only lets diagnoseM3/diagnoseM5/diagnoseM5FromServer compute a real
28
+ * ok/degraded verdict instead of `awaiting` — it does not gate, block, or fail anything.
29
+ */
30
+ /** A single pinned floor: the number plus why/when/who accepted it. */
31
+ export interface PinnedFloor {
32
+ /** The pinned numeric floor. */
33
+ value: number;
34
+ /** Why this number, in one line — cites the calibration evidence, never invents one. */
35
+ rationale: string;
36
+ /** When the founder accepted it (ISO date). */
37
+ acceptedDate: string;
38
+ /** The Chain decision that accepted it. */
39
+ decision: string;
40
+ }
41
+ export declare const M3_IN_SESSION_FLOOR: PinnedFloor;
42
+ /** M5 has TWO INCOMPARABLE age instruments — see diagnoseM5 vs diagnoseM5FromServer in
43
+ * index.ts. Each carries its OWN single-observation calibration; never treat one as a
44
+ * proxy for the other or as two points on a shared trend. */
45
+ export declare const M5_LOCAL_AGE_FLOOR_DAYS: PinnedFloor;
46
+ export declare const M5_SERVER_AGE_FLOOR_DAYS: PinnedFloor;
47
+ //# sourceMappingURL=floors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floors.d.ts","sourceRoot":"","sources":["../../src/scoreboard/floors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC3B,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,wFAAwF;IACxF,SAAS,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,mBAAmB,EAAE,WAOjC,CAAC;AAEF;;8DAE8D;AAC9D,eAAO,MAAM,uBAAuB,EAAE,WAOrC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,WAOtC,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * SYNCED from packages/scoreboard-core/src/floors.ts — DO NOT EDIT HERE.
3
+ * Canonical SSOT for the flywheel scoreboard diagnosis (consumed by BOTH the published
4
+ * `pb` CLI and the Cortex page). The CLI cannot import the workspace package at publish time
5
+ * (tsc, no bundler), so it carries this committed copy. Edit the source, then run:
6
+ * node scripts/sync-scoreboard-core.mjs
7
+ * A content-hash drift gate (scripts/check-mcp-lib-drift.mjs) fails CI if this drifts.
8
+ */
9
+ export const M3_IN_SESSION_FLOOR = {
10
+ value: 0.1,
11
+ rationale: "Product-OS calibration baseline (docs/evals/PRESS-RELEASE-EVAL.md): in-session ratify rate observed 0% " +
12
+ 'in every Product-OS run so far — a conservative early bar, not derived from any other workspace\'s history.',
13
+ acceptedDate: '2026-07-26',
14
+ decision: 'DEC-1513',
15
+ };
16
+ /** M5 has TWO INCOMPARABLE age instruments — see diagnoseM5 vs diagnoseM5FromServer in
17
+ * index.ts. Each carries its OWN single-observation calibration; never treat one as a
18
+ * proxy for the other or as two points on a shared trend. */
19
+ export const M5_LOCAL_AGE_FLOOR_DAYS = {
20
+ value: 10,
21
+ rationale: 'Product-OS calibration: one on-record local-pull-drift age reading (14.1d, Run 1, docs/evals/' +
22
+ "PRESS-RELEASE-EVAL.md) — a single observation, not a trend.",
23
+ acceptedDate: '2026-07-26',
24
+ decision: 'DEC-1513',
25
+ };
26
+ export const M5_SERVER_AGE_FLOOR_DAYS = {
27
+ value: 7,
28
+ rationale: 'Product-OS calibration: one on-record server-generation-age reading (~5.1d, Run 3\'s materialization age, ' +
29
+ 'docs/evals/PRESS-RELEASE-EVAL.md) — a single observation, not a trend.',
30
+ acceptedDate: '2026-07-26',
31
+ decision: 'DEC-1513',
32
+ };
33
+ //# sourceMappingURL=floors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"floors.js","sourceRoot":"","sources":["../../src/scoreboard/floors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAoCH,MAAM,CAAC,MAAM,mBAAmB,GAAgB;IAC/C,KAAK,EAAE,GAAG;IACV,SAAS,EACR,yGAAyG;QACzG,6GAA6G;IAC9G,YAAY,EAAE,YAAY;IAC1B,QAAQ,EAAE,UAAU;CACpB,CAAC;AAEF;;8DAE8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAgB;IACnD,KAAK,EAAE,EAAE;IACT,SAAS,EACR,+FAA+F;QAC/F,6DAA6D;IAC9D,YAAY,EAAE,YAAY;IAC1B,QAAQ,EAAE,UAAU;CACpB,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAAgB;IACpD,KAAK,EAAE,CAAC;IACR,SAAS,EACR,4GAA4G;QAC5G,wEAAwE;IACzE,YAAY,EAAE,YAAY;IAC1B,QAAQ,EAAE,UAAU;CACpB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productbrain/cli",
3
- "version": "0.1.0-beta.3107",
3
+ "version": "0.1.0-beta.3109",
4
4
  "description": "Product Brain — Chain knowledge and write-back CLI",
5
5
  "type": "module",
6
6
  "bin": {