Skip to content

fix(logs): keep provenance sidecars intact through log PII redaction - #9344

Merged
waleedlatif1 merged 2 commits into
stagingfrom
fix/log-pii-redaction-provenance-sidecars
Oct 23, 2026
Merged

waleedlatif1 merged 2 commits into
stagingfrom
fix/log-pii-redaction-provenance-sidecars

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Log-stage PII masking walks every string leaf of executionState. A match inside an encrypted provenance entry (e.g. a digit run in the ciphertext hex) rewrote it, so the AES-GCM auth check failed on read and the log display withheld the final output
  • preservePrivateExecutionStateMetadata already restored run, block-state, block-log and workflow-variable provenance from the pre-redaction state. It now also restores finalOutputResolvedSecretTraceProvenance, workflowInputResolvedSecretTraceProvenance, loop/parallel scope provenance (inputResolvedSecretTraceProvenance / resolvedSecretTraceProvenance) and sourceExecutionId, which backfill and run-from-block read back
  • User-content fields are still masked exactly as before. Only server-written metadata is copied back
  • Log noise: an undecryptable stored envelope logged three errors per read (encryption, registry summary, trace-store). The registry now decrypts with logFailure: false. The trace-store takes the registry's decrypt summary through a new onDecryptFailure import option, so it logs one attributed undecryptable error with the counts and first error. Other importers keep the registry summary
  • Fault semantics and what the reader sees are unchanged. Rows that are already corrupted stay fail-closed

Type of Change

  • Bug fix

Testing

  • New regression test in logger.test.ts. It runs the real log PII pass with only the HTTP mask client mocked, then checks that the finalOutput/workflowInput sidecars, loop and parallel scope provenance, and sourceExecutionId survive while user content is still masked. It fails on the pre-fix logger.ts, and also when only the loop restore, the parallel restore, the scope-level field or sourceExecutionId is reverted
  • vitest run on logger, trace-store, trace-store-storage, trace-secret-projection, functional-outputs, pii-redaction, logging-session and resolved-secret-trace-registry tests: 228 passed
  • bun run lint, check:comment-hygiene, check:explicit-any, check:utils
  • Type-check, check:audits and the full suite run in CI

Checklist

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

Log-stage PII masking walks every string leaf of the execution state, so a
match inside an encrypted provenance entry rewrote the ciphertext and the
display read failed closed with the final output withheld. Restore the
finalOutput/workflowInput sidecars, loop/parallel scope provenance, and
sourceExecutionId from the pre-redaction state alongside the fields already
restored. An undecryptable stored envelope now logs one attributed error per
read instead of three.
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 23, 2026 8:16pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues remain from this review.

Summary

Preserves encrypted provenance and sourceExecutionId when execution logs mask personal data.

  • Execution logs keep private provenance intact while masking user content.
  • Trace-store reads report decrypt failures with execution context.

Reviews (2) · Last reviewed commit: "test(provenance): expect provenance impo..." · Reviewed by Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit e5ad3ae into staging Oct 23, 2026
67 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/log-pii-redaction-provenance-sidecars branch October 23, 2026 21:51

This branch was previously deployed

1 inactive deployment
Preview — a68ece35 Deployed Oct 23, 2026 by vercel[bot]
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