dsh-session-sync 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +1 -1
- package/CHANGELOG.md +6 -0
- package/lib/engine.mjs +4 -1
- package/package.json +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -52,7 +52,7 @@ The three-way merge compares `base` (merge base), `ours` (local), and `theirs` (
|
|
|
52
52
|
| `append-both` | both appended past base | keep ours + fork file for theirs |
|
|
53
53
|
| `diverged` | neither is a superset | keep ours + fork file for theirs |
|
|
54
54
|
|
|
55
|
-
Fork files are named `<basename>.remote-fork-<UTC
|
|
55
|
+
Fork files are named `<basename>.remote-fork-<UTC 14-digit yyyyMMddHHmmss>-<device8>` (`forkFileName` rejects any non-14-digit stamp, so both backends must strip the ISO separators `-`, `:`, and `T`); mirror and cleanup **never delete or overwrite** files matching that pattern, so both lineages always survive. When a conflicting session is live and has no open turn, the plugin also forks the session at the harness level and injects a persistent `user/message` notice into the child. The session-level mapping follows the host's real session-store layout `$DSH_HOME/sessions/<projectKey>/<sessionId>/<file>` — `projectKey` is derived from the session `cwd` (`_no-cwd` when absent) and `sessionId` is the host's `encodeSegment` form, which `lib/paths.mjs` decodes back (`~XXXX` escapes). Fork paths that do not fit that shape (or the legacy flat `<mirrorDir>/<sessionId>/<file>` form) are reported with a warning and never silently dropped; the fork files themselves are always preserved.
|
|
56
56
|
|
|
57
57
|
## Confirmation gate
|
|
58
58
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.12] - 2026-09-09
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Generate the git-backend fork timestamp as strictly 14 digits: `lib/engine.mjs` stripped only `-` and `:` from `toISOString()` before slicing 14 characters, so the ISO `T` survived (`20260909T13523`), `forkFileName`'s `/^\d{14}$/` check failed, and every git-backend conflict fork silently fell back to the epoch stamp `19700101000000`. The stamp now removes `-`, `:` and `T` exactly like `lib/encrypted.mjs`, yielding a real `yyyyMMddHHmmss` UTC stamp; the encrypted backend was already correct and no other behavior changes. Regression tests assert a 14-digit non-epoch stamp on a real fork path plus the acceptance/fallback contract in `test/paths.test.mjs`.
|
|
13
|
+
|
|
8
14
|
## [0.2.11] - 2026-09-09
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/lib/engine.mjs
CHANGED
|
@@ -253,7 +253,10 @@ export class SyncEngine {
|
|
|
253
253
|
const { resolutions, summary } = planMerge(entries)
|
|
254
254
|
const forks = []
|
|
255
255
|
const now = new Date()
|
|
256
|
-
|
|
256
|
+
// 严格 14 位 UTC 戳(yyyyMMddHHmmss):与 lib/encrypted.mjs 同口径剔除 ISO
|
|
257
|
+
// 分隔符(`-`/`:`/`T`)后再截断。仅去掉 `-`/`:` 会留下 `T`,使
|
|
258
|
+
// forkFileName 的 /^\d{14}$/ 失配并静默回退到纪元戳。
|
|
259
|
+
const stamp = now.toISOString().replace(/[-:T]/gu, '').slice(0, 14)
|
|
257
260
|
for (const resolution of resolutions) {
|
|
258
261
|
if (resolution.adoptTheirs) {
|
|
259
262
|
await this.#deps.git.checkoutStage('theirs', resolution.path)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-session-sync",
|
|
3
3
|
"description": "Cross-device sync for DeepSeek Harness sessions: a dedicated git mirror of the session store, append-only three-way merge with keep-both + fork conflict resolution, /sync command, sync_pull/sync_push/sync_status tools, and configurable auto push/pull",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.12",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/PerryLink/dsh-session-sync.git"
|