Skip to content

Conversation

samchon
Copy link
Owner

@samchon samchon commented Aug 5, 2025

This pull request updates the IValidationHook type in ILlmApplication.ts to improve type safety for validation hooks. The main change reverses the type parameter in the validation function to ensure the input is correctly typed as unknown and the validation result matches the expected argument type.

Type safety improvement:

  • Updated the IValidationHook type so that validation functions now accept an input of type unknown and return an IValidation of the expected argument type, rather than the reverse. This ensures more robust and predictable type checking for validation hooks.

@samchon samchon requested a review from Copilot August 5, 2025 14:21
@samchon samchon self-assigned this Aug 5, 2025
@samchon samchon added the bug Something isn't working label Aug 5, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a type safety issue in the IValidationHook type definition by correcting the parameter order in the validation function signature. The change ensures that validation hooks properly accept unknown input and return validation results typed to match the expected argument type.

  • Reversed the type parameters in IValidationHook to improve type safety
  • Changed validation functions to accept unknown input instead of typed input
  • Updated return type to be IValidation<Argument> instead of IValidation<unknown>

@samchon samchon changed the title Fix ILlmApplication.ValidationHook type Fix ILlmApplication.IValidationHook type Aug 5, 2025
@samchon samchon merged commit ca616b0 into master Aug 5, 2025
4 checks passed
@samchon samchon deleted the samchon-patch-1 branch August 5, 2025 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant