robisie 0.2.1 → 0.2.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/CHANGELOG.md +16 -0
- package/README.md +4 -2
- package/dist/cli.js +16 -6
- package/dist/commands.d.ts +8 -0
- package/dist/commands.js +85 -3
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/delivery-local.d.ts +2 -2
- package/dist/delivery-local.js +26 -5
- package/dist/engine/bundle-report.json +13 -7
- package/dist/engine/tick.cjs +190 -96
- package/dist/engine-inputs.d.ts +13 -0
- package/dist/engine-inputs.js +203 -0
- package/dist/git-commit.d.ts +5 -0
- package/dist/git-commit.js +23 -0
- package/dist/helpers.js +1 -1
- package/dist/role-registry.d.ts +1 -1
- package/dist/role-registry.js +11 -8
- package/dist/roles.d.ts +1 -1
- package/docs/ENGINE-CONFIG.md +8 -0
- package/docs/README.en.md +6 -4
- package/docs/README.md +7 -5
- package/docs/RELEASE-0.1.0.md +2 -0
- package/package.json +1 -1
package/dist/engine/tick.cjs
CHANGED
|
@@ -37577,7 +37577,7 @@ var init_constants = __esm({
|
|
|
37577
37577
|
"packages/client/src/constants.ts"() {
|
|
37578
37578
|
"use strict";
|
|
37579
37579
|
PACKAGE_NAME = "robisie";
|
|
37580
|
-
PACKAGE_VERSION = "0.2.
|
|
37580
|
+
PACKAGE_VERSION = "0.2.2";
|
|
37581
37581
|
SUPPORTED_CONTRACT_MAJOR = 1;
|
|
37582
37582
|
DEFAULT_ORIGIN = "https://robisie.app";
|
|
37583
37583
|
MCP_SERVER_NAME = "robisie";
|
|
@@ -37852,10 +37852,12 @@ function resolveRoleExecution(registry2, role3) {
|
|
|
37852
37852
|
return { provider: entry2.provider, model: entry2.model, effortRequested: entry2.effort };
|
|
37853
37853
|
}
|
|
37854
37854
|
function loadRoleRegistryConfig(path34) {
|
|
37855
|
-
const
|
|
37856
|
-
|
|
37855
|
+
const file3 = (0, import_node_path3.resolve)(path34);
|
|
37856
|
+
let configPath = file3;
|
|
37857
|
+
const retry = `Popraw plik \u201E${file3}\u201D (${CONFIG_FILE}) i pon\xF3w \`npx robisie doctor --engine-config <path>\` z t\u0105 \u015Bcie\u017Ck\u0105.`;
|
|
37857
37858
|
let contents;
|
|
37858
37859
|
try {
|
|
37860
|
+
configPath = (0, import_node_fs2.realpathSync)(configPath);
|
|
37859
37861
|
contents = (0, import_node_fs2.readFileSync)(configPath, "utf8");
|
|
37860
37862
|
} catch {
|
|
37861
37863
|
throw new RobisieError(
|
|
@@ -37867,18 +37869,19 @@ function loadRoleRegistryConfig(path34) {
|
|
|
37867
37869
|
try {
|
|
37868
37870
|
raw = JSON.parse(contents.replace(/^\uFEFF/, ""));
|
|
37869
37871
|
} catch {
|
|
37870
|
-
throw new RobisieError(`${
|
|
37872
|
+
throw new RobisieError(`${file3}: niepoprawny JSON.`, retry);
|
|
37871
37873
|
}
|
|
37872
37874
|
let config2;
|
|
37873
37875
|
try {
|
|
37874
37876
|
config2 = parseEngineConfig(raw, configPath);
|
|
37875
37877
|
} catch (error48) {
|
|
37876
|
-
throw new RobisieError(errorMessage(error48), retry);
|
|
37878
|
+
throw new RobisieError(errorMessage(error48).replaceAll(`${configPath}:`, () => `${file3}:`), retry);
|
|
37877
37879
|
}
|
|
37878
|
-
return { config: config2, roleRegistry: parseRoleRegistry(raw,
|
|
37880
|
+
return { config: config2, roleRegistry: parseRoleRegistry(raw, file3) };
|
|
37879
37881
|
}
|
|
37880
|
-
function doctorEngineConfig(ctx, path34) {
|
|
37881
|
-
const { roleRegistry } = loadRoleRegistryConfig((0, import_node_path3.resolve)(ctx.cwd, path34));
|
|
37882
|
+
function doctorEngineConfig(ctx, path34, afterLoad) {
|
|
37883
|
+
const { roleRegistry, config: config2 } = loadRoleRegistryConfig((0, import_node_path3.resolve)(ctx.cwd, path34));
|
|
37884
|
+
afterLoad?.(config2);
|
|
37882
37885
|
for (const role3 of ROLES) {
|
|
37883
37886
|
const { name: name3, provider, model, effort } = roleRegistry[role3];
|
|
37884
37887
|
ctx.out(`${role3} \u2192 ${name3} / ${provider} / ${model} / ${effort}`);
|
|
@@ -76893,7 +76896,11 @@ async function runLocalDelivery(context, input, beforeDeliver) {
|
|
|
76893
76896
|
journal.landedAt ??= (/* @__PURE__ */ new Date()).toISOString();
|
|
76894
76897
|
save2(context, journal);
|
|
76895
76898
|
const delivered = context.delivery.deliver(journal.prepared);
|
|
76896
|
-
if (!delivered.ok)
|
|
76899
|
+
if (!delivered.ok) {
|
|
76900
|
+
journal.failure = `${delivered.reason}: ${delivered.message}`;
|
|
76901
|
+
save2(context, journal);
|
|
76902
|
+
throw new Error(journal.failure);
|
|
76903
|
+
}
|
|
76897
76904
|
refMoved = delivered.moved;
|
|
76898
76905
|
if (!delivered.moved || delivered.from !== journal.prepared.targetSha || delivered.to !== input.sha || delivered.ref !== journal.prepared.ref) {
|
|
76899
76906
|
throw new Error("Niezgodny wynik deliver");
|
|
@@ -76904,6 +76911,7 @@ async function runLocalDelivery(context, input, beforeDeliver) {
|
|
|
76904
76911
|
if (!targetContains(context, journal)) throw new Error("Drift po CAS");
|
|
76905
76912
|
refMoved = true;
|
|
76906
76913
|
journal.phase = "ref-moved";
|
|
76914
|
+
delete journal.failure;
|
|
76907
76915
|
save2(context, journal);
|
|
76908
76916
|
}
|
|
76909
76917
|
validateTree(context, journal);
|
|
@@ -77052,15 +77060,21 @@ function localTesterContract(card, value) {
|
|
|
77052
77060
|
return input;
|
|
77053
77061
|
}
|
|
77054
77062
|
function safety(context) {
|
|
77063
|
+
let bytes;
|
|
77064
|
+
try {
|
|
77065
|
+
bytes = (0, import_node_fs22.readFileSync)(context.safetyPath);
|
|
77066
|
+
} catch (cause) {
|
|
77067
|
+
if (record9(cause).code === "ENOENT") throw new TesterSafetyError("tester-safety-missing", cause);
|
|
77068
|
+
throw new Error(`Zas\xF3b bezpiecze\u0144stwa ${context.safetyPath}: ${String(cause)}`, { cause });
|
|
77069
|
+
}
|
|
77055
77070
|
try {
|
|
77056
|
-
const bytes = (0, import_node_fs22.readFileSync)(context.safetyPath);
|
|
77057
77071
|
const patterns = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
|
|
77058
77072
|
const rules = patterns.split(/\r?\n/).map((line2) => line2.trim()).filter((line2) => line2 && !line2.startsWith("#"));
|
|
77059
77073
|
if (!rules.length) throw new Error("Pusta lista bezpiecze\u0144stwa");
|
|
77060
77074
|
rules.forEach((rule) => new RegExp(rule, "mi"));
|
|
77061
77075
|
return { resource: { version: 1, path: context.safetyPath, sha256: hash5(bytes) }, patterns };
|
|
77062
77076
|
} catch (cause) {
|
|
77063
|
-
throw new
|
|
77077
|
+
throw new TesterSafetyError("tester-safety-invalid", cause);
|
|
77064
77078
|
}
|
|
77065
77079
|
}
|
|
77066
77080
|
function journalFor(context, card) {
|
|
@@ -77153,7 +77167,7 @@ ${result.failed.command}: ${result.failed.output}
|
|
|
77153
77167
|
`;
|
|
77154
77168
|
return result;
|
|
77155
77169
|
}
|
|
77156
|
-
var import_node_crypto13, import_node_fs22, import_node_path25, import_node_util5, sha2, digest3, text5, absolute, schema, record9, hash5, guard;
|
|
77170
|
+
var import_node_crypto13, import_node_fs22, import_node_path25, import_node_util5, sha2, digest3, text5, absolute, schema, record9, hash5, TesterSafetyError, guard;
|
|
77157
77171
|
var init_local_tester = __esm({
|
|
77158
77172
|
"maszynista/local-tester.ts"() {
|
|
77159
77173
|
"use strict";
|
|
@@ -77184,6 +77198,12 @@ var init_local_tester = __esm({
|
|
|
77184
77198
|
});
|
|
77185
77199
|
record9 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
77186
77200
|
hash5 = (bytes) => (0, import_node_crypto13.createHash)("sha256").update(bytes).digest("hex");
|
|
77201
|
+
TesterSafetyError = class extends Error {
|
|
77202
|
+
constructor(code, cause) {
|
|
77203
|
+
super(code, { cause });
|
|
77204
|
+
this.code = code;
|
|
77205
|
+
}
|
|
77206
|
+
};
|
|
77187
77207
|
guard = `const {execFileSync}=require('node:child_process');
|
|
77188
77208
|
try { const git=a=>execFileSync('git',a,{encoding:'utf8',shell:false}).trim();
|
|
77189
77209
|
const head=git(['rev-parse','HEAD']), dirty=git(['status','--porcelain','--untracked-files=no']);
|
|
@@ -78041,16 +78061,54 @@ var init_local_acceptance = __esm({
|
|
|
78041
78061
|
}
|
|
78042
78062
|
});
|
|
78043
78063
|
|
|
78064
|
+
// packages/client/src/git-commit.ts
|
|
78065
|
+
function gitCommitOptions(args, cwd, timeout = 5e3) {
|
|
78066
|
+
const configured = (key) => {
|
|
78067
|
+
try {
|
|
78068
|
+
return (0, import_node_child_process9.execFileSync)("git", ["config", "--get", key], { cwd, encoding: "utf8", timeout, stdio: "pipe" }).trim();
|
|
78069
|
+
} catch (error48) {
|
|
78070
|
+
if (error48.status === 1) return "";
|
|
78071
|
+
throw new Error(`Nie mo\u017Cna odczyta\u0107 git ${key}`, { cause: error48 });
|
|
78072
|
+
}
|
|
78073
|
+
};
|
|
78074
|
+
const name3 = configured("user.name"), email4 = configured("user.email");
|
|
78075
|
+
const env = { ...process.env };
|
|
78076
|
+
const complete = [
|
|
78077
|
+
env.GIT_AUTHOR_NAME ?? name3,
|
|
78078
|
+
env.GIT_AUTHOR_EMAIL ?? email4,
|
|
78079
|
+
env.GIT_COMMITTER_NAME ?? name3,
|
|
78080
|
+
env.GIT_COMMITTER_EMAIL ?? email4
|
|
78081
|
+
].every((value) => value.trim() !== "");
|
|
78082
|
+
if (!complete) {
|
|
78083
|
+
env.GIT_AUTHOR_NAME = env.GIT_COMMITTER_NAME = "robisie";
|
|
78084
|
+
env.GIT_AUTHOR_EMAIL = env.GIT_COMMITTER_EMAIL = "robisie@localhost";
|
|
78085
|
+
}
|
|
78086
|
+
return { args: ["-c", "commit.gpgsign=false", "-c", "tag.gpgsign=false", ...args], env };
|
|
78087
|
+
}
|
|
78088
|
+
var import_node_child_process9;
|
|
78089
|
+
var init_git_commit = __esm({
|
|
78090
|
+
"packages/client/src/git-commit.ts"() {
|
|
78091
|
+
"use strict";
|
|
78092
|
+
import_node_child_process9 = require("node:child_process");
|
|
78093
|
+
}
|
|
78094
|
+
});
|
|
78095
|
+
|
|
78044
78096
|
// packages/client/src/delivery-local.ts
|
|
78045
78097
|
function runGit(repo, args, input) {
|
|
78046
|
-
|
|
78098
|
+
let options2;
|
|
78099
|
+
try {
|
|
78100
|
+
options2 = args[0] === "notes" && args.includes("add") ? gitCommitOptions(args, repo) : { args, env: process.env };
|
|
78101
|
+
} catch (error48) {
|
|
78102
|
+
return { status: null, stdout: "", stderr: "", error: error48 instanceof Error ? error48 : new Error(String(error48)) };
|
|
78103
|
+
}
|
|
78104
|
+
const result = (0, import_node_child_process10.spawnSync)("git", options2.args, {
|
|
78047
78105
|
cwd: repo,
|
|
78048
78106
|
encoding: "utf8",
|
|
78049
78107
|
input,
|
|
78050
78108
|
timeout: 6e4,
|
|
78051
78109
|
maxBuffer: 20 * 1024 * 1024,
|
|
78052
78110
|
shell: false,
|
|
78053
|
-
env: { ...
|
|
78111
|
+
env: { ...options2.env, LC_ALL: "C", GIT_TERMINAL_PROMPT: "0" }
|
|
78054
78112
|
});
|
|
78055
78113
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "", error: result.error };
|
|
78056
78114
|
}
|
|
@@ -78168,7 +78226,7 @@ function runChecks(cwd, commands, timeoutMs, results) {
|
|
|
78168
78226
|
if (!command) {
|
|
78169
78227
|
return { ok: false, reason: "check-failed", message: "Pusta komenda sprawdzenia.", results };
|
|
78170
78228
|
}
|
|
78171
|
-
const run = (0,
|
|
78229
|
+
const run = (0, import_node_child_process10.spawnSync)(command, args, { cwd, encoding: "utf8", shell: false, timeout: timeoutMs, maxBuffer: 20 * 1024 * 1024 });
|
|
78172
78230
|
const output = `${run.stdout ?? ""}${run.stderr ?? ""}${run.error ? run.error.message : ""}`.slice(-OUTPUT_LIMIT);
|
|
78173
78231
|
const outcome = { command, args, status: run.status, signal: run.signal, output };
|
|
78174
78232
|
results.push(outcome);
|
|
@@ -78211,7 +78269,19 @@ function deliver(repo, prepared) {
|
|
|
78211
78269
|
const worktree = checkedOutIn(repo, ref);
|
|
78212
78270
|
if (typeof worktree === "object") return { ok: false, reason: "error", message: `git worktree list nie powiod\u0142o si\u0119: ${gitText(worktree)}` };
|
|
78213
78271
|
if (worktree !== void 0) {
|
|
78214
|
-
|
|
78272
|
+
const before = resolveCommit(repo, ref);
|
|
78273
|
+
if (before !== targetSha2) {
|
|
78274
|
+
return { ok: false, reason: "target-moved", message: `Odmowa: ${prepared.target} przesun\u0105\u0142 si\u0119 z ${targetSha2} na ${before ?? "(brak)"} po prepare; nic nie zmieniono.` };
|
|
78275
|
+
}
|
|
78276
|
+
const merge3 = runGit(worktree, ["-c", `core.hooksPath=${import_node_os6.devNull}`, "merge", "--ff-only", "--no-autostash", "--no-overwrite-ignore", taskSha]);
|
|
78277
|
+
const after2 = resolveCommit(repo, ref);
|
|
78278
|
+
if (after2 === taskSha) return { ok: true, moved: true, ref, from: targetSha2, to: taskSha };
|
|
78279
|
+
if (after2 === targetSha2) {
|
|
78280
|
+
const diagnostic = gitText(merge3).replace(/\n(?:Please commit\b|Another git process seems to be running in this repository, e\.g\.)[\s\S]*$/, "").trim();
|
|
78281
|
+
return { ok: false, reason: "target-checked-out", message: `Odmowa FF w ${worktree}: ${diagnostic}
|
|
78282
|
+
Od\u0142\xF3\u017C zmiany (git stash) albo cofnij je i pon\xF3w dostaw\u0119.` };
|
|
78283
|
+
}
|
|
78284
|
+
return { ok: false, reason: "target-moved", message: `Odmowa: ${prepared.target} po pr\xF3bie FF wskazuje ${after2 ?? "(brak)"} zamiast ${taskSha}; sprawd\u017A stan repozytorium.` };
|
|
78215
78285
|
}
|
|
78216
78286
|
const update = runGit(repo, ["update-ref", "--no-deref", "-m", `robisie: dostawa local-ff ${taskSha}`, ref, taskSha, targetSha2]);
|
|
78217
78287
|
if (update.status !== 0) {
|
|
@@ -78279,14 +78349,15 @@ function createLocalFfDelivery(repo) {
|
|
|
78279
78349
|
attachEvidence: (sha5, kind, evidence2) => attachEvidence(repo, sha5, kind, evidence2)
|
|
78280
78350
|
};
|
|
78281
78351
|
}
|
|
78282
|
-
var
|
|
78352
|
+
var import_node_child_process10, import_node_fs25, import_node_os6, import_node_path28, EVIDENCE_KINDS, DEFAULT_DELIVERY_ADAPTER, SHA_RE, OUTPUT_LIMIT;
|
|
78283
78353
|
var init_delivery_local = __esm({
|
|
78284
78354
|
"packages/client/src/delivery-local.ts"() {
|
|
78285
78355
|
"use strict";
|
|
78286
|
-
|
|
78356
|
+
import_node_child_process10 = require("node:child_process");
|
|
78287
78357
|
import_node_fs25 = require("node:fs");
|
|
78288
78358
|
import_node_os6 = require("node:os");
|
|
78289
78359
|
import_node_path28 = require("node:path");
|
|
78360
|
+
init_git_commit();
|
|
78290
78361
|
EVIDENCE_KINDS = ["review", "test", "deliver"];
|
|
78291
78362
|
DEFAULT_DELIVERY_ADAPTER = "local-ff";
|
|
78292
78363
|
SHA_RE = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
|
|
@@ -79006,7 +79077,7 @@ function askClaude(prompt2) {
|
|
|
79006
79077
|
return new Promise((resolve7, reject) => {
|
|
79007
79078
|
const args = headlessClaudeArgs(MODEL);
|
|
79008
79079
|
const user = process.env.USER ?? import_node_os7.default.userInfo().username;
|
|
79009
|
-
const child = (0,
|
|
79080
|
+
const child = (0, import_node_child_process11.spawn)("claude", args, {
|
|
79010
79081
|
cwd: REPO,
|
|
79011
79082
|
stdio: ["pipe", "pipe", "pipe"],
|
|
79012
79083
|
env: { ...process.env, ...HEADLESS_CLAUDE_ENV, ANTHROPIC_API_KEY: void 0, USER: user, LOGNAME: process.env.LOGNAME ?? user }
|
|
@@ -79097,7 +79168,7 @@ async function main() {
|
|
|
79097
79168
|
}
|
|
79098
79169
|
let trackedFiles = null;
|
|
79099
79170
|
try {
|
|
79100
|
-
trackedFiles = (0,
|
|
79171
|
+
trackedFiles = (0, import_node_child_process11.execFileSync)("git", ["ls-files", "-z"], { cwd: REPO, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }).split("\0").filter(Boolean);
|
|
79101
79172
|
} catch (error49) {
|
|
79102
79173
|
log(`quality_lane: lista plik\xF3w repo niedost\u0119pna \u2014 katalogi w scope b\u0119d\u0105 CAREFUL (${error49 instanceof Error ? error49.message : String(error49)})`);
|
|
79103
79174
|
}
|
|
@@ -79208,12 +79279,12 @@ async function main() {
|
|
|
79208
79279
|
}
|
|
79209
79280
|
}
|
|
79210
79281
|
}
|
|
79211
|
-
var import_node_fs30,
|
|
79282
|
+
var import_node_fs30, import_node_child_process11, import_node_os7, import_node_path31, DRY, SELECT_DEFAULT_MODEL, MODEL, LAST, LOG, FINGERPRINT, SELECT_LOCK, TRIGGER, MAX_ZERO_REASON_LEN, TICK_TAIL_BYTES, TIMEOUT_MS2;
|
|
79212
79283
|
var init_select3 = __esm({
|
|
79213
79284
|
"maszynista/select.ts"() {
|
|
79214
79285
|
"use strict";
|
|
79215
79286
|
import_node_fs30 = require("node:fs");
|
|
79216
|
-
|
|
79287
|
+
import_node_child_process11 = require("node:child_process");
|
|
79217
79288
|
import_node_os7 = __toESM(require("node:os"));
|
|
79218
79289
|
import_node_path31 = __toESM(require("node:path"));
|
|
79219
79290
|
init_queries();
|
|
@@ -87188,7 +87259,7 @@ function parseBuzzAdminMembers(output) {
|
|
|
87188
87259
|
}
|
|
87189
87260
|
function runRosterCommand(command, args) {
|
|
87190
87261
|
return new Promise((resolve7, reject) => {
|
|
87191
|
-
(0,
|
|
87262
|
+
(0, import_node_child_process12.execFile)(command, args, { encoding: "utf8" }, (error48, stdout) => {
|
|
87192
87263
|
if (error48) reject(error48);
|
|
87193
87264
|
else resolve7(stdout);
|
|
87194
87265
|
});
|
|
@@ -87234,11 +87305,11 @@ async function loadDatabaseSync() {
|
|
|
87234
87305
|
throw new BuzzToolError("Buzz requires Node 22 or newer with node:sqlite available");
|
|
87235
87306
|
}
|
|
87236
87307
|
}
|
|
87237
|
-
var
|
|
87308
|
+
var import_node_child_process12, import_promises2, import_node_module, import_node_os8, import_node_path32, PAGE_EOSE_DEADLINE_MS, ZERO_EVENT_ID, BuzzToolError, RelayWebSocket, SeenStore, BuzzBridge;
|
|
87238
87309
|
var init_bridge = __esm({
|
|
87239
87310
|
"services/buzz-mcp/src/bridge.ts"() {
|
|
87240
87311
|
"use strict";
|
|
87241
|
-
|
|
87312
|
+
import_node_child_process12 = require("node:child_process");
|
|
87242
87313
|
import_promises2 = require("node:fs/promises");
|
|
87243
87314
|
import_node_module = require("node:module");
|
|
87244
87315
|
import_node_os8 = require("node:os");
|
|
@@ -88946,7 +89017,7 @@ async function processAgent(message3, store, errorPath, dependencies) {
|
|
|
88946
89017
|
try {
|
|
88947
89018
|
const err = await (0, import_promises3.open)(`${output}.stderr`, "wx", 384);
|
|
88948
89019
|
try {
|
|
88949
|
-
const child = (0,
|
|
89020
|
+
const child = (0, import_node_child_process13.spawn)(route.executable, [
|
|
88950
89021
|
...route.argv,
|
|
88951
89022
|
"exec",
|
|
88952
89023
|
"--json",
|
|
@@ -89016,7 +89087,7 @@ async function processAgent(message3, store, errorPath, dependencies) {
|
|
|
89016
89087
|
}
|
|
89017
89088
|
}
|
|
89018
89089
|
}
|
|
89019
|
-
var import_node_fs32, import_promises3, import_node_path34, import_node_crypto22,
|
|
89090
|
+
var import_node_fs32, import_promises3, import_node_path34, import_node_crypto22, import_node_child_process13, import_node_os9, AGENT_INSTRUCTIONS, hash8, AGENT_DEADLINE_MS, AGENT_RECORD_RESOLUTION;
|
|
89020
89091
|
var init_agent_route = __esm({
|
|
89021
89092
|
"services/buzz-wake/agent-route.ts"() {
|
|
89022
89093
|
"use strict";
|
|
@@ -89024,7 +89095,7 @@ var init_agent_route = __esm({
|
|
|
89024
89095
|
import_promises3 = require("node:fs/promises");
|
|
89025
89096
|
import_node_path34 = require("node:path");
|
|
89026
89097
|
import_node_crypto22 = require("node:crypto");
|
|
89027
|
-
|
|
89098
|
+
import_node_child_process13 = require("node:child_process");
|
|
89028
89099
|
import_node_os9 = require("node:os");
|
|
89029
89100
|
init_delivery();
|
|
89030
89101
|
init_store();
|
|
@@ -89639,7 +89710,7 @@ function publishedRoute(source, role3) {
|
|
|
89639
89710
|
}
|
|
89640
89711
|
function probeCrProcess(pid) {
|
|
89641
89712
|
return new Promise((resolve7) => {
|
|
89642
|
-
(0,
|
|
89713
|
+
(0, import_node_child_process14.execFile)(
|
|
89643
89714
|
"ps",
|
|
89644
89715
|
["-p", String(pid), "-o", "lstart=,pid=,args="],
|
|
89645
89716
|
{ encoding: "utf8", timeout: 5e3, maxBuffer: 64 * 1024, env: { ...process.env, LC_ALL: "C" } },
|
|
@@ -89811,12 +89882,12 @@ async function dispatchWake(message3, dependencies) {
|
|
|
89811
89882
|
const result = await dependencies.run(dependencies.guardedSendBin, ["--modal-guard", ...role3 === "hermes" ? ["--hermes-safe"] : [], ...mode.mode === "steer" ? ["--steer"] : [], "--surface-id", matches2[0].id, panelNotice]);
|
|
89812
89883
|
return { rc: result.rc, stderr: result.stderr };
|
|
89813
89884
|
}
|
|
89814
|
-
var import_promises4,
|
|
89885
|
+
var import_promises4, import_node_child_process14, import_node_os10, import_node_sqlite2, import_node_path35, SAFE_DIAGNOSTIC_CATEGORY, refusalBridge, GBOT_READ_INTERVAL_MS, UUID, ROLE3, CR_RUNTIME_CWD;
|
|
89815
89886
|
var init_delivery = __esm({
|
|
89816
89887
|
"services/buzz-wake/delivery.ts"() {
|
|
89817
89888
|
"use strict";
|
|
89818
89889
|
import_promises4 = require("node:fs/promises");
|
|
89819
|
-
|
|
89890
|
+
import_node_child_process14 = require("node:child_process");
|
|
89820
89891
|
import_node_os10 = require("node:os");
|
|
89821
89892
|
import_node_sqlite2 = require("node:sqlite");
|
|
89822
89893
|
init_lib();
|
|
@@ -89834,7 +89905,7 @@ var init_delivery = __esm({
|
|
|
89834
89905
|
|
|
89835
89906
|
// maszynista/enabled-auto.ts
|
|
89836
89907
|
function processRun(file3, args, cwd, timeoutMs = 1e4) {
|
|
89837
|
-
const result = (0,
|
|
89908
|
+
const result = (0, import_node_child_process15.spawnSync)(file3, args, { cwd, encoding: "utf8", timeout: Math.min(1e4, timeoutMs), maxBuffer: 1024 * 1024, shell: false, env: { ...process.env, LC_ALL: "C" } });
|
|
89838
89909
|
if (result.error || result.signal || result.status === null) throw new Error(`${file3}: ${result.error?.message ?? result.signal ?? "UNKNOWN status"}`);
|
|
89839
89910
|
return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
|
|
89840
89911
|
}
|
|
@@ -90151,12 +90222,12 @@ async function runEnabledAuto(input, deps) {
|
|
|
90151
90222
|
}
|
|
90152
90223
|
}
|
|
90153
90224
|
}
|
|
90154
|
-
var import_node_crypto23,
|
|
90225
|
+
var import_node_crypto23, import_node_child_process15, import_node_fs33, import_node_path36, SHA2, SERVICE_ALLOWLIST, LOG_ALLOWLIST, ENABLED_CHECKS, MAX_TAIL;
|
|
90155
90226
|
var init_enabled_auto = __esm({
|
|
90156
90227
|
"maszynista/enabled-auto.ts"() {
|
|
90157
90228
|
"use strict";
|
|
90158
90229
|
import_node_crypto23 = require("node:crypto");
|
|
90159
|
-
|
|
90230
|
+
import_node_child_process15 = require("node:child_process");
|
|
90160
90231
|
import_node_fs33 = require("node:fs");
|
|
90161
90232
|
import_node_path36 = __toESM(require("node:path"));
|
|
90162
90233
|
init_host_activation();
|
|
@@ -90560,7 +90631,7 @@ function startWorker(input, deps = {}) {
|
|
|
90560
90631
|
`${PROVIDER}/${input.selection.model}`
|
|
90561
90632
|
];
|
|
90562
90633
|
try {
|
|
90563
|
-
const spawnDetached = deps.spawn ?? ((executable, args, options2) => (0,
|
|
90634
|
+
const spawnDetached = deps.spawn ?? ((executable, args, options2) => (0, import_node_child_process16.spawn)(executable, [...args], options2));
|
|
90564
90635
|
const child = spawnDetached(process.execPath, command, { cwd: input.cwd, detached: true, stdio: "ignore", env: input.env });
|
|
90565
90636
|
child.once?.("error", (error48) => {
|
|
90566
90637
|
try {
|
|
@@ -90706,7 +90777,7 @@ function openCodeGroupAlive(job, deps) {
|
|
|
90706
90777
|
}
|
|
90707
90778
|
function defaultVerifyPid(pid, job) {
|
|
90708
90779
|
try {
|
|
90709
|
-
const command = (0,
|
|
90780
|
+
const command = (0, import_node_child_process16.execFileSync)("ps", ["-ww", "-p", String(pid), "-o", "pgid=,command="], {
|
|
90710
90781
|
encoding: "utf8",
|
|
90711
90782
|
timeout: 5e3,
|
|
90712
90783
|
maxBuffer: 1024 * 1024
|
|
@@ -90960,7 +91031,7 @@ async function runOpenCodeRunner(argv) {
|
|
|
90960
91031
|
const prompt2 = (0, import_node_fs35.readFileSync)(promptPath, "utf8");
|
|
90961
91032
|
stdoutFd = (0, import_node_fs35.openSync)(stdoutPath, "a");
|
|
90962
91033
|
stderrFd = (0, import_node_fs35.openSync)(stderrPath, "a");
|
|
90963
|
-
const child = (0,
|
|
91034
|
+
const child = (0, import_node_child_process16.spawn)(binary, args, { cwd, stdio: ["pipe", stdoutFd, stderrFd] });
|
|
90964
91035
|
let stoppingSignal = null;
|
|
90965
91036
|
process.once("SIGTERM", () => {
|
|
90966
91037
|
stoppingSignal = "SIGTERM";
|
|
@@ -91028,11 +91099,11 @@ async function runOpenCodeRunner(argv) {
|
|
|
91028
91099
|
}
|
|
91029
91100
|
}
|
|
91030
91101
|
}
|
|
91031
|
-
var
|
|
91102
|
+
var import_node_child_process16, import_node_fs35, import_node_crypto24, import_node_path38, import_node_url2, import_node_sqlite3, PROVIDER, REPORT_MARKER, SAFE_ID, SAFE_STREAM_ID, SAFE_MODEL_ID, FIVE_HOURS, SEVEN_DAYS, THIRTY_DAYS, invokedPath;
|
|
91032
91103
|
var init_worker_backend = __esm({
|
|
91033
91104
|
"maszynista/worker-backend.ts"() {
|
|
91034
91105
|
"use strict";
|
|
91035
|
-
|
|
91106
|
+
import_node_child_process16 = require("node:child_process");
|
|
91036
91107
|
import_node_fs35 = require("node:fs");
|
|
91037
91108
|
import_node_crypto24 = require("node:crypto");
|
|
91038
91109
|
import_node_path38 = __toESM(require("node:path"));
|
|
@@ -91494,7 +91565,7 @@ function lunaPrompt(input) {
|
|
|
91494
91565
|
};
|
|
91495
91566
|
const git2 = (args) => {
|
|
91496
91567
|
try {
|
|
91497
|
-
return text7((0,
|
|
91568
|
+
return text7((0, import_node_child_process17.execFileSync)("git", args, {
|
|
91498
91569
|
cwd: input.worktree,
|
|
91499
91570
|
encoding: "utf8",
|
|
91500
91571
|
timeout: 6e4,
|
|
@@ -91513,7 +91584,7 @@ function lunaPrompt(input) {
|
|
|
91513
91584
|
const paths = git2(["diff", "--no-ext-diff", "--no-textconv", "--name-only", "-z", range, "--"]).split("\0").filter(Boolean);
|
|
91514
91585
|
let diff;
|
|
91515
91586
|
try {
|
|
91516
|
-
diff = text7((0,
|
|
91587
|
+
diff = text7((0, import_node_child_process17.execFileSync)("git", ["diff", "--no-ext-diff", "--no-textconv", "--binary", range, "--"], {
|
|
91517
91588
|
cwd: input.worktree,
|
|
91518
91589
|
encoding: "utf8",
|
|
91519
91590
|
timeout: 6e4,
|
|
@@ -91539,7 +91610,7 @@ function cannotReview(answer) {
|
|
|
91539
91610
|
}
|
|
91540
91611
|
function candidateDrift(input) {
|
|
91541
91612
|
try {
|
|
91542
|
-
const git2 = (args) => text7((0,
|
|
91613
|
+
const git2 = (args) => text7((0, import_node_child_process17.execFileSync)("git", args, {
|
|
91543
91614
|
cwd: input.worktree,
|
|
91544
91615
|
encoding: "utf8",
|
|
91545
91616
|
timeout: 6e4,
|
|
@@ -91554,7 +91625,7 @@ function candidateDrift(input) {
|
|
|
91554
91625
|
}
|
|
91555
91626
|
function grokPrompt(input, clientBaseSha) {
|
|
91556
91627
|
try {
|
|
91557
|
-
const git2 = (args) => text7((0,
|
|
91628
|
+
const git2 = (args) => text7((0, import_node_child_process17.execFileSync)("git", args, {
|
|
91558
91629
|
cwd: input.worktree,
|
|
91559
91630
|
encoding: "utf8",
|
|
91560
91631
|
timeout: 6e4,
|
|
@@ -91580,7 +91651,7 @@ function grokPrompt(input, clientBaseSha) {
|
|
|
91580
91651
|
const excerptPaths = changed.filter((file3) => import_node_path41.default.posix.basename(file3) !== "AGENTS.md" && (file3.startsWith("tests/") || file3.startsWith("config/") || /(^|\/)__(tests|fixtures)__\//.test(file3) || /\.(test|spec)\.[^/]+$/.test(file3) || file3 === ".env.example" || file3.endsWith(".md")));
|
|
91581
91652
|
const fullPaths = [.../* @__PURE__ */ new Set([...files2, ...changed])].filter((file3) => !excerptPaths.includes(file3));
|
|
91582
91653
|
const sources = files2.map((file3) => {
|
|
91583
|
-
const bytes = (0,
|
|
91654
|
+
const bytes = (0, import_node_child_process17.execFileSync)("git", ["show", `${input.sha}:${file3}`], {
|
|
91584
91655
|
cwd: input.worktree,
|
|
91585
91656
|
timeout: 6e4,
|
|
91586
91657
|
maxBuffer: MAX_BUFFER_BYTES,
|
|
@@ -91893,7 +91964,7 @@ function runReview(input) {
|
|
|
91893
91964
|
let rawOutput = "";
|
|
91894
91965
|
let rawExport = "";
|
|
91895
91966
|
try {
|
|
91896
|
-
const result = (0,
|
|
91967
|
+
const result = (0, import_node_child_process17.spawnSync)(bin, args, {
|
|
91897
91968
|
cwd,
|
|
91898
91969
|
input: bin === "opencode" || bin === "claude" ? prompt2 : void 0,
|
|
91899
91970
|
encoding: "utf8",
|
|
@@ -92083,12 +92154,12 @@ function runCli(inputPath) {
|
|
|
92083
92154
|
process.exitCode = 1;
|
|
92084
92155
|
}
|
|
92085
92156
|
}
|
|
92086
|
-
var
|
|
92157
|
+
var import_node_child_process17, import_node_crypto26, import_node_fs38, import_node_path41, import_node_os11, import_node_util9, reviewBaseRef, reviewHostStateDir, LUNA_MODEL, FALLBACK_ERRORS, MAX_PROMPT_BYTES, MAX_OUTPUT_BYTES, MAX_STDERR_BYTES, MAX_BUFFER_BYTES, MAX_GROK_PROMPT_BYTES;
|
|
92087
92158
|
var init_review_job = __esm({
|
|
92088
92159
|
"maszynista/review-job.ts"() {
|
|
92089
92160
|
"use strict";
|
|
92090
92161
|
init_client_pair();
|
|
92091
|
-
|
|
92162
|
+
import_node_child_process17 = require("node:child_process");
|
|
92092
92163
|
import_node_crypto26 = require("node:crypto");
|
|
92093
92164
|
import_node_fs38 = require("node:fs");
|
|
92094
92165
|
import_node_path41 = __toESM(require("node:path"));
|
|
@@ -92506,7 +92577,7 @@ async function startTesterJob(dir, input, entry2 = import_node_path43.default.jo
|
|
|
92506
92577
|
const fd = (0, import_node_fs39.openSync)(import_node_path43.default.join(dir, `.tester-job.${id2}.log`), "wx", 384);
|
|
92507
92578
|
try {
|
|
92508
92579
|
await new Promise((resolve7, reject) => {
|
|
92509
|
-
const child = (0,
|
|
92580
|
+
const child = (0, import_node_child_process18.spawn)(process.execPath, engineJobArgv(__filename, "tester", f.input, entry2), {
|
|
92510
92581
|
cwd: import_node_path43.default.resolve(__dirname, ".."),
|
|
92511
92582
|
env: { ...env ?? process.env, MASZYNISTA_DIR: dir },
|
|
92512
92583
|
detached: true,
|
|
@@ -92573,7 +92644,7 @@ async function runTesterJob(inputFile, run) {
|
|
|
92573
92644
|
const { createLocalTesterContext: createLocalTesterContext2 } = await Promise.resolve().then(() => (init_engine_context(), engine_context_exports));
|
|
92574
92645
|
return executeLocalTester(createLocalTesterContext2(
|
|
92575
92646
|
currentEngine2(),
|
|
92576
|
-
(args, cwd) => (0,
|
|
92647
|
+
(args, cwd) => (0, import_node_child_process18.execFileSync)("git", args, { cwd, encoding: "utf8", shell: false }).trim()
|
|
92577
92648
|
), p.input.card, p.input.local, p.input.runtime);
|
|
92578
92649
|
};
|
|
92579
92650
|
const result = run ? await run(p.input) : await execute();
|
|
@@ -92601,12 +92672,12 @@ async function runTesterJob(inputFile, run) {
|
|
|
92601
92672
|
if (record16(readJson3(f.lock)).id !== p.id) throw new Error("Tester straci\u0142 lock przed zapisem wyniku");
|
|
92602
92673
|
atomic3(f.result, completion2);
|
|
92603
92674
|
}
|
|
92604
|
-
var import_node_fs39,
|
|
92675
|
+
var import_node_fs39, import_node_child_process18, import_node_crypto28, import_node_util10, import_node_path43, files, record16, local;
|
|
92605
92676
|
var init_tester_job = __esm({
|
|
92606
92677
|
"maszynista/tester-job.ts"() {
|
|
92607
92678
|
"use strict";
|
|
92608
92679
|
import_node_fs39 = require("node:fs");
|
|
92609
|
-
|
|
92680
|
+
import_node_child_process18 = require("node:child_process");
|
|
92610
92681
|
import_node_crypto28 = require("node:crypto");
|
|
92611
92682
|
import_node_util10 = require("node:util");
|
|
92612
92683
|
import_node_path43 = __toESM(require("node:path"));
|
|
@@ -314257,6 +314328,7 @@ __export2(tick_exports, {
|
|
|
314257
314328
|
TESTER_RETEST_MAX_ERRORS: () => TESTER_RETEST_MAX_ERRORS,
|
|
314258
314329
|
actionableBlockerHold: () => actionableBlockerHold,
|
|
314259
314330
|
armTickDeadline: () => armTickDeadline,
|
|
314331
|
+
autoCommitWorker: () => autoCommitWorker,
|
|
314260
314332
|
cleanupRecoverableDiskArtifacts: () => cleanupRecoverableDiskArtifacts,
|
|
314261
314333
|
configureSparseCheckout: () => configureSparseCheckout,
|
|
314262
314334
|
consumeActive: () => consumeActive,
|
|
@@ -314289,10 +314361,12 @@ __export2(tick_exports, {
|
|
|
314289
314361
|
northStarRecovered: () => northStarRecovered,
|
|
314290
314362
|
notifyLandingHold: () => notifyLandingHold,
|
|
314291
314363
|
obligationPhase: () => obligationPhase,
|
|
314364
|
+
parseHostBootAt: () => parseHostBootAt,
|
|
314292
314365
|
parseUnblockGiB: () => parseUnblockGiB,
|
|
314293
314366
|
processWip: () => processWip,
|
|
314294
314367
|
promotionPhase: () => promotionPhase,
|
|
314295
314368
|
queueForReksio: () => queueForReksio,
|
|
314369
|
+
readHostBootAt: () => readHostBootAt,
|
|
314296
314370
|
readRecentBuzzEvents: () => readRecentBuzzEvents,
|
|
314297
314371
|
readyTaskPatch: () => readyTaskPatch,
|
|
314298
314372
|
reconcileBoardActives: () => reconcileBoardActives,
|
|
@@ -314537,7 +314611,7 @@ function taskInputHash(card, effort) {
|
|
|
314537
314611
|
return (0, import_node_crypto31.createHash)("sha256").update(JSON.stringify([taskBriefHash(brief2), effort, card.details?.codex_model ?? null])).digest("hex");
|
|
314538
314612
|
}
|
|
314539
314613
|
function defaultNpmCacheCleanup() {
|
|
314540
|
-
const result = (0,
|
|
314614
|
+
const result = (0, import_node_child_process19.spawnSync)("npm", ["cache", "clean", "--force"], { cwd: REPO, encoding: "utf8", timeout: remainingTickMs(12e4) });
|
|
314541
314615
|
if (result.error) throw result.error;
|
|
314542
314616
|
if (result.status !== 0) throw new Error(`npm cache clean zako\u0144czony kodem ${String(result.status)}: ${String(result.stderr ?? "").trim()}`);
|
|
314543
314617
|
}
|
|
@@ -314607,7 +314681,7 @@ function cleanupRecoverableDiskArtifacts(repo = TASK_REPO, nowMs = Date.now(), c
|
|
|
314607
314681
|
return { removed, skippedYoung, errors };
|
|
314608
314682
|
}
|
|
314609
314683
|
function runWakeCommand(file3, args) {
|
|
314610
|
-
const result = (0,
|
|
314684
|
+
const result = (0, import_node_child_process19.spawnSync)(file3, [...args], { encoding: "utf8", timeout: remainingTickMs(3e4), env: hostEnv(), maxBuffer: 20 * 1024 * 1024 });
|
|
314611
314685
|
return Promise.resolve({
|
|
314612
314686
|
rc: result.error ? 1 : result.status ?? 1,
|
|
314613
314687
|
stdout: String(result.stdout ?? ""),
|
|
@@ -314847,7 +314921,7 @@ async function handleDiskPressure(state, phase, dependencies = defaultDiskPressu
|
|
|
314847
314921
|
function shutdownCodexBroker(worktree) {
|
|
314848
314922
|
try {
|
|
314849
314923
|
if (!shouldRunLifecycleHook(CODEX_LIFECYCLE_HOOK, import_node_fs47.existsSync)) return;
|
|
314850
|
-
(0,
|
|
314924
|
+
(0, import_node_child_process19.spawnSync)("node", [CODEX_LIFECYCLE_HOOK, "SessionEnd"], {
|
|
314851
314925
|
cwd: worktree,
|
|
314852
314926
|
encoding: "utf-8",
|
|
314853
314927
|
timeout: remainingTickMs(3e4),
|
|
@@ -315033,20 +315107,21 @@ Status na tablicy: blocked (czeka na Ciebie). ${unlock}
|
|
|
315033
315107
|
throw new Error(`Dopisanie ${DECISIONS} nieudane: ${errorText5(error48)}`);
|
|
315034
315108
|
}
|
|
315035
315109
|
}
|
|
315036
|
-
function git(args, cwd = TASK_REPO, timeoutMs = 6e4) {
|
|
315037
|
-
const
|
|
315110
|
+
function git(args, cwd = TASK_REPO, timeoutMs = 6e4, createsCommit = false) {
|
|
315111
|
+
const options2 = createsCommit ? gitCommitOptions(args, cwd, remainingTickMs(5e3)) : { args, env: process.env };
|
|
315112
|
+
const output = (0, import_node_child_process19.execFileSync)("git", options2.args, {
|
|
315038
315113
|
cwd,
|
|
315039
315114
|
encoding: "utf-8",
|
|
315040
315115
|
timeout: remainingTickMs(timeoutMs),
|
|
315041
315116
|
maxBuffer: 20 * 1024 * 1024,
|
|
315042
|
-
env: { ...
|
|
315117
|
+
env: { ...options2.env, GIT_OPTIONAL_LOCKS: "0" }
|
|
315043
315118
|
});
|
|
315044
315119
|
return args.includes("-z") ? output : output.trim();
|
|
315045
315120
|
}
|
|
315046
315121
|
function autoCommitWorker(a) {
|
|
315047
315122
|
if (!git(["status", "--porcelain", "--", ".", REVIEW_JOB_EXCLUDE], a.worktree)) return;
|
|
315048
315123
|
git(["add", "-A", "--", ".", REVIEW_JOB_EXCLUDE], a.worktree);
|
|
315049
|
-
git(["-c", "core.hooksPath=/dev/null", "commit", "-m", `maszynista: praca workera ${a.jobId} (auto-commit)`], a.worktree, 12e4);
|
|
315124
|
+
git(["-c", "core.hooksPath=/dev/null", "commit", "-m", `maszynista: praca workera ${a.jobId} (auto-commit)`], a.worktree, 12e4, true);
|
|
315050
315125
|
}
|
|
315051
315126
|
function clearDeadIndexLock(worktree, cardId) {
|
|
315052
315127
|
let lockPath = "";
|
|
@@ -315067,7 +315142,7 @@ function clearDeadIndexLock(worktree, cardId) {
|
|
|
315067
315142
|
if (lockStat) {
|
|
315068
315143
|
const ageMs = Date.now() - lockStat.mtimeMs;
|
|
315069
315144
|
if (!(ageMs > TICK_LIMIT_MS)) throw new Error(`${lock} wiek=${Math.floor(ageMs / 1e3)}s`);
|
|
315070
|
-
const probe = (0,
|
|
315145
|
+
const probe = (0, import_node_child_process19.spawnSync)("lsof", ["-t", "--", lock], {
|
|
315071
315146
|
encoding: "utf-8",
|
|
315072
315147
|
timeout: remainingTickMs(1e4)
|
|
315073
315148
|
});
|
|
@@ -315130,14 +315205,14 @@ async function fetchMain(cwd, installation) {
|
|
|
315130
315205
|
}
|
|
315131
315206
|
function branchPatchId(worktree, base2, sha5) {
|
|
315132
315207
|
try {
|
|
315133
|
-
const diff = (0,
|
|
315208
|
+
const diff = (0, import_node_child_process19.execFileSync)("git", ["diff", "--binary", base2, sha5], {
|
|
315134
315209
|
cwd: worktree,
|
|
315135
315210
|
encoding: "utf-8",
|
|
315136
315211
|
timeout: remainingTickMs(6e4),
|
|
315137
315212
|
maxBuffer: 20 * 1024 * 1024
|
|
315138
315213
|
});
|
|
315139
315214
|
if (!diff) return null;
|
|
315140
|
-
const result = (0,
|
|
315215
|
+
const result = (0, import_node_child_process19.spawnSync)("git", ["patch-id", "--stable"], {
|
|
315141
315216
|
cwd: worktree,
|
|
315142
315217
|
encoding: "utf-8",
|
|
315143
315218
|
input: diff,
|
|
@@ -315305,7 +315380,7 @@ function exportOpenCodeSession(sessionId, cwd) {
|
|
|
315305
315380
|
}
|
|
315306
315381
|
}
|
|
315307
315382
|
function helper(args, cwd, taskEnv = executionEnv2(), installation = tickInstallation) {
|
|
315308
|
-
const r = (0,
|
|
315383
|
+
const r = (0, import_node_child_process19.spawnSync)("node", [CODEX_HELPER, ...args], {
|
|
315309
315384
|
cwd,
|
|
315310
315385
|
encoding: "utf-8",
|
|
315311
315386
|
timeout: remainingTickMs(12e4),
|
|
@@ -315322,18 +315397,26 @@ function helper(args, cwd, taskEnv = executionEnv2(), installation = tickInstall
|
|
|
315322
315397
|
...errorCode ? { errorCode } : {}
|
|
315323
315398
|
};
|
|
315324
315399
|
}
|
|
315325
|
-
function
|
|
315400
|
+
function parseHostBootAt(source, platform) {
|
|
315401
|
+
const match = platform === "linux" ? source.match(/^btime[ \t]+([0-9]+)[ \t]*$/m) : platform === "darwin" ? source.match(/sec\s*=\s*(\d+)/) : null;
|
|
315402
|
+
if (!match) return null;
|
|
315403
|
+
const sec = Number(match[1]);
|
|
315404
|
+
if (!Number.isFinite(sec) || sec <= 0) return null;
|
|
315326
315405
|
try {
|
|
315327
|
-
const out = (0, import_node_child_process18.execFileSync)("sysctl", ["kern.boottime"], { encoding: "utf-8", timeout: remainingTickMs(5e3) });
|
|
315328
|
-
const match = out.match(/sec\s*=\s*(\d+)/);
|
|
315329
|
-
if (!match) return null;
|
|
315330
|
-
const sec = Number(match[1]);
|
|
315331
|
-
if (!Number.isFinite(sec) || sec <= 0) return null;
|
|
315332
315406
|
return new Date(sec * 1e3).toISOString();
|
|
315333
315407
|
} catch {
|
|
315334
315408
|
return null;
|
|
315335
315409
|
}
|
|
315336
315410
|
}
|
|
315411
|
+
function readHostBootAt(platform = process.platform) {
|
|
315412
|
+
try {
|
|
315413
|
+
if (platform !== "linux" && platform !== "darwin") return null;
|
|
315414
|
+
const out = platform === "linux" ? (0, import_node_fs47.readFileSync)("/proc/stat", "utf8") : (0, import_node_child_process19.execFileSync)("sysctl", ["kern.boottime"], { encoding: "utf-8", timeout: remainingTickMs(5e3) });
|
|
315415
|
+
return parseHostBootAt(out, platform);
|
|
315416
|
+
} catch {
|
|
315417
|
+
return null;
|
|
315418
|
+
}
|
|
315419
|
+
}
|
|
315337
315420
|
function readRestartGitFacts(worktree) {
|
|
315338
315421
|
try {
|
|
315339
315422
|
git(["fetch", engineRemote(), engineBranch(), "--quiet"], worktree, 12e4);
|
|
@@ -317312,7 +317395,7 @@ function boundedReviewText(value, bytes = 4096) {
|
|
|
317312
317395
|
return `${Buffer.from(value).subarray(0, bytes - Buffer.byteLength(marker) - 3).toString("utf8")}${marker}`;
|
|
317313
317396
|
}
|
|
317314
317397
|
function checkRuns(worktree, repository, sha5, timeout) {
|
|
317315
|
-
const raw = (0,
|
|
317398
|
+
const raw = (0, import_node_child_process19.execFileSync)("gh", ["api", "--paginate", "--slurp", `repos/${repository}/commits/${sha5}/check-runs?per_page=100`], {
|
|
317316
317399
|
cwd: worktree,
|
|
317317
317400
|
encoding: "utf-8",
|
|
317318
317401
|
env: hostEnv(),
|
|
@@ -317340,7 +317423,7 @@ function infrastructurePullRequest(sha5, worktree = REPO) {
|
|
|
317340
317423
|
const match = remote.match(/^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);
|
|
317341
317424
|
if (!match) throw new Error("origin nie wskazuje GitHub owner/repo");
|
|
317342
317425
|
const repository = `${match[1]}/${match[2]}`;
|
|
317343
|
-
const pages = JSON.parse((0,
|
|
317426
|
+
const pages = JSON.parse((0, import_node_child_process19.execFileSync)(
|
|
317344
317427
|
"gh",
|
|
317345
317428
|
["api", "--paginate", "--slurp", `repos/${repository}/commits/${sha5}/pulls?per_page=100`],
|
|
317346
317429
|
{ cwd: worktree, encoding: "utf8", env: hostEnv(), timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }
|
|
@@ -317359,7 +317442,7 @@ function infrastructureChecks(sha5, worktree) {
|
|
|
317359
317442
|
const match = remote.match(/^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);
|
|
317360
317443
|
if (!match) throw new Error("origin nie wskazuje github.com owner/repo");
|
|
317361
317444
|
const repository = `${match[1]}/${match[2]}`;
|
|
317362
|
-
const result = (0,
|
|
317445
|
+
const result = (0, import_node_child_process19.spawnSync)(
|
|
317363
317446
|
"bash",
|
|
317364
317447
|
["-c", 'source "$1"; land_required_checks "$2"', "--", import_node_path52.default.join(REPO, "scripts/lib/land-shared.sh"), repository],
|
|
317365
317448
|
{ cwd: worktree, encoding: "utf8", env: hostEnv(), timeout: remainingTickMs(3e4), maxBuffer: 1024 * 1024 }
|
|
@@ -317396,7 +317479,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
|
|
|
317396
317479
|
const runIds = new Set(failed2.map((f) => f.url.match(/\/actions\/runs\/(\d+)/)?.[1]).filter((x) => Boolean(x)));
|
|
317397
317480
|
for (const runId2 of runIds) {
|
|
317398
317481
|
try {
|
|
317399
|
-
const raw = (0,
|
|
317482
|
+
const raw = (0, import_node_child_process19.execFileSync)("gh", ["api", `repos/${repository}/actions/runs/${runId2}/jobs?per_page=100`], { cwd: worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 });
|
|
317400
317483
|
const jobs2 = asRecord3(JSON.parse(raw)).jobs;
|
|
317401
317484
|
if (!Array.isArray(jobs2)) throw new Error("gh jobs: brak listy jobs");
|
|
317402
317485
|
const sourceChecks = failed2.filter((check5) => check5.url === `https://github.com/${repository}/actions/runs/${runId2}` || check5.url.startsWith(`https://github.com/${repository}/actions/runs/${runId2}/`));
|
|
@@ -317411,7 +317494,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
|
|
|
317411
317494
|
return job.conclusion === "failure" && typeof job.name === "string" && CI_DISK_HOLD_JOBS.includes(job.name) && sourceChecks.some((check5) => check5.name === job.name) && Array.isArray(job.steps) && job.steps.some((x) => asRecord3(x).name === CI_DISK_HOLD_STEP && asRecord3(x).conclusion === "failure");
|
|
317412
317495
|
}) || sourceChecks.some((check5) => interruptedJob(check5))) {
|
|
317413
317496
|
try {
|
|
317414
|
-
const run = asRecord3(JSON.parse((0,
|
|
317497
|
+
const run = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["api", `repos/${repository}/actions/runs/${runId2}`], {
|
|
317415
317498
|
cwd: worktree,
|
|
317416
317499
|
encoding: "utf-8",
|
|
317417
317500
|
env: hostEnv(),
|
|
@@ -317457,7 +317540,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
|
|
|
317457
317540
|
}
|
|
317458
317541
|
function ciDiskReady(worktree, repository) {
|
|
317459
317542
|
try {
|
|
317460
|
-
const state = asRecord3(JSON.parse((0,
|
|
317543
|
+
const state = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)(
|
|
317461
317544
|
"gh",
|
|
317462
317545
|
["variable", "get", "ROBISIE_MAC_DISK_STATE", "--repo", repository],
|
|
317463
317546
|
{ cwd: worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(5e3) }
|
|
@@ -317676,7 +317759,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
317676
317759
|
if (!match) throw new Error("Origin nie wskazuje repozytorium github.com owner/repo");
|
|
317677
317760
|
const repository = `${match[1]}/${match[2]}`;
|
|
317678
317761
|
const readMergedPr = () => {
|
|
317679
|
-
const merged = asRecord3(JSON.parse((0,
|
|
317762
|
+
const merged = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["pr", "view", targetBranch, "--json", "state,mergeCommit", "--repo", repository], {
|
|
317680
317763
|
cwd: a.worktree,
|
|
317681
317764
|
encoding: "utf-8",
|
|
317682
317765
|
env: hostEnv(),
|
|
@@ -317847,7 +317930,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
317847
317930
|
if (archived) log2(`R9 card_id=${card.id} target=${targetRef} base=${card.details?.base_sha} stale=${stale} tag=${backupTag} stage=create result=created candidate=${sha5}`);
|
|
317848
317931
|
if (!alreadyPushed) await reviewPhase(uid, card, { branchLease: sha5 });
|
|
317849
317932
|
try {
|
|
317850
|
-
const api = (args) => JSON.parse((0,
|
|
317933
|
+
const api = (args) => JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["api", ...args], {
|
|
317851
317934
|
cwd: a.worktree,
|
|
317852
317935
|
encoding: "utf-8",
|
|
317853
317936
|
env: hostEnv(),
|
|
@@ -317934,7 +318017,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
317934
318017
|
await reviewPhase(uid, card, { ciRetry, hold_reason: null });
|
|
317935
318018
|
await updateTask2(uid, card.id, { status: "in_review", assignee: ASSIGNEE });
|
|
317936
318019
|
card.status = "in_review";
|
|
317937
|
-
for (const runId2 of runIds) (0,
|
|
318020
|
+
for (const runId2 of runIds) (0, import_node_child_process19.execFileSync)(
|
|
317938
318021
|
"gh",
|
|
317939
318022
|
["run", "rerun", runId2, "--failed", "--repo", repository],
|
|
317940
318023
|
{ cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) }
|
|
@@ -317968,7 +318051,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
317968
318051
|
const ciRetry = { sha: sha5, runId: runId2, at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: "cancelled" };
|
|
317969
318052
|
await reviewPhase(uid, card, { ciRetry });
|
|
317970
318053
|
try {
|
|
317971
|
-
(0,
|
|
318054
|
+
(0, import_node_child_process19.execFileSync)("gh", ["run", "rerun", runId2, "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
|
|
317972
318055
|
lastTick(s, "landing", `CI cancelled: jedno ponowienie run ${runId2} dla ${sha5}; runda recenzji bez zmian`, false, card.id);
|
|
317973
318056
|
return;
|
|
317974
318057
|
} catch (rerunError) {
|
|
@@ -317994,7 +318077,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
317994
318077
|
const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: klass };
|
|
317995
318078
|
await reviewPhase(uid, card, { ciRetry });
|
|
317996
318079
|
try {
|
|
317997
|
-
(0,
|
|
318080
|
+
(0, import_node_child_process19.execFileSync)("gh", ["run", "rerun", runIds[0], "--failed", "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
|
|
317998
318081
|
lastTick(s, "landing", `${label2}: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
|
|
317999
318082
|
return;
|
|
318000
318083
|
} catch (rerunError) {
|
|
@@ -318019,7 +318102,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
318019
318102
|
for (const runId2 of runIds) {
|
|
318020
318103
|
let status2;
|
|
318021
318104
|
try {
|
|
318022
|
-
status2 = (0,
|
|
318105
|
+
status2 = (0, import_node_child_process19.execFileSync)("gh", ["run", "view", runId2, "--repo", repository, "--json", "status", "--jq", ".status"], {
|
|
318023
318106
|
cwd: a.worktree,
|
|
318024
318107
|
encoding: "utf-8",
|
|
318025
318108
|
env: hostEnv(),
|
|
@@ -318040,7 +318123,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
318040
318123
|
let logReadFailed = false;
|
|
318041
318124
|
for (const runId2 of runIds) {
|
|
318042
318125
|
try {
|
|
318043
|
-
const raw = (0,
|
|
318126
|
+
const raw = (0, import_node_child_process19.execFileSync)("gh", ["run", "view", runId2, "--log-failed", "--repo", repository], {
|
|
318044
318127
|
cwd: a.worktree,
|
|
318045
318128
|
encoding: "utf-8",
|
|
318046
318129
|
env: hostEnv(),
|
|
@@ -318073,7 +318156,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
|
|
|
318073
318156
|
const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: "outside-diff", tests: [...tests] };
|
|
318074
318157
|
await reviewPhase(uid, card, { ciRetry });
|
|
318075
318158
|
try {
|
|
318076
|
-
(0,
|
|
318159
|
+
(0, import_node_child_process19.execFileSync)("gh", ["run", "rerun", runIds[0], "--failed", "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
|
|
318077
318160
|
lastTick(s, "landing", `CI poza diffem: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
|
|
318078
318161
|
return;
|
|
318079
318162
|
} catch (rerunError) {
|
|
@@ -318216,7 +318299,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
|
|
|
318216
318299
|
[freshWorker2.jobId, freshWorker2.attempts, freshWorker2.worktree, freshWorker2.branch],
|
|
318217
318300
|
[priorWorker.jobId, priorWorker.attempts, priorWorker.worktree, priorWorker.branch]
|
|
318218
318301
|
)) throw new Error("Recenzja lub Worker zmieni\u0142y si\u0119 przed scaleniem PR");
|
|
318219
|
-
(0,
|
|
318302
|
+
(0, import_node_child_process19.execFileSync)("gh", ["pr", "merge", targetBranch, "--merge", "--match-head-commit", sha5, "--repo", repository], {
|
|
318220
318303
|
cwd: a.worktree,
|
|
318221
318304
|
encoding: "utf-8",
|
|
318222
318305
|
env: hostEnv(),
|
|
@@ -318241,7 +318324,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
|
|
|
318241
318324
|
if (clearDeadIndexLock(a.worktree, card.id) === "held") return;
|
|
318242
318325
|
await reviewPhase(uid, card, { phase: "review", sha: null, pass_waiting_sha: null, branchLease: sha5, ci: null });
|
|
318243
318326
|
try {
|
|
318244
|
-
git(["rebase", engineBaseRef()], a.worktree, 12e4);
|
|
318327
|
+
git(["rebase", engineBaseRef()], a.worktree, 12e4, true);
|
|
318245
318328
|
} catch (rebaseError) {
|
|
318246
318329
|
try {
|
|
318247
318330
|
git(["rebase", "--abort"], a.worktree);
|
|
@@ -318329,7 +318412,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
|
|
|
318329
318412
|
const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), reason: "missing" };
|
|
318330
318413
|
await reviewPhase(uid, card, { ciRetry, ci: { ...ci, sha: sha5, startedAt: ciRetry.at } });
|
|
318331
318414
|
try {
|
|
318332
|
-
(0,
|
|
318415
|
+
(0, import_node_child_process19.execFileSync)("gh", ["run", "rerun", runIds[0], "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
|
|
318333
318416
|
lastTick(s, "landing", `CI missing: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
|
|
318334
318417
|
return;
|
|
318335
318418
|
} catch (rerunError) {
|
|
@@ -318441,7 +318524,7 @@ function reviewFreshness(details2) {
|
|
|
318441
318524
|
function reviewResultDiagnostic(s, cardId, phase, reason) {
|
|
318442
318525
|
if (engineClient()) {
|
|
318443
318526
|
s.blocked++;
|
|
318444
|
-
if (reason !== "Brak kontekstu localDelivery klienta; pomijam dostaw\u0119") reason = clientTickFailure();
|
|
318527
|
+
if (reason !== "Brak kontekstu localDelivery klienta; pomijam dostaw\u0119" && !(phase === "local-delivery-hold" && /^(?:Error: )?(?:not-fast-forward|target-moved|target-checked-out|target-is-symbolic-ref|error): /.test(reason))) reason = clientTickFailure();
|
|
318445
318528
|
}
|
|
318446
318529
|
try {
|
|
318447
318530
|
log2(`${phase} cardId=${cardId} ${reason}`);
|
|
@@ -319253,7 +319336,7 @@ async function reviewActive(s, uid, card, a, landing, installation = tickInstall
|
|
|
319253
319336
|
}), { flag: "wx", mode: 384 });
|
|
319254
319337
|
try {
|
|
319255
319338
|
await new Promise((resolve7, reject) => {
|
|
319256
|
-
const child = (0,
|
|
319339
|
+
const child = (0, import_node_child_process19.spawn)(
|
|
319257
319340
|
process.execPath,
|
|
319258
319341
|
engineJobArgv(__filename, "review", file3),
|
|
319259
319342
|
{ cwd: REPO, env: clientPair ? { ...installation.controlEnv(), ROBISIE_ENGINE_CONFIG: clientPair.config.path } : { ...executionEnv2(), MASZYNISTA_HOST_STATE_DIR: hostStateDir() }, detached: true, stdio: "ignore" }
|
|
@@ -320470,7 +320553,7 @@ function testerRelatedFiles(root, changed, failures) {
|
|
|
320470
320553
|
process.stdout.write('TESTER_RELATED_JSON=' + JSON.stringify({ related, graphs }) + '\n');
|
|
320471
320554
|
} finally { await ctx.close(); }
|
|
320472
320555
|
`;
|
|
320473
|
-
const result = (0,
|
|
320556
|
+
const result = (0, import_node_child_process19.spawnSync)(process.execPath, ["--input-type=module", "-e", script, JSON.stringify({ root, changed, failures })], {
|
|
320474
320557
|
cwd: root,
|
|
320475
320558
|
env: executionEnv2(),
|
|
320476
320559
|
encoding: "utf8",
|
|
@@ -321013,7 +321096,7 @@ report: ${json6 ? reportPath : "UNKNOWN (komenda z\u0142o\u017Cona lub inny runn
|
|
|
321013
321096
|
const execute = (run2, cwd, ceiling = TESTER_COMMAND_CEILING_MS) => {
|
|
321014
321097
|
const started = (/* @__PURE__ */ new Date()).toISOString(), startMs = Date.now();
|
|
321015
321098
|
try {
|
|
321016
|
-
return (0,
|
|
321099
|
+
return (0, import_node_child_process19.execFileSync)("/bin/zsh", [
|
|
321017
321100
|
"-lc",
|
|
321018
321101
|
'exec /usr/bin/env -i "$@"',
|
|
321019
321102
|
"maszynista-test-clean-env",
|
|
@@ -321668,7 +321751,7 @@ async function dispatchCard(s, uid, projectId2, c, selection, installation, clie
|
|
|
321668
321751
|
const snapshot2 = () => {
|
|
321669
321752
|
const head = git(["rev-parse", "--verify", "HEAD^{commit}"], worktree);
|
|
321670
321753
|
if (!/^[a-f0-9]{40}$/.test(head)) throw new Error("HEAD UNKNOWN");
|
|
321671
|
-
return { head, diff: (0,
|
|
321754
|
+
return { head, diff: (0, import_node_child_process19.execFileSync)("git", ["diff", "--binary", "HEAD"], { cwd: worktree, encoding: "utf-8", timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }), staged: (0, import_node_child_process19.execFileSync)("git", ["diff", "--cached", "--binary"], { cwd: worktree, encoding: "utf-8", timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }) };
|
|
321672
321755
|
};
|
|
321673
321756
|
try {
|
|
321674
321757
|
candidate = snapshot2();
|
|
@@ -321676,7 +321759,7 @@ async function dispatchCard(s, uid, projectId2, c, selection, installation, clie
|
|
|
321676
321759
|
throw new DispatchHold(`HOLD repair R${reviewRound}: odczyt kandydata: ${errorText5(error48)}`, false);
|
|
321677
321760
|
}
|
|
321678
321761
|
try {
|
|
321679
|
-
git(["rebase", preparedBase ?? (installation?.baseRef() ?? engineBaseRef())], worktree, 12e4);
|
|
321762
|
+
git(["rebase", preparedBase ?? (installation?.baseRef() ?? engineBaseRef())], worktree, 12e4, true);
|
|
321680
321763
|
} catch (rebaseError) {
|
|
321681
321764
|
let conflictFiles = "", unknown4 = "";
|
|
321682
321765
|
try {
|
|
@@ -322221,7 +322304,7 @@ function runSeedGate(card) {
|
|
|
322221
322304
|
tool_name: "mcp__robisie-planer__update_task",
|
|
322222
322305
|
tool_input: { id: card.id, status: "ready" }
|
|
322223
322306
|
});
|
|
322224
|
-
const result = (0,
|
|
322307
|
+
const result = (0, import_node_child_process19.spawnSync)("/bin/bash", [gatePath], {
|
|
322225
322308
|
cwd: REPO,
|
|
322226
322309
|
encoding: "utf8",
|
|
322227
322310
|
input: payload,
|
|
@@ -322495,7 +322578,7 @@ function selectorUnavailable(s, now) {
|
|
|
322495
322578
|
}
|
|
322496
322579
|
function spawnSelectorProcess(trigger, force) {
|
|
322497
322580
|
return new Promise((resolve7, reject) => {
|
|
322498
|
-
const child = (0,
|
|
322581
|
+
const child = (0, import_node_child_process19.spawn)("npx", ["tsx", "maszynista/select.ts"], {
|
|
322499
322582
|
cwd: REPO,
|
|
322500
322583
|
detached: true,
|
|
322501
322584
|
stdio: "ignore",
|
|
@@ -323118,7 +323201,7 @@ function createScopeReader(s, uid, projectId2, installation) {
|
|
|
323118
323201
|
if (asRecord3(error48).code !== "ESRCH") throw error48;
|
|
323119
323202
|
}
|
|
323120
323203
|
}
|
|
323121
|
-
const rawGit = (args, cwd) => Buffer.from((0,
|
|
323204
|
+
const rawGit = (args, cwd) => Buffer.from((0, import_node_child_process19.execFileSync)("git", args, {
|
|
323122
323205
|
cwd,
|
|
323123
323206
|
timeout: remainingTickMs(6e4),
|
|
323124
323207
|
maxBuffer: 20 * 1024 * 1024
|
|
@@ -323736,6 +323819,13 @@ function clientTickFailure(error48) {
|
|
|
323736
323819
|
const reason = `Brak komendy klienta: ${command}`;
|
|
323737
323820
|
if (error48 instanceof Error && error48.message === reason) return reason;
|
|
323738
323821
|
}
|
|
323822
|
+
const testerReasons = {
|
|
323823
|
+
"tester-safety-missing": "Brak pliku listy ochrony testera (tester-safety-v1.txt) w <stateDir>/inputs \u2014 uruchom `npx robisie init` w katalogu projektu, potem `npx robisie doctor`",
|
|
323824
|
+
"tester-safety-invalid": "Lista ochrony testera jest pusta lub zawiera niepoprawne wyra\u017Cenie \u2014 popraw plik lub usu\u0144 go i uruchom `npx robisie init`",
|
|
323825
|
+
"client-pair-hold": "Konfiguracja silnika zmieni\u0142a si\u0119 od startu karty \u2014 przywr\xF3\u0107 poprzedni\u0105 zawarto\u015B\u0107 albo pon\xF3w kart\u0119"
|
|
323826
|
+
};
|
|
323827
|
+
const code = error48 instanceof TesterSafetyError ? error48.code : error48 instanceof ClientPairHold ? "client-pair-hold" : void 0;
|
|
323828
|
+
if (code) return `${code}: ${testerReasons[code]}`;
|
|
323739
323829
|
return error48 instanceof Error && error48.message === "ROBISIE_REVIEW_KEY nieustawione lub niepoprawne; wymagany odr\u0119bny aktor owner_validator tego samego konta i polityka enforced" ? "brak poprawnego klucza odbiorcy B; skonfiguruj ROBISIE_REVIEW_KEY odr\u0119bnego owner_validator tego samego konta i pon\xF3w factory run" : "nierozstrzygni\u0119ty wynik lub odmowa fazy; sprawd\u017A lokalne dowody i stan karty przed wznowieniem factory run";
|
|
323740
323830
|
}
|
|
323741
323831
|
async function main2() {
|
|
@@ -324392,12 +324482,12 @@ async function main2() {
|
|
|
324392
324482
|
if (client && result.outcome !== "ok") console.error(`Fabryka ${result.outcome === "stop" ? "zatrzymana" : "retry"}: ${result.reason}${result.cleanup ? "; finalizacja niepotwierdzona \u2014 sprawd\u017A stan i blokad\u0119" : ""}`);
|
|
324393
324483
|
return client && result.outcome === "stop" ? 2 : code;
|
|
324394
324484
|
}
|
|
324395
|
-
var import_node_fs47, import_gray_matter2,
|
|
324485
|
+
var import_node_fs47, import_gray_matter2, import_node_child_process19, import_node_os14, import_node_sqlite4, import_node_util12, import_node_crypto31, import_node_path52, TASK_REPO, ASSIGNEE, CODEX_HELPER, WORKER_TIMEOUT_MIN, WORKER_MODELS_CONFIG, OPENCODE_LEDGER, MAX_ATTEMPTS, REVIEW_JOB_EXCLUDE, TESTER_DETAILS_KEYS, TESTER_RECOVERY_DETAILS_KEYS, LOCAL_TESTER_LIST_DETAILS_KEYS, CARD_OWNER_DETAILS_KEYS, LANDING_RECOVERY_DETAILS_KEYS, ACTIONABLE_BLOCKER_DETAILS_KEYS, REVIEW_RECOVERY_IDENTITY_KEYS, REVIEW_RECOVERY_DETAILS_KEYS, REVIEW_RECOVERY_FIELDS, REVIEW_SCAN_FIELDS, DECISION_QUEUE_SCAN_FIELDS, DECISION_REFRESH_DETAILS_KEYS, BLOCKED_WORKER_DETAILS_KEYS, ENABLED_SCAN_DETAILS_KEYS, RESERVATION_DETAILS_KEYS, RESERVATION_SCAN_DETAILS_KEYS, OBLIGATION_DETAILS_KEYS, READY_DETAILS_KEYS, RECOVERY_DETAILS_KEYS, PROMOTION_BOARD_DETAILS_KEYS, PROMOTION_DRAFT_DETAILS_KEYS, DRAFT_SUPPLY_DETAILS_KEYS, SCAN_OPTIONS, PROMOTION_BOARD_STATUSES, NORTH_STAR, AUTHORITY, RUNTIME_FILES, STATE2, REVIEW_LAST, HOST_MIN_FREE_GIB, HOST_UNBLOCK_FREE_GIB, DISK_ARTIFACT_MIN_AGE_MS, hostOperationsWakeDb, responseGuardReadErrorLogged, crLivenessIdentityLogged, crBlockerIdentityLogged, tickInstallation, CODEX_LIFECYCLE_HOOK, REQUIRED_CHECKS2, CI_QUEUE_CEILING_MS, reviewText, LAST_TICK, DECISIONS, DECISIONS_REKSIO, BLOCKED_TECH, TEST_LAST, FOR_HERMES, LOCK2, LOG2, configuredTickLimitMs, TICK_LIMIT_MS, START_BUDGET_MS, LAND_BUDGET_MS, TESTER_COMMAND_CEILING_MS, TESTER_FLAKE_RERUN_MS, tickDeadline, DRY2, loadedSha, mainSha, hostStateDir, loadEnvFiles2, SshAuthExhausted, DispatchHold, CODEX_PLUGIN_DATA, EXECUTION_ENV_ALLOWLIST, northStarDeps, skippedCardEvents, LEAD_CLASSES, LEAD_AGENT_WAITING, LEAD_OWNER_WAKE_LIMIT, leadWakeDbMissingLogged, rulingSha, ClientReviewBaseChanged, testerRetestRepo, TESTER_RETEST_BACKOFF_BASE_MS, TESTER_RETEST_BACKOFF_MAX_MS, TESTER_RETEST_MAX_ERRORS, TESTER_IDENTITY_RECOVERY_LIMIT, selectorUnavailableTicks, crBlockerIssueLogged, uncertainStarts, processCards;
|
|
324396
324486
|
var init_tick = __esm({
|
|
324397
324487
|
"maszynista/tick.ts"() {
|
|
324398
324488
|
import_node_fs47 = require("node:fs");
|
|
324399
324489
|
import_gray_matter2 = __toESM(require_gray_matter());
|
|
324400
|
-
|
|
324490
|
+
import_node_child_process19 = require("node:child_process");
|
|
324401
324491
|
import_node_os14 = require("node:os");
|
|
324402
324492
|
import_node_sqlite4 = require("node:sqlite");
|
|
324403
324493
|
import_node_util12 = require("node:util");
|
|
@@ -324450,6 +324540,7 @@ var init_tick = __esm({
|
|
|
324450
324540
|
init_zasiew_bell();
|
|
324451
324541
|
init_sparse_policy();
|
|
324452
324542
|
init_constants();
|
|
324543
|
+
init_git_commit();
|
|
324453
324544
|
init_goal_point_publisher();
|
|
324454
324545
|
init_store();
|
|
324455
324546
|
init_host_ops2();
|
|
@@ -324650,6 +324741,7 @@ init_tick();
|
|
|
324650
324741
|
TESTER_RETEST_MAX_ERRORS,
|
|
324651
324742
|
actionableBlockerHold,
|
|
324652
324743
|
armTickDeadline,
|
|
324744
|
+
autoCommitWorker,
|
|
324653
324745
|
cleanupRecoverableDiskArtifacts,
|
|
324654
324746
|
configureSparseCheckout,
|
|
324655
324747
|
consumeActive,
|
|
@@ -324682,10 +324774,12 @@ init_tick();
|
|
|
324682
324774
|
northStarRecovered,
|
|
324683
324775
|
notifyLandingHold,
|
|
324684
324776
|
obligationPhase,
|
|
324777
|
+
parseHostBootAt,
|
|
324685
324778
|
parseUnblockGiB,
|
|
324686
324779
|
processWip,
|
|
324687
324780
|
promotionPhase,
|
|
324688
324781
|
queueForReksio,
|
|
324782
|
+
readHostBootAt,
|
|
324689
324783
|
readRecentBuzzEvents,
|
|
324690
324784
|
readyTaskPatch,
|
|
324691
324785
|
reconcileBoardActives,
|