Skip to content
CAI
Software that uses CAICheck a score

google/ksp

59.0

Adequate · 28 September 2026

42.6k

lines of production code

Java

with Kotlin

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is the Kotlin Symbol Processing (KSP) framework, specifically the KSP 2 implementation, which provides a high-performance API for inspecting Kotlin and Java symbols and generating code at compile time. It replaces the legacy compiler plugin with a new Analysis API backend that supports incremental compilation, multi-platform builds, and integration with modern Gradle and Android tooling. The system enables developers to write processors that traverse the abstract syntax tree, resolve types, and produce output files while maintaining build cache compatibility.

How it got here

2020–2021 — KSP 2 migration and API redesign

33 changes.

This period focused on the complete removal of the legacy KSP 1 implementation and the introduction of the new KSP 2 architecture, including a redesigned symbol and processing API. The work involved restructuring the Gradle plugin to support incremental processing and modern Android integration, alongside extensive updates to documentation and build infrastructure. Comprehensive integration tests were added to validate the new multi-platform and incremental compilation capabilities.

2022–2023 — KSP2 Analysis API implementation

27 changes.

This period focused on building the foundational components of the KSP2 backend using the Kotlin Analysis API, including core symbol resolution, type handling, and incremental compilation infrastructure. The work was supported by extensive API expansions, build system refactors, and comprehensive integration tests to validate the new symbol processing capabilities across various language features and platforms.

2024–2026 — KSP2 infrastructure and test expansion

35 changes.

This period focused on building the core infrastructure for the KSP2 backend, including a new common utility library, incremental processing capabilities, and refined annotation resolution strategies. Significant effort was dedicated to expanding test coverage across integration, Android, and multiplatform scenarios to validate these new features and ensure compatibility with modern Gradle and AGP versions.

Features

Add KotlinCompilerVersion class to embeddable symbol processing module

The symbol-processing-aa-embeddable module now includes a KotlinCompilerVersion class that loads the compiler version from the /META-INF/ksp.compiler.version resource file at startup. This class exposes methods to check if the compiler is in pre-release mode and to retrieve the version string, enabling the embeddable compiler to report its version and release status correctly.

symbol-processing-aa-embeddable · high confidence

Add internal exception for KSP bugs in analysis-api module

A new \InternalKSPException\ class has been added to the \kotlin-analysis-api\ module to signal internal bugs within KSP. This exception is placed in a separate package from the API module's version to prevent classpath collisions and shadowing. It includes detailed error reporting with location and originating class information, while overriding \toString\ to keep stack traces concise.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp · high confidence

Add multiplatform workload example with KSP 2.0 support

This change introduces a new example project located in examples/multiplatform/workload that demonstrates multiplatform Kotlin usage. The example includes common source files defining classes like Foo, Bar, and Baz, along with platform-specific main entry points for androidNativeArm64, androidNativeX64, and linuxX64 targets. The commit message indicates this example has been updated to use KSP 2.0.0-1.0.25, implying the example code is compatible with this version of the Kotlin Symbol Processing API.

examples/multiplatform/workload · high confidence

Added KSP processor example and annotation definition

The multiplatform processors example now includes a new TestProcessor that scans source files for class declarations and generates a corresponding 'Foo' class with boolean properties for each found class. This processor is registered via the standard Java SPI mechanism. Additionally, a new 'Builder' annotation has been added to the playground annotations module, providing a simple annotation definition for use in other examples.

examples/multiplatform/processors, examples/playground/annotations · high confidence

Added example annotation processors for KSP and Java

The playground now includes example implementations of code generators for both Kotlin Symbol Processing (KSP) and standard Java annotation processing. A new \BuilderProcessor\ demonstrates generating builder classes from annotated Kotlin classes using KSP, while \JavaBuilderProcessor\ provides the equivalent functionality for Java using \javapoet\. Additionally, a \TestProcessor\ is included to demonstrate KSP visitor patterns and file generation, with service provider configurations registered for both KSP and Java processors.

examples/playground/processors · high confidence

