robisie 0.5.1 → 0.5.2
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 +13 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.js +1 -1
- package/dist/engine/build-id.json +1 -1
- package/dist/engine/bundle-report.json +7 -7
- package/dist/engine/tick.cjs +191 -56
- package/dist/roles.d.ts +1 -1
- package/docs/README.en.md +1 -1
- package/docs/README.md +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Historia zmian klienta / Client changelog
|
|
2
2
|
|
|
3
|
+
## [0.5.2](https://github.com/chuppa12/robisie-app/compare/client-v0.5.1...client-v0.5.2) (2026-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **maszynista:** izoluj błędy danych kart w lokalnej fabryce ([1db33c1](https://github.com/chuppa12/robisie-app/commit/1db33c10ad37dc0a3ea12bcaf118924af5f9a71a))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Factory Cards
|
|
12
|
+
|
|
13
|
+
* praca workera task-mwc6f088-rsu4wm (auto-commit) ([058e12e](https://github.com/chuppa12/robisie-app/commit/058e12e9a33eaf81890ee7c05fab44417e53355c))
|
|
14
|
+
* praca workera task-mwc7n2hm-oilr8f (auto-commit) ([4f2f04f](https://github.com/chuppa12/robisie-app/commit/4f2f04f6c691e143038a9248fe47ce43363a71ac))
|
|
15
|
+
|
|
3
16
|
## [0.5.1](https://github.com/chuppa12/robisie-app/compare/client-v0.5.0...client-v0.5.1) (2026-11-11)
|
|
4
17
|
|
|
5
18
|
|
package/dist/constants.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
export declare const PACKAGE_VERSION = "0.5.2";
|
|
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.
|
|
3
|
+
export const PACKAGE_VERSION = "0.5.2"; // 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":"
|
|
1
|
+
{"schema":1,"sha":"f3184643267f2e92e8006ac6224e8d237a776d19","dirty":false}
|
|
@@ -1655,20 +1655,20 @@
|
|
|
1655
1655
|
"staticOperations": {
|
|
1656
1656
|
"beforePreflight": {
|
|
1657
1657
|
"module": "maszynista/tick.ts",
|
|
1658
|
-
"startLine":
|
|
1659
|
-
"endLine":
|
|
1658
|
+
"startLine": 9310,
|
|
1659
|
+
"endLine": 9422,
|
|
1660
1660
|
"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 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();"
|
|
1661
1661
|
},
|
|
1662
1662
|
"finalization": {
|
|
1663
1663
|
"module": "maszynista/tick.ts",
|
|
1664
|
-
"startLine":
|
|
1665
|
-
"endLine":
|
|
1664
|
+
"startLine": 9711,
|
|
1665
|
+
"endLine": 9763,
|
|
1666
1666
|
"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 && process.argv[2] !== \"--opencode-runner\") {"
|
|
1667
1667
|
},
|
|
1668
1668
|
"refreshTickReport": {
|
|
1669
1669
|
"module": "maszynista/tick.ts",
|
|
1670
|
-
"startLine":
|
|
1671
|
-
"endLine":
|
|
1670
|
+
"startLine": 814,
|
|
1671
|
+
"endLine": 825,
|
|
1672
1672
|
"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 {"
|
|
1673
1673
|
},
|
|
1674
1674
|
"importTime": {
|
|
@@ -1688,6 +1688,6 @@
|
|
|
1688
1688
|
"status": 0,
|
|
1689
1689
|
"signal": null,
|
|
1690
1690
|
"stdout": "v24.3.0\n",
|
|
1691
|
-
"stderr": "(node:
|
|
1691
|
+
"stderr": "(node:15696) 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"
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
package/dist/engine/tick.cjs
CHANGED
|
@@ -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.
|
|
37631
|
+
PACKAGE_VERSION = "0.5.2";
|
|
37632
37632
|
SUPPORTED_CONTRACT_MAJOR = 1;
|
|
37633
37633
|
DEFAULT_ORIGIN = "https://robisie.app";
|
|
37634
37634
|
MCP_SERVER_NAME = "robisie";
|
|
@@ -314601,7 +314601,7 @@ __export2(tick_exports, {
|
|
|
314601
314601
|
});
|
|
314602
314602
|
module.exports = __toCommonJS(tick_exports);
|
|
314603
314603
|
async function scanTasks(uid, projectId2, opts) {
|
|
314604
|
-
const rows = await
|
|
314604
|
+
const rows = await localDataList(uid, projectId2, { ...opts, ...SCAN_OPTIONS });
|
|
314605
314605
|
return rows.filter((card) => {
|
|
314606
314606
|
if (!card.detailsReadError) return true;
|
|
314607
314607
|
log2(card.detailsReadError);
|
|
@@ -320429,6 +320429,87 @@ async function settleLocalTester(s, uid, completion2, snapshot2) {
|
|
|
320429
320429
|
lastTick(s, "tester-local", `${test.verdict}: ${test.reason}; ${test.ref}`, status2 === "in_review", card.id);
|
|
320430
320430
|
return true;
|
|
320431
320431
|
}
|
|
320432
|
+
function localDataReadError(error48, operation) {
|
|
320433
|
+
return error48 instanceof PlanerClientError && error48.code === "DETAILS_READ_ERROR" && error48.operation === operation && !error48.uncertain;
|
|
320434
|
+
}
|
|
320435
|
+
async function localDataRead(uid, id2, keys2, opts) {
|
|
320436
|
+
try {
|
|
320437
|
+
return keys2 === void 0 ? await getTask2(uid, id2) : await getTask2(uid, id2, keys2, opts);
|
|
320438
|
+
} catch (error48) {
|
|
320439
|
+
if (!localDataReadError(error48, "get_task")) throw error48;
|
|
320440
|
+
return null;
|
|
320441
|
+
}
|
|
320442
|
+
}
|
|
320443
|
+
async function localDataList(uid, projectId2, opts) {
|
|
320444
|
+
try {
|
|
320445
|
+
return await listTasks2(uid, projectId2, opts);
|
|
320446
|
+
} catch (error48) {
|
|
320447
|
+
if (!localDataReadError(error48, "list_tasks")) throw error48;
|
|
320448
|
+
}
|
|
320449
|
+
const listed = await listTasks2(uid, projectId2, { ...opts, detailsKeys: [], detailsFields: void 0, briefDigest: void 0, decisionMarkers: void 0 });
|
|
320450
|
+
const rows = [];
|
|
320451
|
+
for (const row of listed) {
|
|
320452
|
+
const card = await localDataRead(uid, row.id, opts.detailsKeys, opts);
|
|
320453
|
+
rows.push(card ? { ...row, ...card } : { ...row, detailsReadError: `Nieczytelne details karty ${row.id}` });
|
|
320454
|
+
}
|
|
320455
|
+
return rows;
|
|
320456
|
+
}
|
|
320457
|
+
function localDataCard(card) {
|
|
320458
|
+
const marker = asRecord3(card.details?.local_data_hold);
|
|
320459
|
+
if (marker.owner !== "tick-local-data-v1") return card;
|
|
320460
|
+
const details2 = { ...card.details }, previous = asRecord3(marker.previous);
|
|
320461
|
+
if (previous.exists === true) details2.local_data_hold = previous.value;
|
|
320462
|
+
else delete details2.local_data_hold;
|
|
320463
|
+
return { ...card, details: details2 };
|
|
320464
|
+
}
|
|
320465
|
+
async function localDataWrite(uid, card, details2) {
|
|
320466
|
+
if (card.status !== "in_review" && card.status !== "delivered") throw new Error("Obcy status diagnozy lokalnej karty");
|
|
320467
|
+
let failure3;
|
|
320468
|
+
try {
|
|
320469
|
+
await updateTask2(uid, card.id, { expected: { status: card.status, details: card.details }, details: details2 });
|
|
320470
|
+
} catch (error48) {
|
|
320471
|
+
failure3 = error48;
|
|
320472
|
+
}
|
|
320473
|
+
const confirmed = await getTask2(uid, card.id);
|
|
320474
|
+
if (!sameLocalTesterCard(confirmed, card, card.status, details2))
|
|
320475
|
+
throw new Error(`Nierozliczony zapis diagnozy ${card.id}; CAS/read-back: ${failure3 ? clientTickFailure(failure3) : "brak stanu docelowego"}`);
|
|
320476
|
+
return confirmed;
|
|
320477
|
+
}
|
|
320478
|
+
function localDataEvent(cardId, phase, reason) {
|
|
320479
|
+
const file3 = import_node_path52.default.join(DIR, "installation-events.jsonl");
|
|
320480
|
+
let bytes;
|
|
320481
|
+
try {
|
|
320482
|
+
bytes = (0, import_node_fs47.readFileSync)(file3, "utf8");
|
|
320483
|
+
} catch (error48) {
|
|
320484
|
+
if (error48.code !== "ENOENT") throw error48;
|
|
320485
|
+
bytes = "";
|
|
320486
|
+
}
|
|
320487
|
+
const previous = bytes.split("\n").filter(Boolean).map((line2) => asRecord3(JSON.parse(line2))).filter((event) => event.type === "local-card-data" && event.cardId === cardId && event.phase === phase).at(-1);
|
|
320488
|
+
if ((previous?.reason ?? null) === reason) return;
|
|
320489
|
+
(0, import_node_fs47.appendFileSync)(file3, JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), type: "local-card-data", cardId, phase, reason }) + "\n", { mode: 384, flush: true });
|
|
320490
|
+
if (reason) log2(`HOLD ${phase} ${cardId}: ${reason}`);
|
|
320491
|
+
}
|
|
320492
|
+
async function localDataHold(uid, cardId, phase, reason, card) {
|
|
320493
|
+
if (card && !card.detailsReadError) {
|
|
320494
|
+
const existing = asRecord3(card.details?.local_data_hold), owned2 = existing.owner === "tick-local-data-v1";
|
|
320495
|
+
const reasons = owned2 ? asRecord3(existing.reasons) : {};
|
|
320496
|
+
if (reasons[phase] !== reason) await localDataWrite(uid, card, { ...card.details, local_data_hold: {
|
|
320497
|
+
owner: "tick-local-data-v1",
|
|
320498
|
+
previous: owned2 ? existing.previous : {
|
|
320499
|
+
exists: Object.hasOwn(card.details ?? {}, "local_data_hold"),
|
|
320500
|
+
...Object.hasOwn(card.details ?? {}, "local_data_hold") ? { value: card.details?.local_data_hold } : {}
|
|
320501
|
+
},
|
|
320502
|
+
reasons: { ...reasons, [phase]: reason }
|
|
320503
|
+
} });
|
|
320504
|
+
}
|
|
320505
|
+
localDataEvent(cardId, phase, reason);
|
|
320506
|
+
}
|
|
320507
|
+
async function localDataResume(uid, card, phase) {
|
|
320508
|
+
const original = localDataCard(card);
|
|
320509
|
+
if (original !== card) card = await localDataWrite(uid, card, original.details);
|
|
320510
|
+
localDataEvent(card.id, phase, null);
|
|
320511
|
+
return card;
|
|
320512
|
+
}
|
|
320432
320513
|
async function localTesterPhase(s, uid, projectId2, dry, runtime, snapshot2, installation) {
|
|
320433
320514
|
if (dry) {
|
|
320434
320515
|
log2("Tester lokalny dry-run: bez recovery, zapisu i startu");
|
|
@@ -320451,12 +320532,17 @@ async function localTesterPhase(s, uid, projectId2, dry, runtime, snapshot2, ins
|
|
|
320451
320532
|
}
|
|
320452
320533
|
if (localTesterClaimed()) throw new Error("Osierocone dowody lokalnego testera; zachowano pliki, bez startu");
|
|
320453
320534
|
if (!installation?.localTester) throw new Error("Brak kontekstu localTester");
|
|
320454
|
-
const rows = snapshot2 ? [...snapshot2.values()] : await
|
|
320535
|
+
const rows = snapshot2 ? [...snapshot2.values()] : await localDataList(uid, projectId2, { full: true, statuses: ["in_review"], detailsKeys: LOCAL_TESTER_LIST_DETAILS_KEYS });
|
|
320455
320536
|
for (const listed of rows) {
|
|
320456
320537
|
if (listed.status !== "in_review") continue;
|
|
320457
|
-
|
|
320458
|
-
if (!card || card.
|
|
320459
|
-
|
|
320538
|
+
let card = await localDataRead(uid, listed.id);
|
|
320539
|
+
if (!card || card.detailsReadError) {
|
|
320540
|
+
await localDataHold(uid, listed.id, "tester", "Nie mo\u017Cna odczyta\u0107 pe\u0142nej karty testera");
|
|
320541
|
+
continue;
|
|
320542
|
+
}
|
|
320543
|
+
const full = card;
|
|
320544
|
+
card = localDataCard(card);
|
|
320545
|
+
if (card.status !== "in_review" || card.assignee !== ASSIGNEE) continue;
|
|
320460
320546
|
const d = card.details, worker = asRecord3(d?.maszynista), review = asRecord3(d?.review), test = asRecord3(d?.test);
|
|
320461
320547
|
if (worker.phase !== "landed" || d?.reksio_withheld === true || holdActive(d)) continue;
|
|
320462
320548
|
if (["PASS", "PASS_NEEDS_VALIDATOR", "FAIL", "PREPARATION_ERROR"].includes(String(test.verdict)) && typeof test.worker_job_id === "string" && Number.isSafeInteger(test.worker_attempt) && typeof test.review_key === "string" && typeof test.review_receipt_sha256 === "string" && test.sha === asRecord3(d?.landed).sha && test.worker_job_id === worker.jobId && test.worker_attempt === worker.attempts && test.review_key === review.jobKey && test.review_receipt_sha256 === asRecord3(review.receipt).sha256) continue;
|
|
@@ -320464,16 +320550,13 @@ async function localTesterPhase(s, uid, projectId2, dry, runtime, snapshot2, ins
|
|
|
320464
320550
|
try {
|
|
320465
320551
|
local2 = localTesterInput(installation.localTester, card);
|
|
320466
320552
|
} catch (error48) {
|
|
320467
|
-
|
|
320468
|
-
|
|
320469
|
-
|
|
320470
|
-
snapshot2?.set(confirmed.id, confirmed);
|
|
320471
|
-
rememberProcessCards(s, [confirmed]);
|
|
320472
|
-
s.blocked++;
|
|
320473
|
-
lastTick(s, "tester-local-stop", String(asRecord3(confirmed.details?.maszynista).hold_reason), false, card.id);
|
|
320474
|
-
return true;
|
|
320553
|
+
if (error48 instanceof ClientPairHold || error48 instanceof TesterSafetyError) throw error48;
|
|
320554
|
+
await localDataHold(uid, card.id, "tester", `Niepoprawne dane testera: ${clientTickFailure(error48)}`, full);
|
|
320555
|
+
continue;
|
|
320475
320556
|
}
|
|
320476
320557
|
if (!processSlot(s)) return false;
|
|
320558
|
+
card = await localDataResume(uid, full, "tester");
|
|
320559
|
+
snapshot2?.set(card.id, card);
|
|
320477
320560
|
return await startTesterJob(
|
|
320478
320561
|
DIR,
|
|
320479
320562
|
{ card, runtime, local: local2 },
|
|
@@ -320540,29 +320623,55 @@ async function localReceiverPhase(s, uid, projectId2, dry, snapshot2, installati
|
|
|
320540
320623
|
if (localReceiverClaimed()) throw new Error("Osierocone dowody receivera; zachowano pliki, bez startu");
|
|
320541
320624
|
if (localTesterClaimed()) return false;
|
|
320542
320625
|
if (!installation?.localReceiver) throw new Error("Brak kontekstu localReceiver");
|
|
320543
|
-
const rows = snapshot2 ? [...snapshot2.values()] : await
|
|
320626
|
+
const rows = snapshot2 ? [...snapshot2.values()] : await localDataList(uid, projectId2, { full: true, statuses: ["in_review"], detailsKeys: LOCAL_TESTER_LIST_DETAILS_KEYS });
|
|
320544
320627
|
for (const listed of rows) {
|
|
320545
320628
|
if (listed.status !== "in_review") continue;
|
|
320546
|
-
|
|
320547
|
-
if (!card || card.
|
|
320548
|
-
|
|
320629
|
+
let card = await localDataRead(uid, listed.id);
|
|
320630
|
+
if (!card || card.detailsReadError) {
|
|
320631
|
+
await localDataHold(uid, listed.id, "receiver", "Nie mo\u017Cna odczyta\u0107 pe\u0142nej karty receivera");
|
|
320632
|
+
continue;
|
|
320633
|
+
}
|
|
320634
|
+
const full = card;
|
|
320635
|
+
card = localDataCard(card);
|
|
320636
|
+
if (card.status !== "in_review" || card.assignee !== ASSIGNEE) continue;
|
|
320549
320637
|
const d = card.details, worker = asRecord3(d?.maszynista), test = asRecord3(d?.test), previous = asRecord3(d?.local_receiver), review = asRecord3(d?.review);
|
|
320550
320638
|
if (worker.phase !== "landed" || d?.reksio_withheld === true || holdActive(d) || !["PASS", "PASS_NEEDS_VALIDATOR"].includes(String(test.verdict))) continue;
|
|
320551
320639
|
if (typeof test.worker_job_id !== "string" || !Number.isSafeInteger(test.worker_attempt) || typeof test.review_key !== "string" || typeof test.review_receipt_sha256 !== "string" || test.sha !== asRecord3(d?.landed).sha || test.worker_job_id !== worker.jobId || test.worker_attempt !== worker.attempts || test.review_key !== review.jobKey || test.review_receipt_sha256 !== asRecord3(review.receipt).sha256) continue;
|
|
320552
|
-
|
|
320553
|
-
|
|
320554
|
-
|
|
320555
|
-
|
|
320556
|
-
|
|
320557
|
-
|
|
320558
|
-
|
|
320559
|
-
|
|
320560
|
-
|
|
320640
|
+
let settledPass = false;
|
|
320641
|
+
let unchangedWait = false;
|
|
320642
|
+
let input;
|
|
320643
|
+
try {
|
|
320644
|
+
if (previous.outcome === "PASS") {
|
|
320645
|
+
const ref = previous.ref;
|
|
320646
|
+
if (typeof ref !== "string" || import_node_path52.default.dirname(ref) !== dir || !/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}\.json$/.test(import_node_path52.default.basename(ref)))
|
|
320647
|
+
throw new Error("Obce archiwum rozliczonego receivera");
|
|
320648
|
+
const settled = JSON.parse((0, import_node_fs47.readFileSync)(ref, "utf8"));
|
|
320649
|
+
if (settled.outcome !== "PASS" || !(0, import_node_util12.isDeepStrictEqual)(settled.patch.local_receiver, previous)) throw new Error("Zmienione archiwum rozliczonego receivera");
|
|
320650
|
+
if (sameLocalTesterCard(card, settled.input.card, "in_review", { ...settled.input.card.details, ...settled.patch })) {
|
|
320651
|
+
receiver.localReceiverPatch(settled, card);
|
|
320652
|
+
settledPass = true;
|
|
320653
|
+
}
|
|
320654
|
+
}
|
|
320655
|
+
if (!settledPass) unchangedWait = receiver.localReceiverWaitUnchanged(installation.localReceiver, card);
|
|
320656
|
+
if (!settledPass && !unchangedWait) {
|
|
320657
|
+
localTesterInput(installation.localReceiver.tester, card);
|
|
320658
|
+
input = receiver.localReceiverInput(installation.localReceiver, card);
|
|
320659
|
+
if ("reason" in input) throw new Error("Niepoprawne wymagane dowody receivera");
|
|
320561
320660
|
}
|
|
320661
|
+
} catch (error48) {
|
|
320662
|
+
if (error48 instanceof ClientPairHold || error48 instanceof TesterSafetyError) throw error48;
|
|
320663
|
+
await localDataHold(uid, card.id, "receiver", "Nie mo\u017Cna odczyta\u0107 lub zweryfikowa\u0107 dowod\xF3w receivera", full);
|
|
320664
|
+
continue;
|
|
320665
|
+
}
|
|
320666
|
+
if (settledPass) continue;
|
|
320667
|
+
if (unchangedWait) {
|
|
320668
|
+
card = await localDataResume(uid, full, "receiver");
|
|
320669
|
+
snapshot2?.set(card.id, card);
|
|
320670
|
+
continue;
|
|
320562
320671
|
}
|
|
320563
|
-
if (receiver.localReceiverWaitUnchanged(installation.localReceiver, card)) continue;
|
|
320564
|
-
const input = receiver.localReceiverInput(installation.localReceiver, card);
|
|
320565
320672
|
if (!processSlot(s)) return false;
|
|
320673
|
+
card = await localDataResume(uid, full, "receiver");
|
|
320674
|
+
snapshot2?.set(card.id, card);
|
|
320566
320675
|
return await receiver.startLocalReceiverJob(dir, input);
|
|
320567
320676
|
}
|
|
320568
320677
|
return false;
|
|
@@ -320578,33 +320687,42 @@ async function localAcceptancePhase(s, uid, dry, snapshot2, installation) {
|
|
|
320578
320687
|
const { acceptLocalDelivery: acceptLocalDelivery2 } = (init_local_acceptance(), __toCommonJS(local_acceptance_exports));
|
|
320579
320688
|
for (const listed of snapshot2?.values() ?? []) {
|
|
320580
320689
|
if (!["in_review", "delivered"].includes(String(listed.status))) continue;
|
|
320581
|
-
|
|
320582
|
-
|
|
320690
|
+
if (!installation?.localAcceptance) throw new Error("Brak kontekstu localAcceptance");
|
|
320691
|
+
let card = await localDataRead(uid, listed.id);
|
|
320692
|
+
if (!card || card.detailsReadError) {
|
|
320693
|
+
await localDataHold(uid, listed.id, "acceptance", "Brak pe\u0142nej karty odbioru lokalnego");
|
|
320694
|
+
continue;
|
|
320695
|
+
}
|
|
320696
|
+
const full = card;
|
|
320697
|
+
card = localDataCard(card);
|
|
320583
320698
|
if (!["in_review", "delivered"].includes(String(card.status))) continue;
|
|
320584
320699
|
const receiver = asRecord3(card.details?.local_receiver);
|
|
320585
320700
|
if (receiver.outcome !== "PASS") continue;
|
|
320701
|
+
const api = await installation.localAcceptance();
|
|
320586
320702
|
const ref = receiver.ref;
|
|
320587
|
-
if (typeof ref !== "string" || import_node_path52.default.dirname(ref) !== dir || !/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}\.json$/.test(import_node_path52.default.basename(ref)))
|
|
320588
|
-
throw new Error("Obce archiwum odbioru lokalnego");
|
|
320589
320703
|
let completion2;
|
|
320590
320704
|
try {
|
|
320705
|
+
if (typeof ref !== "string" || import_node_path52.default.dirname(ref) !== dir || !/^[a-f0-9]{8}-(?:[a-f0-9]{4}-){3}[a-f0-9]{12}\.json$/.test(import_node_path52.default.basename(ref)))
|
|
320706
|
+
throw new Error("Obce archiwum odbioru lokalnego");
|
|
320591
320707
|
completion2 = JSON.parse((0, import_node_fs47.readFileSync)(ref, "utf8"));
|
|
320592
|
-
|
|
320593
|
-
|
|
320708
|
+
if (!completion2 || completion2.archive !== ref || completion2.input?.card?.id !== card.id || completion2.outcome !== "PASS" || !(0, import_node_util12.isDeepStrictEqual)(completion2.patch?.local_receiver, receiver))
|
|
320709
|
+
throw new Error("Niezgodne archiwum odbioru lokalnego");
|
|
320710
|
+
} catch {
|
|
320711
|
+
await localDataHold(uid, card.id, "acceptance", "Nie mo\u017Cna odczyta\u0107 lub zweryfikowa\u0107 archiwum odbioru lokalnego", full);
|
|
320712
|
+
continue;
|
|
320594
320713
|
}
|
|
320595
|
-
|
|
320714
|
+
card = await localDataResume(uid, full, "acceptance");
|
|
320715
|
+
snapshot2?.set(card.id, card);
|
|
320596
320716
|
if ((0, import_node_fs47.existsSync)(`${ref}.acceptance.json`) && (0, import_node_fs47.existsSync)(`${ref}.acceptance-stop.json`) && card.status === "in_review") continue;
|
|
320597
320717
|
try {
|
|
320598
|
-
const confirmed = await acceptLocalDelivery2(
|
|
320718
|
+
const confirmed = await acceptLocalDelivery2(api, card.id, completion2);
|
|
320599
320719
|
snapshot2?.set(card.id, confirmed);
|
|
320600
320720
|
rememberProcessCards(s, [confirmed]);
|
|
320601
320721
|
s.done_auto++;
|
|
320602
320722
|
lastTick(s, "acceptance-local", "Chroniony odbi\xF3r lokalny \u2192 done", true, card.id);
|
|
320603
320723
|
} catch (error48) {
|
|
320604
|
-
if (!(error48 instanceof Error) || !error48.message.startsWith("STOP odbioru lokalnego:")) throw error48;
|
|
320605
|
-
|
|
320606
|
-
(0, import_node_fs47.appendFileSync)(import_node_path52.default.join(DIR, "installation-events.jsonl"), JSON.stringify({ at: (/* @__PURE__ */ new Date()).toISOString(), cardId: card.id, reason }) + "\n", { mode: 384, flush: true });
|
|
320607
|
-
log2(`HOLD odbioru lokalnego ${card.id}: ${reason}`);
|
|
320724
|
+
if (!(error48 instanceof Error) || !error48.message.startsWith("STOP odbioru lokalnego:") || error48.message.includes("nie uda\u0142o si\u0119 utrwali\u0107 diagnozy")) throw error48;
|
|
320725
|
+
localDataEvent(card.id, "acceptance-protocol", error48.message);
|
|
320608
320726
|
}
|
|
320609
320727
|
}
|
|
320610
320728
|
}
|
|
@@ -323571,14 +323689,9 @@ function rememberProcessCards(s, cards) {
|
|
|
323571
323689
|
function processWip(s, cards = /* @__PURE__ */ new Map()) {
|
|
323572
323690
|
rememberProcessCards(s, cards.values());
|
|
323573
323691
|
const known = processCards.get(s);
|
|
323692
|
+
const unreadableWorkerStatuses = /* @__PURE__ */ new Set(["in_progress", "in_review"]);
|
|
323574
323693
|
const jobs2 = /* @__PURE__ */ new Set();
|
|
323575
323694
|
let unknown4 = 0;
|
|
323576
|
-
if ([...known.values()].some((card) => card.detailsReadError && card.assignee === ASSIGNEE && ["in_progress", "in_review"].includes(String(card.status)))) {
|
|
323577
|
-
for (let index2 = 0; index2 < configuredWip(process.env.MASZYNISTA_WIP); index2++) {
|
|
323578
|
-
jobs2.add(`unknown-worker-details:${index2}`);
|
|
323579
|
-
unknown4++;
|
|
323580
|
-
}
|
|
323581
|
-
}
|
|
323582
323695
|
for (const card of known.values()) if (asRecord3(card.details?.maszynista).processStart != null) {
|
|
323583
323696
|
const start = asRecord3(asRecord3(card.details?.maszynista).processStart);
|
|
323584
323697
|
const at3 = typeof start.at === "string" ? Date.parse(start.at) : NaN;
|
|
@@ -323643,14 +323756,15 @@ function processWip(s, cards = /* @__PURE__ */ new Map()) {
|
|
|
323643
323756
|
for (let index2 = 0; index2 < configuredWip(process.env.MASZYNISTA_WIP); index2++) jobs2.add(`unknown-review:${index2}`);
|
|
323644
323757
|
unknown4 += configuredWip(process.env.MASZYNISTA_WIP);
|
|
323645
323758
|
}
|
|
323646
|
-
try {
|
|
323647
|
-
if (engineClient() ? localTesterClaimed() : readTesterJob(DIR).kind === "running") jobs2.add("tester");
|
|
323648
|
-
} catch (error48) {
|
|
323649
|
-
jobs2.add("tester");
|
|
323650
|
-
unknown4++;
|
|
323651
|
-
log2(`WIP tester UNKNOWN: ${errorText5(error48)}`);
|
|
323652
|
-
}
|
|
323653
323759
|
if (engineClient()) {
|
|
323760
|
+
unreadableWorkerStatuses.delete("in_review");
|
|
323761
|
+
try {
|
|
323762
|
+
if (localTesterClaimed()) jobs2.add("tester");
|
|
323763
|
+
} catch (error48) {
|
|
323764
|
+
jobs2.add("tester");
|
|
323765
|
+
unknown4++;
|
|
323766
|
+
log2(`WIP tester UNKNOWN: ${errorText5(error48)}`);
|
|
323767
|
+
}
|
|
323654
323768
|
try {
|
|
323655
323769
|
if (localReceiverClaimed()) jobs2.add("receiver");
|
|
323656
323770
|
} catch (error48) {
|
|
@@ -323658,6 +323772,20 @@ function processWip(s, cards = /* @__PURE__ */ new Map()) {
|
|
|
323658
323772
|
unknown4++;
|
|
323659
323773
|
log2(`WIP receiver UNKNOWN: ${errorText5(error48)}`);
|
|
323660
323774
|
}
|
|
323775
|
+
} else {
|
|
323776
|
+
try {
|
|
323777
|
+
if (readTesterJob(DIR).kind === "running") jobs2.add("tester");
|
|
323778
|
+
} catch (error48) {
|
|
323779
|
+
jobs2.add("tester");
|
|
323780
|
+
unknown4++;
|
|
323781
|
+
log2(`WIP tester UNKNOWN: ${errorText5(error48)}`);
|
|
323782
|
+
}
|
|
323783
|
+
}
|
|
323784
|
+
if ([...known.values()].some((card) => card.detailsReadError && card.assignee === ASSIGNEE && ["in_progress", "in_review"].includes(String(card.status)) && (unreadableWorkerStatuses.has(String(card.status)) || s.actives.some((active) => active.taskId === card.id)))) {
|
|
323785
|
+
for (let index2 = 0; index2 < configuredWip(process.env.MASZYNISTA_WIP); index2++) {
|
|
323786
|
+
jobs2.add(`unknown-worker-details:${index2}`);
|
|
323787
|
+
unknown4++;
|
|
323788
|
+
}
|
|
323661
323789
|
}
|
|
323662
323790
|
for (const identity of uncertainStarts.get(s) ?? []) if (!jobs2.has(identity)) {
|
|
323663
323791
|
jobs2.add(identity);
|
|
@@ -324022,7 +324150,13 @@ function tryCreateTickLock(lock) {
|
|
|
324022
324150
|
}
|
|
324023
324151
|
}
|
|
324024
324152
|
async function localCardStopped(uid, id2) {
|
|
324025
|
-
|
|
324153
|
+
let card;
|
|
324154
|
+
try {
|
|
324155
|
+
card = await getTask2(uid, id2);
|
|
324156
|
+
} catch (error48) {
|
|
324157
|
+
if (!localDataReadError(error48, "get_task")) throw error48;
|
|
324158
|
+
return false;
|
|
324159
|
+
}
|
|
324026
324160
|
if (!card || card.detailsReadError) throw new Error("Nie mo\u017Cna rozstrzygn\u0105\u0107 stanu aktywnej karty");
|
|
324027
324161
|
const worker = asRecord3(card.details?.maszynista);
|
|
324028
324162
|
return card.status === "blocked" || worker.outcome === "ACTIONABLE_BLOCKER";
|
|
@@ -324242,7 +324376,7 @@ async function main2() {
|
|
|
324242
324376
|
tickPhase = "board";
|
|
324243
324377
|
const projectId2 = await resolveProject(uid);
|
|
324244
324378
|
hostBoard = { uid, projectId: projectId2 };
|
|
324245
|
-
const boardCards2 = await
|
|
324379
|
+
const boardCards2 = await localDataList(uid, projectId2, {
|
|
324246
324380
|
full: true,
|
|
324247
324381
|
statuses: ["in_progress", "in_review"],
|
|
324248
324382
|
detailsKeys: RECOVERY_DETAILS_KEYS,
|
|
@@ -324707,6 +324841,7 @@ var init_tick = __esm({
|
|
|
324707
324841
|
import_node_crypto31 = require("node:crypto");
|
|
324708
324842
|
import_node_path52 = __toESM(require("node:path"));
|
|
324709
324843
|
init_q_planner();
|
|
324844
|
+
init_planer_client();
|
|
324710
324845
|
init_engine_context();
|
|
324711
324846
|
init_local_delivery();
|
|
324712
324847
|
init_engine_consumer();
|
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.
|
|
20
|
+
export declare const MANAGED_LINE = "<!-- robisie:managed 0.5.2 \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.
|
|
1
|
+
# robisie — from account to accepted card (package 0.5.2) <!-- 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.
|
|
1
|
+
# robisie — od konta do odebranej karty (paczka 0.5.2) <!-- 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