Skip to content

Check Party request, response and event payload bodies and success statuses against the BIAN schemas, with ADR-cited deviations (roadmap 1.14) - #134

Merged
KsiProgramming merged 2 commits into
mainfrom
plan/1.14-party-bian-conformance
Nov 9, 2026
Merged

KsiProgramming merged 2 commits into
mainfrom
plan/1.14-party-bian-conformance

Conversation

@KsiProgramming

Copy link
Copy Markdown
Owner

Roadmap phase

Phase: 1.14 Conformance
Planning package: specs/2026-11-09-party-bian-conformance/

Closes #39

Summary

Since 0.14, Party Reference Data Directory's routes have been checked against its BIAN v14 specification: each route is a BIAN operation with the spec's method, and Retrieve is GET. This PR completes "conformance for the implemented subset" by also checking what goes over the wire.

Harness (tests/RimBank.Conformance.Testing, ADR 0037)

  • Bodies. Every request and 2xx response field RimBank writes must exist in the BIAN schema at the same JSON path, with the exact name and a compatible JSON type. Fewer fields than BIAN is always fine. RimBank's shape is exported with JsonSchemaExporter from the host's own JsonOptions. BIAN's generated enum wrappers accept a plain string (ADR 0024), and JsonElement passthroughs accept any JSON.
  • Success statuses. Every endpoint declares at least one 2xx, and only ones BIAN declares. An endpoint reads a body exactly when BIAN declares one. Error statuses are not compared, because Problem Details replaces HTTPError (ADR 0015).
  • Event payloads. The fields of the published events must exist in the BIAN AsyncAPI message payload, compared without regard to case, because events are camelCase on the wire (ADR 0036).
  • Deviations are data. Each deliberate difference is a ConformanceDeviation row: the operation or channel, the JSON path, and a reason that must cite an ADR. A row that no longer occurs fails, and so does a row without an ADR.
  • The catalogue drives the declarations. PartyReferenceDataDirectoryCatalogue moved from RimBank.Conformance.Tests to RimBank.Conformance.Testing/Catalogues/. The Party conformance tests declare their operations and events from its rows that are not deferred, instead of a hand-written list.
  • Two quirks of the BIAN spec files are handled.
    • The 200 of the Control Record's Register, Update, Control, Request, Execute and Exchange points to BadRequest. The harness uses each operation's own <Action><Record>Response instead.
    • Bodies are under the media-type key 'application/json:', with a stray colon.

Party (tests/RimBank.Api.Tests)

  • PartyReferenceDataDirectoryConformanceTests now runs three checks against the real host: routes, bodies and statuses, and event payloads.
  • The check found 63 differences from BIAN. All of them were already decided in an ADR, so they are listed in PartyReferenceDataDirectoryConformanceDeviations:
    • record ids in responses (ADR 0024)
    • RefreshDate (ADR 0024)
    • Demographics verification and ExchangeActionType (ADR 0028)
    • the Country object and contact-point subtypes (ADR 0030, ADR 0031)
    • CompanyOfficerRole as a plain string (ADR 0034)
    • the event envelope (ADR 0036)
  • No production code, HTTP shape or published event contract changed.

