Skip to content

test(provenance): cover the enforced branch of the agent memory surface - #6497

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/durable-secret-provenance-fail-open
Aug 10, 2026
Merged

test(provenance): cover the enforced branch of the agent memory surface#6497
waleedlatif1 merged 1 commit into
stagingfrom
fix/durable-secret-provenance-fail-open

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Add test for memory surface.

Type of Change

  • Other: Test

Testing

N/A

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

The agent's stored-memory read was the only durable-provenance check site
with no test of its enforced path, and the only one whose control flow was
restructured by hand. Pin both directions against the shape that failed in
production: an unrecorded memory reads through and reports, and the same
memory refuses once the memory surface is closed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 10, 2026 5:55pm

Request Review

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only changes to memory provenance enforcement mocks and scenarios; no production behavior modified.

Overview
Extends memory.test.ts so durable secret provenance enforcement is mocked (isDurableSecretProvenanceEnforced, reportUnrecordedDurableProvenance), with beforeEach resetting enforcement to the open (non-enforced) default.

Adds two cases for fetchMemoryMessages when stored memory has provenance: { status: 'unknown' }: while the memory surface stays open, messages are returned, the registry stays complete, and reportUnrecordedDurableProvenance is called; once enforcement is enabled for memory, the same fetch throws and reporting is not invoked.

Reviewed by Cursor Bugbot for commit c380918. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds focused test coverage for stored agent memories whose secret provenance is unknown.

  • Verifies unknown-provenance memory remains readable while enforcement is disabled and reports the unrecorded provenance.
  • Verifies the same memory is rejected when enforcement for the memory surface is enabled.
  • Adds hoisted mocks and resets the enforcement default between tests.

Confidence Score: 5/5

The PR appears safe to merge because the added tests accurately cover both provenance-enforcement states.

The module mock supplies the runtime exports consumed by the memory handler, test state is reset between cases, and the enforced case reaches the intended rejection branch without another viable earlier failure.

Important Files Changed

Filename Overview
apps/sim/executor/handlers/agent/memory.test.ts The added mocks and assertions accurately exercise both open and enforced branches for unknown stored-memory provenance without introducing an actionable issue.

Reviews (1): Last reviewed commit: "test(provenance): cover the enforced bra..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit bc8826a into staging Aug 10, 2026
30 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/durable-secret-provenance-fail-open branch August 10, 2026 18:03
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.

2 participants