Skip to content

Commit 3a842e4

Browse files
committed
feat(rust): update cache version to v113
1 parent c0e9285 commit 3a842e4

2 files changed

Lines changed: 22 additions & 44 deletions

File tree

internal/cachecov/coverage_test.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,7 @@ var versionCoverage = map[int][]string{
145145
111: {"TestExtract_HTTPHandlerProp", "TestBindHTTPHandlers_BindsViaSignature", "TestBindHTTPHandlers_RejectsNonHandlerBySignature", "TestBindHTTPHandlers_AmbiguousMethodNameSkipped", "TestBindHTTPHandlers_MiddlewareNotBound", "TestBindHTTPHandlers_Idempotent", "TestBindHTTPHandlers_CrossRepoNotBound", "TestGolden"}, // Go emits http_handler on func(http.ResponseWriter, *http.Request); bindHTTPHandlers uses it to resolve a route's registration-site handler expression to the declaring symbol, rejecting same-named non-handlers (the wiring package's null-object stub) by SIGNATURE rather than by name, and skipping ambiguous method names outright (new/18) // Java emits io_direct/performs_io on DB/network round-trips (@FeignClient / Spring Data repository interfaces, @Query/@Modifying/@Procedure, Room @Dao ops) so isExpensiveJvmCall's I/O index is populated on pure-Java; type-level seed avoids the JAX-RS/@GetMapping inbound-handler trap; no transitive fixpoint (GAP-JV-02)
146146
112: {"TestStorage_TypeORMEntity", "TestStorage_DrizzleTable", "TestStorage_PrismaModels", "TestStorage_NoORMDependencyEmitsNothing", "TestIODirect_ORMCallSeedsPerformsIO", "TestGolden"}, // TypeScript emits storage facts for TypeORM @Entity / Drizzle pgTable / Prisma models (schema.prisma read off-glob); ORM query methods seed io_direct so performs_io propagates through a repository wrapper, making a per-iteration wrapper call a detectable N+1 (GAP-XL-04, new/26)
147147
113: {"TestJavaSPIServiceFileRefs", "TestJavaRuleNodeProp", "TestGolden"}, // Java folds SPI service-file registrations (META-INF/services + META-INF/dubbo) as KindFileRef references so an impl loaded by name is not a false orphan, and emits scanned_plugin on @RuleNode classpath-scanned plugins (GAP-JV-08, new/60)
148-
115: {"TestGolden", "TestOwnsFile", "TestAST_ImplTraitForType_EmitsImplements"}, // Rust extractor added: symbols, implements post-pass, dependency/calls/route facts, cache participation
149-
116: {"TestGolden", "TestAST_CallInsideMacroArgument", "TestAST_MatchesMacroGuardCall", "TestAST_FunctionPassedAsCallbackArgument", "TestAST_OrdinaryArgument_NoPhantomReference", "TestAST_FunctionReferenceInStructField", "TestAST_FunctionReferenceTakenByAddress", "TestAST_SerdeDefaultAttribute_ReferencesFunction", "TestAST_SerdeSkipSerializingIfAttribute_ReferencesFunction", "TestAST_ClapValueParserAttribute_ReferencesFunction", "TestAST_LocalFunctionPassedAsCallbackWithinSameBody", "TestAST_FunctionReferenceNestedInsideMacroArgument"}, // Rust call-reference precision: macro-arg calls, function-as-value references (incl. nested inside a macro arg, e.g. vec![Box::new(f)]), serde/clap attribute refs, stale-owner-pointer fix
150-
117: {"TestAST_MergeStrategyAttribute_ReferencesScopedFunction", "TestExtract_UnprefixedUseOfSiblingFileSubmodule", "TestAST_ThiserrorAttributeCall_ReferencesFunction", "TestAST_MacroRulesBodyCall_EmitsFileRef", "TestAST_ItemLevelMacroInvocationCall_EmitsFileRef"}, // Rust: merge-attribute scoped-path fix, sibling-file submodule use-resolution, calls embedded in any attribute macro, owner-less macro content (macro_rules! bodies, item-level macro invocations) recorded via file_ref
151-
118: {"TestAST_DropImplTagsOverride", "TestAST_FutureImplTagsOverride", "TestAST_InherentDropLikeMethod_NotTaggedOverride", "TestAST_OtherTraitMethodNamedDrop_NotTaggedOverride"}, // Rust: Drop::drop/Future::poll tagged override (compiler/runtime-invoked, never called by name)
152-
119: {"TestGolden", "TestAST_ScopedAssociatedFnCall_InstantiatesType", "TestAST_ScopedAssociatedFnCall_SelfNotInstantiated"}, // Rust: Type::assoc_fn() records RelInstantiates for Type
153-
120: {"TestAST_BareScopedVariantValue_InstantiatesEnum", "TestAST_ScopedVariantInMatchPattern_InstantiatesEnum", "TestAST_ScopedMethodCall_NotTreatedAsVariant"}, // Rust: Type::Variant records RelInstantiates for Type (bare value or match pattern)
154-
121: {"TestAST_BareUnitStructValue_Instantiates", "TestAST_BareUnitStructValue_LetBinding_Instantiates", "TestAST_ScopedAssociatedFnCall_SelfNotInstantiated"}, // Rust: bare capitalized identifier value instantiates it
148+
114: {"TestGolden", "TestOwnsFile", "TestAST_ImplTraitForType_EmitsImplements", "TestAST_CallInsideMacroArgument", "TestAST_MatchesMacroGuardCall", "TestAST_FunctionPassedAsCallbackArgument", "TestAST_OrdinaryArgument_NoPhantomReference", "TestAST_FunctionReferenceInStructField", "TestAST_FunctionReferenceTakenByAddress", "TestAST_SerdeDefaultAttribute_ReferencesFunction", "TestAST_SerdeSkipSerializingIfAttribute_ReferencesFunction", "TestAST_ClapValueParserAttribute_ReferencesFunction", "TestAST_LocalFunctionPassedAsCallbackWithinSameBody", "TestAST_FunctionReferenceNestedInsideMacroArgument", "TestAST_MergeStrategyAttribute_ReferencesScopedFunction", "TestExtract_UnprefixedUseOfSiblingFileSubmodule", "TestAST_ThiserrorAttributeCall_ReferencesFunction", "TestAST_MacroRulesBodyCall_EmitsFileRef", "TestAST_ItemLevelMacroInvocationCall_EmitsFileRef", "TestAST_DropImplTagsOverride", "TestAST_FutureImplTagsOverride", "TestAST_InherentDropLikeMethod_NotTaggedOverride", "TestAST_OtherTraitMethodNamedDrop_NotTaggedOverride", "TestAST_ScopedAssociatedFnCall_InstantiatesType", "TestAST_ScopedAssociatedFnCall_SelfNotInstantiated", "TestAST_BareScopedVariantValue_InstantiatesEnum", "TestAST_ScopedVariantInMatchPattern_InstantiatesEnum", "TestAST_ScopedMethodCall_NotTreatedAsVariant", "TestAST_BareUnitStructValue_Instantiates", "TestAST_BareUnitStructValue_LetBinding_Instantiates"}, // Rust extractor added: symbols, implements post-pass, dependency/calls/route facts, cache participation; macro-arg calls, function-as-value references, serde/clap/merge attribute refs, sibling-file submodule use-resolution, owner-less macro content via file_ref; Drop::drop/Future::poll tagged override; Type::assoc_fn()/Type::Variant/bare unit-struct value all record RelInstantiates for Type
155149
}
156150

