robisie 0.5.44 → 0.5.46

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,31 @@
1
1
  # Historia zmian klienta / Client changelog
2
2
 
3
+ ## [0.5.46](https://github.com/chuppa12/robisie-app/compare/client-v0.5.45...client-v0.5.46) (2026-11-16)
4
+
5
+
6
+ ### Factory Cards
7
+
8
+ * flaga --effort Groka z osobnej zmiennej, receipt effort zostaje none (walidator klienta tick.ts:5062); atrapa Groka przyjmuje --effort ([353399a](https://github.com/chuppa12/robisie-app/commit/353399a7d2e3e5f104e366703d40a773e49d9254))
9
+ * praca workera task-mwizhyqk-1dtx7a (auto-commit) ([e814c19](https://github.com/chuppa12/robisie-app/commit/e814c19ffd38185d2b44c1a3aff9d10fad714634))
10
+ * praca workera task-mwj1ycmq-rv3ixk (auto-commit) ([51e40b4](https://github.com/chuppa12/robisie-app/commit/51e40b465192e348daa5d20cde960a7d32089f31))
11
+ * praca workera task-mwj2iwcu-tu7d05 (auto-commit) ([8b542ed](https://github.com/chuppa12/robisie-app/commit/8b542edf6bd84c41c36f2614f29f93cdd92b5cb9))
12
+ * praca workera task-mwj3zz6g-pd7sfw (auto-commit) ([1ce1765](https://github.com/chuppa12/robisie-app/commit/1ce1765c3fc9a5abf2677857e1a7fad41e916eb4))
13
+ * praca workera task-mwj54vqb-w5zy7c (auto-commit) ([50f8e0a](https://github.com/chuppa12/robisie-app/commit/50f8e0ad5b4c36f5d7d81e5e42facfb7f5013da0))
14
+ * praca workera task-mwj6ptow-aozigb (auto-commit) ([6c870f8](https://github.com/chuppa12/robisie-app/commit/6c870f8e915a1ac817da48bf32c8ab00ceb984be))
15
+ * praca workera task-mwj7ff7g-i59rea (auto-commit) ([71bb19b](https://github.com/chuppa12/robisie-app/commit/71bb19b3d1cb1ff9a53ac486ebe7237ce2b25f81))
16
+ * recenzent Grok dostaje jawny --effort (host low, klient z roli; none → low), żeby runda mieściła się w budżecie 45 min ([47a969f](https://github.com/chuppa12/robisie-app/commit/47a969fbc91664e33cd44ff9418677cbcab7d104))
17
+ * recenzent Grok dostaje jawny --effort (Z4 timeout) ([fdcaab5](https://github.com/chuppa12/robisie-app/commit/fdcaab5d83f8465414d852c7797cbdbcef7ac545))
18
+ * recenzent Grok dostaje jawny --effort (Z4 timeout) ([fdcaab5](https://github.com/chuppa12/robisie-app/commit/fdcaab5d83f8465414d852c7797cbdbcef7ac545))
19
+
20
+ ## [0.5.45](https://github.com/chuppa12/robisie-app/compare/client-v0.5.44...client-v0.5.45) (2026-11-16)
21
+
22
+
23
+ ### Factory Cards
24
+
25
+ * praca workera task-mwiogmiv-ud00ai (auto-commit) ([ff5521a](https://github.com/chuppa12/robisie-app/commit/ff5521ab04b7d71a7329f0453d17d9227476952d))
26
+ * praca workera task-mwiq6vxj-j06195 (auto-commit) ([56e6f0b](https://github.com/chuppa12/robisie-app/commit/56e6f0bb94034c1f6db13d0050dd5354b21ce254))
27
+ * praca workera task-mwirilg9-4njt21 (auto-commit) ([7d2edc8](https://github.com/chuppa12/robisie-app/commit/7d2edc86e3467c7ea20795d249d131ca7840668f))
28
+
3
29
  ## [0.5.44](https://github.com/chuppa12/robisie-app/compare/client-v0.5.43...client-v0.5.44) (2026-11-16)
4
30
 
5
31
 
package/README.md CHANGED
@@ -181,38 +181,20 @@ Przed aktualizacją wymagany jest brak plików `.tester-job.lock`, `.tester-job.
181
181
 
182
182
  Aktualizuj w katalogu instalacji po prywatnej kopii opisanej w przewodnikach, z tym samym XDG_CONFIG_HOME i CODEX_HOME. `npx robisie init` odświeża zapisanych agentów i mapę ról, używając poprawnego zapisanego klucza bez ponownego wpisywania. W ręcznej instalacji bez login ROBISIE_KEY ma pierwszeństwo; jawny `--key-stdin` zachowuje tor pytania/stdin i umożliwia wymianę klucza. Bez zapisanej instalacji lub przy braku/pustym kluczu init korzysta z dotychczasowego pytania. Wadliwy niepusty klucz, błąd odczytu lub dowiązanie wymagają naprawy lokalnej, bez nadpisywania.
183
183
 
184
- Doctor podaje rzeczywiste wersje starych pomocników i markerów ról oraz wersję paczki; wskazane init aktualizuje je przez zwykły zapis z kopiami. Po login doctor używa plików A/B z ostrzeżeniem przy różnym starym ENV; ręczny doctor wymaga obu ENV, a osobni agenci używają źródeł zależnych od dostawcy opisanych wyżej. Poniższy przykład usuwa wcześniejszy ROBISIE_KEY z sesji, aby init użył zapisanego pliku; po init wczytuje ENV dla doctor i agentów, bez xtrace i bez wydruku:
184
+ Doctor podaje rzeczywiste wersje starych pomocników i markerów ról oraz wersję paczki; wskazane init aktualizuje je przez zwykły zapis z kopiami. Po login doctor używa plików A/B z ostrzeżeniem przy różnym starym ENV; ręczny doctor wymaga obu ENV, a osobni agenci używają źródeł zależnych od dostawcy opisanych wyżej. Komenda update czyta klucze instalacji z chronionych plików, bez ponownego wpisywania i bez ich wydruku:
185
185
 
186
186
  Kopia i odtworzenie obejmują oba pliki key i review-key z prywatnymi uprawnieniami; przed init/doctor wczytaj oba odtworzone klucze. Uninstall raportuje osobno stan obu plików i usuwa je z zachowaniem dotychczasowej ochrony ewidencji oraz konfiguracji. Nie unieważnia żadnego klucza na serwerze.
187
187
 
188
+ Zwykła aktualizacja to `npx robisie update` (host: dodaj `--engine-config /absolutna/sciezka/robisie.config.json`). Pierwsze interaktywne wywołanie pyta jawnie o zgodę i zapisuje `update={consentedAt, enabled:true}`, zachowując pozostałe pola konfiguracji. Bez zgody lub przy `enabled:false` wywołanie w tle kończy się kodem 0 bez zmian. Po zgodzie launchd `com.robisie.update` albo `robisie-update.timer` uruchamia tę samą komendę co 120 sekund; fabryka wykonuje `factory run --once` na osobnym cyklu 120 sekund. Paczka przygotowuje dokładną wersję npm w osobnym katalogu, sprawdza build-id i integralność, potem wymienia prywatny wskaźnik current. Zdrowie wymaga dwóch różnych świeżych taktów OK z loaded oczekiwanego build-id w 1200 sekund, odczytywanych co 20 sekund. Przy błędzie powrót ma osobne okno 1200 sekund dla starego wydania; zarówno potwierdzony, jak i niepotwierdzony powrót ma kod niezerowy. Nowa praca blokuje przełączenie lub powrót. Host bez transportu tablicy poza tick odmawia jawnie; komenda nie dodaje klienta DB. Prywatny audyt i próby znajdziesz w `<stateDir>/update/`; błąd przygotowania też zapisuje wersję. Aby ponowić po wyjaśnieniu przyczyny, usuń jedną linię tej wersji z `attempts.jsonl`. Odroczenie nie oznacza nieudanej próby; po 7200 sekund zapisuje jeden alarm. `AUTO-UPDATE.off` nie steruje produktem. Zachowaj prywatną kopię i osobny awaryjny restore archiwum. Po odświeżeniu ról uruchom ponownie asystenta.
189
+
188
190
  <!-- update:start -->
189
191
  ```sh
190
192
  set +x
191
- unset ROBISIE_KEY ROBISIE_REVIEW_KEY &&
192
- npm i robisie@latest &&
193
- npx robisie init &&
194
- {
195
- if [ ! -L "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/key" ] &&
196
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/key" ] &&
197
- [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/key" ] &&
198
- [ ! -L "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/review-key" ] &&
199
- [ -f "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/review-key" ] &&
200
- [ -r "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/review-key" ] &&
201
- ROBISIE_REVIEW_KEY="$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/review-key" 2>/dev/null)" &&
202
- [ -n "$ROBISIE_REVIEW_KEY" ] &&
203
- ROBISIE_KEY="$(cat "${XDG_CONFIG_HOME:-$HOME/.config}/robisie/key" 2>/dev/null)" &&
204
- [ -n "$ROBISIE_KEY" ]; then
205
- export ROBISIE_KEY ROBISIE_REVIEW_KEY
206
- else
207
- printf '%s\n' 'Nie można wczytać obu niepustych, zwykłych, czytelnych plików kluczy robisie (key, review-key).' 'Następny krok: sprawdź lokalnie plik klucza i jego odczyt; wyjaśnij link/katalog bez nadpisywania danych. Przy braku lub odmowie B podaj nowy owner_validator przez ROBISIE_REVIEW_KEY do init; --key-stdin wymienia tylko A. Nie wklejaj klucza do rozmowy.' >&2
208
- false
209
- fi
210
- } &&
211
- npx robisie doctor
193
+ npx robisie update
212
194
  ```
213
195
  <!-- update:end -->
214
196
 
215
- Doctor sprawdza MAJOR kontraktu. Przy niezgodności wybierz zgodne wydanie. Poprzedni zgodny tgz przygotuj przez `npm pack robisie@<wersja>`; komenda powrotu `npm i --no-save "$backup/robisie-$previous_version.tgz"` wymaga jawnie wybranej wersji, prywatnej kopii konfiguracji i porównania późniejszych własnych zmian według przewodników. Opcja `--no-save` zachowuje przywrócone `package.json` i `package-lock.json`, bez zapisywania zależności `file:` od ścieżki prywatnej kopii. Kolejność powrotu: konfiguracja i OBA manifesty projektu (`package.json`, `package-lock.json`) → ENV starego klucza → tgz → init → doctor. To nie jest automatyczny rollback.
197
+ Doctor sprawdza MAJOR kontraktu. Przy niezgodności wybierz zgodne wydanie. Poprzedni zgodny tgz przygotuj przez `npm pack robisie@<wersja>`; komenda powrotu `npm i --no-save "$backup/robisie-$previous_version.tgz"` wymaga jawnie wybranej wersji, prywatnej kopii konfiguracji i porównania późniejszych własnych zmian według przewodników. Opcja `--no-save` zachowuje przywrócone `package.json` i `package-lock.json`, bez zapisywania zależności `file:` od ścieżki prywatnej kopii. Kolejność powrotu: konfiguracja i OBA manifesty projektu (`package.json`, `package-lock.json`) → ENV starego klucza → tgz → init → doctor. Ten awaryjny restore archiwum jest osobny od automatycznego powrotu wskaźnika po niezdrowej aktualizacji.
216
198
 
217
199
  Pomocniki uruchamiaj z cwd instalacji przez `npx robisie mcp <nazwa>`; init nadal generuje transport dla wersji paczki. npx może pobrać brakującą wersję z sieci. Bez instalacji zacznij od konta → init; przy istniejącej instalacji rozwiąż błędy ewidencji i odczytu klucza przed błędami sieci. Odinstalowanie może zmienić package.json, package-lock.json i node_modules; cache npm może zostać, a npx może pobrać paczkę ponownie. Bez masowego kasowania. Windows/WSL są niezweryfikowane.
218
200
 
@@ -263,6 +245,8 @@ Granice: Landlock ma lukę ochrony metadanych; przed jądrem Linux 6.2 ma też l
263
245
 
264
246
  Przykład zastępujący cały `roleRegistry` dla Workera Grok (pozostałe ustawienia instalacji pozostają jak w przykładzie Codexa). Recenzent i odbiorca mają innego dostawcę. Brak `receiver-client` zachowuje historycznego Groka i przy Workerze Grok oznacza odmowę. Wspólny dostawca wymaga osobnego jawnego `requireIndependentProvider: false` odpowiedniej roli: pozostaje partial i znak „częściowa: bez niezależnego sprawdzenia”; wyjątek odbiorcy wymaga chronionego `review_receipt.receiverIndependenceWaived=true` zapisanego przez `accept_review`. Recenzenckie false nie zwalnia niezależności odbiorcy.
265
247
 
248
+ Po zmianie pary ról karty w toku trzeba ponowić („Ponów pracę”) albo przywrócić poprzednią konfigurację. `HOLD clientPair` dotyczy wskazanej karty; pozostałe poprawne karty mogą pracować dalej.
249
+
266
250
  <!-- grok-worker-example:start -->
267
251
  ```json
268
252
  {
package/dist/cli.js CHANGED
@@ -8,6 +8,7 @@ import { doctor, doctorClientPair, init, recoveryStep, uninstall } from "./comma
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
+ import { runInstallationUpdate } from "./installation-update.js";
11
12
  import { runFactory } from "./factory-run.js";
12
13
  import { CONFIG_FILE, loadEngineConfig } from "./engine-config.js";
13
14
  import { checkInputs, inputDirectory, INPUTS_OK, selectInputDirectory } from "./engine-inputs.js";
@@ -29,6 +30,7 @@ const HELP = `robisie ${PACKAGE_VERSION} — łączy Twojego agenta z tablicą r
29
30
  npx robisie login paruje instalację: kod i link zatwierdzasz w przeglądarce, klucze A i B trafiają prosto do plików
30
31
  npx robisie init klucze A (ROBISIE_KEY) i B (ROBISIE_REVIEW_KEY), osobne ukryte pytania + konfiguracja MCP + role klienta
31
32
  npx robisie doctor sprawdza A i B, wersję kontraktu, role i politykę enforced projektu
33
+ npx robisie update aktualizuje instalację; przy niezdrowym wydaniu sprawdza powrót do poprzedniej wersji
32
34
  npx robisie uninstall usuwa wpisy robisie i role; zachowuje kopie zapasowe
33
35
  npx robisie factory run nadzoruje takty (Linux/local klienta; Linux lub macOS jawnego hosta; Node.js >=24)
34
36
  npx robisie usage --input ./usage.json
@@ -36,6 +38,10 @@ const HELP = `robisie ${PACKAGE_VERSION} — łączy Twojego agenta z tablicą r
36
38
  npx robisie mcp <${HELPER_SERVERS.join("|")}>
37
39
  pomocnik ról (serwer MCP stdio) — uruchamia go agent, nie Ty
38
40
 
41
+ Opcje update:
42
+ --engine-config <path> lub --engine-config=<path> konfiguracja jak factory run; pierwsze interaktywne wywołanie pyta o zgodę
43
+ Bez konfiguracji domyślnej instaluje tylko robisie@latest; bez zgody w tle nic nie zmienia.
44
+
39
45
  Opcje factory run:
40
46
  --engine-config <path> plik konfiguracji; flaga wygrywa z ROBISIE_ENGINE_CONFIG
41
47
  --engine-config=<path> klient: local i stan poza repo; host: mode:host, pr|delivered i istniejący stan
@@ -105,8 +111,8 @@ export function parseArgs(argv) {
105
111
  }
106
112
  if (arg === "--engine-config" || arg.startsWith("--engine-config=")) {
107
113
  const step = "Użyj `npx robisie doctor --engine-config <path>` z jedną niepustą ścieżką pliku.";
108
- if (command !== "init" && command !== "doctor" && command !== "factory")
109
- throw new RobisieError("Opcja --engine-config jest dostępna tylko dla poleceń init, doctor i factory run.", step);
114
+ if (command !== "init" && command !== "doctor" && command !== "factory" && command !== "update")
115
+ throw new RobisieError("Opcja --engine-config jest dostępna tylko dla poleceń init, doctor, factory run i update.", step);
110
116
  if (engineConfig !== null)
111
117
  throw new RobisieError("Opcję --engine-config można podać tylko raz.", step);
112
118
  const value = arg === "--engine-config" ? args.shift() ?? "" : arg.slice("--engine-config=".length);
@@ -287,6 +293,8 @@ export async function run(argv, ctx) {
287
293
  return await doctor(ctx);
288
294
  case "uninstall":
289
295
  return uninstall(ctx);
296
+ case "update":
297
+ return await runInstallationUpdate(ctx, { engineConfig: args.engineConfig });
290
298
  case "factory":
291
299
  return await runFactory(ctx, { engineConfig: args.engineConfig, interval: args.interval, once: args.once });
292
300
  case "mcp":
@@ -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.44";
3
+ export declare const PACKAGE_VERSION = "0.5.46";
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.44"; // x-release-please-version
3
+ export const PACKAGE_VERSION = "0.5.46"; // 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":"26cd1623594b71037d31b847076be5126f48f80e","dirty":false}
1
+ {"schema":1,"sha":"90e87ee0c0c52ba1cc46739c1e5ecf3cfdde2027","dirty":false}
@@ -1692,14 +1692,14 @@
1692
1692
  "staticOperations": {
1693
1693
  "beforePreflight": {
1694
1694
  "module": "maszynista/tick.ts",
1695
- "startLine": 10119,
1696
- "endLine": 10232,
1695
+ "startLine": 10153,
1696
+ "endLine": 10266,
1697
1697
  "text": "export async function main(): Promise<number> {\n const start = standaloneStartCheck({ filename: __filename, env: process.env });\n if (start.standalone && !start.ok) {\n console.error(start.message);\n process.exitCode = 78;\n return 78;\n }\n let installation: EngineContext;\n try { installation = createEngineContext(currentEngine(), {\n loadEnvironment: loadEnvFiles, preflight, baseRef: engineBaseRef, refreshBase: fetchMain,\n disk: defaultDiskPressureDependencies, workerContext: loadNorthStar,\n controlEnv: hostEnv, workerEnv: executionEnv, prepareWorktree: prepareHostWorktree, workerArtifacts: createWorkerTmpdir,\n notify: async (card, reason) => { decisionForReksio(card, reason, \"Rozstrzygnij na karcie\", \"\", \"\"); return { outcome: \"recorded\", ref: DECISIONS_REKSIO }; },\n hostOperations: hostOperationsPhase,\n activation: { confirmLoaded, finishHostActivation, readActivationState, recoverTickTimeout, runEnabledAuto },\n }, git, log); }\n catch (error) {\n if (!engineClient()) throw error;\n console.error(`HOLD kontekst klienta: ${clientTickFailure(error)}`);\n process.exitCode = 78;\n return 78;\n }\n const previousInstallation = tickInstallation;\n const hostErrorText = errorText;\n const client = engineClient();\n const result: { outcome: \"ok\" | \"retry\" | \"stop\"; reason: string; cleanup: boolean } = { outcome: \"ok\", reason: \"\", cleanup: false };\n const stopClient = (reason = clientTickFailure()): void => {\n if (client && result.outcome !== \"stop\") { result.outcome = \"stop\"; result.reason = reason; }\n };\n let code = 2;\n try { code = await q.withPlannerQueries(installation.planner, async () => {\n tickInstallation = installation;\n const seedGateSettings = installationSeedGateSettings();\n const errorText = client ? clientTickFailure : hostErrorText;\n const loadEnvFiles = installation.loadEnvironment;\n const preflight = () => {\n const actor = installation.preflight();\n return { uid: actor.kind === \"db\" ? actor.uid : API_ACTOR };\n };\n const { confirmLoaded, finishHostActivation, readActivationState, recoverTickTimeout, runEnabledAuto } = installation.activation;\n const smokeOnly = DRY && process.env.MASZYNISTA_SMOKE === \"1\";\n if (!DRY) {\n const acquire = (): boolean => tryCreateTickLock(LOCK);\n if (!acquire()) {\n const raw = readFileSync(LOCK, \"utf8\"), pid = Number(raw);\n if (!Number.isSafeInteger(pid) || pid <= 0) { console.log(\"tick lock bez poprawnego PID — HOLD\"); return 0; }\n try { process.kill(pid, 0); console.log(`tick już trwa (pid ${pid})`); return 0; }\n catch (error) { if ((error as NodeJS.ErrnoException).code !== \"ESRCH\") throw error; }\n if (readFileSync(LOCK, \"utf8\") === raw) unlinkSync(LOCK);\n if (!acquire()) { console.log(\"tick już trwa\"); return 0; }\n }\n }\n skippedCardEvents.clear();\n let s = parseState(null).state;\n // Internal smoke handoff: the child cannot outlive the parent's reserved budget.\n const smokeLimit = DRY ? Number(process.env.MASZYNISTA_SMOKE_TIMEOUT_MS) : NaN;\n let stateLoaded = false;\n let tickStarted: string | undefined;\n let outcome: \"ok\" | \"failed\" = \"ok\";\n let runtimeFailed = false;\n let observedLoaded = \"UNKNOWN\";\n let tickPhase = \"startup\";\n const deadlineAlarm = armTickDeadline(() => s, Number.isSafeInteger(smokeLimit) && smokeLimit > 0\n ? Math.min(TICK_LIMIT_MS, smokeLimit) : TICK_LIMIT_MS, () => ({ phase: tickPhase, observedLoaded }));\n let hostReady = false;\n let hostBoard: { uid: string; projectId: string } | undefined;\n let activationCards: CardLike[] = [];\n let activationCardsKnown = false;\n let blockedBefore = 0;\n const clientStopped = (): boolean => {\n if (client && (outcome === \"failed\" || (!DRY && s.blocked > blockedBefore))) stopClient();\n if (client && result.outcome === \"stop\") outcome = \"failed\";\n return client && result.outcome === \"stop\";\n };\n let hostPhaseStarted = false;\n const hostPhase = async (): Promise<boolean> => {\n if (smokeOnly || !hostReady || hostPhaseStarted) return false;\n hostPhaseStarted = true;\n tickPhase = \"host\";\n if (hostBoard) {\n const { uid: boardUid, projectId: boardProject } = hostBoard;\n try {\n await runEnabledAuto({ state: s, loadedSha: observedLoaded, repo: REPO, logPath: LOG, tick: s.tick, stateDir: hostStateDir(),\n now: new Date().toISOString(), activation: readActivationState(hostStateDir()), dryRun: DRY }, {\n listCards: async () => scanTasks(boardUid, boardProject, { full: true, statuses: [\"delivered\"],\n detailsKeys: ENABLED_SCAN_DETAILS_KEYS }),\n getTask: id => q.getTask(boardUid, id),\n appendDetail: async (id, patch) => { await appendBoundedDetail(boardUid, id, patch); },\n saveState: writeState,\n alarm: hostActivationAlarm,\n log,\n });\n } catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL ENABLED auto: ${errorText(error)}`); }\n } else log(\"ENABLED auto: UNKNOWN — brak odczytu projektu; dowód karty czeka na dostęp do tablicy\");\n try {\n const result = await engineRunHostActivation({ repo: REPO, stateDir: hostStateDir(), cards: activationCards, cardsKnown: activationCardsKnown, tick: s.tick, dryRun: DRY }, {\n git, remainingTickMs, alarm: hostActivationAlarm, infrastructureChecks, infrastructurePullRequest, log: line => log(`host-activation: ${line}`),\n });\n log(`host-activation: code=${result.code} target=${result.target ?? \"UNKNOWN\"}${result.detail ? ` reason=${result.detail}` : \"\"}`);\n if (result.code === \"activate\" && result.target) {\n lastTick(s, \"activation\", `aktywacja ${result.target}; ogon odroczony`, outcome === \"ok\");\n return true;\n }\n } catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL aktywacja: ${errorText(error)}`); }\n return false;\n };\n try {\n observedLoaded = loadedSha = readLoadedSha(REPO);\n s = readState((await engineFjConfig()).enabled);\n stateLoaded = true; blockedBefore = s.blocked;\n s.tick++; tickStarted = new Date().toISOString(); s.lastTickAt = tickStarted;\n log(`tick_started tick=${s.tick} at=${tickStarted} duration=UNKNOWN loaded=${loadedSha}`);\n loadEnvFiles();\n const { uid } = preflight();"
1698
1698
  },
1699
1699
  "finalization": {
1700
1700
  "module": "maszynista/tick.ts",
1701
- "startLine": 10523,
1702
- "endLine": 10575,
1701
+ "startLine": 10557,
1702
+ "endLine": 10609,
1703
1703
  "text": " } finally {\n // A persisted terminal FAIL is a card result; every unexpected exception above\n // remains a runtime failure, including DB errors inside card handling.\n if (!DRY && s.blocked > blockedBefore) {\n outcome = \"failed\";\n try { log(`FAIL: licznik blocked wzrósł ${blockedBefore} → ${s.blocked}; outcome=failed`); }\n catch (error) { console.error(`zapis licznika blocked: ${errorText(error)}`); }\n }\n clientStopped();\n // Early board failure still reaches the same host phase, at most once per tick.\n await hostPhase();\n tickPhase = \"finalizing\";\n try { if (!DRY) await finishHostActivation({ stateDir: hostStateDir(), outcome, tick: s.tick, runtimeFailed, observedLoaded }, { alarm: hostActivationAlarm, log }); }\n catch (error) { runtimeFailed = true; outcome = \"failed\"; log(`FAIL breaker aktywacji: ${errorText(error)}`); }\n clientStopped();\n try { if (stateLoaded) writeState(s); }\n catch (error) { runtimeFailed = true; outcome = \"failed\"; if (!client) throw error; stopClient(); result.cleanup = true; }\n finally {\n if (!DRY) {\n try { if (readFileSync(LOCK, \"utf8\") === String(process.pid)) unlinkSync(LOCK); }\n catch (error) { if ((error as NodeJS.ErrnoException).code !== \"ENOENT\") { if (!client) throw error; stopClient(); result.cleanup = true; } }\n }\n const at = new Date().toISOString();\n const duration = tickStarted ? `${(Date.parse(at) - Date.parse(tickStarted)) / 1000}s` : \"UNKNOWN\";\n try {\n const { total, ops } = drainEgressCounters();\n const sorted = Object.entries(ops).sort(([, a], [, b]) => b.bytes - a.bytes);\n const summary = sorted.filter(([op]) => !op.includes(\":\")).slice(0, 12)\n .map(([op, counter]) => `${op}:${counter.calls}:${counter.bytes}`).join(\",\");\n const variants = sorted.filter(([op]) => op.includes(\":\")).slice(0, 6)\n .map(([op, counter]) => `${op}:${counter.calls}:${counter.bytes}`).join(\",\");\n log(`egress tick=${s.tick} total=${total} ops=${summary} variants=${variants}`);\n } catch { /* Optional metrics must never interrupt tick cleanup. */ }\n try { refreshTickReport(observedLoaded); log(`tick_finished tick=${s.tick} at=${at} outcome=${client && result.outcome === \"retry\" ? \"retry\" : outcome} duration=${duration} loaded=${loadedSha}`); }\n finally { clearTimeout(deadlineAlarm); tickDeadline = Number.POSITIVE_INFINITY; }\n }\n }\n }); } catch (error) {\n if (!client) throw error;\n stopClient(); result.cleanup = true;\n } finally {\n tickInstallation = previousInstallation;\n try { await installation.close(); }\n catch (error) {\n if (client) { stopClient(); result.cleanup = true; }\n else safeLog(`Zamknięcie instalacji nieudane: ${String(error)}`);\n }\n }\n if (client && result.outcome !== \"ok\") console.error(`Fabryka ${result.outcome === \"stop\" ? \"zatrzymana\" : \"retry\"}: ${result.reason}${result.cleanup ? \"; finalizacja niepotwierdzona — sprawdź stan i blokadę\" : \"\"}`);\n return client && result.outcome === \"stop\" ? 2 : code;\n}\n\nif (require.main === module && !([\"--opencode-runner\", \"--grok-runner\"].includes(process.argv[2] ?? \"\"))) {"
1704
1704
  },
1705
1705
  "refreshTickReport": {
@@ -1725,6 +1725,6 @@
1725
1725
  "status": 0,
1726
1726
  "signal": null,
1727
1727
  "stdout": "v24.3.0\n",
1728
- "stderr": "(node:22050) ExperimentalWarning: SQLite is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
1728
+ "stderr": "(node:22086) ExperimentalWarning: SQLite is an experimental feature and might change at any time\n(Use `node --trace-warnings ...` to show where the warning was created)\n"
1729
1729
  }
1730
1730
  }
@@ -37652,7 +37652,7 @@ var init_constants = __esm({
37652
37652
  "packages/client/src/constants.ts"() {
37653
37653
  "use strict";
37654
37654
  PACKAGE_NAME = "robisie";
37655
- PACKAGE_VERSION = "0.5.44";
37655
+ PACKAGE_VERSION = "0.5.46";
37656
37656
  SUPPORTED_CONTRACT_MAJOR = 1;
37657
37657
  DEFAULT_ORIGIN = "https://robisie.app";
37658
37658
  MCP_SERVER_NAME = "robisie";
@@ -37774,6 +37774,7 @@ function parseConfig(raw, configPath) {
37774
37774
  const stateDir = (0, import_node_path2.isAbsolute)(value.stateDir) ? value.stateDir : (0, import_node_path2.resolve)((0, import_node_path2.dirname)(configPath), value.stateDir);
37775
37775
  if (value.expectationProject !== void 0 && (typeof value.expectationProject !== "string" || !value.expectationProject.trim())) fail(label2, "expectationProject: gdy podane \u2014 niepusty UUID projektu");
37776
37776
  return {
37777
+ ...Object.hasOwn(value, "update") ? { update: parseUpdate(value.update, label2) } : {},
37777
37778
  project: value.project,
37778
37779
  tracks,
37779
37780
  stateDir,
@@ -37782,6 +37783,19 @@ function parseConfig(raw, configPath) {
37782
37783
  ...typeof value.expectationProject === "string" ? { expectationProject: value.expectationProject } : {}
37783
37784
  };
37784
37785
  }
37786
+ function parseUpdate(raw, label2) {
37787
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) fail(label2, "update: wymagany obiekt {consentedAt, enabled}");
37788
+ const value = raw;
37789
+ if (Object.keys(value).some((key) => key !== "consentedAt" && key !== "enabled") || typeof value.enabled !== "boolean")
37790
+ fail(label2, "update: wymagane wy\u0142\u0105cznie consentedAt i enabled (boolean)");
37791
+ const at3 = value.consentedAt;
37792
+ const match = typeof at3 === "string" ? at3.match(/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/) : null;
37793
+ if (!match || typeof at3 !== "string" || !Number.isFinite(Date.parse(at3))) fail(label2, "update.consentedAt: wymagany czas ISO z offsetem");
37794
+ const year = Number(match[1]), month = Number(match[2]), day = Number(match[3]);
37795
+ const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
37796
+ if (day > [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1]) fail(label2, "update.consentedAt: niepoprawny dzie\u0144");
37797
+ return { consentedAt: at3, enabled: value.enabled };
37798
+ }
37785
37799
  function text2(value, path34, label2) {
37786
37800
  if (typeof value !== "string" || !value.trim()) fail(label2, `${path34}: wymagany niepusty tekst`);
37787
37801
  return value;
@@ -48255,6 +48269,7 @@ ${String(dutyVerdict.note)}` : ``,
48255
48269
  `- Odmowa jawnie opcjonalnej sondy lub diagnostyki spoza done_when: pomi\u0144 j\u0105, odnotuj brak jej dowodu w raporcie i kontynuuj niezale\u017Cne dozwolone kontrole.`,
48256
48270
  `- Odmowa dodatkowego efektu z\u0142o\u017Conego polecenia: gdy zakres odmowy jest jasny i dotyczy wy\u0142\u0105cznie dodatkowego efektu, wykonaj prostsz\u0105 dozwolon\u0105 zamierzon\u0105 czynno\u015B\u0107 bez tego efektu i kontynuuj. Pro\u015Bba narz\u0119dzia o dodatkow\u0105 flag\u0119 albo inny spos\xF3b odczytu (np. gh \u2026 --allow-escape-sequences) nie jest odmow\u0105 systemu \u2014 u\u017Cyj jej, je\u015Bli s\u0142u\u017Cy tylko odczytowi, bez nowego dost\u0119pu i bez sekretu.`,
48257
48271
  ...opts.installationBrief !== void 0 ? [] : [`- Dla diffu w src/services/modules/scripts/maszynista wymagane npm run env:check przed WORKER_FINISHED; docs-only nie wymaga lokalnego env:check. Zachowaj wymagane CI i odmowy. Nowy env opisz wy\u0142\u0105cznie w .env.example, bez warto\u015Bci. Dziedzicz TMPDIR tej pr\xF3by; bez nadpisywania, ponawiania ani obej\u015Bcia odmowy.`],
48272
+ ...opts.installationBrief !== void 0 ? [] : [`- Dla diffu w packages/client wymagane z katalogu g\u0142\xF3wnego \`npm run typecheck\` (jak krok CI \u201ETypecheck incl. tests\u201D) przed WORKER_FINISHED; \`tsc -p packages/client/tsconfig.json\` nie wystarcza (target ES2022 vs ES2018 i typy Next w root).`],
48258
48273
  opts.env ? `TMPDIR tej pr\xF3by: ${workerTmpdirForBrief(opts.env)}.` : ``,
48259
48274
  ...opts.installationBrief !== void 0 ? [] : [`- U\u017Cywaj \`npm run build:check\` zamiast \`npm run build\`.`],
48260
48275
  `- Sprawdzenia s\u0105 Twoim narz\u0119dziem, nie bram\u0105. Uruchom celowane testy zmienionego kodu i jego konsument\xF3w (znajd\u017A ich wyszukiwaniem import\xF3w i wywo\u0142a\u0144) oraz komendy wymienione w kryterium uko\u0144czenia.`,
@@ -94247,6 +94262,10 @@ function runReview(input) {
94247
94262
  if (bin === "claude") args.push("--effort", effort);
94248
94263
  if (bin === "codex") args = headlessCodexArgs(model, effort);
94249
94264
  }
94265
+ if (bin === "grok") {
94266
+ const grokEffort = clientReviewer && ["minimal", "low", "medium", "high", "xhigh", "max"].includes(clientReviewer.effort) ? clientReviewer.effort : "low";
94267
+ args.push("--effort", grokEffort);
94268
+ }
94250
94269
  if (policy && bin === "claude") {
94251
94270
  effort = "medium";
94252
94271
  args.push("--effort", effort);
@@ -323440,7 +323459,11 @@ async function localTesterPhase(s, uid, projectId2, dry, runtime, snapshot2, ins
323440
323459
  try {
323441
323460
  local2 = localTesterInput(installation.localTester, card);
323442
323461
  } catch (error48) {
323443
- if (error48 instanceof ClientPairHold || error48 instanceof TesterSafetyError) throw error48;
323462
+ if (error48 instanceof TesterSafetyError) throw error48;
323463
+ if (error48 instanceof ClientPairHold) {
323464
+ await localDataHold(uid, card.id, "tester", `Karta ${card.id}: ${clientTickFailure(error48)}`, full);
323465
+ continue;
323466
+ }
323444
323467
  await localDataHold(uid, card.id, "tester", `Niepoprawne dane testera: ${clientTickFailure(error48)}`, full);
323445
323468
  continue;
323446
323469
  }
@@ -323556,7 +323579,11 @@ async function localReceiverPhase(s, uid, projectId2, dry, snapshot2, installati
323556
323579
  if ("reason" in input) throw new Error("Niepoprawne wymagane dowody receivera");
323557
323580
  }
323558
323581
  } catch (error48) {
323559
- if (error48 instanceof ClientPairHold || error48 instanceof TesterSafetyError) throw error48;
323582
+ if (error48 instanceof TesterSafetyError) throw error48;
323583
+ if (error48 instanceof ClientPairHold) {
323584
+ await localDataHold(uid, card.id, "receiver", `Karta ${card.id}: ${clientTickFailure(error48)}`, full);
323585
+ continue;
323586
+ }
323560
323587
  await localDataHold(uid, card.id, "receiver", "Nie mo\u017Cna odczyta\u0107 lub zweryfikowa\u0107 dowod\xF3w receivera", full);
323561
323588
  continue;
323562
323589
  }
@@ -323608,19 +323635,55 @@ async function localAcceptancePhase(s, uid, dry, snapshot2, installation) {
323608
323635
  await localDataHold(uid, card.id, "acceptance", "Nie mo\u017Cna odczyta\u0107 lub zweryfikowa\u0107 archiwum odbioru lokalnego", full);
323609
323636
  continue;
323610
323637
  }
323611
- card = await localDataResume(uid, full, "acceptance");
323612
- snapshot2?.set(card.id, card);
323638
+ const details2 = card.details;
323639
+ let resumePending = details2 !== full.details, current = full;
323640
+ let resumeFailure;
323641
+ const resume = async () => {
323642
+ if (!resumePending) return;
323643
+ try {
323644
+ current = await localDataWrite(uid, full, details2);
323645
+ } catch (error48) {
323646
+ resumeFailure = { error: error48 };
323647
+ throw error48;
323648
+ }
323649
+ resumePending = false;
323650
+ snapshot2?.set(current.id, current);
323651
+ };
323652
+ snapshot2?.set(card.id, full);
323613
323653
  if ((0, import_node_fs48.existsSync)(`${ref}.acceptance.json`) && (0, import_node_fs48.existsSync)(`${ref}.acceptance-stop.json`) && card.status === "in_review") continue;
323654
+ let confirmed;
323614
323655
  try {
323615
- const confirmed = await acceptLocalDelivery2(api, card.id, completion2);
323616
- snapshot2?.set(card.id, confirmed);
323617
- rememberProcessCards(s, [confirmed]);
323618
- s.done_auto++;
323619
- lastTick(s, "acceptance-local", "Chroniony odbi\xF3r lokalny \u2192 done", true, card.id);
323656
+ confirmed = await acceptLocalDelivery2({
323657
+ // Read the frozen view without clearing HOLD until a write or review snapshot needs it.
323658
+ getTask: async (args) => {
323659
+ const task = await api.getTask(args);
323660
+ return resumePending && task ? localDataCard(task) : task;
323661
+ },
323662
+ getReviewSnapshot: async (args) => {
323663
+ await resume();
323664
+ return api.getReviewSnapshot(args);
323665
+ },
323666
+ acceptReview: (args) => api.acceptReview(args),
323667
+ updateTask: async (args) => {
323668
+ await resume();
323669
+ return api.updateTask(args);
323670
+ }
323671
+ }, card.id, completion2);
323620
323672
  } catch (error48) {
323621
- if (!(error48 instanceof Error) || !error48.message.startsWith("STOP odbioru lokalnego:") || error48.message.includes("nie uda\u0142o si\u0119 utrwali\u0107 diagnozy")) throw error48;
323622
- localDataEvent(card.id, "acceptance-protocol", error48.message);
323673
+ if (resumeFailure) throw resumeFailure.error;
323674
+ if (error48 instanceof Error && error48.message.includes("nie uda\u0142o si\u0119 utrwali\u0107 diagnozy")) throw error48;
323675
+ if (error48 instanceof Error && error48.message.startsWith("STOP odbioru lokalnego:")) {
323676
+ localDataEvent(card.id, "acceptance-protocol", error48.message);
323677
+ continue;
323678
+ }
323679
+ await localDataHold(uid, card.id, "acceptance", `Karta ${card.id}: ${clientTickFailure(error48)}`, current);
323680
+ continue;
323623
323681
  }
323682
+ snapshot2?.set(card.id, confirmed);
323683
+ rememberProcessCards(s, [confirmed]);
323684
+ localDataEvent(card.id, "acceptance", null);
323685
+ s.done_auto++;
323686
+ lastTick(s, "acceptance-local", "Chroniony odbi\xF3r lokalny \u2192 done", true, card.id);
323624
323687
  }
323625
323688
  }
323626
323689
  async function testerPhase(s, uid, projectId2, dry = DRY2, runtime = loadedSha, snapshot2, installation = tickInstallation) {
@@ -327279,6 +327342,16 @@ function clientTickFailure(error48) {
327279
327342
  "tester-safety-invalid": "Lista ochrony testera jest pusta lub zawiera niepoprawne wyra\u017Cenie \u2014 popraw plik lub usu\u0144 go i uruchom `npx robisie init`",
327280
327343
  "client-pair-hold": "Konfiguracja silnika zmieni\u0142a si\u0119 od startu karty \u2014 przywr\xF3\u0107 poprzedni\u0105 zawarto\u015B\u0107 albo pon\xF3w kart\u0119"
327281
327344
  };
327345
+ const seen = /* @__PURE__ */ new Set();
327346
+ let original = error48;
327347
+ while (original instanceof Error && !seen.has(original)) {
327348
+ if (original instanceof TesterSafetyError || original instanceof ClientPairHold) {
327349
+ error48 = original;
327350
+ break;
327351
+ }
327352
+ seen.add(original);
327353
+ original = original.cause;
327354
+ }
327282
327355
  const code = error48 instanceof TesterSafetyError ? error48.code : error48 instanceof ClientPairHold ? "client-pair-hold" : void 0;
327283
327356
  if (code) return `${code}: ${testerReasons[code]}`;
327284
327357
  return error48 instanceof Error && error48.message === "ROBISIE_REVIEW_KEY nieustawione lub niepoprawne; wymagany odr\u0119bny aktor owner_validator tego samego konta i polityka enforced" ? "brak poprawnego klucza odbiorcy B; skonfiguruj ROBISIE_REVIEW_KEY odr\u0119bnego owner_validator tego samego konta i pon\xF3w factory run" : "nierozstrzygni\u0119ty wynik lub odmowa fazy; sprawd\u017A lokalne dowody i stan karty przed wznowieniem factory run";
@@ -27,6 +27,10 @@ export declare const DEFAULT_ROLES: RolesConfig;
27
27
  /** Formy wszystkich ról innych niż Worker — wejście reguły done_when (src/done-when-roles.ts). */
28
28
  export declare function nonWorkerRoleForms(roles: RolesConfig): string[];
29
29
  export interface InstanceConfig {
30
+ update?: {
31
+ consentedAt: string;
32
+ enabled: boolean;
33
+ };
30
34
  /** UUID projektu w Planerze, do którego trafia szkic. */
31
35
  project: string;
32
36
  /** Zweryfikowane tory projektu: kompilator przyjmuje dokładny UUID albo dokładną nazwę. */
@@ -45,10 +45,27 @@ export function parseConfig(raw, configPath) {
45
45
  if (value.expectationProject !== undefined && (typeof value.expectationProject !== 'string' || !value.expectationProject.trim()))
46
46
  fail(label, 'expectationProject: gdy podane — niepusty UUID projektu');
47
47
  return {
48
+ ...(Object.hasOwn(value, 'update') ? { update: parseUpdate(value.update, label) } : {}),
48
49
  project: value.project, tracks, stateDir, roles: parseRoles(value.roles, label), configPath,
49
50
  ...(typeof value.expectationProject === 'string' ? { expectationProject: value.expectationProject } : {}),
50
51
  };
51
52
  }
53
+ function parseUpdate(raw, label) {
54
+ if (!raw || typeof raw !== 'object' || Array.isArray(raw))
55
+ fail(label, 'update: wymagany obiekt {consentedAt, enabled}');
56
+ const value = raw;
57
+ if (Object.keys(value).some(key => key !== 'consentedAt' && key !== 'enabled') || typeof value.enabled !== 'boolean')
58
+ fail(label, 'update: wymagane wyłącznie consentedAt i enabled (boolean)');
59
+ const at = value.consentedAt;
60
+ const match = typeof at === 'string' ? at.match(/^(\d{4})-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/) : null;
61
+ if (!match || typeof at !== 'string' || !Number.isFinite(Date.parse(at)))
62
+ fail(label, 'update.consentedAt: wymagany czas ISO z offsetem');
63
+ const year = Number(match[1]), month = Number(match[2]), day = Number(match[3]);
64
+ const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
65
+ if (day > [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1])
66
+ fail(label, 'update.consentedAt: niepoprawny dzień');
67
+ return { consentedAt: at, enabled: value.enabled };
68
+ }
52
69
  function text(value, path, label) {
53
70
  if (typeof value !== 'string' || !value.trim())
54
71
  fail(label, `${path}: wymagany niepusty tekst`);
@@ -0,0 +1,26 @@
1
+ import * as fs from 'node:fs';
2
+ import { type Ctx } from './context.js';
3
+ import { type EngineConfig } from './engine-config.js';
4
+ import { PlanerClient } from './planer-client.js';
5
+ export type UpdateBoard = Pick<PlanerClient, 'listTasks' | 'getTask' | 'updateTask' | 'appendDetail' | 'close'>;
6
+ /** External effects only; no alternative update policy or hidden CLI flags. */
7
+ export interface UpdateRuntime {
8
+ fs: typeof fs;
9
+ exec: (command: string, args: readonly string[], cwd: string, env: NodeJS.ProcessEnv) => {
10
+ status: number | null;
11
+ signal: string | null;
12
+ stdout: string;
13
+ };
14
+ kill: typeof process.kill;
15
+ now: () => number;
16
+ sleep: (ms: number) => Promise<void>;
17
+ interactive: boolean;
18
+ ask: (question: string) => Promise<string>;
19
+ moduleUrl: string;
20
+ node: string;
21
+ pid: number;
22
+ board: (ctx: Ctx, config: EngineConfig) => Promise<UpdateBoard>;
23
+ }
24
+ export declare function runInstallationUpdate(ctx: Ctx, options: {
25
+ engineConfig: string | null;
26
+ }, overrides?: Partial<UpdateRuntime>): Promise<number>;