Rewrites history/queries.ts to use bun:sqlite with readonly mode and parameterized queries instead of spawning sqlite3. Consolidates threshold constants into a single source of truth. Adds AGENTS.md as the canonical operational doc, moves architecture to docs/, and adds initial test suite.
27 lines
912 B
TypeScript
27 lines
912 B
TypeScript
import { describe, expect, test } from "bun:test";
|
|
import { getCompactionPrompt } from "../src/compaction/prompt";
|
|
|
|
describe("compaction prompt", () => {
|
|
test("returns non-empty string", () => {
|
|
const prompt = getCompactionPrompt();
|
|
expect(typeof prompt).toBe("string");
|
|
expect(prompt.length).toBeGreaterThan(0);
|
|
});
|
|
|
|
test("emphasizes self-continuity, not another agent", () => {
|
|
const prompt = getCompactionPrompt();
|
|
expect(prompt).toContain("yourself");
|
|
expect(prompt).toContain("not another agent");
|
|
});
|
|
|
|
test("includes key sections", () => {
|
|
const prompt = getCompactionPrompt();
|
|
expect(prompt).toContain("## Goal");
|
|
expect(prompt).toContain("## Instructions");
|
|
expect(prompt).toContain("## Discoveries");
|
|
expect(prompt).toContain("## Accomplished");
|
|
expect(prompt).toContain("## Relevant files");
|
|
expect(prompt).toContain("## Notes");
|
|
});
|
|
});
|