pi-mega-compact 0.20.14 → 0.20.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config/vector-cortex.js +20 -0
- package/dist/config.js +1 -1
- package/dist/extensions/dashboard-server/route-dispatch.js +1 -0
- package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +1 -0
- package/dist/src/config/vector-cortex.js +20 -0
- package/dist/src/config.js +1 -1
- package/dist/src/vector-cortex/migrations/request-hash-v2-ops.js +143 -0
- package/dist/src/vector-cortex/migrations/request-hash-v2-types.js +30 -0
- package/dist/src/vector-cortex/migrations/request-hash-v2.js +42 -147
- package/dist/vector-cortex/migrations/request-hash-v2-ops.js +143 -0
- package/dist/vector-cortex/migrations/request-hash-v2-types.js +30 -0
- package/dist/vector-cortex/migrations/request-hash-v2.js +42 -147
- package/extensions/dashboard-client/dist/assets/{AreaChart-VUd_iOtO.js → AreaChart-CV8WqMmt.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-VUd_iOtO.js.map → AreaChart-CV8WqMmt.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-BoqeJ5mM.js → BarChart-M-HEBq9l.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-BoqeJ5mM.js.map → BarChart-M-HEBq9l.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-1ON7meDK.js → CacheTab-DJ_yPAhP.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-1ON7meDK.js.map → CacheTab-DJ_yPAhP.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-Dr9eqt1k.js → EventsTab-DNVlKzt6.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-Dr9eqt1k.js.map → EventsTab-DNVlKzt6.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-Ciaigd4i.js → HealthTab-B5yjuInb.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-Ciaigd4i.js.map → HealthTab-B5yjuInb.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DjZRr3Lf.js → MaintenanceTab-DoQedESF.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DjZRr3Lf.js.map → MaintenanceTab-DoQedESF.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-BpZXHA7j.js → MemoryMapTab-CuL5CzdH.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-BpZXHA7j.js.map → MemoryMapTab-CuL5CzdH.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-QemocY5k.js → MetricsTab-CZSTaCpK.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-QemocY5k.js.map → MetricsTab-CZSTaCpK.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-VtC1F-mO.js → OverviewTab-vkZlXRW6.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-VtC1F-mO.js.map → OverviewTab-vkZlXRW6.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-CJD1cBxp.js → ReposTab-DgPD96rF.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-CJD1cBxp.js.map → ReposTab-DgPD96rF.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-Cj0erPR4.js → SessionsTab-XPbWh7XN.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-Cj0erPR4.js.map → SessionsTab-XPbWh7XN.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SetupTab-AOVROZ4G.js → SetupTab-Dz74XAtR.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SetupTab-AOVROZ4G.js.map → SetupTab-Dz74XAtR.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-ZliVn8DH.js → TimeSavedCard-FynCpJdx.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-ZliVn8DH.js.map → TimeSavedCard-FynCpJdx.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-DsoTWeIh.js → TurnsTab-C7m3GDy0.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-DsoTWeIh.js.map → TurnsTab-C7m3GDy0.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-jRd_Iztk.js +2 -0
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-jRd_Iztk.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{WikiTab-CK8fcW1l.js → WikiTab-C6viLa0u.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-CK8fcW1l.js.map → WikiTab-C6viLa0u.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-DdPcvex1.js → button-mBEgbBVU.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-DdPcvex1.js.map → button-mBEgbBVU.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-DXFuZph_.js → card-CalUQAKG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-DXFuZph_.js.map → card-CalUQAKG.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-BagDVGWn.js → generateCategoricalChart-CMmkuwj5.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-BagDVGWn.js.map → generateCategoricalChart-CMmkuwj5.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-DVdDtRY4.js → index-Dz8GPBOE.js} +3 -3
- package/extensions/dashboard-client/dist/assets/{index-DVdDtRY4.js.map → index-Dz8GPBOE.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{switch-CtdtGyUR.js → switch-8QKO6CTU.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-CtdtGyUR.js.map → switch-8QKO6CTU.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-Cvvwlbye.js → toggle-9eCkWI4q.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-Cvvwlbye.js.map → toggle-9eCkWI4q.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-DvlceHjV.js → useSSE-s6IqOKoD.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-DvlceHjV.js.map → useSSE-s6IqOKoD.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/api/vector-cortex.ts +9 -0
- package/extensions/dashboard-client/src/tabs/VectorCortexTab.tsx +23 -121
- package/extensions/dashboard-client/src/tabs/useVectorCortexPoll.ts +123 -0
- package/extensions/dashboard-client/src/types/vector-cortex-vc7.ts +63 -0
- package/extensions/dashboard-client/src/types/vector-cortex.ts +5 -33
- package/extensions/dashboard-server/route-dispatch.ts +1 -0
- package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +6 -0
- package/package.json +1 -1
- package/src/config/vector-cortex.ts +21 -0
- package/src/config.ts +1 -0
- package/src/vector-cortex/migrations/request-hash-v2-ops.ts +195 -0
- package/src/vector-cortex/migrations/request-hash-v2-types.ts +87 -0
- package/src/vector-cortex/migrations/request-hash-v2.ts +65 -213
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-BBa7rp6C.js +0 -2
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-BBa7rp6C.js.map +0 -1
|
@@ -4,46 +4,19 @@
|
|
|
4
4
|
* GET /api/vector-cortex/evaluation. VC0C (task 5): live safety envelope health
|
|
5
5
|
* card (breaker state, window/probe/backoff, durable spool frontier/lag) from
|
|
6
6
|
* GET /api/vector-cortex/health plus an admin "reset cooldown" action. Polls
|
|
7
|
-
* every 5s.
|
|
7
|
+
* every 5s via useVectorCortexPoll.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { useState
|
|
10
|
+
import { useState } from "react";
|
|
11
11
|
import {
|
|
12
|
-
fetchVectorCortexEvaluation,
|
|
13
|
-
fetchVectorCortexHealth,
|
|
14
|
-
fetchVectorCortexLedger,
|
|
15
|
-
fetchVectorCortexQuery,
|
|
16
|
-
fetchVectorCortexReconstruct,
|
|
17
|
-
fetchVectorCortexPlans,
|
|
18
|
-
fetchVectorCortexRender,
|
|
19
|
-
fetchVectorCortexRollout,
|
|
20
|
-
fetchVectorCortexClosureProof,
|
|
21
|
-
fetchVectorCortexRestore,
|
|
22
|
-
fetchVectorCortexRepair,
|
|
23
|
-
fetchVectorCortexCrystals,
|
|
24
|
-
fetchVectorCortexEconomics,
|
|
25
|
-
fetchVectorCortexShards,
|
|
26
|
-
fetchVectorCortexTopology,
|
|
27
12
|
resetVectorCortexBreaker,
|
|
28
|
-
|
|
13
|
+
fetchVectorCortexHealth,
|
|
29
14
|
type VectorCortexHealthCard,
|
|
30
|
-
type VectorCortexLedgerView,
|
|
31
|
-
type VectorCortexQueryView,
|
|
32
|
-
type VectorCortexReconstructView,
|
|
33
|
-
type VectorCortexPlansView,
|
|
34
|
-
type VectorCortexRenderView,
|
|
35
|
-
type VectorCortexRolloutView,
|
|
36
|
-
type VectorCortexClosureProofView,
|
|
37
|
-
type VectorCortexRestoreView,
|
|
38
|
-
type VectorCortexRepairView,
|
|
39
|
-
type VectorCortexCrystalsView,
|
|
40
|
-
type VectorCortexEconomicsView,
|
|
41
|
-
type VectorCortexShardsView,
|
|
42
|
-
type VectorCortexTopologyView,
|
|
43
15
|
} from "../api/vector-cortex";
|
|
44
16
|
import { Card, CardContent, CardHeader, CardTitle } from "../components/ui/card";
|
|
45
17
|
import { Badge } from "../components/ui/badge";
|
|
46
18
|
import { Metric } from "./VectorCortexMetric";
|
|
19
|
+
import { useVectorCortexPoll } from "./useVectorCortexPoll";
|
|
47
20
|
import { VectorCortexRenderCard } from "./VectorCortexRenderCard";
|
|
48
21
|
import { VectorCortexRolloutCard } from "./VectorCortexRolloutCard";
|
|
49
22
|
import { VectorCortexClosureCard } from "./VectorCortexClosureCard";
|
|
@@ -69,81 +42,10 @@ function ModeChip({ mode, count }: { mode: string; count: number }): React.React
|
|
|
69
42
|
}
|
|
70
43
|
|
|
71
44
|
export default function VectorCortexTab(): React.ReactElement {
|
|
72
|
-
const [
|
|
73
|
-
const [err, setError] = useState<string | null>(null);
|
|
74
|
-
const [loading, setLoading] = useState(true);
|
|
75
|
-
const [health, setHealth] = useState<VectorCortexHealthCard | null>(null);
|
|
45
|
+
const [poll, refetch] = useVectorCortexPoll();
|
|
76
46
|
const [resetMsg, setResetMsg] = useState<string | null>(null);
|
|
77
|
-
const [ledger, setLedger] = useState<VectorCortexLedgerView | null>(null);
|
|
78
|
-
const [topology, setTopology] = useState<VectorCortexTopologyView | null>(null);
|
|
79
|
-
const [query, setQuery] = useState<VectorCortexQueryView | null>(null);
|
|
80
|
-
const [shards, setShards] = useState<VectorCortexShardsView | null>(null);
|
|
81
|
-
const [reconstruct, setReconstruct] = useState<VectorCortexReconstructView | null>(null);
|
|
82
|
-
const [plans, setPlans] = useState<VectorCortexPlansView | null>(null);
|
|
83
|
-
const [render, setRender] = useState<VectorCortexRenderView | null>(null);
|
|
84
|
-
const [rollout, setRollout] = useState<VectorCortexRolloutView | null>(null);
|
|
85
|
-
const [closureProof, setClosureProof] = useState<VectorCortexClosureProofView | null>(null);
|
|
86
|
-
const [restore, setRestore] = useState<VectorCortexRestoreView | null>(null);
|
|
87
|
-
const [repair, setRepair] = useState<VectorCortexRepairView | null>(null);
|
|
88
|
-
const [crystals, setCrystals] = useState<VectorCortexCrystalsView | null>(null);
|
|
89
|
-
const [economics, setEconomics] = useState<VectorCortexEconomicsView | null>(null);
|
|
90
|
-
|
|
91
|
-
const poll = useCallback(() => {
|
|
92
|
-
fetchVectorCortexEvaluation()
|
|
93
|
-
.then(setData)
|
|
94
|
-
.catch((e: unknown) =>
|
|
95
|
-
setError(e instanceof Error ? e.message : String(e)),
|
|
96
|
-
)
|
|
97
|
-
.finally(() => setLoading(false));
|
|
98
|
-
fetchVectorCortexHealth().then(setHealth).catch(() => {
|
|
99
|
-
/* health card is best-effort (VC0C) */
|
|
100
|
-
});
|
|
101
|
-
fetchVectorCortexLedger().then(setLedger).catch(() => {
|
|
102
|
-
/* ledger card is best-effort (VC1B) */
|
|
103
|
-
});
|
|
104
|
-
fetchVectorCortexTopology().then(setTopology).catch(() => {
|
|
105
|
-
/* topology card is best-effort (VC3A) */
|
|
106
|
-
});
|
|
107
|
-
fetchVectorCortexQuery().then(setQuery).catch(() => {
|
|
108
|
-
/* query diagnostics card is best-effort (VC3C) */
|
|
109
|
-
});
|
|
110
|
-
fetchVectorCortexShards().then(setShards).catch(() => {
|
|
111
|
-
/* dual-tier shards card is best-effort (VC4A) */
|
|
112
|
-
});
|
|
113
|
-
fetchVectorCortexReconstruct().then(setReconstruct).catch(() => {
|
|
114
|
-
/* reconstruction-fidelity card is best-effort (VC4C) */
|
|
115
|
-
});
|
|
116
|
-
fetchVectorCortexPlans().then(setPlans).catch(() => {
|
|
117
|
-
/* plan manifest card is best-effort (VC5A) */
|
|
118
|
-
});
|
|
119
|
-
fetchVectorCortexRender().then(setRender).catch(() => {
|
|
120
|
-
/* render conformance card is best-effort (VC5B) */
|
|
121
|
-
});
|
|
122
|
-
fetchVectorCortexRollout().then(setRollout).catch(() => {
|
|
123
|
-
/* rollout card is best-effort (VC5C) */
|
|
124
|
-
});
|
|
125
|
-
fetchVectorCortexClosureProof().then(setClosureProof).catch(() => {
|
|
126
|
-
/* closure-optimization card is best-effort (VC6A) */
|
|
127
|
-
});
|
|
128
|
-
fetchVectorCortexRestore().then(setRestore).catch(() => {
|
|
129
|
-
/* exact-source-restoration card is best-effort (VC6B) */
|
|
130
|
-
});
|
|
131
|
-
fetchVectorCortexRepair().then(setRepair).catch(() => {
|
|
132
|
-
/* self-healing derived-state card is best-effort (VC6C) */
|
|
133
|
-
});
|
|
134
|
-
fetchVectorCortexCrystals().then(setCrystals).catch(() => {
|
|
135
|
-
/* frozen-range-crystal card is best-effort (VC7A) */
|
|
136
|
-
});
|
|
137
|
-
fetchVectorCortexEconomics().then(setEconomics).catch(() => {
|
|
138
|
-
/* provider-cache-economics card is best-effort (VC7B) */
|
|
139
|
-
});
|
|
140
|
-
}, []);
|
|
141
47
|
|
|
142
|
-
|
|
143
|
-
poll();
|
|
144
|
-
const id = setInterval(poll, 5000);
|
|
145
|
-
return () => clearInterval(id);
|
|
146
|
-
}, [poll]);
|
|
48
|
+
const { loading, error, data, health } = poll;
|
|
147
49
|
|
|
148
50
|
const onReset = () => {
|
|
149
51
|
resetVectorCortexBreaker("provider")
|
|
@@ -153,7 +55,7 @@ export default function VectorCortexTab(): React.ReactElement {
|
|
|
153
55
|
);
|
|
154
56
|
return fetchVectorCortexHealth();
|
|
155
57
|
})
|
|
156
|
-
.then(
|
|
58
|
+
.then((h: VectorCortexHealthCard | null) => { void h; refetch(); })
|
|
157
59
|
.catch((e: unknown) =>
|
|
158
60
|
setResetMsg(e instanceof Error ? e.message : String(e)),
|
|
159
61
|
);
|
|
@@ -161,8 +63,8 @@ export default function VectorCortexTab(): React.ReactElement {
|
|
|
161
63
|
|
|
162
64
|
if (loading && !data)
|
|
163
65
|
return <div className="vc-loading">Loading vector-cortex evaluation…</div>;
|
|
164
|
-
if (
|
|
165
|
-
return <div className="vc-error">Error: {
|
|
66
|
+
if (error && !data)
|
|
67
|
+
return <div className="vc-error">Error: {error}</div>;
|
|
166
68
|
if (!data)
|
|
167
69
|
return <div className="vc-empty">No evaluation data available.</div>;
|
|
168
70
|
|
|
@@ -281,24 +183,24 @@ export default function VectorCortexTab(): React.ReactElement {
|
|
|
281
183
|
}
|
|
282
184
|
/>
|
|
283
185
|
<Metric label="Spool lag" value={String(health.spoolLag)} />
|
|
284
|
-
|
|
285
|
-
|
|
186
|
+
<Metric label="Encoder mode" value={health.encoderMode} />
|
|
187
|
+
<Metric label="Encoder asset" value={health.encoderAssetDigest ? health.encoderAssetDigest.slice(0, 12) : "none"} />
|
|
286
188
|
</div>
|
|
287
189
|
)}
|
|
288
190
|
</CardContent>
|
|
289
191
|
</Card>
|
|
290
|
-
<VectorCortexTopologyCard topology={topology} query={query} />
|
|
291
|
-
<VectorCortexShardsCard view={shards} />
|
|
292
|
-
<VectorCortexReconstructCard view={reconstruct} />
|
|
293
|
-
<VectorCortexPlansCard view={plans} />
|
|
294
|
-
<VectorCortexRenderCard view={render} />
|
|
295
|
-
<VectorCortexRolloutCard view={rollout} />
|
|
296
|
-
<VectorCortexClosureCard view={closureProof} />
|
|
297
|
-
<VectorCortexRestoreCard view={restore} />
|
|
298
|
-
<VectorCortexRepairCard view={repair} />
|
|
299
|
-
<VectorCortexCrystalsCard view={crystals} />
|
|
300
|
-
<VectorCortexEconomicsCard view={economics} />
|
|
301
|
-
<VectorCortexLedgerCard ledger={ledger} />
|
|
192
|
+
<VectorCortexTopologyCard topology={poll.topology} query={poll.query} />
|
|
193
|
+
<VectorCortexShardsCard view={poll.shards} />
|
|
194
|
+
<VectorCortexReconstructCard view={poll.reconstruct} />
|
|
195
|
+
<VectorCortexPlansCard view={poll.plans} />
|
|
196
|
+
<VectorCortexRenderCard view={poll.render} />
|
|
197
|
+
<VectorCortexRolloutCard view={poll.rollout} />
|
|
198
|
+
<VectorCortexClosureCard view={poll.closureProof} />
|
|
199
|
+
<VectorCortexRestoreCard view={poll.restore} />
|
|
200
|
+
<VectorCortexRepairCard view={poll.repair} />
|
|
201
|
+
<VectorCortexCrystalsCard view={poll.crystals} />
|
|
202
|
+
<VectorCortexEconomicsCard view={poll.economics} />
|
|
203
|
+
<VectorCortexLedgerCard ledger={poll.ledger} />
|
|
302
204
|
</div>
|
|
303
205
|
);
|
|
304
206
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useVectorCortexPoll — extracted from VectorCortexTab to keep the tab under
|
|
3
|
+
* the 400-line soft limit. Fetches all vector-cortex reader views in parallel
|
|
4
|
+
* every 5s; each fetch is best-effort (a failure sets its slice to null/state).
|
|
5
|
+
*/
|
|
6
|
+
import { useState, useEffect, useCallback } from "react";
|
|
7
|
+
import {
|
|
8
|
+
fetchVectorCortexEvaluation,
|
|
9
|
+
fetchVectorCortexHealth,
|
|
10
|
+
fetchVectorCortexLedger,
|
|
11
|
+
fetchVectorCortexQuery,
|
|
12
|
+
fetchVectorCortexReconstruct,
|
|
13
|
+
fetchVectorCortexPlans,
|
|
14
|
+
fetchVectorCortexRender,
|
|
15
|
+
fetchVectorCortexRollout,
|
|
16
|
+
fetchVectorCortexClosureProof,
|
|
17
|
+
fetchVectorCortexRestore,
|
|
18
|
+
fetchVectorCortexRepair,
|
|
19
|
+
fetchVectorCortexCrystals,
|
|
20
|
+
fetchVectorCortexEconomics,
|
|
21
|
+
fetchVectorCortexDiagnostics,
|
|
22
|
+
fetchVectorCortexShards,
|
|
23
|
+
fetchVectorCortexTopology,
|
|
24
|
+
type VectorCortexEvaluationSummary,
|
|
25
|
+
type VectorCortexHealthCard,
|
|
26
|
+
type VectorCortexLedgerView,
|
|
27
|
+
type VectorCortexQueryView,
|
|
28
|
+
type VectorCortexReconstructView,
|
|
29
|
+
type VectorCortexPlansView,
|
|
30
|
+
type VectorCortexRenderView,
|
|
31
|
+
type VectorCortexRolloutView,
|
|
32
|
+
type VectorCortexClosureProofView,
|
|
33
|
+
type VectorCortexRestoreView,
|
|
34
|
+
type VectorCortexRepairView,
|
|
35
|
+
type VectorCortexCrystalsView,
|
|
36
|
+
type VectorCortexEconomicsView,
|
|
37
|
+
type VectorCortexDiagnosticsView,
|
|
38
|
+
type VectorCortexShardsView,
|
|
39
|
+
type VectorCortexTopologyView,
|
|
40
|
+
} from "../api/vector-cortex";
|
|
41
|
+
|
|
42
|
+
export interface VectorCortexPollState {
|
|
43
|
+
loading: boolean;
|
|
44
|
+
error: string | null;
|
|
45
|
+
data: VectorCortexEvaluationSummary | null;
|
|
46
|
+
health: VectorCortexHealthCard | null;
|
|
47
|
+
ledger: VectorCortexLedgerView | null;
|
|
48
|
+
topology: VectorCortexTopologyView | null;
|
|
49
|
+
query: VectorCortexQueryView | null;
|
|
50
|
+
shards: VectorCortexShardsView | null;
|
|
51
|
+
reconstruct: VectorCortexReconstructView | null;
|
|
52
|
+
plans: VectorCortexPlansView | null;
|
|
53
|
+
render: VectorCortexRenderView | null;
|
|
54
|
+
rollout: VectorCortexRolloutView | null;
|
|
55
|
+
closureProof: VectorCortexClosureProofView | null;
|
|
56
|
+
restore: VectorCortexRestoreView | null;
|
|
57
|
+
repair: VectorCortexRepairView | null;
|
|
58
|
+
crystals: VectorCortexCrystalsView | null;
|
|
59
|
+
economics: VectorCortexEconomicsView | null;
|
|
60
|
+
diagnostics: VectorCortexDiagnosticsView | null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function useVectorCortexPoll(): [
|
|
64
|
+
VectorCortexPollState,
|
|
65
|
+
() => void,
|
|
66
|
+
] {
|
|
67
|
+
const [state, setState] = useState<VectorCortexPollState>({
|
|
68
|
+
loading: true,
|
|
69
|
+
error: null,
|
|
70
|
+
data: null,
|
|
71
|
+
health: null,
|
|
72
|
+
ledger: null,
|
|
73
|
+
topology: null,
|
|
74
|
+
query: null,
|
|
75
|
+
shards: null,
|
|
76
|
+
reconstruct: null,
|
|
77
|
+
plans: null,
|
|
78
|
+
render: null,
|
|
79
|
+
rollout: null,
|
|
80
|
+
closureProof: null,
|
|
81
|
+
restore: null,
|
|
82
|
+
repair: null,
|
|
83
|
+
crystals: null,
|
|
84
|
+
economics: null,
|
|
85
|
+
diagnostics: null,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
const poll = useCallback(() => {
|
|
89
|
+
setState((prev) => ({ ...prev, loading: true }));
|
|
90
|
+
fetchVectorCortexEvaluation()
|
|
91
|
+
.then((data) => setState((prev) => ({ ...prev, data, loading: false, error: null })))
|
|
92
|
+
.catch((e: unknown) =>
|
|
93
|
+
setState((prev) => ({
|
|
94
|
+
...prev,
|
|
95
|
+
loading: false,
|
|
96
|
+
error: e instanceof Error ? e.message : String(e),
|
|
97
|
+
})),
|
|
98
|
+
);
|
|
99
|
+
fetchVectorCortexHealth().then((health) => setState((p) => ({ ...p, health }))).catch(() => {});
|
|
100
|
+
fetchVectorCortexLedger().then((ledger) => setState((p) => ({ ...p, ledger }))).catch(() => {});
|
|
101
|
+
fetchVectorCortexTopology().then((topology) => setState((p) => ({ ...p, topology }))).catch(() => {});
|
|
102
|
+
fetchVectorCortexQuery().then((query) => setState((p) => ({ ...p, query }))).catch(() => {});
|
|
103
|
+
fetchVectorCortexShards().then((shards) => setState((p) => ({ ...p, shards }))).catch(() => {});
|
|
104
|
+
fetchVectorCortexReconstruct().then((reconstruct) => setState((p) => ({ ...p, reconstruct }))).catch(() => {});
|
|
105
|
+
fetchVectorCortexPlans().then((plans) => setState((p) => ({ ...p, plans }))).catch(() => {});
|
|
106
|
+
fetchVectorCortexRender().then((render) => setState((p) => ({ ...p, render }))).catch(() => {});
|
|
107
|
+
fetchVectorCortexRollout().then((rollout) => setState((p) => ({ ...p, rollout }))).catch(() => {});
|
|
108
|
+
fetchVectorCortexClosureProof().then((closureProof) => setState((p) => ({ ...p, closureProof }))).catch(() => {});
|
|
109
|
+
fetchVectorCortexRestore().then((restore) => setState((p) => ({ ...p, restore }))).catch(() => {});
|
|
110
|
+
fetchVectorCortexRepair().then((repair) => setState((p) => ({ ...p, repair }))).catch(() => {});
|
|
111
|
+
fetchVectorCortexCrystals().then((crystals) => setState((p) => ({ ...p, crystals }))).catch(() => {});
|
|
112
|
+
fetchVectorCortexEconomics().then((economics) => setState((p) => ({ ...p, economics }))).catch(() => {});
|
|
113
|
+
fetchVectorCortexDiagnostics().then((diagnostics) => setState((p) => ({ ...p, diagnostics }))).catch(() => {});
|
|
114
|
+
}, []);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
poll();
|
|
118
|
+
const id = setInterval(poll, 5000);
|
|
119
|
+
return () => clearInterval(id);
|
|
120
|
+
}, [poll]);
|
|
121
|
+
|
|
122
|
+
return [state, poll];
|
|
123
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard-client/src/types/vector-cortex-vc7.ts — VC7-era client view types.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts to keep the parent file under the 300-line
|
|
5
|
+
* soft limit (soft-as-hard gate). Each interface mirrors a reader-only server
|
|
6
|
+
* API contract: counts + codes only, never prompt payloads, digests, or session
|
|
7
|
+
* bytes.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Reader-only frozen-crystal cache view (VC7A). Counts + byte volumes + CRY_*
|
|
12
|
+
* codes only — a crystal is a rendered prompt, so no frozen bytes, covered
|
|
13
|
+
* ranges, digests, or session ids ever reach the client.
|
|
14
|
+
*/
|
|
15
|
+
export interface VectorCortexCrystalsView {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
mode: "A" | "B" | "C";
|
|
18
|
+
crystalCount: number;
|
|
19
|
+
totalBytes: number;
|
|
20
|
+
hits: number;
|
|
21
|
+
misses: number;
|
|
22
|
+
hitBytes: number;
|
|
23
|
+
writes: number;
|
|
24
|
+
duplicateWrites: number;
|
|
25
|
+
collisions: number;
|
|
26
|
+
lastFailure: string | null;
|
|
27
|
+
updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Reader-only cache-economics diagnostics view (VC7B). Counts + ECON_* codes only
|
|
32
|
+
* — never prices, digests, ranges, or session ids.
|
|
33
|
+
*/
|
|
34
|
+
export interface VectorCortexEconomicsView {
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
mode: "A" | "B" | "C";
|
|
37
|
+
profileCount: number;
|
|
38
|
+
provenExclusions: number;
|
|
39
|
+
unprovenExclusions: number;
|
|
40
|
+
lastFailure: string | null;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Reader-only cache miss-diagnostics view (VC7C). One count per EXCLUSIVE miss
|
|
46
|
+
* class plus breaker state and CACHE_* / M5_* codes only — a miss diagnostic would
|
|
47
|
+
* otherwise carry the missed request itself, so no request payload, request
|
|
48
|
+
* digest, covered range, span digest, or session id ever reaches the client.
|
|
49
|
+
*/
|
|
50
|
+
export interface VectorCortexDiagnosticsView {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
mode: "A" | "B" | "C";
|
|
53
|
+
profileMisses: number;
|
|
54
|
+
rangeMisses: number;
|
|
55
|
+
dependencyMisses: number;
|
|
56
|
+
requestMisses: number;
|
|
57
|
+
generationMisses: number;
|
|
58
|
+
unknownMisses: number;
|
|
59
|
+
serveBlocked: number;
|
|
60
|
+
breakerState: string;
|
|
61
|
+
lastFailure: string | null;
|
|
62
|
+
updatedAt: string;
|
|
63
|
+
}
|
|
@@ -256,36 +256,8 @@ export interface VectorCortexClosureProofView {
|
|
|
256
256
|
updatedAt: string;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
export interface VectorCortexCrystalsView {
|
|
265
|
-
enabled: boolean;
|
|
266
|
-
mode: "A" | "B" | "C";
|
|
267
|
-
crystalCount: number;
|
|
268
|
-
totalBytes: number;
|
|
269
|
-
hits: number;
|
|
270
|
-
misses: number;
|
|
271
|
-
hitBytes: number;
|
|
272
|
-
writes: number;
|
|
273
|
-
duplicateWrites: number;
|
|
274
|
-
collisions: number;
|
|
275
|
-
lastFailure: string | null;
|
|
276
|
-
updatedAt: string;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
/**
|
|
280
|
-
* Reader-only cache-economics diagnostics view (VC7B). Counts + ECON_* codes only
|
|
281
|
-
* — never prices, digests, ranges, or session ids.
|
|
282
|
-
*/
|
|
283
|
-
export interface VectorCortexEconomicsView {
|
|
284
|
-
enabled: boolean;
|
|
285
|
-
mode: "A" | "B" | "C";
|
|
286
|
-
profileCount: number;
|
|
287
|
-
provenExclusions: number;
|
|
288
|
-
unprovenExclusions: number;
|
|
289
|
-
lastFailure: string | null;
|
|
290
|
-
updatedAt: string;
|
|
291
|
-
}
|
|
259
|
+
export type {
|
|
260
|
+
VectorCortexCrystalsView,
|
|
261
|
+
VectorCortexEconomicsView,
|
|
262
|
+
VectorCortexDiagnosticsView,
|
|
263
|
+
} from "./vector-cortex-vc7.js";
|
|
@@ -68,6 +68,7 @@ import { handleVectorCortexCrystals } from "./routes-vector-cortex-crystals.js";
|
|
|
68
68
|
// independent of the crystals handler and every file stays well under the
|
|
69
69
|
// 400-line extension soft limit.
|
|
70
70
|
import { handleVectorCortexEconomics } from "./routes-vector-cortex-economics.js";
|
|
71
|
+
// VC7C cache miss diagnostics + breakers handler will be imported here when VC7C ships.
|
|
71
72
|
|
|
72
73
|
/**
|
|
73
74
|
* Dispatch a request through every registered route handler.
|
|
@@ -168,5 +168,11 @@ export const VECTOR_CORTEX_SETTINGS: SettingGroup = {
|
|
|
168
168
|
"Provider cache economics: extends the VC5B provider registry with cache economics (read/write price, TTL, minimum prefix, and a mandatory exclusion fixture id). Answers whether reusing a frozen crystal is actually worth it — a cache WRITE typically costs more than an uncached token, so a cache only pays off once a written prefix is re-read enough times before TTL expiry. Net savings are reported (never clamped at zero, so a losing cache stays visible) and every exclusion MUST name a proving conformance fixture or it is rejected (ECON_EXCLUSION_UNPROVEN). A compiled crystal boundary still reuses the VC7A key unchanged, and a randomized session-level experiment assigns arms by a stable hash so a lost assignment journal re-derives the same arm. OFF = byte-identical predecessor (VC7A); the economics/compiler/experiment arithmetic still runs, only the reporter + dashboard seam is suppressed.",
|
|
169
169
|
true,
|
|
170
170
|
),
|
|
171
|
+
boolDirect(
|
|
172
|
+
"MEGACOMPACT_VC7C",
|
|
173
|
+
"VC7C Cache Diagnostics & Breakers",
|
|
174
|
+
"Cache miss diagnostics + cache-level breakers + the completed M5 request-hash-v2 switch. Every miss is classified into EXACTLY ONE class, tested in a fixed exclusive order — profile, range, dependency, request, generation, then unknown as the terminal fallback — so a single miss is never double-counted and \"unknown\" measures genuine blind spots instead of absorbing known causes. Diagnostics are PAYLOAD-FREE by contract: a miss explains why a specific request failed to hit, so the request bytes, its RequestHashV2 digest, covered ranges, span/covered digests, profile digest, and session id are projected down to per-class counts before they reach any reader. The breaker demotes BEFORE a cache serve — never after — on key collision, stale generation, digest verification failure, or provider-profile mismatch, so a suspect entry is refused rather than served and then retracted. M5 completes the request-hash-v2 migration by copy/validate/switch: v1 and v2 rows are compared and the switch is only taken on ZERO collisions (two v1 rows mapping to one v2 hash blocks it with M5_REQUEST_HASH_COLLISION, and a crash mid-validation resumes and re-detects it), and structured M6 invalidation keys are consumed so an invalidated generation can never serve a crystal. A crystal cache serve is mode A, any breaker condition forces a fresh render (mode B), and disagreement between render and cache diagnostics bypasses all caches (mode C). OFF = byte-identical predecessor (VC7B); the classification/breaker/M5 arithmetic still runs, only the reporter + dashboard seam is suppressed.",
|
|
175
|
+
true,
|
|
176
|
+
),
|
|
171
177
|
],
|
|
172
178
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-mega-compact",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.15",
|
|
4
4
|
"description": "Layered, local, vector-backed context compressor for pi — supersede/collapse/cluster compaction with deduped inline recall.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -218,6 +218,27 @@ export const VC7A_ENABLED = (): boolean => sprintFlag("MEGACOMPACT_VC7A");
|
|
|
218
218
|
*/
|
|
219
219
|
export const VC7B_ENABLED = (): boolean => sprintFlag("MEGACOMPACT_VC7B");
|
|
220
220
|
|
|
221
|
+
/**
|
|
222
|
+
* VC7C — cache miss diagnostics, cache-level breakers and the completed M5
|
|
223
|
+
* request-hash-v2 switch. Default ON. `MEGACOMPACT_VC7C=0` disables and is
|
|
224
|
+
* byte-identical to the predecessor (VC7B): the miss `classify`, the breaker
|
|
225
|
+
* demotion decision and the M5 request-hash-v2 ARITHMETIC STILL RUN (they are
|
|
226
|
+
* PURE — an exclusive ordered comparison over already-computed digests plus a
|
|
227
|
+
* canonical length-prefixed SHA-256, with no clock, storage, or network), so a
|
|
228
|
+
* miss is classified into the SAME single class, a collision / stale generation
|
|
229
|
+
* / digest failure / profile mismatch still demotes BEFORE any cache serve, and
|
|
230
|
+
* the v2 hash of a given request is unchanged with the flag off. A cache is
|
|
231
|
+
* never allowed to serve a stale or colliding entry merely because reporting is
|
|
232
|
+
* off — that would be a correctness change, not a reporting change.
|
|
233
|
+
*
|
|
234
|
+
* The flag gates ONLY the `vector_cortex_cache_miss_classified` /
|
|
235
|
+
* `vector_cortex_cache_serve_blocked` events and the cache-diagnostics dashboard
|
|
236
|
+
* seam, which reports `enabled:false` + mode C when off. This flag MUST also be
|
|
237
|
+
* a dashboard SETTINGS toggle (visible in config UI, never in
|
|
238
|
+
* EXCLUDED_SETTINGS), mirroring VC4A..VC7B.
|
|
239
|
+
*/
|
|
240
|
+
export const VC7C_ENABLED = (): boolean => sprintFlag("MEGACOMPACT_VC7C");
|
|
241
|
+
|
|
221
242
|
// Breaker state machine constants (TRIAD_RESILIENCE.md §breaker) extracted to
|
|
222
243
|
// vector-cortex-breakers.ts to keep this file under the 300-line soft limit.
|
|
223
244
|
export {
|