openpond 0.0.47 → 0.0.49

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 (98) hide show
  1. package/dist/chunks/{app-layer-4PR4BS7N.js → app-layer-E2JWCA6D.js} +2 -2
  2. package/dist/chunks/{app-server-runtime-4KT5OMVC.js → app-server-runtime-OWEIHFEU.js} +6 -6
  3. package/dist/chunks/{apps-V7TF6RTV.js → apps-VQDIVGST.js} +2 -2
  4. package/dist/chunks/{chunk-CGVG46T5.js → chunk-3BR4ACFF.js} +1 -1
  5. package/dist/chunks/{chunk-KPVNB2KS.js → chunk-64LWPRGN.js} +2 -2
  6. package/dist/chunks/{chunk-I4CQJSZK.js → chunk-7G472COA.js} +451 -80
  7. package/dist/chunks/{chunk-7B2K727D.js → chunk-7M4HGT5X.js} +1 -1
  8. package/dist/chunks/{chunk-TNM6UTTF.js → chunk-CNIMJPM5.js} +1315 -894
  9. package/dist/chunks/{chunk-HGJQUQAP.js → chunk-LRLDBKTI.js} +1 -1
  10. package/dist/chunks/{chunk-YYJH2WWX.js → chunk-NR2N6JAC.js} +1 -1
  11. package/dist/chunks/{chunk-IM67TWCC.js → chunk-NRLI3S72.js} +1 -1
  12. package/dist/chunks/{chunk-YBQTQWOY.js → chunk-QD4FR3O4.js} +32 -32
  13. package/dist/chunks/{chunk-ERQUG3HB.js → chunk-UJV3UYLP.js} +1 -1
  14. package/dist/chunks/{cli-TINOXBYY.js → cli-T6TTMVSU.js} +5 -5
  15. package/dist/chunks/{core-commands-O76V62SB.js → core-commands-UW4XTGXK.js} +3 -3
  16. package/dist/chunks/{desktop-test-N2UPF5PP.js → desktop-test-JTBPE7CH.js} +2 -2
  17. package/dist/chunks/{extension-XQBSBEVO.js → extension-VP7LMA32.js} +1 -1
  18. package/dist/chunks/{help-YSGYNWPJ.js → help-OZNCHHO3.js} +1 -1
  19. package/dist/chunks/{opchat-F5OFTH56.js → opchat-RY3QU5UJ.js} +2 -2
  20. package/dist/chunks/{organizations-EEQPOIAZ.js → organizations-GLKSXK3Q.js} +4 -4
  21. package/dist/chunks/{profile-3OGGNTDS.js → profile-JWUYJF23.js} +2 -2
  22. package/dist/chunks/{project-agent-LVOSTVE5.js → project-agent-L4EB7QFO.js} +2 -2
  23. package/dist/chunks/{sandbox-command-S3VMWGMH.js → sandbox-command-26255MSV.js} +2 -2
  24. package/dist/chunks/{sandbox-template-UDXW7LRZ.js → sandbox-template-6UDA3AEY.js} +3 -3
  25. package/dist/chunks/{src-64JULYJS.js → src-7S66FU4P.js} +22 -21
  26. package/dist/chunks/{src-JMDVVYFD.js → src-GCZ2GMG3.js} +3 -3
  27. package/dist/chunks/{teams-bot-YRKKQDYL.js → teams-bot-PO3GOLWU.js} +2 -2
  28. package/dist/chunks/{workspaces-EICADW3U.js → workspaces-26IF6TQV.js} +2 -2
  29. package/dist/cli.js +13 -13
  30. package/dist/web/assets/{AppDialog-Bqw26W0m.js → AppDialog-BTOxCNC5.js} +1 -1
  31. package/dist/web/assets/{AppsView-CWhWKF1c.js → AppsView-Cm5x09IS.js} +1 -1
  32. package/dist/web/assets/{BrowserSidebar-MTkosLlw.js → BrowserSidebar-CIPh5JIn.js} +1 -1
  33. package/dist/web/assets/{CommandMenu-Bz9bpiwl.js → CommandMenu-DdR82TLd.js} +1 -1
  34. package/dist/web/assets/{CommunityView-BqFeUGPj.js → CommunityView-Dqu4cos1.js} +1 -1
  35. package/dist/web/assets/{ComposerCreateImproveStrip-B6BBqdaL.js → ComposerCreateImproveStrip-CW2QuI7r.js} +1 -1
  36. package/dist/web/assets/{GetStartedView-BsgErNU9.js → GetStartedView--CbCnzFQ.js} +1 -1
  37. package/dist/web/assets/{LabModelVersionDetailPage-BLnFb7Mt.js → LabModelVersionDetailPage-BPUvR5XP.js} +1 -1
  38. package/dist/web/assets/{LabSkillSidebar-Ba6gRUbM.js → LabSkillSidebar-CnuyFZ1G.js} +1 -1
  39. package/dist/web/assets/{LabsRoute-BFV7VPOU.js → LabsRoute-CYk2dzQp.js} +3 -3
  40. package/dist/web/assets/{MainChatThread-B283zmgR.js → MainChatThread-0Tc95p0t.js} +2 -2
  41. package/dist/web/assets/{MainPane-Lv073mMC.js → MainPane-Bke4JEHC.js} +3 -3
  42. package/dist/web/assets/{MarkdownText-CinDMr2e.js → MarkdownText-DTBS9xe7.js} +1 -1
  43. package/dist/web/assets/{Messages-okIKN3y-.js → Messages-Bae_sFx5.js} +1 -1
  44. package/dist/web/assets/{NativeSkillSidebar-B1QrK2aH.js → NativeSkillSidebar-DSoPD42b.js} +1 -1
  45. package/dist/web/assets/{NewProjectDialog-CcbDk9Py.js → NewProjectDialog-CmXg2GK7.js} +1 -1
  46. package/dist/web/assets/{OutputsPage-CmwXC2Xd.js → OutputsPage-XmIreC0M.js} +1 -1
  47. package/dist/web/assets/{RightChatPanelStack-CHOpwL1L.js → RightChatPanelStack-BMOtbjus.js} +1 -1
  48. package/dist/web/assets/{ScheduledWorkPage-BzSPcB3d.js → ScheduledWorkPage-Cn5a9VLV.js} +1 -1
  49. package/dist/web/assets/{SettingsView-CkmRV5NT.js → SettingsView-DXF8z3P2.js} +6 -6
  50. package/dist/web/assets/{TeamChatView-DevmTvuf.js → TeamChatView-CB_0oRid.js} +1 -1
  51. package/dist/web/assets/{TerminalOverlay-CteY7dSQ.js → TerminalOverlay-XhABQsCB.js} +1 -1
  52. package/dist/web/assets/{TrainingCreationPanel-AMq0npLN.js → TrainingCreationPanel-ChsDr2GP.js} +1 -1
  53. package/dist/web/assets/{TrainingDraftPanel-BVxPaBhF.js → TrainingDraftPanel-CDlpnno6.js} +1 -1
  54. package/dist/web/assets/{UsageSettingsSection-BPIzRNKL.js → UsageSettingsSection-NbX7_3Uz.js} +1 -1
  55. package/dist/web/assets/{WorkspaceDiffPanel-DMu3IIuX.js → WorkspaceDiffPanel-jaJU08NH.js} +3 -3
  56. package/dist/web/assets/{WorkspaceEnvironmentMenu-ConUKuWd.js → WorkspaceEnvironmentMenu-D0nvQmmj.js} +1 -1
  57. package/dist/web/assets/{WorkspaceGitDialogs-o76400dH.js → WorkspaceGitDialogs-C0PMpVfj.js} +1 -1
  58. package/dist/web/assets/{WorkspaceMonacoEditor-HwyVbn8h.js → WorkspaceMonacoEditor-6QNGzQUi.js} +3 -3
  59. package/dist/web/assets/{arrow-up-right-BKN-maHj.js → arrow-up-right-Cx2xjktp.js} +1 -1
  60. package/dist/web/assets/{chevron-up-CVs6VVxb.js → chevron-up-UF_r7JHT.js} +1 -1
  61. package/dist/web/assets/{circle-alert-C01fZFW7.js → circle-alert-BUHAQ7Du.js} +1 -1
  62. package/dist/web/assets/{cloud-upload-jtADHeTW.js → cloud-upload-Cc_ZQEAm.js} +1 -1
  63. package/dist/web/assets/{cssMode-xJZoI37_.js → cssMode-CrigFsxI.js} +1 -1
  64. package/dist/web/assets/{folder-open-DyyC6ByN.js → folder-open-D7a4t258.js} +1 -1
  65. package/dist/web/assets/{folder-plus-UGSTW1kn.js → folder-plus-CmeHTj5W.js} +1 -1
  66. package/dist/web/assets/{git-branch-D6gtbKJu.js → git-branch-CaVUghsI.js} +1 -1
  67. package/dist/web/assets/{git-commit-horizontal-C_GYw-SZ.js → git-commit-horizontal-oiDAVV_Y.js} +1 -1
  68. package/dist/web/assets/{htmlMode-BjKG829K.js → htmlMode-CLzM5GNi.js} +1 -1
  69. package/dist/web/assets/index-De6p2npi.js +1 -0
  70. package/dist/web/assets/index-UUM3pwfd.css +1 -0
  71. package/dist/web/assets/index-Ure41UF0.js +178 -0
  72. package/dist/web/assets/{info-z2hv9cD1.js → info-dTkimobU.js} +1 -1
  73. package/dist/web/assets/{jsonMode-DjZzpcCY.js → jsonMode-BBF67cOE.js} +1 -1
  74. package/dist/web/assets/{lspLanguageFeatures-B4RETEmT.js → lspLanguageFeatures-DHtN2nxz.js} +1 -1
  75. package/dist/web/assets/{monaco.contribution-I3nbx1nu.js → monaco.contribution-BClTZJd2.js} +2 -2
  76. package/dist/web/assets/{monaco.contribution-DJK2Dt3T.js → monaco.contribution-C_GWU01R.js} +2 -2
  77. package/dist/web/assets/{monaco.contribution-Du7kEHLz.js → monaco.contribution-DtM9AdPi.js} +2 -2
  78. package/dist/web/assets/{monaco.contribution-DCRifLw0.js → monaco.contribution-riAIDf7J.js} +2 -2
  79. package/dist/web/assets/{monitor-DCUsiZyp.js → monitor-POfnZCWw.js} +1 -1
  80. package/dist/web/assets/{play-DCKc0E80.js → play-CjWTsI9z.js} +1 -1
  81. package/dist/web/assets/{python-DwbW9406.js → python-CvZQM_g2.js} +1 -1
  82. package/dist/web/assets/{refresh-cw-D6okuGLV.js → refresh-cw-CeHT_tXT.js} +1 -1
  83. package/dist/web/assets/{reply-KIN_PSFi.js → reply-BkH8nKWG.js} +1 -1
  84. package/dist/web/assets/{save-D7tbQpM9.js → save-CmJ92Odx.js} +1 -1
  85. package/dist/web/assets/{square-BUG8bwGr.js → square-B00f_944.js} +1 -1
  86. package/dist/web/assets/{square-pen-CWS_8PrJ.js → square-pen-LHr8bFfZ.js} +1 -1
  87. package/dist/web/assets/{toggleHighContrast-CO8n70ql.js → toggleHighContrast-C6N52VOS.js} +1 -1
  88. package/dist/web/assets/{tsMode-f9Hqewvr.js → tsMode-CDIfvnHn.js} +1 -1
  89. package/dist/web/assets/{upload-DXI5er5D.js → upload-DK0-5jXz.js} +1 -1
  90. package/dist/web/assets/{useLocalAgentSchedules-BMvi6vmi.js → useLocalAgentSchedules-BUkZjV9E.js} +1 -1
  91. package/dist/web/assets/{wifi-off-B3ZtcrOA.js → wifi-off-BQGq-son.js} +1 -1
  92. package/dist/web/assets/{workers-CNGv6B0J.js → workers-BfcjsZ3C.js} +1 -1
  93. package/dist/web/assets/{yaml-C-tL3IVE.js → yaml-CNqgAihH.js} +1 -1
  94. package/dist/web/index.html +2 -2
  95. package/package.json +1 -1
  96. package/dist/web/assets/index-B8xSSlBW.js +0 -178
  97. package/dist/web/assets/index-C-1-yaL8.js +0 -1
  98. package/dist/web/assets/index-D9jTe16Q.css +0 -1
