Push Bot commited on
Commit
9535a4e
Β·
1 Parent(s): 0176918

Fix SyntaxError; simplify debug; stage repo zip; make packages.txt empty

Browse files
Files changed (1) hide show
  1. app.py +30 -1
app.py CHANGED
@@ -1367,6 +1367,24 @@ def debug_compile_uploaded_zip(zip_file):
1367
 
1368
  def debug_compile_output_zip():
1369
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1370
  logs = [f"🐞 Debug(real) at {_now_str()}"]
1371
  zip_path = ROOT / "output.zip"
1372
  if not zip_path.exists():
@@ -1478,7 +1496,18 @@ def debug_compile_last_pipeline_zip():
1478
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
1479
  last_zip = _find_last_pipeline_zip()
1480
  if not last_zip:
1481
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
1482
 
1483
  # Prepare workspace
1484
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
1367
 
1368
  def debug_compile_output_zip():
1369
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
1370
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
1371
+ zip_path = ROOT / "output.zip"
1372
+ if not zip_path.exists():
1373
+ return (
1374
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
1375
+ + f"<div>Expected at: {zip_path}</div>"
1376
+ )
1377
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
1378
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
1379
+ try:
1380
+ shutil.copy2(zip_path, ZIP_PATH)
1381
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
1382
+ _write_logs(LOG_PATH, logs)
1383
+ except Exception as e:
1384
+ logs.append(f"❌ Failed staging output.zip: {e}")
1385
+ _write_logs(LOG_PATH, logs)
1386
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
1387
+ return debug_compile_last_pipeline_zip()
1388
  logs = [f"🐞 Debug(real) at {_now_str()}"]
1389
  zip_path = ROOT / "output.zip"
1390
  if not zip_path.exists():
 
1496
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
1497
  last_zip = _find_last_pipeline_zip()
1498
  if not last_zip:
1499
+ repo_zip = ROOT / "output.zip"
1500
+ if repo_zip.exists():
1501
+ try:
1502
+ _, W, L, Z = _prepare_workspace(logs)
1503
+ shutil.copy2(repo_zip, Z)
1504
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
1505
+ last_zip = Z
1506
+ except Exception as e:
1507
+ logs.append(f"❌ Auto-stage failed: {e}")
1508
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
1509
+ else:
1510
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
1511
 
1512
  # Prepare workspace
1513
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)