feat(research): merge repository research and tune QMD search coverage
Research skills: - Merge repository-research into research as a Repository section, so an open repository search loads one skill fewer; move its evals and update every reference. - Tune semantic-search for QMD: one question per search, known domain terms in the query, --top-k 10 for survey questions, a small-repository exception, and a Coverage section stating what the index skips. QMD search: - Widen the index file mask to web templates and styles, .NET and WPF markup and project files, JVM build files, and more script modules, and reapply it to existing repository collections. - Add qmd-search.mjs --get to read qmd:// hits from other collections. - List the exact search command in the Claude sandbox excludedCommands, because the macOS/Linux sandbox blocks the localhost daemon and the index under the home directory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
82d9992b3a
commit
eb7cecaaa2
18 files changed
+142
-95
No files matched your search
@@ -7,7 +7,7 @@ import { tmpdir } from 'node:os';
|
||||
import { dirname, join } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as YAML from './fixtures/yaml-shim.mjs';
|
||||
import { collectionName, deviceEnv, idleMinutes, qmdConfigPath, qmdPackageDir, writePrivateJson, writeTextAtomic, readJson, runQmdCli, MODELS } from '../../shared/qmd/qmd-lib.mjs';
|
||||
import { collectionName, deviceEnv, idleMinutes, qmdConfigPath, qmdPackageDir, writePrivateJson, writeTextAtomic, readJson, runQmdCli, MASK, MODELS } from '../../shared/qmd/qmd-lib.mjs';
|
||||
import { setModels, unsetModels, previousModels, restoreModels, setCollectionIgnore } from '../../shared/qmd/qmd-config.mjs';
|
||||
|
||||
for (const layout of ['nested', 'hoisted']) {
|
||||
@@ -134,4 +134,7 @@ test('setCollectionIgnore writes the ignore list of one collection and keeps the
|
||||
const cleared = setCollectionIgnore(withIgnore, YAML, 'repo-aaaaaaaaaaaa', []);
|
||||
assert.deepEqual(YAML.default.parse(cleared).collections['repo-aaaaaaaaaaaa'], { path: '/r', includeByDefault: false });
|
||||
assert.equal(setCollectionIgnore(original, YAML, 'repo-bbbbbbbbbbbb', ['x']), null, 'an unknown collection is not created');
|
||||
const remasked = setCollectionIgnore(cleared, YAML, 'repo-aaaaaaaaaaaa', [], MASK);
|
||||
assert.equal(YAML.default.parse(remasked).collections['repo-aaaaaaaaaaaa'].pattern, MASK, 'an older file mask is replaced');
|
||||
assert.match(MASK, /html,css,scss,xaml/);
|
||||
});
|
||||
@@ -4,11 +4,18 @@ import { EventEmitter } from 'node:events';
|
||||
import { mkdtempSync, rmSync, writeFileSync, existsSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { callDaemon, runSearch, startDaemon, toCliResults } from '../../shared/qmd/qmd-search.mjs';
|
||||
import { callDaemon, getDocument, runSearch, startDaemon, toCliResults } from '../../shared/qmd/qmd-search.mjs';
|
||||
import { collectionName } from '../../shared/qmd/qmd-lib.mjs';
|
||||
|
||||
const hit = [{ path: 'src/a.ts', line: 3, score: 0.9, snippet: 's' }];
|
||||
|
||||
test('getDocument reads qmd URIs through the QMD CLI and rejects other input', () => {
|
||||
const calls = [];
|
||||
assert.equal(getDocument('qmd://notes/a b.md:10', (args) => { calls.push(args); return 'body'; }), 'body');
|
||||
assert.deepEqual(calls, [['get', 'qmd://notes/a b.md:10']]);
|
||||
for (const bad of ['notes/a.md', 'qmd://notes', '--help', 'qmd:///a.md']) assert.throws(() => getDocument(bad, () => 'x'), /qmd:\/\//);
|
||||
});
|
||||
|
||||
test('uses the daemon when it answers', async () => {
|
||||
const results = await runSearch({ root: '/My Repo/ü', query: 'q', topK: 5,
|
||||
daemon: async (path, body) => { assert.equal(path, '/search'); assert.equal(body.repo, '/My Repo/ü'); return { results: hit }; },
|
||||
|
||||
Reference in new issue
Block a user