Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
03e8315
ci: update server.bundle.mjs, cli.bundle.mjs, session hook & security…
github-actions[bot] Jun 29, 2026
4dedadc
ci: update install stats
github-actions[bot] Jun 29, 2026
218a4fc
ci: update install stats
github-actions[bot] Jun 30, 2026
8d68571
ci: update install stats
github-actions[bot] Jun 30, 2026
a0b4609
ci: update install stats
github-actions[bot] Jul 1, 2026
3fbc6ea
ci: update install stats
github-actions[bot] Jul 1, 2026
40f2332
ci: update install stats
github-actions[bot] Jul 2, 2026
ee78b02
ci: update install stats
github-actions[bot] Jul 2, 2026
f3f15e1
ci: update install stats
github-actions[bot] Jul 3, 2026
429d6f2
ci: update install stats
github-actions[bot] Jul 3, 2026
c3fb920
ci: update install stats
github-actions[bot] Jul 4, 2026
aa4e965
ci: update install stats
github-actions[bot] Jul 4, 2026
4f60c87
ci: update install stats
github-actions[bot] Jul 5, 2026
f267bda
ci: update install stats
github-actions[bot] Jul 6, 2026
475dc23
ci: update install stats
github-actions[bot] Jul 7, 2026
d0a0eeb
ci: update install stats
github-actions[bot] Jul 7, 2026
477d845
ci: update install stats
github-actions[bot] Jul 8, 2026
43a2066
ci: update install stats
github-actions[bot] Jul 8, 2026
96446b9
ci: update install stats
github-actions[bot] Jul 9, 2026
b13cfa8
ci: update install stats
github-actions[bot] Jul 10, 2026
a6a990f
ci: update install stats
github-actions[bot] Jul 10, 2026
6118634
ci: update install stats
github-actions[bot] Jul 11, 2026
85ed032
ci: update install stats
github-actions[bot] Jul 11, 2026
f216b6d
ci: update install stats
github-actions[bot] Jul 12, 2026
d31941e
ci: update install stats
github-actions[bot] Jul 13, 2026
36fb343
ci: update install stats
github-actions[bot] Jul 14, 2026
1bea4a5
ci: update install stats
github-actions[bot] Jul 14, 2026
608cd2d
ci: update install stats
github-actions[bot] Jul 15, 2026
f1737f7
ci: update install stats
github-actions[bot] Jul 15, 2026
d2a8cc9
ci: update install stats
github-actions[bot] Jul 16, 2026
b6f25a6
ci: update install stats
github-actions[bot] Jul 16, 2026
eaa83de
ci: update install stats
github-actions[bot] Jul 17, 2026
c13d6be
ci: update install stats
github-actions[bot] Jul 17, 2026
66f1c01
ci: update install stats
github-actions[bot] Jul 18, 2026
712ba0a
ci: update install stats
github-actions[bot] Jul 18, 2026
fe2f53b
ci: update install stats
github-actions[bot] Jul 19, 2026
1618d97
ci: update install stats
github-actions[bot] Jul 20, 2026
2f368c5
ci: update install stats
github-actions[bot] Jul 21, 2026
3e53061
ci: update install stats
github-actions[bot] Jul 21, 2026
51e0f50
ci: update install stats
github-actions[bot] Jul 22, 2026
8b48b76
ci: update install stats
github-actions[bot] Jul 22, 2026
609a312
ci: update install stats
github-actions[bot] Jul 23, 2026
6aad62f
ci: update install stats
github-actions[bot] Jul 23, 2026
98af4ab
test: close SessionDB instances in tests to prevent Windows EPERM hang
skoll43 Jul 24, 2026
456782d
Merge branch 'next' into fix/vitest-eperm-hang
skoll43 Aug 4, 2026
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
307 changes: 154 additions & 153 deletions cli.bundle.mjs

Large diffs are not rendered by default.

269 changes: 135 additions & 134 deletions server.bundle.mjs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions stats.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"schemaVersion": 1,
"label": "users",
"message": "340.8k+",
"message": "426.3k+",
"color": "brightgreen",
"npm": "310.9k+",
"marketplace": "29.8k+"
"npm": "395.5k+",
"marketplace": "30.8k+"
}
15 changes: 14 additions & 1 deletion tests/adapters/omp-plugin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ import "../setup-home";
*/

import { describe, it, expect, beforeEach, afterEach } from "vitest";

