@adhdev/daemon-standalone 0.9.82-rc.37 → 0.9.82-rc.38
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/index.js +51 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -48985,6 +48985,43 @@ ${block}`);
|
|
|
48985
48985
|
const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
|
|
48986
48986
|
const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
|
|
48987
48987
|
const localMachineId = loadConfig2().machineId || "";
|
|
48988
|
+
const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
|
|
48989
|
+
const directTruth = requireDirectPeerTruth ? await hydrateInlineMeshDirectTruth({
|
|
48990
|
+
mesh,
|
|
48991
|
+
meshSource: meshRecord.source,
|
|
48992
|
+
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
48993
|
+
statusInstanceId: this.deps.statusInstanceId,
|
|
48994
|
+
localMachineId
|
|
48995
|
+
}) : {
|
|
48996
|
+
directEvidenceCount: 0,
|
|
48997
|
+
localConfirmedCount: 0,
|
|
48998
|
+
peerAttemptedCount: 0,
|
|
48999
|
+
peerConfirmedCount: 0,
|
|
49000
|
+
unavailableNodeIds: []
|
|
49001
|
+
};
|
|
49002
|
+
const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
|
|
49003
|
+
if (requireDirectPeerTruth && !directTruthSatisfied) {
|
|
49004
|
+
return {
|
|
49005
|
+
success: false,
|
|
49006
|
+
code: "mesh_direct_peer_truth_unavailable",
|
|
49007
|
+
error: "Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.",
|
|
49008
|
+
sourceOfTruth: {
|
|
49009
|
+
membership: meshRecord.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
|
|
49010
|
+
coordinatorOwnsLiveTruth: false,
|
|
49011
|
+
currentStatus: "direct_peer_truth_unavailable",
|
|
49012
|
+
directPeerTruth: {
|
|
49013
|
+
required: true,
|
|
49014
|
+
satisfied: false,
|
|
49015
|
+
directEvidenceCount: directTruth.directEvidenceCount,
|
|
49016
|
+
localConfirmedCount: directTruth.localConfirmedCount,
|
|
49017
|
+
peerAttemptedCount: directTruth.peerAttemptedCount,
|
|
49018
|
+
peerConfirmedCount: directTruth.peerConfirmedCount,
|
|
49019
|
+
unavailableNodeIds: directTruth.unavailableNodeIds
|
|
49020
|
+
}
|
|
49021
|
+
}
|
|
49022
|
+
};
|
|
49023
|
+
}
|
|
49024
|
+
const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
|
|
48988
49025
|
const selectedCoordinatorNodeId = readStringValue(
|
|
48989
49026
|
mesh.coordinator?.preferredNodeId,
|
|
48990
49027
|
mesh.nodes?.[0]?.id,
|
|
@@ -49080,7 +49117,7 @@ ${block}`);
|
|
|
49080
49117
|
status.git = inlineTransitGit;
|
|
49081
49118
|
status.health = inlineTransitGit.isGitRepo ? deriveMeshNodeHealthFromGit(inlineTransitGit) : "degraded";
|
|
49082
49119
|
remoteProbeApplied = true;
|
|
49083
|
-
} else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
|
|
49120
|
+
} else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
|
|
49084
49121
|
try {
|
|
49085
49122
|
const remoteGit = await probeRemoteMeshGitStatus({
|
|
49086
49123
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
@@ -49171,7 +49208,19 @@ ${block}`);
|
|
|
49171
49208
|
refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
49172
49209
|
sourceOfTruth: {
|
|
49173
49210
|
membership: meshRecord?.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord?.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
|
|
49174
|
-
coordinatorOwnsLiveTruth:
|
|
49211
|
+
coordinatorOwnsLiveTruth: directTruthSatisfied,
|
|
49212
|
+
...requireDirectPeerTruth ? {
|
|
49213
|
+
currentStatus: directTruthSatisfied ? "live_git_and_session_probes" : "direct_peer_truth_unavailable",
|
|
49214
|
+
directPeerTruth: {
|
|
49215
|
+
required: true,
|
|
49216
|
+
satisfied: directTruthSatisfied,
|
|
49217
|
+
directEvidenceCount: directTruth.directEvidenceCount,
|
|
49218
|
+
localConfirmedCount: directTruth.localConfirmedCount,
|
|
49219
|
+
peerAttemptedCount: directTruth.peerAttemptedCount,
|
|
49220
|
+
peerConfirmedCount: directTruth.peerConfirmedCount,
|
|
49221
|
+
unavailableNodeIds: directTruth.unavailableNodeIds
|
|
49222
|
+
}
|
|
49223
|
+
} : {},
|
|
49175
49224
|
historicalEvidenceOnly: ["recoveryHints", "ledger.summary", "queue.summary"]
|
|
49176
49225
|
},
|
|
49177
49226
|
nodes: nodeStatuses,
|