pi-mega-compact 0.20.76 → 0.20.78

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 (75) hide show
  1. package/dist/config/vector-cortex-vc9b.js +4 -3
  2. package/dist/extensions/dashboard-server/api-contracts/endpoints/registry-ext.js +1 -1
  3. package/dist/extensions/dashboard-server/routes-rag-settings-vector-cortex.js +1 -1
  4. package/dist/extensions/dashboard-server/routes-setup-cortex-actions.js +6 -5
  5. package/dist/extensions/dashboard-server/setup-cortex-actions-vc2.js +334 -0
  6. package/dist/extensions/dashboard-server/setup-cortex-actions.js +18 -69
  7. package/dist/src/config/vector-cortex-vc9b.js +4 -3
  8. package/extensions/dashboard-client/dist/assets/{AdminTab-B8JqsA41.js → AdminTab-BsA8-_bX.js} +2 -2
  9. package/extensions/dashboard-client/dist/assets/{AdminTab-B8JqsA41.js.map → AdminTab-BsA8-_bX.js.map} +1 -1
  10. package/extensions/dashboard-client/dist/assets/{AreaChart-CeaexvWO.js → AreaChart-BRHEfWhc.js} +2 -2
  11. package/extensions/dashboard-client/dist/assets/{AreaChart-CeaexvWO.js.map → AreaChart-BRHEfWhc.js.map} +1 -1
  12. package/extensions/dashboard-client/dist/assets/{BarChart-Bhyviy7_.js → BarChart-C-M0LaFc.js} +2 -2
  13. package/extensions/dashboard-client/dist/assets/{BarChart-Bhyviy7_.js.map → BarChart-C-M0LaFc.js.map} +1 -1
  14. package/extensions/dashboard-client/dist/assets/{CacheTab-C6bFdEHq.js → CacheTab-Cj3n59U3.js} +2 -2
  15. package/extensions/dashboard-client/dist/assets/{CacheTab-C6bFdEHq.js.map → CacheTab-Cj3n59U3.js.map} +1 -1
  16. package/extensions/dashboard-client/dist/assets/{ConfigTab-CbsdI5yj.js → ConfigTab-C016XTNC.js} +2 -2
  17. package/extensions/dashboard-client/dist/assets/{ConfigTab-CbsdI5yj.js.map → ConfigTab-C016XTNC.js.map} +1 -1
  18. package/extensions/dashboard-client/dist/assets/{EventsTab-kvB5Znx2.js → EventsTab-DE29fuqe.js} +2 -2
  19. package/extensions/dashboard-client/dist/assets/{EventsTab-kvB5Znx2.js.map → EventsTab-DE29fuqe.js.map} +1 -1
  20. package/extensions/dashboard-client/dist/assets/{HealthTab-DqEUk5LW.js → HealthTab-D4eVI8ar.js} +2 -2
  21. package/extensions/dashboard-client/dist/assets/{HealthTab-DqEUk5LW.js.map → HealthTab-D4eVI8ar.js.map} +1 -1
  22. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CS5HqDkY.js → MaintenanceTab-4fJ7M4S4.js} +2 -2
  23. package/extensions/dashboard-client/dist/assets/{MaintenanceTab-CS5HqDkY.js.map → MaintenanceTab-4fJ7M4S4.js.map} +1 -1
  24. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-Oq-iqvUq.js → MemoryMapTab-CDbcK9e4.js} +2 -2
  25. package/extensions/dashboard-client/dist/assets/{MemoryMapTab-Oq-iqvUq.js.map → MemoryMapTab-CDbcK9e4.js.map} +1 -1
  26. package/extensions/dashboard-client/dist/assets/{MetricsCards-36RVmtPj.js → MetricsCards-VUEcgGzo.js} +2 -2
  27. package/extensions/dashboard-client/dist/assets/{MetricsCards-36RVmtPj.js.map → MetricsCards-VUEcgGzo.js.map} +1 -1
  28. package/extensions/dashboard-client/dist/assets/MetricsTab-CKqJ0Zl-.js +2 -0
  29. package/extensions/dashboard-client/dist/assets/{MetricsTab-Clkcniuo.js.map → MetricsTab-CKqJ0Zl-.js.map} +1 -1
  30. package/extensions/dashboard-client/dist/assets/{OverviewTab-Cl2Zx7r1.js → OverviewTab-9Kxo79mi.js} +2 -2
  31. package/extensions/dashboard-client/dist/assets/{OverviewTab-Cl2Zx7r1.js.map → OverviewTab-9Kxo79mi.js.map} +1 -1
  32. package/extensions/dashboard-client/dist/assets/{ReposTab-DUoDgjk-.js → ReposTab-C4iveqrP.js} +2 -2
  33. package/extensions/dashboard-client/dist/assets/{ReposTab-DUoDgjk-.js.map → ReposTab-C4iveqrP.js.map} +1 -1
  34. package/extensions/dashboard-client/dist/assets/{SessionsTab-hEQ_OAfB.js → SessionsTab-DSEwkMQm.js} +2 -2
  35. package/extensions/dashboard-client/dist/assets/{SessionsTab-hEQ_OAfB.js.map → SessionsTab-DSEwkMQm.js.map} +1 -1
  36. package/extensions/dashboard-client/dist/assets/{SetupTab-Bqibg0cD.js → SetupTab-CCyWgy4O.js} +2 -2
  37. package/extensions/dashboard-client/dist/assets/{SetupTab-Bqibg0cD.js.map → SetupTab-CCyWgy4O.js.map} +1 -1
  38. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-9QMQUc7L.js → TimeSavedCard-CyD8e_e_.js} +2 -2
  39. package/extensions/dashboard-client/dist/assets/{TimeSavedCard-9QMQUc7L.js.map → TimeSavedCard-CyD8e_e_.js.map} +1 -1
  40. package/extensions/dashboard-client/dist/assets/{TurnMemoryView-DAfqhJqd.js → TurnMemoryView-5tLbWkRv.js} +2 -2
  41. package/extensions/dashboard-client/dist/assets/{TurnMemoryView-DAfqhJqd.js.map → TurnMemoryView-5tLbWkRv.js.map} +1 -1
  42. package/extensions/dashboard-client/dist/assets/TurnsTab-C7pm92Hg.js +2 -0
  43. package/extensions/dashboard-client/dist/assets/{TurnsTab-C-uZNH2F.js.map → TurnsTab-C7pm92Hg.js.map} +1 -1
  44. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-DyOagOVb.js → VcStatusBadge-ObhcIyfN.js} +2 -2
  45. package/extensions/dashboard-client/dist/assets/{VcStatusBadge-DyOagOVb.js.map → VcStatusBadge-ObhcIyfN.js.map} +1 -1
  46. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BxsbSUGv.js → VectorCortexTab-BtHZb7o7.js} +2 -2
  47. package/extensions/dashboard-client/dist/assets/{VectorCortexTab-BxsbSUGv.js.map → VectorCortexTab-BtHZb7o7.js.map} +1 -1
  48. package/extensions/dashboard-client/dist/assets/{WikiTab-CjefloQb.js → WikiTab-lQ4l3QIK.js} +2 -2
  49. package/extensions/dashboard-client/dist/assets/{WikiTab-CjefloQb.js.map → WikiTab-lQ4l3QIK.js.map} +1 -1
  50. package/extensions/dashboard-client/dist/assets/{button-D-9nb4Bw.js → button-DhQQAJGm.js} +2 -2
  51. package/extensions/dashboard-client/dist/assets/{button-D-9nb4Bw.js.map → button-DhQQAJGm.js.map} +1 -1
  52. package/extensions/dashboard-client/dist/assets/{card-Dvl16_R5.js → card-Cfhz9X31.js} +2 -2
  53. package/extensions/dashboard-client/dist/assets/{card-Dvl16_R5.js.map → card-Cfhz9X31.js.map} +1 -1
  54. package/extensions/dashboard-client/dist/assets/{client-extra-BShDrG99.js → client-extra-CKNOGEz_.js} +2 -2
  55. package/extensions/dashboard-client/dist/assets/{client-extra-BShDrG99.js.map → client-extra-CKNOGEz_.js.map} +1 -1
  56. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-Q_V4fqVi.js → generateCategoricalChart-JKjK9_cB.js} +2 -2
  57. package/extensions/dashboard-client/dist/assets/{generateCategoricalChart-Q_V4fqVi.js.map → generateCategoricalChart-JKjK9_cB.js.map} +1 -1
  58. package/extensions/dashboard-client/dist/assets/{index-CL6Af_JZ.js → index-iuxgtzEW.js} +4 -4
  59. package/extensions/dashboard-client/dist/assets/{index-CL6Af_JZ.js.map → index-iuxgtzEW.js.map} +1 -1
  60. package/extensions/dashboard-client/dist/assets/{switch-0MNUTR9I.js → switch-7EHEQMSP.js} +2 -2
  61. package/extensions/dashboard-client/dist/assets/{switch-0MNUTR9I.js.map → switch-7EHEQMSP.js.map} +1 -1
  62. package/extensions/dashboard-client/dist/assets/{toggle-DHbWo-CW.js → toggle-z1lWY4UM.js} +2 -2
  63. package/extensions/dashboard-client/dist/assets/{toggle-DHbWo-CW.js.map → toggle-z1lWY4UM.js.map} +1 -1
  64. package/extensions/dashboard-client/dist/assets/{useSSE-DcBpzKtI.js → useSSE-sctOZuRM.js} +2 -2
  65. package/extensions/dashboard-client/dist/assets/{useSSE-DcBpzKtI.js.map → useSSE-sctOZuRM.js.map} +1 -1
  66. package/extensions/dashboard-client/dist/index.html +1 -1
  67. package/extensions/dashboard-server/api-contracts/endpoints/registry-ext.ts +1 -1
  68. package/extensions/dashboard-server/routes-rag-settings-vector-cortex.ts +1 -1
  69. package/extensions/dashboard-server/routes-setup-cortex-actions.ts +6 -5
  70. package/extensions/dashboard-server/setup-cortex-actions-vc2.ts +400 -0
  71. package/extensions/dashboard-server/setup-cortex-actions.ts +18 -71
  72. package/package.json +1 -1
  73. package/src/config/vector-cortex-vc9b.ts +4 -3
  74. package/extensions/dashboard-client/dist/assets/MetricsTab-Clkcniuo.js +0 -2
  75. package/extensions/dashboard-client/dist/assets/TurnsTab-C-uZNH2F.js +0 -2
