### Quickstart: clone, build, and run demo lifecycle Source: https://github.com/agentnameservice/ans/blob/main/README.md Clones the repository, builds the binaries, starts the demo daemons, and runs the end-to-end lifecycle script. Requires Go 1.26+, openssl, curl, and jq. ```bash # Prereqs: Go 1.26+, openssl, curl, jq git clone https://github.com/agentnameservice/ans cd ans make build # builds bin/ans-ra, bin/ans-tl, bin/ans-verify, bin/ans-dns scripts/demo/start.sh # starts both daemons against ./data/demo scripts/demo/run-lifecycle.sh # registers an agent, verifies the receipt end-to-end ``` -------------------------------- ### Demo workflow commands (bash) Source: https://github.com/agentnameservice/ans/blob/main/docs/architecture/ans-finder.md Commands to build and run the demo, including starting services and running the lifecycle script. ```bash make build # five binaries into bin/ scripts/demo/start.sh # RA + TL + finder, readiness-gated scripts/demo/run-lifecycle.sh # register → … → VERIFIED → discovered scripts/demo/stop.sh ``` -------------------------------- ### Run vLEI demo with run-vlei.sh Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/vlei/README.md Bootstraps the entire demo with no manual paste. Starts ans-ra and ans-tl in verifier mode, registers an agent, builds the chain, and runs the register + verify-control flow. Re-running is safe; use --down to tear everything down after. ```bash scripts/demo/vlei/run-vlei.sh # add --down to tear everything down after ``` -------------------------------- ### Expected output: offline verify success Source: https://github.com/agentnameservice/ans/blob/main/README.md Expected output from the quickstart lifecycle script, showing the offline verification step succeeding with two keys fetched and a receipt verified. ```text ━━━ 13. Offline verify (bin/ans-verify) ━━━ ✓ Fetched 2 verification key(s) from /root-keys ✓ 1602 bytes (Content-Type: application/scitt-receipt+cose) ✓ VERIFIED (kid <8-char-hex> matched key directly) ``` -------------------------------- ### Start RA in verifier mode with env vars Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/vlei/README.md Starts the RA in verifier mode up front, avoiding the mid-run restart. Uses ANS_VLEI_TYPE and ANS_VLEI_BASE_URL environment variables; start.sh composes its config from these. ```bash ANS_VLEI_TYPE=verifier ANS_VLEI_BASE_URL=http://localhost:7676 scripts/demo/start.sh ``` -------------------------------- ### Run vLEI demo stack stages individually (bash) Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/vlei/README.md Run each stage of the vLEI demo stack in sequence: start the stack, build the chain headlessly, present and verify with auto-signing, then tear down. The AGENT_ID and DATA environment variables configure the verify-control-demo.sh script, and AUTO_SIGN=1 enables automatic signing. ```bash scripts/demo/vlei/up.sh # stack scripts/demo/vlei/build-chain.sh # headless chain build + export AGENT_ID= DATA=scripts/demo/vlei/signify/out \ AUTO_SIGN=1 scripts/demo/vlei/verify-control-demo.sh # present + verify scripts/demo/vlei/down.sh # tear down ``` -------------------------------- ### Regenerate expected-svcb.txt with demo scripts Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md Commands to regenerate testdata/expected-svcb.txt against a local stack. Requires starting the demo, registering the endpoint with the metaDataUrl and metaDataHash, driving it to PENDING_DNS via POST /v2/ans/agents/{agentId}/verify-acme, then filtering SVCB records with jq and writing to the expected file. Ends with stop.sh --clean. ```bash scripts/demo/start.sh # register the endpoint with the metaDataUrl + metaDataHash shown above # (register.sh does not send metaDataHash, so POST /v2/ans/agents directly), # then drive it to PENDING_DNS: # POST /v2/ans/agents/{agentId}/verify-acme scripts/demo/dns-records.sh --json | jq -r '.[] | select(.type=="SVCB") | .value' \ > scripts/demo/capability-descriptors/testdata/expected-svcb.txt scripts/demo/stop.sh --clean ``` -------------------------------- ### Build and run with Docker Compose Source: https://github.com/agentnameservice/ans/blob/main/README.md Builds the Docker images for the long-running daemons (RA and TL) and optionally starts the stack with Docker Compose, including healthchecks. Compose persists the ra-data, ra-keys, and tl-data volumes; use `docker compose down -v` to wipe them. The ans-verify and ans-dns binaries are not part of the compose stack. ```bash # Build images for the long-running daemons make docker-build # Or bring the stack up with compose (RA + TL, with healthchecks) docker compose up --build ``` -------------------------------- ### Architecture overview diagram Source: https://github.com/agentnameservice/ans/blob/main/docs/pr-specs/FINDER-ard-discovery-service.md ASCII diagram of the hexagonal architecture for ans-finder, showing the flow from the feed events contract through the ingestion port, pure projection, SQLite index, and ARD API handlers. The ingestion port uses feed.EventItem as its currency and polls GET /v1/agents/events. ```text feed (events contract) │ ┌─────────────▼─────────────┐ │ ingestion port │ currency: feed.EventItem │ (poll GET /v1/agents/events) └─────────────┬─────────────┘ │ ┌─────────────▼─────────────┐ │ projection (pure) │ FromEvent(item) → entries / skips └─────────────┬─────────────┘ │ ┌─────────────▼─────────────┐ │ index (finder's SQLite) │ FTS5 + facets + tombstones └─────────────┬─────────────┘ │ ┌─────────────▼─────────────┐ │ ARD API handlers │ POST /v1/search, /v1/explore └────────────────────────────┘ ``` -------------------------------- ### HTTP routes for identity endpoints Source: https://github.com/agentnameservice/ans/blob/main/docs/PLAN-verified-identities.md Lists the REST endpoints for identity management, including POST for registration and verification, PUT for rotation, POST for revocation, and GET for listing and detail. The verify-control and revoke endpoints seal events. ```http POST /v2/ans/identities 202 + challenges POST /v2/ans/identities/{identityId}/verify-control 200 VERIFIED (seals) PUT /v2/ans/identities/{identityId} 202 + fresh challenges POST /v2/ans/identities/{identityId}/revoke 200 (seals; POST, never DELETE) GET /v2/ans/identities list (mine) GET /v2/ans/identities/{identityId} detail ``` -------------------------------- ### Root-keys endpoint output format Source: https://github.com/agentnameservice/ans/blob/main/README.md Format of the sumdb-note verification key emitted by the GET /root-keys endpoint. keyhash-hex is the first 4 bytes of SHA-256(SPKI-DER) as zero-padded big-endian hex; verifiers match it against the kid in the receipt's protected header for O(1) key lookup. ```text ++ ``` -------------------------------- ### Run tests and quality gates with make Source: https://github.com/agentnameservice/ans/blob/main/README.md Run the project's test and quality gates. `make test-cover` enforces the ≥90% coverage gate, and `make check` runs fmt, vet, lint, and test-cover as the pre-commit gate. ```bash make test # unit tests make test-cover # with coverage, enforces the repo gate (≥90%) make test-race # race detector make check # fmt + vet + lint + test-cover (pre-commit gate) ``` -------------------------------- ### Set up upstream remote and track main Source: https://github.com/agentnameservice/ans/blob/main/CONTRIBUTING.md Adds the original repository as a remote named 'upstream', fetches its information, and sets the local main branch to track upstream/main. Run these commands to keep your main branch pointing at the original repository and make pull requests from branches on your fork. ```bash git remote add upstream https://github.com/agentnameservice/ans.git git fetch upstream git branch --set-upstream-to=upstream/main main ``` -------------------------------- ### Architecture diagram of cmd and internal packages Source: https://github.com/agentnameservice/ans/blob/main/README.md Shows the hexagonal architecture: the domain model has no framework or storage dependencies, services depend on port interfaces, and adapters implement them against real drivers. The diagram maps the cmd entrypoints to their services and adapters, and shows the verify and dns binaries. ```text cmd/ans-ra/main.go ───────┐ ├─► internal/ra/service ─► port.AgentStore ─► internal/adapter/store/sqlite cmd/ans-tl/main.go ───────┤ port.KeyManager ─► internal/adapter/keymanager │ port.DNSVerifier ─► internal/adapter/dns └─► internal/tl/service ─► port.RenewalStore ─► … cmd/ans-verify/main.go ─► internal/tl/receipt (Verify, ExtractKID, ComputeLeafHash) cmd/ans-dns/main.go ─► miekg/dns authoritative server + RA-driven record install/clear ``` -------------------------------- ### Run capability descriptor verification script Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md Run the verification script offline against committed fixtures, or with --live to also compose a registration for a live descriptor. No running ANS stack is required for offline mode. ```bash scripts/demo/capability-descriptors/verify.sh # offline, fixtures only scripts/demo/capability-descriptors/verify.sh \ --live https://agent.your.tld/.well-known/agent-card.json # also compose a registration # for your live descriptor ``` -------------------------------- ### PR dependency diagram Source: https://github.com/agentnameservice/ans/blob/main/docs/PLAN-verified-identities.md Shows the ordered dependency flow between PR1 through PR6, from TL ingest to ans-verify. ```text PR1 (TL ingest) ──> PR2 (TL reads/join) ──> PR3 (RA identity + did:web) ──> PR4 (RA links + views + demo) └────────────────> PR5 (did:key) ──> PR6 (ans-verify) ``` -------------------------------- ### Local DNS testing with ans-dns Source: https://github.com/agentnameservice/ans/blob/main/README.md Commands to exercise the real DNS lookup verifier locally using the bundled authoritative server. Requires switching ra-local.yaml to dns.type=lookup and re-running verify-dns; ans-dns is dev-only. ```bash # In one terminal: start the dev DNS server (serves ./data/demo/dns) bin/ans-dns serve --addr 127.0.0.1:15353 # In another: install the records the RA expects after verify-acme bin/ans-dns install --api-key http://localhost:18080 # Switch ra-local.yaml to dns.type=lookup pointed at 127.0.0.1:15353 # and re-run verify-dns; ans-tl observes the AGENT_REGISTERED event. # Tear down: bin/ans-dns clear ``` -------------------------------- ### Verify agent state with ans-verify Source: https://github.com/agentnameservice/ans/blob/main/README.md Verifies an agent's state cryptographically. The first command fetches the receipt and keys from the TL. The second is for air-gapped verification with a pinned public key and a local receipt file. ```bash ans-verify -url https://tl.example.com -agent # Or, air-gapped (receipt already on disk, key pinned in CI): ans-verify -pubkey ./trusted-tl.pub -agent \ -url file://./receipt.cbor ``` -------------------------------- ### SQL migration for identity event tables Source: https://github.com/agentnameservice/ans/blob/main/docs/PLAN-verified-identities.md Creates tl_identity_events and tl_identity_event_agents tables, including indexes for identity and agent lookups. Note the CHECK constraint on raw_event and the read-join index design. ```sql CREATE TABLE tl_identity_events ( id INTEGER PRIMARY KEY, leaf_index INTEGER NOT NULL UNIQUE, leaf_hash TEXT NOT NULL, event_hash TEXT NOT NULL UNIQUE, -- dedup key, SHA-256(JCS inner) log_id TEXT NOT NULL, identity_id TEXT NOT NULL, provider_id TEXT, kind TEXT, value TEXT, event_type TEXT NOT NULL, raw_event TEXT NOT NULL CHECK (json_valid(raw_event)), created_at_ms INTEGER NOT NULL ); CREATE INDEX idx_tl_identity_events_identity_leaf ON tl_identity_events(identity_id, leaf_index DESC); -- the read-join index: one row per (link event, named agent) — design §5.6.1 CREATE TABLE tl_identity_event_agents ( id INTEGER PRIMARY KEY, leaf_index INTEGER NOT NULL, identity_id TEXT NOT NULL, ans_id TEXT NOT NULL, event_type TEXT NOT NULL, -- IDENTITY_LINKED | IDENTITY_UNLINKED created_at_ms INTEGER NOT NULL ); CREATE INDEX idx_tl_identity_event_agents_ans ON tl_identity_event_agents(ans_id, leaf_index DESC); ``` -------------------------------- ### Identity resolver configuration Source: https://github.com/agentnameservice/ans/blob/main/docs/PLAN-verified-identities.md Configuration settings for the identity resolver, including the type (noop or web) and the challenge TTL. ```yaml identity: resolver: type: noop # noop | web (default noop — quickstart parity) challengeTTL: 1h # nonce TTL; design floor 5m for high-assurance ``` -------------------------------- ### Sign off a commit with git commit -s Source: https://github.com/agentnameservice/ans/blob/main/CONTRIBUTING.md Use this command to sign off a commit with the required Signed-off-by trailer, certifying the Developer Certificate of Origin. Every commit must carry this trailer. ```bash git commit -s ``` -------------------------------- ### Trust model diagram (Mermaid flowchart) Source: https://github.com/agentnameservice/ans/blob/main/docs/architecture/ans-finder.md Mermaid flowchart illustrating the trust model, separating finder-asserted data from client-verifiable data against the transparency log. ```mermaid flowchart LR subgraph asserted["Finder-asserted (trust the operator + TLS)"] A1["search ranking (score)"] A2["entry content (display, capabilities)"] A3["lifecycle state shown (tombstones hidden)"] A4["freshness (staleSince)"] end subgraph provable["Client-verifiable against the TL (no finder trust)"] B1["agent is registered in the log
(receipt = inclusion proof of the
latest sealed event)"] B2["event content
(badge envelope field-compare,
metadata.logId pins which event)"] B3["current status incl. revocation
(signed status token, 1h validity)"] end asserted -->|"trustManifest.attestations[].uri"| provable ``` -------------------------------- ### Comment on Protocol enum in generate.go Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md States that the Protocol enum is A2A/MCP/HTTP-API and there is no PAYMENT, clarifying the deliberate transport-only boundary. ```go // The protocol enum is A2A/MCP/HTTP-API; // there is no PAYMENT. ``` -------------------------------- ### DIDResolver interface definition Source: https://github.com/agentnameservice/ans/blob/main/docs/PLAN-verified-identities.md The DIDResolver interface provides a uniform port for both noop and web adapters, allowing the service to resolve DID documents with optional key hints. ```go // internal/port/didresolver.go type DIDResolver interface { // Resolve returns the DID document for did. Hints carry the // kid → public-JWK pairs the caller extracted from the submitted // proofs' protected headers; the web resolver ignores them // (authoritative fetch), the noop resolver synthesizes a document // from them so local flows run with zero hosting. Resolve(ctx context.Context, did string, hints []KeyHint) (*DIDDocument, error) } type KeyHint struct { Kid string PublicKeyJWK json.RawMessage // from the proof's `jwk` protected header } type DIDDocument struct { ID string AssertionMethod []VerificationMethod } type VerificationMethod struct { ID string Controller string Type string PublicKeyJwk json.RawMessage PublicKeyMultibase string } ``` -------------------------------- ### Re-register root of trust by hand (curl) Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/vlei/README.md Manually re-register the root of trust with the verifier after a restart, since the verifier's DB is in-container and ephemeral. Replace {gleifRootAID} with the root AID and provide the Gleif KEL/CESR and OOBI URL in the JSON body. ```bash curl -X POST http://localhost:7676/root_of_trust/{gleifRootAID} \ -H 'Content-Type: application/json' \ -d '{"vlei":"","oobi":""}' ``` -------------------------------- ### ANS_DNSAID emitted SVCB row Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md Verbatim SVCB row emitted by the ANS_DNSAID discovery profile for the registration, captured from scripts/demo/dns-records.sh --json and committed as testdata/expected-svcb.txt. The row includes ServiceMode '1 .' at the agent FQDN and SvcParams alpn, port, key65400 (cap), key65401 (cap-sha256), key65402 (bap), and key65409 (well-known). ```text 1 . alpn=a2a port=443 key65400=https://agent.example.com/.well-known/agent-card.json key65401=2DhqFScgsLnh3QWmRWqBLYZNa4WsoqWk0d7P_FDYrYg key65402=a2a key65409=agent-card.json ``` -------------------------------- ### Fixture SHA-256 digest Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md SHA-256 digest of the committed fixture used by verify.sh to assert the fixture's integrity offline and deterministically. ```text d8386a152720b0b9e1dd05a6456a812d864d6b85aca2a5a4d1decffc50d8ad88 ``` -------------------------------- ### A2A agent-card registration body Source: https://github.com/agentnameservice/ans/blob/main/scripts/demo/capability-descriptors/README.md Registration body printed by verify.sh for the committed fixture testdata/agent-card.json. Uses capital-D metaDataUrl and metaDataHash keys matching scripts/demo/register.sh. The descriptor URL is on the same origin as the agent, keeping the endpoint catalog-eligible. ```json { "agentHost": "agent.example.com", "discoveryProfiles": ["ANS_DNSAID"], "endpoints": [ { "protocol": "A2A", "agentUrl": "https://agent.example.com/a2a/v1", "metaDataUrl": "https://agent.example.com/.well-known/agent-card.json", "metaDataHash": "SHA256:d8386a152720b0b9e1dd05a6456a812d864d6b85aca2a5a4d1decffc50d8ad88", "transports": ["JSON_RPC"] } ] } ``` -------------------------------- ### Event envelope JSON structure Source: https://github.com/agentnameservice/ans/blob/main/README.md The event envelope signed on the RA side. It contains a payload with the producer event, keyId, and a detached JWS signature, plus a schemaVersion, a TL attestation JWS, and a status. ```json { "payload": { "logId": "", "producer": { "event": { "ansId": "...", "ansName": "ans://...", "eventType": "AGENT_REGISTRATION", ... }, "keyId": "ans-ra-signer", "signature": "" } }, "schemaVersion": "V1", "signature": "", "status": "ACTIVE" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.