Repository navigation
fix(hcs-25): resolve ans trust discovery agents by uid - #185
Merged
kantorcodes merged 1 commit intoOct 19, 2026
Merged
kantorcodes merged 1 commit into
kantorcodes merged 1 commit into
Conversation
The ans-trust-discovery collector looked agents up by the UAID nativeId, but ANS Trust Index providers key the registered-agent endpoint by the ANS agent id, which HCS-14 carries as the UAID uid parameter. Every lookup returned 404, so no ANS agent received signals. - Resolve the agent id from metadata.uid, then the uid parameter of metadata.uaidFull or the subject id. nativeId is no longer used, and parameters are parsed without a regular expression. - Apply the collector and the scoring adapter to the ans and godaddy-ans registries by default: ans is the HCS-14 registry value and godaddy-ans is the Registry Broker namespace for the same agents. - Clear stored scores when the provider returns 404 for the agent. - Skip collection while stored signals are fresh (24 hours after a success, 1 hour after a failure) unless forced, so batch refreshes stay within provider rate limits. - Retry network errors and HTTP 5xx twice. HTTP 429 is not retried. - Correct the collector test that asserted the nativeId URL, and cover id resolution, 404 clearing, retries, rate limiting, caching and registry applicability. Refs: hashgraph-online#184 Signed-off-by: chou-godaddy <chou@godaddy.com>
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (4 files)
Reviewed by free · Input: 524.5K · Output: 44.9K · Cached: 776.2K |
kantorcodes
approved these changes
Oct 19, 2026
kantorcodes
left a comment
Member
There was a problem hiding this comment.
Checks green, review threads resolved, quiet window elapsed at 49106e0.
internet-dot
approved these changes
Oct 19, 2026
internet-dot
left a comment
There was a problem hiding this comment.
Checks green, review threads resolved, quiet window elapsed at 49106e0.
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 #184. The
ans-trust-discoverycollector looked agents up by the UAIDnativeId, but ANS Trust Index providers keyGET /v1/ans/registered-agents/{id}by the ANS agent id, which HCS-14 (ans-dns-webprofile) carries as the UAIDuidparameter. Every lookup returned 404, so no ANS agent received signals.metadata.uid, then theuidparameter ofmetadata.uaidFull, then ofsubject.id.nativeIdis no longer used, and UAID parameters are parsed without a regular expression.ansandgodaddy-ansby default.ansis the HCS-14 registry value;godaddy-ansis the Registry Broker namespace for the same agents.ttlMs, 24 hours after a success;failureTtlMs, 1 hour after a failure), andforceoverrides this. This keeps batch refreshes within provider rate limits.maxRetries). HTTP 429 is not retried.Testing
pnpm exec jest --config jest.config.json --testPathPattern __tests__/hcs-25 --coverage=false(203 passed on Node 22 and 24, including 14 new tests)pnpm run typecheckpnpm run lintpnpm run buildcollectAndScoreTrustScoreagainst a live ANS Trust Index provider, using subjects shaped like Registry Broker records: a UAID without parameters,metadata.uid, and registrygodaddy-ans. Each component and adapter total matched values computed independently from the provider responses. An unknown id returned 404 and cleared the stored scores, and a second run within the refresh interval made no request.Notes
timeoutorerrorstatus, as the ethos collector does; the 1-hour failure interval then triggers a retry.readUaidParammirrors the parameter handling ofparseHcs14Didso thathcs-25keeps no imports fromhcs-14. Happy to switch toparseHcs14Didif preferred.typecheck,lintand full-suite results are unchanged frommain.ans-dns-webresolver (src/hcs-14/resolvers/ans-dns-web-profile.ts) currently comparesuidwith the Agent CardansName, and its fixtures useans://names, while the profile definesuidas the ANS agent ID (UUID). This PR follows the profile, which matches Registry Broker data; the provider endpoint rejects anans://name with 400. Happy to help align the resolver in a separate change.