Repository navigation
fix(hcs-25): resolve ans trust discovery agents by uid - #2
Closed
chou-godaddy wants to merge 1 commit into
Closed
chou-godaddy wants to merge 1 commit into
chou-godaddy wants to merge 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>
cyen-godaddy
approved these changes
Oct 8, 2026
|
From claude, is this a real? The PR swaps nativeId → uid on the premise that HCS-14 carries the ANS agent id in uid. This repo's own HCS-14 contract says otherwise: GET /v1/ans/registered-agents/ans%3A%2F%2Fv1.0.0.support-agent.example.com → 404 |
Owner
Author
|
Approved internally. Opened upstream as hashgraph-online#185; closing this draft without merging. |
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 hashgraph-online#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.