Commit 1265568
authored
feat(worldline): checkpoint-tree rewind for tui_v2 (#625)
* fix(continue): preserve session workspace on in-place restore
In-place /continue retargets agent.log_path to the restored file, so the
reset bind `_bind_workspace(None)` ran during restore was persisting
session_ws_set(path, "") — erasing that session's own workspace mapping to
"" (read back as "explicitly off") before we read it, which also short-
circuited the log-scan fallback. The continued session never re-entered its
workspace.
Add a `persist` flag to `_bind_workspace`; the restore-time reset passes
persist=False so it only refreshes in-memory state. The session→workspace
map is now written solely by explicit /workspace, /workspace off, and a
successful restore.
* fix(tui_v3): support Home/End keys for line start/end
PTK delivers Home/End as raw VT sequences in KeyPress.data, which
_esc_repl swallowed (only arrows were decoded). Map \x1b[H/[F/[1~/[4~
and SS3 \x1bOH/\x1bOF to internal bytes 0x07/0x14, extend _ESC_RE to
match SS3 as whole sequences, and add jump-to-line-start/end handlers
in _keys. Home no longer collides with Ctrl+A select-all.
* feat(worldline): integrate checkpoint-tree rewind into tui_v2
- tuiapp_v2.py: /rewind durable inline picker + /worldline three-pane
checkpoint tree (tree UI inlined; colors follow the v2 theme) with a
per-node diff viewport; conv-only /rewind restores via the persistent store.
- worldline.py (new): UI-agnostic backend — RewindStore (persistent
checkpoint tree + content-addressed blobs), reconcile, restore_plan,
node_diff, native-log projection.
- continue_cmd.py: gated worldline support — list_sessions(rewind_root=),
continue_inplace/copy(allow_empty=); default-off, other UIs byte-identical.
- tui_v3.py: status line shows concrete model id (unrelated minor tweak).
* feat(worldline): /rewind reuses the restore-mode picker (conv/code/both)
After picking a turn, /rewind now opens the same RestoreModeScreen as
/worldline to choose conversation / code / both, then restores via the
persistent store — making /rewind a true lite view of /worldline (linear
list, no tree/diff) over the identical restore backend.1 parent f8ecfdb commit 1265568
4 files changed
Lines changed: 2367 additions & 35 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
297 | | - | |
| 297 | + | |
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
| |||
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
327 | 364 | | |
328 | 365 | | |
329 | 366 | | |
| |||
1014 | 1051 | | |
1015 | 1052 | | |
1016 | 1053 | | |
1017 | | - | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1018 | 1063 | | |
1019 | 1064 | | |
1020 | | - | |
| 1065 | + | |
| 1066 | + | |
1021 | 1067 | | |
1022 | 1068 | | |
1023 | 1069 | | |
| |||
1026 | 1072 | | |
1027 | 1073 | | |
1028 | 1074 | | |
1029 | | - | |
| 1075 | + | |
| 1076 | + | |
| 1077 | + | |
| 1078 | + | |
| 1079 | + | |
1030 | 1080 | | |
1031 | 1081 | | |
1032 | | - | |
| 1082 | + | |
1033 | 1083 | | |
1034 | 1084 | | |
1035 | 1085 | | |
| |||
1042 | 1092 | | |
1043 | 1093 | | |
1044 | 1094 | | |
1045 | | - | |
| 1095 | + | |
| 1096 | + | |
| 1097 | + | |
| 1098 | + | |
| 1099 | + | |
1046 | 1100 | | |
1047 | 1101 | | |
1048 | 1102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
877 | 877 | | |
878 | 878 | | |
879 | 879 | | |
| 880 | + | |
| 881 | + | |
880 | 882 | | |
881 | | - | |
| 883 | + | |
882 | 884 | | |
883 | | - | |
| 885 | + | |
884 | 886 | | |
885 | 887 | | |
886 | 888 | | |
| |||
1496 | 1498 | | |
1497 | 1499 | | |
1498 | 1500 | | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
1499 | 1510 | | |
1500 | 1511 | | |
1501 | 1512 | | |
| |||
1632 | 1643 | | |
1633 | 1644 | | |
1634 | 1645 | | |
1635 | | - | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
1636 | 1649 | | |
1637 | 1650 | | |
1638 | 1651 | | |
| |||
2107 | 2120 | | |
2108 | 2121 | | |
2109 | 2122 | | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
2110 | 2130 | | |
2111 | 2131 | | |
2112 | 2132 | | |
| |||
2496 | 2516 | | |
2497 | 2517 | | |
2498 | 2518 | | |
2499 | | - | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
2500 | 2522 | | |
2501 | 2523 | | |
2502 | 2524 | | |
| |||
5677 | 5699 | | |
5678 | 5700 | | |
5679 | 5701 | | |
| 5702 | + | |
| 5703 | + | |
| 5704 | + | |
| 5705 | + | |
| 5706 | + | |
| 5707 | + | |
| 5708 | + | |
| 5709 | + | |
5680 | 5710 | | |
5681 | 5711 | | |
5682 | 5712 | | |
| |||
0 commit comments