Replace sqlite3 subprocess with bun:sqlite native driver, add AGENTS.md and tests
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.
This commit is contained in:
26
tests/compaction.test.ts
Normal file
26
tests/compaction.test.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user