@adhdev/daemon-core 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.mjs CHANGED
@@ -26772,6 +26772,43 @@ ${block}`);
26772
26772
  const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
26773
26773
  const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
26774
26774
  const localMachineId = loadConfig().machineId || "";
26775
+ const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
26776
+ const directTruth = requireDirectPeerTruth ? await hydrateInlineMeshDirectTruth({
26777
+ mesh,
26778
+ meshSource: meshRecord.source,
26779
+ dispatchMeshCommand: this.deps.dispatchMeshCommand,
26780
+ statusInstanceId: this.deps.statusInstanceId,
26781
+ localMachineId
26782
+ }) : {
26783
+ directEvidenceCount: 0,
26784
+ localConfirmedCount: 0,
26785
+ peerAttemptedCount: 0,
26786
+ peerConfirmedCount: 0,
26787
+ unavailableNodeIds: []
26788
+ };
26789
+ const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
26790
+ if (requireDirectPeerTruth && !directTruthSatisfied) {
26791
+ return {
26792
+ success: false,
26793
+ code: "mesh_direct_peer_truth_unavailable",
26794
+ error: "Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.",
26795
+ sourceOfTruth: {
26796
+ membership: meshRecord.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
26797
+ coordinatorOwnsLiveTruth: false,
26798
+ currentStatus: "direct_peer_truth_unavailable",
26799
+ directPeerTruth: {
26800
+ required: true,
26801
+ satisfied: false,
26802
+ directEvidenceCount: directTruth.directEvidenceCount,
26803
+ localConfirmedCount: directTruth.localConfirmedCount,
26804
+ peerAttemptedCount: directTruth.peerAttemptedCount,
26805
+ peerConfirmedCount: directTruth.peerConfirmedCount,
26806
+ unavailableNodeIds: directTruth.unavailableNodeIds
26807
+ }
26808
+ }
26809
+ };
26810
+ }
26811
+ const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
26775
26812
  const selectedCoordinatorNodeId = readStringValue(
26776
26813
  mesh.coordinator?.preferredNodeId,
26777
26814
  mesh.nodes?.[0]?.id,
@@ -26867,7 +26904,7 @@ ${block}`);
26867
26904
  status.git = inlineTransitGit;
26868
26905
  status.health = inlineTransitGit.isGitRepo ? deriveMeshNodeHealthFromGit(inlineTransitGit) : "degraded";
26869
26906
  remoteProbeApplied = true;
26870
- } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
26907
+ } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
26871
26908
  try {
26872
26909
  const remoteGit = await probeRemoteMeshGitStatus({
26873
26910
  dispatchMeshCommand: this.deps.dispatchMeshCommand,
@@ -26958,7 +26995,19 @@ ${block}`);
26958
26995
  refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
26959
26996
  sourceOfTruth: {
26960
26997
  membership: meshRecord?.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord?.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
26961
- coordinatorOwnsLiveTruth: meshRecord?.source !== "inline_bootstrap",
26998
+ coordinatorOwnsLiveTruth: directTruthSatisfied,
26999
+ ...requireDirectPeerTruth ? {
27000
+ currentStatus: directTruthSatisfied ? "live_git_and_session_probes" : "direct_peer_truth_unavailable",
27001
+ directPeerTruth: {
27002
+ required: true,
27003
+ satisfied: directTruthSatisfied,
27004
+ directEvidenceCount: directTruth.directEvidenceCount,
27005
+ localConfirmedCount: directTruth.localConfirmedCount,
27006
+ peerAttemptedCount: directTruth.peerAttemptedCount,
27007
+ peerConfirmedCount: directTruth.peerConfirmedCount,
27008
+ unavailableNodeIds: directTruth.unavailableNodeIds
27009
+ }
27010
+ } : {},
26962
27011
  historicalEvidenceOnly: ["recoveryHints", "ledger.summary", "queue.summary"]
26963
27012
  },
26964
27013
  nodes: nodeStatuses,