passalong 0.15.0 → 0.15.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/store.js +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passalong",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "description": "Hand tasks, bugs and finished work to AI coding agents, and get back a write-up with evidence.",
5
5
  "mcpName": "io.github.codellyson/passalong",
6
6
  "keywords": [
package/src/store.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  mkdirSync,
11
11
  readdirSync,
12
12
  readFileSync,
13
+ renameSync,
13
14
  statSync,
14
15
  unlinkSync,
15
16
  writeFileSync,
@@ -40,7 +41,12 @@ export function readConfig() {
40
41
  export function writeConfig(patch) {
41
42
  ensure();
42
43
  const next = { ...readConfig(), ...patch };
43
- writeFileSync(CONFIG, `${JSON.stringify(next, null, 2)}\n`, { mode: 0o600 });
44
+ // Written beside it and renamed over it, so a reader never meets a half-written file: the update
45
+ // check rewrites this from a background process, and a command that read it mid-write saw no
46
+ // accounts at all.
47
+ const tmp = `${CONFIG}.${process.pid}.tmp`;
48
+ writeFileSync(tmp, `${JSON.stringify(next, null, 2)}\n`, { mode: 0o600 });
49
+ renameSync(tmp, CONFIG);
44
50
  return next;
45
51
  }
46
52