robisie 0.5.31 → 0.5.33

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,22 @@
1
1
  # Historia zmian klienta / Client changelog
2
2
 
3
+ ## [0.5.33](https://github.com/chuppa12/robisie-app/compare/client-v0.5.32...client-v0.5.33) (2026-11-14)
4
+
5
+
6
+ ### Factory Cards
7
+
8
+ * praca workera task-mwgaxurs-ybti54 (auto-commit) ([b3ceea6](https://github.com/chuppa12/robisie-app/commit/b3ceea6c8316e9cea8111b1e389bed50d725731a))
9
+ * praca workera task-mwgiflw2-ba77kz (auto-commit) ([5901a86](https://github.com/chuppa12/robisie-app/commit/5901a86e4ed2649a0dbee2e4fbff5bf7e59fd3b0))
10
+ * praca workera worker-b6d6321a-0252-4458-ae1a-8b28bc09763a (auto-commit) ([6cb07f4](https://github.com/chuppa12/robisie-app/commit/6cb07f426d1428acad1a9dee9b05d812d855fa85))
11
+
12
+ ## [0.5.32](https://github.com/chuppa12/robisie-app/compare/client-v0.5.31...client-v0.5.32) (2026-11-14)
13
+
14
+
15
+ ### Factory Cards
16
+
17
+ * praca workera task-mwgigrme-4ju20p (auto-commit) ([2897214](https://github.com/chuppa12/robisie-app/commit/289721468bce4be4bfd0db50e8e3c536587f772a))
18
+ * praca workera task-mwgk0605-3z6nbf (auto-commit) ([6982bb7](https://github.com/chuppa12/robisie-app/commit/6982bb770e9a2218773a0fe4dc5d4fa4f6f00131))
19
+
3
20
  ## [0.5.31](https://github.com/chuppa12/robisie-app/compare/client-v0.5.30...client-v0.5.31) (2026-11-14)
4
21
 
5
22
 
package/README.md CHANGED
@@ -4,7 +4,7 @@ W katalogu projektu z konfiguracją silnika uruchom `npx robisie init`, potem `n
4
4
 
5
5
  Przewodniki: [PL — konto → odbiór → odinstalowanie](docs/README.md) · [EN — account → acceptance → uninstall](docs/README.en.md). Przygotuj Node.js 24+ (wydanie użyte przy sprawdzeniach: 24.3.0), npm, program jednego dostawcy AI oraz pusty katalog; silnik w paczce (`dist/engine/tick.cjs`) dla klienta wymaga systemu Linux lub macOS. Jawny host Robisie (`mode: "host"`, `pr|delivered`) obsługuje także macOS; konfigurację i granice opisuje ENGINE-CONFIG. Nie potrzebujesz strony ani własnego pliku `package.json` — utworzy go poniższy krok Node.js przed instalacją. Zacznij od konta i projektu w panelu. Projekt w panelu i katalog na dysku to osobne rzeczy; CEO wymaga dokładnie jednego projektu z `list_projects`.
6
6
 
7
- Konto i klucz są potrzebne do init i pracy ról. Osobne wejście to walidacja offline, gdy CLI jest dostępne: nie sprawdza instalacji, nie uruchamia dostawców i nie wymaga podawania UUID projektu. Osobno `npx robisie doctor --engine-config ./robisie.config.json` sprawdza offline strukturę konfiguracji i wejścia instalacji lokalnej: nie potwierdza UUID projektu, repo, modeli ani uruchomienia dostawców. Lokalne przewodniki są w `node_modules/robisie/docs/`.
7
+ Konto i klucz są potrzebne do init i pracy ról. `npx robisie doctor --engine-config ./robisie.config.json` przy jawnym `engine.mode:host` sprawdza offline strukturę konfiguracji i wejścia instalacji lokalnej, bez kontroli CLI. Przy `engine.mode:client` albo braku pola `engine.mode`, po walidacji wejść i przy dostępnym programie, sprawdza obecność CLI oraz logowanie: `codex login status` i `grok models` (`grok models` wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie), a `claude auth status` wyłącznie przy `reviewer-client.provider: claude`. Brak programu nie pozwala sprawdzić logowania. Żaden tryb nie wykonuje prawdziwego zadania AI ani komend silnika i nie potwierdza UUID projektu, repo ani modeli. Lokalne przewodniki są w `node_modules/robisie/docs/`.
8
8
 
9
9
  Zamiast przepisywać klucze możesz uruchomić `npx robisie login`: polecenie wypisuje kod i link, Ty albo Twój agent zatwierdzacie parę kluczy A i B w przeglądarce zalogowanej do robisie.app, a klucze trafiają prosto do plików instalacji — w wersji dla testerów agent i właściciel na tym komputerze to jedna strefa zaufania (agent ma technicznie dostęp także do klucza B).
10
10
 
@@ -241,7 +241,7 @@ Zapisz konfigurację projektu i osobny rejestr wykonania w `robisie.config.json`
241
241
 
242
242
  Uruchom `npx robisie doctor --engine-config ./robisie.config.json` (także `--engine-config=./robisie.config.json`). Ścieżka pliku jest względem bieżącego katalogu, a `repo` i `stateDir` względem pliku konfiguracji. Role projektu `coordinator/owner/planner/advisor` zachowują domyślne nazwy; opcjonalne pole `roles` służy ich nazwom i odmianie, osobno od `roleRegistry`.
243
243
 
244
- Kod 0 oznacza poprawną strukturę konfiguracji i dokładnie cztery kompletne przypisania wykonania; raport pokazuje rolę → imię / dostawcę / model / wysiłek. Kod 1 wskazuje plik, błędne pole (jeśli dotyczy) i następny krok. Ten tryb działa offline, bez klucza, uruchamiania dostawców, wykonywania komend silnika ani zapisu plików. Raport jawnie stwierdza: „sprawdzono konfigurację; nie sprawdzono uruchomienia dostawców”. Zwykły `doctor` zachowuje dotychczasową diagnozę instalacji.
244
+ Kod 0 oznacza poprawną strukturę konfiguracji i dokładnie cztery kompletne przypisania wykonania; raport pokazuje rolę → imię / dostawcę / model / wysiłek. Kod 1 wskazuje plik, błędne pole (jeśli dotyczy) i następny krok. Jawny `engine.mode:host` sprawdza strukturę i wejścia offline, bez kontroli CLI. `engine.mode:client` albo brak pola `engine.mode`, po walidacji wejść i przy dostępnym programie, sprawdza obecność CLI oraz logowanie: `codex login status` i `grok models` (`grok models` wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie), a `claude auth status` wyłącznie przy `reviewer-client.provider: claude`. Brak programu nie pozwala sprawdzić logowania. Żaden tryb nie wykonuje prawdziwego zadania AI, komend silnika ani zapisu plików i nie potwierdza UUID projektu, repo ani modeli. Raport nadal stwierdza: „sprawdzono konfigurację; nie sprawdzono uruchomienia dostawców” — to brak prawdziwego zadania AI, nie brak sond CLI klienta. Zwykły `doctor` zachowuje dotychczasową diagnozę instalacji. Tryb nie wymaga klucza.
245
245
 
246
246
  Silnik paczki — `dist/engine/tick.cjs` — jest odrębny od instalatora: `init`/`doctor`/`uninstall` go nie uruchamiają. Uruchamia go `npx robisie factory run --engine-config ./robisie.config.json` (flaga `--once` wykonuje jeden takt) na Linuxie lub macOS dla klienta (`local`) oraz jawnego hosta Robisie (`mode: "host"`, `pr|delivered`), z Node.js 24+; starszy Node, np. 22, otrzymuje odmowę przed `init`, `doctor` i `factory run`, a pozostałe systemy otrzymują kod 2 i komunikat. Pełny opis pól konfiguracji: `node_modules/robisie/docs/ENGINE-CONFIG.md`. Każdy niezerowy wynik taktu zatrzymuje nadzorcę („Fabryka zatrzymana: …”) z jedną linią diagnozy na stderr; kod 2 to eskalacja (np. brak klucza B po receiver PASS, odmowa testera, STOP odbioru) wymagająca rozstrzygnięcia przed ponowieniem, a kod 78 wskazuje konfigurację do poprawy.
247
247
 
package/dist/cli.js CHANGED
@@ -48,10 +48,12 @@ Opcje usage:
48
48
  --input=<plik.json> ta sama składnia; bez sieci i kluczy, --help nie czyta pliku
49
49
 
50
50
  Opcje doctor:
51
- --engine-config <path> offline sprawdza strukturę konfiguracji projektu i przypisania czterech ról wykonania oraz wejścia instalacji lokalnej
52
- --engine-config=<path> ta sama składnia; nie sprawdza uruchomienia dostawców
51
+ --engine-config <path> lub --engine-config=<path> plik konfiguracji; oba zapisy są równoważne
52
+ Jawny engine.mode:host: offline sprawdza strukturę konfiguracji i wejścia, bez kontroli CLI.
53
+ engine.mode:client albo brak pola engine.mode: obecność CLI i logowanie; sonda po walidacji wejść, tylko przy dostępnym programie.
53
54
  Przykład: npx robisie doctor --engine-config ./robisie.config.json
54
- Bez klucza i kontroli instalacji; nie sprawdza UUID projektu, repo, dostępności modeli ani wykonania komend.
55
+ Klient: codex login status i grok models (grok models wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie); claude auth status wyłącznie przy reviewer-client.provider: claude. Brak programu nie pozwala sprawdzić logowania.
56
+ Żaden tryb nie wykonuje prawdziwego zadania AI ani komend silnika; nie sprawdza UUID projektu, repo ani dostępności modeli. Bez klucza.
55
57
  Role wykonania w tym pliku są osobne od mapy ceo/builder/quality ustawianej przez init.
56
58
  Przewodniki i przykłady: node_modules/robisie/docs/README.md oraz README.en.md w tym samym katalogu.
57
59
 
@@ -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.31";
3
+ export declare const PACKAGE_VERSION = "0.5.33";
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.31"; // x-release-please-version
3
+ export const PACKAGE_VERSION = "0.5.33"; // 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":"201d1f0395fd6dc8713936ac21c74934a4fbe88e","dirty":false}
1
+ {"schema":1,"sha":"a240d4c51efb0e29beda3369ad288553bf1da795","dirty":false}
@@ -1673,20 +1673,20 @@
1673
1673
  "staticOperations": {
1674
1674
  "beforePreflight": {
1675
1675
  "module": "maszynista/tick.ts",
1676
- "startLine": 9636,
1677
- "endLine": 9749,
1676
+ "startLine": 9781,
1677
+ "endLine": 9894,
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": 10038,
1683
- "endLine": 10090,
1682
+ "startLine": 10185,
1683
+ "endLine": 10237,
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": {
1687
1687
  "module": "maszynista/tick.ts",
1688
- "startLine": 849,
1689
- "endLine": 860,
1688
+ "startLine": 876,
1689
+ "endLine": 887,
1690
1690
  "text": "export function refreshTickReport(observedLoaded = readLoadedSha(REPO)): void {\n loadedSha = observedLoaded;\n try { mainSha = git([\"rev-parse\", engineBranchRef()]); }\n catch (error) { mainSha = \"UNKNOWN\"; log(`Nie można odczytać main SHA: ${errorText(error)}`); }\n if (DRY) return;\n try {\n const content = readFileSync(LAST_TICK, \"utf8\");\n writeFileSync(LAST_TICK, `${content.replace(/^- (?:loaded|main):.*\\n?/gm, \"\")}- loaded: ${loadedSha}\\n- main: ${mainSha}\\n`);\n } catch (error) { if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") throw error; }\n}\n\nfunction writeAtomic(file: string, content: string): void {"
1691
1691
  },
1692
1692
  "importTime": {
@@ -1706,6 +1706,6 @@
1706
1706
  "status": 0,
1707
1707
  "signal": null,
1708
1708
  "stdout": "v24.3.0\n",
1709
- "stderr": "(node:18049) 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:18088) 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.31";
37631
+ PACKAGE_VERSION = "0.5.33";
37632
37632
  SUPPORTED_CONTRACT_MAJOR = 1;
37633
37633
  DEFAULT_ORIGIN = "https://robisie.app";
37634
37634
  MCP_SERVER_NAME = "robisie";
@@ -315230,6 +315230,7 @@ __export2(tick_exports, {
315230
315230
  executeDeliveredTest: () => executeDeliveredTest,
315231
315231
  executeTesterJob: () => executeTesterJob,
315232
315232
  findEngineProject: () => findEngineProject,
315233
+ flushReviewGrantDiagnostics: () => flushReviewGrantDiagnostics,
315233
315234
  handleCiNoChecksAlarm: () => handleCiNoChecksAlarm,
315234
315235
  handleDiskPressure: () => handleDiskPressure,
315235
315236
  hostActivationAlarm: () => hostActivationAlarm,
@@ -315444,21 +315445,76 @@ function actionableBlockerHold(card, predecessors) {
315444
315445
  if (actionableBlockerRecovery(card, predecessors)) return null;
315445
315446
  return "ACTIONABLE_BLOCKER: seed_brief_sha256 bez zmian; wymagany nowy brief albo depends_on na nierozwi\u0105zan\u0105 kart\u0119-przeszkod\u0119";
315446
315447
  }
315447
- async function recoverBlockedWorkers(s, uid, projectId2, dry = DRY2) {
315448
+ async function recoverBlockedWorkers(s, uid, projectId2, dry = DRY2, pending) {
315448
315449
  if (dry) return;
315450
+ const diagnostics = pending ?? /* @__PURE__ */ new Map();
315451
+ let failure3;
315449
315452
  const rows = await scanTasks(uid, projectId2, { full: true, statuses: ["blocked"], detailsKeys: BLOCKED_WORKER_DETAILS_KEYS });
315450
315453
  for (const row of rows) {
315451
- if (!["ACTIONABLE_BLOCKER", "WORKER_FINISHED"].includes(String(asRecord3(row.details?.maszynista).outcome)) || s.actives.some((a) => a.taskId === row.id)) continue;
315452
- if (row.assignee !== null || landedSha(row) || row.details?.reksio_withheld === true) continue;
315453
- const card = await getTask2(uid, row.id);
315454
- if (!card || card.status !== "blocked" || card.assignee !== null || landedSha(card) || draftHeld(card.details ?? {})) continue;
315455
- const predecessors = await factoryPredecessors(uid, [card]);
315456
- if (!factoryDependenciesReady(card, predecessors)) continue;
315454
+ let diagnostic;
315455
+ const candidate = grantCandidates(row).length > 0;
315457
315456
  try {
315457
+ const hydrated = candidate ? await getTask2(uid, row.id) : null;
315458
+ if (candidate && !hydrated) continue;
315459
+ if (hydrated) {
315460
+ rememberGrantDiagnostics(diagnostics, hydrated);
315461
+ diagnostic = diagnostics.get(row.id);
315462
+ if (row.status !== hydrated.status || row.assignee !== hydrated.assignee || !(0, import_node_util13.isDeepStrictEqual)(row.dependsOn, hydrated.dependsOn) || Object.entries(row.details ?? {}).some(([key, value]) => !(0, import_node_util13.isDeepStrictEqual)(value, hydrated.details?.[key]))) rejectGrant(diagnostic, "snapshot_changed");
315463
+ }
315464
+ if (!["ACTIONABLE_BLOCKER", "WORKER_FINISHED"].includes(String(asRecord3(row.details?.maszynista).outcome))) {
315465
+ rejectGrant(diagnostic, "outcome");
315466
+ continue;
315467
+ }
315468
+ if (s.actives.some((a) => a.taskId === row.id)) {
315469
+ rejectGrant(diagnostic, "active");
315470
+ continue;
315471
+ }
315472
+ if (row.assignee !== null) {
315473
+ rejectGrant(diagnostic, "assignee");
315474
+ continue;
315475
+ }
315476
+ if (landedSha(row)) {
315477
+ rejectGrant(diagnostic, "land");
315478
+ continue;
315479
+ }
315480
+ if (row.details?.reksio_withheld === true) {
315481
+ rejectGrant(diagnostic, "veto");
315482
+ continue;
315483
+ }
315484
+ const card = hydrated ?? await getTask2(uid, row.id);
315485
+ if (!card) continue;
315486
+ if (card.status !== "blocked") {
315487
+ rejectGrant(diagnostic, "status");
315488
+ continue;
315489
+ }
315490
+ if (card.assignee !== null) {
315491
+ rejectGrant(diagnostic, "assignee");
315492
+ continue;
315493
+ }
315494
+ if (landedSha(card)) {
315495
+ rejectGrant(diagnostic, "land");
315496
+ continue;
315497
+ }
315498
+ if (draftHeld(card.details ?? {})) {
315499
+ rejectGrant(diagnostic, card.details?.reksio_withheld === true ? "veto" : "hold");
315500
+ continue;
315501
+ }
315502
+ const predecessors = await factoryPredecessors(uid, [card]);
315503
+ if (!factoryDependenciesReady(card, predecessors)) {
315504
+ rejectGrant(diagnostic, "dependencies");
315505
+ continue;
315506
+ }
315458
315507
  const worker = asRecord3(card.details?.maszynista);
315459
315508
  if (worker.outcome === "WORKER_FINISHED") {
315460
- if (worker.phase === "blocked" && worker.move === "blocked" && !await consumeR3Grant(s, uid, card))
315461
- await consumeR4Grant(s, uid, card);
315509
+ if (worker.phase !== "blocked") {
315510
+ rejectGrant(diagnostic, "phase");
315511
+ continue;
315512
+ }
315513
+ if (worker.move !== "blocked") {
315514
+ rejectGrant(diagnostic, "move");
315515
+ continue;
315516
+ }
315517
+ if (!await consumeR3Grant(s, uid, card, diagnostic)) await consumeR4Grant(s, uid, card, diagnostic);
315462
315518
  continue;
315463
315519
  }
315464
315520
  if (!actionableBlockerRecovery(card, predecessors)) continue;
@@ -315470,9 +315526,15 @@ async function recoverBlockedWorkers(s, uid, projectId2, dry = DRY2) {
315470
315526
  });
315471
315527
  log2(`karta ${card.id}: naprawiona powi\u0105zana przeszkoda \u2192 ready`);
315472
315528
  } catch (error48) {
315473
- if (!(error48 instanceof PlannerDomainError) || error48.plannerCode !== "TASK_UPDATE_CONFLICT") throw error48;
315529
+ if (candidate) {
315530
+ if (diagnostic) diagnostic.uncertain = true;
315531
+ if (!(error48 instanceof PlannerDomainError) || error48.plannerCode !== "TASK_UPDATE_CONFLICT") failure3 ??= error48;
315532
+ safeLog(`grant recovery ${row.id}: ${errorText5(error48)}`);
315533
+ } else if (!(error48 instanceof PlannerDomainError) || error48.plannerCode !== "TASK_UPDATE_CONFLICT") throw error48;
315474
315534
  }
315475
315535
  }
315536
+ if (!pending) await flushReviewGrantDiagnostics(uid, diagnostics);
315537
+ if (failure3) throw failure3;
315476
315538
  }
315477
315539
  function ringDraftChanges(cards, dry = DRY2) {
315478
315540
  if (dry) return;
@@ -318088,39 +318150,126 @@ async function deliver3(s, uid, card, sha5) {
318088
318150
  function readyTaskPatch() {
318089
318151
  return { status: "ready", assignee: null, detailsPatch: { readyAt: new Date(Date.now()).toISOString() } };
318090
318152
  }
318091
- function r3Grant(card) {
318153
+ function rejectGrant(diagnostic, reason, round) {
318154
+ if (diagnostic && round) (diagnostic.refusals ??= {})[round] = reason;
318155
+ else if (diagnostic && diagnostic.reason !== "snapshot_changed") diagnostic.reason = reason;
318156
+ return null;
318157
+ }
318158
+ function grantReceiptError(error48) {
318159
+ return error48 instanceof SyntaxError ? "receipt_json" : /SHA-256/.test(errorText5(error48)) ? "receipt_integrity" : "receipt_read";
318160
+ }
318161
+ function grantCandidates(card) {
318162
+ const rulings = card.details?.rozstrzygniecia_reksia;
318163
+ if (!Array.isArray(rulings)) return [];
318164
+ const tokens = /* @__PURE__ */ new Map();
318165
+ for (const value of rulings) {
318166
+ const ruling = asRecord3(value), token = ruling.znalezisko;
318167
+ if (ruling.by !== "control-room" || typeof token !== "string") continue;
318168
+ const match = /^LIMIT_RUND ([a-fA-F0-9]{8}-(?:[a-fA-F0-9]{4}-){3}[a-fA-F0-9]{12}) ([a-fA-F0-9]{40}) R([34])$/.exec(token);
318169
+ if (match && match[0] === token && match[1] === card.id) tokens.set(token, { sha: match[2], round: match[3] === "3" ? 3 : 4 });
318170
+ }
318171
+ return [...tokens].map(([token, identity]) => ({ token, ...identity, rulings: rulings.map(asRecord3).filter((ruling) => ruling.znalezisko === token) }));
318172
+ }
318173
+ function grantConsumed(card, candidate) {
318174
+ const review = asRecord3(card.details?.review), used = asRecord3(candidate.round === 3 ? review.extraRoundGrant : review.extraRound4Grant);
318175
+ if (typeof used.rulingSha256 === "string") return candidate.rulings.every((ruling) => rulingSha(ruling) === used.rulingSha256);
318176
+ return used.token === candidate.token || used.sha === candidate.sha && (used.fromRound === candidate.round - 1 || Number(review.round) >= candidate.round);
318177
+ }
318178
+ function rememberGrantDiagnostics(pending, card, reason) {
318179
+ if (!grantCandidates(card).length) return;
318180
+ if (!pending.has(card.id)) pending.set(card.id, { card: structuredClone(card), reason });
318181
+ }
318182
+ function grantSnapshotMatch(fresh, snapshot2) {
318183
+ return fresh.status === snapshot2.status && fresh.assignee === snapshot2.assignee && (0, import_node_util13.isDeepStrictEqual)(fresh.dependsOn, snapshot2.dependsOn) && recoveryDetailsMatch(fresh, snapshot2) && ["review", "landed", "hold", "unblock", "scope_blocked_at", "seed_brief", "seed_brief_sha256"].every((key) => (0, import_node_util13.isDeepStrictEqual)(fresh.details?.[key], snapshot2.details?.[key]));
318184
+ }
318185
+ async function flushReviewGrantDiagnostics(uid, pending) {
318186
+ if (DRY2) return;
318187
+ for (const [id2, diagnostic] of pending) {
318188
+ try {
318189
+ const fresh = await getTask2(uid, id2);
318190
+ if (!fresh) continue;
318191
+ for (const candidate of grantCandidates(fresh)) {
318192
+ if (grantConsumed(fresh, candidate)) continue;
318193
+ const changed = !grantSnapshotMatch(fresh, diagnostic.card);
318194
+ if (diagnostic.uncertain && !changed) continue;
318195
+ const current = { card: fresh };
318196
+ if (changed) current.reason = "snapshot_changed";
318197
+ else if (candidate.rulings.length > 1) current.reason = "ambiguous_rulings";
318198
+ else if (asRecord3(fresh.details?.review).sha !== candidate.sha) current.reason = "sha_mismatch";
318199
+ else if (diagnostic.reason) current.reason = diagnostic.reason;
318200
+ else if (diagnostic.refusals?.[candidate.round]) current.reason = diagnostic.refusals[candidate.round];
318201
+ else if (candidate.round === 3 ? r3Grant(fresh, current) : r4Grant(fresh, current)) {
318202
+ if (landedSha(fresh)) current.reason = "land";
318203
+ else if (draftHeld(fresh.details ?? {})) current.reason = fresh.details?.reksio_withheld === true ? "veto" : "hold";
318204
+ else continue;
318205
+ }
318206
+ current.reason ??= current.refusals?.[candidate.round];
318207
+ if (!current.reason) continue;
318208
+ const canonical4 = (value) => JSON.stringify(value, (_key, item) => item && typeof item === "object" && !Array.isArray(item) ? Object.fromEntries(Object.entries(item).sort(([a], [b]) => a.localeCompare(b))) : item);
318209
+ const content = candidate.rulings.map(canonical4).sort();
318210
+ const reason = current.reason;
318211
+ const message3 = `grant-odrzucony karta=${id2} R${candidate.round} reason=${reason} ruling=[${content.join(",")}]${reason === "time" ? ` ruling.at=${String(candidate.rulings[0].at)} review.at=${String(asRecord3(fresh.details?.review).at)}` : ""}`;
318212
+ const fingerprint = (0, import_node_crypto32.createHash)("sha256").update(JSON.stringify([id2, candidate.round, content, reason])).digest("hex");
318213
+ const marker = import_node_path52.default.join(DIR, "review-jobs", `grant-rejected-${fingerprint}.log-state`);
318214
+ if ((0, import_node_fs47.existsSync)(marker)) continue;
318215
+ (0, import_node_fs47.mkdirSync)(import_node_path52.default.dirname(marker), { recursive: true });
318216
+ (0, import_node_fs47.writeFileSync)(marker, fingerprint);
318217
+ log2(message3);
318218
+ try {
318219
+ const result = await wakeRole(message3, "control-room", `grant-rejected:${fingerprint}`);
318220
+ if (result.rc !== 0) safeLog(`grant diagnostyka ${id2}: wake CR nieudany ${result.stderr.slice(0, 200)}`);
318221
+ } catch (error48) {
318222
+ safeLog(`grant diagnostyka ${id2}: wake CR nieudany ${errorText5(error48)}`);
318223
+ }
318224
+ }
318225
+ } catch (error48) {
318226
+ safeLog(`grant diagnostyka ${id2}: ${errorText5(error48)}`);
318227
+ }
318228
+ }
318229
+ pending.clear();
318230
+ }
318231
+ function r3Grant(card, diagnostic) {
318092
318232
  const review = asRecord3(card.details?.review), sha5 = review.sha;
318093
- if (!/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(card.id) || card.details?.card_owner !== "control-room" || card.details?.reksio_withheld === true || review.verdict !== "FAIL" || review.round !== 2 || review.extraRoundGrant != null || typeof sha5 !== "string" || !/^[a-f0-9]{40}$/.test(sha5)) return null;
318233
+ if (!/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(card.id)) return rejectGrant(diagnostic, "card_id", 3);
318234
+ if (card.details?.card_owner !== "control-room") return rejectGrant(diagnostic, "card_owner", 3);
318235
+ if (card.details?.reksio_withheld === true) return rejectGrant(diagnostic, "veto", 3);
318236
+ if (review.verdict !== "FAIL") return rejectGrant(diagnostic, "review_verdict", 3);
318237
+ if (review.round !== 2) return rejectGrant(diagnostic, "review_round", 3);
318238
+ if (review.extraRoundGrant != null) return rejectGrant(diagnostic, "r3_used", 3);
318239
+ if (typeof sha5 !== "string" || !/^[a-f0-9]{40}$/.test(sha5)) return rejectGrant(diagnostic, "sha_mismatch", 3);
318094
318240
  const token = `LIMIT_RUND ${card.id} ${sha5} R3`;
318095
318241
  const rulings = card.details?.rozstrzygniecia_reksia;
318096
318242
  const matching = Array.isArray(rulings) ? rulings.map(asRecord3).filter((ruling) => ruling.znalezisko === token) : [];
318097
- if (matching.length > 1) return null;
318243
+ if (matching.length > 1) return rejectGrant(diagnostic, "ambiguous_rulings", 3);
318098
318244
  const grant = matching[0] ?? asRecord3(asRecord3(card.details?.unblock).verdict), at3 = grant.at;
318099
- if (typeof at3 !== "string" || !/^\d{4}-\d\d-\d\dT.*Z$/.test(at3) || !Number.isFinite(Date.parse(at3)) || !Number.isFinite(Date.parse(String(review.at))) || Date.parse(at3) < Date.parse(String(review.at)) || Date.parse(at3) > Date.now()) return null;
318245
+ if (typeof at3 !== "string" || !/^\d{4}-\d\d-\d\dT.*Z$/.test(at3) || !Number.isFinite(Date.parse(at3)) || !Number.isFinite(Date.parse(String(review.at))) || Date.parse(at3) < Date.parse(String(review.at)) || Date.parse(at3) > Date.now()) return rejectGrant(diagnostic, "time", 3);
318100
318246
  if (matching.length === 1) {
318101
- if (grant.werdykt !== "UCHYLONE" || grant.by !== "control-room" || typeof grant.powod !== "string" || !grant.powod.trim()) return null;
318247
+ if (grant.werdykt !== "UCHYLONE" || grant.by !== "control-room" || typeof grant.powod !== "string" || !grant.powod.trim()) return rejectGrant(diagnostic, "ruling", 3);
318102
318248
  } else {
318103
318249
  const worker = asRecord3(card.details?.maszynista), blockedAt = card.details?.scope_blocked_at;
318104
- if (!hasDutyNote(card.details) || card.status !== "blocked" || worker.outcome !== "WORKER_FINISHED" || worker.phase !== "blocked" || worker.move !== "blocked" || typeof blockedAt !== "string" || !Number.isFinite(Date.parse(blockedAt)) || Date.parse(at3) <= Date.parse(blockedAt) || Date.parse(at3) <= Date.parse(String(review.at))) return null;
318250
+ if (!hasDutyNote(card.details) || card.status !== "blocked" || worker.outcome !== "WORKER_FINISHED" || worker.phase !== "blocked" || worker.move !== "blocked" || typeof blockedAt !== "string" || !Number.isFinite(Date.parse(blockedAt)) || Date.parse(at3) <= Date.parse(blockedAt) || Date.parse(at3) <= Date.parse(String(review.at))) return rejectGrant(diagnostic, "legacy_note", 3);
318105
318251
  }
318106
318252
  try {
318107
318253
  const full = asRecord3(JSON.parse((0, import_node_fs47.readFileSync)(checkedReceipt(review.receipt).path, "utf8")));
318108
318254
  const ciResult = asRecord3(asRecord3(card.details?.maszynista).ciResult);
318109
- if (full.sha !== sha5 || full.round !== 2 || !(full.verdict === "FAIL" || full.verdict === "PASS" && ciResult.sha === sha5 && Array.isArray(ciResult.runs) && ciResult.runs.some((value) => {
318255
+ if (full.sha !== sha5) return rejectGrant(diagnostic, "receipt_sha", 3);
318256
+ if (full.round !== 2) return rejectGrant(diagnostic, "receipt_round", 3);
318257
+ if (!(full.verdict === "FAIL" || full.verdict === "PASS" && ciResult.sha === sha5 && Array.isArray(ciResult.runs) && ciResult.runs.some((value) => {
318110
318258
  const { name: name3, status: status2, conclusion } = asRecord3(value);
318111
318259
  return status2 === "completed" && conclusion !== "success" && typeof name3 === "string" && REQUIRED_CHECKS2.some((required3) => name3.startsWith(required3));
318112
- }) || full.verdict === "PASS" && typeof review.notes === "string" && /^Konflikt rebase:/.test(review.notes)) || full.jobKey !== review.jobKey) return null;
318260
+ }) || full.verdict === "PASS" && typeof review.notes === "string" && /^Konflikt rebase:/.test(review.notes))) return rejectGrant(diagnostic, "receipt_verdict", 3);
318261
+ if (full.jobKey !== review.jobKey) return rejectGrant(diagnostic, "receipt_job", 3);
318113
318262
  } catch (error48) {
318114
- log2(`R4 ${card.id}: brak dowodu zako\u0144czonej R3: ${errorText5(error48)}`);
318115
- return null;
318263
+ if (!diagnostic && !grantCandidates(card).length) log2(`R4 ${card.id}: brak dowodu zako\u0144czonej R3: ${errorText5(error48)}`);
318264
+ return rejectGrant(diagnostic, grantReceiptError(error48), 3);
318116
318265
  }
318117
318266
  return { token, at: at3, sha: sha5, fromRound: 2, rulingSha256: (0, import_node_crypto32.createHash)("sha256").update(JSON.stringify(grant)).digest("hex") };
318118
318267
  }
318119
- async function consumeR3Grant(s, uid, card) {
318120
- const grant = r3Grant(card);
318268
+ async function consumeR3Grant(s, uid, card, diagnostic) {
318269
+ const grant = r3Grant(card, diagnostic);
318121
318270
  if (!grant || decideReviewMove("FAIL", 2, 0, true) !== "repair") return false;
318122
318271
  const fresh = await getTask2(uid, card.id);
318123
- if (!fresh || fresh.status !== card.status || fresh.assignee !== card.assignee || !(0, import_node_util13.isDeepStrictEqual)(fresh.dependsOn, card.dependsOn) || landedSha(fresh) || draftHeld(fresh.details ?? {}) || !r3Grant(fresh) || ["maszynista", "review", "rozstrzygniecia_reksia", "card_owner", "reksio_withheld", "unblock", "scope_blocked_at"].some((key) => !(0, import_node_util13.isDeepStrictEqual)(fresh.details?.[key], card.details?.[key]))) return false;
318272
+ if (!fresh || fresh.status !== card.status || fresh.assignee !== card.assignee || !(0, import_node_util13.isDeepStrictEqual)(fresh.dependsOn, card.dependsOn) || landedSha(fresh) || draftHeld(fresh.details ?? {}) || !r3Grant(fresh, diagnostic) || ["maszynista", "review", "rozstrzygniecia_reksia", "card_owner", "reksio_withheld", "unblock", "scope_blocked_at"].some((key) => !(0, import_node_util13.isDeepStrictEqual)(fresh.details?.[key], card.details?.[key]))) return false;
318124
318273
  const review = { ...asRecord3(fresh.details?.review), round: 3, extraRoundGrant: { ...grant, briefSha256: contractSha(fresh) } };
318125
318274
  const maszynista = { ...asRecord3(fresh.details?.maszynista), phase: "repair", move: "repair" };
318126
318275
  await updateTask2(uid, card.id, {
@@ -318145,50 +318294,59 @@ function contractSha(card) {
318145
318294
  if (typeof declared === "string" && /^[a-f0-9]{64}$/i.test(declared) && declared.toLowerCase() !== computed.toLowerCase()) return null;
318146
318295
  return computed.toLowerCase();
318147
318296
  }
318148
- function r4Grant(card) {
318297
+ function r4Grant(card, diagnostic) {
318149
318298
  const review = asRecord3(card.details?.review), sha5 = review.sha, r3 = review.extraRoundGrant;
318150
- if (!/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(card.id) || card.details?.card_owner !== "control-room" || card.details?.reksio_withheld === true || review.verdict !== "FAIL" || review.round !== 3 || r3 == null || typeof sha5 !== "string" || !/^[a-f0-9]{40}$/.test(sha5)) return null;
318299
+ if (!/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(card.id)) return rejectGrant(diagnostic, "card_id", 4);
318300
+ if (card.details?.card_owner !== "control-room") return rejectGrant(diagnostic, "card_owner", 4);
318301
+ if (card.details?.reksio_withheld === true) return rejectGrant(diagnostic, "veto", 4);
318302
+ if (review.verdict !== "FAIL") return rejectGrant(diagnostic, "review_verdict", 4);
318303
+ if (review.round !== 3) return rejectGrant(diagnostic, "review_round", 4);
318304
+ if (r3 == null) return rejectGrant(diagnostic, "r3_missing", 4);
318305
+ if (typeof sha5 !== "string" || !/^[a-f0-9]{40}$/.test(sha5)) return rejectGrant(diagnostic, "sha_mismatch", 4);
318151
318306
  const current = contractSha(card);
318152
- if (!current) return null;
318307
+ if (!current) return rejectGrant(diagnostic, "contract", 4);
318153
318308
  const token = `LIMIT_RUND ${card.id} ${sha5} R4`;
318154
318309
  const rulings = card.details?.rozstrzygniecia_reksia;
318155
318310
  const matching = Array.isArray(rulings) ? rulings.map(asRecord3).filter((ruling2) => ruling2.znalezisko === token) : [];
318156
- if (matching.length !== 1) return null;
318311
+ if (matching.length !== 1) return rejectGrant(diagnostic, "ambiguous_rulings", 4);
318157
318312
  const ruling = matching[0], at3 = ruling.at, declared = ruling.nowy_brief_sha256;
318158
- if (ruling.werdykt !== "UCHYLONE" || ruling.by !== "control-room" || typeof ruling.powod !== "string" || !ruling.powod.trim() || typeof at3 !== "string" || !/^\d{4}-\d\d-\d\dT.*Z$/.test(at3) || !Number.isFinite(Date.parse(at3)) || !Number.isFinite(Date.parse(String(review.at))) || Date.parse(at3) < Date.parse(String(review.at)) || Date.parse(at3) > Date.now()) return null;
318313
+ if (ruling.werdykt !== "UCHYLONE" || ruling.by !== "control-room" || typeof ruling.powod !== "string" || !ruling.powod.trim()) return rejectGrant(diagnostic, "ruling", 4);
318314
+ if (typeof at3 !== "string" || !/^\d{4}-\d\d-\d\dT.*Z$/.test(at3) || !Number.isFinite(Date.parse(at3)) || !Number.isFinite(Date.parse(String(review.at))) || Date.parse(at3) < Date.parse(String(review.at)) || Date.parse(at3) > Date.now()) return rejectGrant(diagnostic, "time", 4);
318159
318315
  const used = asRecord3(review.extraRound4Grant);
318160
- if (used.sha === sha5 || typeof used.briefSha256 === "string" && used.briefSha256.toLowerCase() === current) return null;
318316
+ if (used.sha === sha5 || typeof used.briefSha256 === "string" && used.briefSha256.toLowerCase() === current) return rejectGrant(diagnostic, "brief_used", 4);
318161
318317
  try {
318162
318318
  const full = asRecord3(JSON.parse((0, import_node_fs47.readFileSync)(checkedReceipt(review.receipt).path, "utf8")));
318163
- if (full.sha !== sha5 || full.round !== 3 || full.jobKey !== review.jobKey) return null;
318319
+ if (full.sha !== sha5) return rejectGrant(diagnostic, "receipt_sha", 4);
318320
+ if (full.round !== 3) return rejectGrant(diagnostic, "receipt_round", 4);
318321
+ if (full.jobKey !== review.jobKey) return rejectGrant(diagnostic, "receipt_job", 4);
318164
318322
  if (full.verdict === "FAIL") {
318165
- if (typeof declared !== "string" || !/^[a-f0-9]{64}$/i.test(declared) || declared.toLowerCase() !== current) return null;
318323
+ if (typeof declared !== "string" || !/^[a-f0-9]{64}$/i.test(declared) || declared.toLowerCase() !== current) return rejectGrant(diagnostic, "brief_mismatch", 4);
318166
318324
  const previous = asRecord3(r3).briefSha256;
318167
318325
  if (typeof previous === "string") {
318168
- if (previous.toLowerCase() === current) return null;
318326
+ if (previous.toLowerCase() === current) return rejectGrant(diagnostic, "brief_used", 4);
318169
318327
  } else {
318170
318328
  const r3Ruling = [...Array.isArray(rulings) ? rulings : [], asRecord3(card.details?.unblock).verdict].find((candidate) => candidate != null && rulingSha(candidate) === asRecord3(r3).rulingSha256);
318171
318329
  const r3Brief = asRecord3(r3Ruling).nowy_brief_sha256;
318172
- if (typeof r3Brief === "string" && r3Brief.toLowerCase() === current) return null;
318330
+ if (typeof r3Brief === "string" && r3Brief.toLowerCase() === current) return rejectGrant(diagnostic, "brief_used", 4);
318173
318331
  }
318174
318332
  } else if (full.verdict === "PASS") {
318175
318333
  const ciResult = asRecord3(asRecord3(card.details?.maszynista).ciResult), previousSha = asRecord3(r3).sha;
318176
318334
  if (typeof previousSha !== "string" || !/^[a-f0-9]{40}$/.test(previousSha) || previousSha === sha5 || ciResult.sha !== sha5 || !Array.isArray(ciResult.runs) || !ciResult.runs.some((value) => {
318177
318335
  const { name: name3, status: status2, conclusion } = asRecord3(value);
318178
318336
  return status2 === "completed" && conclusion !== "success" && typeof name3 === "string" && REQUIRED_CHECKS2.some((required3) => name3.startsWith(required3));
318179
- })) return null;
318180
- } else return null;
318337
+ })) return rejectGrant(diagnostic, "ci", 4);
318338
+ } else return rejectGrant(diagnostic, "receipt_verdict", 4);
318181
318339
  } catch (error48) {
318182
- log2(`runda 3\u21924 ${card.id}: brak dowodu zako\u0144czonej rundy 3: ${errorText5(error48)}`);
318183
- return null;
318340
+ if (!diagnostic && !grantCandidates(card).length) log2(`runda 3\u21924 ${card.id}: brak dowodu zako\u0144czonej rundy 3: ${errorText5(error48)}`);
318341
+ return rejectGrant(diagnostic, grantReceiptError(error48), 4);
318184
318342
  }
318185
318343
  return { token, at: at3, sha: sha5, fromRound: 3, briefSha256: current, rulingSha256: rulingSha(ruling) };
318186
318344
  }
318187
- async function consumeR4Grant(s, uid, card) {
318188
- const grant = r4Grant(card);
318345
+ async function consumeR4Grant(s, uid, card, diagnostic) {
318346
+ const grant = r4Grant(card, diagnostic);
318189
318347
  if (!grant) return false;
318190
318348
  const fresh = await getTask2(uid, card.id);
318191
- if (!fresh || fresh.status !== card.status || fresh.assignee !== card.assignee || !(0, import_node_util13.isDeepStrictEqual)(fresh.dependsOn, card.dependsOn) || landedSha(fresh) || draftHeld(fresh.details ?? {}) || !r4Grant(fresh) || ["maszynista", "review", "rozstrzygniecia_reksia", "card_owner", "reksio_withheld", "unblock", "scope_blocked_at", "seed_brief", "seed_brief_sha256"].some((key) => !(0, import_node_util13.isDeepStrictEqual)(fresh.details?.[key], card.details?.[key]))) return false;
318349
+ if (!fresh || fresh.status !== card.status || fresh.assignee !== card.assignee || !(0, import_node_util13.isDeepStrictEqual)(fresh.dependsOn, card.dependsOn) || landedSha(fresh) || draftHeld(fresh.details ?? {}) || !r4Grant(fresh, diagnostic) || ["maszynista", "review", "rozstrzygniecia_reksia", "card_owner", "reksio_withheld", "unblock", "scope_blocked_at", "seed_brief", "seed_brief_sha256"].some((key) => !(0, import_node_util13.isDeepStrictEqual)(fresh.details?.[key], card.details?.[key]))) return false;
318192
318350
  const review = { ...asRecord3(fresh.details?.review), round: 4, extraRound4Grant: grant };
318193
318351
  const maszynista = { ...asRecord3(fresh.details?.maszynista), phase: "repair", move: "repair" };
318194
318352
  await updateTask2(uid, card.id, {
@@ -318207,19 +318365,41 @@ async function consumeR4Grant(s, uid, card) {
318207
318365
  lastTick(s, "repair", `CR: jednorazowa runda 3\u21924 dla ${grant.sha}`, true, card.id);
318208
318366
  return true;
318209
318367
  }
318210
- async function recoverReviewRoundGrants(s, uid, cards) {
318368
+ async function recoverReviewRoundGrants(s, uid, cards, pending) {
318211
318369
  if (DRY2) return;
318370
+ const diagnostics = pending ?? /* @__PURE__ */ new Map();
318371
+ let failure3;
318212
318372
  for (const snapshot2 of cards) {
318213
- const details2 = snapshot2.details ?? {};
318214
- const rulings = details2.rozstrzygniecia_reksia;
318215
- const review = asRecord3(details2.review);
318216
- const tokens = [`LIMIT_RUND ${snapshot2.id} ${review.sha} R3`, `LIMIT_RUND ${snapshot2.id} ${review.sha} R4`];
318217
- if (snapshot2.status !== "blocked" || review.verdict !== "FAIL" || typeof review.sha !== "string" || details2.card_owner !== "control-room" || !Array.isArray(rulings) || !rulings.some((ruling) => tokens.includes(String(asRecord3(ruling).znalezisko)))) continue;
318218
- const fresh = await getTask2(uid, snapshot2.id);
318219
- if (fresh?.status !== "blocked" || !recoveryDetailsMatch(fresh, snapshot2)) continue;
318220
- if (r3Grant(fresh)) await consumeR3Grant(s, uid, fresh);
318221
- else if (r4Grant(fresh)) await consumeR4Grant(s, uid, fresh);
318373
+ if (!grantCandidates(snapshot2).length) continue;
318374
+ try {
318375
+ const fresh = await getTask2(uid, snapshot2.id);
318376
+ if (!fresh) continue;
318377
+ rememberGrantDiagnostics(diagnostics, fresh);
318378
+ const diagnostic = diagnostics.get(fresh.id);
318379
+ const details2 = snapshot2.details ?? {};
318380
+ const review = asRecord3(details2.review);
318381
+ const tokens = [`LIMIT_RUND ${snapshot2.id} ${review.sha} R3`, `LIMIT_RUND ${snapshot2.id} ${review.sha} R4`];
318382
+ const rulings = details2.rozstrzygniecia_reksia;
318383
+ if (!recoveryDetailsMatch(fresh, snapshot2) || fresh.status !== snapshot2.status) {
318384
+ rejectGrant(diagnostic, "snapshot_changed");
318385
+ continue;
318386
+ }
318387
+ if (snapshot2.status !== "blocked") {
318388
+ rejectGrant(diagnostic, "status");
318389
+ continue;
318390
+ }
318391
+ if (review.verdict !== "FAIL" || typeof review.sha !== "string" || details2.card_owner !== "control-room" || !Array.isArray(rulings) || !rulings.some((ruling) => tokens.includes(String(asRecord3(ruling).znalezisko)))) continue;
318392
+ if (r3Grant(fresh, diagnostic)) await consumeR3Grant(s, uid, fresh, diagnostic);
318393
+ else if (r4Grant(fresh, diagnostic)) await consumeR4Grant(s, uid, fresh, diagnostic);
318394
+ } catch (error48) {
318395
+ const diagnostic = diagnostics.get(snapshot2.id);
318396
+ if (diagnostic) diagnostic.uncertain = true;
318397
+ failure3 ??= error48;
318398
+ safeLog(`grant recovery ${snapshot2.id}: ${errorText5(error48)}`);
318399
+ }
318222
318400
  }
318401
+ if (!pending) await flushReviewGrantDiagnostics(uid, diagnostics);
318402
+ if (failure3) throw failure3;
318223
318403
  }
318224
318404
  async function applyReview(s, uid, card, verdict, notes) {
318225
318405
  const previous = asRecord3(card.details?.review);
@@ -325479,8 +325659,9 @@ async function main2() {
325479
325659
  outcome = "failed";
325480
325660
  log2(`FAIL powr\xF3t pakowania: ${errorText6(error48)}`);
325481
325661
  }
325662
+ const grantDiagnostics = /* @__PURE__ */ new Map();
325482
325663
  try {
325483
- await recoverReviewRoundGrants(s, uid, activationCards);
325664
+ await recoverReviewRoundGrants(s, uid, activationCards, grantDiagnostics);
325484
325665
  } catch (error48) {
325485
325666
  runtimeFailed = true;
325486
325667
  outcome = "failed";
@@ -325552,12 +325733,13 @@ async function main2() {
325552
325733
  };
325553
325734
  await leadPhase();
325554
325735
  try {
325555
- await recoverBlockedWorkers(s, uid, projectId2);
325736
+ await recoverBlockedWorkers(s, uid, projectId2, DRY2, grantDiagnostics);
325556
325737
  } catch (error48) {
325557
325738
  runtimeFailed = true;
325558
325739
  outcome = "failed";
325559
325740
  log2(`FAIL powr\xF3t po blokerze: ${errorText6(error48)}`);
325560
325741
  }
325742
+ await flushReviewGrantDiagnostics(uid, grantDiagnostics);
325561
325743
  await leadPhase();
325562
325744
  let dispatchableReadyCount = "UNKNOWN";
325563
325745
  let dispatchError;
@@ -325948,7 +326130,7 @@ var init_tick = __esm({
325948
326130
  REVIEW_SCAN_FIELDS = [...REVIEW_RECOVERY_FIELDS];
325949
326131
  DECISION_QUEUE_SCAN_FIELDS = ["id", "cardId", "reason", "openedAt", "wakes", "attempt", "escalatedAt", "lastMachineWriteAt", "closedAt", "kind", "event_id", "rodzaj", "card_id", "event_type", "occurrence_id", "recipient", "pointer", "readiness", "proof", "lead_class", "consumed"];
325950
326132
  DECISION_REFRESH_DETAILS_KEYS = [...DECISION_DETAILS_KEYS];
325951
- BLOCKED_WORKER_DETAILS_KEYS = ["maszynista", "landed", "reksio_withheld"];
326133
+ BLOCKED_WORKER_DETAILS_KEYS = ["maszynista", "landed", "reksio_withheld", "rozstrzygniecia_reksia"];
325952
326134
  ENABLED_SCAN_DETAILS_KEYS = ["card_class", "landed", "enabled_check", "enabled_evidence", "enabled_auto"];
325953
326135
  RESERVATION_DETAILS_KEYS = [...SCOPE_RESERVATION_DETAILS_KEYS, "origin"];
325954
326136
  RESERVATION_SCAN_DETAILS_KEYS = [...RESERVATION_DETAILS_KEYS, "test", "landed", "retest"];
@@ -326141,6 +326323,7 @@ init_tick();
326141
326323
  executeDeliveredTest,
326142
326324
  executeTesterJob,
326143
326325
  findEngineProject,
326326
+ flushReviewGrantDiagnostics,
326144
326327
  handleCiNoChecksAlarm,
326145
326328
  handleDiskPressure,
326146
326329
  hostActivationAlarm,
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.31 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
20
+ export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.33 \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.31) <!-- x-release-please-version -->
1
+ # robisie — from account to accepted card (package 0.5.33) <!-- 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
 
@@ -7,7 +7,7 @@ Polski: [README.md](README.md).
7
7
  <!-- sekcja: dostepnosc -->
8
8
  ## Availability
9
9
 
10
- An account and key are needed for init and the roles. Offline configuration validation is a separate entry point when the CLI is available: it does not check the installation, start providers or require a project UUID from you. Separately, `npx robisie doctor --engine-config ./robisie.config.json` checks configuration structure and local installation inputs offline: it does not confirm project UUID, repo, models or provider execution. The guides shipped in this package are local at `node_modules/robisie/docs/README.md` and `node_modules/robisie/docs/README.en.md`; no website fetch is needed.
10
+ An account and key are needed for init and the roles. `npx robisie doctor --engine-config ./robisie.config.json` with explicit `engine.mode:host` checks structure and local installation inputs offline, without CLI checks. With `engine.mode:client` or a missing `engine.mode` field, after input validation and when the program is available, it also checks CLI presence and login: `codex login status` and `grok models` (`grok models` requires a network; Grok confirms login only probably), plus `claude auth status` only when `reviewer-client.provider: claude`. A missing program does not check login. Neither mode runs a real AI task or engine commands, and neither confirms project UUID, repo or models. The guides shipped in this package are local at `node_modules/robisie/docs/README.md` and `node_modules/robisie/docs/README.en.md`; no website fetch is needed.
11
11
 
12
12
  Install robisie from npm in the prepared directory; run subsequent commands and agent sessions there. [Preparation](#wymagania) → [account](#konto) → [key](#klucz) → [installation](#instalacja) → [acceptance](#recenzja-i-odbior).
13
13
 
@@ -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` 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.
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` with explicit `engine.mode:host` checks structure offline, without CLI checks. With `engine.mode:client` or a missing `engine.mode` field, after input validation and when the program is available, it checks this pair and login: `codex login status` and `grok models` (`grok models` requires a network; Grok confirms login only probably), plus `claude auth status` only when `reviewer-client.provider: claude`. A missing program does not check login, and a missing CLI or unconfirmed login prevents readiness. Neither mode runs a real AI task. Parsing and this doctor do not prove model or 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
@@ -303,7 +303,7 @@ Save the entire JSON below as `robisie.config.json` in the repo directory, witho
303
303
  ```
304
304
  <!-- local-engine-config:end -->
305
305
 
306
- After replacing and saving configuration, prepare local engine inputs; init creates the project goal and tester safety list in `stateDir/inputs`. Continue only after ordinary doctor exits 0; offline validation alone does not check account or executor readiness.
306
+ After replacing and saving configuration, prepare local engine inputs; init creates the project goal and tester safety list in `stateDir/inputs`. Continue only after ordinary doctor exits 0; `doctor --engine-config` alone does not check the account. Offline checks and no CLI apply only to explicit `engine.mode:host`; with `engine.mode:client` or a missing `engine.mode` field, probes follow input validation and only when the program is available, without a real AI task.
307
307
 
308
308
  ```sh
309
309
  npx robisie init &&
@@ -632,6 +632,6 @@ After repair with an existing record, load the saved key as shown in Update befo
632
632
 
633
633
  The installer does not start background services or the Builder on its own; after operator approval, the CEO can start the Builder through `spawn_builder`. Helpers run during agent sessions using the project directory (or `ROBISIE_PROJECT_CONTEXT`) as context. The installer contacts robisie to check the contract and key; the package file does not provide an account or AI provider access. One shared key identity does not provide three different permission levels. Acceptance requires independent review, evidence and the operator's approval.
634
634
 
635
- Windows/WSL are unverified. Offline validation checks configuration structure, not project UUID, repo existence, model availability or provider execution.
635
+ Windows/WSL are unverified. `doctor --engine-config` with explicit `engine.mode:host` checks structure and local installation inputs offline, without CLI checks. With `engine.mode:client` or a missing `engine.mode` field, after input validation and when the program is available, it checks CLI presence and login: `codex login status` and `grok models` (`grok models` requires a network; Grok confirms login only probably), plus `claude auth status` only when `reviewer-client.provider: claude`. A missing program does not check login. Neither mode runs a real AI task or engine commands, and neither confirms project UUID, repo existence or model availability.
636
636
 
637
637
  The package engine (`dist/engine/tick.cjs`) is separate from the installer: it is started by `npx robisie factory run --engine-config ./robisie.config.json` on Linux or macOS for the client (`local`) or an explicit Robisie host (`mode: "host"`, `pr|delivered`). Other systems receive code 2 and a message. The `--once` option runs one tick without a pause and excludes an explicit `--interval`. Every nonzero tick result stops the supervisor („Fabryka zatrzymana: …”) with one diagnostic line on stderr; code 2 means an escalation (e.g. missing B key after receiver PASS, tester refusal, acceptance STOP) that must be resolved before retrying, and code 78 points to configuration repair. Real customer use on Linux will be proven in the D9 acceptance; a live macOS host switch and return require separate operator acceptance. Automatic FJ plans for customers are announced (“soon”) but are not in this release; the selector returns the true result.
package/docs/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # robisie — od konta do odebranej karty (paczka 0.5.31) <!-- x-release-please-version -->
1
+ # robisie — od konta do odebranej karty (paczka 0.5.33) <!-- 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
 
@@ -9,7 +9,7 @@ English: [README.en.md](README.en.md).
9
9
  <!-- sekcja: dostepnosc -->
10
10
  ## Dostępność
11
11
 
12
- Konto i klucz są potrzebne do init i pracy ról. Osobne wejście to walidacja offline, gdy CLI jest dostępne: nie sprawdza instalacji, nie uruchamia dostawców i nie wymaga podawania UUID projektu. Osobno `npx robisie doctor --engine-config ./robisie.config.json` sprawdza offline strukturę konfiguracji i wejścia instalacji lokalnej: nie potwierdza UUID projektu, repo, modeli ani uruchomienia dostawców. Przewodniki z tej paczki znajdziesz lokalnie w `node_modules/robisie/docs/README.md` i `node_modules/robisie/docs/README.en.md`; nie trzeba pobierać ich ze strony.
12
+ Konto i klucz są potrzebne do init i pracy ról. `npx robisie doctor --engine-config ./robisie.config.json` przy jawnym `engine.mode:host` sprawdza offline strukturę konfiguracji i wejścia instalacji lokalnej, bez kontroli CLI. Przy `engine.mode:client` albo braku pola `engine.mode`, po walidacji wejść i przy dostępnym programie, sprawdza obecność CLI oraz logowanie: `codex login status` i `grok models` (`grok models` wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie), a `claude auth status` wyłącznie przy `reviewer-client.provider: claude`. Brak programu nie pozwala sprawdzić logowania. Żaden tryb nie wykonuje prawdziwego zadania AI ani komend silnika i nie potwierdza UUID projektu, repo ani modeli. Przewodniki z tej paczki znajdziesz lokalnie w `node_modules/robisie/docs/README.md` i `node_modules/robisie/docs/README.en.md`; nie trzeba pobierać ich ze strony.
13
13
 
14
14
  Zainstaluj robisie z npm w przygotowanym katalogu; w nim uruchamiaj dalsze polecenia i sesje agentów. [Przygotowanie](#wymagania) → [konto](#konto) → [klucz](#klucz) → [instalacja](#instalacja) → [odbiór](#recenzja-i-odbior).
15
15
 
@@ -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` 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.
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` przy jawnym `engine.mode:host` sprawdza strukturę offline, bez kontroli CLI. Przy `engine.mode:client` albo braku pola `engine.mode` sprawdza tę parę i logowanie po walidacji wejść i przy dostępnym programie: `codex login status` i `grok models` (`grok models` wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie), a `claude auth status` wyłącznie przy `reviewer-client.provider: claude`. Brak programu nie pozwala sprawdzić logowania; brak CLI lub potwierdzenia logowania nie daje gotowości. Żaden tryb nie wykonuje prawdziwego zadania AI. Same parsowanie i ten doctor 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
 
@@ -350,7 +350,7 @@ Worker Codex na Linuksie może uruchamiać testy tworzące procesy, ale proxy de
350
350
  ```
351
351
  <!-- local-engine-config:end -->
352
352
 
353
- Po podmianie i zapisaniu konfiguracji przygotuj wejścia lokalnego silnika; init utworzy cel projektu i listę ochrony testera w `stateDir/inputs`. Kontynuuj dopiero po zwykłym doctor z exit 0; sama walidacja offline nie sprawdza konta ani gotowości wykonawców.
353
+ Po podmianie i zapisaniu konfiguracji przygotuj wejścia lokalnego silnika; init utworzy cel projektu i listę ochrony testera w `stateDir/inputs`. Kontynuuj dopiero po zwykłym doctor z exit 0; samo `doctor --engine-config` nie sprawdza konta. Offline i brak CLI dotyczą wyłącznie jawnego `engine.mode:host`; przy `engine.mode:client` albo braku pola `engine.mode` sondy następują po walidacji wejść i przy dostępnym programie, bez prawdziwego zadania AI.
354
354
 
355
355
  ```sh
356
356
  npx robisie init &&
@@ -679,6 +679,6 @@ Po naprawie przy istniejącej ewidencji wczytaj zapisany klucz według Aktualiza
679
679
 
680
680
  Instalator nie uruchamia sam usług w tle ani Buildera; po zgodzie operatora CEO może uruchomić Buildera przez `spawn_builder`. Pomocniki działają podczas sesji agenta, z kontekstem katalogu projektu (lub `ROBISIE_PROJECT_CONTEXT`). Instalator łączy się z robisie w celu sprawdzenia kontraktu i klucza; plik paczki nie zapewnia konta ani dostępu do dostawcy AI. Jedna wspólna tożsamość klucza nie daje trzech różnych poziomów uprawnień. Odbiór wymaga niezależnej recenzji, dowodów i zgody operatora.
681
681
 
682
- Windows/WSL są niezweryfikowane. Walidacja offline sprawdza strukturę konfiguracji i wejścia instalacji lokalnej, nie UUID projektu, istnienie repo, dostępność modeli ani uruchomienie dostawców.
682
+ Windows/WSL są niezweryfikowane. `doctor --engine-config` przy jawnym `engine.mode:host` sprawdza offline strukturę konfiguracji i wejścia, bez kontroli CLI; przy `engine.mode:client` albo braku pola `engine.mode`, po walidacji wejść i przy dostępnym programie, sprawdza CLI: `codex login status`, `grok models` (`grok models` wymaga sieci; Grok potwierdza logowanie tylko prawdopodobnie) i `claude auth status` wyłącznie przy `reviewer-client.provider: claude`. Brak programu nie pozwala sprawdzić logowania. Żaden tryb nie wykonuje prawdziwego zadania AI ani komend silnika i nie potwierdza UUID projektu, istnienia repo ani dostępności modeli.
683
683
 
684
684
  Silnik paczki (`dist/engine/tick.cjs`) jest odrębny od instalatora: uruchamia go `npx robisie factory run --engine-config ./robisie.config.json` na Linuxie lub macOS dla klienta (`local`) oraz jawnego hosta Robisie (`mode: "host"`, `pr|delivered`). Pozostałe systemy otrzymują kod 2 i komunikat. Opcja `--once` uruchamia jeden takt bez przerwy i wyklucza jawne `--interval`. Każdy niezerowy wynik taktu zatrzymuje nadzorcę („Fabryka zatrzymana: …”) z jedną linią diagnozy na stderr; kod 2 to eskalacja (np. brak klucza B po receiver PASS, odmowa testera, STOP odbioru) wymagająca rozstrzygnięcia przed ponowieniem, a kod 78 wskazuje konfigurację do poprawy. Realne użycie u klienta na Linuxie zostanie udowodnione w odbiorze D9; próba żywego hosta na macOS i jego powrotu wymaga osobnego odbioru operatora. Automatyczne plany FJ u klienta są zapowiedziane („wkrótce”), ale nie ma ich w tym wydaniu; selektor zwraca prawdziwy wynik.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robisie",
3
- "version": "0.5.31",
3
+ "version": "0.5.33",
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",