robisie 0.5.38 → 0.5.39

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,13 @@
1
1
  # Historia zmian klienta / Client changelog
2
2
 
3
+ ## [0.5.39](https://github.com/chuppa12/robisie-app/compare/client-v0.5.38...client-v0.5.39) (2026-11-15)
4
+
5
+
6
+ ### Factory Cards
7
+
8
+ * praca workera task-mwhl3hrm-uhenco (auto-commit) ([549c54f](https://github.com/chuppa12/robisie-app/commit/549c54f5e0d5273c6af3c5effab3a8686ea79a41))
9
+ * praca workera task-mwhongzp-22e1yi (auto-commit) ([978d630](https://github.com/chuppa12/robisie-app/commit/978d63080167c60871f9e1cab0b5ec9f49b0fdb4))
10
+
3
11
  ## [0.5.38](https://github.com/chuppa12/robisie-app/compare/client-v0.5.37...client-v0.5.38) (2026-11-15)
4
12
 
5
13
 
@@ -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.38";
3
+ export declare const PACKAGE_VERSION = "0.5.39";
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.38"; // x-release-please-version
3
+ export const PACKAGE_VERSION = "0.5.39"; // 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":"80ccd037630760e8e83f387e5af1a2062b3cd17e","dirty":false}
1
+ {"schema":1,"sha":"af76523a5aeb00a541ecf761601e7ee9edfc8d8a","dirty":false}
@@ -1680,14 +1680,14 @@
1680
1680
  "staticOperations": {
1681
1681
  "beforePreflight": {
1682
1682
  "module": "maszynista/tick.ts",
1683
- "startLine": 9875,
1684
- "endLine": 9988,
1683
+ "startLine": 9887,
1684
+ "endLine": 10000,
1685
1685
  "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();"
1686
1686
  },
1687
1687
  "finalization": {
1688
1688
  "module": "maszynista/tick.ts",
1689
- "startLine": 10279,
1690
- "endLine": 10331,
1689
+ "startLine": 10291,
1690
+ "endLine": 10343,
1691
1691
  "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] ?? \"\"))) {"
1692
1692
  },
1693
1693
  "refreshTickReport": {
@@ -1713,6 +1713,6 @@
1713
1713
  "status": 0,
1714
1714
  "signal": null,
1715
1715
  "stdout": "v24.3.0\n",
1716
- "stderr": "(node:20045) 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"
1716
+ "stderr": "(node:20551) 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"
1717
1717
  }
1718
1718
  }
@@ -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.38";
37655
+ PACKAGE_VERSION = "0.5.39";
37656
37656
  SUPPORTED_CONTRACT_MAJOR = 1;
37657
37657
  DEFAULT_ORIGIN = "https://robisie.app";
37658
37658
  MCP_SERVER_NAME = "robisie";
@@ -321132,10 +321132,12 @@ function reviewFreshness(details2) {
321132
321132
  rulings
321133
321133
  });
321134
321134
  }
321135
- function reviewResultDiagnostic(s, cardId, phase, reason) {
321135
+ function reviewResultDiagnostic(s, cardId, phase, reason, historical = false) {
321136
321136
  if (engineClient()) {
321137
- s.blocked++;
321138
- if (reason !== "Brak kontekstu localDelivery klienta; pomijam dostaw\u0119" && !(phase === "local-delivery-hold" && /^(?:Error: )?(?:not-fast-forward|target-moved|target-checked-out|target-is-symbolic-ref|error): /.test(reason))) reason = clientTickFailure();
321137
+ if (!historical) {
321138
+ s.blocked++;
321139
+ if (reason !== "Brak kontekstu localDelivery klienta; pomijam dostaw\u0119" && !(phase === "local-delivery-hold" && /^(?:Error: )?(?:not-fast-forward|target-moved|target-checked-out|target-is-symbolic-ref|error): /.test(reason))) reason = clientTickFailure();
321140
+ }
321139
321141
  }
321140
321142
  try {
321141
321143
  log2(`${phase} cardId=${cardId} ${reason}`);
@@ -321724,7 +321726,10 @@ async function reviewActive(s, uid, card, a, landing, installation = tickInstall
321724
321726
  })) && (claim.sha !== head || !(0, import_node_util14.isDeepStrictEqual)(snapshot2, currentFreshness))) {
321725
321727
  staleClaim = true;
321726
321728
  staleClaims.push({ claim, file: file4 });
321727
- reviewResultDiagnostic(s, card.id, "stale-review-result", `key=${String(claim.key)}: snapshot or HEAD changed; retained as history`);
321729
+ const worker = asRecord3(snapshot2.worker), current = asRecord3(currentFreshness.worker);
321730
+ const fields = ["jobId", "attempts", "worktree", "branch"];
321731
+ const historical = [worker, current].every((owner) => fields.every((field) => field === "attempts" ? Number.isSafeInteger(owner[field]) && Number(owner[field]) > 0 : typeof owner[field] === "string" && owner[field].trim().length > 0)) && fields.every((field) => current[field] === a[field]) && fields.some((field) => worker[field] !== a[field]) && worker.worktree === claim.worktree && /^[a-f0-9]{40}$/.test(String(claim.sha)) && Number.isSafeInteger(claim.round) && Number(claim.round) >= 0 && typeof claim.key === "string" && claim.key.startsWith(`${card.id}:${claim.sha}:${claim.round}`) && import_node_path52.default.basename(file4) === `${(0, import_node_crypto32.createHash)("sha256").update(claim.key).digest("hex")}.json`;
321732
+ reviewResultDiagnostic(s, card.id, "stale-review-result", `key=${String(claim.key)}: snapshot or HEAD changed; retained as history`, historical);
321728
321733
  return false;
321729
321734
  }
321730
321735
  return true;
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.38 \u2014 plik zarz\u0105dzany przez `npx robisie`; `npx robisie uninstall` go usunie -->";
20
+ export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.39 \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.38) <!-- x-release-please-version -->
1
+ # robisie — from account to accepted card (package 0.5.39) <!-- x-release-please-version -->
2
2
 
3
3
  In the project directory with its engine configuration, run `npx robisie init`, then `npx robisie doctor`: init prepares the project goal and tester protection list, and doctor checks both inputs.
4
4
 
package/docs/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # robisie — od konta do odebranej karty (paczka 0.5.38) <!-- x-release-please-version -->
1
+ # robisie — od konta do odebranej karty (paczka 0.5.39) <!-- x-release-please-version -->
2
2
 
3
3
  W katalogu projektu z konfiguracją silnika uruchom `npx robisie init`, potem `npx robisie doctor`: init przygotuje cel projektu i listę ochrony testera, a doctor sprawdzi oba wejścia.
4
4
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "robisie",
3
- "version": "0.5.38",
3
+ "version": "0.5.39",
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",
@@ -64,6 +64,18 @@ async function readCompleteCard(cardRef) {
64
64
 
65
65
  Use the complete second result as the card. The index response is never evidence of complete details. Both indexes must be arrays of strings: [] to [] passes the key check; a missing or null second index fails it. If keys are unreadable or change, report the read failure through the existing failure path; do not continue with partial content.
66
66
 
67
+ ## Facts before diagnosis and questions (P2)
68
+
69
+ Before delegating investigation, seeking diagnostic help, or asking about a fact, first measure at the source: `get_board`, the relevant complete two-call `get_task` read above, and available evidence. Reuse already required reads; spend at most five minutes and stop earlier once the fact is resolved. Use no clock or schedule; never wait for the limit. If the source answers the question, do not ask it. If unresolved, name the exact remaining fact and request help only for that gap. Keep questions about intent, scope, and taste; never guess the operator's answer.
70
+
71
+ Perform preparatory measurement before entering a strict sequence; inside it, reuse only its required reads, with no new calls, reordering, or repetition. For an unreadable or changed key index, follow Complete card reads and its existing read-failure path, never partial content. Measuring state and evidence availability is not judging result quality: never replace or skip required independent review, and add no five-minute wait to that review.
72
+
73
+ ## Learn from repeated evidence (P1)
74
+
75
+ When evidence establishes a second occurrence of the same problem or lesson, compare both occurrences and propose one concrete change to instructions or procedure to the operator. Another note, a blind retry, or a repeated request alone do not resolve the recurrence. Describe the proposal's effect and way of working without tool, stage, or role names. This is a proposal, with no authority to change your role or scope yourself or bypass a refusal.
76
+
77
+ With missing, null, empty, or unreadable evidence, never invent a recurrence or cause: perform the allowed bounded measurement under P2, then name the specific missing evidence. Use readable historical evidence on the same terms as current evidence. Add no schema, counter, data repair, or global HOLD. Preserve all blocked-card mutation limits and the sole local receiver return exception below.
78
+
67
79
  ## Discover the operator's intent
68
80
 
69
81
  Ask at most four focused questions, one question at a time. Skip any answer the operator has already supplied:
@@ -183,7 +195,7 @@ After one card advances, read the board again and intentionally release the next
183
195
  ## Fail closed
184
196
 
185
197
  - If a board read or write fails, stop that transition, re-read when possible, and tell the operator which outcome did not happen.
186
- - Leave the card in `ready` when the launcher fails, say that work did not start, and offer a safe retry of the same idempotent command.
198
+ - Leave the card in `ready` when the launcher fails, say that work did not start, and offer a safe retry of the same idempotent command only after its named cause has been resolved, never blindly; apply P2 before diagnosis and P1 to documented recurrence.
187
199
  - Leave the card in `in_review` when the runtime-specific independent reviewer is unavailable, its direct receipt is missing or malformed, or mechanical verification fails.
188
200
  - If a tool response is ambiguous, verify with `get_task`; absence of evidence is not success.
189
201
  - Never ask the operator to paste a credential into chat or a card. Ask them to restore secure environment configuration outside the conversation.
@@ -196,6 +208,8 @@ After a restart, interruption, or shortened context, repeat authenticated `list_
196
208
 
197
209
  Rebuild the operator update from the live statuses, card details, recorded evidence, and unresolved decisions. Do not trust a conversation summary as the source of state, do not repeat completed discovery questions, and do not launch or advance anything until the board confirms where the work stands.
198
210
 
211
+ Apply P1 and P2 to recovered evidence too: a second documented occurrence requires one proposal; measure unresolved facts before diagnostic help or questions using the same bounded reads and limits.
212
+
199
213
  ## Mandatory visible-message self-check
200
214
 
201
215
  Immediately before emitting text during a dispatch, apply this final protocol: