You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(core)!: split AnyRecord into capability traits (036 W2) (#142)
* refactor(core)!: split AnyRecord into capability traits (036 W2)
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>
* docs(design): mark 036 W2 implemented in PR #142
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: docs/design/036-followup-refactoring.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,7 @@ The registry keeps storing `Box<dyn AnyRecord>`; consumers upcast to the capabil
62
62
63
63
**Payoff:** the core storage contract stops churning every time remote access or profiling evolves, and each consumer's dependency is visible in its signature. **Acceptance:**`AnyRecord` ≤ ~8 methods; no behavior change; rustdoc for each trait states its consumer.
64
64
65
-
**Size:** M. Mechanical but wide. **File together with W1** (it touches the same files; do W2 first or in the same series — W2 shrinks the surface W1 has to move).
65
+
**Size:** M. Mechanical but wide. **File together with W1** (it touches the same files; do W2 first or in the same series — W2 shrinks the surface W1 has to move).**Status:** implemented in PR [#142](https://github.com/aimdb-dev/aimdb/pull/142), stacked on #141 (W1 had already landed, so the "W2 first" ordering note was moot). Deviations from the sketch: the JSON trait's gate is `remote-access` — the actual gate on those methods — not `json-serialize`; the resets live on a `RecordMetricsReset` supertrait (default no-ops, so the supertrait list needs no cfg); the dead `outbound_connector_urls` (cfg `std`, zero callers in-tree and in aimdb-pro) was dropped rather than moved. Result: `AnyRecord` has 6 methods.
0 commit comments