Repository navigation
fix(registry): refuse name-only member calls nothing ties to the receiver - #2977
Merged
Merged
Conversation
…iver #1897's receiver-chain gate judged only chains rooted in a type and let a lower-case root through ("a value whose type the chain does not show"), and the two suffix_match exits of resolve_multi_with_imports were never gated. So a member call no LSP had typed bound whatever project symbol shared its final name: kafka's `tp.topic()` on a TopicPartition bound ConsumerRecord.topic, gardener's `strings.Join` bound pkg/utils/net.Join, finagle's `Future.exception` a thrift service method. At the same name-only exits (unique_name, suffix_match, and now the import fallback) a CALLS resolve of a member call whose receiver is a value or a `new X(...)` constructor binds only on evidence that it means the chosen candidate: a chain segment names its ancestry word by word (`repo` / Repo, `cleanerManager` / LogCleanerManager, `otel_guard` / OtelGuard, the receiver of `verify(x)` / `when(x)`), it lives in the caller's own module, it is import-reachable, or, for a C/C++ call onto a struct member, the C member resolver decides it from the object's type. When another candidate is the field-type hint's own pick the call is left for that re-pick. Otherwise the guess is refused: a veto, never a re-pick. Self receivers (this, self, cls, super, base, this_, _this) and `::` paths are exempt; import_map, same_module, qualified_suffix and lsp_* are untouched. A type root is checked at the import fallback too. Scope by measured language (share of refused edges that were wrong, hand- read seeded samples): whole for Go (50/50), C++ (25/26), C#, Lua, Tcl, Groovy and C; suffix_match picks only for Scala (kafka 29/30, finagle on #2360 28/30). Left out: Java (suffix_match-only still 47/60), Kotlin (unmeasured), Ruby (3/15), and Python, the JS/TS family, Perl and PHP, whose own guards run after resolution and keep their HTTP classification. kafka 4.0.0 loses 5,189 CALLS (Scala 5,183) and 620 fake async routes, finagle on #2360 6,302 Scala CALLS and 13 false HTTP_CALLS, gardener 339 Go CALLS, redis 15, otel 168. Deterministic; incremental matches full. The #2121 controls for value roots now give their candidate a value receiver's evidence (the caller's own module), which a type root would not admit. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
The receiver gate now runs from an explicit per-language allowlist set by measurement instead of applying to every language not exempted: - full gate: Go, C++, C#, Lua, Tcl, Groovy, Elixir; - suffix_match-only: Scala, Rust, PHP; - off: everything else (Java, Kotlin, Swift, Ruby, Objective-C, Dart, C, Python, the JS/TS family, Perl, and every unmeasured language). Each language was measured on a pinned corpus with fresh seeds and hand-read samples of the refused CALLS; a language is gated only where the share of refused edges that were wrong is at least ~85% (Rust 88% for suffix_match, 80% for unique_name, so suffix-only; PHP 30/30 suffix, 60% unique; Elixir 30/30 and 24/25). Rust removes 4,503 false CALLS on meilisearch, PHP 938 on koel, Elixir 1,885 on plausible; off languages are byte-identical. Also new C/C++ evidence: a candidate whose owner type the caller's own module declares binds (`Widget w(n); w.get_id()`), which fixes the cpp/S3 lsp_resolution_probe case the full C++ gate refused in the previous commit. registry_receiver_gate_runs_by_measured_language replaces the JVM-only test and pins full, suffix-only and off languages, including an unmeasured one. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
chidev
added a commit
to lev-os/codebase-memory-mcp
that referenced
this pull request
Nov 14, 2026
…g ties to the receiver Conflict in src/pipeline/registry.c resolve_name_candidates, kept both: - lev narrows the import-reachable set and the fallback by the receiver chain (resolve_multi_with_imports takes callee_name and lang, closest_receiver_admitted). Kept. - DeusData#2977 vetoes a fallback answer the imports do not reach when the receiver is blind (type_receiver_blind, value_receiver_blind), and the no-import closest pick when value_receiver_blind holds. Kept, applied after lev's narrowing. The gate is off for Java, Kotlin, Swift and the JS/TS family (gate_scope), so lev's work there is unchanged. Signed-off-by: chidev <chicagowebdev@gmail.com>
chidev
added a commit
to lev-os/codebase-memory-mcp
that referenced
this pull request
Nov 14, 2026
…ndidate names DeusData#2977's registry_receiver_gate_judges_type_roots_at_import_fallback expects the reference resolver to keep a name-only pick for `Future.exception` at the import fallback. On lev the receiver-chain guard narrows the import path's candidates on every resolve (cb1e370), as upstream does on the unique-name and no-import paths, so that pick is refused there too. The CALLS-path assertion of the test is unchanged. Signed-off-by: chidev <chicagowebdev@gmail.com>
This was referenced Nov 14, 2026
DeusData
added a commit
to ankitsusheel/codebase-memory-mcp
that referenced
this pull request
Nov 14, 2026
Brings the branch up to main 08ab4a0 (DeusData#2966, DeusData#2969, DeusData#2970, DeusData#2977, DeusData#2978, DeusData#2981). scripts/vendored-checksums.txt: main (DeusData#2969) vendored the VB6/VBA grammar while this branch edits MANIFEST.md. Regenerated with scripts/security-vendored.sh --update (1101 files); only the MANIFEST.md line differs from main. Everything else merged without conflict and was checked by hand: - MANIFEST.md keeps main's vba, sql and jsonnet text; only this branch's vbnet registration sentence and custom-handling row differ. - The language count stays 164 (vendored grammar directories); the language-count contract passes. VB.NET adds a language name to the README list, not a grammar. - DeusData#2977's receiver gate is an allowlist (gate_scope); VB.NET is not on it, so it stays GATE_OFF, and receiver_chain_admits is unchanged. - The VB.NET case-insensitive retry still hooks cbm_registry_resolve_lang, cbm_registry_resolve_ref and resolve_call_lang; the Field-call USAGE policy and the enum-member gate are intact. - DeusData#2981's linear-growth rewrites in extract_defs.c touch no VB.NET function; find_class_body still decides VB.NET first. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
DeusData
added a commit
that referenced
this pull request
Nov 14, 2026
Main brought in #2969 (vendored VB6/VBA grammar), #2981 (linear-growth rewrites in extraction and eight LSP passes, a node for C# operators, C increments recorded as writes), #2977 (receiver gate in the registry), #2978 (possible override targets in trace_path), #2966 (CONTRIBUTING test reference) and #2985 (freebsd-vm action bump). Two files conflicted: - internal/cbm/vendored/grammars/MANIFEST.md: the summary header. Took main's counts (164 grammars, 20 first-party, ABI 9x/78x/77x), which a recount of the merged tree confirms (164 grammar directories, LANGUAGE_VERSION 13/14/15 = 9/78/77). Kept this branch's 2026-11-13 ObjectScript recount line above main's 2026-11-12 vba line; main had folded the 2026-11-11 sql line into its vba line, so that line goes. Main's vba prose and table rows and this branch's ObjectScript v1.11.0 rows are both present. - scripts/vendored-checksums.txt: regenerated with scripts/security-vendored.sh --update. Only the MANIFEST.md hash moved; the result differs from this branch only by main's vba entries and from main only by the ObjectScript entries. Every other file merged cleanly. For each file both sides changed (THIRD_PARTY.md, extract_calls.c, extract_defs.c, extract_usages.c, helpers.c, lang_specs.c, tests/test_parse_coverage.c) the merged file differs from each parent by exactly the other parent's change. #2981 rewrote objectscript_routine_preceding_tag onto a memoized sibling search with the same probe; this branch does not touch that function. ObjectScript stays outside #2977's receiver gate allowlist. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
This was referenced Nov 14, 2026
fix(objectscript): refresh the grammars to v1.11.0 and land #2368's extraction changes (#1261)
#2979
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follows #2968 (merged).
Problem
#1897's receiver-chain gate judges only member calls whose chain starts with a
type (
URLSession.shared.data). A chain rooted in a lower-case value(
tp.topic(),strings.Join()) passed through unjudged, and the twosuffix_matchexits ofresolve_multi_with_imports(every file with imports)were never gated at all. So a member call that no LSP had typed bound whatever
project symbol shared its final name:
tp.topic()on aTopicPartition->ConsumerRecord.topicstrings.Join(...)->pkg/utils/net.JoinFuture.exception(...)-> a thrift service'sexceptionSong::query()->...->sort(...)->AlbumBuilder.sortsite.domain(a struct field) -> a privatedomain/0functionFix
At the registry's name-only exits (
unique_name,suffix_match, and theimport fallback), a CALLS resolve of a member call whose receiver is a value or
a
new X(...)constructor now binds only on evidence that it means the chosencandidate. Any one of these counts as evidence:
word, case- and underscore-blind:
repo/ Repo,cleanerManager/LogCleanerManager,
otel_guard/ OtelGuard,new RaftContext.Builder()/RaftContext.Builder, and the receiver handed to
verify(x)/when(x);the object's type;
re-declared above
Widget w(n); w.get_id()), which is all the C++ resolverhad to type the receiver against.
If another candidate is the field-type hint's own pick, the call is left for
that re-pick.
Otherwise the guess is refused. It is a veto and never a re-pick: a refused
call stays unresolved, as with the cross-language veto. Self receivers (
this,self,cls,super,base,this_,_this) and::namespace paths arenot judged.
import_map,same_module,qualified_suffixand everylsp_*strategy run before these exits and are untouched. The existing type-root check
now also covers the import fallback.
This is a language-agnostic suppressor inside the registry. The maintainers
accept that shape only as a recorded exception (exception 5 to the per-language
suppressor rule) and with the evidence #1897 met: upstream strategies
untouched, and a blast radius measured per language on real graphs and read by
hand. So the gate runs from an allowlist by measurement: a language is gated
only where its own measured precision cleared the bar, and every other
language, measured below it or not measured, keeps its name-only binds.
Scope and measurement
Each language was judged on hand-read seeded samples of the CALLS the gate
refuses on a real corpus, with fresh seeds per round. The precision column is
the share of refused edges that were wrong; the bar is about 85%. Where a
language's
suffix_matchpicks cleared it and itsunique_namebinds did not,only the
suffix_matchpicks are judged and theunique_namebinds are kept.Notes on the languages left out or limited:
unique_namebinds. A project's onemethod of a name is often what the untyped receiver means there: Rust's
s.set_searchable_fields(...)insideupdate_settings(|s| ...), PHP'strait methods on parameter-typed receivers (
$playlist->addCollaborator).suffix_matchonly. Most of the rightedges it would refuse sit behind a receiver that is a method's return value
(
groupByKey().count()), which only the Java LSP can type.users.cityId.isNull(),tester1.insertAndGetId {}) bind right by name.of its stored property (
delegate?.completionHandler(...),cam.inProgressSavePhotoDelegates[id]) bind right by name.[api waitForMapWithError:&error]) bindto the protocol's one implementation, which is what runs.
own guards. Gating them before resolution changed no CALLS, but it skipped
the URL-argument HTTP classification those guards keep.
Side effects
minted from
log.info(...)-style calls the name guess had bound. finagle loses13 HTTP_CALLS that came from path-shaped arguments (
Dtab.read("/foo=>/bar")).TESTS edges derived from refused CALLS go with them (kafka -643, finagle -60,
meilisearch -128, koel -2, plausible -1). koel loses one false CONFIGURES
edge with an empty key, minted from
(new $class())->getProperty()bound toone preference class.
empty-resolution service fallbacks, as a cross-language-vetoed one does. On
kafka that adds 2 false route registrations:
props.put("log.dirs", "/tmp/a").Tests
registry_receiver_gate_judges_value_receivers: every evidence rule, theself receivers, the C/C++ struct-member hand-off, the C++ owner type
declared in the caller's file, and a language off the allowlist.
lsp_resolution_probecpp/S3 (Widget w(n); w.get_id()) stays GREEN; itwent RED with C++ gated before the owner-declared rule.
registry_receiver_gate_runs_by_measured_language: the allowlist. Go andElixir judge
unique_namebinds; Scala, Rust and PHP keep them and judgeonly
suffix_matchpicks; Java, Kotlin, Swift, Ruby, Objective-C, C, Dartand an unmeasured language (Zig) keep both.
registry_receiver_gate_judges_type_roots_at_import_fallback: the previouslyungated exit.
pipeline_registry_receiver_gate_full_and_incremental: Scala, Go and Ccallers through the full index (sequential and parallel) and both incremental
routes.
All four are RED on the base. Forcing the gate off turns them RED again.
The #2121 value-root controls now give their candidate a value receiver's
evidence (the caller's own module), which a type root would not admit.
Two indexes are identical (kafka; meilisearch 95,037 = 95,037 edges). The
languages off the allowlist index unchanged: rails, JetBrains/Exposed and
swift-nio give the same CALLS with the gate as without it. Incremental matches
the full index on plausible (Elixir) and on finagle with #2360. On
meilisearch, koel and gardener, incremental and full already differ without
the gate (meilisearch 49 edges, koel 49, gardener 159); with it they differ in
no more (meilisearch 31, koel 46).