instar 1.3.139 → 1.3.141

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 (41) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +135 -54
  3. package/dist/commands/server.js.map +1 -1
  4. package/dist/config/ConfigDefaults.d.ts.map +1 -1
  5. package/dist/config/ConfigDefaults.js +14 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/LeaseCoordinator.d.ts.map +1 -1
  8. package/dist/core/LeaseCoordinator.js +12 -1
  9. package/dist/core/LeaseCoordinator.js.map +1 -1
  10. package/dist/core/LocalLeaseStore.d.ts +55 -0
  11. package/dist/core/LocalLeaseStore.d.ts.map +1 -0
  12. package/dist/core/LocalLeaseStore.js +103 -0
  13. package/dist/core/LocalLeaseStore.js.map +1 -0
  14. package/dist/core/types.d.ts +15 -0
  15. package/dist/core/types.d.ts.map +1 -1
  16. package/dist/core/types.js.map +1 -1
  17. package/dist/monitoring/AgentActivityState.d.ts +25 -0
  18. package/dist/monitoring/AgentActivityState.d.ts.map +1 -0
  19. package/dist/monitoring/AgentActivityState.js +17 -0
  20. package/dist/monitoring/AgentActivityState.js.map +1 -0
  21. package/dist/monitoring/SleepController.d.ts +103 -0
  22. package/dist/monitoring/SleepController.d.ts.map +1 -0
  23. package/dist/monitoring/SleepController.js +178 -0
  24. package/dist/monitoring/SleepController.js.map +1 -0
  25. package/dist/server/AgentServer.d.ts +4 -0
  26. package/dist/server/AgentServer.d.ts.map +1 -1
  27. package/dist/server/AgentServer.js +2 -0
  28. package/dist/server/AgentServer.js.map +1 -1
  29. package/dist/server/CapabilityIndex.d.ts.map +1 -1
  30. package/dist/server/CapabilityIndex.js +1 -0
  31. package/dist/server/CapabilityIndex.js.map +1 -1
  32. package/dist/server/routes.d.ts +4 -0
  33. package/dist/server/routes.d.ts.map +1 -1
  34. package/dist/server/routes.js +17 -0
  35. package/dist/server/routes.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/data/builtin-manifest.json +47 -47
  38. package/upgrades/1.3.140.md +47 -0
  39. package/upgrades/1.3.141.md +52 -0
  40. package/upgrades/side-effects/agent-hard-sleep-controller.md +101 -0
  41. package/upgrades/side-effects/standby-lease-holder-sync.md +70 -0
@@ -0,0 +1,70 @@
1
+ # Side-Effects Review — Standby lease-holder propagation
2
+
3
+ **Version / slug:** `standby-lease-holder-sync`
4
+ **Date:** `2026-05-31`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ Decouple cross-machine lease coordination from git. The lease coordinator +
11
+ `HttpLeaseTransport` (and the handoff / reply-marker / live-tail transports) now
12
+ run whenever `coordinator.enabled && coordinator.identity`, instead of being
13
+ nested inside a single `try` gated on `gitBackupEnabled` whose first statement
14
+ (`new GitSyncManager`) throws on an instar-source-tree home (SourceTreeGuard) and
15
+ discarded everything. Git-sync is now an internal best-effort optional; when no
16
+ git medium exists the lease uses a new `LocalLeaseStore` (local-file backed) and
17
+ the HTTP transport carries cross-machine propagation. Also fixes a self-rejection
18
+ in `LeaseCoordinator.effectiveView` (it passed the transport's self-inclusive
19
+ nonce watermark to `acceptTunnelLease`, rejecting the very lease it validated).
20
+
21
+ ## Decision-point inventory
22
+
23
+ 1. **`gitSyncRef` defined vs undefined** → `GitLeaseStore` vs `LocalLeaseStore`.
24
+ 2. **`effectiveView` tunnel-fold** → accept the observed lease iff sig + git-floor
25
+ + epoch-newer pass (nonce floor now excludes the lease's own holder).
26
+
27
+ ## 1. Over-block
28
+
29
+ **What legitimate inputs does this reject?** None added. The lease coordinator now
30
+ runs in MORE cases (git-less machines) than before, not fewer. `acceptTunnelLease`
31
+ still rejects forged/below-floor/older-nonce leases (signature + git-floor +
32
+ replay checks all run); excluding the observed lease's own holder from the nonce
33
+ floor does not weaken this — the transport's `recordObserved` already dropped
34
+ replays on receive, and a forged lease is still caught by the signature check
35
+ before it is ever folded.
36
+
37
+ ## 2. Under-block
38
+
39
+ **What does this still miss?** A git-less mesh inherits the tunnel's coordination
40
+ (RTT-bounded acquisition + observe-before-acquire), not git's shared CAS — so its
41
+ split-brain guarantees are exactly the documented tunnel-path guarantees, no
42
+ stronger. This matches the spec non-goal. In the current 1-awake/1-standby
43
+ topology the standby never acquires, so there is no acquisition contention to
44
+ resolve. When git IS available, `GitLeaseStore` (shared CAS) is still used.
45
+
46
+ ## 3. Blast radius
47
+
48
+ - New file `LocalLeaseStore.ts` is only constructed when `gitSyncRef` is undefined
49
+ (no git medium). On any git-backed agent the behavior is byte-identical to today
50
+ (`GitLeaseStore` path unchanged).
51
+ - The `effectiveView` change runs for ALL lease-coordinator users (git and
52
+ git-less). It only RELAXES a redundant nonce self-check; existing
53
+ `LeaseCoordinator`/`FencedLease`/`HttpLeaseTransport` unit suites (51 tests
54
+ across these + the new ones) stay green, confirming no replay-semantic
55
+ regression.
56
+ - The server.ts restructure moves the lease/handoff/live-tail setup out of the
57
+ git-gated `try`. A failure in lease setup is still caught (now with a
58
+ "Lease/transport setup" message) so a single-machine agent is unaffected.
59
+
60
+ ## 4. Rollback
61
+
62
+ Pure code (no migration, no config default, no schema). Rollback = revert the PR;
63
+ `lease-local.json` becomes inert (no reader). No data is mutated or deleted.
64
+
65
+ ## 5. Failure modes
66
+
67
+ - `LocalLeaseStore` persist fails (disk) → logged, in-memory view still serves;
68
+ cross-machine propagation continues over the tunnel. Never blocks boot.
69
+ - Git medium unavailable → caught, lease falls back to LocalLeaseStore. This is
70
+ the intended path, not an error.