signetai 0.85.1 → 0.85.2

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.
Files changed (2) hide show
  1. package/dist/daemon.js +21 -6
  2. package/package.json +1 -1
package/dist/daemon.js CHANGED
@@ -28827,11 +28827,11 @@ async function hybridRecall(params, cfg2, embedFn2) {
28827
28827
  timeoutMs: cfg2.pipelineV2.reranker.timeoutMs,
28828
28828
  model: cfg2.pipelineV2.reranker.model
28829
28829
  });
28830
- const rerankedMap = new Map(reranked.map((r2, i3) => [r2.id, i3]));
28830
+ const rerankedMap = new Map(reranked.map((row) => [row.id, row.score]));
28831
28831
  for (const s2 of scored) {
28832
- const idx = rerankedMap.get(s2.id);
28833
- if (idx !== undefined) {
28834
- s2.score = 1 - idx / reranked.length;
28832
+ const score = rerankedMap.get(s2.id);
28833
+ if (typeof score === "number" && Number.isFinite(score)) {
28834
+ s2.score = score;
28835
28835
  }
28836
28836
  }
28837
28837
  scored.sort((a2, b2) => b2.score - a2.score);
@@ -37265,7 +37265,8 @@ function getDefaultConfig() {
37265
37265
  userPromptSubmit: {
37266
37266
  enabled: true,
37267
37267
  recallLimit: 10,
37268
- maxInjectChars: 500
37268
+ maxInjectChars: 500,
37269
+ minScore: 0.8
37269
37270
  },
37270
37271
  preCompaction: {
37271
37272
  summaryGuidelines: `Summarize this session focusing on:
@@ -37281,6 +37282,11 @@ Keep the summary concise but complete. Use first person from the agent's perspec
37281
37282
  }
37282
37283
  };
37283
37284
  }
37285
+ function resolveUserPromptMinScore(value) {
37286
+ if (typeof value !== "number" || !Number.isFinite(value))
37287
+ return 0.8;
37288
+ return Math.max(0, Math.min(1, value));
37289
+ }
37284
37290
  function isAgentConfig(value) {
37285
37291
  return typeof value === "object" && value !== null;
37286
37292
  }
@@ -38127,6 +38133,7 @@ ${now4} (${tz})
38127
38133
  const cfg2 = loadMemoryConfig(AGENTS_DIR3);
38128
38134
  const recallLimit = submitCfg.recallLimit ?? 10;
38129
38135
  const injectBudget = submitCfg.maxInjectChars ?? cfg2.pipelineV2.guardrails.contextBudgetChars;
38136
+ const minScore = resolveUserPromptMinScore(submitCfg.minScore);
38130
38137
  const queryTerms = vectorQuery.slice(0, 80);
38131
38138
  const recall = await hybridRecall({
38132
38139
  query: vectorQuery,
@@ -38138,7 +38145,8 @@ ${now4} (${tz})
38138
38145
  policyGroup: agentScope.policyGroup,
38139
38146
  project: req.project
38140
38147
  }, cfg2, fetchEmbedding);
38141
- const topScore = recall.results[0]?.score;
38148
+ const topRaw = recall.results[0]?.score;
38149
+ const topScore = typeof topRaw === "number" ? clampScore01(topRaw) : undefined;
38142
38150
  const noStructured = recall.results.length === 0 || typeof topScore !== "number" || topScore < 0.4;
38143
38151
  const anchorsMissed = queryAnchorsMissingFromRecall(userMessage, recall.results);
38144
38152
  if (noStructured || anchorsMissed) {
@@ -38170,6 +38178,13 @@ ${now4} (${tz})
38170
38178
  }, "no-structured");
38171
38179
  }
38172
38180
  }
38181
+ if (typeof topScore !== "number" || topScore < minScore) {
38182
+ return finalizeUserPromptSubmitSuccess(req, userMessage, start, {
38183
+ inject: metadataHeader,
38184
+ memoryCount: 0,
38185
+ warnings
38186
+ }, "low-confidence");
38187
+ }
38173
38188
  const mapped = recall.results.map((result) => ({
38174
38189
  ...result,
38175
38190
  pinned: result.pinned ? 1 : 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "signetai",
3
- "version": "0.85.1",
3
+ "version": "0.85.2",
4
4
  "description": "Portable AI agent identity - own your agent, bring it anywhere",
5
5
  "type": "module",
6
6
  "bin": {