@h-rig/runtime 0.0.6-alpha.36 → 0.0.6-alpha.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/bin/rig-agent.js +31 -12
- package/dist/src/control-plane/harness-main.js +31 -12
- package/dist/src/control-plane/hooks/completion-verification.js +32 -13
- package/dist/src/control-plane/hooks/submodule-branch.js +1 -1
- package/dist/src/control-plane/hooks/task-runtime-start.js +1 -1
- package/dist/src/control-plane/native/git-ops.js +31 -12
- package/dist/src/control-plane/native/harness-cli.js +31 -12
- package/dist/src/control-plane/native/task-ops.js +14 -9
- package/dist/src/control-plane/native/verifier.js +1 -1
- package/package.json +8 -8
package/dist/bin/rig-agent.js
CHANGED
|
@@ -3616,7 +3616,7 @@ class GeneralCliEventBus {
|
|
|
3616
3616
|
}
|
|
3617
3617
|
|
|
3618
3618
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
3619
|
-
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync15, writeFileSync as writeFileSync12 } from "fs";
|
|
3619
|
+
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync15, unlinkSync, writeFileSync as writeFileSync12 } from "fs";
|
|
3620
3620
|
import { dirname as dirname15, isAbsolute as isAbsolute2, resolve as resolve28 } from "path";
|
|
3621
3621
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
3622
3622
|
|
|
@@ -6693,14 +6693,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
6693
6693
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
6694
6694
|
}
|
|
6695
6695
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
6696
|
-
const
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6696
|
+
const baseRefCandidates = [];
|
|
6697
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
6698
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
6699
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
6700
|
+
}
|
|
6701
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
6702
|
+
for (const baseRef of baseRefCandidates) {
|
|
6703
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
6704
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
6705
|
+
continue;
|
|
6706
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
6707
|
+
if (result.exitCode === 0) {
|
|
6708
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
6704
6709
|
}
|
|
6705
6710
|
}
|
|
6706
6711
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -7826,9 +7831,23 @@ function commitRepo(projectRoot, repo, label, message, allowEmpty, scoped, files
|
|
|
7826
7831
|
console.log(`Skipping ${label}: no changes to commit.`);
|
|
7827
7832
|
return;
|
|
7828
7833
|
}
|
|
7829
|
-
|
|
7830
|
-
|
|
7831
|
-
|
|
7834
|
+
if (scopedFiles.length > 0) {
|
|
7835
|
+
const pathspecFile = resolve28(repo, ".git", `rig-stage-${process.pid}-${Date.now()}.txt`);
|
|
7836
|
+
writeFileSync12(pathspecFile, `${scopedFiles.join(`
|
|
7837
|
+
`)}
|
|
7838
|
+
`, "utf-8");
|
|
7839
|
+
try {
|
|
7840
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, "add", `--pathspec-from-file=${pathspecFile}`), `Failed to stage changes for ${label}`);
|
|
7841
|
+
} finally {
|
|
7842
|
+
try {
|
|
7843
|
+
unlinkSync(pathspecFile);
|
|
7844
|
+
} catch {}
|
|
7845
|
+
}
|
|
7846
|
+
} else {
|
|
7847
|
+
const addArgs = buildStageAddArgs(repo, scopedFiles, scoped);
|
|
7848
|
+
if (addArgs) {
|
|
7849
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, ...addArgs), `Failed to stage changes for ${label}`);
|
|
7850
|
+
}
|
|
7832
7851
|
}
|
|
7833
7852
|
const stagedChanges = stagedChangeCount(projectRoot, repo);
|
|
7834
7853
|
if (stagedChanges === 0) {
|
|
@@ -9,7 +9,7 @@ import { existsSync as existsSync31 } from "fs";
|
|
|
9
9
|
import { resolve as resolve31 } from "path";
|
|
10
10
|
|
|
11
11
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
12
|
-
import { existsSync as existsSync24, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync13, writeFileSync as writeFileSync12 } from "fs";
|
|
12
|
+
import { existsSync as existsSync24, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync12 } from "fs";
|
|
13
13
|
import { dirname as dirname12, isAbsolute as isAbsolute2, resolve as resolve26 } from "path";
|
|
14
14
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
15
15
|
|
|
@@ -6975,14 +6975,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
6975
6975
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
6976
6976
|
}
|
|
6977
6977
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
6978
|
-
const
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6978
|
+
const baseRefCandidates = [];
|
|
6979
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
6980
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
6981
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
6982
|
+
}
|
|
6983
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
6984
|
+
for (const baseRef of baseRefCandidates) {
|
|
6985
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
6986
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
6987
|
+
continue;
|
|
6988
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
6989
|
+
if (result.exitCode === 0) {
|
|
6990
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
6986
6991
|
}
|
|
6987
6992
|
}
|
|
6988
6993
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -8133,9 +8138,23 @@ function commitRepo(projectRoot, repo, label, message, allowEmpty, scoped, files
|
|
|
8133
8138
|
console.log(`Skipping ${label}: no changes to commit.`);
|
|
8134
8139
|
return;
|
|
8135
8140
|
}
|
|
8136
|
-
|
|
8137
|
-
|
|
8138
|
-
|
|
8141
|
+
if (scopedFiles.length > 0) {
|
|
8142
|
+
const pathspecFile = resolve26(repo, ".git", `rig-stage-${process.pid}-${Date.now()}.txt`);
|
|
8143
|
+
writeFileSync12(pathspecFile, `${scopedFiles.join(`
|
|
8144
|
+
`)}
|
|
8145
|
+
`, "utf-8");
|
|
8146
|
+
try {
|
|
8147
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, "add", `--pathspec-from-file=${pathspecFile}`), `Failed to stage changes for ${label}`);
|
|
8148
|
+
} finally {
|
|
8149
|
+
try {
|
|
8150
|
+
unlinkSync(pathspecFile);
|
|
8151
|
+
} catch {}
|
|
8152
|
+
}
|
|
8153
|
+
} else {
|
|
8154
|
+
const addArgs = buildStageAddArgs(repo, scopedFiles, scoped);
|
|
8155
|
+
if (addArgs) {
|
|
8156
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, ...addArgs), `Failed to stage changes for ${label}`);
|
|
8157
|
+
}
|
|
8139
8158
|
}
|
|
8140
8159
|
const stagedChanges = stagedChangeCount(projectRoot, repo);
|
|
8141
8160
|
if (stagedChanges === 0) {
|
|
@@ -1073,7 +1073,7 @@ function primeGuardHotPaths() {
|
|
|
1073
1073
|
primeGuardHotPaths();
|
|
1074
1074
|
|
|
1075
1075
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
1076
|
-
import { existsSync as existsSync22, lstatSync, mkdirSync as mkdirSync13, readFileSync as readFileSync13, writeFileSync as writeFileSync13 } from "fs";
|
|
1076
|
+
import { existsSync as existsSync22, lstatSync, mkdirSync as mkdirSync13, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync13 } from "fs";
|
|
1077
1077
|
import { dirname as dirname11, isAbsolute as isAbsolute2, resolve as resolve24 } from "path";
|
|
1078
1078
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1079
1079
|
|
|
@@ -6986,14 +6986,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
6986
6986
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
6987
6987
|
}
|
|
6988
6988
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
6989
|
-
const
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6989
|
+
const baseRefCandidates = [];
|
|
6990
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
6991
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
6992
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
6993
|
+
}
|
|
6994
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
6995
|
+
for (const baseRef of baseRefCandidates) {
|
|
6996
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
6997
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
6998
|
+
continue;
|
|
6999
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
7000
|
+
if (result.exitCode === 0) {
|
|
7001
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
6997
7002
|
}
|
|
6998
7003
|
}
|
|
6999
7004
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -7907,9 +7912,23 @@ function commitRepo(projectRoot, repo, label, message, allowEmpty, scoped, files
|
|
|
7907
7912
|
console.log(`Skipping ${label}: no changes to commit.`);
|
|
7908
7913
|
return;
|
|
7909
7914
|
}
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7915
|
+
if (scopedFiles.length > 0) {
|
|
7916
|
+
const pathspecFile = resolve24(repo, ".git", `rig-stage-${process.pid}-${Date.now()}.txt`);
|
|
7917
|
+
writeFileSync13(pathspecFile, `${scopedFiles.join(`
|
|
7918
|
+
`)}
|
|
7919
|
+
`, "utf-8");
|
|
7920
|
+
try {
|
|
7921
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, "add", `--pathspec-from-file=${pathspecFile}`), `Failed to stage changes for ${label}`);
|
|
7922
|
+
} finally {
|
|
7923
|
+
try {
|
|
7924
|
+
unlinkSync(pathspecFile);
|
|
7925
|
+
} catch {}
|
|
7926
|
+
}
|
|
7927
|
+
} else {
|
|
7928
|
+
const addArgs = buildStageAddArgs(repo, scopedFiles, scoped);
|
|
7929
|
+
if (addArgs) {
|
|
7930
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, ...addArgs), `Failed to stage changes for ${label}`);
|
|
7931
|
+
}
|
|
7913
7932
|
}
|
|
7914
7933
|
const stagedChanges = stagedChangeCount(projectRoot, repo);
|
|
7915
7934
|
if (stagedChanges === 0) {
|
|
@@ -8412,7 +8431,7 @@ async function main() {
|
|
|
8412
8431
|
target: "monorepo",
|
|
8413
8432
|
message: `rig: ${taskId} task completion`,
|
|
8414
8433
|
allowEmpty: false,
|
|
8415
|
-
scoped:
|
|
8434
|
+
scoped: false
|
|
8416
8435
|
});
|
|
8417
8436
|
console.log("OK: Task changes committed");
|
|
8418
8437
|
} else {
|
|
@@ -126,7 +126,7 @@ import { resolve as resolve38 } from "path";
|
|
|
126
126
|
import { resolveProjectRoot } from "@rig/hook-kit";
|
|
127
127
|
|
|
128
128
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
129
|
-
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync11, readFileSync as readFileSync13, writeFileSync as writeFileSync10 } from "fs";
|
|
129
|
+
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync11, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync10 } from "fs";
|
|
130
130
|
import { dirname as dirname11, isAbsolute as isAbsolute2, resolve as resolve25 } from "path";
|
|
131
131
|
|
|
132
132
|
// packages/runtime/src/control-plane/runtime/baked-secrets.ts
|
|
@@ -126,7 +126,7 @@ import { resolve as resolve38 } from "path";
|
|
|
126
126
|
import { resolveProjectRoot } from "@rig/hook-kit";
|
|
127
127
|
|
|
128
128
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
129
|
-
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync11, readFileSync as readFileSync13, writeFileSync as writeFileSync10 } from "fs";
|
|
129
|
+
import { existsSync as existsSync25, lstatSync, mkdirSync as mkdirSync11, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync10 } from "fs";
|
|
130
130
|
import { dirname as dirname11, isAbsolute as isAbsolute2, resolve as resolve25 } from "path";
|
|
131
131
|
|
|
132
132
|
// packages/runtime/src/control-plane/runtime/baked-secrets.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
3
|
-
import { existsSync as existsSync9, lstatSync, mkdirSync as mkdirSync5, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
|
|
3
|
+
import { existsSync as existsSync9, lstatSync, mkdirSync as mkdirSync5, readFileSync as readFileSync7, unlinkSync, writeFileSync as writeFileSync5 } from "fs";
|
|
4
4
|
import { dirname as dirname7, isAbsolute as isAbsolute2, resolve as resolve11 } from "path";
|
|
5
5
|
import { fileURLToPath } from "url";
|
|
6
6
|
|
|
@@ -1404,14 +1404,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
1404
1404
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
1405
1405
|
}
|
|
1406
1406
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1407
|
+
const baseRefCandidates = [];
|
|
1408
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
1409
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
1410
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
1411
|
+
}
|
|
1412
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
1413
|
+
for (const baseRef of baseRefCandidates) {
|
|
1414
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
1415
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
1416
|
+
continue;
|
|
1417
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
1418
|
+
if (result.exitCode === 0) {
|
|
1419
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
1415
1420
|
}
|
|
1416
1421
|
}
|
|
1417
1422
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -2439,9 +2444,23 @@ function commitRepo(projectRoot, repo, label, message, allowEmpty, scoped, files
|
|
|
2439
2444
|
console.log(`Skipping ${label}: no changes to commit.`);
|
|
2440
2445
|
return;
|
|
2441
2446
|
}
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2447
|
+
if (scopedFiles.length > 0) {
|
|
2448
|
+
const pathspecFile = resolve11(repo, ".git", `rig-stage-${process.pid}-${Date.now()}.txt`);
|
|
2449
|
+
writeFileSync5(pathspecFile, `${scopedFiles.join(`
|
|
2450
|
+
`)}
|
|
2451
|
+
`, "utf-8");
|
|
2452
|
+
try {
|
|
2453
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, "add", `--pathspec-from-file=${pathspecFile}`), `Failed to stage changes for ${label}`);
|
|
2454
|
+
} finally {
|
|
2455
|
+
try {
|
|
2456
|
+
unlinkSync(pathspecFile);
|
|
2457
|
+
} catch {}
|
|
2458
|
+
}
|
|
2459
|
+
} else {
|
|
2460
|
+
const addArgs = buildStageAddArgs(repo, scopedFiles, scoped);
|
|
2461
|
+
if (addArgs) {
|
|
2462
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, ...addArgs), `Failed to stage changes for ${label}`);
|
|
2463
|
+
}
|
|
2445
2464
|
}
|
|
2446
2465
|
const stagedChanges = stagedChangeCount(projectRoot, repo);
|
|
2447
2466
|
if (stagedChanges === 0) {
|
|
@@ -4,7 +4,7 @@ import { existsSync as existsSync31 } from "fs";
|
|
|
4
4
|
import { resolve as resolve31 } from "path";
|
|
5
5
|
|
|
6
6
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
7
|
-
import { existsSync as existsSync24, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync13, writeFileSync as writeFileSync12 } from "fs";
|
|
7
|
+
import { existsSync as existsSync24, lstatSync, mkdirSync as mkdirSync12, readFileSync as readFileSync13, unlinkSync, writeFileSync as writeFileSync12 } from "fs";
|
|
8
8
|
import { dirname as dirname12, isAbsolute as isAbsolute2, resolve as resolve26 } from "path";
|
|
9
9
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10
10
|
|
|
@@ -6969,14 +6969,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
6969
6969
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
6970
6970
|
}
|
|
6971
6971
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
6972
|
-
const
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6972
|
+
const baseRefCandidates = [];
|
|
6973
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
6974
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
6975
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
6976
|
+
}
|
|
6977
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
6978
|
+
for (const baseRef of baseRefCandidates) {
|
|
6979
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
6980
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
6981
|
+
continue;
|
|
6982
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
6983
|
+
if (result.exitCode === 0) {
|
|
6984
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
6980
6985
|
}
|
|
6981
6986
|
}
|
|
6982
6987
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -8127,9 +8132,23 @@ function commitRepo(projectRoot, repo, label, message, allowEmpty, scoped, files
|
|
|
8127
8132
|
console.log(`Skipping ${label}: no changes to commit.`);
|
|
8128
8133
|
return;
|
|
8129
8134
|
}
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8135
|
+
if (scopedFiles.length > 0) {
|
|
8136
|
+
const pathspecFile = resolve26(repo, ".git", `rig-stage-${process.pid}-${Date.now()}.txt`);
|
|
8137
|
+
writeFileSync12(pathspecFile, `${scopedFiles.join(`
|
|
8138
|
+
`)}
|
|
8139
|
+
`, "utf-8");
|
|
8140
|
+
try {
|
|
8141
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, "add", `--pathspec-from-file=${pathspecFile}`), `Failed to stage changes for ${label}`);
|
|
8142
|
+
} finally {
|
|
8143
|
+
try {
|
|
8144
|
+
unlinkSync(pathspecFile);
|
|
8145
|
+
} catch {}
|
|
8146
|
+
}
|
|
8147
|
+
} else {
|
|
8148
|
+
const addArgs = buildStageAddArgs(repo, scopedFiles, scoped);
|
|
8149
|
+
if (addArgs) {
|
|
8150
|
+
runOrThrow(projectRoot, gitCmd(projectRoot, repo, ...addArgs), `Failed to stage changes for ${label}`);
|
|
8151
|
+
}
|
|
8133
8152
|
}
|
|
8134
8153
|
const stagedChanges = stagedChangeCount(projectRoot, repo);
|
|
8135
8154
|
if (stagedChanges === 0) {
|
|
@@ -3816,7 +3816,7 @@ function resolveRuntimeSecrets(env, baked = BAKED_RUNTIME_SECRETS) {
|
|
|
3816
3816
|
}
|
|
3817
3817
|
|
|
3818
3818
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
3819
|
-
import { existsSync as existsSync21, lstatSync, mkdirSync as mkdirSync10, readFileSync as readFileSync11, writeFileSync as writeFileSync10 } from "fs";
|
|
3819
|
+
import { existsSync as existsSync21, lstatSync, mkdirSync as mkdirSync10, readFileSync as readFileSync11, unlinkSync, writeFileSync as writeFileSync10 } from "fs";
|
|
3820
3820
|
import { dirname as dirname12, isAbsolute as isAbsolute2, resolve as resolve23 } from "path";
|
|
3821
3821
|
|
|
3822
3822
|
// packages/runtime/src/control-plane/native/pr-review-gate.ts
|
|
@@ -7256,14 +7256,19 @@ function resolveTaskMonorepoRoot(projectRoot) {
|
|
|
7256
7256
|
return resolveHarnessPaths(projectRoot).monorepoRoot;
|
|
7257
7257
|
}
|
|
7258
7258
|
function collectCommittedMonorepoFiles(projectRoot, repo) {
|
|
7259
|
-
const
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
|
|
7265
|
-
|
|
7266
|
-
|
|
7259
|
+
const baseRefCandidates = [];
|
|
7260
|
+
const originHead = runCapture(["git", "-C", repo, "rev-parse", "--abbrev-ref", "origin/HEAD"], projectRoot);
|
|
7261
|
+
if (originHead.exitCode === 0 && originHead.stdout.trim()) {
|
|
7262
|
+
baseRefCandidates.push(originHead.stdout.trim());
|
|
7263
|
+
}
|
|
7264
|
+
baseRefCandidates.push("origin/main", "origin/dev", "origin/master", "main", "dev", "master");
|
|
7265
|
+
for (const baseRef of baseRefCandidates) {
|
|
7266
|
+
const mergeBase = runCapture(["git", "-C", repo, "merge-base", "HEAD", baseRef], projectRoot);
|
|
7267
|
+
if (mergeBase.exitCode !== 0 || !mergeBase.stdout.trim())
|
|
7268
|
+
continue;
|
|
7269
|
+
const result = runCapture(["git", "-C", repo, "diff", "--name-only", `${mergeBase.stdout.trim()}..HEAD`], projectRoot);
|
|
7270
|
+
if (result.exitCode === 0) {
|
|
7271
|
+
return result.stdout.split(/\r?\n/).map((line) => line.trim()).filter(Boolean);
|
|
7267
7272
|
}
|
|
7268
7273
|
}
|
|
7269
7274
|
const initialHeadCommit = resolveRuntimeInitialHeadCommit(projectRoot, repo);
|
|
@@ -47,7 +47,7 @@ function resolveRuntimeSecrets(env, baked = BAKED_RUNTIME_SECRETS) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
// packages/runtime/src/control-plane/native/git-ops.ts
|
|
50
|
-
import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync6, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "fs";
|
|
50
|
+
import { existsSync as existsSync13, lstatSync, mkdirSync as mkdirSync6, readFileSync as readFileSync9, unlinkSync, writeFileSync as writeFileSync7 } from "fs";
|
|
51
51
|
import { dirname as dirname9, isAbsolute as isAbsolute2, resolve as resolve14 } from "path";
|
|
52
52
|
|
|
53
53
|
// packages/runtime/src/control-plane/runtime/context.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/runtime",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig package",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
"main": "./dist/src/index.js",
|
|
64
64
|
"module": "./dist/src/index.js",
|
|
65
65
|
"dependencies": {
|
|
66
|
-
"@earendil-works/pi-coding-agent": "npm:@h-rig/pi-coding-agent@0.0.6-alpha.
|
|
66
|
+
"@earendil-works/pi-coding-agent": "npm:@h-rig/pi-coding-agent@0.0.6-alpha.38",
|
|
67
67
|
"@libsql/client": "^0.17.2",
|
|
68
|
-
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.
|
|
69
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
70
|
-
"@rig/hook-kit": "npm:@h-rig/hook-kit@0.0.6-alpha.
|
|
71
|
-
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.
|
|
72
|
-
"@rig/skill-loader": "npm:@h-rig/skill-loader@0.0.6-alpha.
|
|
73
|
-
"@rig/validator-kit": "npm:@h-rig/validator-kit@0.0.6-alpha.
|
|
68
|
+
"@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.38",
|
|
69
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.38",
|
|
70
|
+
"@rig/hook-kit": "npm:@h-rig/hook-kit@0.0.6-alpha.38",
|
|
71
|
+
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.38",
|
|
72
|
+
"@rig/skill-loader": "npm:@h-rig/skill-loader@0.0.6-alpha.38",
|
|
73
|
+
"@rig/validator-kit": "npm:@h-rig/validator-kit@0.0.6-alpha.38",
|
|
74
74
|
"effect": "4.0.0-beta.78",
|
|
75
75
|
"smol-toml": "^1.6.0"
|
|
76
76
|
}
|