@adhdev/daemon-core 0.9.82-rc.82 → 0.9.82-rc.83
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 +145 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +145 -13
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/refine-config.d.ts +12 -0
- package/dist/repo-mesh-types.d.ts +7 -0
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +13 -1
- package/src/commands/cli-manager.ts +25 -0
- package/src/commands/router.ts +107 -7
- package/src/config/mesh-config.ts +1 -0
- package/src/mesh/coordinator-prompt.ts +5 -2
- package/src/mesh/mesh-events.ts +2 -1
- package/src/mesh/refine-config.ts +15 -0
- package/src/repo-mesh-types.ts +8 -0
package/dist/index.mjs
CHANGED
|
@@ -34,6 +34,7 @@ var init_repo_mesh_types = __esm({
|
|
|
34
34
|
requirePreTaskCheckpoint: false,
|
|
35
35
|
requirePostTaskCheckpoint: true,
|
|
36
36
|
requireApprovalForPush: true,
|
|
37
|
+
allowAutoPublishSubmoduleMainCommits: false,
|
|
37
38
|
requireApprovalForDestructiveGit: true,
|
|
38
39
|
dirtyWorkspaceBehavior: "warn",
|
|
39
40
|
maxParallelTasks: 2,
|
|
@@ -787,6 +788,7 @@ function mergeMeshPolicy(base, patch) {
|
|
|
787
788
|
}
|
|
788
789
|
const maxParallelTasks = Number(policy.maxParallelTasks);
|
|
789
790
|
policy.maxParallelTasks = Number.isFinite(maxParallelTasks) ? Math.max(1, Math.min(8, Math.floor(maxParallelTasks))) : 2;
|
|
791
|
+
policy.allowAutoPublishSubmoduleMainCommits = policy.allowAutoPublishSubmoduleMainCommits === true;
|
|
790
792
|
if (!SESSION_CLEANUP_MODES.has(String(policy.sessionCleanupOnNodeRemove))) {
|
|
791
793
|
policy.sessionCleanupOnNodeRemove = "preserve";
|
|
792
794
|
}
|
|
@@ -1173,6 +1175,9 @@ function buildPolicySection(policy) {
|
|
|
1173
1175
|
if (policy.requirePreTaskCheckpoint) rules.push("- Create a git checkpoint **before** starting each task");
|
|
1174
1176
|
if (policy.requirePostTaskCheckpoint) rules.push("- Create a git checkpoint **after** each task completes");
|
|
1175
1177
|
if (policy.requireApprovalForPush) rules.push("- **Ask for user approval** before pushing to remote");
|
|
1178
|
+
if (policy.allowAutoPublishSubmoduleMainCommits) {
|
|
1179
|
+
rules.push("- Refinery may auto-publish unreachable submodule gitlink commits to submodule origin/main with non-force pushes after validation and patch-equivalence pass");
|
|
1180
|
+
}
|
|
1176
1181
|
if (policy.requireApprovalForDestructiveGit) rules.push("- **Ask for user approval** before destructive git operations (force push, reset, etc.)");
|
|
1177
1182
|
const dirtyBehavior = {
|
|
1178
1183
|
block: "- **Do not** send tasks to nodes with dirty workspaces",
|
|
@@ -1204,7 +1209,7 @@ function buildRulesSection(coordinatorCliType) {
|
|
|
1204
1209
|
- **Clean up worktree nodes.** After a worktree task completes and its changes are merged or checkpointed, call \`mesh_remove_node\` to free resources.
|
|
1205
1210
|
- **Do not strand completed branches.** A checkpointed or clean feature/worktree branch is not done by itself. Merge/refine it to the mesh default branch, fast-forward obvious clean behind-only branches with \`mesh_fast_forward_node\`, or explicitly report one of \`pushed_feature_branch_needs_merge\`, \`blocked_review\`, \`cleanup_candidate\`, or \`not_mergeable\` with the next action.
|
|
1206
1211
|
- **Keep Refinery validation project-configurable.** \`mesh_refine_node\` must execute validation from repo mesh/refine config (for example \`.adhdev/refine.{json,yaml,yml}\`, \`.adhdev/repo-mesh-refine.*\`, or \`repo-mesh.refine.*\`). Heuristics are suggestions/scaffolding only, not the execution path.
|
|
1207
|
-
- **Treat submodule main reachability as publish-needed.** A \`submodule_reachability_failed\` refine result means the root gitlink points at a submodule commit that is not reachable from the configured submodule remote main branch. Do not treat feature-branch reachability as complete, retry validation blindly, or start code review first. Classify it as \`blocked_review\`, request user approval to push/publish the submodule commit to submodule main, then rerun \`mesh_refine_node
|
|
1212
|
+
- **Treat submodule main reachability as publish-needed.** A \`submodule_reachability_failed\` refine result means the root gitlink points at a submodule commit that is not reachable from the configured submodule remote main branch. Do not treat feature-branch reachability as complete, retry validation blindly, or start code review first. Classify it as \`blocked_review\`, request user approval to push/publish the submodule commit to submodule main, then rerun \`mesh_refine_node\`, unless the mesh or repo refine config explicitly enabled \`allowAutoPublishSubmoduleMainCommits\` and Refinery reports exact path/commit/remote/branch evidence with post-publish verification.
|
|
1208
1213
|
- **Name worktree branches meaningfully.** Use descriptive names like \`feat/auth-refactor\` or \`fix/build-123\`.${coordinatorNote}`;
|
|
1209
1214
|
}
|
|
1210
1215
|
var TOOLS_SECTION, TOOL_EXPOSURE_PREFLIGHT_SECTION, WORKFLOW_SECTION;
|
|
@@ -1251,7 +1256,7 @@ Before doing any coordinator work, confirm that the actual callable tool list in
|
|
|
1251
1256
|
4. **Monitor** \u2014 Prefer event-driven completion/status notifications. Do **not** poll \`mesh_read_chat\` repeatedly. Use \`mesh_view_queue\` to see the status of all pending, assigned, completed, and failed tasks. Do not call \`mesh_read_chat\` again within a few seconds for the same generating session. Use at most one compact \`mesh_read_chat\` check after a completion/approval signal. Handle approvals via \`mesh_approve\`.
|
|
1252
1257
|
5. **Verify** \u2014 When a task reports completion or git work is visible, call \`mesh_git_status\` to verify changes were made.
|
|
1253
1258
|
6. **Checkpoint** \u2014 Call \`mesh_checkpoint\` to save the work.
|
|
1254
|
-
7. **Converge branches** \u2014 Before marking any task complete, classify every touched node/branch into exactly one final state: \`merged_to_main\`, \`pushed_feature_branch_needs_merge\`, \`blocked_review\`, \`cleanup_candidate\`, or \`not_mergeable\`. Use \`mesh_status\` branchConvergenceSummary. For obvious clean branch catch-up (ahead 0, behind > 0, upstream fresh, no dirty/stash/submodule issues), use \`mesh_fast_forward_node\` dry-run first and execute only when explicitly safe/approved; this avoids consuming an agent session. Use \`mesh_refine_node\` for clean worktree branches when safe. Before/refine merging root commits that contain submodule gitlink changes, require each submodule commit to be reachable from the configured submodule remote main branch, not merely present on a feature ref or local checkout. If \`mesh_refine_node\` returns \`submodule_reachability_failed\` or publish-required evidence, keep the public convergence bucket as \`blocked_review
|
|
1259
|
+
7. **Converge branches** \u2014 Before marking any task complete, classify every touched node/branch into exactly one final state: \`merged_to_main\`, \`pushed_feature_branch_needs_merge\`, \`blocked_review\`, \`cleanup_candidate\`, or \`not_mergeable\`. Use \`mesh_status\` branchConvergenceSummary. For obvious clean branch catch-up (ahead 0, behind > 0, upstream fresh, no dirty/stash/submodule issues), use \`mesh_fast_forward_node\` dry-run first and execute only when explicitly safe/approved; this avoids consuming an agent session. Use \`mesh_refine_node\` for clean worktree branches when safe. Before/refine merging root commits that contain submodule gitlink changes, require each submodule commit to be reachable from the configured submodule remote main branch, not merely present on a feature ref or local checkout. If \`mesh_refine_node\` returns \`submodule_reachability_failed\` or publish-required evidence, keep the public convergence bucket as \`blocked_review\`; unless \`allowAutoPublishSubmoduleMainCommits\` is explicitly enabled and Refinery reports successful non-force publish plus post-publish verification, ask the user for explicit approval to push/publish the unreachable submodule commit(s) to submodule main, then rerun \`mesh_refine_node\`. Do not merge the root branch until the submodule commit(s) are reachable from submodule origin/main. A task that remains on a non-main branch is not fully complete unless the final report names the follow-up state and next step.
|
|
1255
1260
|
8. **Clean up** \u2014 Remove worktree nodes via \`mesh_remove_node\` after their work is merged or no longer needed.
|
|
1256
1261
|
9. **Report** \u2014 Summarize what was done, what changed, any issues, and the branch convergence state.
|
|
1257
1262
|
|
|
@@ -3201,7 +3206,8 @@ function injectMeshSystemMessage(components, args) {
|
|
|
3201
3206
|
const providerSessionId = readNonEmptyString2(args.metadataEvent.providerSessionId) || void 0;
|
|
3202
3207
|
const finalSummary = readNonEmptyString2(args.metadataEvent.finalSummary) || void 0;
|
|
3203
3208
|
const workerResult = readWorkerResultMetadata(args.metadataEvent);
|
|
3204
|
-
const
|
|
3209
|
+
const hasCompletionEvidence = !!finalSummary || !!workerResult;
|
|
3210
|
+
const completedTask = sessionId && hasCompletionEvidence ? updateSessionTaskStatus(args.meshId, sessionId, "completed") : null;
|
|
3205
3211
|
if (completedTask) {
|
|
3206
3212
|
completedTaskForLedger = { id: completedTask.id };
|
|
3207
3213
|
try {
|
|
@@ -8421,6 +8427,11 @@ var MESH_REFINE_CONFIG_SCHEMA = {
|
|
|
8421
8427
|
required: ["version"],
|
|
8422
8428
|
properties: {
|
|
8423
8429
|
version: { const: 1 },
|
|
8430
|
+
allowAutoPublishSubmoduleMainCommits: {
|
|
8431
|
+
type: "boolean",
|
|
8432
|
+
default: false,
|
|
8433
|
+
description: "When true, Refinery may non-force publish submodule gitlink commits referenced by the refined root tree to each submodule origin/main after validation and patch-equivalence pass, then verify reachability."
|
|
8434
|
+
},
|
|
8424
8435
|
validation: {
|
|
8425
8436
|
type: "object",
|
|
8426
8437
|
additionalProperties: false,
|
|
@@ -8513,6 +8524,9 @@ function validateMeshRefineConfig(config, source = "inline") {
|
|
|
8513
8524
|
const rejectedCommands = [];
|
|
8514
8525
|
if (!isRecord(config)) return { valid: false, errors: ["config must be an object"], commands, rejectedCommands };
|
|
8515
8526
|
if (config.version !== 1) errors.push("version must be 1");
|
|
8527
|
+
if (config.allowAutoPublishSubmoduleMainCommits !== void 0 && typeof config.allowAutoPublishSubmoduleMainCommits !== "boolean") {
|
|
8528
|
+
errors.push("allowAutoPublishSubmoduleMainCommits must be a boolean when provided");
|
|
8529
|
+
}
|
|
8516
8530
|
const validation = config.validation;
|
|
8517
8531
|
if (validation !== void 0 && !isRecord(validation)) errors.push("validation must be an object");
|
|
8518
8532
|
const rawCommands = isRecord(validation) ? validation.commands : void 0;
|
|
@@ -16472,7 +16486,7 @@ async function handleReadChat(h, args) {
|
|
|
16472
16486
|
returnedMessages,
|
|
16473
16487
|
ptyStatusApprovalOnly: false
|
|
16474
16488
|
});
|
|
16475
|
-
if (supportsCliNativeTranscript(providerType)) {
|
|
16489
|
+
if (supportsCliNativeTranscript(providerType) && provider?.canonicalHistory?.mode === "native-source") {
|
|
16476
16490
|
const agentStr = provider?.type || args?.agentType || getCurrentProviderType(h, adapter.cliType);
|
|
16477
16491
|
const workspace = typeof args?.workspace === "string" ? args.workspace : typeof h.currentSession?.workspace === "string" ? h.currentSession.workspace : typeof adapter.workingDir === "string" ? adapter.workingDir : void 0;
|
|
16478
16492
|
const nativeHistoryLimit = Math.max(
|
|
@@ -16631,6 +16645,17 @@ async function handleReadChat(h, args) {
|
|
|
16631
16645
|
freshEnough: true,
|
|
16632
16646
|
ptyStatusApprovalOnly: false
|
|
16633
16647
|
});
|
|
16648
|
+
const requiresNativeSource = supportsCliNativeTranscript(agentStr) && provider?.canonicalHistory?.mode === "native-source";
|
|
16649
|
+
if (requiresNativeSource && !nativeSelected) {
|
|
16650
|
+
return {
|
|
16651
|
+
success: false,
|
|
16652
|
+
code: "native_history_not_safely_available",
|
|
16653
|
+
error: "Provider-native history was not safely available for the requested CLI session.",
|
|
16654
|
+
providerSessionId: historyProviderSessionId,
|
|
16655
|
+
messageSource,
|
|
16656
|
+
transcriptProvenance: messageSource
|
|
16657
|
+
};
|
|
16658
|
+
}
|
|
16634
16659
|
return buildReadChatCommandResult({
|
|
16635
16660
|
messages: historyMessages,
|
|
16636
16661
|
status: "idle",
|
|
@@ -21534,6 +21559,14 @@ function hasAdapterPendingResponse(adapter) {
|
|
|
21534
21559
|
function countMessages(value) {
|
|
21535
21560
|
return Array.isArray(value) ? value.length : 0;
|
|
21536
21561
|
}
|
|
21562
|
+
function hasFinalAssistantMessage(value) {
|
|
21563
|
+
const messages = Array.isArray(value) ? value : [];
|
|
21564
|
+
const last = messages[messages.length - 1];
|
|
21565
|
+
if (!last || last.role !== "assistant") return false;
|
|
21566
|
+
if (last.bubbleState === "streaming") return false;
|
|
21567
|
+
if (last.meta?.streaming === true) return false;
|
|
21568
|
+
return typeof last.content === "string" && last.content.trim().length > 0;
|
|
21569
|
+
}
|
|
21537
21570
|
function hasZeroMessageStartingLaunch(adapter) {
|
|
21538
21571
|
const adapterStatus = adapter?.getStatus?.({ allowParse: false }) ?? adapter?.getStatus?.() ?? {};
|
|
21539
21572
|
const parsedStatus = typeof adapter?.getScriptParsedStatus === "function" ? adapter.getScriptParsedStatus() : {};
|
|
@@ -21545,6 +21578,17 @@ function hasZeroMessageStartingLaunch(adapter) {
|
|
|
21545
21578
|
if (countMessages(adapterStatus?.messages) > 0 || countMessages(parsedStatus?.messages) > 0) return false;
|
|
21546
21579
|
return !hasAdapterPendingResponse(adapter);
|
|
21547
21580
|
}
|
|
21581
|
+
function hasCompletedStartingLaunch(adapter) {
|
|
21582
|
+
const adapterStatus = adapter?.getStatus?.({ allowParse: false }) ?? adapter?.getStatus?.() ?? {};
|
|
21583
|
+
const adapterRawStatus = normalizeAgentStatus(adapterStatus?.status);
|
|
21584
|
+
if (adapterRawStatus !== "starting") return false;
|
|
21585
|
+
if (hasAdapterPendingResponse(adapter)) return false;
|
|
21586
|
+
const parsedStatus = typeof adapter?.getScriptParsedStatus === "function" ? adapter.getScriptParsedStatus() : {};
|
|
21587
|
+
const parsedRawStatus = normalizeAgentStatus(parsedStatus?.status);
|
|
21588
|
+
if (parsedRawStatus !== "idle") return false;
|
|
21589
|
+
if (hasNonEmptyModalButtons2(adapterStatus?.activeModal ?? adapterStatus?.modal ?? parsedStatus?.activeModal ?? parsedStatus?.modal)) return false;
|
|
21590
|
+
return hasFinalAssistantMessage(parsedStatus?.messages);
|
|
21591
|
+
}
|
|
21548
21592
|
function shouldSuppressStaleParsedBusyStatus(adapterStatus, parsedStatus, adapter) {
|
|
21549
21593
|
const parsedRawStatus = normalizeAgentStatus(parsedStatus?.status);
|
|
21550
21594
|
if (!BUSY_AGENT_STATUSES.has(parsedRawStatus)) return false;
|
|
@@ -21554,6 +21598,7 @@ function shouldSuppressStaleParsedBusyStatus(adapterStatus, parsedStatus, adapte
|
|
|
21554
21598
|
}
|
|
21555
21599
|
function getEffectiveAgentSendStatus(adapter) {
|
|
21556
21600
|
const adapterStatus = normalizeAgentStatus(adapter?.getStatus?.({ allowParse: false })?.status ?? adapter?.getStatus?.()?.status);
|
|
21601
|
+
if (adapterStatus === "starting" && hasCompletedStartingLaunch(adapter)) return "idle";
|
|
21557
21602
|
if (adapterStatus && adapterStatus !== "idle") return adapterStatus;
|
|
21558
21603
|
if (adapterStatus !== "idle") return adapterStatus;
|
|
21559
21604
|
if (typeof adapter?.getScriptParsedStatus !== "function") return adapterStatus;
|
|
@@ -26532,6 +26577,16 @@ function buildSubmodulePublishRequiredNextStep(entries) {
|
|
|
26532
26577
|
const refs = entries.map((entry) => `${entry.path}@${entry.commit}`).join(", ");
|
|
26533
26578
|
return `Ask the user for explicit approval to push/publish the unreachable submodule commit(s) (${refs}) to the configured submodule remote main branch, then rerun mesh_refine_node. Do not merge the root branch until every submodule gitlink commit is reachable from submodule origin/main.`;
|
|
26534
26579
|
}
|
|
26580
|
+
function resolveRefineryAutoPublishSubmoduleMainCommits(mesh, workspace) {
|
|
26581
|
+
if (mesh?.policy?.allowAutoPublishSubmoduleMainCommits === true) {
|
|
26582
|
+
return { enabled: true, source: "mesh.policy.allowAutoPublishSubmoduleMainCommits" };
|
|
26583
|
+
}
|
|
26584
|
+
const loaded = loadMeshRefineConfig(mesh, workspace);
|
|
26585
|
+
if (loaded.config?.allowAutoPublishSubmoduleMainCommits === true) {
|
|
26586
|
+
return { enabled: true, source: loaded.path || loaded.source };
|
|
26587
|
+
}
|
|
26588
|
+
return { enabled: false };
|
|
26589
|
+
}
|
|
26535
26590
|
async function computeGitPatchId(cwd, fromRef, toRef) {
|
|
26536
26591
|
const { execFileSync: execFileSync3 } = await import("child_process");
|
|
26537
26592
|
const diff = execFileSync3("git", ["diff", "--patch", "--full-index", fromRef, toRef], {
|
|
@@ -26600,7 +26655,7 @@ async function runMeshRefinePatchEquivalenceGate(repoRoot, baseHead, branchHead)
|
|
|
26600
26655
|
};
|
|
26601
26656
|
}
|
|
26602
26657
|
}
|
|
26603
|
-
async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree) {
|
|
26658
|
+
async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree, options = {}) {
|
|
26604
26659
|
const startedAt = Date.now();
|
|
26605
26660
|
const entries = [];
|
|
26606
26661
|
try {
|
|
@@ -26621,6 +26676,17 @@ async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree) {
|
|
|
26621
26676
|
await runGit2(submodulePath, ["-c", "protocol.file.allow=always", "fetch", "origin", `refs/heads/${branch}:refs/remotes/origin/${branch}`]);
|
|
26622
26677
|
await runGit2(submodulePath, ["merge-base", "--is-ancestor", commit, `refs/remotes/origin/${branch}`]);
|
|
26623
26678
|
};
|
|
26679
|
+
const publishCommitToRemoteMain = async (submodulePath, commit, branch = "main") => {
|
|
26680
|
+
const refspec = `${commit}:refs/heads/${branch}`;
|
|
26681
|
+
const { stdout, stderr } = await execFileAsync3("git", ["push", "origin", refspec], {
|
|
26682
|
+
cwd: submodulePath,
|
|
26683
|
+
encoding: "utf8",
|
|
26684
|
+
timeout: 3e4,
|
|
26685
|
+
maxBuffer: REFINE_PATCH_EQUIVALENCE_OUTPUT_LIMIT_BYTES,
|
|
26686
|
+
windowsHide: true
|
|
26687
|
+
});
|
|
26688
|
+
return { stdout: String(stdout || ""), stderr: String(stderr || ""), refspec };
|
|
26689
|
+
};
|
|
26624
26690
|
const treeOutput = await runGit2(repoRoot, ["ls-tree", "-r", "-z", mergedTree]);
|
|
26625
26691
|
const gitlinks = treeOutput.split("\0").filter(Boolean).map((record) => {
|
|
26626
26692
|
const match = /^160000\s+commit\s+([0-9a-f]{40})\t(.+)$/.exec(record);
|
|
@@ -26661,11 +26727,43 @@ async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree) {
|
|
|
26661
26727
|
continue;
|
|
26662
26728
|
}
|
|
26663
26729
|
entry.remoteMainBranch = "main";
|
|
26664
|
-
|
|
26665
|
-
|
|
26666
|
-
|
|
26667
|
-
|
|
26668
|
-
|
|
26730
|
+
try {
|
|
26731
|
+
await verifyRemoteMainContainsCommit(submodulePath, gitlink.commit, "main");
|
|
26732
|
+
entry.fetchedFromOrigin = true;
|
|
26733
|
+
entry.remoteReachable = true;
|
|
26734
|
+
entry.remoteMainReachable = true;
|
|
26735
|
+
entry.reachable = true;
|
|
26736
|
+
} catch (e) {
|
|
26737
|
+
entry.remoteReachable = false;
|
|
26738
|
+
entry.remoteMainReachable = false;
|
|
26739
|
+
entry.publishRequired = true;
|
|
26740
|
+
const details = truncateValidationOutput(e?.stderr || e?.message || String(e));
|
|
26741
|
+
entry.error = `Submodule remote main reachability check failed for origin/main: ${details}`;
|
|
26742
|
+
if (options.allowAutoPublishSubmoduleMainCommits === true && entry.localReachable === true) {
|
|
26743
|
+
entry.autoPublishAllowed = true;
|
|
26744
|
+
entry.autoPublishAttempted = true;
|
|
26745
|
+
try {
|
|
26746
|
+
const publish = await publishCommitToRemoteMain(submodulePath, gitlink.commit, "main");
|
|
26747
|
+
entry.autoPublishRefspec = publish.refspec;
|
|
26748
|
+
entry.publishStdout = truncateValidationOutput(publish.stdout);
|
|
26749
|
+
entry.publishStderr = truncateValidationOutput(publish.stderr);
|
|
26750
|
+
entry.autoPublishSucceeded = true;
|
|
26751
|
+
await verifyRemoteMainContainsCommit(submodulePath, gitlink.commit, "main");
|
|
26752
|
+
entry.fetchedFromOrigin = true;
|
|
26753
|
+
entry.remoteReachable = true;
|
|
26754
|
+
entry.remoteMainReachable = true;
|
|
26755
|
+
entry.autoPublishVerified = true;
|
|
26756
|
+
entry.publishRequired = false;
|
|
26757
|
+
entry.reachable = true;
|
|
26758
|
+
entry.error = void 0;
|
|
26759
|
+
} catch (publishError) {
|
|
26760
|
+
entry.autoPublishSucceeded = false;
|
|
26761
|
+
entry.autoPublishVerified = false;
|
|
26762
|
+
const publishDetails = truncateValidationOutput(publishError?.stderr || publishError?.message || String(publishError));
|
|
26763
|
+
entry.error = `Submodule auto-publish to origin/main failed or could not be verified: ${publishDetails}`;
|
|
26764
|
+
}
|
|
26765
|
+
}
|
|
26766
|
+
}
|
|
26669
26767
|
} catch (e) {
|
|
26670
26768
|
entry.remoteReachable = false;
|
|
26671
26769
|
entry.remoteMainReachable = false;
|
|
@@ -26685,7 +26783,9 @@ async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree) {
|
|
|
26685
26783
|
checked: entries.length,
|
|
26686
26784
|
unreachable: unreachable.map((entry) => ({ ...entry, publishRequired: entry.publishRequired !== false })),
|
|
26687
26785
|
entries: entries.map((entry) => entry.reachable ? entry : { ...entry, publishRequired: entry.publishRequired !== false }),
|
|
26688
|
-
durationMs: Date.now() - startedAt
|
|
26786
|
+
durationMs: Date.now() - startedAt,
|
|
26787
|
+
autoPublishAllowed: options.allowAutoPublishSubmoduleMainCommits === true,
|
|
26788
|
+
autoPublishPolicySource: options.autoPublishPolicySource
|
|
26689
26789
|
};
|
|
26690
26790
|
} catch (e) {
|
|
26691
26791
|
const unreachable = entries.filter((entry) => !entry.reachable).map((entry) => ({ ...entry, publishRequired: true }));
|
|
@@ -26695,6 +26795,8 @@ async function runMeshRefineSubmoduleReachabilityGate(repoRoot, mergedTree) {
|
|
|
26695
26795
|
unreachable,
|
|
26696
26796
|
entries: entries.map((entry) => entry.reachable ? entry : { ...entry, publishRequired: true }),
|
|
26697
26797
|
durationMs: Date.now() - startedAt,
|
|
26798
|
+
autoPublishAllowed: options.allowAutoPublishSubmoduleMainCommits === true,
|
|
26799
|
+
autoPublishPolicySource: options.autoPublishPolicySource,
|
|
26698
26800
|
error: truncateValidationOutput(e?.message || String(e))
|
|
26699
26801
|
};
|
|
26700
26802
|
}
|
|
@@ -27833,13 +27935,36 @@ var DaemonCommandRouter = class {
|
|
|
27833
27935
|
};
|
|
27834
27936
|
}
|
|
27835
27937
|
const submoduleReachabilityStarted = Date.now();
|
|
27836
|
-
const
|
|
27938
|
+
const autoPublishSubmoduleMainCommits = resolveRefineryAutoPublishSubmoduleMainCommits(mesh, node.workspace);
|
|
27939
|
+
const submoduleReachability = await runMeshRefineSubmoduleReachabilityGate(repoRoot, patchEquivalence.mergedTree || branchHead, {
|
|
27940
|
+
allowAutoPublishSubmoduleMainCommits: autoPublishSubmoduleMainCommits.enabled,
|
|
27941
|
+
autoPublishPolicySource: autoPublishSubmoduleMainCommits.source
|
|
27942
|
+
});
|
|
27837
27943
|
recordMeshRefineStage(refineStages, "submodule_reachability", submoduleReachability.status, submoduleReachabilityStarted, {
|
|
27838
27944
|
checked: submoduleReachability.checked,
|
|
27945
|
+
autoPublishAllowed: submoduleReachability.autoPublishAllowed,
|
|
27946
|
+
autoPublishPolicySource: submoduleReachability.autoPublishPolicySource,
|
|
27947
|
+
autoPublished: submoduleReachability.entries.filter((entry) => entry.autoPublishAttempted).map((entry) => ({
|
|
27948
|
+
path: entry.path,
|
|
27949
|
+
commit: entry.commit,
|
|
27950
|
+
remote: entry.remote,
|
|
27951
|
+
remoteUrl: entry.remoteUrl,
|
|
27952
|
+
remoteMainBranch: entry.remoteMainBranch,
|
|
27953
|
+
refspec: entry.autoPublishRefspec,
|
|
27954
|
+
succeeded: entry.autoPublishSucceeded,
|
|
27955
|
+
verified: entry.autoPublishVerified,
|
|
27956
|
+
remoteMainReachable: entry.remoteMainReachable,
|
|
27957
|
+
error: entry.error
|
|
27958
|
+
})),
|
|
27839
27959
|
unreachable: submoduleReachability.unreachable.map((entry) => ({
|
|
27840
27960
|
path: entry.path,
|
|
27841
27961
|
commit: entry.commit,
|
|
27842
27962
|
publishRequired: entry.publishRequired === true,
|
|
27963
|
+
autoPublishAllowed: entry.autoPublishAllowed,
|
|
27964
|
+
autoPublishAttempted: entry.autoPublishAttempted,
|
|
27965
|
+
autoPublishSucceeded: entry.autoPublishSucceeded,
|
|
27966
|
+
autoPublishVerified: entry.autoPublishVerified,
|
|
27967
|
+
autoPublishRefspec: entry.autoPublishRefspec,
|
|
27843
27968
|
remote: entry.remote,
|
|
27844
27969
|
remoteUrl: entry.remoteUrl,
|
|
27845
27970
|
remoteReachable: entry.remoteReachable,
|
|
@@ -27873,6 +27998,11 @@ var DaemonCommandRouter = class {
|
|
|
27873
27998
|
remoteReachable: entry.remoteReachable,
|
|
27874
27999
|
remoteMainBranch: entry.remoteMainBranch,
|
|
27875
28000
|
remoteMainReachable: entry.remoteMainReachable,
|
|
28001
|
+
autoPublishAllowed: entry.autoPublishAllowed,
|
|
28002
|
+
autoPublishAttempted: entry.autoPublishAttempted,
|
|
28003
|
+
autoPublishSucceeded: entry.autoPublishSucceeded,
|
|
28004
|
+
autoPublishVerified: entry.autoPublishVerified,
|
|
28005
|
+
autoPublishRefspec: entry.autoPublishRefspec,
|
|
27876
28006
|
error: entry.error
|
|
27877
28007
|
})),
|
|
27878
28008
|
branch,
|
|
@@ -27947,7 +28077,7 @@ var DaemonCommandRouter = class {
|
|
|
27947
28077
|
appendLedgerEntry2(meshId, {
|
|
27948
28078
|
kind: "node_removed",
|
|
27949
28079
|
nodeId,
|
|
27950
|
-
payload: { refined: true, mergedBranch: branch, into: baseBranch, validationSummary, patchEquivalence }
|
|
28080
|
+
payload: { refined: true, mergedBranch: branch, into: baseBranch, validationSummary, patchEquivalence, submoduleReachability }
|
|
27951
28081
|
});
|
|
27952
28082
|
recordMeshRefineStage(refineStages, "ledger", "passed", ledgerStarted);
|
|
27953
28083
|
} catch (e) {
|
|
@@ -27975,6 +28105,7 @@ var DaemonCommandRouter = class {
|
|
|
27975
28105
|
removeResult,
|
|
27976
28106
|
validationSummary,
|
|
27977
28107
|
patchEquivalence,
|
|
28108
|
+
submoduleReachability,
|
|
27978
28109
|
mergeResult,
|
|
27979
28110
|
refineStages,
|
|
27980
28111
|
...ledgerError ? { ledgerError } : {},
|
|
@@ -27989,6 +28120,7 @@ var DaemonCommandRouter = class {
|
|
|
27989
28120
|
removeResult,
|
|
27990
28121
|
validationSummary,
|
|
27991
28122
|
patchEquivalence,
|
|
28123
|
+
submoduleReachability,
|
|
27992
28124
|
mergeResult,
|
|
27993
28125
|
refineStages,
|
|
27994
28126
|
...ledgerError ? { ledgerError } : {},
|