Skip to content

Add regression tests for null and duplicate type fields in provider-message decoder - #18

Merged
numinousmuses merged 2 commits into
masterfrom
forge/task-c0b3ce44f544dcd1a4c2bd4daa506314
Sep 6, 2026
Merged

numinousmuses merged 2 commits into
masterfrom
forge/task-c0b3ce44f544dcd1a4c2bd4daa506314

Conversation

@numinousmuses

@numinousmuses numinousmuses commented Sep 6, 2026 •

Copy link
Copy Markdown

Trigger

Requested work to pin the decoded semantics of duplicate and null type fields in the Darkbloom provider-message decoder. A duplicate or case-variant type key pushes decoding off the fast path onto Go's encoding/json rules, and this behavior deserves an explicit regression test rather than relying on the decoder as its own oracle.

Behavior under test

The new test file coordinator/protocol/messages_type_null_duplicate_test.go adds TestProviderMessageTypeNullAndDuplicateFields, a table test with five cases and explicit expected outcomes:

  • known type then null (null is a no-op, prior string kept)
  • null then known type (later string wins)
  • mixed-case null duplicate (case-insensitive matching, prior string kept)
  • unknown type then null (still rejected)
  • numeric duplicate then known type (wrong JSON type still fails the whole decode)

Accepted heartbeat cases assert the decoded Type and Status; rejection cases assert the decode fails. The change is test-only; no production code was modified.

Verification

Both configured checks passed on this revision:

  • Protocol behavior (265 tests, provider-message decoder and protocol regressions only; does not cover Forge infrastructure or conversations)
  • Documentation

The agent additionally reported running the named test and the full protocol suite under the race detector locally, plus make docs-check; those local results are not independent verification. A pass here establishes these tests passed on this revision, not that the decoder is free of other issues.

Review focus

Confirm the expected types and acceptance outcomes match the intended encoding/json semantics, particularly that JSON null is treated as a no-op and a numeric type rejects even with a later valid duplicate.

Before/After

flowchart TD
  subgraph Before
    A[Existing protocol tests] --> B[ProviderMessage.UnmarshalJSON]
  end
  subgraph After
    C[TestProviderMessageTypeNullAndDuplicateFields] --> D[ProviderMessage.UnmarshalJSON]
    D --> E[5 explicit cases: last-match-wins, case-insensitive, null no-op, numeric reject]
  end
Loading

Closes #15. The issue's status comment tracks the requested work.

Independent checks configured: Protocol behavior, Documentation.

Recorded check Result
Protocol behavior Passed
Documentation Passed

Source revision a9d9ca55b4dc. Verification status comes from execution records; agent observations are provisional.

The proposed change passed independent verification. PR CI checks its merge with the target branch separately. Maintainers review the behavior and decide what ships.

Verification reference

Source: a9d9ca55b4dc3236f3c2491b22371396a922c836
Verified tree: d1602cb7555e880fd87d7f209b6f7aee96039646
Task: c0b3ce44f544dcd1a4c2bd4daa506314

Verified tree: d1602cb
Policy: c0f26d7da586fda2c72702cf736512909371e691eaef0893b0d9eeea404ccd85
@numinousmuses

numinousmuses commented Sep 6, 2026 •

Copy link
Copy Markdown
Author

Numinous Forge · Merged into this fork

Trigger: Instructed

This PR has been merged. The recorded checks passed on its reviewed revision.

Next: No further action on this PR.

Verification details
Recorded check Result
Protocol behavior Passed
Documentation Passed
Coordinator Passed

Source revision 9d02805008ef. Verification status comes from execution records; agent observations are provisional.

This run verifies the PR and does not modify its code.

@numinousmuses numinousmuses moved this to Verifying in Darkbloom engineering Sep 6, 2026
@numinousmuses
numinousmuses marked this pull request as ready for review September 6, 2026 17:39
@numinousmuses numinousmuses moved this from Verifying to Needs review in Darkbloom engineering Sep 6, 2026
@numinousmuses numinousmuses moved this from Needs review to Queued in Darkbloom engineering Sep 6, 2026
@numinousmuses numinousmuses moved this from Queued to Verifying in Darkbloom engineering Sep 6, 2026
@numinousmuses
numinousmuses merged commit dc52ad9 into master Sep 6, 2026
2 checks passed
@numinousmuses numinousmuses moved this from Verifying to Needs review in Darkbloom engineering Sep 6, 2026
@numinousmuses numinousmuses moved this from Needs review to Done in Darkbloom engineering Sep 6, 2026
@numinousmuses numinousmuses added trigger:instructed Work was explicitly requested; generated PRs inherit this trigger. trigger:ci Forge was triggered by a contributor PR or new commit. and removed trigger:ci Forge was triggered by a contributor PR or new commit. labels Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger:instructed Work was explicitly requested; generated PRs inherit this trigger.

Projects

Development

Successfully merging this pull request may close these issues.

Cover null and duplicate type fields in provider messages

1 participant