agenr 0.8.14 → 0.8.15

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.8.15] - 2026-02-23
4
+
5
+ ### Fixed
6
+ - fix(consolidate): switch GROUP_CONCAT separator from comma to pipe in buildClusters to prevent silent tag corruption when tag values contain commas (issue #155)
7
+ - fix(consolidate): Tier 1 near-exact duplicate merge now preserves the highest importance across merged entries by raising the keeper's `importance` floor to the group max (issue #156)
8
+ - fix(consolidate): Tier 1 near-exact duplicate merge now preserves oldest provenance by inheriting the oldest `created_at` across the merge group into the keeper (issue #156)
9
+ - test(consolidate): new cluster.test.ts with pipe-separator roundtrip and comma-in-tag regression coverage (issue #155)
10
+ - test(consolidate): added merge coverage for tag union transfer, keeper importance floor, and keeper `created_at` inheritance in rules consolidation tests (issue #156)
11
+
3
12
  ## [0.8.13] - 2026-02-23
4
13
 
5
14
  ### Fixed
package/dist/cli-main.js CHANGED
@@ -6540,7 +6540,7 @@ async function mergeNearExactDuplicates(db, options) {
6540
6540
  args.push(...projectSql.args);
6541
6541
  const result = await db.execute({
6542
6542
  sql: `
6543
- SELECT id, type, subject, content, project, embedding, confirmations, recall_count, created_at
6543
+ SELECT id, type, subject, content, project, importance, embedding, confirmations, recall_count, created_at
6544
6544
  FROM entries
6545
6545
  WHERE superseded_by IS NULL
6546
6546
  AND retired = 0
@@ -6556,6 +6556,7 @@ async function mergeNearExactDuplicates(db, options) {
6556
6556
  subject: toStringValue2(row.subject),
6557
6557
  content: toStringValue2(row.content),
6558
6558
  project: toProjectValue(row.project),
6559
+ importance: Number.isFinite(toNumber3(row.importance)) ? toNumber3(row.importance) : 5,
6559
6560
  embedding: mapBufferToVector3(row.embedding),
6560
6561
  confirmations: Number.isFinite(toNumber3(row.confirmations)) ? toNumber3(row.confirmations) : 0,
6561
6562
  recallCount: Number.isFinite(toNumber3(row.recall_count)) ? toNumber3(row.recall_count) : 0,
@@ -6628,6 +6629,12 @@ async function mergeNearExactDuplicates(db, options) {
6628
6629
  continue;
6629
6630
  }
6630
6631
  const totalConfirmations = sorted.reduce((sum, entry) => sum + entry.confirmations, 0);
6632
+ const maxImportance = sorted.reduce((max, entry) => Math.max(max, entry.importance ?? 5), 0);
6633
+ const oldestCreatedAt = sorted.reduce((oldest, entry) => {
6634
+ const t = Date.parse(entry.createdAt);
6635
+ const o = Date.parse(oldest);
6636
+ return Number.isFinite(t) && t < (Number.isFinite(o) ? o : Infinity) ? entry.createdAt : oldest;
6637
+ }, keeper.createdAt);
6631
6638
  for (const source of sources) {
6632
6639
  await db.execute({
6633
6640
  sql: `
@@ -6662,10 +6669,12 @@ async function mergeNearExactDuplicates(db, options) {
6662
6669
  UPDATE entries
6663
6670
  SET merged_from = ?,
6664
6671
  consolidated_at = datetime('now'),
6665
- confirmations = ?
6672
+ confirmations = ?,
6673
+ importance = CASE WHEN importance < ? THEN ? ELSE importance END,
6674
+ created_at = CASE WHEN created_at > ? THEN ? ELSE created_at END
6666
6675
  WHERE id = ?
6667
6676
  `,
6668
- args: [sources.length, totalConfirmations, keeper.id]
6677
+ args: [sources.length, totalConfirmations, maxImportance, maxImportance, oldestCreatedAt, oldestCreatedAt, keeper.id]
6669
6678
  });
6670
6679
  }
6671
6680
  return mergedCount;
@@ -6882,7 +6891,7 @@ function mapActiveEmbeddedEntry(row) {
6882
6891
  const projectRaw = toStringValue3(row.project);
6883
6892
  const project = projectRaw.trim().length > 0 ? projectRaw.trim().toLowerCase() : null;
6884
6893
  const tagsRaw = toStringValue3(row.tags_csv);
6885
- const tags = tagsRaw.length > 0 ? tagsRaw.split(",").map((tag) => tag.trim()).filter(Boolean) : [];
6894
+ const tags = tagsRaw.length > 0 ? tagsRaw.split("|").map((tag) => tag.trim()).filter(Boolean) : [];
6886
6895
  return {
6887
6896
  id,
6888
6897
  type: toStringValue3(row.type),
@@ -6943,7 +6952,7 @@ async function buildClusters(db, options = {}) {
6943
6952
  e.merged_from,
6944
6953
  e.consolidated_at,
6945
6954
  (
6946
- SELECT GROUP_CONCAT(t.tag, ',')
6955
+ SELECT GROUP_CONCAT(t.tag, '|')
6947
6956
  FROM tags t
6948
6957
  WHERE t.entry_id = e.id
6949
6958
  ) AS tags_csv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenr",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "openclaw": {
5
5
  "extensions": [
6
6
  "dist/openclaw-plugin/index.js"