@futurelastic/colab-handbook 1.14.1-rc.6 → 1.14.1-rc.7
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 +1 -1
- package/tools/colab +33 -3
package/package.json
CHANGED
package/tools/colab
CHANGED
|
@@ -13601,6 +13601,31 @@ function handoffEvidence(v) {
|
|
|
13601
13601
|
return v ? ` · landed from the executor's hand-off ${v.url} — its claim and worktree stay until it confirms the land` : '';
|
|
13602
13602
|
}
|
|
13603
13603
|
|
|
13604
|
+
/**
|
|
13605
|
+
* #619: the one line a failed B1 git step is reported by. Never `stderr.split('\n')[0]` — a
|
|
13606
|
+
* pre-commit hook that prints a banner first (gitleaks' ASCII art opens with `○`) made the banner
|
|
13607
|
+
* the entire report and discarded the reason. gitFailureLine picks the `fatal:` line or the LAST
|
|
13608
|
+
* line, which is where a hook's verdict lands. stdout is the fallback because git writes some
|
|
13609
|
+
* failures there with an empty stderr (`merge --squash` conflicts, `nothing to commit`).
|
|
13610
|
+
*/
|
|
13611
|
+
function b1FailureLine(r, fallback) {
|
|
13612
|
+
return git.gitFailureLine(r.stderr) || git.gitFailureLine(r.stdout) || fallback;
|
|
13613
|
+
}
|
|
13614
|
+
|
|
13615
|
+
/**
|
|
13616
|
+
* #619: the full output of a failed B1 git step, indented under the one-line summary, so the cause
|
|
13617
|
+
* survives even when no single line names it (the measured failure could not be recovered: an
|
|
13618
|
+
* identical retry passed). Empty when there is at most one line — the summary already said it.
|
|
13619
|
+
* Capped at the last 40 lines; a hook's verdict is at the end, not the start.
|
|
13620
|
+
*/
|
|
13621
|
+
function b1FailureDetail(r) {
|
|
13622
|
+
const lines = String((r.stderr || '').trim() ? r.stderr : (r.stdout || '')).split('\n').filter((l) => l.trim());
|
|
13623
|
+
if (lines.length <= 1) return '';
|
|
13624
|
+
const shown = lines.slice(-40);
|
|
13625
|
+
const head = lines.length > shown.length ? ` … ${lines.length - shown.length} earlier line(s) omitted\n` : '';
|
|
13626
|
+
return ` git output:\n${head}${shown.map((l) => ` ${l}`).join('\n')}\n`;
|
|
13627
|
+
}
|
|
13628
|
+
|
|
13604
13629
|
function shipRefFor(repoAbs, branch) {
|
|
13605
13630
|
const r = git.branchRefs(repoAbs, branch);
|
|
13606
13631
|
return r.localSha || r.remoteSha || branch;
|
|
@@ -14546,14 +14571,19 @@ function cmdShip(argv) {
|
|
|
14546
14571
|
const sq = git.git(['merge', '--squash', sess.branch], targetDir);
|
|
14547
14572
|
if (!sq.ok) {
|
|
14548
14573
|
git.git(['merge', '--abort'], targetDir); cleanupEphemeral(); cleanupTarget();
|
|
14549
|
-
|
|
14574
|
+
// #619: never stderr's first line — a conflict reports on STDOUT with an empty stderr.
|
|
14575
|
+
process.stderr.write(`✗ B1: squash-merge failed: ${b1FailureLine(sq, 'no output from git')}. Nothing pushed.\n${b1FailureDetail(sq)}`);
|
|
14576
|
+
process.stderr.write(` Sync ${target} into the branch (\`git merge ${shipRemote}/${target}\` in its worktree), resolve, push, then re-run \`colab ship --branch ${sess.branch}\`.\n`);
|
|
14550
14577
|
return 1;
|
|
14551
14578
|
}
|
|
14552
14579
|
const commit = git.run('git', ['commit', '-m', commitMsg], { cwd: targetDir });
|
|
14553
14580
|
if (!commit.ok) {
|
|
14554
14581
|
git.git(['reset', '--hard', `${shipRemote}/${target}`], targetDir); cleanupEphemeral(); cleanupTarget();
|
|
14555
|
-
//
|
|
14556
|
-
|
|
14582
|
+
// #619: a hook that prints a banner first (gitleaks' ASCII art) made stderr's FIRST line the
|
|
14583
|
+
// whole report, discarding the reason. gitFailureLine picks the `fatal:` / last line instead,
|
|
14584
|
+
// and the full hook output follows so the cause survives even when no single line names it.
|
|
14585
|
+
process.stderr.write(`✗ B1: commit failed (${b1FailureLine(commit, 'nothing to commit?')}). ${target} reset, nothing pushed.\n${b1FailureDetail(commit)}`);
|
|
14586
|
+
process.stderr.write(` Fix what the output above names on ${sess.branch}, push, then re-run \`colab ship --branch ${sess.branch}\` once it passes.\n`);
|
|
14557
14587
|
return 1;
|
|
14558
14588
|
}
|
|
14559
14589
|
const sha = git.git(['rev-parse', '--short', 'HEAD'], targetDir).stdout;
|