Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/agentctx/src/consolidate/digest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export function buildDigestSections(
const prefs = currentRecords(
db,
GLOBAL_PROJECT_ID,
"type = 'preference' AND confidence != 'inferred'",
"type = 'preference' AND confidence = 'reinforced'",
"score DESC, recorded_at DESC",
);
if (prefs.length > 0) {
Expand Down
9 changes: 9 additions & 0 deletions packages/agentctx/test/consolidate/run.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ describe("agentctx consolidate", () => {
body: "not yet reinforced",
confidence: "inferred",
});
seed({
projectId: GLOBAL_PROJECT_ID,
scope: "global",
type: "preference",
title: "Explicit but not reinforced preference",
body: "explicit only",
confidence: "explicit",
});

expect(await runConsolidate(t.env)).toBe(0);

Expand All @@ -144,6 +152,7 @@ describe("agentctx consolidate", () => {
expect(digest?.sections.handover).toContain("extraction pipeline");
expect(digest?.sections.globalPreferences).toContain("Prefers arrow functions");
expect(digest?.sections.globalPreferences).not.toContain("Unproven");
expect(digest?.sections.globalPreferences).not.toContain("Explicit but not reinforced");
expect(digest?.sections.mcpHint).toContain("ctx_search");

const total = Object.values(digest?.sections ?? {}).reduce(
Expand Down
Loading