pi-mega-compact 0.20.19 → 0.20.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/dist/config/vector-cortex-vc8c.js +31 -0
  2. package/dist/config/vector-cortex.js +5 -0
  3. package/dist/config.js +1 -1
  4. package/dist/extensions/dashboard-server/api-contracts/vector-cortex-platform.js +12 -0
  5. package/dist/extensions/dashboard-server/route-dispatch.js +6 -0
  6. package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +2 -1
  7. package/dist/extensions/dashboard-server/routes-vector-cortex-platform.js +42 -0
  8. package/dist/src/config/vector-cortex-vc8c.js +31 -0
  9. package/dist/src/config/vector-cortex.js +5 -0
  10. package/dist/src/config.js +1 -1
  11. package/dist/src/vector-cortex/cache/_diagnostics-fixture.js +79 -5
  12. package/dist/src/vector-cortex/cache/diagnostics.js +17 -8
  13. package/dist/src/vector-cortex/controller/_adaptive-fixture.js +126 -0
  14. package/dist/src/vector-cortex/controller/policy.js +1 -1
  15. package/dist/src/vector-cortex/migrations/request-hash-v2-ops.js +23 -7
  16. package/dist/src/vector-cortex/platform/cross-read.js +98 -0
  17. package/dist/src/vector-cortex/platform/emit.js +54 -0
  18. package/dist/src/vector-cortex/platform/select.js +104 -0
  19. package/dist/src/vector-cortex/platform/types.js +57 -0
  20. package/dist/vector-cortex/cache/_diagnostics-fixture.js +79 -5
  21. package/dist/vector-cortex/cache/diagnostics.js +17 -8
  22. package/dist/vector-cortex/controller/_adaptive-fixture.js +126 -0
  23. package/dist/vector-cortex/controller/policy.js +1 -1
  24. package/dist/vector-cortex/migrations/request-hash-v2-ops.js +23 -7
  25. package/dist/vector-cortex/platform/cross-read.js +98 -0
  26. package/dist/vector-cortex/platform/emit.js +54 -0
  27. package/dist/vector-cortex/platform/select.js +104 -0
  28. package/dist/vector-cortex/platform/types.js +57 -0
  29. package/extensions/dashboard-client/dist/assets/{AreaChart-ujtGh2ez.js → AreaChart-BkfB-LSQ.js} +2 -2
  30. package/extensions/dashboard-client/dist/assets/{AreaChart-ujtGh2ez.js.map → AreaChart-BkfB-LSQ.js.map} +1 -1
  31. package/extensions/dashboard-client/dist/assets/{BarChart-DNZqvtqh.js → BarChart-Cs1kogko.js} +2 -2
  32. package/extensions/dashboard-client/dist/assets/{BarChart-DNZqvtqh.js.map → BarChart-Cs1kogko.js.map} +1 -1
  33. package/extensions/dashboard-client/dist/assets/{CacheTab-CeCIW1rD.js → CacheTab-BZgaguGr.js} +2 -2
  34. package/extensions/dashboard-client/dist/assets/{CacheTab-CeCIW1rD.js.map → CacheTab-BZgaguGr.js.map} +1 -1
  35. package/extensions/dashboard-client/dist/assets/{EventsTab-ChohmqJI.js → EventsTab-BFbkI_MO.js} +2 -2
  36. package/extensions/dashboard-client/dist/assets/{EventsTab-ChohmqJI.js.map → EventsTab-BFbkI_MO.js.map} +1 -1
  37. package/extensions/dashboard-client/dist/assets/{HealthTab-CKfAooiV.js → HealthTab-CvlOENCX.js} +2 -2
  38. package/extensions/dashboard-client/dist/assets/{HealthTab-CKfAooiV.js.map → HealthTab-CvlOENCX.js.map} +1 -1
  39. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-D3DxHgM2.js → MaintenanceTab-CtBuz2qL.js} +2 -2
  40. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-D3DxHgM2.js.map → MaintenanceTab-CtBuz2qL.js.map} +1 -1
  41. package/extensions/dashboard-client/dist/assets/{MemoryMapTab--c-0PBka.js → MemoryMapTab-K4775S4d.js} +2 -2
  42. package/extensions/dashboard-client/dist/assets/{MemoryMapTab--c-0PBka.js.map → MemoryMapTab-K4775S4d.js.map} +1 -1
  43. package/extensions/dashboard-client/dist/assets/{MetricsTab-9UaEB69R.js → MetricsTab-DVGcFInz.js} +2 -2
  44. package/extensions/dashboard-client/dist/assets/{MetricsTab-9UaEB69R.js.map → MetricsTab-DVGcFInz.js.map} +1 -1
  45. package/extensions/dashboard-client/dist/assets/{OverviewTab-89zNl1qx.js → OverviewTab-4LmW5ZCl.js} +2 -2
  46. package/extensions/dashboard-client/dist/assets/{OverviewTab-89zNl1qx.js.map → OverviewTab-4LmW5ZCl.js.map} +1 -1
  47. package/extensions/dashboard-client/dist/assets/{ReposTab-CkfNrdxF.js → ReposTab-StebchgQ.js} +2 -2
  48. package/extensions/dashboard-client/dist/assets/{ReposTab-CkfNrdxF.js.map → ReposTab-StebchgQ.js.map} +1 -1
  49. package/extensions/dashboard-client/dist/assets/{SessionsTab-DA7wqI05.js → SessionsTab-C3D_XAkX.js} +2 -2
  50. package/extensions/dashboard-client/dist/assets/{SessionsTab-DA7wqI05.js.map → SessionsTab-C3D_XAkX.js.map} +1 -1
  51. package/extensions/dashboard-client/dist/assets/{SetupTab-pG4xMI3P.js → SetupTab-BTBGyppF.js} +2 -2
  52. package/extensions/dashboard-client/dist/assets/{SetupTab-pG4xMI3P.js.map → SetupTab-BTBGyppF.js.map} +1 -1
  53. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-DeQnzSkb.js → TimeSavedCard-CTPi_AAW.js} +2 -2
  54. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-DeQnzSkb.js.map → TimeSavedCard-CTPi_AAW.js.map} +1 -1
  55. package/extensions/dashboard-client/dist/assets/{TurnsTab-B6ifHMbg.js → TurnsTab-DSOGcY5Q.js} +2 -2
  56. package/extensions/dashboard-client/dist/assets/{TurnsTab-B6ifHMbg.js.map → TurnsTab-DSOGcY5Q.js.map} +1 -1
  57. package/extensions/dashboard-client/dist/assets/VectorCortexTab-OMW8_RFf.js +2 -0
  58. package/extensions/dashboard-client/dist/assets/VectorCortexTab-OMW8_RFf.js.map +1 -0
  59. package/extensions/dashboard-client/dist/assets/{WikiTab-awMsQNBY.js → WikiTab-Db-qFDdg.js} +2 -2
  60. package/extensions/dashboard-client/dist/assets/{WikiTab-awMsQNBY.js.map → WikiTab-Db-qFDdg.js.map} +1 -1
  61. package/extensions/dashboard-client/dist/assets/{button-DCDwPy_j.js → button-BF4UgBAD.js} +2 -2
  62. package/extensions/dashboard-client/dist/assets/{button-DCDwPy_j.js.map → button-BF4UgBAD.js.map} +1 -1
  63. package/extensions/dashboard-client/dist/assets/{card-D3KAYtck.js → card-XmXoYQqB.js} +2 -2
  64. package/extensions/dashboard-client/dist/assets/{card-D3KAYtck.js.map → card-XmXoYQqB.js.map} +1 -1
  65. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D_FHNog-.js → generateCategoricalChart-Be8hM1aU.js} +2 -2
  66. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-D_FHNog-.js.map → generateCategoricalChart-Be8hM1aU.js.map} +1 -1
  67. package/extensions/dashboard-client/dist/assets/{index-4MkLsevY.js → index-NXDgILxv.js} +3 -3
  68. package/extensions/dashboard-client/dist/assets/{index-4MkLsevY.js.map → index-NXDgILxv.js.map} +1 -1
  69. package/extensions/dashboard-client/dist/assets/{switch-Cc05xGtg.js → switch-kUZCrbia.js} +2 -2
  70. package/extensions/dashboard-client/dist/assets/{switch-Cc05xGtg.js.map → switch-kUZCrbia.js.map} +1 -1
  71. package/extensions/dashboard-client/dist/assets/{toggle--QUzWk-Y.js → toggle-DEe5mCwF.js} +2 -2
  72. package/extensions/dashboard-client/dist/assets/{toggle--QUzWk-Y.js.map → toggle-DEe5mCwF.js.map} +1 -1
  73. package/extensions/dashboard-client/dist/assets/{useSSE-DcAeX67m.js → useSSE-BlCyLqge.js} +2 -2
  74. package/extensions/dashboard-client/dist/assets/{useSSE-DcAeX67m.js.map → useSSE-BlCyLqge.js.map} +1 -1
  75. package/extensions/dashboard-client/dist/index.html +1 -1
  76. package/extensions/dashboard-client/src/api/vector-cortex.ts +9 -0
  77. package/extensions/dashboard-client/src/tabs/VectorCortexPlatformCard.tsx +42 -0
  78. package/extensions/dashboard-client/src/tabs/VectorCortexTab.tsx +2 -0
  79. package/extensions/dashboard-client/src/tabs/useVectorCortexPoll.ts +5 -0
  80. package/extensions/dashboard-client/src/types/vector-cortex-vc8.ts +19 -3
  81. package/extensions/dashboard-client/src/types/vector-cortex.ts +1 -1
  82. package/extensions/dashboard-server/api-contracts/vector-cortex-platform.ts +34 -0
  83. package/extensions/dashboard-server/route-dispatch.ts +6 -0
  84. package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +7 -1
  85. package/extensions/dashboard-server/routes-vector-cortex-platform.ts +52 -0
  86. package/package.json +1 -1
  87. package/src/config/vector-cortex-vc8c.ts +33 -0
  88. package/src/config/vector-cortex.ts +6 -0
  89. package/src/config.ts +1 -0
  90. package/src/vector-cortex/cache/_diagnostics-fixture.ts +163 -5
  91. package/src/vector-cortex/cache/diagnostics.ts +18 -9
  92. package/src/vector-cortex/controller/_adaptive-fixture.ts +230 -0
  93. package/src/vector-cortex/controller/policy.ts +1 -1
  94. package/src/vector-cortex/migrations/request-hash-v2-ops.ts +21 -6
  95. package/src/vector-cortex/platform/cross-read.ts +122 -0
  96. package/src/vector-cortex/platform/emit.ts +77 -0
  97. package/src/vector-cortex/platform/select.ts +131 -0
  98. package/src/vector-cortex/platform/types.ts +169 -0
  99. package/extensions/dashboard-client/dist/assets/VectorCortexTab-DSz16qtM.js +0 -2
  100. package/extensions/dashboard-client/dist/assets/VectorCortexTab-DSz16qtM.js.map +0 -1
