chore: remove forget extension
51b2c89b6a8337845484b12a68b1fc57714f3a3a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
- Parent 1: bebe40e3e7cb
bugabingas pi extensions
51b2c89b6a8337845484b12a68b1fc57714f3a3a
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
+0 / −962 text lines
+0 / −1 text lines
| `devil` | Structured `/devil` stress test against a devil's advocate and defender. | [README](extensions/devil/README.md) || `diff-review` | Browser UI for reviewing git diffs and sending findings back to Pi. | [README](extensions/diff-review/README.md) || `forget` | Experimental active-context forgetting tool for Pi. | [README](extensions/forget/README.md) |deleted file mode 100644+0 / −8 text lines
deleted file mode 100644+0 / −74 text lines
# forget planExperimental goal:let the model manage stale active context in long mixed-task sessions with onesmall prefix-cut API.## SDK constraints- Pi session files are append-only. Entries cannot be modified or physically deleted through `SessionManager`.- Active context can still be changed safely by adding a compaction entry. `appendCompaction(summary, firstKeptEntryId, tokensBefore, details, fromHook)` makes `buildSessionContext()` emit the summary, then branch messages from `firstKeptEntryId` onward.- Recent tail deletion is already covered by Pi tree navigation/forking. It is out of scope for Forget.- Middle deletion is not supported without replaying or filtering the transcript. Replay breaks IDs/tool-call adjacency; per-turn filtering is fragile and not a persistent session edit.## Design- Tool: `forget(target?, reason?)` - `target="current_user"`: keep the latest user request onward; drop older active context. - `target="previous_user"`: keep the immediately previous user request onward; drop older active context. - omitted `target` defaults to `current_user`.- Per-prompt system reminder: short turn-local line tells the agent to consider Forget in long mixed-task sessions and skip when prior context may still be needed.- Guardrails: - no entry IDs exposed to the model. - no inspect/debug/status tool. - no ranges or holes. - target must resolve to a user message on the active branch. - no physical deletion claim; JSONL keeps recoverable history. - not a secret-redaction guarantee; newer/current messages and model thinking can still contain sensitive strings.## Real-provider learnings- Long-session probes showed `previous_user` is useful for preserving immediate setup while dropping older task context.- Kimi and OpenAI used the API best in long mixed-task sessions.- Z.ai used it aggressively but still gained context cleanup.- MiniMax often ignored the tool; that is acceptable for weak-tool models.- `inspect`, raw entry IDs, `status`, and `user:<offset>` added complexity without reliable model gains.## Tests- Unit: target normalization, user-boundary resolution, terse errors, tombstone summary.- Harness: extension loads, tool registers, reminder injects, `current_user` and `previous_user` create compactions with expected `firstKeptEntryId`, context drops old text, invalid targets fail tersely.- Real MiniMax: optional `FORGET_REAL=1`; runs isolated SDK session with only Forget loaded, calls the tool directly, verifies compaction is active.## Manual test```bashcd extensions/forgetbun testFORGET_REAL=1 bun run test:realpi -e ./index.ts --model kimi-coding/kimi-for-coding```deleted file mode 100644+0 / −62 text lines
# forgetExperimental active-context forgetting for Pi.## Install / loadLoaded through the root `pi-ext` package.See [root README](../../README.md).## Commands / tools / settingsCommands:none.Tools:- `forget`: drops older active context before `current_user` or `previous_user`.Settings:none.Hooks/events:- `before_agent_start`: injects one short reminder so the agent considers Forget in long mixed-task sessions.## Behavior`forget` appends a Pi compaction entry. Active LLM context becomes:1. a short tombstone summary saying prior context was intentionally forgotten;2. branch messages from the chosen user boundary onward;3. future messages.Targets:- `current_user`: keep the latest user request onward. Use for independent new tasks.- `previous_user`: keep the immediately previous user request onward. Use when the latest request depends on immediate setup but older context is stale.If `target` is omitted, `current_user` is used.History is not physically deleted from the JSONL session file.It is removed from the active context path by Pi compaction semantics and can berecovered through tree/session history.Forget is a context-budget tool, not a secrecy/redaction tool.If sensitive text appears in the current request, assistant reasoning, toolresults, or later messages, Forget cannot remove that newer span without alsodropping the newer branch.Middle deletion is intentionally unsupported.Pi sessions are append-only, so Forget only performs prefix cuts.The injected reminder is turn-local system prompt text, not a stored remindermessage.It costs a short line each turn but does not accumulate inside the sessiontranscript.deleted file mode 100644+0 / −147 text lines
import { afterEach, describe, expect, it } from "vitest";import path from "node:path";import { createTestSession, type TestSession,} from "@marcfargas/pi-test-harness";let t: TestSession | undefined;afterEach(() => { t?.dispose(); t = undefined;});function forgetPath(): string { return path.resolve(import.meta.dir, "../index.ts");}function textOf(result: any): string { return result.content .map((part: { text?: string }) => part.text ?? "") .join("\n");}async function callForget(params: Record<string, unknown>) { const tool = t!.session.extensionRunner.getToolDefinition("forget"); return tool.execute( "call-1", params, undefined, undefined, t!.session.extensionRunner.createContext(), );}describe("forget harness integration", () => { it("loads and registers only the forget tool", async () => { t = await createTestSession({ extensions: [forgetPath()] }); const [extension] = t.session.extensionRunner.extensions; expect([...extension.tools.keys()]).toContain("forget"); expect([...extension.commands.keys()]).toEqual([]); }); it("current_user appends compaction and drops older active context", async () => { t = await createTestSession({ extensions: [forgetPath()] }); t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "OLD_SECRET_DO_NOT_KEEP" }], }); const keep = t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "new safe request" }], }); t.session.sessionManager.appendMessage({ role: "assistant", content: [{ type: "text", text: "safe answer" }], }); const result = await callForget({ target: "current_user", reason: "new task", }); expect(textOf(result)).toContain("done. kept=current_user"); const compaction = t.session.sessionManager .getEntries() .find((entry: any) => entry.type === "compaction") as any; expect(compaction).toBeTruthy(); expect(compaction.firstKeptEntryId).toBe(keep); expect(compaction.fromHook).toBe(true); expect(compaction.details).toMatchObject({ kind: "forget", version: 2, target: "current_user", keptFromEntryId: keep, reason: "new task", }); expect(compaction.details.forgottenBefore).toBeGreaterThan(0); const context = (t.session.sessionManager as any).buildSessionContext(); const serialized = JSON.stringify(context.messages); expect(serialized).toContain("[Forget]"); expect(serialized).toContain("new safe request"); expect(serialized).toContain("safe answer"); expect(serialized).not.toContain("OLD_SECRET_DO_NOT_KEEP"); }); it("previous_user keeps immediate setup and drops older context", async () => { t = await createTestSession({ extensions: [forgetPath()] }); t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "OLD_ARCHIVE" }], }); t.session.sessionManager.appendMessage({ role: "assistant", content: [{ type: "text", text: "ok" }], }); const setup = t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "SETUP_KEEP_ME" }], }); t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "continue setup" }], }); const result = await callForget({ target: "previous_user" }); expect(textOf(result)).toContain("done. kept=previous_user"); const compaction = t.session.sessionManager .getEntries() .find((entry: any) => entry.type === "compaction") as any; expect(compaction.firstKeptEntryId).toBe(setup); expect(compaction.details.target).toBe("previous_user"); const context = (t.session.sessionManager as any).buildSessionContext(); const serialized = JSON.stringify(context.messages); expect(serialized).toContain("SETUP_KEEP_ME"); expect(serialized).toContain("continue setup"); expect(serialized).not.toContain("OLD_ARCHIVE"); }); it("returns terse errors and no-op when no safe cut exists", async () => { t = await createTestSession({ extensions: [forgetPath()] }); const bad = await callForget({ target: "user:2" }); expect(bad.isError).toBe(true); expect(textOf(bad)).toBe("bad_target. use current_user or previous_user"); t.session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "first" }], }); const previous = await callForget({ target: "previous_user" }); expect(previous.isError).toBe(true); expect(textOf(previous)).toBe( "no_boundary. no previous user; use current_user or skip", ); const current = await callForget({ target: "current_user" }); expect(textOf(current)).toBe("already_first. nothing to forget"); expect( t.session.sessionManager .getEntries() .some((entry: any) => entry.type === "compaction"), ).toBe(false); });});deleted file mode 100644+0 / −105 text lines
import { describe, expect, it } from "vitest";import fs from "node:fs";import os from "node:os";import path from "node:path";import { getModel } from "@earendil-works/pi-ai";import { AuthStorage, createAgentSession, DefaultResourceLoader, ModelRegistry, SessionManager, SettingsManager,} from "@earendil-works/pi-coding-agent";const real = process.env.FORGET_REAL === "1";const d = real ? describe : describe.skip;function textOf(result: any): string { return result.content .map((part: { text?: string }) => part.text ?? "") .join("\n");}d("real MiniMax integration", () => { it("runs isolated SDK session then forgets older active context", async () => { const temp = fs.mkdtempSync(path.join(os.tmpdir(), "forget-real-")); const cwd = path.join(temp, "cwd"); const agentDir = path.join(temp, "agent"); fs.mkdirSync(cwd, { recursive: true }); fs.mkdirSync(agentDir, { recursive: true }); const forgetPath = path.resolve(import.meta.dir, "../../index.ts"); const settingsManager = SettingsManager.inMemory({ defaultProvider: "minimax", defaultModel: "MiniMax-M2.7-highspeed", defaultThinkingLevel: "off", }); const loader = new DefaultResourceLoader({ cwd, agentDir, settingsManager, noExtensions: true, noSkills: true, noPromptTemplates: true, noThemes: true, noContextFiles: true, additionalExtensionPaths: [forgetPath], }); await loader.reload(); const authStorage = AuthStorage.create(); const modelRegistry = ModelRegistry.create(authStorage); const model = getModel("minimax", "MiniMax-M2.7-highspeed"); const { session, extensionsResult } = await createAgentSession({ cwd, agentDir, authStorage, modelRegistry, model, thinkingLevel: "off", sessionManager: SessionManager.inMemory(), settingsManager, resourceLoader: loader, noTools: "all", }); try { expect(extensionsResult.extensions.map((e) => e.path)).toEqual([ forgetPath, ]); await session.prompt("Reply exactly OK. Remember OLD_REAL_SECRET_TOKEN."); await session.agent.waitForIdle(); const keep = session.sessionManager.appendMessage({ role: "user", content: [{ type: "text", text: "New safe context starts here." }], }); const tool = session.extensionRunner.getToolDefinition("forget"); const result = await tool.execute( "real-call-1", { target: "current_user", reason: "new task" }, undefined, undefined, session.extensionRunner.createContext(), ); expect(textOf(result)).toContain("done. kept=current_user"); const compaction = session.sessionManager .getEntries() .find((entry: any) => entry.type === "compaction") as any; expect(compaction.firstKeptEntryId).toBe(keep); expect(compaction.details.target).toBe("current_user"); const context = (session.sessionManager as any).buildSessionContext(); const serialized = JSON.stringify(context.messages); expect(serialized).toContain("New safe context starts here"); expect(serialized).not.toContain("OLD_REAL_SECRET_TOKEN"); } finally { session.dispose(); fs.rmSync(temp, { recursive: true, force: true }); } }, 120000);});deleted file mode 100644+0 / −157 text lines
import { describe, expect, test } from "vitest";import forgetExtension, { __test } from "../index.ts";const { entryPreview, forgetSummary, normalizeTarget, REMINDER, renderForgetCall, renderForgetResult, resolveTarget, userIndexes,} = __test;const theme = { bold: (text: string) => text, fg: (_tone: string, text: string) => text,};function rendered(component: { render(width: number): string[] }) { return component.render(120).join("\n");}function msg(id: string, role: string, text: string) { return { type: "message", id, parentId: null, timestamp: "", message: { role, content: text }, };}describe("forget pure helpers", () => { test("registers short before-agent reminder", () => { const handlers = new Map<string, any>(); forgetExtension({ on: (name: string, handler: unknown) => handlers.set(name, handler), registerTool: () => undefined, } as never); const handler = handlers.get("before_agent_start"); const result = handler({ systemPrompt: "base" }); expect(result.systemPrompt).toContain(REMINDER); expect(REMINDER).toContain("current_user"); expect(REMINDER).toContain("previous_user"); }); test("normalizes model-friendly target aliases", () => { expect(normalizeTarget(undefined)).toBe("current_user"); expect(normalizeTarget("")).toBe("current_user"); expect(normalizeTarget("current")).toBe("current_user"); expect(normalizeTarget("user:0")).toBe("current_user"); expect(normalizeTarget("prev")).toBe("previous_user"); expect(normalizeTarget("user:1")).toBe("previous_user"); expect(normalizeTarget("user:2")).toBeUndefined(); }); test("finds user boundaries", () => { const branch = [ msg("u1", "user", "one"), msg("a1", "assistant", "two"), msg("u2", "user", "three"), ]; expect(userIndexes(branch)).toEqual([0, 2]); }); test("resolves current and previous user prefix cuts", () => { const branch = [ msg("u1", "user", "old"), msg("a1", "assistant", "answer"), msg("u2", "user", "new"), msg("a2", "assistant", "answer"), ]; const current = resolveTarget(branch); expect(current).toMatchObject({ ok: true, target: "current_user", offset: 0, index: 2, }); expect(current.entry?.id).toBe("u2"); const previous = resolveTarget(branch, "previous_user"); expect(previous).toMatchObject({ ok: true, target: "previous_user", offset: 1, index: 0, }); expect(previous.entry?.id).toBe("u1"); }); test("returns terse errors for bad or missing boundaries", () => { expect(resolveTarget([], "wat")).toMatchObject({ ok: false, code: "bad_target", hint: "use current_user or previous_user", }); expect( resolveTarget([msg("u1", "user", "one")], "previous_user"), ).toMatchObject({ ok: false, code: "no_boundary", hint: "no previous user; use current_user or skip", }); }); test("forget summary is explicit tombstone not hidden data", () => { const branch = [msg("u1", "user", "secret")]; const resolution = resolveTarget(branch); const summary = forgetSummary(resolution, "new task"); expect(summary).toContain("intentionally removed"); expect(summary).toContain("current_user"); expect(summary).toContain("u1"); expect(summary).toContain("new task"); expect(summary).not.toContain("secret"); }); test("renders call and result with kept context preview", () => { const branch = [msg("u1", "user", "keep this setup text")]; const resolution = resolveTarget(branch); const preview = entryPreview(resolution.entry); expect(preview).toBe("keep this setup text"); const call = rendered( renderForgetCall( { target: "previous_user", reason: "new direction" }, theme, ), ); expect(call).toContain("forget previous_user"); expect(call).toContain("new direction"); const result = rendered( renderForgetResult( { content: [{ type: "text", text: "done" }], details: { target: "current_user", keptPreview: preview, keptFromEntryId: "u1", forgottenBefore: 4, reason: "new direction", compactionId: "c1", }, }, { expanded: true }, theme, ), ); expect(result).toContain("kept current_user"); expect(result).toContain("dropped 4 entries"); expect(result).toContain("keep this setup text"); expect(result).toContain("compaction: c1"); });});deleted file mode 100644+0 / −364 text lines
import { StringEnum } from "@earendil-works/pi-ai";import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";import { Text } from "@earendil-works/pi-tui";import { Type } from "typebox";const TOOL = "forget";const DETAILS_KIND = "forget";const REMINDER = "Context hygiene: use forget for safe prefix cuts in long mixed-task sessions. current_user=new task; previous_user=keep immediate setup. Skip if prior context may be needed.";type ForgetTarget = "current_user" | "previous_user";interface ForgetParams { target?: ForgetTarget | string; reason?: string;}interface BranchEntry { type?: string; id?: string; message?: { role?: string; content?: unknown }; [key: string]: unknown;}interface TargetResolution { ok: boolean; target: ForgetTarget; offset: 0 | 1; index: number; userCount: number; entry?: BranchEntry; code?: string; hint?: string;}interface ForgetResultDetails { kind?: typeof DETAILS_KIND; version?: number; code?: string; skipped?: boolean; compactionId?: string; target?: ForgetTarget | string; offset?: 0 | 1; keptFromEntryId?: string; keptPreview?: string; forgottenBefore?: number; reason?: string;}function textResult(text: string, details?: Record<string, unknown>) { return { content: [{ type: "text" as const, text }], details };}function errorResult( code: string, hint: string, details?: Record<string, unknown>,) { return { content: [{ type: "text" as const, text: `${code}. ${hint}` }], isError: true, details: { kind: DETAILS_KIND, code, ...details }, };}function compactWhitespace(text: string): string { return text.replace(/\s+/g, " ").trim();}function safeInline(text: unknown): string { return compactWhitespace( String(text ?? "").replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, ""), );}function contentText(content: unknown): string { if (typeof content === "string") return content; if (Array.isArray(content)) { return content .map((part) => { if (typeof part === "string") return part; if (part && typeof part === "object" && "text" in part) { const text = (part as { text?: unknown }).text; return typeof text === "string" ? text : ""; } return ""; }) .filter(Boolean) .join(" "); } return "";}function entryPreview( entry: BranchEntry | undefined, max = 180,): string | undefined { const text = safeInline(contentText(entry?.message?.content)); if (!text) return undefined; return text.length > max ? `${text.slice(0, max - 1)}…` : text;}function firstText(result: { content?: Array<{ type?: string; text?: string }>;}) { return result.content?.find((part) => part?.type === "text")?.text ?? "";}function userIndexes(branch: BranchEntry[]): number[] { const indexes: number[] = []; for (let i = 0; i < branch.length; i++) { const entry = branch[i]; if (entry?.type === "message" && entry.message?.role === "user") indexes.push(i); } return indexes;}function normalizeTarget(target: unknown): ForgetTarget | undefined { if (target === undefined || target === null || target === "") return "current_user"; if (target === "current_user" || target === "previous_user") return target; if (target === "current" || target === "latest" || target === "user:0") return "current_user"; if (target === "previous" || target === "prev" || target === "user:1") return "previous_user"; return undefined;}function resolveTarget( branch: BranchEntry[], rawTarget?: unknown,): TargetResolution { const target = normalizeTarget(rawTarget); if (!target) return { ok: false, target: "current_user", offset: 0, index: -1, userCount: 0, code: "bad_target", hint: "use current_user or previous_user", }; const offset = target === "current_user" ? 0 : 1; const users = userIndexes(branch); const position = users.length - 1 - offset; if (position < 0) return { ok: false, target, offset, index: -1, userCount: users.length, code: "no_boundary", hint: offset === 1 ? "no previous user; use current_user or skip" : "no current user", }; const index = users[position]; return { ok: true, target, offset, index, userCount: users.length, entry: branch[index], };}function forgetSummary(resolution: TargetResolution, reason?: string): string { return [ "[Forget] Earlier conversation context intentionally removed from active LLM context.", `Kept from ${resolution.target} entry ${resolution.entry?.id ?? "?"}.`, `Reason: ${reason?.trim() || "context budget"}.`, "History remains append-only/recoverable; active prompt context changed only.", ].join("\n");}function countTokensBefore(ctx: { getContextUsage?: () => { tokens?: number | null } | undefined;}): number { const tokens = ctx.getContextUsage?.()?.tokens; return typeof tokens === "number" && Number.isFinite(tokens) ? tokens : 0;}function appendForgetCompaction( ctx: unknown, resolution: TargetResolution, reason?: string,): string { const sessionManager = (ctx as { sessionManager?: unknown }) .sessionManager as { appendCompaction?: ( summary: string, firstKeptEntryId: string, tokensBefore: number, details?: unknown, fromHook?: boolean, ) => string; }; if (typeof sessionManager?.appendCompaction !== "function") throw new Error( "SessionManager appendCompaction unavailable in this Pi runtime", ); return sessionManager.appendCompaction( forgetSummary(resolution, reason), resolution.entry?.id ?? "", countTokensBefore( ctx as { getContextUsage?: () => { tokens?: number | null } | undefined }, ), { kind: DETAILS_KIND, version: 2, target: resolution.target, keptFromEntryId: resolution.entry?.id, forgottenBefore: resolution.index, reason, }, true, );}function renderForgetCall(args: ForgetParams, theme: any) { const target = normalizeTarget(args.target) ?? safeInline(args.target ?? "current_user"); let text = theme.fg("toolTitle", theme.bold("◌ forget ")); text += theme.fg("accent", target); const reason = safeInline(args.reason); if (reason) text += theme.fg("dim", ` — ${reason}`); return new Text(text, 0, 0);}function renderForgetResult( result: { content?: Array<{ type?: string; text?: string }>; details?: unknown; isError?: boolean; }, options: { expanded?: boolean; isPartial?: boolean }, theme: any,) { if (options.isPartial) return new Text(theme.fg("warning", "◌ forgetting context…"), 0, 0); const details = result.details as ForgetResultDetails | undefined; if (result.isError || details?.code) { const msg = safeInline( firstText(result) || details?.code || "forget failed", ); return new Text(theme.fg("error", `✗ ${msg}`), 0, 0); } if (details?.skipped) { let text = theme.fg("muted", "↷ nothing to forget"); if (details.target) text += theme.fg("dim", ` · ${details.target}`); return new Text(text, 0, 0); } let text = theme.fg("success", "✓ "); text += theme.fg("accent", `kept ${details?.target ?? "boundary"}`); if (typeof details?.forgottenBefore === "number") text += theme.fg("dim", ` · dropped ${details.forgottenBefore} entries`); if (details?.keptPreview) text += `\n ${theme.fg("muted", "↳ kept context:")} ${theme.fg("dim", details.keptPreview)}`; if (options.expanded) { if (details?.reason) text += `\n ${theme.fg("muted", "reason:")} ${theme.fg("dim", safeInline(details.reason))}`; if (details?.keptFromEntryId) text += `\n ${theme.fg("muted", "entry:")} ${theme.fg("dim", details.keptFromEntryId)}`; if (details?.compactionId) text += `\n ${theme.fg("muted", "compaction:")} ${theme.fg("dim", details.compactionId)}`; text += `\n ${theme.fg("muted", "history append-only; active context prefix-cut only")}`; } return new Text(text, 0, 0);}export const __test = { appendForgetCompaction, entryPreview, forgetSummary, normalizeTarget, REMINDER, renderForgetCall, renderForgetResult, resolveTarget, userIndexes,};export default function (pi: ExtensionAPI) { pi.on("before_agent_start", (event) => { if (event.systemPrompt.includes(REMINDER)) return undefined; return { systemPrompt: `${event.systemPrompt}\n\n${REMINDER}` }; }); pi.registerTool({ name: TOOL, label: "Forget", description: "Context-budget tool. Drops older active context before current_user or previous_user. Not privacy deletion.", promptSnippet: "forget(target?, reason?) — prefix-cut active context before current_user or previous_user", promptGuidelines: [ "target=current_user: latest user starts an independent new task; drop older context.", "target=previous_user: latest request depends on immediate prior setup; keep that setup and drop older context.", "Skip forget if prior discussion may be needed or no safe prefix cut exists.", ], parameters: Type.Object({ target: Type.Optional( StringEnum(["current_user", "previous_user"] as const, { description: "Prefix-cut boundary. Defaults to current_user.", }), ), reason: Type.Optional( Type.String({ description: "Short reason for context compaction" }), ), }), renderCall: renderForgetCall, renderResult: renderForgetResult, async execute(_toolCallId, params: ForgetParams, _signal, _onUpdate, ctx) { const branch = ctx.sessionManager.getBranch() as BranchEntry[]; const resolution = resolveTarget(branch, params.target); if (!resolution.ok) return errorResult( resolution.code ?? "invalid", resolution.hint ?? "skip forget", { target: params.target }, ); if (resolution.target === "current_user" && resolution.userCount <= 1) return textResult("already_first. nothing to forget", { kind: DETAILS_KIND, version: 3, skipped: true, target: resolution.target, keptFromEntryId: resolution.entry?.id, keptPreview: entryPreview(resolution.entry), forgottenBefore: 0, }); const compactionId = appendForgetCompaction( ctx, resolution, params.reason, ); return textResult( `done. kept=${resolution.target} dropped_entries=${resolution.index}`, { kind: DETAILS_KIND, version: 3, compactionId, target: resolution.target, offset: resolution.offset, keptFromEntryId: resolution.entry?.id, keptPreview: entryPreview(resolution.entry), forgottenBefore: resolution.index, reason: params.reason, }, ); }, });}deleted file mode 100644+0 / −27 text lines
{ "name": "@bugabinga/pi-ext-forget", "description": "Experimental active-context forgetting tool for pi", "type": "module", "main": "index.ts", "scripts": { "test:real": "FORGET_REAL=1 vitest run ./__tests__/real/*.test.ts --timeout 120000" }, "keywords": [ "pi", "extension", "context", "forget", "pi-extension" ], "license": "MIT", "peerDependencies": { "@earendil-works/pi-ai": "*", "@earendil-works/pi-coding-agent": "*", "@earendil-works/pi-tui": "*", "typebox": "*" }, "devDependencies": { "@marcfargas/pi-test-harness": "^0.6.1" }, "private": true}+0 / −17 text lines
"extensions/forget": { "name": "@bugabinga/pi-ext-forget", "license": "MIT", "devDependencies": { "@marcfargas/pi-test-harness": "^0.6.1" }, "peerDependencies": { "@earendil-works/pi-ai": "*", "@earendil-works/pi-coding-agent": "*", "@earendil-works/pi-tui": "*", "typebox": "*" } },