feat: cross-stack error taxonomy (#249) + aid_escrow MAX_ALLOWED_TOKENS guard (#233) - #1
Open
precy41 wants to merge 1 commit into
Open
feat: cross-stack error taxonomy (#249) + aid_escrow MAX_ALLOWED_TOKENS guard (#233)#1precy41 wants to merge 1 commit into
precy41 wants to merge 1 commit into
Conversation
…LLOWED_TOKENS guard (ChainForgee#233) Co-authored-by: ChainForge <noreply@chainforge.local>
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.
Summary
Closes ChainForgee#249 and ChainForgee#233 in one PR.
ChainForgee#249 Cross-stack error taxonomy
docs/errors.yaml(15 cross-service + 23 Soroban contract identifiers).src/common/errors/codes.tsmirrors the YAML;AllExceptionsFilterattacheserrorCodeon everyErrorResponse. Added optionalerrorCodefield toApiResponseDto.schemas/error_codes.pymirrors the same enum (extendsstrfor byte-identical JSON). HTTPException / RequestValidationError / AIServiceError / generic handlers and the body-size middleware all emit canonical strings. Fixed latentCODE_BODY_LENGTH_MISMATCHtypo in_send_400_mismatch.app/backend/src/common/errors/codes.spec.tsandapp/ai-service/tests/test_error_codes.pyguard both enums against drift.ChainForgee#233 aid_escrow MAX_ALLOWED_TOKENS guard
MAX_ALLOWED_TOKENS = 32, newError::TooManyAllowedTokens = 23variant, length gate runs before per-tokenvalidate_tokenso a bogus 33rd address can't trigger extra host invocations.soroban-error.mapper.tscovers 19..23 in both the numeric map and the string-fallback map so they never silently fall through to the catch-all 500.InvalidTokenat length=32 (threshold pin), and constant-drift guardMAX_ALLOWED_TOKENS == 32. Backend mapper spec mirrors via numeric and string-fallback tests.Follow-ups (post-merge)
mapContractErrorMessage(includes-> word-boundary anchors).REQUEST_TIMEOUTidentifier for HTTP 408 instead of overloadingUPSTREAM_TIMEOUT.Refs ChainForgee#249, ChainForgee#233.