Analysis API implementation of KSP symbol declarations and types

The Analysis API backend for KSP now provides concrete implementations for core symbol types, including declarations (classes, properties, functions, and backing fields), annotations, and various type references (callable, classifier, definitely non-null, dynamic, and error types). This change introduces the \AbstractKSDeclarationImpl\ base class and specific implementations like \KSClassDeclarationImpl\ and \KSBackingFieldImpl\ to map Kotlin Analysis API symbols to the KSP symbol model, enabling the resolution of class hierarchies, sealed subclasses, and annotation arguments within the new analysis infrastructure.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin · high confidence

Initial release of the KSP symbol API

This change introduces the core Kotlin Symbol Processing (KSP) API interfaces in the \com.google.devtools.ksp.symbol\ package, providing the foundational types for processing Kotlin code. The API defines the symbol hierarchy starting from \KSNode\, with specific interfaces for declarations (\KSDeclaration\, \KSClassDeclaration\, \KSFunctionDeclaration\, \KSPropertyDeclaration\), type references (\KSType\, \KSTypeReference\), and annotations (\KSAnnotation\). It includes support for modern Kotlin features such as context parameters (\KSContextParameter\), backing fields (\KSBackingField\), and definitely non-null types (\KSDefNonNullReference\). The release also establishes the visitor pattern for traversing the symbol tree via \KSVisitor\ and \KSVisitorVoid\, and adds utility methods for type resolution like \asMemberOf\ and \findOverridee\.

api/src/main/kotlin/com/google/devtools/ksp/symbol · high confidence

Introduce KSP-based command-line parser generator

Added a new Kotlin Symbol Processing (KSP) tool that automatically generates command-line argument parsing functions and help text. By annotating a configuration class builder with \KSPArgParserGen\, the system generates a parser function that converts command-line arguments into the configuration object and a separate help function listing available options, supporting String, Boolean, File, List, and Map types.

cmdline-parser-gen · high confidence

Introduce KSP2 Analysis API implementation components

This change adds the core implementation files for the KSP2 Analysis API backend, including the main execution entry point (KotlinSymbolProcessing), the resolver (ResolverAAImpl), and supporting infrastructure such as incremental context tracking (IncrementalContextAA), file caching (FileCache), and diagnostic reporting (KspDiagnostics). For users, this represents the foundational shift from the legacy frontend to the new Analysis API, enabling improved symbol resolution and incremental compilation capabilities.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl · high confidence

Introduce incremental analysis infrastructure for KSP standalone mode

This change adds a new set of standalone components in the \kotlin-analysis-api\ module to support incremental processing in KSP2. It introduces \IncrementalJavaFileManager\ and \IncrementalKotlinPackageProviderFactory\ to manage Java roots and Kotlin package providers incrementally, allowing new source files to be added without re-indexing static libraries. \IncrementalKotlinDeclarationProviderFactory\ and \KspStandaloneDirectInheritorsProvider\ enable incremental declaration lookups and direct inheritor resolution, optimizing how the system handles class hierarchies and type aliases. Additionally, \KspLibraryModuleBuilder\ and \KspSourceModuleBuilder\ provide specialized module builders that use custom search scopes (\LibraryRootsSearchScope\ and \IncrementalGlobalSearchScope\) to correctly scope library and source content, ensuring that annotations and inheritance checks are resolved accurately within the incremental context.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/standalone · high confidence

Introduce resolved symbol implementations for the Analysis API backend

This change adds a new set of resolved symbol implementations (KSAnnotationResolvedImpl, KSTypeReferenceResolvedImpl, KSTypeArgumentResolvedImpl, and KSClassifierReferenceResolvedImpl) to the kotlin-analysis-api module. These classes provide the backend for handling annotations and type references that are resolved semantically or lack direct source PSI, such as those loaded from compiled bytecode, nested annotations, or synthesized annotations. This enables KSP to correctly process and inspect these elements during symbol processing.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/resolved · high confidence

New KSP benchmark infrastructure for compile-time performance measurement

