feat(delegation-diagram): where authority came from, after Keyhive's certflow diagrams

wiring-diagram shows who holds what now, and a sequence diagram shows
message order; neither shows where a party's authority came from, or
what a revocation takes with it. Ink & Switch's Keyhive notebook 07
(Certflow Diagrams, 2026-10-31) draws grants as boxes, solid lines for
who delegated to whom and dashed lines for provenance, and makes the
diagrams live: hover traces reach, click revokes. This adapts it to
live references as well as certificates, and has the page compute
reach from its data rather than mark it by hand.

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

No files matched your search

+4
View File
@@ -72,6 +72,10 @@ Code](https://code.claude.com/docs/en/skills) and
TODO: consider copying or adapting its companion for message order,
sequence-diagram-actor-sim (agoric-sdk `.agents/skills/` on branch
`connolly/ago-1299-agentic-planning-tdd`).
- [delegation-diagram](delegation-diagram/SKILL.md) — where authority
came from, after Keyhive's certflow diagrams: solid lines for who
delegated, dashed for provenance; reach computed, traced on hover,
and faded on revoke.
- [obsidian-markdown](obsidian-markdown/SKILL.md) — the workspace is
an Obsidian vault: one line per paragraph, relative links, no file
symlinks you expect Obsidian to show.
+59
View File
@@ -0,0 +1,59 @@
---
name: delegation-diagram
description: >-
Delegation diagram, after Keyhive's certflow diagrams: where each party's authority came from, what it reaches, and what a revocation takes with it — use when asked for a certflow or delegation diagram; when a design delegates or attenuates authority through chains (facets of facets, caretakers, invitations, certificate capabilities, UCANs); when someone asks "who can reach what?", "where did Bob get that?", or "what breaks if we revoke this?"; when an interactive page should trace reach on hover or revoke on click. Not for a snapshot of who holds what (that's wiring-diagram), nor for the order of messages (sequence-diagram-actor-sim).
---
# Delegation diagram
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.
## 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`.
- **Solid lines say who delegated to whom:** granter → grant → grantee.
- **Dashed lines say where the authority comes from:** subject → grant → grant, down the chain, skipping the parties in between. A grant made from another grant has a dashed line from it; follow the dashes up and you reach the subject.
Keeping the two apart is the point: a party can pass along a grant it holds, but the dashes show it can't widen it. A grant whose dashed line doesn't lead to its subject is either a bug in the design or a bug in the drawing.
Dashed means provenance here. In a wiring diagram it means a weak reference, so don't mix the two notations in one picture.
## Live references, not only certificates
Certflow is for certificate capabilities: signed delegations that hold up while the issuer is offline. In an ocap system, the same picture works for live references:
- A grant is an attenuating object: a facet, a caretaker's forwarder, a store's `readOnly()`, a definition's endowment.
- To delegate is to send that object in a message, and the solid line cites the call that sent it.
- The dashed line is what the object forwards to or closes over, and it cites the maker that built it.
As in wiring-diagram, every line cites the code (`file:line`). If you can't cite where a grant came from, it gets no line.
## 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.
- **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.
- **Build in sequence:** a snapshot can't show order, so step through the grants one at a time, as wiring-diagram's step-through does: Prev/Next, arrow keys, and `#sN` deep links.
- Also take `#reach=bob` and `#revoke=g3` in the URL, so a link, or a headless screenshot, shows a highlighted state without a mouse.
## Works in one colour
Every distinction is carried by shape and line style: ball versus box, solid versus dashed, arrowhead versus ✕, diamond. Colour may reinforce them but never carry them alone. The page should still read printed in black, and to someone who can't tell red from green.
## Render and check
Render with headless Chromium, as in wiring-diagram, once plain, then once per interesting `#reach=` and `#revoke=` state. Look at each screenshot. Check that:
- each solid line cites a call, and each dashed line cites a maker;
- the dashes from every grant lead to its subject;
- each party's computed reach is what its job needs, and Mallory's caption matches hers;
- revoking each grant fades exactly what the design says it should;
- `<desc>` tells the same story in prose: who delegated what to whom, and from what.
## Sources
- [07 · Certflow Diagrams](https://www.inkandswitch.com/keyhive/notebook/07/) (Ink & Switch, Keyhive lab notebook, 2026-10-31): the notation, and hover, click-to-revoke, and drag-to-delegate on live diagrams.
- [Keyhive notebook 01](https://www.inkandswitch.com/keyhive/notebook/01/): the Granovetter diagram that certflow adapts.
- [wiring-diagram](../wiring-diagram/SKILL.md): the snapshot companion, with the drawing helpers and the headless render recipe.
- [caretaker](../caretaker/SKILL.md): revocable access as a forwarder plus a revoker, the usual live-reference grant.