Skip to content

Publish runtime pack 0.2.1: leave the type key to the collection - #24

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

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

Conversation

@callumalpass

Copy link
Copy Markdown
Member

Follow-up to #14 for the runtime pack, which #14 didn't cover.

The mdbase.runtime.* 1.0.0 record contracts and their types required and pinned type: runtime_* and rejected other top-level fields. Engines write a record's type under the collection's explicit_type_keys, so in collections that use mdbase_type (TaskNotes v5, Reader) every runtime record was invalid (schema_required: type, schema_additional_properties: mdbase_type), and a record with both keys was invalid everywhere.

  • mdbase.runtime.standard 0.2.1, imported from Leave the type key to the collection in runtime records (pack 0.2.1) mdbase-spec#70: record contracts 1.1.0 and types v2 neither require nor declare type and accept top-level fields outside the contract; nested structures stay closed. Every 1.0.0-valid record stays valid. Types keep their match rule.
  • Keeps installing the 1.0.0 record contracts (contract-retention test), and gives every resource an explicit managed mode, which 0.2.0 omitted (the current engine rejects resources without a mode).
  • 0.2.0 is hidden; dist/packs/mdbase.runtime.standard/0.2.0.json and all 1.0.0 artifacts are byte-identical.
  • sync-runtime-pack.mjs adds the current version beside earlier ones (types under types/mdbase-runtime/v2/) and refuses to overwrite a differing artifact, instead of deleting earlier versions.
  • starter-type-keys.test.mjs now covers the ten runtime types.

Checked with the reference engine (mdbase validate): with explicit_type_keys: [mdbase_type], mdbase_type: runtime_workflow, type: runtime_workflow and both keys all validate against workflow v2; the default collection is clean too.

Local: node tests 42/42 + seed-baselines/contract-retention pass, build has no drift beyond the new artifacts. Engine-backed verify and install tests run in CI. sources.json is bumped to the spec merge commit once #70 merges.

The runtime record contracts 1.0.0 and their types required and pinned
`type: runtime_*` and rejected other top-level fields, so every runtime
record was invalid in collections that declare types with `mdbase_type`
(TaskNotes v5, Reader). This is the bug #14 fixed for the starters.

mdbase.runtime.standard 0.2.1 (from mdbase-spec) carries record contracts
1.1.0 and types v2 that neither require nor declare `type` and accept
top-level fields outside the contract, keeps installing the 1.0.0 contracts,
and gives every resource an explicit managed mode. 0.2.0 is hidden with its
provision byte-identical. The importer now adds a version beside earlier
ones instead of deleting them, and the type-key test covers runtime types.
Pack 0.2.1 installs both 1.0.0 and 1.1.0 of each record contract, and the
importer recorded whichever it read last, so the pack claimed to provide
1.0.0. Take the provided versions from the types' implements instead.
@callumalpass
callumalpass merged commit a239757 into main Nov 17, 2026
1 check passed
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