kodingo-cli 1.0.36 → 1.0.37
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/dist/ports/cloud-event-port.js +11 -11
- package/package.json +1 -1
|
@@ -20,24 +20,24 @@ class CloudEventPort {
|
|
|
20
20
|
}
|
|
21
21
|
async pushDecision(decision, _context) {
|
|
22
22
|
await this.persistence.initDb();
|
|
23
|
-
// Build real priorMemory from
|
|
23
|
+
// Build real priorMemory from affirmed memories in this project
|
|
24
24
|
let context = _context;
|
|
25
25
|
try {
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
.
|
|
34
|
-
.
|
|
26
|
+
const repoPath = this.repoPath;
|
|
27
|
+
const records = await this.persistence.queryMemory("", 100, this.repoPath, { includeNonCanonical: false }).catch(() => []);
|
|
28
|
+
const decisions = records
|
|
29
|
+
.filter((r) => r.externalId?.startsWith("git:") || r.id)
|
|
30
|
+
.map((r) => r.externalId ?? r.id)
|
|
31
|
+
.filter(Boolean);
|
|
32
|
+
const mostRecent = records
|
|
33
|
+
.map((r) => new Date(r.updatedAt ?? r.updated_at ?? 0))
|
|
34
|
+
.sort((a, b) => b.getTime() - a.getTime())[0];
|
|
35
35
|
context = {
|
|
36
36
|
..._context,
|
|
37
37
|
priorMemory: {
|
|
38
38
|
projectId: decision.projectId,
|
|
39
39
|
decisions,
|
|
40
|
-
updatedAt:
|
|
40
|
+
updatedAt: mostRecent ?? new Date(0),
|
|
41
41
|
},
|
|
42
42
|
};
|
|
43
43
|
}
|