fix(KEEP-475): follow-up — hoist regex + add bare /agent redirect#1284
Merged
Conversation
- Hoist EIP-55 address regex to module scope in well-known-erc8004 test to satisfy lint/performance/useTopLevelRegex (pre-commit gate). - Add app/agent/route.ts as a 301 permanent redirect to /agent-card.json so ERC-8004 indexers that probe the bare /agent path don't 404.
🧹 PR Environment Cleaned UpThe PR environment has been successfully deleted. Deleted Resources:
All resources have been cleaned up and will no longer incur costs. |
ℹ️ No PR Environment to Clean UpNo PR environment was found for this PR. This is expected if:
|
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
Follow-up to PR #1276 (already merged). Addresses two findings from the review that were missed in the original merge:
/^0x[a-fA-F0-9]{40}$/attests/unit/well-known-erc8004.test.ts:41violateslint/performance/useTopLevelRegex. Hoisted to a module-levelEIP55_ADDRESSconstant./agentroute 404: Linear KEEP-475 explicitly lists/agent(without.json) as a 404 alongside the.well-known/*variants. ERC-8004 indexers probe this fallback path; without it, KeeperHub's listing on those directories stays incomplete. Addedapp/agent/route.tsas a 301 permanent redirect to/.well-known/agent-card.json, mirroring the existingapp/.well-known/agent.json/route.tspattern.Test plan
pnpm checkon changed files: cleanpnpm type-check: cleannpx vitest run tests/unit/well-known-erc8004.test.ts: 4/4 pass (including the new/agentredirect assertion)