157151
func TestCacheVersionCoverage(t *testing.T) {

internal/engine/cache.go

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -434,45 +434,29 @@ import (
434434
// carries scanned_plugin=true (consumed by the enterprise dead-code detector as an
435435
// entry point). Both are new/changed facts, so cached Java snapshots must re-extract
436436
// (GAP-JV-08, new/60).
437-
// v115: adds the Rust extractor (fn/struct/enum/trait/type/const/static symbols; impl/trait
438-
// "implements" edges attached via a post-pass; use-based dependency facts classified
439-
// internal/external/stdlib; calls/instantiates edges; cyclomatic complexity; Axum route
440-
// facts). Rust is a new FileOwner, so its arrival also reshuffles which files count as
437+
// v114: adds the Rust extractor — fn/struct/enum/trait/type/const/static symbols;
438+
// impl/trait "implements" edges attached via a post-pass; use-based dependency facts
439+
// classified internal/external/stdlib; cyclomatic complexity; Axum route facts; and
440+
// RelCalls/RelInstantiates edges covering calls inside a macro invocation's token_tree
441+
// (bail!/format!/matches! arguments, and an ordinary call embedded in any attribute
442+
// macro, e.g. thiserror's #[error("{}", helper(x))]), a function passed by name as a
443+
// value (call argument, struct field, &f, nested inside a macro argument like
444+
// vec![Box::new(f)], or a local fn declared earlier in the same body), serde/clap/merge
445+
// attribute strings and scoped paths (default, skip_serializing_if, value_parser,
446+
// strategy), an unprefixed `use foo::bar;` where foo is a body-less `mod foo;` in the
447+
// same file/mod scope (classified internal instead of external), calls/references made
448+
// in macro content with no enclosing symbol (a macro_rules! template body, or an
449+
// item-level macro invocation standing in for a whole function — recorded on a file_ref
450+
// fact instead of dropped), a scoped associated-function call (Type::new(),
451+
// some_mod::Type::from(x)), Type::Variant (bare value or match pattern), and a bare
452+
// capitalized identifier used as a plain value (unit struct argument/let-binding) — the
453+
// last three all recorded as RelInstantiates for Type, the dominant Rust construction
454+
// idioms beyond a struct literal. Drop::drop and Future::poll are tagged override
455+
// (compiler/runtime-invoked, never called by name), mirroring Kotlin/Swift's `override`
456+
// handling. Rust is a new FileOwner, so its arrival also reshuffles which files count as
441457
// "shared" for every other cached extractor's key in a mixed-language repo. Cached
442458
// snapshots of any repo containing Rust files must re-extract.
443-
// v116: Rust call-reference precision — calls inside a macro invocation's token_tree
444-
// (bail!/format!/matches! arguments), a function passed by name as a value (call
445-
// argument, struct field, &f, a local fn declared earlier in the same body), and
446-
// serde/clap attribute strings/paths (default, skip_serializing_if, value_parser) are
447-
// now tracked as references. Also fixes a latent bug where a nested item (a local `fn`
448-
// inside a function body) could reallocate the fact slice and silently drop the
449-
// enclosing function's own relations recorded afterward.
450-
// v117: Rust — a function reference nested inside a macro argument (vec![Box::new(f)])
451-
// is now tracked; the merge crate's #[merge(strategy = mod::path)] attribute (and any
452-
// other flattened scoped-path attribute value, previously mis-read as just its first
453-
// segment) resolves correctly; an unprefixed `use foo::bar;` where foo is a body-less
454-
// `mod foo;` in the same file/mod scope is now classified internal instead of external
455-
// (it shares its parent's directory, so classifyUsePath had nothing to match it
456-
// against); an attribute can embed an ordinary call — thiserror's #[error("{}",
457-
// helper(x))] — scanned the same way as a macro invocation regardless of macro name;
458-
// and calls/references made in macro content with no enclosing symbol (a macro_rules!
459-
// template body, or an item-level macro invocation standing in for a whole function
460-
// like `ffi_fn! { fn foo() { ... } }`) are now recorded on a file_ref fact instead of
461-
// silently dropped for lack of an owner.
462-
// v118: Rust tags Drop::drop and Future::poll methods with the override prop — they are
463-
// invoked exclusively by the compiler (scope exit) or the async runtime (.await), never
464-
// by their literal method name, so the dead-code detector now excludes them like any
465-
// other framework-dispatched override (mirrors Kotlin/Swift's `override` handling).
466-
// v119: Rust records a RelInstantiates edge for the leading type in a scoped associated-
467-
// function call (Type::new(), some_mod::Type::from(x)) — the most common Rust
468-
// constructor idiom, previously invisible to the graph since only a struct literal or a
469-
// bare capitalized tuple-call counted as "instantiated".
470-
// v120: Rust records Type::Variant (capitalized trailing segment) as instantiating Type,
471-
// whether it's a plain value (match-arm result) or inside a match pattern.
472-
// v121: Rust records a bare capitalized identifier used as a plain value (a unit struct
473-
// passed as an argument, a let-binding) as instantiating it — previously skipped since
474-
// it looked the same as an ordinary lowercase local/param.
475-
const cacheVersion = "v121"
459+
const cacheVersion = "v114"
476460

477461
// extractorCache holds per-extractor facts keyed by a content hash of the files
478462
// the extractor depends on. It is loaded from disk at the start of a snapshot and

0 commit comments

Comments
 (0)