amsd-pipeline-shared 0.5.33 → 0.5.34
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.
|
@@ -74,7 +74,7 @@ async function handle(a) {
|
|
|
74
74
|
for (const f of profile.logs.evidence) fs.writeFileSync(path.join(ev, path.basename(f)), tail(path.join(runDir, f), profile.logs.evidenceTailLines));
|
|
75
75
|
|
|
76
76
|
const base = git(repo, 'rev-parse', 'HEAD').stdout.trim();
|
|
77
|
-
const branch = `${profile.branch.prefix}${runId}-${attempt.n}
|
|
77
|
+
const branch = freeBranch(repo, `${profile.branch.prefix}${runId}-${attempt.n}`);
|
|
78
78
|
const wt = path.join(A, 'wt');
|
|
79
79
|
const mk = git(repo, 'worktree', 'add', '-b', branch, wt, 'HEAD');
|
|
80
80
|
if (mk.status !== 0) return stop('worktree', `cannot make the repair's work tree: ${mk.stderr.trim()}`);
|
|
@@ -150,4 +150,12 @@ async function handle(a) {
|
|
|
150
150
|
} finally { git(repo, 'worktree', 'remove', '--force', wt); git(repo, 'worktree', 'prune'); }
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
/** The first branch name free in <repo>: <name>, else <name>-leg2, -leg3, … A run's next leg starts its attempts at 1 again, and an earlier
|
|
154
|
+
* leg's repair branch is that repair's evidence — never moved or deleted (2026-10-24: run 13's next leg stopped on "already exists"). */
|
|
155
|
+
function freeBranch(repo, name) {
|
|
156
|
+
const taken = (b) => git(repo, 'rev-parse', '--verify', '--quiet', `refs/heads/${b}`).status === 0;
|
|
157
|
+
if (!taken(name)) return name;
|
|
158
|
+
for (let k = 2; ; k += 1) if (!taken(`${name}-leg${k}`)) return `${name}-leg${k}`;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
module.exports = { handle, freeBranch };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amsd-pipeline-shared",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.34",
|
|
4
4
|
"description": "The AMSD pipeline's shared components, one source for the bash pipeline and its Claude workflows: the model-call gateway (llm-handler.sh — retry, ladder, self-heal, cost) and the libraries it runs.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|