demo: compose capability descriptors via metaDataUrl + ANS_DNSAID - #98
demo: compose capability descriptors via metaDataUrl + ANS_DNSAID#98sparkmastergrape wants to merge 2 commits into
Conversation
Fixes agentnameservice#95 Signed-off-by: J. DiMare <jdimare@pm.me>
csnitker-godaddy
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround, and incorporating the feedback from the issue. Verified the hashes and the recorded row, it all lines up. Left a few inline asks. One naming thought, your call: capability-descriptors might age better than payable-endpoints as the directory name.
Kicking off CI now.
|
|
||
| FIXTURE="$SCRIPT_DIR/testdata/agent-card.json" | ||
| EXPECTED_SVCB="$SCRIPT_DIR/testdata/expected-svcb.txt" | ||
| AGENT_HOST="api.dnsofmoney.com" |
There was a problem hiding this comment.
This hardcodes your production host, and the fixture looks like a snapshot of your real card (--live is already reporting different bytes today). Live modes are a feature here, but the other demos take the host from the runner, register.sh honors AGENT_HOST and defaults to a random example.com name. Would you be open to a neutral fixture, with --live taking the descriptor URL as an argument?
There was a problem hiding this comment.
Done in 93df02e — the fixture is now a neutral card for agent.example.com (nothing serves it, so the offline assertion can't drift), and --live takes the descriptor URL as an argument: it fetches your card and prints its pin, cap-sha256, and the registration body you'd POST. expected-svcb.txt was re-recorded against a fresh ans-ra run with the new card's pin, same recipe as the README's reproduction section.
| command -v "$1" >/dev/null 2>&1 || fail "missing required command: $1" | ||
| } | ||
|
|
||
| require_cmd sha256sum |
There was a problem hiding this comment.
sha256sum isn't on stock macOS, so this dies at the dependency check there. Can you add a shasum -a 256 fallback?
There was a problem hiding this comment.
Added — sha256_file() prefers sha256sum and falls back to shasum -a 256, with a clear failure if neither exists.
| scripts/demo/stop.sh --clean | ||
| ``` | ||
|
|
||
| Recorded against `upstream/main` at `d8ed4bb` on 2026-08-01. |
There was a problem hiding this comment.
I'd drop this line, git history already carries the provenance and it goes stale on the first re-record.
- Replace the production-host snapshot with a neutral fixture card for agent.example.com; expected-svcb.txt re-recorded against a fresh ans-ra run with the new card's pin (same recipe as the README's reproduction section). - --live now takes the descriptor URL as an argument and composes a registration for it (pin + cap-sha256 + body), instead of comparing the network against a fixture it can no longer match. - sha256sum falls back to shasum -a 256 for stock macOS. - Drop the recorded-against provenance line; git history carries it. - Rename payable-endpoints/ -> capability-descriptors/ per review. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: J. DiMare <jdimare@pm.me>
|
All four addressed in 93df02e:
Took the |
Adds a small runnable demo showing that an ANS-registered agent can advertise arbitrary capabilities through the existing
AgentEndpoint.metaDataUrl, pinned withmetaDataHashand published as acaplocator byANS_DNSAID. Zero code, schema, or wire changes.Fixes #95
Addresses both points from the issue discussion
Runnable demo with a committed fixture, not a docs file —
scripts/demo/payable-endpoints/, with the example card committed astestdata/agent-card.json. As you noted, a hash printed against a live card breaks as soon as that card changes, and drift is indistinguishable from a legitimate new version. The demo asserts against the fixture, so the worked example stays verifiable over time;--livefetches the real descriptor and reports a mismatch without failing, with that ambiguity spelled out as the teaching point.Protocol-neutral framing — the README leads on
metaDataUrlcomposing capability descriptors generally. x402 appears only as the worked example, called out as the case people most often assume needs new protocol machinery.The expected SVCB row is recorded output, not a derivation
testdata/expected-svcb.txtwas captured by runningscripts/demo/start.shagainstmainatd8ed4bb, registering the endpoint, driving it toPENDING_DNS, and takingdns-records.sh --jsonverbatim:verify.shderivescap-sha256from the fixture and asserts it against that row, so if the emit path ininternal/adapter/discovery/ans/dnsaid.gochanges shape the demo fails rather than agreeing with its own arithmetic. Reproduction steps are in the README.Note that
register.shdoes not sendmetaDataHash, so the fixture was produced by POSTing/v2/ans/agentsdirectly.Run it
No running stack required — it asserts against the committed fixtures.
Per the
pay.agentsquestion — agreed, keeping that out of scope for its own discussion.AI assistance:
Assisted-by: Claude Code (claude-opus-5)