recallnest 3.0.0 → 4.0.0
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 +304 -0
- package/README.md +251 -258
- package/README_CN.md +226 -247
- package/assets/ui/app.js +6 -1
- package/bin/recallnest.mjs +20 -37
- package/docs/api-reference.md +8 -0
- package/docs/architecture.md +18 -13
- package/eval/cases-canary.json +107 -9
- package/integrations/examples/claude-agent-sdk/memory-agent.ts +2 -0
- package/integrations/examples/langchain/memory-chain.py +4 -0
- package/integrations/examples/openai-agents-sdk/memory-agent.py +4 -0
- package/package.json +12 -3
- package/src/activity-counter.ts +1 -0
- package/src/adaptive-retrieval.ts +23 -0
- package/src/api-server.ts +13 -11
- package/src/asset-sync.ts +26 -2
- package/src/audit-log.ts +2 -0
- package/src/auto-gc.ts +4 -3
- package/src/belief-history.ts +137 -31
- package/src/capture-engine.ts +459 -71
- package/src/cascade-forget.ts +7 -3
- package/src/checkpoint-mirror.ts +417 -0
- package/src/cli.ts +574 -54
- package/src/conflict-engine.ts +43 -15
- package/src/consolidation-engine.ts +24 -3
- package/src/context-collapse-renderer.ts +8 -1
- package/src/context-composer-stable.ts +5 -1
- package/src/context-composer.ts +11 -2
- package/src/distill-lock.ts +246 -74
- package/src/dream-pipeline.ts +3 -1
- package/src/embedder.ts +24 -0
- package/src/env-config.ts +136 -0
- package/src/flock.ts +97 -0
- package/src/forget-engine.ts +342 -58
- package/src/gateway-server.ts +4 -0
- package/src/ingest-plan.ts +56 -0
- package/src/ingest.ts +294 -121
- package/src/kg-contradiction.ts +753 -0
- package/src/kg-extractor.ts +17 -0
- package/src/kg-store.ts +1 -1
- package/src/known-item-eval.ts +455 -0
- package/src/llm-client.ts +13 -26
- package/src/llm-consolidation.ts +2 -2
- package/src/mcp-tool-deps.ts +6 -0
- package/src/mcp-tools-advanced.ts +80 -45
- package/src/mcp-tools-core.ts +23 -17
- package/src/mcp-tools-governance.ts +13 -7
- package/src/memory-assets.ts +144 -8
- package/src/memory-boundaries.ts +19 -0
- package/src/memory-evolution.ts +9 -0
- package/src/memory-lint.ts +1 -1
- package/src/memory-output.ts +311 -14
- package/src/memory-reconcile.ts +1437 -0
- package/src/memory-schema.ts +11 -0
- package/src/memory-store-port.ts +1 -0
- package/src/minis-archive.ts +151 -0
- package/src/noise-filter.ts +15 -2
- package/src/pii-detector.ts +31 -1
- package/src/pivot-apply.ts +55 -5
- package/src/pivot-evidence.ts +128 -0
- package/src/ppr-traversal.ts +25 -1
- package/src/preference-matcher.ts +40 -28
- package/src/prospective-memory.ts +7 -4
- package/src/retriever.ts +297 -57
- package/src/retroactive-boost.ts +3 -2
- package/src/runtime-config.ts +15 -1
- package/src/scope-policy.ts +1 -0
- package/src/session-distiller.ts +6 -2
- package/src/session-engine.ts +11 -4
- package/src/session-output.ts +20 -1
- package/src/session-schema.ts +5 -2
- package/src/session-store.ts +59 -12
- package/src/skill-promotion.ts +67 -1
- package/src/store-receipts.ts +109 -0
- package/src/store-write-budget.ts +37 -0
- package/src/store.ts +298 -57
- package/src/text-fingerprint.ts +25 -0
- package/src/trigger-store.ts +443 -0
- package/src/ui-server.ts +22 -21
- package/src/version-manager.ts +19 -5
- package/src/write-verifier.ts +16 -11
- package/src/__tests__/access-tracker-novelty.test.ts +0 -324
- package/src/__tests__/activity-counter.test.ts +0 -125
- package/src/__tests__/adaptive-fidelity.test.ts +0 -102
- package/src/__tests__/admission-control.test.ts +0 -206
- package/src/__tests__/age-label.test.ts +0 -33
- package/src/__tests__/anchor-generator.test.ts +0 -67
- package/src/__tests__/api-server-security.test.ts +0 -102
- package/src/__tests__/auto-consolidation.test.ts +0 -168
- package/src/__tests__/auto-recall.test.ts +0 -131
- package/src/__tests__/babel-integration.test.ts +0 -144
- package/src/__tests__/batch-dedup.test.ts +0 -65
- package/src/__tests__/belief-history.test.ts +0 -220
- package/src/__tests__/canary-eval.test.ts +0 -114
- package/src/__tests__/capture-engine.test.ts +0 -1328
- package/src/__tests__/capture-heuristic.test.ts +0 -171
- package/src/__tests__/cascade-forget.test.ts +0 -210
- package/src/__tests__/category-min-scores.test.ts +0 -116
- package/src/__tests__/cc8-cc1-essential-context.test.ts +0 -298
- package/src/__tests__/circuit-breaker.test.ts +0 -99
- package/src/__tests__/cluster-consolidation.test.ts +0 -1236
- package/src/__tests__/confidence-metadata.test.ts +0 -125
- package/src/__tests__/confidence-tracker.test.ts +0 -261
- package/src/__tests__/conflict-advisor.test.ts +0 -206
- package/src/__tests__/conflict-escalation.test.ts +0 -149
- package/src/__tests__/conflict-lifecycle.test.ts +0 -83
- package/src/__tests__/conflict-output.test.ts +0 -85
- package/src/__tests__/conflict-store.test.ts +0 -418
- package/src/__tests__/connector-v1.test.ts +0 -181
- package/src/__tests__/consolidation-engine.test.ts +0 -520
- package/src/__tests__/constructive-retrieval.test.ts +0 -509
- package/src/__tests__/context-collapse-renderer.test.ts +0 -214
- package/src/__tests__/context-composer-pins.test.ts +0 -64
- package/src/__tests__/context-composer-task-selection.test.ts +0 -24
- package/src/__tests__/context-reconstructor.test.ts +0 -65
- package/src/__tests__/context-renderer.test.ts +0 -91
- package/src/__tests__/continuity-eval.test.ts +0 -275
- package/src/__tests__/continuity-schema.test.ts +0 -97
- package/src/__tests__/contracts.test.ts +0 -262
- package/src/__tests__/conversation-importer.test.ts +0 -692
- package/src/__tests__/core-recall-eval.test.ts +0 -235
- package/src/__tests__/core-summary.test.ts +0 -109
- package/src/__tests__/data-checkup.test.ts +0 -304
- package/src/__tests__/decay-exemption.test.ts +0 -129
- package/src/__tests__/dedup-actions.test.ts +0 -58
- package/src/__tests__/dedup-guard.test.ts +0 -39
- package/src/__tests__/deterministic-id.test.ts +0 -39
- package/src/__tests__/distill-lock.test.ts +0 -305
- package/src/__tests__/distill-session-argshape.test.ts +0 -79
- package/src/__tests__/doctor.test.ts +0 -319
- package/src/__tests__/dream-pipeline.test.ts +0 -820
- package/src/__tests__/dream-scope-isolation.test.ts +0 -386
- package/src/__tests__/dream-write-batching.test.ts +0 -211
- package/src/__tests__/drill-down.test.ts +0 -108
- package/src/__tests__/embedder.test.ts +0 -122
- package/src/__tests__/emotion-decay.test.ts +0 -46
- package/src/__tests__/emotion-detector.test.ts +0 -56
- package/src/__tests__/emotion-phase1-integration.test.ts +0 -153
- package/src/__tests__/emotion-retrieval.test.ts +0 -56
- package/src/__tests__/entity-resolver.test.ts +0 -58
- package/src/__tests__/env-config-invariant.test.ts +0 -80
- package/src/__tests__/env-config.test.ts +0 -211
- package/src/__tests__/error-signature-boost.test.ts +0 -87
- package/src/__tests__/error-signature.test.ts +0 -95
- package/src/__tests__/error-taxonomy.test.ts +0 -129
- package/src/__tests__/ethics-layer.test.ts +0 -476
- package/src/__tests__/event-segmenter.test.ts +0 -153
- package/src/__tests__/feature-flags-integration.test.ts +0 -54
- package/src/__tests__/frequency-tracker.test.ts +0 -113
- package/src/__tests__/freshness.test.ts +0 -186
- package/src/__tests__/graph-export.test.ts +0 -489
- package/src/__tests__/hotness-blend.test.ts +0 -283
- package/src/__tests__/ingest-chunking.test.ts +0 -44
- package/src/__tests__/ingest-scope-prefix.test.ts +0 -69
- package/src/__tests__/ingest.test.ts +0 -360
- package/src/__tests__/interference-detector.test.ts +0 -203
- package/src/__tests__/kg-extractor.test.ts +0 -192
- package/src/__tests__/kg-store.test.ts +0 -300
- package/src/__tests__/llm-client-pivot.test.ts +0 -628
- package/src/__tests__/llm-consolidation.test.ts +0 -226
- package/src/__tests__/maintenance-locks.test.ts +0 -197
- package/src/__tests__/mcp-efficiency.test.ts +0 -288
- package/src/__tests__/mcp-related-scopes.test.ts +0 -151
- package/src/__tests__/memory-boundaries.test.ts +0 -282
- package/src/__tests__/memory-evolution-b2-b3-e1.test.ts +0 -362
- package/src/__tests__/memory-evolution.test.ts +0 -271
- package/src/__tests__/memory-health-rebalance.test.ts +0 -144
- package/src/__tests__/memory-lint.test.ts +0 -421
- package/src/__tests__/memory-output.test.ts +0 -224
- package/src/__tests__/memory-promotion.test.ts +0 -315
- package/src/__tests__/memory-utility.test.ts +0 -256
- package/src/__tests__/migrate-dedup-ids.test.ts +0 -65
- package/src/__tests__/multi-vector.test.ts +0 -242
- package/src/__tests__/narrative-architecture.test.ts +0 -456
- package/src/__tests__/noise-filter.test.ts +0 -205
- package/src/__tests__/noise-prototype-bank.test.ts +0 -280
- package/src/__tests__/obsidian-connector.test.ts +0 -363
- package/src/__tests__/omitted-reporting.test.ts +0 -98
- package/src/__tests__/openai-contract.test.ts +0 -513
- package/src/__tests__/pending-review.test.ts +0 -77
- package/src/__tests__/pii-redact.test.ts +0 -333
- package/src/__tests__/pivot-apply.test.ts +0 -373
- package/src/__tests__/pivot-distill-supervisor.test.ts +0 -457
- package/src/__tests__/pivot-distill.test.ts +0 -1178
- package/src/__tests__/post-retrieval-filter.test.ts +0 -178
- package/src/__tests__/ppr-traversal.test.ts +0 -256
- package/src/__tests__/prediction-engine.test.ts +0 -349
- package/src/__tests__/predictive-prospective-memory.test.ts +0 -416
- package/src/__tests__/preference-guard-smoke.test.ts +0 -211
- package/src/__tests__/preference-matcher.test.ts +0 -282
- package/src/__tests__/preference-slots.test.ts +0 -205
- package/src/__tests__/promotion-distinct-sources.test.ts +0 -162
- package/src/__tests__/prospective-memory.test.ts +0 -283
- package/src/__tests__/pull-from-macbook-sync-only.test.ts +0 -679
- package/src/__tests__/query-entity-detector.test.ts +0 -171
- package/src/__tests__/query-expander-alias.test.ts +0 -146
- package/src/__tests__/query-expander.test.ts +0 -34
- package/src/__tests__/recall-gate.test.ts +0 -266
- package/src/__tests__/recall-governor.test.ts +0 -227
- package/src/__tests__/recall-mode.test.ts +0 -64
- package/src/__tests__/resolve-db-path.test.ts +0 -130
- package/src/__tests__/resolve-tier.test.ts +0 -64
- package/src/__tests__/result-synthesizer.test.ts +0 -198
- package/src/__tests__/resume-context.test.ts +0 -4898
- package/src/__tests__/retrieval-eval.test.ts +0 -163
- package/src/__tests__/retrieval-trace.test.ts +0 -213
- package/src/__tests__/retrieve-audit-revision.test.ts +0 -255
- package/src/__tests__/retriever-boundary-weight.test.ts +0 -136
- package/src/__tests__/retriever-lazy-init-dispatch.test.ts +0 -123
- package/src/__tests__/retroactive-boost.test.ts +0 -223
- package/src/__tests__/salience-scoring.test.ts +0 -106
- package/src/__tests__/scope-inventory.test.ts +0 -200
- package/src/__tests__/scope-policy.test.ts +0 -69
- package/src/__tests__/scope-suggester.test.ts +0 -80
- package/src/__tests__/session-checkpoint.test.ts +0 -291
- package/src/__tests__/session-distiller.test.ts +0 -640
- package/src/__tests__/session-gc.test.ts +0 -215
- package/src/__tests__/skill-engine.test.ts +0 -552
- package/src/__tests__/skill-promotion.test.ts +0 -654
- package/src/__tests__/skill-verifier.test.ts +0 -122
- package/src/__tests__/source-heartbeat.test.ts +0 -254
- package/src/__tests__/stable-context-length-contract.test.ts +0 -62
- package/src/__tests__/store-patch-metadata.test.ts +0 -235
- package/src/__tests__/store-read-consistency.test.ts +0 -122
- package/src/__tests__/store-schema-migration.test.ts +0 -87
- package/src/__tests__/store-scope-audit.test.ts +0 -81
- package/src/__tests__/store-upsert.test.ts +0 -201
- package/src/__tests__/supersede-chain.test.ts +0 -154
- package/src/__tests__/synthesis-contract.test.ts +0 -252
- package/src/__tests__/synthesis-promotion.test.ts +0 -369
- package/src/__tests__/temporal-parser.test.ts +0 -241
- package/src/__tests__/temporal-validity.test.ts +0 -160
- package/src/__tests__/term-registry-terminal-roster.test.ts +0 -127
- package/src/__tests__/term-registry.test.ts +0 -121
- package/src/__tests__/tool-error-surfacing.test.ts +0 -98
- package/src/__tests__/tool-output-compressor.test.ts +0 -160
- package/src/__tests__/topic-tag.test.ts +0 -113
- package/src/__tests__/trusted-memory.test.ts +0 -867
- package/src/__tests__/ui-server-security.test.ts +0 -93
- package/src/__tests__/usage-tracker.test.ts +0 -287
- package/src/__tests__/utility-weight.test.ts +0 -57
- package/src/__tests__/verbatim-self-recall.test.ts +0 -279
- package/src/__tests__/version-manager.test.ts +0 -248
- package/src/__tests__/workflow-observation-skill-outcome.test.ts +0 -352
- package/src/__tests__/workflow-observation.test.ts +0 -433
- package/src/__tests__/write-verifier.test.ts +0 -122
|
@@ -1,319 +0,0 @@
|
|
|
1
|
-
import { describe, expect, it } from "bun:test";
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
assessContinuityBaseline,
|
|
5
|
-
assessScopeInventoryReport,
|
|
6
|
-
describeSecretPresence,
|
|
7
|
-
formatDoctorResults,
|
|
8
|
-
loadContinuityBaselineEntries,
|
|
9
|
-
} from "../doctor.js";
|
|
10
|
-
import type { MemoryEntry } from "../store.js";
|
|
11
|
-
|
|
12
|
-
function buildEntry(
|
|
13
|
-
id: string,
|
|
14
|
-
category: MemoryEntry["category"],
|
|
15
|
-
text: string,
|
|
16
|
-
scope: string,
|
|
17
|
-
metadata: Record<string, unknown> = {},
|
|
18
|
-
): MemoryEntry {
|
|
19
|
-
return {
|
|
20
|
-
id,
|
|
21
|
-
text,
|
|
22
|
-
vector: [],
|
|
23
|
-
category,
|
|
24
|
-
scope,
|
|
25
|
-
importance: 0.8,
|
|
26
|
-
timestamp: Date.parse("2026-03-17T00:00:00.000Z"),
|
|
27
|
-
metadata: JSON.stringify(metadata),
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
describe("assessContinuityBaseline", () => {
|
|
32
|
-
it("reports full coverage when all canonical continuity seeds are present", () => {
|
|
33
|
-
const seeds = {
|
|
34
|
-
patterns: [
|
|
35
|
-
{
|
|
36
|
-
title: "Cross-window continuity handoff",
|
|
37
|
-
trigger: "When opening a fresh terminal window",
|
|
38
|
-
steps: ["Call resume_context before coding."],
|
|
39
|
-
outcome: "Fresh windows recover stable context.",
|
|
40
|
-
tools: ["resume_context"],
|
|
41
|
-
importance: 0.9,
|
|
42
|
-
source: "agent",
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
cases: [
|
|
46
|
-
{
|
|
47
|
-
title: "Continuity eval checkpoint isolation",
|
|
48
|
-
problem: "Eval reads live checkpoints.",
|
|
49
|
-
solutionSteps: ["Use fixture checkpoints instead."],
|
|
50
|
-
outcome: "Continuity eval becomes deterministic.",
|
|
51
|
-
tools: ["eval:continuity"],
|
|
52
|
-
source: "agent",
|
|
53
|
-
scope: "recallnest",
|
|
54
|
-
importance: 0.85,
|
|
55
|
-
},
|
|
56
|
-
],
|
|
57
|
-
memories: [
|
|
58
|
-
{
|
|
59
|
-
text: "RecallNest is the shared memory layer for Claude Code, Codex, and Gemini CLI.",
|
|
60
|
-
category: "entities",
|
|
61
|
-
scope: "recallnest",
|
|
62
|
-
source: "agent",
|
|
63
|
-
importance: 0.9,
|
|
64
|
-
canonicalKey: "entities:recallnest:shared-memory-layer",
|
|
65
|
-
},
|
|
66
|
-
],
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
const entries: MemoryEntry[] = [
|
|
70
|
-
buildEntry(
|
|
71
|
-
"pattern-1",
|
|
72
|
-
"patterns",
|
|
73
|
-
"Workflow pattern: Cross-window continuity handoff",
|
|
74
|
-
"memory:agent",
|
|
75
|
-
{ workflowPattern: { title: "Cross-window continuity handoff" } },
|
|
76
|
-
),
|
|
77
|
-
buildEntry(
|
|
78
|
-
"case-1",
|
|
79
|
-
"cases",
|
|
80
|
-
"Case: Continuity eval checkpoint isolation",
|
|
81
|
-
"recallnest",
|
|
82
|
-
{ caseMemory: { title: "Continuity eval checkpoint isolation" } },
|
|
83
|
-
),
|
|
84
|
-
buildEntry(
|
|
85
|
-
"memory-1",
|
|
86
|
-
"entities",
|
|
87
|
-
"RecallNest is the shared memory layer for Claude Code, Codex, and Gemini CLI.",
|
|
88
|
-
"recallnest",
|
|
89
|
-
{ canonicalKey: "entities:recallnest:shared-memory-layer" },
|
|
90
|
-
),
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
const assessment = assessContinuityBaseline(entries, seeds as any);
|
|
94
|
-
|
|
95
|
-
expect(assessment.found).toEqual({ patterns: 1, cases: 1, memories: 1 });
|
|
96
|
-
expect(assessment.missing).toEqual({ patterns: [], cases: [], memories: [] });
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it("reports missing canonical seeds by category", () => {
|
|
100
|
-
const seeds = {
|
|
101
|
-
patterns: [
|
|
102
|
-
{
|
|
103
|
-
title: "Recall before repo exploration",
|
|
104
|
-
trigger: "When startup context is sparse",
|
|
105
|
-
steps: ["Run search_memory before local repo exploration."],
|
|
106
|
-
outcome: "Fresh windows recover task-specific continuity.",
|
|
107
|
-
tools: ["resume_context", "search_memory"],
|
|
108
|
-
importance: 0.9,
|
|
109
|
-
source: "agent",
|
|
110
|
-
},
|
|
111
|
-
],
|
|
112
|
-
cases: [
|
|
113
|
-
{
|
|
114
|
-
title: "RecallNest scope fallback cleanup",
|
|
115
|
-
problem: "Project continuity prefers raw transcript notes.",
|
|
116
|
-
solutionSteps: ["Prefer durable cases and patterns."],
|
|
117
|
-
outcome: "Stable project continuity becomes cleaner.",
|
|
118
|
-
tools: ["resume_context"],
|
|
119
|
-
source: "agent",
|
|
120
|
-
scope: "recallnest",
|
|
121
|
-
importance: 0.85,
|
|
122
|
-
},
|
|
123
|
-
],
|
|
124
|
-
memories: [
|
|
125
|
-
{
|
|
126
|
-
text: "RecallNest continuity revolves around three primitives.",
|
|
127
|
-
category: "entities",
|
|
128
|
-
scope: "recallnest",
|
|
129
|
-
source: "agent",
|
|
130
|
-
importance: 0.9,
|
|
131
|
-
canonicalKey: "entities:recallnest:continuity-primitives",
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
const entries: MemoryEntry[] = [
|
|
137
|
-
buildEntry(
|
|
138
|
-
"pattern-1",
|
|
139
|
-
"patterns",
|
|
140
|
-
"Workflow pattern: Cross-window continuity handoff",
|
|
141
|
-
"memory:agent",
|
|
142
|
-
{ workflowPattern: { title: "Cross-window continuity handoff" } },
|
|
143
|
-
),
|
|
144
|
-
];
|
|
145
|
-
|
|
146
|
-
const assessment = assessContinuityBaseline(entries, seeds as any);
|
|
147
|
-
|
|
148
|
-
expect(assessment.found).toEqual({ patterns: 0, cases: 0, memories: 0 });
|
|
149
|
-
expect(assessment.missing.patterns).toEqual(["Recall before repo exploration"]);
|
|
150
|
-
expect(assessment.missing.cases).toEqual(["RecallNest scope fallback cleanup"]);
|
|
151
|
-
expect(assessment.missing.memories).toEqual(["entities:recallnest:continuity-primitives"]);
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it("loads enough entries for baseline checks when the index is larger than the legacy 5000-entry window", async () => {
|
|
155
|
-
const targetEntry = buildEntry(
|
|
156
|
-
"pattern-target",
|
|
157
|
-
"patterns",
|
|
158
|
-
"Workflow pattern: RecallNest MCP transport rollout",
|
|
159
|
-
"project:recallnest",
|
|
160
|
-
{ workflowPattern: { title: "RecallNest MCP transport rollout" } },
|
|
161
|
-
);
|
|
162
|
-
const entries: MemoryEntry[] = [
|
|
163
|
-
...Array.from({ length: 5000 }, (_, index) => buildEntry(
|
|
164
|
-
`noise-${index}`,
|
|
165
|
-
"patterns",
|
|
166
|
-
`Workflow pattern: Noise ${index}`,
|
|
167
|
-
"memory:agent",
|
|
168
|
-
{ workflowPattern: { title: `Noise ${index}` } },
|
|
169
|
-
)),
|
|
170
|
-
targetEntry,
|
|
171
|
-
];
|
|
172
|
-
const listCalls: Array<[string[] | undefined, string | undefined, number | undefined, number | undefined]> = [];
|
|
173
|
-
const store = {
|
|
174
|
-
async list(scopeFilter?: string[], category?: string, limit = 20, offset = 0): Promise<MemoryEntry[]> {
|
|
175
|
-
listCalls.push([scopeFilter, category, limit, offset]);
|
|
176
|
-
return entries.slice(offset, offset + limit);
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
const loaded = await loadContinuityBaselineEntries(store as any, entries.length);
|
|
181
|
-
const assessment = assessContinuityBaseline(loaded, {
|
|
182
|
-
patterns: [
|
|
183
|
-
{
|
|
184
|
-
title: "RecallNest MCP transport rollout",
|
|
185
|
-
trigger: "When RecallNest continuity work touches MCP transport wiring under project scope",
|
|
186
|
-
steps: ["Call resume_context with project:recallnest before transport changes."],
|
|
187
|
-
outcome: "RecallNest transport changes stay project-scoped.",
|
|
188
|
-
tools: ["resume_context", "search_memory", "eval:continuity"],
|
|
189
|
-
source: "agent",
|
|
190
|
-
scope: "project:recallnest",
|
|
191
|
-
importance: 0.87,
|
|
192
|
-
},
|
|
193
|
-
],
|
|
194
|
-
cases: [],
|
|
195
|
-
memories: [],
|
|
196
|
-
} as any);
|
|
197
|
-
|
|
198
|
-
expect(listCalls).toEqual([[undefined, undefined, 5001, 0]]);
|
|
199
|
-
expect(assessment.found.patterns).toBe(1);
|
|
200
|
-
expect(assessment.missing.patterns).toEqual([]);
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
|
|
204
|
-
describe("assessScopeInventoryReport", () => {
|
|
205
|
-
it("reports a clean scope inventory when no unresolved anomalies remain", () => {
|
|
206
|
-
const result = assessScopeInventoryReport({
|
|
207
|
-
generatedAt: "2026-03-19T08:20:00.000Z",
|
|
208
|
-
sampleLimit: 5,
|
|
209
|
-
totalScannedCount: 42,
|
|
210
|
-
totalAnomalyCount: 0,
|
|
211
|
-
totalInvalidCount: 0,
|
|
212
|
-
totalReviewedCount: 1,
|
|
213
|
-
layers: [
|
|
214
|
-
{
|
|
215
|
-
layer: "memories",
|
|
216
|
-
scannedCount: 40,
|
|
217
|
-
anomalyCount: 0,
|
|
218
|
-
invalidCount: 0,
|
|
219
|
-
reviewedCount: 0,
|
|
220
|
-
counts: { missing: 0, empty: 0, global: 0 },
|
|
221
|
-
samples: [],
|
|
222
|
-
recommendation: "ok",
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
layer: "workflow-observations",
|
|
226
|
-
scannedCount: 2,
|
|
227
|
-
anomalyCount: 0,
|
|
228
|
-
invalidCount: 0,
|
|
229
|
-
reviewedCount: 1,
|
|
230
|
-
counts: { missing: 0, empty: 0, global: 0 },
|
|
231
|
-
samples: [],
|
|
232
|
-
recommendation: "ok",
|
|
233
|
-
},
|
|
234
|
-
],
|
|
235
|
-
});
|
|
236
|
-
|
|
237
|
-
expect(result).toEqual({
|
|
238
|
-
name: "Scope inventory",
|
|
239
|
-
status: "pass",
|
|
240
|
-
message: "0 unresolved anomalies across 42 records; reviewed keeps 1",
|
|
241
|
-
});
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
it("warns when scope inventory still has unresolved anomalies or invalid files", () => {
|
|
245
|
-
const result = assessScopeInventoryReport({
|
|
246
|
-
generatedAt: "2026-03-19T08:20:00.000Z",
|
|
247
|
-
sampleLimit: 5,
|
|
248
|
-
totalScannedCount: 12,
|
|
249
|
-
totalAnomalyCount: 2,
|
|
250
|
-
totalInvalidCount: 1,
|
|
251
|
-
totalReviewedCount: 0,
|
|
252
|
-
layers: [
|
|
253
|
-
{
|
|
254
|
-
layer: "pins",
|
|
255
|
-
scannedCount: 4,
|
|
256
|
-
anomalyCount: 1,
|
|
257
|
-
invalidCount: 0,
|
|
258
|
-
reviewedCount: 0,
|
|
259
|
-
counts: { missing: 0, empty: 0, global: 1 },
|
|
260
|
-
samples: [{
|
|
261
|
-
layer: "pins",
|
|
262
|
-
id: "pin-legacy-1234",
|
|
263
|
-
kind: "global",
|
|
264
|
-
scope: "global",
|
|
265
|
-
context: "pin",
|
|
266
|
-
preview: "Legacy pin",
|
|
267
|
-
recordedAt: "2026-03-19T08:00:00.000Z",
|
|
268
|
-
}],
|
|
269
|
-
recommendation: "re-pin",
|
|
270
|
-
},
|
|
271
|
-
{
|
|
272
|
-
layer: "workflow-observations",
|
|
273
|
-
scannedCount: 8,
|
|
274
|
-
anomalyCount: 1,
|
|
275
|
-
invalidCount: 1,
|
|
276
|
-
reviewedCount: 0,
|
|
277
|
-
counts: { missing: 1, empty: 0, global: 0 },
|
|
278
|
-
samples: [],
|
|
279
|
-
recommendation: "review",
|
|
280
|
-
},
|
|
281
|
-
],
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
expect(result.status).toBe("warn");
|
|
285
|
-
expect(result.name).toBe("Scope inventory");
|
|
286
|
-
expect(result.message).toContain("2 unresolved anomalies, 1 invalid file(s) across 12 records");
|
|
287
|
-
expect(result.message).toContain("pins:1");
|
|
288
|
-
expect(result.message).toContain("workflow-observations:1 invalid 1");
|
|
289
|
-
expect(result.message).toContain("sample pins:global:pin-lega");
|
|
290
|
-
expect(result.fix).toBe("bun run scope-inventory");
|
|
291
|
-
});
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
describe("formatDoctorResults", () => {
|
|
295
|
-
it("does not claim all clear when warnings are present", () => {
|
|
296
|
-
const output = formatDoctorResults([
|
|
297
|
-
{ name: "Bun runtime", status: "pass", message: "ok" },
|
|
298
|
-
{ name: "Scope inventory", status: "warn", message: "1 unresolved anomaly", fix: "bun run scope-inventory" },
|
|
299
|
-
]);
|
|
300
|
-
|
|
301
|
-
expect(output).toContain("Review the ⚠️ items above before relying on this environment as a clean baseline.");
|
|
302
|
-
expect(output).not.toContain("All clear.");
|
|
303
|
-
});
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
describe("describeSecretPresence", () => {
|
|
307
|
-
it("reports only presence and never includes the configured value", () => {
|
|
308
|
-
const secret = "sensitive-value-that-must-not-appear";
|
|
309
|
-
const message = describeSecretPresence(secret, "placeholder");
|
|
310
|
-
|
|
311
|
-
expect(message).toBe("set");
|
|
312
|
-
expect(message).not.toContain(secret);
|
|
313
|
-
});
|
|
314
|
-
|
|
315
|
-
it("does not treat an absent or placeholder value as configured", () => {
|
|
316
|
-
expect(describeSecretPresence(undefined, "placeholder")).toBeNull();
|
|
317
|
-
expect(describeSecretPresence("placeholder", "placeholder")).toBeNull();
|
|
318
|
-
});
|
|
319
|
-
});
|