@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.37",
3
+ "version": "0.9.82-rc.39",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3671,6 +3671,49 @@ export class DaemonCommandRouter {
3671
3671
  const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
3672
3672
 
3673
3673
  const localMachineId = loadConfig().machineId || '';
3674
+ const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
3675
+ const directTruth = requireDirectPeerTruth
3676
+ ? await hydrateInlineMeshDirectTruth({
3677
+ mesh,
3678
+ meshSource: meshRecord.source,
3679
+ dispatchMeshCommand: this.deps.dispatchMeshCommand,
3680
+ statusInstanceId: this.deps.statusInstanceId,
3681
+ localMachineId,
3682
+ })
3683
+ : {
3684
+ directEvidenceCount: 0,
3685
+ localConfirmedCount: 0,
3686
+ peerAttemptedCount: 0,
3687
+ peerConfirmedCount: 0,
3688
+ unavailableNodeIds: [] as string[],
3689
+ };
3690
+ const directTruthSatisfied = meshRecord.source !== 'inline_bootstrap' || directTruth.directEvidenceCount > 0;
3691
+ if (requireDirectPeerTruth && !directTruthSatisfied) {
3692
+ return {
3693
+ success: false,
3694
+ code: 'mesh_direct_peer_truth_unavailable',
3695
+ error: 'Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.',
3696
+ sourceOfTruth: {
3697
+ membership: meshRecord.source === 'inline_cache'
3698
+ ? 'coordinator_inline_mesh_cache'
3699
+ : meshRecord.source === 'local_config'
3700
+ ? 'local_mesh_config'
3701
+ : 'inline_bootstrap_snapshot',
3702
+ coordinatorOwnsLiveTruth: false,
3703
+ currentStatus: 'direct_peer_truth_unavailable',
3704
+ directPeerTruth: {
3705
+ required: true,
3706
+ satisfied: false,
3707
+ directEvidenceCount: directTruth.directEvidenceCount,
3708
+ localConfirmedCount: directTruth.localConfirmedCount,
3709
+ peerAttemptedCount: directTruth.peerAttemptedCount,
3710
+ peerConfirmedCount: directTruth.peerConfirmedCount,
3711
+ unavailableNodeIds: directTruth.unavailableNodeIds,
3712
+ },
3713
+ },
3714
+ };
3715
+ }
3716
+ const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
3674
3717
  const selectedCoordinatorNodeId = readStringValue(
3675
3718
  mesh.coordinator?.preferredNodeId,
3676
3719
  (mesh.nodes?.[0] as any)?.id,
@@ -3775,7 +3818,7 @@ export class DaemonCommandRouter {
3775
3818
  ? deriveMeshNodeHealthFromGit(inlineTransitGit as unknown as Record<string, unknown>)
3776
3819
  : 'degraded';
3777
3820
  remoteProbeApplied = true;
3778
- } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
3821
+ } else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
3779
3822
  try {
3780
3823
  const remoteGit = await probeRemoteMeshGitStatus({
3781
3824
  dispatchMeshCommand: this.deps.dispatchMeshCommand,
@@ -3885,7 +3928,19 @@ export class DaemonCommandRouter {
3885
3928
  : meshRecord?.source === 'local_config'
3886
3929
  ? 'local_mesh_config'
3887
3930
  : 'inline_bootstrap_snapshot',
3888
- coordinatorOwnsLiveTruth: meshRecord?.source !== 'inline_bootstrap',
3931
+ coordinatorOwnsLiveTruth: directTruthSatisfied,
3932
+ ...(requireDirectPeerTruth ? {
3933
+ currentStatus: directTruthSatisfied ? 'live_git_and_session_probes' : 'direct_peer_truth_unavailable',
3934
+ directPeerTruth: {
3935
+ required: true,
3936
+ satisfied: directTruthSatisfied,
3937
+ directEvidenceCount: directTruth.directEvidenceCount,
3938
+ localConfirmedCount: directTruth.localConfirmedCount,
3939
+ peerAttemptedCount: directTruth.peerAttemptedCount,
3940
+ peerConfirmedCount: directTruth.peerConfirmedCount,
3941
+ unavailableNodeIds: directTruth.unavailableNodeIds,
3942
+ },
3943
+ } : {}),
3889
3944
  historicalEvidenceOnly: ['recoveryHints', 'ledger.summary', 'queue.summary'],
3890
3945
  },
3891
3946
  nodes: nodeStatuses,