Docs: new ADR 0037. Pointers added in ADR 0020, ADR 0024 (the catalogue's new location) and ADR 0036. Updated tech-stack §3.3 and §9, CONTRIBUTING "BIAN conformance", and the roadmap (1.14 ticked).

No commands or queries were added or changed. This phase only adds tests.

Definition of done

  • Working code that follows tech-stack.md (naming, dependency rules, business-only names in core)
  • Commands and queries kept separate as described in tech-stack.md §8: N/A: no command or query added or changed (test-only phase)
  • Unit tests for domain and application logic, including a projection test (Given events → Then view) for every new or changed read model, plus integration tests (Testcontainers) for any adapter touched: harness self-tests on a fake context, loader tests on the real YAML, and the Party conformance tests through the real host (Testcontainers). No read model changed.
  • Every new or changed read model can be rebuilt from the context's own event store: N/A, no read model changed
  • Contexts stay loosely coupled as described in tech-stack.md §8.4: only the test library RimBank.Conformance.Testing now references Party .PublishedLanguage; it is not a production assembly
  • Architecture tests green
  • Every new error path returns RFC 9457 Problem Details (on both HTTP and MCP): N/A, no new error path
  • Every new BIAN operation exposed over HTTP is also exposed as an MCP tool, with a parity test: N/A, no new operation (MCP tools are 1.16–1.17)
  • GitHub Actions CI green (build, test, format, CodeQL)
  • An ADR in docs/adr/ for any significant or BIAN-interpretation decision: ADR 0037
  • The roadmap checkbox ticked in the same PR

Validation

dotnet restore RimBank.slnx --locked-mode                  # OK
dotnet build RimBank.slnx -c Release                       # 0 warnings, 0 errors
dotnet test --solution RimBank.slnx -c Release --no-build  # 2008 passed, 0 failed, 0 skipped
dotnet format RimBank.slnx --verify-no-changes             # exit 0

Checks from validation.md:

  • Fake-context self-tests (FakeContextBodyConformanceTests), each failing with a message that names the operation or channel and the JSON path:
    • an extra request property
    • an extra nested response property
    • an incompatible type
    • an undeclared 2xx
    • no 2xx declared
    • a body read where BIAN declares none, and none read where BIAN declares one
    • an unknown payload property, while a case-only difference passes
    • a payload on an unknown channel, or with no channel
    • a stale deviation, and a deviation without an ADR
  • Loader tests on the real Party YAML: the 'application/json:' request body, the fallback for a 200 wired to BadRequest, the Retrieve response, and every channel payload.
  • Party conformance through the real host: I ran it first with an empty deviation list. It reported 63 problems, each of which was traced to its ADR before being listed. The failure messages were checked by eye.
  • The 1.13 published-event schema snapshots are unchanged.
  • The Architecture.Tests lock files were updated for both runtimes. The Linux one was edited by hand to match the Windows restore (one dependency line moved from RimBank.Conformance.Tests to RimBank.Conformance.Testing). The CI restore on Linux confirms it.

Review focus

  • Deviations as explicit rows (63) rather than harness rules such as "any <Record>Id is allowed". It is more verbose, but every difference traces to an ADR. Is the grouping in PartyReferenceDataDirectoryConformanceDeviations readable enough?
  • The fallback for the BIAN 200 → BadRequest wiring, which uses the operation's own <Action><Record>Response. It is a reading of a spec bug, recorded in ADR 0037.
  • Type matching is deliberately loose. format, required and enum values are not compared, and integer is accepted where BIAN declares number.
  • The catalogue now lives in a shared test library that references Party .PublishedLanguage. Stage 2 adds its own catalogue next to it.
  • Open question from requirements.md (how many mismatches exist): resolved. There were 63, all already decided in ADRs, and none needed a model change.

🤖 Generated with Claude Code

KsiProgramming and others added 2 commits November 9, 2026 10:33
…r Party Reference Data Directory

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atuses against the BIAN schemas, with ADR-cited deviations and the catalogue driving the declarations (roadmap 1.14)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KsiProgramming KsiProgramming added stage:1 Roadmap Stage 1: Party Reference Data Directory (first vertical slice) type:feature New business or platform behaviour area:bian-conformance Conformance with the BIAN v14 OpenAPI and AsyncAPI specs context:party Party / Party Reference Data Directory labels Nov 9, 2026
@KsiProgramming KsiProgramming self-assigned this Nov 9, 2026
@KsiProgramming
KsiProgramming merged commit 8ceac30 into main Nov 9, 2026
0 of 3 checks passed
@KsiProgramming
KsiProgramming deleted the plan/1.14-party-bian-conformance branch November 10, 2026 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:bian-conformance Conformance with the BIAN v14 OpenAPI and AsyncAPI specs context:party Party / Party Reference Data Directory stage:1 Roadmap Stage 1: Party Reference Data Directory (first vertical slice) type:feature New business or platform behaviour

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.14 Conformance

1 participant