Skip to content

[RFC #7748] feat(samples): standalone SQLite shared memory provider and concurrency suite - #8215

Draft
RemanenetSpy (RemanenetSpy) wants to merge 1 commit into
microsoft:mainfrom
RemanenetSpy:feat/sqlite-shared-memory
Draft

[RFC #7748] feat(samples): standalone SQLite shared memory provider and concurrency suite#8215
RemanenetSpy (RemanenetSpy) wants to merge 1 commit into
microsoft:mainfrom
RemanenetSpy:feat/sqlite-shared-memory

Conversation

@RemanenetSpy

Copy link
Copy Markdown

Draft PR implementing the standalone SQLite shared memory provider sample requested in RFC #7748.

Changes Included:

  • python/samples/agent_memory_sqlite/sqlite_shared_memory.py:
    • SQLiteSharedMemoryStore: Thread-safe SQLite store with WAL mode, foreign key enforcement, bi-temporal soft-invalidation (\�alid_from\ / \�alid_to), and optimistic atomic conditional replacement.
    • BoundSessionMemory: Context-bound tool wrapper instantiated by host orchestrator, binding caller credentials (\ enant_id, \scope_type, \scope_id, \�uthority_tier) server-side to prevent model-directed privilege escalation.
  • python/samples/agent_memory_sqlite/test_sqlite_shared_memory.py:
    • 9 automated unit tests verifying scope isolation, authority tier overrides, atomic superseding, soft-delete tombstones, and trusted context binding.
    • Concurrency suite: 10 competing replacement workers with barrier synchronization (exactly 1 succeeds, 9 raise \ReplacementConflictError).
    • Harness repair test: Injected worker connection-setup failure cleanly aborts barrier, peer workers catch \ hreading.BrokenBarrierError, all threads join without hanging, and assertions strictly reject unexpected exceptions.
  • python/samples/agent_memory_sqlite/README.md: Run instructions.

All 9 tests pass in ~0.5s:
\\�ash
pytest -v python/samples/agent_memory_sqlite/test_sqlite_shared_memory.py
\\

Resolves discussion in #7748.

@RemanenetSpy

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

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