kantban-cli 0.1.12 → 0.1.14

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.
@@ -2,7 +2,7 @@ import {
2
2
  RalphLoop,
3
3
  cleanupMcpConfig,
4
4
  generateMcpConfig
5
- } from "./chunk-MTPUHYZV.js";
5
+ } from "./chunk-KGS3M2MY.js";
6
6
 
7
7
  // src/commands/cron.ts
8
8
  import { execFile } from "child_process";
@@ -109,4 +109,4 @@ async function runCron(client, args) {
109
109
  export {
110
110
  runCron
111
111
  };
112
- //# sourceMappingURL=cron-QKX2LAAY.js.map
112
+ //# sourceMappingURL=cron-AZPDPON3.js.map
package/dist/index.js CHANGED
@@ -163,16 +163,16 @@ async function main() {
163
163
  }
164
164
  case "pipeline": {
165
165
  if (args[0] === "stop") {
166
- const { stopPipeline } = await import("./pipeline-SFXKDLMA.js");
166
+ const { stopPipeline } = await import("./pipeline-7OFX75AU.js");
167
167
  await stopPipeline(args.slice(1));
168
168
  } else {
169
- const { runPipeline } = await import("./pipeline-SFXKDLMA.js");
169
+ const { runPipeline } = await import("./pipeline-7OFX75AU.js");
170
170
  await runPipeline(client, args);
171
171
  }
172
172
  break;
173
173
  }
174
174
  case "cron": {
175
- const { runCron } = await import("./cron-QKX2LAAY.js");
175
+ const { runCron } = await import("./cron-AZPDPON3.js");
176
176
  await runCron(client, args);
177
177
  break;
178
178
  }
@@ -13,7 +13,7 @@ import {
13
13
  parseStuckDetectionResponse,
14
14
  parseTimeout,
15
15
  resolveGatesForColumn
16
- } from "./chunk-MTPUHYZV.js";
16
+ } from "./chunk-KGS3M2MY.js";
17
17
 
18
18
  // src/commands/pipeline.ts
19
19
  import { spawn as spawn2, execSync } from "child_process";
