Goal
The resolver at `src/server/services/ask/resolver.ts` powers how `/ask` picks candidate sessions for the LLM's context. There's a minimal test file (`resolver.test.ts`) but coverage is thin — edge cases around token weighting, stopwords, and the breadth-hint fallback aren't exercised.
Scope
Add tests for:
- Stopword filtering — "is the api session healthy?" should drop "is", "the", "session", "healthy" and score against "api".
- Multi-keyword match — "the sourcebridge oauth session" should rank a session whose cwd contains both "sourcebridge" and "oauth" above one that only matches one.
- Stable ordering on ties — two sessions with identical scores should order by `lastActivityAt` desc.
- `fetchSessionsById` respects order — passing `["b", "a"]` returns in that order (not alphabetic).
- Archived sessions excluded — a session with `status: "archived"` shouldn't leak into the resolver pool.
Where to look
- `src/server/services/ask/resolver.ts` — the resolver.
- `src/server/services/ask/resolver.test.ts` — existing tests to extend.
- `src/server/services/ai/__test_db.ts` — test DB helper.
Acceptance criteria
Great issue if you want to learn the AI/Ask codebase without writing production code.
Goal
The resolver at `src/server/services/ask/resolver.ts` powers how `/ask` picks candidate sessions for the LLM's context. There's a minimal test file (`resolver.test.ts`) but coverage is thin — edge cases around token weighting, stopwords, and the breadth-hint fallback aren't exercised.
Scope
Add tests for:
Where to look
Acceptance criteria
Great issue if you want to learn the AI/Ask codebase without writing production code.