Skip to content

feat(validation): add deterministic JSON-safe metadata sanitiser - #484

Merged
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
Okorie2000-code:feat/issue-462-json-safe-metadata-sanitiser
Aug 30, 2026
Merged

feat(validation): add deterministic JSON-safe metadata sanitiser#484
Lakes41 merged 1 commit into
Adamantine-guild:mainfrom
Okorie2000-code:feat/issue-462-json-safe-metadata-sanitiser

Conversation

@Okorie2000-code

Copy link
Copy Markdown
Contributor

Add a standalone metadata sanitiser that recursively validates and sanitises arbitrary runtime values into JSON-safe representations. Implements circular-reference detection, prototype-pollution safety, configurable depth/collection limits, and structured error paths.

Closes #462

Description

Semver impact:

Linked Issue

Closes #

Type of Change

  • 🐛 Bug fix (patch)
  • ✨ New feature / method (minor)
  • 💥 Breaking change (major)
  • 📝 Documentation / TypeDoc update
  • 🔧 Chore / refactor
  • 🧪 Tests only

Changes Made

Public API Changes

// New / changed exports:

Test Evidence

pnpm test:run output:

Build Evidence

pnpm build output:

Checklist

  • I have read CONTRIBUTING.md
  • This PR is linked to an open issue
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test:run passes — all tests green
  • pnpm build succeeds — dist/ generated cleanly
  • All new public methods/types have TypeDoc comments
  • New behaviour is covered by at least one Vitest unit test
  • No new runtime dependencies added without prior maintainer approval
  • docs/ updated if public API changed
  • examples/ updated if new usage patterns were added
  • Backwards compatibility maintained (or breaking change clearly noted above)

Additional Notes

Add a standalone metadata sanitiser that recursively validates and
sanitises arbitrary runtime values into JSON-safe representations.
Implements circular-reference detection, prototype-pollution safety,
configurable depth/collection limits, and structured error paths.

Closes Adamantine-guild#462

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@Lakes41
Lakes41 merged commit 2a31f03 into Adamantine-guild:main Aug 30, 2026
2 checks passed
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.

Implement a deterministic JSON-safe metadata sanitiser for public SDK responses

3 participants