@openviking/dsh-memory-plugin 0.5.27 → 0.5.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openviking/dsh-memory-plugin",
3
- "version": "0.5.27",
3
+ "version": "0.5.28",
4
4
  "description": "OpenViking memory and context bundle for DeepSeek Harness",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",
@@ -21,7 +21,7 @@
21
21
  * (default: 50)
22
22
  */
23
23
 
24
- import { mkdir, readdir, readFile, rename, writeFile, unlink, stat, chmod } from "node:fs/promises";
24
+ import { mkdir, readdir, readFile, rename, writeFile, unlink, stat, chmod, utimes } from "node:fs/promises";
25
25
  import { createHash } from "node:crypto";
26
26
  import { join } from "node:path";
27
27
  import { homedir } from "node:os";
@@ -268,6 +268,10 @@ export async function claimForReplay(filename) {
268
268
  const dir = getPendingDir();
269
269
  const claimed = processingFilename(filename);
270
270
  try {
271
+ // Recovery measures claim age, not how long the item waited offline.
272
+ // Refresh before publishing .processing so recovery cannot see an old mtime.
273
+ const now = new Date();
274
+ await utimes(join(dir, filename), now, now);
271
275
  await rename(join(dir, filename), join(dir, claimed));
272
276
  return claimed;
273
277
  } catch {