Skip to content

bug: 0.3.0 KSP migration stops generating EntitySchema objects #448

@wax911

Description

@wax911

support-query-builder 0.3.0 KSP issue body

Description of Bug

support-query-builder 0.3.0 appears to stop generating *EntitySchema objects for @EntitySchema-annotated top-level Room entities after the processor migration from KAPT to KSP.

The failure was found while updating anitrend-v2 from 0.2.13 to 0.3.0 in PR https://github.com/AniTrend/anitrend-v2/pull/1186.

Current CI failure:

e: file:///home/runner/work/anitrend-v2/anitrend-v2/data/src/main/kotlin/co/anitrend/data/tag/entity/filter/TagQueryFilter.kt:38:17 Unresolved reference 'TagEntitySchema'.

Failing job:

  • https://github.com/AniTrend/anitrend-v2/actions/runs/25968654463/job/76336658615

Reproduction Steps

  1. Update a consumer project from support-query-builder 0.2.13 to 0.3.0.
  2. Fix the published artifact rename introduced in 0.3.0:
    • core-ext -> ext
  3. Update the consumer processor wiring from KAPT to KSP:
    • add com.google.devtools.ksp
    • change kapt(libs.anitrend.querybuilder.processor) to ksp(libs.anitrend.querybuilder.processor)
  4. Compile a module containing top-level Room @Entity classes annotated with @EntitySchema.
  5. Observe that no generated *EntitySchema files are emitted and downstream Kotlin compilation fails on unresolved schema references.

Consumer-side observations from anitrend-v2:

  • many @EntitySchema declarations still exist under data/src/main/kotlin/...
  • :data:kspDebugKotlin executes
  • no data/build/generated/ksp directory is created
  • no generated TagEntitySchema file appears

Screenshots/Videos

Not applicable.

Device & Build Information

  • OS Version: Ubuntu GitHub Actions runner
  • App Version: not applicable, library consumer build failure
  • Phone Model: not applicable
  • Phone Brand: not applicable

Download Source:

  • PlayStore
  • Github
  • Other (specify)

Additional Context

Release evidence:

  • https://github.com/AniTrend/support-query-builder/releases/tag/0.3.0
  • https://github.com/AniTrend/support-query-builder/compare/0.2.13...0.3.0

Relevant release changes:

  • feat: add new symbol processor (#280)
  • build: smoke test and production testing for Dokka and KSP (#436)

What was already verified:

  1. The initial consumer failure caused by artifact changes was fixed locally:
    • annotations, core, ext, and processor now resolve at 0.3.0
  2. The published processor-0.3.0.jar appears structurally valid and contains:
    • Processor.class
    • Provider.class
    • META-INF/services/com.google.devtools.ksp.processing.SymbolProcessorProvider
  3. After switching the consumer from KAPT to KSP, generation still produces no *EntitySchema outputs.

One suspicious code path in Processor.kt:

valid
    .filterIsInstance<KSClassDeclaration>()
    .groupBy { it.parentDeclaration?.qualifiedName?.asString() }
    .values
    .forEach { classDeclarations ->
        entitySchemaCodeGenerator(
            resolver = resolver,
            classDeclarations = classDeclarations
        )
    }

For top-level declarations, parentDeclaration is typically null. That may be harmless, but it is a large behavior change in the KSP migration and seems worth checking first.

Suggested next check upstream:

  • add a minimal KSP integration test using a top-level Room @Entity annotated with @EntitySchema
  • assert that a TagEntitySchema-style object is generated

Local handover doc with fuller investigation notes:

  • docs/superpowers/plans/2026-05-17-support-query-builder-ksp-root-cause-handover.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions