Push Bot commited on
Commit
63c0bef
Β·
1 Parent(s): 63e7414

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
@@ -3451,6 +3451,24 @@ def debug_compile_uploaded_zip(zip_file):
3451
 
3452
  def debug_compile_output_zip():
3453
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3454
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3455
  zip_path = ROOT / "output.zip"
3456
  if not zip_path.exists():
@@ -3562,7 +3580,18 @@ def debug_compile_last_pipeline_zip():
3562
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3563
  last_zip = _find_last_pipeline_zip()
3564
  if not last_zip:
3565
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
3566
 
3567
  # Prepare workspace
3568
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
3451
 
3452
  def debug_compile_output_zip():
3453
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
3454
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
3455
+ zip_path = ROOT / "output.zip"
3456
+ if not zip_path.exists():
3457
+ return (
3458
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
3459
+ + f"<div>Expected at: {zip_path}</div>"
3460
+ )
3461
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
3462
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
3463
+ try:
3464
+ shutil.copy2(zip_path, ZIP_PATH)
3465
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
3466
+ _write_logs(LOG_PATH, logs)
3467
+ except Exception as e:
3468
+ logs.append(f"❌ Failed staging output.zip: {e}")
3469
+ _write_logs(LOG_PATH, logs)
3470
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
3471
+ return debug_compile_last_pipeline_zip()
3472
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3473
  zip_path = ROOT / "output.zip"
3474
  if not zip_path.exists():
 
3580
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3581
  last_zip = _find_last_pipeline_zip()
3582
  if not last_zip:
3583
+ repo_zip = ROOT / "output.zip"
3584
+ if repo_zip.exists():
3585
+ try:
3586
+ _, W, L, Z = _prepare_workspace(logs)
3587
+ shutil.copy2(repo_zip, Z)
3588
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
3589
+ last_zip = Z
3590
+ except Exception as e:
3591
+ logs.append(f"❌ Auto-stage failed: {e}")
3592
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
3593
+ else:
3594
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
3595
 
3596
  # Prepare workspace
3597
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)