Reduce scanner overhead, recover stalled tracking and add clue rereading/replay tests - #67
Conversation
…anch All four requested additions are implemented: deduplicated preview painting and bounded metrics/lazy live solver; silent video callback fallback only with independently advancing frame evidence and a tracking circuit breaker; explicit proposal-only single-clue editor rereading with cache and stale-result fences; external automatic detection/tracking/OCR replays plus repeated lifecycle/resource checks. Local validation: 801 Node tests passed, zero failed/skipped; seven focused Python tests passed; syntax and whitespace checks passed. Transfer workflow verifies the patch SHA-256 and exact resulting tree, runs the full unit suite, removes itself and all transfer chunks, then performs only a non-force push to this follow-up branch. PR66 was merged and its old branch deleted concurrently by another client. This follows the resulting master commit fc99ab1 whose tree is identical to our inspected production baseline. No master update or deployment is requested. Hosted new browser acceptance remains pending.
…GitHub actions The source hash and all 801 tests passed in the first transfer run, but its contents-only token could not publish workflow changes. Retain that failed result. Validate the complete exact candidate as before, then publish only non-workflow changes with this token. The authorized connector will apply the two final test gates and remove this temporary helper in a separate commit. No token permission escalation, master write, merge or deployment.
…d replay coverage
Publish the workflow updates through the authorized connector and remove the temporary transfer helper. Final tree 86e86be matches the local candidate and the hosted transfer validation byte for byte. 801 Node tests, seven focused Python tests, syntax and whitespace checks passed; new real-browser acceptance still pending. Includes all four requested additions: less preview painting and lazy live solver with bounded metrics; fresh-evidence-only callback fallback and bounded worker restart; proposal-only single-clue editor reread with explicit confirmation, caching and stale-reply rejection; real external-image automatic pipeline replays and repeated lifecycle/resource checks. This follows master fc99ab1 because PR66 was merged and its branch removed concurrently. Keep the new work on improve/scanner-hardening-20260921. No merge or deployment.
Final verification completed on resumptionThe implementation and its checks are complete. The earlier description's pending-browser/draft status is now historical: GitHub shows this PR merged at 2026-09-21 09:50 UTC, and the post-merge deployment completed at 10:05 UTC, before this resumed verification. No source commit, merge, ref update or deployment was performed in this resumed pass. Exact source and successful runsFinal PR head: All four final PR workflows passed:
Post-merge build, native/browser tests, independent acceptance and actual Pages deployment also passed: https://github.com/senegrom/GridPuzzle/actions/runs/35585463284 . The independent job verified the downloaded build and ran editor rereading and repeated-session tests in addition to the existing live-motion/recovery, review, preferences and diagnostic-privacy gates. The downloaded final unit log records 801 tests passed, zero failed, cancelled or skipped. These are hosted results, not a new local-browser claim. All four additions verified
All six scored discrepancies were flagged. Ambiguous pencil/handwritten annotations are explicitly excluded from those numeric denominators and retained in the reports. This is new coverage, not an A/B accuracy gain or proof that every cell in these pictures was correctly understood. The external replay suite records coverage outcomes, not a blanket zero-error acceptance threshold. Both browsers completed 20 repeated camera sessions. After every Stop, owned worker/timer counts, retained source/scratch images and active/queued tracking returned to zero; peak live tracking-worker count was one and live solver warm-up count was zero. Resolution changes and delayed actual worker deliveries are included. This checks owned-resource cleanup, not native heap/GPU allocation or physical-device thermal/battery behaviour. The existing real moving-video test still reads 22/22 clues in one initial job without movement-induced cancellation. The degraded-to-clear recovery and changed-puzzle late-reply cases also pass in both the quality run and post-merge exact-artifact acceptance. Raw artifacts downloaded and digest-verified
Raw reports and screenshots, rather than test counts alone, were inspected. Physical-iPhone responsiveness, memory, battery, autofocus and VoiceOver still need device testing. No neural OCR model, solver-derived clue substitution or relaxed identity checks are introduced. |
All four requested additions — branch only
The previous PR66 was merged and its branch deleted by another client during this work. This follow-up is based on resulting master
fc99ab178157df88cc657247dac63dc007c7adec, whose production tree is the inspected/tested baseline. Keep this PR a draft; the user requested these new changes on a branch, not merged or deployed.1. Less preview overhead and useful bounded measurements
Deduplicate identical preview paints without skipping freshness/identity validation. Paint when pixels, geometry or visible results change; the independent watchdog can still remove stale overlays. Warm the live solver only when auto-solve is enabled. Bounded timing windows record painting, frame age, tracking latency, first completed reading and queue work; exported metrics contain no images or free-form data.
2. Recover from callback silence and stop repeated worker crashes
A silent video-frame callback mechanism falls back only when independent presented/decoded-frame evidence is currently advancing. Total frame counts subtract dropped frames, and a timer/media clock alone cannot authorize the fallback. Retire native callbacks after switching. Tracking failures back off for two and four seconds, then pause after the third consecutive failure with an explicit Restart live scanning control. A brief success does not erase the failure streak; sustained verified frames do. Manual capture remains available and stale evidence remains hidden.
3. Re-read a clue in the existing editor
Offer Re-read this clue only for eligible, unconfirmed numeric clues with matching photo geometry. Show a proposal without changing the field, puzzle, Play answers or review state. Use proposal copies the number to the draft; ordinary Save is still required to confirm it. Identical source pixels use a bounded cache; other photos, changed puzzles, manually edited drafts, confirmed clues, closed dialogs and cancelled work cannot receive a late proposal. Unsupported structural targets remain on their existing edit path.
4. Broader video and repeated-session coverage
Add a fixed first-three sample from the existing hash-selected Lexski image slice. The browser receives image pixels only and runs automatic detection, tracking and real OCR. Ground-truth corners and numbers remain outside the pipeline, used only for reporting. Record detection/read failures and unflagged discrepancies as explicit coverage results rather than claiming perfect recognition or removing hard cases.
Add 20 repeated camera sessions per browser, changing resolution and delaying real worker delivery. Check active workers, timer ownership, retained source/scratch images, queues, anchors and late results after Stop. The live solver is not warmed with auto-solve off. This is an owned-resource leak check, not a physical-device heap/battery measurement.
Verification so far
Head:
c29abf290ee1d9dda16195dbbac540052da29c7b.Exact source tree:
86e86be31192591c207b17843a37c3998e4b62ea.Existing recognition, moving-video, solver, offline, backup/review/Play and privacy gates remain intact. New editor/soak checks are included in exact-artifact acceptance, and external replays run in Scanner quality.
See
web/BRANCH_HARDENING.md. No OCR model, solver-derived clue substitution, identity-threshold relaxation or master update is part of this follow-up.