@@ -1 +1 @@
1
- import{r as b,j as e,au as ue,n as me,a as pe}from"./index-B8xSSlBW.js";import{s as Z,e as he,b as Q,d as K,f as ie}from"./training-model-data-B7-1Bxil.js";import{L as ge,l as xe,a as be,b as fe,c as je,m as ve,d as ye,e as Ne}from"./LabsRoute-BFV7VPOU.js";import"./cloud-upload-jtADHeTW.js";import"./MainPane-Lv073mMC.js";import"./square-pen-CWS_8PrJ.js";import"./arrow-up-right-BKN-maHj.js";import"./MarkdownText-CinDMr2e.js";import"./square-BUG8bwGr.js";import"./folder-open-DyyC6ByN.js";import"./AppDialog-Bqw26W0m.js";import"./ComposerCreateImproveStrip-B6BBqdaL.js";import"./circle-alert-C01fZFW7.js";import"./play-DCKc0E80.js";import"./refresh-cw-D6okuGLV.js";/* empty css */import"./UsageSettingsSection-BPIzRNKL.js";import"./index-C-1-yaL8.js";function ke({receipts:t}){const[l,a]=b.useState(!1);if(!t.length)return e.jsx("div",{className:"training-run-placeholder",children:"No on-policy rollout receipts were recorded for this run."});const r=[...t].sort((s,o)=>o.updatedAt.localeCompare(s.updatedAt)),u=l?r:r.slice(0,24);return e.jsxs("div",{className:"training-rollout-receipts",children:[t.length>24?e.jsxs("div",{className:"training-rollout-receipt-controls",children:[e.jsx("span",{children:l?`Showing all ${t.length} receipts`:`Showing latest ${u.length} of ${t.length} receipts`}),e.jsx("button",{className:"training-text-button",type:"button",onClick:()=>a(s=>!s),children:l?"Show latest 24":`Show all ${t.length}`})]}):null,u.map(s=>e.jsxs("details",{children:[e.jsxs("summary",{children:[e.jsx("span",{children:we(s.providerTrace.rolloutId)}),e.jsx("strong",{children:s.status}),e.jsx("em",{children:s.reward.eligible&&s.reward.raw!=null?s.reward.raw.toFixed(3):s.failureClass??"not reward eligible"})]}),e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(L,{label:"Correlation",value:s.correlationId}),e.jsx(L,{label:"Task",value:s.taskId}),e.jsx(L,{label:"Policy",value:s.policy.modelId}),e.jsx(L,{label:"Checkpoint",value:s.policy.checkpointId??"Provider initial policy"}),e.jsx(L,{label:"Environment",value:`${s.environment.id}@${s.environment.version}`}),e.jsx(L,{label:"World",value:`${s.environment.worldId} · ${s.environment.worldHash}`}),e.jsx(L,{label:"Raw reward",value:s.reward.raw==null?"Not eligible":String(s.reward.raw)}),e.jsx(L,{label:"Components",value:JSON.stringify(s.reward.components)}),e.jsx(L,{label:"Outcome",value:s.verifier?.outcome??s.failureClass??"Pending"}),e.jsx(L,{label:"Trace",value:`${s.providerTrace.experimentId}/${s.providerTrace.rolloutId}`})]})]},s.id))]})}function L({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function we(t){return t.replace(/^lineage_/,"").slice(0,18)}function Re({detail:t,loading:l}){if(l&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Loading evaluation results…"});const a=t?.evaluation;return a?e.jsxs("div",{className:"training-run-evaluation",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(q,{label:"Base score",value:X(a.base.meanScore)}),e.jsx(q,{label:"Trained score",value:X(a.trained.meanScore)}),e.jsx(q,{label:"Score change",value:Se(a.meanScoreDelta)}),e.jsx(q,{label:"Trained pass rate",value:$e(a.trained.passRate)})]}),a.base.count===0?e.jsx("p",{className:"training-muted",children:"Base-model scoring was not imported for this earlier run. New runs retain both base and trained evaluations."}):null,a.trained.count>0&&a.trained.scoredCount===0?e.jsx("p",{className:"training-muted",children:"Outputs were captured, but the grader was unavailable, so this run has no evaluation score."}):null,e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table training-evaluation-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Test example"}),e.jsx("th",{children:"Base"}),e.jsx("th",{children:"Trained"}),e.jsx("th",{children:"Result"})]})}),e.jsx("tbody",{children:a.examples.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("details",{children:[e.jsx("summary",{children:r.taskId}),e.jsx(Me,{input:r.input,baseOutput:r.baseOutput,trainedOutput:r.trainedOutput,baseGrade:r.baseGrade,trainedGrade:r.trainedGrade})]})}),e.jsx("td",{children:ee(r.baseGrade)}),e.jsx("td",{children:ee(r.trainedGrade)}),e.jsx("td",{children:Le(r.baseGrade,r.trainedGrade)})]},r.taskId))})]})})]}):e.jsx("div",{className:"training-run-placeholder",children:"No scored evaluation results are available for this run."})}function Me({input:t,baseOutput:l,trainedOutput:a,baseGrade:r,trainedGrade:u}){const s=[...new Set([...r?.feedback??[],...u?.feedback??[]])];return e.jsxs("div",{className:"training-evaluation-output",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Input"}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]}),l?e.jsxs("div",{children:[e.jsx("span",{children:"Base output"}),e.jsx("pre",{children:JSON.stringify(l,null,2)})]}):null,a?e.jsxs("div",{children:[e.jsx("span",{children:"Trained output"}),e.jsx("pre",{children:JSON.stringify(a,null,2)})]}):null,s.length?e.jsxs("div",{children:[e.jsx("span",{children:"Grader feedback"}),e.jsx("p",{children:s.join(" ")})]}):null]})}function q({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("span",{children:t}),e.jsx("strong",{children:l})]})}function X(t){return t==null?"Not recorded":t.toFixed(3)}function $e(t){return t==null?"Not recorded":`${Math.round(t*100)}%`}function Se(t){return t==null?"Not comparable":`${t>=0?"+":""}${t.toFixed(3)}`}function ee(t){return t?.status==="unavailable"?"Unavailable":t?.score==null?"Not scored":t.score.toFixed(3)}function Le(t,l){if(!l)return"Not evaluated";if(l.status==="unavailable")return"Unavailable";if(!t||t.score==null||l.score==null)return l.passed?"Passed":"Failed";const a=l.score-t.score;return Math.abs(a)<5e-4?"No change":a>0?`Improved ${a.toFixed(3)}`:`Regressed ${Math.abs(a).toFixed(3)}`}const te=[{key:"loss",label:"Loss",format:g},{key:"reward",label:"Reward",format:g},{key:"policyLoss",label:"Policy loss",format:g},{key:"advantageLoss",label:"Advantage loss",format:g},{key:"learningRate",label:"Learning rate",format:G},{key:"gradientNorm",label:"Gradient norm",format:g},{key:"meanTokenAccuracy",label:"Token accuracy",format:J},{key:"preferenceAccuracy",label:"Preference accuracy",format:J},{key:"preferenceMargin",label:"Preference margin",format:g},{key:"chosenReward",label:"Chosen reward",format:g},{key:"rejectedReward",label:"Rejected reward",format:g},{key:"chosenLogProbability",label:"Chosen log probability",format:g},{key:"rejectedLogProbability",label:"Rejected log probability",format:g},{key:"entropy",label:"Entropy",format:g},{key:"memoryBytes",label:"Memory",format:oe}],le=[{key:"meanReward",label:"Reward",format:g},{key:"meanReturn",label:"Return",format:g},{key:"learningRate",label:"Learning rate",format:G},{key:"policyLoss",label:"Policy loss",format:g},{key:"valueLoss",label:"Value loss",format:g},{key:"kl",label:"KL",format:g},{key:"entropy",label:"Entropy",format:g},{key:"policyClipFraction",label:"Policy clip fraction",format:J},{key:"valueClipFraction",label:"Value clip fraction",format:J},{key:"explainedVariance",label:"Explained variance",format:g}];function Te({detail:t,loading:l,error:a}){ue(a,{prefix:"Training metrics"});const r=b.useMemo(()=>Ie(t?.stepMetrics??[]),[t?.stepMetrics]),u=b.useMemo(()=>te.filter(n=>r.some(m=>m[n.key]!=null)),[r]),[s,o]=b.useState("loss"),v=u.find(n=>n.key===s)??u[0]??te[0],x=r.flatMap(n=>n[v.key]==null?[]:[{step:n.step,value:n[v.key]}]),p=b.useMemo(()=>Ee(t?.policyMetrics??[]),[t?.policyMetrics]),h=b.useMemo(()=>le.filter(n=>p.some(m=>m[n.key]!=null)),[p]),[f,j]=b.useState("meanReward"),y=h.find(n=>n.key===f)??h[0]??le[0],A=p.flatMap(n=>n[y.key]==null?[]:[{step:n.step,value:n[y.key]}]),R=p.flatMap(n=>n.meanReward==null?[]:[{step:n.step,value:n.meanReward}]),S=p.flatMap(n=>n.learningRate==null?[]:[{step:n.step,value:n.learningRate}]),c=b.useMemo(()=>Pe(t?.events??[]),[t?.events]),d=t?Ae(t):{};if(l&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Loading training metrics…"});if(a&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Training metrics are unavailable."});if(!t)return e.jsx("div",{className:"training-run-placeholder",children:"Select a training run to inspect its metrics."});if(p.length){if(p.some(m=>m.method==="grpo")||t.job.metadata.trainingMethod==="grpo")return e.jsx(ae,{learningRatePoints:S,rewardPoints:R,rolloutPoints:c});const n=p.at(-1);return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(T,{label:"Optimizer steps",value:n.step}),e.jsx(T,{label:"Latest reward",value:n.meanReward==null?null:g(n.meanReward)}),e.jsx(T,{label:"Policy loss",value:n.policyLoss==null?null:g(n.policyLoss)}),e.jsx(T,{label:"Rollouts",value:c.length||null}),e.jsx(T,{label:"Learning rate",value:n.learningRate==null?null:G(n.learningRate)}),e.jsx(T,{label:"Environment executions",value:n.environmentExecutions})]}),h.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Policy metrics",children:h.map(m=>e.jsx("button",{className:m.key===y.key?"active":"",role:"tab",type:"button","aria-selected":m.key===y.key,onClick:()=>j(m.key),children:m.label},m.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[c.length?e.jsx(B,{axisLabel:"Rollout",format:g,label:"Rollout reward",points:c}):null,e.jsx(B,{format:y.format,label:y.label,points:A})]})]}):null]})}const E=t.job.metadata.trainingMethod==="grpo",F=r.flatMap(n=>n.loss==null?[]:[n.loss]),C=r.flatMap(n=>n.learningRate==null?[]:[{step:n.step,value:n.learningRate}]),N=r.flatMap(n=>n.reward==null?[]:[{step:n.step,value:n.reward}]);if(E){const n=t.job.metadata.optimizerUpdatesObserved,m=typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):null;return e.jsx(ae,{learningRatePoints:m==null?C:C.filter(I=>I.step<=m),rewardPoints:m==null?N:N.filter(I=>I.step<=m),rolloutPoints:c})}return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(T,{label:"Steps",value:d.steps??Fe(r)}),e.jsx(T,{label:"Final loss",value:d.trainLoss==null?F.at(-1)==null?null:g(F.at(-1)):g(d.trainLoss)}),e.jsx(T,{label:"Peak memory",value:Be(t.stepMetrics)}),e.jsx(T,{label:"Adapter parameters",value:d.adapterParameterCount==null?null:d.adapterParameterCount.toLocaleString()})]}),u.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Training metrics",children:u.map(n=>e.jsx("button",{type:"button",role:"tab","aria-selected":n.key===v.key,className:n.key===v.key?"active":"",onClick:()=>o(n.key),children:n.label},n.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[e.jsx(B,{label:v.label,points:x,format:v.format}),v.key!=="learningRate"&&C.length?e.jsx(B,{label:"Learning rate",points:C,format:G}):null]})]}):e.jsx("div",{className:"training-run-placeholder",children:"This earlier run recorded its final result but not per-step Trainer logs."})]})}function ae({rewardPoints:t,rolloutPoints:l,learningRatePoints:a}){return e.jsx("div",{className:"training-run-metrics",children:e.jsxs("div",{className:"training-metric-chart-grid three",children:[e.jsx(B,{format:g,label:"Reward",points:t}),e.jsx(B,{axisLabel:"Rollout",format:g,label:"Rollout reward",points:l}),e.jsx(B,{format:G,label:"Learning rate",points:a})]})})}function B({label:t,points:l,format:a,axisLabel:r="Optimizer step"}){return e.jsxs("section",{className:"training-metric-chart-card",children:[e.jsxs("header",{children:[e.jsx("h4",{children:t}),e.jsxs("span",{children:[l.length," ",l.length===1?"point":"points"]})]}),l.length?e.jsx(Ce,{axisLabel:r,format:a,label:t,points:l}):e.jsx("div",{className:"training-metric-chart-empty",children:"Not recorded"})]})}function Ce({label:t,points:l,format:a,axisLabel:r}){const o={top:20,right:20,bottom:58,left:64},v=l.map(n=>n.value),x=Math.min(...v),p=Math.max(...v),h=p-x||Math.max(Math.abs(p)*.1,1e-9),f=x-h*.08,j=p+h*.08,y=l[0]?.step??0,A=l.at(-1)?.step??y+1,R=Math.max(1,A-y),S=760-o.right,c=n=>l.length===1?(o.left+S)/2:o.left+(n-y)/R*(760-o.left-o.right),d=n=>o.top+(j-n)/(j-f)*(270-o.top-o.bottom),E=l.map((n,m)=>`${m?"L":"M"}${c(n.step).toFixed(2)},${d(n.value).toFixed(2)}`).join(" "),F=270-o.bottom,C=l.length>1?`${E} L${c(A).toFixed(2)},${F} L${c(y).toFixed(2)},${F} Z`:"",N=r!=="Optimizer step"?r:t==="Learning rate"?"Update":"Step";return e.jsx("figure",{className:"training-line-chart","aria-label":`${t} by ${r.toLowerCase()}`,children:e.jsxs("svg",{viewBox:"0 0 760 270",role:"img","aria-labelledby":`metric-${t.replaceAll(" ","-")}`,children:[e.jsx("title",{id:`metric-${t.replaceAll(" ","-")}`,children:`${t} by ${r.toLowerCase()}`}),[0,.25,.5,.75,1].map(n=>{const m=o.top+n*(270-o.top-o.bottom),I=j-n*(j-f);return e.jsxs("g",{children:[e.jsx("line",{className:"training-chart-grid",x1:o.left,x2:760-o.right,y1:m,y2:m}),e.jsx("text",{className:"training-chart-label",x:o.left-10,y:m+4,textAnchor:"end",children:a(I)})]},n)}),e.jsx("line",{className:"training-chart-axis",x1:o.left,x2:760-o.right,y1:270-o.bottom,y2:270-o.bottom}),e.jsx("path",{className:"training-chart-area",d:C}),e.jsx("path",{className:"training-chart-line",d:E}),l.map(n=>e.jsx("circle",{className:"training-chart-point",cx:c(n.step),cy:d(n.value),r:l.length===1?"4.5":"3",children:e.jsx("title",{children:`${N} ${n.step}: ${a(n.value)}`})},`${n.step}-${n.value}`)),e.jsx("text",{className:"training-chart-label",x:c(y),y:236,textAnchor:"middle",children:y}),l.length>1?e.jsx("text",{className:"training-chart-label",x:S,y:236,textAnchor:"middle",children:A}):null,e.jsx("text",{className:"training-chart-label axis-title",x:(o.left+760-o.right)/2,y:261,textAnchor:"middle",children:r})]})})}function Pe(t){return t.flatMap(l=>{if(l.type!=="metric"||l.payload.metricKind!=="rollout_trajectory")return[];const a=ne(l.payload.rolloutIndex),r=ne(l.payload.reward);return a==null||r==null?[]:[{step:a,value:r}]})}function ne(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function T({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("span",{children:t}),e.jsx("strong",{children:l??"Not recorded"})]})}function Ae(t){const l=[...t.events].reverse().find(a=>a.type==="metric"&&a.payload.metricKind!=="sft_step"&&(typeof a.payload.trainLoss=="number"||typeof a.payload.steps=="number"));return Object.fromEntries(Object.entries(l?.payload??{}).filter(a=>typeof a[1]=="number"))}function Fe(t){const l=t.at(-1);return l?`${l.step} of ${l.maxSteps}`:null}function Ie(t){const l=new Map;for(const a of t)l.set(a.step,a);return[...l.values()].sort((a,r)=>a.step-r.step)}function Ee(t){const l=new Map;for(const a of t)l.set(a.step,a);return[...l.values()].sort((a,r)=>a.step-r.step)}function Be(t){const l=t.flatMap(a=>a.memoryBytes==null?[]:[a.memoryBytes]);return l.length?oe(Math.max(...l)):null}function g(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(t)}function G(t){return t===0?"0":t.toExponential(2)}function J(t){return`${(t*100).toFixed(1)}%`}function oe(t){return`${(t/1024**3).toFixed(2)} GB`}const ze=new Set(["queued","starting","running","cancelling","reconciling"]);function Oe(t,l,a){const[r,u]=b.useState(null),[s,o]=b.useState(!1),[v,x]=b.useState(null),p=b.useCallback(async()=>{if(!t||!l)return null;o(!0);try{const h=await me.trainingRunDetail(t,l);return u(h),x(null),h}catch(h){return x(h instanceof Error?h.message:String(h)),null}finally{o(!1)}},[t,l]);return b.useEffect(()=>{u(null),x(null),!(!t||!l)&&p()},[t,l,p]),b.useEffect(()=>{if(!t||!l||!a||!ze.has(a))return;const h=window.setInterval(()=>{p()},2e3);return()=>window.clearInterval(h)},[t,l,a,p]),{detail:r,error:v,loading:s,refresh:p}}function Ve({title:t,status:l,statusValue:a,versionStatus:r,method:u,baseModel:s,taskset:o,compute:v,duration:x,output:p,reward:h,telemetry:f,evidence:j,configuration:y,children:A,failure:R,onOpenTaskset:S}){const c=f?.cost.providerReportedUsd??f?.cost.estimatedUsd??j?.cost.totalUsd??null;return e.jsxs("div",{className:"labs-model-run-summary",children:[e.jsx("section",{className:"labs-run-outcome-card",children:e.jsx("header",{children:e.jsxs("div",{children:[e.jsxs("div",{className:"labs-run-title-row",children:[e.jsx("h2",{children:t}),e.jsx(ge,{label:l,value:a})]}),e.jsxs("p",{children:[Ue(u)," on ",s]})]})})}),A,e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Run setup"})}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx($,{label:"Training method",value:u}),e.jsx($,{label:"Base model",value:s}),e.jsx($,{label:"Compute",value:v}),e.jsx($,{label:"Output",value:p}),r?e.jsx($,{label:"Version status",value:r}):null,e.jsx($,{label:"Duration",value:x}),e.jsx($,{label:"Run cost",value:c===null?"Not reported":`$${c.toFixed(4)}`}),e.jsx($,{label:"Final reward",value:h===null?"Not reported":h.toFixed(4)}),y.map(d=>e.jsx($,{label:d.label,value:d.value},d.label)),f||j?e.jsxs(e.Fragment,{children:[e.jsx(V,{label:"GPU",value:De(f,j)}),e.jsx(V,{label:"Tokens",value:`${D(f?.usage.promptTokens??j?.usage.inputTokens??null)} prompt · ${D(f?.usage.generatedTokens??j?.usage.outputTokens??null)} generated`}),e.jsx(V,{label:"Trajectories",value:`${D(f?.usage.successfulTrajectories??j?.reward.eligibleTrajectoryCount??null)} succeeded · ${D(f?.usage.failedTrajectories??(j?j.reward.trajectoryCount-j.reward.eligibleTrajectoryCount:null))} failed`}),e.jsx(V,{label:"Optimizer updates",value:D(f?.usage.optimizerSteps??j?.progress.committedOptimizerSteps??null)}),e.jsx(V,{label:"GPU time",value:f?.usage.gpuSeconds==null?"Not reported":`${f.usage.gpuSeconds.toFixed(1)} seconds`})]}):e.jsx($,{label:"Resource usage",value:"Not retained for this run"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:S?e.jsxs("button",{className:"labs-run-taskset-link",type:"button",onClick:S,children:[e.jsx("span",{children:o}),e.jsx(pe,{"aria-hidden":"true",size:14})]}):o})]})]})]}),R?e.jsx("p",{className:"labs-training-error",children:R}):null]})}function $({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function V({label:t,value:l}){return e.jsx($,{label:t,value:l})}function De(t,l){const a=t?.resource.gpuCount??l?.resource.gpuCount??null,r=t?.resource.gpuType??l?.resource.gpuType??null;return a===null&&r===null?"Not reported":`${a??"Unknown"} × ${r?Ge(r):"Unreported"}`}function D(t){return t===null?"Not reported":t.toLocaleString()}function Ue(t){return t==="RFT"?"Reinforcement fine-tuning":`${t} training`}function Ge(t){return t.split(" · ").map(l=>l.replaceAll("_"," ").replace(/\b[a-z]/g,a=>a.toUpperCase())).join(" · ")}function gt({connection:t,selectedEntryKey:l,workproduct:a,runs:r,training:u,onOpenDataset:s}){const[o,v]=b.useState("artifacts"),x=u.payload,p=b.useMemo(()=>xe(a,r,x),[r,x,a]),h=b.useMemo(()=>be(a,r,x),[r,x,a]),f=b.useMemo(()=>fe(a,x),[x,a]),j=b.useMemo(()=>je(a,r,x),[r,x,a]),y=b.useMemo(()=>new Map(j.map(i=>[i.id,i])),[j]),R=b.useMemo(()=>ve(p,h),[p,h]).find(i=>i.key===l)??null,S=l.startsWith("model-run:")?l.slice(10):null,c=S?f.find(i=>i.id===S)??null:R?.job?f.find(i=>i.id===R.job?.metadata.modelRunId)??null:null,d=R?.job??(c?x?.jobs.find(i=>i.id===c.id||i.metadata.modelRunId===c.id)??null:null),E=b.useMemo(()=>ye(p,h,f),[p,f,h]),F=E.findIndex(i=>i.key===l||d!==null&&i.job?.id===d.id||c!==null&&i.lifecycleRun?.id===c.id),C=F<0?null:E.length-F,N=R?.version??(c?.adapterArtifactLineageId?h.find(i=>i.lineage.id===c.adapterArtifactLineageId)??null:null),n=(c?x?.modelVersions.find(i=>i.id===c.modelVersionId)?.baseModel.modelId:null)??x?.modelVersions.filter(i=>i.modelId===a.id&&i.kind==="base_reference").sort((i,de)=>de.version-i.version)[0]?.baseModel.modelId??null,m=N?.lineage.frozenEvaluationArtifactId??null,I=N?.lineage.managedServing??null,z=N?.plan??(d?y.get(d.planId)??null:null),_=N?.taskset??Ne(x).find(i=>i.id===(c?.taskset.id??z?.tasksetId))??null,w=Oe(t,d?.id??null,d?.status??null),Y=d?x?.rolloutReceipts.filter(i=>i.jobId===d.id)??[]:[],M=w.detail?.managedEvidence??null,W=[{id:"artifacts",label:"Artifacts"},...w.loading||w.detail?.evaluation||m||M?.evaluations.length?[{id:"evaluation",label:"Evaluation"}]:[],...Y.length?[{id:"rollouts",label:"Rollouts"}]:[],...I?[{id:"serving",label:"Serving"}]:[],...d?[{id:"activity",label:"Activity"}]:[]],P=W.some(i=>i.id===o)?o:W[0].id;return!R&&!c?e.jsx("div",{className:"labs-model-version-detail",children:e.jsx("div",{className:"training-run-placeholder",children:"This training attempt is no longer available."})}):e.jsxs("div",{className:"labs-model-version-detail",children:[e.jsx(Ve,{baseModel:_e(z,n),compute:c?K(c.destinationId):z?K(z.destinationId):d?K(d.destinationId):"Not recorded",duration:c?Q(c.startedAt,c.completedAt):d?Q(d.startedAt,d.completedAt):"Not recorded",failure:d?.error??c?.failure??null,configuration:qe(z),evidence:M,method:he(c?.method??z?.recipe.method),output:N?`Version ${N.number}`:"No version created",reward:c?.reward?.raw??M?.reward.finalMean??null,status:c?Z(c.status):d?Z(d.status):"Imported",statusValue:c?.status??d?.status??"imported",taskset:_?.name??"Unavailable",telemetry:c?.receipt?.telemetry??null,title:c||d?C?`Run ${C}`:"Run details":N?`Version ${N.number}`:"Run details",versionStatus:N?N.current?"Active":"Available":null,onOpenTaskset:_?()=>s(_.id):void 0,children:d?e.jsx(Te,{detail:w.detail,error:w.error,loading:w.loading}):null}),e.jsxs("section",{className:"labs-run-detail-tabs",children:[e.jsx("div",{className:"training-detail-tabs",role:"tablist","aria-label":"Run details",children:W.map(i=>e.jsx("button",{"aria-controls":`run-detail-panel-${i.id}`,"aria-selected":P===i.id,className:P===i.id?"active":void 0,id:`run-detail-tab-${i.id}`,role:"tab",type:"button",onClick:()=>v(i.id),children:i.label},i.id))}),e.jsxs("div",{"aria-labelledby":`run-detail-tab-${P}`,className:"labs-run-detail-tab-panel",id:`run-detail-panel-${P}`,role:"tabpanel",children:[P==="artifacts"?e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(k,{label:"Training attempt",value:d?.id??"Provider import"}),e.jsx(k,{label:"Taskset",value:_?.name??"Unavailable"}),e.jsx(k,{label:"Prepared data",value:d?.bundleHash??"Provider managed"}),e.jsx(k,{label:"Version ID",value:N?.lineage.id??"No version created"}),M?.checkpoint?e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"Checkpoint",value:M.checkpoint.id}),e.jsx(k,{label:"Checkpoint size",value:M.checkpoint.sizeBytes==null?"Not reported":ce(M.checkpoint.sizeBytes)}),e.jsx(k,{label:"Checkpoint hash",value:M.checkpoint.sha256??"Not reported"})]}):null,M?.canonicalPublication.state?e.jsx(k,{label:"Registry publication",value:H(M.canonicalPublication.state)}):null]}):null,P==="evaluation"?e.jsxs("div",{className:"training-run-evaluation",children:[w.loading||w.detail?.evaluation?e.jsx(Re,{detail:w.detail,loading:w.loading}):null,!w.detail?.evaluation&&M?.evaluations.length?e.jsx("dl",{className:"labs-inline-facts",children:M.evaluations.map(i=>e.jsx(k,{label:i.kind==="baseline"?"Baseline score":"Candidate score",value:i.score==null?"Not reported":i.score.toFixed(6)},`${i.kind}:${i.policyVersion}`))}):null,m?e.jsx("button",{className:"training-button secondary",type:"button",onClick:()=>{u.actions.downloadArtifact(m)},children:"Download evaluation receipt"}):null]}):null,P==="rollouts"?e.jsx(ke,{receipts:Y}):null,P==="serving"?e.jsx(Je,{projection:I}):null,P==="activity"&&d?e.jsx(We,{error:d.error??w.error,events:w.detail?.events??[],loading:w.loading}):null]})]})]})}function _e(t,l=null){if(!t)return l?re(l):"Not recorded";const a=t.recipe.method==="sft"||t.recipe.method==="grpo"?t.recipe.baseModel:t.recipe.method==="dpo"?t.recipe.policyModel:t.recipe.method==="ppo"?t.recipe.policyOptimization.policyModel:null;return a?re(a.id):"Not recorded"}function re(t){return t.split("/").at(-1)??t}function qe(t){if(!t)return[];const l=t.recipe;return l.method==="grpo"?[{label:"LoRA rank",value:String(l.lora.rank)},{label:"Learning rate",value:se(l.optimizer.learningRate)},{label:"Optimizer steps",value:String(l.optimizer.maxSteps)},{label:"Rollouts per update",value:String(l.rollout.groupSize)},{label:"Rollout concurrency",value:String(l.rollout.concurrency)},{label:"Max output tokens",value:l.rollout.maxOutputTokens.toLocaleString()},{label:"Temperature",value:String(l.rollout.temperature)},{label:"Top P",value:String(l.rollout.topP)}]:l.method==="sft"||l.method==="dpo"?[{label:"LoRA rank",value:String(l.lora.rank)},{label:"Learning rate",value:se(l.optimizer.learningRate)},{label:"Optimizer steps",value:String(l.optimizer.maxSteps)}]:[]}function se(t){return t===0?"0":t.toExponential(2)}function ce(t){const l=["B","KB","MB","GB","TB"];let a=t,r=0;for(;a>=1024&&r<l.length-1;)a/=1024,r+=1;return`${a.toFixed(r===0?0:2)} ${l[r]}`}function k({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function Je({projection:t}){return t?e.jsxs("dl",{className:"labs-inline-facts",children:[e.jsx(k,{label:"Admission",value:t.customerBindingAllowed?"Allowed":"Pending"}),e.jsx(k,{label:"Artifact",value:H(t.canonicalArtifactState)}),e.jsx(k,{label:"Deployment",value:H(t.canonicalDeploymentState)}),e.jsx(k,{label:"Base profile",value:t.baseProfileId??"Pending"}),e.jsx(k,{label:"Last synchronized",value:ie(t.lastSyncedAt)}),t.lastError?e.jsx(k,{label:"Synchronization",value:t.lastError}):null]}):null}function H(t){return t?t.replaceAll("_"," ").replace(/^./,l=>l.toUpperCase()):"Pending"}function We({error:t,events:l,loading:a}){return a&&!l.length?e.jsx("div",{className:"training-run-placeholder",children:"Loading run events…"}):l.length?e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Time"}),e.jsx("th",{children:"Event"}),e.jsx("th",{children:"Details"})]})}),e.jsxs("tbody",{children:[l.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:ie(r.timestamp)}),e.jsx("td",{children:Ke(r.type)}),e.jsx("td",{children:He(r)})]},r.id)),t?e.jsxs("tr",{children:[e.jsx("td",{children:"Not available"}),e.jsx("td",{children:"Failure"}),e.jsx("td",{children:t})]}):null]})]})}):e.jsx("div",{className:"training-run-placeholder",children:t??"No normalized run events were recorded."})}function Ke(t){return t.replaceAll("_"," ").replace(/^./,l=>l.toUpperCase())}function He(t){const l=t.payload,a=O(l.step),r=O(l.maxSteps);if(t.type==="start")return typeof l.device=="string"?`Worker started on ${l.device}.`:"Worker started.";if(t.type==="progress"&&a!=null)return r==null?`Step ${a}.`:`Step ${a} of ${r}.`;if(t.type==="metric"){const u=typeof l.metricKind=="string"?l.metricKind.replaceAll("_"," "):"metric",s=[U("loss",l.loss),U("reward",l.meanReward??l.reward),U("policy loss",l.policyLoss),U("value loss",l.valueLoss),U("preference accuracy",l.preferenceAccuracy,Ye)].filter(o=>!!o);return`${u}${a==null?"":` · step ${a}`}${s.length?` · ${s.join(" · ")}`:""}`}if(t.type==="checkpoint"){const u=O(l.policyVersion),s=O(l.sizeBytes),o=[u==null?null:`policy ${u}`,s==null?null:ce(s),l.final===!0?"final":null].filter(v=>!!v);return o.length?`Checkpoint committed · ${o.join(" · ")}.`:"Checkpoint committed."}if(t.type==="complete"){const u=O(l.artifactCount);return u==null?"Worker completed.":`Worker completed with ${u} artifacts.`}return t.type==="failure"&&typeof l.message=="string"?l.message:Object.keys(l).length?JSON.stringify(l):"Recorded."}function U(t,l,a=r=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(r)){const r=O(l);return r==null?null:`${t} ${a(r)}`}function O(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Ye(t){return`${(t*100).toFixed(1)}%`}export{gt as LabModelVersionDetailPage};
1
+ import{r as b,j as e,au as ue,n as me,a as pe}from"./index-Ure41UF0.js";import{s as Z,e as he,b as Q,d as K,f as ie}from"./training-model-data-B7-1Bxil.js";import{L as ge,l as xe,a as be,b as fe,c as je,m as ve,d as ye,e as Ne}from"./LabsRoute-CYk2dzQp.js";import"./cloud-upload-Cc_ZQEAm.js";import"./MainPane-Bke4JEHC.js";import"./square-pen-LHr8bFfZ.js";import"./arrow-up-right-Cx2xjktp.js";import"./MarkdownText-DTBS9xe7.js";import"./square-B00f_944.js";import"./folder-open-D7a4t258.js";import"./AppDialog-BTOxCNC5.js";import"./ComposerCreateImproveStrip-CW2QuI7r.js";import"./circle-alert-BUHAQ7Du.js";import"./play-CjWTsI9z.js";import"./refresh-cw-CeHT_tXT.js";/* empty css */import"./UsageSettingsSection-NbX7_3Uz.js";import"./index-De6p2npi.js";function ke({receipts:t}){const[l,a]=b.useState(!1);if(!t.length)return e.jsx("div",{className:"training-run-placeholder",children:"No on-policy rollout receipts were recorded for this run."});const r=[...t].sort((s,o)=>o.updatedAt.localeCompare(s.updatedAt)),u=l?r:r.slice(0,24);return e.jsxs("div",{className:"training-rollout-receipts",children:[t.length>24?e.jsxs("div",{className:"training-rollout-receipt-controls",children:[e.jsx("span",{children:l?`Showing all ${t.length} receipts`:`Showing latest ${u.length} of ${t.length} receipts`}),e.jsx("button",{className:"training-text-button",type:"button",onClick:()=>a(s=>!s),children:l?"Show latest 24":`Show all ${t.length}`})]}):null,u.map(s=>e.jsxs("details",{children:[e.jsxs("summary",{children:[e.jsx("span",{children:we(s.providerTrace.rolloutId)}),e.jsx("strong",{children:s.status}),e.jsx("em",{children:s.reward.eligible&&s.reward.raw!=null?s.reward.raw.toFixed(3):s.failureClass??"not reward eligible"})]}),e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(L,{label:"Correlation",value:s.correlationId}),e.jsx(L,{label:"Task",value:s.taskId}),e.jsx(L,{label:"Policy",value:s.policy.modelId}),e.jsx(L,{label:"Checkpoint",value:s.policy.checkpointId??"Provider initial policy"}),e.jsx(L,{label:"Environment",value:`${s.environment.id}@${s.environment.version}`}),e.jsx(L,{label:"World",value:`${s.environment.worldId} · ${s.environment.worldHash}`}),e.jsx(L,{label:"Raw reward",value:s.reward.raw==null?"Not eligible":String(s.reward.raw)}),e.jsx(L,{label:"Components",value:JSON.stringify(s.reward.components)}),e.jsx(L,{label:"Outcome",value:s.verifier?.outcome??s.failureClass??"Pending"}),e.jsx(L,{label:"Trace",value:`${s.providerTrace.experimentId}/${s.providerTrace.rolloutId}`})]})]},s.id))]})}function L({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function we(t){return t.replace(/^lineage_/,"").slice(0,18)}function Re({detail:t,loading:l}){if(l&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Loading evaluation results…"});const a=t?.evaluation;return a?e.jsxs("div",{className:"training-run-evaluation",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(q,{label:"Base score",value:X(a.base.meanScore)}),e.jsx(q,{label:"Trained score",value:X(a.trained.meanScore)}),e.jsx(q,{label:"Score change",value:Se(a.meanScoreDelta)}),e.jsx(q,{label:"Trained pass rate",value:$e(a.trained.passRate)})]}),a.base.count===0?e.jsx("p",{className:"training-muted",children:"Base-model scoring was not imported for this earlier run. New runs retain both base and trained evaluations."}):null,a.trained.count>0&&a.trained.scoredCount===0?e.jsx("p",{className:"training-muted",children:"Outputs were captured, but the grader was unavailable, so this run has no evaluation score."}):null,e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table training-evaluation-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Test example"}),e.jsx("th",{children:"Base"}),e.jsx("th",{children:"Trained"}),e.jsx("th",{children:"Result"})]})}),e.jsx("tbody",{children:a.examples.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("details",{children:[e.jsx("summary",{children:r.taskId}),e.jsx(Me,{input:r.input,baseOutput:r.baseOutput,trainedOutput:r.trainedOutput,baseGrade:r.baseGrade,trainedGrade:r.trainedGrade})]})}),e.jsx("td",{children:ee(r.baseGrade)}),e.jsx("td",{children:ee(r.trainedGrade)}),e.jsx("td",{children:Le(r.baseGrade,r.trainedGrade)})]},r.taskId))})]})})]}):e.jsx("div",{className:"training-run-placeholder",children:"No scored evaluation results are available for this run."})}function Me({input:t,baseOutput:l,trainedOutput:a,baseGrade:r,trainedGrade:u}){const s=[...new Set([...r?.feedback??[],...u?.feedback??[]])];return e.jsxs("div",{className:"training-evaluation-output",children:[e.jsxs("div",{children:[e.jsx("span",{children:"Input"}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]}),l?e.jsxs("div",{children:[e.jsx("span",{children:"Base output"}),e.jsx("pre",{children:JSON.stringify(l,null,2)})]}):null,a?e.jsxs("div",{children:[e.jsx("span",{children:"Trained output"}),e.jsx("pre",{children:JSON.stringify(a,null,2)})]}):null,s.length?e.jsxs("div",{children:[e.jsx("span",{children:"Grader feedback"}),e.jsx("p",{children:s.join(" ")})]}):null]})}function q({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("span",{children:t}),e.jsx("strong",{children:l})]})}function X(t){return t==null?"Not recorded":t.toFixed(3)}function $e(t){return t==null?"Not recorded":`${Math.round(t*100)}%`}function Se(t){return t==null?"Not comparable":`${t>=0?"+":""}${t.toFixed(3)}`}function ee(t){return t?.status==="unavailable"?"Unavailable":t?.score==null?"Not scored":t.score.toFixed(3)}function Le(t,l){if(!l)return"Not evaluated";if(l.status==="unavailable")return"Unavailable";if(!t||t.score==null||l.score==null)return l.passed?"Passed":"Failed";const a=l.score-t.score;return Math.abs(a)<5e-4?"No change":a>0?`Improved ${a.toFixed(3)}`:`Regressed ${Math.abs(a).toFixed(3)}`}const te=[{key:"loss",label:"Loss",format:g},{key:"reward",label:"Reward",format:g},{key:"policyLoss",label:"Policy loss",format:g},{key:"advantageLoss",label:"Advantage loss",format:g},{key:"learningRate",label:"Learning rate",format:G},{key:"gradientNorm",label:"Gradient norm",format:g},{key:"meanTokenAccuracy",label:"Token accuracy",format:J},{key:"preferenceAccuracy",label:"Preference accuracy",format:J},{key:"preferenceMargin",label:"Preference margin",format:g},{key:"chosenReward",label:"Chosen reward",format:g},{key:"rejectedReward",label:"Rejected reward",format:g},{key:"chosenLogProbability",label:"Chosen log probability",format:g},{key:"rejectedLogProbability",label:"Rejected log probability",format:g},{key:"entropy",label:"Entropy",format:g},{key:"memoryBytes",label:"Memory",format:oe}],le=[{key:"meanReward",label:"Reward",format:g},{key:"meanReturn",label:"Return",format:g},{key:"learningRate",label:"Learning rate",format:G},{key:"policyLoss",label:"Policy loss",format:g},{key:"valueLoss",label:"Value loss",format:g},{key:"kl",label:"KL",format:g},{key:"entropy",label:"Entropy",format:g},{key:"policyClipFraction",label:"Policy clip fraction",format:J},{key:"valueClipFraction",label:"Value clip fraction",format:J},{key:"explainedVariance",label:"Explained variance",format:g}];function Te({detail:t,loading:l,error:a}){ue(a,{prefix:"Training metrics"});const r=b.useMemo(()=>Ie(t?.stepMetrics??[]),[t?.stepMetrics]),u=b.useMemo(()=>te.filter(n=>r.some(m=>m[n.key]!=null)),[r]),[s,o]=b.useState("loss"),v=u.find(n=>n.key===s)??u[0]??te[0],x=r.flatMap(n=>n[v.key]==null?[]:[{step:n.step,value:n[v.key]}]),p=b.useMemo(()=>Ee(t?.policyMetrics??[]),[t?.policyMetrics]),h=b.useMemo(()=>le.filter(n=>p.some(m=>m[n.key]!=null)),[p]),[f,j]=b.useState("meanReward"),y=h.find(n=>n.key===f)??h[0]??le[0],A=p.flatMap(n=>n[y.key]==null?[]:[{step:n.step,value:n[y.key]}]),R=p.flatMap(n=>n.meanReward==null?[]:[{step:n.step,value:n.meanReward}]),S=p.flatMap(n=>n.learningRate==null?[]:[{step:n.step,value:n.learningRate}]),c=b.useMemo(()=>Pe(t?.events??[]),[t?.events]),d=t?Ae(t):{};if(l&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Loading training metrics…"});if(a&&!t)return e.jsx("div",{className:"training-run-placeholder",children:"Training metrics are unavailable."});if(!t)return e.jsx("div",{className:"training-run-placeholder",children:"Select a training run to inspect its metrics."});if(p.length){if(p.some(m=>m.method==="grpo")||t.job.metadata.trainingMethod==="grpo")return e.jsx(ae,{learningRatePoints:S,rewardPoints:R,rolloutPoints:c});const n=p.at(-1);return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(T,{label:"Optimizer steps",value:n.step}),e.jsx(T,{label:"Latest reward",value:n.meanReward==null?null:g(n.meanReward)}),e.jsx(T,{label:"Policy loss",value:n.policyLoss==null?null:g(n.policyLoss)}),e.jsx(T,{label:"Rollouts",value:c.length||null}),e.jsx(T,{label:"Learning rate",value:n.learningRate==null?null:G(n.learningRate)}),e.jsx(T,{label:"Environment executions",value:n.environmentExecutions})]}),h.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Policy metrics",children:h.map(m=>e.jsx("button",{className:m.key===y.key?"active":"",role:"tab",type:"button","aria-selected":m.key===y.key,onClick:()=>j(m.key),children:m.label},m.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[c.length?e.jsx(B,{axisLabel:"Rollout",format:g,label:"Rollout reward",points:c}):null,e.jsx(B,{format:y.format,label:y.label,points:A})]})]}):null]})}const E=t.job.metadata.trainingMethod==="grpo",F=r.flatMap(n=>n.loss==null?[]:[n.loss]),C=r.flatMap(n=>n.learningRate==null?[]:[{step:n.step,value:n.learningRate}]),N=r.flatMap(n=>n.reward==null?[]:[{step:n.step,value:n.reward}]);if(E){const n=t.job.metadata.optimizerUpdatesObserved,m=typeof n=="number"&&Number.isFinite(n)?Math.max(0,n):null;return e.jsx(ae,{learningRatePoints:m==null?C:C.filter(I=>I.step<=m),rewardPoints:m==null?N:N.filter(I=>I.step<=m),rolloutPoints:c})}return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(T,{label:"Steps",value:d.steps??Fe(r)}),e.jsx(T,{label:"Final loss",value:d.trainLoss==null?F.at(-1)==null?null:g(F.at(-1)):g(d.trainLoss)}),e.jsx(T,{label:"Peak memory",value:Be(t.stepMetrics)}),e.jsx(T,{label:"Adapter parameters",value:d.adapterParameterCount==null?null:d.adapterParameterCount.toLocaleString()})]}),u.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Training metrics",children:u.map(n=>e.jsx("button",{type:"button",role:"tab","aria-selected":n.key===v.key,className:n.key===v.key?"active":"",onClick:()=>o(n.key),children:n.label},n.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[e.jsx(B,{label:v.label,points:x,format:v.format}),v.key!=="learningRate"&&C.length?e.jsx(B,{label:"Learning rate",points:C,format:G}):null]})]}):e.jsx("div",{className:"training-run-placeholder",children:"This earlier run recorded its final result but not per-step Trainer logs."})]})}function ae({rewardPoints:t,rolloutPoints:l,learningRatePoints:a}){return e.jsx("div",{className:"training-run-metrics",children:e.jsxs("div",{className:"training-metric-chart-grid three",children:[e.jsx(B,{format:g,label:"Reward",points:t}),e.jsx(B,{axisLabel:"Rollout",format:g,label:"Rollout reward",points:l}),e.jsx(B,{format:G,label:"Learning rate",points:a})]})})}function B({label:t,points:l,format:a,axisLabel:r="Optimizer step"}){return e.jsxs("section",{className:"training-metric-chart-card",children:[e.jsxs("header",{children:[e.jsx("h4",{children:t}),e.jsxs("span",{children:[l.length," ",l.length===1?"point":"points"]})]}),l.length?e.jsx(Ce,{axisLabel:r,format:a,label:t,points:l}):e.jsx("div",{className:"training-metric-chart-empty",children:"Not recorded"})]})}function Ce({label:t,points:l,format:a,axisLabel:r}){const o={top:20,right:20,bottom:58,left:64},v=l.map(n=>n.value),x=Math.min(...v),p=Math.max(...v),h=p-x||Math.max(Math.abs(p)*.1,1e-9),f=x-h*.08,j=p+h*.08,y=l[0]?.step??0,A=l.at(-1)?.step??y+1,R=Math.max(1,A-y),S=760-o.right,c=n=>l.length===1?(o.left+S)/2:o.left+(n-y)/R*(760-o.left-o.right),d=n=>o.top+(j-n)/(j-f)*(270-o.top-o.bottom),E=l.map((n,m)=>`${m?"L":"M"}${c(n.step).toFixed(2)},${d(n.value).toFixed(2)}`).join(" "),F=270-o.bottom,C=l.length>1?`${E} L${c(A).toFixed(2)},${F} L${c(y).toFixed(2)},${F} Z`:"",N=r!=="Optimizer step"?r:t==="Learning rate"?"Update":"Step";return e.jsx("figure",{className:"training-line-chart","aria-label":`${t} by ${r.toLowerCase()}`,children:e.jsxs("svg",{viewBox:"0 0 760 270",role:"img","aria-labelledby":`metric-${t.replaceAll(" ","-")}`,children:[e.jsx("title",{id:`metric-${t.replaceAll(" ","-")}`,children:`${t} by ${r.toLowerCase()}`}),[0,.25,.5,.75,1].map(n=>{const m=o.top+n*(270-o.top-o.bottom),I=j-n*(j-f);return e.jsxs("g",{children:[e.jsx("line",{className:"training-chart-grid",x1:o.left,x2:760-o.right,y1:m,y2:m}),e.jsx("text",{className:"training-chart-label",x:o.left-10,y:m+4,textAnchor:"end",children:a(I)})]},n)}),e.jsx("line",{className:"training-chart-axis",x1:o.left,x2:760-o.right,y1:270-o.bottom,y2:270-o.bottom}),e.jsx("path",{className:"training-chart-area",d:C}),e.jsx("path",{className:"training-chart-line",d:E}),l.map(n=>e.jsx("circle",{className:"training-chart-point",cx:c(n.step),cy:d(n.value),r:l.length===1?"4.5":"3",children:e.jsx("title",{children:`${N} ${n.step}: ${a(n.value)}`})},`${n.step}-${n.value}`)),e.jsx("text",{className:"training-chart-label",x:c(y),y:236,textAnchor:"middle",children:y}),l.length>1?e.jsx("text",{className:"training-chart-label",x:S,y:236,textAnchor:"middle",children:A}):null,e.jsx("text",{className:"training-chart-label axis-title",x:(o.left+760-o.right)/2,y:261,textAnchor:"middle",children:r})]})})}function Pe(t){return t.flatMap(l=>{if(l.type!=="metric"||l.payload.metricKind!=="rollout_trajectory")return[];const a=ne(l.payload.rolloutIndex),r=ne(l.payload.reward);return a==null||r==null?[]:[{step:a,value:r}]})}function ne(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function T({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("span",{children:t}),e.jsx("strong",{children:l??"Not recorded"})]})}function Ae(t){const l=[...t.events].reverse().find(a=>a.type==="metric"&&a.payload.metricKind!=="sft_step"&&(typeof a.payload.trainLoss=="number"||typeof a.payload.steps=="number"));return Object.fromEntries(Object.entries(l?.payload??{}).filter(a=>typeof a[1]=="number"))}function Fe(t){const l=t.at(-1);return l?`${l.step} of ${l.maxSteps}`:null}function Ie(t){const l=new Map;for(const a of t)l.set(a.step,a);return[...l.values()].sort((a,r)=>a.step-r.step)}function Ee(t){const l=new Map;for(const a of t)l.set(a.step,a);return[...l.values()].sort((a,r)=>a.step-r.step)}function Be(t){const l=t.flatMap(a=>a.memoryBytes==null?[]:[a.memoryBytes]);return l.length?oe(Math.max(...l)):null}function g(t){return new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(t)}function G(t){return t===0?"0":t.toExponential(2)}function J(t){return`${(t*100).toFixed(1)}%`}function oe(t){return`${(t/1024**3).toFixed(2)} GB`}const ze=new Set(["queued","starting","running","cancelling","reconciling"]);function Oe(t,l,a){const[r,u]=b.useState(null),[s,o]=b.useState(!1),[v,x]=b.useState(null),p=b.useCallback(async()=>{if(!t||!l)return null;o(!0);try{const h=await me.trainingRunDetail(t,l);return u(h),x(null),h}catch(h){return x(h instanceof Error?h.message:String(h)),null}finally{o(!1)}},[t,l]);return b.useEffect(()=>{u(null),x(null),!(!t||!l)&&p()},[t,l,p]),b.useEffect(()=>{if(!t||!l||!a||!ze.has(a))return;const h=window.setInterval(()=>{p()},2e3);return()=>window.clearInterval(h)},[t,l,a,p]),{detail:r,error:v,loading:s,refresh:p}}function Ve({title:t,status:l,statusValue:a,versionStatus:r,method:u,baseModel:s,taskset:o,compute:v,duration:x,output:p,reward:h,telemetry:f,evidence:j,configuration:y,children:A,failure:R,onOpenTaskset:S}){const c=f?.cost.providerReportedUsd??f?.cost.estimatedUsd??j?.cost.totalUsd??null;return e.jsxs("div",{className:"labs-model-run-summary",children:[e.jsx("section",{className:"labs-run-outcome-card",children:e.jsx("header",{children:e.jsxs("div",{children:[e.jsxs("div",{className:"labs-run-title-row",children:[e.jsx("h2",{children:t}),e.jsx(ge,{label:l,value:a})]}),e.jsxs("p",{children:[Ue(u)," on ",s]})]})})}),A,e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Run setup"})}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx($,{label:"Training method",value:u}),e.jsx($,{label:"Base model",value:s}),e.jsx($,{label:"Compute",value:v}),e.jsx($,{label:"Output",value:p}),r?e.jsx($,{label:"Version status",value:r}):null,e.jsx($,{label:"Duration",value:x}),e.jsx($,{label:"Run cost",value:c===null?"Not reported":`$${c.toFixed(4)}`}),e.jsx($,{label:"Final reward",value:h===null?"Not reported":h.toFixed(4)}),y.map(d=>e.jsx($,{label:d.label,value:d.value},d.label)),f||j?e.jsxs(e.Fragment,{children:[e.jsx(V,{label:"GPU",value:De(f,j)}),e.jsx(V,{label:"Tokens",value:`${D(f?.usage.promptTokens??j?.usage.inputTokens??null)} prompt · ${D(f?.usage.generatedTokens??j?.usage.outputTokens??null)} generated`}),e.jsx(V,{label:"Trajectories",value:`${D(f?.usage.successfulTrajectories??j?.reward.eligibleTrajectoryCount??null)} succeeded · ${D(f?.usage.failedTrajectories??(j?j.reward.trajectoryCount-j.reward.eligibleTrajectoryCount:null))} failed`}),e.jsx(V,{label:"Optimizer updates",value:D(f?.usage.optimizerSteps??j?.progress.committedOptimizerSteps??null)}),e.jsx(V,{label:"GPU time",value:f?.usage.gpuSeconds==null?"Not reported":`${f.usage.gpuSeconds.toFixed(1)} seconds`})]}):e.jsx($,{label:"Resource usage",value:"Not retained for this run"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:S?e.jsxs("button",{className:"labs-run-taskset-link",type:"button",onClick:S,children:[e.jsx("span",{children:o}),e.jsx(pe,{"aria-hidden":"true",size:14})]}):o})]})]})]}),R?e.jsx("p",{className:"labs-training-error",children:R}):null]})}function $({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function V({label:t,value:l}){return e.jsx($,{label:t,value:l})}function De(t,l){const a=t?.resource.gpuCount??l?.resource.gpuCount??null,r=t?.resource.gpuType??l?.resource.gpuType??null;return a===null&&r===null?"Not reported":`${a??"Unknown"} × ${r?Ge(r):"Unreported"}`}function D(t){return t===null?"Not reported":t.toLocaleString()}function Ue(t){return t==="RFT"?"Reinforcement fine-tuning":`${t} training`}function Ge(t){return t.split(" · ").map(l=>l.replaceAll("_"," ").replace(/\b[a-z]/g,a=>a.toUpperCase())).join(" · ")}function gt({connection:t,selectedEntryKey:l,workproduct:a,runs:r,training:u,onOpenDataset:s}){const[o,v]=b.useState("artifacts"),x=u.payload,p=b.useMemo(()=>xe(a,r,x),[r,x,a]),h=b.useMemo(()=>be(a,r,x),[r,x,a]),f=b.useMemo(()=>fe(a,x),[x,a]),j=b.useMemo(()=>je(a,r,x),[r,x,a]),y=b.useMemo(()=>new Map(j.map(i=>[i.id,i])),[j]),R=b.useMemo(()=>ve(p,h),[p,h]).find(i=>i.key===l)??null,S=l.startsWith("model-run:")?l.slice(10):null,c=S?f.find(i=>i.id===S)??null:R?.job?f.find(i=>i.id===R.job?.metadata.modelRunId)??null:null,d=R?.job??(c?x?.jobs.find(i=>i.id===c.id||i.metadata.modelRunId===c.id)??null:null),E=b.useMemo(()=>ye(p,h,f),[p,f,h]),F=E.findIndex(i=>i.key===l||d!==null&&i.job?.id===d.id||c!==null&&i.lifecycleRun?.id===c.id),C=F<0?null:E.length-F,N=R?.version??(c?.adapterArtifactLineageId?h.find(i=>i.lineage.id===c.adapterArtifactLineageId)??null:null),n=(c?x?.modelVersions.find(i=>i.id===c.modelVersionId)?.baseModel.modelId:null)??x?.modelVersions.filter(i=>i.modelId===a.id&&i.kind==="base_reference").sort((i,de)=>de.version-i.version)[0]?.baseModel.modelId??null,m=N?.lineage.frozenEvaluationArtifactId??null,I=N?.lineage.managedServing??null,z=N?.plan??(d?y.get(d.planId)??null:null),_=N?.taskset??Ne(x).find(i=>i.id===(c?.taskset.id??z?.tasksetId))??null,w=Oe(t,d?.id??null,d?.status??null),Y=d?x?.rolloutReceipts.filter(i=>i.jobId===d.id)??[]:[],M=w.detail?.managedEvidence??null,W=[{id:"artifacts",label:"Artifacts"},...w.loading||w.detail?.evaluation||m||M?.evaluations.length?[{id:"evaluation",label:"Evaluation"}]:[],...Y.length?[{id:"rollouts",label:"Rollouts"}]:[],...I?[{id:"serving",label:"Serving"}]:[],...d?[{id:"activity",label:"Activity"}]:[]],P=W.some(i=>i.id===o)?o:W[0].id;return!R&&!c?e.jsx("div",{className:"labs-model-version-detail",children:e.jsx("div",{className:"training-run-placeholder",children:"This training attempt is no longer available."})}):e.jsxs("div",{className:"labs-model-version-detail",children:[e.jsx(Ve,{baseModel:_e(z,n),compute:c?K(c.destinationId):z?K(z.destinationId):d?K(d.destinationId):"Not recorded",duration:c?Q(c.startedAt,c.completedAt):d?Q(d.startedAt,d.completedAt):"Not recorded",failure:d?.error??c?.failure??null,configuration:qe(z),evidence:M,method:he(c?.method??z?.recipe.method),output:N?`Version ${N.number}`:"No version created",reward:c?.reward?.raw??M?.reward.finalMean??null,status:c?Z(c.status):d?Z(d.status):"Imported",statusValue:c?.status??d?.status??"imported",taskset:_?.name??"Unavailable",telemetry:c?.receipt?.telemetry??null,title:c||d?C?`Run ${C}`:"Run details":N?`Version ${N.number}`:"Run details",versionStatus:N?N.current?"Active":"Available":null,onOpenTaskset:_?()=>s(_.id):void 0,children:d?e.jsx(Te,{detail:w.detail,error:w.error,loading:w.loading}):null}),e.jsxs("section",{className:"labs-run-detail-tabs",children:[e.jsx("div",{className:"training-detail-tabs",role:"tablist","aria-label":"Run details",children:W.map(i=>e.jsx("button",{"aria-controls":`run-detail-panel-${i.id}`,"aria-selected":P===i.id,className:P===i.id?"active":void 0,id:`run-detail-tab-${i.id}`,role:"tab",type:"button",onClick:()=>v(i.id),children:i.label},i.id))}),e.jsxs("div",{"aria-labelledby":`run-detail-tab-${P}`,className:"labs-run-detail-tab-panel",id:`run-detail-panel-${P}`,role:"tabpanel",children:[P==="artifacts"?e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(k,{label:"Training attempt",value:d?.id??"Provider import"}),e.jsx(k,{label:"Taskset",value:_?.name??"Unavailable"}),e.jsx(k,{label:"Prepared data",value:d?.bundleHash??"Provider managed"}),e.jsx(k,{label:"Version ID",value:N?.lineage.id??"No version created"}),M?.checkpoint?e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"Checkpoint",value:M.checkpoint.id}),e.jsx(k,{label:"Checkpoint size",value:M.checkpoint.sizeBytes==null?"Not reported":ce(M.checkpoint.sizeBytes)}),e.jsx(k,{label:"Checkpoint hash",value:M.checkpoint.sha256??"Not reported"})]}):null,M?.canonicalPublication.state?e.jsx(k,{label:"Registry publication",value:H(M.canonicalPublication.state)}):null]}):null,P==="evaluation"?e.jsxs("div",{className:"training-run-evaluation",children:[w.loading||w.detail?.evaluation?e.jsx(Re,{detail:w.detail,loading:w.loading}):null,!w.detail?.evaluation&&M?.evaluations.length?e.jsx("dl",{className:"labs-inline-facts",children:M.evaluations.map(i=>e.jsx(k,{label:i.kind==="baseline"?"Baseline score":"Candidate score",value:i.score==null?"Not reported":i.score.toFixed(6)},`${i.kind}:${i.policyVersion}`))}):null,m?e.jsx("button",{className:"training-button secondary",type:"button",onClick:()=>{u.actions.downloadArtifact(m)},children:"Download evaluation receipt"}):null]}):null,P==="rollouts"?e.jsx(ke,{receipts:Y}):null,P==="serving"?e.jsx(Je,{projection:I}):null,P==="activity"&&d?e.jsx(We,{error:d.error??w.error,events:w.detail?.events??[],loading:w.loading}):null]})]})]})}function _e(t,l=null){if(!t)return l?re(l):"Not recorded";const a=t.recipe.method==="sft"||t.recipe.method==="grpo"?t.recipe.baseModel:t.recipe.method==="dpo"?t.recipe.policyModel:t.recipe.method==="ppo"?t.recipe.policyOptimization.policyModel:null;return a?re(a.id):"Not recorded"}function re(t){return t.split("/").at(-1)??t}function qe(t){if(!t)return[];const l=t.recipe;return l.method==="grpo"?[{label:"LoRA rank",value:String(l.lora.rank)},{label:"Learning rate",value:se(l.optimizer.learningRate)},{label:"Optimizer steps",value:String(l.optimizer.maxSteps)},{label:"Rollouts per update",value:String(l.rollout.groupSize)},{label:"Rollout concurrency",value:String(l.rollout.concurrency)},{label:"Max output tokens",value:l.rollout.maxOutputTokens.toLocaleString()},{label:"Temperature",value:String(l.rollout.temperature)},{label:"Top P",value:String(l.rollout.topP)}]:l.method==="sft"||l.method==="dpo"?[{label:"LoRA rank",value:String(l.lora.rank)},{label:"Learning rate",value:se(l.optimizer.learningRate)},{label:"Optimizer steps",value:String(l.optimizer.maxSteps)}]:[]}function se(t){return t===0?"0":t.toExponential(2)}function ce(t){const l=["B","KB","MB","GB","TB"];let a=t,r=0;for(;a>=1024&&r<l.length-1;)a/=1024,r+=1;return`${a.toFixed(r===0?0:2)} ${l[r]}`}function k({label:t,value:l}){return e.jsxs("div",{children:[e.jsx("dt",{children:t}),e.jsx("dd",{children:l})]})}function Je({projection:t}){return t?e.jsxs("dl",{className:"labs-inline-facts",children:[e.jsx(k,{label:"Admission",value:t.customerBindingAllowed?"Allowed":"Pending"}),e.jsx(k,{label:"Artifact",value:H(t.canonicalArtifactState)}),e.jsx(k,{label:"Deployment",value:H(t.canonicalDeploymentState)}),e.jsx(k,{label:"Base profile",value:t.baseProfileId??"Pending"}),e.jsx(k,{label:"Last synchronized",value:ie(t.lastSyncedAt)}),t.lastError?e.jsx(k,{label:"Synchronization",value:t.lastError}):null]}):null}function H(t){return t?t.replaceAll("_"," ").replace(/^./,l=>l.toUpperCase()):"Pending"}function We({error:t,events:l,loading:a}){return a&&!l.length?e.jsx("div",{className:"training-run-placeholder",children:"Loading run events…"}):l.length?e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Time"}),e.jsx("th",{children:"Event"}),e.jsx("th",{children:"Details"})]})}),e.jsxs("tbody",{children:[l.map(r=>e.jsxs("tr",{children:[e.jsx("td",{children:ie(r.timestamp)}),e.jsx("td",{children:Ke(r.type)}),e.jsx("td",{children:He(r)})]},r.id)),t?e.jsxs("tr",{children:[e.jsx("td",{children:"Not available"}),e.jsx("td",{children:"Failure"}),e.jsx("td",{children:t})]}):null]})]})}):e.jsx("div",{className:"training-run-placeholder",children:t??"No normalized run events were recorded."})}function Ke(t){return t.replaceAll("_"," ").replace(/^./,l=>l.toUpperCase())}function He(t){const l=t.payload,a=O(l.step),r=O(l.maxSteps);if(t.type==="start")return typeof l.device=="string"?`Worker started on ${l.device}.`:"Worker started.";if(t.type==="progress"&&a!=null)return r==null?`Step ${a}.`:`Step ${a} of ${r}.`;if(t.type==="metric"){const u=typeof l.metricKind=="string"?l.metricKind.replaceAll("_"," "):"metric",s=[U("loss",l.loss),U("reward",l.meanReward??l.reward),U("policy loss",l.policyLoss),U("value loss",l.valueLoss),U("preference accuracy",l.preferenceAccuracy,Ye)].filter(o=>!!o);return`${u}${a==null?"":` · step ${a}`}${s.length?` · ${s.join(" · ")}`:""}`}if(t.type==="checkpoint"){const u=O(l.policyVersion),s=O(l.sizeBytes),o=[u==null?null:`policy ${u}`,s==null?null:ce(s),l.final===!0?"final":null].filter(v=>!!v);return o.length?`Checkpoint committed · ${o.join(" · ")}.`:"Checkpoint committed."}if(t.type==="complete"){const u=O(l.artifactCount);return u==null?"Worker completed.":`Worker completed with ${u} artifacts.`}return t.type==="failure"&&typeof l.message=="string"?l.message:Object.keys(l).length?JSON.stringify(l):"Recorded."}function U(t,l,a=r=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(r)){const r=O(l);return r==null?null:`${t} ${a(r)}`}function O(t){return typeof t=="number"&&Number.isFinite(t)?t:null}function Ye(t){return`${(t*100).toFixed(1)}%`}export{gt as LabModelVersionDetailPage};
@@ -1 +1 @@
1
- import{r as n,n as g,j as e,$ as z,X as y,aN as w,F}from"./index-B8xSSlBW.js";import{M as L,F as $}from"./MarkdownText-CinDMr2e.js";import{I as k}from"./MainPane-Lv073mMC.js";import"./cloud-upload-jtADHeTW.js";import"./square-pen-CWS_8PrJ.js";import"./arrow-up-right-BKN-maHj.js";import"./square-BUG8bwGr.js";import"./folder-open-DyyC6ByN.js";function H({connection:a,expanded:l,selection:s,onClose:j,onResizeStart:h,onToggleExpanded:v}){const c=`${s.scope}:${s.name}`,[o,N]=n.useState({selectionKey:c,path:s.files[0]??"SKILL.md"}),r=o.selectionKey===c&&s.files.includes(o.path)?o.path:s.files[0]??"SKILL.md",[d,u]=n.useState(null),[m,p]=n.useState(null),[S,x]=n.useState(!1);n.useEffect(()=>{if(!a){u(null),p("Connect to the local OpenPond server to load this skill source.");return}let i=!1;return x(!0),p(null),u(null),g.skillSourceFile(a,s.scope,s.name,r).then(t=>{i||u(t)}).catch(t=>{i||p(t instanceof Error?t.message:String(t))}).finally(()=>{i||x(!1)}),()=>{i=!0}},[a,r,s.name,s.scope]);const f=r.split("/").at(-1)??r;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar lab-skill-sidebar ${l?"expanded":""}`,"aria-label":`Skill package source: ${s.name}`,children:[l?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize skill source",onPointerDown:h}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Selected skill file",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(b,{path:r}),e.jsx("span",{children:f})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:l?"Dock sidebar":"Expand sidebar","aria-label":l?"Dock sidebar":"Expand sidebar",onClick:v,children:l?e.jsx(L,{size:14}):e.jsx(z,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:j,children:e.jsx(y,{size:14})})]})]}),e.jsxs("div",{className:"lab-skill-source-layout",children:[e.jsxs("nav",{className:"lab-skill-file-list","aria-label":`${s.name} package files`,children:[e.jsx("div",{className:"lab-skill-file-list-heading",children:"Package files"}),s.files.map(i=>e.jsxs("button",{"aria-current":i===r?"page":void 0,className:i===r?"active":void 0,type:"button",title:i,onClick:()=>N({selectionKey:c,path:i}),children:[e.jsx(b,{path:i}),e.jsx("span",{children:i})]},i))]}),e.jsxs("div",{className:"native-skill-sidebar-body lab-skill-source-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsxs("div",{className:"lab-skill-source-title-row",children:[e.jsx("h2",{children:s.name}),e.jsx("span",{children:C(s.scope)})]}),e.jsx("p",{children:s.description}),e.jsx("code",{children:s.packagePath})]}),S?e.jsxs("div",{className:"lab-skill-source-state",children:[e.jsx(w,{className:"spin",size:16})," Loading source…"]}):m?e.jsx("div",{className:"lab-skill-source-state error",children:m}):d?.isBinary?e.jsxs("div",{className:"lab-skill-source-state",children:[e.jsx(k,{size:18}),"Binary asset · ",B(d.byteSize)]}):e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${f} source`,children:e.jsx("code",{children:d?.content??""})})]})]})]})}function C(a){return a==="codex"?"Codex skill":a==="extension"?"GitHub extension":"OpenPond skill"}function b({path:a}){const l=a.split(".").at(-1)?.toLowerCase();return["avif","gif","jpeg","jpg","png","webp"].includes(l??"")?e.jsx(k,{size:14}):["md","txt","yaml","yml"].includes(l??"")?e.jsx(F,{size:14}):e.jsx($,{size:14})}function B(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}export{H as LabSkillSidebar};
1
+ import{r as n,n as g,j as e,$ as z,X as y,aN as w,F}from"./index-Ure41UF0.js";import{M as L,F as $}from"./MarkdownText-DTBS9xe7.js";import{I as k}from"./MainPane-Bke4JEHC.js";import"./cloud-upload-Cc_ZQEAm.js";import"./square-pen-LHr8bFfZ.js";import"./arrow-up-right-Cx2xjktp.js";import"./square-B00f_944.js";import"./folder-open-D7a4t258.js";function H({connection:a,expanded:l,selection:s,onClose:j,onResizeStart:h,onToggleExpanded:v}){const c=`${s.scope}:${s.name}`,[o,N]=n.useState({selectionKey:c,path:s.files[0]??"SKILL.md"}),r=o.selectionKey===c&&s.files.includes(o.path)?o.path:s.files[0]??"SKILL.md",[d,u]=n.useState(null),[m,p]=n.useState(null),[S,x]=n.useState(!1);n.useEffect(()=>{if(!a){u(null),p("Connect to the local OpenPond server to load this skill source.");return}let i=!1;return x(!0),p(null),u(null),g.skillSourceFile(a,s.scope,s.name,r).then(t=>{i||u(t)}).catch(t=>{i||p(t instanceof Error?t.message:String(t))}).finally(()=>{i||x(!1)}),()=>{i=!0}},[a,r,s.name,s.scope]);const f=r.split("/").at(-1)??r;return e.jsxs("aside",{className:`workspace-diff-panel native-skill-sidebar lab-skill-sidebar ${l?"expanded":""}`,"aria-label":`Skill package source: ${s.name}`,children:[l?null:e.jsx("div",{className:"workspace-diff-resize-handle",role:"separator","aria-orientation":"vertical","aria-label":"Resize skill source",onPointerDown:h}),e.jsxs("div",{className:"workspace-diff-topbar native-skill-sidebar-topbar",children:[e.jsx("div",{className:"workspace-diff-tabs",role:"tablist","aria-label":"Selected skill file",children:e.jsxs("button",{className:"workspace-diff-tab active",type:"button",role:"tab","aria-selected":!0,children:[e.jsx(b,{path:r}),e.jsx("span",{children:f})]})}),e.jsxs("div",{className:"workspace-diff-toolbar-actions",children:[e.jsx("button",{className:"diff-icon-button",type:"button",title:l?"Dock sidebar":"Expand sidebar","aria-label":l?"Dock sidebar":"Expand sidebar",onClick:v,children:l?e.jsx(L,{size:14}):e.jsx(z,{size:14})}),e.jsx("button",{className:"diff-icon-button",type:"button",title:"Close skill source","aria-label":"Close skill source",onClick:j,children:e.jsx(y,{size:14})})]})]}),e.jsxs("div",{className:"lab-skill-source-layout",children:[e.jsxs("nav",{className:"lab-skill-file-list","aria-label":`${s.name} package files`,children:[e.jsx("div",{className:"lab-skill-file-list-heading",children:"Package files"}),s.files.map(i=>e.jsxs("button",{"aria-current":i===r?"page":void 0,className:i===r?"active":void 0,type:"button",title:i,onClick:()=>N({selectionKey:c,path:i}),children:[e.jsx(b,{path:i}),e.jsx("span",{children:i})]},i))]}),e.jsxs("div",{className:"native-skill-sidebar-body lab-skill-source-body",children:[e.jsxs("header",{className:"native-skill-source-header",children:[e.jsxs("div",{className:"lab-skill-source-title-row",children:[e.jsx("h2",{children:s.name}),e.jsx("span",{children:C(s.scope)})]}),e.jsx("p",{children:s.description}),e.jsx("code",{children:s.packagePath})]}),S?e.jsxs("div",{className:"lab-skill-source-state",children:[e.jsx(w,{className:"spin",size:16})," Loading source…"]}):m?e.jsx("div",{className:"lab-skill-source-state error",children:m}):d?.isBinary?e.jsxs("div",{className:"lab-skill-source-state",children:[e.jsx(k,{size:18}),"Binary asset · ",B(d.byteSize)]}):e.jsx("pre",{className:"native-skill-markdown-source","aria-label":`${f} source`,children:e.jsx("code",{children:d?.content??""})})]})]})]})}function C(a){return a==="codex"?"Codex skill":a==="extension"?"GitHub extension":"OpenPond skill"}function b({path:a}){const l=a.split(".").at(-1)?.toLowerCase();return["avif","gif","jpeg","jpg","png","webp"].includes(l??"")?e.jsx(k,{size:14}):["md","txt","yaml","yml"].includes(l??"")?e.jsx(F,{size:14}):e.jsx($,{size:14})}function B(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}export{H as LabSkillSidebar};