Upload 8 files
Browse files- web/static/runs.js +7 -3
web/static/runs.js
CHANGED
|
@@ -1328,7 +1328,9 @@ function deriveRunDocuments(detail={}){
|
|
| 1328 |
const reportText=String(detail.report||'');
|
| 1329 |
const summary=detail.summary||{};
|
| 1330 |
const blockers=detail.technical_blockers||{};
|
| 1331 |
-
const status=String(summary.status||detail.state?.status||detail.status||'').toLowerCase();
|
|
|
|
|
|
|
| 1332 |
const shouldShowBlockers=Boolean(Object.keys(blockers).length)||status.includes('manual')||status.includes('blocker')||status.includes('failed')||status.includes('error');
|
| 1333 |
const byId=new Map(docs.map(d=>[d.id,{...d}]));
|
| 1334 |
const traceDocState=(prefix,doc)=>{
|
|
@@ -1344,11 +1346,13 @@ function deriveRunDocuments(detail={}){
|
|
| 1344 |
const redactedTrace=traceDocState('traces/redacted',byId.get('pi_redacted_trace'));
|
| 1345 |
byId.get('pi_redacted_trace').present=redactedTrace.present;
|
| 1346 |
byId.get('pi_redacted_trace').url=redactedTrace.url;
|
| 1347 |
-
byId.get('report').present=Boolean((byId.get('report').present&&byId.get('report').url)||reportText.length||filePaths.has('report.md'));
|
|
|
|
| 1348 |
// Legacy invariant: filePaths.has('generation_smoke.json') remains covered by firstKnownPath below.
|
| 1349 |
const smokePath=firstKnownPath(['tests/generation_smoke.json','tests/generation_smoke_latest.json','generation_smoke.json','tests/test_result.json']);
|
| 1350 |
-
byId.get('smoke').present=Boolean((byId.get('smoke').present&&byId.get('smoke').url)||Object.keys(detail.generation_smoke||{}).length||Boolean(smokePath));
|
| 1351 |
if(smokePath)retargetDocUrl(byId.get('smoke'),smokePath);
|
|
|
|
| 1352 |
if(byId.has('smoke_output')){
|
| 1353 |
const outputPath=firstKnownPath(['artifacts/image.webp','artifacts/image.png','artifacts/image.jpg','artifacts/image.jpeg','artifacts/output.png','artifacts/output.webp','artifacts/output.json']);
|
| 1354 |
const hasOutput=Boolean(outputPath)||hasPrefix('artifacts');
|
|
|
|
| 1328 |
const reportText=String(detail.report||'');
|
| 1329 |
const summary=detail.summary||{};
|
| 1330 |
const blockers=detail.technical_blockers||{};
|
| 1331 |
+
const status=String(summary.status||detail.final_status_reconciliation?.status||detail.state?.status||detail.status||'').toLowerCase();
|
| 1332 |
+
const finalStatus=String(detail.final_status_reconciliation?.status||summary.final_status||summary.status||detail.state?.status||'').toLowerCase();
|
| 1333 |
+
const terminalFullSuccess=['full_inference_success','success','succeeded','completed','done'].includes(finalStatus)||detail.generation_smoke?.status==='success'||detail.generation_smoke?.ok===true||summary.generation_smoke_passed===true||detail.final_status_reconciliation?.generation_smoke_passed===true;
|
| 1334 |
const shouldShowBlockers=Boolean(Object.keys(blockers).length)||status.includes('manual')||status.includes('blocker')||status.includes('failed')||status.includes('error');
|
| 1335 |
const byId=new Map(docs.map(d=>[d.id,{...d}]));
|
| 1336 |
const traceDocState=(prefix,doc)=>{
|
|
|
|
| 1346 |
const redactedTrace=traceDocState('traces/redacted',byId.get('pi_redacted_trace'));
|
| 1347 |
byId.get('pi_redacted_trace').present=redactedTrace.present;
|
| 1348 |
byId.get('pi_redacted_trace').url=redactedTrace.url;
|
| 1349 |
+
byId.get('report').present=Boolean((byId.get('report').present&&byId.get('report').url)||reportText.length||filePaths.has('report.md')||terminalFullSuccess);
|
| 1350 |
+
if(terminalFullSuccess&&!byId.get('report').url)retargetDocUrl(byId.get('report'),'report.md');
|
| 1351 |
// Legacy invariant: filePaths.has('generation_smoke.json') remains covered by firstKnownPath below.
|
| 1352 |
const smokePath=firstKnownPath(['tests/generation_smoke.json','tests/generation_smoke_latest.json','generation_smoke.json','tests/test_result.json']);
|
| 1353 |
+
byId.get('smoke').present=Boolean((byId.get('smoke').present&&byId.get('smoke').url)||Object.keys(detail.generation_smoke||{}).length||Boolean(smokePath)||terminalFullSuccess);
|
| 1354 |
if(smokePath)retargetDocUrl(byId.get('smoke'),smokePath);
|
| 1355 |
+
else if(terminalFullSuccess)retargetDocUrl(byId.get('smoke'),'tests/generation_smoke.json');
|
| 1356 |
if(byId.has('smoke_output')){
|
| 1357 |
const outputPath=firstKnownPath(['artifacts/image.webp','artifacts/image.png','artifacts/image.jpg','artifacts/image.jpeg','artifacts/output.png','artifacts/output.webp','artifacts/output.json']);
|
| 1358 |
const hasOutput=Boolean(outputPath)||hasPrefix('artifacts');
|