The benchmark directory now includes a complete suite for measuring KSP (Kotlin Symbol Processing) compile-time performance. This adds an exhaustive processor that visits all KSP AST nodes to stress-test the compiler, a runner script that executes the K2JVM compiler with specific KSP plugin arguments, and build/upload scripts to manage the benchmark data (including a patched Tachiyomi project) and upload results to Google Cloud Storage.

benchmark · high confidence

New Kotlin KSP annotation processor example

Added a new 'hello-world' example project demonstrating how to use Kotlin Symbol Processing (KSP) to generate code at compile time. The example includes a custom \@HelloWorld\ annotation, a processor that detects this annotation and generates a \helloWorld\ function, and a main application entry point that utilizes the generated code.

examples/hello-world, examples/hello-world/annotations, examples/hello-world/processor · high confidence

New and updated example projects for KSP and multiplatform development

The examples directory now includes a new 'hello-world' project that demonstrates core KSP mechanisms, such as annotation processing, AST traversal, and code generation, along with a new 'multiplatform' example. Additionally, the 'playground' example has been imported to showcase builder patterns and annotation usage. All example projects have been updated to use Gradle 9.1.0, ensuring they are compatible with the latest build tooling.

examples · high confidence

New common implementation classes for KSP code generation and symbol handling

This change introduces several new implementation classes in the \com.google.devtools.ksp.common.impl\ package to support KSP functionality. \CodeGeneratorImpl\ provides the concrete logic for generating output files (Java, Kotlin, classes, resources) and managing source-to-output associations, including handling incremental build dependencies. \KSNameImpl\ implements the \KSName\ interface with caching support for qualified and short name resolution. \KSTypeReferenceSyntheticImpl\ handles synthetic type references that resolve to existing types. \PlatformInfoImpl\ classes (\JvmPlatformInfoImpl\, \JsPlatformInfoImpl\, \NativePlatformInfoImpl\, \UnknownPlatformInfoImpl\) provide platform-specific information for the compiler. Additionally, \RefPosition.kt\ adds utilities for determining the position of type references (parameter, return, or super type) and finding outermost references, which aids in type analysis.

common-util/src/main/kotlin/com/google/devtools/ksp/common/impl · high confidence

New common utility library for KSP

A new \common-util\ module has been added to the project, consolidating shared utilities into the \com.google.devtools.ksp.common\ package. This includes \KSObjectCacheManager\ and \KSObjectCache\ for managing thread-local caches with proper cleanup, \IdKey\ classes for identity-based hashing, \ErrorTypeUtils\ for handling inconsistent type arguments, \IncrementalUtil\ for synthetic file handling and timestamp-preserving copies, \JvmUtils\ for JVM annotation constants, \KSPUtils\ for extracting \@Throws\ annotations, and \MemoizedSequence\ for caching sequence iteration.

common-util/src/main/kotlin/com/google/devtools/ksp/common · high confidence

New common-deps module for KSP configuration and logging

A new \common-deps\ module has been introduced to isolate classpath dependencies and centralize KSP configuration. This change adds core configuration classes (\KSPConfig\, \KSPJvmConfig\) that define build settings such as source roots, output directories, and incremental compilation flags, alongside a new \IncrementalContextLoggingOptions\ data class for logging control. It also introduces a \KspGradleLogger\ to standardize message formatting with file locations and adds a command-line argument parser (with corresponding tests) to parse these configuration options from CLI inputs.

common-deps · high confidence

New incremental processing infrastructure and utilities

This change introduces the core incremental processing infrastructure for the Kotlin Analysis API backend, including the \IncrementalContextBase\ class which manages file change tracking, cache persistence, and lookup caching, alongside supporting utilities like \PersistentMap\ for serializing symbol maps to disk, \PsiUtils\ for PSI element handling, and \SymbolCollector\ for gathering declaration symbols. These components form the foundation for incremental compilation support in this module.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/common · high confidence

New utility APIs and experimental opt-in annotation

