Skip to content

πŸ›πŸ§‘β€πŸ’» - Review false positive implicit null input requiredness contradicts the actual Kotlin decoderΒ #807

Closed

Description

@efraespada

Is there an existing issue for this?

Which actions are affected?

Pull Request

Which platforms are affected?

Linux

Description

Bugbot recommends removing the explicitNulls=false condition from input optionality, claiming that the compiled Kotlin decoder always requires nullable properties without defaults. That recommendation would reject inputs that the actual corresponding Kotlin decoder accepts.

The cited existing negative test executes serverWireJson with explicitNulls=true. It does not establish behavior for the false policy. The generator currently accounts for the policy correctly; no generator production change is needed.

Reproducing the issue

Observed finding: https://github.com/vypdev/geckocv/pull/42#discussion_r4423890160

Review workflow: https://github.com/vypdev/geckocv/actions/runs/41059078157

Reviewed source: 1b5e3a0ade73d21c749bceba004230fc97f2713e.

Additional compiled controls and audit: https://github.com/vypdev/geckocv/commit/f017a52

The existing compiled probe contains:

@Serializable
private data class WireShapeProbe(
    @SerialName("candidate_name") val candidateName: String,
    val requiredNullable: String?,
    // Other fields have defaults.
)

With the repository's installed runtime and Json(serverWireJson) { explicitNulls = false }, decoding {"candidate_name":"Synthetic"} succeeds and requiredNullable is null. It equals decoding the same object with requiredNullable explicitly null. Decoding {} still throws for the missing non-nullable candidate_name. With serverWireJson's explicitNulls=true, omitting requiredNullable throws.

The new actual compiled serializer control passes with the seven existing controls: eight tests, zero failures/errors/skips. The actual export still has the original frozen proposal SHA-256 111bcafb260579ec2489f8386117a531ec8498e73a90f271f9a3e4c795d65dd7. The generator remains byte-for-byte unchanged.

The real TypeScript 5.9.3 campaign also compiles omission of requiredNullable under the compiled implicit-null fixture. Its existing negative control rejects that omission under the explicit-null fixture. All 64 typed-contract tooling cases pass, retaining all nine source floors of 90% lines and branches.

Official semantics: https://kotlinlang.org/api/kotlinx.serialization/kotlinx-serialization-json/kotlinx.serialization.json/-json-builder/explicit-nulls.html

The documentation explicitly covers absence becoming null for nullable properties without defaults when the flag is disabled. Actual repository runtime execution independently confirms it.

copilot Version

Observed review uses published vypdev/copilot@v3 at f5e5a4c / 3.10.6. No conclusion is drawn about an unexecuted newer release or the internal cause of this reasoning error.

Relevant Log Output

The finding asserts: "for valid evidence with explicitNulls: false, the generated input type permits omission that the corresponding Kotlin serializer rejects." The real decoder accepts that omission. Its suggested change would narrow the TypeScript input surface incorrectly.

Additional context and comments

Please cover both flag values in review grounding/evaluation, including required non-nullable controls and nullable fields with/without defaults. Follow the actual Json instance used by the cited test rather than transferring conclusions between policies. This report does not dismiss actual request-validation issues or ask to reduce review gates.

