R3.2.8.6-R1.3C-KK1-R2 English Pane Purity and Premature Stream Retry

#33
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ core/__pycache__/pipeline_agent.cpython-313.pyc filter=lfs diff=lfs merge=lfs -text
__pycache__/config.cpython-313.pyc ADDED
Binary file (31.9 kB). View file
 
__pycache__/desktop.ini ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [.ShellClassInfo]
2
+ IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
app.py CHANGED
@@ -833,7 +833,9 @@ def _render_checkpoint_preview(task: dict, lang_code: str) -> None:
833
  checkpoint = _load_confirmed_checkpoint(task)
834
  english = str((checkpoint or {}).get("full_draft_en") or "").strip()
835
  target = str((checkpoint or {}).get("full_draft_translated") or "").strip()
836
- english_initial = english if english else tr(lang_code, "draft_preparing")
 
 
837
  target_initial = target if target else tr(lang_code, "translation_waiting")
838
  english_placeholder = "0" if english else "1"
839
  target_placeholder = "0" if target else "1"
@@ -842,6 +844,7 @@ def _render_checkpoint_preview(task: dict, lang_code: str) -> None:
842
  st.markdown(tr(lang_code, "english_draft"))
843
  st.markdown(
844
  f"""
 
845
  <div id='sp-live-manuscript-shell' style='border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;min-height:220px;max-height:68vh;overflow:auto;background:#ffffff;'>
846
  <div id='sp-live-manuscript-preview' data-sp-placeholder='{english_placeholder}' style='white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit;line-height:1.72;color:#111827;'>{html.escape(english_initial)}</div>
847
  <span id='sp-live-manuscript-cursor' aria-hidden='true' style='display:inline-block;width:7px;height:1.05em;background:#111827;margin-left:2px;vertical-align:-0.12em;animation:spBlink 1s steps(1,end) infinite;'></span>
 
833
  checkpoint = _load_confirmed_checkpoint(task)
834
  english = str((checkpoint or {}).get("full_draft_en") or "").strip()
835
  target = str((checkpoint or {}).get("full_draft_translated") or "").strip()
836
+ english_initial = english
837
+ english_status_initial = "" if english else tr(lang_code, "draft_preparing")
838
+ english_status_display = "none" if english else "block"
839
  target_initial = target if target else tr(lang_code, "translation_waiting")
840
  english_placeholder = "0" if english else "1"
841
  target_placeholder = "0" if target else "1"
 
844
  st.markdown(tr(lang_code, "english_draft"))
845
  st.markdown(
846
  f"""
847
+ <div id='sp-live-manuscript-status' style='white-space:pre-wrap;font-size:0.88em;opacity:0.72;margin:0 0 8px 0;display:{english_status_display};'>{html.escape(english_status_initial)}</div>
848
  <div id='sp-live-manuscript-shell' style='border:1px solid #e5e7eb;border-radius:8px;padding:14px 16px;min-height:220px;max-height:68vh;overflow:auto;background:#ffffff;'>
849
  <div id='sp-live-manuscript-preview' data-sp-placeholder='{english_placeholder}' style='white-space:pre-wrap;overflow-wrap:anywhere;margin:0;font-family:inherit;line-height:1.72;color:#111827;'>{html.escape(english_initial)}</div>
850
  <span id='sp-live-manuscript-cursor' aria-hidden='true' style='display:inline-block;width:7px;height:1.05em;background:#111827;margin-left:2px;vertical-align:-0.12em;animation:spBlink 1s steps(1,end) infinite;'></span>
core/__pycache__/desktop.ini ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [.ShellClassInfo]
2
+ IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
core/__pycache__/pipeline_agent.cpython-313.pyc ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a90da19681e8a85bd4cdc0aecee7b5b7606689033265841355cca8cf564e2392
3
+ size 303484
core/__pycache__/production_guard.cpython-313.pyc ADDED
Binary file (29.5 kB). View file
 
core/pipeline_agent.py CHANGED
@@ -1071,6 +1071,7 @@ class SSciPipelineAgent:
1071
  except (
1072
  requests.exceptions.Timeout,
1073
  requests.exceptions.ConnectionError,
 
1074
  requests.exceptions.HTTPError,
1075
  DeepSeekAPIError,
1076
  ) as exc:
 
1071
  except (
1072
  requests.exceptions.Timeout,
1073
  requests.exceptions.ConnectionError,
1074
+ requests.exceptions.ChunkedEncodingError,
1075
  requests.exceptions.HTTPError,
1076
  DeepSeekAPIError,
1077
  ) as exc:
smartpaper_restore_bridge/frontend/index.html CHANGED
@@ -316,9 +316,14 @@
316
  }
