Skip to content

fix(message): separate payload and envelope content types - #693

Closed
marcschier wants to merge 2 commits into
xregistry:mainfrom
marcschier:fix/spec-640-cloudevents-content-layers
Closed

marcschier wants to merge 2 commits into
xregistry:mainfrom
marcschier:fix/spec-640-cloudevents-content-layers

Conversation

@marcschier

@marcschier marcschier commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #640

Proposed Changes - current review scope

This original PR remains open as policy decision (e). The approved
three-bundle consolidation does not approve or merge this proposal.

There is a real baseline contradiction between cross-location datacontenttype equality and the explicit structured-envelope meaning. The PR resolves it by choosing payload meaning for the top-level Message attribute and separately changes inference policy. Those choices are e. One small Endpoint example combines binary mode with a forbidden format option and is independently repairable as a.

e - decision requiring separate approval

These hunks choose the meaning of an xRegistry field, scope equality, and replace a previously stated inference rule. Keep them outside the a/b/c consolidations.

  • All Message hunks: envelope-options linkage, top-level data-layer meaning, layer matrix/body illustration, migration and inference replacement
  • Endpoint @@ -539,8 +539,14 @@: new layer comparison prose, excluding the separate example substitution
  • Issue640 documentation supports the selected policy; it is not a standalone tooling correction

Python cleanup in f9ed173

The forward, signed cleanup commit removes new specification-text assertions
and synthetic policy-test code unless it has a concrete role in checking
real repository artifacts. It does not change this PR's normative proposal,
source models, samples, generated artifacts or production behavior.

Python path Disposition
tools/issue640/content_layers_640.py removed
tools/issue640/test_content_layers_640.py removed

Script-only documentation and obsolete helper/test instructions were removed
or corrected with the affected code. Unmodified baseline Python is outside
the audit's scope; the cleanup is not evidence that a proposed policy is
already normative.

Current evidence and dependencies

  • python -B -m pytest tools -q --tb=short -p no:cacheprovider -p pytest_asyncio.plugin: 67 passed, 4 warnings in 3.34s.
  • python -B tools\verify.py .: passed.
  • exact deletion-only scope, clean worktree, direct ancestry, author-matching signoff: passed.

The selected xregistry/spec#722 (A) contributions are tracked separately. Their required prerequisite overlap intentionally remains in this original PR until the replacement is merged upstream. After that external merge, forward-merge, narrow the remaining diff and regenerate/rerun real artifact checks as applicable; do not remove necessary source prematurely.

The cleanup preserves the original draft state. No review thread is marked
resolved by this update, and no source branch is deleted. The historical
description below is preserved for context; its old test counts, helper
instructions and specification-text assertions are not current evidence.

Historical description at 580368b (before cleanup)
Fixes #640

## Proposed Changes

- Message `datacontenttype` consistently describes payload data. Equality applies only to same-layer declarations and the CloudEvents data attribute.
- Reuse `envelopeoptions.mode`/`format` for envelope serialization. Explain binary versus structured HTTP Content-Type; correct the Endpoint example that combined binary mode with format.
- Add an actual six-case layer table, a structured JSON/XML body excerpt, and focused source/admission checks with adjacent tool documentation. Replace the data-media inference from schema language alone with explicit payload-type reuse; leave broader inference and schema URI materialization to #652.

## Compatibility and limits

Declarations that used Message `datacontenttype` for the envelope must move that constraint to `envelopeoptions.format` and describe payload data separately. No new field or model/generated change is introduced. JSON/XML/binary payloads do not inherit the envelope media type. Format/binding-specific defaults remain scoped to those formats/bindings, not universal Message defaults.

Tests are offline abstract/source evidence, not real server/SDK interoperability. The checker requires an explicit mode and is not a full CloudEvents codec or media type parser. The HTTP example deliberately shows only the relevant header and body, not transport framing. No remote acquisition or implicit publication is introduced.

## Requirement evidence

