soulbridge 0.0.21 → 0.0.22

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.
@@ -8,7 +8,7 @@ export * from './types.ts';
8
8
  export type { SoulStore } from './store.ts';
9
9
  export { openSqlite, SCHEMA_VERSION, AFFECT_RETENTION_MS, DbNewerThanBinaryError } from './sqlite.ts';
10
10
  export { buildContext, styleDirectives, DEFAULT_MAX_CHARS, AFFECT_BUDGET, AFFECT_WINDOW_MS, } from './context.ts';
11
- export { reflect, ruleExtract, nextEmotion, isCorrection, correctionRule } from './reflect.ts';
11
+ export { reflect, ruleExtract, nextEmotion, isCorrection, correctionRule, isQuestion } from './reflect.ts';
12
12
  export { rank, scoreMemory, tokenize, relevance } from './scoring.ts';
13
13
  export * from './affect/index.ts';
14
14
  export { measureStyle } from './style/measure.ts';
@@ -7,7 +7,7 @@
7
7
  export * from './types.js';
8
8
  export { openSqlite, SCHEMA_VERSION, AFFECT_RETENTION_MS, DbNewerThanBinaryError } from './sqlite.js';
9
9
  export { buildContext, styleDirectives, DEFAULT_MAX_CHARS, AFFECT_BUDGET, AFFECT_WINDOW_MS, } from './context.js';
10
- export { reflect, ruleExtract, nextEmotion, isCorrection, correctionRule } from './reflect.js';
10
+ export { reflect, ruleExtract, nextEmotion, isCorrection, correctionRule, isQuestion } from './reflect.js';
11
11
  export { rank, scoreMemory, tokenize, relevance } from './scoring.js';
12
12
  export * from './affect/index.js';
13
13
  export { measureStyle } from './style/measure.js';
@@ -44,6 +44,13 @@ export declare function gateDrafts(drafts: Draft[]): {
44
44
  accepted: Draft[];
45
45
  rejected: DraftRejection[];
46
46
  };
47
+ /**
48
+ * A question is not a statement to remember.
49
+ *
50
+ * Measured case: "我们这个记忆会记住日常生活吗?" was stored as a fact because a
51
+ * trigger word matched before anything looked at the sentence type.
52
+ */
53
+ export declare function isQuestion(text: string): boolean;
47
54
  export declare function ruleExtract(turns: Turn[]): Draft[];
48
55
  /** Corrections raise tension and lower passion; an ordinary session lets tension decay. */
49
56
  export declare function nextEmotion(current: Emotion, turns: Turn[]): Emotion;
@@ -121,11 +121,25 @@ export function gateDrafts(drafts) {
121
121
  }
122
122
  return { accepted, rejected };
123
123
  }
124
+ /**
125
+ * A question is not a statement to remember.
126
+ *
127
+ * Measured case: "我们这个记忆会记住日常生活吗?" was stored as a fact because a
128
+ * trigger word matched before anything looked at the sentence type.
129
+ */
130
+ export function isQuestion(text) {
131
+ const trimmed = text.trim();
132
+ if (trimmed.endsWith('?') || trimmed.endsWith('?'))
133
+ return true;
134
+ return /(吗|呢)[。.!!~~]?$/.test(trimmed);
135
+ }
124
136
  export function ruleExtract(turns) {
125
137
  const drafts = [];
126
138
  for (const turn of turns) {
127
139
  if (turn.role !== 'user')
128
140
  continue;
141
+ if (isQuestion(turn.content))
142
+ continue;
129
143
  for (const rule of RULES) {
130
144
  if (!rule.match(turn.content))
131
145
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soulbridge",
3
- "version": "0.0.21",
3
+ "version": "0.0.22",
4
4
  "description": "A personality layer for any agent: continuity, forgetting, and growth across tools.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",