feat(memory): W3 parity harness (Layer 1) — on-disk format regression pins#4532
Conversation
… pins Fixture-free format asserters from the parity checklist (spec §0.3), gating the store cutover: pin the crate's deterministic on-disk contracts to the exact byte forms historical workspaces used, so a future crate change that reshapes chunk IDs / vector encoding / vault paths fails here instead of corrupting real data. - chunk_id: golden SHA-256-first-32-hex (2be5fac1…) + per-field sensitivity - vector encoding: little-endian packed f32 golden + round-trip - content paths: Windows-illegal ':' sanitized, deterministic, .md Test-only module (#[cfg(test)]). The Layer-2 golden-workspace differential harness (real chunks.db + vault, opened + compared) is the merge gate for the actual store flips and lands with the first flip. Tests run on CI. 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: 47 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 (2)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bfbef53e57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| fn content_paths_are_windows_safe_and_stable() { | ||
| let p1 = chunk_rel_path("chat", "slack:#eng", "chat:slack:#eng:0"); | ||
| let p2 = chunk_rel_path("chat", "slack:#eng", "chat:slack:#eng:0"); | ||
| assert_eq!(p1, p2, "path derivation must be deterministic"); |
There was a problem hiding this comment.
Pin the exact legacy vault path
This only proves the crate path is deterministic, colon-free, and ends in .md; if tinycortex changes the slugging or layout while preserving those properties (for example sanitizing # too, or moving the source folder), this test still passes even though the legacy host path for this input is chat/slack-eng/chat-slack-#eng-0.md. That would let a store flip look in the wrong vault path for existing chunks, so the P6 parity guard should assert the exact legacy relative path or compare against memory_store::content::paths::chunk_rel_path for chat/email/document cases.
Useful? React with 👍 / 👎.
Summary
Problem
W3 re-implements
UnifiedMemory/MemoryClientovertinycortex::store+chunks. Before any storage flip, we need automated proof that chunk IDs, vector encoding, and vault paths are byte-identical to what real workspaces already contain — otherwise a flip silently strands existing data.Solution
Layer-1 asserters (run on every PR, cheap, no fixture):
2be5fac1…) for a fixed input + per-field sensitivity (guards input drop / reorder / separator changes).vec_to_bytes/bytes_to_vec).chunk_rel_pathsanitizes Windows-illegal:out of colon-laden chunk IDs, deterministic,.md.Test-only module (
#[cfg(test)]), placed in the seam so it can call the crate directly and count toward coverage.Layer 2 — the golden-workspace differential harness (a real
chunks.db+ vault opened by pre- and post-migration builds and compared for recall/tree parity) — is the merge gate for the actual store flips and lands with the first flip PR.Impact
Related
AI Authored PR Metadata
Validation Run
cargo check --libclean; new module is#[cfg(test)]-only, compiled + run by CIValidation Blocked
command:localcargo testdeferred to GitHub runners (per maintainer direction — slow local test-profile builds)Behavior Changes