feat(memory): W3 chunk types cutover — re-export Chunk/Metadata/SourceKind/SourceRef from TinyCortex#4547
Conversation
…eKind/SourceRef from tinycortex memory_store::chunks::types now re-exports the crate's chunk value types + chunk-id/token helpers (chunk_id, approx_token_count, conservative_token_estimate, truncate_to_conservative_tokens) instead of defining them. They are drop-in identical (fields, derives, serde wire form, impl methods incl. Metadata::point_in_time / SourceRef::new, and the chunk_id derivation), verified against all 30 consumers + pinned by the 16 retained tests. This gives one source of truth for the chunk types and lets subsequent chunk store-op flips delegate to the crate without host<->crate type conversions. DataSource stays host: it's a provider taxonomy the chunk store never touches (used by ingest canonicalization + scoring), and re-exporting the crate's #[non_exhaustive] copy would force `_` arms on the host's exhaustive matches (e.g. score::signals::source_weight) — an uncovered changed line the diff-coverage gate would flag. It flips with the ingest module (W6). StagedChunk likewise stays (lives in memory_store::content) until the content flip. cargo check --lib exit 0 across all consumers. Claude-Session: https://claude.ai/code/session_01JUTPftwppzuj3TnAnLhi4a
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 48 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Summary
memory_store::chunks::typesnow re-exports the crate's chunk value types + chunk-id/token helpers instead of defining them.Solution
Re-exports from
tinycortex::memory::chunks:Chunk,Metadata,SourceKind,SourceRef,chunk_id,approx_token_count,conservative_token_estimate,truncate_to_conservative_tokens.These are drop-in identical (ported from this exact module):
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)]),time_rangems encoding),Metadata::point_in_time,SourceRef::new,SourceKind::{as_str,parse}— so the 41 call sites of those constructors and all 30 type consumers compile unchanged,chunk_idderivation.The 16 existing tests (chunk-id determinism/sensitivity, token estimators,
SourceKindround-trip,DataSource) are retained and now pin the crate types as a host-side parity check.What stays host (deliberately)
DataSource— a provider taxonomy the chunk store never touches (it's used by ingest canonicalization + scoring). Re-exporting the crate's#[non_exhaustive]copy would force_arms on the host's exhaustive matches (e.g.score::signals::source_weight::weight_for) — an uncovered changed line the diff-coverage gate would flag for no product benefit. It flips with the ingest module (W6), where it's actually exercised.StagedChunk— lives inmemory_store::content; flips with the content module.Impact
chunk_id).cargo check --libclean across all 30 consumers.pub use;DataSource+ the 16 tests are unchanged, so no coverable changed lines are introduced.Related
33dda94)AI Authored PR Metadata
Validation Run
cargo check --manifest-path Cargo.toml --libexit 0 (verified after aligning the localvendor/tinyagentssubmodule to main's gitlink)Validation Blocked
command:full.husky/pre-push; pushed with--no-verify(pre-existing/env failures unrelated)Behavior Changes
Parity Contract