Repository navigation
feat(hcs-25): add ans-trust-discovery adapter and collector - #184
Merged
kantorcodes merged 5 commits intoOct 8, 2026
Merged
kantorcodes merged 5 commits into
kantorcodes merged 5 commits into
Conversation
Implements the ans-trust-discovery adapter and signal family documented in the HCS-25 specification (adapters/ans-trust-discovery.md and signals/ans-trust-discovery.md). - Passes through the eight ANS Trust Index signals stored under metadata.ansTrustDiscovery (certtype, dnssecurity, agentage, versionstability, dnsconsistency, httpsrecord, agentcard, certificatehygiene) as one component each. Null or absent signals are excluded from the adapter mean. - Scoped to registry=ans with weight 1 and default component key ans-trust-discovery.certtype, per the specification. - A stored ansTrustDiscoveryStatus of stale applies the stale multiplier. - Adds the stored-field schema and HCS25_SIGNAL_CATALOG entry, registers the adapter in createHcs25AdapterCatalog, and adds tests. Refs: hiero-ledger/hiero-consensus-specifications#38 Signed-off-by: chou-godaddy <chou@godaddy.com>
4 tasks
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous Review Summaries (2 snapshots, latest commit 70b9ded)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit 70b9ded)Status: 4 Issues Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (10 files)
Fix these issues in Kilo Cloud Previous reviewStatus: No Issues Found | Recommendation: Merge Overview
Files Reviewed (7 files)
Verification Notes
Reviewed by free · Input: 378.8K · Output: 12.6K · Cached: 185.8K |
A stored ansTrustDiscoveryStatus of timeout or error with no score now surfaces that status, matching the other HCS-25 adapters. Present scores still pass through, and stale still keeps the score for the multiplier. Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
…-discovery-adapter Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
Adds the ans-trust-discovery signal collector next to the other HCS-25 collectors. It reads the provider registered-agent response, stores the eight scores under metadata.ansTrustDiscovery, and records timeout or error when the request fails. Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
A missing, timeout, or error response now writes the same status for all eight ans-trust-discovery signals. The stored status field still rides on the first signal. Signed-off-by: Michael Kantor <6068672+kantorcodes@users.noreply.github.com>
zerocodefast
approved these changes
Oct 8, 2026
kantorcodes
approved these changes
Oct 8, 2026
This was referenced Oct 8, 2026
kantorcodes
pushed a commit
that referenced
this pull request
Oct 19, 2026
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: #184 Signed-off-by: chou-godaddy <chou@godaddy.com>
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
ans-trust-discoveryscoring adapter and registers it increateHcs25AdapterCatalog().metadata.ansTrustDiscovery(certtype,dnssecurity,agentage,versionstability,dnsconsistency,httpsrecord,agentcard,certificatehygiene). Scores are clamped to[0,100]. Null, absent, or non-numeric signals stay out of the adapter mean.ansTrustDiscoveryStatusofstalekeeps the score so the stale multiplier applies.timeoutorerrorwith no score is returned as that status, matching the other HCS-25 adapters.ans-trust-discoverysignal collector used bycreateHcs25SignalAdapters({ ansTrustDiscovery: true }). It requestsGET {baseUrl}/v1/ans/registered-agents/{agentId}and stores the eight scores. The default base URL ishttps://api.godaddy.com.scoped, weight1,includeRegistries: ['ans'], default component keyans-trust-discovery.certtype.Testing
pnpm exec jest --config jest.config.json --testPathPattern __tests__/hcs-25 --coverage=false(189 passed)pnpm exec tsc -p tsconfig.json --noEmitpnpm exec prettier --checkon the changed HCS-25 filesNotes
anssubject with no stored signals stays in the denominator at0underans-trust-discovery.certtypewith statusmissing.