kantban-cli 0.1.21 → 0.1.23

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.
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runGates
3
- } from "./chunk-APZG5K2J.js";
3
+ } from "./chunk-2P25AHSD.js";
4
4
  import {
5
5
  ClaudeProvider,
6
6
  RalphLoop,
@@ -12,7 +12,7 @@ import {
12
12
  generateMcpConfig,
13
13
  parseJsonFromLlmOutput,
14
14
  parseStuckDetectionResponse
15
- } from "./chunk-KFPZHDJ2.js";
15
+ } from "./chunk-Y3D6ATF2.js";
16
16
  import {
17
17
  LoopCheckpointSchema,
18
18
  VerdictSchema,
@@ -46,22 +46,37 @@ function generateWorktreeName(ticketNumber, columnName) {
46
46
  const slug = columnName.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "");
47
47
  return `kantban-${ticketNumber}-${slug}`;
48
48
  }
49
+ function isPlausibleRemoteUrl(url) {
50
+ return url.includes("/") || url.includes("@") || url.includes("://");
51
+ }
49
52
  function ensureWorktreeRemote(worktreePath) {
50
53
  try {
51
54
  const remotes = execFileSync("git", ["-C", worktreePath, "remote"], {
52
55
  stdio: "pipe",
53
56
  encoding: "utf-8"
54
57
  }).trim();
55
- if (remotes.split("\n").includes("origin")) return;
58
+ if (remotes.split("\n").includes("origin")) {
59
+ const currentUrl = execFileSync("git", ["-C", worktreePath, "remote", "get-url", "origin"], {
60
+ stdio: "pipe",
61
+ encoding: "utf-8"
62
+ }).trim();
63
+ if (isPlausibleRemoteUrl(currentUrl)) return;
64
+ console.error(`[worktree] Invalid origin URL in ${worktreePath}: "${currentUrl}" \u2014 fixing`);
65
+ execFileSync("git", ["-C", worktreePath, "remote", "remove", "origin"], {
66
+ stdio: "pipe"
67
+ });
68
+ }
56
69
  const originUrl = execFileSync("git", ["remote", "get-url", "origin"], {
57
70
  stdio: "pipe",
58
71
  encoding: "utf-8"
59
72
  }).trim();
60
- if (originUrl) {
73
+ if (originUrl && isPlausibleRemoteUrl(originUrl)) {
61
74
  execFileSync("git", ["-C", worktreePath, "remote", "add", "origin", originUrl], {
62
75
  stdio: "pipe"
63
76
  });
64
77
  console.error(`[worktree] Added missing origin remote to ${worktreePath}: ${originUrl}`);
78
+ } else {
79
+ console.error(`[worktree] WARNING: main repo origin URL is also invalid: "${originUrl}"`);
65
80
  }
66
81
  } catch (err) {
67
82
  const msg = err instanceof Error ? err.message : String(err);
@@ -1340,6 +1355,20 @@ ${response.feedback}`)
1340
1355
  return true;
1341
1356
  }
1342
1357
  case "RELAX_WITH_DEBT": {
1358
+ const isMergeColumn = colConfig.name.toLowerCase().includes("merge");
1359
+ const isDoneColumn = colConfig.columnType === "done";
1360
+ if (isMergeColumn || isDoneColumn) {
1361
+ console.error(` [advisor] RELAX_WITH_DEBT blocked for ${colConfig.name}`);
1362
+ await this.safeAction(
1363
+ ticketId,
1364
+ "advisor:createComment",
1365
+ () => this.deps.createComment(
1366
+ ticketId,
1367
+ `ADVISOR: RELAX_WITH_DEBT blocked \u2014 cannot auto-advance from "${colConfig.name}". ${isMergeColumn ? "Merge must succeed before the ticket can proceed." : "Done-type columns cannot be relaxed past."} Manual intervention needed.`
1368
+ )
1369
+ );
1370
+ return false;
1371
+ }
1343
1372
  const waivedGates = (response.debt_items ?? []).filter((d) => d.type === "waived_gate").map((d) => d.description);
1344
1373
  if (response.debt_items && response.debt_items.length > 0 && this.deps.setFieldValue) {
1345
1374
  const items = response.debt_items.map((d) => ({ ...d, source_column: colScope?.column.name ?? "" }));
@@ -4360,4 +4389,4 @@ export {
4360
4389
  runPipeline,
4361
4390
  stopPipeline
4362
4391
  };
4363
- //# sourceMappingURL=pipeline-Q254R5HA.js.map
4392
+ //# sourceMappingURL=pipeline-AM742SOH.js.map