Skip to content

Commit c9ffafb

Browse files
authored
Merge pull request #44 from VapiAI/chore/improvements-conflict-resolution
docs: resolve improvements backlog merge conflict
2 parents 5b3b5b9 + 0538886 commit c9ffafb

1 file changed

Lines changed: 72 additions & 0 deletions

File tree

improvements.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ you which stack PR closes the row.**
7777
| 23 | Phantom `both-diverged` (canonicalization + agree-gate) | Untouched resources blocked on first push | None | RESOLVED 2026-06-03 (#TBD) |
7878
| 24 | Bare `push` is too easy to use as the deploy path | Raw push skips apply's validate+pull safety | None | Open — mitigated by per-resource drift gate |
7979
| 25 | Interactive flows lack automated coverage | Picker/conflict-prompt regressions ship silently | None | Open — scheduled for the test-update iteration |
80+
| 26 | Rollback is snapshot replay, not transaction rollback | Creates/deletes/state drift are not fully undone | #3 | Open — document/plan transactional rollback |
81+
82+
**Active backlog after cleanup:** `#2`, `#6`, `#8`, `#12`, `#20`, and `#24–#26`. Resolved entries stay in this file as historical incident notes per the maintenance directive; stale superseded backlog rows are not duplicated.
8083

8184
---
8285

@@ -1226,6 +1229,75 @@ reconciles the suite with the slim-state/hash-store engine.
12261229

12271230
---
12281231

1232+
## 26. Rollback is snapshot replay, not one-click transactional rollback
1233+
1234+
**Discovered:** source review of `src/snapshot.ts` and `src/rollback-cmd.ts`,
1235+
2026-06-02; re-verified during the 2026-06-15 conflict cleanup.
1236+
1237+
### Problem
1238+
1239+
`npm run rollback -- <org> --to <timestamp>` restores the platform payloads
1240+
captured before PATCH updates. That is useful, but it is not a full
1241+
transactional undo for everything a push/apply might have changed.
1242+
1243+
### Current behavior (Verified)
1244+
1245+
- `src/snapshot.ts` writes `.vapi-state.<org>.snapshots/<timestamp>/...`
1246+
entries with the outgoing local payload and the current platform payload.
1247+
- `src/push.ts` writes those snapshots before PATCHing existing resources and
1248+
reuses the drift-detection GET when available.
1249+
- `src/rollback-cmd.ts` loads a timestamp and PATCHes each saved `platform`
1250+
payload back to the current UUID from `.vapi-state.<org>.json`.
1251+
- Creates have no prior platform payload to replay. Deletes/orphan cleanup are
1252+
not recreated. Rollback also depends on the current state file still mapping
1253+
the same resource id to the same UUID.
1254+
1255+
### Risk
1256+
1257+
An operator can reasonably read "rollback" as "undo this whole deploy." Today
1258+
it means "restore pre-push bodies for resources that were updated by PATCH and
1259+
still have compatible state mappings." New resources may remain live, deleted
1260+
resources may stay deleted, and renamed/re-keyed state can make snapshot entries
1261+
skip.
1262+
1263+
### Current mitigation
1264+
1265+
Use rollback as a PATCH-update safety net, then audit and re-sync:
1266+
1267+
```bash
1268+
npm run audit -- <org>
1269+
npm run pull -- <org> --bootstrap
1270+
```
1271+
1272+
For deploys that create/delete resources, pair rollback with manual cleanup or a
1273+
follow-up `apply` from a known-good git revision.
1274+
1275+
### Possible fix
1276+
1277+
Add a per-run rollback manifest that records every mutation, not just PATCH
1278+
payloads:
1279+
1280+
- PATCH: current behavior, replay prior platform payload.
1281+
- POST: record created UUID and optionally DELETE it during rollback.
1282+
- DELETE: snapshot full pre-delete payload and optionally recreate it when the
1283+
API supports recreating that resource type.
1284+
- State: snapshot relevant `.vapi-state.<org>.json` entries so rollback can
1285+
restore state mappings after platform replay.
1286+
1287+
Expose an explicit dry-run / confirm flow, for example:
1288+
1289+
```bash
1290+
npm run rollback -- <org> --to <timestamp> --plan
1291+
npm run rollback -- <org> --to <timestamp> --confirm <org>
1292+
```
1293+
1294+
### Status
1295+
1296+
**Open.** Current rollback is valuable snapshot replay; it should not be treated
1297+
as a transactional deploy rollback until create/delete/state coverage exists.
1298+
1299+
---
1300+
12291301
## Out of scope (intentionally not improvements)
12301302

12311303
- **State file is identity-only and not git-ignored.** It's intentionally

0 commit comments

Comments
 (0)