3634 Commits
Author SHA1 Message Date
tomholford 79b262fb43 fix(extract): close import scopes on error nodes
tree-sitter marks ERROR nodes extra. The unified walk deferred scope
expiry until the next non-extra node, so a #include left inside_import
set across the recovered subtree. Every leaf then climbed
nearest_import_ancestor with ts_node_parent.

The libtomcrypt LUT prefix is the repro and must finish extracting.

Signed-off-by: tomholford <tomholford@users.noreply.github.com>
2026-11-28 19:16:10 -08:00
Martin Vogel 1cd6a3992d Merge origin/main into fix-cypher-invalid-regex-silent
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-28 19:59:25 +01:00
Martin Vogel 31040ff885 Merge origin/main into fix/cfml-template-includes
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-28 09:58:17 +01:00
Martin Vogel 6d8016914c Merge origin/main into feat/terragrunt-stacks
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-28 01:47:14 +01:00
Martin Vogel 0606492a8c Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-28 00:03:01 +01:00
Martin Vogel a7d28e2a94 Merge origin/main into feat/terragrunt-stacks
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-28 00:02:12 +01:00
Martin Vogel 3554a12e41 Merge pull request #3064 from chuenchen309/fix/architecture-projection-invalid-utf8
fix(store): keep the architecture projection for non-UTF-8 paths
2026-11-28 00:00:46 +01:00
Martin Vogel 5fe3c7e554 Merge pull request #2994 from Bowen-Xue-ac2/fix/skip-binary-preserve-target
fix(cli): preserve existing binary when installation is skipped
2026-11-27 23:58:40 +01:00
Martin Vogel 5a4b875325 Merge origin/main into fix/scala-companion-objects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 06:15:54 +01:00
Martin Vogel 5959081aa5 Merge pull request #3080 from AlexSimionGeorge/fix/csharp-method-return-type
fix(csharp): read a method's return type from the `returns` field
2026-11-27 06:15:14 +01:00
Martin Vogel ff01a30009 Merge origin/main into fix/scala-companion-objects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 05:50:09 +01:00
Martin Vogel bf8b32c5f9 Merge pull request #3103 from DeusData/fix/php-global-use-function-absence-proof
fix(php): a global function or constant use no longer hides the file's class imports
2026-11-27 05:41:26 +01:00
Martin Vogel 192322c7a8 Merge origin/main into fix/scala-companion-objects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>

# Conflicts:
#	src/pipeline/pipeline_internal.h
2026-11-27 05:20:29 +01:00
Martin Vogel 89ce50cf06 Merge pull request #3102 from DeusData/fix/semantic-index-version-14
fix(pipeline): an index built before the config references rebuilds once
2026-11-27 04:45:59 +01:00
Martin Vogel 434496d003 Merge origin/main into fix/scala-companion-objects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 03:44:34 +01:00
Martin Vogel 267f0811b7 Merge origin/main into fix/csharp-method-return-type
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 03:43:59 +01:00
Martin Vogel 6715a9afa9 Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 03:43:51 +01:00
Martin Vogel 886bd5123c Merge pull request #3053 from DeusData/feat/lsp-shared-member-walk-php
feat(lsp): one member lookup over a type's ancestry, and PHP moves onto it
2026-11-27 03:43:00 +01:00
BowenX 32a538fbb1 Merge branch 'main' into fix/skip-binary-preserve-target 2026-11-26 18:10:01 -08:00
Martin Vogel a075173ab7 Merge pull request #3099 from DeusData/feat/make-prerequisites-error-region
feat(pipeline): read Make prerequisites inside a grammar error region
2026-11-27 03:00:07 +01:00
Martin Vogel 9cb5d24322 Merge pull request #3098 from DeusData/feat/make-prerequisites
feat(pipeline): a Make rule depends on the rules its prerequisites name
2026-11-27 02:59:52 +01:00
Martin Vogel 99ff6b451d fix(pipeline): an index built before the config references rebuilds once
A Dockerfile, a compose file, a Terraform block, a workflow and a
kustomization draw REFERENCES_FILE edges to the files they name, and a
Make rule DEPENDS_ON the rules its prerequisites name. An index built
before has none of these edges for its unchanged files, and the changes
that added them did not raise the semantic index version. An
incremental run reads only what changed, so such an index stayed
without them until each config file was edited.

