@mestreyoda/fabrica 0.2.30 → 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.
@@ -44,6 +44,8 @@ The `.worktrees/` directory sits NEXT TO the repo folder (not inside it). This k
44
44
 
45
45
  Never create or implement the project under `~/.openclaw/workspace/<slug>` unless the task message explicitly says that directory is the canonical repo path. If the repo already contains scaffolded files, do not re-initialize the project with `npm init`, `uv init`, `cargo init`, or a second skeleton generator — keep the existing stack and modify the scaffold inside the assigned worktree. Once you are in the assigned worktree, stay there for the rest of the task and do not switch back to the main checkout.
46
46
 
47
+ IMPORTANT: the shell `exec` tool is stateless and does NOT remember a previous `cd`. That means every shell command that depends on the repo location must explicitly prefix the worktree path, e.g. `cd "$WORKTREE" && <command>` or use absolute file paths. If `pwd` or tool output ever shows `~/.openclaw/workspace`, `~/`, or any directory outside the assigned worktree, stop, re-enter the worktree, and only continue with commands that include the explicit `cd "$WORKTREE" && ...` prefix.
48
+
47
49
  ### 2. Implement the changes
48
50
 
49
51
  - Read the issue description and comments thoroughly
@@ -56,6 +56,8 @@ fi
56
56
 
57
57
  **IMPORTANT:** Always verify you are on the correct branch before running tests. If you test on `main` and the feature code is not there, your results will be WRONG.
58
58
 
59
+ IMPORTANT: the shell `exec` tool is stateless and does NOT remember a previous `cd`. That means every repo-scoped command must explicitly include the worktree path, e.g. `cd "$WORKTREE" && <command>` or use absolute file paths inside the assigned worktree. If `pwd` or any command output shows `~/.openclaw/workspace`, `~/`, or any directory outside the assigned worktree, stop, re-enter the worktree, and rerun the command with an explicit `cd "$WORKTREE" && ...` prefix before trusting the result.
60
+
59
61
  ### 2. Run QA contract (MANDATORY)
60
62
 
61
63
  ```bash
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.30") {
113909
- return "0.2.30";
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 (observation.executionContractViolation) {
131919
- if (context2) {
131920
- const violationPayload = {
131921
- sessionKey: opts.sessionKey,
131922
- projectSlug: context2.projectSlug,
131923
- issueId: context2.issueId,
131924
- role,
131925
- reason: "invalid_execution_path",
131926
- violationReason: observation.executionContractViolation.reason,
131927
- evidence: observation.executionContractViolation.evidence
131928
- };
131929
- await updateIssueRuntime(opts.workspaceDir, context2.projectSlug, context2.issueId, {
131930
- inconclusiveCompletionAt: (/* @__PURE__ */ new Date()).toISOString(),
131931
- inconclusiveCompletionReason: "invalid_execution_path"
131932
- }).catch(() => {
131933
- });
131934
- await log(opts.workspaceDir, "worker_execution_contract_violation", violationPayload).catch(() => {
131935
- });
131936
- await log(opts.workspaceDir, "worker_execution_recovery_started", violationPayload).catch(() => {
131937
- });
131938
- await log(opts.workspaceDir, "worker_completion_inconclusive", {
131939
- ...violationPayload
131940
- }).catch(() => {
131941
- });
131942
- } else {
131943
- const violationPayload = {
131944
- sessionKey: opts.sessionKey,
131945
- role,
131946
- reason: "invalid_execution_path",
131947
- violationReason: observation.executionContractViolation.reason,
131948
- evidence: observation.executionContractViolation.evidence
131949
- };
131950
- await log(opts.workspaceDir, "worker_execution_contract_violation", violationPayload).catch(() => {
131951
- });
131952
- await log(opts.workspaceDir, "worker_result_skipped", {
131953
- ...violationPayload
131954
- }).catch(() => {
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.30",
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",