robisie 0.5.26 → 0.5.27

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,15 @@
1
1
  # Historia zmian klienta / Client changelog
2
2
 
3
+ ## [0.5.27](https://github.com/chuppa12/robisie-app/compare/client-v0.5.26...client-v0.5.27) (2026-11-14)
4
+
5
+
6
+ ### Factory Cards
7
+
8
+ * praca workera task-mwfyliua-tek9cp (auto-commit) ([007b581](https://github.com/chuppa12/robisie-app/commit/007b5817caa02586400d300ff800c2b629e1e749))
9
+ * praca workera task-mwg09qgw-cfk5u1 (auto-commit) ([e94b6a7](https://github.com/chuppa12/robisie-app/commit/e94b6a729c0460b7140af749670f1049302797b0))
10
+ * S1-1 41938e2e — rebase operatora + rozwiązanie konfliktu z D (porada 010 §5) ([c9df2c9](https://github.com/chuppa12/robisie-app/commit/c9df2c9105fe86c595ebce1e1c7247cc62028d13))
11
+ * S1-1 41938e2e — usunięcie raportu dowodowego Workera z drzewa (Z-S1-1-DOWOD-POZA-REPO) ([ac58411](https://github.com/chuppa12/robisie-app/commit/ac58411d35116563de11514b936a3ef1bba3aad5))
12
+
3
13
  ## [0.5.26](https://github.com/chuppa12/robisie-app/compare/client-v0.5.25...client-v0.5.26) (2026-11-14)
4
14
 
5
15
 
package/dist/cli.js CHANGED
@@ -1,19 +1,20 @@
1
1
  #!/usr/bin/env node
2
- import { lstatSync, realpathSync } from "node:fs";
2
+ import { lstatSync, readFileSync, realpathSync } from "node:fs";
3
3
  import { resolve } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
  import { z } from "zod";
6
6
  import { AGENT_IDS, isAgentId } from "./agents.js";
7
- import { doctor, init, recoveryStep, uninstall } from "./commands.js";
7
+ import { doctor, doctorClientPair, init, recoveryStep, uninstall } from "./commands.js";
8
8
  import { HELPER_SERVERS, PACKAGE_VERSION } from "./constants.js";
9
9
  import { RobisieError, errorMessage, nodeCtx } from "./context.js";
10
10
  import { DEFAULT_LOGIN_TIMEOUT_SECONDS } from "./device-login.js";
11
11
  import { runFactory } from "./factory-run.js";
12
- import { checkInputs, inputDirectory, INPUTS_OK } from "./engine-inputs.js";
12
+ import { CONFIG_FILE, loadEngineConfig } from "./engine-config.js";
13
+ import { checkInputs, inputDirectory, INPUTS_OK, selectInputDirectory } from "./engine-inputs.js";
13
14
  import { isHelperServer, runHelper } from "./helpers.js";
14
15
  import { closeInstallation, initNeedsLogin, login, openInstallation } from "./login.js";
15
16
  import { ROLE_IDS, ROLE_STEP } from "./manifest.js";
16
- import { doctorEngineConfig } from "./role-registry.js";
17
+ import { doctorEngineConfig, loadRoleRegistryConfig, validateClientRoles } from "./role-registry.js";
17
18
  import { bounded, runLocalUsage } from "./local-usage.js";
18
19
  const usageText = z.string().trim().min(1);
19
20
  const usageAt = z.iso.datetime({ offset: true });
@@ -198,6 +199,28 @@ export async function run(argv, ctx) {
198
199
  }
199
200
  if (args.command === "login")
200
201
  return await login(ctx, { wait: args.wait, timeoutSeconds: args.timeout ?? undefined });
202
+ if (args.command === "init") {
203
+ selectInputDirectory(ctx, args.engineConfig);
204
+ let selected = args.engineConfig ?? (ctx.env.ROBISIE_ENGINE_CONFIG?.trim() ? ctx.env.ROBISIE_ENGINE_CONFIG : null);
205
+ if (selected === null) {
206
+ try {
207
+ const raw = JSON.parse(readFileSync(resolve(ctx.cwd, CONFIG_FILE), "utf8").replace(/^\uFEFF/, ""));
208
+ if (raw && typeof raw === "object" && Object.hasOwn(raw, "engine"))
209
+ selected = CONFIG_FILE;
210
+ }
211
+ catch (error) {
212
+ if (error?.code !== "ENOENT")
213
+ throw new RobisieError("Nie mogę odczytać konfiguracji silnika.", `Popraw plik ${CONFIG_FILE} i ponów init.`);
214
+ }
215
+ }
216
+ if (selected !== null) {
217
+ const configPath = resolve(ctx.cwd, selected);
218
+ if (loadEngineConfig(configPath).engine.mode !== "host") {
219
+ const { roleRegistry } = loadRoleRegistryConfig(configPath);
220
+ validateClientRoles(roleRegistry["worker-client"], roleRegistry["reviewer-client"]);
221
+ }
222
+ }
223
+ }
201
224
  if (args.command === "init" && initNeedsLogin(ctx, args.keyStdin)) {
202
225
  const code = await login(ctx, { wait: true });
203
226
  if (code !== 0)
@@ -234,11 +257,13 @@ export async function run(argv, ctx) {
234
257
  case "doctor":
235
258
  if (args.engineConfig !== null) {
236
259
  const configPath = resolve(ctx.cwd, args.engineConfig);
237
- return doctorEngineConfig(ctx, args.engineConfig, config => {
260
+ return doctorEngineConfig(ctx, args.engineConfig, (config, registry) => {
238
261
  if (config.engine.delivery === "local") {
239
262
  checkInputs(inputDirectory(config), configPath);
240
263
  ctx.out(INPUTS_OK);
241
264
  }
265
+ if (config.engine.mode !== "host")
266
+ doctorClientPair(ctx, registry);
242
267
  });
243
268
  }
244
269
  if (ctx.env.ROBISIE_KEY) {
@@ -1,6 +1,7 @@
1
1
  import { type AgentId } from "./agents.js";
2
2
  import { type Ctx } from "./context.js";
3
3
  import { type RoleProviders } from "./manifest.js";
4
+ import { type EngineRoleRegistry } from "./role-registry.js";
4
5
  export interface InitOptions {
5
6
  agents: AgentId[] | null;
6
7
  roles?: Partial<RoleProviders>;
@@ -21,6 +22,8 @@ export declare const loginIo: {
21
22
  status: number | null;
22
23
  };
23
24
  };
25
+ /** Uses the registry already read by doctorEngineConfig, without reopening configuration. */
26
+ export declare function doctorClientPair(ctx: Ctx, registry: EngineRoleRegistry): void;
24
27
  /** Returns the process exit code: 0 = all good, 1 = something needs one action. */
25
28
  export declare function doctor(ctx: Ctx): Promise<number>;
26
29
  export declare function uninstall(ctx: Ctx): number;
package/dist/commands.js CHANGED
@@ -14,6 +14,7 @@ import { clientPaths, ensurePrivateDir, loginFields, readKey, readManifest, writ
14
14
  import { assertCompatible, checkConnection, fetchContractVersion } from "./mcp.js";
15
15
  import { loadRoles, MANAGED_LINE, rolesDir } from "./roles.js";
16
16
  import { checkInputs, createInputs, INPUTS_OK, preflightInputs, selectInputDirectory } from "./engine-inputs.js";
17
+ import { validateClientRoles } from "./role-registry.js";
17
18
  import { PlanerClient } from "./planer-client.js";
18
19
  const NO_KEY_STEP = "Wygeneruj klucz worker na https://robisie.app/dashboard/connect; w zsh/bash wykonaj `unset ROBISIE_KEY`, potem lokalne `npx robisie init` i wklej klucz w ukrytym pytaniu (poza rozmową).";
19
20
  const KEY_FORMAT_STEP = `Skopiuj klucz jeszcze raz z https://robisie.app/dashboard/connect; ustaw poprawny ROBISIE_KEY w środowisku lokalnego init (poza rozmową i historią poleceń) albo przekaż klucz przez stdin z jawną flagą: \`npx robisie init --key-stdin\` (poza rozmową i historią poleceń). Następnie wczytaj zapisany klucz do bieżącej sesji POSIX z tym samym XDG_CONFIG_HOME: \`${SHELL_EXPORT}\`, potem uruchom \`npx robisie doctor\`.`;
@@ -286,21 +287,21 @@ function findProgram(cwd, path, name) {
286
287
  return null;
287
288
  }
288
289
  /** Login of the client execution pair (Codex worker, Grok reviewer) as the engine starts them. */
289
- function pairReadiness(ctx, fail) {
290
+ function pairReadiness(ctx, fail, registry) {
290
291
  const home = ctx.env.HOME || ctx.home;
291
292
  const env = {};
292
293
  for (const name of PAIR_ENV)
293
294
  if (ctx.env[name] !== undefined)
294
295
  env[name] = ctx.env[name];
295
296
  env.HOME = home;
296
- const grokEnv = { ...env, PATH: `${join(home, ".local/bin")}${delimiter}${env.PATH ?? ""}` };
297
+ const reviewEnv = { ...env, PATH: `${join(home, ".local/bin")}${delimiter}${env.PATH ?? ""}` };
297
298
  const retry = "Potem ponów `npx robisie doctor`.";
298
299
  let unchecked = false;
299
300
  let failed = false;
300
301
  const codex = findProgram(ctx.cwd, env.PATH ?? "", "codex");
301
302
  if (!codex) {
302
303
  unchecked = true;
303
- ctx.out("! Codex: brak programu codex w PATH — logowania NIE SPRAWDZONO.");
304
+ fail("Codex: brak programu codex w PATH — logowania NIE SPRAWDZONO.", "Zainstaluj Codex CLI i ponów doctor.");
304
305
  }
305
306
  else if (loginIo.run(codex, ["login", "status"], env, ctx.cwd).status === 0) {
306
307
  ctx.out(`✓ Codex zalogowany (\`codex login status\`, HOME=${home}).`);
@@ -310,20 +311,45 @@ function pairReadiness(ctx, fail) {
310
311
  fail(`Codex nie jest zalogowany w środowisku silnika (HOME=${home}).`, `Zaloguj Codex: \`codex login --device-auth\`. ${retry}`);
311
312
  }
312
313
  // Grok CLI has no login-status command; `grok models` lists models without a paid model call.
313
- const grok = findProgram(ctx.cwd, grokEnv.PATH, "grok");
314
+ const grok = findProgram(ctx.cwd, reviewEnv.PATH, "grok");
314
315
  if (!grok) {
315
316
  unchecked = true;
316
- ctx.out("! Grok: brak programu grok w PATH — logowania NIE SPRAWDZONO.");
317
+ fail("Grok: brak programu grok w PATH — logowania NIE SPRAWDZONO.", "Zainstaluj Grok CLI i ponów doctor.");
317
318
  }
318
- else if (loginIo.run(grok, ["models"], grokEnv, ctx.cwd).status === 0) {
319
+ else if (loginIo.run(grok, ["models"], reviewEnv, ctx.cwd).status === 0) {
319
320
  ctx.out(`✓ Grok prawdopodobnie zalogowany (\`grok models\` działa; Grok CLI nie ma polecenia statusu logowania; HOME=${home}).`);
320
321
  }
321
322
  else {
322
323
  failed = true;
323
324
  fail(`Grok: nie potwierdzono zalogowania w środowisku silnika (HOME=${home}; \`grok models\` zakończył się błędem).`, `Zaloguj Grok: \`grok login --device-auth\`. ${retry}`);
324
325
  }
326
+ if (registry?.["reviewer-client"].provider === "claude") {
327
+ const claude = findProgram(ctx.cwd, reviewEnv.PATH, "claude");
328
+ if (!claude) {
329
+ unchecked = true;
330
+ fail("Claude: brak programu claude w PATH — logowania NIE SPRAWDZONO.", "Zainstaluj Claude CLI i ponów doctor.");
331
+ }
332
+ else if (loginIo.run(claude, ["auth", "status"], reviewEnv, ctx.cwd).status === 0) {
333
+ ctx.out(`✓ Claude zalogowany (\`claude auth status\`, HOME=${home}).`);
334
+ }
335
+ else {
336
+ failed = true;
337
+ fail("Claude: nie potwierdzono zalogowania w środowisku silnika.", "Zaloguj Claude: `claude auth login`. " + retry);
338
+ }
339
+ }
325
340
  return failed ? "niegotowa" : unchecked ? "NIE SPRAWDZONO" : "sprawdzona (Grok: prawdopodobnie zalogowany)";
326
341
  }
342
+ /** Uses the registry already read by doctorEngineConfig, without reopening configuration. */
343
+ export function doctorClientPair(ctx, registry) {
344
+ validateClientRoles(registry["worker-client"], registry["reviewer-client"]);
345
+ const reviewer = registry["reviewer-client"];
346
+ ctx.out(`Recenzent: ${reviewer.provider}/${reviewer.model}; niezależność: ${reviewer.requireIndependentProvider === false ? "częściowa: bez niezależnego sprawdzenia" : "wymagana"}.`);
347
+ const problems = [];
348
+ const readiness = pairReadiness(ctx, (line, next) => { ctx.out(`✗ ${line}`); problems.push(next); }, registry);
349
+ ctx.out(`Gotowość wykonawców: ${readiness}.`);
350
+ if (problems.length)
351
+ throw new RobisieError("Wykonawcy klienta niegotowi.", problems[0]);
352
+ }
327
353
  /** Returns the process exit code: 0 = all good, 1 = something needs one action. */
328
354
  export async function doctor(ctx) {
329
355
  let policyLine = "! Polityka enforced: NIE SPRAWDZONO — odczyt nieudany.";
@@ -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.26";
3
+ export declare const PACKAGE_VERSION = "0.5.27";
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.26"; // x-release-please-version
3
+ export const PACKAGE_VERSION = "0.5.27"; // 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":"23c06814a6bfd34a787d37b27c2e2f0183e15a11","dirty":false}
1
+ {"schema":1,"sha":"6579bcc0996608231044a9b18c93699fc44e5b51","dirty":false}
@@ -1673,14 +1673,14 @@
1673
1673
  "staticOperations": {
1674
1674
  "beforePreflight": {
1675
1675
  "module": "maszynista/tick.ts",
1676
- "startLine": 9619,
1677
- "endLine": 9732,
1676
+ "startLine": 9625,
1677
+ "endLine": 9738,
1678
1678
  "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();"
1679
1679
  },
1680
1680
  "finalization": {
1681
1681
  "module": "maszynista/tick.ts",
1682
- "startLine": 10021,
1683
- "endLine": 10073,
1682
+ "startLine": 10027,
1683
+ "endLine": 10079,
1684
1684
  "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] ?? \"\"))) {"
1685
1685
  },
1686
1686
  "refreshTickReport": {
@@ -1706,6 +1706,6 @@
1706
1706
  "status": 0,
1707
1707
  "signal": null,
1708
1708
  "stdout": "v24.3.0\n",
1709
- "stderr": "(node:16281) 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"
1709
+ "stderr": "(node:17970) 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"
1710
1710
  }
1711
1711
  }
@@ -37628,7 +37628,7 @@ var init_constants = __esm({
37628
37628
  "packages/client/src/constants.ts"() {
37629
37629
  "use strict";
37630
37630
  PACKAGE_NAME = "robisie";
37631
- PACKAGE_VERSION = "0.5.26";
37631
+ PACKAGE_VERSION = "0.5.27";
37632
37632
  SUPPORTED_CONTRACT_MAJOR = 1;
37633
37633
  DEFAULT_ORIGIN = "https://robisie.app";
37634
37634
  MCP_SERVER_NAME = "robisie";
@@ -37918,7 +37918,7 @@ function parseRoleRegistry(raw, configPath) {
37918
37918
  if (!Object.hasOwn(registry2, role3) || !object2(registry2[role3])) fail2(configPath, path34, "wymagany w\u0142asny wpis {name, provider, model, effort}");
37919
37919
  const entry2 = registry2[role3];
37920
37920
  for (const key of Object.keys(entry2)) {
37921
- if (!FIELDS.includes(key)) fail2(configPath, path34, "nieznane pole; dozwolone: " + FIELDS.join(", "));
37921
+ if (!FIELDS.includes(key) && !(role3 === "reviewer-client" && key === "requireIndependentProvider")) fail2(configPath, path34, "nieznane pole; dozwolone: " + FIELDS.join(", "));
37922
37922
  }
37923
37923
  for (const field of FIELDS) {
37924
37924
  if (!Object.hasOwn(entry2, field) || typeof entry2[field] !== "string" || !entry2[field].trim()) {
@@ -37928,15 +37928,28 @@ function parseRoleRegistry(raw, configPath) {
37928
37928
  if (!PROVIDERS.includes(entry2.provider)) {
37929
37929
  fail2(configPath, `${path34}.provider`, "dozwoleni dostawcy: " + PROVIDERS.join(", "));
37930
37930
  }
37931
+ if (Object.hasOwn(entry2, "requireIndependentProvider") && typeof entry2.requireIndependentProvider !== "boolean")
37932
+ fail2(configPath, `${path34}.requireIndependentProvider`, "wymagany boolean true albo false");
37931
37933
  result[role3] = {
37932
37934
  name: entry2.name,
37933
37935
  provider: entry2.provider,
37934
37936
  model: entry2.model,
37935
- effort: entry2.effort
37937
+ effort: entry2.effort,
37938
+ ...Object.hasOwn(entry2, "requireIndependentProvider") ? { requireIndependentProvider: entry2.requireIndependentProvider } : {}
37936
37939
  };
37937
37940
  }
37938
37941
  return result;
37939
37942
  }
37943
+ function validateClientRoles(worker, reviewer) {
37944
+ if (worker.provider !== "codex" || !["codex", "claude", "grok"].includes(reviewer.provider))
37945
+ throw new RobisieError("Worker klienta wymaga Codex; recenzent klienta: Codex, Claude albo Grok.", "Wybierz obs\u0142ugiwanego dostawc\u0119 w rejestrze.");
37946
+ if (Object.hasOwn(reviewer, "requireIndependentProvider") && typeof reviewer.requireIndependentProvider !== "boolean")
37947
+ throw new RobisieError("requireIndependentProvider wymaga boolean true albo false.", "Popraw konfiguracj\u0119 recenzenta.");
37948
+ if (reviewer.provider === "grok" && (reviewer.model !== "grok-cli" || reviewer.effort !== "none"))
37949
+ throw new RobisieError("Recenzent Grok wymaga grok-cli/none.", "Popraw model i effort recenzenta.");
37950
+ if (reviewer.provider === worker.provider && reviewer.requireIndependentProvider !== false)
37951
+ throw new RobisieError("Wymagana niezale\u017Cno\u015B\u0107: wybierz innego dostawc\u0119 lub jawnie wy\u0142\u0105cz wym\xF3g przez requireIndependentProvider=false.", "Wybierz innego dostawc\u0119 lub jawne false.");
37952
+ }
37940
37953
  function resolveRoleExecution(registry2, role3) {
37941
37954
  if (!ROLES.includes(role3) || !Object.hasOwn(registry2, role3)) {
37942
37955
  throw new RobisieError("Brak wybranej roli w rejestrze.", "Wybierz rol\u0119 obecn\u0105 w sprawdzonej konfiguracji rejestru.");
@@ -37974,7 +37987,7 @@ function loadRoleRegistryConfig(path34) {
37974
37987
  }
37975
37988
  function doctorEngineConfig(ctx, path34, afterLoad) {
37976
37989
  const { roleRegistry, config: config2 } = loadRoleRegistryConfig((0, import_node_path3.resolve)(ctx.cwd, path34));
37977
- afterLoad?.(config2);
37990
+ afterLoad?.(config2, roleRegistry);
37978
37991
  for (const role3 of ROLES) {
37979
37992
  const { name: name3, provider, model, effort } = roleRegistry[role3];
37980
37993
  ctx.out(`${role3} \u2192 ${name3} / ${provider} / ${model} / ${effort}`);
@@ -76831,12 +76844,21 @@ var init_local_usage = __esm({
76831
76844
  function entry(value) {
76832
76845
  if (!value || [value.name, value.provider, value.model, value.effort].some((v) => typeof v !== "string" || !v.trim()))
76833
76846
  throw new ClientPairHold("niepe\u0142ny wpis roli");
76834
- return Object.freeze({ name: value.name, provider: value.provider, model: value.model, effort: value.effort });
76847
+ return Object.freeze({
76848
+ name: value.name,
76849
+ provider: value.provider,
76850
+ model: value.model,
76851
+ effort: value.effort,
76852
+ ...Object.hasOwn(value, "requireIndependentProvider") ? { requireIndependentProvider: value.requireIndependentProvider } : {}
76853
+ });
76835
76854
  }
76836
76855
  function selectionOf(workerEntry, reviewerEntry) {
76837
76856
  const worker = entry(workerEntry), reviewer = entry(reviewerEntry);
76838
- if (worker.provider !== "codex" || reviewer.provider !== "grok" || reviewer.model !== "grok-cli" || reviewer.effort !== "none")
76839
- throw new ClientPairHold("wymagana para Codex \u2192 Grok (grok-cli/none)");
76857
+ try {
76858
+ validateClientRoles(worker, reviewer);
76859
+ } catch (error48) {
76860
+ throw new ClientPairHold(error48 instanceof Error ? error48.message : "niepoprawna para");
76861
+ }
76840
76862
  const registrySha256 = (0, import_node_crypto11.createHash)("sha256").update(JSON.stringify({ version: 1, worker, reviewer })).digest("hex");
76841
76863
  return Object.freeze({ worker, reviewer, registrySha256 });
76842
76864
  }
@@ -76846,7 +76868,7 @@ function selectClientPair(registry2) {
76846
76868
  const reviewer = resolveRoleExecution(registry2, "reviewer-client");
76847
76869
  return selectionOf(
76848
76870
  { name: registry2["worker-client"].name, provider: worker.provider, model: worker.model, effort: worker.effortRequested },
76849
- { name: registry2["reviewer-client"].name, provider: reviewer.provider, model: reviewer.model, effort: reviewer.effortRequested }
76871
+ { ...registry2["reviewer-client"], name: registry2["reviewer-client"].name, provider: reviewer.provider, model: reviewer.model, effort: reviewer.effortRequested }
76850
76872
  );
76851
76873
  } catch (error48) {
76852
76874
  if (error48 instanceof ClientPairHold) throw error48;
@@ -77653,7 +77675,7 @@ function completion(dir, claim, response, timestamp3, stop = "", legacyShape = f
77653
77675
  sha: p.tester.delivery.sha,
77654
77676
  ref: `${archive}#/input/prepared/authors`
77655
77677
  },
77656
- independence_level: "full",
77678
+ ...p.pair.selection.reviewer.requireIndependentProvider === false ? { independence_level: "partial", independence_note: "cz\u0119\u015Bciowa: bez niezale\u017Cnego sprawdzenia" } : { independence_level: "full" },
77657
77679
  provenance: {
77658
77680
  packet_hash: claim.packetHash,
77659
77681
  attempt: p.tester.delivery,
@@ -92148,13 +92170,9 @@ function independentAttempt(value) {
92148
92170
  const attempt = record15(value);
92149
92171
  return attempt.provider === "xai" && attempt.requestedModel === "grok-cli" || attempt.provider === "opencode-go" && independentModel(attempt.requestedModel) || attempt.provider === "anthropic" && claudeFamily(attempt.requestedModel) !== null || attempt.provider === "independent" && attempt.requestedModel === "review-backend";
92150
92172
  }
92151
- function verifyIndependentAttempt(value, raw, sha5) {
92152
- const attempt = record15(value);
92153
- if (!independentAttempt(attempt) || attempt.sourceSha !== sha5 || raw.sourceSha !== sha5 || typeof raw.sourcePrompt !== "string" || attempt.sourcePromptSha256 !== (0, import_node_crypto27.createHash)("sha256").update(raw.sourcePrompt).digest("hex")) {
92154
- throw new Error("PARK_GROK_RECEIPT: missing exact source/reviewer");
92155
- }
92156
- if (Object.hasOwn(raw, "transcript") || raw.sourcePrompt.includes(SOURCE_PROTOCOL)) {
92157
- verifySourceTranscript(raw.sourcePrompt, raw.transcript);
92173
+ function verifyAttemptTranscript(attempt, raw, sourcePrompt2) {
92174
+ if (Object.hasOwn(raw, "transcript") || sourcePrompt2.includes(SOURCE_PROTOCOL)) {
92175
+ verifySourceTranscript(sourcePrompt2, raw.transcript);
92158
92176
  const transcript = raw.transcript;
92159
92177
  for (let round = 1; round <= transcript.rounds; round++) {
92160
92178
  const call = transcript.invocations.filter((call2) => call2.round === round).at(-1);
@@ -92162,6 +92180,7 @@ function verifyIndependentAttempt(value, raw, sha5) {
92162
92180
  let answer;
92163
92181
  if (attempt.provider === "xai") answer = sourceAnswer(call.output, "grok", String(attempt.requestedModel)).text;
92164
92182
  else if (attempt.provider === "anthropic") answer = sourceAnswer(call.output, "claude", String(attempt.requestedModel)).text;
92183
+ else if (attempt.provider === "openai") answer = call.output;
92165
92184
  else {
92166
92185
  const parsed = openCodeText(call.output, String(attempt.requestedModel));
92167
92186
  openCodeExport(call.export, parsed.session, parsed.message, String(attempt.requestedModel), parsed.text);
@@ -92184,6 +92203,13 @@ function verifyIndependentAttempt(value, raw, sha5) {
92184
92203
  const last2 = transcript.invocations.at(-1);
92185
92204
  if (last2.output !== raw.output || (last2.export || void 0) !== (raw.export || void 0)) throw new Error("PARK_GROK_RECEIPT: final invocation mismatch");
92186
92205
  }
92206
+ }
92207
+ function verifyIndependentAttempt(value, raw, sha5) {
92208
+ const attempt = record15(value);
92209
+ if (!independentAttempt(attempt) || attempt.sourceSha !== sha5 || raw.sourceSha !== sha5 || typeof raw.sourcePrompt !== "string" || attempt.sourcePromptSha256 !== (0, import_node_crypto27.createHash)("sha256").update(raw.sourcePrompt).digest("hex")) {
92210
+ throw new Error("PARK_GROK_RECEIPT: missing exact source/reviewer");
92211
+ }
92212
+ verifyAttemptTranscript(attempt, raw, raw.sourcePrompt);
92187
92213
  let observedText;
92188
92214
  if (attempt.provider === "xai") {
92189
92215
  const parsed = grokText(String(raw.output));
@@ -92204,6 +92230,17 @@ function verifyIndependentAttempt(value, raw, sha5) {
92204
92230
  }
92205
92231
  if (observedText !== raw.text || parseReviewVerdict(observedText) !== attempt.parser) throw new Error("PARK_GROK_RECEIPT: text/verdict mismatch");
92206
92232
  }
92233
+ function verifyClientAttempt(value, raw, sha5) {
92234
+ const attempt = record15(value);
92235
+ if (attempt.provider !== "openai") {
92236
+ verifyIndependentAttempt(value, raw, sha5);
92237
+ return;
92238
+ }
92239
+ const observed = runtimeEvidence(String(raw.stderr)).confirmedModel;
92240
+ if (!observed || observed !== attempt.requestedModel || observed !== attempt.confirmedModel || raw.output !== raw.text || parseReviewVerdict(String(raw.output)) !== attempt.parser || attempt.sourceSha !== sha5 || raw.sourceSha !== sha5 || typeof raw.sourcePrompt !== "string" || attempt.sourcePromptSha256 !== (0, import_node_crypto27.createHash)("sha256").update(raw.sourcePrompt).digest("hex"))
92241
+ throw new ClientPairHold("niezgodna to\u017Csamo\u015B\u0107, tekst lub \u017Ar\xF3d\u0142o procesu Codex");
92242
+ verifyAttemptTranscript(attempt, raw, raw.sourcePrompt);
92243
+ }
92207
92244
  function goModel(worktree) {
92208
92245
  const usage = readCompletedUsage(
92209
92246
  import_node_path41.default.join(worktree, "config/maszynista-review-models.json"),
@@ -92500,7 +92537,7 @@ function runReview(input) {
92500
92537
  }
92501
92538
  }
92502
92539
  const worker = record15(record15(input.freshness).worker);
92503
- const xaiWorker2 = worker.backend === "grok" || worker.provider === "xai";
92540
+ const xaiWorker2 = !client && (worker.backend === "grok" || worker.provider === "xai");
92504
92541
  const policy = client ? void 0 : input.policy;
92505
92542
  if (!client && !xaiWorker2 && (policy || readReviewPolicy()) && isReviewRecoveryKey(input.key, `${input.cardId}:${input.sha}:${input.round}`)) {
92506
92543
  try {
@@ -92523,7 +92560,7 @@ function runReview(input) {
92523
92560
  } catch (error48) {
92524
92561
  throw new Error(`ACTIONABLE: TMPDIR recenzenta: ${errorText4(error48)}`);
92525
92562
  }
92526
- let independent;
92563
+ const clientReviewer = client ? input.clientPair.selection.reviewer : void 0;
92527
92564
  let finalText = "";
92528
92565
  let finalVerdict = "UNAVAILABLE";
92529
92566
  let route = xaiWorker2 ? "sol" : client ? "grok" : policy ? policy.cardClass === "ordinary" ? "sol" : "grok" : input.retryGrok ? "grok" : "opencode";
@@ -92575,11 +92612,12 @@ function runReview(input) {
92575
92612
  cwd = reviewEnv.TMPDIR;
92576
92613
  args = [];
92577
92614
  } else if (route === "grok") {
92615
+ let independent;
92578
92616
  try {
92579
- independent = client ? { backend: "grok-cli" } : policy ? policy.cardClass === "strategic" || opusFallback ? { backend: "claude", model: "opus" } : { backend: "grok-cli" } : readIndependentBackend();
92580
- if (!client && !policy && isReviewRecoveryKey(input.key, `${input.cardId}:${input.sha}:${input.round}`) && input.key !== reviewRecoveryKey(input.cardId, input.sha, input.round, input.packagingLoadedSha, independent))
92617
+ independent = clientReviewer ? clientReviewer.provider === "grok" ? { backend: "grok-cli" } : { backend: clientReviewer.provider, model: clientReviewer.model } : policy ? policy.cardClass === "strategic" || opusFallback ? { backend: "claude", model: "opus" } : { backend: "grok-cli" } : readIndependentBackend();
92618
+ if (!client && !policy && independent.backend !== "codex" && isReviewRecoveryKey(input.key, `${input.cardId}:${input.sha}:${input.round}`) && input.key !== reviewRecoveryKey(input.cardId, input.sha, input.round, input.packagingLoadedSha, independent))
92581
92619
  throw new Error("review-backend: recovery configuration changed before execution");
92582
- if (!policy && independent.backend === "claude") requireOppositeClaudeWorker(input);
92620
+ if (!client && !policy && independent.backend === "claude") requireOppositeClaudeWorker(input);
92583
92621
  } catch (error48) {
92584
92622
  const diagnostic = errorText4(error48);
92585
92623
  const vendorError = diagnostic.startsWith("review-backend: worker vendor");
@@ -92659,6 +92697,11 @@ function runReview(input) {
92659
92697
  "--settings",
92660
92698
  '{"disableAllHooks":true}'
92661
92699
  ];
92700
+ if (clientReviewer) {
92701
+ effort = clientReviewer.effort;
92702
+ if (bin === "claude") args.push("--effort", effort);
92703
+ if (bin === "codex") args = ["-c", `review_model=${JSON.stringify(model)}`, "-c", `model_reasoning_effort=${JSON.stringify(effort)}`, "review", "-"];
92704
+ }
92662
92705
  if (policy && bin === "claude") {
92663
92706
  effort = "medium";
92664
92707
  args.push("--effort", effort);
@@ -92724,7 +92767,7 @@ function runReview(input) {
92724
92767
  invoked = true;
92725
92768
  const result = (0, import_node_child_process18.spawnSync)(bin, args, {
92726
92769
  cwd,
92727
- input: bin === "opencode" || bin === "claude" ? prompt2 : void 0,
92770
+ input: bin === "opencode" || bin === "claude" || clientReviewer?.provider === "codex" ? prompt2 : void 0,
92728
92771
  encoding: "utf8",
92729
92772
  env,
92730
92773
  timeout,
@@ -92761,7 +92804,7 @@ function runReview(input) {
92761
92804
  finalText = parsed.text;
92762
92805
  confirmedModel = expectedModel;
92763
92806
  quota = parsed.quota;
92764
- } else if (route === "grok") {
92807
+ } else if (route === "grok" && bin !== "codex") {
92765
92808
  const parsed = sourceAnswer(finalText, bin === "claude" ? "claude" : "grok", model);
92766
92809
  finalText = parsed.text;
92767
92810
  confirmedModel = parsed.model;
@@ -92778,6 +92821,15 @@ function runReview(input) {
92778
92821
  errorClass = classifyError(error48, prompt2, stderr, text7(details2.stdout) || rawOutput, input.prompt, bin === "claude");
92779
92822
  if (policy && bin === "grok" && (details2.code === "ENOENT" || error48 instanceof SyntaxError || finalText === "grok-cli identity malformed")) errorClass = "model-unavailable";
92780
92823
  }
92824
+ if (bin === "codex") {
92825
+ const evidence2 = runtimeEvidence(stderr);
92826
+ confirmedModel = evidence2.confirmedModel;
92827
+ quota = evidence2.quota;
92828
+ if (client && (!confirmedModel || confirmedModel !== model)) {
92829
+ errorClass = "model-identity";
92830
+ finalVerdict = "UNAVAILABLE";
92831
+ }
92832
+ }
92781
92833
  if (route !== "grok") break;
92782
92834
  if (!invoked) break;
92783
92835
  if (Date.now() >= deadline && errorClass === null) {
@@ -92851,11 +92903,6 @@ function runReview(input) {
92851
92903
  finalVerdict = "UNAVAILABLE";
92852
92904
  finalText = drift;
92853
92905
  }
92854
- if (bin === "codex") {
92855
- const evidence2 = runtimeEvidence(stderr);
92856
- confirmedModel = evidence2.confirmedModel;
92857
- quota = evidence2.quota;
92858
- }
92859
92906
  const attemptReceipt = receiptFor(
92860
92907
  input.cardId,
92861
92908
  "attempt",
@@ -92914,10 +92961,14 @@ function runReview(input) {
92914
92961
  const selected = receipt.attempts.at(-1);
92915
92962
  const completed = {
92916
92963
  ...receipt,
92964
+ ...clientReviewer?.requireIndependentProvider === false ? {
92965
+ independence_level: "partial",
92966
+ independence_note: "cz\u0119\u015Bciowa: bez niezale\u017Cnego sprawdzenia"
92967
+ } : {},
92917
92968
  verdict: finalVerdict,
92918
92969
  text: finalText,
92919
92970
  selectedAttempt: receipt.attempts.length,
92920
- ...selected && independentAttempt(selected) && selected.confirmedModel && selected.errorClass === null && finalVerdict !== "UNAVAILABLE" ? { reviewer: selected.provider === "xai" ? "grok-cli" : `${selected.provider}/${selected.confirmedModel}` } : {}
92971
+ ...selected && (independentAttempt(selected) || client && selected.provider === "openai") && selected.confirmedModel && selected.errorClass === null && finalVerdict !== "UNAVAILABLE" ? { reviewer: selected.provider === "xai" ? "grok-cli" : `${selected.provider}/${selected.confirmedModel}` } : {}
92921
92972
  };
92922
92973
  if (selected?.errorClass || client && finalVerdict === "UNAVAILABLE") {
92923
92974
  return {
@@ -319829,7 +319880,13 @@ async function consumeReviewClaim(s, uid, card, a, landing, file3, installation
319829
319880
  promptSha256: result.promptSha256,
319830
319881
  text: result.text,
319831
319882
  workerReport: result.workerReport,
319832
- ...engineClient() ? { clientPair: result.clientPair } : {}
319883
+ ...engineClient() ? {
319884
+ clientPair: result.clientPair,
319885
+ ...result.clientPair?.selection.reviewer.requireIndependentProvider === false ? {
319886
+ independence_level: "partial",
319887
+ independence_note: "cz\u0119\u015Bciowa: bez niezale\u017Cnego sprawdzenia"
319888
+ } : {}
319889
+ } : {}
319833
319890
  };
319834
319891
  const written = await appendBoundedDetail(uid, card.id, { review });
319835
319892
  card.details = { ...card.details, ...written };
@@ -319966,10 +320023,12 @@ async function restartClientReview(s, uid, card, a, changed) {
319966
320023
  function validateClientReviewResult(card, active, claim, result, deliveryBase) {
319967
320024
  validateClientReviewClaim(card, active, claim);
319968
320025
  const selected = asRecord3(result.attempts?.[0]);
319969
- if (!(0, import_node_util13.isDeepStrictEqual)(result.clientPair, claim.clientPair) || !(0, import_node_util13.isDeepStrictEqual)(result.workerReport, claim.workerReport) || result.status !== "complete" || !["PASS", "FAIL"].includes(String(result.verdict)) || result.key !== claim.key || result.cardId !== card.id || result.sha !== claim.sha || result.round !== claim.round || result.promptSha256 !== (0, import_node_crypto32.createHash)("sha256").update(String(claim.prompt)).digest("hex") || result.promptBytes !== Buffer.byteLength(String(claim.prompt)) || result.attempts?.length !== 1 || result.selectedAttempt !== 1 || selected.provider !== "xai" || selected.requestedModel !== "grok-cli" || selected.exit !== 0 || selected.errorClass !== null || selected.parser !== result.verdict || result.reviewer !== "grok-cli")
319970
- throw new ClientPairHold(`niepe\u0142ny lub niezgodny wynik Groka: ${String(result.diagnostic ?? result.verdict)}`);
320026
+ const reviewer = claim.clientPair.selection.reviewer;
320027
+ const provider = { codex: "openai", claude: "anthropic", grok: "xai" }[reviewer.provider];
320028
+ if (!(0, import_node_util13.isDeepStrictEqual)(result.clientPair, claim.clientPair) || !(0, import_node_util13.isDeepStrictEqual)(result.workerReport, claim.workerReport) || result.status !== "complete" || !["PASS", "FAIL"].includes(String(result.verdict)) || result.key !== claim.key || result.cardId !== card.id || result.sha !== claim.sha || result.round !== claim.round || result.promptSha256 !== (0, import_node_crypto32.createHash)("sha256").update(String(claim.prompt)).digest("hex") || result.promptBytes !== Buffer.byteLength(String(claim.prompt)) || result.attempts?.length !== 1 || result.selectedAttempt !== 1 || selected.provider !== provider || selected.requestedModel !== reviewer.model || selected.effort !== reviewer.effort || selected.exit !== 0 || selected.errorClass !== null || reviewer.requireIndependentProvider === false && (asRecord3(result).independence_level !== "partial" || asRecord3(result).independence_note !== "cz\u0119\u015Bciowa: bez niezale\u017Cnego sprawdzenia") || selected.parser !== result.verdict || result.reviewer !== (provider === "xai" ? "grok-cli" : `${provider}/${String(selected.confirmedModel)}`))
320029
+ throw new ClientPairHold(`niepe\u0142ny lub niezgodny wynik recenzenta: ${String(result.diagnostic ?? result.verdict)}`);
319971
320030
  const raw = asRecord3(JSON.parse((0, import_node_fs47.readFileSync)(checkedReceipt(selected.receipt).path, "utf8")));
319972
- verifyIndependentAttempt(selected, raw, String(claim.sha));
320031
+ verifyClientAttempt(selected, raw, String(claim.sha));
319973
320032
  const sourcePrompt2 = reviewSourcePrompt(claim);
319974
320033
  const packet3 = typeof raw.sourcePrompt === "string" ? raw.sourcePrompt.slice(sourcePrompt2.length) : "";
319975
320034
  const marker = `
@@ -7,9 +7,12 @@ export type EngineRoleRegistry = Record<typeof ROLES[number], {
7
7
  provider: typeof PROVIDERS[number];
8
8
  model: string;
9
9
  effort: string;
10
+ requireIndependentProvider?: boolean;
10
11
  }>;
11
12
  /** Separate from K2 roles (names/inflections) and K7's resource RoleRegistry. */
12
13
  export declare function parseRoleRegistry(raw: unknown, configPath: string): EngineRoleRegistry;
14
+ /** Shared client execution contract; host registries retain their existing choices. */
15
+ export declare function validateClientRoles(worker: EngineRoleRegistry["worker-client"], reviewer: EngineRoleRegistry["reviewer-client"]): void;
13
16
  /** Select CLI/model/effort from the parsed registry; manufacturer and profile metadata belong to the caller. */
14
17
  export declare function resolveRoleExecution(registry: EngineRoleRegistry, role: string): {
15
18
  provider: typeof PROVIDERS[number];
@@ -21,5 +24,5 @@ export declare function loadRoleRegistryConfig(path: string): {
21
24
  config: EngineConfig;
22
25
  roleRegistry: EngineRoleRegistry;
23
26
  };
24
- export declare function doctorEngineConfig(ctx: Ctx, path: string, afterLoad?: (config: EngineConfig) => void): number;
27
+ export declare function doctorEngineConfig(ctx: Ctx, path: string, afterLoad?: (config: EngineConfig, registry: EngineRoleRegistry) => void): number;
25
28
  export {};
@@ -29,7 +29,7 @@ export function parseRoleRegistry(raw, configPath) {
29
29
  fail(configPath, path, "wymagany własny wpis {name, provider, model, effort}");
30
30
  const entry = registry[role];
31
31
  for (const key of Object.keys(entry)) {
32
- if (!FIELDS.includes(key))
32
+ if (!FIELDS.includes(key) && !(role === "reviewer-client" && key === "requireIndependentProvider"))
33
33
  fail(configPath, path, "nieznane pole; dozwolone: " + FIELDS.join(", "));
34
34
  }
35
35
  for (const field of FIELDS) {
@@ -40,11 +40,25 @@ export function parseRoleRegistry(raw, configPath) {
40
40
  if (!PROVIDERS.includes(entry.provider)) {
41
41
  fail(configPath, `${path}.provider`, "dozwoleni dostawcy: " + PROVIDERS.join(", "));
42
42
  }
43
+ if (Object.hasOwn(entry, "requireIndependentProvider") && typeof entry.requireIndependentProvider !== "boolean")
44
+ fail(configPath, `${path}.requireIndependentProvider`, "wymagany boolean true albo false");
43
45
  result[role] = { name: entry.name, provider: entry.provider,
44
- model: entry.model, effort: entry.effort };
46
+ model: entry.model, effort: entry.effort,
47
+ ...(Object.hasOwn(entry, "requireIndependentProvider") ? { requireIndependentProvider: entry.requireIndependentProvider } : {}) };
45
48
  }
46
49
  return result;
47
50
  }
51
+ /** Shared client execution contract; host registries retain their existing choices. */
52
+ export function validateClientRoles(worker, reviewer) {
53
+ if (worker.provider !== "codex" || !["codex", "claude", "grok"].includes(reviewer.provider))
54
+ throw new RobisieError("Worker klienta wymaga Codex; recenzent klienta: Codex, Claude albo Grok.", "Wybierz obsługiwanego dostawcę w rejestrze.");
55
+ if (Object.hasOwn(reviewer, "requireIndependentProvider") && typeof reviewer.requireIndependentProvider !== "boolean")
56
+ throw new RobisieError("requireIndependentProvider wymaga boolean true albo false.", "Popraw konfigurację recenzenta.");
57
+ if (reviewer.provider === "grok" && (reviewer.model !== "grok-cli" || reviewer.effort !== "none"))
58
+ throw new RobisieError("Recenzent Grok wymaga grok-cli/none.", "Popraw model i effort recenzenta.");
59
+ if (reviewer.provider === worker.provider && reviewer.requireIndependentProvider !== false)
60
+ throw new RobisieError("Wymagana niezależność: wybierz innego dostawcę lub jawnie wyłącz wymóg przez requireIndependentProvider=false.", "Wybierz innego dostawcę lub jawne false.");
61
+ }
48
62
  /** Select CLI/model/effort from the parsed registry; manufacturer and profile metadata belong to the caller. */
49
63
  export function resolveRoleExecution(registry, role) {
50
64
  if (!ROLES.includes(role) || !Object.hasOwn(registry, role)) {
@@ -84,7 +98,7 @@ export function loadRoleRegistryConfig(path) {
84
98
  }
85
99
  export function doctorEngineConfig(ctx, path, afterLoad) {
86
100
  const { roleRegistry, config } = loadRoleRegistryConfig(resolve(ctx.cwd, path));
87
- afterLoad?.(config);
101
+ afterLoad?.(config, roleRegistry);
88
102
  for (const role of ROLES) {
89
103
  const { name, provider, model, effort } = roleRegistry[role];
90
104
  ctx.out(`${role} → ${name} / ${provider} / ${model} / ${effort}`);
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.26 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
20
+ export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.27 \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.26) <!-- x-release-please-version -->
1
+ # robisie — from account to accepted card (package 0.5.27) <!-- 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
 
@@ -276,7 +276,7 @@ git commit -m "Przygotuj lokalne powitanie"
276
276
  ```
277
277
  <!-- local-repo-setup:end -->
278
278
 
279
- Save the entire JSON below as `robisie.config.json` in the repo directory, without overwriting existing configuration. **Replace** fictitious `project` with the UUID from authenticated `list_projects`, and the `tracks` UUID and name with a real track from that project’s board. Replace `engine.repo` with the absolute current repo path and `stateDir` with a separate directory **outside the repo**. Complete all four `roleRegistry` entries. In the local flow, `worker-client` must use `provider: codex`, and `reviewer-client` must use `provider: grok`, `model: grok-cli`, `effort: none`. Another pair will stop at `HOLD clientPair`, even if it passes configuration validation. For Codex roles, choose a real model available on your account and supported effort; this example uses `gpt-6.1-sol` / `high`, not fixture models. The installed Grok CLI selects the reviewer model; keep `grok-cli` / `none`. The local flow needs available, signed-in `codex` and `grok` programs; the installer provider’s program alone is insufficient. Parsing and offline doctor do not prove model/provider availability. This execution registry is separate from the installer’s CEO/Builder/Quality Officer map.
279
+ Save the entire JSON below as `robisie.config.json` in the repo directory, without overwriting existing configuration. **Replace** fictitious `project` with the UUID from authenticated `list_projects`, and the `tracks` UUID and name with a real track from that project’s board. Replace `engine.repo` with the absolute current repo path and `stateDir` with a separate directory **outside the repo**. Complete all four `roleRegistry` entries. In the local flow, `worker-client` must use `provider: codex`, and `reviewer-client` can select Codex, Claude or Grok. Grok still requires `provider: grok`, `model: grok-cli`, `effort: none`. Only the reviewer supports optional boolean `requireIndependentProvider`: absent or `true` requires another provider; Codex requires explicit `false`. Every `false`, including Claude or Grok, marks review and acceptance as `partial` with the note “częściowa: bez niezależnego sprawdzenia”. Review always runs in a separate process. An unsupported pair or a configuration change during the card causes `HOLD clientPair`. For Codex roles, choose a real model available on your account and supported effort; this example uses `gpt-6.1-sol` / `high`, not fixture models. Set the Codex or Claude reviewer model and effort in the registry; the installed Grok CLI selects its model (`grok-cli` / `none`). The local flow needs an available, signed-in Codex Worker, the selected reviewer, and Grok for acceptance. `doctor --engine-config` checks this pair and login (`claude auth status` for Claude), without a paid model call; a missing CLI or unconfirmed login prevents readiness. Parsing and offline doctor do not prove model/provider availability. This execution registry is separate from the installer’s CEO/Builder/Quality Officer map.
280
280
 
281
281
  <!-- local-engine-config:start -->
282
282
  ```json
package/docs/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # robisie — od konta do odebranej karty (paczka 0.5.26) <!-- x-release-please-version -->
1
+ # robisie — od konta do odebranej karty (paczka 0.5.27) <!-- 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
 
@@ -321,7 +321,7 @@ git commit -m "Przygotuj lokalne powitanie"
321
321
  ```
322
322
  <!-- local-repo-setup:end -->
323
323
 
324
- Zapisz cały poniższy JSON jako `robisie.config.json` w katalogu repo, bez nadpisywania istniejącej konfiguracji. **Podmień** fikcyjne `project` na UUID z uwierzytelnionego `list_projects`, a UUID i nazwę `tracks` na rzeczywisty tor z tablicy tego projektu. Podmień `engine.repo` na absolutną ścieżkę bieżącego repo, a `stateDir` na osobny katalog **poza repo**. Uzupełnij wszystkie cztery wpisy `roleRegistry`. W lokalnym przebiegu `worker-client` musi używać `provider: codex`, a `reviewer-client` musi używać `provider: grok`, `model: grok-cli`, `effort: none`. Inna para zostanie zatrzymana przez `HOLD clientPair`, nawet jeśli przejdzie walidację konfiguracji. Dla ról Codex wybierz rzeczywisty model dostępny na swoim koncie i obsługiwany effort; przykład używa `gpt-6.1-sol` / `high`, nie modeli fixture. Model recenzenta wybiera zainstalowany Grok CLI; zachowaj `grok-cli` / `none`. Lokalny przebieg wymaga dostępnych i zalogowanych programów `codex` i `grok`; sam program dostawcy instalatora nie wystarcza. Same parsowanie i doctor offline nie dowodzą dostępności modeli ani dostawców. Rejestr wykonania jest odrębny od mapy instalatora CEO/Builder/Quality Officer.
324
+ Zapisz cały poniższy JSON jako `robisie.config.json` w katalogu repo, bez nadpisywania istniejącej konfiguracji. **Podmień** fikcyjne `project` na UUID z uwierzytelnionego `list_projects`, a UUID i nazwę `tracks` na rzeczywisty tor z tablicy tego projektu. Podmień `engine.repo` na absolutną ścieżkę bieżącego repo, a `stateDir` na osobny katalog **poza repo**. Uzupełnij wszystkie cztery wpisy `roleRegistry`. W lokalnym przebiegu `worker-client` musi używać `provider: codex`, a `reviewer-client` może wybrać Codex, Claude albo Grok. Grok nadal wymaga `provider: grok`, `model: grok-cli`, `effort: none`. Tylko recenzent ma opcjonalne boolean `requireIndependentProvider`: brak lub `true` wymaga innego dostawcy; Codex wymaga jawnego `false`. Każde `false`, także przy Claude lub Groku, zapisuje review i acceptance jako `partial` z notą „częściowa: bez niezależnego sprawdzenia”. Recenzja zawsze działa w osobnym procesie. Niedozwolona para lub zmiana konfiguracji w trakcie karty daje `HOLD clientPair`. Dla ról Codex wybierz rzeczywisty model dostępny na swoim koncie i obsługiwany effort; przykład używa `gpt-6.1-sol` / `high`, nie modeli fixture. Dla Codex i Claude ustaw model oraz effort recenzenta w rejestrze; model Groka wybiera zainstalowany Grok CLI (`grok-cli` / `none`). Lokalny przebieg wymaga dostępnego i zalogowanego Codexa Workera, wybranego recenzenta oraz Groka odbiorcy. `doctor --engine-config` sprawdza tę parę i logowanie (`claude auth status` dla Claude), bez płatnego wywołania modelu; brak CLI lub potwierdzenia logowania nie daje gotowości. Same parsowanie i doctor offline nie dowodzą dostępności modeli ani dostawców. Rejestr wykonania jest odrębny od mapy instalatora CEO/Builder/Quality Officer.
325
325
 
326
326
  Worker Codex na Linuksie może uruchamiać testy tworzące procesy, ale proxy deny-all blokuje dostęp do internetu: komenda próbująca ruchu sieciowego zostanie PRZERWANA (exit −1), zamiast zwrócić zwykły błąd. Zależności przygotuj poza Workerem. Runner dopisuje `127.0.0.1,localhost` osobno do `NO_PROXY` i `no_proxy`, zachowując istniejące listy użytkownika i dostęp HTTP do localhost. Pomiar dotyczy Codex 0.166.0 na Linux aarch64; nie potwierdza rzeczywistego użycia u Dota na Linux x64 po wydaniu.
327
327
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robisie",
3
- "version": "0.5.26",
3
+ "version": "0.5.27",
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",