robisie 0.5.49 → 0.5.51

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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # Historia zmian klienta / Client changelog
2
2
 
3
+ ## [0.5.51](https://github.com/chuppa12/robisie-app/compare/client-v0.5.50...client-v0.5.51) (2026-11-17)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **client:** release-rollback niezależny od wolnego dysku maszyny ([13b2ef0](https://github.com/chuppa12/robisie-app/commit/13b2ef0c8990baf85c6e521c1da0976094aaed12))
9
+
10
+
11
+ ### Factory Cards
12
+
13
+ * `robisie usage` w piaskownicy Codexa zachowuje wyjście programu: stdout i stderr idą do plików, nie przez łącza ([841ca08](https://github.com/chuppa12/robisie-app/commit/841ca08d401dd05efdc0fcd775bd9d57e2ec744d))
14
+ * praca workera task-mwk45npv-3qxhht (auto-commit) ([519065e](https://github.com/chuppa12/robisie-app/commit/519065ebaeced31366091d2cc045f66b78cb50f3))
15
+ * praca workera task-mwk5b3h4-e855co (auto-commit) ([528bb29](https://github.com/chuppa12/robisie-app/commit/528bb2925518eb4148982556a4661217d38f1763))
16
+ * praca workera task-mwk954bl-riub1y (auto-commit) ([b2d4311](https://github.com/chuppa12/robisie-app/commit/b2d4311674cf1e491f7e16de6cb9a9d757e7b55d))
17
+ * praca workera task-mwkatxg3-3s1un7 (auto-commit) ([fc2db3e](https://github.com/chuppa12/robisie-app/commit/fc2db3ec3e8b4d802a9ef0ccb08bd73285b9f782))
18
+ * Recenzent Grok, któremu zabrakło tur, dostaje ponowienie zamiast blokady karty ([cfc01fe](https://github.com/chuppa12/robisie-app/commit/cfc01fe6e615ef57ca0c490a6be1113ddec52d3e))
19
+
20
+ ## [0.5.50](https://github.com/chuppa12/robisie-app/compare/client-v0.5.49...client-v0.5.50) (2026-11-17)
21
+
22
+
23
+ ### Factory Cards
24
+
25
+ * praca workera task-mwjydiej-dm3r91 (auto-commit) ([97b08fd](https://github.com/chuppa12/robisie-app/commit/97b08fdb8af4c0c8ba687aa169e2101238119e5e))
26
+ * przygotowanie konfliktu z main ([930e431](https://github.com/chuppa12/robisie-app/commit/930e4310f301e0c1957757649ee81bb89f17baad))
27
+
3
28
  ## [0.5.49](https://github.com/chuppa12/robisie-app/compare/client-v0.5.48...client-v0.5.49) (2026-11-17)
4
29
 
5
30
 
@@ -1,6 +1,6 @@
1
1
  /** Package identity and the server contract it speaks. */
2
2
  export declare const PACKAGE_NAME = "robisie";
3
- export declare const PACKAGE_VERSION = "0.5.49";
3
+ export declare const PACKAGE_VERSION = "0.5.51";
4
4
  /**
5
5
  * MAJOR of the agent-API contract this package understands.
6
6
  * PARITY: src/lib/mcp/contract-version.ts (AGENT_API_CONTRACT_VERSION) on the server.
package/dist/constants.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /** Package identity and the server contract it speaks. */
2
2
  export const PACKAGE_NAME = "robisie";
3
- export const PACKAGE_VERSION = "0.5.49"; // x-release-please-version
3
+ export const PACKAGE_VERSION = "0.5.51"; // x-release-please-version
4
4
  /**
5
5
  * MAJOR of the agent-API contract this package understands.
6
6
  * PARITY: src/lib/mcp/contract-version.ts (AGENT_API_CONTRACT_VERSION) on the server.
@@ -1 +1 @@
1
- {"schema":1,"sha":"efb840140849ac2265d33f7fb8b7cb1ef377a383","dirty":false}
1
+ {"schema":1,"sha":"29ff73b438f0cd3b05674f12da1a80578e310758","dirty":false}
@@ -1692,14 +1692,14 @@
1692
1692
  "staticOperations": {
1693
1693
  "beforePreflight": {
1694
1694
  "module": "maszynista/tick.ts",
1695
- "startLine": 10206,
1696
- "endLine": 10319,
1695
+ "startLine": 10241,
1696
+ "endLine": 10354,
1697
1697
  "text": "export async function main(): Promise<number> {\n const start = standaloneStartCheck({ filename: __filename, env: process.env });\n if (start.standalone && !start.ok) {\n console.error(start.message);\n process.exitCode = 78;\n return 78;\n }\n let installation: EngineContext;\n try { installation = createEngineContext(currentEngine(), {\n loadEnvironment: loadEnvFiles, preflight, baseRef: engineBaseRef, refreshBase: fetchMain,\n disk: defaultDiskPressureDependencies, workerContext: loadNorthStar,\n controlEnv: hostEnv, workerEnv: executionEnv, prepareWorktree: prepareHostWorktree, workerArtifacts: createWorkerTmpdir,\n notify: async (card, reason) => { decisionForReksio(card, reason, \"Rozstrzygnij na karcie\", \"\", \"\"); return { outcome: \"recorded\", ref: DECISIONS_REKSIO }; },\n hostOperations: hostOperationsPhase,\n activation: { confirmLoaded, finishHostActivation, readActivationState, recoverTickTimeout, runEnabledAuto },\n }, git, log); }\n catch (error) {\n if (!engineClient()) throw error;\n console.error(`HOLD kontekst klienta: ${clientTickFailure(error)}`);\n process.exitCode = 78;\n return 78;\n }\n const previousInstallation = tickInstallation;\n const hostErrorText = errorText;\n const client = engineClient();\n const result: { outcome: \"ok\" | \"retry\" | \"stop\"; reason: string; cleanup: boolean } = { outcome: \"ok\", reason: \"\", cleanup: false };\n const stopClient = (reason = clientTickFailure()): void => {\n if (client && result.outcome !== \"stop\") { result.outcome = \"stop\"; result.reason = reason; }\n };\n let code = 2;\n try { code = await q.withPlannerQueries(installation.planner, async () => {\n tickInstallation = installation;\n const seedGateSettings = installationSeedGateSettings();\n const errorText = client ? clientTickFailure : hostErrorText;\n const loadEnvFiles = installation.loadEnvironment;\n const preflight = () => {\n const actor = installation.preflight();\n return { uid: actor.kind === \"db\" ? actor.uid : API_ACTOR };\n };\n const { confirmLoaded, finishHostActivation, readActivationState, recoverTickTimeout, runEnabledAuto } = installation.activation;\n const smokeOnly = DRY && process.env.MASZYNISTA_SMOKE === \"1\";\n if (!DRY) {\n const acquire = (): boolean => tryCreateTickLock(LOCK);\n if (!acquire()) {\n const raw = readFileSync(LOCK, \"utf8\"), pid = Number(raw);\n if (!Number.isSafeInteger(pid) || pid <= 0) { console.log(\"tick lock bez poprawnego PID — HOLD\"); return 0; }\n try { process.kill(pid, 0); console.log(`tick już trwa (pid ${pid})`); return 0; }\n catch (error) { if ((error as NodeJS.ErrnoException).code !== \"ESRCH\") throw error; }\n if (readFileSync(LOCK, \"utf8\") === raw) unlinkSync(LOCK);\n if (!acquire()) { console.log(\"tick już trwa\"); return 0; }\n }\n }\n skippedCardEvents.clear();\n let s = parseState(null).state;\n // Internal smoke handoff: the child cannot outlive the parent's reserved budget.\n const smokeLimit = DRY ? Number(process.env.MASZYNISTA_SMOKE_TIMEOUT_MS) : NaN;\n let stateLoaded = false;\n let tickStarted: string | undefined;\n let outcome: \"ok\" | \"failed\" = \"ok\";\n let runtimeFailed = false;\n let observedLoaded = \"UNKNOWN\";\n let tickPhase = \"startup\";\n const deadlineAlarm = armTickDeadline(() => s, Number.isSafeInteger(smokeLimit) && smokeLimit > 0\n ? Math.min(TICK_LIMIT_MS, smokeLimit) : TICK_LIMIT_MS, () => ({ phase: tickPhase, observedLoaded }));\n let hostReady = false;\n let hostBoard: { uid: string; projectId: string } | undefined;\n let activationCards: CardLike[] = [];\n let activationCardsKnown = false;\n let blockedBefore = 0;\n const clientStopped = (): boolean => {\n if (client && (outcome === \"failed\" || (!DRY && s.blocked > blockedBefore))) stopClient();\n if (client && result.outcome === \"stop\") outcome = \"failed\";\n return client && result.outcome === \"stop\";\n };\n let hostPhaseStarted = false;\n const hostPhase = async (): Promise<boolean> => {\n if (smokeOnly || !hostReady || hostPhaseStarted) return false;\n hostPhaseStarted = true;\n tickPhase = \"host\";\n if (hostBoard) {\n const { uid: boardUid, projectId: boardProject } = hostBoard;\n try {\n await runEnabledAuto({ state: s, loadedSha: observedLoaded, repo: REPO, logPath: LOG, tick: s.tick, stateDir: hostStateDir(),\n now: new Date().toISOString(), activation: readActivationState(hostStateDir()), dryRun: DRY }, {\n listCards: async () => scanTasks(boardUid, boardProject, { full: true, statuses: [\"delivered\"],\n detailsKeys: ENABLED_SCAN_DETAILS_KEYS }),\n getTask: id => q.getTask(boardUid, id),\n appendDetail: async (id, patch) => { await appendBoundedDetail(boardUid, id, patch); },\n saveState: writeState,\n alarm: hostActivationAlarm,\n log,\n });\n } catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL ENABLED auto: ${errorText(error)}`); }\n } else log(\"ENABLED auto: UNKNOWN — brak odczytu projektu; dowód karty czeka na dostęp do tablicy\");\n try {\n const result = await engineRunHostActivation({ repo: REPO, stateDir: hostStateDir(), cards: activationCards, cardsKnown: activationCardsKnown, tick: s.tick, dryRun: DRY }, {\n git, remainingTickMs, alarm: hostActivationAlarm, infrastructureChecks, infrastructurePullRequest, log: line => log(`host-activation: ${line}`),\n });\n log(`host-activation: code=${result.code} target=${result.target ?? \"UNKNOWN\"}${result.detail ? ` reason=${result.detail}` : \"\"}`);\n if (result.code === \"activate\" && result.target) {\n lastTick(s, \"activation\", `aktywacja ${result.target}; ogon odroczony`, outcome === \"ok\");\n return true;\n }\n } catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL aktywacja: ${errorText(error)}`); }\n return false;\n };\n try {\n observedLoaded = loadedSha = readLoadedSha(REPO);\n s = readState((await engineFjConfig()).enabled);\n stateLoaded = true; blockedBefore = s.blocked;\n s.tick++; tickStarted = new Date().toISOString(); s.lastTickAt = tickStarted;\n log(`tick_started tick=${s.tick} at=${tickStarted} duration=UNKNOWN loaded=${loadedSha}`);\n loadEnvFiles();\n const { uid } = preflight();"
1698
1698
  },
1699
1699
  "finalization": {
1700
1700
  "module": "maszynista/tick.ts",
1701
- "startLine": 10610,
1702
- "endLine": 10662,
1701
+ "startLine": 10645,
1702
+ "endLine": 10697,
1703
1703
  "text": " } finally {\n // A persisted terminal FAIL is a card result; every unexpected exception above\n // remains a runtime failure, including DB errors inside card handling.\n if (!DRY && s.blocked > blockedBefore) {\n outcome = \"failed\";\n try { log(`FAIL: licznik blocked wzrósł ${blockedBefore} → ${s.blocked}; outcome=failed`); }\n catch (error) { console.error(`zapis licznika blocked: ${errorText(error)}`); }\n }\n clientStopped();\n // Early board failure still reaches the same host phase, at most once per tick.\n await hostPhase();\n tickPhase = \"finalizing\";\n try { if (!DRY) await finishHostActivation({ stateDir: hostStateDir(), outcome, tick: s.tick, runtimeFailed, observedLoaded }, { alarm: hostActivationAlarm, log }); }\n catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL breaker aktywacji: ${errorText(error)}`); }\n clientStopped();\n try { if (stateLoaded) writeState(s); }\n catch (error) { runtimeFailed = true; outcome = \"failed\"; if (!client) throw error; stopClient(); result.cleanup = true; }\n finally {\n if (!DRY) {\n try { if (readFileSync(LOCK, \"utf8\") === String(process.pid)) unlinkSync(LOCK); }\n catch (error) { if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") { if (!client) throw error; stopClient(); result.cleanup = true; } }\n }\n const at = new Date().toISOString();\n const duration = tickStarted ? `${(Date.parse(at) - Date.parse(tickStarted)) / 1000}s` : \"UNKNOWN\";\n try {\n const { total, ops } = drainEgressCounters();\n const sorted = Object.entries(ops).sort(([, a], [, b]) => b.bytes - a.bytes);\n const summary = sorted.filter(([op]) => !op.includes(\":\")).slice(0, 12)\n .map(([op, counter]) => `${op}:${counter.calls}:${counter.bytes}`).join(\",\");\n const variants = sorted.filter(([op]) => op.includes(\":\")).slice(0, 6)\n .map(([op, counter]) => `${op}:${counter.calls}:${counter.bytes}`).join(\",\");\n log(`egress tick=${s.tick} total=${total} ops=${summary} variants=${variants}`);\n } catch { /* Optional metrics must never interrupt tick cleanup. */ }\n try { refreshTickReport(observedLoaded); log(`tick_finished tick=${s.tick} at=${at} outcome=${client && result.outcome === \"retry\" ? \"retry\" : outcome} duration=${duration} loaded=${loadedSha}`); }\n finally { clearTimeout(deadlineAlarm); tickDeadline = Number.POSITIVE_INFINITY; }\n }\n }\n }); } catch (error) {\n if (!client) throw error;\n stopClient(); result.cleanup = true;\n } finally {\n tickInstallation = previousInstallation;\n try { await installation.close(); }\n catch (error) {\n if (client) { stopClient(); result.cleanup = true; }\n else safeLog(`Zamknięcie instalacji nieudane: ${String(error)}`);\n }\n }\n if (client && result.outcome !== \"ok\") console.error(`Fabryka ${result.outcome === \"stop\" ? \"zatrzymana\" : \"retry\"}: ${result.reason}${result.cleanup ? \"; finalizacja niepotwierdzona — sprawdź stan i blokadę\" : \"\"}`);\n return client && result.outcome === \"stop\" ? 2 : code;\n}\n\nif (require.main === module && !([\"--opencode-runner\", \"--grok-runner\"].includes(process.argv[2] ?? \"\"))) {"
1704
1704
  },
1705
1705
  "refreshTickReport": {
@@ -1725,6 +1725,6 @@
1725
1725
  "status": 0,
1726
1726
  "signal": null,
1727
1727
  "stdout": "v24.3.0\n",
1728
- "stderr": "(node:22029) ExperimentalWarning: SQLite is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
1728
+ "stderr": "(node:23246) ExperimentalWarning: SQLite is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
1729
1729
  }
1730
1730
  }
@@ -37652,7 +37652,7 @@ var init_constants = __esm({
37652
37652
  "packages/client/src/constants.ts"() {
37653
37653
  "use strict";
37654
37654
  PACKAGE_NAME = "robisie";
37655
- PACKAGE_VERSION = "0.5.49";
37655
+ PACKAGE_VERSION = "0.5.51";
37656
37656
  SUPPORTED_CONTRACT_MAJOR = 1;
37657
37657
  DEFAULT_ORIGIN = "https://robisie.app";
37658
37658
  MCP_SERVER_NAME = "robisie";
@@ -77021,6 +77021,51 @@ function owned(root, file3) {
77021
77021
  if ((0, import_node_fs20.realpathSync)(root) !== root || within(root, import_node_path22.default.relative(root, file3)) !== file3) throw new Error("Zmieniona \u015Bcie\u017Cka przebiegu");
77022
77022
  return file3;
77023
77023
  }
77024
+ async function usageSupervisor() {
77025
+ const fs4 = process.getBuiltinModule("node:fs");
77026
+ const { spawn: spawn7 } = process.getBuiltinModule("node:child_process");
77027
+ const [report, entry2, ...args] = process.argv.slice(1);
77028
+ const child = spawn7("/bin/bash", [
77029
+ "--noprofile",
77030
+ "--norc",
77031
+ "-c",
77032
+ 'ulimit -f 1024 || exit; exec /usr/bin/env -i PATH=/usr/bin:/bin LANG=C.UTF-8 "$@"',
77033
+ "usage",
77034
+ process.execPath,
77035
+ entry2,
77036
+ ...args
77037
+ ], { stdio: ["ignore", 1, 2], shell: false });
77038
+ let error48;
77039
+ const stop = (cause) => {
77040
+ error48 ??= String(cause);
77041
+ try {
77042
+ child.kill("SIGKILL");
77043
+ } catch (cause2) {
77044
+ error48 += `; zatrzymanie: ${String(cause2)}`;
77045
+ }
77046
+ };
77047
+ const check5 = () => {
77048
+ try {
77049
+ for (const [fd, stream] of [[1, "stdout"], [2, "stderr"]]) {
77050
+ if (fs4.fstatSync(fd).size >= 1048576) stop(new Error(`${stream}: osi\u0105gni\u0119ty limit zapisu 1048576 bajt\xF3w`));
77051
+ }
77052
+ } catch (cause) {
77053
+ stop(cause);
77054
+ }
77055
+ };
77056
+ const monitor = setInterval(check5, 10);
77057
+ child.on("error", stop);
77058
+ child.on("close", (status2, signal) => {
77059
+ clearInterval(monitor);
77060
+ check5();
77061
+ try {
77062
+ fs4.writeFileSync(report, JSON.stringify({ status: status2, signal, error: error48 }), { flag: "wx", mode: 384 });
77063
+ } catch (cause) {
77064
+ console.error(`Zapis wyniku nadzoru: ${String(cause)}`);
77065
+ process.exitCode = 1;
77066
+ }
77067
+ });
77068
+ }
77024
77069
  function runLocalUsage(input) {
77025
77070
  let stage = "wej\u015Bcie", published = false, lock, pending;
77026
77071
  let root, run, result;
@@ -77104,11 +77149,31 @@ function runLocalUsage(input) {
77104
77149
  const artifact = destination(copy, input.program.artifact);
77105
77150
  if ((0, import_node_fs20.lstatSync)(artifact, { throwIfNoEntry: false })) throw new Error("Artefakt istnieje przed u\u017Cyciem");
77106
77151
  stage = "proces";
77107
- const executed = (0, import_node_child_process9.spawnSync)(process.execPath, [entry2, ...input.program.args], { cwd: copy, env, encoding: "utf8", shell: false });
77152
+ const stdoutFile = import_node_path22.default.join(run, "stdout"), stderrFile = import_node_path22.default.join(run, "stderr");
77153
+ const reportFile = import_node_path22.default.join(run, "outcome.json");
77154
+ const fdOut = (0, import_node_fs20.openSync)(stdoutFile, "wx", 384);
77155
+ let fdErr, outcome;
77156
+ try {
77157
+ fdErr = (0, import_node_fs20.openSync)(stderrFile, "wx", 384);
77158
+ const executed = (0, import_node_child_process9.spawnSync)(process.execPath, ["-e", `(${usageSupervisor.toString()})().catch(error => { process.exitCode = 1; console.error(error) })`, reportFile, entry2, ...input.program.args], { cwd: copy, env, encoding: "utf8", shell: false, stdio: ["ignore", fdOut, fdErr] });
77159
+ outcome = executed;
77160
+ if (cleanExit(executed)) {
77161
+ const report = external_exports.strictObject({ status: external_exports.number().int().nullable(), signal: external_exports.string().nullable(), error: external_exports.string().optional() }).parse(JSON.parse(bounded3(reportFile)));
77162
+ if (report.error) throw new Error(report.error);
77163
+ outcome = { ...executed, status: report.status, signal: report.signal };
77164
+ }
77165
+ } finally {
77166
+ try {
77167
+ (0, import_node_fs20.closeSync)(fdOut);
77168
+ } finally {
77169
+ if (fdErr !== void 0) (0, import_node_fs20.closeSync)(fdErr);
77170
+ }
77171
+ }
77172
+ const stdout = boundedBytes(stdoutFile).toString("utf8"), stderr = boundedBytes(stderrFile).toString("utf8");
77108
77173
  const finishedAt = (/* @__PURE__ */ new Date()).toISOString();
77109
- if (!cleanExit(executed)) throw new Error(
77110
- `Proces u\u017Cycia: status=${executed.status}, signal=${executed.signal}; stdout=${executed.stdout ?? ""}; stderr=${executed.stderr ?? ""}${executed.error ? `; error=${failure(executed.error)}` : ""}`,
77111
- { cause: executed.error }
77174
+ if (!cleanExit(outcome)) throw new Error(
77175
+ `Proces u\u017Cycia: status=${outcome.status}, signal=${outcome.signal}; stdout=${stdout}; stderr=${stderr}${outcome.error ? `; error=${failure(outcome.error)}` : ""}`,
77176
+ { cause: outcome.error }
77112
77177
  );
77113
77178
  stage = "weryfikacja po wykonaniu";
77114
77179
  verify2();
@@ -77127,7 +77192,7 @@ function runLocalUsage(input) {
77127
77192
  sha: sha5,
77128
77193
  ref,
77129
77194
  operation: input.operation,
77130
- result: JSON.stringify({ exit: executed.status, stdout: executed.stdout ?? "", stderr: executed.stderr ?? "" })
77195
+ result: JSON.stringify({ exit: outcome.status, stdout, stderr })
77131
77196
  });
77132
77197
  stage = "walidacja zapisu";
77133
77198
  const line2 = JSON.stringify(external_exports.json().parse(Object.fromEntries(Object.entries(result).sort(([a], [b]) => a.localeCompare(b))))) + "\n";
@@ -93441,7 +93506,7 @@ END_SOURCE_REQUESTS`)[0], q)) fail4();
93441
93506
  const calls = t.invocations.filter((call) => call.round === i3);
93442
93507
  if (!calls.length || calls.length > 2 || Buffer.byteLength(current) > SOURCE_INPUT_LIMIT) fail4();
93443
93508
  for (const call of calls) if (call.inputSha256 !== sourceHash(current) || !Number.isFinite(call.startedAt) || !Number.isFinite(call.finishedAt) || call.finishedAt < call.startedAt || call.startedAt < t.startedAt || call.finishedAt - t.startedAt > 27e5 || typeof call.output !== "string" || typeof call.export !== "string") fail4();
93444
- if (calls.length === 2 && !["timeout", "transport-unavailable"].includes(String(calls[0].errorClass))) fail4();
93509
+ if (calls.length === 2 && !["timeout", "transport-unavailable", "turn-limit"].includes(String(calls[0].errorClass))) fail4();
93445
93510
  }
93446
93511
  if (t.invocations.some((call, i3, all) => call.round < 1 || call.round > t.rounds || i3 > 0 && call.round < all[i3 - 1].round)) fail4();
93447
93512
  if (!reads || t.finalInput !== sourceInput(base2, t.events) || !t.finalInput.startsWith(base2) || t.finalInputSha256 !== sourceHash(t.finalInput) || Buffer.byteLength(t.finalInput) > SOURCE_INPUT_LIMIT) fail4();
@@ -93700,7 +93765,7 @@ function receiptFor(cardId, kind, sha5, round, attempt, value) {
93700
93765
  throw new Error(`ACTIONABLE: receipt ${target}: ${errorText4(error48)}`);
93701
93766
  }
93702
93767
  }
93703
- function classifyError(error48, prompt2, stderr, stdout, originalPrompt = prompt2, claude = false) {
93768
+ function classifyError(error48, prompt2, stderr, stdout, originalPrompt = prompt2, claude = false, grok = false) {
93704
93769
  const details2 = record15(error48);
93705
93770
  const code = typeof details2.code === "string" ? details2.code : "";
93706
93771
  const clean2 = (value) => [prompt2, originalPrompt].reduce(
@@ -93725,10 +93790,12 @@ function classifyError(error48, prompt2, stderr, stdout, originalPrompt = prompt
93725
93790
  }
93726
93791
  }));
93727
93792
  const diagnostic = runtimeLines.join("\n");
93728
- if (/\b(?:at|over) capacity\b/i.test(diagnostic)) return "model-unavailable";
93729
- if (/EACCES|EPERM/.test(code) || /permission denied|policy refusal|authentication failed|authentication required|auth error|not authenticated|unauthori[sz]ed|forbidden|access denied|not permitted|credential|\b401\b|\b403\b/i.test(diagnostic) || claude && /not logged in/i.test(diagnostic)) {
93793
+ const capacity = /\b(?:at|over) capacity\b/i.test(diagnostic);
93794
+ if (!grok && capacity) return "model-unavailable";
93795
+ if (/EACCES|EPERM/.test(code) || grok && /\b(?:EACCES|EPERM)\b/.test(diagnostic) || /permission denied|policy refusal|authentication failed|authentication required|auth error|not authenticated|unauthori[sz]ed|forbidden|access denied|not permitted|credential|\b401\b|\b403\b/i.test(diagnostic) || claude && /not logged in/i.test(diagnostic)) {
93730
93796
  return "refusal";
93731
93797
  }
93798
+ if (capacity) return "model-unavailable";
93732
93799
  if (/usage[- ]limit|rate[- ]limit|\b429\b|\b402\b|payment required|usage balance exhausted|quota/i.test(diagnostic) || claude && /you(?:'ve| have) hit your limit/i.test(diagnostic)) return "quota-exhausted";
93733
93800
  if (/ETIMEDOUT|ESOCKETTIMEDOUT/.test(code) || /timeout|timed out/i.test(diagnostic)) return "timeout";
93734
93801
  if (/ENOTFOUND|ECONNRESET|ECONNREFUSED|EAI_AGAIN|EHOSTUNREACH/.test(code) || /network error|transport error|connection (?:failed|refused|reset)|service unavailable|no session available|session (?:missing|unavailable|expired)|\b503\b/i.test(diagnostic) || claude && /\b529\b|overloaded/i.test(diagnostic)) {
@@ -93739,6 +93806,13 @@ function classifyError(error48, prompt2, stderr, stdout, originalPrompt = prompt
93739
93806
  }
93740
93807
  return "process-error";
93741
93808
  }
93809
+ function grokTurnLimit(output) {
93810
+ try {
93811
+ return record15(JSON.parse(output)).stopReason === "max_turn_requests";
93812
+ } catch {
93813
+ return false;
93814
+ }
93815
+ }
93742
93816
  function runtimeEvidence(stderr) {
93743
93817
  const confirmedModel = stderr.match(/^model:\s*(gpt-[\w.-]+)\s*$/m)?.[1] ?? null;
93744
93818
  const quotaLine = stderr.match(/^rate_limits:\s*(\{[^\n]+\})\s*$/m)?.[1];
@@ -94113,7 +94187,7 @@ function canRetryRequiredGrok(value) {
94113
94187
  const review = record15(value), attempts = Array.isArray(review.attempts) ? review.attempts : [];
94114
94188
  if (review.verdict !== "UNAVAILABLE" || attempts.length === 0) return false;
94115
94189
  const last2 = record15(attempts.at(-1));
94116
- if (review.selectedAttempt === attempts.length && independentAttempt(last2) && ["quota-exhausted", "transport-unavailable", "model-unavailable", "timeout"].includes(String(last2.errorClass))) {
94190
+ if (review.selectedAttempt === attempts.length && independentAttempt(last2) && ["quota-exhausted", "transport-unavailable", "model-unavailable", "timeout", "turn-limit"].includes(String(last2.errorClass))) {
94117
94191
  return attempts.slice(0, -1).some(primaryPass);
94118
94192
  }
94119
94193
  if (!primaryPass(last2) || attempts.some(independentAttempt)) return false;
@@ -94180,6 +94254,7 @@ function runReview(input) {
94180
94254
  }
94181
94255
  }
94182
94256
  receipt.attempts = client || xaiWorker2 ? [] : retryAttempts(input);
94257
+ let grokMaxTurns = receipt.attempts.at(-1)?.errorClass === "turn-limit" ? "4" : "2";
94183
94258
  let materialPrompt;
94184
94259
  try {
94185
94260
  materialPrompt = reviewSourcePrompt(input);
@@ -94306,7 +94381,7 @@ function runReview(input) {
94306
94381
  "--output-format",
94307
94382
  "json",
94308
94383
  "--max-turns",
94309
- "2",
94384
+ grokMaxTurns,
94310
94385
  "--permission-mode",
94311
94386
  "dontAsk",
94312
94387
  "--tools",
@@ -94362,7 +94437,7 @@ function runReview(input) {
94362
94437
  OPENCODE_CONFIG_PROJECT_DISABLE: "1"
94363
94438
  };
94364
94439
  }
94365
- const command = [bin, ...args.map((arg) => arg === prompt2 ? "<frozen-prompt>" : arg)];
94440
+ let command = [bin, ...args.map((arg) => arg === prompt2 ? "<frozen-prompt>" : arg)];
94366
94441
  const startedAt = Date.now();
94367
94442
  let stderr = "";
94368
94443
  let exit = 0;
@@ -94389,7 +94464,10 @@ function runReview(input) {
94389
94464
  try {
94390
94465
  if (route === "grok") {
94391
94466
  prompt2 = sourceInput(basePrompt, transcript.events);
94392
- if (bin === "grok") (0, import_node_fs39.writeFileSync)(args[args.indexOf("--prompt-file") + 1], prompt2, { mode: 384 });
94467
+ if (bin === "grok") {
94468
+ args = args.map((arg, i3) => args[i3 - 1] === "--max-turns" ? grokMaxTurns : arg);
94469
+ (0, import_node_fs39.writeFileSync)(args[args.indexOf("--prompt-file") + 1], prompt2, { mode: 384 });
94470
+ }
94393
94471
  }
94394
94472
  const timeout = route === "grok" ? sourceTimeLeft(deadline) : 18e5;
94395
94473
  if (route === "grok") {
@@ -94397,6 +94475,7 @@ function runReview(input) {
94397
94475
  transcript.finalInput = prompt2;
94398
94476
  transcript.finalInputSha256 = sourceHash(prompt2);
94399
94477
  }
94478
+ command = [bin, ...args.map((arg) => arg === prompt2 ? "<frozen-prompt>" : arg)];
94400
94479
  rawOutput = "";
94401
94480
  rawExport = "";
94402
94481
  quota = null;
@@ -94414,7 +94493,7 @@ function runReview(input) {
94414
94493
  if (bin !== "codex") stream = bounded4(finalText, MAX_OUTPUT_BYTES);
94415
94494
  stderr = text7(result.stderr);
94416
94495
  exit = result.status;
94417
- if (result.error || result.status !== 0) {
94496
+ if (result.error || result.status !== 0 || bin === "grok" && grokTurnLimit(rawOutput)) {
94418
94497
  const failure3 = result.error ?? new Error(`${bin} exited ${result.status}`);
94419
94498
  throw Object.assign(failure3, { status: result.status, stdout: finalText, stderr });
94420
94499
  }
@@ -94454,7 +94533,9 @@ function runReview(input) {
94454
94533
  const details2 = record15(error48);
94455
94534
  exit = typeof details2.status === "number" ? details2.status : null;
94456
94535
  stderr = typeof details2.stderr === "string" ? details2.stderr : stderr;
94457
- errorClass = classifyError(error48, prompt2, stderr, text7(details2.stdout) || rawOutput, input.prompt, bin === "claude");
94536
+ const turnLimit = bin === "grok" && grokTurnLimit(rawOutput);
94537
+ errorClass = classifyError(error48, prompt2, stderr, turnLimit ? "" : text7(details2.stdout) || rawOutput, input.prompt, bin === "claude", bin === "grok");
94538
+ if (turnLimit && errorClass !== "refusal") errorClass = "turn-limit";
94458
94539
  if (policy && bin === "grok" && (details2.code === "ENOENT" || error48 instanceof SyntaxError || finalText === "grok-cli identity malformed")) errorClass = "model-unavailable";
94459
94540
  }
94460
94541
  if (bin === "codex") {
@@ -94486,7 +94567,8 @@ function runReview(input) {
94486
94567
  });
94487
94568
  for (const [key, value] of Object.entries(sourceUsage(rawOutput, quota))) transcript.usage[key] = (transcript.usage[key] ?? 0) + value;
94488
94569
  if (errorClass !== null) {
94489
- if (retry === 0 && ["transport-unavailable", "timeout"].includes(errorClass) && Date.now() < deadline) {
94570
+ if (retry === 0 && (["transport-unavailable", "timeout"].includes(errorClass) || errorClass === "turn-limit" && grokMaxTurns === "2") && Date.now() < deadline) {
94571
+ if (errorClass === "turn-limit") grokMaxTurns = "4";
94490
94572
  retry++;
94491
94573
  continue;
94492
94574
  }
@@ -320259,19 +320341,27 @@ function validFlakeAttempt(raw) {
320259
320341
  return false;
320260
320342
  }
320261
320343
  }
320262
- function readFlakeRepair(row) {
320344
+ function validRetryErrors(raw) {
320345
+ return typeof raw === "string" && raw.trim().length > 0 && Buffer.byteLength(raw.replaceAll("%", "%25").replaceAll("\r", "%0D").replaceAll("\n", "%0A")) <= 16384;
320346
+ }
320347
+ function readFlakeRepair(row, alarm2) {
320263
320348
  if (row.detailsReadError) throw new Error("board details unreadable");
320264
320349
  const raw = flakeRecord(flakeRecord(row.details).maszynista).flakeRepair;
320265
320350
  if (raw === void 0) return null;
320266
320351
  const repair = flakeRecord(raw);
320267
320352
  if (flakePath(repair.path) !== repair.path || !Array.isArray(repair.evidence) || !repair.evidence.length) throw new Error("repair dedup unreadable");
320268
- for (const item of repair.evidence) {
320269
- const e = flakeRecord(item);
320353
+ const evidence2 = repair.evidence.map((item, index2) => {
320354
+ const e = { ...flakeRecord(item) };
320270
320355
  if (e.path !== repair.path || typeof e.sourceCardId !== "string" || !e.sourceCardId || typeof e.runId !== "string" || !/^\d+$/.test(e.runId) || typeof e.sha !== "string" || !/^[a-f0-9]{40}$/.test(e.sha) || !validFlakeAttempt(e.attempt) || JSON.parse(e.attempt)[1] !== e.runId || JSON.parse(e.attempt)[2] !== e.sha || !(e.name === null || typeof e.name === "string" && e.name.trim()) || !(e.signal === "outside-diff" && e.ciRunRetries === 1 && e.vitestRetries === null || e.signal === "vitest" && e.ciRunRetries === null && Number.isSafeInteger(e.vitestRetries) && e.vitestRetries > 0 && typeof e.name === "string")) {
320271
320356
  throw new Error("repair evidence unreadable");
320272
320357
  }
320273
- }
320274
- return repair;
320358
+ if ("retryErrors" in e && !validRetryErrors(e.retryErrors)) {
320359
+ alarm2(`saved retryErrors invalid repairId=${row.id ?? "UNKNOWN"} evidence=${index2}`);
320360
+ delete e.retryErrors;
320361
+ }
320362
+ return e;
320363
+ });
320364
+ return { ...repair, evidence: evidence2 };
320275
320365
  }
320276
320366
  async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320277
320367
  const verify2 = required3.find((run) => run.name.startsWith("Verify"));
@@ -320313,8 +320403,14 @@ async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320313
320403
  ));
320314
320404
  if (!Array.isArray(raw) || !raw.length || raw.some((page) => !Array.isArray(page))) throw new Error("annotations pages incomplete");
320315
320405
  accountAttempt = true;
320406
+ const retried = [];
320407
+ const errors = [];
320316
320408
  for (const item of raw.flat()) {
320317
320409
  const annotation = flakeRecord(item);
320410
+ if (annotation.title === "retried-test-errors") {
320411
+ errors.push(annotation.message);
320412
+ continue;
320413
+ }
320318
320414
  if (annotation.title !== "retried-test") continue;
320319
320415
  const entry2 = typeof annotation.message === "string" ? annotation.message.match(/^(.+?) > ([\s\S]+) \(retries=(\d+), final=(pass|fail)\)$/) : null;
320320
320416
  if (!entry2 || !entry2[2].trim() || !Number.isSafeInteger(Number(entry2[3])) || Number(entry2[3]) <= 0) {
@@ -320322,9 +320418,29 @@ async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320322
320418
  alarm2("retried-test entry lacks positive retries/final");
320323
320419
  continue;
320324
320420
  }
320421
+ const test = { identity: `${entry2[1]} > ${entry2[2]}`, errors: [], ambiguous: false };
320422
+ retried.push(test);
320325
320423
  if (entry2[4] !== "pass") continue;
320326
- try {
320327
- signals.push({ ...base2, path: flakePath(entry2[1]), name: entry2[2], signal: "vitest", ciRunRetries: null, vitestRetries: Number(entry2[3]) });
320424
+ test.evidence = { ...base2, path: entry2[1], name: entry2[2], signal: "vitest", ciRunRetries: null, vitestRetries: Number(entry2[3]) };
320425
+ }
320426
+ const errorsPrefix = (identity, message3) => message3.startsWith("retry-errors-v1:") ? `retry-errors-v1:${identity.length}
320427
+ ${identity}
320428
+ ` : identity + "\n";
320429
+ for (const message3 of errors) {
320430
+ const matches2 = retried.filter((test) => typeof message3 === "string" && message3.startsWith(errorsPrefix(test.identity, message3)));
320431
+ if (matches2.length !== 1) {
320432
+ alarm2(`retryErrors ${matches2.length ? "ambiguous" : "orphan or malformed"} annotation`);
320433
+ for (const test of matches2) test.ambiguous = true;
320434
+ } else matches2[0].errors.push(message3);
320435
+ }
320436
+ for (const test of retried) {
320437
+ const message3 = test.errors[0];
320438
+ if (test.ambiguous || test.errors.length > 1) alarm2(`retryErrors ambiguous identity=${JSON.stringify(test.identity)}`);
320439
+ else if (!validRetryErrors(message3) || !message3.slice(errorsPrefix(test.identity, message3).length).trim()) {
320440
+ alarm2(`retryErrors missing or invalid identity=${JSON.stringify(test.identity)}`);
320441
+ } else if (test.evidence) test.evidence.retryErrors = message3;
320442
+ if (test.evidence) try {
320443
+ signals.push({ ...test.evidence, path: flakePath(test.evidence.path) });
320328
320444
  } catch (error48) {
320329
320445
  accountAttempt = false;
320330
320446
  alarm2(errorText5(error48));
@@ -320343,7 +320459,7 @@ async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320343
320459
  if (!Array.isArray(rows)) throw new Error("full board list unavailable");
320344
320460
  return rows.map((row) => {
320345
320461
  if (!row.id || typeof row.status !== "string") throw new Error("board row incomplete");
320346
- return { row, repair: readFlakeRepair(row) };
320462
+ return { row, repair: readFlakeRepair(row, alarm2) };
320347
320463
  });
320348
320464
  };
320349
320465
  const groups = Map.groupBy(signals, (e) => e.path);
@@ -320366,7 +320482,7 @@ async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320366
320482
  if (existing) {
320367
320483
  const fresh = await getTask2(uid, existing.row.id);
320368
320484
  if (!fresh || fresh.status === "done") throw new Error("open repair changed before append");
320369
- const prior = readFlakeRepair(fresh);
320485
+ const prior = readFlakeRepair(fresh, alarm2);
320370
320486
  if (!prior || prior.path !== file3) throw new Error("repair changed before append");
320371
320487
  const evidence2 = [...prior.evidence, ...additions.filter((e) => !prior.evidence.some((old) => flakeKey(old) === flakeKey(e)))];
320372
320488
  await appendDetail2(uid, fresh.id, { maszynista: { ...flakeRecord(flakeRecord(fresh.details).maszynista), flakeRepair: { path: file3, evidence: evidence2 } } });
@@ -320393,7 +320509,7 @@ async function greenFlakeDrafts(uid, card, a, repository, sha5, required3) {
320393
320509
  repairId = created.id;
320394
320510
  }
320395
320511
  const exact = await getTask2(uid, repairId);
320396
- const repair = exact && readFlakeRepair(exact);
320512
+ const repair = exact && readFlakeRepair(exact, alarm2);
320397
320513
  if (!repair || additions.some((e) => !repair.evidence.some((old) => flakeKey(old) === flakeKey(e)))) throw new Error("repair write read-back incomplete");
320398
320514
  } catch (error48) {
320399
320515
  alarm2(errorText5(error48));
@@ -321328,7 +321444,8 @@ Te testy nie nale\u017C\u0105 do Twojego diffu i pad\u0142y te\u017C po ponowien
321328
321444
  [freshWorker2.jobId, freshWorker2.attempts, freshWorker2.worktree, freshWorker2.branch],
321329
321445
  [priorWorker.jobId, priorWorker.attempts, priorWorker.worktree, priorWorker.branch]
321330
321446
  )) throw new Error("Recenzja lub Worker zmieni\u0142y si\u0119 przed scaleniem PR");
321331
- (0, import_node_child_process21.execFileSync)("gh", ["pr", "merge", targetBranch, "--merge", "--match-head-commit", sha5, "--repo", repository], {
321447
+ const title = typeof card.title === "string" ? card.title.replace(/[\r\n]+/g, " ").trim() : "";
321448
+ (0, import_node_child_process21.execFileSync)("gh", ["pr", "merge", targetBranch, "--merge", "--match-head-commit", sha5, "--repo", repository, "--subject", `maszynista: ${title || "karta " + card.id.slice(0, 8)}`], {
321332
321449
  cwd: a.worktree,
321333
321450
  encoding: "utf-8",
321334
321451
  env: hostEnv(),
@@ -321773,7 +321890,7 @@ async function consumeReviewClaim(s, uid, card, a, landing, file3, installation
321773
321890
  await holdReviewJob(s, uid, card, claim.retryGrok ? "ponowny b\u0142\u0105d pakowania po primary PASS" : "pakowanie po primary PASS; oczekiwanie na zmian\u0119 loaded SHA", stopPackaging, review2, Boolean(claim.retryGrok));
321774
321891
  return;
321775
321892
  }
321776
- if (canRetryRequiredGrok(result) || ["quota-exhausted", "transport-unavailable", "model-unavailable", "timeout", "process-error"].includes(String(outage.errorClass))) {
321893
+ if (canRetryRequiredGrok(result) || ["quota-exhausted", "transport-unavailable", "model-unavailable", "timeout", "turn-limit", "process-error"].includes(String(outage.errorClass))) {
321777
321894
  card.details = { ...card.details, review: review2 };
321778
321895
  reviewText = boundedReviewText(result.text);
321779
321896
  await applyReview(s, uid, card, "UNAVAILABLE", reviewText);
@@ -42,6 +42,6 @@ export declare function within(root: string, ref: string): string;
42
42
  /** The transport already bounds model output to 256 KiB; inputs use the same byte bound. */
43
43
  export declare function bounded(file: string): string;
44
44
  export declare function readLocalUsageEvents(root: string, c: LocalUsageReadInput): LocalUsageEvent[];
45
- /** One synchronous Node invocation; no shell, card commands, inherited credentials or control env. */
45
+ /** One synchronous usage; a fixed shell launcher sets the file limit without evaluating card commands. */
46
46
  export declare function runLocalUsage(input: RunLocalUsageInput): UsageEvent;
47
47
  export {};
@@ -107,7 +107,52 @@ function owned(root, file) {
107
107
  throw new Error("Zmieniona ścieżka przebiegu");
108
108
  return file;
109
109
  }
110
- /** One synchronous Node invocation; no shell, card commands, inherited credentials or control env. */
110
+ /** Runs in a separate Node process so monitoring continues during the synchronous caller. */
111
+ async function usageSupervisor() {
112
+ const fs = process.getBuiltinModule("node:fs");
113
+ const { spawn } = process.getBuiltinModule("node:child_process");
114
+ const [report, entry, ...args] = process.argv.slice(1);
115
+ // Bash (without POSIXLY_CORRECT in the restricted env) uses 1024-byte blocks.
116
+ // Both hard and soft RLIMIT_FSIZE are set before exec; polling cannot overshoot the disk bound.
117
+ const child = spawn("/bin/bash", ["--noprofile", "--norc", "-c", 'ulimit -f 1024 || exit; exec /usr/bin/env -i PATH=/usr/bin:/bin LANG=C.UTF-8 "$@"',
118
+ "usage", process.execPath, entry, ...args], { stdio: ["ignore", 1, 2], shell: false });
119
+ let error;
120
+ const stop = (cause) => {
121
+ error ??= String(cause);
122
+ try {
123
+ child.kill("SIGKILL");
124
+ }
125
+ catch (cause) {
126
+ error += `; zatrzymanie: ${String(cause)}`;
127
+ }
128
+ };
129
+ const check = () => {
130
+ try {
131
+ for (const [fd, stream] of [[1, "stdout"], [2, "stderr"]]) {
132
+ if (fs.fstatSync(fd).size >= 1048576)
133
+ stop(new Error(`${stream}: osiągnięty limit zapisu 1048576 bajtów`));
134
+ }
135
+ }
136
+ catch (cause) {
137
+ stop(cause);
138
+ }
139
+ };
140
+ // Node may ignore SIGXFSZ and the program may catch EFBIG and retry forever.
141
+ const monitor = setInterval(check, 10);
142
+ child.on("error", stop);
143
+ child.on("close", (status, signal) => {
144
+ clearInterval(monitor);
145
+ check();
146
+ try {
147
+ fs.writeFileSync(report, JSON.stringify({ status, signal, error }), { flag: "wx", mode: 0o600 });
148
+ }
149
+ catch (cause) {
150
+ console.error(`Zapis wyniku nadzoru: ${String(cause)}`);
151
+ process.exitCode = 1;
152
+ }
153
+ });
154
+ }
155
+ /** One synchronous usage; a fixed shell launcher sets the file limit without evaluating card commands. */
111
156
  export function runLocalUsage(input) {
112
157
  let stage = "wejście", published = false, lock, pending;
113
158
  let root, run, result;
@@ -205,10 +250,35 @@ export function runLocalUsage(input) {
205
250
  if (lstatSync(artifact, { throwIfNoEntry: false }))
206
251
  throw new Error("Artefakt istnieje przed użyciem");
207
252
  stage = "proces";
208
- const executed = spawnSync(process.execPath, [entry, ...input.program.args], { cwd: copy, env, encoding: "utf8", shell: false });
253
+ const stdoutFile = path.join(run, "stdout"), stderrFile = path.join(run, "stderr");
254
+ const reportFile = path.join(run, "outcome.json");
255
+ const fdOut = openSync(stdoutFile, "wx", 0o600);
256
+ let fdErr, outcome;
257
+ try {
258
+ fdErr = openSync(stderrFile, "wx", 0o600);
259
+ const executed = spawnSync(process.execPath, ["-e", `(${usageSupervisor.toString()})().catch(error => { process.exitCode = 1; console.error(error) })`, reportFile, entry, ...input.program.args], { cwd: copy, env, encoding: "utf8", shell: false, stdio: ["ignore", fdOut, fdErr] });
260
+ outcome = executed;
261
+ if (cleanExit(executed)) {
262
+ const report = z.strictObject({ status: z.number().int().nullable(), signal: z.string().nullable(), error: z.string().optional() })
263
+ .parse(JSON.parse(bounded(reportFile)));
264
+ if (report.error)
265
+ throw new Error(report.error);
266
+ outcome = { ...executed, status: report.status, signal: report.signal };
267
+ }
268
+ }
269
+ finally {
270
+ try {
271
+ closeSync(fdOut);
272
+ }
273
+ finally {
274
+ if (fdErr !== undefined)
275
+ closeSync(fdErr);
276
+ }
277
+ }
278
+ const stdout = boundedBytes(stdoutFile).toString("utf8"), stderr = boundedBytes(stderrFile).toString("utf8");
209
279
  const finishedAt = new Date().toISOString();
210
- if (!cleanExit(executed))
211
- throw new Error(`Proces użycia: status=${executed.status}, signal=${executed.signal}; stdout=${executed.stdout ?? ""}; stderr=${executed.stderr ?? ""}${executed.error ? `; error=${failure(executed.error)}` : ""}`, { cause: executed.error });
280
+ if (!cleanExit(outcome))
281
+ throw new Error(`Proces użycia: status=${outcome.status}, signal=${outcome.signal}; stdout=${stdout}; stderr=${stderr}${outcome.error ? `; error=${failure(outcome.error)}` : ""}`, { cause: outcome.error });
212
282
  stage = "weryfikacja po wykonaniu";
213
283
  verify();
214
284
  stage = "SHA po wykonaniu";
@@ -221,7 +291,7 @@ export function runLocalUsage(input) {
221
291
  within(root, ref);
222
292
  syncDirectory(path.dirname(saved));
223
293
  result = eventSchema.parse({ id, at: finishedAt, sha, ref,
224
- operation: input.operation, result: JSON.stringify({ exit: executed.status, stdout: executed.stdout ?? "", stderr: executed.stderr ?? "" }) });
294
+ operation: input.operation, result: JSON.stringify({ exit: outcome.status, stdout, stderr }) });
225
295
  stage = "walidacja zapisu";
226
296
  // Stable key order; validate JSON before serializing so undefined never silently disappears.
227
297
  const line = JSON.stringify(z.json().parse(Object.fromEntries(Object.entries(result).sort(([a], [b]) => a.localeCompare(b))))) + "\n";
package/dist/roles.d.ts CHANGED
@@ -17,7 +17,7 @@ export interface Role {
17
17
  export declare function rolesDir(): string;
18
18
  export declare function parseRole(file: Role["file"], text: string): Role;
19
19
  export declare function loadRoles(dir?: string): Role[];
20
- export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.49 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
20
+ export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.51 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
21
21
  export type AgentFlavor = "claude" | "codex" | "opencode";
22
22
  /** How the operator starts the Builder for one card in its own session (the card id is not a secret). */
23
23
  export declare function builderStartCommand(flavor: AgentFlavor, codexRolePath?: string): string;
package/docs/README.en.md CHANGED
@@ -1,4 +1,4 @@
1
- # robisie — from account to accepted card (package 0.5.49) <!-- x-release-please-version -->
1
+ # robisie — from account to accepted card (package 0.5.51) <!-- x-release-please-version -->
2
2
 
3
3
  In the project directory with its engine configuration, run `npx robisie init`, then `npx robisie doctor`: init prepares the project goal and tester protection list, and doctor checks both inputs.
4
4
 
package/docs/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # robisie — od konta do odebranej karty (paczka 0.5.49) <!-- x-release-please-version -->
1
+ # robisie — od konta do odebranej karty (paczka 0.5.51) <!-- x-release-please-version -->
2
2
 
3
3
  W katalogu projektu z konfiguracją silnika uruchom `npx robisie init`, potem `npx robisie doctor`: init przygotuje cel projektu i listę ochrony testera, a doctor sprawdzi oba wejścia.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robisie",
3
- "version": "0.5.49",
3
+ "version": "0.5.51",
4
4
  "description": "Instalator klienta robisie: łączy agenta (Claude Code, Codex CLI, OpenCode) z tablicą robisie i instaluje role klienta.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",