Context
The remaining mechanical items from Phase 1 of docs/design/034-technical-debt-review.md (§3.1.2, §3.1.3, §3.8, §3.10). Sibling of #129 (DbError unification). Every item is independent, low-risk, and zero-behavior-change — they can be picked individually and reviewed as separate PRs against this issue.
Breaking changes are acceptable (dead-API deletion is wanted, not deprecated).
Tasks
1. Unify std/alloc imports (~25 sites in aimdb-core)
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, sync::Arc};
#[cfg(feature = "std")]
use std::{boxed::Box, sync::Arc};
std::sync::Arc is a re-export of alloc::sync::Arc — one unconditional use alloc::... works on every target (the crate has an unconditional extern crate alloc). Replace all dual-import headers. (The fully duplicated RuntimeContext impl blocks in context.rs are handled by #131; skip that file if #131 lands first.)
2. Internal logging macros instead of 62 per-call-site cfg gates
Add crate-private log_debug!/log_info!/log_warn!/log_error! macros that forward to tracing when the feature is on and expand to nothing otherwise; delete every #[cfg(feature = "tracing")] attribute that exists only to guard a single log statement.
3. Delete dead API surface
Database<A> (aimdb-core/src/database.rs, 140 lines) — thin wrapper over AimDb, referenced only by…
TokioDatabase / EmbassyDatabase type aliases — used nowhere in the workspace.
.link() on RecordRegistrar — deprecated since 0.2.0, workspace is at 1.1.0.
4. Drop the vestigial tokio dependency from aimdb-core
[dependencies] tokio (with net, io-util, sync, time) is enabled by the std feature, but since the session-engine refactor the only tokio:: references in aimdb-core/src are inside #[cfg(test)] modules — covered by the existing dev-dependency. Remove it from [dependencies] and from the std feature list.
5. Struct-ify OutboundRoute
builder.rs defines it as a 5-tuple type alias; every connector destructures it positionally. Make it a struct with named fields (topic, consumer, serializer, config, topic_provider) and update the connectors.
6. Small opportunistic fixes
Acceptance criteria
See docs/design/034-technical-debt-review.md Phase 1 for context. Related: #129, #130, #131.
Context
The remaining mechanical items from Phase 1 of
docs/design/034-technical-debt-review.md(§3.1.2, §3.1.3, §3.8, §3.10). Sibling of #129 (DbError unification). Every item is independent, low-risk, and zero-behavior-change — they can be picked individually and reviewed as separate PRs against this issue.Breaking changes are acceptable (dead-API deletion is wanted, not deprecated).
Tasks
1. Unify std/alloc imports (~25 sites in aimdb-core)
std::sync::Arcis a re-export ofalloc::sync::Arc— one unconditionaluse alloc::...works on every target (the crate has an unconditionalextern crate alloc). Replace all dual-import headers. (The fully duplicatedRuntimeContextimpl blocks incontext.rsare handled by #131; skip that file if #131 lands first.)2. Internal logging macros instead of 62 per-call-site
cfggatesAdd crate-private
log_debug!/log_info!/log_warn!/log_error!macros that forward totracingwhen the feature is on and expand to nothing otherwise; delete every#[cfg(feature = "tracing")]attribute that exists only to guard a single log statement.3. Delete dead API surface
Database<A>(aimdb-core/src/database.rs, 140 lines) — thin wrapper overAimDb, referenced only by…TokioDatabase/EmbassyDatabasetype aliases — used nowhere in the workspace..link()onRecordRegistrar— deprecated since 0.2.0, workspace is at 1.1.0.4. Drop the vestigial
tokiodependency from aimdb-core[dependencies] tokio(withnet,io-util,sync,time) is enabled by thestdfeature, but since the session-engine refactor the onlytokio::references inaimdb-core/srcare inside#[cfg(test)]modules — covered by the existing dev-dependency. Remove it from[dependencies]and from thestdfeature list.5. Struct-ify
OutboundRoutebuilder.rsdefines it as a 5-tuple type alias; every connector destructures it positionally. Make it a struct with named fields (topic,consumer,serializer,config,topic_provider) and update the connectors.6. Small opportunistic fixes
ConsumerTrait::subscribe_any's vestigialDbResult(infallible since M14; superseded if refactor(core)!: remove runtime type parameter R from the object graph — non-generic AimDb/TypedRecord/RuntimeContext (R-removal part 2) #131 task 6 lands first).records.iter().position(...)perconfigure()call andby_key.keys().find(...)per topo entry inbuild().Acceptance criteria
grep -rn "use std::{" aimdb-core/srcand dual-import pairs return nothing (std-only modules likeerror.rsioimports excepted)grep -rn 'cfg(feature = "tracing")' aimdb-core/srconly hits the macro definition siteDatabase,TokioDatabase,EmbassyDatabase,.link()gone; changelog notes the removalscargo tree -p aimdb-coreshows notokiooutside dev-dependenciesmake checkandmake examplespassSee
docs/design/034-technical-debt-review.mdPhase 1 for context. Related: #129, #130, #131.