pi-mega-compact 0.20.24 → 0.20.26

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.
Files changed (132) hide show
  1. package/dist/extensions/dashboard-server/routes-vector-cortex-crystals.js +6 -0
  2. package/dist/extensions/dashboard-server/routes-vector-cortex-diagnostics.js +6 -0
  3. package/dist/extensions/dashboard-server/routes-vector-cortex-economics.js +6 -0
  4. package/dist/extensions/dashboard-server/routes-vector-cortex-eval.js +2 -0
  5. package/dist/extensions/dashboard-server/routes-vector-cortex-heal.js +9 -0
  6. package/dist/extensions/dashboard-server/routes-vector-cortex-health.js +4 -0
  7. package/dist/extensions/dashboard-server/routes-vector-cortex-ledger.js +2 -0
  8. package/dist/extensions/dashboard-server/routes-vector-cortex-outcomes.js +10 -2
  9. package/dist/extensions/dashboard-server/routes-vector-cortex-plans.js +2 -0
  10. package/dist/extensions/dashboard-server/routes-vector-cortex-platform.js +13 -2
  11. package/dist/extensions/dashboard-server/routes-vector-cortex-policy.js +6 -0
  12. package/dist/extensions/dashboard-server/routes-vector-cortex-query.js +2 -0
  13. package/dist/extensions/dashboard-server/routes-vector-cortex-reconstruct.js +5 -0
  14. package/dist/extensions/dashboard-server/routes-vector-cortex-render.js +2 -0
  15. package/dist/extensions/dashboard-server/routes-vector-cortex-repair.js +5 -0
  16. package/dist/extensions/dashboard-server/routes-vector-cortex-residual.js +2 -0
  17. package/dist/extensions/dashboard-server/routes-vector-cortex-rollout.js +56 -3
  18. package/dist/extensions/dashboard-server/routes-vector-cortex-shards.js +5 -0
  19. package/dist/extensions/dashboard-server/routes-vector-cortex-topology.js +2 -0
  20. package/dist/extensions/dashboard-server/server.js +4 -2
  21. package/dist/extensions/dashboard-server/vc-status.js +17 -0
  22. package/dist/extensions/mega-dashboard-bounce.js +79 -0
  23. package/dist/extensions/mega-dashboard-cmds.js +57 -24
  24. package/dist/extensions/mega-events/context-handler/afterCompact.js +2 -2
  25. package/dist/extensions/mega-events/context-handler/pipelineRun.js +17 -2
  26. package/dist/extensions/mega-events/register.js +17 -0
  27. package/dist/extensions/mega-pipeline/recall.js +11 -0
  28. package/extensions/dashboard-client/dist/assets/{AreaChart-BzEedilo.js → AreaChart-DRErPez1.js} +2 -2
  29. package/extensions/dashboard-client/dist/assets/{AreaChart-BzEedilo.js.map → AreaChart-DRErPez1.js.map} +1 -1
  30. package/extensions/dashboard-client/dist/assets/{BarChart-CzAVg1_J.js → BarChart-Cwxel3M7.js} +2 -2
  31. package/extensions/dashboard-client/dist/assets/{BarChart-CzAVg1_J.js.map → BarChart-Cwxel3M7.js.map} +1 -1
  32. package/extensions/dashboard-client/dist/assets/{CacheTab-D2-rzTuX.js → CacheTab-D4j3vwFu.js} +2 -2
  33. package/extensions/dashboard-client/dist/assets/{CacheTab-D2-rzTuX.js.map → CacheTab-D4j3vwFu.js.map} +1 -1
  34. package/extensions/dashboard-client/dist/assets/{EventsTab-DB7g1Szy.js → EventsTab-BA7t_fsH.js} +2 -2
  35. package/extensions/dashboard-client/dist/assets/{EventsTab-DB7g1Szy.js.map → EventsTab-BA7t_fsH.js.map} +1 -1
  36. package/extensions/dashboard-client/dist/assets/{HealthTab-Cvkmi-R3.js → HealthTab-Ci9gtYDP.js} +2 -2
  37. package/extensions/dashboard-client/dist/assets/{HealthTab-Cvkmi-R3.js.map → HealthTab-Ci9gtYDP.js.map} +1 -1
  38. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-g_udcOO7.js → MaintenanceTab-BeqWn-xu.js} +2 -2
  39. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-g_udcOO7.js.map → MaintenanceTab-BeqWn-xu.js.map} +1 -1
  40. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-DAjBaf8P.js → MemoryMapTab-BreZegCV.js} +2 -2
  41. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-DAjBaf8P.js.map → MemoryMapTab-BreZegCV.js.map} +1 -1
  42. package/extensions/dashboard-client/dist/assets/{MetricsTab-13dYYocB.js → MetricsTab-DLbgfJT2.js} +2 -2
  43. package/extensions/dashboard-client/dist/assets/{MetricsTab-13dYYocB.js.map → MetricsTab-DLbgfJT2.js.map} +1 -1
  44. package/extensions/dashboard-client/dist/assets/{OverviewTab-CLpCyLvx.js → OverviewTab-BtcXdrnC.js} +2 -2
  45. package/extensions/dashboard-client/dist/assets/{OverviewTab-CLpCyLvx.js.map → OverviewTab-BtcXdrnC.js.map} +1 -1
  46. package/extensions/dashboard-client/dist/assets/{ReposTab-EdAqUrwG.js → ReposTab-DpDLEzV9.js} +2 -2
  47. package/extensions/dashboard-client/dist/assets/{ReposTab-EdAqUrwG.js.map → ReposTab-DpDLEzV9.js.map} +1 -1
  48. package/extensions/dashboard-client/dist/assets/{SessionsTab-C21ZuOL_.js → SessionsTab-CMe5jSrZ.js} +2 -2
  49. package/extensions/dashboard-client/dist/assets/{SessionsTab-C21ZuOL_.js.map → SessionsTab-CMe5jSrZ.js.map} +1 -1
  50. package/extensions/dashboard-client/dist/assets/{SetupTab-CP7lE3L_.js → SetupTab-C3OY8mc7.js} +2 -2
  51. package/extensions/dashboard-client/dist/assets/{SetupTab-CP7lE3L_.js.map → SetupTab-C3OY8mc7.js.map} +1 -1
  52. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-DZ3QR8qt.js → TimeSavedCard-BFPJUQzs.js} +2 -2
  53. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-DZ3QR8qt.js.map → TimeSavedCard-BFPJUQzs.js.map} +1 -1
  54. package/extensions/dashboard-client/dist/assets/{TurnsTab-CNchE5rD.js → TurnsTab-Ujt29pKI.js} +2 -2
  55. package/extensions/dashboard-client/dist/assets/{TurnsTab-CNchE5rD.js.map → TurnsTab-Ujt29pKI.js.map} +1 -1
  56. package/extensions/dashboard-client/dist/assets/VectorCortexTab-CfxZW91A.js +2 -0
  57. package/extensions/dashboard-client/dist/assets/VectorCortexTab-CfxZW91A.js.map +1 -0
  58. package/extensions/dashboard-client/dist/assets/{WikiTab-BIe5Z9Nc.js → WikiTab-BiKXVwGT.js} +2 -2
  59. package/extensions/dashboard-client/dist/assets/{WikiTab-BIe5Z9Nc.js.map → WikiTab-BiKXVwGT.js.map} +1 -1
  60. package/extensions/dashboard-client/dist/assets/{button-BrVreSt5.js → button-DJwGcw0u.js} +2 -2
  61. package/extensions/dashboard-client/dist/assets/{button-BrVreSt5.js.map → button-DJwGcw0u.js.map} +1 -1
  62. package/extensions/dashboard-client/dist/assets/{card-D9F4wbqs.js → card-CgjBf5LZ.js} +2 -2
  63. package/extensions/dashboard-client/dist/assets/{card-D9F4wbqs.js.map → card-CgjBf5LZ.js.map} +1 -1
  64. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-mkdzCnMP.js → generateCategoricalChart-CTQIl2qs.js} +2 -2
  65. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-mkdzCnMP.js.map → generateCategoricalChart-CTQIl2qs.js.map} +1 -1
  66. package/extensions/dashboard-client/dist/assets/{index-CtlmOlj1.js → index-Bu8CZUMX.js} +3 -3
  67. package/extensions/dashboard-client/dist/assets/{index-CtlmOlj1.js.map → index-Bu8CZUMX.js.map} +1 -1
  68. package/extensions/dashboard-client/dist/assets/{switch-BXmp5iwA.js → switch-uUiS1Raq.js} +2 -2
  69. package/extensions/dashboard-client/dist/assets/{switch-BXmp5iwA.js.map → switch-uUiS1Raq.js.map} +1 -1
  70. package/extensions/dashboard-client/dist/assets/{toggle-BgawNwW9.js → toggle-Dv3OEscH.js} +2 -2
  71. package/extensions/dashboard-client/dist/assets/{toggle-BgawNwW9.js.map → toggle-Dv3OEscH.js.map} +1 -1
  72. package/extensions/dashboard-client/dist/assets/{useSSE-DZKX73Ea.js → useSSE-n6ymAic3.js} +2 -2
  73. package/extensions/dashboard-client/dist/assets/{useSSE-DZKX73Ea.js.map → useSSE-n6ymAic3.js.map} +1 -1
  74. package/extensions/dashboard-client/dist/index.html +1 -1
  75. package/extensions/dashboard-client/src/tabs/VcStatusBadge.tsx +24 -0
  76. package/extensions/dashboard-client/src/tabs/VectorCortexClosureCard.tsx +12 -6
  77. package/extensions/dashboard-client/src/tabs/VectorCortexCrystalsCard.tsx +12 -6
  78. package/extensions/dashboard-client/src/tabs/VectorCortexDiagnosticsCard.tsx +12 -6
  79. package/extensions/dashboard-client/src/tabs/VectorCortexEconomicsCard.tsx +12 -6
  80. package/extensions/dashboard-client/src/tabs/VectorCortexLedgerCard.tsx +12 -6
  81. package/extensions/dashboard-client/src/tabs/VectorCortexOutcomesCard.tsx +12 -6
  82. package/extensions/dashboard-client/src/tabs/VectorCortexPlansCard.tsx +12 -6
  83. package/extensions/dashboard-client/src/tabs/VectorCortexPlatformCard.tsx +12 -6
  84. package/extensions/dashboard-client/src/tabs/VectorCortexPolicyCard.tsx +12 -6
  85. package/extensions/dashboard-client/src/tabs/VectorCortexRenderCard.tsx +12 -6
  86. package/extensions/dashboard-client/src/tabs/VectorCortexRepairCard.tsx +12 -6
  87. package/extensions/dashboard-client/src/tabs/VectorCortexRestoreCard.tsx +12 -6
  88. package/extensions/dashboard-client/src/tabs/VectorCortexRolloutCard.tsx +12 -6
  89. package/extensions/dashboard-client/src/tabs/VectorCortexShardsCard.tsx +23 -11
  90. package/extensions/dashboard-client/src/tabs/VectorCortexTab.tsx +5 -7
  91. package/extensions/dashboard-client/src/tabs/VectorCortexTopologyCard.tsx +28 -14
  92. package/extensions/dashboard-client/src/types/vector-cortex-vc7.ts +6 -0
  93. package/extensions/dashboard-client/src/types/vector-cortex-vc8.ts +6 -0
  94. package/extensions/dashboard-client/src/types/vector-cortex.ts +26 -0
  95. package/extensions/dashboard-server/api-contracts/vector-cortex-cache.ts +2 -0
  96. package/extensions/dashboard-server/api-contracts/vector-cortex-diagnostics.ts +2 -0
  97. package/extensions/dashboard-server/api-contracts/vector-cortex-economics.ts +2 -0
  98. package/extensions/dashboard-server/api-contracts/vector-cortex-heal.ts +6 -0
  99. package/extensions/dashboard-server/api-contracts/vector-cortex-outcomes.ts +2 -0
  100. package/extensions/dashboard-server/api-contracts/vector-cortex-platform.ts +2 -0
  101. package/extensions/dashboard-server/api-contracts/vector-cortex-policy.ts +2 -0
  102. package/extensions/dashboard-server/api-contracts/vector-cortex.ts +19 -0
  103. package/extensions/dashboard-server/routes-vector-cortex-crystals.ts +6 -0
  104. package/extensions/dashboard-server/routes-vector-cortex-diagnostics.ts +6 -0
  105. package/extensions/dashboard-server/routes-vector-cortex-economics.ts +6 -0
  106. package/extensions/dashboard-server/routes-vector-cortex-eval.ts +2 -0
  107. package/extensions/dashboard-server/routes-vector-cortex-heal.ts +9 -0
  108. package/extensions/dashboard-server/routes-vector-cortex-health.ts +4 -0
  109. package/extensions/dashboard-server/routes-vector-cortex-ledger.ts +2 -0
  110. package/extensions/dashboard-server/routes-vector-cortex-outcomes.ts +11 -2
  111. package/extensions/dashboard-server/routes-vector-cortex-plans.ts +2 -0
  112. package/extensions/dashboard-server/routes-vector-cortex-platform.ts +14 -2
  113. package/extensions/dashboard-server/routes-vector-cortex-policy.ts +6 -0
  114. package/extensions/dashboard-server/routes-vector-cortex-query.ts +2 -0
  115. package/extensions/dashboard-server/routes-vector-cortex-reconstruct.ts +5 -0
  116. package/extensions/dashboard-server/routes-vector-cortex-render.ts +2 -0
  117. package/extensions/dashboard-server/routes-vector-cortex-repair.ts +5 -0
  118. package/extensions/dashboard-server/routes-vector-cortex-residual.ts +2 -0
  119. package/extensions/dashboard-server/routes-vector-cortex-rollout.ts +58 -3
  120. package/extensions/dashboard-server/routes-vector-cortex-shards.ts +5 -0
  121. package/extensions/dashboard-server/routes-vector-cortex-topology.ts +2 -0
  122. package/extensions/dashboard-server/server.ts +4 -2
  123. package/extensions/dashboard-server/vc-status.ts +22 -0
  124. package/extensions/mega-dashboard-bounce.ts +97 -0
  125. package/extensions/mega-dashboard-cmds.ts +63 -24
  126. package/extensions/mega-events/context-handler/afterCompact.ts +2 -2
  127. package/extensions/mega-events/context-handler/pipelineRun.ts +18 -3
  128. package/extensions/mega-events/register.ts +14 -1
  129. package/extensions/mega-pipeline/recall.ts +10 -0
  130. package/package.json +1 -1
  131. package/extensions/dashboard-client/dist/assets/VectorCortexTab-B3WuPeyn.js +0 -2
  132. package/extensions/dashboard-client/dist/assets/VectorCortexTab-B3WuPeyn.js.map +0 -1