@@ -1,2 +1,2 @@
1
- import{j as e}from"./index-CL6Af_JZ.js";import{C as c,a as i,b as n,c as r}from"./card-Dvl16_R5.js";import{g as t}from"./format-COjDIVGj.js";function s({label:a,value:o}){return e.jsxs("div",{className:"flex items-baseline justify-between border-b border-border py-1 text-sm",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:a}),e.jsx("span",{className:"font-semibold",children:o})]})}function j(a){return e.jsxs(c,{className:"electric-hover",children:[e.jsx(i,{children:e.jsx(n,{children:"💾 Cache Hits & Compactions"})}),e.jsxs(r,{children:[e.jsx(s,{label:"Cache Hits (session)",value:a.cacheHitsSession.toLocaleString()}),e.jsx(s,{label:"Cache Hits (total)",value:a.cacheHitsTotal.toLocaleString()}),e.jsx(s,{label:"Tokens Saved (session)",value:a.tokensSavedSession.toLocaleString()}),e.jsx(s,{label:"Tokens Saved (total)",value:a.tokensSavedTotal.toLocaleString()}),e.jsx(s,{label:"Compactions (session)",value:a.compactionsSession.toLocaleString()}),e.jsx(s,{label:"Compactions (total)",value:a.compactionsTotal.toLocaleString()})]})]})}function l({label:a,value:o}){return e.jsxs("div",{className:"ov-stat-row",children:[e.jsx("span",{className:"ov-stat-label",children:a}),e.jsx("span",{className:"ov-stat-value",children:o})]})}function v(a){return e.jsxs("div",{className:"card time-saved-card",children:[e.jsx("h3",{children:"⏱ Time Saved (est.)"}),e.jsx(l,{label:"Compact (session)",value:t(a.compactSessionSec)}),e.jsx(l,{label:"Compact (total)",value:t(a.compactTotalSec)}),e.jsx(l,{label:"Cache Hit (session)",value:t(a.cacheHitSessionSec)}),e.jsx(l,{label:"Cache Hit (total)",value:t(a.cacheHitTotalSec)})]})}export{j as C,v as T};
2
- //# sourceMappingURL=TimeSavedCard-9QMQUc7L.js.map
1
+ import{j as e}from"./index-iuxgtzEW.js";import{C as c,a as i,b as n,c as r}from"./card-Cfhz9X31.js";import{g as t}from"./format-COjDIVGj.js";function s({label:a,value:o}){return e.jsxs("div",{className:"flex items-baseline justify-between border-b border-border py-1 text-sm",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:a}),e.jsx("span",{className:"font-semibold",children:o})]})}function j(a){return e.jsxs(c,{className:"electric-hover",children:[e.jsx(i,{children:e.jsx(n,{children:"💾 Cache Hits & Compactions"})}),e.jsxs(r,{children:[e.jsx(s,{label:"Cache Hits (session)",value:a.cacheHitsSession.toLocaleString()}),e.jsx(s,{label:"Cache Hits (total)",value:a.cacheHitsTotal.toLocaleString()}),e.jsx(s,{label:"Tokens Saved (session)",value:a.tokensSavedSession.toLocaleString()}),e.jsx(s,{label:"Tokens Saved (total)",value:a.tokensSavedTotal.toLocaleString()}),e.jsx(s,{label:"Compactions (session)",value:a.compactionsSession.toLocaleString()}),e.jsx(s,{label:"Compactions (total)",value:a.compactionsTotal.toLocaleString()})]})]})}function l({label:a,value:o}){return e.jsxs("div",{className:"ov-stat-row",children:[e.jsx("span",{className:"ov-stat-label",children:a}),e.jsx("span",{className:"ov-stat-value",children:o})]})}function v(a){return e.jsxs("div",{className:"card time-saved-card",children:[e.jsx("h3",{children:"⏱ Time Saved (est.)"}),e.jsx(l,{label:"Compact (session)",value:t(a.compactSessionSec)}),e.jsx(l,{label:"Compact (total)",value:t(a.compactTotalSec)}),e.jsx(l,{label:"Cache Hit (session)",value:t(a.cacheHitSessionSec)}),e.jsx(l,{label:"Cache Hit (total)",value:t(a.cacheHitTotalSec)})]})}export{j as C,v as T};
2
+ //# sourceMappingURL=TimeSavedCard-CyD8e_e_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TimeSavedCard-9QMQUc7L.js","sources":["../../src/components/CacheHitsCard.tsx","../../src/components/TimeSavedCard.tsx"],"sourcesContent":["/**\n * dashboard-client/src/components/CacheHitsCard.tsx — Cache Hits & Compactions card.\n *\n * 6 fields: Cache Hits (session), Cache Hits (total),\n * Tokens Saved (session), Tokens Saved (total),\n * Compactions (session), Compactions (total).\n */\n\nimport type React from \"react\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"../components/ui/card\";\n\nexport interface CacheHitsCardProps {\n\t/** Cache hits in the current session. */\n\tcacheHitsSession: number;\n\t/** Total cache hits across all sessions. */\n\tcacheHitsTotal: number;\n\t/** Tokens saved by cache hits this session. */\n\ttokensSavedSession: number;\n\t/** Total tokens saved by cache hits. */\n\ttokensSavedTotal: number;\n\t/** Compactions performed this session. */\n\tcompactionsSession: number;\n\t/** Total compactions performed. */\n\tcompactionsTotal: number;\n}\n\nfunction StatRow({\n\tlabel,\n\tvalue,\n}: {\n\tlabel: string;\n\tvalue: string | number;\n}): React.ReactElement {\n\treturn (\n\t\t<div className=\"flex items-baseline justify-between border-b border-border py-1 text-sm\">\n\t\t\t<span className=\"text-xs text-muted-foreground\">{label}</span>\n\t\t\t<span className=\"font-semibold\">{value}</span>\n\t\t</div>\n\t);\n}\n\nexport function CacheHitsCard(\n\tprops: CacheHitsCardProps,\n): React.ReactElement {\n\treturn (\n\t\t<Card className=\"electric-hover\">\n\t\t\t<CardHeader>\n\t\t\t\t<CardTitle>💾 Cache Hits &amp; Compactions</CardTitle>\n\t\t\t</CardHeader>\n\t\t\t<CardContent>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Cache Hits (session)\"\n\t\t\t\t\tvalue={props.cacheHitsSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Cache Hits (total)\"\n\t\t\t\t\tvalue={props.cacheHitsTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Tokens Saved (session)\"\n\t\t\t\t\tvalue={props.tokensSavedSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Tokens Saved (total)\"\n\t\t\t\t\tvalue={props.tokensSavedTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Compactions (session)\"\n\t\t\t\t\tvalue={props.compactionsSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Compactions (total)\"\n\t\t\t\t\tvalue={props.compactionsTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n","/**\n * dashboard-client/src/components/TimeSavedCard.tsx — Time Saved (est.) card.\n *\n * 4 fields: Compact (session), Compact (total),\n * Cache Hit (session), Cache Hit (total).\n */\n\nimport type React from \"react\";\nimport { fmtSec } from \"../utils/format\";\n\nexport interface TimeSavedCardProps {\n\t/** Seconds saved by compaction this session. */\n\tcompactSessionSec: number;\n\t/** Total seconds saved by compaction. */\n\tcompactTotalSec: number;\n\t/** Seconds saved by cache hits this session. */\n\tcacheHitSessionSec: number;\n\t/** Total seconds saved by cache hits. */\n\tcacheHitTotalSec: number;\n}\n\nfunction StatRow({\n\tlabel,\n\tvalue,\n}: {\n\tlabel: string;\n\tvalue: string;\n}): React.ReactElement {\n\treturn (\n\t\t<div className=\"ov-stat-row\">\n\t\t\t<span className=\"ov-stat-label\">{label}</span>\n\t\t\t<span className=\"ov-stat-value\">{value}</span>\n\t\t</div>\n\t);\n}\n\nexport function TimeSavedCard(\n\tprops: TimeSavedCardProps,\n): React.ReactElement {\n\treturn (\n\t\t<div className=\"card time-saved-card\">\n\t\t\t<h3>⏱ Time Saved (est.)</h3>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Compact (session)\"\n\t\t\t\tvalue={fmtSec(props.compactSessionSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Compact (total)\"\n\t\t\t\tvalue={fmtSec(props.compactTotalSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Cache Hit (session)\"\n\t\t\t\tvalue={fmtSec(props.cacheHitSessionSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Cache Hit (total)\"\n\t\t\t\tvalue={fmtSec(props.cacheHitTotalSec)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"names":["StatRow","label","value","jsxs","jsx","CacheHitsCard","props","Card","CardHeader","CardTitle","CardContent","TimeSavedCard","fmtSec"],"mappings":"6IA0BA,SAASA,EAAQ,CAChB,MAAAC,EACA,MAAAC,CACD,EAGuB,CACtB,OACCC,EAAAA,KAAC,MAAA,CAAI,UAAU,0EACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,gCAAiC,SAAAH,EAAM,EACvDG,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAF,CAAA,CAAM,CAAA,EACxC,CAEF,CAEO,SAASG,EACfC,EACqB,CACrB,OACCH,EAAAA,KAACI,EAAA,CAAK,UAAU,iBACf,SAAA,CAAAH,MAACI,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CAAU,SAAA,6BAAA,CAA+B,EAC3C,SACCC,EAAA,CACA,SAAA,CAAAN,EAAAA,IAACJ,EAAA,CACA,MAAM,uBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,EAE9CF,EAAAA,IAACJ,EAAA,CACA,MAAM,qBACN,MAAOM,EAAM,eAAe,eAAA,CAAe,CAAA,EAE5CF,EAAAA,IAACJ,EAAA,CACA,MAAM,yBACN,MAAOM,EAAM,mBAAmB,eAAA,CAAe,CAAA,EAEhDF,EAAAA,IAACJ,EAAA,CACA,MAAM,uBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,EAE9CF,EAAAA,IAACJ,EAAA,CACA,MAAM,wBACN,MAAOM,EAAM,mBAAmB,eAAA,CAAe,CAAA,EAEhDF,EAAAA,IAACJ,EAAA,CACA,MAAM,sBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,CAC9C,CAAA,CACD,CAAA,EACD,CAEF,CCxDA,SAASN,EAAQ,CAChB,MAAAC,EACA,MAAAC,CACD,EAGuB,CACtB,OACCC,EAAAA,KAAC,MAAA,CAAI,UAAU,cACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAH,EAAM,EACvCG,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAF,CAAA,CAAM,CAAA,EACxC,CAEF,CAEO,SAASS,EACfL,EACqB,CACrB,OACCH,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACd,SAAA,CAAAC,EAAAA,IAAC,MAAG,SAAA,qBAAA,CAAmB,EACvBA,EAAAA,IAACJ,EAAA,CACA,MAAM,oBACN,MAAOY,EAAON,EAAM,iBAAiB,CAAA,CAAA,EAEtCF,EAAAA,IAACJ,EAAA,CACA,MAAM,kBACN,MAAOY,EAAON,EAAM,eAAe,CAAA,CAAA,EAEpCF,EAAAA,IAACJ,EAAA,CACA,MAAM,sBACN,MAAOY,EAAON,EAAM,kBAAkB,CAAA,CAAA,EAEvCF,EAAAA,IAACJ,EAAA,CACA,MAAM,oBACN,MAAOY,EAAON,EAAM,gBAAgB,CAAA,CAAA,CACrC,EACD,CAEF"}
1
+ {"version":3,"file":"TimeSavedCard-CyD8e_e_.js","sources":["../../src/components/CacheHitsCard.tsx","../../src/components/TimeSavedCard.tsx"],"sourcesContent":["/**\n * dashboard-client/src/components/CacheHitsCard.tsx — Cache Hits & Compactions card.\n *\n * 6 fields: Cache Hits (session), Cache Hits (total),\n * Tokens Saved (session), Tokens Saved (total),\n * Compactions (session), Compactions (total).\n */\n\nimport type React from \"react\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"../components/ui/card\";\n\nexport interface CacheHitsCardProps {\n\t/** Cache hits in the current session. */\n\tcacheHitsSession: number;\n\t/** Total cache hits across all sessions. */\n\tcacheHitsTotal: number;\n\t/** Tokens saved by cache hits this session. */\n\ttokensSavedSession: number;\n\t/** Total tokens saved by cache hits. */\n\ttokensSavedTotal: number;\n\t/** Compactions performed this session. */\n\tcompactionsSession: number;\n\t/** Total compactions performed. */\n\tcompactionsTotal: number;\n}\n\nfunction StatRow({\n\tlabel,\n\tvalue,\n}: {\n\tlabel: string;\n\tvalue: string | number;\n}): React.ReactElement {\n\treturn (\n\t\t<div className=\"flex items-baseline justify-between border-b border-border py-1 text-sm\">\n\t\t\t<span className=\"text-xs text-muted-foreground\">{label}</span>\n\t\t\t<span className=\"font-semibold\">{value}</span>\n\t\t</div>\n\t);\n}\n\nexport function CacheHitsCard(\n\tprops: CacheHitsCardProps,\n): React.ReactElement {\n\treturn (\n\t\t<Card className=\"electric-hover\">\n\t\t\t<CardHeader>\n\t\t\t\t<CardTitle>💾 Cache Hits &amp; Compactions</CardTitle>\n\t\t\t</CardHeader>\n\t\t\t<CardContent>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Cache Hits (session)\"\n\t\t\t\t\tvalue={props.cacheHitsSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Cache Hits (total)\"\n\t\t\t\t\tvalue={props.cacheHitsTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Tokens Saved (session)\"\n\t\t\t\t\tvalue={props.tokensSavedSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Tokens Saved (total)\"\n\t\t\t\t\tvalue={props.tokensSavedTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Compactions (session)\"\n\t\t\t\t\tvalue={props.compactionsSession.toLocaleString()}\n\t\t\t\t/>\n\t\t\t\t<StatRow\n\t\t\t\t\tlabel=\"Compactions (total)\"\n\t\t\t\t\tvalue={props.compactionsTotal.toLocaleString()}\n\t\t\t\t/>\n\t\t\t</CardContent>\n\t\t</Card>\n\t);\n}\n","/**\n * dashboard-client/src/components/TimeSavedCard.tsx — Time Saved (est.) card.\n *\n * 4 fields: Compact (session), Compact (total),\n * Cache Hit (session), Cache Hit (total).\n */\n\nimport type React from \"react\";\nimport { fmtSec } from \"../utils/format\";\n\nexport interface TimeSavedCardProps {\n\t/** Seconds saved by compaction this session. */\n\tcompactSessionSec: number;\n\t/** Total seconds saved by compaction. */\n\tcompactTotalSec: number;\n\t/** Seconds saved by cache hits this session. */\n\tcacheHitSessionSec: number;\n\t/** Total seconds saved by cache hits. */\n\tcacheHitTotalSec: number;\n}\n\nfunction StatRow({\n\tlabel,\n\tvalue,\n}: {\n\tlabel: string;\n\tvalue: string;\n}): React.ReactElement {\n\treturn (\n\t\t<div className=\"ov-stat-row\">\n\t\t\t<span className=\"ov-stat-label\">{label}</span>\n\t\t\t<span className=\"ov-stat-value\">{value}</span>\n\t\t</div>\n\t);\n}\n\nexport function TimeSavedCard(\n\tprops: TimeSavedCardProps,\n): React.ReactElement {\n\treturn (\n\t\t<div className=\"card time-saved-card\">\n\t\t\t<h3>⏱ Time Saved (est.)</h3>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Compact (session)\"\n\t\t\t\tvalue={fmtSec(props.compactSessionSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Compact (total)\"\n\t\t\t\tvalue={fmtSec(props.compactTotalSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Cache Hit (session)\"\n\t\t\t\tvalue={fmtSec(props.cacheHitSessionSec)}\n\t\t\t/>\n\t\t\t<StatRow\n\t\t\t\tlabel=\"Cache Hit (total)\"\n\t\t\t\tvalue={fmtSec(props.cacheHitTotalSec)}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"names":["StatRow","label","value","jsxs","jsx","CacheHitsCard","props","Card","CardHeader","CardTitle","CardContent","TimeSavedCard","fmtSec"],"mappings":"6IA0BA,SAASA,EAAQ,CAChB,MAAAC,EACA,MAAAC,CACD,EAGuB,CACtB,OACCC,EAAAA,KAAC,MAAA,CAAI,UAAU,0EACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,gCAAiC,SAAAH,EAAM,EACvDG,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAF,CAAA,CAAM,CAAA,EACxC,CAEF,CAEO,SAASG,EACfC,EACqB,CACrB,OACCH,EAAAA,KAACI,EAAA,CAAK,UAAU,iBACf,SAAA,CAAAH,MAACI,EAAA,CACA,SAAAJ,EAAAA,IAACK,EAAA,CAAU,SAAA,6BAAA,CAA+B,EAC3C,SACCC,EAAA,CACA,SAAA,CAAAN,EAAAA,IAACJ,EAAA,CACA,MAAM,uBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,EAE9CF,EAAAA,IAACJ,EAAA,CACA,MAAM,qBACN,MAAOM,EAAM,eAAe,eAAA,CAAe,CAAA,EAE5CF,EAAAA,IAACJ,EAAA,CACA,MAAM,yBACN,MAAOM,EAAM,mBAAmB,eAAA,CAAe,CAAA,EAEhDF,EAAAA,IAACJ,EAAA,CACA,MAAM,uBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,EAE9CF,EAAAA,IAACJ,EAAA,CACA,MAAM,wBACN,MAAOM,EAAM,mBAAmB,eAAA,CAAe,CAAA,EAEhDF,EAAAA,IAACJ,EAAA,CACA,MAAM,sBACN,MAAOM,EAAM,iBAAiB,eAAA,CAAe,CAAA,CAC9C,CAAA,CACD,CAAA,EACD,CAEF,CCxDA,SAASN,EAAQ,CAChB,MAAAC,EACA,MAAAC,CACD,EAGuB,CACtB,OACCC,EAAAA,KAAC,MAAA,CAAI,UAAU,cACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAH,EAAM,EACvCG,EAAAA,IAAC,OAAA,CAAK,UAAU,gBAAiB,SAAAF,CAAA,CAAM,CAAA,EACxC,CAEF,CAEO,SAASS,EACfL,EACqB,CACrB,OACCH,EAAAA,KAAC,MAAA,CAAI,UAAU,uBACd,SAAA,CAAAC,EAAAA,IAAC,MAAG,SAAA,qBAAA,CAAmB,EACvBA,EAAAA,IAACJ,EAAA,CACA,MAAM,oBACN,MAAOY,EAAON,EAAM,iBAAiB,CAAA,CAAA,EAEtCF,EAAAA,IAACJ,EAAA,CACA,MAAM,kBACN,MAAOY,EAAON,EAAM,eAAe,CAAA,CAAA,EAEpCF,EAAAA,IAACJ,EAAA,CACA,MAAM,sBACN,MAAOY,EAAON,EAAM,kBAAkB,CAAA,CAAA,EAEvCF,EAAAA,IAACJ,EAAA,CACA,MAAM,oBACN,MAAOY,EAAON,EAAM,gBAAgB,CAAA,CAAA,CACrC,EACD,CAEF"}
@@ -1,5 +1,5 @@
1
- import{u as C,r as l,f as L,j as e,B as m,V as R,W as $,X as H,Y as A,Z as P}from"./index-CL6Af_JZ.js";import{C as g,a as y,b as N,c as v}from"./card-Dvl16_R5.js";import{B as D}from"./button-D-9nb4Bw.js";function I(r,d){return`${r}:${d}`}function B(r,d){const a=r.split(`
1
+ import{u as C,r as l,f as L,j as e,B as m,V as R,W as $,X as H,Y as A,Z as P}from"./index-iuxgtzEW.js";import{C as g,a as y,b as N,c as v}from"./card-Cfhz9X31.js";import{B as D}from"./button-DhQQAJGm.js";function I(r,d){return`${r}:${d}`}function B(r,d){const a=r.split(`
2
2
  `);return a.length>d?a.slice(0,d).join(`
3
3
  `):r}function M({row:r}){return r.recallScore>0||r.recallPass===1?e.jsxs("div",{className:"mt-2 rounded-md border border-border/60 bg-bg-elevated/40 p-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:"Recall quality"}),e.jsx(m,{variant:r.recallPass===1?"success":"warning",children:r.recallPass===1?"pass":"fail"}),e.jsxs("span",{children:["score ",e.jsx("strong",{className:"text-foreground",children:r.recallScore.toFixed(2)})]})]}),e.jsxs("div",{className:"mt-1 flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-muted-foreground",children:[e.jsxs("span",{children:["relevance ",r.recallRelevance.toFixed(2)]}),e.jsxs("span",{children:["coverage ",r.recallCoverage.toFixed(2)]}),e.jsxs("span",{children:["diversity ",r.recallDiversity.toFixed(2)]}),e.jsxs("span",{children:["specificity ",r.recallSpecificity.toFixed(2)]})]})]}):e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"No recall-quality metrics for this turn."})}const _=({conversationId:r,turnIndex:d})=>{const{data:a}=C(l.useMemo(()=>()=>L(),[]),{pollInterval:3e4}),[o,t]=l.useState(!1),s=l.useMemo(()=>a?.recent.find(x=>I(x.conversationId,x.turnIndex)===I(r,d))??null,[a,r,d]);if(!a)return e.jsx("div",{className:"text-xs text-muted-foreground",children:"Loading HyDE stats…"});if(!s)return e.jsx("div",{className:"text-xs text-muted-foreground",children:"No HyDE/recall telemetry recorded for this turn."});const i=s.hydeDoc??"",f=i.split(`
4
4
  `).length>3,b=o||!f?i:B(i,3);return e.jsxs(g,{className:"border border-border/60 bg-bg-elevated/20 p-3",children:[s.hydeRan===1?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-2 flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(m,{variant:"accent",children:"HyDE ran"}),e.jsxs("span",{className:"text-muted-foreground",children:["gen ",e.jsxs("strong",{className:"text-foreground",children:[s.hydeGenerationMs,"ms"]})]}),e.jsxs("span",{className:"text-muted-foreground",children:["raw ",e.jsx("strong",{className:"text-foreground",children:s.hydeRawCount}),e.jsx(T,{}),"hyde ",e.jsx("strong",{className:"text-foreground",children:s.hydeHydeCount}),e.jsx(T,{}),"fused ",e.jsx("strong",{className:"text-foreground",children:s.hydeFusedCount})]}),e.jsxs("span",{className:"text-muted-foreground",children:["lift"," ",e.jsxs("strong",{className:"text-neon",children:[s.hydeLift.toFixed(2),"×"]})]})]}),i&&e.jsx("pre",{className:"max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-border/50 bg-bg-elevated/40 p-2 font-mono text-xs text-muted-foreground",children:b}),f&&e.jsx("button",{type:"button",className:"mt-1 text-xs text-accent underline",onClick:()=>t(x=>!x),children:o?"Show less":"Show full hypothetical doc"})]}):e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx(m,{variant:"warning",children:"HyDE skipped"}),e.jsx("span",{className:"text-muted-foreground",children:q(s)})]}),e.jsx(M,{row:s})]})};function T(){return e.jsx("span",{className:"text-muted-foreground/60",children:" → "})}function q(r){switch(r.hydeReason){case"no-llm":return"No LLM embedder available (requires Ollama/HTTP embedder).";case"generation-failed":return"Hypothetical doc generation failed this turn.";case"disabled":return"HyDE is disabled (MEGACOMPACT_HYDE_DISABLED).";default:return"HyDE was not invoked for this turn."}}function w(r){return r?new Date(r).toLocaleString():"—"}function G(r){return r==="green"?"success":r==="yellow"?"warning":r==="red"?"danger":"default"}function O(r){return r==="checkpoint"?"ckpt":r==="cluster_summary"?"raptor":"mem"}function W(){const{data:r,loading:d,error:a}=C(l.useCallback(()=>R(),[]),{pollInterval:1e4}),{data:o}=C(l.useCallback(()=>$(),[]),{pollInterval:5e3}),[t,s]=l.useState(null),[i,p]=l.useState(null),[f,b]=l.useState(!1),[x,j]=l.useState(null),[k,u]=l.useState(null),E=l.useCallback(async n=>{if(t===n){s(null),p(null);return}s(n),b(!0),p(null);try{const c=await H(n);p(c)}finally{b(!1)}},[t]),F=l.useCallback(async(n,c)=>{j(`fork:${n}:${c}`),u(null);try{const h=await A(n,c);u(`Forked → ${h.childConversationId} (${h.recalledCount} recalled)`)}catch(h){u(`Fork failed: ${h.message}`)}finally{j(null)}},[]),S=l.useCallback(async(n,c)=>{j(`rewind:${n}:${c}`),u(null);try{await P(n,c),u(`Rewind intent queued for turn ${c}`)}catch(h){u(`Rewind failed: ${h.message}`)}finally{j(null)}},[]);return a&&!r?e.jsxs("div",{className:"tab-stub",children:["Error loading turns: ",a.message]}):d&&!r?e.jsx("div",{className:"tab-stub",children:"Loading turns…"}):!r||r.conversations.length===0?e.jsxs("div",{className:"tab-stub",children:[e.jsx("h3",{children:"Turn-by-turn memory"}),e.jsxs("p",{children:["No turns recorded yet. Per-turn tracking starts when"," ",e.jsx("code",{children:"MEGACOMPACT_TURNS_DB=1"})," and the session runs through a compaction. Each turn records its context metrics + the checkpoints recalled into it."]})]}):e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h3",{className:"font-heading text-lg font-semibold",children:"Turn-by-turn memory tracking + recall"}),k&&e.jsx(m,{variant:"warning",children:k}),o&&o.intents.length>0&&e.jsxs(g,{children:[e.jsx(y,{children:e.jsxs(N,{children:["Pending rewind intents (",o.intents.length,")"]})}),e.jsx(v,{children:e.jsx("ul",{className:"list-disc space-y-1 pl-5",children:o.intents.map(n=>e.jsxs("li",{children:[w(n.createdAt)," — rewind"," ",e.jsx("code",{children:n.conversationId})," to turn ",n.targetTurnIndex]},n.id))})})]}),e.jsxs(g,{children:[e.jsx(y,{children:e.jsxs(N,{children:["Conversations (",r.conversations.length,")"]})}),e.jsx(v,{children:e.jsxs("table",{className:"w-full border-collapse text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Conversation"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Turns"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Recall"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Epochs"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Avg ctx%"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Last turn"}),e.jsx("th",{className:"border-b border-border px-3 py-2"})]})}),e.jsx("tbody",{children:r.conversations.map(n=>e.jsx(V,{c:n,active:r.activeConversationId===n.conversationId,expanded:t===n.conversationId,onExpand:()=>E(n.conversationId)},n.conversationId))})]})})]}),t&&e.jsxs(g,{children:[e.jsx(y,{children:e.jsxs(N,{children:["Turns in ",e.jsx("code",{children:t})]})}),e.jsx(v,{children:f?e.jsx("div",{className:"text-sm text-muted-foreground",children:"Loading turns…"}):i?e.jsx(z,{detail:i,busy:x,onFork:F,onRewind:S}):e.jsx("div",{className:"text-sm text-muted-foreground",children:"No detail."})})]})]})}function V({c:r,active:d,expanded:a,onExpand:o}){return e.jsx(e.Fragment,{children:e.jsxs("tr",{className:`border-b border-border/50 hover:bg-bg-elevated/40 ${d?"bg-primary/10":""}`,onClick:o,style:{cursor:"pointer"},children:[e.jsxs("td",{className:"px-3 py-2",children:[a?"▾":"▸"," ",e.jsx("code",{children:r.conversationId}),d&&e.jsx(m,{variant:"accent",className:"ml-2",children:"active"})]}),e.jsx("td",{className:"px-3 py-2 text-right",children:r.turnCount}),e.jsx("td",{className:"px-3 py-2 text-right",children:r.totalRecall}),e.jsx("td",{className:"px-3 py-2 text-right",children:r.epochCount}),e.jsxs("td",{className:"px-3 py-2 text-right",children:[r.avgCtxPercent.toFixed(0),"%"]}),e.jsx("td",{className:"px-3 py-2",children:w(r.lastTurnAt)}),e.jsx("td",{className:"px-3 py-2"})]})})}function z({detail:r,busy:d,onFork:a,onRewind:o}){return e.jsxs("table",{className:"w-full border-collapse text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"#"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Role"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Ctx"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Band"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Epoch"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Recalled checkpoints (memory recall)"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"HyDE"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Ended"}),e.jsx("th",{className:"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground",children:"Actions"})]})}),e.jsx("tbody",{children:r.turns.map(t=>e.jsxs("tr",{className:"border-b border-border/50 hover:bg-bg-elevated/40",children:[e.jsx("td",{className:"px-3 py-2 text-right",children:t.turnIndex}),e.jsx("td",{className:"px-3 py-2",children:t.role}),e.jsxs("td",{className:"px-3 py-2",children:[t.ctxTokens??"—",t.ctxPercent!=null&&e.jsxs("span",{className:"text-muted-foreground",children:[" ","· ",t.ctxPercent.toFixed(0),"%"]})]}),e.jsx("td",{className:"px-3 py-2",children:e.jsx(m,{variant:G(t.pressureBand),children:t.pressureBand??"—"})}),e.jsx("td",{className:"px-3 py-2",children:t.epochId?e.jsx("code",{children:t.epochId.slice(0,8)}):"—"}),e.jsx("td",{className:"px-3 py-2",children:t.recall.length===0?e.jsx("span",{className:"text-muted-foreground",children:"—"}):e.jsx("ul",{className:"space-y-1",children:t.recall.map(s=>e.jsxs("li",{children:[e.jsx("code",{children:s.checkpointId.slice(0,12)})," ",e.jsxs("span",{className:"text-muted-foreground",children:[O(s.source)," · ",s.score.toFixed(2),s.raptorLevel!=null?` · L${s.raptorLevel}`:""]})]},s.checkpointId))})}),e.jsx("td",{className:"px-3 py-2 align-top",children:e.jsx(_,{conversationId:t.conversationId,turnIndex:t.turnIndex})}),e.jsx("td",{className:"px-3 py-2",children:w(t.endedAt)}),e.jsx("td",{className:"px-3 py-2",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(D,{type:"button",variant:"outline",size:"sm",disabled:d!==null,onClick:()=>a(t.conversationId,t.turnIndex),children:"fork"}),e.jsx(D,{type:"button",variant:"outline",size:"sm",disabled:d!==null,onClick:()=>o(t.conversationId,t.turnIndex),children:"rewind"})]})})]},`${t.conversationId}:${t.turnIndex}`))})]})}export{W as T};
5
- //# sourceMappingURL=TurnMemoryView-DAfqhJqd.js.map
5
+ //# sourceMappingURL=TurnMemoryView-5tLbWkRv.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TurnMemoryView-DAfqhJqd.js","sources":["../../src/components/HydeDetailPanel.tsx","../../src/tabs/SessionsTab/TurnMemoryView.tsx"],"sourcesContent":["/**\n * dashboard-client/src/components/HydeDetailPanel.tsx — per-turn HyDE + recall\n * quality detail (H3.1).\n *\n * Fetches /api/rag-metrics once and indexes telemetry rows by the composite\n * `conversationId:turnIndex` key (the dashboard TurnRow has no DB id, so the\n * pair is the stable identifier). Renders one of three HyDE states:\n * - HyDE ran: hypothetical doc (collapsible), raw/hyde/fused hit counts,\n * lift multiplier, generation latency.\n * - HyDE skipped: reason (disabled / no-llm / generation-failed).\n * - No telemetry: nothing (the parent only renders us when flagged).\n * Plus a CRAG-style mini score line when recall metrics exist.\n *\n * PREVENT-PI-004: relative-path fetch to the same-origin dashboard server.\n */\n\nimport type React from \"react\";\nimport { useMemo, useState } from \"react\";\nimport { useApi } from \"../hooks/useApi\";\nimport { fetchRagMetrics } from \"../api/client\";\nimport type { RagMetricsResponse } from \"@contracts\";\nimport { Card } from \"./ui/card\";\nimport { Badge } from \"./ui/badge\";\n\n/** Per-turn telemetry row shape derived from the rag-metrics contract. */\ntype TelemetryRow = RagMetricsResponse[\"recent\"][number];\n\nexport interface HydeDetailPanelProps {\n\tconversationId: string;\n\tturnIndex: number;\n}\n\n/** Composite key matching a telemetry row to a rendered turn. */\nfunction rowKey(conversationId: string, turnIndex: number): string {\n\treturn `${conversationId}:${turnIndex}`;\n}\n\n/** First N lines of the hypothetical doc (or full when expanded). */\nfunction truncateDoc(doc: string, maxLines: number): string {\n\tconst lines = doc.split(\"\\n\");\n\treturn lines.length > maxLines ? lines.slice(0, maxLines).join(\"\\n\") : doc;\n}\n\n/** CRAG-style mini score line when recall metrics were captured. */\nfunction ScoreLine({ row }: { row: TelemetryRow }): React.ReactElement {\n\tconst hasScore = row.recallScore > 0 || row.recallPass === 1;\n\tif (!hasScore) {\n\t\treturn (\n\t\t\t<div className=\"mt-2 text-xs text-muted-foreground\">\n\t\t\t\tNo recall-quality metrics for this turn.\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div className=\"mt-2 rounded-md border border-border/60 bg-bg-elevated/40 p-2\">\n\t\t\t<div className=\"flex items-center gap-2 text-xs\">\n\t\t\t\t<span className=\"font-medium text-muted-foreground\">Recall quality</span>\n\t\t\t\t<Badge variant={row.recallPass === 1 ? \"success\" : \"warning\"}>\n\t\t\t\t\t{row.recallPass === 1 ? \"pass\" : \"fail\"}\n\t\t\t\t</Badge>\n\t\t\t\t<span>\n\t\t\t\t\tscore <strong className=\"text-foreground\">{row.recallScore.toFixed(2)}</strong>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div className=\"mt-1 flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-muted-foreground\">\n\t\t\t\t<span>relevance {row.recallRelevance.toFixed(2)}</span>\n\t\t\t\t<span>coverage {row.recallCoverage.toFixed(2)}</span>\n\t\t\t\t<span>diversity {row.recallDiversity.toFixed(2)}</span>\n\t\t\t\t<span>specificity {row.recallSpecificity.toFixed(2)}</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const HydeDetailPanel: React.FC<HydeDetailPanelProps> = ({\n\tconversationId,\n\tturnIndex,\n}) => {\n\tconst { data: metrics } = useApi<RagMetricsResponse>(\n\t\tuseMemo(() => () => fetchRagMetrics(), []),\n\t\t{ pollInterval: 30_000 },\n\t);\n\tconst [showFullDoc, setShowFullDoc] = useState(false);\n\n\t// Rebuild the index whenever metrics arrive; rare enough that a full\n\t// rebuild on each render is cheaper than memoizing with a mutable dep.\n\tconst row = useMemo(\n\t\t() =>\n\t\t\tmetrics?.recent.find(\n\t\t\t\t(t) => rowKey(t.conversationId, t.turnIndex) === rowKey(conversationId, turnIndex),\n\t\t\t) ?? null,\n\t\t[metrics, conversationId, turnIndex],\n\t);\n\n\tif (!metrics) {\n\t\treturn <div className=\"text-xs text-muted-foreground\">Loading HyDE stats…</div>;\n\t}\n\tif (!row) {\n\t\treturn (\n\t\t\t<div className=\"text-xs text-muted-foreground\">\n\t\t\t\tNo HyDE/recall telemetry recorded for this turn.\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst doc = row.hydeDoc ?? \"\";\n\tconst docLines = doc.split(\"\\n\").length;\n\tconst showDoc = docLines > 3;\n\tconst visibleDoc = showFullDoc || !showDoc ? doc : truncateDoc(doc, 3);\n\n\treturn (\n\t\t<Card className=\"border border-border/60 bg-bg-elevated/20 p-3\">\n\t\t\t{row.hydeRan === 1 ? (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"mb-2 flex flex-wrap items-center gap-2 text-xs\">\n\t\t\t\t\t\t<Badge variant=\"accent\">HyDE ran</Badge>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\tgen <strong className=\"text-foreground\">{row.hydeGenerationMs}ms</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\traw <strong className=\"text-foreground\">{row.hydeRawCount}</strong>\n\t\t\t\t\t\t\t<Arrow />\n\t\t\t\t\t\t\thyde <strong className=\"text-foreground\">{row.hydeHydeCount}</strong>\n\t\t\t\t\t\t\t<Arrow />\n\t\t\t\t\t\t\tfused <strong className=\"text-foreground\">{row.hydeFusedCount}</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\tlift{\" \"}\n\t\t\t\t\t\t\t<strong className=\"text-neon\">{row.hydeLift.toFixed(2)}×</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t{doc && (\n\t\t\t\t\t\t<pre className=\"max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-border/50 bg-bg-elevated/40 p-2 font-mono text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t{visibleDoc}\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t)}\n\t\t\t\t\t{showDoc && (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclassName=\"mt-1 text-xs text-accent underline\"\n\t\t\t\t\t\t\tonClick={() => setShowFullDoc((v) => !v)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{showFullDoc ? \"Show less\" : \"Show full hypothetical doc\"}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<div className=\"flex items-center gap-2 text-xs\">\n\t\t\t\t\t<Badge variant=\"warning\">HyDE skipped</Badge>\n\t\t\t\t\t<span className=\"text-muted-foreground\">{skipReason(row)}</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<ScoreLine row={row} />\n\t\t</Card>\n\t);\n};\n\nfunction Arrow(): React.ReactElement {\n\treturn <span className=\"text-muted-foreground/60\"> → </span>;\n}\n\nfunction skipReason(row: TelemetryRow): string {\n\tswitch (row.hydeReason) {\n\t\tcase \"no-llm\":\n\t\t\treturn \"No LLM embedder available (requires Ollama/HTTP embedder).\";\n\t\tcase \"generation-failed\":\n\t\t\treturn \"Hypothetical doc generation failed this turn.\";\n\t\tcase \"disabled\":\n\t\t\treturn \"HyDE is disabled (MEGACOMPACT_HYDE_DISABLED).\";\n\t\tdefault:\n\t\t\treturn \"HyDE was not invoked for this turn.\";\n\t}\n}\n","/**\n * dashboard-client/src/tabs/SessionsTab/TurnMemoryView.tsx — Turn-by-turn memory\n * tracking + recall (S52), moved VERBATIM from the top-level TurnsTab.tsx.\n *\n * DASH-0b: the Sessions surface absorbs the existent TurnsTab as a drill-down.\n * This file holds the byte-preserved turns body (the `TurnMemoryView`\n * component). The standalone `tabs/TurnsTab.tsx` is LEFT UNTOUCHED this sprint —\n * its copy stays live for flag-off / pre-DASH parity. A DASH-0d cleanup deletes\n * the standalone copy after a deep-link audit proves no live consumer points\n * at it. Only the export name changed (TurnsTab → TurnMemoryView); the render\n * body is otherwise identical.\n *\n * Fetches /api/turns (conversation list), expands the active conversation into\n * per-turn detail (/api/turns/conversation/:id), and renders:\n * - Conversation summary list (turn count, recall total, epochs, last turn).\n * - Per-turn rows: turn index, role, ctx tokens/percent + pressure band,\n * epoch id, and the injected-checkpoint recall set (the memory recalled\n * at each turn, with score + source).\n * - Pending rewind intents (S52A) + Fork action (S50C primitive).\n *\n * Read-mostly via /api/turns; fork/intent/prune via POST. No absolute URLs\n * (PREVENT-PI-004: loopback-only, same-origin static bundle).\n */\n\nimport type React from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { useApi } from \"../../hooks/useApi\";\nimport {\n\tfetchTurns,\n\tfetchConversationTurns,\n\tfetchTurnIntents,\n\tpostFork,\n\tpostTurnIntent,\n} from \"../../api/client\";\nimport type {\n\tTurnsResponse,\n\tConversationTurnsResponse,\n\tRewindIntentsResponse,\n\tTurnRow,\n\tConversationSummary,\n} from \"@contracts\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"../../components/ui/card\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { HydeDetailPanel } from \"../../components/HydeDetailPanel\";\n\nfunction fmtTs(ms: number): string {\n\tif (!ms) return \"—\";\n\treturn new Date(ms).toLocaleString();\n}\n\nfunction bandVariant(band: TurnRow[\"pressureBand\"]): \"success\" | \"warning\" | \"danger\" | \"default\" {\n\tif (band === \"green\") return \"success\";\n\tif (band === \"yellow\") return \"warning\";\n\tif (band === \"red\") return \"danger\";\n\treturn \"default\";\n}\n\nfunction sourceLabel(s: TurnRow[\"recall\"][number][\"source\"]): string {\n\tif (s === \"checkpoint\") return \"ckpt\";\n\tif (s === \"cluster_summary\") return \"raptor\";\n\treturn \"mem\";\n}\n\nexport function TurnMemoryView(): React.ReactElement {\n\tconst {\n\t\tdata: turns,\n\t\tloading,\n\t\terror,\n\t} = useApi<TurnsResponse>(\n\t\tuseCallback(() => fetchTurns(), []),\n\t\t{\n\t\t\tpollInterval: 10_000,\n\t\t},\n\t);\n\tconst { data: intents } = useApi<RewindIntentsResponse>(\n\t\tuseCallback(() => fetchTurnIntents(), []),\n\t\t{ pollInterval: 5_000 },\n\t);\n\tconst [expanded, setExpanded] = useState<string | null>(null);\n\tconst [detail, setDetail] = useState<ConversationTurnsResponse | null>(null);\n\tconst [detailLoading, setDetailLoading] = useState(false);\n\tconst [busy, setBusy] = useState<string | null>(null);\n\tconst [notice, setNotice] = useState<string | null>(null);\n\n\tconst expand = useCallback(\n\t\tasync (conversationId: string) => {\n\t\t\tif (expanded === conversationId) {\n\t\t\t\tsetExpanded(null);\n\t\t\t\tsetDetail(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpanded(conversationId);\n\t\t\tsetDetailLoading(true);\n\t\t\tsetDetail(null);\n\t\t\ttry {\n\t\t\t\tconst d = await fetchConversationTurns(conversationId);\n\t\t\t\tsetDetail(d);\n\t\t\t} finally {\n\t\t\t\tsetDetailLoading(false);\n\t\t\t}\n\t\t},\n\t\t[expanded],\n\t);\n\n\tconst onFork = useCallback(\n\t\tasync (conversationId: string, turnIndex: number) => {\n\t\t\tsetBusy(`fork:${conversationId}:${turnIndex}`);\n\t\t\tsetNotice(null);\n\t\t\ttry {\n\t\t\t\tconst out = await postFork(conversationId, turnIndex);\n\t\t\t\tsetNotice(\n\t\t\t\t\t`Forked → ${out.childConversationId} (${out.recalledCount} recalled)`,\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tsetNotice(`Fork failed: ${(e as Error).message}`);\n\t\t\t} finally {\n\t\t\t\tsetBusy(null);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst onRewind = useCallback(\n\t\tasync (conversationId: string, turnIndex: number) => {\n\t\t\tsetBusy(`rewind:${conversationId}:${turnIndex}`);\n\t\t\tsetNotice(null);\n\t\t\ttry {\n\t\t\t\tawait postTurnIntent(conversationId, turnIndex);\n\t\t\t\tsetNotice(`Rewind intent queued for turn ${turnIndex}`);\n\t\t\t} catch (e) {\n\t\t\t\tsetNotice(`Rewind failed: ${(e as Error).message}`);\n\t\t\t} finally {\n\t\t\t\tsetBusy(null);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tif (error && !turns) {\n\t\treturn <div className=\"tab-stub\">Error loading turns: {error.message}</div>;\n\t}\n\tif (loading && !turns) {\n\t\treturn <div className=\"tab-stub\">Loading turns…</div>;\n\t}\n\tif (!turns || turns.conversations.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"tab-stub\">\n\t\t\t\t<h3>Turn-by-turn memory</h3>\n\t\t\t\t<p>\n\t\t\t\t\tNo turns recorded yet. Per-turn tracking starts when{\" \"}\n\t\t\t\t\t<code>MEGACOMPACT_TURNS_DB=1</code> and the session runs through a\n\t\t\t\t\tcompaction. Each turn records its context metrics + the checkpoints\n\t\t\t\t\trecalled into it.\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<h3 className=\"font-heading text-lg font-semibold\">\n\t\t\t\tTurn-by-turn memory tracking + recall\n\t\t\t</h3>\n\t\t\t{notice && <Badge variant=\"warning\">{notice}</Badge>}\n\n\t\t\t{intents && intents.intents.length > 0 && (\n\t\t\t\t<Card>\n\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\t\tPending rewind intents ({intents.intents.length})\n\t\t\t\t\t\t</CardTitle>\n\t\t\t\t\t</CardHeader>\n\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t<ul className=\"list-disc space-y-1 pl-5\">\n\t\t\t\t\t\t\t{intents.intents.map((i) => (\n\t\t\t\t\t\t\t\t<li key={i.id}>\n\t\t\t\t\t\t\t\t\t{fmtTs(i.createdAt)} — rewind{\" \"}\n\t\t\t\t\t\t\t\t\t<code>{i.conversationId}</code> to turn {i.targetTurnIndex}\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</CardContent>\n\t\t\t\t</Card>\n\t\t\t)}\n\n\t\t\t<Card>\n\t\t\t\t<CardHeader>\n\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\tConversations ({turns.conversations.length})\n\t\t\t\t\t</CardTitle>\n\t\t\t\t</CardHeader>\n\t\t\t\t<CardContent>\n\t\t\t\t\t<table className=\"w-full border-collapse text-sm\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Conversation</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Turns</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Recall</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Epochs</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Avg ctx%</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Last turn</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t{turns.conversations.map((c: ConversationSummary) => (\n\t\t\t\t\t\t\t\t<ConversationRow\n\t\t\t\t\t\t\t\t\tkey={c.conversationId}\n\t\t\t\t\t\t\t\t\tc={c}\n\t\t\t\t\t\t\t\t\tactive={turns.activeConversationId === c.conversationId}\n\t\t\t\t\t\t\t\t\texpanded={expanded === c.conversationId}\n\t\t\t\t\t\t\t\t\tonExpand={() => expand(c.conversationId)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</CardContent>\n\t\t\t</Card>\n\n\t\t\t{expanded && (\n\t\t\t\t<Card>\n\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\t\tTurns in <code>{expanded}</code>\n\t\t\t\t\t\t</CardTitle>\n\t\t\t\t\t</CardHeader>\n\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t{detailLoading ? (\n\t\t\t\t\t\t\t<div className=\"text-sm text-muted-foreground\">Loading turns…</div>\n\t\t\t\t\t\t) : detail ? (\n\t\t\t\t\t\t\t<TurnDetail\n\t\t\t\t\t\t\t\tdetail={detail}\n\t\t\t\t\t\t\t\tbusy={busy}\n\t\t\t\t\t\t\t\tonFork={onFork}\n\t\t\t\t\t\t\t\tonRewind={onRewind}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"text-sm text-muted-foreground\">No detail.</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</CardContent>\n\t\t\t\t</Card>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction ConversationRow({\n\tc,\n\tactive,\n\texpanded,\n\tonExpand,\n}: {\n\tc: ConversationSummary;\n\tactive: boolean;\n\texpanded: boolean;\n\tonExpand: () => void;\n}): React.ReactElement {\n\treturn (\n\t\t<>\n\t\t\t<tr\n\t\t\t\tclassName={`border-b border-border/50 hover:bg-bg-elevated/40 ${\n\t\t\t\t\tactive ? \"bg-primary/10\" : \"\"\n\t\t\t\t}`}\n\t\t\t\tonClick={onExpand}\n\t\t\t\tstyle={{ cursor: \"pointer\" }}\n\t\t\t>\n\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t{expanded ? \"▾\" : \"▸\"} <code>{c.conversationId}</code>\n\t\t\t\t\t{active && <Badge variant=\"accent\" className=\"ml-2\">active</Badge>}\n\t\t\t\t</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.turnCount}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.totalRecall}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.epochCount}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.avgCtxPercent.toFixed(0)}%</td>\n\t\t\t\t<td className=\"px-3 py-2\">{fmtTs(c.lastTurnAt)}</td>\n\t\t\t\t<td className=\"px-3 py-2\" />\n\t\t\t</tr>\n\t\t</>\n\t);\n}\n\nfunction TurnDetail({\n\tdetail,\n\tbusy,\n\tonFork,\n\tonRewind,\n}: {\n\tdetail: ConversationTurnsResponse;\n\tbusy: string | null;\n\tonFork: (conversationId: string, turnIndex: number) => void;\n\tonRewind: (conversationId: string, turnIndex: number) => void;\n}): React.ReactElement {\n\treturn (\n\t\t<table className=\"w-full border-collapse text-sm\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">#</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Role</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Ctx</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Band</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Epoch</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Recalled checkpoints (memory recall)</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">HyDE</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Ended</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Actions</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t{detail.turns.map((t) => (\n\t\t\t\t\t<tr\n\t\t\t\t\t\tkey={`${t.conversationId}:${t.turnIndex}`}\n\t\t\t\t\t\tclassName=\"border-b border-border/50 hover:bg-bg-elevated/40\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<td className=\"px-3 py-2 text-right\">{t.turnIndex}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{t.role}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t{t.ctxTokens ?? \"—\"}\n\t\t\t\t\t\t\t{t.ctxPercent != null && (\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\t\t\t· {t.ctxPercent.toFixed(0)}%\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t<Badge variant={bandVariant(t.pressureBand)}>\n\t\t\t\t\t\t\t\t{t.pressureBand ?? \"—\"}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{t.epochId ? <code>{t.epochId.slice(0, 8)}</code> : \"—\"}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t{t.recall.length === 0 ? (\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">—</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ul className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t{t.recall.map((r) => (\n\t\t\t\t\t\t\t\t\t\t<li key={r.checkpointId}>\n\t\t\t\t\t\t\t\t\t\t\t<code>{r.checkpointId.slice(0, 12)}</code>{\" \"}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t\t\t{sourceLabel(r.source)} · {r.score.toFixed(2)}\n\t\t\t\t\t\t\t\t\t\t\t\t{r.raptorLevel != null ? ` · L${r.raptorLevel}` : \"\"}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2 align-top\">\n\t\t\t\t\t\t\t<HydeDetailPanel\n\t\t\t\t\t\t\t\tconversationId={t.conversationId}\n\t\t\t\t\t\t\t\tturnIndex={t.turnIndex}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{fmtTs(t.endedAt)}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex gap-2\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\tdisabled={busy !== null}\n\t\t\t\t\t\t\t\t\tonClick={() => onFork(t.conversationId, t.turnIndex)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfork\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\tdisabled={busy !== null}\n\t\t\t\t\t\t\t\t\tonClick={() => onRewind(t.conversationId, t.turnIndex)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\trewind\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t))}\n\t\t\t</tbody>\n\t\t</table>\n\t);\n}\n"],"names":["rowKey","conversationId","turnIndex","truncateDoc","doc","maxLines","lines","ScoreLine","row","jsxs","jsx","Badge","HydeDetailPanel","metrics","useApi","useMemo","fetchRagMetrics","showFullDoc","setShowFullDoc","useState","t","showDoc","visibleDoc","Card","Fragment","Arrow","v","skipReason","fmtTs","ms","bandVariant","band","sourceLabel","s","TurnMemoryView","turns","loading","error","useCallback","fetchTurns","intents","fetchTurnIntents","expanded","setExpanded","detail","setDetail","detailLoading","setDetailLoading","busy","setBusy","notice","setNotice","expand","d","fetchConversationTurns","onFork","out","postFork","e","onRewind","postTurnIntent","CardHeader","CardTitle","CardContent","i","c","ConversationRow","TurnDetail","active","onExpand","r","Button"],"mappings":"4MAiCA,SAASA,EAAOC,EAAwBC,EAA2B,CAClE,MAAO,GAAGD,CAAc,IAAIC,CAAS,EACtC,CAGA,SAASC,EAAYC,EAAaC,EAA0B,CAC3D,MAAMC,EAAQF,EAAI,MAAM;AAAA,CAAI,EAC5B,OAAOE,EAAM,OAASD,EAAWC,EAAM,MAAM,EAAGD,CAAQ,EAAE,KAAK;AAAA,CAAI,EAAID,CACxE,CAGA,SAASG,EAAU,CAAE,IAAAC,GAAkD,CAEtE,OADiBA,EAAI,YAAc,GAAKA,EAAI,aAAe,EAS1DC,EAAAA,KAAC,MAAA,CAAI,UAAU,gEACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,kCACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,oCAAoC,SAAA,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"file":"TurnMemoryView-5tLbWkRv.js","sources":["../../src/components/HydeDetailPanel.tsx","../../src/tabs/SessionsTab/TurnMemoryView.tsx"],"sourcesContent":["/**\n * dashboard-client/src/components/HydeDetailPanel.tsx — per-turn HyDE + recall\n * quality detail (H3.1).\n *\n * Fetches /api/rag-metrics once and indexes telemetry rows by the composite\n * `conversationId:turnIndex` key (the dashboard TurnRow has no DB id, so the\n * pair is the stable identifier). Renders one of three HyDE states:\n * - HyDE ran: hypothetical doc (collapsible), raw/hyde/fused hit counts,\n * lift multiplier, generation latency.\n * - HyDE skipped: reason (disabled / no-llm / generation-failed).\n * - No telemetry: nothing (the parent only renders us when flagged).\n * Plus a CRAG-style mini score line when recall metrics exist.\n *\n * PREVENT-PI-004: relative-path fetch to the same-origin dashboard server.\n */\n\nimport type React from \"react\";\nimport { useMemo, useState } from \"react\";\nimport { useApi } from \"../hooks/useApi\";\nimport { fetchRagMetrics } from \"../api/client\";\nimport type { RagMetricsResponse } from \"@contracts\";\nimport { Card } from \"./ui/card\";\nimport { Badge } from \"./ui/badge\";\n\n/** Per-turn telemetry row shape derived from the rag-metrics contract. */\ntype TelemetryRow = RagMetricsResponse[\"recent\"][number];\n\nexport interface HydeDetailPanelProps {\n\tconversationId: string;\n\tturnIndex: number;\n}\n\n/** Composite key matching a telemetry row to a rendered turn. */\nfunction rowKey(conversationId: string, turnIndex: number): string {\n\treturn `${conversationId}:${turnIndex}`;\n}\n\n/** First N lines of the hypothetical doc (or full when expanded). */\nfunction truncateDoc(doc: string, maxLines: number): string {\n\tconst lines = doc.split(\"\\n\");\n\treturn lines.length > maxLines ? lines.slice(0, maxLines).join(\"\\n\") : doc;\n}\n\n/** CRAG-style mini score line when recall metrics were captured. */\nfunction ScoreLine({ row }: { row: TelemetryRow }): React.ReactElement {\n\tconst hasScore = row.recallScore > 0 || row.recallPass === 1;\n\tif (!hasScore) {\n\t\treturn (\n\t\t\t<div className=\"mt-2 text-xs text-muted-foreground\">\n\t\t\t\tNo recall-quality metrics for this turn.\n\t\t\t</div>\n\t\t);\n\t}\n\treturn (\n\t\t<div className=\"mt-2 rounded-md border border-border/60 bg-bg-elevated/40 p-2\">\n\t\t\t<div className=\"flex items-center gap-2 text-xs\">\n\t\t\t\t<span className=\"font-medium text-muted-foreground\">Recall quality</span>\n\t\t\t\t<Badge variant={row.recallPass === 1 ? \"success\" : \"warning\"}>\n\t\t\t\t\t{row.recallPass === 1 ? \"pass\" : \"fail\"}\n\t\t\t\t</Badge>\n\t\t\t\t<span>\n\t\t\t\t\tscore <strong className=\"text-foreground\">{row.recallScore.toFixed(2)}</strong>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div className=\"mt-1 flex flex-wrap gap-x-4 gap-y-0.5 text-xs text-muted-foreground\">\n\t\t\t\t<span>relevance {row.recallRelevance.toFixed(2)}</span>\n\t\t\t\t<span>coverage {row.recallCoverage.toFixed(2)}</span>\n\t\t\t\t<span>diversity {row.recallDiversity.toFixed(2)}</span>\n\t\t\t\t<span>specificity {row.recallSpecificity.toFixed(2)}</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport const HydeDetailPanel: React.FC<HydeDetailPanelProps> = ({\n\tconversationId,\n\tturnIndex,\n}) => {\n\tconst { data: metrics } = useApi<RagMetricsResponse>(\n\t\tuseMemo(() => () => fetchRagMetrics(), []),\n\t\t{ pollInterval: 30_000 },\n\t);\n\tconst [showFullDoc, setShowFullDoc] = useState(false);\n\n\t// Rebuild the index whenever metrics arrive; rare enough that a full\n\t// rebuild on each render is cheaper than memoizing with a mutable dep.\n\tconst row = useMemo(\n\t\t() =>\n\t\t\tmetrics?.recent.find(\n\t\t\t\t(t) => rowKey(t.conversationId, t.turnIndex) === rowKey(conversationId, turnIndex),\n\t\t\t) ?? null,\n\t\t[metrics, conversationId, turnIndex],\n\t);\n\n\tif (!metrics) {\n\t\treturn <div className=\"text-xs text-muted-foreground\">Loading HyDE stats…</div>;\n\t}\n\tif (!row) {\n\t\treturn (\n\t\t\t<div className=\"text-xs text-muted-foreground\">\n\t\t\t\tNo HyDE/recall telemetry recorded for this turn.\n\t\t\t</div>\n\t\t);\n\t}\n\n\tconst doc = row.hydeDoc ?? \"\";\n\tconst docLines = doc.split(\"\\n\").length;\n\tconst showDoc = docLines > 3;\n\tconst visibleDoc = showFullDoc || !showDoc ? doc : truncateDoc(doc, 3);\n\n\treturn (\n\t\t<Card className=\"border border-border/60 bg-bg-elevated/20 p-3\">\n\t\t\t{row.hydeRan === 1 ? (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"mb-2 flex flex-wrap items-center gap-2 text-xs\">\n\t\t\t\t\t\t<Badge variant=\"accent\">HyDE ran</Badge>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\tgen <strong className=\"text-foreground\">{row.hydeGenerationMs}ms</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\traw <strong className=\"text-foreground\">{row.hydeRawCount}</strong>\n\t\t\t\t\t\t\t<Arrow />\n\t\t\t\t\t\t\thyde <strong className=\"text-foreground\">{row.hydeHydeCount}</strong>\n\t\t\t\t\t\t\t<Arrow />\n\t\t\t\t\t\t\tfused <strong className=\"text-foreground\">{row.hydeFusedCount}</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\tlift{\" \"}\n\t\t\t\t\t\t\t<strong className=\"text-neon\">{row.hydeLift.toFixed(2)}×</strong>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t{doc && (\n\t\t\t\t\t\t<pre className=\"max-h-40 overflow-auto whitespace-pre-wrap rounded-md border border-border/50 bg-bg-elevated/40 p-2 font-mono text-xs text-muted-foreground\">\n\t\t\t\t\t\t\t{visibleDoc}\n\t\t\t\t\t\t</pre>\n\t\t\t\t\t)}\n\t\t\t\t\t{showDoc && (\n\t\t\t\t\t\t<button\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\tclassName=\"mt-1 text-xs text-accent underline\"\n\t\t\t\t\t\t\tonClick={() => setShowFullDoc((v) => !v)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{showFullDoc ? \"Show less\" : \"Show full hypothetical doc\"}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t)}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<div className=\"flex items-center gap-2 text-xs\">\n\t\t\t\t\t<Badge variant=\"warning\">HyDE skipped</Badge>\n\t\t\t\t\t<span className=\"text-muted-foreground\">{skipReason(row)}</span>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t<ScoreLine row={row} />\n\t\t</Card>\n\t);\n};\n\nfunction Arrow(): React.ReactElement {\n\treturn <span className=\"text-muted-foreground/60\"> → </span>;\n}\n\nfunction skipReason(row: TelemetryRow): string {\n\tswitch (row.hydeReason) {\n\t\tcase \"no-llm\":\n\t\t\treturn \"No LLM embedder available (requires Ollama/HTTP embedder).\";\n\t\tcase \"generation-failed\":\n\t\t\treturn \"Hypothetical doc generation failed this turn.\";\n\t\tcase \"disabled\":\n\t\t\treturn \"HyDE is disabled (MEGACOMPACT_HYDE_DISABLED).\";\n\t\tdefault:\n\t\t\treturn \"HyDE was not invoked for this turn.\";\n\t}\n}\n","/**\n * dashboard-client/src/tabs/SessionsTab/TurnMemoryView.tsx — Turn-by-turn memory\n * tracking + recall (S52), moved VERBATIM from the top-level TurnsTab.tsx.\n *\n * DASH-0b: the Sessions surface absorbs the existent TurnsTab as a drill-down.\n * This file holds the byte-preserved turns body (the `TurnMemoryView`\n * component). The standalone `tabs/TurnsTab.tsx` is LEFT UNTOUCHED this sprint —\n * its copy stays live for flag-off / pre-DASH parity. A DASH-0d cleanup deletes\n * the standalone copy after a deep-link audit proves no live consumer points\n * at it. Only the export name changed (TurnsTab → TurnMemoryView); the render\n * body is otherwise identical.\n *\n * Fetches /api/turns (conversation list), expands the active conversation into\n * per-turn detail (/api/turns/conversation/:id), and renders:\n * - Conversation summary list (turn count, recall total, epochs, last turn).\n * - Per-turn rows: turn index, role, ctx tokens/percent + pressure band,\n * epoch id, and the injected-checkpoint recall set (the memory recalled\n * at each turn, with score + source).\n * - Pending rewind intents (S52A) + Fork action (S50C primitive).\n *\n * Read-mostly via /api/turns; fork/intent/prune via POST. No absolute URLs\n * (PREVENT-PI-004: loopback-only, same-origin static bundle).\n */\n\nimport type React from \"react\";\nimport { useCallback, useState } from \"react\";\nimport { useApi } from \"../../hooks/useApi\";\nimport {\n\tfetchTurns,\n\tfetchConversationTurns,\n\tfetchTurnIntents,\n\tpostFork,\n\tpostTurnIntent,\n} from \"../../api/client\";\nimport type {\n\tTurnsResponse,\n\tConversationTurnsResponse,\n\tRewindIntentsResponse,\n\tTurnRow,\n\tConversationSummary,\n} from \"@contracts\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"../../components/ui/card\";\nimport { Badge } from \"../../components/ui/badge\";\nimport { Button } from \"../../components/ui/button\";\nimport { HydeDetailPanel } from \"../../components/HydeDetailPanel\";\n\nfunction fmtTs(ms: number): string {\n\tif (!ms) return \"—\";\n\treturn new Date(ms).toLocaleString();\n}\n\nfunction bandVariant(band: TurnRow[\"pressureBand\"]): \"success\" | \"warning\" | \"danger\" | \"default\" {\n\tif (band === \"green\") return \"success\";\n\tif (band === \"yellow\") return \"warning\";\n\tif (band === \"red\") return \"danger\";\n\treturn \"default\";\n}\n\nfunction sourceLabel(s: TurnRow[\"recall\"][number][\"source\"]): string {\n\tif (s === \"checkpoint\") return \"ckpt\";\n\tif (s === \"cluster_summary\") return \"raptor\";\n\treturn \"mem\";\n}\n\nexport function TurnMemoryView(): React.ReactElement {\n\tconst {\n\t\tdata: turns,\n\t\tloading,\n\t\terror,\n\t} = useApi<TurnsResponse>(\n\t\tuseCallback(() => fetchTurns(), []),\n\t\t{\n\t\t\tpollInterval: 10_000,\n\t\t},\n\t);\n\tconst { data: intents } = useApi<RewindIntentsResponse>(\n\t\tuseCallback(() => fetchTurnIntents(), []),\n\t\t{ pollInterval: 5_000 },\n\t);\n\tconst [expanded, setExpanded] = useState<string | null>(null);\n\tconst [detail, setDetail] = useState<ConversationTurnsResponse | null>(null);\n\tconst [detailLoading, setDetailLoading] = useState(false);\n\tconst [busy, setBusy] = useState<string | null>(null);\n\tconst [notice, setNotice] = useState<string | null>(null);\n\n\tconst expand = useCallback(\n\t\tasync (conversationId: string) => {\n\t\t\tif (expanded === conversationId) {\n\t\t\t\tsetExpanded(null);\n\t\t\t\tsetDetail(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetExpanded(conversationId);\n\t\t\tsetDetailLoading(true);\n\t\t\tsetDetail(null);\n\t\t\ttry {\n\t\t\t\tconst d = await fetchConversationTurns(conversationId);\n\t\t\t\tsetDetail(d);\n\t\t\t} finally {\n\t\t\t\tsetDetailLoading(false);\n\t\t\t}\n\t\t},\n\t\t[expanded],\n\t);\n\n\tconst onFork = useCallback(\n\t\tasync (conversationId: string, turnIndex: number) => {\n\t\t\tsetBusy(`fork:${conversationId}:${turnIndex}`);\n\t\t\tsetNotice(null);\n\t\t\ttry {\n\t\t\t\tconst out = await postFork(conversationId, turnIndex);\n\t\t\t\tsetNotice(\n\t\t\t\t\t`Forked → ${out.childConversationId} (${out.recalledCount} recalled)`,\n\t\t\t\t);\n\t\t\t} catch (e) {\n\t\t\t\tsetNotice(`Fork failed: ${(e as Error).message}`);\n\t\t\t} finally {\n\t\t\t\tsetBusy(null);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tconst onRewind = useCallback(\n\t\tasync (conversationId: string, turnIndex: number) => {\n\t\t\tsetBusy(`rewind:${conversationId}:${turnIndex}`);\n\t\t\tsetNotice(null);\n\t\t\ttry {\n\t\t\t\tawait postTurnIntent(conversationId, turnIndex);\n\t\t\t\tsetNotice(`Rewind intent queued for turn ${turnIndex}`);\n\t\t\t} catch (e) {\n\t\t\t\tsetNotice(`Rewind failed: ${(e as Error).message}`);\n\t\t\t} finally {\n\t\t\t\tsetBusy(null);\n\t\t\t}\n\t\t},\n\t\t[],\n\t);\n\n\tif (error && !turns) {\n\t\treturn <div className=\"tab-stub\">Error loading turns: {error.message}</div>;\n\t}\n\tif (loading && !turns) {\n\t\treturn <div className=\"tab-stub\">Loading turns…</div>;\n\t}\n\tif (!turns || turns.conversations.length === 0) {\n\t\treturn (\n\t\t\t<div className=\"tab-stub\">\n\t\t\t\t<h3>Turn-by-turn memory</h3>\n\t\t\t\t<p>\n\t\t\t\t\tNo turns recorded yet. Per-turn tracking starts when{\" \"}\n\t\t\t\t\t<code>MEGACOMPACT_TURNS_DB=1</code> and the session runs through a\n\t\t\t\t\tcompaction. Each turn records its context metrics + the checkpoints\n\t\t\t\t\trecalled into it.\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className=\"flex flex-col gap-4\">\n\t\t\t<h3 className=\"font-heading text-lg font-semibold\">\n\t\t\t\tTurn-by-turn memory tracking + recall\n\t\t\t</h3>\n\t\t\t{notice && <Badge variant=\"warning\">{notice}</Badge>}\n\n\t\t\t{intents && intents.intents.length > 0 && (\n\t\t\t\t<Card>\n\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\t\tPending rewind intents ({intents.intents.length})\n\t\t\t\t\t\t</CardTitle>\n\t\t\t\t\t</CardHeader>\n\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t<ul className=\"list-disc space-y-1 pl-5\">\n\t\t\t\t\t\t\t{intents.intents.map((i) => (\n\t\t\t\t\t\t\t\t<li key={i.id}>\n\t\t\t\t\t\t\t\t\t{fmtTs(i.createdAt)} — rewind{\" \"}\n\t\t\t\t\t\t\t\t\t<code>{i.conversationId}</code> to turn {i.targetTurnIndex}\n\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</CardContent>\n\t\t\t\t</Card>\n\t\t\t)}\n\n\t\t\t<Card>\n\t\t\t\t<CardHeader>\n\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\tConversations ({turns.conversations.length})\n\t\t\t\t\t</CardTitle>\n\t\t\t\t</CardHeader>\n\t\t\t\t<CardContent>\n\t\t\t\t\t<table className=\"w-full border-collapse text-sm\">\n\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Conversation</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Turns</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Recall</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Epochs</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Avg ctx%</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Last turn</th>\n\t\t\t\t\t\t\t\t<th className=\"border-b border-border px-3 py-2\"></th>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t{turns.conversations.map((c: ConversationSummary) => (\n\t\t\t\t\t\t\t\t<ConversationRow\n\t\t\t\t\t\t\t\t\tkey={c.conversationId}\n\t\t\t\t\t\t\t\t\tc={c}\n\t\t\t\t\t\t\t\t\tactive={turns.activeConversationId === c.conversationId}\n\t\t\t\t\t\t\t\t\texpanded={expanded === c.conversationId}\n\t\t\t\t\t\t\t\t\tonExpand={() => expand(c.conversationId)}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</CardContent>\n\t\t\t</Card>\n\n\t\t\t{expanded && (\n\t\t\t\t<Card>\n\t\t\t\t\t<CardHeader>\n\t\t\t\t\t\t<CardTitle>\n\t\t\t\t\t\t\tTurns in <code>{expanded}</code>\n\t\t\t\t\t\t</CardTitle>\n\t\t\t\t\t</CardHeader>\n\t\t\t\t\t<CardContent>\n\t\t\t\t\t\t{detailLoading ? (\n\t\t\t\t\t\t\t<div className=\"text-sm text-muted-foreground\">Loading turns…</div>\n\t\t\t\t\t\t) : detail ? (\n\t\t\t\t\t\t\t<TurnDetail\n\t\t\t\t\t\t\t\tdetail={detail}\n\t\t\t\t\t\t\t\tbusy={busy}\n\t\t\t\t\t\t\t\tonFork={onFork}\n\t\t\t\t\t\t\t\tonRewind={onRewind}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"text-sm text-muted-foreground\">No detail.</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</CardContent>\n\t\t\t\t</Card>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction ConversationRow({\n\tc,\n\tactive,\n\texpanded,\n\tonExpand,\n}: {\n\tc: ConversationSummary;\n\tactive: boolean;\n\texpanded: boolean;\n\tonExpand: () => void;\n}): React.ReactElement {\n\treturn (\n\t\t<>\n\t\t\t<tr\n\t\t\t\tclassName={`border-b border-border/50 hover:bg-bg-elevated/40 ${\n\t\t\t\t\tactive ? \"bg-primary/10\" : \"\"\n\t\t\t\t}`}\n\t\t\t\tonClick={onExpand}\n\t\t\t\tstyle={{ cursor: \"pointer\" }}\n\t\t\t>\n\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t{expanded ? \"▾\" : \"▸\"} <code>{c.conversationId}</code>\n\t\t\t\t\t{active && <Badge variant=\"accent\" className=\"ml-2\">active</Badge>}\n\t\t\t\t</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.turnCount}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.totalRecall}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.epochCount}</td>\n\t\t\t\t<td className=\"px-3 py-2 text-right\">{c.avgCtxPercent.toFixed(0)}%</td>\n\t\t\t\t<td className=\"px-3 py-2\">{fmtTs(c.lastTurnAt)}</td>\n\t\t\t\t<td className=\"px-3 py-2\" />\n\t\t\t</tr>\n\t\t</>\n\t);\n}\n\nfunction TurnDetail({\n\tdetail,\n\tbusy,\n\tonFork,\n\tonRewind,\n}: {\n\tdetail: ConversationTurnsResponse;\n\tbusy: string | null;\n\tonFork: (conversationId: string, turnIndex: number) => void;\n\tonRewind: (conversationId: string, turnIndex: number) => void;\n}): React.ReactElement {\n\treturn (\n\t\t<table className=\"w-full border-collapse text-sm\">\n\t\t\t<thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">#</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Role</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Ctx</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Band</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Epoch</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Recalled checkpoints (memory recall)</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">HyDE</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Ended</th>\n\t\t\t\t\t<th className=\"border-b border-border px-3 py-2 text-left font-medium text-muted-foreground\">Actions</th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t\t\t{detail.turns.map((t) => (\n\t\t\t\t\t<tr\n\t\t\t\t\t\tkey={`${t.conversationId}:${t.turnIndex}`}\n\t\t\t\t\t\tclassName=\"border-b border-border/50 hover:bg-bg-elevated/40\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<td className=\"px-3 py-2 text-right\">{t.turnIndex}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{t.role}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t{t.ctxTokens ?? \"—\"}\n\t\t\t\t\t\t\t{t.ctxPercent != null && (\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t{\" \"}\n\t\t\t\t\t\t\t\t\t· {t.ctxPercent.toFixed(0)}%\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t<Badge variant={bandVariant(t.pressureBand)}>\n\t\t\t\t\t\t\t\t{t.pressureBand ?? \"—\"}\n\t\t\t\t\t\t\t</Badge>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{t.epochId ? <code>{t.epochId.slice(0, 8)}</code> : \"—\"}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t{t.recall.length === 0 ? (\n\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">—</span>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ul className=\"space-y-1\">\n\t\t\t\t\t\t\t\t\t{t.recall.map((r) => (\n\t\t\t\t\t\t\t\t\t\t<li key={r.checkpointId}>\n\t\t\t\t\t\t\t\t\t\t\t<code>{r.checkpointId.slice(0, 12)}</code>{\" \"}\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t\t\t{sourceLabel(r.source)} · {r.score.toFixed(2)}\n\t\t\t\t\t\t\t\t\t\t\t\t{r.raptorLevel != null ? ` · L${r.raptorLevel}` : \"\"}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2 align-top\">\n\t\t\t\t\t\t\t<HydeDetailPanel\n\t\t\t\t\t\t\t\tconversationId={t.conversationId}\n\t\t\t\t\t\t\t\tturnIndex={t.turnIndex}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">{fmtTs(t.endedAt)}</td>\n\t\t\t\t\t\t<td className=\"px-3 py-2\">\n\t\t\t\t\t\t\t<div className=\"flex gap-2\">\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\tdisabled={busy !== null}\n\t\t\t\t\t\t\t\t\tonClick={() => onFork(t.conversationId, t.turnIndex)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfork\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\t\t\tdisabled={busy !== null}\n\t\t\t\t\t\t\t\t\tonClick={() => onRewind(t.conversationId, t.turnIndex)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\trewind\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t))}\n\t\t\t</tbody>\n\t\t</table>\n\t);\n}\n"],"names":["rowKey","conversationId","turnIndex","truncateDoc","doc","maxLines","lines","ScoreLine","row","jsxs","jsx","Badge","HydeDetailPanel","metrics","useApi","useMemo","fetchRagMetrics","showFullDoc","setShowFullDoc","useState","t","showDoc","visibleDoc","Card","Fragment","Arrow","v","skipReason","fmtTs","ms","bandVariant","band","sourceLabel","s","TurnMemoryView","turns","loading","error","useCallback","fetchTurns","intents","fetchTurnIntents","expanded","setExpanded","detail","setDetail","detailLoading","setDetailLoading","busy","setBusy","notice","setNotice","expand","d","fetchConversationTurns","onFork","out","postFork","e","onRewind","postTurnIntent","CardHeader","CardTitle","CardContent","i","c","ConversationRow","TurnDetail","active","onExpand","r","Button"],"mappings":"4MAiCA,SAASA,EAAOC,EAAwBC,EAA2B,CAClE,MAAO,GAAGD,CAAc,IAAIC,CAAS,EACtC,CAGA,SAASC,EAAYC,EAAaC,EAA0B,CAC3D,MAAMC,EAAQF,EAAI,MAAM;AAAA,CAAI,EAC5B,OAAOE,EAAM,OAASD,EAAWC,EAAM,MAAM,EAAGD,CAAQ,EAAE,KAAK;AAAA,CAAI,EAAID,CACxE,CAGA,SAASG,EAAU,CAAE,IAAAC,GAAkD,CAEtE,OADiBA,EAAI,YAAc,GAAKA,EAAI,aAAe,EAS1DC,EAAAA,KAAC,MAAA,CAAI,UAAU,gEACd,SAAA,CAAAA,EAAAA,KAAC,MAAA,CAAI,UAAU,kCACd,SAAA,CAAAC,EAAAA,IAAC,OAAA,CAAK,UAAU,oCAAoC,SAAA,iBAAc,EAClEA,EAAAA,IAACC,EAAA,CAAM,QAASH,EAAI,aAAe,EAAI,UAAY,UACjD,SAAAA,EAAI,aAAe,EAAI,OAAS,OAClC,SACC,OAAA,CAAK,SAAA,CAAA,SACCE,MAAC,UAAO,UAAU,kBAAmB,WAAI,YAAY,QAAQ,CAAC,CAAA,CAAE,CAAA,CAAA,CACvE,CAAA,EACD,EACAD,EAAAA,KAAC,MAAA,CAAI,UAAU,sEACd,SAAA,CAAAA,OAAC,OAAA,CAAK,SAAA,CAAA,aAAWD,EAAI,gBAAgB,QAAQ,CAAC,CAAA,EAAE,SAC/C,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AAC,EAC3CA,EAAE,aAAe,KAAO,OAAOA,EAAE,WAAW,GAAK,EAAA,CAAA,CACnD,CAAA,CAAA,EALQA,EAAE,YAMX,CACA,CAAA,CACF,CAAA,CAEF,EACA5D,EAAAA,IAAC,KAAA,CAAG,UAAU,sBACb,SAAAA,EAAAA,IAACE,EAAA,CACA,eAAgB,EAAE,eAClB,UAAW,EAAE,SAAA,CAAA,EAEf,QACC,KAAA,CAAG,UAAU,YAAa,SAAAgB,EAAM,EAAE,OAAO,EAAE,QAC3C,KAAA,CAAG,UAAU,YACb,SAAAnB,EAAAA,KAAC,MAAA,CAAI,UAAU,aACd,SAAA,CAAAC,EAAAA,IAAC6D,EAAA,CACA,KAAK,SACL,QAAQ,UACR,KAAK,KACL,SAAUvB,IAAS,KACnB,QAAS,IAAMO,EAAO,EAAE,eAAgB,EAAE,SAAS,EACnD,SAAA,MAAA,CAAA,EAGD7C,EAAAA,IAAC6D,EAAA,CACA,KAAK,SACL,QAAQ,UACR,KAAK,KACL,SAAUvB,IAAS,KACnB,QAAS,IAAMW,EAAS,EAAE,eAAgB,EAAE,SAAS,EACrD,SAAA,QAAA,CAAA,CAED,CAAA,CACD,CAAA,CACD,CAAA,CAAA,EAjEK,GAAG,EAAE,cAAc,IAAI,EAAE,SAAS,EAAA,CAmExC,CAAA,CACF,CAAA,EACD,CAEF"}
@@ -0,0 +1,2 @@
1
+ import{j as r}from"./index-iuxgtzEW.js";import{T as o}from"./TurnMemoryView-5tLbWkRv.js";import"./card-Cfhz9X31.js";import"./button-DhQQAJGm.js";function e(){return r.jsx(o,{})}export{e as default};
2
+ //# sourceMappingURL=TurnsTab-C7pm92Hg.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TurnsTab-C-uZNH2F.js","sources":["../../src/tabs/TurnsTab.tsx"],"sourcesContent":["/**\n * dashboard-client/src/tabs/TurnsTab.tsx — Turn-by-turn memory surface (S52).\n *\n * DASH-0d consolidation: the sessions surface owns the turns body as a drill-\n * down (`SessionsTab/TurnMemoryView.tsx`, re-homed VERBATIM in DASH-0b). This\n * standalone top-level file is reduced to a thin shell re-exporting\n * `TurnMemoryView`, so the flag-off pre-rollup 13-tab surface set still\n * resolves `TurnsTab` (deep-link + lazy-import anchor) with no duplicated\n * render body. The canonical home is `SessionsTab/TurnMemoryView.tsx`.\n */\n\nimport type React from \"react\";\nimport { TurnMemoryView } from \"./SessionsTab/TurnMemoryView\";\n\nexport default function TurnsTab(): React.ReactElement {\n\treturn <TurnMemoryView />;\n}\n"],"names":["TurnsTab","TurnMemoryView"],"mappings":"iJAcA,SAAwBA,GAA+B,CACtD,aAAQC,EAAA,EAAe,CACxB"}
1
+ {"version":3,"file":"TurnsTab-C7pm92Hg.js","sources":["../../src/tabs/TurnsTab.tsx"],"sourcesContent":["/**\n * dashboard-client/src/tabs/TurnsTab.tsx — Turn-by-turn memory surface (S52).\n *\n * DASH-0d consolidation: the sessions surface owns the turns body as a drill-\n * down (`SessionsTab/TurnMemoryView.tsx`, re-homed VERBATIM in DASH-0b). This\n * standalone top-level file is reduced to a thin shell re-exporting\n * `TurnMemoryView`, so the flag-off pre-rollup 13-tab surface set still\n * resolves `TurnsTab` (deep-link + lazy-import anchor) with no duplicated\n * render body. The canonical home is `SessionsTab/TurnMemoryView.tsx`.\n */\n\nimport type React from \"react\";\nimport { TurnMemoryView } from \"./SessionsTab/TurnMemoryView\";\n\nexport default function TurnsTab(): React.ReactElement {\n\treturn <TurnMemoryView />;\n}\n"],"names":["TurnsTab","TurnMemoryView"],"mappings":"iJAcA,SAAwBA,GAA+B,CACtD,aAAQC,EAAA,EAAe,CACxB"}
@@ -1,2 +1,2 @@
1
- import{j as r,B as a}from"./index-CL6Af_JZ.js";function t({status:e}){switch(e){case"live":return r.jsx(a,{variant:"success",children:"LIVE"});case"awaiting_data":return r.jsx(a,{variant:"warning",children:"AWAITING DATA"});case"deferred":return r.jsx(a,{variant:"outline",children:"DEFERRED"});case"structural":return r.jsx(a,{variant:"accent",children:"STRUCTURAL"});case"off":return r.jsx(a,{variant:"danger",children:"OFF"});default:return r.jsx(a,{variant:"danger",children:"OFF"})}}export{t as V};
2
- //# sourceMappingURL=VcStatusBadge-DyOagOVb.js.map
1
+ import{j as r,B as a}from"./index-iuxgtzEW.js";function t({status:e}){switch(e){case"live":return r.jsx(a,{variant:"success",children:"LIVE"});case"awaiting_data":return r.jsx(a,{variant:"warning",children:"AWAITING DATA"});case"deferred":return r.jsx(a,{variant:"outline",children:"DEFERRED"});case"structural":return r.jsx(a,{variant:"accent",children:"STRUCTURAL"});case"off":return r.jsx(a,{variant:"danger",children:"OFF"});default:return r.jsx(a,{variant:"danger",children:"OFF"})}}export{t as V};
2
+ //# sourceMappingURL=VcStatusBadge-ObhcIyfN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VcStatusBadge-DyOagOVb.js","sources":["../../src/tabs/VcStatusBadge.tsx"],"sourcesContent":["import { Badge } from \"../components/ui/badge\";\n\ntype VcStatus = \"live\" | \"awaiting_data\" | \"deferred\" | \"structural\" | \"off\";\n\nexport function VcStatusBadge({\n status,\n}: {\n status?: VcStatus | string;\n}): React.ReactElement {\n switch (status) {\n case \"live\":\n return <Badge variant=\"success\">LIVE</Badge>;\n case \"awaiting_data\":\n return <Badge variant=\"warning\">AWAITING DATA</Badge>;\n case \"deferred\":\n return <Badge variant=\"outline\">DEFERRED</Badge>;\n case \"structural\":\n return <Badge variant=\"accent\">STRUCTURAL</Badge>;\n case \"off\":\n return <Badge variant=\"danger\">OFF</Badge>;\n default:\n return <Badge variant=\"danger\">OFF</Badge>;\n }\n}\n"],"names":["VcStatusBadge","status","jsx","Badge"],"mappings":"+CAIO,SAASA,EAAc,CAC5B,OAAAC,CACF,EAEuB,CACrB,OAAQA,EAAA,CACN,IAAK,OACH,OAAOC,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,OAAI,EACtC,IAAK,gBACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,gBAAa,EAC/C,IAAK,WACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,WAAQ,EAC1C,IAAK,aACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,aAAU,EAC3C,IAAK,MACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,MAAG,EACpC,QACE,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,MAAG,CAAA,CAExC"}
1
+ {"version":3,"file":"VcStatusBadge-ObhcIyfN.js","sources":["../../src/tabs/VcStatusBadge.tsx"],"sourcesContent":["import { Badge } from \"../components/ui/badge\";\n\ntype VcStatus = \"live\" | \"awaiting_data\" | \"deferred\" | \"structural\" | \"off\";\n\nexport function VcStatusBadge({\n status,\n}: {\n status?: VcStatus | string;\n}): React.ReactElement {\n switch (status) {\n case \"live\":\n return <Badge variant=\"success\">LIVE</Badge>;\n case \"awaiting_data\":\n return <Badge variant=\"warning\">AWAITING DATA</Badge>;\n case \"deferred\":\n return <Badge variant=\"outline\">DEFERRED</Badge>;\n case \"structural\":\n return <Badge variant=\"accent\">STRUCTURAL</Badge>;\n case \"off\":\n return <Badge variant=\"danger\">OFF</Badge>;\n default:\n return <Badge variant=\"danger\">OFF</Badge>;\n }\n}\n"],"names":["VcStatusBadge","status","jsx","Badge"],"mappings":"+CAIO,SAASA,EAAc,CAC5B,OAAAC,CACF,EAEuB,CACrB,OAAQA,EAAA,CACN,IAAK,OACH,OAAOC,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,OAAI,EACtC,IAAK,gBACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,gBAAa,EAC/C,IAAK,WACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,UAAU,SAAA,WAAQ,EAC1C,IAAK,aACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,aAAU,EAC3C,IAAK,MACH,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,MAAG,EACpC,QACE,OAAOD,EAAAA,IAACC,EAAA,CAAM,QAAQ,SAAS,SAAA,MAAG,CAAA,CAExC"}
@@ -1,2 +1,2 @@
1
- import{j as e,r as j,B as p,u as q,e as z}from"./index-CL6Af_JZ.js";import{C as c,a as x,b as u,c as m}from"./card-Dvl16_R5.js";import{V as h}from"./VcStatusBadge-DyOagOVb.js";import{i as Y,a as W}from"./client-extra-BShDrG99.js";async function G(){const s=await fetch("/api/vector-cortex/evaluation");if(!s.ok)throw new Error(`vector-cortex evaluation: ${s.status}`);return s.json()}async function R(){const s=await fetch("/api/vector-cortex/health");if(!s.ok)throw new Error(`vector-cortex health: ${s.status}`);return s.json()}async function K(){const s=await fetch("/api/vector-cortex/topology");if(!s.ok)throw new Error(`vector-cortex topology: ${s.status}`);return s.json()}async function Q(){const s=await fetch("/api/vector-cortex/query");if(!s.ok)throw new Error(`vector-cortex query: ${s.status}`);return s.json()}async function J(){const s=await fetch("/api/vector-cortex/shards");if(!s.ok)throw new Error(`vector-cortex shards: ${s.status}`);return s.json()}async function Z(){const s=await fetch("/api/vector-cortex/reconstruct");if(!s.ok)throw new Error(`vector-cortex reconstruct: ${s.status}`);return s.json()}async function X(){const s=await fetch("/api/vector-cortex/plans");if(!s.ok)throw new Error(`vector-cortex plans: ${s.status}`);return s.json()}async function ee(){const s=await fetch("/api/vector-cortex/render");if(!s.ok)throw new Error(`vector-cortex render: ${s.status}`);return s.json()}async function se(){const s=await fetch("/api/vector-cortex/rollout");if(!s.ok)throw new Error(`vector-cortex rollout: ${s.status}`);return s.json()}async function te(){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 re(){const s=await fetch("/api/vector-cortex/restore");if(!s.ok)throw new Error(`vector-cortex restore: ${s.status}`);return s.json()}async function ae(){const s=await fetch("/api/vector-cortex/repair");if(!s.ok)throw new Error(`vector-cortex repair: ${s.status}`);return s.json()}async function ne(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 le(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 oe(){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 de(){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 ie(){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 ce(){const s=await fetch("/api/vector-cortex/outcomes");if(!s.ok)throw new Error(`vector-cortex outcomes: ${s.status}`);return s.json()}async function xe(){const s=await fetch("/api/vector-cortex/policy");if(!s.ok)throw new Error(`vector-cortex policy: ${s.status}`);return s.json()}async function ue(){const s=await fetch("/api/vector-cortex/platform");if(!s.ok)throw new Error(`vector-cortex platform: ${s.status}`);return s.json()}function t({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 me(){const[s,a]=j.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,platform:null}),l=j.useCallback(()=>{a(r=>({...r,loading:!0})),G().then(r=>a(n=>({...n,data:r,loading:!1,error:null}))).catch(r=>a(n=>({...n,loading:!1,error:r instanceof Error?r.message:String(r)}))),R().then(r=>a(n=>({...n,health:r}))).catch(()=>{}),ne().then(r=>a(n=>({...n,ledger:r}))).catch(()=>{}),K().then(r=>a(n=>({...n,topology:r}))).catch(()=>{}),Q().then(r=>a(n=>({...n,query:r}))).catch(()=>{}),J().then(r=>a(n=>({...n,shards:r}))).catch(()=>{}),Z().then(r=>a(n=>({...n,reconstruct:r}))).catch(()=>{}),X().then(r=>a(n=>({...n,plans:r}))).catch(()=>{}),ee().then(r=>a(n=>({...n,render:r}))).catch(()=>{}),se().then(r=>a(n=>({...n,rollout:r}))).catch(()=>{}),te().then(r=>a(n=>({...n,closureProof:r}))).catch(()=>{}),re().then(r=>a(n=>({...n,restore:r}))).catch(()=>{}),ae().then(r=>a(n=>({...n,repair:r}))).catch(()=>{}),oe().then(r=>a(n=>({...n,crystals:r}))).catch(()=>{}),de().then(r=>a(n=>({...n,economics:r}))).catch(()=>{}),ie().then(r=>a(n=>({...n,diagnostics:r}))).catch(()=>{}),ce().then(r=>a(n=>({...n,outcomes:r}))).catch(()=>{}),xe().then(r=>a(n=>({...n,policy:r}))).catch(()=>{}),ue().then(r=>a(n=>({...n,platform:r}))).catch(()=>{})},[]);return j.useEffect(()=>{l();const r=setInterval(l,5e3);return()=>clearInterval(r)},[l]),[s,l]}function V({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Validated Prompt Renderer (VC5B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Render fixtures",value:String(s.renderCount)}),e.jsx(t,{label:"Provider profiles",value:String(s.providerCount)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Renderer disabled (VC5B off)."})})]})}function E({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Graduated Rollout (VC5C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Gate",value:`${s.gatePct}%`}),e.jsx(t,{label:"Exposed buckets",value:String(s.bucketCount)}),e.jsx(t,{label:"Total buckets",value:String(s.buckets)}),e.jsx(t,{label:"Promotion",value:s.promotionBlocked?"FROZEN":"OPEN"}),e.jsx(t,{label:"Events",value:String(s.events)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Rollout disabled (VC5C off)."})})]})}function A({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Closure Optimization (VC6A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Optimizations",value:String(s.optimizations)}),e.jsx(t,{label:"Proof rejections",value:String(s.proofRejections)}),e.jsx(t,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(t,{label:"Retained edges",value:String(s.retainedEdgeTotal)}),e.jsx(t,{label:"Removed edges",value:String(s.removedEdgeTotal)}),e.jsx(t,{label:"Conservative walks",value:String(s.conservativeTraversalTotal)}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Closure optimization disabled (VC6A off) — conservative VC4C closure used directly (mode B)."})})]})}function k({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Exact Source Restoration (VC6B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Restore attempts",value:String(s.restoreAttempts)}),e.jsx(t,{label:"Restored",value:String(s.restoredCount)}),e.jsx(t,{label:"Missing source",value:String(s.missingCount)}),e.jsx(t,{label:"Digest rejections",value:String(s.digestRejections)}),e.jsx(t,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 D({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Self-Healing Derived State (VC6C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Repair attempts",value:String(s.repairAttempts)}),e.jsx(t,{label:"Repairs planned",value:String(s.repairsPlanned)}),e.jsx(t,{label:"Pointers switched",value:String(s.pointersSwitched)}),e.jsx(t,{label:"Backoffs",value:String(s.backoffs)}),e.jsx(t,{label:"Last backoff",value:s.lastBackoffMs===null?"none":`${s.lastBackoffMs}ms`}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 _({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Frozen Range Crystals (VC7A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Crystals",value:String(s.crystalCount)}),e.jsx(t,{label:"Frozen bytes",value:String(s.totalBytes)}),e.jsx(t,{label:"Hits",value:String(s.hits)}),e.jsx(t,{label:"Misses",value:String(s.misses)}),e.jsx(t,{label:"Hit bytes",value:String(s.hitBytes)}),e.jsx(t,{label:"Writes",value:String(s.writes)}),e.jsx(t,{label:"Duplicate writes",value:String(s.duplicateWrites)}),e.jsx(t,{label:"Collisions",value:String(s.collisions)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 M({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Cache Economics (VC7B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Profiles",value:String(s.profileCount)}),e.jsx(t,{label:"Proven exclusions",value:String(s.provenExclusions)}),e.jsx(t,{label:"Unproven exclusions",value:String(s.unprovenExclusions)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 P({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Cache Diagnostics & Breakers (VC7C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Profile misses",value:String(s.profileMisses)}),e.jsx(t,{label:"Range misses",value:String(s.rangeMisses)}),e.jsx(t,{label:"Dependency misses",value:String(s.dependencyMisses)}),e.jsx(t,{label:"Request misses",value:String(s.requestMisses)}),e.jsx(t,{label:"Generation misses",value:String(s.generationMisses)}),e.jsx(t,{label:"Unknown misses",value:String(s.unknownMisses)}),e.jsx(t,{label:"Serves blocked",value:String(s.serveBlocked)}),e.jsx(t,{label:"Breaker",value:s.breakerState}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 w({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Consent-Bound Outcomes (VC8A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Outcomes",value:String(s.outcomeCount)}),e.jsx(t,{label:"Consented sessions",value:String(s.consentedSessions)}),e.jsx(t,{label:"Revoked sessions",value:String(s.revokedSessions)}),e.jsx(t,{label:"Manifests",value:String(s.manifestCount)}),e.jsx(t,{label:"Excluded records",value:String(s.excludedCount)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 T({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Shadow Adaptive Policy (VC8B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Shadow decisions",value:String(s.shadowDecisions)}),e.jsx(t,{label:"Clamped",value:String(s.clampedDecisions)}),e.jsx(t,{label:"Rejected inputs",value:String(s.rejectedInputs)}),e.jsx(t,{label:"Live mutations",value:String(s.liveMutations)}),e.jsx(t,{label:"Pressure version",value:String(s.pressureVersion)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 B({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Canary Platform + Rust Parity (VC8C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Fixtures",value:String(s.fixtureCount)}),e.jsx(t,{label:"Passed",value:String(s.passed)}),e.jsx(t,{label:"Failed",value:String(s.failed)}),e.jsx(t,{label:"External runner",value:s.externalRunnerConfigured?"configured":"none"}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only canary selection and external Rust parity — aggregate counts and RUST_ codes only. The selector admits a qualified external Rust artifact only when ABI version, URL metadata, commit, Cargo.lock digest, and platform all match evidence; otherwise it demotes to TS reference (mode B) or legacy (mode C). The cross-conformance runner exchanges length-framed neutral records over a local stdin/stdout channel (no network). No artifact bytes, output bytes, or free-text ever reaches the client."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Canary platform disabled (VC8C off) — no engine parity checks are reported, so the selection stays at the predecessor (mode C). The selector and cross-conformance runner arithmetic still run; only this reporting seam is suppressed."})})]})}function F({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Dual-Tier Shards (VC4A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Semantic shards",value:String(s.semanticCount)}),e.jsx(t,{label:"Exact shards",value:String(s.exactCount)}),e.jsx(t,{label:"Byte total",value:String(s.byteTotal)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Dual-tier shards disabled (VC4A off)."})})]})}function $({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Reconstruction Fidelity (VC4C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Closure attempts",value:String(s.closureAttempts)}),e.jsx(t,{label:"Closure rejections",value:String(s.closureRejections)}),e.jsx(t,{label:"Validated",value:String(s.validatedCount)}),e.jsx(t,{label:"Invalidated",value:String(s.invalidatedCount)}),e.jsx(t,{label:"Span total",value:String(s.spanTotal)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Reconstruction fidelity disabled (VC4C off)."})})]})}function I({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Plan Manifests (VC5A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"DAG fixtures",value:String(s.dagCount)}),e.jsx(t,{label:"Plan fixtures",value:String(s.plannerCount)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"PromptDagV1 + budgeted planner disabled (VC5A off)."})})]})}function L({topology:s,query:a}){return e.jsxs(e.Fragment,{children:[e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Derived Cortex Store (VC3A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Generation",value:s.generationId??"—"}),e.jsx(t,{label:"Ordinal",value:s.ordinal??"—"}),e.jsx(t,{label:"Records",value:String(s.recordCount)}),e.jsx(t,{label:"Frontier (HW)",value:s.sourceHighWater}),e.jsx(t,{label:"Root digest",value:s.rootDigest?s.rootDigest.slice(0,16):"—"}),s.nodes!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Nodes",value:String(s.nodes?.length??0)}),e.jsx(t,{label:"Edges",value:String(s.edges?.length??0)}),e.jsx(t,{label:"Graph digest",value:s.generationDigest?s.generationDigest.slice(0,16):"—"})]})]}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]}),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((l,r)=>e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.source}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.target}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.head}),e.jsx("td",{className:"py-1 pr-2",children:l.direction}),e.jsx("td",{className:"py-1 font-mono",children:l.score})]},`${l.source}-${l.target}-${l.head}-${r}`))})]})]})]}):e.jsx("div",{className:"vc-empty",children:"Cortex store disabled (VC3A off)."})})]}),e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Topology Query Diagnostics (VC3C)"}),e.jsx(h,{status:a?.status})]})}),e.jsx(m,{children:a?.enabled?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:e.jsx(t,{label:"Router version",value:String(a.routerVersion)})}),a?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),a?.status==="deferred"&&a?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",a.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Query diagnostics unavailable (VC3C off)."})})]})]})}function O({ledger:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Occurrence Ledger (VC1B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Session",value:s.session}),e.jsx(t,{label:"High-water",value:s.highWater}),e.jsx(t,{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}`))})]})}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Ledger disabled (VC1B off)."})})]})}function U({encoderMode:s,encoderAssetDigest:a,status:l}){const[r,n]=j.useState({state:"idle"}),[b,g]=j.useState(!1),[v,o]=j.useState(null),i=d=>{W(d).then(f=>{f.status==="improving"?(n({state:"improving",progress:f.progress,jobId:d}),window.setTimeout(()=>i(d),2e3)):f.status==="qualified"?n({state:"promoted",digest:f.assetDigest,verdictText:f.verdict.verdict}):n({state:"rejected",reason:f.reason}),g(!1)}).catch(f=>{o(f instanceof Error?f.message:String(f)),n({state:"idle"}),g(!1)})},y=()=>{window.confirm("Run local ML5-A training and re-qualify the encoder heads? The Improve job is local-only.")&&(g(!0),o(null),Y().then(d=>{n({state:"improving",progress:0,jobId:d.jobId}),i(d.jobId)}).catch(d=>{o(d instanceof Error?d.message:String(d)),g(!1)}))},C=r.state==="promoted"?e.jsx(p,{variant:"success",children:"Promoted"}):r.state==="rejected"?e.jsx(p,{variant:"danger",children:"Rejected"}):s==="A"?e.jsx(p,{variant:"success",children:"Promoted"}):e.jsx(p,{variant:"outline",children:"Idle"});return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Model Improvement (ML5-D)"}),C]})}),e.jsxs(m,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"Encoder mode",value:s}),e.jsx(t,{label:"Asset digest",value:a?a.slice(0,12):"none"}),e.jsx(t,{label:"Status",value:l??"off"}),e.jsx(t,{label:"Job",value:r.state==="improving"?`${Math.round(r.progress*100)}%`:r.state==="promoted"?"promoted":r.state==="rejected"?"rejected":"idle"})]}),(r.state==="promoted"||r.state==="rejected")&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:r.state==="promoted"?`Qualified verdict: ${r.verdictText} · asset ${r.digest.slice(0,12)}`:`Demoted to mode B: ${r.reason}`}),v&&e.jsx("div",{className:"vc-error mt-2 text-xs",children:v}),e.jsx("div",{className:"mt-3",children:e.jsx("button",{onClick:y,disabled:b||l==="off",className:"rounded border border-border px-3 py-1 text-xs disabled:opacity-50",children:b?"Improving…":"Improve"})})]})]})}function N({id:s,title:a}){return e.jsx("h2",{id:s,className:"font-heading text-lg font-semibold",children:a})}function he({health:s,onReset:a,resetMsg:l}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Safety Envelope (VC0C)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[s?.stateSource==="ephemeral"&&e.jsx(p,{variant:"outline",children:"EPHEMERAL (non-live)"}),e.jsx("button",{onClick:a,disabled:!s?.enabled,className:"rounded border border-border px-2 py-1 text-xs disabled:opacity-50",children:"Reset Cooldown"})]})]})}),e.jsxs(m,{children:[l&&e.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:l}),s?e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"State",value:s.state}),e.jsx(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Window",value:`${s.windowMs}ms`}),e.jsx(t,{label:"Probes",value:String(s.probeCount)}),e.jsx(t,{label:"Backoff",value:`${s.backoffDelayMs}ms`}),e.jsx(t,{label:"Failures",value:`${s.failures}/${s.attempts}`}),e.jsx(t,{label:"Frontier",value:s.stateSource==="ephemeral"?"non-live":s.frontierFrozen?"FROZEN":"LIVE"}),e.jsx(t,{label:"Spool lag",value:String(s.spoolLag)}),e.jsx(t,{label:"Encoder mode",value:s.encoderMode}),e.jsx(t,{label:"Encoder asset",value:s.encoderAssetDigest?s.encoderAssetDigest.slice(0,12):"none"})]}):e.jsx("div",{className:"vc-empty",children:"Health unavailable (VC0C off)."})]})]})}function fe({data:s,health:a,poll:l,onReset:r,resetMsg:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{"aria-labelledby":"cortex-status",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-status",title:"Cortex status"}),e.jsx(he,{health:a,onReset:r,resetMsg:n}),s.ml5dEnabled&&e.jsx(U,{encoderMode:a?.encoderMode??"B",encoderAssetDigest:a?.encoderAssetDigest??null,status:s.status}),e.jsx(L,{topology:l.topology,query:l.query}),e.jsx(F,{view:l.shards}),e.jsx($,{view:l.reconstruct})]}),e.jsxs("section",{"aria-labelledby":"cortex-repair",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-repair",title:"Cortex repair"}),e.jsx(A,{view:l.closureProof}),e.jsx(k,{view:l.restore}),e.jsx(D,{view:l.repair})]}),e.jsxs("section",{"aria-labelledby":"cortex-cache",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-cache",title:"Cortex cache"}),e.jsx(_,{view:l.crystals}),e.jsx(M,{view:l.economics}),e.jsx(P,{view:l.diagnostics})]}),e.jsxs("section",{"aria-labelledby":"cortex-adaptive",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-adaptive",title:"Cortex adaptive"}),e.jsx(w,{view:l.outcomes}),e.jsx(T,{view:l.policy}),e.jsx(I,{view:l.plans}),e.jsx(V,{view:l.render}),e.jsx(E,{view:l.rollout}),e.jsx(B,{view:l.platform}),e.jsx(O,{ledger:l.ledger})]})]})}const je="MEGACOMPACT_DASH_0B";function ge(s){if(!s)return!1;for(const a of s.categories)for(const l of a.settings)if(l.key===je&&l.type==="boolean")return l.value===!0;return!1}function S({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 Ce(){const[s,a]=me(),[l,r]=j.useState(null),{data:n}=q(()=>z(),{pollInterval:0,maxRetries:0}),b=ge(n),{loading:g,error:v,data:o,health:i}=s,y=()=>{le("provider").then(d=>(r(`Breaker "${d.subsystem}" ${d.state}; evidence retained: ${d.failures} failures / ${d.attempts} attempts`),R())).then(d=>{a()}).catch(d=>r(d instanceof Error?d.message:String(d)))};if(g&&!o)return e.jsx("div",{className:"vc-loading",children:"Loading vector-cortex evaluation…"});if(v&&!o)return e.jsxs("div",{className:"vc-error",children:["Error: ",v]});if(!o)return e.jsx("div",{className:"vc-empty",children:"No evaluation data available."});const C=Math.max(1,...o.histogram.cells,o.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"}),e.jsx(h,{status:o.status}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.samples," samples · mode ",o.mode]})]}),b?e.jsx(fe,{data:o,health:i,poll:s,onReset:y,resetMsg:l}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs(c,{children:[e.jsx(x,{children:e.jsx(u,{children:"Samples"})}),e.jsxs(m,{children:[e.jsx("div",{className:"text-3xl font-bold",children:o.samples}),e.jsxs("div",{className:"mt-2 flex flex-col",children:[e.jsx(S,{mode:"A",count:o.byMode.A}),e.jsx(S,{mode:"B",count:o.byMode.B}),e.jsx(S,{mode:"C",count:o.byMode.C})]})]})]}),e.jsxs(c,{className:"md:col-span-2",children:[e.jsx(x,{children:e.jsx(u,{children:"Latency Histogram (ms, inclusive edges)"})}),e.jsxs(m,{children:[e.jsxs("div",{className:"flex items-end gap-2",style:{height:160},children:[o.histogram.edges.map((d,f)=>{const H=o.histogram.cells[f]/C*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:o.histogram.cells[f]}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,H),background:"#6366f1"}}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["≤",d]})]},d)}),e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:o.histogram.overflow}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,o.histogram.overflow/C*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: ",o.histogram.total," · Rejects: ",o.rejects.length]})]})]})]}),e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Safety Envelope (VC0C)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[i?.stateSource==="ephemeral"&&e.jsx(p,{variant:"outline",children:"EPHEMERAL (non-live)"}),e.jsx("button",{onClick:y,disabled:!i?.enabled,className:"rounded border border-border px-2 py-1 text-xs disabled:opacity-50",children:"Reset Cooldown"})]})]})}),e.jsxs(m,{children:[l&&e.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:l}),i?e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"State",value:i.state}),e.jsx(t,{label:"Mode",value:i.mode}),e.jsx(t,{label:"Window",value:`${i.windowMs}ms`}),e.jsx(t,{label:"Probes",value:String(i.probeCount)}),e.jsx(t,{label:"Backoff",value:`${i.backoffDelayMs}ms`}),e.jsx(t,{label:"Failures",value:`${i.failures}/${i.attempts}`}),e.jsx(t,{label:"Frontier",value:i.stateSource==="ephemeral"?"non-live":i.frontierFrozen?"FROZEN":"LIVE"}),e.jsx(t,{label:"Spool lag",value:String(i.spoolLag)}),e.jsx(t,{label:"Encoder mode",value:i.encoderMode}),e.jsx(t,{label:"Encoder asset",value:i.encoderAssetDigest?i.encoderAssetDigest.slice(0,12):"none"})]}):e.jsx("div",{className:"vc-empty",children:"Health unavailable (VC0C off)."})]})]}),o.ml5dEnabled&&e.jsx(U,{encoderMode:i?.encoderMode??"B",encoderAssetDigest:i?.encoderAssetDigest??null,status:o.status}),e.jsx(L,{topology:s.topology,query:s.query}),e.jsx(F,{view:s.shards}),e.jsx($,{view:s.reconstruct}),e.jsx(I,{view:s.plans}),e.jsx(V,{view:s.render}),e.jsx(E,{view:s.rollout}),e.jsx(A,{view:s.closureProof}),e.jsx(k,{view:s.restore}),e.jsx(D,{view:s.repair}),e.jsx(_,{view:s.crystals}),e.jsx(M,{view:s.economics}),e.jsx(P,{view:s.diagnostics}),e.jsx(w,{view:s.outcomes}),e.jsx(T,{view:s.policy}),e.jsx(B,{view:s.platform}),e.jsx(O,{ledger:s.ledger})]})]})}export{Ce as default};
2
- //# sourceMappingURL=VectorCortexTab-BxsbSUGv.js.map
1
+ import{j as e,r as j,B as p,u as q,e as z}from"./index-iuxgtzEW.js";import{C as c,a as x,b as u,c as m}from"./card-Cfhz9X31.js";import{V as h}from"./VcStatusBadge-ObhcIyfN.js";import{i as Y,a as W}from"./client-extra-CKNOGEz_.js";async function G(){const s=await fetch("/api/vector-cortex/evaluation");if(!s.ok)throw new Error(`vector-cortex evaluation: ${s.status}`);return s.json()}async function R(){const s=await fetch("/api/vector-cortex/health");if(!s.ok)throw new Error(`vector-cortex health: ${s.status}`);return s.json()}async function K(){const s=await fetch("/api/vector-cortex/topology");if(!s.ok)throw new Error(`vector-cortex topology: ${s.status}`);return s.json()}async function Q(){const s=await fetch("/api/vector-cortex/query");if(!s.ok)throw new Error(`vector-cortex query: ${s.status}`);return s.json()}async function J(){const s=await fetch("/api/vector-cortex/shards");if(!s.ok)throw new Error(`vector-cortex shards: ${s.status}`);return s.json()}async function Z(){const s=await fetch("/api/vector-cortex/reconstruct");if(!s.ok)throw new Error(`vector-cortex reconstruct: ${s.status}`);return s.json()}async function X(){const s=await fetch("/api/vector-cortex/plans");if(!s.ok)throw new Error(`vector-cortex plans: ${s.status}`);return s.json()}async function ee(){const s=await fetch("/api/vector-cortex/render");if(!s.ok)throw new Error(`vector-cortex render: ${s.status}`);return s.json()}async function se(){const s=await fetch("/api/vector-cortex/rollout");if(!s.ok)throw new Error(`vector-cortex rollout: ${s.status}`);return s.json()}async function te(){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 re(){const s=await fetch("/api/vector-cortex/restore");if(!s.ok)throw new Error(`vector-cortex restore: ${s.status}`);return s.json()}async function ae(){const s=await fetch("/api/vector-cortex/repair");if(!s.ok)throw new Error(`vector-cortex repair: ${s.status}`);return s.json()}async function ne(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 le(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 oe(){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 de(){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 ie(){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 ce(){const s=await fetch("/api/vector-cortex/outcomes");if(!s.ok)throw new Error(`vector-cortex outcomes: ${s.status}`);return s.json()}async function xe(){const s=await fetch("/api/vector-cortex/policy");if(!s.ok)throw new Error(`vector-cortex policy: ${s.status}`);return s.json()}async function ue(){const s=await fetch("/api/vector-cortex/platform");if(!s.ok)throw new Error(`vector-cortex platform: ${s.status}`);return s.json()}function t({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 me(){const[s,a]=j.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,platform:null}),l=j.useCallback(()=>{a(r=>({...r,loading:!0})),G().then(r=>a(n=>({...n,data:r,loading:!1,error:null}))).catch(r=>a(n=>({...n,loading:!1,error:r instanceof Error?r.message:String(r)}))),R().then(r=>a(n=>({...n,health:r}))).catch(()=>{}),ne().then(r=>a(n=>({...n,ledger:r}))).catch(()=>{}),K().then(r=>a(n=>({...n,topology:r}))).catch(()=>{}),Q().then(r=>a(n=>({...n,query:r}))).catch(()=>{}),J().then(r=>a(n=>({...n,shards:r}))).catch(()=>{}),Z().then(r=>a(n=>({...n,reconstruct:r}))).catch(()=>{}),X().then(r=>a(n=>({...n,plans:r}))).catch(()=>{}),ee().then(r=>a(n=>({...n,render:r}))).catch(()=>{}),se().then(r=>a(n=>({...n,rollout:r}))).catch(()=>{}),te().then(r=>a(n=>({...n,closureProof:r}))).catch(()=>{}),re().then(r=>a(n=>({...n,restore:r}))).catch(()=>{}),ae().then(r=>a(n=>({...n,repair:r}))).catch(()=>{}),oe().then(r=>a(n=>({...n,crystals:r}))).catch(()=>{}),de().then(r=>a(n=>({...n,economics:r}))).catch(()=>{}),ie().then(r=>a(n=>({...n,diagnostics:r}))).catch(()=>{}),ce().then(r=>a(n=>({...n,outcomes:r}))).catch(()=>{}),xe().then(r=>a(n=>({...n,policy:r}))).catch(()=>{}),ue().then(r=>a(n=>({...n,platform:r}))).catch(()=>{})},[]);return j.useEffect(()=>{l();const r=setInterval(l,5e3);return()=>clearInterval(r)},[l]),[s,l]}function V({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Validated Prompt Renderer (VC5B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Render fixtures",value:String(s.renderCount)}),e.jsx(t,{label:"Provider profiles",value:String(s.providerCount)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Renderer disabled (VC5B off)."})})]})}function E({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Graduated Rollout (VC5C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Gate",value:`${s.gatePct}%`}),e.jsx(t,{label:"Exposed buckets",value:String(s.bucketCount)}),e.jsx(t,{label:"Total buckets",value:String(s.buckets)}),e.jsx(t,{label:"Promotion",value:s.promotionBlocked?"FROZEN":"OPEN"}),e.jsx(t,{label:"Events",value:String(s.events)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Rollout disabled (VC5C off)."})})]})}function A({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Closure Optimization (VC6A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Optimizations",value:String(s.optimizations)}),e.jsx(t,{label:"Proof rejections",value:String(s.proofRejections)}),e.jsx(t,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(t,{label:"Retained edges",value:String(s.retainedEdgeTotal)}),e.jsx(t,{label:"Removed edges",value:String(s.removedEdgeTotal)}),e.jsx(t,{label:"Conservative walks",value:String(s.conservativeTraversalTotal)}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Closure optimization disabled (VC6A off) — conservative VC4C closure used directly (mode B)."})})]})}function k({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Exact Source Restoration (VC6B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Restore attempts",value:String(s.restoreAttempts)}),e.jsx(t,{label:"Restored",value:String(s.restoredCount)}),e.jsx(t,{label:"Missing source",value:String(s.missingCount)}),e.jsx(t,{label:"Digest rejections",value:String(s.digestRejections)}),e.jsx(t,{label:"Last rejection",value:s.lastRejection??"none"}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 D({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Self-Healing Derived State (VC6C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Repair attempts",value:String(s.repairAttempts)}),e.jsx(t,{label:"Repairs planned",value:String(s.repairsPlanned)}),e.jsx(t,{label:"Pointers switched",value:String(s.pointersSwitched)}),e.jsx(t,{label:"Backoffs",value:String(s.backoffs)}),e.jsx(t,{label:"Last backoff",value:s.lastBackoffMs===null?"none":`${s.lastBackoffMs}ms`}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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)."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 _({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Frozen Range Crystals (VC7A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Crystals",value:String(s.crystalCount)}),e.jsx(t,{label:"Frozen bytes",value:String(s.totalBytes)}),e.jsx(t,{label:"Hits",value:String(s.hits)}),e.jsx(t,{label:"Misses",value:String(s.misses)}),e.jsx(t,{label:"Hit bytes",value:String(s.hitBytes)}),e.jsx(t,{label:"Writes",value:String(s.writes)}),e.jsx(t,{label:"Duplicate writes",value:String(s.duplicateWrites)}),e.jsx(t,{label:"Collisions",value:String(s.collisions)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 M({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Cache Economics (VC7B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Profiles",value:String(s.profileCount)}),e.jsx(t,{label:"Proven exclusions",value:String(s.provenExclusions)}),e.jsx(t,{label:"Unproven exclusions",value:String(s.unprovenExclusions)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 P({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Cache Diagnostics & Breakers (VC7C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Profile misses",value:String(s.profileMisses)}),e.jsx(t,{label:"Range misses",value:String(s.rangeMisses)}),e.jsx(t,{label:"Dependency misses",value:String(s.dependencyMisses)}),e.jsx(t,{label:"Request misses",value:String(s.requestMisses)}),e.jsx(t,{label:"Generation misses",value:String(s.generationMisses)}),e.jsx(t,{label:"Unknown misses",value:String(s.unknownMisses)}),e.jsx(t,{label:"Serves blocked",value:String(s.serveBlocked)}),e.jsx(t,{label:"Breaker",value:s.breakerState}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 w({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Consent-Bound Outcomes (VC8A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Outcomes",value:String(s.outcomeCount)}),e.jsx(t,{label:"Consented sessions",value:String(s.consentedSessions)}),e.jsx(t,{label:"Revoked sessions",value:String(s.revokedSessions)}),e.jsx(t,{label:"Manifests",value:String(s.manifestCount)}),e.jsx(t,{label:"Excluded records",value:String(s.excludedCount)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 T({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Shadow Adaptive Policy (VC8B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Shadow decisions",value:String(s.shadowDecisions)}),e.jsx(t,{label:"Clamped",value:String(s.clampedDecisions)}),e.jsx(t,{label:"Rejected inputs",value:String(s.rejectedInputs)}),e.jsx(t,{label:"Live mutations",value:String(s.liveMutations)}),e.jsx(t,{label:"Pressure version",value:String(s.pressureVersion)}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):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 B({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Canary Platform + Rust Parity (VC8C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Fixtures",value:String(s.fixtureCount)}),e.jsx(t,{label:"Passed",value:String(s.passed)}),e.jsx(t,{label:"Failed",value:String(s.failed)}),e.jsx(t,{label:"External runner",value:s.externalRunnerConfigured?"configured":"none"}),e.jsx(t,{label:"Last failure",value:s.lastFailure??"none"}),e.jsx(t,{label:"Updated",value:s.updatedAt})]}),e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:"Reader-only canary selection and external Rust parity — aggregate counts and RUST_ codes only. The selector admits a qualified external Rust artifact only when ABI version, URL metadata, commit, Cargo.lock digest, and platform all match evidence; otherwise it demotes to TS reference (mode B) or legacy (mode C). The cross-conformance runner exchanges length-framed neutral records over a local stdin/stdout channel (no network). No artifact bytes, output bytes, or free-text ever reaches the client."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Canary platform disabled (VC8C off) — no engine parity checks are reported, so the selection stays at the predecessor (mode C). The selector and cross-conformance runner arithmetic still run; only this reporting seam is suppressed."})})]})}function F({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Dual-Tier Shards (VC4A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Semantic shards",value:String(s.semanticCount)}),e.jsx(t,{label:"Exact shards",value:String(s.exactCount)}),e.jsx(t,{label:"Byte total",value:String(s.byteTotal)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Dual-tier shards disabled (VC4A off)."})})]})}function $({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Reconstruction Fidelity (VC4C)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Closure attempts",value:String(s.closureAttempts)}),e.jsx(t,{label:"Closure rejections",value:String(s.closureRejections)}),e.jsx(t,{label:"Validated",value:String(s.validatedCount)}),e.jsx(t,{label:"Invalidated",value:String(s.invalidatedCount)}),e.jsx(t,{label:"Span total",value:String(s.spanTotal)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Reconstruction fidelity disabled (VC4C off)."})})]})}function I({view:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Plan Manifests (VC5A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"DAG fixtures",value:String(s.dagCount)}),e.jsx(t,{label:"Plan fixtures",value:String(s.plannerCount)}),e.jsx(t,{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."}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"PromptDagV1 + budgeted planner disabled (VC5A off)."})})]})}function L({topology:s,query:a}){return e.jsxs(e.Fragment,{children:[e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Derived Cortex Store (VC3A)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Generation",value:s.generationId??"—"}),e.jsx(t,{label:"Ordinal",value:s.ordinal??"—"}),e.jsx(t,{label:"Records",value:String(s.recordCount)}),e.jsx(t,{label:"Frontier (HW)",value:s.sourceHighWater}),e.jsx(t,{label:"Root digest",value:s.rootDigest?s.rootDigest.slice(0,16):"—"}),s.nodes!==void 0&&e.jsxs(e.Fragment,{children:[e.jsx(t,{label:"Nodes",value:String(s.nodes?.length??0)}),e.jsx(t,{label:"Edges",value:String(s.edges?.length??0)}),e.jsx(t,{label:"Graph digest",value:s.generationDigest?s.generationDigest.slice(0,16):"—"})]})]}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]}),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((l,r)=>e.jsxs("tr",{className:"border-b border-border/30",children:[e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.source}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.target}),e.jsx("td",{className:"py-1 pr-2 font-mono",children:l.head}),e.jsx("td",{className:"py-1 pr-2",children:l.direction}),e.jsx("td",{className:"py-1 font-mono",children:l.score})]},`${l.source}-${l.target}-${l.head}-${r}`))})]})]})]}):e.jsx("div",{className:"vc-empty",children:"Cortex store disabled (VC3A off)."})})]}),e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Topology Query Diagnostics (VC3C)"}),e.jsx(h,{status:a?.status})]})}),e.jsx(m,{children:a?.enabled?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-3",children:e.jsx(t,{label:"Router version",value:String(a.routerVersion)})}),a?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),a?.status==="deferred"&&a?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",a.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Query diagnostics unavailable (VC3C off)."})})]})]})}function O({ledger:s}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Occurrence Ledger (VC1B)"}),e.jsx(h,{status:s?.status})]})}),e.jsx(m,{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(t,{label:"Session",value:s.session}),e.jsx(t,{label:"High-water",value:s.highWater}),e.jsx(t,{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}`))})]})}),s?.status==="awaiting_data"&&e.jsx("div",{className:"mt-2 text-xs text-muted-foreground",children:"Awaiting first event. Data will appear after the next pipeline run."}),s?.status==="deferred"&&s?.deferredReason&&e.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:["Deferred: ",s.deferredReason.replace(/_/g," ")]})]}):e.jsx("div",{className:"vc-empty",children:"Ledger disabled (VC1B off)."})})]})}function U({encoderMode:s,encoderAssetDigest:a,status:l}){const[r,n]=j.useState({state:"idle"}),[b,g]=j.useState(!1),[v,o]=j.useState(null),i=d=>{W(d).then(f=>{f.status==="improving"?(n({state:"improving",progress:f.progress,jobId:d}),window.setTimeout(()=>i(d),2e3)):f.status==="qualified"?n({state:"promoted",digest:f.assetDigest,verdictText:f.verdict.verdict}):n({state:"rejected",reason:f.reason}),g(!1)}).catch(f=>{o(f instanceof Error?f.message:String(f)),n({state:"idle"}),g(!1)})},y=()=>{window.confirm("Run local ML5-A training and re-qualify the encoder heads? The Improve job is local-only.")&&(g(!0),o(null),Y().then(d=>{n({state:"improving",progress:0,jobId:d.jobId}),i(d.jobId)}).catch(d=>{o(d instanceof Error?d.message:String(d)),g(!1)}))},C=r.state==="promoted"?e.jsx(p,{variant:"success",children:"Promoted"}):r.state==="rejected"?e.jsx(p,{variant:"danger",children:"Rejected"}):s==="A"?e.jsx(p,{variant:"success",children:"Promoted"}):e.jsx(p,{variant:"outline",children:"Idle"});return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Model Improvement (ML5-D)"}),C]})}),e.jsxs(m,{children:[e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"Encoder mode",value:s}),e.jsx(t,{label:"Asset digest",value:a?a.slice(0,12):"none"}),e.jsx(t,{label:"Status",value:l??"off"}),e.jsx(t,{label:"Job",value:r.state==="improving"?`${Math.round(r.progress*100)}%`:r.state==="promoted"?"promoted":r.state==="rejected"?"rejected":"idle"})]}),(r.state==="promoted"||r.state==="rejected")&&e.jsx("div",{className:"mt-3 text-xs text-muted-foreground",children:r.state==="promoted"?`Qualified verdict: ${r.verdictText} · asset ${r.digest.slice(0,12)}`:`Demoted to mode B: ${r.reason}`}),v&&e.jsx("div",{className:"vc-error mt-2 text-xs",children:v}),e.jsx("div",{className:"mt-3",children:e.jsx("button",{onClick:y,disabled:b||l==="off",className:"rounded border border-border px-3 py-1 text-xs disabled:opacity-50",children:b?"Improving…":"Improve"})})]})]})}function N({id:s,title:a}){return e.jsx("h2",{id:s,className:"font-heading text-lg font-semibold",children:a})}function he({health:s,onReset:a,resetMsg:l}){return e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Safety Envelope (VC0C)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[s?.stateSource==="ephemeral"&&e.jsx(p,{variant:"outline",children:"EPHEMERAL (non-live)"}),e.jsx("button",{onClick:a,disabled:!s?.enabled,className:"rounded border border-border px-2 py-1 text-xs disabled:opacity-50",children:"Reset Cooldown"})]})]})}),e.jsxs(m,{children:[l&&e.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:l}),s?e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"State",value:s.state}),e.jsx(t,{label:"Mode",value:s.mode}),e.jsx(t,{label:"Window",value:`${s.windowMs}ms`}),e.jsx(t,{label:"Probes",value:String(s.probeCount)}),e.jsx(t,{label:"Backoff",value:`${s.backoffDelayMs}ms`}),e.jsx(t,{label:"Failures",value:`${s.failures}/${s.attempts}`}),e.jsx(t,{label:"Frontier",value:s.stateSource==="ephemeral"?"non-live":s.frontierFrozen?"FROZEN":"LIVE"}),e.jsx(t,{label:"Spool lag",value:String(s.spoolLag)}),e.jsx(t,{label:"Encoder mode",value:s.encoderMode}),e.jsx(t,{label:"Encoder asset",value:s.encoderAssetDigest?s.encoderAssetDigest.slice(0,12):"none"})]}):e.jsx("div",{className:"vc-empty",children:"Health unavailable (VC0C off)."})]})]})}function fe({data:s,health:a,poll:l,onReset:r,resetMsg:n}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{"aria-labelledby":"cortex-status",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-status",title:"Cortex status"}),e.jsx(he,{health:a,onReset:r,resetMsg:n}),s.ml5dEnabled&&e.jsx(U,{encoderMode:a?.encoderMode??"B",encoderAssetDigest:a?.encoderAssetDigest??null,status:s.status}),e.jsx(L,{topology:l.topology,query:l.query}),e.jsx(F,{view:l.shards}),e.jsx($,{view:l.reconstruct})]}),e.jsxs("section",{"aria-labelledby":"cortex-repair",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-repair",title:"Cortex repair"}),e.jsx(A,{view:l.closureProof}),e.jsx(k,{view:l.restore}),e.jsx(D,{view:l.repair})]}),e.jsxs("section",{"aria-labelledby":"cortex-cache",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-cache",title:"Cortex cache"}),e.jsx(_,{view:l.crystals}),e.jsx(M,{view:l.economics}),e.jsx(P,{view:l.diagnostics})]}),e.jsxs("section",{"aria-labelledby":"cortex-adaptive",className:"flex flex-col gap-4",children:[e.jsx(N,{id:"cortex-adaptive",title:"Cortex adaptive"}),e.jsx(w,{view:l.outcomes}),e.jsx(T,{view:l.policy}),e.jsx(I,{view:l.plans}),e.jsx(V,{view:l.render}),e.jsx(E,{view:l.rollout}),e.jsx(B,{view:l.platform}),e.jsx(O,{ledger:l.ledger})]})]})}const je="MEGACOMPACT_DASH_0B";function ge(s){if(!s)return!1;for(const a of s.categories)for(const l of a.settings)if(l.key===je&&l.type==="boolean")return l.value===!0;return!1}function S({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 Ce(){const[s,a]=me(),[l,r]=j.useState(null),{data:n}=q(()=>z(),{pollInterval:0,maxRetries:0}),b=ge(n),{loading:g,error:v,data:o,health:i}=s,y=()=>{le("provider").then(d=>(r(`Breaker "${d.subsystem}" ${d.state}; evidence retained: ${d.failures} failures / ${d.attempts} attempts`),R())).then(d=>{a()}).catch(d=>r(d instanceof Error?d.message:String(d)))};if(g&&!o)return e.jsx("div",{className:"vc-loading",children:"Loading vector-cortex evaluation…"});if(v&&!o)return e.jsxs("div",{className:"vc-error",children:["Error: ",v]});if(!o)return e.jsx("div",{className:"vc-empty",children:"No evaluation data available."});const C=Math.max(1,...o.histogram.cells,o.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"}),e.jsx(h,{status:o.status}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[o.samples," samples · mode ",o.mode]})]}),b?e.jsx(fe,{data:o,health:i,poll:s,onReset:y,resetMsg:l}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-3",children:[e.jsxs(c,{children:[e.jsx(x,{children:e.jsx(u,{children:"Samples"})}),e.jsxs(m,{children:[e.jsx("div",{className:"text-3xl font-bold",children:o.samples}),e.jsxs("div",{className:"mt-2 flex flex-col",children:[e.jsx(S,{mode:"A",count:o.byMode.A}),e.jsx(S,{mode:"B",count:o.byMode.B}),e.jsx(S,{mode:"C",count:o.byMode.C})]})]})]}),e.jsxs(c,{className:"md:col-span-2",children:[e.jsx(x,{children:e.jsx(u,{children:"Latency Histogram (ms, inclusive edges)"})}),e.jsxs(m,{children:[e.jsxs("div",{className:"flex items-end gap-2",style:{height:160},children:[o.histogram.edges.map((d,f)=>{const H=o.histogram.cells[f]/C*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:o.histogram.cells[f]}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,H),background:"#6366f1"}}),e.jsxs("span",{className:"text-[10px] text-muted-foreground",children:["≤",d]})]},d)}),e.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground",children:o.histogram.overflow}),e.jsx("div",{className:"w-full rounded-t",style:{height:Math.max(2,o.histogram.overflow/C*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: ",o.histogram.total," · Rejects: ",o.rejects.length]})]})]})]}),e.jsxs(c,{children:[e.jsx(x,{children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(u,{children:"Live Safety Envelope (VC0C)"}),e.jsxs("div",{className:"flex items-center gap-2",children:[i?.stateSource==="ephemeral"&&e.jsx(p,{variant:"outline",children:"EPHEMERAL (non-live)"}),e.jsx("button",{onClick:y,disabled:!i?.enabled,className:"rounded border border-border px-2 py-1 text-xs disabled:opacity-50",children:"Reset Cooldown"})]})]})}),e.jsxs(m,{children:[l&&e.jsx("div",{className:"mb-2 text-xs text-muted-foreground",children:l}),i?e.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[e.jsx(t,{label:"State",value:i.state}),e.jsx(t,{label:"Mode",value:i.mode}),e.jsx(t,{label:"Window",value:`${i.windowMs}ms`}),e.jsx(t,{label:"Probes",value:String(i.probeCount)}),e.jsx(t,{label:"Backoff",value:`${i.backoffDelayMs}ms`}),e.jsx(t,{label:"Failures",value:`${i.failures}/${i.attempts}`}),e.jsx(t,{label:"Frontier",value:i.stateSource==="ephemeral"?"non-live":i.frontierFrozen?"FROZEN":"LIVE"}),e.jsx(t,{label:"Spool lag",value:String(i.spoolLag)}),e.jsx(t,{label:"Encoder mode",value:i.encoderMode}),e.jsx(t,{label:"Encoder asset",value:i.encoderAssetDigest?i.encoderAssetDigest.slice(0,12):"none"})]}):e.jsx("div",{className:"vc-empty",children:"Health unavailable (VC0C off)."})]})]}),o.ml5dEnabled&&e.jsx(U,{encoderMode:i?.encoderMode??"B",encoderAssetDigest:i?.encoderAssetDigest??null,status:o.status}),e.jsx(L,{topology:s.topology,query:s.query}),e.jsx(F,{view:s.shards}),e.jsx($,{view:s.reconstruct}),e.jsx(I,{view:s.plans}),e.jsx(V,{view:s.render}),e.jsx(E,{view:s.rollout}),e.jsx(A,{view:s.closureProof}),e.jsx(k,{view:s.restore}),e.jsx(D,{view:s.repair}),e.jsx(_,{view:s.crystals}),e.jsx(M,{view:s.economics}),e.jsx(P,{view:s.diagnostics}),e.jsx(w,{view:s.outcomes}),e.jsx(T,{view:s.policy}),e.jsx(B,{view:s.platform}),e.jsx(O,{ledger:s.ledger})]})]})}export{Ce as default};
2
+ //# sourceMappingURL=VectorCortexTab-BtHZb7o7.js.map