Skip to content

feat!: infer record payloads and schema from typed keys (design 063) - #487

Merged
lxsaah merged 6 commits into
mainfrom
feat/typed-record-keys
Nov 15, 2026
Merged

lxsaah merged 6 commits into
mainfrom
feat/typed-record-keys

Conversation

@lxsaah

@lxsaah lxsaah commented Nov 15, 2026

Copy link
Copy Markdown
Member

Description

Implement design 063: record declarations bind a name to its payload type, so configuration, handles, direct reads/writes, transforms, joins and aimdb-sync infer the payload from the key.

  • Add TypedName, TypedKey, Name and data-contracts Key; require contract/payload declarations in RecordKey derives.
  • Make keys authoritative for schema metadata, including records without links (R3), and remove public schema setters and string-keyed typed access.
  • Declare and reuse keys outside builders across the workspace, examples and rolling-upgrade fixtures.
  • Preserve design 062's migration, envelope, admission and counter behavior.

Breaking API change: callers pass typed declarations instead of a separate record name and payload type. Runtime registration uses interned declarations; repeated lookups borrow names.

Related Issue

Implements design 063, building on the landed design 062 implementation.

Validation

Passed locally:

  • Full formatting and Clippy feature matrix, including host, Cortex-M and WASM combinations.
  • Core unit tests; the full data-contracts suite, including compile-fail, schema ownership, migration and lock tests; sync tests.
  • Postcard/CDR rolling upgrades across both MQTT backends.
  • Cortex-M fixture and WASM target checks.
  • make build and make bench-gate: envelope paths remain allocation-free and migration performs one decode per value.

The full local make check was stopped during its test phase at the user's request; CI will complete the remaining validation.

Checklist

  • I have read the CONTRIBUTING document.
  • My code follows the project's coding standards.
  • I have added tests to cover my changes.
  • All new and existing tests passed (make check) — awaiting CI.
  • I have updated the documentation accordingly.

- Updated the usage of record keys in various examples to utilize the new `aimdb_core::Name` type for better type safety and clarity.
- Replaced string literals for record keys with `Name` instances in MQTT connector demos, HTTP server examples, and CLI tools.
- Ensured consistency in the configuration of record keys across different modules, enhancing maintainability and reducing potential errors.
- Adjusted tests to reflect the new key structure, ensuring all tests pass with the updated key handling.
lxsaah and others added 2 commits November 15, 2026 22:55
The trybuild suite also runs without the observable feature
(alloc,linkable-json,migratable), where ObservableRegistrarExt does not
exist, so the contract-verbs case failed to resolve its import. Cover
observe() with a compile_fail doctest on the method instead, which only
builds when the feature is on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ9Sps6DnUDtpdbs6kD
The demos imported payload types only for the old configure::<T>
turbofish; with typed keys they are unused and fail make examples under
denied warnings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGkDJ9Sps6DnUDtpdbs6kD
@lxsaah
lxsaah merged commit 0439014 into main Nov 15, 2026
12 checks passed
@lxsaah
lxsaah deleted the feat/typed-record-keys branch November 15, 2026 22:54
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.

2 participants