@@ -756,13 +756,12 @@ var PipelineOrchestrator = class {
756
756
  for (const r of result.results) {
757
757
  if (!r.passed && !r.error) {
758
758
  const constraint = constraintMap.get(r.constraint_id);
759
- if (constraint?.notify && this.deps.createColumnSignal) {
760
- void this.deps.createColumnSignal(
761
- columnId,
762
- `Firing constraint "${r.name}" blocked column: resolved=${String(r.resolved_value)} ${r.threshold.operator} ${String(r.threshold.value)}`
763
- ).catch((err) => {
759
+ if (constraint?.notify && this.deps.upsertColumnSignal) {
760
+ const prefix = `Firing constraint "${r.name}" blocked`;
761
+ const body = `${prefix} column: resolved=${String(r.resolved_value)} ${r.threshold.operator} ${String(r.threshold.value)}`;
762
+ void this.deps.upsertColumnSignal(columnId, prefix, body).catch((err) => {
764
763
  const msg = err instanceof Error ? err.message : String(err);
765
- console.error(` [warn] Failed to create constraint signal: ${msg}`);
764
+ console.error(` [warn] Failed to upsert constraint signal: ${msg}`);
766
765
  });
767
766
  }
768
767
  }
@@ -2014,14 +2013,21 @@ var RunMemory = class {
2014
2013
  this._documentId = await this.deps.createDocument(content, title);
2015
2014
  }
2016
2015
  /**
2017
- * Get current document content. Returns '' if not initialized or on error.
2016
+ * Get current document content, truncated to last 500 lines.
2017
+ * Returns '' if not initialized or on error.
2018
2018
  */
2019
2019
  async getContent() {
2020
2020
  if (this._documentId === null) {
2021
2021
  return "";
2022
2022
  }
2023
2023
  try {
2024
- return await this.deps.getDocument(this._documentId);
2024
+ const content = await this.deps.getDocument(this._documentId);
2025
+ const lines = content.split("\n");
2026
+ if (lines.length > DEFAULT_COMPACTION_THRESHOLD) {
2027
+ const truncated = lines.slice(-DEFAULT_COMPACTION_THRESHOLD);
2028
+ return "[Run memory truncated \u2014 compaction needed]\n" + truncated.join("\n");
2029
+ }
2030
+ return content;
2025
2031
  } catch (err) {
2026
2032
  console.warn(`[run-memory] getContent failed: ${err instanceof Error ? err.message : String(err)}`);
2027
2033
  return "";
@@ -2029,12 +2035,18 @@ var RunMemory = class {
2029
2035
  }
2030
2036
  /**
2031
2037
  * Check if document exceeds line threshold (default 500).
2038
+ * Reads the raw document directly — getContent() truncates, so checking
2039
+ * truncated output would cap the visible line count and miss the real size.
2032
2040
  */
2033
2041
  async needsCompaction(threshold = DEFAULT_COMPACTION_THRESHOLD) {
2034
- const content = await this.getContent();
2035
- if (!content) return false;
2036
- const lineCount = content.split("\n").length;
2037
- return lineCount > threshold;
2042
+ if (this._documentId === null) return false;
2043
+ try {
2044
+ const content = await this.deps.getDocument(this._documentId);
2045
+ if (!content) return false;
2046
+ return content.split("\n").length > threshold;
2047
+ } catch {
2048
+ return false;
2049
+ }
2038
2050
  }
2039
2051
  /**
2040
2052
  * Append content under a specific section heading.
@@ -2731,6 +2743,12 @@ function computeDelta(previous, currentResults) {
2731
2743
  const currPassing = currentResults.filter((r) => r.passed).length;
2732
2744
  if (currPassing > prevPassing) return "improved";
2733
2745
  if (currPassing < prevPassing) return "regressed";
2746
+ const prevFailing = previous.results.filter((r) => !r.passed);
2747
+ const currFailing = currentResults.filter((r) => !r.passed);
2748
+ for (const curr of currFailing) {
2749
+ const prev = prevFailing.find((r) => r.name === curr.name);
2750
+ if (prev && prev.output !== curr.output) return "improved";
2751
+ }
2734
2752
  return "same";
2735
2753
  }
2736
2754
  var GateSnapshotStore = class {
@@ -2895,7 +2913,7 @@ var PipelineCostTracker = class {
2895
2913
  cc.tokens_out += inv.tokensOut;
2896
2914
  if (inv.type === "light") cc.light_calls++;
2897
2915
  if (inv.type === "heavy") cc.heavy_calls++;
2898
- if (inv.type === "advisor" || inv.type === "stuck_detection") cc.advisor_calls++;
2916
+ if (inv.type === "advisor" || inv.type === "stuck_detection" || inv.type === "replanner") cc.advisor_calls++;
2899
2917
  this.columnCosts.set(inv.columnId, cc);
2900
2918
  const mc = this.modelCosts.get(inv.model) ?? { tokens_in: 0, tokens_out: 0, calls: 0 };
2901
2919
  mc.tokens_in += inv.tokensIn;
@@ -3624,6 +3642,12 @@ async function runPipeline(client, args) {
3624
3642
  scopeId: columnId,
3625
3643
  content: body
3626
3644
  }),
3645
+ upsertColumnSignal: (columnId, contentPrefix, body) => client.put(`/projects/${projectId}/signals/upsert`, {
3646
+ scopeType: "column",
3647
+ scopeId: columnId,
3648
+ contentPrefix,
3649
+ content: body
3650
+ }),
3627
3651
  claimTicket: (ticketId) => client.claimTicket(projectId, ticketId),
3628
3652
  fetchBlockedTickets: (ticketId) => client.get(
3629
3653
  `/projects/${projectId}/tickets/${ticketId}/blocked-tickets`
@@ -3752,7 +3776,7 @@ async function runPipeline(client, args) {
3752
3776
  tools: "",
3753
3777
  includeMcpConfig: false
3754
3778
  });
3755
- costTracker?.record({ ticketId: "replanner", columnId: "pipeline", model: "haiku", tokensIn, tokensOut, type: "orchestrator" });
3779
+ costTracker?.record({ ticketId: "replanner", columnId: "pipeline", model: "haiku", tokensIn, tokensOut, type: "replanner" });
3756
3780
  if (exitCode !== 0) throw new Error(`Replanner failed`);
3757
3781
  return parseReplannerResponse(output);
3758
3782
  }
@@ -4118,4 +4142,4 @@ export {
4118
4142
  runPipeline,
4119
4143
  stopPipeline
4120
4144
  };
4121
- //# sourceMappingURL=pipeline-SFXKDLMA.js.map
4145
+ //# sourceMappingURL=pipeline-7OFX75AU.js.map