@mestreyoda/fabrica 0.2.31 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +64 -43
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113905,8 +113905,8 @@ import fsSync from "node:fs";
|
|
|
113905
113905
|
import path5 from "node:path";
|
|
113906
113906
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
113907
113907
|
function getCurrentVersion() {
|
|
113908
|
-
if ("0.2.
|
|
113909
|
-
return "0.2.
|
|
113908
|
+
if ("0.2.33") {
|
|
113909
|
+
return "0.2.33";
|
|
113910
113910
|
}
|
|
113911
113911
|
try {
|
|
113912
113912
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -131466,6 +131466,13 @@ function detectExecutionContractViolation(messages) {
|
|
|
131466
131466
|
evidence: nestedCommand
|
|
131467
131467
|
};
|
|
131468
131468
|
}
|
|
131469
|
+
const worktreeDrift = evidenceEntries.map((entry) => matchWorktreeDriftEvidence(entry.text)).find((match) => Boolean(match));
|
|
131470
|
+
if (worktreeDrift) {
|
|
131471
|
+
return {
|
|
131472
|
+
reason: "worktree_drift",
|
|
131473
|
+
evidence: worktreeDrift
|
|
131474
|
+
};
|
|
131475
|
+
}
|
|
131469
131476
|
for (const entry of assistantEntries) {
|
|
131470
131477
|
const metaSkillUsage = matchStrongMetaSkillUsage(entry.text);
|
|
131471
131478
|
if (metaSkillUsage) {
|
|
@@ -131491,6 +131498,19 @@ function detectExecutionContractViolation(messages) {
|
|
|
131491
131498
|
}
|
|
131492
131499
|
return null;
|
|
131493
131500
|
}
|
|
131501
|
+
function matchWorktreeDriftEvidence(text) {
|
|
131502
|
+
if (!text) return null;
|
|
131503
|
+
const patterns = [
|
|
131504
|
+
/ENOENT: .*\/home\/ubuntu\/\.openclaw\/workspace(?:\/[^\s'"`]+)?/,
|
|
131505
|
+
/^\/home\/ubuntu\/\.openclaw\/workspace$/m,
|
|
131506
|
+
/\/home\/ubuntu\/\.openclaw\/workspace(?:\/[^\s'"`]+)?/
|
|
131507
|
+
];
|
|
131508
|
+
for (const pattern of patterns) {
|
|
131509
|
+
const match = text.match(pattern);
|
|
131510
|
+
if (match?.[0]) return match[0];
|
|
131511
|
+
}
|
|
131512
|
+
return null;
|
|
131513
|
+
}
|
|
131494
131514
|
function collectWorkerTranscriptEvidence(messages) {
|
|
131495
131515
|
const evidence = [];
|
|
131496
131516
|
for (const message of messages) {
|
|
@@ -131914,48 +131934,49 @@ async function handleWorkerAgentEnd(opts) {
|
|
|
131914
131934
|
}).catch(() => {
|
|
131915
131935
|
});
|
|
131916
131936
|
}
|
|
131917
|
-
if (!observation.result) {
|
|
131918
|
-
if (
|
|
131919
|
-
|
|
131920
|
-
|
|
131921
|
-
|
|
131922
|
-
|
|
131923
|
-
|
|
131924
|
-
|
|
131925
|
-
|
|
131926
|
-
|
|
131927
|
-
|
|
131928
|
-
|
|
131929
|
-
|
|
131930
|
-
|
|
131931
|
-
|
|
131932
|
-
|
|
131933
|
-
|
|
131934
|
-
|
|
131935
|
-
|
|
131936
|
-
|
|
131937
|
-
|
|
131938
|
-
|
|
131939
|
-
|
|
131940
|
-
|
|
131941
|
-
|
|
131942
|
-
|
|
131943
|
-
|
|
131944
|
-
|
|
131945
|
-
|
|
131946
|
-
|
|
131947
|
-
|
|
131948
|
-
|
|
131949
|
-
|
|
131950
|
-
|
|
131951
|
-
|
|
131952
|
-
|
|
131953
|
-
|
|
131954
|
-
|
|
131955
|
-
|
|
131956
|
-
}
|
|
131957
|
-
return { applied: false, reason: "invalid_execution_path" };
|
|
131937
|
+
if (observation.executionContractViolation && (!observation.result || observation.executionContractViolation.reason === "worktree_drift")) {
|
|
131938
|
+
if (context2) {
|
|
131939
|
+
const violationPayload = {
|
|
131940
|
+
sessionKey: opts.sessionKey,
|
|
131941
|
+
projectSlug: context2.projectSlug,
|
|
131942
|
+
issueId: context2.issueId,
|
|
131943
|
+
role,
|
|
131944
|
+
reason: "invalid_execution_path",
|
|
131945
|
+
violationReason: observation.executionContractViolation.reason,
|
|
131946
|
+
evidence: observation.executionContractViolation.evidence
|
|
131947
|
+
};
|
|
131948
|
+
await updateIssueRuntime(opts.workspaceDir, context2.projectSlug, context2.issueId, {
|
|
131949
|
+
inconclusiveCompletionAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
131950
|
+
inconclusiveCompletionReason: "invalid_execution_path"
|
|
131951
|
+
}).catch(() => {
|
|
131952
|
+
});
|
|
131953
|
+
await log(opts.workspaceDir, "worker_execution_contract_violation", violationPayload).catch(() => {
|
|
131954
|
+
});
|
|
131955
|
+
await log(opts.workspaceDir, "worker_execution_recovery_started", violationPayload).catch(() => {
|
|
131956
|
+
});
|
|
131957
|
+
await log(opts.workspaceDir, "worker_completion_inconclusive", {
|
|
131958
|
+
...violationPayload,
|
|
131959
|
+
hadResultLine: Boolean(observation.result)
|
|
131960
|
+
}).catch(() => {
|
|
131961
|
+
});
|
|
131962
|
+
} else {
|
|
131963
|
+
const violationPayload = {
|
|
131964
|
+
sessionKey: opts.sessionKey,
|
|
131965
|
+
role,
|
|
131966
|
+
reason: "invalid_execution_path",
|
|
131967
|
+
violationReason: observation.executionContractViolation.reason,
|
|
131968
|
+
evidence: observation.executionContractViolation.evidence
|
|
131969
|
+
};
|
|
131970
|
+
await log(opts.workspaceDir, "worker_execution_contract_violation", violationPayload).catch(() => {
|
|
131971
|
+
});
|
|
131972
|
+
await log(opts.workspaceDir, "worker_result_skipped", {
|
|
131973
|
+
...violationPayload
|
|
131974
|
+
}).catch(() => {
|
|
131975
|
+
});
|
|
131958
131976
|
}
|
|
131977
|
+
return { applied: false, reason: "invalid_execution_path" };
|
|
131978
|
+
}
|
|
131979
|
+
if (!observation.result) {
|
|
131959
131980
|
if (context2 && observation.activityObserved) {
|
|
131960
131981
|
await updateIssueRuntime(opts.workspaceDir, context2.projectSlug, context2.issueId, {
|
|
131961
131982
|
inconclusiveCompletionAt: (/* @__PURE__ */ new Date()).toISOString(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mestreyoda/fabrica",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"description": "Autonomous software engineering pipeline for OpenClaw. Turns ideas into deployed code via intake, dispatch, review, test, and merge.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|