adhdev 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 CHANGED
@@ -48620,6 +48620,43 @@ ${block}`);
48620
48620
  const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
48621
48621
  const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
48622
48622
  const localMachineId = loadConfig().machineId || "";
48623
+ const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
48624
+ const directTruth = requireDirectPeerTruth ? await hydrateInlineMeshDirectTruth({
48625
+ mesh,
48626
+ meshSource: meshRecord.source,
48627
+ dispatchMeshCommand: this.deps.dispatchMeshCommand,
48628
+ statusInstanceId: this.deps.statusInstanceId,
48629
+ localMachineId
48630
+ }) : {
48631
+ directEvidenceCount: 0,
48632
+ localConfirmedCount: 0,
48633
+ peerAttemptedCount: 0,
48634
+ peerConfirmedCount: 0,
48635
+ unavailableNodeIds: []
48636
+ };
48637
+ const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
48638
+ if (requireDirectPeerTruth && !directTruthSatisfied) {
48639
+ return {
48640
+ success: false,
48641
+ code: "mesh_direct_peer_truth_unavailable",
48642
+ error: "Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.",
48643
+ sourceOfTruth: {
48644
+ membership: meshRecord.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
48645
+ coordinatorOwnsLiveTruth: false,
48646
+ currentStatus: "direct_peer_truth_unavailable",
48647
+ directPeerTruth: {
48648
+ required: true,
48649
+ satisfied: false,
48650
+ directEvidenceCount: directTruth.directEvidenceCount,
48651
+ localConfirmedCount: directTruth.localConfirmedCount,
48652
+ peerAttemptedCount: directTruth.peerAttemptedCount,
48653
+ peerConfirmedCount: directTruth.peerConfirmedCount,
48654
+ unavailableNodeIds: directTruth.unavailableNodeIds
48655
+ }
48656
+ }
48657
+ };
48658
+ }
48659
+ const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
48623
48660
  const selectedCoordinatorNodeId = readStringValue(
48624
48661
  mesh.coordinator?.preferredNodeId,
48625
48662
  mesh.nodes?.[0]?.id,
@@ -48715,7 +48752,7 @@ ${block}`);
48715
48752
  status.git = inlineTransitGit;
48716
48753
  status.health = inlineTransitGit.isGitRepo ? deriveMeshNodeHealthFromGit(inlineTransitGit) : "degraded";
48717
48754
  remoteProbeApplied = true;
48718
- } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
48755
+ } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
48719
48756
  try {
48720
48757
  const remoteGit = await probeRemoteMeshGitStatus({
48721
48758
  dispatchMeshCommand: this.deps.dispatchMeshCommand,
@@ -48806,7 +48843,19 @@ ${block}`);
48806
48843
  refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
48807
48844
  sourceOfTruth: {
48808
48845
  membership: meshRecord?.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord?.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
48809
- coordinatorOwnsLiveTruth: meshRecord?.source !== "inline_bootstrap",
48846
+ coordinatorOwnsLiveTruth: directTruthSatisfied,
48847
+ ...requireDirectPeerTruth ? {
48848
+ currentStatus: directTruthSatisfied ? "live_git_and_session_probes" : "direct_peer_truth_unavailable",
48849
+ directPeerTruth: {
48850
+ required: true,
48851
+ satisfied: directTruthSatisfied,
48852
+ directEvidenceCount: directTruth.directEvidenceCount,
48853
+ localConfirmedCount: directTruth.localConfirmedCount,
48854
+ peerAttemptedCount: directTruth.peerAttemptedCount,
48855
+ peerConfirmedCount: directTruth.peerConfirmedCount,
48856
+ unavailableNodeIds: directTruth.unavailableNodeIds
48857
+ }
48858
+ } : {},
48810
48859
  historicalEvidenceOnly: ["recoveryHints", "ledger.summary", "queue.summary"]
48811
48860
  },
48812
48861
  nodes: nodeStatuses,
@@ -67779,7 +67828,7 @@ var init_adhdev_daemon = __esm({
67779
67828
  init_version();
67780
67829
  init_src();
67781
67830
  init_runtime_defaults();
67782
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.82-rc.37" });
67831
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.82-rc.38" });
67783
67832
  AdhdevDaemon = class _AdhdevDaemon {
67784
67833
  localHttpServer = null;
67785
67834
  localWss = null;