Skip to content
Merged
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
2b8e8b7
docs(plan): receiver-correlated invoked-property evidence for issue-2088
carlos-alm Aug 24, 2026
013576b
docs: fix WU-8's native NAPI-threading file and precedent citation (#…
carlos-alm Aug 24, 2026
8aa0167
docs: fix WU-2b's return-owner escape gap and WU-5a's fabricated cita…
carlos-alm Aug 24, 2026
899188d
docs: fix WU-2's alias escape-tracking gap and strengthen WU-10 asser…
carlos-alm Aug 24, 2026
62606d0
docs: fix alias-transitivity gap in WU-2's rebinding branch (#2612)
carlos-alm Aug 24, 2026
515140a
docs: treat param-flow positions as escaping in WU-2 condition 3 (#2612)
carlos-alm Aug 24, 2026
9156a88
docs: gate tracked reference positions on T1 visibility in WU-2 (#2612)
carlos-alm Aug 24, 2026
e8efa37
docs: close five round-7 escape-analysis soundness gaps in WU-2 (#2612)
carlos-alm Aug 24, 2026
0bdfb32
docs: close three round-8 soundness gaps in WU-2's escape analysis
carlos-alm Aug 24, 2026
df5fd92
docs: close round-9 gaps in WU-2 escape analysis and WU-5 ordering
carlos-alm Aug 24, 2026
24eb39f
docs: close round-10 identifier-resolution gaps in WU-2 condition 4
carlos-alm Aug 24, 2026
521ab3a
docs: fix round-10 regression and for-in gap in WU-2 condition 4
carlos-alm Aug 24, 2026
bd57e70
docs: close round-12 arrow-parameter shadow gap in WU-2 condition 4
carlos-alm Aug 24, 2026
222fa85
docs: note for-await coverage and the two-walk divergence risk
carlos-alm Aug 24, 2026
34a2f7a
docs: fix issue-2088 plan's condition-4 reassignment gap (round 13)
carlos-alm Aug 24, 2026
752405f
docs: close round-14 write-scan and duplicate-declaration gaps in WU-…
carlos-alm Aug 24, 2026
63c63c3
docs: close round-15 var/Annex-B hoist-through-blocks gap in WU-2 con…
carlos-alm Aug 24, 2026
81b1be1
docs: fix countHoistedVarScopeDeclarations's own traversal order (rou…
carlos-alm Aug 24, 2026
34c445c
docs: close round-16 under-escape gaps in WU-2 condition 4 (#2630/#26…
carlos-alm Aug 24, 2026
69ae1c9
docs: cross-reference #2637 (switch_body using_declaration residual) …
carlos-alm Aug 24, 2026
6ac51c2
docs: close round-17 under-escape gaps in WU-2 condition 4 (#2637 + 3…
carlos-alm Aug 24, 2026
f709b31
docs: apply Greptile's update_expression unwrapParens fix in WU-2
carlos-alm Aug 24, 2026
e3be4f7
docs: close round-18 gaps in WU-2 condition 3/4, reopen #2637
carlos-alm Aug 24, 2026
71c9325
docs: close two outstanding Greptile findings from this PR in WU-2
carlos-alm Aug 24, 2026
a4977ba
docs: close round-19 under-escape gaps in WU-2 conditions 3/4
carlos-alm Aug 25, 2026
4b9bd16
docs: close round-20 escape-analysis gaps in WU-2, apply ablation dis…
carlos-alm Aug 25, 2026
e8ad327
docs: fix round-8 self-shadow bug recurring at every allReferencesTra…
carlos-alm Aug 25, 2026
3e92903
docs: fix class_static_block var-scope gap in WU-2, correct round-21 …
carlos-alm Aug 25, 2026
f1fef6e
docs: fix WU-10 fixture-matrix oracle, axes, and case (by); reconcile…
carlos-alm Aug 25, 2026
8bc1b0a
docs: fix hasT1Evidence scoping and WU-10 coverage-claim gaps (round 23)
carlos-alm Aug 25, 2026
0e3d3c4
docs: fix under-escape gap in condition 2's alias recursion (round 25)
carlos-alm Aug 25, 2026
1846117
docs: cite #2645 for the round-25 matrix-generator invocation gap
carlos-alm Aug 25, 2026
c394ef3
docs(plan): pin exportedNames derivation, fix round-25 false claims (…
carlos-alm Aug 25, 2026
d9fb30c
docs(plan): fix callerName derivation, pts null-guard, definitionName…
carlos-alm Aug 25, 2026
b280748
docs(plan): complete B1 with a widened enclosing-scope probe set (rou…
carlos-alm Aug 25, 2026
2183bea
docs(plan): expand collision write-up, add shape 36, note this-receiv…
carlos-alm Aug 25, 2026
8aced6d
docs(plan): correct stale declaringScope recursion instructions (#2612)
carlos-alm Aug 26, 2026
aac2df0
feat(roles): correlate invoked-property evidence to object-literal sites
carlos-alm Sep 3, 2026
ee5ce74
Merge branch 'main' into feat/2088-correlated-invoked-property-evidence
carlos-alm Sep 3, 2026
b3ddfe7
fix: rustfmt native edge builder and JS extractor (#2654)
carlos-alm Sep 3, 2026
7577948
fix: persist invoked_property_sites on native full-build paths (#2654)
carlos-alm Sep 3, 2026
b28988a
fix: treat globalThis-qualified reads as untracked object-literal ref…
carlos-alm Sep 3, 2026
a8a6456
merge: remote feat/2088-correlated-invoked-property-evidence before push
carlos-alm Sep 3, 2026
9b6aeb3
fix: reuse native pts maps instead of solving three times per build
carlos-alm Sep 3, 2026
1107d74
fix: format hub-selection test import for biome
carlos-alm Sep 3, 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,7 @@ const { results: fused } = await multiSearchData(

- **TypeScript compiler integration is auto-enabled** — when `typescript` is installed and a `tsconfig.json` is found, the TypeScript compiler API pass runs automatically; disable with `"build": { "typescriptResolver": false }` in `.codegraphrc.json` if you want faster builds without it; heuristic type inference (annotations, `new` expressions, assignment chains) is always active as a baseline
- **Dynamic calls are best-effort** — complex computed property access and `eval` patterns are not resolved
- **Dead-code dispatch tables** — object-literal properties on a proven local-closed literal (`const T = { k: fn }; T.k()`) are correlated to that literal's own invocations. Escaping literals (exported, passed as arguments, `this`-using methods, spreads, …) keep the coarser name-based check: any `x.k(...)` in the build still credits `{ k: fn }`. Disable the tighter check with `"analysis": { "correlatedPropertyEvidence": false }`
- **Python imports** — resolves relative imports but doesn't follow `sys.path` or virtual environment packages
- **Dataflow analysis** — interprocedural edges (`arg_in`, `return_out`) require a full build after adding new callee files; incremental re-stitch fires automatically on both the JS and native engine paths

Expand Down
21 changes: 21 additions & 0 deletions crates/codegraph-core/src/db/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,27 @@ const MIGRATIONS: &[Migration] = &[
);
"#,
},
Migration {
// #2088: durable per-file object-literal sites and correlated
// invoked-property evidence. Mirrors src/db/migrations.ts v32.
version: 32,
up: r#"
CREATE TABLE IF NOT EXISTS object_literal_sites (
file TEXT NOT NULL,
site TEXT NOT NULL,
escapes INTEGER NOT NULL,
PRIMARY KEY (file, site)
);
CREATE TABLE IF NOT EXISTS invoked_property_sites (
site_key TEXT NOT NULL,
name TEXT NOT NULL,
file TEXT NOT NULL,
PRIMARY KEY (site_key, name, file)
);
CREATE INDEX IF NOT EXISTS idx_invoked_property_sites_key
ON invoked_property_sites(site_key);
"#,
},
];

// ── napi types ──────────────────────────────────────────────────────────
Expand Down
28 changes: 26 additions & 2 deletions crates/codegraph-core/src/domain/graph/builder/pipeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ pub fn run_pipeline(
&import_ctx,
!change_result.is_full_build,
config.analysis.points_to_max_iterations,
config.analysis.correlated_property_evidence,
)
.map_err(|e| format!("call edge insertion failed: {e}"))?;

Expand Down Expand Up @@ -2075,6 +2076,7 @@ fn build_and_insert_call_edges(
import_ctx: &ImportEdgeContext,
is_incremental: bool,
max_iterations: u32,
correlation_enabled: bool,
) -> Result<(), String> {
use crate::domain::graph::builder::stages::build_edges::*;

Expand Down Expand Up @@ -2152,6 +2154,7 @@ fn build_and_insert_call_edges(
dynamic_kind: c.dynamic_kind.clone(),
key_expr: c.key_expr.clone(),
accessor_read: c.accessor_read.clone(),
object_literal_site: c.object_literal_site.clone(),
})
.collect(),
imported_names,
Expand All @@ -2176,6 +2179,8 @@ fn build_and_insert_call_edges(
object_prop_bindings: non_empty(&symbols.object_prop_bindings),
computed_dispatch_table_evidence: non_empty(&symbols.computed_dispatch_table_evidence),
new_expressions: non_empty(&symbols.new_expressions),
object_literal_sites: non_empty(&symbols.object_literal_sites),
call_assignments: non_empty(&symbols.call_assignments),
});
}

Expand All @@ -2185,6 +2190,15 @@ fn build_and_insert_call_edges(
// view for repos built with the native engine too.
import_edges::persist_invoked_property_names(conn, &file_entries)
.map_err(|e| format!("invoked property name persistence failed: {e}"))?;
import_edges::persist_object_literal_sites(conn, &file_entries)
.map_err(|e| format!("object literal site persistence failed: {e}"))?;
Comment thread
carlos-alm marked this conversation as resolved.
// #2088: one Andersen pass for this file set, reused for persist AND
// call-edge emission — mirrors JS `prepareInvokedPropertySiteResolution`.
// Persist before the extra-SELECT so a later incremental rebuild's
// extra-SELECT is not vacuously empty.
let prep = prepare_invoked_property_site_resolution(&file_entries, &all_nodes, max_iterations);
import_edges::persist_invoked_property_sites(conn, &file_entries, &prep.sites_by_file)
.map_err(|e| format!("invoked property site persistence failed: {e}"))?;

// Read back the now-current whole-graph view (includes the fresh rows
// just written above) so this pass's own call-edge resolution sees
Expand All @@ -2198,12 +2212,22 @@ fn build_and_insert_call_edges(
})
.unwrap_or_default();

let computed_edges = build_call_edges(
let extra_invoked_property_sites: Vec<String> = conn
.prepare("SELECT site_key || '|' || name FROM invoked_property_sites")
.and_then(|mut stmt| {
stmt.query_map([], |row| row.get::<_, String>(0))
.map(|rows| rows.filter_map(|r| r.ok()).collect())
})
.unwrap_or_default();

let computed_edges = build_call_edges_prepared(
file_entries,
all_nodes,
builtin_receivers,
max_iterations,
Some(extra_invoked_property_names),
Some(extra_invoked_property_sites),
Some(correlation_enabled),
prep,
);
insert_call_edge_rows(conn, &computed_edges)
}
Expand Down
Loading
Loading