adhdev 0.9.82-rc.36 → 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/cli/index.js +245 -22
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +245 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/cli/index.js
CHANGED
|
@@ -47128,6 +47128,82 @@ function truncateValidationOutput(value) {
|
|
|
47128
47128
|
return `${text.slice(0, REFINE_VALIDATION_SUMMARY_CHARS)}
|
|
47129
47129
|
[truncated ${text.length - REFINE_VALIDATION_SUMMARY_CHARS} chars]`;
|
|
47130
47130
|
}
|
|
47131
|
+
function recordMeshRefineStage(stages, stage, status, startedAt, details) {
|
|
47132
|
+
stages.push({
|
|
47133
|
+
stage,
|
|
47134
|
+
status,
|
|
47135
|
+
durationMs: Date.now() - startedAt,
|
|
47136
|
+
...details || {}
|
|
47137
|
+
});
|
|
47138
|
+
}
|
|
47139
|
+
async function computeGitPatchId(cwd, fromRef, toRef) {
|
|
47140
|
+
const { execFileSync: execFileSync7 } = await import("child_process");
|
|
47141
|
+
const diff = execFileSync7("git", ["diff", "--patch", "--full-index", fromRef, toRef], {
|
|
47142
|
+
cwd,
|
|
47143
|
+
encoding: "utf8",
|
|
47144
|
+
maxBuffer: REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES
|
|
47145
|
+
});
|
|
47146
|
+
if (!diff.trim()) return "";
|
|
47147
|
+
const patchId = execFileSync7("git", ["patch-id", "--stable"], {
|
|
47148
|
+
cwd,
|
|
47149
|
+
input: diff,
|
|
47150
|
+
encoding: "utf8",
|
|
47151
|
+
maxBuffer: REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES
|
|
47152
|
+
}).trim();
|
|
47153
|
+
return patchId.split(/\s+/)[0] || "";
|
|
47154
|
+
}
|
|
47155
|
+
async function runMeshRefinePatchEquivalenceGate(repoRoot, baseHead, branchHead) {
|
|
47156
|
+
const startedAt = Date.now();
|
|
47157
|
+
try {
|
|
47158
|
+
const { execFileSync: execFileSync7 } = await import("child_process");
|
|
47159
|
+
const git = (args) => execFileSync7("git", args, {
|
|
47160
|
+
cwd: repoRoot,
|
|
47161
|
+
encoding: "utf8",
|
|
47162
|
+
maxBuffer: REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES
|
|
47163
|
+
});
|
|
47164
|
+
const mergeBase = git(["merge-base", baseHead, branchHead]).trim();
|
|
47165
|
+
const mergeTreeStdout = git(["merge-tree", "--write-tree", baseHead, branchHead]);
|
|
47166
|
+
const mergedTree = mergeTreeStdout.trim().split(/\s+/)[0] || "";
|
|
47167
|
+
if (!mergeBase || !mergedTree) {
|
|
47168
|
+
return {
|
|
47169
|
+
status: "failed",
|
|
47170
|
+
equivalent: false,
|
|
47171
|
+
baseHead,
|
|
47172
|
+
branchHead,
|
|
47173
|
+
mergeBase: mergeBase || void 0,
|
|
47174
|
+
mergedTree: mergedTree || void 0,
|
|
47175
|
+
durationMs: Date.now() - startedAt,
|
|
47176
|
+
error: "patch equivalence preflight could not resolve merge-base or synthetic merge tree",
|
|
47177
|
+
stdout: truncateValidationOutput(mergeTreeStdout)
|
|
47178
|
+
};
|
|
47179
|
+
}
|
|
47180
|
+
const expectedPatchId = await computeGitPatchId(repoRoot, mergeBase, branchHead);
|
|
47181
|
+
const actualPatchId = await computeGitPatchId(repoRoot, baseHead, mergedTree);
|
|
47182
|
+
const equivalent = expectedPatchId === actualPatchId;
|
|
47183
|
+
return {
|
|
47184
|
+
status: equivalent ? "passed" : "failed",
|
|
47185
|
+
equivalent,
|
|
47186
|
+
baseHead,
|
|
47187
|
+
branchHead,
|
|
47188
|
+
mergeBase,
|
|
47189
|
+
mergedTree,
|
|
47190
|
+
expectedPatchId,
|
|
47191
|
+
actualPatchId,
|
|
47192
|
+
durationMs: Date.now() - startedAt
|
|
47193
|
+
};
|
|
47194
|
+
} catch (e) {
|
|
47195
|
+
return {
|
|
47196
|
+
status: "failed",
|
|
47197
|
+
equivalent: false,
|
|
47198
|
+
baseHead,
|
|
47199
|
+
branchHead,
|
|
47200
|
+
durationMs: Date.now() - startedAt,
|
|
47201
|
+
error: e?.message || String(e),
|
|
47202
|
+
stdout: truncateValidationOutput(e?.stdout),
|
|
47203
|
+
stderr: truncateValidationOutput(e?.stderr)
|
|
47204
|
+
};
|
|
47205
|
+
}
|
|
47206
|
+
}
|
|
47131
47207
|
function readPackageScripts(workspace) {
|
|
47132
47208
|
try {
|
|
47133
47209
|
const packageJsonPath = (0, import_path7.join)(workspace, "package.json");
|
|
@@ -47471,7 +47547,7 @@ function summarizeSessionHostPruneResult(result) {
|
|
|
47471
47547
|
keptCount: Array.isArray(value.keptSessionIds) ? value.keptSessionIds.length : void 0
|
|
47472
47548
|
};
|
|
47473
47549
|
}
|
|
47474
|
-
var import_os4, import_path7, fs10, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
47550
|
+
var import_os4, import_path7, fs10, CHANNEL_NPM_TAG, CHANNEL_SERVER_URL, REFINE_VALIDATION_CATEGORIES, REFINE_VALIDATION_TIMEOUT_MS, REFINE_VALIDATION_OUTPUT_LIMIT_BYTES, REFINE_VALIDATION_SUMMARY_CHARS, REFINE_VALIDATION_MAX_COMMANDS, REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES, CHAT_COMMANDS, READ_DEBUG_ENABLED2, DaemonCommandRouter;
|
|
47475
47551
|
var init_router = __esm({
|
|
47476
47552
|
"../../oss/packages/daemon-core/src/commands/router.ts"() {
|
|
47477
47553
|
"use strict";
|
|
@@ -47513,6 +47589,7 @@ var init_router = __esm({
|
|
|
47513
47589
|
REFINE_VALIDATION_OUTPUT_LIMIT_BYTES = 128 * 1024;
|
|
47514
47590
|
REFINE_VALIDATION_SUMMARY_CHARS = 2e3;
|
|
47515
47591
|
REFINE_VALIDATION_MAX_COMMANDS = 4;
|
|
47592
|
+
REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES = 4 * 1024 * 1024;
|
|
47516
47593
|
CHAT_COMMANDS = [
|
|
47517
47594
|
"send_chat",
|
|
47518
47595
|
"new_chat",
|
|
@@ -48814,26 +48891,41 @@ var init_router = __esm({
|
|
|
48814
48891
|
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
48815
48892
|
const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
|
|
48816
48893
|
if (!meshId || !nodeId) return { success: false, error: "meshId and nodeId required" };
|
|
48894
|
+
const refineStages = [];
|
|
48817
48895
|
try {
|
|
48818
48896
|
const meshRecord = await this.getMeshForCommand(meshId, args?.inlineMesh);
|
|
48819
48897
|
const mesh = meshRecord?.mesh;
|
|
48820
48898
|
const node = mesh?.nodes?.find((n) => n.id === nodeId || n.nodeId === nodeId);
|
|
48821
|
-
if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh
|
|
48899
|
+
if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh`, refineStages };
|
|
48822
48900
|
if (!node.isLocalWorktree || !node.workspace) {
|
|
48823
|
-
return { success: false, error: `Refinery requires a local worktree node
|
|
48901
|
+
return { success: false, error: `Refinery requires a local worktree node`, refineStages };
|
|
48824
48902
|
}
|
|
48825
48903
|
const sourceNode = node.clonedFromNodeId ? mesh?.nodes.find((n) => n.id === node.clonedFromNodeId || n.nodeId === node.clonedFromNodeId) : mesh?.nodes.find((n) => !n.isLocalWorktree);
|
|
48826
48904
|
const repoRoot = sourceNode?.repoRoot || sourceNode?.workspace;
|
|
48827
|
-
if (!repoRoot) return { success: false, error: "Source node repoRoot not found" };
|
|
48905
|
+
if (!repoRoot) return { success: false, error: "Source node repoRoot not found", refineStages };
|
|
48828
48906
|
const { execFile: execFile3 } = await import("child_process");
|
|
48829
48907
|
const { promisify: promisify3 } = await import("util");
|
|
48830
48908
|
const execFileAsync3 = promisify3(execFile3);
|
|
48909
|
+
const resolveStarted = Date.now();
|
|
48831
48910
|
const { stdout: branchStdout } = await execFileAsync3("git", ["branch", "--show-current"], { cwd: node.workspace, encoding: "utf8" });
|
|
48832
48911
|
const branch = branchStdout.trim();
|
|
48833
|
-
if (!branch) return { success: false, error: "Could not determine branch of the worktree node" };
|
|
48912
|
+
if (!branch) return { success: false, error: "Could not determine branch of the worktree node", refineStages };
|
|
48834
48913
|
const { stdout: baseBranchStdout } = await execFileAsync3("git", ["branch", "--show-current"], { cwd: repoRoot, encoding: "utf8" });
|
|
48835
48914
|
const baseBranch = baseBranchStdout.trim();
|
|
48915
|
+
const { stdout: baseHeadStdout } = await execFileAsync3("git", ["rev-parse", "HEAD"], { cwd: repoRoot, encoding: "utf8" });
|
|
48916
|
+
const { stdout: branchHeadStdout } = await execFileAsync3("git", ["rev-parse", branch], { cwd: node.workspace, encoding: "utf8" });
|
|
48917
|
+
const baseHead = baseHeadStdout.trim();
|
|
48918
|
+
const branchHead = branchHeadStdout.trim();
|
|
48919
|
+
recordMeshRefineStage(refineStages, "resolve_refs", "passed", resolveStarted, { branch, baseBranch, baseHead, branchHead });
|
|
48920
|
+
const validationStarted = Date.now();
|
|
48836
48921
|
const validationSummary = await runMeshRefineValidationGate(mesh, node.workspace);
|
|
48922
|
+
recordMeshRefineStage(
|
|
48923
|
+
refineStages,
|
|
48924
|
+
"validation",
|
|
48925
|
+
validationSummary.status === "passed" ? "passed" : validationSummary.status === "failed" ? "failed" : "skipped",
|
|
48926
|
+
validationStarted,
|
|
48927
|
+
{ validationStatus: validationSummary.status, commandsRun: validationSummary.commandsRun.length }
|
|
48928
|
+
);
|
|
48837
48929
|
if (validationSummary.status === "failed") {
|
|
48838
48930
|
return {
|
|
48839
48931
|
success: false,
|
|
@@ -48843,6 +48935,7 @@ var init_router = __esm({
|
|
|
48843
48935
|
branch,
|
|
48844
48936
|
into: baseBranch,
|
|
48845
48937
|
validationSummary,
|
|
48938
|
+
refineStages,
|
|
48846
48939
|
finalBranchConvergenceState: {
|
|
48847
48940
|
branch,
|
|
48848
48941
|
baseBranch,
|
|
@@ -48862,6 +48955,7 @@ var init_router = __esm({
|
|
|
48862
48955
|
branch,
|
|
48863
48956
|
into: baseBranch,
|
|
48864
48957
|
validationSummary,
|
|
48958
|
+
refineStages,
|
|
48865
48959
|
finalBranchConvergenceState: {
|
|
48866
48960
|
branch,
|
|
48867
48961
|
baseBranch,
|
|
@@ -48872,37 +48966,121 @@ var init_router = __esm({
|
|
|
48872
48966
|
}
|
|
48873
48967
|
};
|
|
48874
48968
|
}
|
|
48969
|
+
const patchEquivalenceStarted = Date.now();
|
|
48970
|
+
const patchEquivalence = await runMeshRefinePatchEquivalenceGate(repoRoot, baseHead, branchHead);
|
|
48971
|
+
recordMeshRefineStage(refineStages, "patch_equivalence", patchEquivalence.status, patchEquivalenceStarted, {
|
|
48972
|
+
equivalent: patchEquivalence.equivalent,
|
|
48973
|
+
expectedPatchId: patchEquivalence.expectedPatchId,
|
|
48974
|
+
actualPatchId: patchEquivalence.actualPatchId,
|
|
48975
|
+
error: patchEquivalence.error
|
|
48976
|
+
});
|
|
48977
|
+
if (!patchEquivalence.equivalent) {
|
|
48978
|
+
return {
|
|
48979
|
+
success: false,
|
|
48980
|
+
code: "patch_equivalence_failed",
|
|
48981
|
+
convergenceStatus: "blocked_review",
|
|
48982
|
+
error: "Refinery patch-equivalence preflight failed; merge/refine was not attempted.",
|
|
48983
|
+
branch,
|
|
48984
|
+
into: baseBranch,
|
|
48985
|
+
validationSummary,
|
|
48986
|
+
patchEquivalence,
|
|
48987
|
+
refineStages,
|
|
48988
|
+
finalBranchConvergenceState: {
|
|
48989
|
+
branch,
|
|
48990
|
+
baseBranch,
|
|
48991
|
+
merged: false,
|
|
48992
|
+
removed: false,
|
|
48993
|
+
validation: "passed",
|
|
48994
|
+
patchEquivalence: "failed",
|
|
48995
|
+
status: "blocked_review"
|
|
48996
|
+
}
|
|
48997
|
+
};
|
|
48998
|
+
}
|
|
48999
|
+
let mergeResult;
|
|
49000
|
+
const mergeStarted = Date.now();
|
|
48875
49001
|
try {
|
|
48876
|
-
await execFileAsync3("git", ["merge", "--no-ff", branch, "-m", `Auto-merge branch '${branch}' via Refinery`], { cwd: repoRoot, encoding: "utf8" });
|
|
49002
|
+
const result = await execFileAsync3("git", ["merge", "--no-ff", branch, "-m", `Auto-merge branch '${branch}' via Refinery`], { cwd: repoRoot, encoding: "utf8" });
|
|
49003
|
+
mergeResult = {
|
|
49004
|
+
stdout: truncateValidationOutput(result.stdout),
|
|
49005
|
+
stderr: truncateValidationOutput(result.stderr),
|
|
49006
|
+
durationMs: Date.now() - mergeStarted
|
|
49007
|
+
};
|
|
49008
|
+
recordMeshRefineStage(refineStages, "merge", "passed", mergeStarted, mergeResult);
|
|
48877
49009
|
} catch (e) {
|
|
49010
|
+
recordMeshRefineStage(refineStages, "merge", "failed", mergeStarted, {
|
|
49011
|
+
error: e?.message || String(e),
|
|
49012
|
+
stdout: truncateValidationOutput(e?.stdout),
|
|
49013
|
+
stderr: truncateValidationOutput(e?.stderr)
|
|
49014
|
+
});
|
|
48878
49015
|
return {
|
|
48879
49016
|
success: false,
|
|
48880
49017
|
error: `Merge failed (conflicts?): ${e.message}`,
|
|
48881
49018
|
validationSummary,
|
|
49019
|
+
patchEquivalence,
|
|
49020
|
+
refineStages,
|
|
48882
49021
|
finalBranchConvergenceState: {
|
|
48883
49022
|
branch,
|
|
48884
49023
|
baseBranch,
|
|
48885
49024
|
merged: false,
|
|
48886
49025
|
removed: false,
|
|
48887
49026
|
validation: "passed",
|
|
49027
|
+
patchEquivalence: "passed",
|
|
48888
49028
|
status: "not_mergeable"
|
|
48889
49029
|
}
|
|
48890
49030
|
};
|
|
48891
49031
|
}
|
|
49032
|
+
const cleanupStarted = Date.now();
|
|
48892
49033
|
const removeResult = await this.execute("remove_mesh_node", {
|
|
48893
49034
|
meshId,
|
|
48894
49035
|
nodeId,
|
|
48895
|
-
sessionCleanupMode: "
|
|
49036
|
+
sessionCleanupMode: "preserve",
|
|
48896
49037
|
inlineMesh: args?.inlineMesh
|
|
48897
49038
|
});
|
|
49039
|
+
recordMeshRefineStage(refineStages, "cleanup", removeResult?.success === false ? "failed" : "passed", cleanupStarted, {
|
|
49040
|
+
removed: removeResult?.removed,
|
|
49041
|
+
code: removeResult?.code,
|
|
49042
|
+
error: removeResult?.error
|
|
49043
|
+
});
|
|
49044
|
+
let ledgerError;
|
|
49045
|
+
const ledgerStarted = Date.now();
|
|
48898
49046
|
try {
|
|
48899
49047
|
const { appendLedgerEntry: appendLedgerEntry2 } = await Promise.resolve().then(() => (init_mesh_ledger(), mesh_ledger_exports));
|
|
48900
49048
|
appendLedgerEntry2(meshId, {
|
|
48901
49049
|
kind: "node_removed",
|
|
48902
49050
|
nodeId,
|
|
48903
|
-
payload: { refined: true, mergedBranch: branch, into: baseBranch, validationSummary }
|
|
49051
|
+
payload: { refined: true, mergedBranch: branch, into: baseBranch, validationSummary, patchEquivalence }
|
|
48904
49052
|
});
|
|
48905
|
-
|
|
49053
|
+
recordMeshRefineStage(refineStages, "ledger", "passed", ledgerStarted);
|
|
49054
|
+
} catch (e) {
|
|
49055
|
+
ledgerError = e?.message || String(e);
|
|
49056
|
+
recordMeshRefineStage(refineStages, "ledger", "failed", ledgerStarted, { error: ledgerError });
|
|
49057
|
+
}
|
|
49058
|
+
const finalBranchConvergenceState = {
|
|
49059
|
+
branch: baseBranch,
|
|
49060
|
+
mergedBranch: branch,
|
|
49061
|
+
baseBranch,
|
|
49062
|
+
merged: true,
|
|
49063
|
+
removed: removeResult?.success !== false,
|
|
49064
|
+
validation: "passed",
|
|
49065
|
+
patchEquivalence: "passed",
|
|
49066
|
+
status: removeResult?.success === false ? "merged_cleanup_failed" : "merged"
|
|
49067
|
+
};
|
|
49068
|
+
if (removeResult?.success === false) {
|
|
49069
|
+
return {
|
|
49070
|
+
success: false,
|
|
49071
|
+
code: "cleanup_failed",
|
|
49072
|
+
error: "Refinery merge completed but worktree cleanup failed; manual cleanup/retry is required.",
|
|
49073
|
+
merged: true,
|
|
49074
|
+
branch,
|
|
49075
|
+
into: baseBranch,
|
|
49076
|
+
removeResult,
|
|
49077
|
+
validationSummary,
|
|
49078
|
+
patchEquivalence,
|
|
49079
|
+
mergeResult,
|
|
49080
|
+
refineStages,
|
|
49081
|
+
...ledgerError ? { ledgerError } : {},
|
|
49082
|
+
finalBranchConvergenceState
|
|
49083
|
+
};
|
|
48906
49084
|
}
|
|
48907
49085
|
return {
|
|
48908
49086
|
success: true,
|
|
@@ -48911,18 +49089,14 @@ var init_router = __esm({
|
|
|
48911
49089
|
into: baseBranch,
|
|
48912
49090
|
removeResult,
|
|
48913
49091
|
validationSummary,
|
|
48914
|
-
|
|
48915
|
-
|
|
48916
|
-
|
|
48917
|
-
|
|
48918
|
-
|
|
48919
|
-
removed: removeResult?.success !== false,
|
|
48920
|
-
validation: "passed",
|
|
48921
|
-
status: removeResult?.success === false ? "merged_cleanup_failed" : "merged"
|
|
48922
|
-
}
|
|
49092
|
+
patchEquivalence,
|
|
49093
|
+
mergeResult,
|
|
49094
|
+
refineStages,
|
|
49095
|
+
...ledgerError ? { ledgerError } : {},
|
|
49096
|
+
finalBranchConvergenceState
|
|
48923
49097
|
};
|
|
48924
49098
|
} catch (e) {
|
|
48925
|
-
return { success: false, error: e.message };
|
|
49099
|
+
return { success: false, error: e.message, refineStages };
|
|
48926
49100
|
}
|
|
48927
49101
|
}
|
|
48928
49102
|
case "remove_mesh_node": {
|
|
@@ -49434,6 +49608,43 @@ ${block}`);
|
|
|
49434
49608
|
const sessionHostRecords = this.deps.sessionHostControl?.listSessions ? await this.deps.sessionHostControl.listSessions().catch(() => []) : [];
|
|
49435
49609
|
const liveMeshSessions = partitionSessionHostRecords(Array.isArray(sessionHostRecords) ? sessionHostRecords : []).liveRuntimes;
|
|
49436
49610
|
const localMachineId = loadConfig().machineId || "";
|
|
49611
|
+
const requireDirectPeerTruth = args?.requireDirectPeerTruth === true;
|
|
49612
|
+
const directTruth = requireDirectPeerTruth ? await hydrateInlineMeshDirectTruth({
|
|
49613
|
+
mesh,
|
|
49614
|
+
meshSource: meshRecord.source,
|
|
49615
|
+
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
49616
|
+
statusInstanceId: this.deps.statusInstanceId,
|
|
49617
|
+
localMachineId
|
|
49618
|
+
}) : {
|
|
49619
|
+
directEvidenceCount: 0,
|
|
49620
|
+
localConfirmedCount: 0,
|
|
49621
|
+
peerAttemptedCount: 0,
|
|
49622
|
+
peerConfirmedCount: 0,
|
|
49623
|
+
unavailableNodeIds: []
|
|
49624
|
+
};
|
|
49625
|
+
const directTruthSatisfied = meshRecord.source !== "inline_bootstrap" || directTruth.directEvidenceCount > 0;
|
|
49626
|
+
if (requireDirectPeerTruth && !directTruthSatisfied) {
|
|
49627
|
+
return {
|
|
49628
|
+
success: false,
|
|
49629
|
+
code: "mesh_direct_peer_truth_unavailable",
|
|
49630
|
+
error: "Selected coordinator could not confirm direct mesh truth yet. Bootstrap inventory stays unavailable until direct mesh_status probes succeed.",
|
|
49631
|
+
sourceOfTruth: {
|
|
49632
|
+
membership: meshRecord.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
|
|
49633
|
+
coordinatorOwnsLiveTruth: false,
|
|
49634
|
+
currentStatus: "direct_peer_truth_unavailable",
|
|
49635
|
+
directPeerTruth: {
|
|
49636
|
+
required: true,
|
|
49637
|
+
satisfied: false,
|
|
49638
|
+
directEvidenceCount: directTruth.directEvidenceCount,
|
|
49639
|
+
localConfirmedCount: directTruth.localConfirmedCount,
|
|
49640
|
+
peerAttemptedCount: directTruth.peerAttemptedCount,
|
|
49641
|
+
peerConfirmedCount: directTruth.peerConfirmedCount,
|
|
49642
|
+
unavailableNodeIds: directTruth.unavailableNodeIds
|
|
49643
|
+
}
|
|
49644
|
+
}
|
|
49645
|
+
};
|
|
49646
|
+
}
|
|
49647
|
+
const directTruthUnavailableNodeIds = new Set(directTruth.unavailableNodeIds);
|
|
49437
49648
|
const selectedCoordinatorNodeId = readStringValue(
|
|
49438
49649
|
mesh.coordinator?.preferredNodeId,
|
|
49439
49650
|
mesh.nodes?.[0]?.id,
|
|
@@ -49529,7 +49740,7 @@ ${block}`);
|
|
|
49529
49740
|
status.git = inlineTransitGit;
|
|
49530
49741
|
status.health = inlineTransitGit.isGitRepo ? deriveMeshNodeHealthFromGit(inlineTransitGit) : "degraded";
|
|
49531
49742
|
remoteProbeApplied = true;
|
|
49532
|
-
} else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand) {
|
|
49743
|
+
} else if (!isSelfNode && daemonId && this.deps.dispatchMeshCommand && !directTruthUnavailableNodeIds.has(nodeId)) {
|
|
49533
49744
|
try {
|
|
49534
49745
|
const remoteGit = await probeRemoteMeshGitStatus({
|
|
49535
49746
|
dispatchMeshCommand: this.deps.dispatchMeshCommand,
|
|
@@ -49620,7 +49831,19 @@ ${block}`);
|
|
|
49620
49831
|
refreshedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
49621
49832
|
sourceOfTruth: {
|
|
49622
49833
|
membership: meshRecord?.source === "inline_cache" ? "coordinator_inline_mesh_cache" : meshRecord?.source === "local_config" ? "local_mesh_config" : "inline_bootstrap_snapshot",
|
|
49623
|
-
coordinatorOwnsLiveTruth:
|
|
49834
|
+
coordinatorOwnsLiveTruth: directTruthSatisfied,
|
|
49835
|
+
...requireDirectPeerTruth ? {
|
|
49836
|
+
currentStatus: directTruthSatisfied ? "live_git_and_session_probes" : "direct_peer_truth_unavailable",
|
|
49837
|
+
directPeerTruth: {
|
|
49838
|
+
required: true,
|
|
49839
|
+
satisfied: directTruthSatisfied,
|
|
49840
|
+
directEvidenceCount: directTruth.directEvidenceCount,
|
|
49841
|
+
localConfirmedCount: directTruth.localConfirmedCount,
|
|
49842
|
+
peerAttemptedCount: directTruth.peerAttemptedCount,
|
|
49843
|
+
peerConfirmedCount: directTruth.peerConfirmedCount,
|
|
49844
|
+
unavailableNodeIds: directTruth.unavailableNodeIds
|
|
49845
|
+
}
|
|
49846
|
+
} : {},
|
|
49624
49847
|
historicalEvidenceOnly: ["recoveryHints", "ledger.summary", "queue.summary"]
|
|
49625
49848
|
},
|
|
49626
49849
|
nodes: nodeStatuses,
|
|
@@ -98778,7 +99001,7 @@ var init_adhdev_daemon = __esm({
|
|
|
98778
99001
|
init_version();
|
|
98779
99002
|
init_src();
|
|
98780
99003
|
init_runtime_defaults();
|
|
98781
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.82-rc.
|
|
99004
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.82-rc.38" });
|
|
98782
99005
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
98783
99006
|
localHttpServer = null;
|
|
98784
99007
|
localWss = null;
|