Skip to content

refactor: add structured validation metadata and fix contract client …#149

Open
whitezaddy wants to merge 1 commit into
Adamantine-guild:mainfrom
whitezaddy:refactor/structured-validation-metadata
Open

refactor: add structured validation metadata and fix contract client …#149
whitezaddy wants to merge 1 commit into
Adamantine-guild:mainfrom
whitezaddy:refactor/structured-validation-metadata

Conversation

@whitezaddy

Copy link
Copy Markdown

…test workspace instability
Closes #129

🚀 #Refactor: Structured Metadata Validation Exceptions

Overview

This Pull Request transitions the input validation pipeline from throwing unstructured, string-based exceptions to throwing strongly-typed, machine-readable GuildPassError metadata blocks. This enables consumers to isolate exactly which configuration field or entity parameter failed and why without fragile string parsing.

Key Changes

  • Validation Standardization: Implemented a unified throwValidationError helper inside src/utils/validation.ts ensuring consistent output object shape mapping (field, reason, value, valueType).
  • Masking Invariants: Added strict string checking to mask and sanitize sensitive pipeline keys (e.g., apiKey) from leaking through exception details blocks.
  • Workspace Stability Fixes: Corrected long-standing missing scope imports (DECIMALS_SELECTOR and formatUnits) and added strict regex digit/decimal boundaries inside src/contracts/contractClient.ts.

Verification Checklist

  • All 375 unit and integration tests executing cleanly inside Vitest framework.
  • Sensitive parameters scrubbed from error details context.
  • Form fields properly categorized with REQUIRED, INVALID_FORMAT, and INVALID_TYPE metadata keys.

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.

Add Structured Error Metadata for Validation Failures

1 participant