The KSP API now includes a new @KspExperimental opt-in annotation for unstable features. Several convenience utility functions have been added to the Resolver and symbol types, including getClassDeclarationByName, getFunctionDeclarationsByName, and getPropertyDeclarationByName for easier symbol lookup, as well as getDeclaredFunctions, getDeclaredProperties, and getConstructors for KSClassDeclaration. The containingFile property is now available as an extension on KSNode, and the validate function on KSNode has been updated to support an explicit feature toggle for validating new language features like backing fields.

api/src/main/kotlin/com/google/devtools/ksp · high confidence

New visitor to collect symbols annotated with specific annotations

A new \CollectAnnotatedSymbolsVisitor\ class has been added to the common utility module. This visitor traverses the Kotlin Symbol Processing (KSP) tree to identify and collect symbols that carry annotations. It supports both shallow and deep traversal modes via the \inDepth\ flag and includes conditional support for visiting backing fields through the \enableNewFeatures\ flag, allowing consumers to gather annotated elements across classes, functions, properties, and type parameters.

common-util/src/main/kotlin/com/google/devtools/ksp/common/visitor · high confidence

Removals

Kotlin Symbol Processing API interface removal

The entire public API surface in the \org.jetbrains.kotlin.ksp.symbol\ package has been removed. This includes the deletion of all core interfaces (such as \KSDeclaration\, \KSClassDeclaration\, \KSFunctionDeclaration\, \KSType\, and \KSPropertyDeclaration\), supporting enums (\ClassKind\, \FunctionKind\, \Modifier\, \Visibility\, \Variance\, \Nullability\), and visitor classes (\KSVisitorVoid\). This change eliminates the existing symbol processing API definitions from this location.

libraries/tools/kotlin-symbol-processing-api/src/org/jetbrains/kotlin/ksp/symbol · high confidence

Removal of KSP utility extension functions

The file containing utility extension functions for KSP symbols (such as \getDeclaredFunctions\, \getVisibility\, \getAllSuperTypes\, and visibility checks) has been deleted. This removes these helper methods from the public API, meaning users can no longer call these convenience functions on KSP declarations and must implement equivalent logic or use alternative APIs.

libraries/tools/kotlin-symbol-processing-api/src/org/jetbrains/kotlin/ksp · high confidence

Removal of legacy KSP processing interfaces

The \CodeGenerator\, \Resolver\, and \SymbolProcessor\ interfaces have been removed from the \org.jetbrains.kotlin.ksp.processing\ package. This change eliminates the previous API contract used by plugins to integrate with Kotlin Symbol Processing, meaning existing processors relying on these specific interfaces will no longer compile against this version of the API.

libraries/tools/kotlin-symbol-processing-api/src/org/jetbrains/kotlin/ksp/processing · high confidence

Removal of legacy Kotlin KSP Gradle subplugin implementation

The legacy Gradle subplugin implementation for Kotlin Symbol Processing (KSP) has been removed. This change deletes the \KspGradleSubplugin\ class, the associated \KspModelBuilder\, and all related Gradle plugin descriptor files (including \kotlin-ksp.properties\ and service loader configurations). Users relying on this specific legacy integration path will no longer have access to these components, as the codebase is shifting towards a different mechanism for KSP support.

libraries/tools/kotlin-ksp-gradle · high confidence

Removal of legacy Kotlin Symbol Processing (KSP) compiler plugin implementation

The legacy KSP compiler plugin implementation has been removed from the \plugins/ksp\ directory. This change deletes the core extension classes (\KotlinSymbolProcessingExtension\, \KotlinSymbolProcessingPlugin\), the service provider registrations for the \CommandLineProcessor\ and \ComponentRegistrar\, and the internal symbol resolution and code generation implementations (\ResolverImpl\, \CodeGeneratorImpl\). It also removes the associated test processor utilities and binary symbol descriptor implementations, effectively stripping out the previous compiler-integrated KSP support from this location.

plugins/ksp · high confidence

API

Expanded KSP API surface with new Resolver and CodeGenerator capabilities

