Push Bot commited on
Commit
56e3376
Β·
1 Parent(s): 02c0a6e

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
@@ -2788,6 +2788,24 @@ def debug_compile_uploaded_zip(zip_file):
2788
 
2789
  def debug_compile_output_zip():
2790
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2791
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2792
  zip_path = ROOT / "output.zip"
2793
  if not zip_path.exists():
@@ -2899,7 +2917,18 @@ def debug_compile_last_pipeline_zip():
2899
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2900
  last_zip = _find_last_pipeline_zip()
2901
  if not last_zip:
2902
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
2903
 
2904
  # Prepare workspace
2905
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
2788
 
2789
  def debug_compile_output_zip():
2790
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
2791
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
2792
+ zip_path = ROOT / "output.zip"
2793
+ if not zip_path.exists():
2794
+ return (
2795
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
2796
+ + f"<div>Expected at: {zip_path}</div>"
2797
+ )
2798
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
2799
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
2800
+ try:
2801
+ shutil.copy2(zip_path, ZIP_PATH)
2802
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
2803
+ _write_logs(LOG_PATH, logs)
2804
+ except Exception as e:
2805
+ logs.append(f"❌ Failed staging output.zip: {e}")
2806
+ _write_logs(LOG_PATH, logs)
2807
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
2808
+ return debug_compile_last_pipeline_zip()
2809
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2810
  zip_path = ROOT / "output.zip"
2811
  if not zip_path.exists():
 
2917
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2918
  last_zip = _find_last_pipeline_zip()
2919
  if not last_zip:
2920
+ repo_zip = ROOT / "output.zip"
2921
+ if repo_zip.exists():
2922
+ try:
2923
+ _, W, L, Z = _prepare_workspace(logs)
2924
+ shutil.copy2(repo_zip, Z)
2925
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
2926
+ last_zip = Z
2927
+ except Exception as e:
2928
+ logs.append(f"❌ Auto-stage failed: {e}")
2929
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
2930
+ else:
2931
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
2932
 
2933
  # Prepare workspace
2934
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)