refactor(core)!: split AnyRecord into capability traits (036 W2)#142
Open
lxsaah wants to merge 2 commits into
Open
refactor(core)!: split AnyRecord into capability traits (036 W2)#142lxsaah wants to merge 2 commits into
lxsaah wants to merge 2 commits into
Conversation
AnyRecord carried ~22 methods spanning four concerns; every remote-access or profiling change churned the core storage contract. Split by consumer: - AnyRecord (6 methods): storage/lifecycle only — validate, as_any(_mut), drain_config_errors, set_writable_erased, plus the cfg-gated json_access() accessor so the remote-access gate lives in one place. - RecordIntrospect (supertrait): graph/metadata introspection consumed by the builder's dependency-graph construction, route collection, and list_records. - JsonRecordAccess (cfg remote-access): latest_json / subscribe_json / set_from_json, reached via json_access(); the runtime .with_remote_access() checks stay inside the methods, so behavior is unchanged. Gate is `remote-access` (the 036 sketch said json-serialize). - RecordMetricsReset (supertrait): the cfg-gated no-op-default resets. Supertrait wiring keeps every dyn AnyRecord call site compiling unchanged; only the four JSON call sites switch to the accessor. Registry storage stays Vec<Box<dyn AnyRecord>>. Drops the dead outbound_connector_urls (cfg std) — zero callers in-tree and in aimdb-pro. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements W2 from 036-followup-refactoring.md (034 §3.8): splits the ~22-method
AnyRecordgod-trait by consumer, stacked on the W1 branch (#141) in the same breaking window.AnyRecord(6 methods) — storage/lifecycle only:validate,as_any(_mut),drain_config_errors,set_writable_erased, plus the cfg-gatedjson_access()accessor so theremote-accessgate lives in one place for consumers.RecordIntrospect(supertrait) — graph/metadata introspection: connector links,has_*,record_origin,buffer_info,transform_input_keys,collect_metadata. Consumed by the builder's dependency-graph construction, route collection, andlist_records.JsonRecordAccess(cfgremote-access) —latest_json/subscribe_json/set_from_json, reached viajson_access(). The runtime.with_remote_access()checks stay inside the methods → no behavior change. (The 036 sketch saidjson-serialize; the code gate is and staysremote-access.)RecordMetricsReset(supertrait) — the cfg-gated, no-op-default profiling/metrics resets.Supertrait wiring keeps every
dyn AnyRecordcall site compiling unchanged; only the four JSON call sites (buildertry_latest_as_json/set_record_from_json, AimX dispatch drain,remote::stream) switch to the accessor. Registry storage staysVec<Box<dyn AnyRecord>>. Also drops the deadoutbound_connector_urls(cfgstd) — zero callers in-tree and in aimdb-pro.Acceptance (036 W2):
AnyRecord≤ ~8 methods ✓ (6); no behavior change ✓ (bodies and error messages moved verbatim; session smoke tests unmodified); rustdoc per trait names its consumer ✓.Notes for review
refactor/036-w1-data-plane-de-any— retarget tomainonce refactor(core)!: data-plane de-Any — fuse typed pipelines at registration (036 W1) #141 merges.AnyRecordimplementor or caller of the moved methods on concrete types (in-tree there are none; introspection methods have same-named inherentTypedRecordcounterparts).Test plan
make build/make test— full CI feature matrix (incl.--no-default-features --features alloc{,profiling,metrics,connector-session}, thumbv7em, wasm) ✅make clippy(-D warnings, all combos) +make fmt-check✅cargo checkagainst the new core ✅🤖 Generated with Claude Code