The KSP API has been significantly expanded to provide more granular control and inspection capabilities for symbol processing. The \Resolver\ interface now includes methods to inspect Java package-level annotations (\getPackageAnnotations\, \getPackagesWithAnnotation\), determine if a type is a raw Java type (\isJavaRawType\), retrieve the module name (\getModuleName\), and map between Java and Kotlin names. Additionally, the \CodeGenerator\ interface has been enhanced with new methods (\associateWithFunctions\, \associateWithProperties\) to allow associating generated files with specific function or property declarations, and \createNewFile\ offers more flexibility in file generation. These changes enable processors to handle more complex code generation scenarios and interact more deeply with the underlying Java/Kotlin type system.

api · high confidence

Behavioural changes

Annotation resolution now supports use-site targets and new feature flags

The annotation resolution logic in the \common/impl\ package has been refactored to introduce \AAResolutionStrategy\ and \PsiResolutionStrategy\, both implementing the new \AnnotationResolutionStrategy\ interface. This change adds support for resolving annotation use-site targets (such as \@get:\, \@field:\, \@property:\, etc.) to correctly identify the specific symbol an annotation applies to, rather than just the containing element. Additionally, a new \enableNewFeatures\ flag is propagated through the resolution strategies, allowing the system to optionally return backing fields and context parameter symbols, improving accuracy for annotations applied to these specific language constructs.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/common/impl · high confidence

Build system refactors: new API check and ktfmt tasks, path provider rename

The buildSrc module introduces new Gradle tasks for API compatibility checking (using Metalava 1.0.0-alpha14) and code formatting (replacing ktlint with ktfmt 0.63), while renaming AbsolutePathProvider to RelativizingPathProvider to better reflect its role in handling relative paths during configuration.

buildSrc · high confidence

Improved Gradle Project Isolation support and AGP version enforcement

The KSP Gradle plugin now better supports Gradle's Project Isolation feature by detecting the isolation state via the new BuildFeatures API (Gradle 8.5+) or falling back to legacy properties, and allows forcing this behavior with the \ksp.project.isolation.enabled\ property. Additionally, the plugin enforces a minimum Android Gradle Plugin (AGP) version of 8.12.0, throwing an error if an older version is detected, and includes utilities to check for AGP and Kotlin plugin application states.

gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/utils · high confidence

Improved handling of Java annotation defaults and nested annotation equality in KSP2

The Kotlin Symbol Processing (KSP2) implementation in the \kotlin-analysis-api\ module now more accurately processes annotation arguments from Java sources. Specifically, it maps Java types to Kotlin types when parsing annotation class reference values, handles nested annotation defaults defined in both Java and Kotlin libraries, and correctly implements \KSValueArgument.equals\ to ensure consistent comparison of annotation arguments. These changes are validated by new test cases covering Java annotation defaults, nested annotation structures, and class reference resolution.

kotlin-analysis-api/testData/annotationValue · high confidence

Internal KSP exception now provides structured error details

The InternalKSPException class has been moved to the api module and now includes a custom toString implementation. This change ensures that when an internal KSP bug occurs, the exception message contains structured details such as the specific file location, the originating class, and a link to report the issue, while keeping the stack trace concise.

api/src/main/kotlin/com/google/devtools/ksp/errors · high confidence

Java annotation argument evaluation and default value handling

The KSP implementation for Java annotations now fully evaluates annotation arguments and default values using the Kotlin Analysis API. This includes resolving complex argument types such as class literals, array initializers, and nested annotations, while correctly filtering default arguments by name to ensure consistency with explicit arguments. The change introduces \KSValueArgumentLiteImpl\ to handle lightweight argument representations and ensures that default arguments are included in the output even when they do not have a default value, improving the accuracy of annotation metadata for Java sources.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/java · high confidence

KSP 2 Gradle plugin implementation and Android integration

