← back to Wallco Ai
data/yolo-overnight/frame-overlay-20260525-2350.md
103 lines
# Frame-Overlay Triage — `data/frame-overlay-scan-flagged.jsonl`
**When**: 2026-05-25 (PT)
**Input**: `/root/public-projects/wallco-ai/data/frame-overlay-scan-flagged.jsonl` (2,521 lines, last 200 reviewed)
**Status**: **DO NOT RUN `fix-frame-overlay.js --batch`** — see findings.
---
## TL;DR
The flagged JSONL is **>99.7% stale**. Of 2,521 flagged designs:
- **5** still in `designs.json` (all `is_published=false`, `damask`/`mixed`)
- **7** still in `spoon_all_designs` (5 overlap above + 2 vendor seeds in a *different* repo)
- **PNG-on-disk via the designs.json path**: works for the 5 survivors. **PG `local_path` is broken** (points to `/Users/stevestudio2/...` — Steve's Mac).
- `data/generated/` has **39,686 PNGs**, but PG has only **341 rows** (`212 published, 14 removed`). The scan was run against an old catalog snapshot.
- Quarantine + backup dirs are heavy: `generated_ghost_quarantine/`=6,546, `generated_pre_seamless_backup/`=1,748. Many flagged designs likely moved there in a prior sweep.
The batch fixer would fail on ~2,514/2,521 ids the moment `pgLocalPath()` returns null.
---
## Random sample (5 of 200, seed=0xCAFEBEEF)
| id | category | confidence | source@scan | in designs.json now? | in PG now? | PNG resolvable? |
|---:|----------|-----------:|-------------|----------------------|------------|------------------|
| 32796 | chinoiserie · bordeaux-velvet | 0.90 | json | NO | NO | NO |
| 28360 | muybridge-plate · deep-plum | 0.90 | json | NO | NO | NO |
| 33373 | designer-zoo-calm | 0.90 | json | NO | NO | NO |
| 30082 | muybridge-plate | 0.95 | json | NO | NO | NO |
| 26029 | muybridge-plate · deep-plum | 0.95 | json | NO | NO | NO |
5/5 untouchable. None have a path the fixer can use.
## The 5 designs that *do* still resolve
All `is_published=false`, so they aren't customer-facing. Reasons from scan (Gemini Flash):
| id | category | PNG (data/generated/) |
|---:|----------|----------------------|
| 31 | damask | 1778543234953_386152567.png |
| 50 | damask | 1778550285656_1438445289.png |
| 60 | damask | 1778551180233_656430717.png |
| 63 | damask | 1778551227159_1460330882.png |
| 69 | mixed | 1778555003161_1405845871.png |
Two extra PG-only rows (135 dolce-gabbana, 136 designer-wallcoverings) live in `/root/public-projects/thesetdecorator/...` — these are vendor-seed JPGs, **out of scope** for `fix-frame-overlay.js` (it only targets local generated PNGs in this repo and skips vendor categories).
---
## Bugs discovered in `scripts/fix-frame-overlay.js`
1. **`psql` call has no auth** (line ~67): `spawnSync('psql', ['-d', 'dw_unified', ...])`. On this Linux box, `dw_admin` needs `PGPASSWORD=«REDACTED-DB-PW» psql -h 127.0.0.1 -U dw_admin`. Today it silently returns `null` and the fixer reports "local_path missing".
2. **PG paths are Mac-prefixed** (`/Users/stevestudio2/Projects/wallco-ai/data/generated/...`). Even when auth is fixed, `fs.existsSync()` will fail. Needs a translator: `s|^/Users/stevestudio2/Projects/wallco-ai/|/root/public-projects/wallco-ai/|`.
3. **Single-source resolver**: fix-frame-overlay only consults PG. `scan-frame-overlay` also resolves via `designs.json` → `data/generated/`. Fix script should mirror that fallback so `source=json` rows are reachable.
---
## 5 Candidate Fixes (need Steve's approval)
### 1. Re-scan first, fix nothing yet *(recommended)*
- Run `node scripts/scan-frame-overlay.js --source both` against the current 341-row PG + 276-entry `designs.json`.
- Estimated cost: 341 × ~$0.0005 (single-vote) ≈ **$0.17**, or ~$0.51 stable-3-vote.
- Output to new `frame-overlay-scan-flagged-v2-20260525.jsonl`; archive the stale file as `frame-overlay-scan-flagged.pre-2026-05-25.jsonl`.
- **Why**: the current JSONL is operationally dead. Reflagging against live catalog is cheaper than reasoning about which 2,521 are gone.
### 2. Triage / split the stale JSONL (no Gemini calls)
- Filter `frame-overlay-scan-flagged.jsonl` against `designs.json` ids + `spoon_all_designs.id`.
- Write resolvable rows → `frame-overlay-scan-flagged.live.jsonl` (≈7 rows).
- Write the rest → `frame-overlay-scan-flagged.archived-stale.jsonl` (≈2,514 rows).
- Zero API cost; pure file split.
- **Why**: keeps a clean working file without invoking Gemini. Pairs well with #1.
### 3. Patch `scripts/fix-frame-overlay.js` portability
- Replace `pgLocalPath()` with the same dual resolver `scan-frame-overlay` uses (PG + designs.json), plus the Mac→Linux path translator.
- Use `PGPASSWORD + -h 127.0.0.1 -U dw_admin` from `/root/.env`.
- Smoke-test on the 5 surviving ids (31, 50, 60, 63, 69) with `--dry-run`.
- **Why**: even if today's batch is dead, the script needs to work on Linux before the next scan.
### 4. Manual-review the 5 survivors (cheap, safe)
- Copy the 5 PNGs into `data/yolo-overnight/frame-overlay-samples-20260525/` for Steve's eyes.
- Decide per-design: quarantine to `generated_ghost_quarantine/` (they're all unpublished damask/mixed), mark `user_removed=true`, or run the patched fixer.
- **Why**: 5 unpublished designs are not worth a Gemini fix. A human-eye + soft-delete is faster and cheaper.
### 5. Cross-check `generated_ghost_quarantine` for the missing 2,514
- Many flagged designs may already be quarantined from a prior ghost-purge sweep. If true, no further action is needed for those ids — just confirm.
- Pure read: list quarantine PNG filenames, join against `designs.json` for the flagged ids (where image_url is known), report overlap.
- **Why**: tells us whether the stale JSONL represents *work already done* (great) or *work that vanished without trace* (concerning).
---
## Recommendation
Do **2 → 5 → 4 → 3 → 1** in that order:
1. Split the file (no cost, no risk).
2. Confirm prior quarantine sweep accounts for most of the 2,514 (no cost).
3. Eyeball the 5 survivors and soft-quarantine if obvious defects.
4. Patch the fixer for Linux + dual-resolver.
5. Only then run a fresh scan — and it'll be cheap because the live catalog is 341 rows, not 39,686.
**Do NOT run** `node scripts/fix-frame-overlay.js --batch` on the existing JSONL. It will iterate 2,521 entries, fail `pgLocalPath` on 2,514, and produce nothing but log spam.