@@ -6,6 +6,8 @@
6
6
 
7
7
  export interface VectorCortexEvaluationSummary {
8
8
  enabled: boolean;
9
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
10
+ readonly deferredReason?: string;
9
11
  mode: "A" | "B" | "C";
10
12
  samples: number;
11
13
  byMode: { A: number; B: number; C: number };
@@ -25,6 +27,8 @@ export interface VectorCortexEvaluationSummary {
25
27
  */
26
28
  export interface VectorCortexHealthCard {
27
29
  enabled: boolean;
30
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
31
+ readonly deferredReason?: string;
28
32
  mode: "A" | "B" | "C";
29
33
  state:
30
34
  | "CLOSED_A"
@@ -82,6 +86,8 @@ export interface VectorCortexResetResult {
82
86
  */
83
87
  export interface VectorCortexTopologyView {
84
88
  enabled: boolean;
89
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
90
+ readonly deferredReason?: string;
85
91
  generationId: string | null;
86
92
  rootDigest: string | null;
87
93
  sourceHighWater: string;
@@ -111,6 +117,8 @@ export interface VectorCortexTopologyView {
111
117
  */
112
118
  export interface VectorCortexQueryView {
113
119
  enabled: boolean;
120
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
121
+ readonly deferredReason?: string;
114
122
  routerVersion: number;
115
123
  updatedAt: string;
116
124
  }
@@ -121,6 +129,8 @@ export interface VectorCortexQueryView {
121
129
  */
122
130
  export interface VectorCortexShardsView {
123
131
  enabled: boolean;
132
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
133
+ readonly deferredReason?: string;
124
134
  semanticCount: number;
125
135
  exactCount: number;
126
136
  byteTotal: number;
@@ -135,6 +145,8 @@ export interface VectorCortexShardsView {
135
145
  */
136
146
  export interface VectorCortexReconstructView {
137
147
  enabled: boolean;
148
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
149
+ readonly deferredReason?: string;
138
150
  closureAttempts: number;
139
151
  closureRejections: number;
140
152
  validatedCount: number;
@@ -150,6 +162,8 @@ export interface VectorCortexReconstructView {
150
162
  */
151
163
  export interface VectorCortexLedgerView {
152
164
  enabled: boolean;
165
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
166
+ readonly deferredReason?: string;
153
167
  session: string;
154
168
  highWater: string;
155
169
  count: number;
@@ -177,6 +191,8 @@ export interface VectorCortexPlanManifest {
177
191
 
178
192
  export interface VectorCortexPlansView {
179
193
  enabled: boolean;
194
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
195
+ readonly deferredReason?: string;
180
196
  dagCount: number;
181
197
  plannerCount: number;
182
198
  plans: VectorCortexPlanManifest[];
@@ -186,6 +202,8 @@ export interface VectorCortexPlansView {
186
202
  /** Reader-only render + provider-profile view (VC5B). */
187
203
  export interface VectorCortexRenderView {
188
204
  enabled: boolean;
205
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
206
+ readonly deferredReason?: string;
189
207
  renderCount: number;
190
208
  providerCount: number;
191
209
  knownProfiles: string[];
@@ -199,6 +217,8 @@ export interface VectorCortexRenderView {
199
217
  */
200
218
  export interface VectorCortexRolloutView {
201
219
  enabled: boolean;
220
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
221
+ readonly deferredReason?: string;
202
222
  gateIndex: number;
203
223
  gatePct: number;
204
224
  buckets: number;
@@ -216,6 +236,8 @@ export interface VectorCortexRolloutView {
216
236
  */
217
237
  export interface VectorCortexRestoreView {
218
238
  enabled: boolean;
239
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
240
+ readonly deferredReason?: string;
219
241
  mode: "A" | "B" | "C";
220
242
  restoreAttempts: number;
221
243
  restoredCount: number;
@@ -232,6 +254,8 @@ export interface VectorCortexRestoreView {
232
254
  */
233
255
  export interface VectorCortexRepairView {
234
256
  enabled: boolean;
257
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
258
+ readonly deferredReason?: string;
235
259
  mode: "A" | "B" | "C";
236
260
  repairAttempts: number;
237
261
  repairsPlanned: number;
@@ -245,6 +269,8 @@ export interface VectorCortexRepairView {
245
269
  /** Reader-only closure-optimization diagnostics view (VC6A). Aggregate only. */
246
270
  export interface VectorCortexClosureProofView {
247
271
  enabled: boolean;
272
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
273
+ readonly deferredReason?: string;
248
274
  mode: "A" | "B" | "C";
249
275
  optimizations: number;
250
276
  proofRejections: number;
@@ -55,4 +55,6 @@ export interface VectorCortexCrystalsView {
55
55
  * why emit-only counters are reported instead of live cache-serve integration.
56
56
  */
57
57
  readonly deferredReason?: string;
58
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
59
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
58
60
  }
@@ -75,4 +75,6 @@ export interface VectorCortexDiagnosticsView {
75
75
  readonly lastFailure: string | null;
76
76
  /** ISO timestamp of the snapshot. */
77
77
  readonly updatedAt: string;
78
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
79
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
78
80
  }
@@ -46,4 +46,6 @@ export interface VectorCortexEconomicsView {
46
46
  readonly updatedAt: string;
47
47
  /** Present when the economic aggregate is not yet computed, with a reason. */
48
48
  readonly deferredReason?: string;
49
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
50
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
49
51
  }
@@ -40,6 +40,8 @@ export interface VectorCortexClosureProofView {
40
40
  readonly lastRejection: string | null;
41
41
  /** ISO timestamp of the snapshot. */
42
42
  readonly updatedAt: string;
43
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
44
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
43
45
  }
44
46
 
45
47
  /**
@@ -70,6 +72,8 @@ export interface VectorCortexRestoreView {
70
72
  readonly lastRejection: string | null;
71
73
  /** ISO timestamp of the snapshot. */
72
74
  readonly updatedAt: string;
75
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
76
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
73
77
  }
74
78
 
75
79
  /**
@@ -108,4 +112,6 @@ export interface VectorCortexRepairView {
108
112
  readonly lastFailure: string | null;
109
113
  /** ISO timestamp of the snapshot. */
110
114
  readonly updatedAt: string;
115
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
116
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
111
117
  }
@@ -37,6 +37,8 @@ export interface VectorCortexOutcomesView {
37
37
  readonly lastFailure: string | null;
38
38
  /** ISO timestamp of the snapshot. */
39
39
  readonly updatedAt: string;
40
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
41
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
40
42
  }
41
43
 
42
44
  /** Consent admin API request body (audited). */
@@ -31,4 +31,6 @@ export interface VectorCortexPlatformView {
31
31
  readonly lastFailure: string | null;
32
32
  /** ISO timestamp of the snapshot. */
33
33
  readonly updatedAt: string;
34
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
35
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
34
36
  }
@@ -35,4 +35,6 @@ export interface VectorCortexPolicyView {
35
35
  readonly updatedAt: string;
36
36
  /** Present when the shadow controller is not yet instantiated, with a reason. */
37
37
  readonly deferredReason?: string;
38
+ /** Live-state derivation for the dashboard (off/awaiting_data/deferred/structural). */
39
+ readonly status?: "live" | "awaiting_data" | "deferred" | "structural" | "off";
38
40
  }
@@ -10,6 +10,13 @@
10
10
  * PREVENT-011: no `any` type.
11
11
  */
12
12
 
13
+ /**
14
+ * Live-state derivation shared across the VC views: "off" (flag disabled),
15
+ * "awaiting_data" (enabled but no data yet), "deferred" (echoed with a
16
+ * deferredReason), "structural" (enabled, structure-only metrics), "live".
17
+ */
18
+ type VcStatus = "live" | "awaiting_data" | "deferred" | "structural" | "off";
19
+
13
20
  /**
14
21
  * Aggregate evaluation summary for GET /api/vector-cortex/evaluation.
15
22
  * Reader-only: exposes aggregates (histogram cells, counts), never payloads or
@@ -39,6 +46,7 @@ export interface VectorCortexEvaluationSummary {
39
46
  readonly rejects: readonly string[];
40
47
  /** ISO timestamp of the summary. */
41
48
  readonly updatedAt: string;
49
+ readonly status?: VcStatus;
42
50
  }
43
51
 
44
52
  /**
@@ -101,6 +109,7 @@ export interface VectorCortexHealthCard {
101
109
  * (lexical). Reader-only aggregate — the measured digest prefix, never bytes.
102
110
  */
103
111
  readonly encoderMode: "A" | "B" | "C";
112
+ readonly status?: VcStatus;
104
113
  }
105
114
 
106
115
  /**
@@ -117,6 +126,7 @@ export interface VectorCortexResetResult {
117
126
  readonly probeCount: number;
118
127
  readonly manualReason?: string;
119
128
  readonly updatedAt: string;
129
+ readonly status?: VcStatus;
120
130
  }
121
131
 
122
132
  /**
@@ -158,6 +168,7 @@ export interface VectorCortexTopologyView {
158
168
  readonly generationDigest?: string | null;
159
169
  /** ISO timestamp of the snapshot. */
160
170
  readonly updatedAt: string;
171
+ readonly status?: VcStatus;
161
172
  }
162
173
 
163
174
  /**
@@ -175,6 +186,7 @@ export interface VectorCortexQueryView {
175
186
  readonly routerVersion: number;
176
187
  /** ISO timestamp of the snapshot. */
177
188
  readonly updatedAt: string;
189
+ readonly status?: VcStatus;
178
190
  }
179
191
 
180
192
  /**
@@ -199,6 +211,7 @@ export interface VectorCortexShardsView {
199
211
  readonly protectedByteTotal: number;
200
212
  /** ISO timestamp of the snapshot. */
201
213
  readonly updatedAt: string;
214
+ readonly status?: VcStatus;
202
215
  }
203
216
 
204
217
  /**
@@ -228,6 +241,7 @@ export interface VectorCortexResidualView {
228
241
  readonly exactByteTotal: number;
229
242
  /** ISO timestamp of the snapshot. */
230
243
  readonly updatedAt: string;
244
+ readonly status?: VcStatus;
231
245
  }
232
246
 
233
247
  /**
@@ -256,6 +270,7 @@ export interface VectorCortexReconstructView {
256
270
  readonly byteTotal: number;
257
271
  /** ISO timestamp of the snapshot. */
258
272
  readonly updatedAt: string;
273
+ readonly status?: VcStatus;
259
274
  }
260
275
 
261
276
  /**
@@ -294,6 +309,7 @@ export interface VectorCortexPlansView {
294
309
  readonly plans: readonly VectorCortexPlanManifest[];
295
310
  /** ISO timestamp of the snapshot. */
296
311
  readonly updatedAt: string;
312
+ readonly status?: VcStatus;
297
313
  }
298
314
 
299
315
  /**
@@ -314,6 +330,7 @@ export interface VectorCortexRenderView {
314
330
  readonly knownProfiles: readonly string[];
315
331
  /** ISO timestamp of the snapshot. */
316
332
  readonly updatedAt: string;
333
+ readonly status?: VcStatus;
317
334
  }
318
335
 
319
336
  /**
@@ -345,6 +362,7 @@ export interface VectorCortexRolloutView {
345
362
  readonly promotionBlocked: boolean;
346
363
  /** ISO timestamp of the snapshot. */
347
364
  readonly updatedAt: string;
365
+ readonly status?: VcStatus;
348
366
  }
349
367
 
350
368
  /**
@@ -372,6 +390,7 @@ export interface VectorCortexLedgerView {
372
390
  }[];
373
391
  /** ISO timestamp of the snapshot. */
374
392
  readonly updatedAt: string;
393
+ readonly status?: VcStatus;
375
394
  }
376
395
 
377
396
  export type {
@@ -29,6 +29,7 @@ import type { RouteContext } from "./routes-core.js";
29
29
  import { VC7A_ENABLED } from "../../src/config.js";
30
30
  import { sendJson } from "./routes-vector-cortex-shared.js";
31
31
  import { countVcEvents, vcCount } from "./vc-event-counts.js";
32
+ import { deriveVcStatus } from "./vc-status.js";
32
33
  import type { VectorCortexCrystalsView } from "./api-contracts/vector-cortex-cache.js";
33
34
 
34
35
  // Actual events emitted by src/vector-cortex/cache/crystal-emit.ts.
@@ -77,6 +78,11 @@ export function handleVectorCortexCrystals(
77
78
  lastFailure: null,
78
79
  updatedAt: new Date().toISOString(),
79
80
  deferredReason: "crystal_store_not_instantiated_v0_20_23",
81
+ status: deriveVcStatus({
82
+ enabled,
83
+ deferredReason: "crystal_store_not_instantiated_v0_20_23",
84
+ hasData: vcCount(counts, "vector_cortex_crystal_written") > 0,
85
+ }),
80
86
  };
81
87
  sendJson(res, 200, body);
82
88
  return true;
@@ -31,6 +31,7 @@ import type { RouteContext } from "./routes-core.js";
31
31
  import { VC7C_ENABLED } from "../../src/config.js";
32
32
  import { sendJson } from "./routes-vector-cortex-shared.js";
33
33
  import { countVcEvents, vcCount } from "./vc-event-counts.js";
34
+ import { deriveVcStatus } from "./vc-status.js";
34
35
  import type { VectorCortexDiagnosticsView } from "./api-contracts/vector-cortex-diagnostics.js";
35
36
 
36
37
  // Actual events emitted by src/vector-cortex/cache/diagnostics-emit.ts.
@@ -77,6 +78,11 @@ export function handleVectorCortexDiagnostics(
77
78
  lastFailure: null,
78
79
  updatedAt: new Date().toISOString(),
79
80
  deferredReason: "cache_classifier_not_wired_v0_20_23",
81
+ status: deriveVcStatus({
82
+ enabled,
83
+ deferredReason: "cache_classifier_not_wired_v0_20_23",
84
+ hasData: vcCount(counts, "vector_cortex_cache_serve_blocked") > 0,
85
+ }),
80
86
  };
81
87
  sendJson(res, 200, body);
82
88
  return true;
@@ -27,6 +27,7 @@ import type { IncomingMessage, ServerResponse } from "node:http";
27
27
  import type { RouteContext } from "./routes-core.js";
28
28
  import { VC7B_ENABLED } from "../../src/config.js";
29
29
  import { sendJson } from "./routes-vector-cortex-shared.js";
30
+ import { deriveVcStatus } from "./vc-status.js";
30
31
  import type { VectorCortexEconomicsView } from "./api-contracts/vector-cortex-economics.js";
31
32
 
32
33
  /**
@@ -63,6 +64,11 @@ export function handleVectorCortexEconomics(
63
64
  lastFailure: null,
64
65
  updatedAt: new Date().toISOString(),
65
66
  deferredReason: "economics_not_computed_v0_20_23",
67
+ status: deriveVcStatus({
68
+ enabled,
69
+ deferredReason: "economics_not_computed_v0_20_23",
70
+ hasData: false,
71
+ }),
66
72
  };
67
73
  sendJson(res, 200, body);
68
74
  return true;
@@ -17,6 +17,7 @@ import { readEvalRows } from "../../src/vector-cortex/eval/persist.js";
17
17
  import { summarizeEvalRows } from "../../src/vector-cortex/eval/reader.js";
18
18
  import { sendJson } from "./routes-vector-cortex-shared.js";
19
19
  import type { VectorCortexEvaluationSummary } from "./api-contracts/vector-cortex.js";
20
+ import { deriveVcStatus } from "./vc-status.js";
20
21
 
21
22
  /** Reader-only aggregate GET /api/vector-cortex/evaluation. */
22
23
  export function handleVectorCortexEvaluation(
@@ -53,6 +54,7 @@ export function handleVectorCortexEvaluation(
53
54
  },
54
55
  rejects: [], // VC0C wires live breaker/reject telemetry here
55
56
  updatedAt: new Date().toISOString(),
57
+ status: deriveVcStatus({ enabled, hasData: summary.samples > 0 }),
56
58
  };
57
59
  sendJson(res, 200, body);
58
60
  return true;
@@ -25,6 +25,7 @@ import type { RouteContext } from "./routes-core.js";
25
25
  import { VC6A_ENABLED, VC6B_ENABLED } from "../../src/config.js";
26
26
  import { sendJson } from "./routes-vector-cortex-shared.js";
27
27
  import { countVcEvents, vcCount } from "./vc-event-counts.js";
28
+ import { deriveVcStatus } from "./vc-status.js";
28
29
  import type {
29
30
  VectorCortexClosureProofView,
30
31
  VectorCortexRestoreView,
@@ -69,6 +70,10 @@ export function handleVectorCortexClosureProof(
69
70
  optimizedTraversalTotal: 0,
70
71
  lastRejection: null,
71
72
  updatedAt: new Date().toISOString(),
73
+ status: deriveVcStatus({
74
+ enabled,
75
+ hasData: vcCount(counts, "vector_cortex_closure_optimized") > 0,
76
+ }),
72
77
  };
73
78
  sendJson(res, 200, body);
74
79
  return true;
@@ -110,6 +115,10 @@ export function handleVectorCortexRestore(
110
115
  digestRejections: vcCount(counts, "vector_cortex_restore_digest_rejected"),
111
116
  lastRejection: null,
112
117
  updatedAt: new Date().toISOString(),
118
+ status: deriveVcStatus({
119
+ enabled,
120
+ hasData: vcCount(counts, "vector_cortex_source_restored") > 0,
121
+ }),
113
122
  };
114
123
  sendJson(res, 200, body);
115
124
  return true;
@@ -23,6 +23,7 @@ import type {
23
23
  VectorCortexHealthCard,
24
24
  VectorCortexResetResult,
25
25
  } from "./api-contracts/vector-cortex.js";
26
+ import { deriveVcStatus } from "./vc-status.js";
26
27
 
27
28
  /** Resolve the committed encoder-v1 asset dir by walking up to the repo root. */
28
29
  function encoderAssetDir(): string | null {
@@ -169,6 +170,7 @@ export function handleVectorCortexHealth(
169
170
  stateSource: "ephemeral",
170
171
  encoderAssetDigest: enc.assetDigest,
171
172
  encoderMode: enc.mode,
173
+ status: deriveVcStatus({ enabled: false, hasData: false }),
172
174
  };
173
175
  if (!card) {
174
176
  sendJson(res, 200, fallback);
@@ -210,6 +212,7 @@ export function handleVectorCortexHealth(
210
212
  stateSource: card.stateSource,
211
213
  encoderAssetDigest: enc.assetDigest,
212
214
  encoderMode: enc.mode,
215
+ status: deriveVcStatus({ enabled, hasData: true, structuralOnly: true }),
213
216
  };
214
217
  sendJson(res, 200, body);
215
218
  return true;
@@ -263,6 +266,7 @@ export function handleVectorCortexBreakersReset(
263
266
  probeCount: rec.probeCount,
264
267
  manualReason: rec.manualReason,
265
268
  updatedAt: rec.updatedAt,
269
+ status: deriveVcStatus({ enabled: true, hasData: true }),
266
270
  };
267
271
  sendJson(res, 200, body);
268
272
  } catch {
@@ -18,6 +18,7 @@ import { VC1B_ENABLED } from "../../src/config.js";
18
18
  import { createLedgerStore } from "../../src/vector-cortex/ledger/store.js";
19
19
  import { sendJson } from "./routes-vector-cortex-shared.js";
20
20
  import type { VectorCortexLedgerView } from "./api-contracts/vector-cortex.js";
21
+ import { deriveVcStatus } from "./vc-status.js";
21
22
 
22
23
  /**
23
24
  * Reader-only GET /api/vector-cortex/ledger (VC1B).
@@ -86,6 +87,7 @@ export function handleVectorCortexLedger(
86
87
  count,
87
88
  occurrences,
88
89
  updatedAt: new Date().toISOString(),
90
+ status: deriveVcStatus({ enabled: active, hasData: count > 0 }),
89
91
  };
90
92
  sendJson(res, 200, body);
91
93
  return true;
@@ -21,12 +21,18 @@ import type { IncomingMessage, ServerResponse } from "node:http";
21
21
  import type { RouteContext } from "./routes-core.js";
22
22
  import { VC8A_ENABLED } from "../../src/config.js";
23
23
  import { sendJson, readJsonBody } from "./routes-vector-cortex-shared.js";
24
+ import { countVcEvents, vcCount } from "./vc-event-counts.js";
25
+ import { deriveVcStatus } from "./vc-status.js";
24
26
  import type {
25
27
  VectorCortexOutcomesView,
26
28
  ConsentAdminRequest,
27
29
  ConsentAdminResponse,
28
30
  } from "./api-contracts/vector-cortex-outcomes.js";
29
31
 
32
+ // Actual events emitted by src/vector-cortex/outcomes/* — the outcome append is
33
+ // the sole aggregate signal (consent grants/revokes are not emitted as events).
34
+ const OUTCOME_EVENTS = ["vector_cortex_outcome_appended"] as const;
35
+
30
36
  /**
31
37
  * GET /api/vector-cortex/outcomes — reader-only outcomes aggregate (VC8A).
32
38
  * POST /api/vector-cortex/outcomes/consent — audited consent admin API.
@@ -34,7 +40,7 @@ import type {
34
40
  export function handleVectorCortexOutcomes(
35
41
  req: IncomingMessage,
36
42
  res: ServerResponse,
37
- _ctx: RouteContext,
43
+ ctx: RouteContext,
38
44
  ): boolean {
39
45
  const url = req.url ?? "";
40
46
  const path = url.split("?")[0] ?? url;
@@ -77,17 +83,20 @@ export function handleVectorCortexOutcomes(
77
83
  }
78
84
 
79
85
  const enabled = VC8A_ENABLED();
86
+ const counts = countVcEvents(ctx.stateDir, OUTCOME_EVENTS);
87
+ const outcomeCount = vcCount(counts, "vector_cortex_outcome_appended");
80
88
  const mode: "A" | "B" | "C" = enabled ? "A" : "C";
81
89
  const body: VectorCortexOutcomesView = {
82
90
  enabled,
83
91
  mode,
84
- outcomeCount: 0,
92
+ outcomeCount,
85
93
  consentedSessions: 0,
86
94
  revokedSessions: 0,
87
95
  manifestCount: 0,
88
96
  excludedCount: 0,
89
97
  lastFailure: null,
90
98
  updatedAt: new Date().toISOString(),
99
+ status: deriveVcStatus({ enabled, hasData: outcomeCount > 0 }),
91
100
  };
92
101
  sendJson(res, 200, body);
93
102
  return true;
@@ -27,6 +27,7 @@ import { DAG_IDS } from "../../src/vector-cortex/prompt-dag/types.js";
27
27
  import { PLN_IDS } from "../../src/vector-cortex/planner/types.js";
28
28
  import { sendJson } from "./routes-vector-cortex-shared.js";
29
29
  import type { VectorCortexPlansView } from "./api-contracts/vector-cortex.js";
30
+ import { deriveVcStatus } from "./vc-status.js";
30
31
 
31
32
  /**
32
33
  * Reader-only GET /api/vector-cortex/plans (VC5A).
@@ -52,6 +53,7 @@ export function handleVectorCortexPlans(
52
53
  plannerCount: enabled ? PLN_IDS.length : 0,
53
54
  plans: [],
54
55
  updatedAt: new Date().toISOString(),
56
+ status: deriveVcStatus({ enabled, hasData: true, structuralOnly: true }),
55
57
  };
56
58
  sendJson(res, 200, body);
57
59
  return true;
@@ -18,13 +18,22 @@ import type { IncomingMessage, ServerResponse } from "node:http";
18
18
  import type { RouteContext } from "./routes-core.js";
19
19
  import { VC8C_ENABLED } from "../../src/config.js";
20
20
  import { sendJson } from "./routes-vector-cortex-shared.js";
21
+ import { countVcEvents, vcCount } from "./vc-event-counts.js";
22
+ import { deriveVcStatus } from "./vc-status.js";
21
23
  import type { VectorCortexPlatformView } from "./api-contracts/vector-cortex-platform.js";
22
24
 
25
+ // Actual events emitted by src/vector-cortex/platform/* — a parity run checks
26
+ // fixtures and a demotion records an engine-selection downgrade.
27
+ const PLATFORM_EVENTS = [
28
+ "vector_cortex_engine_parity_checked",
29
+ "vector_cortex_engine_selection_demoted",
30
+ ] as const;
31
+
23
32
  /** GET /api/vector-cortex/platform — reader-only engine parity/selection aggregate (VC8C). */
24
33
  export function handleVectorCortexPlatform(
25
34
  req: IncomingMessage,
26
35
  res: ServerResponse,
27
- _ctx: RouteContext,
36
+ ctx: RouteContext,
28
37
  ): boolean {
29
38
  const url = req.url ?? "";
30
39
  const path = url.split("?")[0] ?? url;
@@ -36,16 +45,19 @@ export function handleVectorCortexPlatform(
36
45
  }
37
46
 
38
47
  const enabled = VC8C_ENABLED();
48
+ const counts = countVcEvents(ctx.stateDir, PLATFORM_EVENTS);
39
49
  const mode: VectorCortexPlatformView["mode"] = enabled ? "A" : "C";
50
+ const fixtureCount = vcCount(counts, "vector_cortex_engine_parity_checked");
40
51
  const body: VectorCortexPlatformView = {
41
52
  enabled,
42
53
  mode,
43
- fixtureCount: 0,
54
+ fixtureCount,
44
55
  passed: 0,
45
56
  failed: 0,
46
57
  externalRunnerConfigured: process.env.MEGACOMPACT_RUST_RUNNER !== undefined,
47
58
  lastFailure: null,
48
59
  updatedAt: new Date().toISOString(),
60
+ status: deriveVcStatus({ enabled, hasData: fixtureCount > 0 }),
49
61
  };
50
62
  sendJson(res, 200, body);
51
63
  return true;
@@ -20,6 +20,7 @@ import type { IncomingMessage, ServerResponse } from "node:http";
20
20
  import type { RouteContext } from "./routes-core.js";
21
21
  import { VC8B_ENABLED } from "../../src/config.js";
22
22
  import { sendJson } from "./routes-vector-cortex-shared.js";
23
+ import { deriveVcStatus } from "./vc-status.js";
23
24
  import type { VectorCortexPolicyView } from "./api-contracts/vector-cortex-policy.js";
24
25
 
25
26
  /** GET /api/vector-cortex/policy — reader-only policy + shadow aggregate (VC8B). */
@@ -50,6 +51,11 @@ export function handleVectorCortexPolicy(
50
51
  lastFailure: null,
51
52
  updatedAt: new Date().toISOString(),
52
53
  deferredReason: "shadow_controller_not_instantiated_v0_20_23",
54
+ status: deriveVcStatus({
55
+ enabled,
56
+ deferredReason: "shadow_controller_not_instantiated_v0_20_23",
57
+ hasData: false,
58
+ }),
53
59
  };
54
60
  sendJson(res, 200, body);
55
61
  return true;
@@ -19,6 +19,7 @@ import { VC3C_ENABLED } from "../../src/config.js";
19
19
  import { ROUTER_KEY_VERSION } from "../../src/vector-cortex/topology/query.js";
20
20
  import { sendJson } from "./routes-vector-cortex-shared.js";
21
21
  import type { VectorCortexQueryView } from "./api-contracts/vector-cortex.js";
22
+ import { deriveVcStatus } from "./vc-status.js";
22
23
 
23
24
  /**
24
25
  * Reader-only GET /api/vector-cortex/query (VC3C query-layer diagnostics).
@@ -48,6 +49,7 @@ export function handleVectorCortexQuery(
48
49
  enabled,
49
50
  routerVersion: ROUTER_KEY_VERSION,
50
51
  updatedAt: new Date().toISOString(),
52
+ status: deriveVcStatus({ enabled, hasData: true, structuralOnly: true }),
51
53
  };
52
54
  sendJson(res, 200, body);
53
55
  return true;
@@ -13,6 +13,7 @@ import { VC4C_ENABLED } from "../../src/config.js";
13
13
  import { sendJson } from "./routes-vector-cortex-shared.js";
14
14
  import { countVcEvents, vcCount } from "./vc-event-counts.js";
15
15
  import type { VectorCortexReconstructView } from "./api-contracts/vector-cortex.js";
16
+ import { deriveVcStatus } from "./vc-status.js";
16
17
 
17
18
  // Closure attempt/rejection events emitted by src/vector-cortex/heal/emit.ts.
18
19
  const RECONSTRUCT_EVENTS = [
@@ -43,6 +44,10 @@ export function handleVectorCortexReconstruct(
43
44
  spanTotal: 0,
44
45
  byteTotal: 0,
45
46
  updatedAt: new Date().toISOString(),
47
+ status: deriveVcStatus({
48
+ enabled,
49
+ hasData: vcCount(counts, "vector_cortex_closure_optimized") > 0,
50
+ }),
46
51
  };
47
52
  sendJson(res, 200, body);
48
53
  return true;
@@ -21,6 +21,7 @@ import { PRO_IDS } from "../../src/vector-cortex/provider/types.js";
21
21
  import { KNOWN_PROVIDER_KEYS } from "../../src/vector-cortex/provider/registry.js";
22
22
  import { sendJson } from "./routes-vector-cortex-shared.js";
23
23
  import type { VectorCortexRenderView } from "./api-contracts/vector-cortex.js";
24
+ import { deriveVcStatus } from "./vc-status.js";
24
25
 
25
26
  /** Reader-only GET /api/vector-cortex/render (VC5B). */
26
27
  export function handleVectorCortexRender(
@@ -43,6 +44,7 @@ export function handleVectorCortexRender(
43
44
  providerCount: enabled ? PRO_IDS.length : 0,
44
45
  knownProfiles: enabled ? KNOWN_PROVIDER_KEYS : [],
45
46
  updatedAt: new Date().toISOString(),
47
+ status: deriveVcStatus({ enabled, hasData: true, structuralOnly: true }),
46
48
  };
47
49
  sendJson(res, 200, body);
48
50
  return true;
@@ -26,6 +26,7 @@ import type { RouteContext } from "./routes-core.js";
26
26
  import { VC6C_ENABLED } from "../../src/config.js";
27
27
  import { sendJson } from "./routes-vector-cortex-shared.js";
28
28
  import { countVcEvents, vcCount } from "./vc-event-counts.js";
29
+ import { deriveVcStatus } from "./vc-status.js";
29
30
  import type { VectorCortexRepairView } from "./api-contracts/vector-cortex.js";
30
31
 
31
32
  // Actual event names emitted by src/vector-cortex/heal/repair-emit.ts.
@@ -75,6 +76,10 @@ export function handleVectorCortexRepair(
75
76
  lastBackoffMs: null,
76
77
  lastFailure: null,
77
78
  updatedAt: new Date().toISOString(),
79
+ status: deriveVcStatus({
80
+ enabled,
81
+ hasData: vcCount(counts, "vector_cortex_repair_planned") > 0,
82
+ }),
78
83
  };
79
84
  sendJson(res, 200, body);
80
85
  return true;