@apralabs/apra-fleet 0.4.1 → 0.4.2
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/README.md +16 -8
- package/dist/agents/backlog-groomer.md +17 -21
- package/dist/agents/ci-watcher.md +3 -0
- package/dist/agents/deployer.md +22 -44
- package/dist/agents/doer.md +131 -132
- package/dist/agents/harvester.md +20 -32
- package/dist/agents/integ-test-runner.md +81 -113
- package/dist/agents/kb-reconciler.md +31 -42
- package/dist/agents/plan-reviewer.md +32 -44
- package/dist/agents/planner.md +51 -63
- package/dist/agents/regression-test-runner.md +65 -80
- package/dist/agents/reviewer.md +56 -83
- package/dist/agents/schemas/integ-test-runner-output.json +1 -1
- package/dist/agents/schemas/regression-test-runner-output.json +4 -17
- package/dist/cli/auth.d.ts.map +1 -1
- package/dist/cli/auth.js +1 -2
- package/dist/cli/auth.js.map +1 -1
- package/dist/cli/config.d.ts +3 -3
- package/dist/cli/config.d.ts.map +1 -1
- package/dist/cli/config.js +4 -13
- package/dist/cli/config.js.map +1 -1
- package/dist/cli/install.d.ts.map +1 -1
- package/dist/cli/install.js +5 -39
- package/dist/cli/install.js.map +1 -1
- package/dist/cli/register-member.js +1 -1
- package/dist/cli/start.d.ts.map +1 -1
- package/dist/cli/start.js +7 -0
- package/dist/cli/start.js.map +1 -1
- package/dist/cli/uninstall.d.ts.map +1 -1
- package/dist/cli/uninstall.js +5 -3
- package/dist/cli/uninstall.js.map +1 -1
- package/dist/cli/watch.d.ts +26 -3
- package/dist/cli/watch.d.ts.map +1 -1
- package/dist/cli/watch.js +41 -9
- package/dist/cli/watch.js.map +1 -1
- package/dist/os/git-bash-candidates.d.ts +35 -0
- package/dist/os/git-bash-candidates.d.ts.map +1 -0
- package/dist/os/git-bash-candidates.js +46 -0
- package/dist/os/git-bash-candidates.js.map +1 -0
- package/dist/os/index.d.ts +13 -4
- package/dist/os/index.d.ts.map +1 -1
- package/dist/os/index.js +17 -2
- package/dist/os/index.js.map +1 -1
- package/dist/os/linux.js +1 -1
- package/dist/os/linux.js.map +1 -1
- package/dist/os/os-commands.d.ts +7 -0
- package/dist/os/os-commands.d.ts.map +1 -1
- package/dist/os/os-commands.js.map +1 -1
- package/dist/os/windows-gitbash.d.ts +93 -0
- package/dist/os/windows-gitbash.d.ts.map +1 -0
- package/dist/os/windows-gitbash.js +244 -0
- package/dist/os/windows-gitbash.js.map +1 -0
- package/dist/os/windows.d.ts.map +1 -1
- package/dist/os/windows.js +27 -5
- package/dist/os/windows.js.map +1 -1
- package/dist/providers/agy.d.ts +3 -2
- package/dist/providers/agy.d.ts.map +1 -1
- package/dist/providers/agy.js +11 -2
- package/dist/providers/agy.js.map +1 -1
- package/dist/providers/claude.d.ts +3 -2
- package/dist/providers/claude.d.ts.map +1 -1
- package/dist/providers/claude.js +22 -3
- package/dist/providers/claude.js.map +1 -1
- package/dist/providers/codex.d.ts +3 -2
- package/dist/providers/codex.d.ts.map +1 -1
- package/dist/providers/codex.js +5 -2
- package/dist/providers/codex.js.map +1 -1
- package/dist/providers/copilot.d.ts +3 -2
- package/dist/providers/copilot.d.ts.map +1 -1
- package/dist/providers/copilot.js +7 -2
- package/dist/providers/copilot.js.map +1 -1
- package/dist/providers/index.d.ts +0 -1
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +0 -3
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/none.d.ts +3 -2
- package/dist/providers/none.d.ts.map +1 -1
- package/dist/providers/none.js +5 -2
- package/dist/providers/none.js.map +1 -1
- package/dist/providers/opencode.d.ts +3 -2
- package/dist/providers/opencode.d.ts.map +1 -1
- package/dist/providers/opencode.js +5 -2
- package/dist/providers/opencode.js.map +1 -1
- package/dist/providers/provider.d.ts +16 -7
- package/dist/providers/provider.d.ts.map +1 -1
- package/dist/providers/provider.js +2 -2
- package/dist/providers/provider.js.map +1 -1
- package/dist/services/agent-provisioner.js +2 -2
- package/dist/services/agent-provisioner.js.map +1 -1
- package/dist/services/cloud/activity.js +2 -2
- package/dist/services/cloud/activity.js.map +1 -1
- package/dist/services/context-admission.d.ts.map +1 -1
- package/dist/services/context-admission.js +9 -7
- package/dist/services/context-admission.js.map +1 -1
- package/dist/services/credential-cleanup.d.ts.map +1 -1
- package/dist/services/credential-cleanup.js +22 -3
- package/dist/services/credential-cleanup.js.map +1 -1
- package/dist/services/member-home.d.ts +1 -1
- package/dist/services/member-home.d.ts.map +1 -1
- package/dist/services/member-home.js +15 -12
- package/dist/services/member-home.js.map +1 -1
- package/dist/services/model-pricing.d.ts.map +1 -1
- package/dist/services/model-pricing.js +0 -5
- package/dist/services/model-pricing.js.map +1 -1
- package/dist/services/orphan-recovery.d.ts +6 -3
- package/dist/services/orphan-recovery.d.ts.map +1 -1
- package/dist/services/orphan-recovery.js +17 -14
- package/dist/services/orphan-recovery.js.map +1 -1
- package/dist/services/preflight-check.js +2 -2
- package/dist/services/preflight-check.js.map +1 -1
- package/dist/services/shell-probe.d.ts +131 -0
- package/dist/services/shell-probe.d.ts.map +1 -0
- package/dist/services/shell-probe.js +210 -0
- package/dist/services/shell-probe.js.map +1 -0
- package/dist/services/singleton.d.ts +2 -0
- package/dist/services/singleton.d.ts.map +1 -1
- package/dist/services/singleton.js +1 -1
- package/dist/services/singleton.js.map +1 -1
- package/dist/services/ssh.js +2 -2
- package/dist/services/ssh.js.map +1 -1
- package/dist/services/stall/find-log-file.d.ts.map +1 -1
- package/dist/services/stall/find-log-file.js +22 -16
- package/dist/services/stall/find-log-file.js.map +1 -1
- package/dist/services/stall/read-log-tail.d.ts.map +1 -1
- package/dist/services/stall/read-log-tail.js +6 -5
- package/dist/services/stall/read-log-tail.js.map +1 -1
- package/dist/services/stall/stall-poller.d.ts.map +1 -1
- package/dist/services/stall/stall-poller.js +35 -42
- package/dist/services/stall/stall-poller.js.map +1 -1
- package/dist/services/strategy.d.ts +9 -0
- package/dist/services/strategy.d.ts.map +1 -1
- package/dist/services/strategy.js +40 -6
- package/dist/services/strategy.js.map +1 -1
- package/dist/services/user-config.js +1 -1
- package/dist/services/user-config.js.map +1 -1
- package/dist/services/vcs/azure-devops.d.ts +1 -1
- package/dist/services/vcs/azure-devops.d.ts.map +1 -1
- package/dist/services/vcs/azure-devops.js +105 -10
- package/dist/services/vcs/azure-devops.js.map +1 -1
- package/dist/services/vcs/bitbucket.d.ts.map +1 -1
- package/dist/services/vcs/bitbucket.js +16 -0
- package/dist/services/vcs/bitbucket.js.map +1 -1
- package/dist/services/vcs/github.d.ts.map +1 -1
- package/dist/services/vcs/github.js +24 -0
- package/dist/services/vcs/github.js.map +1 -1
- package/dist/services/vcs/types.d.ts +123 -2
- package/dist/services/vcs/types.d.ts.map +1 -1
- package/dist/skills/fleet-sprint-cli/SKILL.md +2 -1
- package/dist/skills/pm/SKILL.md +0 -1
- package/dist/skills/pm/cost.md +0 -1
- package/dist/skills/pm/fleet-addendum.md +0 -1
- package/dist/tools/check-status.js +3 -3
- package/dist/tools/check-status.js.map +1 -1
- package/dist/tools/cloud-control.js +2 -2
- package/dist/tools/cloud-control.js.map +1 -1
- package/dist/tools/compose-permissions.d.ts.map +1 -1
- package/dist/tools/compose-permissions.js +37 -24
- package/dist/tools/compose-permissions.js.map +1 -1
- package/dist/tools/execute-command.d.ts.map +1 -1
- package/dist/tools/execute-command.js +28 -12
- package/dist/tools/execute-command.js.map +1 -1
- package/dist/tools/execute-prompt.d.ts.map +1 -1
- package/dist/tools/execute-prompt.js +55 -18
- package/dist/tools/execute-prompt.js.map +1 -1
- package/dist/tools/list-members.d.ts.map +1 -1
- package/dist/tools/list-members.js +6 -2
- package/dist/tools/list-members.js.map +1 -1
- package/dist/tools/member-detail.d.ts.map +1 -1
- package/dist/tools/member-detail.js +5 -3
- package/dist/tools/member-detail.js.map +1 -1
- package/dist/tools/member-reservation.d.ts.map +1 -1
- package/dist/tools/member-reservation.js +13 -1
- package/dist/tools/member-reservation.js.map +1 -1
- package/dist/tools/monitor-task.d.ts.map +1 -1
- package/dist/tools/monitor-task.js +17 -2
- package/dist/tools/monitor-task.js.map +1 -1
- package/dist/tools/provision-auth.js +5 -5
- package/dist/tools/provision-auth.js.map +1 -1
- package/dist/tools/provision-vcs-auth.d.ts +5 -2
- package/dist/tools/provision-vcs-auth.d.ts.map +1 -1
- package/dist/tools/provision-vcs-auth.js +58 -52
- package/dist/tools/provision-vcs-auth.js.map +1 -1
- package/dist/tools/register-member.d.ts +18 -12
- package/dist/tools/register-member.d.ts.map +1 -1
- package/dist/tools/register-member.js +42 -4
- package/dist/tools/register-member.js.map +1 -1
- package/dist/tools/remove-member.js +2 -2
- package/dist/tools/remove-member.js.map +1 -1
- package/dist/tools/revoke-vcs-auth.js +2 -2
- package/dist/tools/revoke-vcs-auth.js.map +1 -1
- package/dist/tools/setup-ssh-key.d.ts.map +1 -1
- package/dist/tools/setup-ssh-key.js +2 -1
- package/dist/tools/setup-ssh-key.js.map +1 -1
- package/dist/tools/stop-prompt.js +2 -2
- package/dist/tools/stop-prompt.js.map +1 -1
- package/dist/tools/update-agent-cli.js +2 -2
- package/dist/tools/update-agent-cli.js.map +1 -1
- package/dist/tools/update-member.d.ts +18 -12
- package/dist/tools/update-member.d.ts.map +1 -1
- package/dist/tools/update-member.js +18 -1
- package/dist/tools/update-member.js.map +1 -1
- package/dist/types.d.ts +11 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agent-helpers.d.ts +36 -0
- package/dist/utils/agent-helpers.d.ts.map +1 -1
- package/dist/utils/agent-helpers.js +39 -1
- package/dist/utils/agent-helpers.js.map +1 -1
- package/dist/utils/platform.d.ts +7 -0
- package/dist/utils/platform.d.ts.map +1 -1
- package/dist/utils/platform.js +11 -1
- package/dist/utils/platform.js.map +1 -1
- package/dist/utils/workspace-trust.d.ts.map +1 -1
- package/dist/utils/workspace-trust.js +5 -1
- package/dist/utils/workspace-trust.js.map +1 -1
- package/dist/workflows/auto-sprint.js +4 -17
- package/package.json +2 -2
- package/packages/apra-fleet-client/src/client/api.mjs +92 -3
- package/packages/apra-fleet-se/apra-pm/agents/backlog-groomer.md +17 -21
- package/packages/apra-fleet-se/apra-pm/agents/ci-watcher.md +3 -0
- package/packages/apra-fleet-se/apra-pm/agents/deployer.md +22 -44
- package/packages/apra-fleet-se/apra-pm/agents/doer.md +131 -132
- package/packages/apra-fleet-se/apra-pm/agents/harvester.md +20 -32
- package/packages/apra-fleet-se/apra-pm/agents/integ-test-runner.md +81 -113
- package/packages/apra-fleet-se/apra-pm/agents/kb-reconciler.md +31 -42
- package/packages/apra-fleet-se/apra-pm/agents/plan-reviewer.md +32 -44
- package/packages/apra-fleet-se/apra-pm/agents/planner.md +51 -63
- package/packages/apra-fleet-se/apra-pm/agents/regression-test-runner.md +65 -80
- package/packages/apra-fleet-se/apra-pm/agents/reviewer.md +56 -83
- package/packages/apra-fleet-se/apra-pm/agents/schemas/integ-test-runner-output.json +1 -1
- package/packages/apra-fleet-se/apra-pm/agents/schemas/regression-test-runner-output.json +4 -17
- package/packages/apra-fleet-se/apra-pm/skills/pm/SKILL.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/cost.md +0 -1
- package/packages/apra-fleet-se/apra-pm/skills/pm/fleet-addendum.md +0 -1
- package/packages/apra-fleet-se/bin/cli.mjs +132 -3
- package/packages/apra-fleet-se/bin/serve.mjs +36 -1
- package/packages/apra-fleet-se/fleet-sprint/contracts.mjs +151 -33
- package/packages/apra-fleet-se/fleet-sprint/docs/README.md +22 -7
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-manual-recovery-verified.md +10 -8
- package/packages/apra-fleet-se/fleet-sprint/docs/dolt-sync-redesign.md +9 -4
- package/packages/apra-fleet-se/fleet-sprint/docs/escalate-to-llm-design.md +2 -2
- package/packages/apra-fleet-se/fleet-sprint/docs/shared-orchestrator-reservation-design.md +12 -12
- package/packages/apra-fleet-se/fleet-sprint/docs/stabilization-log.md +14 -4
- package/packages/apra-fleet-se/fleet-sprint/dolt-settle.mjs +275 -99
- package/packages/apra-fleet-se/fleet-sprint/dolt-sync.mjs +67 -16
- package/packages/apra-fleet-se/fleet-sprint/errors.mjs +41 -0
- package/packages/apra-fleet-se/fleet-sprint/runner.js +1140 -209
- package/packages/apra-fleet-se/fleet-sprint/se-os-commands.mjs +134 -0
- package/packages/apra-fleet-se/fleet-sprint/se-posix.mjs +154 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows-gitbash.mjs +97 -0
- package/packages/apra-fleet-se/fleet-sprint/se-windows.mjs +143 -0
- package/packages/apra-fleet-se/fleet-sprint/skills/fleet-sprint-cli/SKILL.md +2 -1
- package/packages/apra-fleet-se/fleet-sprint/vcs-module.mjs +51 -0
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/azure-devops.mjs +657 -12
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/dolt.mjs +33 -4
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/github.mjs +60 -43
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/index.mjs +205 -2
- package/packages/apra-fleet-se/fleet-sprint/vcs-providers/shell-helpers.mjs +164 -0
- package/packages/apra-fleet-se/fleet-sprint/viewer-extensions.mjs +92 -37
- package/packages/apra-fleet-workflow/src/viewer/index.mjs +167 -1
- package/packages/apra-fleet-workflow/src/workflow/index.mjs +435 -31
- package/skills/fleet/SKILL.md +20 -9
- package/skills/fleet/auth-azdevops.md +44 -5
- package/skills/fleet/auth-bitbucket.md +3 -3
- package/skills/fleet/auth-github.md +2 -2
- package/skills/fleet/beads-conflict-resolution.md +141 -0
- package/skills/fleet/beads.md +16 -12
- package/skills/fleet/onboarding.md +4 -4
- package/skills/fleet/permissions.md +6 -6
- package/skills/fleet/skill-matrix.md +1 -1
- package/skills/fleet/troubleshooting.md +2 -1
- package/version.json +1 -1
- package/dist/providers/gemini.d.ts +0 -52
- package/dist/providers/gemini.d.ts.map +0 -1
- package/dist/providers/gemini.js +0 -236
- package/dist/providers/gemini.js.map +0 -1
- package/packages/apra-fleet-se/fleet-sprint/docs/coach-role-design.md +0 -23
|
@@ -227,8 +227,30 @@ export async function isMemberSyncRemoteConfigured(member, opts) {
|
|
|
227
227
|
// instant re-issue -- the previous code retried with zero delay, which turned
|
|
228
228
|
// the bound into "fail twice as fast". Delay is attempt-indexed and capped, and
|
|
229
229
|
// `sleep` is injectable so unit suites never actually wait.
|
|
230
|
+
//
|
|
231
|
+
// apra-fleet-ka1u follow-up: a live Windows machine-wide git.exe spawn outage
|
|
232
|
+
// (fork/exec ... "Not enough memory resources") was directly measured to last
|
|
233
|
+
// 1-3 MINUTES per occurrence (fleet supervisor log analysis), during which
|
|
234
|
+
// essentially every dolt-initiated git spawn fails -- not an isolated blip.
|
|
235
|
+
// The original 8s cap meant even 5 retries covered at most ~15s of backoff,
|
|
236
|
+
// structurally unable to span an outage an order of magnitude longer; the
|
|
237
|
+
// sprint kept dying with retries correctly firing but exhausted. Raised to
|
|
238
|
+
// 30s so a realistic retry budget (see maxTransientRetries below) can
|
|
239
|
+
// actually outlast one of these windows instead of just softening it.
|
|
230
240
|
const DOLT_BACKOFF_BASE_MS = 500;
|
|
231
|
-
const DOLT_BACKOFF_MAX_MS =
|
|
241
|
+
const DOLT_BACKOFF_MAX_MS = 30000;
|
|
242
|
+
|
|
243
|
+
// apra-fleet-jxdf.2: every `bd dolt pull`/`bd dolt push` this module issues
|
|
244
|
+
// used to inherit whatever generic default the injected command() primitive
|
|
245
|
+
// falls back to when no timeout is specified (120s, sized for an ordinary
|
|
246
|
+
// shell command, not a Dolt sync). A live incident confirmed an INCREMENTAL
|
|
247
|
+
// pull against an already-cloned, several-hundred-MB embedded Dolt DB can
|
|
248
|
+
// take multiple minutes -- an order of magnitude past that default -- and
|
|
249
|
+
// every one of those pulls was timing out, silently, every single time,
|
|
250
|
+
// with no fatal error surfaced and the caller left reading stale data. Size
|
|
251
|
+
// this for realistic Dolt DB sizes in this fleet, not a toy DB; callers that
|
|
252
|
+
// need a different budget can still override via opts.timeoutS.
|
|
253
|
+
const DOLT_STEP_TIMEOUT_S = 600;
|
|
232
254
|
|
|
233
255
|
/**
|
|
234
256
|
* Delay before transient retry #`attempt` (1-based): base * 2^(attempt-1),
|
|
@@ -279,12 +301,12 @@ const defaultSleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
279
301
|
*
|
|
280
302
|
* @returns {Promise<{ ok: boolean, output: string, error: string|null, kind?: 'no-remote'|'empty-remote'|'remote-unreachable'|'diverged'|'auth'|'transient'|'unknown' }>}
|
|
281
303
|
*/
|
|
282
|
-
async function runDoltStep({ command, member, cmd, label, log, maxTransientRetries, onAuthFailure, sleep = defaultSleep, backoffBaseMs = DOLT_BACKOFF_BASE_MS }) {
|
|
304
|
+
async function runDoltStep({ command, member, cmd, label, log, maxTransientRetries, onAuthFailure, sleep = defaultSleep, backoffBaseMs = DOLT_BACKOFF_BASE_MS, timeoutS = DOLT_STEP_TIMEOUT_S }) {
|
|
283
305
|
let attempt = 0;
|
|
284
306
|
let authHealAttempted = false;
|
|
285
307
|
// eslint-disable-next-line no-constant-condition
|
|
286
308
|
while (true) {
|
|
287
|
-
const res = await command(cmd, { member_name: member, silent: true, failSoft: true, label });
|
|
309
|
+
const res = await command(cmd, { member_name: member, silent: true, failSoft: true, label, timeout_s: timeoutS });
|
|
288
310
|
if (res && res.ok) return res;
|
|
289
311
|
const error = res ? res.error : 'unknown command failure';
|
|
290
312
|
const kind = classifyDoltFailure(error);
|
|
@@ -302,11 +324,22 @@ async function runDoltStep({ command, member, cmd, label, log, maxTransientRetri
|
|
|
302
324
|
await onAuthFailure({ member, label, cmd, error, kind: 'dolt' });
|
|
303
325
|
} catch (healErr) {
|
|
304
326
|
log(`[Dolt] self-heal for member '${member}' (${label}) failed; not retrying further: ${healErr.message}`);
|
|
327
|
+
log(`[Dolt] ${label} FAILED (${kind}) -- reads/writes for member '${member}' may be stale until this is resolved. Raw: ${error}`);
|
|
305
328
|
return { ok: false, output: res ? res.output : '', error, kind };
|
|
306
329
|
}
|
|
307
330
|
log(`[Dolt] self-heal for member '${member}' (${label}) completed; retrying the failed dolt command once.`);
|
|
308
331
|
continue;
|
|
309
332
|
}
|
|
333
|
+
// apra-fleet-jxdf.2: every non-ok exit from this function used to be
|
|
334
|
+
// reported ONLY as a structured return value -- a caller on the
|
|
335
|
+
// fatal:false path (the common case, e.g. refreshView's documented
|
|
336
|
+
// "never throws" contract) could silently proceed on stale data with
|
|
337
|
+
// no trace of this failure anywhere in the sprint log. Log it loudly
|
|
338
|
+
// here, once, at the single choke point every D-pull/D-push passes
|
|
339
|
+
// through, so a degraded read/write is always visible to whoever is
|
|
340
|
+
// watching a live sprint -- independent of whether the caller treats
|
|
341
|
+
// it as fatal.
|
|
342
|
+
log(`[Dolt] ${label} FAILED (${kind}) -- reads/writes for member '${member}' may be stale until this is resolved. Raw: ${error}`);
|
|
310
343
|
return { ok: false, output: res ? res.output : '', error, kind };
|
|
311
344
|
}
|
|
312
345
|
}
|
|
@@ -382,7 +415,7 @@ async function attemptSettle({ settle, member, operation, error, log }) {
|
|
|
382
415
|
}
|
|
383
416
|
|
|
384
417
|
export async function doltPullBefore(member, opts = {}) {
|
|
385
|
-
const { command, log = () => {}, maxTransientRetries =
|
|
418
|
+
const { command, log = () => {}, maxTransientRetries = 8, checkSyncRemoteConfigured, skipPull = false, onAuthFailure, sleep, backoffBaseMs, timeoutS, settle } = opts;
|
|
386
419
|
if (typeof command !== 'function') {
|
|
387
420
|
throw new Error("doltPullBefore requires an injected command() in opts");
|
|
388
421
|
}
|
|
@@ -405,7 +438,7 @@ export async function doltPullBefore(member, opts = {}) {
|
|
|
405
438
|
|
|
406
439
|
const pull = await runDoltStep({
|
|
407
440
|
command, member, cmd: 'bd dolt pull',
|
|
408
|
-
label: `D-pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
|
|
441
|
+
label: `D-pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
|
|
409
442
|
});
|
|
410
443
|
if (!pull.ok) {
|
|
411
444
|
if (pull.kind === 'no-remote') {
|
|
@@ -596,7 +629,7 @@ export async function preflightBeadsHealthGate(member, opts = {}) {
|
|
|
596
629
|
* @returns {Promise<{ ok: true, member: string, pushed: boolean, reconciled: boolean, skipped?: true, reason?: 'no-remote', recovered?: true, settledTables?: string[] }>}
|
|
597
630
|
*/
|
|
598
631
|
export async function doltPushAfter(member, opts = {}) {
|
|
599
|
-
const { command, pushBeads = true, log = () => {}, maxTransientRetries =
|
|
632
|
+
const { command, pushBeads = true, log = () => {}, maxTransientRetries = 8, mutex, sprintId, checkSyncRemoteConfigured, onAuthFailure, sleep, backoffBaseMs, timeoutS, settle, renewIntervalMs = DOLT_MUTEX_RENEW_INTERVAL_MS } = opts;
|
|
600
633
|
if (typeof command !== 'function') {
|
|
601
634
|
throw new Error("doltPushAfter requires an injected command() in opts");
|
|
602
635
|
}
|
|
@@ -613,7 +646,14 @@ export async function doltPushAfter(member, opts = {}) {
|
|
|
613
646
|
// suppress a push that was already declared must not happen. The
|
|
614
647
|
// failure-path downgrade below stays as defense in depth.
|
|
615
648
|
const preGateCheckFn = checkSyncRemoteConfigured || isMemberSyncRemoteConfigured;
|
|
616
|
-
|
|
649
|
+
// apra-fleet-7h6n.5: cache the pre-gate's boolean result so the
|
|
650
|
+
// failure-path downgrade below (which used to re-invoke the same probe a
|
|
651
|
+
// second time in this call) can reuse it instead of re-probing. By the
|
|
652
|
+
// time the failure path runs, this pre-gate has already returned `true`
|
|
653
|
+
// (a `false` result exits right here), so reusing it there is
|
|
654
|
+
// behavior-preserving, not a new assumption.
|
|
655
|
+
const syncRemoteConfiguredAtPreGate = await preGateCheckFn(member, { command, log });
|
|
656
|
+
if (!syncRemoteConfiguredAtPreGate) {
|
|
617
657
|
log(`[Dolt] D-push for member '${member}' skipped pre-attempt: bd-level sync.remote neutralized/absent -- no push command issued`);
|
|
618
658
|
return { ok: true, member, pushed: false, reconciled: false, skipped: true, reason: 'no-remote' };
|
|
619
659
|
}
|
|
@@ -683,7 +723,7 @@ export async function doltPushAfter(member, opts = {}) {
|
|
|
683
723
|
async function doltPushGuarded() {
|
|
684
724
|
let push = await runDoltStep({
|
|
685
725
|
command, member, cmd: 'bd dolt push',
|
|
686
|
-
label: `D-push for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
|
|
726
|
+
label: `D-push for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
|
|
687
727
|
});
|
|
688
728
|
if (push.ok) {
|
|
689
729
|
return { ok: true, member, pushed: true, reconciled: false };
|
|
@@ -702,8 +742,11 @@ export async function doltPushAfter(member, opts = {}) {
|
|
|
702
742
|
// misclassify a neutralized-sandbox failure as 'unknown'). An
|
|
703
743
|
// absent sync.remote means nothing is supposed to be pushed from this
|
|
704
744
|
// clone, so the failure is the same benign no-remote skip.
|
|
705
|
-
|
|
706
|
-
|
|
745
|
+
// apra-fleet-7h6n.5: reuse the pre-gate's cached probe result instead
|
|
746
|
+
// of re-invoking checkSyncRemoteConfigured/isMemberSyncRemoteConfigured
|
|
747
|
+
// a second time -- see the pre-gate's comment above for why this is
|
|
748
|
+
// always `true` by the time this failure path is reachable.
|
|
749
|
+
const syncRemoteConfigured = syncRemoteConfiguredAtPreGate;
|
|
707
750
|
if (!syncRemoteConfigured) {
|
|
708
751
|
log(`[Dolt] D-push for member '${member}' skipped: no dolt remote configured (bd-level sync.remote neutralized/absent; push failure treated as benign: ${push.error})`);
|
|
709
752
|
return { ok: true, member, pushed: false, reconciled: false, skipped: true, reason: 'no-remote' };
|
|
@@ -738,7 +781,7 @@ export async function doltPushAfter(member, opts = {}) {
|
|
|
738
781
|
log(`[Dolt] D-push for member '${member}' was rejected (another writer pushed first); reconciling with a single D-pull then one re-push (first-successful-pusher-wins).`);
|
|
739
782
|
const reconcile = await runDoltStep({
|
|
740
783
|
command, member, cmd: 'bd dolt pull',
|
|
741
|
-
label: `D-push reconcile pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
|
|
784
|
+
label: `D-push reconcile pull for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
|
|
742
785
|
});
|
|
743
786
|
if (!reconcile.ok) {
|
|
744
787
|
if (reconcile.kind === 'diverged') {
|
|
@@ -758,7 +801,7 @@ export async function doltPushAfter(member, opts = {}) {
|
|
|
758
801
|
|
|
759
802
|
push = await runDoltStep({
|
|
760
803
|
command, member, cmd: 'bd dolt push',
|
|
761
|
-
label: `D-push re-push after reconcile for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs,
|
|
804
|
+
label: `D-push re-push after reconcile for '${member}'`, log, maxTransientRetries, onAuthFailure, sleep, backoffBaseMs, timeoutS,
|
|
762
805
|
});
|
|
763
806
|
if (push.ok) {
|
|
764
807
|
return { ok: true, member, pushed: true, reconciled: true };
|
|
@@ -1083,7 +1126,9 @@ async function runDegradable(run, ctx) {
|
|
|
1083
1126
|
*
|
|
1084
1127
|
* All other opts are passed through unchanged to doltPullBefore():
|
|
1085
1128
|
* `command` (required), `log`, `maxTransientRetries`, `onAuthFailure`,
|
|
1086
|
-
* `checkSyncRemoteConfigured`, `sleep`, `backoffBaseMs
|
|
1129
|
+
* `checkSyncRemoteConfigured`, `sleep`, `backoffBaseMs`, `timeoutS` (defaults
|
|
1130
|
+
* to DOLT_STEP_TIMEOUT_S -- override only for a call site with a known-
|
|
1131
|
+
* different Dolt DB size/latency profile).
|
|
1087
1132
|
*
|
|
1088
1133
|
* @param {string} member
|
|
1089
1134
|
* @param {{ command: Function, readinessGate?: boolean, fatal?: boolean, onDegraded?: Function, log?: Function, maxTransientRetries?: number, checkSyncRemoteConfigured?: Function, skipRefresh?: boolean, onAuthFailure?: Function, sleep?: Function, backoffBaseMs?: number }} opts
|
|
@@ -1267,18 +1312,24 @@ export function flush(filter = {}) {
|
|
|
1267
1312
|
* `platform`/`arch` are optional and probed from the member when absent.
|
|
1268
1313
|
* `opts.settle` may be supplied to override the callback (tests do this).
|
|
1269
1314
|
*
|
|
1315
|
+
* `opts.shell` threads the member's REGISTERED shell into dolt-settle
|
|
1316
|
+
* (apra-fleet-7dir.16/.24) the same way every other buildSettleCallback call
|
|
1317
|
+
* site does -- omitted (defaulting to '', the PowerShell dialect on
|
|
1318
|
+
* Windows) is the pre-shell-aware behavior, not a regression, for any
|
|
1319
|
+
* caller that has not resolved it.
|
|
1320
|
+
*
|
|
1270
1321
|
* @param {string} member
|
|
1271
|
-
* @param {{ command?: Function, log?: Function, platform?: string, arch?: string, settle?: Function, [key: string]: any }} [opts]
|
|
1322
|
+
* @param {{ command?: Function, log?: Function, platform?: string, arch?: string, shell?: string, settle?: Function, [key: string]: any }} [opts]
|
|
1272
1323
|
* @returns {Promise<{ repaired: boolean, escalation?: string, result?: object }>}
|
|
1273
1324
|
*/
|
|
1274
1325
|
export async function repair(member, opts = {}) {
|
|
1275
|
-
const { command, log = () => {}, platform, arch } = opts;
|
|
1326
|
+
const { command, log = () => {}, platform, arch, shell = '' } = opts;
|
|
1276
1327
|
if (typeof command !== 'function') {
|
|
1277
1328
|
return { repaired: false, escalation: 'not-configured: repair() requires an injected command() to run settle' };
|
|
1278
1329
|
}
|
|
1279
1330
|
const settle = typeof opts.settle === 'function'
|
|
1280
1331
|
? opts.settle
|
|
1281
|
-
: buildSettleCallback(member, { command, log, platform, arch });
|
|
1332
|
+
: buildSettleCallback(member, { command, log, platform, arch, shell });
|
|
1282
1333
|
let result = null;
|
|
1283
1334
|
try {
|
|
1284
1335
|
result = await settle({ operation: 'repair' });
|
|
@@ -614,3 +614,44 @@ export class PostDispatchSyncError extends WorkflowError {
|
|
|
614
614
|
export function isPostDispatchSyncFailure(err) {
|
|
615
615
|
return err instanceof PostDispatchSyncError;
|
|
616
616
|
}
|
|
617
|
+
|
|
618
|
+
// ---------------------------------------------------------------------------
|
|
619
|
+
// apra-fleet-p2to.4.2 -- resume could not re-reserve every member
|
|
620
|
+
// ---------------------------------------------------------------------------
|
|
621
|
+
|
|
622
|
+
/**
|
|
623
|
+
* Thrown when a cooperative resume (after a pause released this sprint's member
|
|
624
|
+
* reservations) cannot re-acquire one or more members because another sprint
|
|
625
|
+
* claimed them while this one was paused -- an OWNER-CHECKED re-reserve, so we
|
|
626
|
+
* refuse to silently continue on top of a member some other sprint now owns.
|
|
627
|
+
*
|
|
628
|
+
* The whole point of this error is that it NAMES the unavailable members, so an
|
|
629
|
+
* operator reading the failed resume knows exactly which members to free (or
|
|
630
|
+
* which other sprint to stop) before retrying the resume -- rather than a
|
|
631
|
+
* generic "resume failed" with no actionable detail.
|
|
632
|
+
*
|
|
633
|
+
* @property {string[]} members - the members that could NOT be re-reserved on
|
|
634
|
+
* resume (each already reserved by a different sprint).
|
|
635
|
+
*/
|
|
636
|
+
export class MemberReservationResumeError extends WorkflowError {
|
|
637
|
+
/**
|
|
638
|
+
* @param {string[]} unavailableMembers
|
|
639
|
+
* @param {{ details?: object, cause?: unknown }} [opts]
|
|
640
|
+
*/
|
|
641
|
+
constructor(unavailableMembers = [], opts = {}) {
|
|
642
|
+
const members = Array.isArray(unavailableMembers) ? unavailableMembers : [];
|
|
643
|
+
const { details, cause } = opts;
|
|
644
|
+
super(
|
|
645
|
+
`[Workflow Error] Resume failed: could not re-reserve ${members.length} member(s) ` +
|
|
646
|
+
`released at pause -- ${members.join(', ')} ` +
|
|
647
|
+
`${members.length === 1 ? 'is' : 'are'} now reserved by another sprint. ` +
|
|
648
|
+
`Free ${members.length === 1 ? 'it' : 'them'} (or stop the other sprint) before resuming.`,
|
|
649
|
+
{
|
|
650
|
+
code: 'MEMBER_RESERVATION_RESUME_FAILED',
|
|
651
|
+
details: { members, ...details },
|
|
652
|
+
cause,
|
|
653
|
+
}
|
|
654
|
+
);
|
|
655
|
+
this.members = members;
|
|
656
|
+
}
|
|
657
|
+
}
|