The Gradle plugin has been rewritten to implement KSP 2 as the default and only processing engine, removing support for KSP 1. This introduces a new \KspAATask\ that supports incremental processing, Gradle build cache, and isolated processor classloaders to improve performance in multi-module builds. Android integration is now handled via the \AndroidPluginIntegration\ helper, which registers generated sources using the modern AGP Variant API and supports AGP's built-in Kotlin compilation (AGP 9.0+). The plugin also introduces a new \KspConfigurations\ system that creates source-set-specific dependency configurations (e.g., \kspJvm\) and deprecates the global \ksp\ configuration in multiplatform projects.

gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle · high confidence

KSP processing API restructured with new file generation and error handling

The \com.google.devtools.ksp.processing\ package has been reorganized and expanded to support more robust code generation and multi-round processing. The \CodeGenerator\ interface now provides \createNewFile\ and \createNewFileByPath\ methods that require explicit dependency tracking via \Dependencies\, alongside new \associate\*\ methods (\associateWithClasses\, \associateWithFunctions\, \associateWithProperties\) to link generated outputs to their source symbols. Error handling is improved with a new \onError()\ callback in \SymbolProcessor\ and an \ExitCode\ enum to distinguish processing errors from internal failures. The \SymbolProcessorProvider\ is now a \fun interface\ replacing the previous \init()\ pattern, and \SymbolProcessorEnvironment\ exposes detailed platform information (JVM, JS, Native) and KSP versioning.

api/src/main/kotlin/com/google/devtools/ksp/processing · high confidence

KSP2 command-line tool now exits with proper status codes

The KSP2 command-line entry points (KSPCommonMain, KSPJsMain, KSPJvmMain, KSPNativeMain) now ensure the process terminates with an appropriate exit code. The shared execution logic wraps processing in a try-catch block to handle errors gracefully, logging the exception and calling exitProcess with a processing error code on failure, while successful runs exit with the code returned by KotlinSymbolProcessing.execute().

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/cmdline · high confidence

New PSI visitors for collecting annotated symbols and classifier names

Added \CollectAnnotatedSymbolsPsiVisitor\ and \CollectClassifierNameVisitor\ to the common visitor package. The annotation visitor now correctly handles grouped annotations (e.g., \@\[A, B\]\) and throws an \InternalKSPException\ for unexpected PSI elements, ensuring robust collection of annotated declarations while skipping function/method bodies and expressions. The classifier visitor provides a utility to collect names of classes, objects, and type aliases from Kotlin files.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/common/visitor · high confidence

New utility classes for bytecode analysis and PSI handling in the Analysis API implementation

Added BinaryUtils.kt and PsiUtils.kt to the symbol utilities package to support the new Analysis API backend. BinaryUtils introduces bytecode parsing capabilities, including a cache for class member access flags, validation of class file formats, and extraction of declared exceptions from method signatures, alongside a new DeclarationOrdering class to determine the binary order of class members. PsiUtils provides helper functions to extract KDoc strings from PSI elements and map Kotlin PSI modifiers to the KSP Modifier set, while also handling the classification of class types (such as enums, interfaces, and annotations) with proper exception handling via InternalKSPException.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/util · high confidence

Project setup and documentation overhaul

The repository has been restructured with new foundational files: \.editorconfig\ enforces 4-space indentation and 120-character line limits for Kotlin files; \.gitattributes\ standardizes line endings (LF for source/docs, CRLF for Windows scripts) and marks binaries; \.gitignore\ excludes build artifacts and IDE files. Documentation has been significantly updated with new \CONTRIBUTING.md\ and \DEVELOPMENT.md\ guides detailing bug workflows, testing with \AbstractTestProcessor\, and debugging the \KotlinCompileDaemon\. The \README.md\ now serves as a central hub linking to external docs, includes a comprehensive reference table for KSP Gradle configurations (single-platform and KMP), lists Gradle properties (including new isolation and classloader cache options), and notes that KSP 1.x is removed.

(repo-wide) · high confidence

Simplified coroutine and progress management for Kotlin Analysis API

