Push Bot commited on
Commit
e69584b
Β·
1 Parent(s): a459a0d

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
@@ -3484,6 +3484,24 @@ def debug_compile_uploaded_zip(zip_file):
3484
 
3485
  def debug_compile_output_zip():
3486
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3487
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3488
  zip_path = ROOT / "output.zip"
3489
  if not zip_path.exists():
@@ -3595,7 +3613,18 @@ def debug_compile_last_pipeline_zip():
3595
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3596
  last_zip = _find_last_pipeline_zip()
3597
  if not last_zip:
3598
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
3599
 
3600
  # Prepare workspace
3601
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
3484
 
3485
  def debug_compile_output_zip():
3486
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
3487
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
3488
+ zip_path = ROOT / "output.zip"
3489
+ if not zip_path.exists():
3490
+ return (
3491
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
3492
+ + f"<div>Expected at: {zip_path}</div>"
3493
+ )
3494
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
3495
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
3496
+ try:
3497
+ shutil.copy2(zip_path, ZIP_PATH)
3498
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
3499
+ _write_logs(LOG_PATH, logs)
3500
+ except Exception as e:
3501
+ logs.append(f"❌ Failed staging output.zip: {e}")
3502
+ _write_logs(LOG_PATH, logs)
3503
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
3504
+ return debug_compile_last_pipeline_zip()
3505
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3506
  zip_path = ROOT / "output.zip"
3507
  if not zip_path.exists():
 
3613
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3614
  last_zip = _find_last_pipeline_zip()
3615
  if not last_zip:
3616
+ repo_zip = ROOT / "output.zip"
3617
+ if repo_zip.exists():
3618
+ try:
3619
+ _, W, L, Z = _prepare_workspace(logs)
3620
+ shutil.copy2(repo_zip, Z)
3621
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
3622
+ last_zip = Z
3623
+ except Exception as e:
3624
+ logs.append(f"❌ Auto-stage failed: {e}")
3625
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
3626
+ else:
3627
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
3628
 
3629
  # Prepare workspace
3630
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)