openpond 0.0.63 → 0.0.65

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-TUAFALOE.js → app-layer-NCSTDSNQ.js} +2 -2
  2. package/dist/chunks/{app-server-runtime-O26LVUYH.js → app-server-runtime-6PDQHOBE.js} +6 -6
  3. package/dist/chunks/{apps-KSZRA7Y2.js → apps-HEG7FEEV.js} +2 -2
  4. package/dist/chunks/{chunk-JTFDOA2P.js → chunk-6FZNXLVN.js} +17 -5
  5. package/dist/chunks/{chunk-7UVEB2AZ.js → chunk-B63GTC7F.js} +2 -2
  6. package/dist/chunks/{chunk-IXA5PMXC.js → chunk-BRLUAT6S.js} +1 -1
  7. package/dist/chunks/{chunk-6FKBOGA4.js → chunk-EWP6VGHP.js} +1 -1
  8. package/dist/chunks/{chunk-V2CTXKS2.js → chunk-HJJYGJ36.js} +205 -141
  9. package/dist/chunks/{chunk-KGU437HZ.js → chunk-JMHOO2IG.js} +2 -2
  10. package/dist/chunks/{chunk-66KQLYSH.js → chunk-LNYGV6AM.js} +1 -1
  11. package/dist/chunks/{chunk-7IFPXSSJ.js → chunk-TW4YWBQR.js} +1 -1
  12. package/dist/chunks/{chunk-LEL5AQJU.js → chunk-U345JN44.js} +1 -1
  13. package/dist/chunks/{chunk-YDH34BGG.js → chunk-WT3THPTX.js} +32 -32
  14. package/dist/chunks/{cli-LPFU4ULD.js → cli-CQOUYUQ4.js} +5 -5
  15. package/dist/chunks/{core-commands-OEOBYFIW.js → core-commands-Y4ZMQXO4.js} +3 -3
  16. package/dist/chunks/{desktop-test-BRLZF3O7.js → desktop-test-YRFKONLO.js} +2 -2
  17. package/dist/chunks/{extension-5BUCIDKG.js → extension-4MFKIC6Q.js} +2 -2
  18. package/dist/chunks/{help-MT6VPW4X.js → help-STXVR4NO.js} +1 -1
  19. package/dist/chunks/{opchat-O4DVKNFW.js → opchat-CCVKI5GH.js} +2 -2
  20. package/dist/chunks/{organizations-ACNOJ57Q.js → organizations-AS76SGLP.js} +4 -4
  21. package/dist/chunks/{profile-7LLWXAJE.js → profile-QNWDNZY3.js} +2 -2
  22. package/dist/chunks/{project-agent-RVYQYTU2.js → project-agent-GPZL7KAL.js} +2 -2
  23. package/dist/chunks/{sandbox-command-QST23BX5.js → sandbox-command-LC63MMAA.js} +2 -2
  24. package/dist/chunks/{sandbox-template-N7UG3P6V.js → sandbox-template-FPQLZ4IP.js} +3 -3
  25. package/dist/chunks/{src-CPM5Q7T5.js → src-6NIBZPH2.js} +3 -3
  26. package/dist/chunks/{src-M37V6NVU.js → src-ESTRZ2YU.js} +12 -63
  27. package/dist/chunks/{teams-bot-ITTI47XS.js → teams-bot-YTX7IC2J.js} +2 -2
  28. package/dist/chunks/{workspaces-CYBR37US.js → workspaces-ODK2CTFF.js} +2 -2
  29. package/dist/cli.js +13 -13
  30. package/dist/web/assets/{AppDialog-wIb8mGQ0.js → AppDialog-DacC7BcY.js} +1 -1
  31. package/dist/web/assets/{AppsView-D097dPIV.js → AppsView-mkeAkrvr.js} +1 -1
  32. package/dist/web/assets/{BrowserSidebar-DrD-o_yB.js → BrowserSidebar-1aEC6gsF.js} +1 -1
  33. package/dist/web/assets/{CommandMenu-L5LelA2h.js → CommandMenu-BN6J3ecV.js} +1 -1
  34. package/dist/web/assets/{CommunityView-DUJ8NryS.js → CommunityView-B2v9Q4cw.js} +1 -1
  35. package/dist/web/assets/{ComposerCreateImproveStrip-BP-7DmQG.js → ComposerCreateImproveStrip-BH8Ath1h.js} +1 -1
  36. package/dist/web/assets/{GetStartedView-B7gB6Hii.js → GetStartedView-B-R-KSva.js} +1 -1
  37. package/dist/web/assets/{LabModelVersionDetailPage-CNDz2a6I.js → LabModelVersionDetailPage-Bhfa7T00.js} +1 -1
  38. package/dist/web/assets/{LabSkillSidebar-BImOQcjk.js → LabSkillSidebar-CbYdG0RN.js} +1 -1
  39. package/dist/web/assets/{LabsRoute-BauSK1is.js → LabsRoute-DFV5vV6Z.js} +3 -3
  40. package/dist/web/assets/{MainChatThread-BZvAqQO6.js → MainChatThread-COiXI7ri.js} +2 -2
  41. package/dist/web/assets/MainPane-CQCLhV5C.js +6 -0
  42. package/dist/web/assets/MarkdownText-R3MC5S30.js +9 -0
  43. package/dist/web/assets/{Messages-DijmQL-z.js → Messages-DpZ8mIz8.js} +1 -1
  44. package/dist/web/assets/{NativeSkillSidebar-aCkrdGa0.js → NativeSkillSidebar-BfcMqLHA.js} +1 -1
  45. package/dist/web/assets/{NewProjectDialog-D98WIQzr.js → NewProjectDialog-DqTX1Eeo.js} +1 -1
  46. package/dist/web/assets/{OutputsPage-BA0c6cfy.js → OutputsPage-DfZYswx2.js} +1 -1
  47. package/dist/web/assets/{RightChatPanelStack-DKDEmrEH.js → RightChatPanelStack-DH8QjiDY.js} +1 -1
  48. package/dist/web/assets/{ScheduledWorkPage-DeHi99mv.js → ScheduledWorkPage-DkaVUnwj.js} +1 -1
  49. package/dist/web/assets/SettingsView-BRPrJuP5.css +1 -0
  50. package/dist/web/assets/SettingsView-StVFsSJ6.js +6 -0
  51. package/dist/web/assets/{TeamChatView-D2mCoLZ3.js → TeamChatView-CqZOnQh2.js} +1 -1
  52. package/dist/web/assets/{TerminalOverlay-BHMsVp4L.js → TerminalOverlay-CnFv6FZT.js} +1 -1
  53. package/dist/web/assets/{TrainingCreationPanel-CPnMWgkt.js → TrainingCreationPanel-CWzyzmyT.js} +1 -1
  54. package/dist/web/assets/{TrainingDraftPanel-0scEtzSW.js → TrainingDraftPanel-BVHx0HZ0.js} +1 -1
  55. package/dist/web/assets/{UsageSettingsSection-COoCLLg6.js → UsageSettingsSection-Bdvm66WK.js} +1 -1
  56. package/dist/web/assets/{WorkspaceDiffPanel-BFTwZ_dB.js → WorkspaceDiffPanel-DUCjD1GA.js} +5 -5
  57. package/dist/web/assets/{WorkspaceEnvironmentMenu-DFlkdd9T.js → WorkspaceEnvironmentMenu-DHGrt_ie.js} +1 -1
  58. package/dist/web/assets/{WorkspaceGitDialogs-Dt3LO27Z.js → WorkspaceGitDialogs-hI57yjPL.js} +1 -1
  59. package/dist/web/assets/{WorkspaceMonacoEditor-3g05teoR.js → WorkspaceMonacoEditor-DPv-1uO6.js} +3 -3
  60. package/dist/web/assets/{arrow-up-right-DYGSWA2J.js → arrow-up-right-BDcNd1rt.js} +1 -1
  61. package/dist/web/assets/{chevron-up-4qfvI9iW.js → chevron-up-XTMMnfnf.js} +1 -1
  62. package/dist/web/assets/{cloud-upload-COReKxOy.js → cloud-upload-D6bS8rS2.js} +1 -1
  63. package/dist/web/assets/{cssMode-BbH67BYF.js → cssMode-CvN9o8bP.js} +1 -1
  64. package/dist/web/assets/{folder-open-9OjGqNgP.js → folder-open-8C5l7A93.js} +1 -1
  65. package/dist/web/assets/{folder-plus-DF5E6zr3.js → folder-plus-B9Wqb9yd.js} +1 -1
  66. package/dist/web/assets/{git-branch-eCwyZXMl.js → git-branch-C45ve7zh.js} +1 -1
  67. package/dist/web/assets/{git-commit-horizontal-cPm51DqY.js → git-commit-horizontal-CGoLIyKK.js} +1 -1
  68. package/dist/web/assets/{htmlMode-DD6Oge4x.js → htmlMode-DxLP6j5r.js} +1 -1
  69. package/dist/web/assets/index-BYgrO3wt.js +1 -0
  70. package/dist/web/assets/index-CHqMtVfF.css +1 -0
  71. package/dist/web/assets/{index-BO2W2U23.js → index-LrGasYyx.js} +29 -29
  72. package/dist/web/assets/{info-p1mFpqBI.js → info-DTObFlHw.js} +1 -1
  73. package/dist/web/assets/{jsonMode-C2Xd56A_.js → jsonMode-C3_fOSJu.js} +1 -1
  74. package/dist/web/assets/{lspLanguageFeatures-BjYEk4gJ.js → lspLanguageFeatures-0c-UKStE.js} +1 -1
  75. package/dist/web/assets/{monaco.contribution-quEPEMQZ.js → monaco.contribution-CF1DgPPC.js} +2 -2
  76. package/dist/web/assets/{monaco.contribution-C7WMqwmc.js → monaco.contribution-CFLEc9Ly.js} +2 -2
  77. package/dist/web/assets/{monaco.contribution-Bo-5m7yy.js → monaco.contribution-Cb7KlQ6G.js} +2 -2
  78. package/dist/web/assets/{monaco.contribution-DzWlEgU1.js → monaco.contribution-Dsug_FPj.js} +2 -2
  79. package/dist/web/assets/{play-Ctx-iMqd.js → play-Cbsyrwkw.js} +1 -1
  80. package/dist/web/assets/{python-Cm64qCpk.js → python-DVcVB2lF.js} +1 -1
  81. package/dist/web/assets/{refresh-cw-Bn28jIl0.js → refresh-cw-ChUK_QfF.js} +1 -1
  82. package/dist/web/assets/{save-BM5IQX65.js → save-Doep-KC7.js} +1 -1
  83. package/dist/web/assets/{square-DAGpFfSr.js → square-B5q2aneb.js} +1 -1
  84. package/dist/web/assets/{toggleHighContrast-DLW8Fnck.js → toggleHighContrast-CTZp7RE7.js} +1 -1
  85. package/dist/web/assets/{tsMode-BleUN_8S.js → tsMode-GfNadOOB.js} +1 -1
  86. package/dist/web/assets/{upload-vaAKFfxi.js → upload-DcewuCTa.js} +1 -1
  87. package/dist/web/assets/{useLocalAgentSchedules-Ccenbqf6.js → useLocalAgentSchedules-BwltnId8.js} +1 -1
  88. package/dist/web/assets/{wifi-off-DJA9KReb.js → wifi-off-cXPyKIzd.js} +1 -1
  89. package/dist/web/assets/{workers-CFG-afha.js → workers-CP6kCS63.js} +1 -1
  90. package/dist/web/assets/{yaml-Cs8iZKVC.js → yaml-w0GP6yKf.js} +1 -1
  91. package/dist/web/index.html +2 -2
  92. package/package.json +1 -1
  93. package/dist/web/assets/MainPane-CuhwxMxg.js +0 -6
  94. package/dist/web/assets/MarkdownText-gwAue4u5.js +0 -9
  95. package/dist/web/assets/SettingsView--fL3Ecuy.js +0 -6
  96. package/dist/web/assets/SettingsView-BS5m5vdt.css +0 -1
  97. package/dist/web/assets/index-BRLugX1S.js +0 -1
  98. package/dist/web/assets/index-Y7IoiSlQ.css +0 -1
