@adhdev/daemon-core 0.9.82-rc.37 → 0.9.82-rc.39

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 CHANGED
@@ -27005,6 +27005,43 @@ ${block}`);
27005
27005
  const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
27006
27006
  const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
27007
27007
  const localMachineId = loadConfig().machineId || "";
27008
+ const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
27009
+ const directTruth = requireDirectPeerTruth ? await hydrateInlineMeshDirectTruth({
27010
+ mesh,
27011
+ meshSource: meshRecord.source,
27012
+ dispatchMeshCommand: this.deps.dispatchMeshCommand,
27013
+ statusInstanceId: this.deps.statusInstanceId,
27014
+ localMachineId
27015
+ }) : {
27016
+ directEvidenceCount: 0,
27017
+ localConfirmedCount: 0,
27018
+ peerAttemptedCount: 0,
27019
+ peerConfirmedCount: 0,
27020
+ unavailableNodeIds: []
27021
+ };
27022
+ const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
27023
+ if (requireDirectPeerTruth && !directTruthSatisfied) {
27024
+ return {
27025
+ success: false,
27026
+ code: "mesh_direct_peer_truth_unavailable",
27027
+ error: "Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.",
27028
+ sourceOfTruth: {
27029
+ membership: meshRecord.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
27030
+ coordinatorOwnsLiveTruth: false,
27031
+ currentStatus: "direct_peer_truth_unavailable",
27032
+ directPeerTruth: {
27033
+ required: true,
27034
+ satisfied: false,
27035
+ directEvidenceCount: directTruth.directEvidenceCount,
27036
+ localConfirmedCount: directTruth.localConfirmedCount,
27037
+ peerAttemptedCount: directTruth.peerAttemptedCount,
27038
+ peerConfirmedCount: directTruth.peerConfirmedCount,
27039
+ unavailableNodeIds: directTruth.unavailableNodeIds
27040
+ }
27041
+ }
27042
+ };
27043
+ }
27044
+ const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
27008
27045
  const selectedCoordinatorNodeId = readStringValue(
27009
27046
  mesh.coordinator?.preferredNodeId,
27010
27047
  mesh.nodes?.[0]?.id,
@@ -27100,7 +27137,7 @@ ${block}`);
27100
27137
  status.git = inlineTransitGit;
27101
27138
  status.health = inlineTransitGit.isGitRepo ? deriveMeshNodeHealthFromGit(inlineTransitGit) : "degraded";
27102
27139
  remoteProbeApplied = true;
27103
- } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
27140
+ } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
27104
27141
  try {
27105
27142
  const remoteGit = await probeRemoteMeshGitStatus({
27106
27143
  dispatchMeshCommand: this.deps.dispatchMeshCommand,
@@ -27191,7 +27228,19 @@ ${block}`);
27191
27228
  refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
27192
27229
  sourceOfTruth: {
27193
27230
  membership: meshRecord?.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord?.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
27194
- coordinatorOwnsLiveTruth: meshRecord?.source !== "inline_bootstrap",
27231
+ coordinatorOwnsLiveTruth: directTruthSatisfied,
27232
+ ...requireDirectPeerTruth ? {
27233
+ currentStatus: directTruthSatisfied ? "live_git_and_session_probes" : "direct_peer_truth_unavailable",
27234
+ directPeerTruth: {
27235
+ required: true,
27236
+ satisfied: directTruthSatisfied,
27237
+ directEvidenceCount: directTruth.directEvidenceCount,
27238
+ localConfirmedCount: directTruth.localConfirmedCount,
27239
+ peerAttemptedCount: directTruth.peerAttemptedCount,
27240
+ peerConfirmedCount: directTruth.peerConfirmedCount,
27241
+ unavailableNodeIds: directTruth.unavailableNodeIds
27242
+ }
27243
+ } : {},
27195
27244
  historicalEvidenceOnly: ["recoveryHints", "ledger.summary", "queue.summary"]
27196
27245
  },
27197
27246
  nodes: nodeStatuses,