The version is 14 now. An index stamped with an older one rebuilds once
in full on its next run, as with every earlier number.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 02:53:17 +01:00
Martin Vogel 5585214d1a docs(php): make the absence proof's comments say what the code does
The comment on where a resolver NULL admits an absence proof named only
the namespace-only path and a global class `use`; it now names the
unaliased global `use` of a class, a function or a constant, and what
leaves the file unknown. Two test comments said the implementation's
method runs; they now say what is asserted, the edge to the interface's
declaration, and that the constant test passes with the first commit
alone. No behaviour change.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 02:51:53 +01:00
Martin Vogel 38f5ce89b6 fix(php): say what the absence proof of a global use proves
A `use const` can name nothing the graph holds but a File or Module of
the name: the graph has no node for a PHP constant (a top-level or
namespaced `const`, a class constant and `define()` give none), so the
check for a constant or variable node of the name compared against
nodes that never exist. Say so, and drop that check. Name the proof's
other limits: names are compared as written, while PHP compares class
and function names in any ASCII case; and a function declared inside
another function's body has no node.

Tests: an aliased global `use function` keeps the file's imports
unknown (it binds the alias exception), and a `use const` beside the
project's own `const` leaves the file complete (it binds what the proof
claims for constants). The partner beside a namespaced function of the
same name is dropped: it passed with and without the change it was
meant to guard, because the import resolver binds that use by name
first.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 02:05:12 +01:00
Martin Vogel 9a4fbbf107 Merge origin/main into fix/csharp-method-return-type
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>

# Conflicts:
#	tests/test_extraction.c
2026-11-27 01:58:50 +01:00
Martin Vogel 6f9b494bc3 Merge pull request #3081 from AlexSimionGeorge/fix/rust-impl-method-return-type
fix(rust): impl methods publish their declared return type
2026-11-27 01:57:37 +01:00
Martin Vogel 890859e9b9 Merge pull request #3097 from DeusData/feat/kustomize-file-references
feat(pipeline): a kustomization references the files its generators read
2026-11-27 01:53:58 +01:00
Martin Vogel 9bbdd89235 Merge pull request #3096 from DeusData/feat/workflow-local-uses
feat(pipeline): a workflow references its local actions and workflows
2026-11-27 01:53:35 +01:00
Martin Vogel a8793158a8 Merge pull request #3095 from DeusData/feat/terraform-file-references
feat(pipeline): a Terraform block references the files it reads
2026-11-27 01:53:19 +01:00
Martin Vogel bcdc8504ae Merge pull request #3094 from DeusData/feat/compose-file-references
feat(pipeline): a compose service references the files it names
2026-11-27 01:52:54 +01:00
Martin Vogel c200578156 Merge pull request #3093 from DeusData/feat/dockerfile-copy-references
feat(pipeline): a Dockerfile references the files it copies
2026-11-27 01:52:28 +01:00
Martin Vogel 862a3b54bd test(parallel): free the return-type table in the cross-pass harness
pass_calls builds its return-type table once any Method carries a return type.
The C# fixtures do now that methods read the `returns` field, and
run_sequential_with_lsp_cross_and_mutator was the one harness helper that did
not call harness_ctx_free_tables: LSan reported the table's strdup'd entries
(test-unix gcc x86, parallel_csharp_parse_damaged_namespace_is_not_global).
Linux arm64 gcc ASan: the parallel suite leaks without this and is clean with it.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 01:46:09 +01:00
Martin Vogel c0e5aab156 Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 01:20:25 +01:00
Martin Vogel 1e39470142 fix(scala): an Owner.m call names the companion object, even beside a class twin
Scored against main on the Scala truth repos, naming the companion object
Owner#object lost 18 pairs on cats and circe, in two shapes:

- `Chain.concat(a, b)` (also As.compose, Free.compile, Epsilon.isFinite)
  reached the class's same-named member: import_map and same_module tried
  Owner.m before Owner#object.m, and the qualified tail called the pair
  X.m / X#object.m ambiguous. The term `Owner` is the object, so both
  lookups now try the object first and the qualified tail takes the
  object's twin.
- `ev.abs(a)` reached a member nested in the companion object: the name
  scorer's last tie-break is strcmp, and '#' sorts before '.'. Ties now
  order as if the fence were absent (the order before it existed), and of
  two twins a call through a value takes the class member.

All four are gated on a registered object fence, so a registry without
Scala resolves exactly as before. Scala truth, main vs this branch:
+465 / -10 pairs (before this change +440 / -21); cats + circe +166 / -3,
new wrong edges 24 vs 19 removed. The 73 dev/other repos of the other
languages score identically.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 01:03:29 +01:00
Martin Vogel 4b0c661919 Merge pull request #3092 from DeusData/feat/scope-closure-protobuf
feat(pipeline): a scope closure for Protobuf references
2026-11-27 00:14:25 +01:00
Martin Vogel ba9da85c5b Merge origin/main into fix/csharp-method-return-type
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 00:11:29 +01:00
Martin Vogel 120f5970c9 Merge origin/main into fix/rust-impl-method-return-type
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 00:08:23 +01:00
Martin Vogel b2580fc02f feat(pipeline): read Make prerequisites inside a grammar error region
tree-sitter-make gives up on some valid makefiles: a nested conditional
indented with tabs inside an indented one turns everything from there to
the end of the file into one error region. The rules after it are still
parsed as rules and have their nodes, but no prerequisite edge was drawn
for a rule inside such a region.

