# Proposal staging recovery

Status: backup and disposable restore verified. A and B are deployed. Production settings and deployment versions were compared immediately before/after and are unchanged.

- Source baseline commit: `4a1874e` in `/Users/agency/Documents/Agty/kertujitok-proposal-20260927`, branch `codex/proposal-contract-20260927`. Existing live panel/calendar HTML matches this snapshot byte for byte.
- Existing A Worker rollback version: `aec59972-129c-431d-b078-f8e7749912f7` (100%).
- Backup: `private/stage-before.sql`, SHA-256 `4666bd1e7cafda71135d03dc10be69fd1ce3ca3a0f7fd9c1979868d75fef3159`.
- Complete Worker multipart: `private/stage-worker-before.multipart`, SHA-256 `0dbd5c1d0ec659665d863f4cd43deed2ea032b181da7ac8317eec42980147664`.
- SQL restored into disposable SQLite with integrity_check=ok, all 9 application table counts matched. No original table was deleted.
- B uses `pvb_` prefixed copies in the same isolated staging D1 because the provider account has reached its 10-database quota. All original A records remain unchanged. Namespace clone passed exact-data and independent-edit checks.

## Restore commands

Run from the isolated proposal source, with existing authorized Cloudflare environment:

```sh
node node_modules/wrangler/bin/wrangler.js rollback aec59972-129c-431d-b078-f8e7749912f7 --config cloudflare/calendar-stage/wrangler.toml --message 'Restore pre-proposal staging UI'
```

This restores the previous Worker/assets while retaining D1 data. Additive proposal tables/columns and B tables remain available for recovery. It does not reset existing CRM records or delete evidence.

A complete database recovery can be rehearsed by importing private/stage-before.sql into an empty disposable SQLite database, as already verified in evidence/backup-rehearsal.json. Do not import a full backup over existing tables. To recover exact affected records, first export the current state, compare the affected IDs with this backup, and apply narrow inverse updates. Provider settings/deployments and original records are in private/. No production or GHL operation is part of this procedure.

## Current deployed recovery points

- A proposal version: `f09f3726-67f5-493d-b509-4a8b9709842f`.
- B proposal version: `1b76707c-ce32-43cb-a7db-8a71c7d1873b`.
- Final public-assets archive: `private/proposal-final-public-assets.tar.gz`, SHA-256 `fedc14f3b1c101c1b472fd2b04419fda8b48335415cbd297a45069b735059fe2`. It restores the assembled `dist/` in a clean checkout. The archive contains only the verified public staging assets.
- Fresh provider receipts and anonymous routes are under `evidence/deployment/`. The old A rollback command above remains the route back to the previous panel release while preserving additive data.
