agenr 0.9.95 → 0.9.97

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,18 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.97] - 2026-03-15
4
+
5
+ ### Fixed
6
+
7
+ - Fixed a follow-on watch/change issue discovered immediately after the 0.9.96 release and shipped the corrective patch as a fast follow-up release.
8
+
9
+ ## [0.9.96] - 2026-03-15
10
+
11
+ ### Fixed
12
+
13
+ - Fixed the bulk rebuild ingest path so Phase 3 structured fields are no longer bypassed during ingest when claims are enabled. Bulk ingest now runs structured-claim normalization and optional claim extraction before insert, keeping `subject_key`, `claim_predicate`, and `claim_role` population aligned with the normal store path.
14
+ - Fixed ingest/eval parity so bulk-mode and normal-mode claim population stay aligned, and added regression coverage proving bulk ingest can fill structured columns while still leaving `entry_supports` empty on first insert until later reinforcement/consolidation.
15
+
3
16
  ## [0.9.95] - 2026-03-15
4
17
 
5
18
  ### Added
@@ -42,7 +42,7 @@ import {
42
42
  toErrorMessage,
43
43
  updateRecallMetadata,
44
44
  walCheckpoint
45
- } from "./chunk-VW6ZN3RY.js";
45
+ } from "./chunk-QVHE2EZN.js";
46
46
  import {
47
47
  MILLISECONDS_PER_DAY,
48
48
  toNumber,
@@ -29,7 +29,7 @@ import {
29
29
  structuredClaimIdentityEquals,
30
30
  toErrorMessage,
31
31
  walCheckpoint
32
- } from "./chunk-VW6ZN3RY.js";
32
+ } from "./chunk-QVHE2EZN.js";
33
33
  import {
34
34
  MILLISECONDS_PER_DAY,
35
35
  parseDaysBetween,
@@ -19799,6 +19799,7 @@ export {
19799
19799
  acquireDbLock,
19800
19800
  releaseDbLock,
19801
19801
  warnIfLocked,
19802
+ createStoreInfrastructureAdapter,
19802
19803
  KNOWLEDGE_TYPES,
19803
19804
  IMPORTANCE_MIN,
19804
19805
  IMPORTANCE_MAX,
@@ -19810,6 +19811,7 @@ export {
19810
19811
  resolveHigherExpiry,
19811
19812
  resolveHighestExpiry,
19812
19813
  resolveSameSubject,
19814
+ prepareStructuredClaimIdentity,
19813
19815
  deleteCoRecallEdgesForEntryIds,
19814
19816
  retireEntries,
19815
19817
  stripInjectedContext,
package/dist/cli-main.js CHANGED
@@ -47,7 +47,7 @@ import {
47
47
  runTraceService,
48
48
  sessionStartRecall,
49
49
  ui
50
- } from "./chunk-UUCGEA3M.js";
50
+ } from "./chunk-52OVQENY.js";
51
51
  import {
52
52
  ConflictAlreadyResolvedError,
53
53
  REVIEW_QUEUE_PATH,
@@ -62,7 +62,7 @@ import {
62
62
  showFlaggedMerges,
63
63
  toConflictLogRow,
64
64
  toRecord
65
- } from "./chunk-3SQJQUIE.js";
65
+ } from "./chunk-H3ZKP2NJ.js";
66
66
  import {
67
67
  APP_VERSION,
68
68
  DEFAULT_AROUND_RADIUS_DAYS,
@@ -95,6 +95,7 @@ import {
95
95
  cosineSimilarity,
96
96
  createLlmClient,
97
97
  createLogger,
98
+ createStoreInfrastructureAdapter,
98
99
  describeAuth,
99
100
  detectAndStoreClusters,
100
101
  detectProjectFromCwd,
@@ -141,6 +142,7 @@ import {
141
142
  parsePositiveInt,
142
143
  parseProjectList,
143
144
  parseSinceToIso,
145
+ prepareStructuredClaimIdentity,
144
146
  probeCredentials,
145
147
  readConfig,
146
148
  rebuildFtsAndTriggers,
@@ -172,7 +174,7 @@ import {
172
174
  walCheckpoint,
173
175
  warnIfLocked,
174
176
  writeConfig
175
- } from "./chunk-VW6ZN3RY.js";
177
+ } from "./chunk-QVHE2EZN.js";
176
178
  import {
177
179
  getCoRecallNeighbors,
178
180
  getTopCoRecallEdges,
@@ -7325,12 +7327,32 @@ async function preStoreDedup(entries, db, apiKey, embedFn = embed, options = {})
7325
7327
  }
7326
7328
 
7327
7329
  // src/commands/ingest/bulk-store.ts
7330
+ async function prepareBulkEntry(extractClaim2, entityHintsPromise, entry, options) {
7331
+ const preparedEntry = {
7332
+ ...entry
7333
+ };
7334
+ normalizeStructuredClaimFields(preparedEntry);
7335
+ if (!options.llmClient || options.claimExtractionEnabled !== true) {
7336
+ return preparedEntry;
7337
+ }
7338
+ await prepareStructuredClaimIdentity(preparedEntry, {
7339
+ llmClient: options.llmClient,
7340
+ extractClaim: extractClaim2,
7341
+ claimExtractionEnabled: true,
7342
+ claimExtractionModel: options.claimExtractionModel,
7343
+ config: options.config,
7344
+ entityHints: await entityHintsPromise
7345
+ });
7346
+ return preparedEntry;
7347
+ }
7328
7348
  async function bulkStoreEntriesFn(params) {
7329
7349
  const { bulkDb, entries, apiKey, storeOptions = {}, seenNormHashes, embedFn, onDecision } = params;
7330
7350
  let bulkDedupSkippedHashMinhash = params.bulkDedupSkippedHashMinhash;
7331
7351
  const started = Date.now();
7332
7352
  let added = 0;
7333
7353
  let skipped = 0;
7354
+ const infrastructure = createStoreInfrastructureAdapter(bulkDb);
7355
+ const entityHintsPromise = storeOptions.llmClient && storeOptions.claimExtractionEnabled === true ? infrastructure.getDistinctEntities().catch(() => []) : Promise.resolve([]);
7334
7356
  const localSeenNormHashes = /* @__PURE__ */ new Set();
7335
7357
  const candidates = [];
7336
7358
  for (const entry of entries) {
@@ -7369,7 +7391,13 @@ async function bulkStoreEntriesFn(params) {
7369
7391
  minhashSig
7370
7392
  });
7371
7393
  }
7372
- const texts = candidates.map((candidate) => composeEmbeddingText(candidate.entry));
7394
+ const preparedCandidates = await Promise.all(
7395
+ candidates.map(async (candidate) => ({
7396
+ ...candidate,
7397
+ entry: await prepareBulkEntry(infrastructure.extractClaim, entityHintsPromise, candidate.entry, storeOptions)
7398
+ }))
7399
+ );
7400
+ const texts = preparedCandidates.map((candidate) => composeEmbeddingText(candidate.entry));
7373
7401
  const embeddings = texts.length > 0 ? await embedFn(texts, apiKey) : [];
7374
7402
  if (embeddings.length !== texts.length) {
7375
7403
  throw new Error(`Bulk embed mismatch: expected ${texts.length}, got ${embeddings.length}.`);
@@ -7377,8 +7405,8 @@ async function bulkStoreEntriesFn(params) {
7377
7405
  const committedHashes = /* @__PURE__ */ new Set();
7378
7406
  await bulkDb.execute("BEGIN IMMEDIATE");
7379
7407
  try {
7380
- for (let i = 0; i < candidates.length; i += 1) {
7381
- const candidate = candidates[i];
7408
+ for (let i = 0; i < preparedCandidates.length; i += 1) {
7409
+ const candidate = preparedCandidates[i];
7382
7410
  const embedding = embeddings[i];
7383
7411
  if (!candidate || !embedding) {
7384
7412
  throw new Error(`Missing bulk write candidate or embedding at index ${i}.`);
@@ -7899,6 +7927,9 @@ async function runEvalHarnessIngestInspectMode(options, deps) {
7899
7927
  let storeResult = emptyStoreResult();
7900
7928
  let storeDecisions = [];
7901
7929
  let preStoreSection;
7930
+ const claimExtractionEnabled = config?.contradiction?.enableClaimsDuringIngest === true;
7931
+ const contradictionEnabled = config?.contradiction?.enableDuringIngest === true;
7932
+ const llmClient = claimExtractionEnabled || contradictionEnabled ? resolvedDeps.createLlmClientFn({ env }) : void 0;
7902
7933
  if (options.ingestMode === "normal") {
7903
7934
  const dedupResult = extracted.length > 0 ? await resolvedDeps.preStoreDedupFn(extracted, db, apiKey, resolvedDeps.embedFn) : {
7904
7935
  survivors: [],
@@ -7908,9 +7939,6 @@ async function runEvalHarnessIngestInspectMode(options, deps) {
7908
7939
  totalReceived: 0
7909
7940
  };
7910
7941
  const inputIndexByKey = buildDecisionIndex(dedupResult.survivors);
7911
- const claimExtractionEnabled = config?.contradiction?.enableClaimsDuringIngest === true;
7912
- const contradictionEnabled = config?.contradiction?.enableDuringIngest === true;
7913
- const llmClient = claimExtractionEnabled || contradictionEnabled ? resolvedDeps.createLlmClientFn({ env }) : void 0;
7914
7942
  storeResult = dedupResult.survivors.length > 0 ? await resolvedDeps.storeEntriesFn(db, dedupResult.survivors, apiKey, {
7915
7943
  sourceFile: fixture.source_file,
7916
7944
  ingestContentHash: contentHash,
@@ -7943,6 +7971,12 @@ async function runEvalHarnessIngestInspectMode(options, deps) {
7943
7971
  bulkDb: db,
7944
7972
  entries: extracted,
7945
7973
  apiKey,
7974
+ storeOptions: {
7975
+ llmClient,
7976
+ claimExtractionEnabled,
7977
+ claimExtractionModel: claimExtractionEnabled ? resolveModelForTask(config, "claimExtraction") : void 0,
7978
+ config: config ?? void 0
7979
+ },
7946
7980
  seenNormHashes: /* @__PURE__ */ new Set(),
7947
7981
  bulkDedupSkippedHashMinhash: 0,
7948
7982
  embedFn: resolvedDeps.embedFn,
@@ -17128,12 +17162,12 @@ function registerMaintainCommand(program) {
17128
17162
  "--only <tasks>",
17129
17163
  "Comma-separated task names: quality,edge-decay,clusters,conflicts,consolidation,retirement,reflection"
17130
17164
  ).option("--prune-edges", "When edge decay runs, delete edges below the configured decay floor").option("--verbose", "Show detailed per-task output").action(async (opts) => {
17131
- const { runMaintainCommand } = await import("./maintain-WL7KST4P.js");
17165
+ const { runMaintainCommand } = await import("./maintain-CH6FGJJF.js");
17132
17166
  const result = await runMaintainCommand(opts);
17133
17167
  process.exitCode = result.exitCode;
17134
17168
  });
17135
17169
  maintainCommand.command("history").description("Show past maintenance runs").option("--db <path>", "Database path override").option("--limit <n>", "Max runs to show (default: 10)", parseIntOption).option("--json", "Output as JSON").action(async (opts) => {
17136
- const { runMaintainHistoryCommand } = await import("./maintain-WL7KST4P.js");
17170
+ const { runMaintainHistoryCommand } = await import("./maintain-CH6FGJJF.js");
17137
17171
  const result = await runMaintainHistoryCommand(opts);
17138
17172
  process.exitCode = result.exitCode;
17139
17173
  });
@@ -19379,8 +19413,8 @@ async function runWatcher(options, deps) {
19379
19413
  env: process.env
19380
19414
  });
19381
19415
  const config = resolvedDeps.readConfigFn(process.env);
19382
- const claimExtractionEnabled = config?.contradiction?.enabled !== false;
19383
- const contradictionEnabled = config?.contradiction?.enabled !== false;
19416
+ const claimExtractionEnabled = config?.contradiction?.enableClaimsDuringIngest === true;
19417
+ const contradictionEnabled = config?.contradiction?.enableDuringIngest === true;
19384
19418
  const claimExtractionModel = resolveModelForTask(config, "claimExtraction");
19385
19419
  const dbPath = options.dbPath?.trim() || config?.db?.path;
19386
19420
  const db = options.dryRun ? null : resolvedDeps.getDbFn(dbPath);
@@ -19660,7 +19694,7 @@ async function runWatcher(options, deps) {
19660
19694
  () => resolvedDeps.storeEntriesFn(db, deduped, embeddingApiKey ?? "", {
19661
19695
  sourceFile: targetFilePath,
19662
19696
  onlineDedup: options.onlineDedup !== false,
19663
- llmClient: options.onlineDedup === false ? void 0 : client,
19697
+ llmClient: options.onlineDedup === false && !claimExtractionEnabled && !contradictionEnabled ? void 0 : client,
19664
19698
  claimExtractionEnabled,
19665
19699
  claimExtractionModel,
19666
19700
  contradictionEnabled,
@@ -17,7 +17,7 @@ import {
17
17
  resolveConflict,
18
18
  runConsolidationOrchestrator,
19
19
  toRecord
20
- } from "./chunk-3SQJQUIE.js";
20
+ } from "./chunk-H3ZKP2NJ.js";
21
21
  import {
22
22
  DEFAULT_DB_PATH,
23
23
  DEFAULT_TASK_MODEL,
@@ -46,7 +46,7 @@ import {
46
46
  resolveModelForLlmClient,
47
47
  runSimpleStream,
48
48
  walCheckpoint
49
- } from "./chunk-VW6ZN3RY.js";
49
+ } from "./chunk-QVHE2EZN.js";
50
50
  import {
51
51
  decayCoRecallEdges,
52
52
  getLastRecallActivity,
@@ -24,7 +24,7 @@ import {
24
24
  runStoreService,
25
25
  runTraceService,
26
26
  setSessionProject
27
- } from "../chunk-UUCGEA3M.js";
27
+ } from "../chunk-52OVQENY.js";
28
28
  import {
29
29
  KNOWLEDGE_TYPES,
30
30
  SCOPE_LEVELS,
@@ -41,7 +41,7 @@ import {
41
41
  sanitizeInjectedContextText,
42
42
  stripInjectedContext,
43
43
  toErrorMessage
44
- } from "../chunk-VW6ZN3RY.js";
44
+ } from "../chunk-QVHE2EZN.js";
45
45
  import {
46
46
  MILLISECONDS_PER_DAY,
47
47
  __export,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agenr",
3
- "version": "0.9.95",
3
+ "version": "0.9.97",
4
4
  "openclaw": {
5
5
  "extensions": [
6
6
  "dist/openclaw-plugin/index.js"