|
| 1 | +import type { LongTermMemoryEntry } from "../../src/types.ts"; |
| 2 | + |
| 3 | +const now = "2026-04-28T00:00:00.000Z"; |
| 4 | + |
| 5 | +function mem( |
| 6 | + id: string, |
| 7 | + type: LongTermMemoryEntry["type"], |
| 8 | + text: string, |
| 9 | + source: LongTermMemoryEntry["source"] = "compaction", |
| 10 | +): LongTermMemoryEntry { |
| 11 | + return { |
| 12 | + id, |
| 13 | + type, |
| 14 | + text, |
| 15 | + source, |
| 16 | + confidence: source === "explicit" ? 1 : 0.75, |
| 17 | + status: "active", |
| 18 | + createdAt: now, |
| 19 | + updatedAt: now, |
| 20 | + }; |
| 21 | +} |
| 22 | + |
| 23 | +export const reviewerCurrent28Fixture: LongTermMemoryEntry[] = [ |
| 24 | + // High-value durable entries. These should survive. |
| 25 | + mem("good_feedback_language", "feedback", "User prefers architecture reviews in Traditional Chinese", "explicit"), |
| 26 | + mem("good_feedback_direct", "feedback", "User wants direct architecture feedback with concrete file paths", "explicit"), |
| 27 | + mem("good_feedback_no_manual_cleanup", "feedback", "User prefers automatic memory cleanup over manual cleanup instructions", "explicit"), |
| 28 | + mem("good_decision_no_extra_api", "decision", "Do not add extra LLM API calls for memory consolidation"), |
| 29 | + mem("good_decision_no_semantic_merge", "decision", "Memory dedupe must use exact canonical keys and generic URL/path identity only"), |
| 30 | + mem("good_decision_no_render_tracking", "decision", "Do not use rendered-memory access tracking as evidence"), |
| 31 | + mem("good_reference_frozen", "reference", "Workspace memory is rendered as a frozen system[1] snapshot; pending memories remain in hot session state until compaction"), |
| 32 | + mem("good_project_plugin", "project", "The project is an OpenCode plugin using TypeScript and local JSON stores"), |
| 33 | + mem("good_reference_accounting", "reference", "Promotion accounting reports promoted, absorbed, superseded, and rejected outcomes"), |
| 34 | + |
| 35 | + // Pseudo feedback/decision/progress snapshots. These should be superseded/rejected. |
| 36 | + mem("bad_feedback_wave_done", "feedback", "Wave 1 completed successfully and all tests passed"), |
| 37 | + mem("bad_feedback_plan_done", "feedback", "Plan 1 critical stability fixes were implemented"), |
| 38 | + mem("bad_feedback_session_note", "feedback", "The assistant reviewed the code reviewer feedback and updated the plan"), |
| 39 | + mem("bad_feedback_impl_note", "feedback", "Implemented owner-aware pending journal cleanup in plugin.ts"), |
| 40 | + mem("bad_decision_commit", "decision", "Commit 53aa6d3 completed consolidation accounting"), |
| 41 | + mem("bad_decision_tests", "decision", "180 tests pass and 0 tests fail after the latest change"), |
| 42 | + mem("bad_decision_pr_status", "decision", "PR1 is done and PR2 is ready to start"), |
| 43 | + mem("bad_project_files", "project", "Modified src/plugin.ts src/workspace-memory.ts src/pending-journal.ts during the last wave"), |
| 44 | + mem("bad_project_wave", "project", "Wave 3 finished after cache bounds and Bearer redaction were added"), |
| 45 | + mem("bad_reference_commit", "reference", "Commit a762e86 contains the owner scope fix"), |
| 46 | + mem("bad_reference_ci", "reference", "CI compatibility run 25033906652 passed"), |
| 47 | + mem("bad_reference_error", "reference", "TypeError: Cannot read properties of undefined"), |
| 48 | + mem("bad_project_current", "project", "Currently running npm test before continuing"), |
| 49 | + |
| 50 | + // Borderline implementation facts. Reject unless they are written as future rules. |
| 51 | + mem("bad_decision_impl_detail", "decision", "dedupeLongTermEntriesWithAccounting was updated in the previous session"), |
| 52 | + mem("bad_feedback_internal", "feedback", "The migration writes to disk when redaction changes content"), |
| 53 | + mem("bad_reference_tmp", "reference", "storage.test.ts had a flaky cross-process test in CI"), |
| 54 | + |
| 55 | + // Durable future-facing rules. These should survive. |
| 56 | + mem("good_decision_quality", "decision", "Reject completion and progress statements before storing compaction memory candidates"), |
| 57 | + mem("good_decision_quality_shared", "decision", "Use one shared memory quality gate for extraction and migration"), |
| 58 | + mem("good_reference_quality_migration", "reference", "Quality cleanup migration supersedes low-quality compaction memories and does not touch explicit memories"), |
| 59 | +]; |
| 60 | + |
| 61 | +export const expectedAcceptedFixtureIds = new Set([ |
| 62 | + "good_feedback_language", |
| 63 | + "good_feedback_direct", |
| 64 | + "good_feedback_no_manual_cleanup", |
| 65 | + "good_decision_no_extra_api", |
| 66 | + "good_decision_no_semantic_merge", |
| 67 | + "good_decision_no_render_tracking", |
| 68 | + "good_reference_frozen", |
| 69 | + "good_project_plugin", |
| 70 | + "good_reference_accounting", |
| 71 | + "good_decision_quality", |
| 72 | + "good_decision_quality_shared", |
| 73 | + "good_reference_quality_migration", |
| 74 | +]); |
0 commit comments