Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/lawful-basis.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Section 6 tells readers what to do before acting on a vCon:

## Python

The [`vcon`](https://pypi.org/project/vcon/) library (1.0.5) builds this attachment and fills in `purpose`, `encoding`, `party`, `mediatype` and `start`. Version 1.0 and later target core-05: `Vcon.build_new()` sets `"vcon": "0.5.0"`, and the attachment is scoped to a session with `session_index` rather than to a dialog. With only `dialog_index` the helper logs a warning and writes a dialog-only scope, as in the core-04 form described above; with neither, it uses the vCon's only session or raises `ValueError`. The helper adds `lawful_basis` to `extensions`, which `is_valid()` requires. Proof mechanisms must be `ProofMechanism` objects, not dicts.
The [`vcon`](https://pypi.org/project/vcon/) library (1.0.6) builds this attachment and fills in `purpose`, `encoding`, `party`, `mediatype` and `start`. Version 1.0 and later target core-05: `Vcon.build_new()` sets `"vcon": "0.5.0"`, and the attachment is scoped to a session with `session_index` rather than to a dialog. With only `dialog_index` the helper logs a warning and writes a dialog-only scope, as in the core-04 form described above; with neither, it uses the vCon's only session or raises `ValueError`. The helper adds `lawful_basis` to `extensions`, which `is_valid()` requires. Proof mechanisms must be `ProofMechanism` objects, not dicts.

Since 1.0.4, `Vcon.is_valid()` also checks the body of every `purpose: "lawful_basis"` attachment, including one written by hand with `add_attachment()`: `lawful_basis`, `expiration` (which may be `null`) and `purpose_grants` are required, and each grant and proof mechanism is checked. A `proof_type`, hash algorithm or canonicalization method outside the values the draft lists is a warning from `get_validation_warnings()`, not an error, because the draft's lists are open. For core-04 output (`"0.4.0"`, `dialog` scope), stay on `vcon` 0.10.x.

Expand Down
4 changes: 2 additions & 2 deletions extensions/wtf-transcription.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ All confidence values are normalized to the range 0 to 1 (Section 8.1).

## Python

Build the analysis entry with the [`vcon`](https://pypi.org/project/vcon/) library. The example uses `vcon` 1.0.5, which writes core-05 (`"vcon": "0.5.0"`), so the recording dialog sits in a session. `add_wtf_transcription_analysis()` writes the entry this draft defines: `type: "wtf_transcription"`, `encoding: "json"`, the WTF document as the `body` value, `vendor` and `product` from `metadata["provider"]` and `metadata["model"]`, and the draft URL in `schema`. It also adds `wtf_transcription` to `extensions`.
Build the analysis entry with the [`vcon`](https://pypi.org/project/vcon/) library. The example uses `vcon` 1.0.6, which writes core-05 (`"vcon": "0.5.0"`), so the recording dialog sits in a session. `add_wtf_transcription_analysis()` writes the entry this draft defines: `type: "wtf_transcription"`, `encoding: "json"`, the WTF document as the `body` value, `vendor` and `product` from `metadata["provider"]` and `metadata["model"]`, and the draft URL in `schema`. It also adds `wtf_transcription` to `extensions`.

```python
from vcon import Dialog, Session, Vcon
Expand All @@ -126,7 +126,7 @@ v.add_party(Party(tel="+15551230002", name="Bob"))
v.add_session(Session(start="2026-10-06T14:00:00Z", parties=[0, 1]))
v.add_dialog(Dialog(type="recording", start="2026-10-06T14:00:00Z", parties=[0, 1],
url="https://example.com/call.wav", mediatype="audio/x-wav",
# placeholder hash; a url needs a content_hash
# placeholder hash; set content_hash when you have the bytes
content_hash="sha512-GLy6IPaIUM1GqzZqfIPZlWjaDsNgNvZM0iCONNThnH0a75fhUM6cYzLZ5GynSURREvZwmOh54-2lRRieyj82UQ"),
session=0)

Expand Down
2 changes: 1 addition & 1 deletion helps-and-hacks/coding-prompt-cheat-sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ The [`vcon`](../vcon-library/README.md) library 0.10.x does most of this for cor

* `redacted` and `amended` are mutually exclusive.
* Every index must point at an existing array element.
* `url` always comes with `content_hash`.
* `url` comes with `content_hash` whenever you have the bytes. `redacted` and `amended` always need it. On a dialog, attachment or analysis whose URL has no stable bytes to hash (a YouTube page, audio behind a login), the WG direction on core issue #40 allows leaving it out (accepted by `vcon` 1.0.6); never invent a hash.
* `incomplete` dialogs need `disposition`; `recording-set` dialogs need `recordings`.
* Every attachment has `start`, `party` and `dialog`; every analysis has `vendor`.
* A reader that finds an unsupported name in `critical` rejects the vCon.
2 changes: 1 addition & 1 deletion vcon-adapters/llm-guide-creating-vcon-adapters.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Paste this page into a model's context to generate adapter code. It holds the gr
* With `encoding="json"`, `body` is the JSON value itself, never a `json.dumps()` string. Readers accept both; use `json_body()`.
* Attachments use `purpose`, never `type`, and carry `start`, `party`, `dialog`. A body carries `mediatype` and `encoding`.
* Analysis uses `schema`, never `schema_version`, and requires `vendor`. Transcripts go in `analysis[]` with `type: "wtf_transcription"`.
* External media needs both `url` and `content_hash`, formatted `sha512-<base64url digest>`.
* External media needs both `url` and `content_hash`, formatted `sha512-<base64url digest>`, when the adapter has the bytes. Leave the hash out only for a URL with no stable bytes to hash (see the [checklist](spec-compliance-checklist.md#external-media)); never invent one.
* Field names: `critical` (not `must_support`), `amended` (not `appended`), `mediatype` (not `mimetype`). Do not emit `did` on parties.
* Timestamps are ISO 8601 with a timezone. List every extension used in `extensions[]`.
* Build through helpers. Hand-set only `subject` and `extensions`.
Expand Down
2 changes: 1 addition & 1 deletion vcon-adapters/spec-compliance-checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Build through the `vcon` library helpers (`add_party`, `add_dialog`, `add_attach

## External media

* [ ] A dialog that points at media has both `url` and `content_hash`
* [ ] A dialog that points at media has both `url` and `content_hash`. The exception is a URL with no stable bytes to hash, such as a streaming page or audio behind a login: the working group's direction on [core issue #40](https://github.com/ietf-wg-vcon/draft-ietf-vcon-vcon-core/issues/40) allows a `url` without a `content_hash` there (accepted by `vcon` 1.0.6; the draft text still says MUST). An adapter that downloads the recording has the bytes, so it hashes them. Never invent a hash
* [ ] `content_hash` is `sha512-<base64url digest>`, not hex, not padded base64, not SHA-256
* [ ] `mediatype` is set

Expand Down
6 changes: 3 additions & 3 deletions vcon-library/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
---
description: Where to start with the Python vCon library, version 1.0.5 on core-05.
description: Where to start with the Python vCon library, version 1.0.6 on core-05.
icon: plug
---

# vCon Library

## vCon Python Library

> **Current version:** `vcon` **1.0.5** · `pip install vcon` · [GitHub: vcon-dev/vcon-lib](https://github.com/vcon-dev/vcon-lib) · Targets [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/), syntax `"0.5.0"` · Reads and migrates `"0.4.0"` · Python 3.12 or later.
> **Current version:** `vcon` **1.0.6** · `pip install vcon` · [GitHub: vcon-dev/vcon-lib](https://github.com/vcon-dev/vcon-lib) · Targets [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/), syntax `"0.5.0"` · Reads and migrates `"0.4.0"` · Python 3.12 or later.

### About the library

The `vcon` package builds, reads, validates, signs and serializes vCons in Python. A vCon is a JSON container for one conversation: its parties, sessions, dialogs (text, recordings, images), events such as joins and transfers, attachments, and analysis such as transcripts or sentiment. The library covers the core-05 object model and two extensions, [Lawful Basis](../extensions/lawful-basis.md) and [WTF transcription](../extensions/wtf-transcription.md).

Version 1.0.0 is a breaking release. Code written for 0.10.0 and core-04 needs changes: dialogs belong to sessions, `party_history` and transfer dialogs became events, and attachments need a `dialog` or `session`. Version 1.0.4 makes `is_valid()` check content hash syntax and lawful basis bodies, keeps `created_at` as written, fixes the video helpers (`vcon[video]`), moves JWS to joserfc, and deprecates `add_wtf_transcription_attachment()`. The [quickstart](quickstart.md#release-notes) lists the changes.
Version 1.0.0 is a breaking release. Code written for 0.10.0 and core-04 needs changes: dialogs belong to sessions, `party_history` and transfer dialogs became events, and attachments need a `dialog` or `session`. Version 1.0.4 makes `is_valid()` check content hash syntax and lawful basis bodies, keeps `created_at` as written, fixes the video helpers (`vcon[video]`), moves JWS to joserfc, and deprecates `add_wtf_transcription_attachment()`. Version 1.0.6 allows a `url` without a `content_hash` on a dialog, attachment or analysis entry, for URLs whose bytes cannot be obtained stably (a YouTube page, audio behind a login), following the working group's direction on [core issue #40](https://github.com/ietf-wg-vcon/draft-ietf-vcon-vcon-core/issues/40). The [quickstart](quickstart.md#release-notes) lists the changes.

### Features

Expand Down
8 changes: 5 additions & 3 deletions vcon-library/library-api-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Signatures, return types and working examples for every public clas

## vCon Library API Reference

Reference for `vcon` **1.0.5**, which implements [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/) (`"vcon": "0.5.0"`) and reads and migrates 0.4.0. The [quickstart](quickstart.md) has release notes and known limits. What each field means, and when it is required, is in the [field reference](../vcons/field-reference.md); that page describes core-04 (`"0.4.0"`), while the library writes core-05.
Reference for `vcon` **1.0.6**, which implements [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/) (`"vcon": "0.5.0"`) and reads and migrates 0.4.0. The [quickstart](quickstart.md) has release notes and known limits. What each field means, and when it is required, is in the [field reference](../vcons/field-reference.md); that page describes core-04 (`"0.4.0"`), while the library writes core-05.

### Installation

Expand Down Expand Up @@ -86,7 +86,9 @@ The library logs through `logging.getLogger(__name__)` in each module and does n

`is_valid()` checks required fields; that `vcon`, when present, is `"0.5.0"`; that a session exists when there is dialog or events; every party, dialog, session, attachment and analysis index; the event parameter table; that attachments have `party` and `dialog` or `session`; that `redacted_from` and `amended_from` are not both present; that `extensions` lists every extension in use and every `critical` entry; that a dialog or attachment with inline content has a `mediatype`; that every `__REDACTED_REF_#` has a `redacted_strings` entry; that `created_at` is ISO 8601; that every `content_hash` (dialog, attachment, analysis, `redacted_from`, `amended_from`) is `<algorithm>-<unpadded base64url digest>`, with an 86-character digest for `sha512` and 43 for `sha256`, so hex and padded digests fail; and that every `purpose: "lawful_basis"` attachment body has `lawful_basis`, `expiration` and `purpose_grants` and well-formed grants and proof mechanisms.

`get_validation_warnings()` reports a dialog that no session lists, a session without `start` or `parties`, a `url` without a `content_hash` (an `is_valid()` error from 1.1), an `encoding: "json"` body that is a serialized JSON string, and lawful basis proof types, hash algorithms or canonicalization methods the draft does not define.
`get_validation_warnings()` reports a dialog that no session lists, a session without `start` or `parties`, an `encoding: "json"` body that is a serialized JSON string, and lawful basis proof types, hash algorithms or canonicalization methods the draft does not define.

A `url` without a `content_hash` on a dialog, attachment or analysis entry is neither an error nor a warning from 1.0.6 (1.0.4 and 1.0.5 warned), because a producer cannot always get stable bytes for the URL, such as a YouTube page or audio behind a login. This follows the working group's direction on [core issue #40](https://github.com/ietf-wg-vcon/draft-ietf-vcon-vcon-core/issues/40); the core-05 text still says MUST. Set `content_hash` whenever you have the bytes. `redacted_from` and `amended_from` with a `url` still need a `content_hash` (an `is_valid()` error), and an attachment needs `body` and `encoding`, or `url`.

`PERMITTED_JWS_ALGORITHMS` in `vcon.vcon` lists `RS256`, `RS384`, `RS512`, `PS256`, `PS384`, `PS512`, `ES256`, `ES384`, `ES512` and `EdDSA`. `AlgorithmNotPermittedError` is a `ValueError`.

Expand All @@ -108,7 +110,7 @@ ref = Dialog(type="recording", start=now, parties=[0], mediatype="audio/x-wav",
url="https://example.com/call.wav") # placeholder URL, no content_hash
draft = Vcon(vcon.to_dict())
draft.add_dialog(ref, session=0)
print(draft.is_valid()[0], draft.get_validation_warnings()[0][:40]) # True Dialog at index 1 has a url but no conte
print(draft.is_valid(), draft.get_validation_warnings()) # (True, []) []
ref.content_hash = "sha512-" + "ab" * 64 # hex, not base64url
draft.vcon_dict["dialog"][1] = ref.to_dict()
print(draft.is_valid()[1][0][:46]) # Dialog at index 1 has an invalid content_hash
Expand Down
14 changes: 9 additions & 5 deletions vcon-library/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Install the Python vCon library and build, save, load, sign and val

## vCon Library

`vcon` 1.0.5 on PyPI. It targets [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/) and writes `"vcon": "0.5.0"`. It reads 0.4.0 and 0.5.0 and migrates 0.4.0 on load. Python 3.12 or later.
`vcon` 1.0.6 on PyPI. It targets [`draft-ietf-vcon-vcon-core-05`](https://datatracker.ietf.org/doc/draft-ietf-vcon-vcon-core/) and writes `"vcon": "0.5.0"`. It reads 0.4.0 and 0.5.0 and migrates 0.4.0 on load. Python 3.12 or later.

```bash
pip install vcon
Expand Down Expand Up @@ -184,7 +184,7 @@ print(vcon.is_valid()) # (True, [])
print(vcon.get_validation_warnings()) # []
```

A dialog or attachment with a `url` needs a `content_hash` (core-05 section 2.4). In 1.0.x a `url` without one is a warning from `get_validation_warnings()`; it will be an `is_valid()` error in 1.1.
Set `content_hash` with a `url` whenever you have the bytes (`compute_content_hash()`, or `add_external_data()`). From 1.0.6 a `url` without a `content_hash` is allowed on a dialog, attachment or analysis entry, because a producer cannot always get stable bytes for the URL (a YouTube page returns different HTML on each fetch; some audio sits behind a login). This follows the working group's direction on [core issue #40](https://github.com/ietf-wg-vcon/draft-ietf-vcon-vcon-core/issues/40); the core-05 text (section 2.4) still says MUST until the WG revises it. There is no marker field. `redacted_from` and `amended_from` with a `url` still need a `content_hash`, and a malformed `content_hash` is still an `is_valid()` error.

Dialog types are `recording`, `text` and `incomplete`. `Dialog(type="audio")` and `Dialog(type="video")` still work but warn and build a `recording`. `transfer` and `recording-set` dialogs are gone: `Dialog(party_history=...)`, `originator=`, `transferee=` and the other transfer parameters raise `ValueError`, and `add_transfer_dialog()` raises `NotImplementedError`. An `Event` checks the per-type parameter table when built, so `Event(type="join", time=now, party=0)` raises `ValueError` for the missing `sessions`. `add_incomplete_dialog()` writes no `body`; `details` goes to `metadata["details"]`.

Expand Down Expand Up @@ -367,6 +367,11 @@ A signed 0.4.0 vCon is not migrated on load, because migrating drops the signatu

### Release notes

**1.0.6** changes:

* A `url` without a `content_hash` is allowed on a dialog, attachment or analysis entry, because a producer cannot always get stable bytes for the URL (a streaming page such as YouTube, audio behind a login). This follows the working group's direction on [core issue #40](https://github.com/ietf-wg-vcon/draft-ietf-vcon-vcon-core/issues/40); core-05 itself still says MUST. 1.0.4 and 1.0.5 reported it as a warning and said it would become an `is_valid()` error in 1.1; that plan is dropped, and `get_validation_warnings()` no longer reports it. An attachment needs `body` and `encoding`, or `url` (it used to need `url` and `content_hash`).
* Unchanged: a malformed `content_hash` is still an `is_valid()` error, and `redacted_from` and `amended_from` with a `url` still need a `content_hash`.

**1.0.5** fixes:

* `is_valid()` no longer raises on a malformed `lawful_basis` body (a 1.0.4 regression): a non-string or offset-less `expiration`, a non-object grant, proof mechanism, `content_hash` or `registry`, or a non-string `lawful_basis` are reported as errors. A timestamp with no offset is read as UTC.
Expand All @@ -385,7 +390,7 @@ A signed 0.4.0 vCon is not migrated on load, because migrating drops the signatu
**1.0.4** changes:

* JWS uses joserfc instead of `authlib.jose`, so `import vcon` no longer prints a deprecation warning. Signatures interoperate with 1.0.3 in both directions, and `sign()` and `verify()` also accept EC and Ed25519 keys.
* `get_validation_warnings()` reports a `url` without a `content_hash` (an `is_valid()` error from 1.1) and an `encoding: "json"` body that is a serialized JSON string.
* `get_validation_warnings()` reports a `url` without a `content_hash` (no longer reported from 1.0.6) and an `encoding: "json"` body that is a serialized JSON string.
* `add_tag()` takes `party` (default 0) and raises `ValueError` for an index that does not exist. On a vCon with no parties it warns (`DeprecationWarning`) and will raise in 1.1.
* `add_wtf_transcription_attachment()` is deprecated. Use `add_wtf_transcription_analysis()`.

Expand Down Expand Up @@ -415,11 +420,10 @@ A signed 0.4.0 vCon is not migrated on load, because migrating drops the signatu

**0.9.5** content hashes use the spec form `sha512-<unpadded base64url>`, and `compute_content_hash` and `parse_content_hash_algorithm` were added. Old unprefixed SHA-256 hashes still verify. **0.9.6** security: `requests` bump. **0.9.3** fixed `add_tag()` defaults. **0.9.2** `build_new()` emitted `"vcon": "0.4.0"` and `add_wtf_transcription_analysis()` was added.

### Known limits in 1.0.5
### Known limits in 1.0.6

* `subject` has no setter.
* `add_wtf_transcription_attachment()` is deprecated but still writes WTF to `attachments[]`, and `is_valid()` does not flag it. Use `add_wtf_transcription_analysis()`.
* A `url` without a `content_hash` passes `is_valid()` and is only a warning until 1.1.
* `add_tag()` on a vCon with no parties writes a party index that does not exist (with a `DeprecationWarning`) until 1.1.
* `Dialog.VALID_TYPES` still lists `audio` and `video`, which are accepted for backward compatibility and written as `recording`.

Expand Down
Loading
Loading