@zq-silk/yui 0.13.0 → 0.13.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.
@@ -589,7 +589,7 @@ async function executeSqliteInPlaceUpgrade(options, classification, now, callerP
589
589
  finally {
590
590
  db.close();
591
591
  }
592
- });
592
+ }, options.externalUpgradeFenceOwnerPid ?? callerPid);
593
593
  }
594
594
  catch (error) {
595
595
  unexpected = error;
@@ -1358,7 +1358,7 @@ function executeFenced(options, classification, target, callerPid, now, switchSt
1358
1358
  ? {}
1359
1359
  : { backupPath: report.switch.backupPath })
1360
1360
  };
1361
- });
1361
+ }, options.externalUpgradeFenceOwnerPid ?? callerPid);
1362
1362
  }
1363
1363
  catch (error) {
1364
1364
  if (!(error instanceof UpgradeFenceError))
@@ -37,12 +37,13 @@ const COORDINATION_LOCK_MIN_AGE_MS = 1_000;
37
37
  * A hook that passed a check before an upgrade placed its fence either owns the
38
38
  * lock and finishes before cutover, or waits and receives an explicit
39
39
  * UpgradeFenceError after the cutover holder releases it. There is no second
40
- * scan or retry protocol hidden in this helper.
40
+ * scan or retry protocol hidden in this helper. A staged updater child passes
41
+ * its already-authenticated parent fence owner through this same boundary.
41
42
  */
42
- export function withUpgradeCoordinationLock(home, execute) {
43
+ export function withUpgradeCoordinationLock(home, execute, fenceOwnerPid = process.pid) {
43
44
  const release = acquireUpgradeCoordinationLock(home);
44
45
  try {
45
- assertUpgradeAdmission(home);
46
+ assertUpgradeAdmission(home, fenceOwnerPid);
46
47
  return execute();
47
48
  }
48
49
  finally {
@@ -57,8 +58,8 @@ export function withUpgradeCoordinationLock(home, execute) {
57
58
  * avoiding a permanent post-promote hook deadlock. A malformed marker with a
58
59
  * missing Home still fails closed because its recovery phase cannot be trusted.
59
60
  */
60
- export function assertUpgradeAdmission(home) {
61
- assertHomeWritable(home);
61
+ export function assertUpgradeAdmission(home, fenceOwnerPid = process.pid) {
62
+ assertHomeWritable(home, fenceOwnerPid);
62
63
  const progressPath = switchProgressPath(home);
63
64
  if (!existsSync(progressPath))
64
65
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,