@monoes/monograph 1.5.1 → 1.5.2
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/.monodesign/hook.cache.json +1 -0
- package/dist/src/analysis/cycles.d.ts.map +1 -1
- package/dist/src/analysis/cycles.js +5 -3
- package/dist/src/analysis/cycles.js.map +1 -1
- package/dist/src/analysis/trace.d.ts.map +1 -1
- package/dist/src/analysis/trace.js +1 -19
- package/dist/src/analysis/trace.js.map +1 -1
- package/dist/src/analysis/worker-pool.d.ts.map +1 -1
- package/dist/src/analysis/worker-pool.js +9 -7
- package/dist/src/analysis/worker-pool.js.map +1 -1
- package/dist/src/cli/skill-gen.d.ts.map +1 -1
- package/dist/src/cli/skill-gen.js +16 -25
- package/dist/src/cli/skill-gen.js.map +1 -1
- package/dist/src/export/html.d.ts.map +1 -1
- package/dist/src/export/html.js +3 -2
- package/dist/src/export/html.js.map +1 -1
- package/dist/src/graph/regex-search.d.ts.map +1 -1
- package/dist/src/graph/regex-search.js +9 -3
- package/dist/src/graph/regex-search.js.map +1 -1
- package/dist/src/pipeline/phases/call-site-extractors.d.ts +17 -0
- package/dist/src/pipeline/phases/call-site-extractors.d.ts.map +1 -0
- package/dist/src/pipeline/phases/call-site-extractors.js +132 -0
- package/dist/src/pipeline/phases/call-site-extractors.js.map +1 -0
- package/dist/src/pipeline/phases/module-resolution.d.ts +10 -0
- package/dist/src/pipeline/phases/module-resolution.d.ts.map +1 -0
- package/dist/src/pipeline/phases/module-resolution.js +301 -0
- package/dist/src/pipeline/phases/module-resolution.js.map +1 -0
- package/dist/src/pipeline/phases/orm.js +1 -2
- package/dist/src/pipeline/phases/orm.js.map +1 -1
- package/dist/src/pipeline/phases/scope-resolution.d.ts +2 -25
- package/dist/src/pipeline/phases/scope-resolution.d.ts.map +1 -1
- package/dist/src/pipeline/phases/scope-resolution.js +18 -580
- package/dist/src/pipeline/phases/scope-resolution.js.map +1 -1
- package/dist/src/pipeline/phases/wildcard-phase.d.ts.map +1 -1
- package/dist/src/pipeline/phases/wildcard-phase.js +6 -1
- package/dist/src/pipeline/phases/wildcard-phase.js.map +1 -1
- package/dist/src/search/hybrid-query.js +1 -1
- package/dist/src/search/hybrid-query.js.map +1 -1
- package/dist/src/web/api.d.ts.map +1 -1
- package/dist/src/web/api.js +17 -14
- package/dist/src/web/api.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/__tests__/pipeline/phases/wildcard-phase.test.ts +39 -4
- package/src/analysis/cycles.ts +7 -3
- package/src/analysis/trace.ts +1 -21
- package/src/analysis/worker-pool.ts +8 -7
- package/src/cli/skill-gen.ts +6 -14
- package/src/export/html.ts +3 -2
- package/src/graph/regex-search.ts +9 -5
- package/src/pipeline/phases/call-site-extractors.ts +169 -0
- package/src/pipeline/phases/module-resolution.ts +294 -0
- package/src/pipeline/phases/orm.ts +1 -2
- package/src/pipeline/phases/scope-resolution.ts +25 -618
- package/src/pipeline/phases/wildcard-phase.ts +5 -1
- package/src/search/hybrid-query.ts +1 -1
- package/src/web/api.ts +17 -13
|
@@ -32,7 +32,11 @@ export const wildcardSynthesisPhase: PipelinePhase<WildcardSynthesisOutput> = {
|
|
|
32
32
|
`);
|
|
33
33
|
|
|
34
34
|
for (const [filePath, source] of fileContents) {
|
|
35
|
-
const fileNodeId = fileNodeIndex.get(filePath)
|
|
35
|
+
const fileNodeId = fileNodeIndex.get(filePath);
|
|
36
|
+
// No real node for this file (e.g. no parsed symbols) — there's no
|
|
37
|
+
// valid row to attach a source_id to, and fabricating one violates the
|
|
38
|
+
// edges table's FOREIGN KEY constraint on source_id (issue #40).
|
|
39
|
+
if (!fileNodeId) continue;
|
|
36
40
|
const { synthesizedEdges } = synthesizeWildcardImports(fileNodeId, source, allKnownNodes, allKnownEdges);
|
|
37
41
|
|
|
38
42
|
for (const edge of synthesizedEdges) {
|
|
@@ -48,7 +48,7 @@ export async function hybridQuery(
|
|
|
48
48
|
const normalizedQuery = normalizeSearchTerm(query);
|
|
49
49
|
|
|
50
50
|
// ── BM25 via FTS5 ──────────────────────────────────────────────────────────
|
|
51
|
-
const bm25Limit = 50;
|
|
51
|
+
const bm25Limit = Math.max(limit, 50);
|
|
52
52
|
const bm25Raw = ftsSearch(db, normalizedQuery, bm25Limit, label);
|
|
53
53
|
const bm25Results: RankedResult[] = bm25Raw.map((r) => ({
|
|
54
54
|
id: r.id,
|
package/src/web/api.ts
CHANGED
|
@@ -95,23 +95,27 @@ export function queryGraphData(db: Database.Database): GraphData {
|
|
|
95
95
|
|
|
96
96
|
const edges: ApiEdge[] = [];
|
|
97
97
|
if (nodeIds.size > 0) {
|
|
98
|
-
//
|
|
98
|
+
// Use a temp table so SQLite filters edges instead of scanning full table in JS
|
|
99
|
+
db.exec('CREATE TEMP TABLE IF NOT EXISTS _vis_nodes (id TEXT PRIMARY KEY)');
|
|
100
|
+
db.exec('DELETE FROM _vis_nodes');
|
|
101
|
+
const insertVis = db.prepare('INSERT OR IGNORE INTO _vis_nodes (id) VALUES (?)');
|
|
102
|
+
const insertAll = db.transaction((ids: string[]) => { for (const id of ids) insertVis.run(id); });
|
|
103
|
+
insertAll([...nodeIds]);
|
|
104
|
+
|
|
99
105
|
const edgeRows = db
|
|
100
|
-
.prepare(
|
|
106
|
+
.prepare(`SELECT e.source_id, e.target_id, e.relation, e.confidence_score FROM edges e
|
|
107
|
+
JOIN _vis_nodes s ON e.source_id = s.id
|
|
108
|
+
JOIN _vis_nodes t ON e.target_id = t.id
|
|
109
|
+
LIMIT 10000`)
|
|
101
110
|
.all() as Record<string, unknown>[];
|
|
102
111
|
|
|
103
112
|
for (const r of edgeRows) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
relation: r['relation'] as string,
|
|
111
|
-
confidenceScore: r['confidence_score'] as number,
|
|
112
|
-
});
|
|
113
|
-
if (edges.length >= 10000) break;
|
|
114
|
-
}
|
|
113
|
+
edges.push({
|
|
114
|
+
sourceId: r['source_id'] as string,
|
|
115
|
+
targetId: r['target_id'] as string,
|
|
116
|
+
relation: r['relation'] as string,
|
|
117
|
+
confidenceScore: r['confidence_score'] as number,
|
|
118
|
+
});
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
|