digdig 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -14
- package/digdig.config.example.json +0 -0
- package/dist/claims/deterministic-checks.d.ts +0 -0
- package/dist/claims/deterministic-checks.d.ts.map +0 -0
- package/dist/claims/deterministic-checks.js +0 -0
- package/dist/claims/deterministic-checks.js.map +0 -0
- package/dist/claims/policy.d.ts +0 -0
- package/dist/claims/policy.d.ts.map +0 -0
- package/dist/claims/policy.js +0 -0
- package/dist/claims/policy.js.map +0 -0
- package/dist/claims/store.d.ts +0 -0
- package/dist/claims/store.d.ts.map +0 -0
- package/dist/claims/store.js +0 -0
- package/dist/claims/store.js.map +0 -0
- package/dist/claims/types.d.ts +0 -0
- package/dist/claims/types.d.ts.map +0 -0
- package/dist/claims/types.js +0 -0
- package/dist/claims/types.js.map +0 -0
- package/dist/commands/claim.d.ts +0 -0
- package/dist/commands/claim.d.ts.map +0 -0
- package/dist/commands/claim.js +0 -0
- package/dist/commands/claim.js.map +0 -0
- package/dist/commands/coverage.d.ts +7 -0
- package/dist/commands/coverage.d.ts.map +1 -0
- package/dist/commands/coverage.js +78 -0
- package/dist/commands/coverage.js.map +1 -0
- package/dist/commands/doc-index.d.ts +0 -0
- package/dist/commands/doc-index.d.ts.map +0 -0
- package/dist/commands/doc-index.js +0 -0
- package/dist/commands/doc-index.js.map +0 -0
- package/dist/commands/doc-search.d.ts +0 -0
- package/dist/commands/doc-search.d.ts.map +0 -0
- package/dist/commands/doc-search.js +0 -0
- package/dist/commands/doc-search.js.map +0 -0
- package/dist/commands/evidence.d.ts +0 -0
- package/dist/commands/evidence.d.ts.map +0 -0
- package/dist/commands/evidence.js +0 -0
- package/dist/commands/evidence.js.map +0 -0
- package/dist/commands/extract.d.ts +0 -0
- package/dist/commands/extract.d.ts.map +0 -0
- package/dist/commands/extract.js +5 -5
- package/dist/commands/extract.js.map +1 -1
- package/dist/commands/graph-add.d.ts +0 -0
- package/dist/commands/graph-add.d.ts.map +0 -0
- package/dist/commands/graph-add.js +0 -0
- package/dist/commands/graph-add.js.map +1 -1
- package/dist/commands/graph-drill.d.ts +0 -0
- package/dist/commands/graph-drill.d.ts.map +0 -0
- package/dist/commands/graph-drill.js +0 -0
- package/dist/commands/graph-drill.js.map +0 -0
- package/dist/commands/graph-explore.d.ts +0 -0
- package/dist/commands/graph-explore.d.ts.map +0 -0
- package/dist/commands/graph-explore.js +0 -0
- package/dist/commands/graph-explore.js.map +0 -0
- package/dist/commands/graph-obfuscate.d.ts +0 -0
- package/dist/commands/graph-obfuscate.d.ts.map +0 -0
- package/dist/commands/graph-obfuscate.js +0 -0
- package/dist/commands/graph-obfuscate.js.map +0 -0
- package/dist/commands/graph-search.d.ts +0 -0
- package/dist/commands/graph-search.d.ts.map +0 -0
- package/dist/commands/graph-search.js +0 -0
- package/dist/commands/graph-search.js.map +0 -0
- package/dist/commands/graph-traverse.d.ts +0 -0
- package/dist/commands/graph-traverse.d.ts.map +0 -0
- package/dist/commands/graph-traverse.js +0 -0
- package/dist/commands/graph-traverse.js.map +0 -0
- package/dist/commands/json-input.d.ts +0 -0
- package/dist/commands/json-input.d.ts.map +0 -0
- package/dist/commands/json-input.js +0 -0
- package/dist/commands/json-input.js.map +0 -0
- package/dist/commands/query-graph.d.ts +0 -0
- package/dist/commands/query-graph.d.ts.map +0 -0
- package/dist/commands/query-graph.js +0 -0
- package/dist/commands/query-graph.js.map +0 -0
- package/dist/commands/results-add.d.ts +0 -0
- package/dist/commands/results-add.d.ts.map +0 -0
- package/dist/commands/results-add.js +0 -0
- package/dist/commands/results-add.js.map +0 -0
- package/dist/commands/review.d.ts +0 -0
- package/dist/commands/review.d.ts.map +0 -0
- package/dist/commands/review.js +0 -0
- package/dist/commands/review.js.map +0 -0
- package/dist/commands/session.d.ts +0 -0
- package/dist/commands/session.d.ts.map +0 -0
- package/dist/commands/session.js +0 -0
- package/dist/commands/session.js.map +0 -0
- package/dist/commands/verdict.d.ts +0 -0
- package/dist/commands/verdict.d.ts.map +0 -0
- package/dist/commands/verdict.js +0 -0
- package/dist/commands/verdict.js.map +0 -0
- package/dist/config.d.ts +0 -0
- package/dist/config.d.ts.map +0 -0
- package/dist/config.js +0 -0
- package/dist/config.js.map +0 -0
- package/dist/deep/co-occurrence.d.ts +0 -0
- package/dist/deep/co-occurrence.d.ts.map +0 -0
- package/dist/deep/co-occurrence.js +0 -0
- package/dist/deep/co-occurrence.js.map +0 -0
- package/dist/deep/coverage.d.ts +81 -0
- package/dist/deep/coverage.d.ts.map +1 -0
- package/dist/deep/coverage.js +183 -0
- package/dist/deep/coverage.js.map +1 -0
- package/dist/deep/dedupe.d.ts +9 -1
- package/dist/deep/dedupe.d.ts.map +1 -1
- package/dist/deep/dedupe.js +21 -2
- package/dist/deep/dedupe.js.map +1 -1
- package/dist/deep/degree-utils.d.ts +0 -0
- package/dist/deep/degree-utils.d.ts.map +0 -0
- package/dist/deep/degree-utils.js +0 -0
- package/dist/deep/degree-utils.js.map +0 -0
- package/dist/deep/extractor.d.ts +0 -0
- package/dist/deep/extractor.d.ts.map +0 -0
- package/dist/deep/extractor.js +0 -0
- package/dist/deep/extractor.js.map +0 -0
- package/dist/deep/fuse.d.ts +63 -0
- package/dist/deep/fuse.d.ts.map +1 -0
- package/dist/deep/fuse.js +108 -0
- package/dist/deep/fuse.js.map +1 -0
- package/dist/deep/graph-explore.d.ts +0 -0
- package/dist/deep/graph-explore.d.ts.map +0 -0
- package/dist/deep/graph-explore.js +0 -0
- package/dist/deep/graph-explore.js.map +0 -0
- package/dist/deep/graph-obfuscate.d.ts +0 -0
- package/dist/deep/graph-obfuscate.d.ts.map +0 -0
- package/dist/deep/graph-obfuscate.js +0 -0
- package/dist/deep/graph-obfuscate.js.map +0 -0
- package/dist/deep/graph-preprocess.d.ts +0 -0
- package/dist/deep/graph-preprocess.d.ts.map +0 -0
- package/dist/deep/graph-preprocess.js +0 -0
- package/dist/deep/graph-preprocess.js.map +0 -0
- package/dist/deep/graph-sampling.d.ts +0 -0
- package/dist/deep/graph-sampling.d.ts.map +0 -0
- package/dist/deep/graph-sampling.js +0 -0
- package/dist/deep/graph-sampling.js.map +0 -0
- package/dist/deep/graph.d.ts +0 -0
- package/dist/deep/graph.d.ts.map +0 -0
- package/dist/deep/graph.js +0 -0
- package/dist/deep/graph.js.map +0 -0
- package/dist/deep/index.d.ts +1 -1
- package/dist/deep/index.d.ts.map +0 -0
- package/dist/deep/index.js +1 -1
- package/dist/deep/index.js.map +0 -0
- package/dist/deep/iteration-data.d.ts +9 -13
- package/dist/deep/iteration-data.d.ts.map +1 -1
- package/dist/deep/iteration-data.js +12 -16
- package/dist/deep/iteration-data.js.map +1 -1
- package/dist/deep/local-doc/indexer.d.ts +0 -4
- package/dist/deep/local-doc/indexer.d.ts.map +1 -1
- package/dist/deep/local-doc/indexer.js +21 -3
- package/dist/deep/local-doc/indexer.js.map +1 -1
- package/dist/deep/local-doc/scanner.d.ts +0 -0
- package/dist/deep/local-doc/scanner.d.ts.map +0 -0
- package/dist/deep/local-doc/scanner.js +0 -0
- package/dist/deep/local-doc/scanner.js.map +0 -0
- package/dist/deep/local-doc/searcher.d.ts +0 -0
- package/dist/deep/local-doc/searcher.d.ts.map +1 -1
- package/dist/deep/local-doc/searcher.js +3 -4
- package/dist/deep/local-doc/searcher.js.map +1 -1
- package/dist/deep/local-doc/types.d.ts +0 -0
- package/dist/deep/local-doc/types.d.ts.map +0 -0
- package/dist/deep/local-doc/types.js +0 -0
- package/dist/deep/local-doc/types.js.map +0 -0
- package/dist/deep/path-extraction.d.ts +0 -0
- package/dist/deep/path-extraction.d.ts.map +0 -0
- package/dist/deep/path-extraction.js +0 -0
- package/dist/deep/path-extraction.js.map +0 -0
- package/dist/deep/pending-facts.d.ts +64 -0
- package/dist/deep/pending-facts.d.ts.map +1 -0
- package/dist/deep/pending-facts.js +74 -0
- package/dist/deep/pending-facts.js.map +1 -0
- package/dist/deep/query-redundancy.d.ts +0 -0
- package/dist/deep/query-redundancy.d.ts.map +0 -0
- package/dist/deep/query-redundancy.js +0 -0
- package/dist/deep/query-redundancy.js.map +0 -0
- package/dist/deep/query-suggest.d.ts +1 -3
- package/dist/deep/query-suggest.d.ts.map +1 -1
- package/dist/deep/query-suggest.js +3 -11
- package/dist/deep/query-suggest.js.map +1 -1
- package/dist/deep/rrf.d.ts +0 -0
- package/dist/deep/rrf.d.ts.map +0 -0
- package/dist/deep/rrf.js +0 -0
- package/dist/deep/rrf.js.map +0 -0
- package/dist/deep/search-strategy.d.ts +0 -0
- package/dist/deep/search-strategy.d.ts.map +0 -0
- package/dist/deep/search-strategy.js +0 -0
- package/dist/deep/search-strategy.js.map +0 -0
- package/dist/deep/session.d.ts +5 -3
- package/dist/deep/session.d.ts.map +1 -1
- package/dist/deep/session.js +29 -9
- package/dist/deep/session.js.map +1 -1
- package/dist/deep/simhash.d.ts +0 -0
- package/dist/deep/simhash.d.ts.map +0 -0
- package/dist/deep/simhash.js +0 -0
- package/dist/deep/simhash.js.map +0 -0
- package/dist/deep/tfidf.d.ts +0 -0
- package/dist/deep/tfidf.d.ts.map +0 -0
- package/dist/deep/tfidf.js +0 -0
- package/dist/deep/tfidf.js.map +0 -0
- package/dist/deepseek-service.d.ts +0 -0
- package/dist/deepseek-service.d.ts.map +1 -1
- package/dist/deepseek-service.js +7 -3
- package/dist/deepseek-service.js.map +1 -1
- package/dist/entry.d.ts +5 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +7 -2
- package/dist/entry.js.map +1 -1
- package/dist/errors.d.ts +76 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +117 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.d.ts.map +0 -0
- package/dist/index.js.map +0 -0
- package/dist/init.d.ts +0 -0
- package/dist/init.d.ts.map +0 -0
- package/dist/init.js +0 -0
- package/dist/init.js.map +0 -0
- package/dist/legacy.d.ts +0 -0
- package/dist/legacy.d.ts.map +0 -0
- package/dist/legacy.js +0 -0
- package/dist/legacy.js.map +0 -0
- package/dist/ollama-service.d.ts +0 -0
- package/dist/ollama-service.d.ts.map +1 -1
- package/dist/ollama-service.js +27 -6
- package/dist/ollama-service.js.map +1 -1
- package/dist/protocol.d.ts +0 -0
- package/dist/protocol.d.ts.map +0 -0
- package/dist/protocol.js +0 -0
- package/dist/protocol.js.map +0 -0
- package/dist/runCli.d.ts +1 -1
- package/dist/runCli.d.ts.map +1 -1
- package/dist/runCli.js +224 -432
- package/dist/runCli.js.map +1 -1
- package/dist/service.d.ts +10 -0
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +27 -21
- package/dist/service.js.map +1 -1
- package/dist/sxng.d.ts +0 -0
- package/dist/sxng.d.ts.map +0 -0
- package/dist/sxng.js.map +0 -0
- package/package.json +2 -2
- package/dist/commands/build-graph.d.ts +0 -8
- package/dist/commands/build-graph.d.ts.map +0 -1
- package/dist/commands/build-graph.js +0 -70
- package/dist/commands/build-graph.js.map +0 -1
- package/dist/commands/graph-add.d.ts.sync-conflict-20260629-232900-2SGIW5T.map +0 -1
- package/dist/commands/graph-add.js.sync-conflict-20260629-232916-2SGIW5T.map +0 -1
- package/dist/commands/graph-add.sync-conflict-20260629-232853-2SGIW5T.js +0 -163
- package/dist/commands/raw.d.ts +0 -14
- package/dist/commands/raw.d.ts.map +0 -1
- package/dist/commands/raw.js +0 -125
- package/dist/commands/raw.js.map +0 -1
- package/dist/deep/extractor.d.sync-conflict-20260629-232902-2SGIW5T.ts +0 -37
- package/dist/deep/extractor.d.ts.sync-conflict-20260629-232921-2SGIW5T.map +0 -1
- package/dist/deep/extractor.js.sync-conflict-20260629-232921-2SGIW5T.map +0 -1
- package/dist/deep/extractor.sync-conflict-20260629-232903-2SGIW5T.js +0 -203
- package/dist/deep/graph.d.sync-conflict-20260629-232917-2SGIW5T.ts +0 -78
- package/dist/deep/graph.d.ts.sync-conflict-20260629-232911-2SGIW5T.map +0 -1
- package/dist/deep/graph.js.sync-conflict-20260629-232855-2SGIW5T.map +0 -1
- package/dist/deep/graph.sync-conflict-20260629-232907-2SGIW5T.js +0 -194
- package/dist/deep/keywords.d.ts +0 -27
- package/dist/deep/keywords.d.ts.map +0 -1
- package/dist/deep/keywords.js +0 -293
- package/dist/deep/keywords.js.map +0 -1
- package/dist/deep/local-doc/searcher.sync-conflict-20260805-191858-2SGIW5T.d.ts +0 -38
- package/dist/deep/local-doc/searcher.sync-conflict-20260805-191858-2SGIW5T.d.ts.map +0 -1
- package/dist/deep/local-doc/searcher.sync-conflict-20260805-191858-2SGIW5T.js +0 -212
- package/dist/deep/local-doc/searcher.sync-conflict-20260805-191858-2SGIW5T.js.map +0 -1
- package/dist/deep/quality-assess.d.ts +0 -46
- package/dist/deep/quality-assess.d.ts.map +0 -1
- package/dist/deep/quality-assess.js +0 -122
- package/dist/deep/quality-assess.js.map +0 -1
- package/dist/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.d.ts +0 -46
- package/dist/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.d.ts.map +0 -1
- package/dist/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.js +0 -122
- package/dist/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.js.map +0 -1
- package/dist/deep/recovery-analysis.d.ts +0 -60
- package/dist/deep/recovery-analysis.d.ts.map +0 -1
- package/dist/deep/recovery-analysis.js +0 -185
- package/dist/deep/recovery-analysis.js.map +0 -1
- package/dist/deep/session.d.sync-conflict-20260629-232917-2SGIW5T.ts +0 -71
- package/dist/deep/session.d.ts.sync-conflict-20260629-232921-2SGIW5T.map +0 -1
- package/dist/deep/session.js.sync-conflict-20260629-232854-2SGIW5T.map +0 -1
- package/dist/runCli.d.ts.sync-conflict-20260629-232854-2SGIW5T.map +0 -1
- package/dist/runCli.js.sync-conflict-20260629-232857-2SGIW5T.map +0 -1
- package/dist/runCli.sync-conflict-20260629-232915-2SGIW5T.js +0 -1109
- package/dist/runCli.sync-conflict-20260629-233530-JAULAPO.d.ts +0 -8
- package/dist/runCli.sync-conflict-20260629-233530-JAULAPO.d.ts.map +0 -1
- package/dist/runCli.sync-conflict-20260629-233530-JAULAPO.js +0 -1111
- package/dist/runCli.sync-conflict-20260629-233530-JAULAPO.js.map +0 -1
|
@@ -1,212 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Searcher — BM25 search + SessionResult formatting.
|
|
3
|
-
*
|
|
4
|
-
* Searches an Orama index, formats results as SessionResult[]
|
|
5
|
-
* with source: 'local', and injects them into the session pipeline
|
|
6
|
-
* without incrementing the round counter.
|
|
7
|
-
*/
|
|
8
|
-
import { resolve } from 'path';
|
|
9
|
-
import { search as oramaSearch } from '@orama/orama';
|
|
10
|
-
import { distance as levenshtein } from 'fastest-levenshtein';
|
|
11
|
-
import { scanFiles } from './scanner.js';
|
|
12
|
-
import { buildIndexFromScannedFiles, getIndexMemoryBudget, getIndexMeta, hasIndex, loadIndex, refreshIndexIfStale, } from './indexer.js';
|
|
13
|
-
import { DEFAULT_BOOST } from './types.js';
|
|
14
|
-
import { appendSessionResults, getPendingResults, injectApprovedResults, initSessionDir, resolveSessionPath, } from '../session.js';
|
|
15
|
-
/**
|
|
16
|
-
* Parse boost string like "title:3,headings:2,content:1"
|
|
17
|
-
* into an object { title: 3, headings: 2, content: 1 }
|
|
18
|
-
*/
|
|
19
|
-
function parseBoost(raw) {
|
|
20
|
-
const boost = {};
|
|
21
|
-
for (const pair of raw.split(',')) {
|
|
22
|
-
const [k, v] = pair.split(':');
|
|
23
|
-
if (k && v !== undefined) {
|
|
24
|
-
boost[k.trim()] = parseFloat(v.trim());
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return boost;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Search local documents and inject results into session.
|
|
31
|
-
* Auto-indexes the path if not already indexed.
|
|
32
|
-
*/
|
|
33
|
-
export async function docSearch(opts) {
|
|
34
|
-
const { query, topK } = opts;
|
|
35
|
-
const absPath = resolve(opts.path);
|
|
36
|
-
// Validate query
|
|
37
|
-
if (!query || query.trim().length === 0) {
|
|
38
|
-
throw Object.assign(new Error('Query is empty'), { code: 'EMPTY_QUERY' });
|
|
39
|
-
}
|
|
40
|
-
// Auto-index if needed
|
|
41
|
-
if (!hasIndex(absPath)) {
|
|
42
|
-
const memoryBudgetBytes = getIndexMemoryBudget();
|
|
43
|
-
try {
|
|
44
|
-
await buildIndexFromScannedFiles(absPath, scanFiles(absPath, { maxFileSize: Math.min(10 * 1024 * 1024, Math.floor(memoryBudgetBytes / 8)) }), memoryBudgetBytes);
|
|
45
|
-
}
|
|
46
|
-
catch (err) {
|
|
47
|
-
if (err.code === 'NO_INDEXABLE_FILES') {
|
|
48
|
-
throw Object.assign(new Error(`No indexable files found in ${absPath} (supported: .md, .txt)`), { code: 'NO_INDEXABLE_FILES' });
|
|
49
|
-
}
|
|
50
|
-
if (err.code === 'MEMORY_LIMIT_REACHED') {
|
|
51
|
-
throw Object.assign(new Error('Not enough free memory to index any local documents.'), {
|
|
52
|
-
code: 'MEMORY_LIMIT_REACHED',
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
throw err;
|
|
56
|
-
}
|
|
57
|
-
if (!hasIndex(absPath)) {
|
|
58
|
-
throw Object.assign(new Error(`No indexable files found in ${absPath} (supported: .md, .txt)`), { code: 'NO_INDEXABLE_FILES' });
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
let refreshed = false;
|
|
62
|
-
let stale = false;
|
|
63
|
-
try {
|
|
64
|
-
refreshed = await refreshIndexIfStale(absPath);
|
|
65
|
-
}
|
|
66
|
-
catch {
|
|
67
|
-
// A prior usable index is safer than turning a refresh issue into no search.
|
|
68
|
-
stale = true;
|
|
69
|
-
}
|
|
70
|
-
// Load index
|
|
71
|
-
let db;
|
|
72
|
-
try {
|
|
73
|
-
db = await loadIndex(absPath);
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
throw Object.assign(new Error('Failed to load search index. Try re-indexing with doc-index.'), { code: 'INDEX_LOAD_ERROR' });
|
|
77
|
-
}
|
|
78
|
-
// Determine boost
|
|
79
|
-
const boost = opts.boost || DEFAULT_BOOST;
|
|
80
|
-
// Search
|
|
81
|
-
let searchResult;
|
|
82
|
-
try {
|
|
83
|
-
searchResult = await oramaSearch(db, {
|
|
84
|
-
term: query,
|
|
85
|
-
mode: 'fulltext',
|
|
86
|
-
limit: topK,
|
|
87
|
-
boost,
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
catch {
|
|
91
|
-
throw Object.assign(new Error('Search failed'), { code: 'SEARCH_ERROR' });
|
|
92
|
-
}
|
|
93
|
-
// BM25 zero-results fallback: fuzzy title match via Levenshtein
|
|
94
|
-
if (!searchResult.hits || searchResult.hits.length === 0) {
|
|
95
|
-
const fallback = fuzzyTitleFallback(db, query, topK);
|
|
96
|
-
if (fallback.length > 0) {
|
|
97
|
-
searchResult = { hits: fallback };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (!searchResult.hits || searchResult.hits.length === 0) {
|
|
101
|
-
return {
|
|
102
|
-
session: opts.session,
|
|
103
|
-
query,
|
|
104
|
-
path: absPath,
|
|
105
|
-
added: 0,
|
|
106
|
-
totalPending: 0,
|
|
107
|
-
partial: getIndexMeta(absPath)?.partial ?? false,
|
|
108
|
-
freshness: stale ? 'stale' : getIndexMeta(absPath)?.partial ? 'partial' : 'fresh',
|
|
109
|
-
refreshed,
|
|
110
|
-
results: [],
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
// Format as SessionResult[]
|
|
114
|
-
const results = [];
|
|
115
|
-
const indexedAt = Date.now();
|
|
116
|
-
for (const hit of searchResult.hits) {
|
|
117
|
-
const doc = hit.document;
|
|
118
|
-
// Build title: "DocumentName — Section / Subsection"
|
|
119
|
-
const sectionParts = [];
|
|
120
|
-
if (doc.headings && doc.headings.length > 0) {
|
|
121
|
-
sectionParts.push(...doc.headings);
|
|
122
|
-
}
|
|
123
|
-
let title;
|
|
124
|
-
if (sectionParts.length > 0) {
|
|
125
|
-
title = `${doc.title || doc.filePath} — ${sectionParts.join(' / ')}`;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
title = doc.title || doc.filePath || 'Untitled';
|
|
129
|
-
}
|
|
130
|
-
// Build file:/// URL with absolute path
|
|
131
|
-
const absFile = resolve(absPath, doc.filePath);
|
|
132
|
-
const url = `file://${absFile}#chunk-${doc.chunkIndex}`;
|
|
133
|
-
results.push({
|
|
134
|
-
url,
|
|
135
|
-
title,
|
|
136
|
-
contentType: 'extracted',
|
|
137
|
-
content: doc.content || '',
|
|
138
|
-
extractor: 'local-index',
|
|
139
|
-
extractedAt: indexedAt,
|
|
140
|
-
score: hit.score,
|
|
141
|
-
filePath: doc.filePath,
|
|
142
|
-
headings: doc.headings || [],
|
|
143
|
-
chunkIndex: doc.chunkIndex,
|
|
144
|
-
origins: [{ tool: 'local-index', query }],
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
// Inject into session (skip round increment — merged with current web round)
|
|
148
|
-
const sessionDir = resolveSessionPath(opts.session);
|
|
149
|
-
initSessionDir(sessionDir); // ensure meta.json exists
|
|
150
|
-
const { added, total, approvedResults } = appendSessionResults(sessionDir, results, {
|
|
151
|
-
skipRoundIncrement: true,
|
|
152
|
-
});
|
|
153
|
-
injectApprovedResults(sessionDir, approvedResults);
|
|
154
|
-
const pendingCount = getPendingResults(sessionDir).length;
|
|
155
|
-
return {
|
|
156
|
-
session: sessionDir,
|
|
157
|
-
query,
|
|
158
|
-
path: absPath,
|
|
159
|
-
added,
|
|
160
|
-
totalPending: pendingCount,
|
|
161
|
-
partial: getIndexMeta(absPath)?.partial ?? false,
|
|
162
|
-
freshness: stale ? 'stale' : getIndexMeta(absPath)?.partial ? 'partial' : 'fresh',
|
|
163
|
-
refreshed,
|
|
164
|
-
results,
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Fallback when BM25 returns zero: match query words against document titles
|
|
169
|
-
* using Levenshtein distance ≤ 2. Returns at most topK results.
|
|
170
|
-
*/
|
|
171
|
-
function fuzzyTitleFallback(db, query, topK) {
|
|
172
|
-
const qWords = query.toLowerCase().split(/\s+/).filter(Boolean);
|
|
173
|
-
if (qWords.length === 0)
|
|
174
|
-
return [];
|
|
175
|
-
// ponytail: Orama internal doc store, cache-based fallback if access pattern changes
|
|
176
|
-
const docs = db.data?.documents;
|
|
177
|
-
if (!docs || typeof docs.values !== 'function')
|
|
178
|
-
return [];
|
|
179
|
-
const candidates = [];
|
|
180
|
-
for (const doc of docs.values()) {
|
|
181
|
-
const title = (doc.title || '').toLowerCase();
|
|
182
|
-
const tWords = title.split(/\s+/).filter(Boolean);
|
|
183
|
-
if (tWords.length === 0)
|
|
184
|
-
continue;
|
|
185
|
-
let matched = 0;
|
|
186
|
-
let totalDist = 0;
|
|
187
|
-
for (const qw of qWords) {
|
|
188
|
-
let best = Infinity;
|
|
189
|
-
for (const tw of tWords) {
|
|
190
|
-
const d = levenshtein(qw, tw);
|
|
191
|
-
if (d < best)
|
|
192
|
-
best = d;
|
|
193
|
-
}
|
|
194
|
-
if (best <= 2) {
|
|
195
|
-
matched++;
|
|
196
|
-
totalDist += best;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
// At least half the query words must find a fuzzy match
|
|
200
|
-
if (matched >= Math.ceil(qWords.length / 2)) {
|
|
201
|
-
candidates.push({ doc, avgDist: totalDist / matched });
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
candidates.sort((a, b) => a.avgDist - b.avgDist);
|
|
205
|
-
return candidates.slice(0, topK).map((c, i) => ({
|
|
206
|
-
id: c.doc.id || String(i),
|
|
207
|
-
score: 1 / (1 + c.avgDist),
|
|
208
|
-
document: c.doc,
|
|
209
|
-
}));
|
|
210
|
-
}
|
|
211
|
-
export { parseBoost };
|
|
212
|
-
//# sourceMappingURL=searcher.sync-conflict-20260805-191858-2SGIW5T.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"searcher.sync-conflict-20260805-191858-2SGIW5T.js","sourceRoot":"","sources":["../../../src/deep/local-doc/searcher.sync-conflict-20260805-191858-2SGIW5T.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,QAAQ,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EACpB,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EACL,oBAAoB,EACpB,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GAEnB,MAAM,eAAe,CAAC;AAsBvB;;;GAGG;AACH,SAAS,UAAU,CAAC,GAAW;IAC7B,MAAM,KAAK,GAA2B,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,KAAK,SAAS,EAAE,CAAC;YACzB,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAsB;IACpD,MAAM,EAAE,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agent review. Agent makes the final quality decision based on
|
|
6
|
-
* title, content, and source.
|
|
7
|
-
*
|
|
8
|
-
* Three indicators (independent thresholds, no weighted sum):
|
|
9
|
-
* - contentDepth: average extracted content length
|
|
10
|
-
* - sourceDiversity: number of distinct domains
|
|
11
|
-
* - novelty: fraction not similar to earlier approved results (Jaccard)
|
|
12
|
-
*
|
|
13
|
-
* Verdict logic:
|
|
14
|
-
* - good: all pass
|
|
15
|
-
* - acceptable: 1 fails
|
|
16
|
-
* - poor: two or more fail
|
|
17
|
-
*/
|
|
18
|
-
import { SessionResult } from './session.js';
|
|
19
|
-
export interface IndicatorResult {
|
|
20
|
-
value: number;
|
|
21
|
-
threshold: number;
|
|
22
|
-
pass: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface QualityBreakdown {
|
|
25
|
-
contentDepth: IndicatorResult;
|
|
26
|
-
sourceDiversity: IndicatorResult;
|
|
27
|
-
novelty: IndicatorResult;
|
|
28
|
-
}
|
|
29
|
-
export interface QualityScore {
|
|
30
|
-
verdict: 'good' | 'acceptable' | 'poor';
|
|
31
|
-
breakdown: QualityBreakdown;
|
|
32
|
-
failedIndicators: string[];
|
|
33
|
-
}
|
|
34
|
-
export interface QualityThresholds {
|
|
35
|
-
contentDepth: number;
|
|
36
|
-
sourceDiversity: number;
|
|
37
|
-
novelty: number;
|
|
38
|
-
}
|
|
39
|
-
/** Assess results from the newest recorded round against earlier approved results. */
|
|
40
|
-
export declare function assessLatestResultQuality(sessionResults: SessionResult[], thresholds?: Partial<QualityThresholds>): QualityScore;
|
|
41
|
-
/** Assess result quality against session context.
|
|
42
|
-
* Programmatic pre-filter only; the Agent makes the final quality decision.
|
|
43
|
-
* All indicators use independent thresholds with no weighted sum.
|
|
44
|
-
*/
|
|
45
|
-
export declare function assessResultQuality(results: SessionResult[], sessionResults: SessionResult[], thresholds?: Partial<QualityThresholds>): QualityScore;
|
|
46
|
-
//# sourceMappingURL=quality-assess.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quality-assess.d.ts","sourceRoot":"","sources":["../../src/deep/quality-assess.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,EAAE,eAAe,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IACxC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACnB;AA0ED,sFAAsF;AACtF,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACxC,YAAY,CAoBd;AAID;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,aAAa,EAAE,EACxB,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACxC,YAAY,CAEd"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result quality assessment for deep search sessions.
|
|
3
|
-
*
|
|
4
|
-
* Programmatic pre-filter: removes obviously poor results before
|
|
5
|
-
* Agent review. Agent makes the final quality decision based on
|
|
6
|
-
* title, content, and source.
|
|
7
|
-
*
|
|
8
|
-
* Three indicators (independent thresholds, no weighted sum):
|
|
9
|
-
* - contentDepth: average extracted content length
|
|
10
|
-
* - sourceDiversity: number of distinct domains
|
|
11
|
-
* - novelty: fraction not similar to earlier approved results (Jaccard)
|
|
12
|
-
*
|
|
13
|
-
* Verdict logic:
|
|
14
|
-
* - good: all pass
|
|
15
|
-
* - acceptable: 1 fails
|
|
16
|
-
* - poor: two or more fail
|
|
17
|
-
*/
|
|
18
|
-
import { jaccardSimilarity, resultUrlKey } from './dedupe.js';
|
|
19
|
-
const DEFAULT_THRESHOLDS = {
|
|
20
|
-
contentDepth: 150,
|
|
21
|
-
sourceDiversity: 3,
|
|
22
|
-
novelty: 0.3,
|
|
23
|
-
};
|
|
24
|
-
const NOVELTY_SIMILARITY_THRESHOLD = 0.75;
|
|
25
|
-
// Indicator computations
|
|
26
|
-
/** Extract domain from URL */
|
|
27
|
-
function extractDomain(url) {
|
|
28
|
-
if (url.startsWith('file://'))
|
|
29
|
-
return ''; // Local documents have no domain.
|
|
30
|
-
try {
|
|
31
|
-
return new URL(url).hostname;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return '';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** Compute content depth from extracted results only. */
|
|
38
|
-
function computeContentDepth(results, threshold) {
|
|
39
|
-
const extracted = results.filter(r => r.content && r.content.length > 0);
|
|
40
|
-
if (extracted.length === 0) {
|
|
41
|
-
return { value: 0, threshold, pass: false };
|
|
42
|
-
}
|
|
43
|
-
const totalLength = extracted.reduce((sum, r) => sum + (r.content?.length ?? 0), 0);
|
|
44
|
-
const value = totalLength / extracted.length;
|
|
45
|
-
return { value, threshold, pass: value >= threshold };
|
|
46
|
-
}
|
|
47
|
-
/** Compute source diversity as the number of distinct domains. */
|
|
48
|
-
function computeSourceDiversity(newResults, threshold) {
|
|
49
|
-
const domains = new Set();
|
|
50
|
-
for (const r of newResults) {
|
|
51
|
-
const domain = extractDomain(r.url);
|
|
52
|
-
if (domain)
|
|
53
|
-
domains.add(domain);
|
|
54
|
-
}
|
|
55
|
-
const value = domains.size;
|
|
56
|
-
return { value, threshold, pass: value >= threshold };
|
|
57
|
-
}
|
|
58
|
-
/** Compute text novelty against distinct historical URLs. */
|
|
59
|
-
function computeNovelty(newResults, sessionResults, threshold, seenEarlierUrls) {
|
|
60
|
-
if (newResults.length === 0) {
|
|
61
|
-
return { value: 0, threshold, pass: false };
|
|
62
|
-
}
|
|
63
|
-
if (sessionResults.length === 0 && !seenEarlierUrls?.size) {
|
|
64
|
-
return { value: 1, threshold, pass: true };
|
|
65
|
-
}
|
|
66
|
-
let novelCount = 0;
|
|
67
|
-
for (const r of newResults) {
|
|
68
|
-
const text = r.content || r.title;
|
|
69
|
-
const repeatedFromEarlierRound = seenEarlierUrls?.has(resultUrlKey(r)) ?? false;
|
|
70
|
-
const isSimilarToPriorResult = sessionResults.some(existing => existing.url !== r.url
|
|
71
|
-
&& jaccardSimilarity(text, existing.content || existing.title) >= NOVELTY_SIMILARITY_THRESHOLD);
|
|
72
|
-
if (!repeatedFromEarlierRound && !isSimilarToPriorResult)
|
|
73
|
-
novelCount++;
|
|
74
|
-
}
|
|
75
|
-
const value = novelCount / newResults.length;
|
|
76
|
-
return { value, threshold, pass: value >= threshold };
|
|
77
|
-
}
|
|
78
|
-
/** Assess results from the newest recorded round against earlier approved results. */
|
|
79
|
-
export function assessLatestResultQuality(sessionResults, thresholds) {
|
|
80
|
-
const rounds = sessionResults.flatMap(result => (result.origins || []).map(origin => origin.round).filter((round) => Number.isInteger(round)));
|
|
81
|
-
if (rounds.length === 0)
|
|
82
|
-
return assessResultQuality(sessionResults, sessionResults, thresholds);
|
|
83
|
-
const latestRound = Math.max(...rounds);
|
|
84
|
-
const isFromRound = (result, predicate) => (result.origins || []).some(origin => origin.round !== undefined && predicate(origin.round));
|
|
85
|
-
const latestResults = sessionResults.filter(result => !result.skippedAt && isFromRound(result, round => round === latestRound));
|
|
86
|
-
const priorApproved = sessionResults.filter(result => result.status === 'approved' && !result.skippedAt && isFromRound(result, round => round < latestRound));
|
|
87
|
-
const seenEarlierUrls = new Set(sessionResults
|
|
88
|
-
.filter(result => isFromRound(result, round => round < latestRound))
|
|
89
|
-
.map(result => resultUrlKey(result)));
|
|
90
|
-
return assessQuality(latestResults, priorApproved, thresholds, seenEarlierUrls);
|
|
91
|
-
}
|
|
92
|
-
// Main assessment
|
|
93
|
-
/** Assess result quality against session context.
|
|
94
|
-
* Programmatic pre-filter only; the Agent makes the final quality decision.
|
|
95
|
-
* All indicators use independent thresholds with no weighted sum.
|
|
96
|
-
*/
|
|
97
|
-
export function assessResultQuality(results, sessionResults, thresholds) {
|
|
98
|
-
return assessQuality(results, sessionResults, thresholds);
|
|
99
|
-
}
|
|
100
|
-
function assessQuality(results, sessionResults, thresholds, seenEarlierUrls) {
|
|
101
|
-
const t = { ...DEFAULT_THRESHOLDS, ...thresholds };
|
|
102
|
-
const breakdown = {
|
|
103
|
-
contentDepth: computeContentDepth(results, t.contentDepth),
|
|
104
|
-
sourceDiversity: computeSourceDiversity(results, t.sourceDiversity),
|
|
105
|
-
novelty: computeNovelty(results, sessionResults, t.novelty, seenEarlierUrls),
|
|
106
|
-
};
|
|
107
|
-
const failedIndicators = Object.entries(breakdown)
|
|
108
|
-
.filter(([, v]) => !v.pass)
|
|
109
|
-
.map(([k]) => k);
|
|
110
|
-
let verdict;
|
|
111
|
-
if (failedIndicators.length === 0) {
|
|
112
|
-
verdict = 'good';
|
|
113
|
-
}
|
|
114
|
-
else if (failedIndicators.length === 1) {
|
|
115
|
-
verdict = 'acceptable';
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
verdict = 'poor';
|
|
119
|
-
}
|
|
120
|
-
return { verdict, breakdown, failedIndicators };
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=quality-assess.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quality-assess.js","sourceRoot":"","sources":["../../src/deep/quality-assess.ts"],"names":[],"mappings":"AAAA;;;;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,CAAC;KAC/E,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SAC1B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,OAAgC,CAAC;IACrC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,YAAY,CAAC;IAC3B,CAAC;SAAM,CAAC;QACJ,OAAO,GAAG,MAAM,CAAC;IACrB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result quality assessment for deep search sessions.
|
|
3
|
-
*
|
|
4
|
-
* Programmatic pre-filter: removes obviously poor results before
|
|
5
|
-
* Agent review. Agent makes the final quality decision based on
|
|
6
|
-
* title, content, and source.
|
|
7
|
-
*
|
|
8
|
-
* Three indicators (independent thresholds, no weighted sum):
|
|
9
|
-
* - contentDepth: average extracted content length
|
|
10
|
-
* - sourceDiversity: number of distinct domains
|
|
11
|
-
* - novelty: fraction not similar to earlier approved results (Jaccard)
|
|
12
|
-
*
|
|
13
|
-
* Verdict logic:
|
|
14
|
-
* - good: all pass
|
|
15
|
-
* - acceptable: 1 fails
|
|
16
|
-
* - poor: 鈮? fail
|
|
17
|
-
*/
|
|
18
|
-
import { SessionResult } from './session.js';
|
|
19
|
-
export interface IndicatorResult {
|
|
20
|
-
value: number;
|
|
21
|
-
threshold: number;
|
|
22
|
-
pass: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface QualityBreakdown {
|
|
25
|
-
contentDepth: IndicatorResult;
|
|
26
|
-
sourceDiversity: IndicatorResult;
|
|
27
|
-
novelty: IndicatorResult;
|
|
28
|
-
}
|
|
29
|
-
export interface QualityScore {
|
|
30
|
-
verdict: 'good' | 'acceptable' | 'poor';
|
|
31
|
-
breakdown: QualityBreakdown;
|
|
32
|
-
failedIndicators: string[];
|
|
33
|
-
}
|
|
34
|
-
export interface QualityThresholds {
|
|
35
|
-
contentDepth: number;
|
|
36
|
-
sourceDiversity: number;
|
|
37
|
-
novelty: number;
|
|
38
|
-
}
|
|
39
|
-
/** Assess results from the newest recorded round against earlier approved results. */
|
|
40
|
-
export declare function assessLatestResultQuality(sessionResults: SessionResult[], thresholds?: Partial<QualityThresholds>): QualityScore;
|
|
41
|
-
/** Assess the quality of results against session context.
|
|
42
|
-
* Programmatic pre-filter only 鈥?Agent makes final quality decision.
|
|
43
|
-
* All indicators use independent thresholds 鈥?no weighted sum.
|
|
44
|
-
*/
|
|
45
|
-
export declare function assessResultQuality(results: SessionResult[], sessionResults: SessionResult[], thresholds?: Partial<QualityThresholds>): QualityScore;
|
|
46
|
-
//# sourceMappingURL=quality-assess.sync-conflict-20260728-195206-JAULAPO.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quality-assess.sync-conflict-20260728-195206-JAULAPO.d.ts","sourceRoot":"","sources":["../../src/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,MAAM,WAAW,eAAe;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,YAAY,EAAE,eAAe,CAAC;IAC9B,eAAe,EAAE,eAAe,CAAC;IACjC,OAAO,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;IACxC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;CACnB;AA0ED,sFAAsF;AACtF,wBAAgB,yBAAyB,CACrC,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACxC,YAAY,CAoBd;AAID;;;GAGG;AACH,wBAAgB,mBAAmB,CAC/B,OAAO,EAAE,aAAa,EAAE,EACxB,cAAc,EAAE,aAAa,EAAE,EAC/B,UAAU,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACxC,YAAY,CAEd"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result quality assessment for deep search sessions.
|
|
3
|
-
*
|
|
4
|
-
* Programmatic pre-filter: removes obviously poor results before
|
|
5
|
-
* Agent review. Agent makes the final quality decision based on
|
|
6
|
-
* title, content, and source.
|
|
7
|
-
*
|
|
8
|
-
* Three indicators (independent thresholds, no weighted sum):
|
|
9
|
-
* - contentDepth: average extracted content length
|
|
10
|
-
* - sourceDiversity: number of distinct domains
|
|
11
|
-
* - novelty: fraction not similar to earlier approved results (Jaccard)
|
|
12
|
-
*
|
|
13
|
-
* Verdict logic:
|
|
14
|
-
* - good: all pass
|
|
15
|
-
* - acceptable: 1 fails
|
|
16
|
-
* - poor: 鈮? fail
|
|
17
|
-
*/
|
|
18
|
-
import { jaccardSimilarity, resultUrlKey } from './dedupe.js';
|
|
19
|
-
const DEFAULT_THRESHOLDS = {
|
|
20
|
-
contentDepth: 150,
|
|
21
|
-
sourceDiversity: 3,
|
|
22
|
-
novelty: 0.3,
|
|
23
|
-
};
|
|
24
|
-
const NOVELTY_SIMILARITY_THRESHOLD = 0.75;
|
|
25
|
-
// 鈹€鈹€ Indicator computations 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
|
|
26
|
-
/** Extract domain from URL */
|
|
27
|
-
function extractDomain(url) {
|
|
28
|
-
if (url.startsWith('file://'))
|
|
29
|
-
return ''; // local docs 鈫?no domain
|
|
30
|
-
try {
|
|
31
|
-
return new URL(url).hostname;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return '';
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
/** Compute content depth indicator 鈥?average content length of extracted results only */
|
|
38
|
-
function computeContentDepth(results, threshold) {
|
|
39
|
-
const extracted = results.filter(r => r.content && r.content.length > 0);
|
|
40
|
-
if (extracted.length === 0) {
|
|
41
|
-
return { value: 0, threshold, pass: false };
|
|
42
|
-
}
|
|
43
|
-
const totalLength = extracted.reduce((sum, r) => sum + (r.content?.length ?? 0), 0);
|
|
44
|
-
const value = totalLength / extracted.length;
|
|
45
|
-
return { value, threshold, pass: value >= threshold };
|
|
46
|
-
}
|
|
47
|
-
/** Compute source diversity indicator 鈥?number of distinct domains */
|
|
48
|
-
function computeSourceDiversity(newResults, threshold) {
|
|
49
|
-
const domains = new Set();
|
|
50
|
-
for (const r of newResults) {
|
|
51
|
-
const domain = extractDomain(r.url);
|
|
52
|
-
if (domain)
|
|
53
|
-
domains.add(domain);
|
|
54
|
-
}
|
|
55
|
-
const value = domains.size;
|
|
56
|
-
return { value, threshold, pass: value >= threshold };
|
|
57
|
-
}
|
|
58
|
-
/** Compute text novelty against distinct historical URLs. */
|
|
59
|
-
function computeNovelty(newResults, sessionResults, threshold, seenEarlierUrls) {
|
|
60
|
-
if (newResults.length === 0) {
|
|
61
|
-
return { value: 0, threshold, pass: false };
|
|
62
|
-
}
|
|
63
|
-
if (sessionResults.length === 0 && !seenEarlierUrls?.size) {
|
|
64
|
-
return { value: 1, threshold, pass: true };
|
|
65
|
-
}
|
|
66
|
-
let novelCount = 0;
|
|
67
|
-
for (const r of newResults) {
|
|
68
|
-
const text = r.content || r.title;
|
|
69
|
-
const repeatedFromEarlierRound = seenEarlierUrls?.has(resultUrlKey(r)) ?? false;
|
|
70
|
-
const isSimilarToPriorResult = sessionResults.some(existing => existing.url !== r.url
|
|
71
|
-
&& jaccardSimilarity(text, existing.content || existing.title) >= NOVELTY_SIMILARITY_THRESHOLD);
|
|
72
|
-
if (!repeatedFromEarlierRound && !isSimilarToPriorResult)
|
|
73
|
-
novelCount++;
|
|
74
|
-
}
|
|
75
|
-
const value = novelCount / newResults.length;
|
|
76
|
-
return { value, threshold, pass: value >= threshold };
|
|
77
|
-
}
|
|
78
|
-
/** Assess results from the newest recorded round against earlier approved results. */
|
|
79
|
-
export function assessLatestResultQuality(sessionResults, thresholds) {
|
|
80
|
-
const rounds = sessionResults.flatMap(result => (result.origins || []).map(origin => origin.round).filter((round) => Number.isInteger(round)));
|
|
81
|
-
if (rounds.length === 0)
|
|
82
|
-
return assessResultQuality(sessionResults, sessionResults, thresholds);
|
|
83
|
-
const latestRound = Math.max(...rounds);
|
|
84
|
-
const isFromRound = (result, predicate) => (result.origins || []).some(origin => origin.round !== undefined && predicate(origin.round));
|
|
85
|
-
const latestResults = sessionResults.filter(result => isFromRound(result, round => round === latestRound));
|
|
86
|
-
const priorApproved = sessionResults.filter(result => result.status === 'approved' && isFromRound(result, round => round < latestRound));
|
|
87
|
-
const seenEarlierUrls = new Set(sessionResults
|
|
88
|
-
.filter(result => isFromRound(result, round => round < latestRound))
|
|
89
|
-
.map(result => resultUrlKey(result)));
|
|
90
|
-
return assessQuality(latestResults, priorApproved, thresholds, seenEarlierUrls);
|
|
91
|
-
}
|
|
92
|
-
// 鈹€鈹€ Main assessment 鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€鈹€
|
|
93
|
-
/** Assess the quality of results against session context.
|
|
94
|
-
* Programmatic pre-filter only 鈥?Agent makes final quality decision.
|
|
95
|
-
* All indicators use independent thresholds 鈥?no weighted sum.
|
|
96
|
-
*/
|
|
97
|
-
export function assessResultQuality(results, sessionResults, thresholds) {
|
|
98
|
-
return assessQuality(results, sessionResults, thresholds);
|
|
99
|
-
}
|
|
100
|
-
function assessQuality(results, sessionResults, thresholds, seenEarlierUrls) {
|
|
101
|
-
const t = { ...DEFAULT_THRESHOLDS, ...thresholds };
|
|
102
|
-
const breakdown = {
|
|
103
|
-
contentDepth: computeContentDepth(results, t.contentDepth),
|
|
104
|
-
sourceDiversity: computeSourceDiversity(results, t.sourceDiversity),
|
|
105
|
-
novelty: computeNovelty(results, sessionResults, t.novelty, seenEarlierUrls),
|
|
106
|
-
};
|
|
107
|
-
const failedIndicators = Object.entries(breakdown)
|
|
108
|
-
.filter(([, v]) => !v.pass)
|
|
109
|
-
.map(([k]) => k);
|
|
110
|
-
let verdict;
|
|
111
|
-
if (failedIndicators.length === 0) {
|
|
112
|
-
verdict = 'good';
|
|
113
|
-
}
|
|
114
|
-
else if (failedIndicators.length === 1) {
|
|
115
|
-
verdict = 'acceptable';
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
verdict = 'poor';
|
|
119
|
-
}
|
|
120
|
-
return { verdict, breakdown, failedIndicators };
|
|
121
|
-
}
|
|
122
|
-
//# sourceMappingURL=quality-assess.sync-conflict-20260728-195206-JAULAPO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"quality-assess.sync-conflict-20260728-195206-JAULAPO.js","sourceRoot":"","sources":["../../src/deep/quality-assess.sync-conflict-20260728-195206-JAULAPO.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AA6B9D,MAAM,kBAAkB,GAAsB;IAC1C,YAAY,EAAE,GAAG;IACjB,eAAe,EAAE,CAAC;IAClB,OAAO,EAAE,GAAG;CACf,CAAC;AAEF,MAAM,4BAA4B,GAAG,IAAI,CAAC;AAE1C,+GAA+G;AAE/G,8BAA8B;AAC9B,SAAS,aAAa,CAAC,GAAW;IAC9B,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAC,CAAC,yBAAyB;IACnE,IAAI,CAAC;QACD,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;IACjC,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,EAAE,CAAC;IACd,CAAC;AACL,CAAC;AAED,yFAAyF;AACzF,SAAS,mBAAmB,CAAC,OAAwB,EAAE,SAAiB;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzE,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IAChD,CAAC;IACD,MAAM,WAAW,GAAG,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACpF,MA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;QACnE,OAAO,EAAE,cAAc,CAAC,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,eAAe,CAAC;KAC/E,CAAC;IAEF,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;SAC7C,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SAC1B,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAErB,IAAI,OAAgC,CAAC;IACrC,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,OAAO,GAAG,MAAM,CAAC;IACrB,CAAC;SAAM,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,GAAG,YAAY,CAAC;IAC3B,CAAC;SAAM,CAAC;QACJ,OAAO,GAAG,MAAM,CAAC;IACrB,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Recovery analysis for deep search sessions.
|
|
3
|
-
*
|
|
4
|
-
* When search quality is poor, analyze the session and suggest recovery
|
|
5
|
-
* strategies for the Agent. CLI outputs analysis data only — Agent decides.
|
|
6
|
-
*
|
|
7
|
-
* Recovery strategies:
|
|
8
|
-
* - reformulate: query too specific → remove qualifiers or use broader terms
|
|
9
|
-
* - engine_rotation: current engines not covering sources → try different engines
|
|
10
|
-
* - category_shift: category results poor → switch category
|
|
11
|
-
* - backtrack: ≥2 consecutive poor rounds → return to last successful query direction
|
|
12
|
-
*/
|
|
13
|
-
import { DirectedGraph } from 'graphology';
|
|
14
|
-
import { GraphNodeAttrs, GraphEdgeAttrs } from './graph.js';
|
|
15
|
-
import { SessionResult } from './session.js';
|
|
16
|
-
import { QualityScore, QualityThresholds } from './quality-assess.js';
|
|
17
|
-
import { StrategyConfig } from './search-strategy.js';
|
|
18
|
-
export type RecoveryStrategy = 'reformulate' | 'engine_rotation' | 'category_shift' | 'backtrack';
|
|
19
|
-
export interface RecoveryStrategyInfo {
|
|
20
|
-
strategy: RecoveryStrategy;
|
|
21
|
-
reason: string;
|
|
22
|
-
suggestion: string;
|
|
23
|
-
backtrackTo?: {
|
|
24
|
-
round: number;
|
|
25
|
-
query: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export interface RoundQuality {
|
|
29
|
-
round: number;
|
|
30
|
-
query: string;
|
|
31
|
-
verdict: QualityScore['verdict'];
|
|
32
|
-
failedIndicators: string[];
|
|
33
|
-
}
|
|
34
|
-
export interface RecoveryAnalysis {
|
|
35
|
-
qualityScore: QualityScore;
|
|
36
|
-
recentFailures: number;
|
|
37
|
-
availableStrategies: RecoveryStrategyInfo[];
|
|
38
|
-
lastSuccessfulRound: {
|
|
39
|
-
round: number;
|
|
40
|
-
query: string;
|
|
41
|
-
quality: string;
|
|
42
|
-
} | null;
|
|
43
|
-
roundQualityHistory: RoundQuality[];
|
|
44
|
-
}
|
|
45
|
-
/** Build per-round quality history from the session graph and results.
|
|
46
|
-
* Each query node in the graph represents a round. We assess quality
|
|
47
|
-
* of results yielded by that query against the accumulated results up
|
|
48
|
-
* to that round. */
|
|
49
|
-
export declare function buildRoundQualityHistory(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>, sessionResults: SessionResult[], qualityThresholds?: Partial<QualityThresholds>): RoundQuality[];
|
|
50
|
-
/** Analyze recovery options for a session with poor quality results.
|
|
51
|
-
* Returns available strategies with reasons and suggestions. */
|
|
52
|
-
export declare function analyzeRecoveryOptions(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>, sessionResults: SessionResult[], qualityScore: QualityScore, config?: Partial<StrategyConfig>): RecoveryAnalysis;
|
|
53
|
-
/** Backtrack via graph traversal: find the query node that yielded
|
|
54
|
-
* the most results connected to high-degree entity nodes.
|
|
55
|
-
* Returns the query and round to backtrack to. */
|
|
56
|
-
export declare function backtrackToBestQuery(graph: DirectedGraph<GraphNodeAttrs, GraphEdgeAttrs>): {
|
|
57
|
-
round: number;
|
|
58
|
-
query: string;
|
|
59
|
-
} | null;
|
|
60
|
-
//# sourceMappingURL=recovery-analysis.d.ts.map
|