fix(provenance): close durable writer and reader gaps - #7584
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR closes durable secret-provenance gaps across memory, knowledge reranking, table snapshot mounts, workspace files, and client-tool completion handling.
Confidence Score: 5/5The PR appears safe to merge; no concrete correctness, security, or repository-rule violations remain. The changed model-egress paths either import and redact exact provenance, preserve explicitly flag-controlled legacy compatibility, or fail closed when enforcement requires it. Memory concurrency and historical recovery are bounded and covered by PostgreSQL and route-level regressions.
|
| Filename | Overview |
|---|---|
| apps/sim/executor/handlers/agent/memory.ts | Sanitizes messages before binding, serializes memory writes, and safely preflights historical provenance recovery. |
| apps/sim/lib/memory/secret-provenance.ts | Adds per-message provenance binding, bounded historical recovery, and more precise unknown-write diagnostics. |
| apps/sim/lib/memory/locks.ts | Introduces a transaction-scoped PostgreSQL advisory lock keyed by workspace and conversation. |
| apps/sim/lib/knowledge/application/search.ts | Imports stored result provenance before reranking and refuses unsafe provider egress under the configured policy. |
| apps/sim/lib/table/rows/secret-provenance.ts | Aggregates snapshot safety classifications and attributes non-exact writes after their sidecars are bound. |
| apps/sim/lib/uploads/contexts/workspace/workspace-file-secret-provenance.ts | Adds safe diagnostics for non-exact writes and provenance-based model-egress refusals. |
| apps/sim/lib/copilot/request/tools/client-completion-seal.server.ts | Classifies sealed completion and context failures without exposing encrypted or decrypted contents. |
| .github/workflows/test-build.yml | Adds PostgreSQL integration coverage for table provenance classification and concurrent memory writes. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Tool or Agent output] --> B[Sanitize persisted value]
B --> C[Bind secret provenance to value]
C --> D[(Durable store and sidecar)]
D --> E{Model-facing read}
E --> F[Validate sidecar binding]
F -->|Exact| G[Import scoped or anonymous secrets]
F -->|Unrecorded, flag off| H[Proceed and report diagnostic]
F -->|Unavailable or enforced| I[Refuse model egress]
G --> J[Redact provider payload]
J --> K[Knowledge reranker or agent model]
Reviews (1): Last reviewed commit: "fix(provenance): close durable writer an..." | Re-trigger Greptile
1387345 to
8a65a76
Compare
|
@cubic review |
@icecrasher321 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic review |
@icecrasher321 I have started the AI code review. It will take a few minutes to complete. |
|
@cubic review |
@icecrasher321 I have started the AI code review. It will take a few minutes to complete. |
Summary
Type of Change
Testing
Checklist