feat(ops): error-payload scrubbing wired into error boundaries (#76) - #113
Merged
joelpeace48-cell merged 1 commit intoAug 30, 2026
Merged
Conversation
…inesseStudioLab#76) - lib/observability/scrub.ts: scrubErrorPayload() masks Stellar addresses (G.../C... 56-char base32) in messages, stack traces and nested context, and drops request bodies, headers, auth and other sensitive keys. Recursion is cycle-safe and depth-bounded. - lib/observability/report.ts: captureError() — the single reporting entry point; all output goes through the scrubber first. Sentry transport (source maps, release = commit SHA, rate alerting) layers on here. - app/error.tsx + app/global-error.tsx now call captureError(). - tests/unit/scrub.test.ts asserts a known address string never survives scrubbing — the invariant that stays true as the codebase changes. Refs FinesseStudioLab#76
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Error-payload scrubbing, wired into both error boundaries (issue #76). No new deps.
lib/observability/scrub.ts—scrubErrorPayload(error, context)masks Stellar addresses (G…/C…56-char base32) in the message, stack trace, and any nested context object, and drops request bodies, headers, auth tokens, and other sensitive keys. Recursion is cycle-safe and depth-bounded.lib/observability/report.ts—captureError(), the single reporting entry point; everything passes through the scrubber before it goes anywhere. The Sentry transport (source maps,release= commit SHA, rate-based alerting) layers on here without call sites changing.app/error.tsx+app/global-error.tsxnow callcaptureError()instead of a rawconsole.error(error).tests/unit/scrub.test.ts— asserts a known address string never survives scrubbing (message, stack, nested context), plus cycle handling and sensitive-key drops (7 tests).Follow-up (same issue)
Sentry SDK + DSN, build-time source-map upload, release tagging in CI, rate-based alert rules.
Testing
npm test(7 new tests pass),next lintclean locally.Closes #76