Skip to content

Leave the type key to the collection in runtime records (pack 0.2.1) - #70

Merged
callumalpass merged 2 commits into
mainfrom
fix/runtime-type-key
Nov 17, 2026
Merged

callumalpass merged 2 commits into
mainfrom
fix/runtime-type-key

Conversation

@callumalpass

Copy link
Copy Markdown
Member

The ten runtime record schemas required and pinned type (type: runtime_workflow …) and rejected other top-level fields. A conforming engine writes a record's type under the collection's configured explicit_type_keys (§12), so in any collection that declares types with mdbase_type (TaskNotes v5, Reader) every runtime record was invalid, and a record carrying both keys was invalid everywhere. Verified with the reference engine (mdbase validate) against the published type: mdbase_type: runtime_workflow → schema_required: type + schema_additional_properties: mdbase_type.

This is the same bug mdbase-contracts#14 fixed for the Person/Comment/View starters.

  • Record contracts 1.1.0 and canonical types v2: schemas neither require nor declare type and accept top-level fields outside the contract; nested structures stay closed. Strictly looser, so every 1.0.0-valid record stays valid. Types keep their match: type: runtime_* rule for hand-written records.
  • standard-packs/mdbase-runtime/0.2.1 carries them; event/action artifacts are byte-identical to 0.2.0. 0.2.0 stays as published; the generator writes only the current pack.
  • @callumalpass/mdbase-runtime 0.2.1: validates against 1.1.0; validateRuntimeRecord(value, recordType?) takes the record type for records declared under another key; type is optional on RuntimeWorkflow/RuntimePolicy.
  • Conformance tests, runtime profile text, README/site links point at 0.2.1. Spec text unchanged.

Local: runtime package 6/6 (new test for the configured-key case), reference executor 1/1, check_v03_tests.py and level guardrail pass, generator has no drift.

The ten runtime record schemas required and pinned `type` and rejected
other top-level fields. Engines write a record's type under the collection's
configured explicit_type_keys, so every runtime record was invalid in a
collection that declares types with `mdbase_type` (TaskNotes v5, Reader).

Record contracts 1.1.0 and types v2 drop the pinned `type` and accept
top-level fields outside the contract; nested structures stay closed and
every 1.0.0-valid record stays valid. Pack 0.2.1 carries them; 0.2.0 stays
as published. @callumalpass/mdbase-runtime 0.2.1 validates against 1.1.0 and
validateRuntimeRecord accepts the record type for records declared under
another key.
A collection type that still implements a 1.0.0 runtime record contract
would be left invalid if the upgraded pack stopped installing it. Copy the
1.0.0 schemas and contracts byte-for-byte from the published 0.2.0 pack.
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