kodingo-cli 1.0.32 → 1.0.34

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.
@@ -20,6 +20,30 @@ class CloudEventPort {
20
20
  }
21
21
  async pushDecision(decision, _context) {
22
22
  await this.persistence.initDb();
23
+ // Build real priorMemory from existing records for this project
24
+ let context = _context;
25
+ try {
26
+ const existing = await this.persistence.queryMemoryBySymbol({
27
+ symbol: decision.id,
28
+ limit: 50,
29
+ includeDenied: false,
30
+ onlyCanonical: false,
31
+ });
32
+ const decisions = existing
33
+ .filter(r => r.externalId?.startsWith("git:"))
34
+ .map(r => r.externalId ?? r.id);
35
+ context = {
36
+ ..._context,
37
+ priorMemory: {
38
+ projectId: decision.projectId,
39
+ decisions,
40
+ updatedAt: existing[0]?.updatedAt ?? new Date(0),
41
+ },
42
+ };
43
+ }
44
+ catch {
45
+ context = _context;
46
+ }
23
47
  const { title, content, symbol, externalId } = await this.mapDecisionToMemory(decision);
24
48
  // Confidence accumulation: if symbol is present, look for existing record
25
49
  if (symbol) {
@@ -60,13 +84,22 @@ class CloudEventPort {
60
84
  return;
61
85
  }
62
86
  }
63
- // No existing proposed/ignored record — insert new
87
+ // No existing proposed/ignored record — validate invariants via core then insert
88
+ try {
89
+ (0, kodingo_core_1.enforceDecisionInvariants)(decision, context);
90
+ }
91
+ catch (e) {
92
+ console.warn(`[core] Decision invariant failed: ${e.message} — skipping`);
93
+ return;
94
+ }
95
+ // Apply lifecycle — produces events and new memory state
96
+ const outcome = (0, kodingo_core_1.applyDecisionLifecycle)(decision, context);
64
97
  const input = {
65
98
  type: "decision",
66
99
  content,
67
100
  repoPath: this.repoPath,
68
101
  status: "proposed",
69
- confidence: 0.3,
102
+ confidence: decision.confidence ?? 0.3,
70
103
  externalId,
71
104
  tags: ["signal:git", "kind:decision"],
72
105
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.0.32",
3
+ "version": "1.0.34",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -25,7 +25,7 @@
25
25
  "@typescript-eslint/types": "^8.61.1",
26
26
  "@typescript-eslint/typescript-estree": "^8.61.1",
27
27
  "commander": "^12.1.0",
28
- "kodingo-core": "^0.2.0",
28
+ "kodingo-core": "^0.2.1",
29
29
  "open": "^11.0.0",
30
30
  "simple-git": "^3.30.0",
31
31
  "uuid": "^10.0.0"