Skip to content

Commit 9fd52a5

Browse files
Stephen ChristiansenStephen Christiansen
authored andcommitted
fix(memory-wiki): preserve hash through evidence normalization + update test contract
1 parent 961afed commit 9fd52a5

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎extensions/memory-wiki/src/markdown.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export type WikiClaimEvidence = {
2828
privacyTier?: string;
2929
note?: string;
3030
updatedAt?: string;
31+
hash?: string;
3132
};
3233

3334
export type WikiClaim = {
@@ -209,6 +210,7 @@ function normalizeWikiClaimEvidence(value: unknown): WikiClaimEvidence | null {
209210
const weight =
210211
typeof record.weight === "number" && Number.isFinite(record.weight) ? record.weight : undefined;
211212
const confidence = normalizeOptionalNumber(record.confidence);
213+
const hash = normalizeOptionalString(record.hash);
212214
if (
213215
!kind &&
214216
!sourceId &&
@@ -218,7 +220,8 @@ function normalizeWikiClaimEvidence(value: unknown): WikiClaimEvidence | null {
218220
weight === undefined &&
219221
confidence === undefined &&
220222
!privacyTier &&
221-
!updatedAt
223+
!updatedAt &&
224+
!hash
222225
) {
223226
return null;
224227
}
@@ -232,6 +235,7 @@ function normalizeWikiClaimEvidence(value: unknown): WikiClaimEvidence | null {
232235
...(privacyTier ? { privacyTier } : {}),
233236
...(note ? { note } : {}),
234237
...(updatedAt ? { updatedAt } : {}),
238+
...(hash ? { hash } : {}),
235239
};
236240
}
237241

‎extensions/memory-wiki/src/tool.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe("memory-wiki tools", () => {
2222

2323
expect(Object.keys(evidenceProperties).toSorted()).toEqual([
2424
"confidence",
25+
"hash",
2526
"kind",
2627
"lines",
2728
"note",

0 commit comments

Comments
 (0)