Push Bot commited on
Commit
fec4387
Β·
1 Parent(s): 448fbdc

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
@@ -2440,6 +2440,24 @@ def debug_compile_uploaded_zip(zip_file):
2440
 
2441
  def debug_compile_output_zip():
2442
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2443
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2444
  zip_path = ROOT / "output.zip"
2445
  if not zip_path.exists():
@@ -2551,7 +2569,18 @@ def debug_compile_last_pipeline_zip():
2551
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2552
  last_zip = _find_last_pipeline_zip()
2553
  if not last_zip:
2554
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
2555
 
2556
  # Prepare workspace
2557
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
2440
 
2441
  def debug_compile_output_zip():
2442
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
2443
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
2444
+ zip_path = ROOT / "output.zip"
2445
+ if not zip_path.exists():
2446
+ return (
2447
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
2448
+ + f"<div>Expected at: {zip_path}</div>"
2449
+ )
2450
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
2451
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
2452
+ try:
2453
+ shutil.copy2(zip_path, ZIP_PATH)
2454
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
2455
+ _write_logs(LOG_PATH, logs)
2456
+ except Exception as e:
2457
+ logs.append(f"❌ Failed staging output.zip: {e}")
2458
+ _write_logs(LOG_PATH, logs)
2459
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
2460
+ return debug_compile_last_pipeline_zip()
2461
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2462
  zip_path = ROOT / "output.zip"
2463
  if not zip_path.exists():
 
2569
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2570
  last_zip = _find_last_pipeline_zip()
2571
  if not last_zip:
2572
+ repo_zip = ROOT / "output.zip"
2573
+ if repo_zip.exists():
2574
+ try:
2575
+ _, W, L, Z = _prepare_workspace(logs)
2576
+ shutil.copy2(repo_zip, Z)
2577
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
2578
+ last_zip = Z
2579
+ except Exception as e:
2580
+ logs.append(f"❌ Auto-stage failed: {e}")
2581
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
2582
+ else:
2583
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
2584
 
2585
  # Prepare workspace
2586
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)