const activeDBs: Array<{ close?: () => void }> = [];
afterEach(() => {
for (const db of activeDBs) { try { db.close?.(); } catch {} }
activeDBs.length = 0;
});

import { mkdtempSync, rmSync } from "node:fs";
import { join } from "node:path";
import { tmpdir } from "node:os";
Expand Down Expand Up @@ -206,6 +213,7 @@ describe("OMP plugin", () => {
sessionsDir: adapter.getSessionDir(),
}),
});
activeDBs.push(db as any);
const latest = db.getLatestSessionId();
expect(latest).not.toBeNull();
const events = db.getEvents(latest as string);
Expand Down Expand Up @@ -252,6 +260,7 @@ describe("OMP plugin", () => {
sessionsDir: adapter.getSessionDir(),
}),
});
activeDBs.push(db as any);
const latest = db.getLatestSessionId();
expect(latest).not.toBeNull();
});
Expand Down Expand Up @@ -309,6 +318,7 @@ describe("OMP plugin", () => {
sessionsDir: adapter.getSessionDir(),
}),
});
activeDBs.push(db as any);
const resume = db.getResume(sid);
expect(resume).not.toBeNull();
expect(resume?.snapshot.length).toBeGreaterThan(0);
Expand Down Expand Up @@ -357,7 +367,10 @@ describe("OMP plugin", () => {
expect(fileExists(canonicalPath)).toBe(true);

// Verify the canonical file is the one with our session_start row.
const db = new SessionDB({ dbPath: canonicalPath });
const db = new SessionDB({ dbPath: canonicalPath });
activeDBs.push(db as any);
activeDBs.push(db as any);
activeDBs.push(db as any);
try {
const latest = db.getLatestSessionId();
expect(latest).not.toBeNull();
Expand Down
20 changes: 17 additions & 3 deletions tests/core/search-project-filter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,42 @@
* null (no filter), explicit string → that string.
*/

import { describe, test, expect } from "vitest";
import { describe, test, expect, afterEach } from "vitest";
import { tmpdir } from "node:os";
import { join } from "node:path";
import { randomUUID } from "node:crypto";
import { ContentStore } from "../../src/store.js";
import { SessionDB } from "../../src/session/db.js";
import { searchAllSources } from "../../src/search/unified.js";

const activeDBs: Array<{ close?: () => void, cleanup?: () => void }> = [];

afterEach(() => {
for (const db of activeDBs) {
try { db.cleanup?.(); } catch {}
try { db.close?.(); } catch {}
}
activeDBs.length = 0;
});

function createStore(): ContentStore {
const path = join(
tmpdir(),
`ctx-issue737-store-${Date.now()}-${Math.random().toString(36).slice(2)}.db`,
);
return new ContentStore(path);
const store = new ContentStore(path);
activeDBs.push(store as any);
return store;
}

function createSessionDB(): SessionDB {
const path = join(
tmpdir(),
`ctx-issue737-session-${Date.now()}-${Math.random().toString(36).slice(2)}.db`,
);
return new SessionDB({ dbPath: path });
const db = new SessionDB({ dbPath: path });
activeDBs.push(db as any);
return db;
}

// ═══════════════════════════════════════════════════════════
Expand Down
8 changes: 8 additions & 0 deletions tests/integration/commit-message-symmetry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
*/

import { describe, test, beforeEach, afterEach, expect, vi } from "vitest";

const activeDBs: Array<{ close?: () => void }> = [];
afterEach(() => {
for (const db of activeDBs) { try { db.close?.(); } catch {} }
activeDBs.length = 0;
});

import { mkdtempSync, rmSync, writeFileSync, mkdirSync } from "node:fs";
import { join, dirname } from "node:path";
import { tmpdir } from "node:os";
Expand Down Expand Up @@ -78,6 +85,7 @@ describe("session-loaders — Bug 2 repro: commit_message symmetric stamp", () =

test("session with 1 commit + 3 file edits — every body MUST carry commit_message alongside has_commit", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sid = "commit-msg-symmetry-" + Date.now();
db.ensureSession(sid, fakeHome);

Expand Down
22 changes: 17 additions & 5 deletions tests/integration/cross-project-attribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
*/

import { describe, test, beforeEach, afterEach, expect, vi } from "vitest";

const activeDBs: Array<{ close?: () => void }> = [];
afterEach(() => {
for (const db of activeDBs) { try { db.close?.(); } catch {} }
activeDBs.length = 0;
});

import { mkdtempSync, rmSync, writeFileSync, mkdirSync } from "node:fs";
import { join, dirname } from "node:path";
import { tmpdir } from "node:os";
Expand Down Expand Up @@ -102,7 +109,8 @@ describe("cross-project attribution — Bug 7 repro", () => {
});

test("tracer: cwd=projA but file_edit on projB/foo.ts → body.project resolves to projB's canonical id", async () => {
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
activeDBs.push(db as any);
const sid = "cross-proj-" + Date.now();
db.ensureSession(sid, projA);

Expand Down Expand Up @@ -145,7 +153,8 @@ describe("cross-project attribution — Bug 7 repro", () => {
});

test("batched events split across projA + projB → each attributes to its own repo", async () => {
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
activeDBs.push(db as any);
const sid = "cross-proj-batch-" + Date.now();
db.ensureSession(sid, projA);

Expand All @@ -172,7 +181,8 @@ describe("cross-project attribution — Bug 7 repro", () => {
});

test("Bug 8 — Bash 'git -C /projB status' via real extractEvents → project=projB", async () => {
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
activeDBs.push(db as any);
const sid = "bash-c-" + Date.now();
db.ensureSession(sid, projA);

Expand Down Expand Up @@ -212,7 +222,8 @@ describe("cross-project attribution — Bug 7 repro", () => {
});

test("Bug 8 — Bash 'cd /projB && npm test' → project=projB", async () => {
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
activeDBs.push(db as any);
const sid = "bash-cd-" + Date.now();
db.ensureSession(sid, projA);

Expand Down Expand Up @@ -242,7 +253,8 @@ describe("cross-project attribution — Bug 7 repro", () => {
});

test("Bash without any path indicator → falls back to cwd (projA) — expected behavior", async () => {
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
const db = new SessionDB({ dbPath: join(fakeHome, "test.db") });
activeDBs.push(db as any);
const sid = "bash-no-path-" + Date.now();
db.ensureSession(sid, projA);

Expand Down
14 changes: 14 additions & 0 deletions tests/integration/seed-parity-coverage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
*/

import { describe, test, beforeEach, afterEach, expect, vi } from "vitest";

const activeDBs: Array<{ close?: () => void }> = [];
afterEach(() => {
for (const db of activeDBs) { try { db.close?.(); } catch {} }
activeDBs.length = 0;
});

import { mkdtempSync, rmSync, writeFileSync, mkdirSync } from "node:fs";
import { dirname, join } from "node:path";
import { tmpdir } from "node:os";
Expand Down Expand Up @@ -132,6 +139,7 @@ describe("seed-parity coverage gate", () => {

test("every outgoing event carries all 21 universal seed-parity columns", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sessionId = "parity-session-" + Date.now();
db.ensureSession(sessionId, fakeHome);

Expand Down Expand Up @@ -181,6 +189,7 @@ describe("seed-parity coverage gate", () => {

test("variant columns populate by category", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sessionId = "parity-variants-" + Date.now();
db.ensureSession(sessionId, fakeHome);

Expand Down Expand Up @@ -224,6 +233,7 @@ describe("seed-parity coverage gate", () => {

test("rollup snapshot reflects session-wide aggregates", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sessionId = "parity-rollup-" + Date.now();
db.ensureSession(sessionId, fakeHome);

Expand Down Expand Up @@ -263,6 +273,7 @@ describe("seed-parity coverage gate", () => {

test("Bash metadata: command_type/command_tool/exit_code derived algorithmically", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sid = "bash-meta-" + Date.now();
db.ensureSession(sid, fakeHome);

Expand Down Expand Up @@ -301,6 +312,7 @@ describe("seed-parity coverage gate", () => {

test("blocker_status: derived from canonical event type, not regex", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sid = "blocker-" + Date.now();
db.ensureSession(sid, fakeHome);

Expand Down Expand Up @@ -328,6 +340,7 @@ describe("seed-parity coverage gate", () => {

test("latency_ms: read from PreToolUse marker, duration_bucket derived", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sid = "latency-" + Date.now();
db.ensureSession(sid, fakeHome);

Expand Down Expand Up @@ -358,6 +371,7 @@ describe("seed-parity coverage gate", () => {

test("variant matrix — coverage report", async () => {
const db = new SessionDB({ dbPath });
activeDBs.push(db as any);
const sessionId = "parity-matrix-" + Date.now();
db.ensureSession(sessionId, fakeHome);

Expand Down
Loading