317
 
318
  function updateDraftPreparation(parentDocument, node, labels, task=null) {
319
- const target = parentDocument.getElementById("sp-live-manuscript-preview");
320
  const channel = renderChannels.english;
321
- if (!target || channel.authoritative || target.querySelector("[data-sp-live-stream='1']")) return;
 
 
 
 
 
322
  const map = labels && typeof labels === "object" ? labels : {};
323
  const progress = Math.max(0, Math.min(100, asCount(task && task.progress_pct)));
324
  const s2 = asCount(task && task.s2_calls);
@@ -331,8 +336,8 @@
331
  if (map.oa) lines.push(formatTemplate(map.oa, {count:oa}));
332
  const value = lines.filter(Boolean).join("\n");
333
  if (!value) return;
334
- target.dataset.spPlaceholder = "1";
335
- target.textContent = value;
336
  }
337
 
338
  function ensureTargetStatusNode(parentDocument) {
@@ -540,6 +545,11 @@
540
  const targetText = String(payload && payload.target_text || "");
541
  if (englishText && englishText !== lastPreviewText) {
542
  updateOnePreview(parentDocument, parentWindow, "sp-live-manuscript-preview", "sp-live-manuscript-shell", englishText, renderChannels.english);
 
 
 
 
 
543
  lastPreviewText = englishText;
544
  }
545
  if (targetText && targetText !== lastTargetPreviewText) {
 
316
  }
317
 
318
  function updateDraftPreparation(parentDocument, node, labels, task=null) {
319
+ const status = parentDocument.getElementById("sp-live-manuscript-status");
320
  const channel = renderChannels.english;
321
+ if (!status) return;
322
+ if (channel.authoritative) {
323
+ status.textContent = "";
324
+ status.style.display = "none";
325
+ return;
326
+ }
327
  const map = labels && typeof labels === "object" ? labels : {};
328
  const progress = Math.max(0, Math.min(100, asCount(task && task.progress_pct)));
329
  const s2 = asCount(task && task.s2_calls);
 
336
  if (map.oa) lines.push(formatTemplate(map.oa, {count:oa}));
337
  const value = lines.filter(Boolean).join("\n");
338
  if (!value) return;
339
+ status.textContent = value;
340
+ status.style.display = "block";
341
  }
342
 
343
  function ensureTargetStatusNode(parentDocument) {
 
545
  const targetText = String(payload && payload.target_text || "");
546
  if (englishText && englishText !== lastPreviewText) {
547
  updateOnePreview(parentDocument, parentWindow, "sp-live-manuscript-preview", "sp-live-manuscript-shell", englishText, renderChannels.english);
548
+ const englishStatus = parentDocument.getElementById("sp-live-manuscript-status");
549
+ if (englishStatus) {
550
+ englishStatus.textContent = "";
551
+ englishStatus.style.display = "none";
552
+ }
553
  lastPreviewText = englishText;
554
  }
555
  if (targetText && targetText !== lastTargetPreviewText) {
utils/__pycache__/desktop.ini ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [.ShellClassInfo]
2
+ IconResource=C:\Program Files\Google\Drive File Stream\129.0.1.0\GoogleDriveFS.exe,27
utils/__pycache__/docx_builder.cpython-313.pyc ADDED
Binary file (10.3 kB). View file