A rule that is a direct child of the error node and stands at the start
of its line now has its prerequisites read like any other. A rule line
indented with spaces and a rule nested in another node of the region stay
undrawn.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 00:00:20 +01:00
Martin Vogel 3e5d298cd8 feat(pipeline): a Make rule depends on the rules its prerequisites name
A prerequisite that names a rule of the same makefile draws DEPENDS_ON
{via: prerequisite, line} from each target of the rule to that rule's
node: once per pair, at the first line stating it, as make merges the
prerequisites a target's rules give it. An order-only prerequisite (after
`|`) carries "order_only": true, unless another rule of the target lists
it as a normal one: make then treats it as normal, and the edge carries
that line.

The rule nodes exist already, one per target. The shell pass parses every
makefile it reads; it now keeps each rule's plain prerequisites and matches
them against the rule nodes of that file in one pass over the Function
nodes (the table `make <target>` resolution built, now shared).

A rule line that repeats a target or a prerequisite is read once per name:
the work is the line's words plus its distinct pairs, counted by
g_sh_make_pairs and pinned by a test at 1x, 4x and 16x. If a name cannot
be kept (an allocation fails), no prerequisite edge is drawn at all.

A prerequisite with a variable, a pattern or a glob, one that names a file
or a rule of another makefile, a target naming itself, a static pattern
rule, and a rule line the grammar could not parse cleanly (a
target-specific variable it took for a rule) draw nothing.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-27 00:00:14 +01:00
Martin Vogel c26a4740de fix(php): a global function or constant use no longer hides the file's class imports
One `use function sprintf;` or `use const PHP_EOL;` that names nothing in
the project left the whole file's import evidence unknown: no binding
snapshot was written, the file's class imports reached the PHP engine as
File QNs, and the typed calls through them fell to a name guess or were
lost (phpmyadmin's controllers). The absence proof a global class `use`
already had now covers these two kinds: unaliased, and no PHP node of a
label such a use can bind (a function, a constant, or a file or module)
carries the name.

With the file's imports complete, its unresolved imports also veto the
name guesses they shadow, as they already did in every other file.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:35:47 +01:00
Martin Vogel 1f39f9e69c feat(pipeline): a kustomization references the files its generators read
The files a configMapGenerator or secretGenerator reads (`files`, also as
`key=path`; `envs`; the single `env` of older kustomize) and the entries of
`configurations` draw REFERENCES_FILE {via: configMapGenerator |
secretGenerator | configurations, line} from the kustomization's File node
to the file's, once per kustomization and file at the first line naming it.

They are not imports. An import from a kustomization makes its target a
member of the build, and a generator's input holds no object of the build.

The extractor emits one in-memory fact per entry (CBM_K8S_FACT_FILE); the
K8s pass keeps them beside the patch facts and draws them. Facts are not
part of the stored result. A file the index does not hold, an absolute path
and a path out of the repository draw nothing.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:05:54 +01:00
Martin Vogel 0c015a5a6a feat(pipeline): a workflow references its local actions and workflows
A local `uses:` of a GitHub workflow or composite action is a path from
the repository root. A step's names an action by its directory, a job's a
reusable workflow by its file. Each draws REFERENCES_FILE {via: uses, line}
from the file stating it to the file it names: the directory's action.yml
or action.yaml (the one it holds), or the workflow file. Once per target,
at the first use.

An action of another repository, a path with an expression, a directory
with no action file or with both spellings, and a path out of the
repository draw nothing.

The CI walk that reads `run:` steps hands the local uses to the shell pass
through a second callback of cbm_ci_commands, in the same walk: a file is
parsed once, as before.

The incremental repair reads no workflow again when an action file is
deleted. A directory with both spellings has no edge, and deleting one of
the two makes the other the action, so that deletion takes the full route
(local_action_pair_deleted).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:05:49 +01:00
Martin Vogel c17a62f3c2 feat(pipeline): a Terraform block references the files it reads
file(), templatefile(), filebase64() and the file hash functions whose
first argument is "${path.module}/<literal path>" read a file of the
repository. Each draws REFERENCES_FILE {via: <the function>, line} from the
top-level block holding the call to that file's File node, once per block
and file at the first call.

A path written without ${path.module} is relative to the directory
Terraform is run in, which the module does not state, so it draws nothing;
neither does path.root or path.cwd, a path with another interpolation, an
expression argument, or a file the index does not hold.

The calls are collected in the module resolver's existing walk over each
top-level block and drawn in its link step, with the string evaluation the
pass already has for literals and ${path.module}.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:05:43 +01:00
Martin Vogel ad806581d7 feat(pipeline): a compose service references the files it names
The host side of a bind mount (short form beginning with `.`, long form of
type bind), an env_file, and the file of a config or secret a service lists
draw REFERENCES_FILE {via: volume | env_file | config | secret, line} from
the service's node to the file's File node, once per service and file at
the first line naming it.

Compose states these paths relative to the compose file's directory, so
nothing is inferred: a path that is not an indexed file draws nothing, and
neither does a named or anonymous volume, an absolute or home path, a path
out of the repository, a variable without a value, a config without `file:`
or the compose file itself. Variables come from the project's .env through
the reader the compose walk already has.

The compose walk hands the paths to the container pass with each service,
and the pass looks them up among the File nodes. The compose step re-reads
every compose file on each run, so the incremental planner needs no new
rule.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:05:36 +01:00
Martin Vogel 55fbc5a6d7 feat(pipeline): a Dockerfile references the files it copies
A COPY or ADD source written as a plain path that is an indexed file under
exactly one of the two contexts a build of the Dockerfile can have (its
directory, the repository root) draws REFERENCES_FILE {via: copy | add,
line} from the Dockerfile's File node to that file's, once per file at the
first instruction naming it. A source of another stage or image (--from),
a URL, a glob, a source a variable supplies, a directory, a path out of its
context, a file under both contexts and a file under one context that is a
directory under the other draw nothing.

The lookup is the one the pass already uses to map a container path back
to the repository for SPAWNS; the pass already recorded every COPY and ADD.

The incremental planner runs the container pass over changed files only.
When a file that has a same-path partner under a Dockerfile's other context
is deleted, the remaining file becomes the only candidate, and its edge
would come from a Dockerfile that did not change. The same holds for a file
below a directory whose same-path partner is a file: once the directory is
empty, that file is the only candidate. Both deletions now take the full
route (docker_context_pair_deleted). The pass's SPAWNS mapping uses the
same lookup and had the first of the two gaps.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 23:05:31 +01:00
Martin Vogel 9cb8ffe881 Merge commit 'bca84c9d2524fef4e0e6d21df4927bde27d2d59f' into shared/member-walk-c1
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>

# Conflicts:
#	internal/cbm/extract_defs.c
#	src/pipeline/lsp_surface.c
#	src/pipeline/pass_lsp_cross.c
2026-11-26 23:01:21 +01:00
Martin Vogel 23af0b4609 Merge origin/main into feat/vbnet-structural-extraction
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 22:49:32 +01:00
Martin Vogel 0c2b4927c0 Merge origin/main into fix/scala-companion-objects
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 22:40:46 +01:00
Martin Vogel be95b8f7b4 fix(scala): name a companion object Owner#object, collision-only
A Scala object with a same-named class, trait or enum in the same scope
(its companion) is now named <Owner>#object and its members
<Owner>#object.<m>, in place of the `$` suffix of the merged change. The
fence works like C's `#macro`: no plain Scala identifier ends in `#object`,
so the registry no longer needs a table of companion owners, the declaring
file's language, or an extra parameter on its helpers to tell a Scala
companion from a Java or JavaScript class named `Foo$`. An object without
such a type beside it keeps its plain QN.

The lookups that let `Owner.m` written in source reach `Owner#object.m`
try the fenced form: the import map (exact and suffix), the same-module
probe, the qualified-tail match, the receiver-chain guard and the package
map's member import. The registry runs the import and same-module probes
only once a Scala companion has been registered. The enclosing-function QN
used by the usage, throw, type-assignment and env-access walkers fences the
object the same way, so those source to the method the def walk emits.

Companion detection answers each object in O(1). A scope's children are
read once with a tree cursor: the def walk reads every class body ahead and
the first query reads the file's top level, where the previous code walked
down from the root for every parent lookup and indexed children one at a
time. The answers are held by pointer in the extraction context and tied to
the source they were built for, so a copied context with another source
builds its own instead of sharing a by-value copy.

CBM_SEMANTIC_INDEX_VERSION goes from 13 to 14: an index built before holds
one merged node for a type and its companion and rebuilds once.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
2026-11-26 22:39:41 +01:00
Martin Vogel 6d68ffae68 Merge pull request #1712 from benrfairless/feat/ruby-lsp-cross-file
feat(pipeline): wire Ruby cross-file LSP resolution
2026-11-26 22:38:13 +01:00