robisie 0.2.1 → 0.3.0

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.
@@ -13832,6 +13832,9 @@ var init_types = __esm({
13832
13832
  // src/lib/db/schema.ts
13833
13833
  var schema_exports = {};
13834
13834
  __export2(schema_exports, {
13835
+ cliInstallations: () => cliInstallations,
13836
+ cliKeyPairs: () => cliKeyPairs,
13837
+ deviceAuthorizations: () => deviceAuthorizations,
13835
13838
  emailFailures: () => emailFailures,
13836
13839
  gdprAuditLog: () => gdprAuditLog,
13837
13840
  jobs: () => jobs,
@@ -13858,7 +13861,7 @@ __export2(schema_exports, {
13858
13861
  userProfiles: () => userProfiles,
13859
13862
  users: () => users
13860
13863
  });
13861
- var users, jobs, plugins, userPlugins, monitoredChannels, subscriptions, products, userProfiles, emailFailures, gdprAuditLog, storageCleanupQueue, bytea, tsvector, memoryDocuments, memoryChunks, plannerProjects, plannerReviewPolicies, plannerTracks, plannerTasks, stripeEvents, userMcpKeys, plannerWebhookSubscriptions, plannerTaskStatusEvents, plannerLimitEvents, mcpRateLimitWindows, licenseUsageReadings, licenseUsageAlerts;
13864
+ var users, jobs, plugins, userPlugins, monitoredChannels, subscriptions, products, userProfiles, emailFailures, gdprAuditLog, storageCleanupQueue, bytea, tsvector, memoryDocuments, memoryChunks, plannerProjects, plannerReviewPolicies, plannerTracks, plannerTasks, stripeEvents, userMcpKeys, cliInstallations, deviceAuthorizations, cliKeyPairs, plannerWebhookSubscriptions, plannerTaskStatusEvents, plannerLimitEvents, mcpRateLimitWindows, licenseUsageReadings, licenseUsageAlerts;
13862
13865
  var init_schema2 = __esm({
13863
13866
  "src/lib/db/schema.ts"() {
13864
13867
  "use strict";
@@ -14332,6 +14335,51 @@ var init_schema2 = __esm({
14332
14335
  index("idx_user_mcp_keys_user").on(table.userId)
14333
14336
  ]
14334
14337
  );
14338
+ cliInstallations = pgTable("cli_installations", {
14339
+ id: uuid("id").primaryKey().defaultRandom(),
14340
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
14341
+ displayName: text("display_name"),
14342
+ createdAt: timestamp("created_at", { withTimezone: true, mode: "date" }).notNull().defaultNow(),
14343
+ revokedAt: timestamp("revoked_at", { withTimezone: true, mode: "date" })
14344
+ }, (table) => [index("idx_cli_installations_user").on(table.userId)]);
14345
+ deviceAuthorizations = pgTable("device_authorizations", {
14346
+ id: uuid("id").primaryKey().defaultRandom(),
14347
+ deviceCodeHash: text("device_code_hash").notNull().unique(),
14348
+ userCodeHash: text("user_code_hash").notNull().unique(),
14349
+ clientId: text("client_id").notNull(),
14350
+ scope: text("scope").notNull(),
14351
+ installationHint: uuid("installation_hint"),
14352
+ displayName: text("display_name"),
14353
+ state: text("state", { enum: ["pending", "approved", "denied", "consumed", "expired"] }).notNull().default("pending"),
14354
+ ownerUserId: text("owner_user_id").references(() => users.id, { onDelete: "cascade" }),
14355
+ installationId: uuid("installation_id").references(() => cliInstallations.id, { onDelete: "cascade" }),
14356
+ approvedSessionId: text("approved_session_id"),
14357
+ reauthAt: timestamp("reauth_at", { withTimezone: true, mode: "date" }),
14358
+ intervalS: integer("interval_s").notNull().default(5),
14359
+ lastPolledAt: timestamp("last_polled_at", { withTimezone: true, mode: "date" }),
14360
+ pollCount: integer("poll_count").notNull().default(0),
14361
+ createdIpHash: text("created_ip_hash").notNull(),
14362
+ createdAt: timestamp("created_at", { withTimezone: true, mode: "date" }).notNull().defaultNow(),
14363
+ expiresAt: timestamp("expires_at", { withTimezone: true, mode: "date" }).notNull().default(sql`now() + interval '600 seconds'`),
14364
+ decidedAt: timestamp("decided_at", { withTimezone: true, mode: "date" }),
14365
+ consumedAt: timestamp("consumed_at", { withTimezone: true, mode: "date" })
14366
+ }, (table) => [
14367
+ index("idx_device_authorizations_active_ip").on(table.createdIpHash, table.expiresAt).where(sql`${table.state} = 'pending'`),
14368
+ index("idx_device_authorizations_owner").on(table.ownerUserId)
14369
+ ]);
14370
+ cliKeyPairs = pgTable("cli_key_pairs", {
14371
+ pairId: uuid("pair_id").primaryKey(),
14372
+ installationId: uuid("installation_id").notNull().references(() => cliInstallations.id, { onDelete: "cascade" }),
14373
+ userId: text("user_id").notNull().references(() => users.id, { onDelete: "cascade" }),
14374
+ workerKeyId: uuid("worker_key_id").notNull().unique().references(() => userMcpKeys.id, { onDelete: "cascade" }),
14375
+ reviewKeyId: uuid("review_key_id").notNull().unique().references(() => userMcpKeys.id, { onDelete: "cascade" }),
14376
+ issuedAt: timestamp("issued_at", { withTimezone: true, mode: "date" }).notNull().defaultNow(),
14377
+ confirmedAt: timestamp("confirmed_at", { withTimezone: true, mode: "date" }),
14378
+ revokedAt: timestamp("revoked_at", { withTimezone: true, mode: "date" })
14379
+ }, (table) => [
14380
+ index("idx_cli_key_pairs_installation").on(table.installationId),
14381
+ index("idx_cli_key_pairs_user").on(table.userId)
14382
+ ]);
14335
14383
  plannerWebhookSubscriptions = pgTable(
14336
14384
  "planner_webhook_subscriptions",
14337
14385
  {
@@ -37577,7 +37625,7 @@ var init_constants = __esm({
37577
37625
  "packages/client/src/constants.ts"() {
37578
37626
  "use strict";
37579
37627
  PACKAGE_NAME = "robisie";
37580
- PACKAGE_VERSION = "0.2.1";
37628
+ PACKAGE_VERSION = "0.3.0";
37581
37629
  SUPPORTED_CONTRACT_MAJOR = 1;
37582
37630
  DEFAULT_ORIGIN = "https://robisie.app";
37583
37631
  MCP_SERVER_NAME = "robisie";
@@ -37852,10 +37900,12 @@ function resolveRoleExecution(registry2, role3) {
37852
37900
  return { provider: entry2.provider, model: entry2.model, effortRequested: entry2.effort };
37853
37901
  }
37854
37902
  function loadRoleRegistryConfig(path34) {
37855
- const configPath = (0, import_node_path3.resolve)(path34);
37856
- const retry = `Popraw plik \u201E${configPath}\u201D (${CONFIG_FILE}) i pon\xF3w \`npx robisie doctor --engine-config <path>\` z t\u0105 \u015Bcie\u017Ck\u0105.`;
37903
+ const file3 = (0, import_node_path3.resolve)(path34);
37904
+ let configPath = file3;
37905
+ 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
37906
  let contents;
37858
37907
  try {
37908
+ configPath = (0, import_node_fs2.realpathSync)(configPath);
37859
37909
  contents = (0, import_node_fs2.readFileSync)(configPath, "utf8");
37860
37910
  } catch {
37861
37911
  throw new RobisieError(
@@ -37867,18 +37917,19 @@ function loadRoleRegistryConfig(path34) {
37867
37917
  try {
37868
37918
  raw = JSON.parse(contents.replace(/^\uFEFF/, ""));
37869
37919
  } catch {
37870
- throw new RobisieError(`${configPath}: niepoprawny JSON.`, retry);
37920
+ throw new RobisieError(`${file3}: niepoprawny JSON.`, retry);
37871
37921
  }
37872
37922
  let config2;
37873
37923
  try {
37874
37924
  config2 = parseEngineConfig(raw, configPath);
37875
37925
  } catch (error48) {
37876
- throw new RobisieError(errorMessage(error48), retry);
37926
+ throw new RobisieError(errorMessage(error48).replaceAll(`${configPath}:`, () => `${file3}:`), retry);
37877
37927
  }
37878
- return { config: config2, roleRegistry: parseRoleRegistry(raw, configPath) };
37928
+ return { config: config2, roleRegistry: parseRoleRegistry(raw, file3) };
37879
37929
  }
37880
- function doctorEngineConfig(ctx, path34) {
37881
- const { roleRegistry } = loadRoleRegistryConfig((0, import_node_path3.resolve)(ctx.cwd, path34));
37930
+ function doctorEngineConfig(ctx, path34, afterLoad) {
37931
+ const { roleRegistry, config: config2 } = loadRoleRegistryConfig((0, import_node_path3.resolve)(ctx.cwd, path34));
37932
+ afterLoad?.(config2);
37882
37933
  for (const role3 of ROLES) {
37883
37934
  const { name: name3, provider, model, effort } = roleRegistry[role3];
37884
37935
  ctx.out(`${role3} \u2192 ${name3} / ${provider} / ${model} / ${effort}`);
@@ -53340,7 +53391,7 @@ function finishTickState(state, outcome, tick, at3, facts = {}) {
53340
53391
  const reason = observed ? `runtime=failed outcome=${outcome} loaded=${facts.observedLoaded ?? "UNKNOWN"} tick=${tick}` : `outcome=failed tick=${tick}`;
53341
53392
  return { ...state, confirmed: void 0, breaker: { ...state.confirmed, at: at3, reason } };
53342
53393
  }
53343
- function readLoadedSha(repo, git2 = defaultGit) {
53394
+ function readLoadedSha(repo, git2 = quietGit) {
53344
53395
  try {
53345
53396
  const head = git2(["rev-parse", "HEAD"], repo);
53346
53397
  const dirty = git2(["status", "--porcelain", "-z", "--", ":(glob)maszynista/*.ts", "services", "src/lib"], repo);
@@ -53352,9 +53403,15 @@ function readLoadedSha(repo, git2 = defaultGit) {
53352
53403
  function mainRefLockRace(error48) {
53353
53404
  return [record6(error48).stderr, error48 instanceof Error ? error48.message : String(error48)].some((diagnostic) => typeof diagnostic === "string" && diagnostic.includes("cannot lock ref 'refs/remotes/origin/main'"));
53354
53405
  }
53355
- function defaultGit(args, cwd = process.cwd(), timeoutMs = 6e4) {
53406
+ function runGit(args, cwd = process.cwd(), timeoutMs = 6e4, quiet = false) {
53356
53407
  try {
53357
- const output = (0, import_node_child_process4.execFileSync)("git", args, { cwd, encoding: "utf8", timeout: timeoutMs, maxBuffer: 20 * 1024 * 1024 });
53408
+ const output = (0, import_node_child_process4.execFileSync)("git", args, {
53409
+ cwd,
53410
+ encoding: "utf8",
53411
+ timeout: timeoutMs,
53412
+ maxBuffer: 20 * 1024 * 1024,
53413
+ stdio: quiet ? ["ignore", "pipe", "ignore"] : void 0
53414
+ });
53358
53415
  return args.includes("-z") ? output : output.trim();
53359
53416
  } catch (error48) {
53360
53417
  throw Object.assign(
@@ -54076,7 +54133,7 @@ async function runHostActivation(input, deps = {}) {
54076
54133
  deps.log?.(`ff ${head.slice(0, 8)}\u2192${target.slice(0, 8)} ${label2} brud=${porcelainPaths(porcelain).length} zachowany`);
54077
54134
  return endRefusal({ code: "activate", target });
54078
54135
  }
54079
- var import_node_child_process4, import_node_crypto6, import_node_fs11, import_node_path13, STATE_FILE, MODE_FILE, BREAKER_WINDOW_TICKS, SMOKE_TIMEOUT_MS, ACTIVATION_RESERVE_MS, loadableExtensions, dependencyKeys;
54136
+ var import_node_child_process4, import_node_crypto6, import_node_fs11, import_node_path13, STATE_FILE, MODE_FILE, BREAKER_WINDOW_TICKS, SMOKE_TIMEOUT_MS, ACTIVATION_RESERVE_MS, loadableExtensions, dependencyKeys, defaultGit, quietGit;
54080
54137
  var init_host_activation = __esm({
54081
54138
  "maszynista/host-activation.ts"() {
54082
54139
  "use strict";
@@ -54093,6 +54150,8 @@ var init_host_activation = __esm({
54093
54150
  ACTIVATION_RESERVE_MS = 15e4;
54094
54151
  loadableExtensions = /* @__PURE__ */ new Set([".ts", ".tsx", ".js", ".mjs", ".cjs", ".json"]);
54095
54152
  dependencyKeys = ["dependencies", "devDependencies", "optionalDependencies", "peerDependencies", "overrides", "resolutions"];
54153
+ defaultGit = (args, cwd, timeoutMs) => runGit(args, cwd, timeoutMs);
54154
+ quietGit = (args, cwd, timeoutMs) => runGit(args, cwd, timeoutMs, true);
54096
54155
  }
54097
54156
  });
54098
54157
 
@@ -76323,7 +76382,7 @@ function callLocalReceiver(input, dir) {
76323
76382
  "--disable-web-search",
76324
76383
  "--verbatim",
76325
76384
  "--reasoning-effort",
76326
- "none"
76385
+ "low"
76327
76386
  ];
76328
76387
  const result = (0, import_node_child_process7.spawnSync)("grok", args, { cwd: dir, env: localReceiverEnv(), encoding: "utf8", timeout: 18e4, maxBuffer: 256 * 1024 });
76329
76388
  if (result.error || result.status !== 0) throw result.error ?? new Error(`Grok exit=${result.status}`);
@@ -76332,7 +76391,7 @@ function callLocalReceiver(input, dir) {
76332
76391
  return { output: envelope.structuredOutput ?? null, invocation: {
76333
76392
  provider: "xai",
76334
76393
  actualModel: models[0],
76335
- effort: "none",
76394
+ effort: "low",
76336
76395
  exit: result.status,
76337
76396
  startedAt,
76338
76397
  finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -76893,7 +76952,11 @@ async function runLocalDelivery(context, input, beforeDeliver) {
76893
76952
  journal.landedAt ??= (/* @__PURE__ */ new Date()).toISOString();
76894
76953
  save2(context, journal);
76895
76954
  const delivered = context.delivery.deliver(journal.prepared);
76896
- if (!delivered.ok) throw new Error(`${delivered.reason}: ${delivered.message}`);
76955
+ if (!delivered.ok) {
76956
+ journal.failure = `${delivered.reason}: ${delivered.message}`;
76957
+ save2(context, journal);
76958
+ throw new Error(journal.failure);
76959
+ }
76897
76960
  refMoved = delivered.moved;
76898
76961
  if (!delivered.moved || delivered.from !== journal.prepared.targetSha || delivered.to !== input.sha || delivered.ref !== journal.prepared.ref) {
76899
76962
  throw new Error("Niezgodny wynik deliver");
@@ -76904,6 +76967,7 @@ async function runLocalDelivery(context, input, beforeDeliver) {
76904
76967
  if (!targetContains(context, journal)) throw new Error("Drift po CAS");
76905
76968
  refMoved = true;
76906
76969
  journal.phase = "ref-moved";
76970
+ delete journal.failure;
76907
76971
  save2(context, journal);
76908
76972
  }
76909
76973
  validateTree(context, journal);
@@ -77052,15 +77116,21 @@ function localTesterContract(card, value) {
77052
77116
  return input;
77053
77117
  }
77054
77118
  function safety(context) {
77119
+ let bytes;
77120
+ try {
77121
+ bytes = (0, import_node_fs22.readFileSync)(context.safetyPath);
77122
+ } catch (cause) {
77123
+ if (record9(cause).code === "ENOENT") throw new TesterSafetyError("tester-safety-missing", cause);
77124
+ throw new Error(`Zas\xF3b bezpiecze\u0144stwa ${context.safetyPath}: ${String(cause)}`, { cause });
77125
+ }
77055
77126
  try {
77056
- const bytes = (0, import_node_fs22.readFileSync)(context.safetyPath);
77057
77127
  const patterns = new TextDecoder("utf-8", { fatal: true }).decode(bytes);
77058
77128
  const rules = patterns.split(/\r?\n/).map((line2) => line2.trim()).filter((line2) => line2 && !line2.startsWith("#"));
77059
77129
  if (!rules.length) throw new Error("Pusta lista bezpiecze\u0144stwa");
77060
77130
  rules.forEach((rule) => new RegExp(rule, "mi"));
77061
77131
  return { resource: { version: 1, path: context.safetyPath, sha256: hash5(bytes) }, patterns };
77062
77132
  } catch (cause) {
77063
- throw new Error(`Zas\xF3b bezpiecze\u0144stwa ${context.safetyPath}: ${String(cause)}`, { cause });
77133
+ throw new TesterSafetyError("tester-safety-invalid", cause);
77064
77134
  }
77065
77135
  }
77066
77136
  function journalFor(context, card) {
@@ -77153,7 +77223,7 @@ ${result.failed.command}: ${result.failed.output}
77153
77223
  `;
77154
77224
  return result;
77155
77225
  }
77156
- var import_node_crypto13, import_node_fs22, import_node_path25, import_node_util5, sha2, digest3, text5, absolute, schema, record9, hash5, guard;
77226
+ var import_node_crypto13, import_node_fs22, import_node_path25, import_node_util5, sha2, digest3, text5, absolute, schema, record9, hash5, TesterSafetyError, guard;
77157
77227
  var init_local_tester = __esm({
77158
77228
  "maszynista/local-tester.ts"() {
77159
77229
  "use strict";
@@ -77184,6 +77254,12 @@ var init_local_tester = __esm({
77184
77254
  });
77185
77255
  record9 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
77186
77256
  hash5 = (bytes) => (0, import_node_crypto13.createHash)("sha256").update(bytes).digest("hex");
77257
+ TesterSafetyError = class extends Error {
77258
+ constructor(code, cause) {
77259
+ super(code, { cause });
77260
+ this.code = code;
77261
+ }
77262
+ };
77187
77263
  guard = `const {execFileSync}=require('node:child_process');
77188
77264
  try { const git=a=>execFileSync('git',a,{encoding:'utf8',shell:false}).trim();
77189
77265
  const head=git(['rev-parse','HEAD']), dirty=git(['status','--porcelain','--untracked-files=no']);
@@ -77299,7 +77375,7 @@ function completion(dir, claim, response, timestamp3, stop = "") {
77299
77375
  reason = `U\u017Cycia ${p.events.length}/${p.contract.min}; termin ${p.contract.deadline}; wyzwalacz: nowe zdarzenie lub deadline`;
77300
77376
  } else {
77301
77377
  const raw = record10(response), invocation = record10(raw.invocation), model = text6.parse(invocation.actualModel);
77302
- if (invocation.provider !== "xai" || !/^grok-/.test(model) || invocation.exit !== 0 || invocation.effort !== "none" || !(0, import_node_util6.isDeepStrictEqual)(Object.keys(record10(invocation.modelUsage)), [model]) || !at2.safeParse(invocation.startedAt).success || !at2.safeParse(invocation.finishedAt).success || !Array.isArray(invocation.command)) throw new Error("Brak rzeczywistego wywo\u0142ania Groka");
77378
+ if (invocation.provider !== "xai" || !/^grok-/.test(model) || invocation.exit !== 0 || invocation.effort !== "none" && invocation.effort !== "low" || !(0, import_node_util6.isDeepStrictEqual)(Object.keys(record10(invocation.modelUsage)), [model]) || !at2.safeParse(invocation.startedAt).success || !at2.safeParse(invocation.finishedAt).success || !Array.isArray(invocation.command)) throw new Error("Brak rzeczywistego wywo\u0142ania Groka");
77303
77379
  const results = validateLocalReceiver(raw.output, input);
77304
77380
  if (results.some((r) => r.verdict !== "PASS")) throw new Error(results.map((r) => `${r.index}: ${r.verdict}: ${r.reason}`).join("; "));
77305
77381
  const used = new Set(results.flatMap((r) => r.eventIds)), events = p.events.filter((e) => used.has(e.id));
@@ -78041,16 +78117,54 @@ var init_local_acceptance = __esm({
78041
78117
  }
78042
78118
  });
78043
78119
 
78120
+ // packages/client/src/git-commit.ts
78121
+ function gitCommitOptions(args, cwd, timeout = 5e3) {
78122
+ const configured = (key) => {
78123
+ try {
78124
+ return (0, import_node_child_process9.execFileSync)("git", ["config", "--get", key], { cwd, encoding: "utf8", timeout, stdio: "pipe" }).trim();
78125
+ } catch (error48) {
78126
+ if (error48.status === 1) return "";
78127
+ throw new Error(`Nie mo\u017Cna odczyta\u0107 git ${key}`, { cause: error48 });
78128
+ }
78129
+ };
78130
+ const name3 = configured("user.name"), email4 = configured("user.email");
78131
+ const env = { ...process.env };
78132
+ const complete = [
78133
+ env.GIT_AUTHOR_NAME ?? name3,
78134
+ env.GIT_AUTHOR_EMAIL ?? email4,
78135
+ env.GIT_COMMITTER_NAME ?? name3,
78136
+ env.GIT_COMMITTER_EMAIL ?? email4
78137
+ ].every((value) => value.trim() !== "");
78138
+ if (!complete) {
78139
+ env.GIT_AUTHOR_NAME = env.GIT_COMMITTER_NAME = "robisie";
78140
+ env.GIT_AUTHOR_EMAIL = env.GIT_COMMITTER_EMAIL = "robisie@localhost";
78141
+ }
78142
+ return { args: ["-c", "commit.gpgsign=false", "-c", "tag.gpgsign=false", ...args], env };
78143
+ }
78144
+ var import_node_child_process9;
78145
+ var init_git_commit = __esm({
78146
+ "packages/client/src/git-commit.ts"() {
78147
+ "use strict";
78148
+ import_node_child_process9 = require("node:child_process");
78149
+ }
78150
+ });
78151
+
78044
78152
  // packages/client/src/delivery-local.ts
78045
- function runGit(repo, args, input) {
78046
- const result = (0, import_node_child_process9.spawnSync)("git", args, {
78153
+ function runGit2(repo, args, input) {
78154
+ let options2;
78155
+ try {
78156
+ options2 = args[0] === "notes" && args.includes("add") ? gitCommitOptions(args, repo) : { args, env: process.env };
78157
+ } catch (error48) {
78158
+ return { status: null, stdout: "", stderr: "", error: error48 instanceof Error ? error48 : new Error(String(error48)) };
78159
+ }
78160
+ const result = (0, import_node_child_process10.spawnSync)("git", options2.args, {
78047
78161
  cwd: repo,
78048
78162
  encoding: "utf8",
78049
78163
  input,
78050
78164
  timeout: 6e4,
78051
78165
  maxBuffer: 20 * 1024 * 1024,
78052
78166
  shell: false,
78053
- env: { ...process.env, LC_ALL: "C", GIT_TERMINAL_PROMPT: "0" }
78167
+ env: { ...options2.env, LC_ALL: "C", GIT_TERMINAL_PROMPT: "0" }
78054
78168
  });
78055
78169
  return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "", error: result.error };
78056
78170
  }
@@ -78058,12 +78172,12 @@ function gitText(run) {
78058
78172
  return (run.error?.message ?? (run.stderr.trim() || run.stdout.trim())).slice(0, OUTPUT_LIMIT);
78059
78173
  }
78060
78174
  function resolveCommit(repo, spec) {
78061
- const run = runGit(repo, ["rev-parse", "--verify", "--quiet", "--end-of-options", `${spec}^{commit}`]);
78175
+ const run = runGit2(repo, ["rev-parse", "--verify", "--quiet", "--end-of-options", `${spec}^{commit}`]);
78062
78176
  const sha5 = run.stdout.trim();
78063
78177
  return run.status === 0 && SHA_RE.test(sha5) ? sha5 : void 0;
78064
78178
  }
78065
78179
  function isAncestor2(repo, ancestor3, descendant) {
78066
- const run = runGit(repo, ["merge-base", "--is-ancestor", ancestor3, descendant]);
78180
+ const run = runGit2(repo, ["merge-base", "--is-ancestor", ancestor3, descendant]);
78067
78181
  if (run.status === 0) return true;
78068
78182
  if (run.status === 1) return false;
78069
78183
  return run;
@@ -78077,7 +78191,7 @@ function canonical2(value) {
78077
78191
  }
78078
78192
  function prepare(repo, input) {
78079
78193
  const target = typeof input?.target === "string" ? input.target : "";
78080
- const branch = runGit(repo, ["check-ref-format", "--branch", target]);
78194
+ const branch = runGit2(repo, ["check-ref-format", "--branch", target]);
78081
78195
  if (!target || target.startsWith("-") || branch.status !== 0 || branch.stdout.trim() !== target) {
78082
78196
  return { ok: false, reason: "invalid-target", message: `Nieprawid\u0142owa nazwa ga\u0142\u0119zi celu: ${JSON.stringify(target)}` };
78083
78197
  }
@@ -78090,7 +78204,7 @@ function prepare(repo, input) {
78090
78204
  }
78091
78205
  const taskSha = resolveCommit(repo, requested);
78092
78206
  if (taskSha !== requested) return { ok: false, reason: "invalid-task", message: `Commit zadania ${requested} nie istnieje w repozytorium.` };
78093
- const merge3 = runGit(repo, ["merge-tree", "--write-tree", "--name-only", "--no-messages", targetSha2, taskSha]);
78207
+ const merge3 = runGit2(repo, ["merge-tree", "--write-tree", "--name-only", "--no-messages", targetSha2, taskSha]);
78094
78208
  const lines2 = merge3.stdout.split("\n").filter(Boolean);
78095
78209
  const tree = lines2[0] ?? "";
78096
78210
  if (merge3.status === 1 && SHA_RE.test(tree)) {
@@ -78123,7 +78237,7 @@ function check4(repo, prepared, commands, options2 = {}) {
78123
78237
  return { ok: false, reason: "error", message: `Nie uda\u0142o si\u0119 utworzy\u0107 katalogu tymczasowego: ${error48 instanceof Error ? error48.message : String(error48)}`, results };
78124
78238
  }
78125
78239
  const worktree = (0, import_node_path28.join)(tmp, "wt");
78126
- const add2 = runGit(repo, ["worktree", "add", "--detach", "--quiet", worktree, prepared.taskSha]);
78240
+ const add2 = runGit2(repo, ["worktree", "add", "--detach", "--quiet", worktree, prepared.taskSha]);
78127
78241
  if (add2.status !== 0 || add2.error) {
78128
78242
  const outcome2 = { ok: false, reason: "error", message: `git worktree add nie powiod\u0142o si\u0119: ${gitText(add2)}`, results };
78129
78243
  return withCleanup(outcome2, removeWorktree(repo, tmp, worktree, false), tmp, worktree);
@@ -78139,14 +78253,14 @@ function check4(repo, prepared, commands, options2 = {}) {
78139
78253
  }
78140
78254
  function removeWorktree(repo, tmp, worktree, added) {
78141
78255
  const failed2 = [];
78142
- const remove = runGit(repo, ["worktree", "remove", "--force", worktree]);
78256
+ const remove = runGit2(repo, ["worktree", "remove", "--force", worktree]);
78143
78257
  if (added && (remove.status !== 0 || remove.error)) failed2.push({ step: "worktree-remove", message: gitText(remove) || `status=${remove.status}` });
78144
78258
  try {
78145
78259
  (0, import_node_fs25.rmSync)(tmp, { recursive: true, force: true });
78146
78260
  } catch (error48) {
78147
78261
  failed2.push({ step: "rm-tmp", message: error48 instanceof Error ? error48.message : String(error48) });
78148
78262
  }
78149
- const prune = runGit(repo, ["worktree", "prune"]);
78263
+ const prune = runGit2(repo, ["worktree", "prune"]);
78150
78264
  if (prune.status !== 0 || prune.error) failed2.push({ step: "worktree-prune", message: gitText(prune) || `status=${prune.status}` });
78151
78265
  return failed2;
78152
78266
  }
@@ -78168,7 +78282,7 @@ function runChecks(cwd, commands, timeoutMs, results) {
78168
78282
  if (!command) {
78169
78283
  return { ok: false, reason: "check-failed", message: "Pusta komenda sprawdzenia.", results };
78170
78284
  }
78171
- const run = (0, import_node_child_process9.spawnSync)(command, args, { cwd, encoding: "utf8", shell: false, timeout: timeoutMs, maxBuffer: 20 * 1024 * 1024 });
78285
+ const run = (0, import_node_child_process10.spawnSync)(command, args, { cwd, encoding: "utf8", shell: false, timeout: timeoutMs, maxBuffer: 20 * 1024 * 1024 });
78172
78286
  const output = `${run.stdout ?? ""}${run.stderr ?? ""}${run.error ? run.error.message : ""}`.slice(-OUTPUT_LIMIT);
78173
78287
  const outcome = { command, args, status: run.status, signal: run.signal, output };
78174
78288
  results.push(outcome);
@@ -78179,7 +78293,7 @@ function runChecks(cwd, commands, timeoutMs, results) {
78179
78293
  return { ok: true, results };
78180
78294
  }
78181
78295
  function checkedOutIn(repo, ref) {
78182
- const list2 = runGit(repo, ["worktree", "list", "--porcelain", "-z"]);
78296
+ const list2 = runGit2(repo, ["worktree", "list", "--porcelain", "-z"]);
78183
78297
  if (list2.status !== 0) return list2;
78184
78298
  let path34;
78185
78299
  for (const field of list2.stdout.split("\0")) {
@@ -78203,7 +78317,7 @@ function deliver(repo, prepared) {
78203
78317
  if (!forward || prepared.mode !== "fast-forward") {
78204
78318
  return { ok: false, reason: "not-fast-forward", message: `Odmowa: ${taskSha} nie jest fast-forwardem ${prepared.target} (${targetSha2}). Zaktualizuj ga\u0142\u0105\u017A zadania o cel i powt\xF3rz.` };
78205
78319
  }
78206
- const symbolic = runGit(repo, ["symbolic-ref", "-q", ref]);
78320
+ const symbolic = runGit2(repo, ["symbolic-ref", "-q", ref]);
78207
78321
  if (symbolic.status === 0 && !symbolic.error) {
78208
78322
  return { ok: false, reason: "target-is-symbolic-ref", message: `Odmowa: ${prepared.target} jest aliasem (symbolic ref) do ${symbolic.stdout.trim()}; dostarcz do ga\u0142\u0119zi docelowej wprost.` };
78209
78323
  }
@@ -78211,9 +78325,21 @@ function deliver(repo, prepared) {
78211
78325
  const worktree = checkedOutIn(repo, ref);
78212
78326
  if (typeof worktree === "object") return { ok: false, reason: "error", message: `git worktree list nie powiod\u0142o si\u0119: ${gitText(worktree)}` };
78213
78327
  if (worktree !== void 0) {
78214
- return { ok: false, reason: "target-checked-out", message: `Odmowa: ga\u0142\u0105\u017A ${prepared.target} jest wyewidencjonowana w ${worktree}; przesuni\u0119cie refa rozjecha\u0142oby jej drzewo robocze.` };
78328
+ const before = resolveCommit(repo, ref);
78329
+ if (before !== targetSha2) {
78330
+ 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.` };
78331
+ }
78332
+ const merge3 = runGit2(worktree, ["-c", `core.hooksPath=${import_node_os6.devNull}`, "merge", "--ff-only", "--no-autostash", "--no-overwrite-ignore", taskSha]);
78333
+ const after2 = resolveCommit(repo, ref);
78334
+ if (after2 === taskSha) return { ok: true, moved: true, ref, from: targetSha2, to: taskSha };
78335
+ if (after2 === targetSha2) {
78336
+ const diagnostic = gitText(merge3).replace(/\n(?:Please commit\b|Another git process seems to be running in this repository, e\.g\.)[\s\S]*$/, "").trim();
78337
+ return { ok: false, reason: "target-checked-out", message: `Odmowa FF w ${worktree}: ${diagnostic}
78338
+ Od\u0142\xF3\u017C zmiany (git stash) albo cofnij je i pon\xF3w dostaw\u0119.` };
78339
+ }
78340
+ return { ok: false, reason: "target-moved", message: `Odmowa: ${prepared.target} po pr\xF3bie FF wskazuje ${after2 ?? "(brak)"} zamiast ${taskSha}; sprawd\u017A stan repozytorium.` };
78215
78341
  }
78216
- const update = runGit(repo, ["update-ref", "--no-deref", "-m", `robisie: dostawa local-ff ${taskSha}`, ref, taskSha, targetSha2]);
78342
+ const update = runGit2(repo, ["update-ref", "--no-deref", "-m", `robisie: dostawa local-ff ${taskSha}`, ref, taskSha, targetSha2]);
78217
78343
  if (update.status !== 0) {
78218
78344
  const now = resolveCommit(repo, ref);
78219
78345
  if (now !== targetSha2) {
@@ -78235,24 +78361,24 @@ function attachEvidence(repo, sha5, kind, evidence2) {
78235
78361
  }
78236
78362
  if (line2 === void 0) return { ok: false, reason: "error", message: "Dow\xF3d nie jest serializowalny do JSON." };
78237
78363
  const ref = `refs/notes/robisie/${kind}`;
78238
- const strategy = runGit(repo, ["config", `notes.robisie/${kind}.mergeStrategy`, "cat_sort_uniq"]);
78364
+ const strategy = runGit2(repo, ["config", `notes.robisie/${kind}.mergeStrategy`, "cat_sort_uniq"]);
78239
78365
  if (strategy.status !== 0) return { ok: false, reason: "error", message: `Ustawienie notes mergeStrategy nie powiod\u0142o si\u0119: ${gitText(strategy)}` };
78240
78366
  const existing = readEvidenceLines(repo, kind, sha5);
78241
78367
  if (!Array.isArray(existing)) return existing;
78242
78368
  if (existing.includes(line2)) return { ok: true, ref, sha: sha5, written: false };
78243
78369
  const body = [.../* @__PURE__ */ new Set([...existing, line2])].sort().join("\n") + "\n";
78244
- const write = runGit(repo, ["notes", `--ref=${ref}`, "add", "-f", "-F", "-", sha5], body);
78370
+ const write = runGit2(repo, ["notes", `--ref=${ref}`, "add", "-f", "-F", "-", sha5], body);
78245
78371
  if (write.status !== 0) return { ok: false, reason: "error", message: `git notes add nie powiod\u0142o si\u0119: ${gitText(write)}` };
78246
78372
  return { ok: true, ref, sha: sha5, written: true };
78247
78373
  }
78248
78374
  function readEvidenceLines(repo, kind, sha5) {
78249
78375
  const ref = `refs/notes/robisie/${kind}`;
78250
- const exists2 = runGit(repo, ["rev-parse", "--verify", "--quiet", ref]);
78376
+ const exists2 = runGit2(repo, ["rev-parse", "--verify", "--quiet", ref]);
78251
78377
  if (exists2.status === 1 && !exists2.error && !exists2.stderr.trim()) return [];
78252
78378
  if (exists2.status !== 0 || exists2.error) {
78253
78379
  return { ok: false, reason: "evidence-read-failed", message: `Odczyt ${ref} nie powi\xF3d\u0142 si\u0119: ${gitText(exists2) || `status=${exists2.status}`}` };
78254
78380
  }
78255
- const show = runGit(repo, ["notes", `--ref=${ref}`, "show", sha5]);
78381
+ const show = runGit2(repo, ["notes", `--ref=${ref}`, "show", sha5]);
78256
78382
  if (show.status === 0 && !show.error) return show.stdout.split("\n").filter(Boolean);
78257
78383
  if (show.status === 1 && !show.error && /^error: no note found for object [0-9a-f]+\.?$/.test(show.stderr.trim())) return [];
78258
78384
  return { ok: false, reason: "evidence-read-failed", message: `git notes show nie powiod\u0142o si\u0119: ${gitText(show) || `status=${show.status}`}` };
@@ -78279,14 +78405,15 @@ function createLocalFfDelivery(repo) {
78279
78405
  attachEvidence: (sha5, kind, evidence2) => attachEvidence(repo, sha5, kind, evidence2)
78280
78406
  };
78281
78407
  }
78282
- var import_node_child_process9, import_node_fs25, import_node_os6, import_node_path28, EVIDENCE_KINDS, DEFAULT_DELIVERY_ADAPTER, SHA_RE, OUTPUT_LIMIT;
78408
+ var import_node_child_process10, import_node_fs25, import_node_os6, import_node_path28, EVIDENCE_KINDS, DEFAULT_DELIVERY_ADAPTER, SHA_RE, OUTPUT_LIMIT;
78283
78409
  var init_delivery_local = __esm({
78284
78410
  "packages/client/src/delivery-local.ts"() {
78285
78411
  "use strict";
78286
- import_node_child_process9 = require("node:child_process");
78412
+ import_node_child_process10 = require("node:child_process");
78287
78413
  import_node_fs25 = require("node:fs");
78288
78414
  import_node_os6 = require("node:os");
78289
78415
  import_node_path28 = require("node:path");
78416
+ init_git_commit();
78290
78417
  EVIDENCE_KINDS = ["review", "test", "deliver"];
78291
78418
  DEFAULT_DELIVERY_ADAPTER = "local-ff";
78292
78419
  SHA_RE = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/;
@@ -79006,7 +79133,7 @@ function askClaude(prompt2) {
79006
79133
  return new Promise((resolve7, reject) => {
79007
79134
  const args = headlessClaudeArgs(MODEL);
79008
79135
  const user = process.env.USER ?? import_node_os7.default.userInfo().username;
79009
- const child = (0, import_node_child_process10.spawn)("claude", args, {
79136
+ const child = (0, import_node_child_process11.spawn)("claude", args, {
79010
79137
  cwd: REPO,
79011
79138
  stdio: ["pipe", "pipe", "pipe"],
79012
79139
  env: { ...process.env, ...HEADLESS_CLAUDE_ENV, ANTHROPIC_API_KEY: void 0, USER: user, LOGNAME: process.env.LOGNAME ?? user }
@@ -79097,7 +79224,7 @@ async function main() {
79097
79224
  }
79098
79225
  let trackedFiles = null;
79099
79226
  try {
79100
- trackedFiles = (0, import_node_child_process10.execFileSync)("git", ["ls-files", "-z"], { cwd: REPO, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }).split("\0").filter(Boolean);
79227
+ trackedFiles = (0, import_node_child_process11.execFileSync)("git", ["ls-files", "-z"], { cwd: REPO, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 }).split("\0").filter(Boolean);
79101
79228
  } catch (error49) {
79102
79229
  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
79230
  }
@@ -79208,12 +79335,12 @@ async function main() {
79208
79335
  }
79209
79336
  }
79210
79337
  }
79211
- var import_node_fs30, import_node_child_process10, 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;
79338
+ 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
79339
  var init_select3 = __esm({
79213
79340
  "maszynista/select.ts"() {
79214
79341
  "use strict";
79215
79342
  import_node_fs30 = require("node:fs");
79216
- import_node_child_process10 = require("node:child_process");
79343
+ import_node_child_process11 = require("node:child_process");
79217
79344
  import_node_os7 = __toESM(require("node:os"));
79218
79345
  import_node_path31 = __toESM(require("node:path"));
79219
79346
  init_queries();
@@ -87188,7 +87315,7 @@ function parseBuzzAdminMembers(output) {
87188
87315
  }
87189
87316
  function runRosterCommand(command, args) {
87190
87317
  return new Promise((resolve7, reject) => {
87191
- (0, import_node_child_process11.execFile)(command, args, { encoding: "utf8" }, (error48, stdout) => {
87318
+ (0, import_node_child_process12.execFile)(command, args, { encoding: "utf8" }, (error48, stdout) => {
87192
87319
  if (error48) reject(error48);
87193
87320
  else resolve7(stdout);
87194
87321
  });
@@ -87234,11 +87361,11 @@ async function loadDatabaseSync() {
87234
87361
  throw new BuzzToolError("Buzz requires Node 22 or newer with node:sqlite available");
87235
87362
  }
87236
87363
  }
87237
- var import_node_child_process11, import_promises2, import_node_module, import_node_os8, import_node_path32, PAGE_EOSE_DEADLINE_MS, ZERO_EVENT_ID, BuzzToolError, RelayWebSocket, SeenStore, BuzzBridge;
87364
+ 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
87365
  var init_bridge = __esm({
87239
87366
  "services/buzz-mcp/src/bridge.ts"() {
87240
87367
  "use strict";
87241
- import_node_child_process11 = require("node:child_process");
87368
+ import_node_child_process12 = require("node:child_process");
87242
87369
  import_promises2 = require("node:fs/promises");
87243
87370
  import_node_module = require("node:module");
87244
87371
  import_node_os8 = require("node:os");
@@ -88946,7 +89073,7 @@ async function processAgent(message3, store, errorPath, dependencies) {
88946
89073
  try {
88947
89074
  const err = await (0, import_promises3.open)(`${output}.stderr`, "wx", 384);
88948
89075
  try {
88949
- const child = (0, import_node_child_process12.spawn)(route.executable, [
89076
+ const child = (0, import_node_child_process13.spawn)(route.executable, [
88950
89077
  ...route.argv,
88951
89078
  "exec",
88952
89079
  "--json",
@@ -89016,7 +89143,7 @@ async function processAgent(message3, store, errorPath, dependencies) {
89016
89143
  }
89017
89144
  }
89018
89145
  }
89019
- var import_node_fs32, import_promises3, import_node_path34, import_node_crypto22, import_node_child_process12, import_node_os9, AGENT_INSTRUCTIONS, hash8, AGENT_DEADLINE_MS, AGENT_RECORD_RESOLUTION;
89146
+ 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
89147
  var init_agent_route = __esm({
89021
89148
  "services/buzz-wake/agent-route.ts"() {
89022
89149
  "use strict";
@@ -89024,7 +89151,7 @@ var init_agent_route = __esm({
89024
89151
  import_promises3 = require("node:fs/promises");
89025
89152
  import_node_path34 = require("node:path");
89026
89153
  import_node_crypto22 = require("node:crypto");
89027
- import_node_child_process12 = require("node:child_process");
89154
+ import_node_child_process13 = require("node:child_process");
89028
89155
  import_node_os9 = require("node:os");
89029
89156
  init_delivery();
89030
89157
  init_store();
@@ -89639,7 +89766,7 @@ function publishedRoute(source, role3) {
89639
89766
  }
89640
89767
  function probeCrProcess(pid) {
89641
89768
  return new Promise((resolve7) => {
89642
- (0, import_node_child_process13.execFile)(
89769
+ (0, import_node_child_process14.execFile)(
89643
89770
  "ps",
89644
89771
  ["-p", String(pid), "-o", "lstart=,pid=,args="],
89645
89772
  { encoding: "utf8", timeout: 5e3, maxBuffer: 64 * 1024, env: { ...process.env, LC_ALL: "C" } },
@@ -89811,12 +89938,12 @@ async function dispatchWake(message3, dependencies) {
89811
89938
  const result = await dependencies.run(dependencies.guardedSendBin, ["--modal-guard", ...role3 === "hermes" ? ["--hermes-safe"] : [], ...mode.mode === "steer" ? ["--steer"] : [], "--surface-id", matches2[0].id, panelNotice]);
89812
89939
  return { rc: result.rc, stderr: result.stderr };
89813
89940
  }
89814
- var import_promises4, import_node_child_process13, import_node_os10, import_node_sqlite2, import_node_path35, SAFE_DIAGNOSTIC_CATEGORY, refusalBridge, GBOT_READ_INTERVAL_MS, UUID, ROLE3, CR_RUNTIME_CWD;
89941
+ 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
89942
  var init_delivery = __esm({
89816
89943
  "services/buzz-wake/delivery.ts"() {
89817
89944
  "use strict";
89818
89945
  import_promises4 = require("node:fs/promises");
89819
- import_node_child_process13 = require("node:child_process");
89946
+ import_node_child_process14 = require("node:child_process");
89820
89947
  import_node_os10 = require("node:os");
89821
89948
  import_node_sqlite2 = require("node:sqlite");
89822
89949
  init_lib();
@@ -89834,7 +89961,7 @@ var init_delivery = __esm({
89834
89961
 
89835
89962
  // maszynista/enabled-auto.ts
89836
89963
  function processRun(file3, args, cwd, timeoutMs = 1e4) {
89837
- const result = (0, import_node_child_process14.spawnSync)(file3, args, { cwd, encoding: "utf8", timeout: Math.min(1e4, timeoutMs), maxBuffer: 1024 * 1024, shell: false, env: { ...process.env, LC_ALL: "C" } });
89964
+ 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
89965
  if (result.error || result.signal || result.status === null) throw new Error(`${file3}: ${result.error?.message ?? result.signal ?? "UNKNOWN status"}`);
89839
89966
  return { status: result.status, stdout: result.stdout ?? "", stderr: result.stderr ?? "" };
89840
89967
  }
@@ -90151,12 +90278,12 @@ async function runEnabledAuto(input, deps) {
90151
90278
  }
90152
90279
  }
90153
90280
  }
90154
- var import_node_crypto23, import_node_child_process14, import_node_fs33, import_node_path36, SHA2, SERVICE_ALLOWLIST, LOG_ALLOWLIST, ENABLED_CHECKS, MAX_TAIL;
90281
+ var import_node_crypto23, import_node_child_process15, import_node_fs33, import_node_path36, SHA2, SERVICE_ALLOWLIST, LOG_ALLOWLIST, ENABLED_CHECKS, MAX_TAIL;
90155
90282
  var init_enabled_auto = __esm({
90156
90283
  "maszynista/enabled-auto.ts"() {
90157
90284
  "use strict";
90158
90285
  import_node_crypto23 = require("node:crypto");
90159
- import_node_child_process14 = require("node:child_process");
90286
+ import_node_child_process15 = require("node:child_process");
90160
90287
  import_node_fs33 = require("node:fs");
90161
90288
  import_node_path36 = __toESM(require("node:path"));
90162
90289
  init_host_activation();
@@ -90560,7 +90687,7 @@ function startWorker(input, deps = {}) {
90560
90687
  `${PROVIDER}/${input.selection.model}`
90561
90688
  ];
90562
90689
  try {
90563
- const spawnDetached = deps.spawn ?? ((executable, args, options2) => (0, import_node_child_process15.spawn)(executable, [...args], options2));
90690
+ const spawnDetached = deps.spawn ?? ((executable, args, options2) => (0, import_node_child_process16.spawn)(executable, [...args], options2));
90564
90691
  const child = spawnDetached(process.execPath, command, { cwd: input.cwd, detached: true, stdio: "ignore", env: input.env });
90565
90692
  child.once?.("error", (error48) => {
90566
90693
  try {
@@ -90706,7 +90833,7 @@ function openCodeGroupAlive(job, deps) {
90706
90833
  }
90707
90834
  function defaultVerifyPid(pid, job) {
90708
90835
  try {
90709
- const command = (0, import_node_child_process15.execFileSync)("ps", ["-ww", "-p", String(pid), "-o", "pgid=,command="], {
90836
+ const command = (0, import_node_child_process16.execFileSync)("ps", ["-ww", "-p", String(pid), "-o", "pgid=,command="], {
90710
90837
  encoding: "utf8",
90711
90838
  timeout: 5e3,
90712
90839
  maxBuffer: 1024 * 1024
@@ -90960,7 +91087,7 @@ async function runOpenCodeRunner(argv) {
90960
91087
  const prompt2 = (0, import_node_fs35.readFileSync)(promptPath, "utf8");
90961
91088
  stdoutFd = (0, import_node_fs35.openSync)(stdoutPath, "a");
90962
91089
  stderrFd = (0, import_node_fs35.openSync)(stderrPath, "a");
90963
- const child = (0, import_node_child_process15.spawn)(binary, args, { cwd, stdio: ["pipe", stdoutFd, stderrFd] });
91090
+ const child = (0, import_node_child_process16.spawn)(binary, args, { cwd, stdio: ["pipe", stdoutFd, stderrFd] });
90964
91091
  let stoppingSignal = null;
90965
91092
  process.once("SIGTERM", () => {
90966
91093
  stoppingSignal = "SIGTERM";
@@ -91028,11 +91155,11 @@ async function runOpenCodeRunner(argv) {
91028
91155
  }
91029
91156
  }
91030
91157
  }
91031
- var import_node_child_process15, 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;
91158
+ 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
91159
  var init_worker_backend = __esm({
91033
91160
  "maszynista/worker-backend.ts"() {
91034
91161
  "use strict";
91035
- import_node_child_process15 = require("node:child_process");
91162
+ import_node_child_process16 = require("node:child_process");
91036
91163
  import_node_fs35 = require("node:fs");
91037
91164
  import_node_crypto24 = require("node:crypto");
91038
91165
  import_node_path38 = __toESM(require("node:path"));
@@ -91494,7 +91621,7 @@ function lunaPrompt(input) {
91494
91621
  };
91495
91622
  const git2 = (args) => {
91496
91623
  try {
91497
- return text7((0, import_node_child_process16.execFileSync)("git", args, {
91624
+ return text7((0, import_node_child_process17.execFileSync)("git", args, {
91498
91625
  cwd: input.worktree,
91499
91626
  encoding: "utf8",
91500
91627
  timeout: 6e4,
@@ -91513,7 +91640,7 @@ function lunaPrompt(input) {
91513
91640
  const paths = git2(["diff", "--no-ext-diff", "--no-textconv", "--name-only", "-z", range, "--"]).split("\0").filter(Boolean);
91514
91641
  let diff;
91515
91642
  try {
91516
- diff = text7((0, import_node_child_process16.execFileSync)("git", ["diff", "--no-ext-diff", "--no-textconv", "--binary", range, "--"], {
91643
+ diff = text7((0, import_node_child_process17.execFileSync)("git", ["diff", "--no-ext-diff", "--no-textconv", "--binary", range, "--"], {
91517
91644
  cwd: input.worktree,
91518
91645
  encoding: "utf8",
91519
91646
  timeout: 6e4,
@@ -91539,7 +91666,7 @@ function cannotReview(answer) {
91539
91666
  }
91540
91667
  function candidateDrift(input) {
91541
91668
  try {
91542
- const git2 = (args) => text7((0, import_node_child_process16.execFileSync)("git", args, {
91669
+ const git2 = (args) => text7((0, import_node_child_process17.execFileSync)("git", args, {
91543
91670
  cwd: input.worktree,
91544
91671
  encoding: "utf8",
91545
91672
  timeout: 6e4,
@@ -91554,7 +91681,7 @@ function candidateDrift(input) {
91554
91681
  }
91555
91682
  function grokPrompt(input, clientBaseSha) {
91556
91683
  try {
91557
- const git2 = (args) => text7((0, import_node_child_process16.execFileSync)("git", args, {
91684
+ const git2 = (args) => text7((0, import_node_child_process17.execFileSync)("git", args, {
91558
91685
  cwd: input.worktree,
91559
91686
  encoding: "utf8",
91560
91687
  timeout: 6e4,
@@ -91580,7 +91707,7 @@ function grokPrompt(input, clientBaseSha) {
91580
91707
  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
91708
  const fullPaths = [.../* @__PURE__ */ new Set([...files2, ...changed])].filter((file3) => !excerptPaths.includes(file3));
91582
91709
  const sources = files2.map((file3) => {
91583
- const bytes = (0, import_node_child_process16.execFileSync)("git", ["show", `${input.sha}:${file3}`], {
91710
+ const bytes = (0, import_node_child_process17.execFileSync)("git", ["show", `${input.sha}:${file3}`], {
91584
91711
  cwd: input.worktree,
91585
91712
  timeout: 6e4,
91586
91713
  maxBuffer: MAX_BUFFER_BYTES,
@@ -91893,7 +92020,7 @@ function runReview(input) {
91893
92020
  let rawOutput = "";
91894
92021
  let rawExport = "";
91895
92022
  try {
91896
- const result = (0, import_node_child_process16.spawnSync)(bin, args, {
92023
+ const result = (0, import_node_child_process17.spawnSync)(bin, args, {
91897
92024
  cwd,
91898
92025
  input: bin === "opencode" || bin === "claude" ? prompt2 : void 0,
91899
92026
  encoding: "utf8",
@@ -92083,12 +92210,12 @@ function runCli(inputPath) {
92083
92210
  process.exitCode = 1;
92084
92211
  }
92085
92212
  }
92086
- var import_node_child_process16, 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;
92213
+ 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
92214
  var init_review_job = __esm({
92088
92215
  "maszynista/review-job.ts"() {
92089
92216
  "use strict";
92090
92217
  init_client_pair();
92091
- import_node_child_process16 = require("node:child_process");
92218
+ import_node_child_process17 = require("node:child_process");
92092
92219
  import_node_crypto26 = require("node:crypto");
92093
92220
  import_node_fs38 = require("node:fs");
92094
92221
  import_node_path41 = __toESM(require("node:path"));
@@ -92506,7 +92633,7 @@ async function startTesterJob(dir, input, entry2 = import_node_path43.default.jo
92506
92633
  const fd = (0, import_node_fs39.openSync)(import_node_path43.default.join(dir, `.tester-job.${id2}.log`), "wx", 384);
92507
92634
  try {
92508
92635
  await new Promise((resolve7, reject) => {
92509
- const child = (0, import_node_child_process17.spawn)(process.execPath, engineJobArgv(__filename, "tester", f.input, entry2), {
92636
+ const child = (0, import_node_child_process18.spawn)(process.execPath, engineJobArgv(__filename, "tester", f.input, entry2), {
92510
92637
  cwd: import_node_path43.default.resolve(__dirname, ".."),
92511
92638
  env: { ...env ?? process.env, MASZYNISTA_DIR: dir },
92512
92639
  detached: true,
@@ -92573,7 +92700,7 @@ async function runTesterJob(inputFile, run) {
92573
92700
  const { createLocalTesterContext: createLocalTesterContext2 } = await Promise.resolve().then(() => (init_engine_context(), engine_context_exports));
92574
92701
  return executeLocalTester(createLocalTesterContext2(
92575
92702
  currentEngine2(),
92576
- (args, cwd) => (0, import_node_child_process17.execFileSync)("git", args, { cwd, encoding: "utf8", shell: false }).trim()
92703
+ (args, cwd) => (0, import_node_child_process18.execFileSync)("git", args, { cwd, encoding: "utf8", shell: false }).trim()
92577
92704
  ), p.input.card, p.input.local, p.input.runtime);
92578
92705
  };
92579
92706
  const result = run ? await run(p.input) : await execute();
@@ -92601,12 +92728,12 @@ async function runTesterJob(inputFile, run) {
92601
92728
  if (record16(readJson3(f.lock)).id !== p.id) throw new Error("Tester straci\u0142 lock przed zapisem wyniku");
92602
92729
  atomic3(f.result, completion2);
92603
92730
  }
92604
- var import_node_fs39, import_node_child_process17, import_node_crypto28, import_node_util10, import_node_path43, files, record16, local;
92731
+ var import_node_fs39, import_node_child_process18, import_node_crypto28, import_node_util10, import_node_path43, files, record16, local;
92605
92732
  var init_tester_job = __esm({
92606
92733
  "maszynista/tester-job.ts"() {
92607
92734
  "use strict";
92608
92735
  import_node_fs39 = require("node:fs");
92609
- import_node_child_process17 = require("node:child_process");
92736
+ import_node_child_process18 = require("node:child_process");
92610
92737
  import_node_crypto28 = require("node:crypto");
92611
92738
  import_node_util10 = require("node:util");
92612
92739
  import_node_path43 = __toESM(require("node:path"));
@@ -314257,6 +314384,7 @@ __export2(tick_exports, {
314257
314384
  TESTER_RETEST_MAX_ERRORS: () => TESTER_RETEST_MAX_ERRORS,
314258
314385
  actionableBlockerHold: () => actionableBlockerHold,
314259
314386
  armTickDeadline: () => armTickDeadline,
314387
+ autoCommitWorker: () => autoCommitWorker,
314260
314388
  cleanupRecoverableDiskArtifacts: () => cleanupRecoverableDiskArtifacts,
314261
314389
  configureSparseCheckout: () => configureSparseCheckout,
314262
314390
  consumeActive: () => consumeActive,
@@ -314289,10 +314417,12 @@ __export2(tick_exports, {
314289
314417
  northStarRecovered: () => northStarRecovered,
314290
314418
  notifyLandingHold: () => notifyLandingHold,
314291
314419
  obligationPhase: () => obligationPhase,
314420
+ parseHostBootAt: () => parseHostBootAt,
314292
314421
  parseUnblockGiB: () => parseUnblockGiB,
314293
314422
  processWip: () => processWip,
314294
314423
  promotionPhase: () => promotionPhase,
314295
314424
  queueForReksio: () => queueForReksio,
314425
+ readHostBootAt: () => readHostBootAt,
314296
314426
  readRecentBuzzEvents: () => readRecentBuzzEvents,
314297
314427
  readyTaskPatch: () => readyTaskPatch,
314298
314428
  reconcileBoardActives: () => reconcileBoardActives,
@@ -314537,7 +314667,7 @@ function taskInputHash(card, effort) {
314537
314667
  return (0, import_node_crypto31.createHash)("sha256").update(JSON.stringify([taskBriefHash(brief2), effort, card.details?.codex_model ?? null])).digest("hex");
314538
314668
  }
314539
314669
  function defaultNpmCacheCleanup() {
314540
- const result = (0, import_node_child_process18.spawnSync)("npm", ["cache", "clean", "--force"], { cwd: REPO, encoding: "utf8", timeout: remainingTickMs(12e4) });
314670
+ const result = (0, import_node_child_process19.spawnSync)("npm", ["cache", "clean", "--force"], { cwd: REPO, encoding: "utf8", timeout: remainingTickMs(12e4) });
314541
314671
  if (result.error) throw result.error;
314542
314672
  if (result.status !== 0) throw new Error(`npm cache clean zako\u0144czony kodem ${String(result.status)}: ${String(result.stderr ?? "").trim()}`);
314543
314673
  }
@@ -314607,7 +314737,7 @@ function cleanupRecoverableDiskArtifacts(repo = TASK_REPO, nowMs = Date.now(), c
314607
314737
  return { removed, skippedYoung, errors };
314608
314738
  }
314609
314739
  function runWakeCommand(file3, args) {
314610
- const result = (0, import_node_child_process18.spawnSync)(file3, [...args], { encoding: "utf8", timeout: remainingTickMs(3e4), env: hostEnv(), maxBuffer: 20 * 1024 * 1024 });
314740
+ const result = (0, import_node_child_process19.spawnSync)(file3, [...args], { encoding: "utf8", timeout: remainingTickMs(3e4), env: hostEnv(), maxBuffer: 20 * 1024 * 1024 });
314611
314741
  return Promise.resolve({
314612
314742
  rc: result.error ? 1 : result.status ?? 1,
314613
314743
  stdout: String(result.stdout ?? ""),
@@ -314847,7 +314977,7 @@ async function handleDiskPressure(state, phase, dependencies = defaultDiskPressu
314847
314977
  function shutdownCodexBroker(worktree) {
314848
314978
  try {
314849
314979
  if (!shouldRunLifecycleHook(CODEX_LIFECYCLE_HOOK, import_node_fs47.existsSync)) return;
314850
- (0, import_node_child_process18.spawnSync)("node", [CODEX_LIFECYCLE_HOOK, "SessionEnd"], {
314980
+ (0, import_node_child_process19.spawnSync)("node", [CODEX_LIFECYCLE_HOOK, "SessionEnd"], {
314851
314981
  cwd: worktree,
314852
314982
  encoding: "utf-8",
314853
314983
  timeout: remainingTickMs(3e4),
@@ -315033,20 +315163,21 @@ Status na tablicy: blocked (czeka na Ciebie). ${unlock}
315033
315163
  throw new Error(`Dopisanie ${DECISIONS} nieudane: ${errorText5(error48)}`);
315034
315164
  }
315035
315165
  }
315036
- function git(args, cwd = TASK_REPO, timeoutMs = 6e4) {
315037
- const output = (0, import_node_child_process18.execFileSync)("git", args, {
315166
+ function git(args, cwd = TASK_REPO, timeoutMs = 6e4, createsCommit = false) {
315167
+ const options2 = createsCommit ? gitCommitOptions(args, cwd, remainingTickMs(5e3)) : { args, env: process.env };
315168
+ const output = (0, import_node_child_process19.execFileSync)("git", options2.args, {
315038
315169
  cwd,
315039
315170
  encoding: "utf-8",
315040
315171
  timeout: remainingTickMs(timeoutMs),
315041
315172
  maxBuffer: 20 * 1024 * 1024,
315042
- env: { ...process.env, GIT_OPTIONAL_LOCKS: "0" }
315173
+ env: { ...options2.env, GIT_OPTIONAL_LOCKS: "0" }
315043
315174
  });
315044
315175
  return args.includes("-z") ? output : output.trim();
315045
315176
  }
315046
315177
  function autoCommitWorker(a) {
315047
315178
  if (!git(["status", "--porcelain", "--", ".", REVIEW_JOB_EXCLUDE], a.worktree)) return;
315048
315179
  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);
315180
+ git(["-c", "core.hooksPath=/dev/null", "commit", "-m", `maszynista: praca workera ${a.jobId} (auto-commit)`], a.worktree, 12e4, true);
315050
315181
  }
315051
315182
  function clearDeadIndexLock(worktree, cardId) {
315052
315183
  let lockPath = "";
@@ -315067,7 +315198,7 @@ function clearDeadIndexLock(worktree, cardId) {
315067
315198
  if (lockStat) {
315068
315199
  const ageMs = Date.now() - lockStat.mtimeMs;
315069
315200
  if (!(ageMs > TICK_LIMIT_MS)) throw new Error(`${lock} wiek=${Math.floor(ageMs / 1e3)}s`);
315070
- const probe = (0, import_node_child_process18.spawnSync)("lsof", ["-t", "--", lock], {
315201
+ const probe = (0, import_node_child_process19.spawnSync)("lsof", ["-t", "--", lock], {
315071
315202
  encoding: "utf-8",
315072
315203
  timeout: remainingTickMs(1e4)
315073
315204
  });
@@ -315130,14 +315261,14 @@ async function fetchMain(cwd, installation) {
315130
315261
  }
315131
315262
  function branchPatchId(worktree, base2, sha5) {
315132
315263
  try {
315133
- const diff = (0, import_node_child_process18.execFileSync)("git", ["diff", "--binary", base2, sha5], {
315264
+ const diff = (0, import_node_child_process19.execFileSync)("git", ["diff", "--binary", base2, sha5], {
315134
315265
  cwd: worktree,
315135
315266
  encoding: "utf-8",
315136
315267
  timeout: remainingTickMs(6e4),
315137
315268
  maxBuffer: 20 * 1024 * 1024
315138
315269
  });
315139
315270
  if (!diff) return null;
315140
- const result = (0, import_node_child_process18.spawnSync)("git", ["patch-id", "--stable"], {
315271
+ const result = (0, import_node_child_process19.spawnSync)("git", ["patch-id", "--stable"], {
315141
315272
  cwd: worktree,
315142
315273
  encoding: "utf-8",
315143
315274
  input: diff,
@@ -315305,7 +315436,7 @@ function exportOpenCodeSession(sessionId, cwd) {
315305
315436
  }
315306
315437
  }
315307
315438
  function helper(args, cwd, taskEnv = executionEnv2(), installation = tickInstallation) {
315308
- const r = (0, import_node_child_process18.spawnSync)("node", [CODEX_HELPER, ...args], {
315439
+ const r = (0, import_node_child_process19.spawnSync)("node", [CODEX_HELPER, ...args], {
315309
315440
  cwd,
315310
315441
  encoding: "utf-8",
315311
315442
  timeout: remainingTickMs(12e4),
@@ -315322,18 +315453,26 @@ function helper(args, cwd, taskEnv = executionEnv2(), installation = tickInstall
315322
315453
  ...errorCode ? { errorCode } : {}
315323
315454
  };
315324
315455
  }
315325
- function readHostBootAt() {
315456
+ function parseHostBootAt(source, platform) {
315457
+ const match = platform === "linux" ? source.match(/^btime[ \t]+([0-9]+)[ \t]*$/m) : platform === "darwin" ? source.match(/sec\s*=\s*(\d+)/) : null;
315458
+ if (!match) return null;
315459
+ const sec = Number(match[1]);
315460
+ if (!Number.isFinite(sec) || sec <= 0) return null;
315326
315461
  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
315462
  return new Date(sec * 1e3).toISOString();
315333
315463
  } catch {
315334
315464
  return null;
315335
315465
  }
315336
315466
  }
315467
+ function readHostBootAt(platform = process.platform) {
315468
+ try {
315469
+ if (platform !== "linux" && platform !== "darwin") return null;
315470
+ 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) });
315471
+ return parseHostBootAt(out, platform);
315472
+ } catch {
315473
+ return null;
315474
+ }
315475
+ }
315337
315476
  function readRestartGitFacts(worktree) {
315338
315477
  try {
315339
315478
  git(["fetch", engineRemote(), engineBranch(), "--quiet"], worktree, 12e4);
@@ -317312,7 +317451,7 @@ function boundedReviewText(value, bytes = 4096) {
317312
317451
  return `${Buffer.from(value).subarray(0, bytes - Buffer.byteLength(marker) - 3).toString("utf8")}${marker}`;
317313
317452
  }
317314
317453
  function checkRuns(worktree, repository, sha5, timeout) {
317315
- const raw = (0, import_node_child_process18.execFileSync)("gh", ["api", "--paginate", "--slurp", `repos/${repository}/commits/${sha5}/check-runs?per_page=100`], {
317454
+ const raw = (0, import_node_child_process19.execFileSync)("gh", ["api", "--paginate", "--slurp", `repos/${repository}/commits/${sha5}/check-runs?per_page=100`], {
317316
317455
  cwd: worktree,
317317
317456
  encoding: "utf-8",
317318
317457
  env: hostEnv(),
@@ -317340,7 +317479,7 @@ function infrastructurePullRequest(sha5, worktree = REPO) {
317340
317479
  const match = remote.match(/^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);
317341
317480
  if (!match) throw new Error("origin nie wskazuje GitHub owner/repo");
317342
317481
  const repository = `${match[1]}/${match[2]}`;
317343
- const pages = JSON.parse((0, import_node_child_process18.execFileSync)(
317482
+ const pages = JSON.parse((0, import_node_child_process19.execFileSync)(
317344
317483
  "gh",
317345
317484
  ["api", "--paginate", "--slurp", `repos/${repository}/commits/${sha5}/pulls?per_page=100`],
317346
317485
  { cwd: worktree, encoding: "utf8", env: hostEnv(), timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }
@@ -317359,7 +317498,7 @@ function infrastructureChecks(sha5, worktree) {
317359
317498
  const match = remote.match(/^(?:git@github\.com:|https:\/\/github\.com\/|ssh:\/\/git@github\.com\/)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);
317360
317499
  if (!match) throw new Error("origin nie wskazuje github.com owner/repo");
317361
317500
  const repository = `${match[1]}/${match[2]}`;
317362
- const result = (0, import_node_child_process18.spawnSync)(
317501
+ const result = (0, import_node_child_process19.spawnSync)(
317363
317502
  "bash",
317364
317503
  ["-c", 'source "$1"; land_required_checks "$2"', "--", import_node_path52.default.join(REPO, "scripts/lib/land-shared.sh"), repository],
317365
317504
  { cwd: worktree, encoding: "utf8", env: hostEnv(), timeout: remainingTickMs(3e4), maxBuffer: 1024 * 1024 }
@@ -317396,7 +317535,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
317396
317535
  const runIds = new Set(failed2.map((f) => f.url.match(/\/actions\/runs\/(\d+)/)?.[1]).filter((x) => Boolean(x)));
317397
317536
  for (const runId2 of runIds) {
317398
317537
  try {
317399
- const raw = (0, import_node_child_process18.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 });
317538
+ 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
317539
  const jobs2 = asRecord3(JSON.parse(raw)).jobs;
317401
317540
  if (!Array.isArray(jobs2)) throw new Error("gh jobs: brak listy jobs");
317402
317541
  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 +317550,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
317411
317550
  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
317551
  }) || sourceChecks.some((check5) => interruptedJob(check5))) {
317413
317552
  try {
317414
- const run = asRecord3(JSON.parse((0, import_node_child_process18.execFileSync)("gh", ["api", `repos/${repository}/actions/runs/${runId2}`], {
317553
+ const run = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["api", `repos/${repository}/actions/runs/${runId2}`], {
317415
317554
  cwd: worktree,
317416
317555
  encoding: "utf-8",
317417
317556
  env: hostEnv(),
@@ -317457,7 +317596,7 @@ function failedJobSteps(worktree, repository, failed2, sha5) {
317457
317596
  }
317458
317597
  function ciDiskReady(worktree, repository) {
317459
317598
  try {
317460
- const state = asRecord3(JSON.parse((0, import_node_child_process18.execFileSync)(
317599
+ const state = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)(
317461
317600
  "gh",
317462
317601
  ["variable", "get", "ROBISIE_MAC_DISK_STATE", "--repo", repository],
317463
317602
  { cwd: worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(5e3) }
@@ -317676,7 +317815,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
317676
317815
  if (!match) throw new Error("Origin nie wskazuje repozytorium github.com owner/repo");
317677
317816
  const repository = `${match[1]}/${match[2]}`;
317678
317817
  const readMergedPr = () => {
317679
- const merged = asRecord3(JSON.parse((0, import_node_child_process18.execFileSync)("gh", ["pr", "view", targetBranch, "--json", "state,mergeCommit", "--repo", repository], {
317818
+ const merged = asRecord3(JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["pr", "view", targetBranch, "--json", "state,mergeCommit", "--repo", repository], {
317680
317819
  cwd: a.worktree,
317681
317820
  encoding: "utf-8",
317682
317821
  env: hostEnv(),
@@ -317847,7 +317986,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
317847
317986
  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
317987
  if (!alreadyPushed) await reviewPhase(uid, card, { branchLease: sha5 });
317849
317988
  try {
317850
- const api = (args) => JSON.parse((0, import_node_child_process18.execFileSync)("gh", ["api", ...args], {
317989
+ const api = (args) => JSON.parse((0, import_node_child_process19.execFileSync)("gh", ["api", ...args], {
317851
317990
  cwd: a.worktree,
317852
317991
  encoding: "utf-8",
317853
317992
  env: hostEnv(),
@@ -317934,7 +318073,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
317934
318073
  await reviewPhase(uid, card, { ciRetry, hold_reason: null });
317935
318074
  await updateTask2(uid, card.id, { status: "in_review", assignee: ASSIGNEE });
317936
318075
  card.status = "in_review";
317937
- for (const runId2 of runIds) (0, import_node_child_process18.execFileSync)(
318076
+ for (const runId2 of runIds) (0, import_node_child_process19.execFileSync)(
317938
318077
  "gh",
317939
318078
  ["run", "rerun", runId2, "--failed", "--repo", repository],
317940
318079
  { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) }
@@ -317968,7 +318107,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
317968
318107
  const ciRetry = { sha: sha5, runId: runId2, at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: "cancelled" };
317969
318108
  await reviewPhase(uid, card, { ciRetry });
317970
318109
  try {
317971
- (0, import_node_child_process18.execFileSync)("gh", ["run", "rerun", runId2, "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
318110
+ (0, import_node_child_process19.execFileSync)("gh", ["run", "rerun", runId2, "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
317972
318111
  lastTick(s, "landing", `CI cancelled: jedno ponowienie run ${runId2} dla ${sha5}; runda recenzji bez zmian`, false, card.id);
317973
318112
  return;
317974
318113
  } catch (rerunError) {
@@ -317994,7 +318133,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
317994
318133
  const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: klass };
317995
318134
  await reviewPhase(uid, card, { ciRetry });
317996
318135
  try {
317997
- (0, import_node_child_process18.execFileSync)("gh", ["run", "rerun", runIds[0], "--failed", "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
318136
+ (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
318137
  lastTick(s, "landing", `${label2}: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
317999
318138
  return;
318000
318139
  } catch (rerunError) {
@@ -318019,7 +318158,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
318019
318158
  for (const runId2 of runIds) {
318020
318159
  let status2;
318021
318160
  try {
318022
- status2 = (0, import_node_child_process18.execFileSync)("gh", ["run", "view", runId2, "--repo", repository, "--json", "status", "--jq", ".status"], {
318161
+ status2 = (0, import_node_child_process19.execFileSync)("gh", ["run", "view", runId2, "--repo", repository, "--json", "status", "--jq", ".status"], {
318023
318162
  cwd: a.worktree,
318024
318163
  encoding: "utf-8",
318025
318164
  env: hostEnv(),
@@ -318040,7 +318179,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
318040
318179
  let logReadFailed = false;
318041
318180
  for (const runId2 of runIds) {
318042
318181
  try {
318043
- const raw = (0, import_node_child_process18.execFileSync)("gh", ["run", "view", runId2, "--log-failed", "--repo", repository], {
318182
+ const raw = (0, import_node_child_process19.execFileSync)("gh", ["run", "view", runId2, "--log-failed", "--repo", repository], {
318044
318183
  cwd: a.worktree,
318045
318184
  encoding: "utf-8",
318046
318185
  env: hostEnv(),
@@ -318073,7 +318212,7 @@ async function land(s, uid, card, a, sha5, diskDependencies, landing = { availab
318073
318212
  const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), startedAt: failed2[0].startedAt, reason: "outside-diff", tests: [...tests] };
318074
318213
  await reviewPhase(uid, card, { ciRetry });
318075
318214
  try {
318076
- (0, import_node_child_process18.execFileSync)("gh", ["run", "rerun", runIds[0], "--failed", "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
318215
+ (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
318216
  lastTick(s, "landing", `CI poza diffem: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
318078
318217
  return;
318079
318218
  } catch (rerunError) {
@@ -318216,7 +318355,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
318216
318355
  [freshWorker2.jobId, freshWorker2.attempts, freshWorker2.worktree, freshWorker2.branch],
318217
318356
  [priorWorker.jobId, priorWorker.attempts, priorWorker.worktree, priorWorker.branch]
318218
318357
  )) throw new Error("Recenzja lub Worker zmieni\u0142y si\u0119 przed scaleniem PR");
318219
- (0, import_node_child_process18.execFileSync)("gh", ["pr", "merge", targetBranch, "--merge", "--match-head-commit", sha5, "--repo", repository], {
318358
+ (0, import_node_child_process19.execFileSync)("gh", ["pr", "merge", targetBranch, "--merge", "--match-head-commit", sha5, "--repo", repository], {
318220
318359
  cwd: a.worktree,
318221
318360
  encoding: "utf-8",
318222
318361
  env: hostEnv(),
@@ -318241,7 +318380,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
318241
318380
  if (clearDeadIndexLock(a.worktree, card.id) === "held") return;
318242
318381
  await reviewPhase(uid, card, { phase: "review", sha: null, pass_waiting_sha: null, branchLease: sha5, ci: null });
318243
318382
  try {
318244
- git(["rebase", engineBaseRef()], a.worktree, 12e4);
318383
+ git(["rebase", engineBaseRef()], a.worktree, 12e4, true);
318245
318384
  } catch (rebaseError) {
318246
318385
  try {
318247
318386
  git(["rebase", "--abort"], a.worktree);
@@ -318329,7 +318468,7 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
318329
318468
  const ciRetry = { sha: sha5, runId: runIds[0], at: (/* @__PURE__ */ new Date()).toISOString(), reason: "missing" };
318330
318469
  await reviewPhase(uid, card, { ciRetry, ci: { ...ci, sha: sha5, startedAt: ciRetry.at } });
318331
318470
  try {
318332
- (0, import_node_child_process18.execFileSync)("gh", ["run", "rerun", runIds[0], "--repo", repository], { cwd: a.worktree, encoding: "utf-8", env: hostEnv(), timeout: remainingTickMs(6e4) });
318471
+ (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
318472
  lastTick(s, "landing", `CI missing: jedno ponowienie run ${runIds[0]} dla ${sha5}; runda bez zmian`, false, card.id);
318334
318473
  return;
318335
318474
  } catch (rerunError) {
@@ -318441,7 +318580,7 @@ function reviewFreshness(details2) {
318441
318580
  function reviewResultDiagnostic(s, cardId, phase, reason) {
318442
318581
  if (engineClient()) {
318443
318582
  s.blocked++;
318444
- if (reason !== "Brak kontekstu localDelivery klienta; pomijam dostaw\u0119") reason = clientTickFailure();
318583
+ 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
318584
  }
318446
318585
  try {
318447
318586
  log2(`${phase} cardId=${cardId} ${reason}`);
@@ -319253,7 +319392,7 @@ async function reviewActive(s, uid, card, a, landing, installation = tickInstall
319253
319392
  }), { flag: "wx", mode: 384 });
319254
319393
  try {
319255
319394
  await new Promise((resolve7, reject) => {
319256
- const child = (0, import_node_child_process18.spawn)(
319395
+ const child = (0, import_node_child_process19.spawn)(
319257
319396
  process.execPath,
319258
319397
  engineJobArgv(__filename, "review", file3),
319259
319398
  { cwd: REPO, env: clientPair ? { ...installation.controlEnv(), ROBISIE_ENGINE_CONFIG: clientPair.config.path } : { ...executionEnv2(), MASZYNISTA_HOST_STATE_DIR: hostStateDir() }, detached: true, stdio: "ignore" }
@@ -320470,7 +320609,7 @@ function testerRelatedFiles(root, changed, failures) {
320470
320609
  process.stdout.write('TESTER_RELATED_JSON=' + JSON.stringify({ related, graphs }) + '\n');
320471
320610
  } finally { await ctx.close(); }
320472
320611
  `;
320473
- const result = (0, import_node_child_process18.spawnSync)(process.execPath, ["--input-type=module", "-e", script, JSON.stringify({ root, changed, failures })], {
320612
+ const result = (0, import_node_child_process19.spawnSync)(process.execPath, ["--input-type=module", "-e", script, JSON.stringify({ root, changed, failures })], {
320474
320613
  cwd: root,
320475
320614
  env: executionEnv2(),
320476
320615
  encoding: "utf8",
@@ -321013,7 +321152,7 @@ report: ${json6 ? reportPath : "UNKNOWN (komenda z\u0142o\u017Cona lub inny runn
321013
321152
  const execute = (run2, cwd, ceiling = TESTER_COMMAND_CEILING_MS) => {
321014
321153
  const started = (/* @__PURE__ */ new Date()).toISOString(), startMs = Date.now();
321015
321154
  try {
321016
- return (0, import_node_child_process18.execFileSync)("/bin/zsh", [
321155
+ return (0, import_node_child_process19.execFileSync)("/bin/zsh", [
321017
321156
  "-lc",
321018
321157
  'exec /usr/bin/env -i "$@"',
321019
321158
  "maszynista-test-clean-env",
@@ -321668,7 +321807,7 @@ async function dispatchCard(s, uid, projectId2, c, selection, installation, clie
321668
321807
  const snapshot2 = () => {
321669
321808
  const head = git(["rev-parse", "--verify", "HEAD^{commit}"], worktree);
321670
321809
  if (!/^[a-f0-9]{40}$/.test(head)) throw new Error("HEAD UNKNOWN");
321671
- return { head, diff: (0, import_node_child_process18.execFileSync)("git", ["diff", "--binary", "HEAD"], { cwd: worktree, encoding: "utf-8", timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }), staged: (0, import_node_child_process18.execFileSync)("git", ["diff", "--cached", "--binary"], { cwd: worktree, encoding: "utf-8", timeout: remainingTickMs(6e4), maxBuffer: 20 * 1024 * 1024 }) };
321810
+ 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
321811
  };
321673
321812
  try {
321674
321813
  candidate = snapshot2();
@@ -321676,7 +321815,7 @@ async function dispatchCard(s, uid, projectId2, c, selection, installation, clie
321676
321815
  throw new DispatchHold(`HOLD repair R${reviewRound}: odczyt kandydata: ${errorText5(error48)}`, false);
321677
321816
  }
321678
321817
  try {
321679
- git(["rebase", preparedBase ?? (installation?.baseRef() ?? engineBaseRef())], worktree, 12e4);
321818
+ git(["rebase", preparedBase ?? (installation?.baseRef() ?? engineBaseRef())], worktree, 12e4, true);
321680
321819
  } catch (rebaseError) {
321681
321820
  let conflictFiles = "", unknown4 = "";
321682
321821
  try {
@@ -322221,7 +322360,7 @@ function runSeedGate(card) {
322221
322360
  tool_name: "mcp__robisie-planer__update_task",
322222
322361
  tool_input: { id: card.id, status: "ready" }
322223
322362
  });
322224
- const result = (0, import_node_child_process18.spawnSync)("/bin/bash", [gatePath], {
322363
+ const result = (0, import_node_child_process19.spawnSync)("/bin/bash", [gatePath], {
322225
322364
  cwd: REPO,
322226
322365
  encoding: "utf8",
322227
322366
  input: payload,
@@ -322495,7 +322634,7 @@ function selectorUnavailable(s, now) {
322495
322634
  }
322496
322635
  function spawnSelectorProcess(trigger, force) {
322497
322636
  return new Promise((resolve7, reject) => {
322498
- const child = (0, import_node_child_process18.spawn)("npx", ["tsx", "maszynista/select.ts"], {
322637
+ const child = (0, import_node_child_process19.spawn)("npx", ["tsx", "maszynista/select.ts"], {
322499
322638
  cwd: REPO,
322500
322639
  detached: true,
322501
322640
  stdio: "ignore",
@@ -323118,7 +323257,7 @@ function createScopeReader(s, uid, projectId2, installation) {
323118
323257
  if (asRecord3(error48).code !== "ESRCH") throw error48;
323119
323258
  }
323120
323259
  }
323121
- const rawGit = (args, cwd) => Buffer.from((0, import_node_child_process18.execFileSync)("git", args, {
323260
+ const rawGit = (args, cwd) => Buffer.from((0, import_node_child_process19.execFileSync)("git", args, {
323122
323261
  cwd,
323123
323262
  timeout: remainingTickMs(6e4),
323124
323263
  maxBuffer: 20 * 1024 * 1024
@@ -323736,6 +323875,13 @@ function clientTickFailure(error48) {
323736
323875
  const reason = `Brak komendy klienta: ${command}`;
323737
323876
  if (error48 instanceof Error && error48.message === reason) return reason;
323738
323877
  }
323878
+ const testerReasons = {
323879
+ "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`",
323880
+ "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`",
323881
+ "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"
323882
+ };
323883
+ const code = error48 instanceof TesterSafetyError ? error48.code : error48 instanceof ClientPairHold ? "client-pair-hold" : void 0;
323884
+ if (code) return `${code}: ${testerReasons[code]}`;
323739
323885
  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
323886
  }
323741
323887
  async function main2() {
@@ -324392,12 +324538,12 @@ async function main2() {
324392
324538
  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
324539
  return client && result.outcome === "stop" ? 2 : code;
324394
324540
  }
324395
- var import_node_fs47, import_gray_matter2, import_node_child_process18, 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;
324541
+ 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
324542
  var init_tick = __esm({
324397
324543
  "maszynista/tick.ts"() {
324398
324544
  import_node_fs47 = require("node:fs");
324399
324545
  import_gray_matter2 = __toESM(require_gray_matter());
324400
- import_node_child_process18 = require("node:child_process");
324546
+ import_node_child_process19 = require("node:child_process");
324401
324547
  import_node_os14 = require("node:os");
324402
324548
  import_node_sqlite4 = require("node:sqlite");
324403
324549
  import_node_util12 = require("node:util");
@@ -324450,6 +324596,7 @@ var init_tick = __esm({
324450
324596
  init_zasiew_bell();
324451
324597
  init_sparse_policy();
324452
324598
  init_constants();
324599
+ init_git_commit();
324453
324600
  init_goal_point_publisher();
324454
324601
  init_store();
324455
324602
  init_host_ops2();
@@ -324650,6 +324797,7 @@ init_tick();
324650
324797
  TESTER_RETEST_MAX_ERRORS,
324651
324798
  actionableBlockerHold,
324652
324799
  armTickDeadline,
324800
+ autoCommitWorker,
324653
324801
  cleanupRecoverableDiskArtifacts,
324654
324802
  configureSparseCheckout,
324655
324803
  consumeActive,
@@ -324682,10 +324830,12 @@ init_tick();
324682
324830
  northStarRecovered,
324683
324831
  notifyLandingHold,
324684
324832
  obligationPhase,
324833
+ parseHostBootAt,
324685
324834
  parseUnblockGiB,
324686
324835
  processWip,
324687
324836
  promotionPhase,
324688
324837
  queueForReksio,
324838
+ readHostBootAt,
324689
324839
  readRecentBuzzEvents,
324690
324840
  readyTaskPatch,
324691
324841
  reconcileBoardActives,