Skip to content

docs: add layered architecture diagrams - #163

Open
kperry-godaddy wants to merge 3 commits into
mainfrom
claude/arch-diagram
Open

kperry-godaddy wants to merge 3 commits into
mainfrom
claude/arch-diagram

Conversation

@kperry-godaddy

@kperry-godaddy kperry-godaddy commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Summary

Layered architecture diagrams for the README and docs/architecture/.

An earlier revision of this PR added one dense topology diagram. It showed every route, adapter and store at once and was hard to read at README width. This revision replaces it with eight diagrams meant to be read in order:

  • Overview: the components and who talks to whom, with the lifecycle numbered from registering an agent to calling it.
  • One diagram per component: Registration Authority, Transparency Log, ARD Discovery, Agent Trust Discovery, Verifier.
  • Two sequences: registering an agent, and finding and trusting one.

docs/architecture/README.md indexes the set and explains each diagram. The project README embeds the overview in place of the ASCII sketch and links to that index.

Notes for reviewers

  • The diagrams describe roles, not a deployment. None of them names a storage engine, key store or adapter; the README's "Pluggable architecture" table still covers those.
  • ARD Discovery and Agent Trust Discovery are drawn as services that build on ANS public records without special access. A client can search either one for an agent, and Agent Trust Discovery adds trust scores. Agent Trust Discovery lives in agentnameservice/agent-trust-discovery.
  • The README no longer links docs/architecture/ans-finder.md. The file itself is unchanged.
  • All eight diagrams are pages of docs/architecture/architecture.drawio. Each SVG is the export of one page, and the index documents the export loop. Labels are plain <text> nodes (no foreignObject), so GitHub renders them as-is. When editing in the draw.io GUI keep Word Wrap off, or the next export regresses to foreignObject.
  • No raster images are committed; the SVGs total about 120 KB.

Assisted by Claude Code (Claude Fable 5.2)

Add a partner-facing system topology diagram of the ANS reference
implementation as an editable draw.io file with an SVG export, and
embed the SVG in the README's Architecture section in place of the
ASCII sketch.

The diagram groups components by trust boundary (agent owner, ANS
operator, verifiers/consumers), shows the three daemons with their
ports, routes, default adapters and stores, sets the dev-only tooling
apart, and numbers the edges to tell the register -> seal -> discover
-> verify lifecycle on one page. Labels are plain SVG text (no
foreignObject) so GitHub renders the SVG as-is; keep word wrap off
when editing in the draw.io GUI or the export regresses.

Re-export after editing the .drawio:

  drawio -x -f svg --embed-diagram --embed-svg-fonts false --theme light --border 8 \
    -o docs/architecture/reference-implementation.svg \
    docs/architecture/reference-implementation.drawio

A raster copy for slides is one more command (-f png --scale 2); it is
not committed because it exceeds the repository's 500 KB added-file
limit.

Signed-off-by: kperry <kperry@godaddy.com>
@kperry-godaddy kperry-godaddy changed the title docs: architecture diagram and quickstart demo recording in README docs: add reference implementation architecture diagram Nov 20, 2026
@kperry-godaddy
kperry-godaddy marked this pull request as ready for review November 20, 2026 06:12
@kperry-godaddy
kperry-godaddy requested review from a team as code owners November 20, 2026 06:12
Copilot AI balanced review requested due to automatic review settings November 20, 2026 06:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The diagram misidentifies the leaf-hash input, which could cause inclusion-proof verification failures, and the README inaccurately claims exclusive verification dependencies.

2 open issues
What changed in this PR

Adds a partner-facing architecture diagram showing how ANS components work together, replacing the README’s ASCII sketch. This is a documentation-only change.

Changes:

  • Maps trust boundaries, services, APIs, adapters, and storage.
  • Illustrates the register → seal → discover → verify lifecycle and separates development tooling.
  • Provides editable draw.io source and an SVG export embedded in the README.
File Description
README.md Embeds the diagram and updates the architecture description.
docs/​architecture/​reference-implementation.svg Provides the rendered topology and lifecycle diagram.
docs/​architecture/​reference-implementation.drawio Provides the editable diagram source.

Review effort: Balanced

Comment thread README.md Outdated
Comment on lines +126 to +128
key-manager, DNS, and certificate adapters; `cmd/ans-verify` depends
only on `internal/tl/receipt`; `cmd/ans-dns` is a miekg/dns
authoritative server with RA-driven record `install` / `clear`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 50f8c89. The sentence now says ans-verify verifies receipts through internal/tl/receipt and checkpoints through internal/lognote, with no dependency on the TL's storage or service layer, which is the boundary that matters for an offline verifier. go list -deps ./cmd/ans-verify confirms the internal set is domain, port, crypto, lognote, and tl/receipt.