@@ -1 +1 @@
1
- import{r as y,j as e,ay as je,p as fe,a as ve}from"./index-BO2W2U23.js";import{s as G,e as ye,b as ne,d as Z,f as pe}from"./training-model-data-V8276E5q.js";import{L as X,b as ee,a as ke,l as Ne,c as Te,d as Re,e as $e,m as Se,f as we,g as Me,h as Ce,E as le}from"./LabsRoute-BauSK1is.js";import"./cloud-upload-COReKxOy.js";import"./MainPane-CuhwxMxg.js";import"./arrow-up-right-DYGSWA2J.js";import"./MarkdownText-gwAue4u5.js";import"./square-DAGpFfSr.js";import"./folder-open-9OjGqNgP.js";import"./AppDialog-wIb8mGQ0.js";import"./ComposerCreateImproveStrip-BP-7DmQG.js";import"./play-Ctx-iMqd.js";import"./refresh-cw-Bn28jIl0.js";/* empty css */import"./UsageSettingsSection-COoCLLg6.js";import"./index-BRLugX1S.js";function Le({receipts:a}){const[t,n]=y.useState(!1);if(!a.length)return e.jsx("div",{className:"training-run-placeholder",children:"No on-policy rollout receipts were recorded for this run."});const s=[...a].sort((l,o)=>o.updatedAt.localeCompare(l.updatedAt)),i=t?s:s.slice(0,24);return e.jsxs("div",{className:"training-rollout-receipts",children:[a.length>24?e.jsxs("div",{className:"training-rollout-receipt-controls",children:[e.jsx("span",{children:t?`Showing all ${a.length} receipts`:`Showing latest ${i.length} of ${a.length} receipts`}),e.jsx("button",{className:"training-text-button",type:"button",onClick:()=>n(l=>!l),children:t?"Show latest 24":`Show all ${a.length}`})]}):null,i.map(l=>e.jsxs("details",{children:[e.jsxs("summary",{children:[e.jsx("span",{children:Pe(l.providerTrace.rolloutId)}),e.jsx("strong",{children:l.status}),e.jsx("em",{children:l.reward.eligible&&l.reward.raw!=null?l.reward.raw.toFixed(3):l.failureClass??"not reward eligible"})]}),e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(C,{label:"Correlation",value:l.correlationId}),e.jsx(C,{label:"Task",value:l.taskId}),e.jsx(C,{label:"Policy",value:l.policy.modelId}),e.jsx(C,{label:"Checkpoint",value:l.policy.checkpointId??"Provider initial policy"}),e.jsx(C,{label:"Environment",value:`${l.environment.id}@${l.environment.version}`}),e.jsx(C,{label:"World",value:`${l.environment.worldId} · ${l.environment.worldHash}`}),e.jsx(C,{label:"Raw reward",value:l.reward.raw==null?"Not eligible":String(l.reward.raw)}),e.jsx(C,{label:"Components",value:JSON.stringify(l.reward.components)}),e.jsx(C,{label:"Outcome",value:l.verifier?.outcome??l.failureClass??"Pending"}),e.jsx(C,{label:"Trace",value:`${l.providerTrace.experimentId}/${l.providerTrace.rolloutId}`})]})]},l.id))]})}function C({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function Pe(a){return a.replace(/^lineage_/,"").slice(0,18)}function Ae({detail:a,loading:t}){if(t&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Loading evaluation results…"});const n=a?.evaluation;return n?e.jsxs("div",{className:"training-run-evaluation",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(J,{label:"Base score",value:se(n.base.meanScore)}),e.jsx(J,{label:"Trained score",value:se(n.trained.meanScore)}),e.jsx(J,{label:"Score change",value:Ie(n.meanScoreDelta)}),e.jsx(J,{label:"Trained pass rate",value:Ee(n.trained.passRate)})]}),n.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,n.trained.count>0&&n.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:n.examples.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("details",{children:[e.jsx("summary",{children:s.taskId}),e.jsx(Fe,{input:s.input,baseOutput:s.baseOutput,trainedOutput:s.trainedOutput,baseGrade:s.baseGrade,trainedGrade:s.trainedGrade})]})}),e.jsx("td",{children:re(s.baseGrade)}),e.jsx("td",{children:re(s.trainedGrade)}),e.jsx("td",{children:Be(s.baseGrade,s.trainedGrade)})]},s.taskId))})]})})]}):e.jsx("div",{className:"training-run-placeholder",children:"No scored evaluation results are available for this run."})}function Fe({input:a,baseOutput:t,trainedOutput:n,baseGrade:s,trainedGrade:i}){const l=[...new Set([...s?.feedback??[],...i?.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(a,null,2)})]}),t?e.jsxs("div",{children:[e.jsx("span",{children:"Base output"}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]}):null,n?e.jsxs("div",{children:[e.jsx("span",{children:"Trained output"}),e.jsx("pre",{children:JSON.stringify(n,null,2)})]}):null,l.length?e.jsxs("div",{children:[e.jsx("span",{children:"Grader feedback"}),e.jsx("p",{children:l.join(" ")})]}):null]})}function J({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("span",{children:a}),e.jsx("strong",{children:t})]})}function se(a){return a==null?"Not recorded":a.toFixed(3)}function Ee(a){return a==null?"Not recorded":`${Math.round(a*100)}%`}function Ie(a){return a==null?"Not comparable":`${a>=0?"+":""}${a.toFixed(3)}`}function re(a){return a?.status==="unavailable"?"Unavailable":a?.score==null?"Not scored":a.score.toFixed(3)}function Be(a,t){if(!t)return"Not evaluated";if(t.status==="unavailable")return"Unavailable";if(!a||a.score==null||t.score==null)return t.passed?"Passed":"Failed";const n=t.score-a.score;return Math.abs(n)<5e-4?"No change":n>0?`Improved ${n.toFixed(3)}`:`Regressed ${Math.abs(n).toFixed(3)}`}const ie=[{key:"loss",label:"Loss",format:j},{key:"reward",label:"Reward",format:j},{key:"policyLoss",label:"Policy loss",format:j},{key:"advantageLoss",label:"Advantage loss",format:j},{key:"learningRate",label:"Learning rate",format:H},{key:"gradientNorm",label:"Gradient norm",format:j},{key:"meanTokenAccuracy",label:"Token accuracy",format:K},{key:"preferenceAccuracy",label:"Preference accuracy",format:K},{key:"preferenceMargin",label:"Preference margin",format:j},{key:"chosenReward",label:"Chosen reward",format:j},{key:"rejectedReward",label:"Rejected reward",format:j},{key:"chosenLogProbability",label:"Chosen log probability",format:j},{key:"rejectedLogProbability",label:"Rejected log probability",format:j},{key:"entropy",label:"Entropy",format:j},{key:"memoryBytes",label:"Memory",format:he}],oe=[{key:"meanReward",label:"Reward",format:j},{key:"meanReturn",label:"Return",format:j},{key:"learningRate",label:"Learning rate",format:H},{key:"policyLoss",label:"Policy loss",format:j},{key:"valueLoss",label:"Value loss",format:j},{key:"kl",label:"KL",format:j},{key:"entropy",label:"Entropy",format:j},{key:"policyClipFraction",label:"Policy clip fraction",format:K},{key:"valueClipFraction",label:"Value clip fraction",format:K},{key:"explainedVariance",label:"Explained variance",format:j}];function Ue({detail:a,loading:t,error:n}){je(n,{prefix:"Training metrics"});const s=y.useMemo(()=>_e(a?.stepMetrics??[]),[a?.stepMetrics]),i=y.useMemo(()=>ie.filter(r=>s.some(v=>v[r.key]!=null)),[s]),[l,o]=y.useState("loss"),c=i.find(r=>r.key===l)??i[0]??ie[0],f=s.flatMap(r=>r[c.key]==null?[]:[{step:r.step,value:r[c.key]}]),p=y.useMemo(()=>qe(a?.policyMetrics??[]),[a?.policyMetrics]),x=y.useMemo(()=>oe.filter(r=>p.some(v=>v[r.key]!=null)),[p]),[u,h]=y.useState("meanReward"),g=x.find(r=>r.key===u)??x[0]??oe[0],S=p.flatMap(r=>r[g.key]==null?[]:[{step:r.step,value:r[g.key]}]),P=p.flatMap(r=>r.meanReward==null?[]:[{step:r.step,value:r.meanReward}]),T=p.flatMap(r=>r.learningRate==null?[]:[{step:r.step,value:r.learningRate}]),k=y.useMemo(()=>Ve(a?.events??[]),[a?.events]),m=a?Oe(a):{};if(t&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Loading training metrics…"});if(n&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Training metrics are unavailable."});if(!a)return e.jsx("div",{className:"training-run-placeholder",children:"Select a training run to inspect its metrics."});if(p.length){if(p.some(v=>v.method==="grpo")||a.job.metadata.trainingMethod==="grpo")return e.jsx(ce,{learningRatePoints:T,rewardPoints:P,rolloutPoints:k});const r=p.at(-1);return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(L,{label:"Optimizer steps",value:r.step}),e.jsx(L,{label:"Latest reward",value:r.meanReward==null?null:j(r.meanReward)}),e.jsx(L,{label:"Policy loss",value:r.policyLoss==null?null:j(r.policyLoss)}),e.jsx(L,{label:"Rollouts",value:k.length||null}),e.jsx(L,{label:"Learning rate",value:r.learningRate==null?null:H(r.learningRate)}),e.jsx(L,{label:"Environment executions",value:r.environmentExecutions})]}),x.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Policy metrics",children:x.map(v=>e.jsx("button",{className:v.key===g.key?"active":"",role:"tab",type:"button","aria-selected":v.key===g.key,onClick:()=>h(v.key),children:v.label},v.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[k.length?e.jsx(z,{axisLabel:"Rollout",format:j,label:"Rollout reward",points:k}):null,e.jsx(z,{format:g.format,label:g.label,points:S})]})]}):null]})}const b=a.job.metadata.trainingMethod==="grpo",I=s.flatMap(r=>r.loss==null?[]:[r.loss]),A=s.flatMap(r=>r.learningRate==null?[]:[{step:r.step,value:r.learningRate}]),B=s.flatMap(r=>r.reward==null?[]:[{step:r.step,value:r.reward}]);if(b){const r=a.job.metadata.optimizerUpdatesObserved,v=typeof r=="number"&&Number.isFinite(r)?Math.max(0,r):null;return e.jsx(ce,{learningRatePoints:v==null?A:A.filter(F=>F.step<=v),rewardPoints:v==null?B:B.filter(F=>F.step<=v),rolloutPoints:k})}return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(L,{label:"Steps",value:m.steps??De(s)}),e.jsx(L,{label:"Final loss",value:m.trainLoss==null?I.at(-1)==null?null:j(I.at(-1)):j(m.trainLoss)}),e.jsx(L,{label:"Peak memory",value:Ge(a.stepMetrics)}),e.jsx(L,{label:"Adapter parameters",value:m.adapterParameterCount==null?null:m.adapterParameterCount.toLocaleString()})]}),i.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Training metrics",children:i.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":r.key===c.key,className:r.key===c.key?"active":"",onClick:()=>o(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[e.jsx(z,{label:c.label,points:f,format:c.format}),c.key!=="learningRate"&&A.length?e.jsx(z,{label:"Learning rate",points:A,format:H}):null]})]}):e.jsx("div",{className:"training-run-placeholder",children:"This earlier run recorded its final result but not per-step Trainer logs."})]})}function ce({rewardPoints:a,rolloutPoints:t,learningRatePoints:n}){return e.jsx("div",{className:"training-run-metrics",children:e.jsxs("div",{className:"training-metric-chart-grid three",children:[e.jsx(z,{format:j,label:"Reward",points:a}),e.jsx(z,{axisLabel:"Rollout",format:j,label:"Rollout reward",points:t}),e.jsx(z,{format:H,label:"Learning rate",points:n})]})})}function z({label:a,points:t,format:n,axisLabel:s="Optimizer step"}){return e.jsxs("section",{className:"training-metric-chart-card",children:[e.jsxs("header",{children:[e.jsx("h4",{children:a}),e.jsxs("span",{children:[t.length," ",t.length===1?"point":"points"]})]}),t.length?e.jsx(ze,{axisLabel:s,format:n,label:a,points:t}):e.jsx("div",{className:"training-metric-chart-empty",children:"Not recorded"})]})}function ze({label:a,points:t,format:n,axisLabel:s}){const o={top:20,right:20,bottom:58,left:64},c=t.map(r=>r.value),f=Math.min(...c),p=Math.max(...c),x=p-f||Math.max(Math.abs(p)*.1,1e-9),u=f-x*.08,h=p+x*.08,g=t[0]?.step??0,S=t.at(-1)?.step??g+1,P=Math.max(1,S-g),T=760-o.right,k=r=>t.length===1?(o.left+T)/2:o.left+(r-g)/P*(760-o.left-o.right),m=r=>o.top+(h-r)/(h-u)*(270-o.top-o.bottom),b=t.map((r,v)=>`${v?"L":"M"}${k(r.step).toFixed(2)},${m(r.value).toFixed(2)}`).join(" "),I=270-o.bottom,A=t.length>1?`${b} L${k(S).toFixed(2)},${I} L${k(g).toFixed(2)},${I} Z`:"",B=s!=="Optimizer step"?s:a==="Learning rate"?"Update":"Step";return e.jsx("figure",{className:"training-line-chart","aria-label":`${a} by ${s.toLowerCase()}`,children:e.jsxs("svg",{viewBox:"0 0 760 270",role:"img","aria-labelledby":`metric-${a.replaceAll(" ","-")}`,children:[e.jsx("title",{id:`metric-${a.replaceAll(" ","-")}`,children:`${a} by ${s.toLowerCase()}`}),[0,.25,.5,.75,1].map(r=>{const v=o.top+r*(270-o.top-o.bottom),F=h-r*(h-u);return e.jsxs("g",{children:[e.jsx("line",{className:"training-chart-grid",x1:o.left,x2:760-o.right,y1:v,y2:v}),e.jsx("text",{className:"training-chart-label",x:o.left-10,y:v+4,textAnchor:"end",children:n(F)})]},r)}),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:A}),e.jsx("path",{className:"training-chart-line",d:b}),t.map(r=>e.jsx("circle",{className:"training-chart-point",cx:k(r.step),cy:m(r.value),r:t.length===1?"4.5":"3",children:e.jsx("title",{children:`${B} ${r.step}: ${n(r.value)}`})},`${r.step}-${r.value}`)),e.jsx("text",{className:"training-chart-label",x:k(g),y:236,textAnchor:"middle",children:g}),t.length>1?e.jsx("text",{className:"training-chart-label",x:T,y:236,textAnchor:"middle",children:S}):null,e.jsx("text",{className:"training-chart-label axis-title",x:(o.left+760-o.right)/2,y:261,textAnchor:"middle",children:s})]})})}function Ve(a){return a.flatMap(t=>{if(t.type!=="metric"||t.payload.metricKind!=="rollout_trajectory")return[];const n=de(t.payload.rolloutIndex),s=de(t.payload.reward);return n==null||s==null?[]:[{step:n,value:s}]})}function de(a){return typeof a=="number"&&Number.isFinite(a)?a:null}function L({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("span",{children:a}),e.jsx("strong",{children:t??"Not recorded"})]})}function Oe(a){const t=[...a.events].reverse().find(n=>n.type==="metric"&&n.payload.metricKind!=="sft_step"&&(typeof n.payload.trainLoss=="number"||typeof n.payload.steps=="number"));return Object.fromEntries(Object.entries(t?.payload??{}).filter(n=>typeof n[1]=="number"))}function De(a){const t=a.at(-1);return t?`${t.step} of ${t.maxSteps}`:null}function _e(a){const t=new Map;for(const n of a)t.set(n.step,n);return[...t.values()].sort((n,s)=>n.step-s.step)}function qe(a){const t=new Map;for(const n of a)t.set(n.step,n);return[...t.values()].sort((n,s)=>n.step-s.step)}function Ge(a){const t=a.flatMap(n=>n.memoryBytes==null?[]:[n.memoryBytes]);return t.length?he(Math.max(...t)):null}function j(a){return new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(a)}function H(a){return a===0?"0":a.toExponential(2)}function K(a){return`${(a*100).toFixed(1)}%`}function he(a){return`${(a/1024**3).toFixed(2)} GB`}const He=new Set(["queued","starting","running","cancelling","reconciling"]);function Je(a,t,n){const[s,i]=y.useState(null),[l,o]=y.useState(!1),[c,f]=y.useState(null),p=y.useCallback(async()=>{if(!a||!t)return null;o(!0);try{const x=await fe.trainingRunDetail(a,t);return i(x),f(null),x}catch(x){return f(x instanceof Error?x.message:String(x)),null}finally{o(!1)}},[a,t]);return y.useEffect(()=>{i(null),f(null),!(!a||!t)&&p()},[a,t,p]),y.useEffect(()=>{if(!a||!t||!n||!He.has(n))return;const x=window.setInterval(()=>{p()},2e3);return()=>window.clearInterval(x)},[a,t,n,p]),{detail:s,error:c,loading:l,refresh:p}}function We({title:a,status:t,statusValue:n,versionStatus:s,method:i,baseModel:l,taskset:o,compute:c,duration:f,output:p,reward:x,telemetry:u,evidence:h,configuration:g,children:S,failure:P,onOpenTaskset:T}){const k=u?.cost.providerReportedUsd??u?.cost.estimatedUsd??h?.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:a}),e.jsx(X,{label:t,value:n})]}),e.jsxs("p",{children:[Ye(i)," on ",l]})]})})}),S,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(M,{label:"Training method",value:i}),e.jsx(M,{label:"Base model",value:l}),e.jsx(M,{label:"Compute",value:c}),e.jsx(M,{label:"Output",value:p}),s?e.jsx(M,{label:"Version status",value:s}):null,e.jsx(M,{label:"Duration",value:f}),e.jsx(M,{label:"Run cost",value:k===null?"Not reported":`$${k.toFixed(4)}`}),e.jsx(M,{label:"Final reward",value:x===null?"Not reported":x.toFixed(4)}),g.map(m=>e.jsx(M,{label:m.label,value:m.value},m.label)),u||h?e.jsxs(e.Fragment,{children:[e.jsx(D,{label:"GPU",value:Ke(u,h)}),e.jsx(D,{label:"Tokens",value:`${_(u?.usage.promptTokens??h?.usage.inputTokens??null)} prompt · ${_(u?.usage.generatedTokens??h?.usage.outputTokens??null)} generated`}),e.jsx(D,{label:"Trajectories",value:`${_(u?.usage.successfulTrajectories??h?.reward.eligibleTrajectoryCount??null)} succeeded · ${_(u?.usage.failedTrajectories??(h?h.reward.trajectoryCount-h.reward.eligibleTrajectoryCount:null))} failed`}),e.jsx(D,{label:"Optimizer updates",value:_(u?.usage.optimizerSteps??h?.progress.committedOptimizerSteps??null)}),e.jsx(D,{label:"GPU time",value:u?.usage.gpuSeconds==null?"Not reported":`${u.usage.gpuSeconds.toFixed(1)} seconds`})]}):e.jsx(M,{label:"Resource usage",value:"Not retained for this run"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:T?e.jsxs("button",{className:"labs-run-taskset-link",type:"button",onClick:T,children:[e.jsx("span",{children:o}),e.jsx(ve,{"aria-hidden":"true",size:14})]}):o})]})]})]}),P?e.jsx("p",{className:"labs-training-error",children:P}):null]})}function M({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function D({label:a,value:t}){return e.jsx(M,{label:a,value:t})}function Ke(a,t){const n=a?.resource.gpuCount??t?.resource.gpuCount??null,s=a?.resource.gpuType??t?.resource.gpuType??null;return n===null&&s===null?"Not reported":`${n??"Unknown"} × ${s?Ze(s):"Unreported"}`}function _(a){return a===null?"Not reported":a.toLocaleString()}function Ye(a){return a==="RFT"?"Reinforcement fine-tuning":`${a} training`}function Ze(a){return a.split(" · ").map(t=>t.replaceAll("_"," ").replace(/\b[a-z]/g,n=>n.toUpperCase())).join(" · ")}function Qe({receipt:a,onOpenConversation:t}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Inconclusive benchmark"})}),e.jsx("p",{className:"training-run-placeholder",children:a.reason}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx(N,{label:"Held-out baseline tokens",value:a.usage.baseline.totalTokens.toLocaleString()}),e.jsx(N,{label:"Adaptation baseline tokens",value:a.usage.adaptation.totalTokens.toLocaleString()}),e.jsx(N,{label:"Refiner tokens",value:a.usage.refiner.totalTokens.toLocaleString()}),e.jsx(N,{label:"Grader tokens",value:a.usage.grader.totalTokens.toLocaleString()}),e.jsx(N,{label:"Observed / maximum spend",value:`$${a.budget.observedSpendUsd.toFixed(4)} / $${a.budget.maximumSpendUsd.toFixed(2)}`}),e.jsx(N,{label:"Harness candidate",value:a.stopReason==="candidate_harness_unchanged"?"Unchanged":"Lineage invalid"}),e.jsx(N,{label:"Completed attempts",value:a.attempts.length.toLocaleString()}),e.jsx(N,{label:"Candidate attempts",value:"Skipped"})]})]}),a.attempts.length?e.jsx(xe,{receipt:a,onOpenConversation:t}):null]})}function Xe({run:a}){const t=["baseline","adaptation","refiner","candidate_adaptation","candidate","comparison"],n={baseline:"Baseline",adaptation:"Adaptation",refiner:"Refiner",candidate_adaptation:"Sequential adaptation",candidate:"Candidate",comparison:"Comparison"},s=Math.max(0,t.indexOf(a.evaluationProgress?.stage??"baseline")),i=a.evaluationProgress?.completedAttempts??0,l=a.evaluationProgress?.totalAttempts??1;return e.jsxs("div",{className:"labs-benchmark-progress",children:[e.jsxs("header",{children:[e.jsx("h3",{children:"Benchmark progress"}),e.jsxs("strong",{children:[i," of ",l," attempts"]})]}),e.jsx("div",{className:"labs-benchmark-progress-track","aria-hidden":"true",children:e.jsx("span",{style:{width:`${Math.min(100,i/l*100)}%`}})}),e.jsx("ol",{children:t.map((o,c)=>e.jsxs("li",{className:c<s?"complete":c===s?"active":void 0,children:[e.jsx("span",{}),n[o]]},o))})]})}function ea({receipt:a}){const t=ee(a),n=t.pairs.filter(l=>l.cohort==="held_out"),s=t.pairs.filter(l=>l.cohort==="adaptation"),i=l=>l.length?l.reduce((o,c)=>o+c,0)/l.length:0;return e.jsxs("div",{className:"labs-benchmark-attempt-charts",children:[e.jsx(W,{title:"Held-out tokens by task",baseline:n.map(l=>l.baseline.totalTokens),candidate:n.map(l=>l.refined.totalTokens),format:l=>Math.round(l).toLocaleString()}),e.jsx(W,{title:"Adaptation tokens by task",baseline:s.map(l=>l.baseline.totalTokens),candidate:s.map(l=>l.refined.totalTokens),format:l=>Math.round(l).toLocaleString()}),e.jsx(W,{title:"Held-out quality by task",baseline:n.map(l=>l.baseline.score),candidate:n.map(l=>l.refined.score),format:l=>l.toFixed(2),summarize:i}),e.jsx(W,{title:"Adaptation quality by task",baseline:s.map(l=>l.baseline.score),candidate:s.map(l=>l.refined.score),format:l=>l.toFixed(2),summarize:i})]})}function aa({receipt:a,run:t,tasksetName:n,onOpenTaskset:s}){const i=ee(a),l=i.comparedTaskCount>0,o=i.passed,c=i.tokenDeltaPercent===null?"—":`${i.tokenDeltaPercent>0?"+":""}${i.tokenDeltaPercent.toFixed(2)}%`,f=p=>{const x=i.cohorts[p];return`${x.passedTaskCount}/${x.comparedTaskCount} passed`};return e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Token efficiency"})}),l?e.jsxs("div",{className:"labs-benchmark-efficiency-summary",children:[e.jsxs("strong",{children:[i.passedTaskCount," of ",i.comparedTaskCount," tasks passed"]}),e.jsxs("p",{children:["A task passes only when its refined token count is strictly lower than its own baseline. ",i.failedTaskCount," failed this token-efficiency test; aggregate usage changed by ",c,"."]})]}):e.jsx("p",{className:"training-run-placeholder",children:"Paired task-level token evidence is unavailable for this run."}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx(N,{label:"Execution",value:G(t.status)}),e.jsx(N,{label:"Token-efficiency result",value:o?"Passed":"Failed"}),e.jsx(N,{label:"Efficiency passes",value:`${i.passedTaskCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"Efficiency failures",value:`${i.failedTaskCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"All-task foreground tokens",value:`${i.baselineTokens.toLocaleString()} → ${i.refinedTokens.toLocaleString()}`}),e.jsx(N,{label:"Aggregate token change",value:c}),e.jsx(N,{label:"Adaptation replay",value:f("adaptation")}),e.jsx(N,{label:"Held-out replay",value:f("held_out")}),e.jsx(N,{label:"Task quality",value:`${i.baselinePassedCount}/${i.comparedTaskCount} → ${i.refinedPassedCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"Result lineage",value:a.lineage.valid?"Valid":"Invalid"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:s?e.jsx("button",{className:"labs-run-taskset-link",type:"button",onClick:s,children:n}):n})]})]})]})}function W({title:a,baseline:t,candidate:n,format:s,summarize:i=l=>l.reduce((o,c)=>o+c,0)}){const l=t.filter(u=>u!==null),o=n.filter(u=>u!==null),c=Math.max(1,...l,...o),f=Math.max(2,t.length,n.length),p=u=>{const h=[];let g=[];return u.forEach((S,P)=>{if(S===null){g.length&&h.push(g.join(" ")),g=[];return}const T=6+P/(f-1)*88,k=44-S/c*36;g.push(`${T},${k}`)}),g.length&&h.push(g.join(" ")),h},x=u=>u.flatMap((h,g)=>h===null?[]:[{x:6+g/(f-1)*88,y:44-h/c*36}]);return e.jsxs("section",{className:"labs-benchmark-line-chart",children:[e.jsxs("header",{children:[e.jsx("h4",{children:a}),e.jsxs("div",{children:[e.jsxs("span",{children:["Baseline ",s(i(l))]}),e.jsxs("span",{children:["Refined ",s(i(o))]})]})]}),e.jsxs("svg",{"aria-label":a,role:"img",viewBox:"0 0 100 50",preserveAspectRatio:"none",children:[e.jsx("line",{x1:"6",x2:"94",y1:"44",y2:"44"}),p(t).map((u,h)=>e.jsx("polyline",{className:"baseline",points:u},`baseline-${h}`)),p(n).map((u,h)=>e.jsx("polyline",{className:"candidate",points:u},`candidate-${h}`)),x(t).map((u,h)=>e.jsx("circle",{className:"baseline",cx:u.x,cy:u.y,r:"1"},`baseline-point-${h}`)),x(n).map((u,h)=>e.jsx("circle",{className:"candidate",cx:u.x,cy:u.y,r:"1"},`candidate-point-${h}`))]})]})}function xe({receipt:a,onOpenConversation:t}){const n=a.schemaVersion==="openpond.modelEvaluationReceipt.v1"?ke(a.attempts??[]):a.attempts??[];return e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:a.schemaVersion==="openpond.modelEvaluationReceipt.v1"?"Selected task results":"Completed attempts"})}),e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table labs-benchmark-attempt-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Task"}),e.jsx("th",{children:"Phase"}),e.jsx("th",{children:"Result"}),e.jsx("th",{children:"Score"}),e.jsx("th",{children:"Tokens"}),e.jsx("th",{children:"Work chat"})]})}),e.jsx("tbody",{children:n.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:ta(s.taskId)}),e.jsx("td",{children:s.phase}),e.jsx("td",{children:e.jsx(X,{label:s.passed?"Passed":"Failed",value:s.passed?"succeeded":"failed"})}),e.jsx("td",{children:s.score===null?"—":s.score.toFixed(2)}),e.jsx("td",{children:s.totalTokens.toLocaleString()}),e.jsx("td",{children:s.sessionId?e.jsx("button",{className:"labs-run-taskset-link",type:"button",onClick:()=>t(s.sessionId),children:"Open chat"}):"Not retained"})]},`${s.phase}:${s.attemptId}`))})]})})]})}function ta(a){return a.replace(/^(?:adaptation|frozen)-/,"").replaceAll("-"," ").replace(/^./,t=>t.toUpperCase())}function N({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function Sa({connection:a,selectedEntryKey:t,workproduct:n,runs:s,training:i,onOpenDataset:l,onOpenConversation:o}){const[c,f]=y.useState("artifacts"),p=i.payload,x=y.useMemo(()=>Ne(n,s,p),[s,p,n]),u=y.useMemo(()=>Te(n,s,p),[s,p,n]),h=y.useMemo(()=>Re(n,p),[p,n]),g=y.useMemo(()=>$e(n,s,p),[s,p,n]),S=y.useMemo(()=>new Map(g.map(d=>[d.id,d])),[g]),T=y.useMemo(()=>Se(x,u),[x,u]).find(d=>d.key===t)??null,k=t.startsWith("model-run:")?t.slice(10):null,m=k?h.find(d=>d.id===k)??null:T?.job?h.find(d=>d.id===T.job?.metadata.modelRunId)??null:null,b=T?.job??(m?p?.jobs.find(d=>d.id===m.id||d.metadata.modelRunId===m.id)??null:null),I=y.useMemo(()=>we(x,u,h),[x,h,u]),A=I.findIndex(d=>d.key===t||b!==null&&d.job?.id===b.id||m!==null&&d.lifecycleRun?.id===m.id),B=A<0?null:I.length-A,r=T?.version??(m?.adapterArtifactLineageId?u.find(d=>d.lineage.id===m.adapterArtifactLineageId)??null:null),v=(m?p?.modelVersions.find(d=>d.id===m.modelVersionId)?.baseModel.modelId:null)??p?.modelVersions.filter(d=>d.modelId===n.id&&d.kind==="base_reference").sort((d,ge)=>ge.version-d.version)[0]?.baseModel.modelId??null,F=r?.lineage.frozenEvaluationArtifactId??null,ae=r?.lineage.managedServing??null,V=r?.plan??(b?S.get(b.planId)??null:null),U=r?.taskset??Me(p).find(d=>d.id===(m?.taskset.id??V?.tasksetId))??null,$=Je(a,b?.id??null,b?.status??null),te=b?p?.rolloutReceipts.filter(d=>d.jobId===b.id)??[]:[],w=$.detail?.managedEvidence??null,Y=[{id:"artifacts",label:"Artifacts"},...$.loading||$.detail?.evaluation||F||w?.evaluations.length?[{id:"evaluation",label:"Evaluation"}]:[],...te.length?[{id:"rollouts",label:"Rollouts"}]:[],...ae?[{id:"serving",label:"Serving"}]:[],...b?[{id:"activity",label:"Activity"}]:[]],E=Y.some(d=>d.id===c)?c:Y[0].id;return!T&&!m?e.jsx("div",{className:"labs-model-version-detail",children:e.jsx("div",{className:"training-run-placeholder",children:"This training attempt is no longer available."})}):m?.kind==="evaluation"?e.jsx(na,{run:m,runNumber:B,tasksetName:U?.name??"Unavailable",onOpenTaskset:U?()=>l(U.id):void 0,onOpenConversation:o}):e.jsxs("div",{className:"labs-model-version-detail",children:[e.jsx(We,{baseModel:la(V,v),compute:m?Z(m.destinationId??""):V?Z(V.destinationId):b?Z(b.destinationId):"Not recorded",duration:m?ne(m.startedAt,m.completedAt):b?ne(b.startedAt,b.completedAt):"Not recorded",failure:b?.error??m?.failure??null,configuration:sa(V),evidence:w,method:ye(m?.method??V?.recipe.method),output:r?`Version ${r.number}`:"No version created",reward:m?.reward?.raw??w?.reward.finalMean??null,status:m?G(m.status):b?G(b.status):"Imported",statusValue:m?.status??b?.status??"imported",taskset:U?.name??"Unavailable",telemetry:m?.receipt?.schemaVersion==="openpond.modelRunReceipt.v1"?m.receipt.telemetry:null,title:m||b?B?`Run ${B}`:"Run details":r?`Version ${r.number}`:"Run details",versionStatus:r?r.current?"Active":"Available":null,onOpenTaskset:U?()=>l(U.id):void 0,children:b?e.jsx(Ue,{detail:$.detail,error:$.error,loading:$.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:Y.map(d=>e.jsx("button",{"aria-controls":`run-detail-panel-${d.id}`,"aria-selected":E===d.id,className:E===d.id?"active":void 0,id:`run-detail-tab-${d.id}`,role:"tab",type:"button",onClick:()=>f(d.id),children:d.label},d.id))}),e.jsxs("div",{"aria-labelledby":`run-detail-tab-${E}`,className:"labs-run-detail-tab-panel",id:`run-detail-panel-${E}`,role:"tabpanel",children:[E==="artifacts"?e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(R,{label:"Training attempt",value:b?.id??"Provider import"}),e.jsx(R,{label:"Taskset",value:U?.name??"Unavailable"}),e.jsx(R,{label:"Prepared data",value:b?.bundleHash??"Provider managed"}),e.jsx(R,{label:"Version ID",value:r?.lineage.id??"No version created"}),w?.checkpoint?e.jsxs(e.Fragment,{children:[e.jsx(R,{label:"Checkpoint",value:w.checkpoint.id}),e.jsx(R,{label:"Checkpoint size",value:w.checkpoint.sizeBytes==null?"Not reported":be(w.checkpoint.sizeBytes)}),e.jsx(R,{label:"Checkpoint hash",value:w.checkpoint.sha256??"Not reported"})]}):null,w?.canonicalPublication.state?e.jsx(R,{label:"Registry publication",value:Q(w.canonicalPublication.state)}):null]}):null,E==="evaluation"?e.jsxs("div",{className:"training-run-evaluation",children:[$.loading||$.detail?.evaluation?e.jsx(Ae,{detail:$.detail,loading:$.loading}):null,!$.detail?.evaluation&&w?.evaluations.length?e.jsx("dl",{className:"labs-inline-facts",children:w.evaluations.map(d=>e.jsx(R,{label:d.kind==="baseline"?"Baseline score":"Candidate score",value:d.score==null?"Not reported":d.score.toFixed(6)},`${d.kind}:${d.policyVersion}`))}):null,F?e.jsx("button",{className:"training-button secondary",type:"button",onClick:()=>{i.actions.downloadArtifact(F)},children:"Download evaluation receipt"}):null]}):null,E==="rollouts"?e.jsx(Le,{receipts:te}):null,E==="serving"?e.jsx(ra,{projection:ae}):null,E==="activity"&&b?e.jsx(ia,{error:b.error??$.error,events:$.detail?.events??[],loading:$.loading}):null]})]})]})}function na({run:a,runNumber:t,tasksetName:n,onOpenTaskset:s,onOpenConversation:i}){const l=a.receipt?.schemaVersion==="openpond.modelEvaluationReceipt.v1"?a.receipt:null,o=a.receipt?.schemaVersion==="openpond.modelEvaluationStopReceipt.v1"?a.receipt:null,c=l?Ce(l):null,f=l?ee(l):null;return e.jsxs("div",{className:"labs-model-version-detail labs-model-evaluation-detail",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?`Run ${t}`:"Evaluation run"}),e.jsx(X,{label:l?f?.comparedTaskCount?`${f.passedTaskCount}/${f.comparedTaskCount} passed`:"No paired result":o?"Inconclusive":G(a.status),value:l?f?.comparedTaskCount&&f.passed?"succeeded":"neutral":o?.terminalClassification??a.status})]}),e.jsxs("p",{children:["Harness Refiner benchmark · ",n,l||o?` · execution ${G(a.status).toLowerCase()}`:""]})]})})}),l?e.jsxs(e.Fragment,{children:[e.jsx(le,{series:[{id:"baseline",label:"Held-out baseline",inputTokens:c.baseline.inputTokens,outputTokens:c.baseline.outputTokens,tokens:c.baseline.totalTokens,passRate:l.quality.baselinePassRate,costUsd:c.baseline.costUsd},{id:"candidate",label:"Held-out refined",inputTokens:c.candidate.inputTokens,outputTokens:c.candidate.outputTokens,tokens:c.candidate.totalTokens,passRate:l.quality.candidatePassRate,costUsd:c.candidate.costUsd}]}),e.jsx(le,{series:[{id:"adaptation-baseline",label:"Adaptation baseline",inputTokens:c.adaptation.inputTokens,outputTokens:c.adaptation.outputTokens,tokens:c.adaptation.totalTokens,passRate:l.quality.adaptationBaselinePassRate,costUsd:c.adaptation.costUsd},{id:"adaptation-candidate",label:"Adaptation replay",inputTokens:c.candidate_adaptation.inputTokens,outputTokens:c.candidate_adaptation.outputTokens,tokens:c.candidate_adaptation.totalTokens,passRate:l.quality.adaptationCandidatePassRate,costUsd:c.candidate_adaptation.costUsd}]}),(l.attempts??[]).length?e.jsx(ea,{receipt:l}):null,e.jsx(aa,{receipt:l,run:a,tasksetName:n,onOpenTaskset:s}),(l.attempts??[]).length?e.jsx(xe,{receipt:l,onOpenConversation:i}):null]}):o?e.jsx(Qe,{receipt:o,onOpenConversation:i}):e.jsx("section",{className:"labs-run-summary-card",children:a.failure?e.jsx("p",{className:"training-run-placeholder",children:a.failure}):e.jsx(Xe,{run:a})})]})}function la(a,t=null){if(!a)return t?ue(t):"Not recorded";const n=a.recipe.method==="sft"||a.recipe.method==="grpo"?a.recipe.baseModel:a.recipe.method==="dpo"?a.recipe.policyModel:a.recipe.method==="ppo"?a.recipe.policyOptimization.policyModel:null;return n?ue(n.id):"Not recorded"}function ue(a){return a.split("/").at(-1)??a}function sa(a){if(!a)return[];const t=a.recipe;return t.method==="grpo"?[{label:"LoRA rank",value:String(t.lora.rank)},{label:"Learning rate",value:me(t.optimizer.learningRate)},{label:"Optimizer steps",value:String(t.optimizer.maxSteps)},{label:"Rollouts per update",value:String(t.rollout.groupSize)},{label:"Rollout concurrency",value:String(t.rollout.concurrency)},{label:"Max output tokens",value:t.rollout.maxOutputTokens.toLocaleString()},{label:"Temperature",value:String(t.rollout.temperature)},{label:"Top P",value:String(t.rollout.topP)}]:t.method==="sft"||t.method==="dpo"?[{label:"LoRA rank",value:String(t.lora.rank)},{label:"Learning rate",value:me(t.optimizer.learningRate)},{label:"Optimizer steps",value:String(t.optimizer.maxSteps)}]:[]}function me(a){return a===0?"0":a.toExponential(2)}function be(a){const t=["B","KB","MB","GB","TB"];let n=a,s=0;for(;n>=1024&&s<t.length-1;)n/=1024,s+=1;return`${n.toFixed(s===0?0:2)} ${t[s]}`}function R({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function ra({projection:a}){return a?e.jsxs("dl",{className:"labs-inline-facts",children:[e.jsx(R,{label:"Admission",value:a.customerBindingAllowed?"Allowed":"Pending"}),e.jsx(R,{label:"Artifact",value:Q(a.canonicalArtifactState)}),e.jsx(R,{label:"Deployment",value:Q(a.canonicalDeploymentState)}),e.jsx(R,{label:"Base profile",value:a.baseProfileId??"Pending"}),e.jsx(R,{label:"Last synchronized",value:pe(a.lastSyncedAt)}),a.lastError?e.jsx(R,{label:"Synchronization",value:a.lastError}):null]}):null}function Q(a){return a?a.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase()):"Pending"}function ia({error:a,events:t,loading:n}){return n&&!t.length?e.jsx("div",{className:"training-run-placeholder",children:"Loading run events…"}):t.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:[t.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:pe(s.timestamp)}),e.jsx("td",{children:oa(s.type)}),e.jsx("td",{children:ca(s)})]},s.id)),a?e.jsxs("tr",{children:[e.jsx("td",{children:"Not available"}),e.jsx("td",{children:"Failure"}),e.jsx("td",{children:a})]}):null]})]})}):e.jsx("div",{className:"training-run-placeholder",children:a??"No normalized run events were recorded."})}function oa(a){return a.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase())}function ca(a){const t=a.payload,n=O(t.step),s=O(t.maxSteps);if(a.type==="start")return typeof t.device=="string"?`Worker started on ${t.device}.`:"Worker started.";if(a.type==="progress"&&n!=null)return s==null?`Step ${n}.`:`Step ${n} of ${s}.`;if(a.type==="metric"){const i=typeof t.metricKind=="string"?t.metricKind.replaceAll("_"," "):"metric",l=[q("loss",t.loss),q("reward",t.meanReward??t.reward),q("policy loss",t.policyLoss),q("value loss",t.valueLoss),q("preference accuracy",t.preferenceAccuracy,da)].filter(o=>!!o);return`${i}${n==null?"":` · step ${n}`}${l.length?` · ${l.join(" · ")}`:""}`}if(a.type==="checkpoint"){const i=O(t.policyVersion),l=O(t.sizeBytes),o=[i==null?null:`policy ${i}`,l==null?null:be(l),t.final===!0?"final":null].filter(c=>!!c);return o.length?`Checkpoint committed · ${o.join(" · ")}.`:"Checkpoint committed."}if(a.type==="complete"){const i=O(t.artifactCount);return i==null?"Worker completed.":`Worker completed with ${i} artifacts.`}return a.type==="failure"&&typeof t.message=="string"?t.message:Object.keys(t).length?JSON.stringify(t):"Recorded."}function q(a,t,n=s=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(s)){const s=O(t);return s==null?null:`${a} ${n(s)}`}function O(a){return typeof a=="number"&&Number.isFinite(a)?a:null}function da(a){return`${(a*100).toFixed(1)}%`}export{Sa as LabModelVersionDetailPage};
1
+ import{r as y,j as e,ay as je,p as fe,a as ve}from"./index-LrGasYyx.js";import{s as G,e as ye,b as ne,d as Z,f as pe}from"./training-model-data-V8276E5q.js";import{L as X,b as ee,a as ke,l as Ne,c as Te,d as Re,e as $e,m as Se,f as we,g as Me,h as Ce,E as le}from"./LabsRoute-DFV5vV6Z.js";import"./cloud-upload-D6bS8rS2.js";import"./MainPane-CQCLhV5C.js";import"./arrow-up-right-BDcNd1rt.js";import"./MarkdownText-R3MC5S30.js";import"./square-B5q2aneb.js";import"./folder-open-8C5l7A93.js";import"./AppDialog-DacC7BcY.js";import"./ComposerCreateImproveStrip-BH8Ath1h.js";import"./play-Cbsyrwkw.js";import"./refresh-cw-ChUK_QfF.js";/* empty css */import"./UsageSettingsSection-Bdvm66WK.js";import"./index-BYgrO3wt.js";function Le({receipts:a}){const[t,n]=y.useState(!1);if(!a.length)return e.jsx("div",{className:"training-run-placeholder",children:"No on-policy rollout receipts were recorded for this run."});const s=[...a].sort((l,o)=>o.updatedAt.localeCompare(l.updatedAt)),i=t?s:s.slice(0,24);return e.jsxs("div",{className:"training-rollout-receipts",children:[a.length>24?e.jsxs("div",{className:"training-rollout-receipt-controls",children:[e.jsx("span",{children:t?`Showing all ${a.length} receipts`:`Showing latest ${i.length} of ${a.length} receipts`}),e.jsx("button",{className:"training-text-button",type:"button",onClick:()=>n(l=>!l),children:t?"Show latest 24":`Show all ${a.length}`})]}):null,i.map(l=>e.jsxs("details",{children:[e.jsxs("summary",{children:[e.jsx("span",{children:Pe(l.providerTrace.rolloutId)}),e.jsx("strong",{children:l.status}),e.jsx("em",{children:l.reward.eligible&&l.reward.raw!=null?l.reward.raw.toFixed(3):l.failureClass??"not reward eligible"})]}),e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(C,{label:"Correlation",value:l.correlationId}),e.jsx(C,{label:"Task",value:l.taskId}),e.jsx(C,{label:"Policy",value:l.policy.modelId}),e.jsx(C,{label:"Checkpoint",value:l.policy.checkpointId??"Provider initial policy"}),e.jsx(C,{label:"Environment",value:`${l.environment.id}@${l.environment.version}`}),e.jsx(C,{label:"World",value:`${l.environment.worldId} · ${l.environment.worldHash}`}),e.jsx(C,{label:"Raw reward",value:l.reward.raw==null?"Not eligible":String(l.reward.raw)}),e.jsx(C,{label:"Components",value:JSON.stringify(l.reward.components)}),e.jsx(C,{label:"Outcome",value:l.verifier?.outcome??l.failureClass??"Pending"}),e.jsx(C,{label:"Trace",value:`${l.providerTrace.experimentId}/${l.providerTrace.rolloutId}`})]})]},l.id))]})}function C({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function Pe(a){return a.replace(/^lineage_/,"").slice(0,18)}function Ae({detail:a,loading:t}){if(t&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Loading evaluation results…"});const n=a?.evaluation;return n?e.jsxs("div",{className:"training-run-evaluation",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(J,{label:"Base score",value:se(n.base.meanScore)}),e.jsx(J,{label:"Trained score",value:se(n.trained.meanScore)}),e.jsx(J,{label:"Score change",value:Ie(n.meanScoreDelta)}),e.jsx(J,{label:"Trained pass rate",value:Ee(n.trained.passRate)})]}),n.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,n.trained.count>0&&n.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:n.examples.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:e.jsxs("details",{children:[e.jsx("summary",{children:s.taskId}),e.jsx(Fe,{input:s.input,baseOutput:s.baseOutput,trainedOutput:s.trainedOutput,baseGrade:s.baseGrade,trainedGrade:s.trainedGrade})]})}),e.jsx("td",{children:re(s.baseGrade)}),e.jsx("td",{children:re(s.trainedGrade)}),e.jsx("td",{children:Be(s.baseGrade,s.trainedGrade)})]},s.taskId))})]})})]}):e.jsx("div",{className:"training-run-placeholder",children:"No scored evaluation results are available for this run."})}function Fe({input:a,baseOutput:t,trainedOutput:n,baseGrade:s,trainedGrade:i}){const l=[...new Set([...s?.feedback??[],...i?.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(a,null,2)})]}),t?e.jsxs("div",{children:[e.jsx("span",{children:"Base output"}),e.jsx("pre",{children:JSON.stringify(t,null,2)})]}):null,n?e.jsxs("div",{children:[e.jsx("span",{children:"Trained output"}),e.jsx("pre",{children:JSON.stringify(n,null,2)})]}):null,l.length?e.jsxs("div",{children:[e.jsx("span",{children:"Grader feedback"}),e.jsx("p",{children:l.join(" ")})]}):null]})}function J({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("span",{children:a}),e.jsx("strong",{children:t})]})}function se(a){return a==null?"Not recorded":a.toFixed(3)}function Ee(a){return a==null?"Not recorded":`${Math.round(a*100)}%`}function Ie(a){return a==null?"Not comparable":`${a>=0?"+":""}${a.toFixed(3)}`}function re(a){return a?.status==="unavailable"?"Unavailable":a?.score==null?"Not scored":a.score.toFixed(3)}function Be(a,t){if(!t)return"Not evaluated";if(t.status==="unavailable")return"Unavailable";if(!a||a.score==null||t.score==null)return t.passed?"Passed":"Failed";const n=t.score-a.score;return Math.abs(n)<5e-4?"No change":n>0?`Improved ${n.toFixed(3)}`:`Regressed ${Math.abs(n).toFixed(3)}`}const ie=[{key:"loss",label:"Loss",format:j},{key:"reward",label:"Reward",format:j},{key:"policyLoss",label:"Policy loss",format:j},{key:"advantageLoss",label:"Advantage loss",format:j},{key:"learningRate",label:"Learning rate",format:H},{key:"gradientNorm",label:"Gradient norm",format:j},{key:"meanTokenAccuracy",label:"Token accuracy",format:K},{key:"preferenceAccuracy",label:"Preference accuracy",format:K},{key:"preferenceMargin",label:"Preference margin",format:j},{key:"chosenReward",label:"Chosen reward",format:j},{key:"rejectedReward",label:"Rejected reward",format:j},{key:"chosenLogProbability",label:"Chosen log probability",format:j},{key:"rejectedLogProbability",label:"Rejected log probability",format:j},{key:"entropy",label:"Entropy",format:j},{key:"memoryBytes",label:"Memory",format:he}],oe=[{key:"meanReward",label:"Reward",format:j},{key:"meanReturn",label:"Return",format:j},{key:"learningRate",label:"Learning rate",format:H},{key:"policyLoss",label:"Policy loss",format:j},{key:"valueLoss",label:"Value loss",format:j},{key:"kl",label:"KL",format:j},{key:"entropy",label:"Entropy",format:j},{key:"policyClipFraction",label:"Policy clip fraction",format:K},{key:"valueClipFraction",label:"Value clip fraction",format:K},{key:"explainedVariance",label:"Explained variance",format:j}];function Ue({detail:a,loading:t,error:n}){je(n,{prefix:"Training metrics"});const s=y.useMemo(()=>_e(a?.stepMetrics??[]),[a?.stepMetrics]),i=y.useMemo(()=>ie.filter(r=>s.some(v=>v[r.key]!=null)),[s]),[l,o]=y.useState("loss"),c=i.find(r=>r.key===l)??i[0]??ie[0],f=s.flatMap(r=>r[c.key]==null?[]:[{step:r.step,value:r[c.key]}]),p=y.useMemo(()=>qe(a?.policyMetrics??[]),[a?.policyMetrics]),x=y.useMemo(()=>oe.filter(r=>p.some(v=>v[r.key]!=null)),[p]),[u,h]=y.useState("meanReward"),g=x.find(r=>r.key===u)??x[0]??oe[0],S=p.flatMap(r=>r[g.key]==null?[]:[{step:r.step,value:r[g.key]}]),P=p.flatMap(r=>r.meanReward==null?[]:[{step:r.step,value:r.meanReward}]),T=p.flatMap(r=>r.learningRate==null?[]:[{step:r.step,value:r.learningRate}]),k=y.useMemo(()=>Ve(a?.events??[]),[a?.events]),m=a?Oe(a):{};if(t&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Loading training metrics…"});if(n&&!a)return e.jsx("div",{className:"training-run-placeholder",children:"Training metrics are unavailable."});if(!a)return e.jsx("div",{className:"training-run-placeholder",children:"Select a training run to inspect its metrics."});if(p.length){if(p.some(v=>v.method==="grpo")||a.job.metadata.trainingMethod==="grpo")return e.jsx(ce,{learningRatePoints:T,rewardPoints:P,rolloutPoints:k});const r=p.at(-1);return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(L,{label:"Optimizer steps",value:r.step}),e.jsx(L,{label:"Latest reward",value:r.meanReward==null?null:j(r.meanReward)}),e.jsx(L,{label:"Policy loss",value:r.policyLoss==null?null:j(r.policyLoss)}),e.jsx(L,{label:"Rollouts",value:k.length||null}),e.jsx(L,{label:"Learning rate",value:r.learningRate==null?null:H(r.learningRate)}),e.jsx(L,{label:"Environment executions",value:r.environmentExecutions})]}),x.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Policy metrics",children:x.map(v=>e.jsx("button",{className:v.key===g.key?"active":"",role:"tab",type:"button","aria-selected":v.key===g.key,onClick:()=>h(v.key),children:v.label},v.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[k.length?e.jsx(z,{axisLabel:"Rollout",format:j,label:"Rollout reward",points:k}):null,e.jsx(z,{format:g.format,label:g.label,points:S})]})]}):null]})}const b=a.job.metadata.trainingMethod==="grpo",I=s.flatMap(r=>r.loss==null?[]:[r.loss]),A=s.flatMap(r=>r.learningRate==null?[]:[{step:r.step,value:r.learningRate}]),B=s.flatMap(r=>r.reward==null?[]:[{step:r.step,value:r.reward}]);if(b){const r=a.job.metadata.optimizerUpdatesObserved,v=typeof r=="number"&&Number.isFinite(r)?Math.max(0,r):null;return e.jsx(ce,{learningRatePoints:v==null?A:A.filter(F=>F.step<=v),rewardPoints:v==null?B:B.filter(F=>F.step<=v),rolloutPoints:k})}return e.jsxs("div",{className:"training-run-metrics",children:[e.jsxs("div",{className:"training-metric-summary",children:[e.jsx(L,{label:"Steps",value:m.steps??De(s)}),e.jsx(L,{label:"Final loss",value:m.trainLoss==null?I.at(-1)==null?null:j(I.at(-1)):j(m.trainLoss)}),e.jsx(L,{label:"Peak memory",value:Ge(a.stepMetrics)}),e.jsx(L,{label:"Adapter parameters",value:m.adapterParameterCount==null?null:m.adapterParameterCount.toLocaleString()})]}),i.length?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"training-metric-tabs",role:"tablist","aria-label":"Training metrics",children:i.map(r=>e.jsx("button",{type:"button",role:"tab","aria-selected":r.key===c.key,className:r.key===c.key?"active":"",onClick:()=>o(r.key),children:r.label},r.key))}),e.jsxs("div",{className:"training-metric-chart-grid",children:[e.jsx(z,{label:c.label,points:f,format:c.format}),c.key!=="learningRate"&&A.length?e.jsx(z,{label:"Learning rate",points:A,format:H}):null]})]}):e.jsx("div",{className:"training-run-placeholder",children:"This earlier run recorded its final result but not per-step Trainer logs."})]})}function ce({rewardPoints:a,rolloutPoints:t,learningRatePoints:n}){return e.jsx("div",{className:"training-run-metrics",children:e.jsxs("div",{className:"training-metric-chart-grid three",children:[e.jsx(z,{format:j,label:"Reward",points:a}),e.jsx(z,{axisLabel:"Rollout",format:j,label:"Rollout reward",points:t}),e.jsx(z,{format:H,label:"Learning rate",points:n})]})})}function z({label:a,points:t,format:n,axisLabel:s="Optimizer step"}){return e.jsxs("section",{className:"training-metric-chart-card",children:[e.jsxs("header",{children:[e.jsx("h4",{children:a}),e.jsxs("span",{children:[t.length," ",t.length===1?"point":"points"]})]}),t.length?e.jsx(ze,{axisLabel:s,format:n,label:a,points:t}):e.jsx("div",{className:"training-metric-chart-empty",children:"Not recorded"})]})}function ze({label:a,points:t,format:n,axisLabel:s}){const o={top:20,right:20,bottom:58,left:64},c=t.map(r=>r.value),f=Math.min(...c),p=Math.max(...c),x=p-f||Math.max(Math.abs(p)*.1,1e-9),u=f-x*.08,h=p+x*.08,g=t[0]?.step??0,S=t.at(-1)?.step??g+1,P=Math.max(1,S-g),T=760-o.right,k=r=>t.length===1?(o.left+T)/2:o.left+(r-g)/P*(760-o.left-o.right),m=r=>o.top+(h-r)/(h-u)*(270-o.top-o.bottom),b=t.map((r,v)=>`${v?"L":"M"}${k(r.step).toFixed(2)},${m(r.value).toFixed(2)}`).join(" "),I=270-o.bottom,A=t.length>1?`${b} L${k(S).toFixed(2)},${I} L${k(g).toFixed(2)},${I} Z`:"",B=s!=="Optimizer step"?s:a==="Learning rate"?"Update":"Step";return e.jsx("figure",{className:"training-line-chart","aria-label":`${a} by ${s.toLowerCase()}`,children:e.jsxs("svg",{viewBox:"0 0 760 270",role:"img","aria-labelledby":`metric-${a.replaceAll(" ","-")}`,children:[e.jsx("title",{id:`metric-${a.replaceAll(" ","-")}`,children:`${a} by ${s.toLowerCase()}`}),[0,.25,.5,.75,1].map(r=>{const v=o.top+r*(270-o.top-o.bottom),F=h-r*(h-u);return e.jsxs("g",{children:[e.jsx("line",{className:"training-chart-grid",x1:o.left,x2:760-o.right,y1:v,y2:v}),e.jsx("text",{className:"training-chart-label",x:o.left-10,y:v+4,textAnchor:"end",children:n(F)})]},r)}),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:A}),e.jsx("path",{className:"training-chart-line",d:b}),t.map(r=>e.jsx("circle",{className:"training-chart-point",cx:k(r.step),cy:m(r.value),r:t.length===1?"4.5":"3",children:e.jsx("title",{children:`${B} ${r.step}: ${n(r.value)}`})},`${r.step}-${r.value}`)),e.jsx("text",{className:"training-chart-label",x:k(g),y:236,textAnchor:"middle",children:g}),t.length>1?e.jsx("text",{className:"training-chart-label",x:T,y:236,textAnchor:"middle",children:S}):null,e.jsx("text",{className:"training-chart-label axis-title",x:(o.left+760-o.right)/2,y:261,textAnchor:"middle",children:s})]})})}function Ve(a){return a.flatMap(t=>{if(t.type!=="metric"||t.payload.metricKind!=="rollout_trajectory")return[];const n=de(t.payload.rolloutIndex),s=de(t.payload.reward);return n==null||s==null?[]:[{step:n,value:s}]})}function de(a){return typeof a=="number"&&Number.isFinite(a)?a:null}function L({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("span",{children:a}),e.jsx("strong",{children:t??"Not recorded"})]})}function Oe(a){const t=[...a.events].reverse().find(n=>n.type==="metric"&&n.payload.metricKind!=="sft_step"&&(typeof n.payload.trainLoss=="number"||typeof n.payload.steps=="number"));return Object.fromEntries(Object.entries(t?.payload??{}).filter(n=>typeof n[1]=="number"))}function De(a){const t=a.at(-1);return t?`${t.step} of ${t.maxSteps}`:null}function _e(a){const t=new Map;for(const n of a)t.set(n.step,n);return[...t.values()].sort((n,s)=>n.step-s.step)}function qe(a){const t=new Map;for(const n of a)t.set(n.step,n);return[...t.values()].sort((n,s)=>n.step-s.step)}function Ge(a){const t=a.flatMap(n=>n.memoryBytes==null?[]:[n.memoryBytes]);return t.length?he(Math.max(...t)):null}function j(a){return new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(a)}function H(a){return a===0?"0":a.toExponential(2)}function K(a){return`${(a*100).toFixed(1)}%`}function he(a){return`${(a/1024**3).toFixed(2)} GB`}const He=new Set(["queued","starting","running","cancelling","reconciling"]);function Je(a,t,n){const[s,i]=y.useState(null),[l,o]=y.useState(!1),[c,f]=y.useState(null),p=y.useCallback(async()=>{if(!a||!t)return null;o(!0);try{const x=await fe.trainingRunDetail(a,t);return i(x),f(null),x}catch(x){return f(x instanceof Error?x.message:String(x)),null}finally{o(!1)}},[a,t]);return y.useEffect(()=>{i(null),f(null),!(!a||!t)&&p()},[a,t,p]),y.useEffect(()=>{if(!a||!t||!n||!He.has(n))return;const x=window.setInterval(()=>{p()},2e3);return()=>window.clearInterval(x)},[a,t,n,p]),{detail:s,error:c,loading:l,refresh:p}}function We({title:a,status:t,statusValue:n,versionStatus:s,method:i,baseModel:l,taskset:o,compute:c,duration:f,output:p,reward:x,telemetry:u,evidence:h,configuration:g,children:S,failure:P,onOpenTaskset:T}){const k=u?.cost.providerReportedUsd??u?.cost.estimatedUsd??h?.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:a}),e.jsx(X,{label:t,value:n})]}),e.jsxs("p",{children:[Ye(i)," on ",l]})]})})}),S,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(M,{label:"Training method",value:i}),e.jsx(M,{label:"Base model",value:l}),e.jsx(M,{label:"Compute",value:c}),e.jsx(M,{label:"Output",value:p}),s?e.jsx(M,{label:"Version status",value:s}):null,e.jsx(M,{label:"Duration",value:f}),e.jsx(M,{label:"Run cost",value:k===null?"Not reported":`$${k.toFixed(4)}`}),e.jsx(M,{label:"Final reward",value:x===null?"Not reported":x.toFixed(4)}),g.map(m=>e.jsx(M,{label:m.label,value:m.value},m.label)),u||h?e.jsxs(e.Fragment,{children:[e.jsx(D,{label:"GPU",value:Ke(u,h)}),e.jsx(D,{label:"Tokens",value:`${_(u?.usage.promptTokens??h?.usage.inputTokens??null)} prompt · ${_(u?.usage.generatedTokens??h?.usage.outputTokens??null)} generated`}),e.jsx(D,{label:"Trajectories",value:`${_(u?.usage.successfulTrajectories??h?.reward.eligibleTrajectoryCount??null)} succeeded · ${_(u?.usage.failedTrajectories??(h?h.reward.trajectoryCount-h.reward.eligibleTrajectoryCount:null))} failed`}),e.jsx(D,{label:"Optimizer updates",value:_(u?.usage.optimizerSteps??h?.progress.committedOptimizerSteps??null)}),e.jsx(D,{label:"GPU time",value:u?.usage.gpuSeconds==null?"Not reported":`${u.usage.gpuSeconds.toFixed(1)} seconds`})]}):e.jsx(M,{label:"Resource usage",value:"Not retained for this run"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:T?e.jsxs("button",{className:"labs-run-taskset-link",type:"button",onClick:T,children:[e.jsx("span",{children:o}),e.jsx(ve,{"aria-hidden":"true",size:14})]}):o})]})]})]}),P?e.jsx("p",{className:"labs-training-error",children:P}):null]})}function M({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function D({label:a,value:t}){return e.jsx(M,{label:a,value:t})}function Ke(a,t){const n=a?.resource.gpuCount??t?.resource.gpuCount??null,s=a?.resource.gpuType??t?.resource.gpuType??null;return n===null&&s===null?"Not reported":`${n??"Unknown"} × ${s?Ze(s):"Unreported"}`}function _(a){return a===null?"Not reported":a.toLocaleString()}function Ye(a){return a==="RFT"?"Reinforcement fine-tuning":`${a} training`}function Ze(a){return a.split(" · ").map(t=>t.replaceAll("_"," ").replace(/\b[a-z]/g,n=>n.toUpperCase())).join(" · ")}function Qe({receipt:a,onOpenConversation:t}){return e.jsxs(e.Fragment,{children:[e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Inconclusive benchmark"})}),e.jsx("p",{className:"training-run-placeholder",children:a.reason}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx(N,{label:"Held-out baseline tokens",value:a.usage.baseline.totalTokens.toLocaleString()}),e.jsx(N,{label:"Adaptation baseline tokens",value:a.usage.adaptation.totalTokens.toLocaleString()}),e.jsx(N,{label:"Refiner tokens",value:a.usage.refiner.totalTokens.toLocaleString()}),e.jsx(N,{label:"Grader tokens",value:a.usage.grader.totalTokens.toLocaleString()}),e.jsx(N,{label:"Observed / maximum spend",value:`$${a.budget.observedSpendUsd.toFixed(4)} / $${a.budget.maximumSpendUsd.toFixed(2)}`}),e.jsx(N,{label:"Harness candidate",value:a.stopReason==="candidate_harness_unchanged"?"Unchanged":"Lineage invalid"}),e.jsx(N,{label:"Completed attempts",value:a.attempts.length.toLocaleString()}),e.jsx(N,{label:"Candidate attempts",value:"Skipped"})]})]}),a.attempts.length?e.jsx(xe,{receipt:a,onOpenConversation:t}):null]})}function Xe({run:a}){const t=["baseline","adaptation","refiner","candidate_adaptation","candidate","comparison"],n={baseline:"Baseline",adaptation:"Adaptation",refiner:"Refiner",candidate_adaptation:"Sequential adaptation",candidate:"Candidate",comparison:"Comparison"},s=Math.max(0,t.indexOf(a.evaluationProgress?.stage??"baseline")),i=a.evaluationProgress?.completedAttempts??0,l=a.evaluationProgress?.totalAttempts??1;return e.jsxs("div",{className:"labs-benchmark-progress",children:[e.jsxs("header",{children:[e.jsx("h3",{children:"Benchmark progress"}),e.jsxs("strong",{children:[i," of ",l," attempts"]})]}),e.jsx("div",{className:"labs-benchmark-progress-track","aria-hidden":"true",children:e.jsx("span",{style:{width:`${Math.min(100,i/l*100)}%`}})}),e.jsx("ol",{children:t.map((o,c)=>e.jsxs("li",{className:c<s?"complete":c===s?"active":void 0,children:[e.jsx("span",{}),n[o]]},o))})]})}function ea({receipt:a}){const t=ee(a),n=t.pairs.filter(l=>l.cohort==="held_out"),s=t.pairs.filter(l=>l.cohort==="adaptation"),i=l=>l.length?l.reduce((o,c)=>o+c,0)/l.length:0;return e.jsxs("div",{className:"labs-benchmark-attempt-charts",children:[e.jsx(W,{title:"Held-out tokens by task",baseline:n.map(l=>l.baseline.totalTokens),candidate:n.map(l=>l.refined.totalTokens),format:l=>Math.round(l).toLocaleString()}),e.jsx(W,{title:"Adaptation tokens by task",baseline:s.map(l=>l.baseline.totalTokens),candidate:s.map(l=>l.refined.totalTokens),format:l=>Math.round(l).toLocaleString()}),e.jsx(W,{title:"Held-out quality by task",baseline:n.map(l=>l.baseline.score),candidate:n.map(l=>l.refined.score),format:l=>l.toFixed(2),summarize:i}),e.jsx(W,{title:"Adaptation quality by task",baseline:s.map(l=>l.baseline.score),candidate:s.map(l=>l.refined.score),format:l=>l.toFixed(2),summarize:i})]})}function aa({receipt:a,run:t,tasksetName:n,onOpenTaskset:s}){const i=ee(a),l=i.comparedTaskCount>0,o=i.passed,c=i.tokenDeltaPercent===null?"—":`${i.tokenDeltaPercent>0?"+":""}${i.tokenDeltaPercent.toFixed(2)}%`,f=p=>{const x=i.cohorts[p];return`${x.passedTaskCount}/${x.comparedTaskCount} passed`};return e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:"Token efficiency"})}),l?e.jsxs("div",{className:"labs-benchmark-efficiency-summary",children:[e.jsxs("strong",{children:[i.passedTaskCount," of ",i.comparedTaskCount," tasks passed"]}),e.jsxs("p",{children:["A task passes only when its refined token count is strictly lower than its own baseline. ",i.failedTaskCount," failed this token-efficiency test; aggregate usage changed by ",c,"."]})]}):e.jsx("p",{className:"training-run-placeholder",children:"Paired task-level token evidence is unavailable for this run."}),e.jsxs("dl",{className:"labs-run-detail-list",children:[e.jsx(N,{label:"Execution",value:G(t.status)}),e.jsx(N,{label:"Token-efficiency result",value:o?"Passed":"Failed"}),e.jsx(N,{label:"Efficiency passes",value:`${i.passedTaskCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"Efficiency failures",value:`${i.failedTaskCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"All-task foreground tokens",value:`${i.baselineTokens.toLocaleString()} → ${i.refinedTokens.toLocaleString()}`}),e.jsx(N,{label:"Aggregate token change",value:c}),e.jsx(N,{label:"Adaptation replay",value:f("adaptation")}),e.jsx(N,{label:"Held-out replay",value:f("held_out")}),e.jsx(N,{label:"Task quality",value:`${i.baselinePassedCount}/${i.comparedTaskCount} → ${i.refinedPassedCount}/${i.comparedTaskCount}`}),e.jsx(N,{label:"Result lineage",value:a.lineage.valid?"Valid":"Invalid"}),e.jsxs("div",{children:[e.jsx("dt",{children:"Taskset"}),e.jsx("dd",{children:s?e.jsx("button",{className:"labs-run-taskset-link",type:"button",onClick:s,children:n}):n})]})]})]})}function W({title:a,baseline:t,candidate:n,format:s,summarize:i=l=>l.reduce((o,c)=>o+c,0)}){const l=t.filter(u=>u!==null),o=n.filter(u=>u!==null),c=Math.max(1,...l,...o),f=Math.max(2,t.length,n.length),p=u=>{const h=[];let g=[];return u.forEach((S,P)=>{if(S===null){g.length&&h.push(g.join(" ")),g=[];return}const T=6+P/(f-1)*88,k=44-S/c*36;g.push(`${T},${k}`)}),g.length&&h.push(g.join(" ")),h},x=u=>u.flatMap((h,g)=>h===null?[]:[{x:6+g/(f-1)*88,y:44-h/c*36}]);return e.jsxs("section",{className:"labs-benchmark-line-chart",children:[e.jsxs("header",{children:[e.jsx("h4",{children:a}),e.jsxs("div",{children:[e.jsxs("span",{children:["Baseline ",s(i(l))]}),e.jsxs("span",{children:["Refined ",s(i(o))]})]})]}),e.jsxs("svg",{"aria-label":a,role:"img",viewBox:"0 0 100 50",preserveAspectRatio:"none",children:[e.jsx("line",{x1:"6",x2:"94",y1:"44",y2:"44"}),p(t).map((u,h)=>e.jsx("polyline",{className:"baseline",points:u},`baseline-${h}`)),p(n).map((u,h)=>e.jsx("polyline",{className:"candidate",points:u},`candidate-${h}`)),x(t).map((u,h)=>e.jsx("circle",{className:"baseline",cx:u.x,cy:u.y,r:"1"},`baseline-point-${h}`)),x(n).map((u,h)=>e.jsx("circle",{className:"candidate",cx:u.x,cy:u.y,r:"1"},`candidate-point-${h}`))]})]})}function xe({receipt:a,onOpenConversation:t}){const n=a.schemaVersion==="openpond.modelEvaluationReceipt.v1"?ke(a.attempts??[]):a.attempts??[];return e.jsxs("section",{className:"labs-run-summary-card",children:[e.jsx("header",{children:e.jsx("h3",{children:a.schemaVersion==="openpond.modelEvaluationReceipt.v1"?"Selected task results":"Completed attempts"})}),e.jsx("div",{className:"training-table-wrap",children:e.jsxs("table",{className:"training-data-table labs-benchmark-attempt-table",children:[e.jsx("thead",{children:e.jsxs("tr",{children:[e.jsx("th",{children:"Task"}),e.jsx("th",{children:"Phase"}),e.jsx("th",{children:"Result"}),e.jsx("th",{children:"Score"}),e.jsx("th",{children:"Tokens"}),e.jsx("th",{children:"Work chat"})]})}),e.jsx("tbody",{children:n.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:ta(s.taskId)}),e.jsx("td",{children:s.phase}),e.jsx("td",{children:e.jsx(X,{label:s.passed?"Passed":"Failed",value:s.passed?"succeeded":"failed"})}),e.jsx("td",{children:s.score===null?"—":s.score.toFixed(2)}),e.jsx("td",{children:s.totalTokens.toLocaleString()}),e.jsx("td",{children:s.sessionId?e.jsx("button",{className:"labs-run-taskset-link",type:"button",onClick:()=>t(s.sessionId),children:"Open chat"}):"Not retained"})]},`${s.phase}:${s.attemptId}`))})]})})]})}function ta(a){return a.replace(/^(?:adaptation|frozen)-/,"").replaceAll("-"," ").replace(/^./,t=>t.toUpperCase())}function N({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function Sa({connection:a,selectedEntryKey:t,workproduct:n,runs:s,training:i,onOpenDataset:l,onOpenConversation:o}){const[c,f]=y.useState("artifacts"),p=i.payload,x=y.useMemo(()=>Ne(n,s,p),[s,p,n]),u=y.useMemo(()=>Te(n,s,p),[s,p,n]),h=y.useMemo(()=>Re(n,p),[p,n]),g=y.useMemo(()=>$e(n,s,p),[s,p,n]),S=y.useMemo(()=>new Map(g.map(d=>[d.id,d])),[g]),T=y.useMemo(()=>Se(x,u),[x,u]).find(d=>d.key===t)??null,k=t.startsWith("model-run:")?t.slice(10):null,m=k?h.find(d=>d.id===k)??null:T?.job?h.find(d=>d.id===T.job?.metadata.modelRunId)??null:null,b=T?.job??(m?p?.jobs.find(d=>d.id===m.id||d.metadata.modelRunId===m.id)??null:null),I=y.useMemo(()=>we(x,u,h),[x,h,u]),A=I.findIndex(d=>d.key===t||b!==null&&d.job?.id===b.id||m!==null&&d.lifecycleRun?.id===m.id),B=A<0?null:I.length-A,r=T?.version??(m?.adapterArtifactLineageId?u.find(d=>d.lineage.id===m.adapterArtifactLineageId)??null:null),v=(m?p?.modelVersions.find(d=>d.id===m.modelVersionId)?.baseModel.modelId:null)??p?.modelVersions.filter(d=>d.modelId===n.id&&d.kind==="base_reference").sort((d,ge)=>ge.version-d.version)[0]?.baseModel.modelId??null,F=r?.lineage.frozenEvaluationArtifactId??null,ae=r?.lineage.managedServing??null,V=r?.plan??(b?S.get(b.planId)??null:null),U=r?.taskset??Me(p).find(d=>d.id===(m?.taskset.id??V?.tasksetId))??null,$=Je(a,b?.id??null,b?.status??null),te=b?p?.rolloutReceipts.filter(d=>d.jobId===b.id)??[]:[],w=$.detail?.managedEvidence??null,Y=[{id:"artifacts",label:"Artifacts"},...$.loading||$.detail?.evaluation||F||w?.evaluations.length?[{id:"evaluation",label:"Evaluation"}]:[],...te.length?[{id:"rollouts",label:"Rollouts"}]:[],...ae?[{id:"serving",label:"Serving"}]:[],...b?[{id:"activity",label:"Activity"}]:[]],E=Y.some(d=>d.id===c)?c:Y[0].id;return!T&&!m?e.jsx("div",{className:"labs-model-version-detail",children:e.jsx("div",{className:"training-run-placeholder",children:"This training attempt is no longer available."})}):m?.kind==="evaluation"?e.jsx(na,{run:m,runNumber:B,tasksetName:U?.name??"Unavailable",onOpenTaskset:U?()=>l(U.id):void 0,onOpenConversation:o}):e.jsxs("div",{className:"labs-model-version-detail",children:[e.jsx(We,{baseModel:la(V,v),compute:m?Z(m.destinationId??""):V?Z(V.destinationId):b?Z(b.destinationId):"Not recorded",duration:m?ne(m.startedAt,m.completedAt):b?ne(b.startedAt,b.completedAt):"Not recorded",failure:b?.error??m?.failure??null,configuration:sa(V),evidence:w,method:ye(m?.method??V?.recipe.method),output:r?`Version ${r.number}`:"No version created",reward:m?.reward?.raw??w?.reward.finalMean??null,status:m?G(m.status):b?G(b.status):"Imported",statusValue:m?.status??b?.status??"imported",taskset:U?.name??"Unavailable",telemetry:m?.receipt?.schemaVersion==="openpond.modelRunReceipt.v1"?m.receipt.telemetry:null,title:m||b?B?`Run ${B}`:"Run details":r?`Version ${r.number}`:"Run details",versionStatus:r?r.current?"Active":"Available":null,onOpenTaskset:U?()=>l(U.id):void 0,children:b?e.jsx(Ue,{detail:$.detail,error:$.error,loading:$.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:Y.map(d=>e.jsx("button",{"aria-controls":`run-detail-panel-${d.id}`,"aria-selected":E===d.id,className:E===d.id?"active":void 0,id:`run-detail-tab-${d.id}`,role:"tab",type:"button",onClick:()=>f(d.id),children:d.label},d.id))}),e.jsxs("div",{"aria-labelledby":`run-detail-tab-${E}`,className:"labs-run-detail-tab-panel",id:`run-detail-panel-${E}`,role:"tabpanel",children:[E==="artifacts"?e.jsxs("dl",{className:"training-configuration-list",children:[e.jsx(R,{label:"Training attempt",value:b?.id??"Provider import"}),e.jsx(R,{label:"Taskset",value:U?.name??"Unavailable"}),e.jsx(R,{label:"Prepared data",value:b?.bundleHash??"Provider managed"}),e.jsx(R,{label:"Version ID",value:r?.lineage.id??"No version created"}),w?.checkpoint?e.jsxs(e.Fragment,{children:[e.jsx(R,{label:"Checkpoint",value:w.checkpoint.id}),e.jsx(R,{label:"Checkpoint size",value:w.checkpoint.sizeBytes==null?"Not reported":be(w.checkpoint.sizeBytes)}),e.jsx(R,{label:"Checkpoint hash",value:w.checkpoint.sha256??"Not reported"})]}):null,w?.canonicalPublication.state?e.jsx(R,{label:"Registry publication",value:Q(w.canonicalPublication.state)}):null]}):null,E==="evaluation"?e.jsxs("div",{className:"training-run-evaluation",children:[$.loading||$.detail?.evaluation?e.jsx(Ae,{detail:$.detail,loading:$.loading}):null,!$.detail?.evaluation&&w?.evaluations.length?e.jsx("dl",{className:"labs-inline-facts",children:w.evaluations.map(d=>e.jsx(R,{label:d.kind==="baseline"?"Baseline score":"Candidate score",value:d.score==null?"Not reported":d.score.toFixed(6)},`${d.kind}:${d.policyVersion}`))}):null,F?e.jsx("button",{className:"training-button secondary",type:"button",onClick:()=>{i.actions.downloadArtifact(F)},children:"Download evaluation receipt"}):null]}):null,E==="rollouts"?e.jsx(Le,{receipts:te}):null,E==="serving"?e.jsx(ra,{projection:ae}):null,E==="activity"&&b?e.jsx(ia,{error:b.error??$.error,events:$.detail?.events??[],loading:$.loading}):null]})]})]})}function na({run:a,runNumber:t,tasksetName:n,onOpenTaskset:s,onOpenConversation:i}){const l=a.receipt?.schemaVersion==="openpond.modelEvaluationReceipt.v1"?a.receipt:null,o=a.receipt?.schemaVersion==="openpond.modelEvaluationStopReceipt.v1"?a.receipt:null,c=l?Ce(l):null,f=l?ee(l):null;return e.jsxs("div",{className:"labs-model-version-detail labs-model-evaluation-detail",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?`Run ${t}`:"Evaluation run"}),e.jsx(X,{label:l?f?.comparedTaskCount?`${f.passedTaskCount}/${f.comparedTaskCount} passed`:"No paired result":o?"Inconclusive":G(a.status),value:l?f?.comparedTaskCount&&f.passed?"succeeded":"neutral":o?.terminalClassification??a.status})]}),e.jsxs("p",{children:["Harness Refiner benchmark · ",n,l||o?` · execution ${G(a.status).toLowerCase()}`:""]})]})})}),l?e.jsxs(e.Fragment,{children:[e.jsx(le,{series:[{id:"baseline",label:"Held-out baseline",inputTokens:c.baseline.inputTokens,outputTokens:c.baseline.outputTokens,tokens:c.baseline.totalTokens,passRate:l.quality.baselinePassRate,costUsd:c.baseline.costUsd},{id:"candidate",label:"Held-out refined",inputTokens:c.candidate.inputTokens,outputTokens:c.candidate.outputTokens,tokens:c.candidate.totalTokens,passRate:l.quality.candidatePassRate,costUsd:c.candidate.costUsd}]}),e.jsx(le,{series:[{id:"adaptation-baseline",label:"Adaptation baseline",inputTokens:c.adaptation.inputTokens,outputTokens:c.adaptation.outputTokens,tokens:c.adaptation.totalTokens,passRate:l.quality.adaptationBaselinePassRate,costUsd:c.adaptation.costUsd},{id:"adaptation-candidate",label:"Adaptation replay",inputTokens:c.candidate_adaptation.inputTokens,outputTokens:c.candidate_adaptation.outputTokens,tokens:c.candidate_adaptation.totalTokens,passRate:l.quality.adaptationCandidatePassRate,costUsd:c.candidate_adaptation.costUsd}]}),(l.attempts??[]).length?e.jsx(ea,{receipt:l}):null,e.jsx(aa,{receipt:l,run:a,tasksetName:n,onOpenTaskset:s}),(l.attempts??[]).length?e.jsx(xe,{receipt:l,onOpenConversation:i}):null]}):o?e.jsx(Qe,{receipt:o,onOpenConversation:i}):e.jsx("section",{className:"labs-run-summary-card",children:a.failure?e.jsx("p",{className:"training-run-placeholder",children:a.failure}):e.jsx(Xe,{run:a})})]})}function la(a,t=null){if(!a)return t?ue(t):"Not recorded";const n=a.recipe.method==="sft"||a.recipe.method==="grpo"?a.recipe.baseModel:a.recipe.method==="dpo"?a.recipe.policyModel:a.recipe.method==="ppo"?a.recipe.policyOptimization.policyModel:null;return n?ue(n.id):"Not recorded"}function ue(a){return a.split("/").at(-1)??a}function sa(a){if(!a)return[];const t=a.recipe;return t.method==="grpo"?[{label:"LoRA rank",value:String(t.lora.rank)},{label:"Learning rate",value:me(t.optimizer.learningRate)},{label:"Optimizer steps",value:String(t.optimizer.maxSteps)},{label:"Rollouts per update",value:String(t.rollout.groupSize)},{label:"Rollout concurrency",value:String(t.rollout.concurrency)},{label:"Max output tokens",value:t.rollout.maxOutputTokens.toLocaleString()},{label:"Temperature",value:String(t.rollout.temperature)},{label:"Top P",value:String(t.rollout.topP)}]:t.method==="sft"||t.method==="dpo"?[{label:"LoRA rank",value:String(t.lora.rank)},{label:"Learning rate",value:me(t.optimizer.learningRate)},{label:"Optimizer steps",value:String(t.optimizer.maxSteps)}]:[]}function me(a){return a===0?"0":a.toExponential(2)}function be(a){const t=["B","KB","MB","GB","TB"];let n=a,s=0;for(;n>=1024&&s<t.length-1;)n/=1024,s+=1;return`${n.toFixed(s===0?0:2)} ${t[s]}`}function R({label:a,value:t}){return e.jsxs("div",{children:[e.jsx("dt",{children:a}),e.jsx("dd",{children:t})]})}function ra({projection:a}){return a?e.jsxs("dl",{className:"labs-inline-facts",children:[e.jsx(R,{label:"Admission",value:a.customerBindingAllowed?"Allowed":"Pending"}),e.jsx(R,{label:"Artifact",value:Q(a.canonicalArtifactState)}),e.jsx(R,{label:"Deployment",value:Q(a.canonicalDeploymentState)}),e.jsx(R,{label:"Base profile",value:a.baseProfileId??"Pending"}),e.jsx(R,{label:"Last synchronized",value:pe(a.lastSyncedAt)}),a.lastError?e.jsx(R,{label:"Synchronization",value:a.lastError}):null]}):null}function Q(a){return a?a.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase()):"Pending"}function ia({error:a,events:t,loading:n}){return n&&!t.length?e.jsx("div",{className:"training-run-placeholder",children:"Loading run events…"}):t.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:[t.map(s=>e.jsxs("tr",{children:[e.jsx("td",{children:pe(s.timestamp)}),e.jsx("td",{children:oa(s.type)}),e.jsx("td",{children:ca(s)})]},s.id)),a?e.jsxs("tr",{children:[e.jsx("td",{children:"Not available"}),e.jsx("td",{children:"Failure"}),e.jsx("td",{children:a})]}):null]})]})}):e.jsx("div",{className:"training-run-placeholder",children:a??"No normalized run events were recorded."})}function oa(a){return a.replaceAll("_"," ").replace(/^./,t=>t.toUpperCase())}function ca(a){const t=a.payload,n=O(t.step),s=O(t.maxSteps);if(a.type==="start")return typeof t.device=="string"?`Worker started on ${t.device}.`:"Worker started.";if(a.type==="progress"&&n!=null)return s==null?`Step ${n}.`:`Step ${n} of ${s}.`;if(a.type==="metric"){const i=typeof t.metricKind=="string"?t.metricKind.replaceAll("_"," "):"metric",l=[q("loss",t.loss),q("reward",t.meanReward??t.reward),q("policy loss",t.policyLoss),q("value loss",t.valueLoss),q("preference accuracy",t.preferenceAccuracy,da)].filter(o=>!!o);return`${i}${n==null?"":` · step ${n}`}${l.length?` · ${l.join(" · ")}`:""}`}if(a.type==="checkpoint"){const i=O(t.policyVersion),l=O(t.sizeBytes),o=[i==null?null:`policy ${i}`,l==null?null:be(l),t.final===!0?"final":null].filter(c=>!!c);return o.length?`Checkpoint committed · ${o.join(" · ")}.`:"Checkpoint committed."}if(a.type==="complete"){const i=O(t.artifactCount);return i==null?"Worker completed.":`Worker completed with ${i} artifacts.`}return a.type==="failure"&&typeof t.message=="string"?t.message:Object.keys(t).length?JSON.stringify(t):"Recorded."}function q(a,t,n=s=>new Intl.NumberFormat(void 0,{maximumFractionDigits:4}).format(s)){const s=O(t);return s==null?null:`${a} ${n(s)}`}function O(a){return typeof a=="number"&&Number.isFinite(a)?a:null}function da(a){return`${(a*100).toFixed(1)}%`}export{Sa as LabModelVersionDetailPage};
@@ -1 +1 @@
1
- import{r as n,p as g,j as e,a0 as z,X as y,aS as w,i as L}from"./index-BO2W2U23.js";import{M as C,F}from"./MarkdownText-gwAue4u5.js";import{I as k}from"./MainPane-CuhwxMxg.js";import"./cloud-upload-COReKxOy.js";import"./arrow-up-right-DYGSWA2J.js";import"./square-DAGpFfSr.js";import"./folder-open-9OjGqNgP.js";function G({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(C,{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:$(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 $(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(L,{size:14}):e.jsx(F,{size:14})}function B(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}export{G as LabSkillSidebar};
1
+ import{r as n,p as g,j as e,a0 as z,X as y,aS as w,i as L}from"./index-LrGasYyx.js";import{M as C,F}from"./MarkdownText-R3MC5S30.js";import{I as k}from"./MainPane-CQCLhV5C.js";import"./cloud-upload-D6bS8rS2.js";import"./arrow-up-right-BDcNd1rt.js";import"./square-B5q2aneb.js";import"./folder-open-8C5l7A93.js";function G({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(C,{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:$(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 $(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(L,{size:14}):e.jsx(F,{size:14})}function B(a){return a<1024?`${a} B`:a<1048576?`${(a/1024).toFixed(1)} KB`:`${(a/1048576).toFixed(1)} MB`}export{G as LabSkillSidebar};