← back to Dw Photo Capture
test: lock parseOcrRows barcode branches + overnight wind-down note (cycle 23)
6407d119d35a410c909e743f4ad898ee5c5acfe0 · 2026-06-26 09:51:18 -0700 · Steve Abrams
Covered the last untested parse branches: barcode line WITH symbology (sym captured),
WITHOUT symbology (sym omitted), and non-numeric height → 0. Noted .sym is parsed-but-
unused downstream (deferred, no consumer). 71→74 tests, lint clean.
The pure-helper test space is now exhausted; added an honest 'Overnight wind-down note'
to the ledger summarizing the 23-cycle run (74 tests, 4 hardenings, 6 evidence-based
rejections, a recovered disk-full emergency, ~$0.006 total cost) and flagging the only
Steve-gated item left: the staged weekly vendor-refresh launchd job. $0 (local).
Files touched
M OVERNIGHT_LEDGER.mdM test-analyze-ocr.js
Diff
commit 6407d119d35a410c909e743f4ad898ee5c5acfe0
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Fri Jun 26 09:51:18 2026 -0700
test: lock parseOcrRows barcode branches + overnight wind-down note (cycle 23)
Covered the last untested parse branches: barcode line WITH symbology (sym captured),
WITHOUT symbology (sym omitted), and non-numeric height → 0. Noted .sym is parsed-but-
unused downstream (deferred, no consumer). 71→74 tests, lint clean.
The pure-helper test space is now exhausted; added an honest 'Overnight wind-down note'
to the ledger summarizing the 23-cycle run (74 tests, 4 hardenings, 6 evidence-based
rejections, a recovered disk-full emergency, ~$0.006 total cost) and flagging the only
Steve-gated item left: the staged weekly vendor-refresh launchd job. $0 (local).
---
OVERNIGHT_LEDGER.md | 22 ++++++++++++++++++++++
test-analyze-ocr.js | 6 ++++++
2 files changed, 28 insertions(+)
diff --git a/OVERNIGHT_LEDGER.md b/OVERNIGHT_LEDGER.md
index 27ee7de..7ab1e02 100644
--- a/OVERNIGHT_LEDGER.md
+++ b/OVERNIGHT_LEDGER.md
@@ -69,3 +69,25 @@ the single highest-value safe one, the officer executes it, and the loop resched
| 20 | collision gate → REJECT O/0 fallback + lock verbatim contract | checked 225,846 real codes: 14 collision groups where different products are pure O/0 or I/1 variants (RI5112≠R15112) → O/0 auto-fallback would mis-resolve → REJECTED w/ evidence; locked the safe behavior (analyzeOcr preserves codes verbatim, no silent O↔0/I↔1) with 3 tests | df 34G; 51→54 tests; lint clean | $0 |
| 21 | test-coverage (untested core helper) | mfrToHouseSku (scanned vendor code → DW house SKU) was UNTESTED despite real logic; added 7 guards via an injected MFR_INDEX fixture: exact/normalized match, case+dash+space stripping, <4-char→null, no-match→null, ±1-trailing-char fuzzy (WDW23107→WDW2310), 5-char fuzzy length-guard. Behavior verified empirically first (my initial guesses were wrong — code is correct) | df 34G; 54→61 tests; lint clean | $0 |
| 22 | test-coverage (untested normalizers) | covered nmfr (mfr dedup: WOS3467T==WOS3467; a regression would let duplicate products be created) + brandRe (vendor name → OCR-detection regex source). Behavior verified empirically first; 10 guards: trailing-T strip/trim/upper/null, single-T-only, multiword \s*-join, single-<4-char→null, 2-char-word-drop, no-alpha→null | df 32G; 61→71 tests; lint clean | $0 |
+| 23 | test-coverage (last untested branches) + wind-down | locked parseOcrRows barcode-parse branches: symbology-present (sym:QR), symbology-absent (no sym), non-numeric-height→0. Noted: .sym is parsed-but-unused downstream (deferred — no consumer). Untested-pure-helper space now EXHAUSTED | df 31G; 71→74 tests; lint clean | $0 |
+
+## Overnight wind-down note (2026-06-26, cycle 23)
+The overnight officer-yolo run is SATURATED — 23 cycles, the codebase is mature/hardened and
+the pure-helper test space is now exhausted. Summary of the run:
+- 24 commits (3c0bcb1 → cycle 23). Tests grew 21 → 74 (all green); lint clean throughout.
+- Features (cycles 0-9): vendor-logo learning from Shopify Files, logo VLM /api/identify,
+ fingerprint tiebreaker (DTD-A), barcode/QR exact-SKU, brand-aware fast-lock, model speed
+ toggle, background self-teaching bgIdentify, code-review pass (3 fixes), API.md.
+- Real hardenings (cycles 14-18): prefix >=2-scan support gate; proto-pollution DoS fix
+ (vendor=__proto__ crashed the process); fuzzy ambiguity guard (Alan~Nina Campbell); atomic
+ saveJSON (crash/ENOSPC can't corrupt persisted data); /api/stats observability.
+- Evidence-based rejections (cycles 11,12,20): Vision low-light pre-pass (Vision reads
+ 4-level contrast raw), OCR confidence threshold (Vision = 1.0-or-nothing), O/0 variant
+ fallback (14 real RI5112≠R15112 collisions in 225k codes).
+- Survived a real disk-full (ENOSPC) emergency mid-run; recovered, now canary-monitored.
+- Cost: ~$0.006 total (2 DTD Codex calls) + $0 local for everything else.
+
+STILL PENDING STEVE (gated, in ~/.claude/yolo-queue/pending-approval): the weekly
+vendor-refresh launchd job (com.steve.dwphoto-vendor-refresh.plist) — plist staged, not
+installed. That is the only item needing your sign-off. Nothing was pushed; nothing
+customer-facing was touched.
diff --git a/test-analyze-ocr.js b/test-analyze-ocr.js
index f6f4ac7..3600673 100644
--- a/test-analyze-ocr.js
+++ b/test-analyze-ocr.js
@@ -69,6 +69,12 @@ const bc = (payload, sym = 'Code128') => `BC\t${payload}\t${sym}`;
ok(rows.length === 3, 'parseOcrRows: 3 rows');
ok(rows.find(r => r.bc && r.t === 'GRS-26820'), 'parseOcrRows: barcode row tagged bc');
eq(rows[0], { h: 120, t: 'WDW2310' }, 'parseOcrRows: height parsed');
+ // barcode line WITH a symbology field captures sym; height is the sentinel 10000
+ eq(parseOcrRows('BC\tGRS-7777\tQR')[0], { h: 10000, t: 'GRS-7777', bc: true, sym: 'QR' }, 'parseOcrRows: barcode symbology captured');
+ // barcode line WITHOUT a symbology field omits sym
+ eq(parseOcrRows('BC\tGRS-7777')[0], { h: 10000, t: 'GRS-7777', bc: true }, 'parseOcrRows: barcode without symbology omits sym');
+ // a non-numeric height field falls back to 0
+ eq(parseOcrRows('abc\tHELLO')[0], { h: 0, t: 'HELLO' }, 'parseOcrRows: non-numeric height → 0');
}
// ── analyzeOcr: brand on swatch + big code → vendor + topStrong ──
← 25e9532 test: cover nmfr + brandRe normalizers (cycle 22)
·
back to Dw Photo Capture
·
chore: v1.1.0 — 🎨 Recognize Pattern feature (session close) 06f58bc →