instar 1.3.652 → 1.3.654
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/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +388 -3
- package/dist/commands/server.js.map +1 -1
- package/dist/core/configCoherence.d.ts +46 -5
- package/dist/core/configCoherence.d.ts.map +1 -1
- package/dist/core/configCoherence.js +101 -12
- package/dist/core/configCoherence.js.map +1 -1
- package/dist/core/devGatedFeatures.d.ts.map +1 -1
- package/dist/core/devGatedFeatures.js +12 -0
- package/dist/core/devGatedFeatures.js.map +1 -1
- package/dist/core/ownershipFollowsLiveWork.d.ts +68 -0
- package/dist/core/ownershipFollowsLiveWork.d.ts.map +1 -0
- package/dist/core/ownershipFollowsLiveWork.js +95 -0
- package/dist/core/ownershipFollowsLiveWork.js.map +1 -0
- package/dist/core/types.d.ts +26 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/messaging/stuckMessageRecovery.d.ts +12 -0
- package/dist/messaging/stuckMessageRecovery.d.ts.map +1 -1
- package/dist/messaging/stuckMessageRecovery.js +12 -0
- package/dist/messaging/stuckMessageRecovery.js.map +1 -1
- package/dist/monitoring/SessionRecovery.d.ts +73 -0
- package/dist/monitoring/SessionRecovery.d.ts.map +1 -1
- package/dist/monitoring/SessionRecovery.js +113 -0
- package/dist/monitoring/SessionRecovery.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.653.md +85 -0
- package/upgrades/1.3.654.md +26 -0
- package/upgrades/side-effects/mesh-coherence-live-state-honesty.md +53 -0
- package/upgrades/side-effects/ownership-follows-live-work.md +137 -0
|
@@ -57,6 +57,47 @@ export class SessionRecovery extends EventEmitter {
|
|
|
57
57
|
if (!this.config.enabled) {
|
|
58
58
|
return { recovered: false, failureType: null, message: 'Recovery disabled' };
|
|
59
59
|
}
|
|
60
|
+
// ── Part D: double-dispatch recovery gate (ownership-follows-live-work) ──────
|
|
61
|
+
// BEFORE any recovery sub-path respawns/re-injects, consult per-topic ownership.
|
|
62
|
+
// A `forward`/`withhold` decision means another machine owns this topic (or its
|
|
63
|
+
// owner is briefly unreachable) — re-running here would double-dispatch the same
|
|
64
|
+
// inbound. Strict no-op when the flag is OFF / deps absent (legacy behavior).
|
|
65
|
+
const ownershipDecision = this.decideOwnershipForRecovery(topicId);
|
|
66
|
+
if (ownershipDecision === 'forward') {
|
|
67
|
+
// Reachable peer owns the topic: do NOT recover locally — forward the topic's
|
|
68
|
+
// pending inbound through route() (which re-resolves the live owner + applies
|
|
69
|
+
// isRemotelyHandled at dispatch). No pending inbound ⇒ nothing to serve; the
|
|
70
|
+
// leftover idle session is converged by the existing reaper/reconciler.
|
|
71
|
+
let forwarded = 0;
|
|
72
|
+
let nonePending = true;
|
|
73
|
+
try {
|
|
74
|
+
const r = await this.deps.forwardPendingInboundViaRoute?.(topicId);
|
|
75
|
+
if (r) {
|
|
76
|
+
forwarded = r.forwarded;
|
|
77
|
+
nonePending = r.nonePending;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch { /* @silent-fallback-ok — forward is best-effort; route()'s own ledger owns delivery + exactly-once */ }
|
|
81
|
+
return {
|
|
82
|
+
recovered: false,
|
|
83
|
+
failureType: null,
|
|
84
|
+
message: nonePending
|
|
85
|
+
? `Recovery skipped — topic ${topicId} owned by a reachable peer and no pending inbound to forward`
|
|
86
|
+
: `Recovery forwarded — topic ${topicId} owned by a reachable peer; ${forwarded} pending inbound routed to the owner`,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
if (ownershipDecision === 'withhold') {
|
|
90
|
+
// Unreachable peer owns the topic (incl. reachability-throw): WITHHOLD the
|
|
91
|
+
// local re-run. The message is NOT lost — it rides the existing durable inbound
|
|
92
|
+
// queue / forward path; if the owner stays dark the ownership reconciler +
|
|
93
|
+
// failover (force-claim on death evidence) eventually move ownership.
|
|
94
|
+
return {
|
|
95
|
+
recovered: false,
|
|
96
|
+
failureType: null,
|
|
97
|
+
message: `Recovery withheld — topic ${topicId} owned by an unreachable peer; the message rides the durable inbound queue (not re-run locally to avoid double-dispatch)`,
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// ownershipDecision === 'proceed' → fall through to today's recovery logic.
|
|
60
101
|
const processAlive = this.deps.isSessionAlive(sessionName);
|
|
61
102
|
// 1. Check for context exhaustion (process alive but conversation too long)
|
|
62
103
|
// This runs FIRST and doesn't need JSONL — it scans tmux output directly.
|
|
@@ -105,6 +146,78 @@ export class SessionRecovery extends EventEmitter {
|
|
|
105
146
|
}
|
|
106
147
|
return { recovered: false, failureType: null, message: 'No mechanical failure detected' };
|
|
107
148
|
}
|
|
149
|
+
/**
|
|
150
|
+
* Part D decision logic (docs/specs/ownership-follows-live-work.md). Resolves the
|
|
151
|
+
* per-topic ownership state into a recovery direction. The safe direction is
|
|
152
|
+
* MIXED and named honestly per state (NOT uniformly fail-closed):
|
|
153
|
+
* - owner === self / null / released → `proceed` (re-run locally; no competing
|
|
154
|
+
* owner can double-dispatch, and NOT re-running would silently drop the recovery).
|
|
155
|
+
* - owner === reachable peer → `forward` (the owner serves it; double-dispatch avoided).
|
|
156
|
+
* - owner === unreachable peer (incl. `isOwnerReachable` THROW / indeterminate) →
|
|
157
|
+
* `withhold` (the record NAMES a peer, so the safe direction is no-double-dispatch).
|
|
158
|
+
* - `ownerOf` THROWS / registry unreadable → `proceed` — **fail-OPEN, labeled as
|
|
159
|
+
* such** + a `recovery-gate-registry-unknown` telemetry row: we have NO owner
|
|
160
|
+
* evidence at all, and a dead conversation is a worse failure than a rare
|
|
161
|
+
* double-reply. (A *persistent* registry failure degrades to the OLD
|
|
162
|
+
* double-dispatch-prone behavior — an already-broken state, not a new regression.)
|
|
163
|
+
*/
|
|
164
|
+
decideOwnershipForRecovery(topicId) {
|
|
165
|
+
// Flag OFF / deps absent → strict no-op (legacy behavior: always proceed).
|
|
166
|
+
if (!this.deps.ownershipFollowsLiveWork || !this.deps.ownershipFollowsLiveWork())
|
|
167
|
+
return 'proceed';
|
|
168
|
+
if (!this.deps.ownerOfTopic || !this.deps.selfMachineId)
|
|
169
|
+
return 'proceed';
|
|
170
|
+
const self = this.deps.selfMachineId();
|
|
171
|
+
if (!self)
|
|
172
|
+
return 'proceed'; // single-machine / mesh id not resolved → no peer can own it
|
|
173
|
+
let owner;
|
|
174
|
+
try {
|
|
175
|
+
owner = this.deps.ownerOfTopic(topicId);
|
|
176
|
+
}
|
|
177
|
+
catch {
|
|
178
|
+
// ownerOf THREW / registry unreadable → FAIL-OPEN (re-run locally), labeled
|
|
179
|
+
// as such + measured. We have NO owner evidence (distinct from a reachability
|
|
180
|
+
// throw, where the record DID name a peer). A registry read error is rare +
|
|
181
|
+
// transient; a recovery path that silently does nothing on a blip is the worse
|
|
182
|
+
// failure (a dead conversation). The fleet-promotion gate reads this count.
|
|
183
|
+
try {
|
|
184
|
+
this.deps.emitRecoveryGateTelemetry?.({
|
|
185
|
+
kind: 'recovery-gate-registry-unknown',
|
|
186
|
+
topicId,
|
|
187
|
+
decision: 're-run-local',
|
|
188
|
+
reason: 'ownerOf threw / registry unreadable — fail-open to conversation continuity',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
catch { /* @silent-fallback-ok — telemetry is observability; never affects the decision */ }
|
|
192
|
+
return 'proceed';
|
|
193
|
+
}
|
|
194
|
+
if (owner === null)
|
|
195
|
+
return 'proceed'; // released / never-seen → no competing owner
|
|
196
|
+
if (owner === self)
|
|
197
|
+
return 'proceed'; // we own it → re-run is correct (today's behavior)
|
|
198
|
+
// owner is a PEER. Reachable → forward; unreachable / indeterminate → withhold.
|
|
199
|
+
let reachable;
|
|
200
|
+
try {
|
|
201
|
+
reachable = this.deps.isOwnerReachable ? this.deps.isOwnerReachable(owner) : false;
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// isOwnerReachable THREW / indeterminate for a PEER-owned record → treat as the
|
|
205
|
+
// UNREACHABLE-peer branch (withhold), NOT a local re-run: the record NAMES a
|
|
206
|
+
// peer, so the safe direction is no-double-dispatch (distinct from the
|
|
207
|
+
// ownerOf-throw case above where we had no owner evidence at all). Measured.
|
|
208
|
+
try {
|
|
209
|
+
this.deps.emitRecoveryGateTelemetry?.({
|
|
210
|
+
kind: 'recovery-gate-reachability-unknown',
|
|
211
|
+
topicId,
|
|
212
|
+
decision: 'withhold',
|
|
213
|
+
reason: 'isOwnerReachable threw / indeterminate for a peer-owned record — withhold (record names a peer)',
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch { /* @silent-fallback-ok — telemetry is observability; never affects the decision */ }
|
|
217
|
+
return 'withhold';
|
|
218
|
+
}
|
|
219
|
+
return reachable ? 'forward' : 'withhold';
|
|
220
|
+
}
|
|
108
221
|
/**
|
|
109
222
|
* Log a recovery event to the JSONL event log for observability.
|
|
110
223
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecovery.js","sourceRoot":"","sources":["../../src/monitoring/SessionRecovery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAsC,MAAM,qBAAqB,CAAC;AAChH,OAAO,EAAE,wBAAwB,EAA2B,MAAM,sBAAsB,CAAC;AACzF,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AA0F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,EAAE,CAAC;wBAClC,cAAc,CAAC,cAAc,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,uCAAuC,EAAE,CAAC,CAAC;wBAChG,OAAO,EAAE,CAAC;oBACZ,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC,CAAC,uEAAuE;oBAC/E,kCAAkC;gBACpC,CAAC;YACH,CAAC;YAED,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;gBAChB,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC;YACxE,CAAC;QACH,CAAC;QAAC,MAAM,CAAC,CAAC,oFAAoF;YAC5F,sCAAsC;QACxC,CAAC;IACH,CAAC;CACF;AAED,+EAA+E;AAC/E,uBAAuB;AACvB,+EAA+E;AAE/E;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAY,EAAE,YAAoB,IAAI;IACtE,OAAO,IAAI;QACT,yFAAyF;SACxF,OAAO,CAAC,kDAAkD,EAAE,EAAE,CAAC;QAChE,4DAA4D;SAC3D,OAAO,CAAC,mCAAmC,EAAE,EAAE,CAAC;QACjD,2BAA2B;SAC1B,SAAS,CAAC,KAAK,CAAC;QACjB,WAAW;SACV,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-06-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-06-24T14:42:23.151Z",
|
|
5
|
+
"instarVersion": "1.3.654",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The multi-machine `SessionOwnership` record can drift away from where the live
|
|
9
|
+
session actually is, leaving a stale `active(owner=this-machine)` label after a
|
|
10
|
+
transferred-here session completes. PR #1258 (`post-transfer-closeout-correctness`)
|
|
11
|
+
*stopped the harm* by liveness-gating the `SessionReaper` closeout so it never
|
|
12
|
+
kills a live local session on a stale label — a compensating control. This change
|
|
13
|
+
removes the stale record itself, so the dangerous state can't arise:
|
|
14
|
+
|
|
15
|
+
- **Part A — release-on-complete.** On the `sessionComplete` event, the owning
|
|
16
|
+
machine issues a `release` CAS for a topic-owned session it actively owns, so the
|
|
17
|
+
record advances to `released` (→ `ownerOf` reads null) instead of being stuck
|
|
18
|
+
`active`. Guarded by a session-identity check (FD9): the release is WITHHELD if a
|
|
19
|
+
DIFFERENT live session is bound to the topic — compared by the stable per-instance
|
|
20
|
+
key `startedAt`, NOT the reusable tmux name — closing the same-machine A∥B
|
|
21
|
+
"released record, live session" race the adversarial reviewer caught. Withheld on
|
|
22
|
+
every uncertainty (unresolvable topic, unprovable instance identity, registry
|
|
23
|
+
throw, CAS-lost).
|
|
24
|
+
- **Part B — claim-on-spawn.** The autonomous respawn path (which bypasses the
|
|
25
|
+
router's claim) issues a fenced-epoch `place → claim` so ownership follows the
|
|
26
|
+
live session onto this machine. It NEVER force-claims a peer-owned topic (force is
|
|
27
|
+
reserved for the reconciler's death-evidence path) — a post-gate owned-elsewhere
|
|
28
|
+
race withholds + records one neutral audit row. A lost CAS is a no-op (the spawn
|
|
29
|
+
still runs; the existing reconciler/applier converge).
|
|
30
|
+
- **Part D — double-dispatch recovery gate.** The single ungated recovery funnel
|
|
31
|
+
`SessionRecovery.checkAndRecover` (and the lease-gated `recoverStuckMessages`) now
|
|
32
|
+
consults per-topic ownership before re-running locally. A reachable-peer owner →
|
|
33
|
+
forward to the owner (don't re-run); an unreachable-peer owner → withhold (the
|
|
34
|
+
message rides the durable inbound queue); a null/self owner → re-run locally. The
|
|
35
|
+
registry-read-error path is deliberately fail-OPEN (re-run locally) and labeled as
|
|
36
|
+
such, emitting a `recovery-gate-registry-unknown` telemetry row so the tradeoff is
|
|
37
|
+
measured before any fleet promotion.
|
|
38
|
+
|
|
39
|
+
All three parts ride ONE dark flag `multiMachine.ownershipFollowsLiveWork`, OMITTED
|
|
40
|
+
from `ConfigDefaults` so `resolveDevAgentGate` resolves it LIVE on a dev agent / DARK
|
|
41
|
+
on the fleet. With the flag OFF (or a single-machine agent — `_meshSelfId` null), the
|
|
42
|
+
behavior is byte-identical to before: no release-on-complete, no claim-on-spawn, and
|
|
43
|
+
the recovery paths run their existing logic with no ownership consultation.
|
|
44
|
+
|
|
45
|
+
## What to Tell Your User
|
|
46
|
+
|
|
47
|
+
Nothing yet — this ships dark on the fleet (live only on development agents for
|
|
48
|
+
dogfooding) and is internal plumbing with no user-facing surface. The fleet flip is
|
|
49
|
+
an evidence-gated dev soak, tracked separately (see the spec's fleet-promotion
|
|
50
|
+
acceptance criteria). Do NOT narrate it as a finished capability.
|
|
51
|
+
|
|
52
|
+
## Summary of New Capabilities
|
|
53
|
+
|
|
54
|
+
- The multi-machine ownership record self-corrects toward where the live work is:
|
|
55
|
+
a completed session releases, an autonomous spawn claims, and a non-router recovery
|
|
56
|
+
path forwards (instead of double-dispatching) a topic this machine no longer owns.
|
|
57
|
+
- Purely additive and dev-agent-gated; flag OFF / single-machine = byte-identical to
|
|
58
|
+
today. Every ownership write is the existing fenced-epoch CAS, best-effort, never
|
|
59
|
+
forced; Part D's ownership read is a signal that can only ever withhold a local
|
|
60
|
+
re-run or forward to the owner — never a new kill or send.
|
|
61
|
+
|
|
62
|
+
## Evidence
|
|
63
|
+
|
|
64
|
+
- `npx tsc --noEmit` — clean.
|
|
65
|
+
- Full repo lint suite (`npm run lint`) — green (incl. `lint-cas-emit-placement`:
|
|
66
|
+
12 CAS sites all paired; `lint-dev-agent-dark-gate`; `lint-no-direct-destructive`).
|
|
67
|
+
- 66 new tests across all three tiers, all green:
|
|
68
|
+
- Unit: `tests/unit/ownershipFollowsLiveWork.test.ts` (26 — Part A/B pure helpers
|
|
69
|
+
both-sides incl. FD9 same-machine A∥B clobber + not-yet-bound; FD10 nonce
|
|
70
|
+
collision-resistance; the A∥B and B∥transfer fenced-epoch races against the real
|
|
71
|
+
registry FSM) + `tests/unit/ownershipFollowsLiveWork-recovery-gate.test.ts` (10 —
|
|
72
|
+
Part D every ownership state + the fail-open-but-counted telemetry assertion) +
|
|
73
|
+
`tests/unit/stuck-message-recovery.test.ts` (3 added — the third Part-D site).
|
|
74
|
+
- Integration: `tests/integration/ownership-follows-live-work.test.ts` (6 — the
|
|
75
|
+
Part D gate wired with the REAL `MachinePoolRegistry` online signal; Part A/B
|
|
76
|
+
against the real registry).
|
|
77
|
+
- E2E: `tests/e2e/ownership-follows-live-work-lifecycle.test.ts` (7 — flag
|
|
78
|
+
resolution alive-on-dev / dark-on-fleet through the REAL ConfigDefaults +
|
|
79
|
+
`resolveDevAgentGate`; the PR #1258 stale-record lifecycle regression fixed at
|
|
80
|
+
the source).
|
|
81
|
+
- Legacy regression suites green (no breakage): SessionOwnership, SessionOwnershipRegistry,
|
|
82
|
+
SessionRecovery, the three session-reaper suites (the PR #1258 area), OwnershipReconciler,
|
|
83
|
+
OwnershipApplier, devGatedFeatures-wiring (validates the new dev-gated entry).
|
|
84
|
+
- Spec: `docs/specs/ownership-follows-live-work.md` (converged 3 rounds, codex-cli:gpt-5.5
|
|
85
|
+
external reviewer; 11 frontloaded decisions). Convergence report sibling.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The multi-machine config-coherence checker (`src/core/configCoherence.ts`) is a signal-only startup advisory — it logs WARNINGS about incoherent mesh config, never rejecting boot. Two honesty gaps are fixed. **Fix (c) (ships unflagged):** the mesh-rope priority check validated a `.priorities` dict that NO type or default ever populates — dead code that always skipped, so a real operator mistake (a `priorityLan` colliding with `priorityTailscale`, or a negative value) sailed through unwarned. It now validates the REAL flat keys (`priorityTailscale`/`priorityLan`/`priorityCloudflare`) for distinct-positive-integers, reusing the existing warning codes, and the local interface is retyped against the canonical `MeshTransportConfig` so the phantom dict can't be reintroduced. **Fix (b) (dev-gated dark behind `monitoring.meshCoherenceLiveCheck`, LIVE on a development agent):** the existing verdict read CONFIG ONLY, so it would report "all clear" even when the LIVE mesh state contradicts the config. A new periodic, signal-only recheck (wired onto the existing 30s peer-presence timer — no new timer) now compares config intent against live state and surfaces two real divergences: a runtime `meshTransport.enabled` flip WITHOUT a restart (config says off, the live server is still bound non-loopback → `mesh-config-off-but-live-on`), and a half-activated boot (config says on, but this machine advertises zero mesh endpoints past a warmup grace → `mesh-config-on-but-live-inert`). It emits transition-only (one line per divergence episode, not one-per-tick), carries a per-feature metric (`mesh-coherence-live`) for the dev soak, never throws into the tick (a corrupt registry read fails toward silence with a capped backoff), and never leaks a peer-writable endpoint value into a warning string. Single-machine agents are a strict no-op.
|
|
9
|
+
|
|
10
|
+
## What to Tell Your User
|
|
11
|
+
|
|
12
|
+
If you run me across more than one machine, my "is the mesh config coherent?" check no longer lies to you. Before, if you flipped the mesh switch off in config without restarting me, the check would cheerfully say "all clear" while the mesh was still demonstrably up — an advisory that lies is worse than silence. Now it reads my actual running state and tells you honestly when the config and the live mesh disagree (the disable hasn't taken effect yet — restart to apply; or the mesh is on but this machine isn't advertising any routes). It also now catches a real config mistake — duplicate or non-positive mesh rope priorities — that previously slipped through unwarned. It's still purely advisory (it never blocks my startup), and the live-state half is on only on this development agent while it soaks.
|
|
13
|
+
|
|
14
|
+
## Summary of New Capabilities
|
|
15
|
+
|
|
16
|
+
- The mesh rope-priority coherence check validates the REAL flat config keys (`priorityTailscale`/`priorityLan`/`priorityCloudflare`) for distinct-positive-integers, replacing a dead check that validated a never-populated dict. Ships unflagged (a pure improvement to an existing boot-time warning).
|
|
17
|
+
- A new periodic, signal-only `checkMeshLiveStateCoherence` surfaces config-vs-live mesh divergences — a runtime disable that hasn't taken effect (`mesh-config-off-but-live-on`) and a config-on machine advertising no routes (`mesh-config-on-but-live-inert`) — with transition-only logging + a `mesh-coherence-live` per-feature metric. Dev-gated dark behind `monitoring.meshCoherenceLiveCheck` (live-on-dev / dark-on-fleet); flag off is byte-identical to today.
|
|
18
|
+
- The live check never blocks boot, never throws into the periodic tick (capped half-open-breaker backoff on a corrupt registry read), and never interpolates a peer-writable endpoint value into a warning string (the no-leak invariant). Single-machine agents are a strict no-op.
|
|
19
|
+
|
|
20
|
+
## Evidence
|
|
21
|
+
|
|
22
|
+
The two divergences are dead-state bugs in the EXISTING checker, demonstrated by the new tests rather than reproduced as a live outage (signal-only, dev-gated dark — no production incident to repro):
|
|
23
|
+
|
|
24
|
+
- **Fix (c) — the dead priority check.** Before: a config with `priorityTailscale: 10, priorityLan: 10` produced ZERO warnings, because the checker validated `mm.meshTransport.priorities` — a dict key that no shipped type or `ConfigDefaults` ever populates (always `undefined`, so the guard `pri && typeof pri === 'object'` always skipped). After: the same collision raises `mesh-priority-collision`, and a `priorityTailscale: 0` raises `mesh-priority-nonpositive`. Proven by `tests/unit/configCoherence.test.ts` (collision / zero / negative / float / Infinity all fire on the FLAT keys; the dead-dict regression case asserts an old-style `priorities` dict now produces no warning AND is rejected by the retyped interface at compile time).
|
|
25
|
+
- **Fix (b) — the config-only verdict.** Before: with `meshTransport.enabled:false` in config but the live server still bound `0.0.0.0` (the flip-without-restart case), a fresh coherence read reported "all clear." After: `checkMeshLiveStateCoherence` raises `mesh-config-off-but-live-on` for a non-loopback live bind (incl. a specific `bindHost` override like `192.168.1.50`, the R2-M10 regression), and `mesh-config-on-but-live-inert` for a config-on machine advertising zero endpoints past the warmup grace. Proven both directions in `tests/unit/configCoherence.test.ts`; the transition-only emit, emitCap ceiling, dev-gate no-op, and corrupt-registry backoff/auto-recover are proven in `tests/integration/mesh-coherence-live-check.test.ts`; the inline boot wiring is pinned in `tests/unit/mesh-coherence-wiring.test.ts`.
|
|
26
|
+
- **Pre-existing failure fixed (Zero-Failure Standard):** `tests/unit/notification-spam-prevention.test.ts > sends ONE mismatch notification` was failing on the base branch (`expected +0 to be 1`) because the AutoUpdater mock lacked `getShadowInstalledVersion`, which the loop-breaker's strand detection now calls every tick — the mock threw before reaching the notify path. Before: 1 failed / 14 passed. After: 15 passed. Full unit suite green (31523 passing).
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Side-Effects Review — Mesh Coherence: Live-State Honesty
|
|
2
|
+
|
|
3
|
+
**Spec:** docs/specs/mesh-coherence-live-state-honesty.md (converged + approved — standing operator pre-authorization, Justin topic 27515, 2026-06-22 mandate). **Parent principle:** Signal vs. Authority.
|
|
4
|
+
**Fix (c) ships UNFLAGGED** (pure improvement to an existing boot-time warning). **Fix (b) ships DARK** behind `monitoring.meshCoherenceLiveCheck.enabled` (dev-gated: live-on-dev / dark-fleet). Single-machine agents are a strict no-op (the `isMultiMachine` guard + the multi-machine-only `peerPresenceTimer`).
|
|
5
|
+
**Files:** src/core/configCoherence.ts, src/commands/server.ts, src/core/types.ts, src/core/devGatedFeatures.ts
|
|
6
|
+
|
|
7
|
+
## What changed
|
|
8
|
+
|
|
9
|
+
1. **configCoherence.ts — Fix (c):** DROPPED the dead `.priorities`-dict check (it validated a key no type or default ever populates) and replaced it with a flat-key check (`priorityTailscale`/`priorityLan`/`priorityCloudflare`) for distinct-positive-integers, reusing the EXISTING codes `mesh-priority-nonpositive` / `mesh-priority-collision`. RETYPED `MultiMachineLike.meshTransport` as `Pick<MeshTransportConfig, 'enabled'|'priorityTailscale'|'priorityLan'|'priorityCloudflare'|'bindHost'>` (imported the canonical type) so the phantom dict cannot be reintroduced by a hand-edit (compile-time proof).
|
|
10
|
+
2. **configCoherence.ts — Fix (b):** NEW exported pure function `checkMeshLiveStateCoherence(mm, isMultiMachine, live, warmupGraceMs?)` + the `MeshLiveState` interface + the exported `MESH_WARMUP_GRACE_MS` const. b.1 fires `mesh-config-off-but-live-on` on config-off + a NOT-LOOPBACK live bind (boundWide, corroborated-only by self-entry presence); b.2 fires `mesh-config-on-but-live-inert` on config-on + zero advertised endpoints + uptime past the warmup grace. NO-LEAK invariant: never interpolates a peer endpoint VALUE (counts + the process-local bound-host only); `selfEndpoints` is a boolean presence signal.
|
|
11
|
+
3. **server.ts — Fix (b) wiring:** `let meshResolvedBindHost: string | undefined` at OUTER function scope (beside `let getSelfMeshEndpoints`), ASSIGNED inside the mesh-init block via `resolveMeshBindHost` from the SAME `meshBindActive` inputs the AgentServer bind callsite uses (boot constant). The existing one-line `peerPresenceTimer` arrow was promoted to a named `peerPresenceTick` callback; the live-coherence recheck is APPENDED to it AFTER `pullOnce()`, gated `resolveDevAgentGate(config.monitoring?.meshCoherenceLiveCheck?.enabled, config)`. Transition-only emit (`_meshCoherenceLastCodes` Set + level-triggered reset) + emitCap (`_meshCoherenceEmitCounts`) + half-open-breaker backoff (`_meshCoherenceConsecFailures` / `_meshCoherenceTicksSinceAttempt`, MAX_BACKOFF_TICKS=20) + a healthy→failing latch (`_meshCoherenceFailing`) that transition-gates the `error` metric. Per-feature metric `mesh-coherence-live` (kind:'event', fired/noop/error) via `getFeatureMetricsRecorder()`.
|
|
12
|
+
4. **types.ts:** added `meshCoherenceLiveCheck?: { enabled?; warmupGraceMs?; emitCap? }` to `MonitoringConfig` (next to `growthAnalyst`).
|
|
13
|
+
5. **devGatedFeatures.ts:** added the `meshCoherenceLiveCheck` DEV_GATED_FEATURES entry (configPath `monitoring.meshCoherenceLiveCheck.enabled`). OMITTED from ConfigDefaults per the dev-gate convention → no `migrateConfig` needed.
|
|
14
|
+
|
|
15
|
+
## Blast radius
|
|
16
|
+
|
|
17
|
+
- **Fix (c) is behavior-narrowing then -widening, never wrong.** The dict check was ALWAYS dead (the dict is `undefined` for every shipped config), so removing it changes nothing for any real config; the new flat-key check only ADDS a warning for a genuine operator mistake (collision / non-positive) that previously sailed through unwarned. Both surfaces are advisory log lines — never a boot reject.
|
|
18
|
+
- **Fix (b) is config-gated, not wiring-gated.** With `meshCoherenceLiveCheck.enabled` resolving DARK (fleet), the `peerPresenceTick` coherence branch is a strict no-op — the tick does exactly what it did before (`pullOnce()`). `meshResolvedBindHost` is computed at boot regardless (cheap, pure), but it is read only inside the gated branch.
|
|
19
|
+
- **No new HTTP route, no new outbound surface.** Per spec, the warnings ride the existing `console.log(pc.yellow(...))` log path + the per-feature metric in `/metrics/features`. No Attention queue, no Telegram, no new route.
|
|
20
|
+
- **Machine-local.** Each machine evaluates its OWN config vs its OWN live bind/endpoints. No cross-machine fan-out, no pool-scope read.
|
|
21
|
+
- **The peerPresenceTimer refactor is behavior-preserving.** The named `peerPresenceTick` calls `pullOnce()` first (unchanged), then the gated coherence branch; the timer is still `setInterval(..., 30_000)` + `unref()`. The peer-presence-wiring test was updated to pin the pull inside the named tick fn.
|
|
22
|
+
|
|
23
|
+
## Risk + mitigation
|
|
24
|
+
|
|
25
|
+
- **Risk:** a corrupt/mid-write registry read (`getSelfMeshEndpoints()` → `loadRegistry`) throws and crashes the 30s tick. **Mitigation:** the live read is wrapped in try/catch; on failure it emits a TRANSITION-GATED `error` metric (one row per failure episode, not per tick), advances a capped backoff (≤1 attempt per ~10 min), and leaves the transition state untouched (fail toward silence). A successful read auto-resets the backoff and the latch. Proven by the sustained-failure integration test.
|
|
26
|
+
- **Risk:** a hostile/garbage peer-written self-entry steers the warning text (the registry is git-synced + peer-writable). **Mitigation:** the no-leak invariant — `selfEndpoints` is consumed as a boolean `length > 0` presence signal ONLY; warning strings interpolate only counts + the process-local operator-derived bound-host. Proven by the no-leak unit test (a hostile `url` never renders).
|
|
27
|
+
- **Risk:** b.1 false-silenced on a specific `meshTransport.bindHost` override (the original is-wildcard bug). **Mitigation:** `boundWide ≡ NOT-loopback` (mirrors `resolveMeshBindHost`'s `isLoopback`), so a specific non-loopback bind (e.g. 192.168.1.50) still fires. Proven by the R2-M10 regression test.
|
|
28
|
+
- **Risk:** b.2 false-fires during the legitimate boot-warmup window. **Mitigation:** a monotonic `process.uptime()` gate (default 2 min, overridable via `warmupGraceMs`); a permanently-inert mesh (first advertise never lands) still warns ~2 min after boot. Proven by the below/past-grace + param-override tests.
|
|
29
|
+
- **Risk:** the divergence line re-logs every 30s tick (repeated-true-line anti-pattern). **Mitigation:** transition-only emit with a level-triggered reset + an optional `emitCap` ceiling. Proven by the transition-only + emitCap integration tests.
|
|
30
|
+
|
|
31
|
+
## Migration parity
|
|
32
|
+
|
|
33
|
+
- `meshCoherenceLiveCheck` is OMITTED from ConfigDefaults (the dev-gate convention) → `resolveDevAgentGate` reads the absence directly, so NO `migrateConfig` change is needed (a backfilled `enabled:false` would defeat the gate). Stated explicitly in the spec (Decision #2).
|
|
34
|
+
- No CLAUDE.md template change: this is a signal-only honesty fix to an existing internal boot check with no user-facing conversational surface (no route, no proactive trigger). The Agent Awareness Standard targets capabilities an agent surfaces to users; a more-honest internal log line is not one. (The docs-coverage ratchet for the new exported helper is handled in site/src/content/docs if it trips — see PR.)
|
|
35
|
+
|
|
36
|
+
## Dark-gate line-map
|
|
37
|
+
|
|
38
|
+
- UNCHANGED. `meshCoherenceLiveCheck` is OMITTED from ConfigDefaults.ts (no inline `enabled:` literal added there), so no `enabled:` line shifted. Verified: `node scripts/lint-dev-agent-dark-gate.js` → clean; `tests/unit/devGatedFeatures-wiring.test.ts` → green (the new entry resolves live-on-dev / dark-fleet against real ConfigDefaults).
|
|
39
|
+
|
|
40
|
+
## Rollback
|
|
41
|
+
|
|
42
|
+
- Fix (b): set `monitoring.meshCoherenceLiveCheck.enabled: false` (or leave dark on the fleet) → strict no-op. Full revert: remove the DEV_GATED_FEATURES entry + the types field + the server.ts wiring (restore the one-line arrow timer) + `checkMeshLiveStateCoherence`. Fix (c) is a pure improvement to an existing check; reverting it restores the dead dict check (not recommended).
|
|
43
|
+
|
|
44
|
+
## Tests
|
|
45
|
+
|
|
46
|
+
- `tests/unit/configCoherence.test.ts` — extended: Fix (c) flat-key validation (collision / zero / negative / float / Infinity / default-no-warn / single-key / dead-dict-ignored), Fix (b) both directions (b.1 wildcards + bindHost-override-flip MUST-fire + stale-self-entry-must-not-fire + corroboration-count + disabled-took-effect; b.2 below/past grace + on-and-advertising + warmupGraceMs param override; single-machine no-op; undefined no-throw; no-leak assertion).
|
|
47
|
+
- `tests/integration/mesh-coherence-live-check.test.ts` — the wiring STATE MACHINE: transition-only emit over 3 ticks + level-triggered reset, flag-DARK no-op, emitCap:2 ceiling, sustained-failure (one error row, never crashes, bounded re-probes, auto-recovery).
|
|
48
|
+
- `tests/unit/mesh-coherence-wiring.test.ts` — e2e/wiring tier: source-pins the inline wiring in server.ts (import, outer-scope let, resolveMeshBindHost assignment from the bind inputs, nested-?.enabled dev-gate, real live signals, both tuning knobs, the metric, the throw-safety try/catch, the existing boot call intact).
|
|
49
|
+
- `tests/unit/peer-presence-wiring.test.ts` — updated for the named-tick refactor (the pull now lives in `peerPresenceTick`).
|
|
50
|
+
|
|
51
|
+
## Agent awareness
|
|
52
|
+
|
|
53
|
+
- No CLAUDE.md template entry (signal-only internal honesty fix, no user-facing surface). <!-- tracked: mesh-coherence-live-state-honesty -->
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Side-Effects Review — Ownership Follows Live Work (release-on-complete + claim-on-spawn + double-dispatch recovery gate)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `ownership-follows-live-work`
|
|
4
|
+
**Date:** `2026-06-24`
|
|
5
|
+
**Author:** Echo (autonomous)
|
|
6
|
+
**Spec:** `docs/specs/ownership-follows-live-work.md` (converged, approved, 11 frontloaded decisions)
|
|
7
|
+
**Second-pass reviewer:** independent Phase-5 review (the operator owns the trace/commit/PR ceremony)
|
|
8
|
+
|
|
9
|
+
## Summary of the change
|
|
10
|
+
|
|
11
|
+
Three independent gaps let the multi-machine `SessionOwnership` record drift from
|
|
12
|
+
where the live session actually is. This change makes the record self-correcting,
|
|
13
|
+
removing the stale-`active` cause PR #1258's reaper-closeout gate had to compensate
|
|
14
|
+
for. All three parts ride ONE dark flag `multiMachine.ownershipFollowsLiveWork`
|
|
15
|
+
(OMITTED from ConfigDefaults → `resolveDevAgentGate`: live-on-dev / dark-on-fleet).
|
|
16
|
+
|
|
17
|
+
Files added:
|
|
18
|
+
- `src/core/ownershipFollowsLiveWork.ts` — pure decision helpers (`shouldReleaseOnComplete`
|
|
19
|
+
for Part A's gate incl. the FD9 session-identity guard; `planClaimOnSpawn` for Part
|
|
20
|
+
B; `ownershipNonce` — the FD10 single collision-resistant nonce source). Single-
|
|
21
|
+
sourced so the gate logic is unit-testable.
|
|
22
|
+
- `tests/unit/ownershipFollowsLiveWork.test.ts`, `tests/unit/ownershipFollowsLiveWork-recovery-gate.test.ts`,
|
|
23
|
+
`tests/integration/ownership-follows-live-work.test.ts`, `tests/e2e/ownership-follows-live-work-lifecycle.test.ts`.
|
|
24
|
+
- `upgrades/next/ownership-follows-live-work.md` — release fragment (agent-only / experimental).
|
|
25
|
+
|
|
26
|
+
Files modified:
|
|
27
|
+
- `src/commands/server.ts` — (A) a new flag-gated `sessionComplete` listener wired
|
|
28
|
+
INSIDE the durable-ownership block (the only scope where `ownReg`/`emitPlacement`/
|
|
29
|
+
`_meshSelfId` are in lexical view — an anchor correction, see below) issuing a
|
|
30
|
+
release CAS + the mandatory `emitPlacement`; (B) a hoisted
|
|
31
|
+
`_claimOwnershipForAutonomousSpawn` helper called from the AutonomousLivenessReconciler
|
|
32
|
+
`respawn` closure after a successful spawn; (D) Part-D deps wired into the
|
|
33
|
+
SessionRecovery construction + the `recoverStuckMessages` per-topic owner skip; a
|
|
34
|
+
shared `isOwnerReachableShared` helper used by BOTH Part-D gates.
|
|
35
|
+
- `src/monitoring/SessionRecovery.ts` — the Part-D recovery gate: new injected deps
|
|
36
|
+
on `SessionRecoveryDeps` + the `decideOwnershipForRecovery` decision method +
|
|
37
|
+
the forward/withhold/proceed handling at the top of `checkAndRecover`.
|
|
38
|
+
- `src/messaging/stuckMessageRecovery.ts` — the third Part-D site: an optional
|
|
39
|
+
`ownerElsewhereReachable` dep that SKIPS (leaves untouched) a topic owned by a
|
|
40
|
+
reachable peer.
|
|
41
|
+
- `src/core/types.ts` — the optional `multiMachine.ownershipFollowsLiveWork?: boolean`.
|
|
42
|
+
- `src/core/devGatedFeatures.ts` — the `DEV_GATED_FEATURES` registration.
|
|
43
|
+
|
|
44
|
+
## Anchor corrections (code-grounding discipline)
|
|
45
|
+
|
|
46
|
+
The spec's anchors were close but the code won in three places:
|
|
47
|
+
1. **Part A scope.** The spec said register the release handler "alongside the
|
|
48
|
+
existing `sessionComplete` handler (server.ts:13247)" assuming `ownReg`/`_meshSelfId`
|
|
49
|
+
were in scope there. They are NOT — they are declared in a nested try-block textually
|
|
50
|
+
AFTER 13247. The handler is registered INSIDE that block (a session listener may be
|
|
51
|
+
added at any init point); functionally identical, correct scope.
|
|
52
|
+
2. **`getSessionForTopic` returns a session NAME, not a Session.** The spec's Part A
|
|
53
|
+
pseudocode read `liveForTopic.startedAt` off the result; the real method returns
|
|
54
|
+
`string | null`. The implementation resolves the name to the running Session via
|
|
55
|
+
`sessionManager.listRunningSessions()` and reads its `startedAt`.
|
|
56
|
+
3. **Part B/D scope.** Part B's claim is exposed via a hoisted helper so the respawn
|
|
57
|
+
closure (defined before the ownership block) can reach it; Part D's deps are
|
|
58
|
+
late-bound closures that read the registry/pool assigned later — both invoked at
|
|
59
|
+
runtime, after wiring.
|
|
60
|
+
|
|
61
|
+
## Decision-point inventory
|
|
62
|
+
|
|
63
|
+
- **Added (Part A — authority):** a `release` CAS callsite on `sessionComplete`, gated
|
|
64
|
+
by (a) flag+self, (b) owner===self & status active, (c) the FD9 session-identity
|
|
65
|
+
guard. Fail-CLOSED on every uncertainty (withhold the release). Paired with the
|
|
66
|
+
mandatory `emitPlacement('released')` (cas-emit-placement lint).
|
|
67
|
+
- **Added (Part B — authority):** a `place→claim` CAS pair on the autonomous respawn.
|
|
68
|
+
NEVER force-claims a peer-owned topic (FD3). Fail-CLOSED (withhold + one neutral
|
|
69
|
+
audit row on a post-gate owned-elsewhere race).
|
|
70
|
+
- **Added (Part D — SIGNAL, not authority):** a per-topic `ownerOf` read inside
|
|
71
|
+
`checkAndRecover` + `recoverStuckMessages` that can ONLY ever WITHHOLD a local
|
|
72
|
+
re-run / forward to the owner — never a new kill or send. Direction is MIXED and
|
|
73
|
+
labeled per state: reachable-peer→forward (fail-closed), unreachable-peer incl.
|
|
74
|
+
reachability-throw→withhold (fail-closed), null/self→proceed, ownerOf-throw→proceed
|
|
75
|
+
(fail-OPEN, instrumented). No existing decision boundary is removed or weakened.
|
|
76
|
+
|
|
77
|
+
No new HTTP route, no new repeating loop (Part A fires once per completion event,
|
|
78
|
+
Part B once per spawn, the recovery gate is a one-shot pre-respawn check).
|
|
79
|
+
|
|
80
|
+
## Roll-up across the seven review dimensions
|
|
81
|
+
|
|
82
|
+
1. **Over-block**: none on the user channel. Part D can only WITHHOLD a local recovery
|
|
83
|
+
re-run / forward it to the true owner — it never blocks a user message. Parts A/B
|
|
84
|
+
withhold an ownership WRITE on uncertainty (the safe direction); a withheld release
|
|
85
|
+
at worst leaves a stale `active` the existing reconciler + PR #1258 closeout still
|
|
86
|
+
handle.
|
|
87
|
+
2. **Under-block**: none. No gate is loosened. Part B never force-claims; Part A never
|
|
88
|
+
releases a record it can't prove is the completed work's; Part D's fail-OPEN branch
|
|
89
|
+
is narrowly the registry-unreadable case (an already-broken state) and is counted.
|
|
90
|
+
3. **Level-of-abstraction fit**: correct. The A/B decision logic is single-sourced in a
|
|
91
|
+
pure helper module (unit-testable); the CAS + emitPlacement pairing stays at the
|
|
92
|
+
server wiring site where those deps live. Part D's decision lives in SessionRecovery
|
|
93
|
+
(its deps are injected) with the primitives bound at server init.
|
|
94
|
+
4. **Signal-vs-authority compliance**: Parts A/B issue real AUTHORITY through the SAME
|
|
95
|
+
guarded `SessionOwnershipRegistry.cas()` FSM at a fenced `epoch+1` (no new FSM
|
|
96
|
+
transition, no new authority surface). Part D's `ownerOf` is a SIGNAL. Every new
|
|
97
|
+
try/catch is either an `@silent-fallback-ok` best-effort observability path or a
|
|
98
|
+
deliberate fail-closed/fail-open branch documented in code — complies with the
|
|
99
|
+
no-silent-fallbacks posture (lint green).
|
|
100
|
+
5. **Interactions**: writes to the EXISTING replicated ownership lifecycle (same
|
|
101
|
+
`emitPlacement` → coherence journal → OwnershipApplier path the user-move
|
|
102
|
+
release/transfer already use), so a Part A release / Part B claim replicates exactly
|
|
103
|
+
like today's releases. The `isOwnerReachable` signal is the SAME
|
|
104
|
+
`machinePoolRegistry.getCapacity(owner).online` the router uses (shared helper — the
|
|
105
|
+
two Part-D gates can't diverge). No new shared state.
|
|
106
|
+
6. **External surfaces**: NONE. No new endpoint, no egress, no third-party spend, no
|
|
107
|
+
destructive fs/git action. The only new on-disk writes are append-only neutral audit
|
|
108
|
+
rows to the EXISTING machine-local `logs/sentinel-events.jsonl` /
|
|
109
|
+
`logs/autonomous-liveness.jsonl`. Single-machine agents are a strict no-op.
|
|
110
|
+
7. **Rollback cost**: low. Dev-gated dark on the fleet; a config flip force-darks even a
|
|
111
|
+
dev agent. The flag OFF / single-machine path is byte-identical to today (locked by
|
|
112
|
+
the flag-OFF regression tests across all three tiers). No migration needed (the flag
|
|
113
|
+
is omitted from ConfigDefaults — the gate decides at runtime).
|
|
114
|
+
|
|
115
|
+
## Cross-machine / mixed-fleet note
|
|
116
|
+
|
|
117
|
+
The flag resolves PER-MACHINE, which is CORRECT here (unlike a transfer/placement
|
|
118
|
+
feature where half-activation strands a seat): each of A/B/D makes a strictly-MORE-correct
|
|
119
|
+
LOCAL decision (release a record we own, claim a record for a session we run, forward
|
|
120
|
+
instead of double-dispatch). A gate-ON machine self-corrects its own records; a gate-OFF
|
|
121
|
+
peer keeps today's (stale-prone) behavior — no torn/corrupt cross-machine state (each CAS
|
|
122
|
+
is fenced; a gate-OFF machine simply omits some releases/claims, which the existing
|
|
123
|
+
reconciler/applier already tolerate). During the mixed-fleet soak, PR #1258's
|
|
124
|
+
liveness-snapshot gate REMAINS the defense against a peer whose applier is lagged — which
|
|
125
|
+
is why its retirement is a SEPARATE, evidence-gated follow-up after the A/B soak, not
|
|
126
|
+
bundled here. This change does NOT touch `SessionReaper.ts` (PR #1258 owns it) or the FSM
|
|
127
|
+
transitions.
|
|
128
|
+
|
|
129
|
+
## Evidence pointers
|
|
130
|
+
|
|
131
|
+
- `npx tsc --noEmit` — clean.
|
|
132
|
+
- `npm run lint` — green (incl. `lint-cas-emit-placement`: 12 CAS sites all paired;
|
|
133
|
+
`lint-dev-agent-dark-gate`; `lint-no-direct-destructive`; `lint-no-unbounded-llm-spawn`).
|
|
134
|
+
- New tests (66, all green): unit (26 + 10 + 3-added), integration (6), e2e (7).
|
|
135
|
+
- Legacy regression green: SessionOwnership, SessionOwnershipRegistry, SessionRecovery,
|
|
136
|
+
the three session-reaper suites (PR #1258 area), OwnershipReconciler, OwnershipApplier,
|
|
137
|
+
devGatedFeatures-wiring (validates the new dev-gated entry — 117 tests).
|