Skip to content

Align bodies and attachments with draft-04; release on tag push (0.10.0) - #65

Merged
howethomas merged 7 commits into
mainfrom
thomashowe/con-1101-draft04-bodies
Sep 26, 2026
Merged

howethomas merged 7 commits into
mainfrom
thomashowe/con-1101-draft04-bodies

Conversation

@howethomas

Copy link
Copy Markdown
Contributor

Aligns body and attachment handling with draft-ietf-vcon-vcon-core-04 and moves releases to tag push. Version 0.10.0.

Changes

  • New decode_body() (and Vcon.decoded_body()): every reader of a json-encoded body accepts the raw JSON value (-04) or a legacy JSON string. Applied to tags, lawful basis validation and processing, and the WTF extension.
  • Attachments default party/dialog to 0, mediatype to application/json for encoding: json, and start to the vCon's created_at. The WG schema requires these on every attachment.
  • Dialog.to_dict() no longer emits empty meta/metadata.
  • Inline binary bodies are written as unpadded base64url; readers accept padded or unpadded.
  • uuid8_time now records the last timestamp, so its monotonic guard works (also clears flake8 F824).
  • Tests: legacy body decoding, and a schema-compliance test against the vendored WG schema (tests/schema/).

Release

  • python-publish.yml runs on v* tag push instead of release: published, and fails before publishing if the tag does not match pyproject.toml.
  • New version-check job compares pyproject.toml, setup.py and the newest CHANGELOG heading. The package workflow now also runs on pull requests.

Breaking output shape

Callers that check for the absence of party, dialog, start or mediatype on attachments, or decode inline bodies with a strict padded base64 decoder, will see a difference. See MIGRATION_GUIDE.md.

Not in scope

  • add_wtf_transcription_analysis() still writes a JSON string body for an analysis entry.
  • recording-set dialog type is not yet accepted by Dialog; adapters currently patch VALID_TYPES.

Tests

277 passed, 7 skipped (baseline 265).

🤖 Generated with Claude Code

howethomas and others added 7 commits September 26, 2026 17:12
Under -04 section 2.3.2, a "json"-encoded body is the JSON value itself,
not a json.dumps string; add_tag()'s list body and
add_lawful_basis_attachment()'s object body were already correct. This
brings every other body-reading site, plus attachment defaults, in line:

- New vcon.body.decode_body() (also Vcon.decoded_body()) accepts both the
  -04 shape and a legacy JSON-string body. Used by get_tag()/add_tag() and
  by the lawful-basis/WTF extension validators and processors.
- add_tag() normalizes a legacy string tags body to a list in place.
- add_attachment(), add_lawful_basis_attachment(), and
  add_wtf_transcription_attachment() now default party/dialog to 0 and
  start to the vCon's created_at (the WG JSON schema requires all three on
  every attachment); Attachment.__init__ applies the same defaults, plus
  mediatype="application/json" for encoding="json" bodies.
- Dialog.to_dict() no longer emits empty meta: {} / metadata: {}.
- New b64url_encode()/b64url_decode() helpers in dialog.py: inline
  base64url bodies the library writes are now unpadded (RFC 7515-style,
  per -04), and internal decode sites accept both padded and unpadded
  input.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- test_dialog.py / test_dialog_more.py: base64url bodies the library
  writes are now unpadded, so decode with the padding-tolerant
  b64url_decode() instead of base64.urlsafe_b64decode() directly.
- test_vcon.py: add_attachment()/find_attachment_by_purpose() now include
  the required start/party/dialog defaults in their output.
- test_body_decode.py: new coverage for vcon.body.decode_body(),
  Vcon.decoded_body(), get_tag() on a raw legacy string body, and the
  lawful-basis/WTF validators accepting a legacy string body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tests/schema/vcon_json_schema.json vendored from vcon-adapter-template
  (see tests/schema/SOURCE.md for exact commit/date); matches the appendix
  schema in draft-ietf-vcon-vcon-core-04.
- tests/test_schema_compliance.py builds a vCon using only public helpers
  (add_tag, add_lawful_basis_attachment, add_dialog with and without
  inline audio, add_attachment) and validates it against that schema with
  no post-processing; also covers a legacy string tags body normalizing
  back to a schema-valid list via add_tag().
- jsonschema added as a dev dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- python-publish.yml now triggers on push of a v* tag instead of
  release: published, so the tag push is the release; nothing else
  should publish. Auth is unchanged (stored PYPI_API_TOKEN secret via
  pypa/gh-action-pypi-publish) since this repo wasn't already set up for
  PyPI trusted publishing (OIDC) -- noted as a separate follow-up.
  Before publishing, the workflow now fails unless the pushed tag equals
  v<pyproject version>.
- scripts/check_version.py: compares pyproject.toml's version against the
  newest CHANGELOG.md "## [x.y.z]" heading and setup.py's hardcoded
  version; also checks a --tag argument against pyproject.toml.
- python-package-poetry.yml: new version-check job runs the guard above
  on every push/PR (also added pull_request to the trigger, which was
  push-only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- setup.py version to match pyproject.toml (0.10.0).
- CHANGELOG.md: 0.10.0 Unreleased entry covering the -04 body/attachment
  changes in this release.
- API_REFERENCE.md / MIGRATION_GUIDE.md: note that get_tag()/add_tag()
  accept a legacy JSON-string tags body, and that new attachments get
  start/party/dialog defaults filled in per the WG JSON schema.

Not tagged; the tag push is the release (see the publish workflow).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The global was declared but never assigned, so the monotonic guard never
fired and flake8 7 reports F824.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@howethomas
howethomas merged commit 9eb141a into main Sep 26, 2026
7 of 8 checks passed

This branch had an error being deployed

1 failed deployment
github-pages — cda81156 Deployed Sep 26, 2026 by howethomas via docs #96
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.

1 participant