← back to Tk11438 Postgres Migration

verification/residual-sweep-2026-09-17/RESTORE-MAP.md

50 lines

# TK-11438 residual sweep — 2026-09-17 — RESTORE MAP

Executed by: sledgehammer lane-3 subagent (openclaw). Scope: local+reversible file edits only.
No service restarts, no PM2 changes, no TCP shutdown, no email, no canonical DB writes.
Live state at execution: zero TCP clients on Postgres (pg_stat_activity + lsof :5432 both empty);
all PM2 services already restarted 2026-09-17T15:03 by fleet owner; shared vendor-requests.js
modules in all 25 projects verified already socket-form (`PGHOST || (darwin ? '/tmp' : '127.0.0.1')`).

## What was changed (8 files, 3 buckets)

### Bucket A — .env runtime configs (untracked; backups ARE the rollback)
| File | Change | Backup |
|---|---|---|
| /Users/macstudio3/Projects/dw-boardroom-governance/.env | `@127.0.0.1:5432/dw_unified` → `@localhost/dw_unified?host=/tmp` | .env.bak-tk11438-20260917-165818 (same dir) |
| /Users/macstudio3/Projects/archive-agent/.archive-agent.env | same | .archive-agent.env.bak-tk11438-20260917-165819 |
| /Users/macstudio3/Projects/sister-parish-onboarding/.env | same | .env.bak-tk11438-20260917-165819 |

Restore: `cp <file>.bak-tk11438-* <file>` (creds preserved byte-identical; env baks chmod 600).

### Bucket B — in-git CLI fallback strings (rollback = git revert / checkout)
| Repo | File(s) | Commit | Old → New |
|---|---|---|---|
| sku-check-skill | server.js | 4749456 | `postgresql://dw_admin@127.0.0.1:5432/dw_unified` → `postgresql://dw_admin@localhost/dw_unified?host=/tmp` |
| Bertha | kalshi-dash/server.js (2 lines: bertha_betting + dw_unified), src/lib/db.js, react-dash/server.js | ce85d99 | same shape per DB |
| SDCC-Stories | server.js | 2dfaf8b | `@127.0.0.1:5432/sdcc` → `@localhost/sdcc?host=/tmp` |
| vendor-recrawl-dispatcher | lib/db.js | cef3bc4 | `@127.0.0.1:5432/dw_unified` → `@localhost/dw_unified?host=/tmp` |

Restore: `git -C <repo> revert <sha>` or `git checkout <sha>^ -- <file>`.

### Bucket C — untracked source (file backup)
| File | Backup |
|---|---|
| /Users/macstudio3/Projects/_scratch/dwaa53-viewer/server.js | server.js.bak-tk11438 (same dir) |

Restore: `cp server.js.bak-tk11438 server.js`.

## Verification performed
- node pg (Ken's installed pg@8) resolves all three new-URL shapes: dw_unified, bertha_betting, sdcc → OK, role dw_admin.
- psql exact-URL check: `postgresql://dw_admin:DW2024!@localhost/dw_unified?host=/tmp` → OK.
- `node --check` PASS on all 7 edited JS files.
- git diffs reviewed: only the intended connection-string lines changed.
- None of the touched services were running at edit time (sku-check-skill, Bertha, SDCC-Stories,
  dwaa53, vendor-recrawl-dispatcher, dw-boardroom-governance, archive-agent, sister-parish — no live PIDs,
  no PM2 entries, no launchd jobs, no crontab entries found).
- These are FALLBACK strings: behavior changes only when env DATABASE_URL is unset.

## Still gated (NOT touched — requires Steve approval)
- reidwitlin-landing single restart (purple-dot memo chain), TCP shutdown (listen_addresses),
  Norma-platform live path (33 files, remote-deployed), port-15432 endpoints (different service),
  Ken follow-the-winners hourly wrapper execution.