@remnic/core 9.6.12 → 9.6.14
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/access-cli.js +2 -2
- package/dist/{chunk-OP47QBUR.js → chunk-5TYS6NTK.js} +2 -2
- package/dist/{chunk-FIOYURII.js → chunk-FV5FVO2J.js} +41 -2
- package/dist/chunk-FV5FVO2J.js.map +1 -0
- package/dist/event-order-recall.js +1 -1
- package/dist/index.js +2 -2
- package/dist/orchestrator.js +2 -2
- package/package.json +2 -2
- package/src/event-order-recall.test.ts +26 -0
- package/src/event-order-recall.ts +71 -5
- package/dist/chunk-FIOYURII.js.map +0 -1
- /package/dist/{chunk-OP47QBUR.js.map → chunk-5TYS6NTK.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -93,7 +93,7 @@ import {
|
|
|
93
93
|
validateTaxonomy,
|
|
94
94
|
watchForChanges,
|
|
95
95
|
writeManifest
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-5TYS6NTK.js";
|
|
97
97
|
import {
|
|
98
98
|
WEARABLE_SOURCE_PREFIX,
|
|
99
99
|
buildExtractionTurns,
|
|
@@ -304,7 +304,7 @@ import {
|
|
|
304
304
|
import {
|
|
305
305
|
buildEventOrderRecallSection,
|
|
306
306
|
shouldRecallEventOrderEvidence
|
|
307
|
-
} from "./chunk-
|
|
307
|
+
} from "./chunk-FV5FVO2J.js";
|
|
308
308
|
import "./chunk-IAIPNEHD.js";
|
|
309
309
|
import {
|
|
310
310
|
buildExplicitCueRecallSection,
|
package/dist/orchestrator.js
CHANGED
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
throwIfRecallAborted,
|
|
44
44
|
tokenizeRecallQuery,
|
|
45
45
|
utcDateKeysForLocalDay
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-5TYS6NTK.js";
|
|
47
47
|
import "./chunk-J3XHPFEU.js";
|
|
48
48
|
import "./chunk-JODHPNLN.js";
|
|
49
49
|
import "./chunk-I74SUMNI.js";
|
|
@@ -113,7 +113,7 @@ import "./chunk-54V4BZWP.js";
|
|
|
113
113
|
import "./chunk-KAWTOYAW.js";
|
|
114
114
|
import "./chunk-QT2RZNRT.js";
|
|
115
115
|
import "./chunk-LZTFCAKE.js";
|
|
116
|
-
import "./chunk-
|
|
116
|
+
import "./chunk-FV5FVO2J.js";
|
|
117
117
|
import "./chunk-IAIPNEHD.js";
|
|
118
118
|
import "./chunk-4463LUIE.js";
|
|
119
119
|
import "./chunk-YVVQUAOO.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.6.
|
|
3
|
+
"version": "9.6.14",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3000,7 +3000,7 @@
|
|
|
3000
3000
|
"core"
|
|
3001
3001
|
],
|
|
3002
3002
|
"peerDependencies": {
|
|
3003
|
-
"@remnic/coding-graph": "^9.6.
|
|
3003
|
+
"@remnic/coding-graph": "^9.6.14"
|
|
3004
3004
|
},
|
|
3005
3005
|
"peerDependenciesMeta": {
|
|
3006
3006
|
"@remnic/coding-graph": {
|
|
@@ -160,6 +160,32 @@ test("event order recall is query-triggered", () => {
|
|
|
160
160
|
);
|
|
161
161
|
});
|
|
162
162
|
|
|
163
|
+
test("temporal-reasoning heuristic: catches ordering and duration phrasings", () => {
|
|
164
|
+
// Ordering comparisons
|
|
165
|
+
assert.equal(shouldRecallEventOrderEvidence("Which event did I attend first, the workshop or the webinar?"), true);
|
|
166
|
+
assert.equal(shouldRecallEventOrderEvidence("What was the first issue I had with my car?"), true);
|
|
167
|
+
assert.equal(shouldRecallEventOrderEvidence("Which event happened first, the purchase or the malfunction?"), true);
|
|
168
|
+
assert.equal(shouldRecallEventOrderEvidence("Who did I meet first, Mark or Sarah?"), true);
|
|
169
|
+
assert.equal(shouldRecallEventOrderEvidence("What is the order of the three trips I took?"), true);
|
|
170
|
+
assert.equal(shouldRecallEventOrderEvidence("Which seeds were started first, the tomatoes or the marigolds?"), true);
|
|
171
|
+
// Duration and relative time
|
|
172
|
+
assert.equal(shouldRecallEventOrderEvidence("How many days before the meeting did I attend the workshop?"), true);
|
|
173
|
+
assert.equal(shouldRecallEventOrderEvidence("How long have I been working before I started my current job?"), true);
|
|
174
|
+
assert.equal(shouldRecallEventOrderEvidence("How many months ago did I book the Airbnb?"), true);
|
|
175
|
+
assert.equal(shouldRecallEventOrderEvidence("How old was I when I moved to the United States?"), true);
|
|
176
|
+
// Recency
|
|
177
|
+
assert.equal(shouldRecallEventOrderEvidence("Which streaming service did I start using most recently?"), true);
|
|
178
|
+
// Date-shaped
|
|
179
|
+
assert.equal(shouldRecallEventOrderEvidence("When did I first mention the database issue?"), true);
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test("temporal-reasoning heuristic: does not match non-temporal questions", () => {
|
|
183
|
+
assert.equal(shouldRecallEventOrderEvidence("What time do I wake up on Tuesdays?"), false);
|
|
184
|
+
assert.equal(shouldRecallEventOrderEvidence("Which airline did I fly with the most in March?"), false);
|
|
185
|
+
assert.equal(shouldRecallEventOrderEvidence("What is my favorite coffee order?"), false);
|
|
186
|
+
assert.equal(shouldRecallEventOrderEvidence("How many people attended the workshop?"), false);
|
|
187
|
+
});
|
|
188
|
+
|
|
163
189
|
test("event order recall honors zero max items without scanning", async () => {
|
|
164
190
|
const engine = new FakeEventOrderEngine("event-order-zero", [
|
|
165
191
|
{
|
|
@@ -29,18 +29,84 @@ const DEFAULT_MAX_ITEMS = 24;
|
|
|
29
29
|
|
|
30
30
|
export function shouldRecallEventOrderEvidence(query: string): boolean {
|
|
31
31
|
const normalized = query.toLowerCase();
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
// --- Existing event-order patterns (LongMemEval order-reconstruction phrasing) ---
|
|
34
|
+
if (
|
|
35
|
+
/\border in which\b/.test(normalized) ||
|
|
33
36
|
/\bsequence in which\b/.test(normalized) ||
|
|
34
37
|
/\breconstruct\b.*\btimeline\b/.test(normalized) ||
|
|
35
38
|
/\btimeline\b.*\bin order\b/.test(normalized) ||
|
|
36
39
|
/\bsequence\b.*\bin order\b/.test(normalized) ||
|
|
37
40
|
/\bintroduced\b.*\bin order\b/.test(normalized) ||
|
|
38
|
-
/\bwalk me through\b/.test(normalized) && /\bin order\b/.test(normalized) ||
|
|
39
|
-
/\bin order\b/.test(normalized) &&
|
|
40
|
-
/\b(?:develop(?:ed|ment)?|evolv(?:e|ed|ing)?|progress|throughout|conversations?|sessions?)\b/.test(normalized) ||
|
|
41
|
+
(/\bwalk me through\b/.test(normalized) && /\bin order\b/.test(normalized)) ||
|
|
42
|
+
(/\bin order\b/.test(normalized) &&
|
|
43
|
+
/\b(?:develop(?:ed|ment)?|evolv(?:e|ed|ing)?|progress|throughout|conversations?|sessions?)\b/.test(normalized)) ||
|
|
41
44
|
/\bprogress\b.*\bin order\b/.test(normalized) ||
|
|
42
45
|
/\bchronological(?:ly| order)?\b/.test(normalized) ||
|
|
43
|
-
isTimelineSummaryQuery(normalized)
|
|
46
|
+
isTimelineSummaryQuery(normalized)
|
|
47
|
+
) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// --- Temporal-reasoning patterns (LongMemEval temporal-reasoning question type) ---
|
|
52
|
+
// These question shapes need chronological evidence to answer correctly:
|
|
53
|
+
// ordering ("which happened first"), relative time ("how many days
|
|
54
|
+
// between"), and recency ("which did I [verb] last"). The event-order tier
|
|
55
|
+
// surfaces a chronologically sorted evidence pack so the responder can
|
|
56
|
+
// reconstruct the answer from an ordered timeline rather than fragments.
|
|
57
|
+
// Verified against the LongMemEval-oracle dataset: 0% of the 133
|
|
58
|
+
// temporal-reasoning questions matched the original heuristic above.
|
|
59
|
+
|
|
60
|
+
// "Which X did I Y first, A or B?" / "What was the first X ...?"
|
|
61
|
+
if (/\bwhich\b.*\bfirst\b/.test(normalized) || /\bwhat was the first\b/.test(normalized)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
// "Which event happened first, A or B?" / "Which happened first"
|
|
65
|
+
if (/\bhappened first\b/.test(normalized) || /\bwhich\b.*\bhappened\b/.test(normalized)) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
// "How many days before/between/after/did it take"
|
|
69
|
+
if (/\bhow many days\b/.test(normalized)) {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
// "When did I ..." (date-shaped)
|
|
73
|
+
if (/\bwhen did\b/.test(normalized)) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
// "Which X did I Y last?" / "the last X I ..."
|
|
77
|
+
if (/\bwhich\b.*\blast\b/.test(normalized) || /\bthe last\b.*\bi\b/.test(normalized)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
// "Who did I meet/become first, X or Y?" (person ordering)
|
|
81
|
+
if (/\bwho\b.*\bfirst\b/.test(normalized)) {
|
|
82
|
+
return true;
|
|
83
|
+
}
|
|
84
|
+
// "most recently" / "most recent" (recency)
|
|
85
|
+
if (/\bmost recent(?:ly)?\b/.test(normalized)) {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
// "What is the order of..." / "...from earliest to latest"
|
|
89
|
+
if (/\border of\b/.test(normalized) || /\bfrom earliest to latest\b/.test(normalized)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// "How long have/did/had I been..." (duration)
|
|
94
|
+
if (/\bhow long\b/.test(normalized)) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
// "How many months/weeks/years ago/before" (relative time)
|
|
98
|
+
if (/\bhow many (months|weeks|years)\b/.test(normalized)) {
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
// "How many X did I [verb] before Y" (temporal comparison)
|
|
102
|
+
if (/\bhow many\b.*\bbefore\b/.test(normalized)) {
|
|
103
|
+
return true;
|
|
104
|
+
}
|
|
105
|
+
// "How old was I when..." (age-at-time)
|
|
106
|
+
if (/\bhow old\b.*\bwhen\b/.test(normalized)) {
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
44
110
|
}
|
|
45
111
|
|
|
46
112
|
export async function buildEventOrderRecallSection(
|