Skip to content

🧪 [testing improvement] Add tests for MemoryDb::evidence_locator - #4

Merged
undivisible merged 2 commits into
mainfrom
add-evidence-locator-tests-11407451167084790810
Aug 12, 2026
Merged

🧪 [testing improvement] Add tests for MemoryDb::evidence_locator#4
undivisible merged 2 commits into
mainfrom
add-evidence-locator-tests-11407451167084790810

Conversation

@undivisible

@undivisible undivisible commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🎯 What: This PR addresses the gap in testing for MemoryDb::evidence_locator. The function now has a full unit test suite ensuring it behaves correctly when querying transcript locators associated with evidence.

📊 Coverage: The tests cover the following scenarios:

  • Successful retrieval of a locator.
  • Missing locator for an existing memory.
  • Cross-scope data isolation (tenant_id / person_id validation).
  • Proper handling of soft-deleted evidence (returns None when deleted_at is set).

Result: Test coverage for MemoryDb lifecycle operations is improved, ensuring robust fetching of transcript locators and minimizing the risk of regressions during refactoring.


PR created automatically by Jules for task 11407451167084790810 started by @undivisible


Note

Low Risk
Test-only change with no production code modifications.

Overview
Adds a unit test for MemoryDb::evidence_locator covering successful locator retrieval, missing locators, tenant/person scope isolation, and soft-deleted evidence returning None.

No production code changes.

Reviewed by Cursor Bugbot for commit 0c786ff. Configure here.

This commit adds comprehensive unit tests to `src/store/tests/lifecycle.rs` for the `MemoryDb::evidence_locator` function.

It covers the following scenarios:
1. Successfully retrieving a stored transcript locator for a specific evidence entry.
2. Returning `None` when the evidence exists but has no locator.
3. Returning `None` when trying to query across different scopes (mismatched tenant/person IDs).
4. Returning `None` when the evidence is soft-deleted.

Co-authored-by: undivisible <136312656+undivisible@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_153caa66-becb-4389-b754-4f9bd8b70c17)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e864646a4

ℹ️ 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".

Comment on lines +662 to +663
tenant_id: TenantId("b".into()),
person_id: PersonId("sam".into()),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Test person isolation independently

This cross-scope case changes only tenant_id, so it would still pass if MemoryDb::evidence_locator stopped filtering by person_id. Because tenant and person are independent scope dimensions, add a lookup using tenant a with a different person to ensure a locator cannot be retrieved across people within the same tenant.

Useful? React with 👍 / 👎.

@cursor

cursor Bot commented Aug 12, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_30b25091-d73b-4a8f-b2f3-2e068a41394e)

@undivisible
undivisible merged commit 9abc0f4 into main Aug 12, 2026
7 checks passed
@undivisible
undivisible deleted the add-evidence-locator-tests-11407451167084790810 branch August 12, 2026 03:29
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