instar 1.3.367 → 1.3.369

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 (43) hide show
  1. package/dist/commands/server.d.ts.map +1 -1
  2. package/dist/commands/server.js +104 -3
  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 +11 -0
  6. package/dist/config/ConfigDefaults.js.map +1 -1
  7. package/dist/core/CoherenceJournal.d.ts +8 -0
  8. package/dist/core/CoherenceJournal.d.ts.map +1 -1
  9. package/dist/core/CoherenceJournal.js +62 -3
  10. package/dist/core/CoherenceJournal.js.map +1 -1
  11. package/dist/core/CommitmentsSync.d.ts +144 -0
  12. package/dist/core/CommitmentsSync.d.ts.map +1 -0
  13. package/dist/core/CommitmentsSync.js +293 -0
  14. package/dist/core/CommitmentsSync.js.map +1 -0
  15. package/dist/core/MeshRpc.d.ts +6 -0
  16. package/dist/core/MeshRpc.d.ts.map +1 -1
  17. package/dist/core/MeshRpc.js +1 -0
  18. package/dist/core/MeshRpc.js.map +1 -1
  19. package/dist/core/PeerPresencePuller.d.ts +19 -0
  20. package/dist/core/PeerPresencePuller.d.ts.map +1 -1
  21. package/dist/core/PeerPresencePuller.js +7 -0
  22. package/dist/core/PeerPresencePuller.js.map +1 -1
  23. package/dist/core/types.d.ts +13 -0
  24. package/dist/core/types.d.ts.map +1 -1
  25. package/dist/core/types.js.map +1 -1
  26. package/dist/monitoring/CommitmentTracker.d.ts +40 -0
  27. package/dist/monitoring/CommitmentTracker.d.ts.map +1 -1
  28. package/dist/monitoring/CommitmentTracker.js +95 -4
  29. package/dist/monitoring/CommitmentTracker.js.map +1 -1
  30. package/dist/server/AgentServer.d.ts +3 -0
  31. package/dist/server/AgentServer.d.ts.map +1 -1
  32. package/dist/server/AgentServer.js +1 -0
  33. package/dist/server/AgentServer.js.map +1 -1
  34. package/dist/server/routes.d.ts +4 -0
  35. package/dist/server/routes.d.ts.map +1 -1
  36. package/dist/server/routes.js +20 -1
  37. package/dist/server/routes.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/data/builtin-manifest.json +47 -47
  40. package/src/data/state-coherence-registry.json +13 -1
  41. package/upgrades/1.3.369.md +81 -0
  42. package/upgrades/side-effects/commitments-sync-p15a.md +93 -0
  43. package/upgrades/side-effects/journal-lock-retry-pin-fallback.md +64 -0
@@ -0,0 +1,64 @@
1
+ # Side-Effects Review — journal lock retry + heartbeat (#925) and quiet-topic pin fallback (#926)
2
+
3
+ **Version / slug:** `journal-lock-retry-pin-fallback`
4
+ **Date:** `2026-06-06`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required (two live-found fixes against converged specs; both bounded; both with regression tests)`
7
+
8
+ ## Summary of the change
9
+
10
+ Two bugs found by the P2 LIVE two-machine proof (echo pair, v1.3.367):
11
+
12
+ 1. **#925 — writer lock wedge.** The restart cascade (3 boots/hour on a
13
+ release day) left the journal writer silently read-only for ~75 min:
14
+ boot-time stale-lock reclaim correctly refused while the old process
15
+ lingered, and the locked-out state had NO retry. Fix: (a) a bounded
16
+ retry timer (max(40×flushInterval, 10s)) re-attempts activation and
17
+ recovers IN PLACE with one log line; (b) the live holder heartbeats the
18
+ lock file mtime every ~40 flushes; (c) reclaim treats an mtime-stale
19
+ (5 min) lock as dead even when its recorded pid "exists" — the
20
+ pid-reuse defense; (d) the autonomous scanner does NOT mark runs seen
21
+ while the writer is locked out, so dropped `started` emits re-emit
22
+ after recovery (op-key dedupe makes re-emits safe).
23
+ 2. **#926 — quiet-topic reflex refusal.** Ownership only CASes when
24
+ traffic flows, so a topic just moved (pinned, owner:null) — the exact
25
+ state the fetch reflex exists for — answered not-owner. Fix: the
26
+ ownerOf seam falls back to the placement pin (`pinned &&
27
+ preferredMachine === self` ⇒ self at epoch 0); a real claim bumps past
28
+ epoch 0 and aborts an in-flight pull as superseded (the existing
29
+ recheck, by design). Spec §3.3 delta + eli16 amendment ride along.
30
+
31
+ ## Decision-point inventory
32
+
33
+ - Retry cadence bounded (P19): one timer, unref'd, cleared on recovery +
34
+ close; no retry while active.
35
+ - mtime-stale threshold (5 min) vs heartbeat cadence (~10s): 30× margin —
36
+ a paused-but-alive holder (debugger, SIGSTOP) longer than 5 min loses
37
+ the lock deliberately (it wasn't flushing anyway; the new holder's
38
+ 'wx' open + the old holder's dead fd keep streams append-consistent).
39
+ - The pin fallback only ever returns SELF (never another machine) and
40
+ only when pinned — an unpinned unowned topic still refuses honestly.
41
+
42
+ ## 1-2. Over/Under-block
43
+
44
+ Over: a >5-min-frozen live holder is reclaimed (stated trade). Under:
45
+ two processes could still interleave between mtime check and rm in a
46
+ pathological race — the 'wx' open after rm serializes the winner; the
47
+ loser retries on its timer.
48
+
49
+ ## 3. Fit / 4. Blast radius
50
+
51
+ Lock logic stays inside CoherenceJournal (the single owner of the lock
52
+ discipline); the scanner guard is one line at the existing seenRuns
53
+ seam; the pin fallback lives in the server's ownerOf wiring (the seam
54
+ the spec names). Blast radius: journal writer recovery behavior +
55
+ reflex eligibility on pinned-unowned topics; both covered by tests.
56
+
57
+ ## Evidence
58
+
59
+ - tests/unit/CoherenceJournal.test.ts — 38 passing (3 new: locked-out
60
+ honored for a fresh live-pid lock; mtime-stale reclaim despite an
61
+ "alive" pid; freed lock acquirable). Full typecheck clean.
62
+ - Live remediation already validated the failure analysis: stale-lock
63
+ removal + restart restored emissions (the 77901 proof artifact
64
+ journaled + replicated to the Mini within one cadence).