Skip to content

feat(memory): add V1 migration audit and deprecation guidance - #77

Merged
AnzoBenjamin merged 8 commits into
mainfrom
feat/memory-v1-deprecation-audit
Sep 13, 2026
Merged

AnzoBenjamin merged 8 commits into
mainfrom
feat/memory-v1-deprecation-audit

Conversation

@AnzoBenjamin

@AnzoBenjamin AnzoBenjamin commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • add an exact, read-only V1-to-V2 migration audit API and /memory audit-migration CLI flow
  • mark Memory V1 compatibility surfaces deprecated while preserving Release N behavior
  • document explicit removal-readiness, backup, rollback, mixed-version, and go/no-go gates

Migration safety

  • no V1 API, persistence, authority, shadow, import, or fallback behavior is removed in Release N
  • exact is lossless only with zero omissions, truncations, and warnings
  • not-migrated means removal is not ready; it is not treated as a product defect
  • both V1 and V2 stores must remain intact through any future rollback window

Validation

  • automated validation/reviewer gates: LOOKS_GOOD
  • full monorepo typecheck passed
  • focused CLI and SDK migration/audit tests passed
  • memory drift guard passed with 0 findings
  • Prettier check passed for documentation changes
  • pre-push check:ci-local passed, including 1,245 agents/common tests

This change is Reviewable

@vercel

vercel Bot commented Sep 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
openbuff Ready Ready Preview, v0 Sep 13, 2026 6:49pm UTC

Deprecate json-v1 and shadow-v2 in favor of sqlite-v2-opt-in with explicit no-removal-date guidance, and make /memory audit-migration read-only and inspection-first so absent, invalid, and unreadable V1 records are reported distinctly before any V2 acquisition. Reconcile V1 evidence against descriptor-bound versioned hashes with containment checks and fail-closed, token-owned cross-process locking so pruning never acts on unverifiable or inherited stale verdicts. Validate V1->V2 migration deterministically by reconstructing every source-derived task and observation event and comparing full normalized headers and payloads, closing the first two Gate 0 removal-readiness blockers documented in docs/memory-v1-removal-readiness.md.
…ip validation

The V1->V2 import now runs before the query-id check and fails closed against a stateless stub, so update the stale coordinator expectation to the deterministic 'migration-failed' reason while keeping the no-context/no-parity safety invariant. Split validatedMigrationOwnedMarkerMetadata's inline check chain into focused boolean predicate helpers; semantics are unchanged.
The Bun SQLite backend persists event payloads via stableJson (recursive key sort) and export() re-parses from that sorted JSON, so record-valued marker fields like sourceItemCounts round-trip in sorted key order while the in-memory draft keeps insertion order. equalEventDraft's naive JSON.stringify comparison therefore always reported imported-body-mismatch on the real provider. Canonicalize both sides (recursive key sort, arrays keep order) so comparison is by content, letting import return 'imported' and audit report 'exact'. Adds a regression test mimicking the stableJson round-trip, hoists the loop-invariant getV1MigrationIdentity out of findMigrationMarker's reservation loop, and documents hashToken truncation collision tolerance.
Seed a V1 task-memory record, import it into V2 through the real Bun SQLite backend against a temp project, and assert the migration audit certifies an exact result with matching sourceItemCounts. This exercises the canonicalizeForCompare key-order round-trip end to end: the backend persists event payloads via key-sorted stableJson, so the re-read marker arrives with sorted record keys while the in-memory draft keeps insertion order.
The sdk-side test reached into cli internals via a cross-package relative path to import the Bun SQLite backend, which a reviewer advisory flagged as fragile. Colocating the test with the existing cli backend test makes the backend import package-local; the migration and V1-store modules are still exercised from sdk source.
@AnzoBenjamin
AnzoBenjamin merged commit efaac94 into main Sep 13, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant