pi-mega-compact 0.20.26 → 0.20.28
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-vc9a.js +29 -0
- package/dist/config/vector-cortex-vc9b.js +29 -0
- package/dist/config/vector-cortex-vc9c.js +34 -0
- package/dist/config/vector-cortex.js +4 -0
- package/dist/config.js +1 -1
- package/dist/extensions/dashboard-server/api-contracts/endpoints/registry-ext.js +20 -0
- package/dist/extensions/dashboard-server/api-contracts/setup-cortex.js +13 -0
- package/dist/extensions/dashboard-server/route-dispatch.js +7 -1
- package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +3 -0
- package/dist/extensions/dashboard-server/routes-setup-cortex-actions.js +116 -0
- package/dist/extensions/dashboard-server/routes-setup-cortex.js +143 -0
- package/dist/extensions/dashboard-server/routes.js +2 -0
- package/dist/extensions/dashboard-server/setup-cortex-actions.js +213 -0
- package/dist/extensions/dashboard-server/setup-cortex-blockers.js +70 -0
- package/dist/src/config/vector-cortex-vc9a.js +29 -0
- package/dist/src/config/vector-cortex-vc9b.js +29 -0
- package/dist/src/config/vector-cortex-vc9c.js +34 -0
- package/dist/src/config/vector-cortex.js +4 -0
- package/dist/src/config.js +1 -1
- package/extensions/dashboard-client/dist/assets/{AreaChart-DRErPez1.js → AreaChart-DIKsPqLG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{AreaChart-DRErPez1.js.map → AreaChart-DIKsPqLG.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{BarChart-Cwxel3M7.js → BarChart-DeqN74Hn.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{BarChart-Cwxel3M7.js.map → BarChart-DeqN74Hn.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{CacheTab-D4j3vwFu.js → CacheTab-x1YU4tYc.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{CacheTab-D4j3vwFu.js.map → CacheTab-x1YU4tYc.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{EventsTab-BA7t_fsH.js → EventsTab-6BuEbd8Y.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{EventsTab-BA7t_fsH.js.map → EventsTab-6BuEbd8Y.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{HealthTab-Ci9gtYDP.js → HealthTab-B71Ft1ac.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{HealthTab-Ci9gtYDP.js.map → HealthTab-B71Ft1ac.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-BeqWn-xu.js → MaintenanceTab-dysyJtHk.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MaintenanceTab-BeqWn-xu.js.map → MaintenanceTab-dysyJtHk.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-BreZegCV.js → MemoryMapTab-B3dKRb_4.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MemoryMapTab-BreZegCV.js.map → MemoryMapTab-B3dKRb_4.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{MetricsTab-DLbgfJT2.js → MetricsTab-COn4GoUK.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{MetricsTab-DLbgfJT2.js.map → MetricsTab-COn4GoUK.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BtcXdrnC.js → OverviewTab-Cd9qAEB3.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{OverviewTab-BtcXdrnC.js.map → OverviewTab-Cd9qAEB3.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{ReposTab-DpDLEzV9.js → ReposTab-DpiP1-Vv.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{ReposTab-DpDLEzV9.js.map → ReposTab-DpiP1-Vv.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CMe5jSrZ.js → SessionsTab-BwRUeGZM.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{SessionsTab-CMe5jSrZ.js.map → SessionsTab-BwRUeGZM.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/SetupTab-CJFDD2_v.js +3 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-CJFDD2_v.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-BFPJUQzs.js → TimeSavedCard-_XsdjQ7Z.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TimeSavedCard-BFPJUQzs.js.map → TimeSavedCard-_XsdjQ7Z.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{TurnsTab-Ujt29pKI.js → TurnsTab-CWPscPLL.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{TurnsTab-Ujt29pKI.js.map → TurnsTab-CWPscPLL.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/VcStatusBadge-Cx56rAIM.js +2 -0
- package/extensions/dashboard-client/dist/assets/VcStatusBadge-Cx56rAIM.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-B5ElUM7S.js +2 -0
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-B5ElUM7S.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/{WikiTab-BiKXVwGT.js → WikiTab-uZ5Mq3XG.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{WikiTab-BiKXVwGT.js.map → WikiTab-uZ5Mq3XG.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{button-DJwGcw0u.js → button-Kc18bYFz.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{button-DJwGcw0u.js.map → button-Kc18bYFz.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{card-CgjBf5LZ.js → card-COJZoG08.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{card-CgjBf5LZ.js.map → card-COJZoG08.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-CTQIl2qs.js → generateCategoricalChart-ChEYo017.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-CTQIl2qs.js.map → generateCategoricalChart-ChEYo017.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{index-Bu8CZUMX.js → index-CB7Rn5FP.js} +14 -14
- package/extensions/dashboard-client/dist/assets/index-CB7Rn5FP.js.map +1 -0
- package/extensions/dashboard-client/dist/assets/index-DbuGwYD7.css +1 -0
- package/extensions/dashboard-client/dist/assets/{switch-uUiS1Raq.js → switch-BFhl_tNh.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{switch-uUiS1Raq.js.map → switch-BFhl_tNh.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{toggle-Dv3OEscH.js → toggle-DJ68kATc.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{toggle-Dv3OEscH.js.map → toggle-DJ68kATc.js.map} +1 -1
- package/extensions/dashboard-client/dist/assets/{useSSE-n6ymAic3.js → useSSE-CXWh42xX.js} +2 -2
- package/extensions/dashboard-client/dist/assets/{useSSE-n6ymAic3.js.map → useSSE-CXWh42xX.js.map} +1 -1
- package/extensions/dashboard-client/dist/index.html +2 -2
- package/extensions/dashboard-client/src/api/setup-cortex.ts +62 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexActionsCard.tsx +221 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexBlockersCard.tsx +74 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexEncoderCard.tsx +113 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexSetup.tsx +53 -0
- package/extensions/dashboard-client/src/tabs/SetupTab/CortexSetupStyles.ts +98 -0
- package/extensions/dashboard-client/src/tabs/SetupTab.tsx +22 -6
- package/extensions/dashboard-client/src/tabs/useSetupCortexPoll.ts +64 -0
- package/extensions/dashboard-client/src/types/setup-cortex.ts +118 -0
- package/extensions/dashboard-server/api-contracts/endpoints/registry-ext.ts +44 -0
- package/extensions/dashboard-server/api-contracts/setup-cortex.ts +123 -0
- package/extensions/dashboard-server/route-dispatch.ts +6 -0
- package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +18 -0
- package/extensions/dashboard-server/routes-setup-cortex-actions.ts +133 -0
- package/extensions/dashboard-server/routes-setup-cortex.ts +167 -0
- package/extensions/dashboard-server/routes.ts +5 -0
- package/extensions/dashboard-server/setup-cortex-actions.ts +242 -0
- package/extensions/dashboard-server/setup-cortex-blockers.ts +98 -0
- package/package.json +1 -1
- package/src/config/vector-cortex-vc9a.ts +31 -0
- package/src/config/vector-cortex-vc9b.ts +31 -0
- package/src/config/vector-cortex-vc9c.ts +36 -0
- package/src/config/vector-cortex.ts +5 -0
- package/src/config.ts +3 -0
- package/extensions/dashboard-client/dist/assets/SetupTab-C3OY8mc7.js +0 -2
- package/extensions/dashboard-client/dist/assets/SetupTab-C3OY8mc7.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-CfxZW91A.js +0 -2
- package/extensions/dashboard-client/dist/assets/VectorCortexTab-CfxZW91A.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/index-Bu8CZUMX.js.map +0 -1
- package/extensions/dashboard-client/dist/assets/index-Difwoltx.css +0 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/vector-cortex-vc9a.ts — VC9A setup-cortex status-read-path sprint flag.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts so that file stays under the 300-line soft
|
|
5
|
+
* limit (soft-as-hard gate), exactly as vector-cortex-vc8c.ts,
|
|
6
|
+
* vector-cortex-breakers.ts and vector-cortex-early.ts were. This is the
|
|
7
|
+
* SETUP-DASHBOARD reader flag (the dashboard Setup tab cortex status endpoint).
|
|
8
|
+
* vector-cortex.ts re-exports it below and root src/config.ts re-exports it, so
|
|
9
|
+
* no consumer import path changes.
|
|
10
|
+
*
|
|
11
|
+
* The split is purely mechanical: VC9A_ENABLED is byte-identical in name,
|
|
12
|
+
* semantics, and default to the definition it replaces, and vector-cortex.ts
|
|
13
|
+
* re-exports it so every existing `from "./config/vector-cortex.js"` import
|
|
14
|
+
* keeps resolving unchanged.
|
|
15
|
+
*
|
|
16
|
+
* Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
|
|
17
|
+
*/
|
|
18
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
19
|
+
/**
|
|
20
|
+
* VC9A — Setup Cortex status read path (GET /api/setup-cortex-status).
|
|
21
|
+
* Default ON. `MEGACOMPACT_VC9A=0` disables and is byte-identical to the
|
|
22
|
+
* predecessor (VC8C-era shape): the endpoint returns `{enabled:false,
|
|
23
|
+
* mode:"C", status:"off"}` and surfaces no qualification/blocker/health detail —
|
|
24
|
+
* a pure reader-only projection, never a mutation. This flag MUST also be a
|
|
25
|
+
* dashboard SETTINGS toggle (visible in config UI, never in EXCLUDED_SETTINGS),
|
|
26
|
+
* mirroring VC4A..VC8C. The dashboard reader itself performs only local
|
|
27
|
+
* filesystem reads (no network, PREVENT-PI-004).
|
|
28
|
+
*/
|
|
29
|
+
export const VC9A_ENABLED = () => sprintFlag("MEGACOMPACT_VC9A");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/vector-cortex-vc9b.ts — VC9B setup-cortex action-drivers sprint flag.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts so that file stays under the 300-line soft
|
|
5
|
+
* limit (soft-as-hard gate), exactly as vector-cortex-vc9a.ts was. This is the
|
|
6
|
+
* SETUP-DASHBOARD action flag (the dashboard Setup tab fetch/bench/verify action
|
|
7
|
+
* drivers). vector-cortex.ts re-exports it below and root src/config.ts
|
|
8
|
+
* re-exports it, so no consumer import path changes.
|
|
9
|
+
*
|
|
10
|
+
* The split is purely mechanical: VC9B_ENABLED is byte-identical in name,
|
|
11
|
+
* semantics, and default to the definition it replaces, and vector-cortex.ts
|
|
12
|
+
* re-exports it so every existing `from "./config/vector-cortex.js"` import
|
|
13
|
+
* keeps resolving unchanged.
|
|
14
|
+
*
|
|
15
|
+
* Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
|
|
16
|
+
*/
|
|
17
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
18
|
+
/**
|
|
19
|
+
* VC9B — Setup Cortex action drivers (POST /api/setup-cortex-action +
|
|
20
|
+
* GET /api/setup-cortex-action-log). Default ON. `MEGACOMPACT_VC9B=0` disables
|
|
21
|
+
* and is byte-identical to the predecessor (VC9A-era): the action POST returns
|
|
22
|
+
* the disabled shape (404/disabled) and flag-off bytes are unchanged. The
|
|
23
|
+
* actions only spawn the existing committed local scripts
|
|
24
|
+
* (scripts/vc2-model-prep/fetch-model.sh / bench-onnx.mjs) or re-read the
|
|
25
|
+
* committed encoder assets — never payload bytes, no network (PREVENT-PI-004).
|
|
26
|
+
* This flag MUST also be a dashboard SETTINGS toggle (visible in config UI,
|
|
27
|
+
* never in EXCLUDED_SETTINGS), mirroring VC9A.
|
|
28
|
+
*/
|
|
29
|
+
export const VC9B_ENABLED = () => sprintFlag("MEGACOMPACT_VC9B");
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* config/vector-cortex-vc9c.ts — VC9C SetupTab Cortex sub-tab sprint flag.
|
|
3
|
+
*
|
|
4
|
+
* Extracted from vector-cortex.ts so that file stays under the 300-line soft
|
|
5
|
+
* limit (soft-as-hard gate), exactly as vector-cortex-vc9a.ts and
|
|
6
|
+
* vector-cortex-vc9b.ts were. This is the SETUP-DASHBOARD UI flag (the Cortex
|
|
7
|
+
* sub-tab inside SetupTab). vector-cortex.ts re-exports it below and root
|
|
8
|
+
* src/config.ts re-exports it, so no consumer import path changes.
|
|
9
|
+
*
|
|
10
|
+
* The split is purely mechanical: VC9C_ENABLED is byte-identical in name,
|
|
11
|
+
* semantics, and default to the definition it replaces, and vector-cortex.ts
|
|
12
|
+
* re-exports it so every existing `from "./config/vector-cortex.js"` import
|
|
13
|
+
* keeps resolving unchanged.
|
|
14
|
+
*
|
|
15
|
+
* The client gates the Cortex sub-tab's visible state on the flag via the
|
|
16
|
+
* VC0E honest-status pattern: when the VC9A status payload reports the
|
|
17
|
+
* off/disabled shape (or VC9C is off), the sub-tab is filtered from
|
|
18
|
+
* SUB_TABS. Flag-off is byte-identical to the predecessor (VC9B-era).
|
|
19
|
+
*
|
|
20
|
+
* Pi-agnostic, dependency-free (PREVENT-PI-004 / PREVENT-011).
|
|
21
|
+
*/
|
|
22
|
+
import { sprintFlag } from "./vector-cortex-flag.js";
|
|
23
|
+
/**
|
|
24
|
+
* VC9C — SetupTab Cortex sub-tab (client UI). Default ON. `MEGACOMPACT_VC9C=0`
|
|
25
|
+
* disables and is byte-identical to the predecessor (VC9B-era): the Cortex
|
|
26
|
+
* sub-tab is filtered from SUB_TABS and the Setup tab renders exactly as it
|
|
27
|
+
* did before this sprint. The sub-tab is a pure consumer of the VC9A status
|
|
28
|
+
* endpoint (GET /api/setup-cortex-status) + VC9B action endpoints (POST
|
|
29
|
+
* /api/setup-cortex-action, GET /api/setup-cortex-action-log); it adds NO
|
|
30
|
+
* server logic and never surfaces payload bytes/prompts/ledger. This flag MUST
|
|
31
|
+
* also be a dashboard SETTINGS toggle (visible in config UI, never in
|
|
32
|
+
* EXCLUDED_SETTINGS), mirroring VC9A/VC9B.
|
|
33
|
+
*/
|
|
34
|
+
export const VC9C_ENABLED = () => sprintFlag("MEGACOMPACT_VC9C");
|
|
@@ -244,6 +244,10 @@ export const VC8B_ENABLED = () => sprintFlag("MEGACOMPACT_VC8B");
|
|
|
244
244
|
// Re-exported here so every existing `from "./config/vector-cortex.js"`
|
|
245
245
|
// import keeps resolving unchanged.
|
|
246
246
|
export { VC8C_ENABLED } from "./vector-cortex-vc8c.js";
|
|
247
|
+
// VC9A/VC9B/VC9C split to vector-cortex-vc9{a,b,c}.ts to stay under the 300-line soft limit.
|
|
248
|
+
export { VC9A_ENABLED } from "./vector-cortex-vc9a.js";
|
|
249
|
+
export { VC9B_ENABLED } from "./vector-cortex-vc9b.js";
|
|
250
|
+
export { VC9C_ENABLED } from "./vector-cortex-vc9c.js";
|
|
247
251
|
// Breaker state machine constants (TRIAD_RESILIENCE.md §breaker) extracted to
|
|
248
252
|
// vector-cortex-breakers.ts to keep this file under the 300-line soft limit.
|
|
249
253
|
export { BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./vector-cortex-breakers.js";
|
package/dist/config.js
CHANGED
|
@@ -114,4 +114,4 @@ export const NEW_UI = () => ragEnabled("MEGACOMPACT_NEW_UI");
|
|
|
114
114
|
// default ON, `=0`/`_DISABLED` off. Re-exported from src/config/vector-cortex.ts
|
|
115
115
|
// so root consumers share one source of truth.
|
|
116
116
|
// ---------------------------------------------------------------------------
|
|
117
|
-
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
|
117
|
+
export { VC0A_ENABLED, VC0B_ENABLED, VC1A_ENABLED, VC0C_ENABLED, VC1B_ENABLED, VC1C_ENABLED, VC2A_ENABLED, VC2B_ENABLED, VC2C_ENABLED, VC3A_ENABLED, VC3B_ENABLED, VC3C_ENABLED, VC4A_ENABLED, VC4B_ENABLED, VC4C_ENABLED, VC5A_ENABLED, VC5B_ENABLED, VC5C_ENABLED, VC6A_ENABLED, VC6B_ENABLED, VC6C_ENABLED, VC7A_ENABLED, VC7B_ENABLED, VC7C_ENABLED, VC8A_ENABLED, VC8B_ENABLED, VC8C_ENABLED, VC9A_ENABLED, VC9B_ENABLED, VC9C_ENABLED, BREAKER_WINDOW_MS, BREAKER_MIN_ATTEMPTS, BREAKER_PERF_FAILURES, BREAKER_PERF_FAILURE_RATE, BREAKER_CORRECTNESS_FAILURES, BREAKER_COOLDOWN_MS, BREAKER_PROBE_COUNT, BREAKER_RETRY_BASE_MS, BREAKER_RETRY_CAP_MS, BREAKER_RETRY_JITTER, BREAKER_HYSTERESIS_FAILURE_RATE, BREAKER_HYSTERESIS_BUDGET_P95_MS, BREAKER_MIN_HEALTHY_RESIDENCE_MS, } from "./config/vector-cortex.js";
|
|
@@ -27,4 +27,24 @@ export const EXTRA_ENDPOINTS = {
|
|
|
27
27
|
path: "/api/vector-cortex/ledger",
|
|
28
28
|
description: "Reader-only occurrence-ledger identity view: seq/eventId/kind/digest + high-water (never source payloads).",
|
|
29
29
|
},
|
|
30
|
+
// ─── VC9A Setup Cortex (dashboard Setup tab cortex status) ─────────
|
|
31
|
+
/** GET /api/setup-cortex-status — reader-only vector-cortex encoder gate. */
|
|
32
|
+
setupCortexStatus: {
|
|
33
|
+
method: "GET",
|
|
34
|
+
path: "/api/setup-cortex-status",
|
|
35
|
+
description: "Reader-only vector-cortex encoder gate: mode A/B/C, qualification verdict, blockers, encoder health — for the dashboard Setup tab. Never closes the ML gate.",
|
|
36
|
+
},
|
|
37
|
+
// ─── VC9B Setup Cortex actions (dashboard Setup tab action drivers) ─────
|
|
38
|
+
/** POST /api/setup-cortex-action — confirmation-gated fetch/bench/verify. */
|
|
39
|
+
setupCortexAction: {
|
|
40
|
+
method: "POST",
|
|
41
|
+
path: "/api/setup-cortex-action",
|
|
42
|
+
description: "Confirmation-gated driver: fetch-model / bench / verify-asset. Executes only the committed local scripts (scripts/vc2-model-prep/*) or re-reads the committed encoder assets; an OPEN hard-gate item returns action_blocked_by_open_item and does NOT spawn. Never payload bytes; confirm:true required.",
|
|
43
|
+
},
|
|
44
|
+
/** GET /api/setup-cortex-action-log — bounded, redacted action log tail. */
|
|
45
|
+
setupCortexActionLog: {
|
|
46
|
+
method: "GET",
|
|
47
|
+
path: "/api/setup-cortex-action-log",
|
|
48
|
+
description: "Bounded (8 KiB) redacted tail of a VC9B action log under <stateDir>/logs/vc9b/; the name must be a validated basename (path traversal rejected).",
|
|
49
|
+
},
|
|
30
50
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api-contracts/setup-cortex.ts — Setup Cortex status + action API types (VC9A/VC9B).
|
|
3
|
+
*
|
|
4
|
+
* Types for GET /api/setup-cortex-status (reader-only aggregate that surfaces
|
|
5
|
+
* the vector-cortex encoder gate WITHOUT closing the ML gate) and the VC9B
|
|
6
|
+
* action drivers POST /api/setup-cortex-action + GET /api/setup-cortex-action-log
|
|
7
|
+
* (confirmation-gated, hard-gate-aware fetches/bench/verify). Reader/actor-only:
|
|
8
|
+
* never payload bytes/prompts/ledger (EVAL-REDACT-002).
|
|
9
|
+
*
|
|
10
|
+
* PREVENT-PI-004: type definitions only, no network code.
|
|
11
|
+
* PREVENT-011: no `any` type — all types are explicit.
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* PREVENT-PI-004: local filesystem read only, no network.
|
|
9
9
|
* PREVENT-011: no `any` type.
|
|
10
10
|
*/
|
|
11
|
-
import { handleIndex, handleRepoIndex, handleEvents, handleGameState, handleGameScores, handlePerfSamples, handlePerf, handleAchievements, handleSessions, handleTopics, handleTurns, handleMaintenance, handleProviderCache, handleMemoryStatus, handleCacheStripes, handleSetupStatus, handleSetupDetect, handleSetupConfigure, handleMemoryMap, handleRaptorTree, handleRaptorBuildHistory, handleContextHealth, handleCachePoison, handleHealthSettings, handleEmbedderHealth, handleRagSettings, handleRagMetrics, handleModelThresholds, handleWiki, handleVectorCortexEvaluation, handleVectorCortexHealth, handleVectorCortexBreakersReset, handleVectorCortexLedger, handleVectorCortexTopology, handleVectorCortexQuery, handleVectorCortexShards, handleVectorCortexResidual, handleVectorCortexReconstruct, handleVectorCortexPlans, handleVectorCortexRender, handleVectorCortexRollout, handleVectorCortexClosureProof, handleVectorCortexRestore, } from "./routes.js";
|
|
11
|
+
import { handleIndex, handleRepoIndex, handleEvents, handleGameState, handleGameScores, handlePerfSamples, handlePerf, handleAchievements, handleSessions, handleTopics, handleTurns, handleMaintenance, handleProviderCache, handleMemoryStatus, handleCacheStripes, handleSetupStatus, handleSetupDetect, handleSetupConfigure, handleMemoryMap, handleRaptorTree, handleRaptorBuildHistory, handleContextHealth, handleCachePoison, handleHealthSettings, handleEmbedderHealth, handleRagSettings, handleRagMetrics, handleModelThresholds, handleWiki, handleVectorCortexEvaluation, handleVectorCortexHealth, handleVectorCortexBreakersReset, handleVectorCortexLedger, handleVectorCortexTopology, handleVectorCortexQuery, handleVectorCortexShards, handleVectorCortexResidual, handleVectorCortexReconstruct, handleVectorCortexPlans, handleVectorCortexRender, handleVectorCortexRollout, handleVectorCortexClosureProof, handleVectorCortexRestore, handleSetupCortexStatus, handleSetupCortexAction, handleSetupCortexActionLog, } from "./routes.js";
|
|
12
12
|
// VC6C repair lives in its own module (routes-vector-cortex-repair.ts) so the
|
|
13
13
|
// heal route file stays well under the 400-line extension soft limit.
|
|
14
14
|
import { handleVectorCortexRepair } from "./routes-vector-cortex-repair.js";
|
|
@@ -141,5 +141,11 @@ export function dispatchRoutes(req, res, ctx) {
|
|
|
141
141
|
return true;
|
|
142
142
|
if (handleVectorCortexPlatform(req, res, ctx))
|
|
143
143
|
return true;
|
|
144
|
+
if (handleSetupCortexStatus(req, res, ctx))
|
|
145
|
+
return true;
|
|
146
|
+
if (handleSetupCortexAction(req, res, ctx))
|
|
147
|
+
return true;
|
|
148
|
+
if (handleSetupCortexActionLog(req, res, ctx))
|
|
149
|
+
return true;
|
|
144
150
|
return false;
|
|
145
151
|
}
|
|
@@ -48,5 +48,8 @@ export const VECTOR_CORTEX_SETTINGS = {
|
|
|
48
48
|
boolDirect("MEGACOMPACT_VC8A", "VC8A Consent-Bound Outcomes", "Consent-bound outcome ledger and offline learning dataset. Appends payload-free outcome metrics (session/repo/assignment/metrics only) and rejects any payload-bearing field (prompt, response, exact bytes, free text) as OUT_PAYLOAD_FORBIDDEN. Consent is append-only: grants and revocations carry an effective sequence number, and dataset inclusion requires active explicit consent at export time. Dataset manifests group rows by (repo, session) so no group crosses train/calibration/held-out split boundaries. Revocations disappear from future manifests. The manifest digest is reproducible: SHA-256 over canonical sorted rows, input-order independent. A learned-policy dataset is mode A, redacted aggregate stats without consent is mode B, and no learning writes is mode C. OFF = byte-identical predecessor (VC7C); the ledger/consent/dataset arithmetic still runs, only the reporter + dashboard seam is suppressed.", true),
|
|
49
49
|
boolDirect("MEGACOMPACT_VC8B", "VC8B Shadow Adaptive Policy", "Bounded shadow adaptive policy + M7 pressure-v2 migration. Policy actions are from a finite set (admit/dampen/defer/escalate/reject) chosen deterministically by the canonical pressure level; token budgets are clamped into a configured window after the pressure factor. Unknown pressure labels are rejected as POL_PRESSURE_UNKNOWN, never coerced to a neighbour. The shadow engine is structurally incapable of affecting the live path: inputs are deep-copied, the canonical prompt digest is pinned before and after to prove non-mutation, and liveMutations is always zero. M7 migrates legacy pressure labels to the v2 canonical five by copy/validate/switch; an unknown label blocks the switch and keeps the legacy pointer (M7_PRESSURE_UNKNOWN). A shadow decision is mode A, static calibrated policy is mode B (forced by invalid A), and fixed legacy thresholds is mode C (forced by M7 or B failure). OFF = byte-identical predecessor (VC8A); the policy/shadow/migration arithmetic still runs, only the reporter + dashboard seam is suppressed.", true),
|
|
50
50
|
boolDirect("MEGACOMPACT_VC8C", "VC8C Canary Platform + Rust Parity", "Canary selection and external Rust parity. The selector admits a qualified external Rust artifact only when ABI version, URL metadata, commit, Cargo.lock digest, and platform all match evidence; a Cargo.lock digest mismatch rejects the artifact (RUST_CARGO_DIGEST_MISMATCH). The cross-conformance runner exchanges length-framed neutral records over a local stdin/stdout channel — a subprocess, never a URL (PREVENT-PI-004). A parity mismatch selects TS mode B. A qualified external artifact is mode A, TS reference is mode B, legacy path is mode C. OFF = byte-identical predecessor (VC8B); the selector and cross-conformance arithmetic still run, only the reporter + dashboard seam is suppressed.", true),
|
|
51
|
+
boolDirect("MEGACOMPACT_VC9A", "VC9A Setup Cortex Status", "Reader-only Setup Cortex status read path (GET /api/setup-cortex-status): surfaces the vector-cortex encoder gate — mode A/B/C, qualification verdict, open blockers, encoder health — to the dashboard Setup tab without closing the ML gate. OFF = byte-identical predecessor (VC8C-era): returns enabled:false / mode:C / status:off.", true),
|
|
52
|
+
boolDirect("MEGACOMPACT_VC9B", "VC9B Setup Cortex Actions", "Setup Cortex action drivers (POST /api/setup-cortex-action + GET /api/setup-cortex-action-log): confirmation-gated wrappers that fetch-model / bench / verify-asset by spawning only the committed local scripts (scripts/vc2-model-prep/fetch-model.sh, bench-onnx.mjs) or re-reading the committed encoder assets — never payload bytes, no network. Actions gated by an OPEN hard-gate item (HG-1/HG-3) return action_blocked_by_open_item and do NOT spawn. OFF = byte-identical predecessor (VC9A-era): the action POST returns a disabled/404 shape and flag-off bytes are unchanged.", true),
|
|
53
|
+
boolDirect("MEGACOMPACT_VC9C", "VC9C SetupTab Cortex Sub-tab", "SetupTab Cortex sub-tab (client UI): a Cortex sub-tab inside SetupTab that consumes the VC9A status endpoint (GET /api/setup-cortex-status) + the VC9B action endpoints. It surfaces the encoder mode A/B/C, asset digest prefix, qualification verdict + threshold failures, the open hard-gate blockers, and the confirmation-gated fetch/bench/verify actions. OFF = byte-identical predecessor (VC9B-era): the Cortex sub-tab is filtered from SUB_TABS and the Setup tab renders exactly as before.", true),
|
|
51
54
|
],
|
|
52
55
|
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard-server/routes-setup-cortex-actions.ts — VC9B Setup Cortex action routes.
|
|
3
|
+
*
|
|
4
|
+
* POST /api/setup-cortex-action — confirmation-gated driver
|
|
5
|
+
* GET /api/setup-cortex-action-log — bounded, redacted log tail
|
|
6
|
+
*
|
|
7
|
+
* Reader/actor-only: NEVER exposes payload bytes, prompts, or ledger. Actions
|
|
8
|
+
* only spawn the committed local vc2-model-prep scripts or re-read the committed
|
|
9
|
+
* encoder assets (verify-asset) — no network (PREVENT-PI-004). A hard gate
|
|
10
|
+
* (HG-1/HG-3) blocking the requested action yields 423 action_blocked_by_open_item
|
|
11
|
+
* with the blocker ids and NO subprocess is spawned. Missing confirm:true yields
|
|
12
|
+
* 400 confirmation_required. Flag-off (MEGACOMPACT_VC9B=0) is byte-identical to
|
|
13
|
+
* the VC9A-era predecessor: the routes are absent, so they return the 404
|
|
14
|
+
* disabled shape and no action runs.
|
|
15
|
+
*
|
|
16
|
+
* Guardrails: PREVENT-011 (no `any`), PREVENT-001 (guarded JSON.parse via
|
|
17
|
+
* readJsonBody), no string literals for scripts/blockers (delegated to
|
|
18
|
+
* setup-cortex-actions.ts + setup-cortex-blockers.ts).
|
|
19
|
+
*/
|
|
20
|
+
import { sendJson, readJsonBody } from "./routes-vector-cortex-shared.js";
|
|
21
|
+
import { VC9B_ENABLED } from "../../src/config.js";
|
|
22
|
+
import { setupCortexActionBlockers } from "./setup-cortex-blockers.js";
|
|
23
|
+
import { runSetupCortexAction, readActionLogTail, } from "./setup-cortex-actions.js";
|
|
24
|
+
const ACTION_KINDS = new Set([
|
|
25
|
+
"fetch-model",
|
|
26
|
+
"bench",
|
|
27
|
+
"verify-asset",
|
|
28
|
+
]);
|
|
29
|
+
function isActionKind(v) {
|
|
30
|
+
return typeof v === "string" && ACTION_KINDS.has(v);
|
|
31
|
+
}
|
|
32
|
+
/** Flag-off response, byte-identical regardless of request (VC9B absent). */
|
|
33
|
+
function sendDisabled(res) {
|
|
34
|
+
sendJson(res, 404, { error: "disabled" });
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* POST /api/setup-cortex-action (VC9B). Returns true when it claims the request.
|
|
38
|
+
*/
|
|
39
|
+
export function handleSetupCortexAction(req, res, ctx) {
|
|
40
|
+
const url = req.url ?? "";
|
|
41
|
+
if (url !== "/api/setup-cortex-action")
|
|
42
|
+
return false;
|
|
43
|
+
if (req.method !== "POST") {
|
|
44
|
+
sendJson(res, 405, { error: "method_not_allowed" });
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
if (!VC9B_ENABLED()) {
|
|
48
|
+
sendDisabled(res);
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
readJsonBody(req, (parsed) => {
|
|
52
|
+
if (!parsed.ok) {
|
|
53
|
+
sendJson(res, 400, { error: "invalid_body" });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const value = parsed.value;
|
|
57
|
+
const action = value.action;
|
|
58
|
+
if (!isActionKind(action)) {
|
|
59
|
+
sendJson(res, 400, { error: "invalid_action" });
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (value.confirm !== true) {
|
|
63
|
+
sendJson(res, 400, { error: "confirmation_required" });
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
// Hard-gate check: when an OPEN hard-gate item gates this action, do NOT
|
|
67
|
+
// spawn — surface the blocker ids so the client highlights the matching rows.
|
|
68
|
+
const blockers = setupCortexActionBlockers(action);
|
|
69
|
+
if (blockers.length > 0) {
|
|
70
|
+
sendJson(res, 423, {
|
|
71
|
+
error: "action_blocked_by_open_item",
|
|
72
|
+
blockers: [...blockers],
|
|
73
|
+
});
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const result = runSetupCortexAction(action, ctx.stateDir);
|
|
77
|
+
sendJson(res, result.ok ? 200 : 500, result);
|
|
78
|
+
});
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* GET /api/setup-cortex-action-log?name=<basename> (VC9B). Returns true when it
|
|
83
|
+
* claims the request. Bounded tail (8 KiB max) + redacted (digest prefixes +
|
|
84
|
+
* codes); the name must validate to a basename inside the vc9b log dir.
|
|
85
|
+
*/
|
|
86
|
+
export function handleSetupCortexActionLog(req, res, ctx) {
|
|
87
|
+
const url = req.url ?? "";
|
|
88
|
+
if (url.split("?")[0] !== "/api/setup-cortex-action-log")
|
|
89
|
+
return false;
|
|
90
|
+
if (req.method !== "GET") {
|
|
91
|
+
sendJson(res, 405, { error: "method_not_allowed" });
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
if (!VC9B_ENABLED()) {
|
|
95
|
+
sendDisabled(res);
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
let name = null;
|
|
99
|
+
try {
|
|
100
|
+
name = new URL(url, "http://localhost").searchParams.get("name");
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
name = null;
|
|
104
|
+
}
|
|
105
|
+
if (!name) {
|
|
106
|
+
sendJson(res, 400, { error: "invalid_log_name" });
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
const tail = readActionLogTail(ctx.stateDir, name);
|
|
110
|
+
if (tail === null) {
|
|
111
|
+
sendJson(res, 404, { error: "log_not_found" });
|
|
112
|
+
return true;
|
|
113
|
+
}
|
|
114
|
+
sendJson(res, 200, tail);
|
|
115
|
+
return true;
|
|
116
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* dashboard-server/routes-setup-cortex.ts — VC9A Setup Cortex status route.
|
|
3
|
+
*
|
|
4
|
+
* GET /api/setup-cortex-status — reader-only aggregate surfacing the
|
|
5
|
+
* vector-cortex encoder gate (mode A/B/C, qualification verdict,
|
|
6
|
+
* blockers, encoder health) for the dashboard Setup tab. Does NOT close
|
|
7
|
+
* the ML gate: the hard-gate blockers are read-only and stay open.
|
|
8
|
+
*
|
|
9
|
+
* Reuses readEncoderManifest / verifyEncoderAsset / detectPlatform
|
|
10
|
+
* (src/vector-cortex/encoder/asset.ts) and deriveVcStatus (vc-status.ts),
|
|
11
|
+
* plus the memoized encoder-facts pattern from routes-vector-cortex-health.ts
|
|
12
|
+
* (manifest bytes + file size/mtime + platform cache key) so the expensive
|
|
13
|
+
* full-asset hashing is skipped on repeat polls.
|
|
14
|
+
*
|
|
15
|
+
* The blocker rows carry NO string literals here — they come from the static
|
|
16
|
+
* manifest module setup-cortex-blockers.ts (single canonical source).
|
|
17
|
+
*
|
|
18
|
+
* Guardrails: PREVENT-PI-004 (local filesystem read only), PREVENT-011 (no
|
|
19
|
+
* `any`), reader-only aggregate (never payloads/prompts/ledger — EVAL-REDACT-002).
|
|
20
|
+
*/
|
|
21
|
+
import { createHash } from "node:crypto";
|
|
22
|
+
import { readFileSync, statSync } from "node:fs";
|
|
23
|
+
import { join, dirname } from "node:path";
|
|
24
|
+
import { fileURLToPath } from "node:url";
|
|
25
|
+
import { VC9A_ENABLED } from "../../src/config.js";
|
|
26
|
+
import { readEncoderManifest, verifyEncoderAsset, detectPlatform } from "../../src/vector-cortex/encoder/asset.js";
|
|
27
|
+
import { sendJson } from "./routes-vector-cortex-shared.js";
|
|
28
|
+
import { deriveVcStatus } from "./vc-status.js";
|
|
29
|
+
import { SETUP_CORTEX_BLOCKERS } from "./setup-cortex-blockers.js";
|
|
30
|
+
/** Resolve the committed encoder-v1 asset dir by walking up to the repo root. */
|
|
31
|
+
function encoderAssetDir() {
|
|
32
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const rel = join("assets", "vector-cortex", "encoder-v1");
|
|
34
|
+
for (let i = 0; i < 8; i++) {
|
|
35
|
+
const candidate = join(dir, rel);
|
|
36
|
+
try {
|
|
37
|
+
// guardrails-allow PREVENT-PI-004: local asset filesystem read (loopback)
|
|
38
|
+
readFileSync(join(candidate, "manifest.json"));
|
|
39
|
+
return candidate;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
/* keep walking */
|
|
43
|
+
}
|
|
44
|
+
const next = dirname(dir);
|
|
45
|
+
if (next === dir)
|
|
46
|
+
break;
|
|
47
|
+
dir = next;
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
let factCache = null;
|
|
52
|
+
/** Stable cache key: manifest bytes + (size,mtime) of the asset files + platform. */
|
|
53
|
+
function factCacheKey(dir, manifestPath) {
|
|
54
|
+
const platform = detectPlatform();
|
|
55
|
+
if (!platform)
|
|
56
|
+
return null;
|
|
57
|
+
const parts = [platform];
|
|
58
|
+
try {
|
|
59
|
+
for (const p of [manifestPath, join(dir, "model.onnx"), join(dir, "tokenizer.json")]) {
|
|
60
|
+
const s = statSync(p);
|
|
61
|
+
parts.push(`${s.size}:${s.mtimeMs}`);
|
|
62
|
+
}
|
|
63
|
+
// guardrails-allow PREVENT-PI-004: local manifest filesystem read (loopback)
|
|
64
|
+
parts.push(createHash("sha256").update(readFileSync(manifestPath)).digest("hex"));
|
|
65
|
+
}
|
|
66
|
+
catch {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return parts.join("|");
|
|
70
|
+
}
|
|
71
|
+
function computeSetupCortexFacts(dir) {
|
|
72
|
+
const manifest = readEncoderManifest(dir);
|
|
73
|
+
if (manifest === null) {
|
|
74
|
+
return { mode: "C", assetDigestPrefix: null, verdict: "unavailable", thresholdFailures: [] };
|
|
75
|
+
}
|
|
76
|
+
const manifestPath = join(dir, "manifest.json");
|
|
77
|
+
const key = factCacheKey(dir, manifestPath);
|
|
78
|
+
if (key === null)
|
|
79
|
+
return null;
|
|
80
|
+
if (factCache !== null && factCache.key === key)
|
|
81
|
+
return factCache.facts;
|
|
82
|
+
let digest;
|
|
83
|
+
try {
|
|
84
|
+
// guardrails-allow PREVENT-PI-004: local manifest filesystem read (loopback)
|
|
85
|
+
digest = createHash("sha256").update(readFileSync(manifestPath)).digest("hex");
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
const facts = { mode: "B", assetDigestPrefix: null, verdict: "demoted", thresholdFailures: ["ENC_ASSET_UNREADABLE"] };
|
|
89
|
+
factCache = { key, facts };
|
|
90
|
+
return facts;
|
|
91
|
+
}
|
|
92
|
+
const verify = verifyEncoderAsset(dir, manifest, detectPlatform());
|
|
93
|
+
const prefix = digest.slice(0, 12);
|
|
94
|
+
const facts = verify.ok
|
|
95
|
+
? { mode: "A", assetDigestPrefix: prefix, verdict: "qualified", thresholdFailures: [] }
|
|
96
|
+
: { mode: "B", assetDigestPrefix: prefix, verdict: "demoted", thresholdFailures: [verify.code] };
|
|
97
|
+
factCache = { key, facts };
|
|
98
|
+
return facts;
|
|
99
|
+
}
|
|
100
|
+
function setupCortexFacts() {
|
|
101
|
+
const dir = encoderAssetDir();
|
|
102
|
+
if (dir === null) {
|
|
103
|
+
return { mode: "C", assetDigestPrefix: null, verdict: "unavailable", thresholdFailures: [] };
|
|
104
|
+
}
|
|
105
|
+
const facts = computeSetupCortexFacts(dir);
|
|
106
|
+
return facts ?? { mode: "C", assetDigestPrefix: null, verdict: "unavailable", thresholdFailures: [] };
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Reader-only GET /api/setup-cortex-status (VC9A).
|
|
110
|
+
*
|
|
111
|
+
* Purely read: no mutation, never payloads/prompts/ledger. Flag-off returns the
|
|
112
|
+
* byte-identical VC8C-era shape `{enabled:false, mode:"C", status:"off"}` with
|
|
113
|
+
* the encoder-health mode C and no qualification/blocker detail leaked.
|
|
114
|
+
*/
|
|
115
|
+
export function handleSetupCortexStatus(req, res, _ctx) {
|
|
116
|
+
const url = req.url ?? "";
|
|
117
|
+
if (url !== "/api/setup-cortex-status")
|
|
118
|
+
return false;
|
|
119
|
+
if (req.method !== "GET") {
|
|
120
|
+
sendJson(res, 405, { error: "method_not_allowed" });
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
const enabled = VC9A_ENABLED();
|
|
124
|
+
const facts = enabled ? setupCortexFacts() : null;
|
|
125
|
+
const blocks = enabled ? [...SETUP_CORTEX_BLOCKERS] : [];
|
|
126
|
+
const body = {
|
|
127
|
+
enabled,
|
|
128
|
+
flag: "MEGACOMPACT_VC9A",
|
|
129
|
+
mode: facts ? facts.mode : "C",
|
|
130
|
+
assetDigestPrefix: facts ? facts.assetDigestPrefix : null,
|
|
131
|
+
qualification: facts
|
|
132
|
+
? { verdict: facts.verdict, thresholdFailures: facts.thresholdFailures }
|
|
133
|
+
: { verdict: "unavailable", thresholdFailures: [] },
|
|
134
|
+
blockers: blocks,
|
|
135
|
+
encoderHealth: facts
|
|
136
|
+
? { assetDigestPrefix: facts.assetDigestPrefix, mode: facts.mode }
|
|
137
|
+
: { assetDigestPrefix: null, mode: "C" },
|
|
138
|
+
updatedAt: new Date().toISOString(),
|
|
139
|
+
status: deriveVcStatus({ enabled, hasData: !!facts && facts.verdict !== "unavailable", structuralOnly: true }),
|
|
140
|
+
};
|
|
141
|
+
sendJson(res, 200, body);
|
|
142
|
+
return true;
|
|
143
|
+
}
|
|
@@ -24,3 +24,5 @@ export { handleRagMetrics } from "./routes-rag-metrics.js";
|
|
|
24
24
|
export { handleModelThresholds } from "./routes-model-thresholds.js";
|
|
25
25
|
export { handleWiki } from "./routes-wiki.js";
|
|
26
26
|
export { handleVectorCortexEvaluation, handleVectorCortexHealth, handleVectorCortexBreakersReset, handleVectorCortexLedger, handleVectorCortexTopology, handleVectorCortexQuery, handleVectorCortexShards, handleVectorCortexResidual, handleVectorCortexReconstruct, handleVectorCortexPlans, handleVectorCortexRender, handleVectorCortexRollout, handleVectorCortexClosureProof, handleVectorCortexRestore, } from "./routes-vector-cortex.js";
|
|
27
|
+
export { handleSetupCortexStatus } from "./routes-setup-cortex.js";
|
|
28
|
+
export { handleSetupCortexAction, handleSetupCortexActionLog, } from "./routes-setup-cortex-actions.js";
|