Push Bot commited on
Commit
b6bec6c
Β·
1 Parent(s): 5cd4b13

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
@@ -3135,6 +3135,24 @@ def debug_compile_uploaded_zip(zip_file):
3135
 
3136
  def debug_compile_output_zip():
3137
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3138
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3139
  zip_path = ROOT / "output.zip"
3140
  if not zip_path.exists():
@@ -3246,7 +3264,18 @@ def debug_compile_last_pipeline_zip():
3246
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3247
  last_zip = _find_last_pipeline_zip()
3248
  if not last_zip:
3249
- return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
 
 
 
 
 
 
 
 
 
 
 
3250
 
3251
  # Prepare workspace
3252
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)
 
3135
 
3136
  def debug_compile_output_zip():
3137
  """Compile the repo-root output.zip (a real LaTeX project) and preview the resulting PDF."""
3138
+ # Stage repo output.zip to runs/<id>/output.zip to follow pipeline layout, then delegate
3139
+ zip_path = ROOT / "output.zip"
3140
+ if not zip_path.exists():
3141
+ return (
3142
+ "<div style='color:#b00'><b>output.zip not found at repo root.</b></div>"
3143
+ + f"<div>Expected at: {zip_path}</div>"
3144
+ )
3145
+ logs = [f"🐞 Stage(repo zip) at {_now_str()}"]
3146
+ _, WORK_DIR, LOG_PATH, ZIP_PATH = _prepare_workspace(logs)
3147
+ try:
3148
+ shutil.copy2(zip_path, ZIP_PATH)
3149
+ logs.append(f"πŸ“¦ Staged repo output.zip β†’ runs/{WORK_DIR.name}/output.zip")
3150
+ _write_logs(LOG_PATH, logs)
3151
+ except Exception as e:
3152
+ logs.append(f"❌ Failed staging output.zip: {e}")
3153
+ _write_logs(LOG_PATH, logs)
3154
+ return "<div style='color:#b00'>Failed to stage output.zip</div>"
3155
+ return debug_compile_last_pipeline_zip()
3156
  logs = [f"🐞 Debug(real) at {_now_str()}"]
3157
  zip_path = ROOT / "output.zip"
3158
  if not zip_path.exists():
 
3264
  logs = [f"🐞 Debug(last-pipeline-zip) at {_now_str()}"]
3265
  last_zip = _find_last_pipeline_zip()
3266
  if not last_zip:
3267
+ repo_zip = ROOT / "output.zip"
3268
+ if repo_zip.exists():
3269
+ try:
3270
+ _, W, L, Z = _prepare_workspace(logs)
3271
+ shutil.copy2(repo_zip, Z)
3272
+ logs.append(f"πŸ“¦ Auto-staged repo output.zip β†’ runs/{W.name}/output.zip")
3273
+ last_zip = Z
3274
+ except Exception as e:
3275
+ logs.append(f"❌ Auto-stage failed: {e}")
3276
+ return "<div style='color:#b00'>No recent pipeline output.zip found and auto-stage failed.</div>"
3277
+ else:
3278
+ return "<div style='color:#b00'>No recent pipeline output.zip found under runs/.</div>"
3279
 
3280
  # Prepare workspace
3281
  run_id, WORK_DIR, LOG_PATH, _ = _prepare_workspace(logs)