pi-mega-compact 0.20.56 → 0.20.58
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/repo-corpus.js +20 -0
- package/dist/config/vector-cortex-dash-0a.js +22 -0
- package/dist/config/vector-cortex.js +5 -0
- package/dist/config.js +1 -1
- package/dist/extensions/dashboard-server/api-contracts/endpoints/registry-ext.js +7 -0
- package/dist/extensions/dashboard-server/api-contracts/repo-corpus.js +10 -0
- package/dist/extensions/dashboard-server/route-dispatch.js +3 -1
- package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +2 -0
- package/dist/extensions/dashboard-server/routes-repo-corpus.js +258 -0
- package/dist/extensions/dashboard-server/routes.js +1 -0
- package/dist/src/config/repo-corpus.js +20 -0
- package/dist/src/config/vector-cortex-dash-0a.js +22 -0
- package/dist/src/config/vector-cortex.js +5 -0
- package/dist/src/config.js +1 -1
- package/extensions/dashboard-client/dist/assets/{AreaChart-DlndN0p2.js → AreaChart-CtJ6dSMT.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-DlndN0p2.js.map → AreaChart-CtJ6dSMT.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-DH6rZ60s.js → BarChart-DJ3j3xDz.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-DH6rZ60s.js.map → BarChart-DJ3j3xDz.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-Qj_NYKw3.js → CacheTab-CXU1_9lR.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-Qj_NYKw3.js.map → CacheTab-CXU1_9lR.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-3QlIPMFj.js → EventsTab-DF-Q3o7x.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-3QlIPMFj.js.map → EventsTab-DF-Q3o7x.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-DTwitpIb.js → HealthTab-Dr1HGOkl.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-DTwitpIb.js.map → HealthTab-Dr1HGOkl.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DkVlBnp7.js → MaintenanceTab-zKhR18_s.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-DkVlBnp7.js.map → MaintenanceTab-zKhR18_s.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-B-pHH85r.js → MemoryMapTab-DekIzfn2.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-B-pHH85r.js.map → MemoryMapTab-DekIzfn2.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-C8VpwhJN.js → MetricsTab-CEKajY38.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-C8VpwhJN.js.map → MetricsTab-CEKajY38.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-C_JZlM_Q.js → OverviewTab-24sG8xiE.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-C_JZlM_Q.js.map → OverviewTab-24sG8xiE.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-rRMlub-E.js → ReposTab-70gkV8l9.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-rRMlub-E.js.map → ReposTab-70gkV8l9.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CL6S094G.js → SessionsTab-B3quvYPZ.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CL6S094G.js.map → SessionsTab-B3quvYPZ.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/SetupTab-tbPrrfYx.js +3 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-tbPrrfYx.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-B-8NCvzd.js → TimeSavedCard-B6mdtCWE.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-B-8NCvzd.js.map → TimeSavedCard-B6mdtCWE.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-C2MVgG4N.js → TurnsTab-CmhRJJqr.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-C2MVgG4N.js.map → TurnsTab-CmhRJJqr.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-CvlS_fvh.js → VcStatusBadge-SDThp0R0.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VcStatusBadge-CvlS_fvh.js.map → VcStatusBadge-SDThp0R0.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BXCAzwQm.js → VectorCortexTab-DDjCkTjk.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BXCAzwQm.js.map → VectorCortexTab-DDjCkTjk.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{WikiTab-DUivYmJ5.js → WikiTab-Cki48_8N.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-DUivYmJ5.js.map → WikiTab-Cki48_8N.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-dTpuinxr.js → button-CojFYd7q.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-dTpuinxr.js.map → button-CojFYd7q.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-DNwZ7dSg.js → card-Cxeeje9o.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-DNwZ7dSg.js.map → card-Cxeeje9o.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{client-extra-CQuCpjyO.js → client-extra-DLxyGxW8.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{client-extra-CQuCpjyO.js.map → client-extra-DLxyGxW8.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D1HV4d79.js → generateCategoricalChart-DRlqBks2.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D1HV4d79.js.map → generateCategoricalChart-DRlqBks2.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-Bi5YNsLx.js → index-CkbdlPBm.js} +14 -14
- package/extensions/dashboard-client/dist/assets/index-CkbdlPBm.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{switch-DiKc2q4n.js → switch-Cx_nl-Ba.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-DiKc2q4n.js.map → switch-Cx_nl-Ba.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-BBYD10JO.js → toggle-CfIFzp6P.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-BBYD10JO.js.map → toggle-CfIFzp6P.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-CWUSDhIb.js → useSSE-B9_N7ccG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-CWUSDhIb.js.map → useSSE-B9_N7ccG.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +1 -1
- package/extensions/dashboard-client/src/dash-consolidation/plan.ts +200 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexSetup.tsx +2 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/VectorCortexRepoCorpusCard.tsx +126 -0
- package/extensions/dashboard-client/src/types/repo-corpus.ts +25 -0
- package/extensions/dashboard-server/api-contracts/endpoints/registry-ext.ts +11 -0
- package/extensions/dashboard-server/api-contracts/index.ts +12 -0
- package/extensions/dashboard-server/api-contracts/repo-corpus.ts +76 -0
- package/extensions/dashboard-server/route-dispatch.ts +2 -0
- package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +12 -0
- package/extensions/dashboard-server/routes-repo-corpus.ts +286 -0
- package/extensions/dashboard-server/routes.ts +1 -0
- package/extensions/mega-runtime/widget-types.ts +2 -1
- package/package.json +1 -1
- package/src/config/repo-corpus.ts +23 -0
- package/src/config/vector-cortex-dash-0a.ts +24 -0
- package/src/config/vector-cortex.ts +5 -0
- package/src/config.ts +2 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-C6b8YuBK.js +0 -3
- package/extensions/dashboard-client/dist/assets/SetupTab-C6b8YuBK.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/index-Bi5YNsLx.js.map +0 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dash-consolidation/plan.ts — DASH-0a typed merge plan for the dashboard.
|
|
3
|
+
*
|
|
4
|
+
* Contract-planning only: this module records, as concrete data structures, the
|
|
5
|
+
* collapse of the 13 current dashboard TabIds onto the fixed 7 navigational
|
|
6
|
+
* surfaces (Overview, Sessions, Cache+Performance, Memory Graph, Diagnostics,
|
|
7
|
+
* Setup, Admin). The shell (App.tsx), the lazy list, and every tab/section
|
|
8
|
+
* component are untouched by this sprint — DASH-0b/0c consume this plan to
|
|
9
|
+
* move components, DASH-0d wires deep links + a11y hooks against it.
|
|
10
|
+
*
|
|
11
|
+
* All constants are `readonly`; no `any`. Imports only the TabId union (never
|
|
12
|
+
* redefined locally) so the plan can never drift from the live registry.
|
|
13
|
+
*/
|
|
14
|
+
import type { TabId } from "../tabs/registry";
|
|
15
|
+
|
|
16
|
+
/** The fixed 7 dashboard navigation surfaces. */
|
|
17
|
+
export type DASHSurface =
|
|
18
|
+
| "overview"
|
|
19
|
+
| "sessions"
|
|
20
|
+
| "cache-perf"
|
|
21
|
+
| "memory-graph"
|
|
22
|
+
| "diagnostics"
|
|
23
|
+
| "setup"
|
|
24
|
+
| "admin";
|
|
25
|
+
|
|
26
|
+
/** A source TabId the plan records as kept-but-not-a-surface (legacy section). */
|
|
27
|
+
export interface LegacySection {
|
|
28
|
+
id: TabId | "topics" | "achievements" | "game";
|
|
29
|
+
disposition: "keep_but_listed_under";
|
|
30
|
+
keep_but_listed_under: DASHSurface;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** One row of the per-surface merge plan. */
|
|
34
|
+
export interface DashSurfacePlan {
|
|
35
|
+
surface: DASHSurface;
|
|
36
|
+
label: string;
|
|
37
|
+
/** Current top-level TabIds folded into this surface. */
|
|
38
|
+
sources: readonly TabId[];
|
|
39
|
+
/** Delegate component/card ids that land on this surface. */
|
|
40
|
+
mergedCardIds: readonly string[];
|
|
41
|
+
/** Setup-only: the existent SetupTab SUB_TABS member ids (under setup, NOT admin). */
|
|
42
|
+
setup_subtabs?: readonly string[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The 7-surface merge plan keyed by surface id. */
|
|
46
|
+
export const DASH_TAB_PLAN: readonly DashSurfacePlan[] = [
|
|
47
|
+
{
|
|
48
|
+
surface: "overview",
|
|
49
|
+
label: "Overview",
|
|
50
|
+
sources: ["overview"],
|
|
51
|
+
mergedCardIds: [],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
surface: "sessions",
|
|
55
|
+
label: "Sessions",
|
|
56
|
+
sources: ["sessions", "turns"],
|
|
57
|
+
mergedCardIds: [],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
surface: "cache-perf",
|
|
61
|
+
label: "Cache + Performance",
|
|
62
|
+
sources: ["cache", "metrics"],
|
|
63
|
+
mergedCardIds: [],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
surface: "memory-graph",
|
|
67
|
+
label: "Memory Graph",
|
|
68
|
+
sources: ["memory-map", "repos", "wiki"],
|
|
69
|
+
mergedCardIds: [
|
|
70
|
+
"MemoryMapView",
|
|
71
|
+
"RaptorTreeView",
|
|
72
|
+
"WikiPage",
|
|
73
|
+
"WikiPageControls",
|
|
74
|
+
"TopicTimeline",
|
|
75
|
+
"TopicEvolutionView",
|
|
76
|
+
"TopicEvolutionGraph",
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
surface: "diagnostics",
|
|
81
|
+
label: "Diagnostics",
|
|
82
|
+
sources: ["vector-cortex", "events", "health"],
|
|
83
|
+
mergedCardIds: [
|
|
84
|
+
"VectorCortexDiagnosticsCard",
|
|
85
|
+
"VectorCortexClosureCard",
|
|
86
|
+
"VectorCortexCrystalsCard",
|
|
87
|
+
"VectorCortexEconomicsCard",
|
|
88
|
+
"VectorCortexLedgerCard",
|
|
89
|
+
"VectorCortexOutcomesCard",
|
|
90
|
+
"VectorCortexPlansCard",
|
|
91
|
+
"VectorCortexPlatformCard",
|
|
92
|
+
"VectorCortexPolicyCard",
|
|
93
|
+
"VectorCortexRenderCard",
|
|
94
|
+
"VectorCortexRepairCard",
|
|
95
|
+
"VectorCortexRestoreCard",
|
|
96
|
+
"VectorCortexRolloutCard",
|
|
97
|
+
"VectorCortexShardsCard",
|
|
98
|
+
"VectorCortexTopologyCard",
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
surface: "setup",
|
|
103
|
+
label: "Setup",
|
|
104
|
+
sources: ["setup"],
|
|
105
|
+
mergedCardIds: [
|
|
106
|
+
"SettingsPanel",
|
|
107
|
+
"SettingsSection",
|
|
108
|
+
"ThresholdsPanel",
|
|
109
|
+
"CortexSetup",
|
|
110
|
+
"EmbedderSetup",
|
|
111
|
+
"CortexActionsCard",
|
|
112
|
+
"CortexBlockersCard",
|
|
113
|
+
"CortexEncoderCard",
|
|
114
|
+
"CortexRuntimeCard",
|
|
115
|
+
"EmbedderHealthCard",
|
|
116
|
+
"RagHealthCard",
|
|
117
|
+
"CustomEndpointSection",
|
|
118
|
+
"VectorCortexCosineFpCard",
|
|
119
|
+
"VectorCortexRepoCorpusCard",
|
|
120
|
+
],
|
|
121
|
+
// The existent SetupTab SUB_TABS member — recorded under Setup, NOT admin.
|
|
122
|
+
setup_subtabs: ["config"],
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
surface: "admin",
|
|
126
|
+
label: "Admin",
|
|
127
|
+
sources: ["maintenance"],
|
|
128
|
+
mergedCardIds: [
|
|
129
|
+
"ActionsCard",
|
|
130
|
+
"DbStatsCard",
|
|
131
|
+
"DebugBundleCard",
|
|
132
|
+
"HealthMitigationCard",
|
|
133
|
+
"SchemaHealthCard",
|
|
134
|
+
],
|
|
135
|
+
},
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
/** Exactly 7 fixed surfaces. */
|
|
139
|
+
export const DASH_TAB_COUNT = 7;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Legacy sections rendered today that are kept-but-folded under a surface.
|
|
143
|
+
* One explicit bucket per non-surface tab/section so the audit stays total.
|
|
144
|
+
*/
|
|
145
|
+
export const DASH_LEGACY_SECTIONS: readonly LegacySection[] = [
|
|
146
|
+
{ id: "topics", disposition: "keep_but_listed_under", keep_but_listed_under: "admin" },
|
|
147
|
+
{ id: "achievements", disposition: "keep_but_listed_under", keep_but_listed_under: "admin" },
|
|
148
|
+
{ id: "game", disposition: "keep_but_listed_under", keep_but_listed_under: "admin" },
|
|
149
|
+
];
|
|
150
|
+
|
|
151
|
+
/** Old route -> new { surface, sub-tab hint } map, one entry per current TabId.
|
|
152
|
+
* Feeds the DASH-0d hash router; does not change App.tsx routing this sprint. */
|
|
153
|
+
export const DEEP_LINK_TARGETS: Readonly<Record<TabId, { surface: DASHSurface; subTabHint: string }>> = {
|
|
154
|
+
overview: { surface: "overview", subTabHint: "overview" },
|
|
155
|
+
sessions: { surface: "sessions", subTabHint: "session-list" },
|
|
156
|
+
turns: { surface: "sessions", subTabHint: "turn-list" },
|
|
157
|
+
cache: { surface: "cache-perf", subTabHint: "cache-cards" },
|
|
158
|
+
metrics: { surface: "cache-perf", subTabHint: "perf-cards" },
|
|
159
|
+
"memory-map": { surface: "memory-graph", subTabHint: "memory-map" },
|
|
160
|
+
repos: { surface: "memory-graph", subTabHint: "repo-list" },
|
|
161
|
+
wiki: { surface: "memory-graph", subTabHint: "wiki" },
|
|
162
|
+
"vector-cortex": { surface: "diagnostics", subTabHint: "cortex" },
|
|
163
|
+
events: { surface: "diagnostics", subTabHint: "event-log" },
|
|
164
|
+
health: { surface: "diagnostics", subTabHint: "health" },
|
|
165
|
+
setup: { surface: "setup", subTabHint: "settings" },
|
|
166
|
+
maintenance: { surface: "admin", subTabHint: "maintenance" },
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
/** One a11y landmark row per fixed surface (DASH-0d axe-hook contract).
|
|
170
|
+
* No ARIA markup is emitted this sprint — this constant IS the contract. */
|
|
171
|
+
export interface NavMapRow {
|
|
172
|
+
surface: DASHSurface;
|
|
173
|
+
navLabel: string;
|
|
174
|
+
subNavLabel: string | null;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export const DASH_NAV_MAP: readonly NavMapRow[] = [
|
|
178
|
+
{ surface: "overview", navLabel: "Overview", subNavLabel: null },
|
|
179
|
+
{ surface: "sessions", navLabel: "Session windows", subNavLabel: "Session turns" },
|
|
180
|
+
{ surface: "cache-perf", navLabel: "Performance cards", subNavLabel: "Cache status" },
|
|
181
|
+
{ surface: "memory-graph", navLabel: "Memory graph", subNavLabel: "Wiki + repos" },
|
|
182
|
+
{ surface: "diagnostics", navLabel: "Diagnostics groups", subNavLabel: "Event + health" },
|
|
183
|
+
{ surface: "setup", navLabel: "Setup", subNavLabel: "Sub-tabs" },
|
|
184
|
+
{ surface: "admin", navLabel: "Admin", subNavLabel: "Maintenance" },
|
|
185
|
+
];
|
|
186
|
+
|
|
187
|
+
/** Per-surface responsive plan: column strategy + sub-tab toggle collapse.
|
|
188
|
+
* All grids stay `grid-cols-1 md:grid-cols-3`, matching existent card grids;
|
|
189
|
+
* below `sm` sub-tab toggles collapse to a horizontal scroll region. */
|
|
190
|
+
export interface ResponsivePlan {
|
|
191
|
+
surface: DASHSurface;
|
|
192
|
+
grid: "grid-cols-1 md:grid-cols-3";
|
|
193
|
+
subTabCollapseBelow: "sm";
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export const DASH_RESPONSIVE: readonly ResponsivePlan[] = DASH_TAB_PLAN.map((p) => ({
|
|
197
|
+
surface: p.surface,
|
|
198
|
+
grid: "grid-cols-1 md:grid-cols-3",
|
|
199
|
+
subTabCollapseBelow: "sm",
|
|
200
|
+
}));
|
|
@@ -16,6 +16,7 @@ import { CortexBlockersCard } from "./CortexBlockersCard";
|
|
|
16
16
|
import { CortexActionsCard } from "./CortexActionsCard";
|
|
17
17
|
import CortexRuntimeCard from "./CortexRuntimeCard";
|
|
18
18
|
import { VectorCortexCosineFpCard } from "./VectorCortexCosineFpCard";
|
|
19
|
+
import { VectorCortexRepoCorpusCard } from "./VectorCortexRepoCorpusCard";
|
|
19
20
|
import { styles } from "./CortexSetupStyles";
|
|
20
21
|
|
|
21
22
|
export default function CortexSetup(): React.ReactElement {
|
|
@@ -43,6 +44,7 @@ export default function CortexSetup(): React.ReactElement {
|
|
|
43
44
|
<CortexEncoderCard data={state.data} error={state.error} />
|
|
44
45
|
<CortexRuntimeCard />
|
|
45
46
|
<VectorCortexCosineFpCard />
|
|
47
|
+
<VectorCortexRepoCorpusCard />
|
|
46
48
|
<CortexBlockersCard
|
|
47
49
|
blockers={state.data?.blockers ?? []}
|
|
48
50
|
highlight={highlight}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SetupTab/VectorCortexRepoCorpusCard.tsx — REPO-A cross-repo corpus consent
|
|
3
|
+
* status card.
|
|
4
|
+
*
|
|
5
|
+
* Reader-only card on the Setup Cortex sub-tab. Polls GET /api/repo-corpus and
|
|
6
|
+
* shows each pseudonymous repo's consent state + cross-repo overlap + total
|
|
7
|
+
* events. It NEVER submits consent — consent is CLI/ops-only (consent.mjs,
|
|
8
|
+
* append-only). The endpoint 404s on flag-off (MEGACOMPACT_REPO_CORPUS=0): the
|
|
9
|
+
* card renders an honest "disabled" state matching deriveVcStatus off. Counts +
|
|
10
|
+
* IDs + status only — never payload content (EVAL-REDACT-002).
|
|
11
|
+
*
|
|
12
|
+
* PREVENT-PI-004: relative-path fetch to the same-origin dashboard server.
|
|
13
|
+
*/
|
|
14
|
+
import type React from "react";
|
|
15
|
+
import { useMemo } from "react";
|
|
16
|
+
import { useApi } from "../../hooks/useApi";
|
|
17
|
+
import { getJson, ApiError } from "../../api/client-http";
|
|
18
|
+
import type { RepoCorpusStatusV1 } from "@contracts";
|
|
19
|
+
|
|
20
|
+
const styles: Record<string, React.CSSProperties> = {
|
|
21
|
+
section: {
|
|
22
|
+
background: "#1a1a2e",
|
|
23
|
+
borderRadius: "8px",
|
|
24
|
+
padding: "1rem",
|
|
25
|
+
marginBottom: "1rem",
|
|
26
|
+
border: "1px solid #2a2a4e",
|
|
27
|
+
},
|
|
28
|
+
sectionTitle: {
|
|
29
|
+
fontSize: "1.1rem",
|
|
30
|
+
fontWeight: 700,
|
|
31
|
+
marginTop: 0,
|
|
32
|
+
marginBottom: "0.25rem",
|
|
33
|
+
color: "#e0e0e0",
|
|
34
|
+
},
|
|
35
|
+
subtitle: {
|
|
36
|
+
fontSize: "0.85rem",
|
|
37
|
+
color: "#a0a0c0",
|
|
38
|
+
marginTop: 0,
|
|
39
|
+
marginBottom: "0.75rem",
|
|
40
|
+
},
|
|
41
|
+
row: { marginBottom: "0.4rem", fontSize: "0.9rem" },
|
|
42
|
+
label: { fontWeight: 600, color: "#a0a0c0", marginRight: "0.5rem" },
|
|
43
|
+
value: { color: "#e0e0e0" },
|
|
44
|
+
disabled: {
|
|
45
|
+
background: "#1a1a2e",
|
|
46
|
+
border: "1px solid #2a2a4e",
|
|
47
|
+
borderRadius: "8px",
|
|
48
|
+
padding: "1rem",
|
|
49
|
+
marginBottom: "1rem",
|
|
50
|
+
color: "#a0a0c0",
|
|
51
|
+
fontSize: "0.85rem",
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const VectorCortexRepoCorpusCard: React.FC = () => {
|
|
56
|
+
const { data, error, loading } = useApi<RepoCorpusStatusV1 | null>(
|
|
57
|
+
useMemo(
|
|
58
|
+
() => () =>
|
|
59
|
+
getJson<RepoCorpusStatusV1>("/api/repo-corpus").catch((e: unknown) => {
|
|
60
|
+
// 404 = flag-off: surface to the renderer as disabled.
|
|
61
|
+
if (e instanceof ApiError && e.status === 404) return null;
|
|
62
|
+
throw e;
|
|
63
|
+
}),
|
|
64
|
+
[],
|
|
65
|
+
),
|
|
66
|
+
{ pollInterval: 5000 },
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
if (data === null && !error && !loading) {
|
|
70
|
+
return (
|
|
71
|
+
<div style={styles.disabled}>
|
|
72
|
+
Cross-repo corpus: disabled (MEGACOMPACT_REPO_CORPUS=0).
|
|
73
|
+
</div>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<div style={styles.section}>
|
|
79
|
+
<h3 style={styles.sectionTitle}>Cross-Repo Corpus</h3>
|
|
80
|
+
<p style={styles.subtitle}>
|
|
81
|
+
Pseudonymous consent status across donated repos
|
|
82
|
+
</p>
|
|
83
|
+
{error !== null ? (
|
|
84
|
+
<p style={{ color: "#f44336", fontSize: "0.85rem" }}>
|
|
85
|
+
Error loading corpus: {error.message}
|
|
86
|
+
</p>
|
|
87
|
+
) : data === null ? (
|
|
88
|
+
<div style={styles.value}>Loading…</div>
|
|
89
|
+
) : (
|
|
90
|
+
<div>
|
|
91
|
+
<div style={styles.row}>
|
|
92
|
+
<span style={styles.label}>Status:</span>
|
|
93
|
+
<span style={styles.value}>{data.status}</span>
|
|
94
|
+
</div>
|
|
95
|
+
<div style={styles.row}>
|
|
96
|
+
<span style={styles.label}>Total events:</span>
|
|
97
|
+
<span style={styles.value}>{data.totalEvents}</span>
|
|
98
|
+
</div>
|
|
99
|
+
<div style={styles.row}>
|
|
100
|
+
<span style={styles.label}>Overlap pairs:</span>
|
|
101
|
+
<span style={styles.value}>
|
|
102
|
+
{data.corpus ? data.corpus.overlaps.length : 0}
|
|
103
|
+
</span>
|
|
104
|
+
</div>
|
|
105
|
+
<div style={{ marginTop: "0.5rem" }}>
|
|
106
|
+
{(data.perRepo ?? []).map((r) => (
|
|
107
|
+
<div key={r.repoPseudonym} style={styles.row}>
|
|
108
|
+
<span style={styles.label}>
|
|
109
|
+
{r.repoPseudonym.slice(0, 8)}:
|
|
110
|
+
</span>
|
|
111
|
+
<span style={styles.value}>
|
|
112
|
+
{r.sessions} sessions ·{" "}
|
|
113
|
+
{r.consentedCrossRepo
|
|
114
|
+
? r.revokedAt
|
|
115
|
+
? `revoked ${r.revokedAt}`
|
|
116
|
+
: "consented"
|
|
117
|
+
: "not consented"}
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
))}
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
124
|
+
</div>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard-client/src/types/repo-corpus.ts — REPO-A client view types.
|
|
3
|
+
*
|
|
4
|
+
* Reader-only consent status card view. The live API payload is the server
|
|
5
|
+
* contract RepoCorpusStatusV1 (imported via @contracts); these types shape the
|
|
6
|
+
* card's rendering of one repo's consent state — counts + IDs + status only,
|
|
7
|
+
* never payload content (EVAL-REDACT-002).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** One repo's consent status row rendered by the card. */
|
|
11
|
+
export interface RepoCorpusCardRow {
|
|
12
|
+
readonly repoPseudonym: string;
|
|
13
|
+
readonly sessions: number;
|
|
14
|
+
readonly consentedCrossRepo: boolean;
|
|
15
|
+
readonly revokedAt?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Card-level rendering state derived from the live status. */
|
|
19
|
+
export interface RepoCorpusCardView {
|
|
20
|
+
readonly present: boolean; // a corpus manifest exists
|
|
21
|
+
readonly totalEvents: number;
|
|
22
|
+
readonly repos: readonly RepoCorpusCardRow[];
|
|
23
|
+
readonly overlapCount: number;
|
|
24
|
+
readonly status: string; // live / awaiting_data / off — never empty
|
|
25
|
+
}
|
|
@@ -32,6 +32,7 @@ import type {
|
|
|
32
32
|
} from "../cortex-improve.js";
|
|
33
33
|
import type { DedupTierAttributionResponse } from "../dedup-attribution.js";
|
|
34
34
|
import type { CosineFpReportV1 } from "../cosine-fp.js";
|
|
35
|
+
import type { RepoCorpusStatusV1 } from "../repo-corpus.js";
|
|
35
36
|
|
|
36
37
|
/** Additive endpoint entries spread into the ENDPOINTS registry. */
|
|
37
38
|
export const EXTRA_ENDPOINTS = {
|
|
@@ -180,4 +181,14 @@ export const EXTRA_ENDPOINTS = {
|
|
|
180
181
|
description:
|
|
181
182
|
"Reader-only cosine-FP report (COS-FP-A): the last written synthetic bench aggregate — grid summary, per-content-type FP/FN/F1, recommended default, report digest. Counts + fractions + digests only, never template text. Missing report → awaiting_data; flag-off returns 404.",
|
|
182
183
|
} as const satisfies EndpointDef<"GET", undefined, CosineFpReportV1>,
|
|
184
|
+
|
|
185
|
+
// ─── REPO-A cross-repo corpus ──────────────────────────────────────
|
|
186
|
+
|
|
187
|
+
/** GET /api/repo-corpus — reader-only pseudonymous corpus status. */
|
|
188
|
+
repoCorpus: {
|
|
189
|
+
method: "GET",
|
|
190
|
+
path: "/api/repo-corpus",
|
|
191
|
+
description:
|
|
192
|
+
"Reader-only cross-repo corpus status (REPO-A): which pseudonymous repos/sessions are in the consented corpus, cross-repo overlap descriptors, and per-repo active-consent state. Counts + IDs + status only — never payload content. Flag-off returns 404; absent corpus returns awaiting_data.",
|
|
193
|
+
} as const satisfies EndpointDef<"GET", undefined, RepoCorpusStatusV1>,
|
|
183
194
|
} as const;
|
|
@@ -357,3 +357,15 @@ export type {
|
|
|
357
357
|
CosineFpOverrides,
|
|
358
358
|
CosineFpReportV1,
|
|
359
359
|
} from "./cosine-fp.js";
|
|
360
|
+
|
|
361
|
+
// REPO-A — cross-repo corpus status (reader-only)
|
|
362
|
+
export type {
|
|
363
|
+
RepoCorpusStatus,
|
|
364
|
+
RepoCorpusRepoV1,
|
|
365
|
+
RepoCorpusOverlapV1,
|
|
366
|
+
RepoCorpusManifestV1,
|
|
367
|
+
RepoCorpusConsentStateV1,
|
|
368
|
+
RepoCorpusConsentRowV1,
|
|
369
|
+
RepoCorpusPerRepoStatusV1,
|
|
370
|
+
RepoCorpusStatusV1,
|
|
371
|
+
} from "./repo-corpus.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/repo-corpus.ts — REPO-A cross-repo corpus API contract.
|
|
3
|
+
*
|
|
4
|
+
* Reader-only shapes for GET /api/repo-corpus. The corpus manifest is written by
|
|
5
|
+
* the CLI corpus-builder (scripts/repo-corpus/build.mjs) as a PSEUDONYMOUS
|
|
6
|
+
* artifact — repo IDs/counts/digests/cross-repo-overlap descriptors only, never
|
|
7
|
+
* payload content (EVAL-REDACT-002). The canonicalRemote→pseudonym mapping is a
|
|
8
|
+
* pure in-memory function and never leaves the builder. No `any`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/** Derived endpoint status (from vc-status.ts). */
|
|
12
|
+
export type RepoCorpusStatus =
|
|
13
|
+
| "live"
|
|
14
|
+
| "awaiting_data"
|
|
15
|
+
| "deferred"
|
|
16
|
+
| "structural"
|
|
17
|
+
| "off";
|
|
18
|
+
|
|
19
|
+
/** One pseudonymous repo in the corpus manifest. */
|
|
20
|
+
export interface RepoCorpusRepoV1 {
|
|
21
|
+
readonly repoPseudonym: string;
|
|
22
|
+
readonly sessions: number;
|
|
23
|
+
readonly sessionIds: readonly string[];
|
|
24
|
+
readonly events: number;
|
|
25
|
+
/** SHA-256 over the repo's session-id slice + count (content-free). */
|
|
26
|
+
readonly digest: string;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** A recorded cross-repo session overlap descriptor (IDs only, never text). */
|
|
30
|
+
export interface RepoCorpusOverlapV1 {
|
|
31
|
+
readonly repoA: string;
|
|
32
|
+
readonly repoB: string;
|
|
33
|
+
readonly sharedSessions: number;
|
|
34
|
+
readonly sharedIds: readonly string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The corpus manifest the builder emits (pseudonymous). */
|
|
38
|
+
export interface RepoCorpusManifestV1 {
|
|
39
|
+
readonly schema: "repo-corpus-manifest-v1";
|
|
40
|
+
readonly ownerPseudonym: string;
|
|
41
|
+
readonly datasetVersion: string;
|
|
42
|
+
readonly effectiveSeq: number;
|
|
43
|
+
readonly totalEvents: number;
|
|
44
|
+
readonly repos: readonly RepoCorpusRepoV1[];
|
|
45
|
+
readonly overlaps: readonly RepoCorpusOverlapV1[];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** Per-repo consent state projection used by the reader route (pseudonymous). */
|
|
49
|
+
export interface RepoCorpusConsentStateV1 {
|
|
50
|
+
readonly schema: "repo-corpus-consent-state-v1";
|
|
51
|
+
readonly perRepo: readonly RepoCorpusConsentRowV1[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** One repo's consent row (never payload content). */
|
|
55
|
+
export interface RepoCorpusConsentRowV1 {
|
|
56
|
+
readonly repoPseudonym: string;
|
|
57
|
+
readonly consentedCrossRepo: boolean;
|
|
58
|
+
readonly revokedAt?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Per-repo status row in RepoCorpusStatusV1. */
|
|
62
|
+
export interface RepoCorpusPerRepoStatusV1 {
|
|
63
|
+
readonly repoPseudonym: string;
|
|
64
|
+
readonly sessions: number;
|
|
65
|
+
readonly consentedCrossRepo: boolean;
|
|
66
|
+
readonly revokedAt?: string;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/** Response body for GET /api/repo-corpus. */
|
|
70
|
+
export interface RepoCorpusStatusV1 {
|
|
71
|
+
readonly schema: "repo-corpus-status-v1";
|
|
72
|
+
readonly corpus: RepoCorpusManifestV1 | null;
|
|
73
|
+
readonly perRepo: readonly RepoCorpusPerRepoStatusV1[];
|
|
74
|
+
readonly totalEvents: number;
|
|
75
|
+
readonly status: RepoCorpusStatus;
|
|
76
|
+
}
|
|
@@ -64,6 +64,7 @@ import {
|
|
|
64
64
|
handleImproveCortexStatus,
|
|
65
65
|
handleDedupTierAttribution,
|
|
66
66
|
handleCosineFpReport,
|
|
67
|
+
handleRepoCorpus,
|
|
67
68
|
} from "./routes.js";
|
|
68
69
|
// VC6C repair lives in its own module (routes-vector-cortex-repair.ts) so the
|
|
69
70
|
// heal route file stays well under the 400-line extension soft limit.
|
|
@@ -162,5 +163,6 @@ export function dispatchRoutes(
|
|
|
162
163
|
if (handleImproveCortexStatus(req, res, ctx)) return true;
|
|
163
164
|
if (handleDedupTierAttribution(req, res, ctx)) return true;
|
|
164
165
|
if (handleCosineFpReport(req, res, ctx)) return true;
|
|
166
|
+
if (handleRepoCorpus(req, res, ctx)) return true;
|
|
165
167
|
return false;
|
|
166
168
|
}
|
|
@@ -324,5 +324,17 @@ export const VECTOR_CORTEX_SETTINGS: SettingGroup = {
|
|
|
324
324
|
"Real-corpus L2 cosine FP validation (COS-FP-R): runs the real-corpus grid sweep (scripts/cosine-fp/real-bench.mjs) against donated, consent-approved sessions only (SECURITY_PRIVACY Lifecycle/Consent), scoring FP/FN with Wilson intervals + session-grouped bootstrap, and appends CI-backed per-content-type recommendations to the cosine-threshold report. Runs only when a valid consented corpus exists; absent corpus = no_corpus (normative pre-donation state, nothing written). OFF = script inert, nothing executes, no writes (byte-identical predecessor).",
|
|
325
325
|
true,
|
|
326
326
|
),
|
|
327
|
+
boolDirect(
|
|
328
|
+
"MEGACOMPACT_REPO_CORPUS",
|
|
329
|
+
"Cross-Repo Corpus (REPO-A)",
|
|
330
|
+
"Cross-repo corpus preparation (REPO-A): the governed, consent-gated reader-only path that builds a pseudonymous corpus manifest from per-repo events.log slices and serves GET /api/repo-corpus answering which pseudonymous repos/sessions are in the corpus, what cross-repo overlap exists, and whether consent is active for each — counts + IDs + status only, never payload content. Consent is append-only (consent.mjs, CLI/ops-only); revocation freezes the builder + route. OFF = builder refuses to run, reader route 404s, single-repo recall untouched (byte-identical predecessor).",
|
|
331
|
+
true,
|
|
332
|
+
),
|
|
333
|
+
boolDirect(
|
|
334
|
+
"MEGACOMPACT_DASH_0A",
|
|
335
|
+
"Dashboard Consolidation — Tab Plan",
|
|
336
|
+
"DASH-0a dashboard tab-audit + consolidation merge plan: records (as typed constants) the collapse of the 13 current TabIds onto the fixed 7 navigational surfaces (Overview, Sessions, Cache+Performance, Memory Graph, Diagnostics, Setup, Admin), plus the deep-link map, a11y nav-map, and responsive plan. Contract-planning only — no component moves, no route change. OFF = the plan module is inert (never imported by the shell); all 13 tab/section top-level files render exactly as today (byte-identical predecessor).",
|
|
337
|
+
true,
|
|
338
|
+
),
|
|
327
339
|
],
|
|
328
340
|
};
|