| Requirement | Concrete tests |
| --- | --- |
| Binary/structured and JSON/XML/binary payload layers | `test_documented_content_layer_matrix_covers_both_modes_and_three_payloads`, `test_json_event_payload_shapes_keep_their_own_media_types` |
| Actual structured JSON carrying XML | `test_actual_structured_xml_example_separates_data_and_http_body` |
| Correct outer format and binary option constraints | `test_endpoint_envelope_option_example_uses_structured_outer_media_type`, `test_binary_content_type_is_payload_and_format_is_not_applicable` |
| Explicit versus unknown data media types | `test_one_explicit_payload_declaration_determines_only_the_data_layer`, `test_schema_language_and_envelope_format_do_not_invent_payload_media_type` |
| Real same-layer conflicts and value-sensitive comparison | `test_genuine_same_layer_conflicts_fail_without_cross_layer_equality`, `test_media_type_comparison_preserves_parameter_value_semantics_and_input` |
| Explicit invalid/unsupported input errors | `test_invalid_explicit_media_types_do_not_become_absent_or_defaults`, `test_checker_reports_modes_outside_its_explicit_scope`, `test_duplicate_parameters_are_not_silently_overwritten` |

Isolated Python focused suite: **23 passed**. Full `python -B -m pytest tools -q --tb=short -p no:cacheprovider -p pytest_asyncio.plugin`: **90 passed**, four existing deprecation warnings. Actual changed Markdown: **3 files / 191 links**, spelling, tabs/trailing spaces, ticks, forbidden-link-form and new-file LF checks passed; staged/committed diffs checked.

Standalone base `9ecf8ea67bc9a6128c154b4545a21164493cc71e`; no prerequisite commits copied or stacked. Draft because five files changed.

```release-note
Message datacontenttype describes payload data in both CloudEvents binary and structured modes. Envelope media type is expressed through envelopeoptions.format, and comparisons respect the layer each field describes.
```

Signed-off-by: Marc Schier <marcschier@hotmail.com>
Signed-off-by: Marc Schier <marcschier@hotmail.com>
@marcschier

Copy link
Copy Markdown
Contributor Author

Applied signed, forward cleanup commit f9ed173. Removed the introduced specification-text/synthetic-policy Python and its script-only instructions. The full remaining baseline tools suite passed 67 cases.

The normative proposal, source models, samples and generated artifacts are unchanged by cleanup. This PR remains open for its e review; no policy decision or review-thread resolution is implied. Selected prerequisites are now tracked in xregistry/spec#722 (A); their necessary overlap remains here until those replacements land.

Updated the PR description with current evidence, explicit retained scope and the pre-cleanup description archived as historical context. Original draft state and source branch are preserved.

marcschier added a commit to marcschier/xregistry-drafts that referenced this pull request Sep 16, 2026
Port the cleaned net diff from xregistry#693 at f9ed173, relative to main 9ecf8ea.

Retain the single structured-envelope Endpoint example owned by prerequisite xregistry#722 (A) until it lands upstream. Preserve the payload/envelope migration and inference boundaries; no pre-cleanup test history is replayed.

Signed-off-by: Marc Schier <marcschier@hotmail.com>
@marcschier

Copy link
Copy Markdown
Contributor Author

Superseded by the expanded Message, Endpoint and CloudEvents profiles keeper xregistry/spec#685. The reviewed net changes at f9ed173 were transferred with their issue and review provenance; specification-text/synthetic-policy Python stays removed.

Transfer and local integration evidence are in the keeper provenance comment. Immediately before closing, keeper head 2fec061 had successful verify and DCO gates.

Closing this original only as superseded: the policy decisions remain open in the keeper, no upstream merge or review-thread resolution is implied, and the source branch is preserved.

@marcschier marcschier closed this Sep 16, 2026
duglin pushed a commit that referenced this pull request Sep 23, 2026
* fix(docs): correct specification and example errors

Transfer only the approved category-a documentation hunks. Keep policy,
metadata-view, generated-artifact and tooling changes in their own bundles.
Preserve the existing sample-validation Python without importing prose tests.

Refs: #668, #669, #671,
#672, #674, #676,
#682, #693, #695,
#704, #705, #710,
#711, #717, #718.

Refs: #609. These residual serialization repairs complement,
but do not absorb or complete, the separately owned #657 work.

Signed-off-by: Marc Schier <marcschier@hotmail.com>

* docs(core): repair selected Resource example punctuation

Add the three missing member separators and remove the extra brace from the reviewed Patch Resource initial state.

Signed-off-by: Marc Schier <marcschier@hotmail.com>

* docs(cloudevents): drop the added sample-abbreviation sentences

Review feedback on #722 asked to remove both new sentences; the samples and their corrected literals are unchanged otherwise.

Signed-off-by: Marc Schier <marcschier@hotmail.com>

---------

Signed-off-by: Marc Schier <marcschier@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Separate CloudEvents payload content type from structured-envelope media type

1 participant