feat(delegation-diagram): an exemplar, and reach that keeps attenuation

The exemplar draws a toybox host endowing a guest's ERTP definition
with a narrowed WebApp and a rholo signer. Drawing it showed that reach
computed over every dashed line erases attenuation: Mallory, with a
leaked guest link, "reached" the WebApp maker and the key store. Grants
now say what they act on (followed), what they were narrowed from (not
followed), and what they use without handing out (not followed, but its
revocation disables them).

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-11-27 13:52:46 -06:00
1 parent c2a6fcdd63
commit 5294138a48
2 files changed
+270 -1

No files matched your search

+9 -1
View File
@@ -8,6 +8,8 @@ description: >-
A wiring diagram shows who holds what now. It doesn't say how they got it, so it can't answer the questions a review of delegation asks: **where did this authority come from, what does it reach, and what goes when it's revoked?** Keyhive's certflow diagrams answer them by drawing the grant itself as a thing, with two kinds of line.
Exemplar: [`example-ertp-endowment.html`](example-ertp-endowment.html), next to this file: a toybox host endowing a guest's ERTP definition with a narrowed WebApp and a rholo signer. Start from it: the scene is data (`parties`, `subjects`, `grants`), and drawing, reach, revocation, the step-through, and the deep links all derive from that data.
## Two kinds of line
- Parties are balls. Each grant is a box labelled with the access it gives over its subject: `read: doc`, `relay: inbox`, `deposit: purse`.
@@ -30,7 +32,13 @@ As in wiring-diagram, every line cites the code (`file:line`). If you can't cite
## Reach is computed, not drawn
Keep the scene as data (parties, grants with `granter`, `grantee`, `subject`, `access`, and revocations) and draw it from that data. A party's reach is the closure over what it holds and what those grants lead to. Compute it; never mark it by hand. Then the page can't claim a reach the data doesn't support.
Keep the scene as data (parties, subjects, and grants with who made each, who holds it, and its access) and draw it from that data. Compute reach; never mark it by hand. Then the page can't claim a reach the data doesn't support. Give each grant three kinds of source, all drawn dashed, which reach treats differently:
- `over`: what it acts on, narrowed. Reach follows it: holding `testnet` reaches the node, through its `/api/v1/`.
- `from`: the wider grant it was narrowed from. Reach doesn't follow it: holding `testnet` doesn't reach `webApps`. Following it would erase the attenuation the diagram exists to show.
- `uses`: what it holds and never hands out, such as a signer's read-only facet of the key store. Reach doesn't follow it, but revoking it disables the grant that uses it.
Reach is still an upper bound: it assumes each object passes on all it's `over`. Say so where it matters.
- **Hover a party to trace its reach:** highlight what it reaches and fade the rest. Hover Mallory, who holds whatever is most likely to leak, and her caption should match what lights up.
- **Revoke on click:** a revocation is a diamond held by the revoker, with a solid red line that ends in ✕ instead of an arrowhead, and red dashes back to where the revoker's authority comes from. Recompute reach. What depended on the revoked grant fades, unless another route still backs it. Fading, rather than deleting, keeps the change visible.