Pointf5ive commited on
Commit
9f024f9
·
1 Parent(s): 16b10a3

Add Smoke Signal diagnostic audit trail and bug report template

Browse files
README.md CHANGED
@@ -11,3 +11,8 @@ pinned: false
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
14
+
15
+ ## Smoke Signal Ops
16
+
17
+ - Diagnostic audit trail: `smoke_signal/manifest/DIAGNOSTIC_AUDIT_TRAIL.md`
18
+ - Bug report template: `smoke_signal/manifest/BUG_REPORT_TEMPLATE.md`
smoke_signal/manifest/BUG_REPORT_TEMPLATE.md ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Smoke Signal — Bug Report Template
2
+
3
+ Use this template when filing Smoke Signal issues.
4
+
5
+ ## Summary
6
+
7
+ - Date/time:
8
+ - Reporter:
9
+ - Space URL:
10
+ - Runtime SHA:
11
+ - Stage affected: `ingest` | `profile` | `ocr` | `review` | `export`
12
+ - Severity: `low` | `medium` | `high` | `blocking`
13
+
14
+ ## What Happened
15
+
16
+ - Expected behavior:
17
+ - Actual behavior:
18
+ - First visible symptom:
19
+
20
+ ## Reproduction
21
+
22
+ 1.
23
+ 2.
24
+ 3.
25
+
26
+ ## Evidence
27
+
28
+ - Screenshot(s):
29
+ - Step log excerpt (first 20 lines):
30
+ - Browser + version:
31
+ - Rights class used:
32
+ - Test book ID:
33
+
34
+ ## Runtime State
35
+
36
+ - `/api/spaces/.../runtime` stage:
37
+ - `/api/spaces/.../runtime` sha:
38
+ - Was fallback expected? `yes` | `no`
39
+ - If OCR: did log show `using Tesseract fallback for this run`? `yes` | `no`
40
+
41
+ ## Impact
42
+
43
+ - Affected users:
44
+ - Data integrity risk: `none` | `possible` | `confirmed`
45
+ - Rights/compliance risk: `none` | `possible` | `confirmed`
46
+
47
+ ## Cross-Reference
48
+
49
+ - Related audit entry in `DIAGNOSTIC_AUDIT_TRAIL.md`:
50
+ - Related commit(s):
51
+ - Related issue ticket:
52
+
smoke_signal/manifest/DIAGNOSTIC_AUDIT_TRAIL.md ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Smoke Signal — Diagnostic Audit Trail
2
+
3
+ **Last updated:** 2026-05-16
4
+ **Scope:** Production fixes applied to Space `Pointf5ive/Codex_Extractor` during Gradio/OCR stabilization.
5
+
6
+ ## Purpose
7
+
8
+ This file is the canonical incident and remediation trail for Smoke Signal runtime behavior.
9
+ Use it for bug reports, regression checks, and release notes.
10
+
11
+ ## Runtime Context
12
+
13
+ - Space: `https://huggingface.co/spaces/Pointf5ive/Codex_Extractor`
14
+ - Python runtime target: `3.12`
15
+ - UI runtime: Gradio 6.x compatible path
16
+ - OCR engines: Surya (primary), Tesseract (fallback)
17
+ - Data root: `/tmp/smoke_signal`
18
+
19
+ ## Change Timeline
20
+
21
+ | Local time (Europe/London) | Commit | Area | Symptom Observed | Root Cause | Fix Applied | Verification Signal |
22
+ |---|---|---|---|---|---|---|
23
+ | 2026-05-16 12:30 | `c4147bf` | UI startup | Smoke Signal tab hang on load | Blocking `wizard.load` + SSR interaction | Removed blocking load path | Tab can open without startup lock |
24
+ | 2026-05-16 12:38 | `9556658` | Gradio compat | Runtime crash on app launch | Gradio API changes (`css/head`, image arg) | Moved `css/head` usage + removed deprecated image arg | Space builds and serves tab |
25
+ | 2026-05-16 13:05 | `776da0b` | Dependency policy | Breakage risk across Gradio majors | Unpinned major updates | Pinned Gradio to `<7`, removed deprecated flags | Predictable runtime behavior |
26
+ | 2026-05-16 13:27 | `600390b` | Dependency | Silent failures in workbook paths | Missing `openpyxl` | Added `openpyxl` to requirements | Excel-dependent flows stop failing |
27
+ | 2026-05-16 14:38 | `894f8d5` | Queue/startup | Tabs unresponsive at startup | Blocking `demo.load` path | Removed startup blocking load call | Tabs interactive immediately |
28
+ | 2026-05-16 14:44 | `2f1780f` | Event handlers | Gradio deprecation drift | Deprecated `queue=False` handler args | Removed legacy queue flags | Handlers register cleanly |
29
+ | 2026-05-16 15:36 | `1ae819d` | Storage | Write failures on Space filesystem | Non-writable target paths | Moved operational state under `/tmp/smoke_signal` | Pipeline writes succeed in Space |
30
+ | 2026-05-16 15:50 | `2d9935c` | OCR diagnostics | OCR step gave low observability | Sparse logging | Added debug output in OCR stage | Operator sees gating context in logs |
31
+ | 2026-05-16 16:01 | `6233ead` | Ingest/rights | Rights edits blocked by duplicate uploads | Missing update path for existing rows | Added rights update behavior/UI | Rights corrections available post-upload |
32
+ | 2026-05-16 16:44 | `e31e277` | Review UX | Missing page images after restart | `/tmp` cleanup removed rendered crops | Added on-demand re-render for review page images | Review image recovers after restart |
33
+ | 2026-05-16 16:55 | `db859e4` | Governance diagnostics | Confusing OCR skip cases | Rights/status gating not explicit enough | Added rights/status gate diagnostics | Clear skip reasons in log |
34
+ | 2026-05-16 17:03 | `6c9e2c1` | Runtime + shell | Sidebar/dashboard shell regressions | Compatibility drift + render shell timing | Restored compatibility + dashboard shell behavior | Left navigation shell visible |
35
+ | 2026-05-16 17:18 | `be1ecc2` | Surya integration | `No module named 'surya.ocr'` fallback | Surya API changed in newer package versions | Added dual API support (predictor-v2 + legacy-v1) | Surya import path no longer hard-fails |
36
+ | 2026-05-16 17:46 | `ad64790` | OCR performance | OCR perceived as frozen / very slow | Per-page model calls + repeated PDF opens + no progress | Added model reuse, batched OCR, one-open-per-book, live progress | OCR logs and progress move during run |
37
+ | 2026-05-16 17:53 | `8c23eee` | OCR reliability | Long stalls before fallback activation | Surya load could block run path | Added Surya load timeout + background load + Tesseract run fallback | Fallback path no longer waits indefinitely |
38
+ | 2026-05-16 18:16 | `16b10a3` | Fallback correctness | Fallback still stalled in practice | Fallback batches had missing image load path | Fixed Tesseract batch image loading + render/OCR progress separation | OCR advances under fallback mode |
39
+
40
+ ## Current OCR Safeguards
41
+
42
+ - Surya runtime is loaded once and reused when available.
43
+ - Surya load timeout is enforced (`SS_SURYA_LOAD_TIMEOUT_SEC`, default `20`).
44
+ - If Surya is not ready in time, run continues with Tesseract.
45
+ - If a Surya batch fails, that batch retries via Tesseract.
46
+ - OCR run progress is split into render phase and OCR phase for visibility.
47
+
48
+ ## Active Runtime Knobs
49
+
50
+ - `SS_SURYA_BATCH_SIZE` (default `4`)
51
+ - `SS_SURYA_LOAD_TIMEOUT_SEC` (default `20`)
52
+ - `SS_RENDER_DPI_SURYA` (default `300`)
53
+ - `SS_RENDER_DPI_FALLBACK` (default `220`)
54
+
55
+ ## Release Validation Checklist
56
+
57
+ Run this before closing any OCR incident:
58
+
59
+ 1. Confirm Space runtime shows latest commit SHA in API/runtime panel.
60
+ 2. Open Smoke Signal tab and verify tabs remain responsive.
61
+ 3. Run Step 3 OCR once and confirm progress text moves beyond `Preparing OCR run...`.
62
+ 4. Confirm one of these appears in log:
63
+ - `Surya models loaded (...)`
64
+ - `using Tesseract fallback for this run`
65
+ 5. Confirm output file exists for test book:
66
+ - `ocr_raw/<BOOK_ID>/<BOOK_ID>_ocr_raw.json`
67
+
68
+ ## Known Operational Risk
69
+
70
+ - Hugging Face runtime can temporarily stick on older SHA during `RUNNING_APP_STARTING`.
71
+ - If this happens, perform a controlled pause/restart cycle and re-check runtime SHA before testing behavior.
72
+