<mxCell id="tl_key" value="One ECDSA P-256 signing key" style="rounded=1;absoluteArcSize=1;arcSize=10;html=0;fontFamily=Helvetica, Arial, sans-serif;arcSize=8;align=left;verticalAlign=top;spacingLeft=8;spacingTop=3;fontSize=12;fontStyle=1;fontColor=#1A1A1A;fillColor=#F8FAFD;strokeColor=#9AA7B8;" vertex="1" parent="tl"><mxGeometry x="12" y="226" width="314" height="80" as="geometry"/></mxCell>
<mxCell id="tl_key_t" value="signs checkpoints, attestations, receipts,&#xa;status tokens; /root-keys advertises exactly&#xa;one verification line" style="text;html=0;strokeColor=none;fillColor=none;align=left;verticalAlign=top;fontSize=12;fontColor=#1A1A1A;spacingLeft=8;spacingTop=0;fontFamily=Helvetica, Arial, sans-serif;" vertex="1" parent="tl_key"><mxGeometry x="0" y="22" width="314" height="56" as="geometry"/></mxCell>
<mxCell id="tl_ing" value="Authenticated ingest (producer keys)" style="rounded=1;absoluteArcSize=1;arcSize=10;html=0;fontFamily=Helvetica, Arial, sans-serif;arcSize=8;align=left;verticalAlign=top;spacingLeft=8;spacingTop=3;fontSize=12;fontStyle=1;fontColor=#1A1A1A;fillColor=#F8FAFD;strokeColor=#9AA7B8;" vertex="1" parent="tl"><mxGeometry x="12" y="318" width="314" height="122" as="geometry"/></mxCell>
<mxCell id="tl_ing_t" value="POST /v1/internal/agents/event&#xa;POST /v2/internal/agents/event&#xa;POST /v1/internal/identities/event&#xa;body: JCS-canonical event · X-Signature: detached&#xa;ES256 JWS → leaf = SHA-256(0x00 ‖ event) → logId" style="text;html=0;strokeColor=none;fillColor=none;align=left;verticalAlign=top;fontSize=12;fontColor=#1A1A1A;spacingLeft=8;spacingTop=0;fontFamily=Helvetica, Arial, sans-serif;" vertex="1" parent="tl_ing"><mxGeometry x="0" y="22" width="314" height="98" as="geometry"/></mxCell>

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 50f8c89. The label now separates the request body from the leaf input: body: JCS-canonical producer event · X-Signature: detached ES256 JWS → TL wraps + signs it → logId and leaf = SHA-256(0x00 ‖ JCS(signed envelope)), matching Envelope.LeafBytes / LeafHash in internal/tl/event/event.go. SVG regenerated from the updated source.

The ingest label said the leaf is SHA-256(0x00 || event), which reads
as the producer-event request body. The TL hashes the JCS-canonical
signed envelope it builds around that body (event.Envelope.LeafBytes),
and the receipt payload carries those same envelope bytes, so the
label now distinguishes the body the RA posts from the envelope bytes
the leaf and receipt are computed over.

The README claimed ans-verify depends only on internal/tl/receipt. It
also uses internal/lognote to verify checkpoints in the list subcommand
and internal/domain to parse ANS names, so the sentence now names the
receipt and checkpoint verification paths and states the real boundary:
no dependency on the TL's storage or service layer.

Signed-off-by: kperry <kperry@godaddy.com>
The one-page topology diagram showed every route, adapter and store at
once and was too dense to read at README width. Replace it with eight
diagrams meant to be read in order:

- an overview of the components and who talks to whom
- one diagram per component: Registration Authority, Transparency Log,
  ARD Discovery, Agent Trust Discovery, Verifier
- two sequences: registering an agent, and finding and trusting one

The diagrams describe roles rather than a deployment, so none of them
names a storage engine, key store or adapter. ARD Discovery and Agent
Trust Discovery are drawn as services that build on ANS public records
without special access. A client can search either one for an agent,
and Agent Trust Discovery adds trust scores.

docs/architecture/README.md indexes the set and explains each diagram.
The project README now embeds the overview and links to that index.

All eight diagrams are pages of docs/architecture/architecture.drawio.
The SVGs are per-page exports, and the index documents the export loop.
Labels are exported as plain SVG text with no foreignObject, which
GitHub does not render.

Signed-off-by: kperry <kperry@godaddy.com>
@kperry-godaddy kperry-godaddy changed the title docs: add reference implementation architecture diagram docs: add layered architecture diagrams Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants