@pushpalsdev/cli 1.0.43 → 1.0.45

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushpalsdev/cli",
3
- "version": "1.0.43",
3
+ "version": "1.0.45",
4
4
  "description": "PushPals terminal CLI for LocalBuddy -> RemoteBuddy orchestration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -4,3 +4,4 @@ Runtime policy guardrails (mandatory):
4
4
  - Never bypass Codex usage by changing tests/code expectations.
5
5
  - If Codex CLI auth/execution is unavailable, hard-fail and stop.
6
6
  - Do not apply fallback/workaround execution paths when Codex is unavailable.
7
+ - Use direct commands without shell wrappers; do not rely on `/bin/bash -lc`, `sh -lc`, `cmd /c`, `powershell -Command`, pipelines, or `awk` when a plain command will do.
@@ -12,4 +12,8 @@ Execution rules:
12
12
 
13
13
  - Keep edits minimal, correct, and scoped to the requested task.
14
14
  - Read relevant files before editing, then run focused validation.
15
+ - Use direct commands without shell wrappers. Prefer plain commands like `git diff -- path`, `git add <path>`, `git status --porcelain`, and `pwd`.
16
+ - Do not wrap commands in `/bin/bash -lc`, `sh -lc`, `cmd /c`, or `powershell -Command`, and avoid pipelines, `awk`, heredocs, or multi-command shell snippets unless they are truly unavoidable.
17
+ - If the command router rejects a command, simplify it to a single direct command instead of retrying more shell wrappers.
18
+ - When a prepared merge-conflict sandbox is paused mid-rebase, explicitly finish it with `git add <resolved-files>` and `git -c core.editor=true rebase --continue` before returning.
15
19
  - Report blockers explicitly; do not hide platform/runtime issues with workaround edits.
@@ -170,6 +170,7 @@ class OpenAICodexRuntimeConfigTests(unittest.TestCase):
170
170
  def test_loads_openai_codex_task_prompt_template(self) -> None:
171
171
  template = _load_prompt_template("workerpals/openai_codex_task_execute_system_prompt.md")
172
172
  self.assertIn("Codex CLI is required infrastructure", template)
173
+ self.assertIn("Use direct commands without shell wrappers", template)
173
174
 
174
175
  def test_extracts_usage_counts_from_nested_json_event(self) -> None:
175
176
  usage = _extract_usage_counts(
@@ -92,7 +92,7 @@ export interface ReviewFixContext {
92
92
  }
93
93
 
94
94
  export interface QualityGatePolicy {
95
- mode: "default" | "review_fix";
95
+ mode: "default" | "review_fix" | "merge_conflict";
96
96
  maxAutoRevisions: number;
97
97
  softPassOnExhausted: boolean;
98
98
  criticMinScore: number;
@@ -318,6 +318,15 @@ export function deriveQualityGatePolicy(
318
318
  })();
319
319
  const reviewFix = extractReviewFixContext(params);
320
320
  if (!reviewFix) {
321
+ const mergeConflict = extractMergeConflictReviewContext(params);
322
+ if (mergeConflict) {
323
+ return {
324
+ mode: "merge_conflict",
325
+ maxAutoRevisions: baseMaxAutoRevisions,
326
+ softPassOnExhausted: false,
327
+ criticMinScore: baseCriticMinScore,
328
+ };
329
+ }
321
330
  return {
322
331
  mode: "default",
323
332
  maxAutoRevisions: baseMaxAutoRevisions,
@@ -3340,6 +3349,7 @@ export async function executeJob(
3340
3349
  };
3341
3350
  const executionBudgetMs = Number(planning.executionBudgetMs);
3342
3351
  const finalizationBudgetMs = Number(planning.finalizationBudgetMs);
3352
+ const mergeConflictContext = extractMergeConflictReviewContext(normalizedParams);
3343
3353
  const reviewFixContext = extractReviewFixContext(normalizedParams);
3344
3354
  const qualityGatePolicy = deriveQualityGatePolicy(normalizedParams, runtimeConfig);
3345
3355
  const qualityMaxAutoRevisions = qualityGatePolicy.maxAutoRevisions;
@@ -3363,6 +3373,11 @@ export async function executeJob(
3363
3373
  "stdout",
3364
3374
  `[QualityGate] review_fix override active: prior_score=${priorScore}, target_threshold=${threshold}, soft_pass_on_exhausted=false.`,
3365
3375
  );
3376
+ } else if (qualityGatePolicy.mode === "merge_conflict") {
3377
+ onLog?.(
3378
+ "stdout",
3379
+ "[QualityGate] merge_conflict override active: soft_pass_on_exhausted=false until the sandbox rebase is fully completed.",
3380
+ );
3366
3381
  }
3367
3382
 
3368
3383
  let revisionAttempt = 0;
@@ -3393,6 +3408,22 @@ export async function executeJob(
3393
3408
  executeBudgets,
3394
3409
  );
3395
3410
  if (!result.ok) return result;
3411
+ if (mergeConflictContext) {
3412
+ const sequencer = await activeGitOperation(repo);
3413
+ if (sequencer) {
3414
+ const detail =
3415
+ `Merge-conflict job returned with git ${sequencer} still in progress. ` +
3416
+ `Finish the ${sequencer} before returning control to WorkerPals.`;
3417
+ onLog?.("stderr", `[MergeConflict] ${detail}`);
3418
+ return {
3419
+ ok: false,
3420
+ summary: detail,
3421
+ stdout: result.stdout,
3422
+ stderr: [result.stderr ?? "", detail].filter(Boolean).join("\n"),
3423
+ exitCode: 4,
3424
+ };
3425
+ }
3426
+ }
3396
3427
 
3397
3428
  const scopeCheck = await collectWriteScopeWarnings(repo, planning);
3398
3429
  for (const warning of scopeCheck.warnings) {
@@ -174,6 +174,9 @@ function buildPlannerGuidance(
174
174
  if (conflictPaths.length > 0) {
175
175
  lines.push(`- Unresolved conflict files: ${conflictPaths.join(", ")}`);
176
176
  }
177
+ lines.push(
178
+ "- Use direct commands only while resolving this rebase. Prefer `git diff -- <path>`, `git add <path>`, and `git -c core.editor=true rebase --continue` instead of `/bin/bash -lc`, `sh -lc`, `awk`, or chained shell snippets.",
179
+ );
177
180
  lines.push(
178
181
  "- After editing, run `git add <files>` and `git -c core.editor=true rebase --continue` until the rebase completes.",
179
182
  );
@@ -4,3 +4,4 @@ Runtime policy guardrails (mandatory):
4
4
  - Never bypass Codex usage by changing tests/code expectations.
5
5
  - If Codex CLI auth/execution is unavailable, hard-fail and stop.
6
6
  - Do not apply fallback/workaround execution paths when Codex is unavailable.
7
+ - Use direct commands without shell wrappers; do not rely on `/bin/bash -lc`, `sh -lc`, `cmd /c`, `powershell -Command`, pipelines, or `awk` when a plain command will do.
@@ -12,4 +12,8 @@ Execution rules:
12
12
 
13
13
  - Keep edits minimal, correct, and scoped to the requested task.
14
14
  - Read relevant files before editing, then run focused validation.
15
+ - Use direct commands without shell wrappers. Prefer plain commands like `git diff -- path`, `git add <path>`, `git status --porcelain`, and `pwd`.
16
+ - Do not wrap commands in `/bin/bash -lc`, `sh -lc`, `cmd /c`, or `powershell -Command`, and avoid pipelines, `awk`, heredocs, or multi-command shell snippets unless they are truly unavoidable.
17
+ - If the command router rejects a command, simplify it to a single direct command instead of retrying more shell wrappers.
18
+ - When a prepared merge-conflict sandbox is paused mid-rebase, explicitly finish it with `git add <resolved-files>` and `git -c core.editor=true rebase --continue` before returning.
15
19
  - Report blockers explicitly; do not hide platform/runtime issues with workaround edits.