Push Bot commited on
Commit
fb4b7b1
Β·
1 Parent(s): 7453a49

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
@@ -2187,6 +2187,24 @@ def debug_compile_uploaded_zip(zip_file):
2187
 
2188
  def debug_compile_output_zip():
2189
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2190
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2191
  zip_path = ROOT / "output.zip"
2192
  if not zip_path.exists():
@@ -2298,7 +2316,18 @@ def debug_compile_last_pipeline_zip():
2298
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2299
  last_zip = _find_last_pipeline_zip()
2300
  if not last_zip:
2301
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
2302
 
2303
  # Prepare workspace
2304
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
2187
 
2188
  def debug_compile_output_zip():
2189
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
2190
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
2191
+ zip_path = ROOT / "output.zip"
2192
+ if not zip_path.exists():
2193
+ return (
2194
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
2195
+ + f"<div>Expected at: {zip_path}</div>"
2196
+ )
2197
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
2198
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
2199
+ try:
2200
+ shutil.copy2(zip_path, ZIP_PATH)
2201
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
2202
+ _write_logs(LOG_PATH, logs)
2203
+ except Exception as e:
2204
+ logs.append(f"❌ Failed staging output.zip: {e}")
2205
+ _write_logs(LOG_PATH, logs)
2206
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
2207
+ return debug_compile_last_pipeline_zip()
2208
  logs = [f"🐞 Debug(real) at {_now_str()}"]
2209
  zip_path = ROOT / "output.zip"
2210
  if not zip_path.exists():
 
2316
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
2317
  last_zip = _find_last_pipeline_zip()
2318
  if not last_zip:
2319
+ repo_zip = ROOT / "output.zip"
2320
+ if repo_zip.exists():
2321
+ try:
2322
+ _, W, L, Z = _prepare_workspace(logs)
2323
+ shutil.copy2(repo_zip, Z)
2324
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
2325
+ last_zip = Z
2326
+ except Exception as e:
2327
+ logs.append(f"❌ Auto-stage failed: {e}")
2328
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
2329
+ else:
2330
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
2331
 
2332
  # Prepare workspace
2333
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)