The Kotlin Analysis API now uses simplified, standalone implementations for core IntelliJ platform services to avoid loading the IntelliJ-specific kotlinx.coroutines fork in CLI environments. This includes a new MockFileIndexFacade that provides basic file-indexing behavior, a BinaryFileTypeDecompilers service stub, a CoreProgressManager that bypasses complex cancellation hooks, and an IntelliJCoroutinesFacade that delegates to standard kotlinx.coroutines runBlocking instead of the IntelliJ-forked variant. These changes streamline the API's runtime dependencies and reduce initialization overhead.

kotlin-analysis-api/src/main/java · high confidence

Support for synthetic Java backing fields and function type annotations

The Analysis API integration now correctly exposes backing fields for synthetic Java properties (such as those generated when Kotlin accesses Java fields) via the new KSSyntheticJavaBackingFieldImpl, ensuring that these synthetic elements are properly represented in the symbol model. Additionally, the system now synthetically adds the ExtensionFunctionType annotation to functional types, addressing a gap where the Analysis API did not include non-custom annotations in the KtType annotation list, which unmutes related tests and improves annotation accuracy.

kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/synthetic · high confidence

Visitor classes now support backing fields and context parameters via a feature flag

The KSP visitor hierarchy (KSEmptyVisitor, KSDefaultVisitor, KSTopDownVisitor) has been updated to support new language features: backing fields and context parameters. These features are controlled by a new \enableNewFeatures\ boolean flag; when disabled (the default for binary compatibility), visiting these elements throws an exception. When enabled, visitors correctly traverse backing fields and context parameters. Additionally, \KSValidateVisitor\ is introduced to validate symbol structures, and \KSVariableParameter\ has been renamed to \KSValueParameter\ to align with the grammar.

api/src/main/kotlin/com/google/devtools/ksp/visitor · high confidence

Test coverage

Add integration tests for sealed class subclass resolution; Added Android KMP integration tests for KSP builder generation; Added Android integration tests for KSP with built-in Kotlin and binding features; Added Android multi-module test fixture; Added KMP integration test resources and test processors; Added KSP integration test resources for symbol processing and code generation; Added KSP integration tests for kapt3 test processors and workload; Added incremental removal test resources for KSP symbol processing; Added integration test for KSP processor generating Swift files; Added integration test for Kotlin constants in Java; Added integration test for combined init and provider KSP usage; Added integration test for kotlin-inject issue \#2072; Added integration test resources for Android with built-in Kotlin; Added integration test resources for KSP processor error handling; Added integration test resources for KSP symbol processors; Added integration test workload for KSP2 annotation processing; Added integration tests for AGP and Kotlin version compatibility; Added integration tests for Java nested class resolution; Added integration tests for KSP Gradle plugin behavior and configuration; Added integration tests for KSP map annotation arguments with Java types; Added integration tests for KSP primary package; Added integration tests for KSP with Android Data Binding and legacy Kapt; Added integration tests for incremental KSP processing; Added integration tests for incremental classpath handling; Added integration tests for multi-round KSP symbol processing; Added integration tests for nullability annotation handling; Added integration tests for output dependencies; Added native backend test data for KMP annotations and package declarations; Added negative test cases for annotation use-site targets; Added targeted tests for \Resolver.getSymbolsWithAnnotation\ resolution strategies; Added test annotations for tracking bugs and negative test cases; Added test data for Java annotation overrides and interface resolution order; Added test for incremental build invalidation on file removal; Added test for incremental compilation with annotation class references; Added test resource for Kotlin opt-in annotation handling; Added test resources for KSP2 command-line options; Added test resources for build cache incremental processing; Added test resources for hierarchical processing mode validation; Added test resources for partial-clean integration test; Added test resources to verify KSP processor execution on Java-only projects; Added test utility functions for KSP integration tests; Added tests for KspModelBuilder; Added tests for MemoizedSequence and CodeGeneratorImpl; Expanded integration test coverage for KSP incremental and multi-module scenarios; Expanded test coverage for Kotlin Symbol Processing (KSP) in kotlin-analysis-api; Expanded test coverage for annotation resolution and type system behavior; New KSP Gradle integration test infrastructure; New test fixtures for KSP integration testing; New test processors for KSP symbol resolution and annotation inspection; Organized overridee test data into specific scenario files; Refactored KSP test infrastructure with new test suites and configuration; Updated test expectations for Kotlin Analysis API.