The reporter has not started an upstream branch, changed the correct consumer generator, reduced the SDD scope, lowered thresholds, deployed or published a release. Genuine malformed administrative-body defects remain open separately in GeckoCV #49. Please handle this through the Copilot team's normal workflow.

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 [-]Review false positive: implicit-null input requiredness contradicts the actual Kotlin decoder[/-] [+]πŸ› - Review false positive implicit null input requiredness contradicts the actual Kotlin decoder[/+] 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 [-]πŸ› - Review false positive implicit null input requiredness contradicts the actual Kotlin decoder[/-] [+]πŸ›πŸ§‘β€πŸ’» - Review false positive implicit null input requiredness contradicts the actual Kotlin decoder[/+] on Oct 30, 2026
  9. added
    state:workingWork can proceed on the verified branch or without a branch.
    on Oct 30, 2026
  10. vypbot commented on Oct 30, 2026

    @vypbot
    Contributor

    Implementation plan

    Current status: Ready to start. No action is required from maintainers before implementation.

    1. Trace the review evidence path
      • Inspect Bugbot context loading, prompt construction, and quality evaluation to find where Kotlin serializer evidence and the cited test are represented.
      • Follow the Json instance and its explicitNulls setting for each cited test.
    2. Ground reviews in the active serializer policy
      • Require evidence for both explicitNulls values before concluding whether omitted nullable properties are accepted.
      • Keep required non-nullable properties and nullable properties with and without defaults as separate controls.
    3. Add policy-specific evaluation cases
      • Cover omission and explicit null for nullable fields under both flag values, plus missing required non-nullable fields.
      • Use compiled decoder results as expected behavior and retain a negative control for explicitNulls=true.
    4. Document and verify the review contract
      • Update the relevant Bugbot guidance and evaluation documentation; leave generator production behavior unchanged unless new evidence identifies a defect.
      • Run focused quality evaluations and applicable tooling checks, confirming existing coverage floors remain satisfied.

    Acceptance: The Bugbot evaluation passes cases for both explicitNulls values, including compiled-decoder controls for required non-nullable properties and nullable properties with and without defaults, and the existing source coverage floors remain at or above 90% for lines and branches.

    Need something else? Mention the bot with a question or use /copilot help.

  11. added
    size: XXLIndicates an extremely large task or issue that requires significant time and effort to complete.
    85%Progress: 85%
    and removed on Oct 30, 2026
  12. vypbot commented on Oct 30, 2026

    @vypbot
    Contributor

    Issue closed β€” historical progress

    Current status: closed as completed.

    The last estimate is retained below as history. Closure does not certify a new percentage, tests, or branch alignment.

    Action required: none for this closed issue. If work continues, reopen the issue; a fresh assessment can update this same card.

    Last assessment before closure (historical)

    Progress: 85% β€” in progress

    > Current status: [R1] Please cover both flag values in review grounding/evaluation, including required non-nullable controls and nullable fields with/without defaults. Follow the actual Json instance used by the cited test rather than transferring conclusions between policies. This report does not dismiss actual request-validation issues or ask to reduce review gates. β€” The guidance, corpus, and compiled probe source cover both explicitNulls values, required non-nullable input, and nullable fields with and without defaults.
    [R2] "title": "Trace the review evidence path", β€” Prompt construction and benchmark tests add coverage for delivering the serializer policy through review and evaluation paths.
    [R3] "Inspect Bugbot context loading, prompt construction, and quality evaluation to find where Kotlin serializer evidence and the cited test are represented.", β€” The prompt guidance and benchmark cases address active Json policy evidence in review and quality evaluation.
    [R4] "Follow the Json instance and its explicitNulls setting for each cited test." β€” Cases distinguish the instance used for decoding, inherited flags, and an alternate instance whose policy differs.
    [R5] "title": "Ground reviews in the active serializer policy", β€” Bugbot guidance now grounds nullable-input conclusions in the active serializer policy.
    [R6] "Require evidence for both explicitNulls values before concluding whether omitted nullable properties are accepted.", β€” Guidance and evaluation fixt
    [untrusted content truncated]

    Next: [R10] "Use compiled decoder results as expected behavior and retain a negative control for explicitNulls=true." β€” Independently verify the compiled decoder results used as expected behavior, including the explicitNulls=true negative control.
    [R13] "Run focused quality evaluations and applicable tooling checks, confirming existing coverage floors remain satisfied." β€” Independently verify the focused quality evaluations and applicable tooling checks, and confirm the existing line and branch coverage floors remain satisfied.
    [R14] "acceptance": "The Bugbot evaluation passes cases for both explicitNulls values, including compiled-decoder controls for required non-nullable properties and nullable properties with and without defaults, and the existing source coverage floors remain at or above 90% for lines and branches." β€” Independently verify the evaluation cases for both explicitNulls values, including compiled-decoder controls, and confirm existing line and branch coverage floors are at least 90%.

  13. added a commit that references this issue on Oct 30, 2026
  14. moved this from In Progress to Done in vypdevon Oct 30, 2026
  15. added
    100%Progress: 100%
    and removed
    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