Compare commits

..
4 Commits
Author SHA1 Message Date
dckc cde1632421 feat(ibis-design): emoji style for markdown, so sources link inline
Generated-by: Claude Opus 5.5
2026-11-27 13:52:46 -06:00
dckc 5294138a48 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
2026-11-27 13:52:46 -06:00
dckc c2a6fcdd63 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
2026-11-27 13:52:46 -06:00
dckc bb9265c90f feat(rholo-node-cloudflare): a rholo testnet node on Cloudflare, and the rights to ask for
A Container takes no inbound TCP from the Internet and has at most 20 GB
of ephemeral disk, while a rholo node needs inbound 40400/40404 from
every peer and 100+ GB NVMe. So the skill steers to an observer seeded
from a synced data directory, as an experiment, or a Worker-only
watcher, and lists the narrow rights an agent asks its host for, by
toybox define or by hand.

Generated-by: Claude Opus 5.5
2026-11-27 13:52:46 -06:00
5 changed files with 417 additions and 9 deletions

No files matched your search

+7
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, TODO: consider copying or adapting its companion for message order,
sequence-diagram-actor-sim (agoric-sdk `.agents/skills/` on branch sequence-diagram-actor-sim (agoric-sdk `.agents/skills/` on branch
`connolly/ago-1299-agentic-planning-tdd`). `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 - [obsidian-markdown](obsidian-markdown/SKILL.md) — the workspace is
an Obsidian vault: one line per paragraph, relative links, no file an Obsidian vault: one line per paragraph, relative links, no file
symlinks you expect Obsidian to show. symlinks you expect Obsidian to show.
@@ -90,6 +94,9 @@ Code](https://code.claude.com/docs/en/skills) and
a throwaway systemd user unit that can't see `~/.ssh` and friends. a throwaway systemd user unit that can't see `~/.ssh` and friends.
- [what-was-i-doing](what-was-i-doing/SKILL.md) — where did this file - [what-was-i-doing](what-was-i-doing/SKILL.md) — where did this file
come from? Correlate mtimes with git history across every repo. come from? Correlate mtimes with git history across every repo.
- [rholo-node-cloudflare](rholo-node-cloudflare/SKILL.md) — a rholo
testnet node on Cloudflare: an observer as an experiment, not a
validator; ask for each right narrowly, by `define` or by hand.
- [notify-me](notify-me/SKILL.md) — desktop notification at the end - [notify-me](notify-me/SKILL.md) — desktop notification at the end
of a long turn, sticky if I'm stepping away; not every reply. of a long turn, sticky if I'm stepping away; not every reply.
+67
View File
@@ -0,0 +1,67 @@
---
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.
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`.
- **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, 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.
- **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.
@@ -0,0 +1,261 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ERTP endowment delegation</title>
<style>
:root { --ink: #1d2430; --faint: #6b7280; --bg: #ffffff; --box: #f3f4f6; --ball: #dbeafe; --ext: #e5e7eb; --hot: #c2410c; --red: #b91c1c; }
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) { --ink: #e5e7eb; --faint: #9ca3af; --bg: #111827; --box: #1f2937; --ball: #1e3a5f; --ext: #374151; --hot: #fb923c; --red: #f87171; }
}
body { margin: 0; padding: 16px; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, sans-serif; }
main { max-width: 1040px; margin: 0 auto; }
h1 { font-size: 1.25em; margin: 0 0 .3em; }
p { margin: .4em 0; max-width: 70em; }
svg { width: 100%; height: auto; display: block; }
svg text { fill: var(--ink); font: 13px system-ui, sans-serif; }
svg .small { font-size: 11px; fill: var(--faint); }
.node, .edge { transition: opacity .2s; }
.dim { opacity: .15; }
.gone { opacity: .25; }
.hot rect, .hot circle { stroke: var(--hot); stroke-width: 3; }
.grant { cursor: pointer; }
.party { cursor: default; }
#controls { display: flex; gap: .5em; align-items: center; flex-wrap: wrap; margin: .5em 0; }
#step { min-width: 12em; }
code { font-size: .92em; }
@media (prefers-reduced-motion: reduce) { .node, .edge { transition: none; } }
</style>
</head>
<body>
<main>
<h1>Where the ERTP vat's authority comes from</h1>
<p>A guest (Claude) proposes a definition; the host (Dan) endows it with a <code>testnet</code> WebApp and a rholo deploy <code>signer</code>, then hands the vat's root to the guest. <b>Solid</b> lines: who delegated to whom. <b>Dashed</b>: what each grant acts on, or was narrowed from. Reach follows what a grant acts on, never the wider grant it was narrowed from. <b>Hover</b> a party to trace its reach; <b>click</b> a grant to see what revoking it takes with it; click again to restore.</p>
<div id="controls">
<button id="prev" type="button">◀ Prev</button>
<button id="next" type="button">Next ▶</button>
<input id="slider" type="range" min="0" value="0" aria-label="step">
<span id="step"></span>
</div>
<svg id="pic" viewBox="0 0 1030 600" role="img" aria-labelledby="t d">
<title id="t">ERTP endowment delegation</title>
<desc id="d"></desc>
<defs>
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="context-stroke"/></marker>
</defs>
<g id="edges"></g>
<g id="nodes"></g>
</svg>
<p id="caption"></p>
<p class="small" id="cite"></p>
<p style="color: var(--faint)">Lines cite <code>packages/toybox</code> on vattr97 branch <code>toybox-rholo</code>, and the definition's own <code>main.js</code>. Only removing the key from the store is a revocation the code has today; clicking the other grants asks "what if?". Notation after Ink &amp; Switch's <a href="https://www.inkandswitch.com/keyhive/notebook/07/">Certflow Diagrams</a>.</p>
</main>
<script>
'use strict';
// The scene, as data: draw it and compute reach from it, never by hand.
const parties = {
kernel: { x: 120, y: 70, label: 'kernel', note: 'boot vat' },
dan: { x: 540, y: 70, label: 'Dan', note: 'owner host' },
claude: { x: 790, y: 70, label: 'Claude', note: 'guest' },
mallory: { x: 950, y: 70, label: 'Mallory', note: 'has a leaked link' },
vat: { x: 520, y: 290, label: 'ERTP vat', note: 'the endowed definition' },
};
// subjects: what the grants finally act on
const subjects = {
fetch: { x: 80, y: 540, label: 'fetch: any URL' },
node: { x: 240, y: 540, label: 'rholo testnet node', ext: true },
device: { x: 420, y: 540, label: 'secp256k1 signing' },
keystore: { x: 630, y: 540, label: 'Dan\'s key store' },
};
// `over`: what a grant acts on, narrowed; reach follows it.
// `from`: the grant it was narrowed from; reach doesn't follow that.
// `uses`: what it holds and never hands out; reach doesn't follow that either.
const grants = {
webApps: { x: 80, y: 190, access: 'make WebApps', by: 'kernel', to: 'dan', over: ['fetch'], from: [], cite: 'examples/wallet/boot.js:112 (owner starters)' },
rholoSigners: { x: 290, y: 190, access: 'make rholo signers', by: 'kernel', to: 'dan', over: ['device'], from: [], cite: 'examples/wallet/boot.js:112; src/devices/rholo.js:216' },
testnet: { x: 200, y: 370, access: 'HTTP: testnet /api/v1/ only', by: 'dan', to: 'vat', over: ['node'], from: ['webApps'], cite: 'examples/webapp.js:93 (makeWebApp); examples/wallet/gateway/agents.exo.js:368 (endow)' },
readOnly: { x: 780, y: 430, access: 'read: key store', by: 'dan', to: null, over: ['keystore'], from: [], cite: 'examples/store-maker.js (readOnly facet)' },
signer: { x: 420, y: 430, access: 'sign: /testnet, phlo ≤ 2M', by: 'dan', to: 'vat', over: ['device'], uses: ['readOnly'], from: ['rholoSigners'], cite: 'src/devices/rholo.js:216 (make), :263 (sign)' },
root: { x: 800, y: 300, access: 'call: alicePaysBob, faucet', by: 'dan', to: 'guestLink', over: ['vat'], from: [], cite: 'rho-ertp main.js:61 (the root closes over testnet and signer)' },
guestLink: { x: 870, y: 190, access: 'act as guest "claude"', by: 'dan', to: 'claude', over: [], from: [], cite: 'examples/wallet/gateway/page.js (invite link, a webkey)' },
};
// who holds what outright, besides grants delegated to them
const keeps = [['dan', 'keystore'], ['mallory', 'guestLink']];
// a revocation the code supports: the keeper deletes privateKey
const revocable = { readOnly: 'Dan deletes privateKey from the store: the signer can no longer sign' };
// the build order, one delegation per step
const steps = [
['webApps', 'The kernel\'s boot vat gives the owner host a WebApp maker, over fetch.'],
['rholoSigners', 'It also gives the owner a rholo signer maker, over the signing device.'],
['testnet', 'Dan narrows the WebApp maker to the testnet node\'s /api/v1/, and endows the vat with it.'],
['readOnly', 'Dan passes a read-only facet of his key store to the signer maker. The signer reads the key with it at each signature and never hands it out; Dan keeps the store.'],
['signer', 'The signer: one shard, a phlo cap, the key read at each signature. Dan endows the vat with it.'],
['root', 'The vat\'s root closes over testnet and signer, and answers only alicePaysBob, faucet, tryNonNat; endow saves it in Dan\'s names.'],
['guestLink', 'Dan\'s guest link gives Claude the guest agent, whose names hold the root. Mallory got a copy.'],
];
const NS = 'http://www.w3.org/2000/svg';
const mk = (tag, attrs = {}, parent) => {
const e = document.createElementNS(NS, tag);
for (const [k, v] of Object.entries(attrs)) e.setAttribute(k, v);
if (parent) parent.append(e);
return e;
};
const pos = id => parties[id] || subjects[id] || grants[id];
const W = 150, H = 46;
// what `id` reaches: what it holds, and what each of those is made from
const reachOf = (id, revoked) => {
const held = new Map();
const add = (a, b) => { if (!held.has(a)) held.set(a, []); held.get(a).push(b); };
for (const [g, d] of Object.entries(grants)) {
if (revoked.has(g)) continue;
if (d.to) add(d.to, g);
for (const o of d.over) if (!revoked.has(o)) add(g, o);
}
for (const [a, b] of keeps) add(a, b);
const seen = new Set([id]);
const todo = [id];
while (todo.length) for (const n of held.get(todo.pop()) || []) if (!seen.has(n)) { seen.add(n); todo.push(n); }
return seen;
};
// an edge from a's box or ball to b's, trimmed at the shapes' edges
const anchor = (p, toward) => {
const dx = toward.x - p.x, dy = toward.y - p.y, len = Math.hypot(dx, dy) || 1;
if (parties[p.id]) return { x: p.x + dx / len * 34, y: p.y + dy / len * 34 };
const t = Math.min((W / 2 + 4) / Math.abs(dx || 1e-9), (H / 2 + 4) / Math.abs(dy || 1e-9));
return { x: p.x + dx * t, y: p.y + dy * t };
};
for (const [id, p] of Object.entries({ ...parties, ...subjects, ...grants })) p.id = id;
const edges = [];
const line = (a, b, kind) => {
const A = anchor(pos(a), pos(b)), B = anchor(pos(b), pos(a));
const g = mk('g', { class: 'edge' }, document.getElementById('edges'));
const l = mk('line', { x1: A.x, y1: A.y, x2: B.x, y2: B.y, stroke: 'currentColor', 'stroke-width': kind === 'from' ? 1.5 : 2, 'stroke-dasharray': kind === 'from' ? '6 5' : 'none', 'marker-end': 'url(#arrow)' }, g);
g.style.color = 'var(--ink)';
const x = mk('text', { x: (A.x + B.x) / 2, y: (A.y + B.y) / 2 + 5, 'text-anchor': 'middle', 'font-size': 18, visibility: 'hidden' }, g);
x.textContent = '✕';
edges.push({ a, b, kind, g, l, x });
};
for (const [g, d] of Object.entries(grants)) {
line(d.by, g, 'by');
if (d.to) line(g, d.to, 'to');
for (const o of d.over) line(o, g, 'from');
for (const f of d.from) line(f, g, 'from');
for (const u of d.uses || []) line(u, g, 'from');
}
for (const [a, b] of keeps) line(a, b, 'keep');
const nodes = {};
const nodesG = document.getElementById('nodes');
for (const [id, p] of Object.entries(parties)) {
const g = mk('g', { class: 'node party', tabindex: 0 }, nodesG);
mk('circle', { cx: p.x, cy: p.y, r: 30, fill: 'var(--ball)', stroke: 'var(--ink)', 'stroke-width': 1.5 }, g);
mk('text', { x: p.x, y: p.y + 4, 'text-anchor': 'middle', 'font-weight': 600 }, g).textContent = p.label;
mk('text', { x: p.x, y: p.y + 46, 'text-anchor': 'middle', class: 'small' }, g).textContent = p.note;
nodes[id] = g;
}
for (const [id, p] of Object.entries(subjects)) {
const g = mk('g', { class: 'node' }, nodesG);
mk('rect', { x: p.x - W / 2, y: p.y - H / 2, width: W, height: H, rx: 2, fill: p.ext ? 'var(--ext)' : 'var(--bg)', stroke: 'var(--ink)', 'stroke-width': 3 }, g);
mk('text', { x: p.x, y: p.y + 4, 'text-anchor': 'middle', 'font-weight': 600 }, g).textContent = p.label;
nodes[id] = g;
}
for (const [id, p] of Object.entries(grants)) {
const g = mk('g', { class: 'node grant', tabindex: 0, role: 'button' }, nodesG);
mk('rect', { x: p.x - W / 2, y: p.y - H / 2, width: W, height: H, rx: 10, fill: 'var(--box)', stroke: 'var(--ink)', 'stroke-width': 1.5 }, g);
mk('text', { x: p.x, y: p.y - 4, 'text-anchor': 'middle', 'font-weight': 600 }, g).textContent = id;
mk('text', { x: p.x, y: p.y + 13, 'text-anchor': 'middle', class: 'small' }, g).textContent = p.access;
nodes[id] = g;
}
// a revocation the code has: a diamond by the revoker, on the grant
const diamond = mk('g', { class: 'node' }, nodesG);
mk('path', { d: 'M780,384 l10,10 l-10,10 l-10,-10 z', fill: 'var(--bg)', stroke: 'var(--ink)', 'stroke-width': 1.5 }, diamond);
let step = steps.length, revoked = new Set(), focus = null;
const shown = () => new Set(steps.slice(0, step).map(([g]) => g));
const render = () => {
const vis = shown();
const reach = focus ? reachOf(focus, revoked) : null;
// what nothing backs any more, once something is revoked: compare with no revocation, from every party
const lost = new Set();
if (revoked.size) {
const before = new Set(), after = new Set();
for (const p of Object.keys(parties)) { reachOf(p, new Set()).forEach(n => before.add(n)); reachOf(p, revoked).forEach(n => after.add(n)); }
for (const n of before) if (!after.has(n) && grants[n]) lost.add(n);
for (const r of revoked) lost.add(r);
// a grant that uses what was lost can't do its job either
let grew = true;
while (grew) {
grew = false;
for (const [g, d] of Object.entries(grants))
if (!lost.has(g) && (d.uses || []).some(u => lost.has(u))) { lost.add(g); grew = true; }
}
}
for (const [id, g] of Object.entries(nodes)) {
const hidden = grants[id] && !vis.has(id);
g.style.display = hidden ? 'none' : '';
g.classList.toggle('dim', !!reach && !reach.has(id));
g.classList.toggle('gone', lost.has(id) && !reach);
g.classList.toggle('hot', !!reach && id === focus);
}
for (const e of edges) {
const grant = grants[e.a] ? e.a : grants[e.b] ? e.b : null;
const hidden = (grant && !vis.has(grant)) || (grants[e.a] && !vis.has(e.a)) || (grants[e.b] && !vis.has(e.b));
e.g.style.display = hidden ? 'none' : '';
const cut = revoked.has(e.a) || revoked.has(e.b);
e.l.setAttribute('stroke', cut ? 'var(--red)' : 'currentColor');
e.l.setAttribute('marker-end', cut ? '' : 'url(#arrow)');
e.x.setAttribute('visibility', cut && (e.kind === 'to' || (e.kind === 'by' && !grants[e.b].to)) ? 'visible' : 'hidden');
e.x.setAttribute('fill', 'var(--red)');
e.g.classList.toggle('dim', !!reach && !(reach.has(e.a) && reach.has(e.b)));
e.g.classList.toggle('gone', !reach && (lost.has(e.a) || lost.has(e.b)));
}
diamond.style.display = vis.has('readOnly') ? '' : 'none';
const [, said] = steps[Math.max(0, step - 1)];
document.getElementById('step').textContent = 'step ' + step + ' of ' + steps.length;
document.getElementById('slider').value = step;
let caption = step ? said : 'Nothing delegated yet.';
if (focus) caption = parties[focus].label + ' reaches: ' + [...reachOf(focus, revoked)].filter(n => n !== focus).map(n => (pos(n).label || n)).join(', ') + '.';
if (revoked.size) caption += ' Revoked: ' + [...revoked].map(r => revocable[r] || r + ' (what if?)').join('; ') + '. Fading: ' + ([...lost].filter(n => !revoked.has(n)).join(', ') || 'nothing else; another route still backs the rest') + '.';
document.getElementById('caption').textContent = caption;
const c = steps[Math.max(0, step - 1)][0];
document.getElementById('cite').textContent = step ? c + ': ' + grants[c].cite : '';
document.getElementById('d').textContent = 'Delegations, in order: ' + steps.slice(0, step).map(([g, s]) => s).join(' ') + ' Mallory, holding a leaked copy of the guest link, reaches what Claude\'s guest agent reaches: the vat\'s root, and through it only the testnet API and a signer for one shard under a phlo cap. She can\'t read the key, sign for another shard, fetch other URLs, or make WebApps or signers.';
};
for (const [id, g] of Object.entries(nodes)) {
if (parties[id]) {
g.addEventListener('mouseenter', () => { focus = id; render(); });
g.addEventListener('focus', () => { focus = id; render(); });
g.addEventListener('mouseleave', () => { focus = null; render(); });
g.addEventListener('blur', () => { focus = null; render(); });
}
if (grants[id]) {
const toggle = () => { revoked.has(id) ? revoked.delete(id) : revoked.add(id); render(); };
g.addEventListener('click', toggle);
g.addEventListener('keydown', ev => { if (ev.key === 'Enter' || ev.key === ' ') { ev.preventDefault(); toggle(); } });
}
}
const go = n => { step = Math.max(0, Math.min(steps.length, n)); history.replaceState(null, '', '#s' + step); render(); };
document.getElementById('slider').max = steps.length;
document.getElementById('slider').addEventListener('input', ev => go(Number(ev.target.value)));
document.getElementById('prev').onclick = () => go(step - 1);
document.getElementById('next').onclick = () => go(step + 1);
document.addEventListener('keydown', ev => { if (ev.key === 'ArrowLeft') go(step - 1); if (ev.key === 'ArrowRight') go(step + 1); });
// deep links: #s3, #reach=mallory, #revoke=readOnly (combine with &)
for (const part of location.hash.slice(1).split('&')) {
const [k, v] = part.split('=');
if (/^s\d+$/.test(k)) step = Math.min(steps.length, Number(k.slice(1)));
if (k === 'reach' && parties[v]) focus = v;
if (k === 'revoke' && grants[v]) revoked.add(v);
}
render();
</script>
</body>
</html>
+29 -9
View File
@@ -74,16 +74,36 @@ dependencies between issues with "(see 5)".
## writing it in markdown ## writing it in markdown
A leading `-` or `.` collides with list syntax and editor Prefer **emoji style** in markdown: each element is a list item led by its emoji, so nesting is the list's own and sources link on the line they support. Links don't render inside a fenced block.
auto-bulleting. Put each symbol after the list marker, escaping where
needed (`- \- con`, `- \+ pro`), or use a fenced block with indentation
as in the example below.
Past a screenful, give each top-level issue its own heading | Symbol | Emoji |
(`### ? 3. What is the fence?`) with its elements in a fenced block | :---: | :---: |
below. Headings show up in the editor outline and give each issue a | `?` | ❓ |
link target. Links don't render inside a fence, so put sources after | `?!` | ✅ |
the block and refer to them from the line they support. | `?~` | ❓🔶 |
| `:` | 💡 |
| `:+` | 👍 |
| `:-` | 👎 |
| `:~+` | 🔶 |
| `+` | ➕ |
| `-` | ➖ |
| `!` | 📌 |
| `.` | 💬 |
```markdown
### ❓ 1. How should we test our software?
- 🔶 1a. Use tape.
- ➕ It's what we currently use.
- ➖ It doesn't have code coverage.
- 👍 1b. Use [test262](https://github.com/tc39/test262).
```
Past a screenful, give each top-level issue its own heading (`### ❓ 3. What is the fence?`), as above: headings show up in the editor outline and give each issue a link target.
In plain text (chat, commit messages, code comments), use the symbols, in a fenced block with indentation as in the example below. A leading `-` or `.` collides with list syntax and editor auto-bulleting.
Source: the [IBIS page's emoji style](https://github.com/dckc/vattr97/wiki/IBIS#emoji-style); an example is [Reviving references on workerd](https://github.com/dckc/vattr97/wiki/reviving-references-on-workerd).
## example ## example
+53
View File
@@ -0,0 +1,53 @@
---
name: rholo-node-cloudflare
description: >-
A rholo testnet node on Cloudflare — use when asked to run, deploy, or host a rholo (RChain in Rust) node, observer, or validator on Cloudflare Workers or Containers; when an agent must ask its host for the rights to do so, by `define` or by hand. Covers what fits (an observer, as an experiment), what doesn't (a validator), and the rights to ask for. Not for running a node on a VPS: follow rholo's own setup guide.
---
# A rholo testnet node on Cloudflare
Read rholo's [Running a node](https://github.com/rhovision-org/rholo/blob/dev/docs/src/node/validator-observer-setup.md) and [the public testnet](https://github.com/rhovision-org/rholo/blob/dev/docs/src/node/testnet.md) first; they are the authority on flags, ports and genesis. This skill says how they meet Cloudflare.
## An observer fits; a validator doesn't
A node needs inbound 40400 (protocol) and 40404 (discovery) **from every peer**; one that admits inbound only from its bootstrap sits at height 0 ([setup guide §3](https://github.com/rhovision-org/rholo/blob/dev/docs/src/node/validator-observer-setup.md#3-network-and-firewall--accept-inbound-from-every-peer)). A [Container](https://developers.cloudflare.com/containers/) gets no inbound TCP from the Internet: requests reach it only through its Durable Object, by `ctx.container.getTcpPort(port).fetch()`. And a Container's disk is ephemeral and at most 20 GB, against rholo's minimum of 100–250 GB NVMe.
So:
- **Validator: no.** It must take inbound from every peer and stay up; an absent one holds finality back.
- **Observer: an experiment.** rholo's fallback for a host that can't take inbound is to seed its data directory from a synced node, minus `node.key.pem` and `node.certificate.pem`. Whether an outbound-only observer then *follows the tip* is unmeasured; measure it before calling it running.
- **Read-only watcher: yes.** A Worker that polls nodes' HTTP APIs (`/api/status`, `/api/last-finalized-block`), in the manner of [rho-observer](https://github.com/rhovision-org/rho-observer), needs no Container at all.
## The observer's shape
- A Worker with one Durable Object class that owns a Container (`scheduling_policy: "durable_object"`), its image built from rholo's `docker/rnode/Dockerfile`, with `--build-arg GIT_HEAD_COMMIT` so `/version` names the commit.
- Instance: custom, up to 4 vCPU, 12 GiB, 20 GB disk; rholo's testnet minimum is 2–4 vCPU and 8 GB RAM.
- Start the node as an observer: no `--validator-private-key-path`, `--no-upnp`, the testnet's `--bootstrap` and genesis inputs, `--host` naming nothing peers can dial (there is none).
- **Seed on every start.** Keep a seed tarball of a synced data directory in R2, or a [container snapshot](https://developers.cloudflare.com/containers/guides/snapshots/); a host restart otherwise starts from nothing.
- **Keep it awake** with a Durable Object alarm that runs more often than `setInactivityTimeout()` (at most 6 hours).
- **Expose 40403 only**, the HTTP API, through the Worker's `fetch`. Never 40402 (propose/repl) or 40405 (admin).
- Billing is per provisioned memory and disk while it runs, so 8 GiB around the clock is the bulk of the cost; check [Containers pricing](https://developers.cloudflare.com/containers/platform/pricing/) before promising a number.
## Rights: ask for each one, narrowly
An agent starts with nothing but messaging to its host. With toybox's `define`, it sends one definition whose slots name exactly what it needs, and the host decides what to bind to each:
| slot | what it's for | narrowest binding |
|---|---|---|
| `deploy` | create and update one Worker, its Container and DO | deploy of one named script, not the account |
| `seed` | write and read the seed tarball | one R2 bucket, or one prefix |
| `seedFrom` | copy a synced node's data directory | read-only, excluding the node key and certificate |
| `logs` | see why a start failed | tail of that one Worker |
Ask for no faucet key, no validator key, and no admin port: an observer needs none. If more turns out to be needed, send another definition.
Until a Cloudflare device exists to bind those slots to, do the same by hand: prepare the Worker, Dockerfile and `wrangler.jsonc` in a branch, then send the host the commands to run and what each one needs, such as `wrangler deploy` (deploy) and `wrangler r2 object put` (seed). The host runs them with their own login. Don't ask for an account-wide API token to save the host a step.
Keep the host's account id, hostnames and tokens out of anything public.
## Sources
- [Running a node: testnet now, mainnet later](https://github.com/rhovision-org/rholo/blob/dev/docs/src/node/validator-observer-setup.md) — roles, ports, the inbound rule, seeding a node that can't take inbound.
- [Running a validator: hardware requirements](https://github.com/rhovision-org/rholo/blob/dev/docs/src/node/validator-requirements.md) — 2–4 vCPU, 8 GB RAM, 100–250 GB NVMe minimal.
- [Containers limits](https://developers.cloudflare.com/containers/platform/limits/) and [FAQ](https://developers.cloudflare.com/containers/faq/) — instance sizes; disk is ephemeral.
- [Workers TCP sockets](https://developers.cloudflare.com/workers/runtime-apis/tcp-sockets/) — inbound TCP from outside Cloudflare is "coming soon".