Skip to content

πŸ›πŸ§‘β€πŸ’» - Bugbot confuses generated Kotlin source lines and flags correct JaCoCo missed line assertionsΒ #796

Closed

Description

@efraespada

Is there an existing issue for this?

  • I searched all-state issues for TypedPolicy and for coverage / false-positive reports. Existing dependency/interop and reconciliation reports describe different findings; no matching generated-source line attribution report was found.

Which actions are affected?

Pull Request

Which platforms are affected?

Linux (review producer and passing complete backend CI); macOS (independent focused Gradle/Kotlin/JaCoCo reproduction). The finding concerns reasoning about generated fixture source, not an asserted platform-specific compiler defect.

Description

Bugbot reports a medium/99%-confidence finding that a real coverage fixture asserts an executed return is missed. It assigns the executed positive return to generated Kotlin source line 7, but the exact fixture writes that return on line 6. Line 7 is the unexecuted negative return. The unchanged test passes, and independently retained JaCoCo XML confirms its line/branch assertions.

Consumer: GeckoCV PR #42, exact analyzed source 2379ca938f8a93a8c8d2d767c38726b5d078fdec.
Finding: 4419172329, review 5706541373, fingerprint fp-55e41399, semantic sf-0fca1181.
Producer: 40977076354; smart effort, codex / gpt-6-luna. Telemetry reports complete context and all 21/21 analysis partitions completed.

Expected: distinguish Python host-file coordinates from line numbers in the Kotlin file generated by its literal string. Trace the actual written bytes and executed branch before asserting that the unchanged test fails. Actual: the finding recommends covering line 7, which would incorrectly treat the unexecuted negative-return statement as executed.

This is one observed review false positive, not proof of an internal parser/mapping root cause or a deterministic model regression. Other UI findings in the same review are valid and are being fixed independently.

Reproducing the issue

  1. Inspect the immutable fixture source. The fixture writer writes its string unchanged; there is no leading newline in the Kotlin literal.
  2. The relevant generated file is exactly:
package example
inline fun <reified T : Any> isKind(value: Any): Boolean = value is T
class TypedPolicy {
    fun recognizes(value: Any): Boolean = isKind<String>(value)
    fun decision(value: Int): Int {
        if (value > 0) return 1
        return -1
    }
    fun neverObserved(): Int = 99
}
  1. Its real JUnit test calls policy.decision(4) and expects 1. The positive return is on line 6, while line 7 is not executed. The fixture intentionally also leaves line 9 unexecuted.
  2. With Java 17 and the repository's populated offline Gradle cache, execute the unchanged fixture from repository root:
python .github/scripts/tests/test_backend_coverage.py BackendCoverageTests.test_kotlin_inline_attribution_keeps_unexecuted_authored_code_visible
  1. Observe success. Complete exact-source backend CI 40974861106 already passes the full coverage-policy suite. A fresh focused invocation after the finding also passes (one original test, 13.158 seconds). Its generated Kotlin file and XML were copied before temporary-directory cleanup without modifying the test, compiler, instrumentation or assertions.

copilot Version

vypdev/copilot@v3 explicitly resolves to f5e5a4cf9a80248994469cd88ad55eecab5b95ca / 3.10.6 in producer 40977076354. No claim is made about an unexecuted newer release or current upstream development changes.

Relevant Log Output

Ran 1 test in 13.158s
OK

Generated TypedPolicy.kt / actual JaCoCo source-line counters:
2: reified inline body  mi=0 ci=1 mb=0 cb=0
6: if (value > 0) return 1  mi=0 ci=4 mb=1 cb=1
7: return -1  mi=2 ci=0 mb=0 cb=0
9: neverObserved return 99  mi=2 ci=0 mb=0 cb=0

Thus line 6 has executed instructions and both a covered and missed authored branch; lines 7 and 9 correctly remain missed.

Additional context and comments

Suggested regression: review a host-language fixture that writes an embedded Kotlin source without a leading newline, then uses numeric JaCoCo source-line assertions. Preserve the distinction between host and generated coordinates. Include a genuine counterexample that incorrectly asserts the executed positive return is missed, so improving this case does not suppress real coverage-test defects. Reconcile an asserted runtime test failure against exact-source execution/XML when available, or express uncertainty instead of presenting an unexecuted prediction as a proven failure.

No consumer assertions, floors, filters, protection, workflow version or scope are weakened. No Copilot core changes or new remote branch were made by the consumer. No credentials or candidate data are included.

Activity

  1. added
    bugSomething isn't working
    bugfixSomething isn't working
    priority: highCritical issue, needs immediate attention.
    on Oct 30, 2026
  2. added theissue type on Oct 30, 2026
  3. moved this to Todo in vypdevon Oct 30, 2026
  4. changed the title [-]Bugbot confuses generated Kotlin source lines and flags correct JaCoCo missed-line assertions[/-] [+]πŸ› - Bugbot confuses generated Kotlin source lines and flags correct JaCoCo missed line assertions[/+] on Oct 30, 2026
  5. vypbot commented on Oct 30, 2026

    @vypbot
    Contributor

    Hi! I’m @vypbot, the Copilot assistant for this repository.

    I can answer questions, explain the codebase, propose implementation and test plans, review issues and pull requests for potential bugs or security problems, and help authorized maintainers apply changes.

    Try /copilot help to see the available commands, or mention @vypbot with your question.

  6. moved this from Todo to In Progress in vypdevon Oct 30, 2026
  7. added
    branchedIndicates that a branch has been created for this issue.
    on Oct 30, 2026
  8. changed the title [-]πŸ› - Bugbot confuses generated Kotlin source lines and flags correct JaCoCo missed line assertions[/-] [+]πŸ›πŸ§‘β€πŸ’» - Bugbot confuses generated Kotlin source lines and flags correct JaCoCo missed line assertions[/+] on Oct 30, 2026
  9. 11 remaining items

  10. added a commit that references this issue on Oct 30, 2026
  11. vypbot commented on Oct 30, 2026

    @vypbot
    Contributor

    Issue closed: synchronization recommendation retired

    No branch synchronization is required for this closed issue.

    The previous recommendation is historical. Issue closure does not certify that the branches are synchronized.

  12. moved this from In Progress to Done in vypdevon Oct 30, 2026
  13. added
    100%Progress: 100%
    and removed
    45%Progress: 45%
    in-progressStart work on an admitted issue.
    state:workingWork can proceed on the verified branch or without a branch.
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

100%Progress: 100%branchedIndicates that a branch has been created for this issue.bugSomething isn't workingbugfixSomething isn't workingpriority: highCritical issue, needs immediate attention.size: XXLIndicates an extremely large task or issue that requires significant time and effort to complete.

Type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions