Skip to content
Merged

0.2.4 #2029

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9c82af5
python: a closure cell rebound through nonlocal from a nested scope i…
swapnilpaliwal-sd Nov 18, 2026
991080f
plugin: test-impact --files names the files that follow it, and is no…
swapnilpaliwal-sd Nov 18, 2026
47fb429
csharp: new T() on a staged library type is not an external construct…
swapnilpaliwal-sd Nov 18, 2026
57e30c1
release 0.2.4: every package and plugin manifest at 0.2.4 (the parser…
swapnilpaliwal-sd Nov 18, 2026
272f1af
typescript: a call to a function-literal const no longer also names i…
swapnilpaliwal-sd Nov 18, 2026
ffda9d6
fill: list every unresolved call site the project may own, settle the…
swapnilpaliwal-sd Nov 18, 2026
414d364
links: a process launcher is not a call that runs a value; fill: a JS…
swapnilpaliwal-sd Nov 18, 2026
fe3c6df
fill: TypeScript and C# value calls, multi-line imports, runtime glob…
swapnilpaliwal-sd Nov 18, 2026
1417351
Merge remote-tracking branch 'origin/chore/version-0.2.4' into fix/py…
swapnilpaliwal-sd Nov 19, 2026
5f84bba
Merge remote-tracking branch 'origin/chore/version-0.2.4' into fix/te…
swapnilpaliwal-sd Nov 19, 2026
fdcdbe2
fill: the build still ends with `graph at`, and AGENTS.md names unres…
swapnilpaliwal-sd Nov 19, 2026
e3a815a
Merge remote-tracking branch 'origin/chore/version-0.2.4' into fix/ts…
swapnilpaliwal-sd Nov 19, 2026
6a2810d
Merge remote-tracking branch 'origin/chore/version-0.2.4' into feat/f…
swapnilpaliwal-sd Nov 19, 2026
3e108bd
Merge remote-tracking branch 'origin/chore/version-0.2.4' into fix/cs…
swapnilpaliwal-sd Nov 19, 2026
c079bfa
Merge pull request #2028 from AxiomCodeAI/feat/fill-unresolved
swapnilpaliwal-sd Nov 19, 2026
2a5373e
Merge pull request #2027 from AxiomCodeAI/fix/ts-annotated-function-c…
swapnilpaliwal-sd Nov 19, 2026
e7bcb65
Merge pull request #2025 from AxiomCodeAI/fix/csharp-staged-ctor-not-…
swapnilpaliwal-sd Nov 19, 2026
851bdc7
Merge pull request #2024 from AxiomCodeAI/fix/test-impact-files-flag
swapnilpaliwal-sd Nov 19, 2026
f5868f8
Merge pull request #2023 from AxiomCodeAI/fix/python-nonlocal-rebind
swapnilpaliwal-sd Nov 19, 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
2 changes: 1 addition & 1 deletion gemini-extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "axiomcode",
"version": "0.2.3",
"version": "0.2.4",
"description": "Ask your repository how its code connects: who calls this, what breaks if I change it, which tests an edit reaches, how A reaches B. Answers come from a resolved call graph and are verified against it; nothing is guessed.",
"contextFileName": "plugins/axiomcode/AGENTS.md",
"mcpServers": {
Expand Down
4 changes: 2 additions & 2 deletions graph/bundle/SCHEMA.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ Every callable the graph refers to: all client methods/functions from the IR, pl
| `client` | all | Declared in the analysed project. |
| `lib` | all | Declared in a staged library IR; listed because an edge reaches it. |
| `generated` | java | Declared by a compile-time annotation processor: present in the compiled artefact and in every caller's source, and in no IR, so the bundle synthesises it to give the edge a target. id `generated:<owner qualified name>#<name>/<arity>`, no file and no line numbers. |
| `generated` | csharp | The Invoke of the delegate held in one field or property: id `generated:<owner qualified name>#<member>.Invoke`, no file and no line numbers. Every call through that member is an edge to it (tier boundary_lib, which is also where the compiler binds the call), and what the member holds is in dispatch_candidates with basis `value`. |
| `generated` | csharp | The Invoke of the delegate held in one field or property: id `generated:<owner qualified name>#<member>.Invoke`, no file and no line numbers. Every call through that member is an edge to it (tier boundary_lib, which is also where the compiler binds the call), and what the member holds is in dispatch_candidates with basis `value`. And the parameterless constructor of a staged library type whose IR carries no constructor: id `generated:<type qualified name>#<constructor>/0`. `new T()` compiles only if T has one, so the target exists, but a library IR is a signature subset and cannot say whether T declares it or the compiler supplies it. The `new` site is an edge to it with callee_provenance `lib` and tier boundary_lib, not an `external:` label, because the library WAS staged. |

**Notes**

Expand Down Expand Up @@ -578,7 +578,7 @@ THE GRAPH. One row per (site, resolved target). A site with N possible targets h
|---|---|---|
| `external` | all | The target is outside every staged IR. callee_method_id is NULL and callee_label names it, as `external:<Type>.<Member>`. A client-only run of a C# project reaches the BCL this way for most of its calls. |
| `client` | all | Target is a client method (callee_method_id set). |
| `lib` | all | Target is a method of a staged library IR (callee_method_id set, methods.provenance = lib). |
| `lib` | all | Target is a method of a staged library IR (callee_method_id set, methods.provenance = lib). C# only: or the parameterless constructor of a staged type its IR does not carry, a methods row with provenance `generated`. |
| `generated` | csharp | The target is a member the compiler generated and no source declares (a `boundary_generated` row); callee_label names it. |
| `builtin` | python | Target is a CPython builtin with no Python source (callee_label = `builtin:NAME`). |
| `external` | python, java | Target is outside every staged IR and has no methods row. Python: an import path (callee_label = the written path). Java: a method of an unstaged ancestor type (callee_label = `external:<type>.<name>`), reached through a receiver declared as that type or inherited by a client subclass; see types.provenance external. |
Expand Down
4 changes: 2 additions & 2 deletions graph/bundle/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export const VOCAB: readonly VocabSpec[] = [
{ table: 'methods', column: 'provenance', value: 'client', languages: 'all', meaning: 'Declared in the analysed project.' },
{ table: 'methods', column: 'provenance', value: 'lib', languages: 'all', meaning: 'Declared in a staged library IR; listed because an edge reaches it.' },
{ table: 'methods', column: 'provenance', value: 'generated', languages: J, meaning: 'Declared by a compile-time annotation processor: present in the compiled artefact and in every caller\'s source, and in no IR, so the bundle synthesises it to give the edge a target. id `generated:<owner qualified name>#<name>/<arity>`, no file and no line numbers.' },
{ table: 'methods', column: 'provenance', value: 'generated', languages: C, meaning: 'The Invoke of the delegate held in one field or property: id `generated:<owner qualified name>#<member>.Invoke`, no file and no line numbers. Every call through that member is an edge to it (tier boundary_lib, which is also where the compiler binds the call), and what the member holds is in dispatch_candidates with basis `value`.' },
{ table: 'methods', column: 'provenance', value: 'generated', languages: C, meaning: 'The Invoke of the delegate held in one field or property: id `generated:<owner qualified name>#<member>.Invoke`, no file and no line numbers. Every call through that member is an edge to it (tier boundary_lib, which is also where the compiler binds the call), and what the member holds is in dispatch_candidates with basis `value`. And the parameterless constructor of a staged library type whose IR carries no constructor: id `generated:<type qualified name>#<constructor>/0`. `new T()` compiles only if T has one, so the target exists, but a library IR is a signature subset and cannot say whether T declares it or the compiler supplies it. The `new` site is an edge to it with callee_provenance `lib` and tier boundary_lib, not an `external:` label, because the library WAS staged.' },
{ table: 'types', column: 'provenance', value: 'client', languages: 'all', meaning: 'Declared in the analysed project.' },
{ table: 'types', column: 'provenance', value: 'lib', languages: 'all', meaning: 'Declared in a staged library IR.' },
{ table: 'types', column: 'provenance', value: 'external', languages: J, meaning: 'Named by the client as an ancestor (`extends`/`implements`) but declared in no staged IR: id `external:<qualified name>`, category EXTERNAL_TYPE, no file, no members. Kept so the subtype edge survives; stage the library to replace it with the real declaration.' },
Expand Down Expand Up @@ -617,7 +617,7 @@ export const VOCAB: readonly VocabSpec[] = [

// call_edges.callee_provenance
{ table: 'call_edges', column: 'callee_provenance', value: 'client', languages: 'all', meaning: 'Target is a client method (callee_method_id set).' },
{ table: 'call_edges', column: 'callee_provenance', value: 'lib', languages: 'all', meaning: 'Target is a method of a staged library IR (callee_method_id set, methods.provenance = lib).' },
{ table: 'call_edges', column: 'callee_provenance', value: 'lib', languages: 'all', meaning: 'Target is a method of a staged library IR (callee_method_id set, methods.provenance = lib). C# only: or the parameterless constructor of a staged type its IR does not carry, a methods row with provenance `generated`.' },
{ table: 'call_edges', column: 'callee_provenance', value: 'generated', languages: C, meaning: 'The target is a member the compiler generated and no source declares (a `boundary_generated` row); callee_label names it.' },
{ table: 'call_edges', column: 'callee_provenance', value: 'builtin', languages: P, meaning: 'Target is a CPython builtin with no Python source (callee_label = `builtin:NAME`).' },
{ table: 'call_edges', column: 'callee_provenance', value: 'external', languages: ['python', 'java'], meaning: 'Target is outside every staged IR and has no methods row. Python: an import path (callee_label = the written path). Java: a method of an unstaged ancestor type (callee_label = `external:<type>.<name>`), reached through a receiver declared as that type or inherited by a client subclass; see types.provenance external.' },
Expand Down
11 changes: 11 additions & 0 deletions graph/csharp/engine/call-edge-generation/call_chain.dl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ site_leaves_client(prov, e) :- client_calls_lib(prov, e, _, _).
// a real project that is most of the unresolved sites -- which makes the number that
// matters unreadable.
site_leaves_client(prov, e) :- external_target(prov, e, _).
// And one into a staged type whose parameterless constructor its IR does not carry.
site_leaves_client(prov, e) :- staged_parameterless_ctor(prov, e, _).
// A call through a field or property holding a delegate lands on the delegate's
// Invoke, which the runtime supplies (resolution/delegates.dl). The site gets an edge
// to that member's Invoke node and the stored functions are in the envelope.
Expand Down Expand Up @@ -235,6 +237,14 @@ call_chain_edge(e, caller, "-", label, "external", "boundary_lib", kind) :-
call_from("client", e, caller),
invocation_site("client", e, kind).

// client -> A STAGED TYPE'S PARAMETERLESS CONSTRUCTOR, NOT CARRIED BY ITS IR. The
// target belongs to a staged type, so the provenance is `lib`; it is the `generated:`
// node resolution/external-types.dl names, which the bundle gives a methods row.
call_chain_edge(e, caller, "-", node, "lib", "boundary_lib", kind) :-
staged_parameterless_ctor("client", e, node),
call_from("client", e, caller),
invocation_site("client", e, kind).

// client -> A DELEGATE MEMBER'S INVOKE (#1206). `getPath(url)` on a field holding a
// delegate calls Invoke -- Roslyn's answer too -- and which stored function then runs
// is value flow, recorded in method_dispatch_candidate with basis `value` rather than
Expand Down Expand Up @@ -400,6 +410,7 @@ call_has_edge(prov, e) :- client_calls_lib(prov, e, _, _).
call_has_edge("client", e) :- client_calls_external(e, _).
call_has_edge("client", e) :- delegate_member_call("client", e, _).
call_has_edge("client", e) :- delegate_param_call(e, _).
call_has_edge("client", e) :- staged_parameterless_ctor("client", e, _).

call_chain_edge(e, caller, "-", "-", "-", cls, kind) :-
invocation_site("client", e, kind),
Expand Down
34 changes: 33 additions & 1 deletion graph/csharp/engine/resolution/external-types.dl
Original file line number Diff line number Diff line change
Expand Up @@ -435,20 +435,52 @@ external_target(prov, e, label) :-
// constructor clause above needs the type to be UNSTAGED, so once a library
// declares the type the site had neither a constructor to resolve nor a name to
// carry. Refusing the implicit-constructor claim alone leaves it a blind spot.
//
// NOT FOR `new T()` ON A STAGED TYPE THAT CARRIES NO CONSTRUCTOR AT ALL. That site
// runs T's parameterless constructor, which exists whether the library declares it
// or the compiler supplies it, and T is staged: `external` would say the
// dependency was not supplied, and it was (#1339). staged_parameterless_ctor names
// it inside the library instead. What is left here is a site whose argument count
// no carried constructor accepts although the IR carries some: a member the subset
// IR was not told about, named like an uncarried method.
external_target(prov, e, label) :-
call_needs_ctor_lookup(prov, e),
expr_new_type(prov, e, gk),
type_group("lib", _, gk),
call_argc(prov, e, ac),
!call_ctor_target_accepts(prov, e, ac),
!staged_parameterless_ctor(prov, e, _),
type_decl("lib", n, _, _, _, t), type_group("lib", t, gk),
label = cat("external:", cat(n, ".<constructor>")).

// Whether any constructor of the created type accepts this site's argument
// count. Named rather than inlined because the rule above needs its NEGATION,
// and a negated conjunction over three relations is where a cross-product hides.
//
// call_ctor_target already admits a constructor only where it accepts the site's
// argument count, under the provenance the constructor is DECLARED in. Re-checking
// it here under the SITE's provenance missed every staged constructor -- a client
// `new` reaching a library constructor -- so a resolved site was also labelled an
// unstaged one and had two rows (#1339).
call_ctor_target_accepts(prov, e, ac) :-
call_ctor_target(prov, e, ctor), ctor_accepts_argc(prov, ctor, ac).
call_ctor_target(prov, e, _), call_argc(prov, e, ac).

// staged_parameterless_ctor(Prov, Site, Node) -- `new T()` with no argument, on a
// staged type whose IR carries no constructor. Not known_implicit_ctor: a library IR
// is a signature subset, so it cannot show that T declares none. But `new T()`
// compiles only if T has a parameterless constructor, declared or supplied, so the
// target is known to exist and to be T's. The node is the `generated:` member id the
// bundle gives a methods row (provenance generated, owner T), so the edge points at
// T inside the library rather than at a label for an unsupplied dependency.
staged_parameterless_ctor(prov, e, node) :-
call_needs_ctor_lookup(prov, e),
expr_new_type(prov, e, gk),
type_group("lib", _, gk),
!type_ctor("lib", gk, _),
!type_ctor(prov, gk, _),
call_argc(prov, e, "0"),
type_decl("lib", _, qn, _, _, t), type_group("lib", t, gk),
node = cat("generated:", cat(qn, "#<constructor>/0")).

// ── A PROPERTY READ ON AN EXTERNAL RECEIVER ─────────────────────────────────
// `someString.Length`, `dict.Count`, `ex.Message`. Reading a property IS a call, and
Expand Down
1 change: 1 addition & 0 deletions graph/csharp/souffle/decls_all.dl
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,7 @@
.decl site_unresolved_named(c0:symbol,c1:symbol,c2:symbol)
.decl site_unresolved_real(c0:symbol)
.decl sseg(c0:symbol,c1:number,c2:symbol)
.decl staged_parameterless_ctor(c0:symbol,c1:symbol,c2:symbol)
.decl starts_slash(c0:symbol)
.decl static_edge_exists(c0:symbol,c1:symbol)
.decl static_fan_member(c0:symbol,c1:symbol,c2:symbol)
Expand Down
17 changes: 14 additions & 3 deletions graph/python/engine/projections/bindings.dl
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,20 @@ binding_is_namespace("lib", h) :- lib_py_binding(_, _, _, _, _, _, _, _, _, _, _
// bindingCount is the number of DISTINCT binding sites for this name in this scope.
// == 1 is the precondition for treating a name as single-valued (the alias case
// `_Aliased = Base`); > 1 means the name is rebound and a single-value inference is
// unsound. Consumed by resolution/name-resolution.dl.
binding_rebinding("client", n, first, last, h) :- py_binding(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, n, first, last, _, _, _, _, _, _, _, _, _, _, h).
binding_rebinding("lib", n, first, last, h) :- lib_py_binding(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, n, first, last, _, _, _, _, _, _, _, _, _, _, h).
// unsound.
// This is the RAW per-row count. It cannot see a write made from a NESTED scope through
// `nonlocal`: that write is a separate NONLOCAL row with its own count, so the enclosing
// cell's row still says 1. resolution/name-resolution.dl derives binding_rebinding from
// this and adds those writes; every single-write guard reads binding_rebinding. Only the
// LEGB walk reads the raw count, because it is what binding_rebinding is derived from.
binding_rebinding_raw("client", n, first, last, h) :- py_binding(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, n, first, last, _, _, _, _, _, _, _, _, _, _, h).
binding_rebinding_raw("lib", n, first, last, h) :- lib_py_binding(_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, n, first, last, _, _, _, _, _, _, _, _, _, _, h).

// ── binding_is_assigned(Prov, BindingHash) ───────────────────────────────────
// Symbol.is_assigned(): the name is a store target in this scope. Separates a
// `nonlocal fn` that rebinds the enclosing cell from one that only reads it.
binding_is_assigned("client", h) :- py_binding(_, _, _, _, _, _, _, _, _, _, "true", _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, h).
binding_is_assigned("lib", h) :- lib_py_binding(_, _, _, _, _, _, _, _, _, _, "true", _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, h).

// ── binding_annotation(Prov, DeclaredTypeName, DeclaredBaseType, PotentialQName, BindingHash) ──
// "" on 68.2% of parameters, which is exactly why declared-type receiver typing —
Expand Down
27 changes: 25 additions & 2 deletions graph/python/engine/resolution/name-resolution.dl
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,15 @@ binding_lookup(p, b, b2) :-
binding_owner(p, mod, _, b),
module_init(p, _, modScope, mod),
binding_decl(p, n, modScope, _, _, b2), b2 != b,
binding_rebinding(p, cnt, _, _, b2), cnt != "0".
binding_rebinding_raw(p, cnt, _, _, b2), cnt != "0".
// (c) FREE / NONLOCAL — nearest enclosing scope that binds the name. Candidate set
// first, then the max-depth filter in the next stratum.
binding_free_candidate(p, b, b2, d) :-
binding_is_free_kind(p, b),
binding_decl(p, n, s, _, _, b),
scope_ancestor(p, s, anc),
binding_decl(p, n, anc, _, _, b2),
binding_rebinding(p, cnt, _, _, b2), cnt != "0",
binding_rebinding_raw(p, cnt, _, _, b2), cnt != "0",
scope_depth(p, dstr, _, anc),
d = to_number(dstr).
binding_free_nearest_depth(p, b, dmax) :-
Expand All @@ -456,6 +456,29 @@ binding_lookup(p, b, b2) :-
binding_free_nearest_depth(p, b, dmax),
binding_free_candidate(p, b, b2, dmax).

// ── binding_nonlocal_write / binding_rebinding: writes from a nested scope ──
// symtable counts a name's binding sites per scope, so a cell rebound from a nested
// function through `nonlocal` has two rows, each with its own count: the cell's own
// (1, `fn = first`) and the nested NONLOCAL row (`fn = second`). Read alone, the cell's
// row says the name is written once, and every single-write guard then commits to the
// first write. #381: `fn = first; def swap(): nonlocal fn; fn = second; swap(); fn()`
// came out known_edge -> first, a function that cannot run there, and `second` was the
// target of no edge.
// A NONLOCAL row that is ASSIGNED is a write to the cell its LEGB walk lands on. One that
// only reads (`nonlocal fn` and no store) is not, and leaves the count alone.
binding_nonlocal_write(p, cell, nb) :-
binding_decl(p, _, _, "NONLOCAL", _, nb),
binding_is_assigned(p, nb),
binding_lookup(p, nb, cell), cell != nb.
binding_rebinding(p, n, first, last, b) :-
binding_rebinding_raw(p, n, first, last, b),
!binding_nonlocal_write(p, b, _).
binding_rebinding(p, total, first, last, b) :-
binding_rebinding_raw(p, n, first, last, b),
binding_nonlocal_write(p, b, _),
k = count : { binding_nonlocal_write(p, b, _) },
total = to_string(to_number(n) + k).

// ── binding_lookup_unresolved(Prov, ReferenceBinding, Name, BindingKind) ─────
// A reference-side binding whose LEGB walk found no declaration. THE HONEST FRONTIER:
// a builtin (`super`, `len`, `object`), a name from `from x import *`, or a genuine
Expand Down
3 changes: 3 additions & 0 deletions graph/python/souffle/decls_all.dl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
.decl binding_decl(c0:symbol,c1:symbol,c2:symbol,c3:symbol,c4:symbol,c5:symbol)
.decl binding_predicates(c0:symbol,c1:symbol,c2:symbol,c3:symbol,c4:symbol,c5:symbol,c6:symbol)
.decl binding_is_namespace(c0:symbol,c1:symbol)
.decl binding_rebinding_raw(c0:symbol,c1:symbol,c2:symbol,c3:symbol,c4:symbol)
.decl binding_rebinding(c0:symbol,c1:symbol,c2:symbol,c3:symbol,c4:symbol)
.decl binding_is_assigned(c0:symbol,c1:symbol)
.decl binding_nonlocal_write(c0:symbol,c1:symbol,c2:symbol)
.decl binding_annotation(c0:symbol,c1:symbol,c2:symbol,c3:symbol,c4:symbol)
.decl binding_declared_ref(c0:symbol,c1:symbol,c2:symbol)
.decl binding_declared_nominal(c0:symbol,c1:symbol,c2:symbol)
Expand Down
Loading
Loading