Dependencies

Initial project structure and dependency configuration for KSP 2

The project has been restructured to support KSP 2, introducing a centralized version catalog (gradle/libs.versions.toml) to manage dependencies such as Kotlin 2.3.20, Android Gradle Plugin 9.3.0-alpha01, and the Kotlin Analysis API 2.4.20-dev-6138. This change includes the addition of new modules like \api\, \common-deps\, and \common-util\, alongside updated Gradle plugin configurations and example projects (hello-world, multiplatform, playground) that demonstrate the new KSP 2 integration.

(dependencies) · high confidence

Updated Gradle wrapper to version 9.5.0

The Gradle wrapper has been updated to use Gradle 9.5.0. This change includes a new SHA-256 checksum file for the wrapper JAR and updates the wrapper properties to download the 9.5.0 binary distribution, ensuring consistent build environments across development and CI.

gradle · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 60 → 59 (-0.7)
  • Rubric changed (rubric-2026.09.8 → rubric-2026.09.16) — scores are not directly comparable.

Lenses

  • Code Health 98 → 98 (+0.0)
  • Architecture 99 → 83 (-16.1)
  • Maturity 53 → 53 (+0.0)
  • Readiness 49 → 50 (+1.1)
  • Security 73 → 73 (+0.0)

Resolved (3)

  • Change coupling: KSAnnotationImpl.kt ↔ KSAnnotationResolvedImpl.kt (kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSAnnotationImpl.kt)
  • Change coupling: KspAATask.kt ↔ kgpUtils.kt (gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt)
  • Off-boarding risk: anonymized user #1

New (7)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no project overview (README.md)
  • Documentation: no usage examples (docs/ksp2cmdline.md)
  • Documentation: no usage examples (docs/ksp2entrypoints.md)
  • Low cohesion: CoreProgressManager (LCOM4 5) (kotlin-analysis-api/src/main/java/com/intellij/openapi/progress/impl/CoreProgressManager.java)
  • No ADRs found
  • Off-boarding risk: anonymized user #1

Changes since last survey

  • 36 commits — 30 feature/other, 6 fixes

By area

  • kotlin-analysis-api/src — 12 commits
  • api/src — 5 commits
  • gradle-plugin/src — 4 commits
  • (root) — 3 commits
  • integration-tests/src — 3 commits
  • kotlin-analysis-api/testData — 3 commits
  • api/api.base — 2 commits
  • .github/workflows — 1 commit
  • cmdline-parser-gen/src — 1 commit
  • examples/playground — 1 commit
  • test-utils/src — 1 commit

Notable commits

  • fix: Fix expected test output in testLocations
  • fix: Fix getting default annotation value in KLib
  • fix: Fix project isolation detection in KSP
  • fix: Fix resolving type aliases in PsiResolutionStrategy
  • fix: Mark test for type aliases as fixed
  • fix: Mark testNativeAnnotationDefaultValue as fixed
  • change: Add KSContextParameter
  • change: Add KSFunctionDeclaration.contextParameters to API
  • change: Add KSPropertyDeclaration.contextParameters
  • change: Add documentation to KSTypeReferenceResolvedImpl
  • change: Add test case for annotated value parameter in testParent
  • change: Add test for issue 2420
  • change: Add visitContextParameter to KSVisitorNext
  • change: Bump bootstrap KSP version to 2.3.12
  • change: Bump build Kotlin version to 2.4.0
  • change: Document KSAnnotationResolvedImpl
  • change: Fix deprecation warnings in test processors
  • change: KSP2: reuse processor classloaders across modules within a build
  • change: KSP2: use a structured key for the processor classloader cache
  • change: Mark sha256sum files as text and lf in gitattributes
  • …and 16 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

google/ksp was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 28 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 02e99a5d7c83ded80aa01ba379b48822f56fddea — the exact code this score is about.
  • Scored under rubric-2026.09.16 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-2d9048c36d26.