@@ -75,14 +75,22 @@ function generationFromEconomics(economicsVersion: string): bigint {
75
75
 
76
76
  export function detectCollision(host: M5Host): boolean {
77
77
  const byHash = new Map<string, string>();
78
- const seenIdentities = new Set<string>();
78
+ // Track the v1 hash seen for each identity so a genuine collision (same
79
+ // identity, DIFFERENT v1 hash) is distinguished from a benign duplicate
80
+ // (same identity, SAME v1 hash — an idempotent resume re-reads the same row).
81
+ const identityHash = new Map<string, string>();
79
82
  for (const v1 of host.v1Rows()) {
80
83
  const row = deriveRequestHashRow(host, v1);
81
84
  const id = identity(v1.profileId, v1.requestDigest);
82
- // Two distinct v1 rows (different v1 hash) with the same v2 hash collide,
83
- // even if they share an identity — the v2 table cannot distinguish them.
84
- if (seenIdentities.has(id)) return true;
85
- seenIdentities.add(id);
85
+ const priorHash = identityHash.get(id);
86
+ if (priorHash !== undefined) {
87
+ // Same identity seen before. Only a collision if the v1 hashes differ —
88
+ // two genuinely distinct v1 rows collapsing to one v2 hash. Identical
89
+ // duplicates (same hash) are benign and skipped.
90
+ if (priorHash !== v1.hash) return true;
91
+ continue;
92
+ }
93
+ identityHash.set(id, v1.hash);
86
94
  const prior = byHash.get(row.hash);
87
95
  if (prior !== undefined && prior !== id) return true;
88
96
  byHash.set(row.hash, id);
@@ -111,11 +119,17 @@ export function m5Copy(host: M5Host): {
111
119
  const existing = new Map(
112
120
  host.existingV2().map((r) => [identity(r.profileId, r.requestDigest), r]),
113
121
  );
122
+ // Track identities already in the `wanted` batch so a benign duplicate v1
123
+ // row (same identity, same hash) does not produce a duplicate v2 write that
124
+ // would later trip COUNT_MISMATCH in verify.
125
+ const batchSeen = new Set<string>();
114
126
  const wanted: RequestHashV2Row[] = [];
115
127
  for (const v1 of host.v1Rows()) {
116
128
  const fresh = deriveRequestHashRow(host, v1);
117
129
  if (isGenerationInvalidated(host, fresh)) continue;
118
- const stored = existing.get(identity(v1.profileId, v1.requestDigest));
130
+ const id = identity(v1.profileId, v1.requestDigest);
131
+ if (batchSeen.has(id)) continue;
132
+ const stored = existing.get(id);
119
133
  if (
120
134
  stored !== undefined &&
121
135
  stored.hash === fresh.hash &&
@@ -123,6 +137,7 @@ export function m5Copy(host: M5Host): {
123
137
  ) {
124
138
  continue;
125
139
  }
140
+ batchSeen.add(id);
126
141
  wanted.push(fresh);
127
142
  }
128
143
  if (wanted.length > 0) host.putV2(wanted);
@@ -0,0 +1,122 @@
1
+ /**
2
+ * platform/cross-read.ts — VC8C neutral stdin/stdout cross-conformance framing.
3
+ *
4
+ * Both the TS reference and an external Rust binary speak ONE neutral wire
5
+ * format: a sequence of length-prefixed JSON records. Each record is:
6
+ *
7
+ * [4-byte big-endian length][exactly that many bytes of canonical JSON]
8
+ *
9
+ * The TS side encodes and decodes this framing; the external runner (a local
10
+ * subprocess, PREVENT-PI-004: never a URL) reads the same frames on stdin and
11
+ * writes them back on stdout. Parity is then byte-for-byte: the canonical JSON
12
+ * bytes of each record and the failure code must match in both directions.
13
+ *
14
+ * `outputBytes` is the OCAML-free canonical representation of a fixture's
15
+ * produced bytes as a HEX STRING, so byte-equality is a plain string compare and
16
+ * the wire JSON never carries raw binary.
17
+ *
18
+ * Everything here is PURE: no clock, no storage, no network, no flag read. The
19
+ * flag gates only the reporter seam in emit.ts.
20
+ *
21
+ * PREVENT-011: no `any` type. PREVENT-PI-004: no network.
22
+ */
23
+
24
+ import { RUST_FRAME_TRUNCATED, RUST_PARITY_MISMATCH } from "./types.js";
25
+
26
+ /** One neutral record exchanged between a TS reference and an external runner. */
27
+ export interface NeutralRecord {
28
+ readonly fixtureId: string;
29
+ /** Produced output bytes as a hex string (canonical byte comparison). */
30
+ readonly outputBytes: string;
31
+ /** The machine failure code, or null when the fixture succeeded. */
32
+ readonly failureCode: string | null;
33
+ }
34
+
35
+ /** The result of decoding a neutral frame stream. */
36
+ export type NeutralDecodeResult =
37
+ | { readonly ok: true; readonly records: ReadonlyArray<NeutralRecord> }
38
+ | { readonly ok: false; readonly code: string };
39
+
40
+ /** The result of comparing two neutral records. */
41
+ export type NeutralCompareResult = { readonly ok: true } | { readonly ok: false; readonly code: string };
42
+
43
+ /** Canonical JSON bytes for a neutral record (the wire form of a record body). */
44
+ export function encodeRecordJson(record: NeutralRecord): Uint8Array {
45
+ return new TextEncoder().encode(JSON.stringify(record));
46
+ }
47
+
48
+ /**
49
+ * Encode a list of neutral records into the length-framed neutral wire format.
50
+ * Each record is written as a 4-byte big-endian length followed by exactly that
51
+ * many canonical JSON bytes, concatenated in order.
52
+ */
53
+ export function encodeNeutralFrame(fixtures: ReadonlyArray<NeutralRecord>): Uint8Array {
54
+ const parts: Array<Uint8Array> = [];
55
+ for (const fixture of fixtures) {
56
+ const body = encodeRecordJson(fixture);
57
+ const header = new Uint8Array(4);
58
+ new DataView(header.buffer).setUint32(0, body.length, false);
59
+ parts.push(header, body);
60
+ }
61
+ const total = parts.reduce((acc, p) => acc + p.length, 0);
62
+ const out = new Uint8Array(total);
63
+ let offset = 0;
64
+ for (const part of parts) {
65
+ out.set(part, offset);
66
+ offset += part.length;
67
+ }
68
+ return out;
69
+ }
70
+
71
+ /**
72
+ * Decode a neutral frame stream back into records. A partial trailing frame
73
+ * (a length prefix with fewer body bytes than declared) returns
74
+ * `{ ok: false, code: "RUST_FRAME_TRUNCATED" }` — the invariant the sprint's
75
+ * unique failure injection exercises.
76
+ */
77
+ export function decodeNeutralFrame(bytes: Uint8Array): NeutralDecodeResult {
78
+ const records: NeutralRecord[] = [];
79
+ let offset = 0;
80
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
81
+ const decoder = new TextDecoder();
82
+ while (offset + 4 <= bytes.byteLength) {
83
+ const len = view.getUint32(offset, false);
84
+ offset += 4;
85
+ if (offset + len > bytes.byteLength) {
86
+ return { ok: false, code: RUST_FRAME_TRUNCATED };
87
+ }
88
+ const body = decoder.decode(bytes.subarray(offset, offset + len));
89
+ offset += len;
90
+ try {
91
+ records.push(JSON.parse(body) as NeutralRecord);
92
+ } catch {
93
+ return { ok: false, code: RUST_FRAME_TRUNCATED };
94
+ }
95
+ }
96
+ if (offset !== bytes.byteLength) {
97
+ // Trailing bytes fewer than one length prefix — the frame was cut mid-header.
98
+ return { ok: false, code: RUST_FRAME_TRUNCATED };
99
+ }
100
+ return { ok: true, records };
101
+ }
102
+
103
+ /**
104
+ * Compare one expected record against one actual record. Both the canonical
105
+ * output bytes (as hex strings) and the failure code must match. Any byte or
106
+ * code difference returns `{ ok: false, code: "RUST_PARITY_MISMATCH" }`.
107
+ */
108
+ export function compareFixtureOutput(
109
+ expected: NeutralRecord,
110
+ actual: NeutralRecord,
111
+ ): NeutralCompareResult {
112
+ if (expected.fixtureId !== actual.fixtureId) {
113
+ return { ok: false, code: RUST_PARITY_MISMATCH };
114
+ }
115
+ if (expected.outputBytes !== actual.outputBytes) {
116
+ return { ok: false, code: RUST_PARITY_MISMATCH };
117
+ }
118
+ if (expected.failureCode !== actual.failureCode) {
119
+ return { ok: false, code: RUST_PARITY_MISMATCH };
120
+ }
121
+ return { ok: true };
122
+ }
@@ -0,0 +1,77 @@
1
+ /**
2
+ * platform/emit.ts — VC8C engine parity/selection reporter seam (FLAG-GATED).
3
+ *
4
+ * Mirrors the VC8B policy-emit pattern: a thin `safe()` wrapper around an
5
+ * optional injected `emit`, and the two event names the sprint spec requires:
6
+ * - `vector_cortex_engine_parity_checked` — a parity report was resolved.
7
+ * - `vector_cortex_engine_selection_demoted` — the triad dropped from A.
8
+ *
9
+ * FLAG SEMANTICS. The engine selector and cross-conformance runner STILL RUN
10
+ * regardless of `MEGACOMPACT_VC8C`. The flag gates ONLY this reporting +
11
+ * dashboard seam: flag-off is byte-identical to the predecessor (VC8B).
12
+ *
13
+ * PAYLOAD DISCIPLINE. These events carry only ids, the finite mode, the machine
14
+ * code, and counts — never artifact bytes, output bytes, or free-text.
15
+ *
16
+ * PREVENT-PI-004: no network. PREVENT-011: no `any` type.
17
+ */
18
+
19
+ import { VC8C_ENABLED } from "../../config/vector-cortex.js";
20
+
21
+ /** The two structured events the VC8C reporter emits. */
22
+ export type PlatformEventName =
23
+ | "vector_cortex_engine_parity_checked"
24
+ | "vector_cortex_engine_selection_demoted";
25
+
26
+ /** Optional emit fn injected by the runtime; tests pass `undefined`. */
27
+ export type PlatformEmit = (name: string, payload: unknown) => void;
28
+
29
+ /** Run `fn` only when an emit exists; a reporting failure is never fatal. */
30
+ function safe(emit: PlatformEmit | undefined, fn: (emit: PlatformEmit) => void): void {
31
+ if (emit === undefined) return;
32
+ try {
33
+ fn(emit);
34
+ } catch {
35
+ // Non-fatal: a reporting failure must never break the agent loop.
36
+ }
37
+ }
38
+
39
+ /** Report a resolved engine parity check. Gated by the flag. */
40
+ export function reportEngineParityChecked(
41
+ emit: PlatformEmit | undefined,
42
+ parity: {
43
+ readonly reportId: string;
44
+ readonly fixtureCount: number;
45
+ readonly passed: number;
46
+ readonly failed: number;
47
+ },
48
+ ): void {
49
+ if (!VC8C_ENABLED()) return;
50
+ safe(emit, (e) =>
51
+ e("vector_cortex_engine_parity_checked", {
52
+ ts: undefined,
53
+ event: "vector_cortex_engine_parity_checked",
54
+ reportId: parity.reportId,
55
+ fixtureCount: parity.fixtureCount,
56
+ passed: parity.passed,
57
+ failed: parity.failed,
58
+ }),
59
+ );
60
+ }
61
+
62
+ /** Report an engine selection demotion away from mode A. Gated by the flag. */
63
+ export function reportEngineSelectionDemoted(
64
+ emit: PlatformEmit | undefined,
65
+ demotion: { readonly from: "A"; readonly to: "B" | "C"; readonly code: string },
66
+ ): void {
67
+ if (!VC8C_ENABLED()) return;
68
+ safe(emit, (e) =>
69
+ e("vector_cortex_engine_selection_demoted", {
70
+ ts: undefined,
71
+ event: "vector_cortex_engine_selection_demoted",
72
+ from: demotion.from,
73
+ to: demotion.to,
74
+ code: demotion.code,
75
+ }),
76
+ );
77
+ }
@@ -0,0 +1,131 @@
1
+ /**
2
+ * platform/select.ts — VC8C canary-selection engine selector (PURE).
3
+ *
4
+ * `selectEngine` decides the failure triad mode from a reviewer-accepted
5
+ * `ParityReportV1` and the current host platform. It admits mode A (qualified
6
+ * external Rust artifact) ONLY when every piece of evidence lines up:
7
+ *
8
+ * 1. The report's ABI version matches ABI_VERSION (RUST-ABI-001).
9
+ * 2. URL metadata is present (artifactUrl is non-empty).
10
+ * 3. A commit hash is present (commit is a non-empty hex-ish string).
11
+ * 4. The artifact's Cargo.lock digest matches the report's evidence digest
12
+ * (RUST-META-003) — a digest mismatch MUST reject the artifact.
13
+ * 5. The platform is in SUPPORTED_PLATFORMS (RUST-PLATFORM-*).
14
+ * 6. EVERY fixture in the report's matrix resolved ok (RUST-001..030).
15
+ *
16
+ * Any failure demotes to B (TS reference). If the TS reference breaker has
17
+ * opened (`allowLegacy` is set by the caller), the selector demotes further to
18
+ * C (legacy path) instead — the two-bytes-of-safety pyramid never runs an
19
+ * unqualified artifact and never silently rides a broken reference.
20
+ *
21
+ * Everything here is PURE: no clock, no storage, no network, no flag read. The
22
+ * flag gates only the reporter seam in emit.ts.
23
+ *
24
+ * PREVENT-002/011/PI-004 honored.
25
+ */
26
+
27
+ import {
28
+ ABI_VERSION,
29
+ RUST_ABI_MISMATCH,
30
+ RUST_ARTIFACT_MISSING,
31
+ RUST_CARGO_DIGEST_MISMATCH,
32
+ RUST_PARITY_MISMATCH,
33
+ RUST_PLATFORM_UNSUPPORTED,
34
+ SUPPORTED_PLATFORMS,
35
+ } from "./types.js";
36
+ import type {
37
+ EngineAbiV1,
38
+ EngineArtifactV1,
39
+ ParityReportV1,
40
+ PlatformSelection,
41
+ SupportedPlatform,
42
+ } from "./types.js";
43
+
44
+ /** A selection failure carrying a machine code (never free-text). */
45
+ export interface SelectionFailure {
46
+ readonly code: string;
47
+ }
48
+
49
+ /** Construct a selection failure. */
50
+ function fail(code: string): SelectionFailure {
51
+ return { code };
52
+ }
53
+
54
+ /** Type guard: is this a supported host platform? */
55
+ export function isSupportedPlatform(platform: string): platform is SupportedPlatform {
56
+ return (SUPPORTED_PLATFORMS as readonly string[]).includes(platform);
57
+ }
58
+
59
+ /** A 40-char lowercase hex string is the canonical bare git SHA-256 commit. */
60
+ const COMMIT_RE = /^[0-9a-f]{40}$/;
61
+
62
+ /** Validate the ABI version matches EngineAbiV1 exactly. Throws on mismatch. */
63
+ export function validateAbi(abi: EngineAbiV1): void {
64
+ if (abi.version !== ABI_VERSION) throw fail(RUST_ABI_MISMATCH);
65
+ }
66
+
67
+ /** Validate URL metadata + commit + Cargo.lock evidence are all present. */
68
+ function validateEvidence(report: ParityReportV1): void {
69
+ if (report.artifactUrl.length === 0) throw fail(RUST_ARTIFACT_MISSING);
70
+ if (!COMMIT_RE.test(report.commit)) throw fail(RUST_ARTIFACT_MISSING);
71
+ // SHA-256 hex digests are exactly 64 chars; anything else is not evidence.
72
+ if (report.cargoLockDigest.length !== 64) {
73
+ throw fail(RUST_ARTIFACT_MISSING);
74
+ }
75
+ if (report.artifactCargoLockDigest.length !== 64) {
76
+ throw fail(RUST_ARTIFACT_MISSING);
77
+ }
78
+ }
79
+
80
+ /** True when every fixture in the matrix resolved ok. */
81
+ export function matrixAllOk(report: ParityReportV1): boolean {
82
+ if (report.matrix.length === 0) return false;
83
+ return report.matrix.every((f) => f.ok && f.code === null);
84
+ }
85
+
86
+ /**
87
+ * Select the engine mode from a parity report and the host platform.
88
+ *
89
+ * Returns mode A only when all six admission checks pass and the digest (the
90
+ * report's own evidence) is internally consistent with the Cargo.lock the
91
+ * artifact claims. Otherwise demotes to B; if the TS reference breaker is open
92
+ * (`allowLegacy`), demotes to C.
93
+ */
94
+ export function selectEngine(
95
+ abi: EngineAbiV1,
96
+ report: ParityReportV1,
97
+ platform: string,
98
+ allowLegacy: boolean = false,
99
+ ): PlatformSelection {
100
+ try {
101
+ validateAbi(abi);
102
+ validateEvidence(report);
103
+ if (!isSupportedPlatform(platform)) throw fail(RUST_PLATFORM_UNSUPPORTED);
104
+ if (report.platform !== platform) throw fail(RUST_PLATFORM_UNSUPPORTED);
105
+ // RUST-META-003: the artifact's own Cargo.lock digest must match the
106
+ // reviewer-accepted evidence; a mismatch rejects the artifact outright.
107
+ if (report.artifactCargoLockDigest !== report.cargoLockDigest) {
108
+ throw fail(RUST_CARGO_DIGEST_MISMATCH);
109
+ }
110
+ if (!matrixAllOk(report)) {
111
+ throw fail(RUST_PARITY_MISMATCH);
112
+ }
113
+ const artifact: EngineArtifactV1 = {
114
+ url: report.artifactUrl,
115
+ commit: report.commit,
116
+ cargoLockDigest: report.cargoLockDigest,
117
+ platform: report.platform as SupportedPlatform,
118
+ qualified: true,
119
+ };
120
+ return { mode: "A", reason: "qualified", artifact };
121
+ } catch (e) {
122
+ const code =
123
+ typeof e === "object" && e !== null && "code" in e
124
+ ? String((e as { code: unknown }).code)
125
+ : RUST_PARITY_MISMATCH;
126
+ if (allowLegacy) {
127
+ return { mode: "C", reason: code, artifact: null };
128
+ }
129
+ return { mode: "B", reason: code, artifact: null };
130
+ }
131
+ }
@@ -0,0 +1,169 @@
1
+ /**
2
+ * platform/types.ts — VC8C engine ABI + parity report + selection types.
3
+ *
4
+ * These are the CANARY-SELECTION contracts. This repo has NO Rust workspace and
5
+ * creates none: an external Rad repo supplies the artifact URL, commit, and
6
+ * Cargo.lock digest/evidence as `ParityReportV1`. The selector only ever admits
7
+ * mode A (qualified external Rust) when every piece of that evidence matches;
8
+ * otherwise it demotes to B (TS reference) or C (legacy).
9
+ *
10
+ * EngineAbiV1 is the FINITE, versioned envelope both sides speak: an input
11
+ * envelope in, an output envelope out, and a machine-coded error envelope. There
12
+ * is deliberately no free-text field and no unbounded version string — an ABI
13
+ * whose version or error space can drift at runtime cannot be cross-checked
14
+ * against a foreign binary.
15
+ *
16
+ * Failure triad (private to the runtime; mirrored here for the selector):
17
+ * A = qualified external Rust artifact
18
+ * B = TS reference (forced by a parity or metadata failure)
19
+ * C = legacy path (forced when the TS reference breaker opens)
20
+ *
21
+ * Conformance IDs RUST-001..030 are registered here as the single source of
22
+ * truth for the sprint's conformance rows; the three named fixtures
23
+ * (RUST-ABI-001, RUST-ERR-002, RUST-META-003) are the headline assertions.
24
+ *
25
+ * PREVENT-PI-004: type definitions only, no network code.
26
+ * PREVENT-011: no `any` type.
27
+ */
28
+
29
+ /** ABI version string shared by every engine implementation. */
30
+ export const ABI_VERSION = "engine-abi-v1";
31
+
32
+ /** Supported host platforms; an artifact for any other platform is rejected. */
33
+ export const SUPPORTED_PLATFORMS = [
34
+ "linux-x64",
35
+ "linux-arm64",
36
+ "darwin-x64",
37
+ "darwin-arm64",
38
+ "win32-x64",
39
+ ] as const;
40
+
41
+ /** A supported host platform. */
42
+ export type SupportedPlatform = (typeof SUPPORTED_PLATFORMS)[number];
43
+
44
+ /** Failure code: canonical bytes or failure codes disagreed across runners. */
45
+ export const RUST_PARITY_MISMATCH = "RUST_PARITY_MISMATCH";
46
+
47
+ /** Failure code: a neutral frame ended mid-record (partial write/read). */
48
+ export const RUST_FRAME_TRUNCATED = "RUST_FRAME_TRUNCATED";
49
+
50
+ /** Failure code: the artifact ABI version does not match ABI_VERSION. */
51
+ export const RUST_ABI_MISMATCH = "RUST_ABI_MISMATCH";
52
+
53
+ /** Failure code: the artifact Cargo.lock digest does not match the evidence. */
54
+ export const RUST_CARGO_DIGEST_MISMATCH = "RUST_CARGO_DIGEST_MISMATCH";
55
+
56
+ /** Failure code: the artifact targets a platform outside SUPPORTED_PLATFORMS. */
57
+ export const RUST_PLATFORM_UNSUPPORTED = "RUST_PLATFORM_UNSUPPORTED";
58
+
59
+ /** Failure code: the report names no artifact (URL/commit missing). */
60
+ export const RUST_ARTIFACT_MISSING = "RUST_ARTIFACT_MISSING";
61
+
62
+ /** The finite engine selection modes of the failure triad. */
63
+ export type EngineMode = "A" | "B" | "C";
64
+
65
+ /**
66
+ * EngineAbiV1 — the versioned, bounded envelope both the TS reference and an
67
+ * external Rust binary speak. `version` is always ABI_VERSION; error envelopes
68
+ * carry only a machine code, never free-text.
69
+ */
70
+ export interface EngineAbiV1 {
71
+ readonly version: typeof ABI_VERSION;
72
+ /** The input envelope: canonical, machine-typed production inputs. */
73
+ readonly input: EngineInputEnvelope;
74
+ /** The output envelope: canonical, machine-typed production outputs. */
75
+ readonly output: EngineOutputEnvelope;
76
+ /** The error envelope: a bounded machine-code set. */
77
+ readonly error: EngineErrorEnvelope;
78
+ }
79
+
80
+ /** The canonical input envelope accepted by any engine. */
81
+ export interface EngineInputEnvelope {
82
+ readonly schema: "engine-input-v1";
83
+ readonly fixtureId: string;
84
+ /** The raw bytes as a hex string so the envelope stays JSON-safe. */
85
+ readonly inputHex: string;
86
+ }
87
+
88
+ /** The canonical output envelope produced by any engine. */
89
+ export interface EngineOutputEnvelope {
90
+ readonly schema: "engine-output-v1";
91
+ readonly fixtureId: string;
92
+ /** The produced bytes as a hex string (canonical byte comparison). */
93
+ readonly outputHex: string;
94
+ /** The machine failure code, or null when the fixture succeeded. */
95
+ readonly failureCode: string | null;
96
+ }
97
+
98
+ /** The bounded set of machine error codes an engine may emit. */
99
+ export interface EngineErrorEnvelope {
100
+ readonly schema: "engine-error-v1";
101
+ readonly codes: readonly [string, ...string[]];
102
+ }
103
+
104
+ /** One resolved fixture result inside a ParityReportV1 matrix. */
105
+ export interface ParityFixtureResult {
106
+ readonly fixtureId: string;
107
+ readonly ok: boolean;
108
+ /** The machine code reported when not ok, else null. */
109
+ readonly code: string | null;
110
+ }
111
+
112
+ /**
113
+ * The result of a single engine selection. `artifact` is non-null ONLY when
114
+ * mode is A (a qualified external Rust artifact is in use).
115
+ */
116
+ export interface PlatformSelection {
117
+ readonly mode: EngineMode;
118
+ /** A short machine reason for the mode (never free-text prose). */
119
+ readonly reason: string;
120
+ readonly artifact: EngineArtifactV1 | null;
121
+ }
122
+
123
+ /** A qualified external Rust artifact as evidenced by a parity report. */
124
+ export interface EngineArtifactV1 {
125
+ readonly url: string;
126
+ /** The external repo commit the artifact was built from. */
127
+ readonly commit: string;
128
+ /** SHA-256 digest of the artifact's Cargo.lock, matched against evidence. */
129
+ readonly cargoLockDigest: string;
130
+ readonly platform: SupportedPlatform;
131
+ /** Every fixture in the report's matrix resolved ok. */
132
+ readonly qualified: true;
133
+ }
134
+
135
+ /**
136
+ * ParityReportV1 — the reviewer-accepted evidence an external repo supplies.
137
+ * Acceptance requires url, commit, cargoLockDigest, platform, and a matrix in
138
+ * which EVERY fixture resolved ok. The selector ALSO compares the artifact's
139
+ * own Cargo.lock digest (`artifactCargoLockDigest`) against the evidenced
140
+ * digest (`cargoLockDigest`): RUST-META-003 — a mismatch rejects the artifact.
141
+ */
142
+ export interface ParityReportV1 {
143
+ readonly schema: "parity-report-v1";
144
+ /** URL of the external Rust artifact. */
145
+ readonly artifactUrl: string;
146
+ /** External repo commit the artifact was built from. */
147
+ readonly commit: string;
148
+ /** SHA-256 digest of the artifact's Cargo.lock, as-evidenced. */
149
+ readonly cargoLockDigest: string;
150
+ /** The artifact's own claimed Cargo.lock digest; MUST match the evidence. */
151
+ readonly artifactCargoLockDigest: string;
152
+ /** The platform the artifact targets. */
153
+ readonly platform: string;
154
+ /** Per-fixture results; used as Cargo.lock evidence when matched against. */
155
+ readonly matrix: ReadonlyArray<ParityFixtureResult>;
156
+ }
157
+
158
+ /** Conformance IDs RUST-001..RUST-030 for the 30 numbered conformance rows. */
159
+ export const RUST_CONFORMANCE_IDS: readonly string[] = Array.from(
160
+ { length: 30 },
161
+ (_v, i) => `RUST-${String(i + 1).padStart(3, "0")}`,
162
+ );
163
+
164
+ /** Named conformance fixtures for the sprint's headline assertions. */
165
+ export const RUST_NAMED_FIXTURES = [
166
+ "RUST-ABI-001",
167
+ "RUST-ERR-002",
168
+ "RUST-META-003",
169
+ ] as const;
@@ -1,2 +0,0 @@
1
- import{j as e,r as m,B as l}from"./index-4MkLsevY.js";import{C as o,a as c,b as i,c as d}from"./card-D3KAYtck.js";async function N(){const s=await fetch("/api/vector-cortex/evaluation");if(!s.ok)throw new Error(`vector-cortex evaluation: ${s.status}`);return s.json()}async function b(){const s=await fetch("/api/vector-cortex/health");if(!s.ok)throw new Error(`vector-cortex health: ${s.status}`);return s.json()}async function S(){const s=await fetch("/api/vector-cortex/topology");if(!s.ok)throw new Error(`vector-cortex topology: ${s.status}`);return s.json()}async function V(){const s=await fetch("/api/vector-cortex/query");if(!s.ok)throw new Error(`vector-cortex query: ${s.status}`);return s.json()}async function E(){const s=await fetch("/api/vector-cortex/shards");if(!s.ok)throw new Error(`vector-cortex shards: ${s.status}`);return s.json()}async function R(){const s=await fetch("/api/vector-cortex/reconstruct");if(!s.ok)throw new Error(`vector-cortex reconstruct: ${s.status}`);return s.json()}async function F(){const s=await fetch("/api/vector-cortex/plans");if(!s.ok)throw new Error(`vector-cortex plans: ${s.status}`);return s.json()}async function k(){const s=await fetch("/api/vector-cortex/render");if(!s.ok)throw new Error(`vector-cortex render: ${s.status}`);return s.json()}async function A(){const s=await fetch("/api/vector-cortex/rollout");if(!s.ok)throw new Error(`vector-cortex rollout: ${s.status}`);return s.json()}async function T(){const s=await fetch("/api/vector-cortex/closure-proof");if(!s.ok)throw new Error(`vector-cortex closure-proof: ${s.status}`);return s.json()}async function M(){const s=await fetch("/api/vector-cortex/restore");if(!s.ok)throw new Error(`vector-cortex restore: ${s.status}`);return s.json()}async function P(){const s=await fetch("/api/vector-cortex/repair");if(!s.ok)throw new Error(`vector-cortex repair: ${s.status}`);return s.json()}async function O(s="default"){const a=await fetch(`/api/vector-cortex/ledger?session=${encodeURIComponent(s)}`);if(!a.ok)throw new Error(`vector-cortex ledger: ${a.status}`);return a.json()}async function I(s){const a=await fetch("/api/vector-cortex/breakers/reset",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subsystem:s})});if(!a.ok)throw new Error(`vector-cortex reset: ${a.status}`);return a.json()}async function $(){const s=await fetch("/api/vector-cortex/cache-crystals");if(!s.ok)throw new Error(`vector-cortex cache-crystals: ${s.status}`);return s.json()}async function w(){const s=await fetch("/api/vector-cortex/cache-economics");if(!s.ok)throw new Error(`vector-cortex cache-economics: ${s.status}`);return s.json()}async function B(){const s=await fetch("/api/vector-cortex/cache-diagnostics");if(!s.ok)throw new Error(`vector-cortex cache-diagnostics: ${s.status}`);return s.json()}async function D(){const s=await fetch("/api/vector-cortex/outcomes");if(!s.ok)throw new Error(`vector-cortex outcomes: ${s.status}`);return s.json()}async function L(){const s=await fetch("/api/vector-cortex/policy");if(!s.ok)throw new Error(`vector-cortex policy: ${s.status}`);return s.json()}function r({label:s,value:a}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-xs text-muted-foreground",children:s}),e.jsx("div",{className:"font-mono text-sm",children:a})]})}function U(){const[s,a]=m.useState({loading:!0,error:null,data:null,health:null,ledger:null,topology:null,query:null,shards:null,reconstruct:null,plans:null,render:null,rollout:null,closureProof:null,restore:null,repair:null,crystals:null,economics:null,diagnostics:null,outcomes:null,policy:null}),u=m.useCallback(()=>{a(t=>({...t,loading:!0})),N().then(t=>a(n=>({...n,data:t,loading:!1,error:null}))).catch(t=>a(n=>({...n,loading:!1,error:t instanceof Error?t.message:String(t)}))),b().then(t=>a(n=>({...n,health:t}))).catch(()=>{}),O().then(t=>a(n=>({...n,ledger:t}))).catch(()=>{}),S().then(t=>a(n=>({...n,topology:t}))).catch(()=>{}),V().then(t=>a(n=>({...n,query:t}))).catch(()=>{}),E().then(t=>a(n=>({...n,shards:t}))).catch(()=>{}),R().then(t=>a(n=>({...n,reconstruct:t}))).catch(()=>{}),F().then(t=>a(n=>({...n,plans:t}))).catch(()=>{}),k().then(t=>a(n=>({...n,render:t}))).catch(()=>{}),A().then(t=>a(n=>({...n,rollout:t}))).catch(()=>{}),T().then(t=>a(n=>({...n,closureProof:t}))).catch(()=>{}),M().then(t=>a(n=>({...n,restore:t}))).catch(()=>{}),P().then(t=>a(n=>({...n,repair:t}))).catch(()=>{}),$().then(t=>a(n=>({...n,crystals:t}))).catch(()=>{}),w().then(t=>a(n=>({...n,economics:t}))).catch(()=>{}),B().then(t=>a(n=>({...n,diagnostics:t}))).catch(()=>{}),D().then(t=>a(n=>({...n,outcomes:t}))).catch(()=>{}),L().then(t=>a(n=>({...n,policy:t}))).catch(()=>{})},[]);return m.useEffect(()=>{u();const t=setInterval(u,5e3);return()=>clearInterval(t)},[u]),[s,u]}function _({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Validated Prompt Renderer (VC5B)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Render fixtures",value:String(s.renderCount)}),e.jsx(r,{label:"Provider profiles",value:String(s.providerCount)}),e.jsx(r,{label:"Known profiles",value:String(s.knownProfiles.length)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only render conformance route — no prompt text or session payloads exposed."})]}):e.jsx("div",{className:"vc-empty",children:"Renderer disabled (VC5B off)."})})]})}function q({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Live Graduated Rollout (VC5C)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Gate",value:`${s.gatePct}%`}),e.jsx(r,{label:"Exposed buckets",value:String(s.bucketCount)}),e.jsx(r,{label:"Total buckets",value:String(s.buckets)}),e.jsx(r,{label:"Promotion",value:s.promotionBlocked?"FROZEN":"OPEN"}),e.jsx(r,{label:"Events",value:String(s.events)}),e.jsx(r,{label:"Sessions",value:String(s.sessions)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only rollout route — no session payloads or bucket→session mappings exposed."})]}):e.jsx("div",{className:"vc-empty",children:"Rollout disabled (VC5C off)."})})]})}function H({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Closure Optimization (VC6A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Optimizations",value:String(s.optimizations)}),e.jsx(r,{label:"Proof rejections",value:String(s.proofRejections)}),e.jsx(r,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(r,{label:"Retained edges",value:String(s.retainedEdgeTotal)}),e.jsx(r,{label:"Removed edges",value:String(s.removedEdgeTotal)}),e.jsx(r,{label:"Conservative walks",value:String(s.conservativeTraversalTotal)}),e.jsx(r,{label:"Optimized walks",value:String(s.optimizedTraversalTotal)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only closure diagnostics — aggregate counts only; per-edge proof rows, node ids, and source payloads are never exposed (SECURITY_PRIVACY)."})]}):e.jsx("div",{className:"vc-empty",children:"Closure optimization disabled (VC6A off) — conservative VC4C closure used directly (mode B)."})})]})}function z({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Exact Source Restoration (VC6B)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Restore attempts",value:String(s.restoreAttempts)}),e.jsx(r,{label:"Restored",value:String(s.restoredCount)}),e.jsx(r,{label:"Missing source",value:String(s.missingCount)}),e.jsx(r,{label:"Digest rejections",value:String(s.digestRejections)}),e.jsx(r,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only restore diagnostics — counts and HEAL_RESTORE_* codes only. There is no payload endpoint: restored bytes, span ids, node ids, and ledger text are never exposed (SECURITY_PRIVACY)."})]}):e.jsx("div",{className:"vc-empty",children:"Exact source restoration disabled (VC6B off) — no exact source is restored; omitted context is disclosed as loss (mode C)."})})]})}function Y({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Self-Healing Derived State (VC6C)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Repair attempts",value:String(s.repairAttempts)}),e.jsx(r,{label:"Repairs planned",value:String(s.repairsPlanned)}),e.jsx(r,{label:"Pointers switched",value:String(s.pointersSwitched)}),e.jsx(r,{label:"Backoffs",value:String(s.backoffs)}),e.jsx(r,{label:"Last backoff",value:s.lastBackoffMs===null?"none":`${s.lastBackoffMs}ms`}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only repair diagnostics — counts and HEAL_REPAIR_* codes only. There is no payload endpoint: subsystem source bytes, gap ranges, high-water marks, root digests, and ledger text are never exposed (SECURITY_PRIVACY)."})]}):e.jsx("div",{className:"vc-empty",children:"Self-healing derived state disabled (VC6C off) — no controller detects gaps or rebuilds derived state; derived state is reported disabled rather than healed (mode C)."})})]})}function W({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Frozen Range Crystals (VC7A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Crystals",value:String(s.crystalCount)}),e.jsx(r,{label:"Frozen bytes",value:String(s.totalBytes)}),e.jsx(r,{label:"Hits",value:String(s.hits)}),e.jsx(r,{label:"Misses",value:String(s.misses)}),e.jsx(r,{label:"Hit bytes",value:String(s.hitBytes)}),e.jsx(r,{label:"Writes",value:String(s.writes)}),e.jsx(r,{label:"Duplicate writes",value:String(s.duplicateWrites)}),e.jsx(r,{label:"Collisions",value:String(s.collisions)}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only crystal diagnostics — counts, byte volumes, and CRY_* codes only. A crystal is a frozen rendered prompt, so frozen bytes, covered ranges, span/covered digests, request digests, and session ids are never exposed (SECURITY_PRIVACY). Keys exclude the global ledger frontier, so an unrelated append does not invalidate a crystal; a covered-byte, dependency, renderer, or profile change does. Collisions mean two renders of one identity disagreed — the stored crystal is never overwritten."})]}):e.jsx("div",{className:"vc-empty",children:"Frozen range crystals disabled (VC7A off) — nothing is served from the crystal cache and every render is produced fresh; the cache is reported bypassed rather than hit (mode C)."})})]})}function G({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Cache Economics (VC7B)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Profiles",value:String(s.profileCount)}),e.jsx(r,{label:"Proven exclusions",value:String(s.provenExclusions)}),e.jsx(r,{label:"Unproven exclusions",value:String(s.unprovenExclusions)}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only cache-economics diagnostics — counts and ECON_* codes only. Cache economics price a frozen rendered prompt's reuse, so provider prices, covered ranges, span/covered digests, request digests, and session ids are never exposed (SECURITY_PRIVACY). An unproven exclusion (declared without a proving fixture id) is rejected by the exclusion-proof rule and is reported here only as a count."})]}):e.jsx("div",{className:"vc-empty",children:"Cache economics disabled (VC7B off) — no cache reuse is priced; the cache-economics surface is reported bypassed rather than priced (mode C)."})})]})}function K({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Cache Diagnostics & Breakers (VC7C)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Profile misses",value:String(s.profileMisses)}),e.jsx(r,{label:"Range misses",value:String(s.rangeMisses)}),e.jsx(r,{label:"Dependency misses",value:String(s.dependencyMisses)}),e.jsx(r,{label:"Request misses",value:String(s.requestMisses)}),e.jsx(r,{label:"Generation misses",value:String(s.generationMisses)}),e.jsx(r,{label:"Unknown misses",value:String(s.unknownMisses)}),e.jsx(r,{label:"Serves blocked",value:String(s.serveBlocked)}),e.jsx(r,{label:"Breaker",value:s.breakerState}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only cache miss diagnostics — per-class counts and CACHE_*/M5_* codes only. Classification is exclusive and ordered (profile, range, dependency, request, generation, then unknown), so each miss increments exactly one counter. A miss diagnostic would otherwise carry the missed request itself, so request payloads, RequestHashV2 digests, covered ranges, span/covered digests, profile digests, and session ids are never exposed (SECURITY_PRIVACY). Blocked serves are demotions taken BEFORE a cache serve — on key collision, stale generation, digest failure, or profile mismatch — and are reported here only as a count; the breaker cannot be reset from this reader-only surface."})]}):e.jsx("div",{className:"vc-empty",children:"Cache diagnostics disabled (VC7C off) — no miss is classified and no cache serve is attested here, so all caches are reported bypassed rather than hit (mode C). The classification and breaker arithmetic still runs; only this reporting seam is suppressed."})})]})}function Q({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Consent-Bound Outcomes (VC8A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Outcomes",value:String(s.outcomeCount)}),e.jsx(r,{label:"Consented sessions",value:String(s.consentedSessions)}),e.jsx(r,{label:"Revoked sessions",value:String(s.revokedSessions)}),e.jsx(r,{label:"Manifests",value:String(s.manifestCount)}),e.jsx(r,{label:"Excluded records",value:String(s.excludedCount)}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only consent-bound outcome ledger — aggregate counts and OUT_ codes only. The outcome ledger carries metrics without payload, so no prompt bytes, response text, free-text, or session content ever reaches the client. Dataset inclusion requires active explicit consent at export time; revocations disappear from future manifests."})]}):e.jsx("div",{className:"vc-empty",children:"Outcome ledger disabled (VC8A off) — no outcomes are appended and no dataset manifests are built, so all learning is bypassed (mode C). The ledger validation, consent evaluation, and manifest builder arithmetic still run; only this reporting seam is suppressed."})})]})}function Z({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Shadow Adaptive Policy (VC8B)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Mode",value:s.mode}),e.jsx(r,{label:"Shadow decisions",value:String(s.shadowDecisions)}),e.jsx(r,{label:"Clamped",value:String(s.clampedDecisions)}),e.jsx(r,{label:"Rejected inputs",value:String(s.rejectedInputs)}),e.jsx(r,{label:"Live mutations",value:String(s.liveMutations)}),e.jsx(r,{label:"Pressure version",value:String(s.pressureVersion)}),e.jsx(r,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(r,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only shadow adaptive policy — aggregate counts and POL_/M7_ codes only. Policy actions are from a finite set chosen deterministically by the canonical pressure level; budgets are clamped into a configured window after the pressure factor. Unknown pressure labels are rejected as POL_PRESSURE_UNKNOWN, never coerced. The shadow engine is structurally incapable of affecting the live path — inputs are deep-copied and the prompt digest is pinned before and after — so liveMutations is always zero. M7 migrates legacy pressure labels to the v2 canonical five by copy/validate/switch; an unknown label blocks the switch (M7_PRESSURE_UNKNOWN). No prompt bytes, session content, or free-text ever reaches the client."})]}):e.jsx("div",{className:"vc-empty",children:"Shadow adaptive policy disabled (VC8B off) — no shadow decisions are reported, so the live path uses the predecessor thresholds (mode C). The policy, shadow, and M7 migration arithmetic still run; only this reporting seam is suppressed."})})]})}function J({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Dual-Tier Shards (VC4A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Semantic shards",value:String(s.semanticCount)}),e.jsx(r,{label:"Exact shards",value:String(s.exactCount)}),e.jsx(r,{label:"Byte total",value:String(s.byteTotal)}),e.jsx(r,{label:"Protected bytes",value:String(s.protectedByteTotal)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only count/byte aggregate; staged in-memory this sprint."})]}):e.jsx("div",{className:"vc-empty",children:"Dual-tier shards disabled (VC4A off)."})})]})}function X({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Reconstruction Fidelity (VC4C)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"Closure attempts",value:String(s.closureAttempts)}),e.jsx(r,{label:"Closure rejections",value:String(s.closureRejections)}),e.jsx(r,{label:"Validated",value:String(s.validatedCount)}),e.jsx(r,{label:"Invalidated",value:String(s.invalidatedCount)}),e.jsx(r,{label:"Span total",value:String(s.spanTotal)}),e.jsx(r,{label:"Byte total",value:String(s.byteTotal)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only closure/validation aggregate; staged in-memory this sprint."})]}):e.jsx("div",{className:"vc-empty",children:"Reconstruction fidelity disabled (VC4C off)."})})]})}function ee({view:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Plan Manifests (VC5A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"DAG fixtures",value:String(s.dagCount)}),e.jsx(r,{label:"Plan fixtures",value:String(s.plannerCount)}),e.jsx(r,{label:"Plans exposed",value:String(s.plans.length)})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only plan manifests only — no session payloads or prompt text. Per-run plan outputs are staged in-memory this sprint."})]}):e.jsx("div",{className:"vc-empty",children:"PromptDagV1 + budgeted planner disabled (VC5A off)."})})]})}function se({topology:s,query:a}){return e.jsxs(e.Fragment,{children:[e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Derived Cortex Store (VC3A)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:[e.jsx(r,{label:"Generation",value:s.generationId??"—"}),e.jsx(r,{label:"Ordinal",value:s.ordinal??"—"}),e.jsx(r,{label:"Records",value:String(s.recordCount)}),e.jsx(r,{label:"Frontier (HW)",value:s.sourceHighWater}),e.jsx(r,{label:"Root digest",value:s.rootDigest?s.rootDigest.slice(0,16):"—"}),s.nodes!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx(r,{label:"Nodes",value:String(s.nodes?.length??0)}),e.jsx(r,{label:"Edges",value:String(s.edges?.length??0)}),e.jsx(r,{label:"Graph digest",value:s.generationDigest?s.generationDigest.slice(0,16):"—"})]})]}),s.nodes!==void 0&&(s.edges?.length??0)>0&&e.jsxs("div",{className:"mt-4 max-h-56 overflow-y-auto",children:[e.jsx("div",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Topology edges (VC3B)"}),e.jsxs("table",{className:"w-full text-left text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50 text-muted-foreground",children:[e.jsx("th",{className:"py-1 pr-2",children:"source"}),e.jsx("th",{className:"py-1 pr-2",children:"target"}),e.jsx("th",{className:"py-1 pr-2",children:"head"}),e.jsx("th",{className:"py-1 pr-2",children:"dir"}),e.jsx("th",{className:"py-1",children:"score"})]})}),e.jsx("tbody",{children:s.edges?.map((u,t)=>e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-1 pr-2 font-mono",children:u.source}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:u.target}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:u.head}),e.jsx("td",{className:"py-1 pr-2",children:u.direction}),e.jsx("td",{className:"py-1 font-mono",children:u.score})]},`${u.source}-${u.target}-${u.head}-${t}`))})]})]})]}):e.jsx("div",{className:"vc-empty",children:"Cortex store disabled (VC3A off)."})})]}),e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Topology Query Diagnostics (VC3C)"}),a?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:a?.enabled?e.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:e.jsx(r,{label:"Router version",value:String(a.routerVersion)})}):e.jsx("div",{className:"vc-empty",children:"Query diagnostics unavailable (VC3C off)."})})]})]})}function re({ledger:s}){return e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Occurrence Ledger (VC1B)"}),s?.enabled?e.jsx(l,{variant:"success",children:"ACTIVE"}):e.jsx(l,{variant:"danger",children:"OFF"})]})}),e.jsx(d,{children:s?.enabled?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-3 grid grid-cols-2 gap-4 md:grid-cols-3",children:[e.jsx(r,{label:"Session",value:s.session}),e.jsx(r,{label:"High-water",value:s.highWater}),e.jsx(r,{label:"Occurrences",value:String(s.count)})]}),s.occurrences.length===0?e.jsx("div",{className:"vc-empty",children:"No occurrences recorded."}):e.jsx("div",{className:"max-h-64 overflow-y-auto",children:e.jsxs("table",{className:"w-full text-left text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border/50 text-muted-foreground",children:[e.jsx("th",{className:"py-1 pr-2",children:"seq"}),e.jsx("th",{className:"py-1 pr-2",children:"eventId"}),e.jsx("th",{className:"py-1 pr-2",children:"kind"}),e.jsx("th",{className:"py-1 pr-2",children:"toolCall"}),e.jsx("th",{className:"py-1",children:"digest"})]})}),e.jsx("tbody",{children:s.occurrences.map(a=>e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-1 pr-2 font-mono",children:a.seq}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:a.eventId}),e.jsx("td",{className:"py-1 pr-2",children:a.kind}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:a.toolCallId??"—"}),e.jsx("td",{className:"max-w-[180px] truncate font-mono text-muted-foreground",children:a.digest})]},`${a.seq}-${a.eventId}`))})]})})]}):e.jsx("div",{className:"vc-empty",children:"Ledger disabled (VC1B off)."})})]})}function g({mode:s,count:a}){return e.jsxs("div",{className:"flex items-center justify-between border-b border-border/50 py-1 text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:["Mode ",s]}),e.jsx("span",{className:"font-mono",children:a})]})}function ne(){const[s,a]=U(),[u,t]=m.useState(null),{loading:n,error:f,data:x,health:h}=s,y=()=>{I("provider").then(j=>(t(`Breaker "${j.subsystem}" ${j.state}; evidence retained: ${j.failures} failures / ${j.attempts} attempts`),b())).then(j=>{a()}).catch(j=>t(j instanceof Error?j.message:String(j)))};if(n&&!x)return e.jsx("div",{className:"vc-loading",children:"Loading vector-cortex evaluation…"});if(f&&!x)return e.jsxs("div",{className:"vc-error",children:["Error: ",f]});if(!x)return e.jsx("div",{className:"vc-empty",children:"No evaluation data available."});const p=Math.max(1,...x.histogram.cells,x.histogram.overflow);return e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:"Vector Cortex Evaluation"}),x.enabled?e.jsx(l,{variant:"warning",children:"OBSERVER PENDING (A)"}):e.jsx(l,{variant:"danger",children:"MODE C (OFF)"})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs(o,{children:[e.jsx(c,{children:e.jsx(i,{children:"Samples"})}),e.jsxs(d,{children:[e.jsx("div",{className:"text-3xl font-bold",children:x.samples}),e.jsxs("div",{className:"mt-2 flex flex-col",children:[e.jsx(g,{mode:"A",count:x.byMode.A}),e.jsx(g,{mode:"B",count:x.byMode.B}),e.jsx(g,{mode:"C",count:x.byMode.C})]})]})]}),e.jsxs(o,{className:"md:col-span-2",children:[e.jsx(c,{children:e.jsx(i,{children:"Latency Histogram (ms, inclusive edges)"})}),e.jsxs(d,{children:[e.jsxs("div",{className:"flex items-end gap-2",style:{height:160},children:[x.histogram.edges.map((j,v)=>{const C=x.histogram.cells[v]/p*140;return e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:x.histogram.cells[v]}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,C),background:"#6366f1"}}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["≤",j]})]},j)}),e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:x.histogram.overflow}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,x.histogram.overflow/p*140),background:"#f87171"}}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:">250"})]})]}),e.jsxs("div",{className:"mt-1 text-xs text-muted-foreground",children:["Total: ",x.histogram.total," · Rejects: ",x.rejects.length]})]})]})]}),e.jsxs(o,{children:[e.jsx(c,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(i,{children:"Live Safety Envelope (VC0C)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[h?.stateSource==="ephemeral"&&e.jsx(l,{variant:"outline",children:"EPHEMERAL (non-live)"}),e.jsx("button",{onClick:y,disabled:!h?.enabled,className:"rounded border border-border px-2 py-1 text-xs disabled:opacity-50",children:"Reset Cooldown"})]})]})}),e.jsxs(d,{children:[u&&e.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:u}),h?e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(r,{label:"State",value:h.state}),e.jsx(r,{label:"Mode",value:h.mode}),e.jsx(r,{label:"Window",value:`${h.windowMs}ms`}),e.jsx(r,{label:"Probes",value:String(h.probeCount)}),e.jsx(r,{label:"Backoff",value:`${h.backoffDelayMs}ms`}),e.jsx(r,{label:"Failures",value:`${h.failures}/${h.attempts}`}),e.jsx(r,{label:"Frontier",value:h.stateSource==="ephemeral"?"non-live":h.frontierFrozen?"FROZEN":"LIVE"}),e.jsx(r,{label:"Spool lag",value:String(h.spoolLag)}),e.jsx(r,{label:"Encoder mode",value:h.encoderMode}),e.jsx(r,{label:"Encoder asset",value:h.encoderAssetDigest?h.encoderAssetDigest.slice(0,12):"none"})]}):e.jsx("div",{className:"vc-empty",children:"Health unavailable (VC0C off)."})]})]}),e.jsx(se,{topology:s.topology,query:s.query}),e.jsx(J,{view:s.shards}),e.jsx(X,{view:s.reconstruct}),e.jsx(ee,{view:s.plans}),e.jsx(_,{view:s.render}),e.jsx(q,{view:s.rollout}),e.jsx(H,{view:s.closureProof}),e.jsx(z,{view:s.restore}),e.jsx(Y,{view:s.repair}),e.jsx(W,{view:s.crystals}),e.jsx(G,{view:s.economics}),e.jsx(K,{view:s.diagnostics}),e.jsx(Q,{view:s.outcomes}),e.jsx(Z,{view:s.policy}),e.jsx(re,{ledger:s.ledger})]})}export{ne as default};
2
- //# sourceMappingURL=VectorCortexTab-DSz16qtM.js.map