Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
abde27c130 | ||
|
|
e887996105 | ||
|
|
4221f2d176 | ||
|
|
fd47da3a98 | ||
|
|
65761a1da5 | ||
|
|
b1cdb74e75 | ||
|
|
d25d46557e | ||
|
|
8cf472636d | ||
|
|
b64b80efd5 |
No files matched your search
@@ -14,6 +14,8 @@ Code](https://code.claude.com/docs/en/skills) and
|
||||
|
||||
## writing code
|
||||
|
||||
- [pola](pola/SKILL.md) — organize all code, tests included, by
|
||||
the flow of authority: each part gets only what its task needs.
|
||||
- [no-ambient-authority](no-ambient-authority/SKILL.md) — clocks,
|
||||
RNGs, `fetch`, and the filesystem come in as parameters.
|
||||
- [io-between-turns](io-between-turns/SKILL.md) — sync I/O is a pointy
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: citation-needed
|
||||
description: Provide live, verifiable links when a factual claim is challenged with "citation needed", or when asserting a fact likely to be challenged. Formats citations as blockquote markup with the page title as the link and a date. Not for code references or repo-local docs.
|
||||
description: Provide live, verifiable links when a factual claim is challenged with "citation needed", or when asserting a fact likely to be challenged; when writing an outline or article that may be published, with a References or sources section, a CSL-JSON sidecar, or a Zotero collection. Formats citations as blockquote markup with the page title as the link and a date. Not for code references or repo-local docs.
|
||||
---
|
||||
|
||||
# Citation Needed
|
||||
@@ -34,6 +34,54 @@ raw in-your-face URLs.
|
||||
> — [Source Page Title](https://example.com/path), Site Name, Sep 23, 2026
|
||||
```
|
||||
|
||||
In madmode.com posts, the dash is `--`:
|
||||
`> -- [Page Title](https://example.com/path), Author or Site, Mon YYYY`.
|
||||
|
||||
## Writing for publication
|
||||
|
||||
Anything that may be shared publicly cites public sources only: never
|
||||
unpublished notes, private LLM chats, or local-only links such as
|
||||
`zotero://select`. A claim that rests on one of those either becomes the
|
||||
author's own words or gets flagged ⚠️ until a real source turns up.
|
||||
|
||||
- **Primary sources first.** Cite the W3C workshop paper, not a post about
|
||||
it. The author's own blog post on the topic goes in parentheses after
|
||||
it, as an inline link.
|
||||
- **Every reference gets a date**, so none pile up undated at the end of
|
||||
a newest-first list: software by a release from around when it became
|
||||
well known, web pages "as of" the month you read them, statutes by
|
||||
enactment.
|
||||
- **Outlines:** use Markdown footnotes (`[^key]`) collected in one
|
||||
`## References` section at the end, newest first, with no subheadings
|
||||
(Obsidian moves footnote definitions to the bottom, leaving
|
||||
subheadings empty).
|
||||
- **CSL-JSON sidecar:** keep `<name> - references.json` next to the
|
||||
outline, in the same order, with `id` equal to the footnote key. It's
|
||||
the data behind everything else.
|
||||
- **Published posts:** don't hand-write the sources list. Put
|
||||
`bib: <name> - references.json` in the post's front matter, and the
|
||||
madmode site renders it with the xhlt91 bibliography conventions
|
||||
(`templates/_bib.html`, `tools/csl_bib.py`). Notes starting "TODO" or
|
||||
"placeholder" stay out of the published list.
|
||||
- **Zotero:** `tools/zotero_import_csl.py` in madmode-blog imports the
|
||||
sidecar into a collection named for the post (precedent: fs86,
|
||||
ai-scrape26). The public library syncs, so importing is publishing.
|
||||
Follow the library's existing conventions for each item type; RFCs, for
|
||||
example, are reports with type "Request for Comments" and institution
|
||||
"Internet Engineering Task Force", so the IETF RFCs saved search
|
||||
finds them.
|
||||
- **Links the fetcher can't read** (403, bot wall, JS-only): mark them 🙋
|
||||
in the draft with the link; the author fetches the page by hand and
|
||||
saves a Zotero snapshot, which can then be read from `~/Zotero/storage`.
|
||||
- **Keep a copy of anything you quote, starting with the first fetch.**
|
||||
Checking exact wording later means fetching again, and fetches fail:
|
||||
PDFs come back as undecodable bytes, sites return 202 or 403. Save the
|
||||
fetched file (e.g. under `.tmp/snapshots/`) and queue it for the author
|
||||
in a 🙋 checklist (`<name> - snapshots.md`) with each source's link and
|
||||
the words quoted from it. The author, acting as a human HTTP proxy,
|
||||
attaches it in Zotero or saves a snapshot. Agents can't attach files to
|
||||
existing Zotero items without a local API key.
|
||||
|
||||
## Search hygiene
|
||||
|
||||
If you are the one asserting a fact, do a quick search before stating it as
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: hypertext-links
|
||||
description: Writing style for links in markdown docs — use when writing or reviewing any doc with URLs to external pages, repo files, or intra-repo documents; enforces descriptive link text over bare/generic links.
|
||||
description: Writing style for links in markdown docs and chat (Discord supports `[text](<url>)`) — use when writing or reviewing any doc or Discord message with URLs to external pages, repo files, or intra-repo documents; enforces descriptive link text over bare/generic links.
|
||||
---
|
||||
|
||||
# Hypertext Links
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
---
|
||||
name: no-ambient-authority
|
||||
description: >-
|
||||
Use when writing or reviewing code whose functions touch I/O, clocks, random number generators, process.env, fetch, or filesystem; when someone says "ambient authority", "wash your mouth out", or "that function shouldn't reach for that"; when debating dependency injection or default-arg seams; when asked what OCap discipline is. Source: the Agoric wiki's OCap Discipline page.
|
||||
Use when writing or reviewing code whose functions touch I/O, clocks, random number generators, process.env, fetch, or filesystem; before writing or refactoring any Python script (DisciplinedPython style guide and checker); when someone says "ambient authority", "wash your mouth out", or "that function shouldn't reach for that"; when debating dependency injection or default-arg seams; when asked what OCap discipline is. Source: the Agoric wiki's OCap Discipline page.
|
||||
---
|
||||
|
||||
# OCap Discipline
|
||||
@@ -42,6 +42,30 @@ capability-based languages, systems, papers, and talks.
|
||||
authority they need, then *delegate* it downward.
|
||||
3. **Test scripts** are named `test-*.js`; tests export nothing.
|
||||
|
||||
## Python: DisciplinedPython
|
||||
|
||||
For Python, the rules above are spelled out in the DisciplinedPython style
|
||||
guide in awesome-ocap (local checkout `~/projects/awesome-ocap`). Read it
|
||||
before writing or refactoring a Python script; don't invent conventions.
|
||||
|
||||
- [ocap-py-style-guide.md](https://codeberg.org/dckc/awesome-ocap/src/branch/master/style-guide/ocap-py-style-guide.md):
|
||||
the script recipe (`main(...)` plus `_script_io()` under the `__main__`
|
||||
guard, authorities passed by name), standard authority names (`argv`,
|
||||
`cwd`, `stdout`, `connect`, `run`, `urlopen`, `now`), prompt attenuation
|
||||
in `main`, and **status goes through `logging.info(...)` directly**: not
|
||||
`print`, not `stderr` writes, not an injected logger.
|
||||
- [disciplined-python-attenuation.md](https://codeberg.org/dckc/awesome-ocap/src/branch/master/style-guide/disciplined-python-attenuation.md):
|
||||
narrowing authority function by function.
|
||||
- Checker: run `~/projects/awesome-ocap/tools/disciplined_python_check.py path/to/script.py`
|
||||
and treat each finding as a bug. It points at matching before/after
|
||||
examples in `tests/fixtures/disciplined_python/{errors,fixed}/`.
|
||||
- Calibration: Python can't enforce a capability boundary (name mangling
|
||||
and introspection get around any wrapper), so for a small script,
|
||||
attenuation that lives mostly in names is fine. An example: a read-only
|
||||
library view whose path object could still POST. GET-only is ideal;
|
||||
note the gap honestly and move on. Robustness against adversaries
|
||||
means leaving Python (e.g. for Hardened JavaScript).
|
||||
|
||||
## how this shows up in review
|
||||
|
||||
- `crypto.getRandomValues()` called inside an exported function →
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
name: pola
|
||||
description: >-
|
||||
Principle of Least Authority as the way to organize all code: trace the flow of authority, give each component only what its task needs, design APIs around attenuation. Use when writing or reviewing any code, tests included: makers and their parameters, module imports and exports, which objects share a scope, what a facet exposes; when someone says "POLA", "least authority", "who can reach that?", "Bob shouldn't see Alice's purse", or "makeFoo-style actors". The table stakes (no clocks, fetch, or env reached for inside logic) are no-ambient-authority; this is the organizing principle on top.
|
||||
---
|
||||
|
||||
# POLA: organize code by the flow of authority
|
||||
|
||||
Mark Miller, [SOSP 50th anniversary panel](https://www.youtube.com/watch?v=br9DwtjqmVI) (3 min):
|
||||
|
||||
> we design abstraction boundaries so that a component's interface only requires arguments that are somehow relevant to its task. If such argument passing were the only source of authority, we would have taken a huge step towards least authority.
|
||||
|
||||
Every reference to anything but immutable data is authority: a purse is the right to spend some assets; a mint, the right to create them; a seat, the right to take part in one deal; a DB handle, every row. Ask of every reference: who holds it, who gave it to them, and does their task need all of it?
|
||||
|
||||
## Recursively, at every level
|
||||
|
||||
[Navigating the Attack Surface](https://www.youtube.com/watch?v=wW9-KuezPp8) (15 min): the same move repeats at each level of composition (OS accounts, apps, modules, objects), and the benefit multiplies, like a Menger sponge. CapMail's main module "receives all of that authority … wiring them together, subdividing the authority … and handing it out piecemeal … written knowing that the address book does not need access to the PGP keyring, so the main module simply doesn't give it that access."
|
||||
|
||||
So at each level, code has two roles:
|
||||
|
||||
- **A wiring layer** (entry point, `main`, test setup, a maker) holds a lot of authority, and its job is to split it and hand out pieces. Keep it small and obvious: it is the TCB at its level.
|
||||
- **Everything else** gets only the pieces its task needs, as arguments, and can't reach more.
|
||||
|
||||
## In practice
|
||||
|
||||
- **Makers take only what their task needs.** `makeAlice({ usdcPurse, stockDepositFacet })`, not `makeAlice({ ledger })`.
|
||||
- **Attenuate at API boundaries.** Hand out the narrowest facet that works: a deposit facet rather than the purse; a seat rather than the escrow's admin; a read-only view rather than the DB. When designing an API, decide which facets it has and who should get each.
|
||||
- **Separate parties get separate scopes.** If two parties' authority shares a scope, a bug or a careless line lets one act as the other. A scope holding both Alice's and Bob's purses is a design error.
|
||||
- **Tests too.** Tests are where the code's intended authority flow is first written down. Write each party as a `makeFoo`-style actor holding its own authority privately; the test's top level is the wiring layer that creates the parties and introduces them ([sequence-diagram-actor-sim](https://github.com/Agoric/agoric-sdk/blob/master/.agents/skills/sequence-diagram-actor-sim/SKILL.md)).
|
||||
- **The test takes the spontaneous step; actors carry out the consequences.** Give an actor what it knows at construction and let it decide how to act: `alice.run()`, or `alice.tradeWith(bob)` to introduce a counterparty. Don't drive it with arguments that decide for it, like `alice.pay(to, amount)`: that is the test acting with Alice's authority, as if it held her purse. What an actor hands others (a deposit facet, a shop) carries no authority to spend for it.
|
||||
- **Modules decide what authority enters through imports and leaves through exports.** Export makers, not instances that close over power ([no-ambient-authority](../no-ambient-authority/SKILL.md)).
|
||||
|
||||
```ts
|
||||
// wrong: one scope holds everyone's purses; Bob's code could spend Alice's
|
||||
const alice = { usdc: await E(usdc.issuer).makeEmptyPurse(), ... };
|
||||
const bob = { usdc: await E(usdc.issuer).makeEmptyPurse(), ... };
|
||||
await E(seatB).offer(await E(bob.stock).withdraw(shares(3n)), ...);
|
||||
|
||||
// right: each party holds its own; the test wires, drives, and observes
|
||||
const makeAlice = async ({ usdcIssuer, stockIssuer, dollars }) => {
|
||||
const usdc = await E(usdcIssuer).makeEmptyPurse(); // Alice's alone
|
||||
...
|
||||
return harden({
|
||||
// Alice decides what to pay; Bob shows only his shop
|
||||
tradeWith: async bob => E(bob.shop).sell(await E(usdc).withdraw(price), ...),
|
||||
getBalances,
|
||||
});
|
||||
};
|
||||
await alice.tradeWith(bob); // the one spontaneous step
|
||||
```
|
||||
|
||||
## Review checklist
|
||||
|
||||
Before committing, for each new maker, scope, and export:
|
||||
|
||||
1. Draw (in your head or as a [wiring-diagram](../wiring-diagram/SKILL.md)) who holds what after this change.
|
||||
2. Does any non-wiring scope hold two parties' authority, or more than its task needs?
|
||||
3. Could a narrower facet replace what's passed? Does any facet let a caller spend for its owner, or does the test decide what an actor does?
|
||||
4. Name the wiring layer at this level. Is it small?
|
||||
+65
-68
@@ -1,41 +1,48 @@
|
||||
---
|
||||
name: wiring-diagram
|
||||
description: >-
|
||||
Capability wiring diagram, "who holds what" — use when asked for a wiring diagram, a picture of who holds what, a capability diagram, or "a diagram like the cookie-rotation one"; when reviewing a design for POLA and wanting to see the reference graph. MarkM ERTP-slide style: actors are balls, makers pale regions, objects rounded squares, state ledger tables, references dot-to-arrowhead; HTML/SVG plus a headless-Chromium PNG. Not for message order over time: that's a sequence diagram (sequence-diagram-actor-sim in agoric-sdk).
|
||||
Capability wiring diagram: who holds a reference to what, and so who can do what — use when asked for a wiring diagram, a capability diagram, or a picture of who holds what; when reviewing a design for POLA and wanting to see the reference graph; when stepping through how that graph changes across create, checkpoint, crash and revive (an "algorithm animation"). In the style of MarkM's ERTP slides. Sequence diagrams of messages between parties are a separate skill (sequence-diagram-actor-sim).
|
||||
---
|
||||
|
||||
# Capability wiring diagram
|
||||
|
||||
One picture that answers, for a design: **who holds a reference to what,
|
||||
and therefore who can do what.** It complements a sequence diagram,
|
||||
which shows *when* messages flow. This one shows the standing graph of
|
||||
authority that makes those messages possible. For sequences, see
|
||||
`~/projects/ymax-workspace/agoric-sdk/.agents/skills/sequence-diagram-actor-sim/SKILL.md`
|
||||
(on agoric-sdk branches `connolly/ago-1264-agentic-planning` and
|
||||
`connolly/ago-1299-agentic-planning-tdd`, not yet on master).
|
||||
POLA says each party should hold only the authority its job needs. A wiring diagram lets you check that at a glance: one picture of **who holds a reference to what, and therefore who can do what**. The arrows that are absent are the security argument. To show what happens over time, step the diagram through frames, one message each (an algorithm animation, below), draw a sequence diagram (see sequence-diagram-actor-sim), or both.
|
||||
|
||||
Exemplars:
|
||||
- `~/oros-bots/capsite-cookie-rotation/docs/cookie-rotation-wiring.html`
|
||||
(+ `.png`): the original.
|
||||
- `~/qtrx/packages/umb-download/docs/wiring.html` (+ `.png`): three
|
||||
makers, two outside parties, and an adversary holding a webkey.
|
||||
- `capsite-cookie-rotation/docs/cookie-rotation-wiring.html` (+ `.png`) in this workspace: the original.
|
||||
- `~/qtrx/packages/umb-download/docs/wiring.html` (+ `.png`): three makers, two outside parties, and an adversary holding a webkey.
|
||||
- `capsite-toybox-kernel/docs/sugarmint-sturdyrefs.html` in this workspace: a step-through of E's sugarMint making sturdyrefs, crashing, and reviving, with nested panes, facets on shared state, weak tables, and cross-vat proxies.
|
||||
|
||||
Start from [`template.html`](template.html), next to this file. It has
|
||||
the drawing helpers and a small example scene to replace.
|
||||
Start from [`template.html`](template.html), next to this file: it has the drawing helpers and a small scene to replace. For a step-through, start from the sugarMint page. The deliverable is a local HTML file in the repo's `docs/`, not a claude.ai artifact, unless asked.
|
||||
|
||||
## Read the graph from the code, not the story
|
||||
|
||||
Every arrow must correspond to something real: a constructor argument, a
|
||||
stored id, a binding, a held token, or a file someone keeps. Before
|
||||
drawing, list the references as `holder → target: where in the code`.
|
||||
Read the factories (`make…`, `newX`, `configure`) and anything that
|
||||
stores an id: a DO id held as a string *is* a reference. If you can't
|
||||
cite where a reference comes from, it doesn't get an arrow.
|
||||
Every arrow must correspond to something real: a constructor argument, a stored id, a binding, a held token, or a file someone keeps. Before drawing, list the references as `holder → target: where in the code`. Read the factories (`make…`, `newX`, `configure`) and anything that stores an id. An id is a reference when its holder can redeem it: a DO id string reaches the object through code that holds the namespace binding, or through a route that redeems ids for anyone (cookie-rotation's `/at/<id>`, which makes the id a bearer capability). Draw the arrow from the id's holder, and say what redeems it. If you can't cite where a reference comes from, it doesn't get an arrow.
|
||||
|
||||
Watch for references that are dropped on purpose (e.g. a setup route
|
||||
that mints an instance, hands its id to one holder and forgets it).
|
||||
That's often the point of the design. Say so in a caption, or just
|
||||
leave the arrow out.
|
||||
Read each object's fields before you say what it is. E's SturdyRef looks like plain data (vatID, swiss number) but also holds a LocatorUnum presence, which is its authority to look the number up. A table keyed by data can't be weak-keyed: say which side is weak (E's swissTable is a WeakValueMap), and draw the weak arrow dashed.
|
||||
|
||||
Watch for references dropped on purpose, such as a setup route that mints an instance, hands its id to one holder and forgets it. That's often the point of the design: say so in a caption, or leave the arrow out.
|
||||
|
||||
When a caption claims something a reader may doubt, cite the line that shows it, and keep what the code shows apart from what you infer. If the code is lost, say so and draw no arrows into it.
|
||||
|
||||
## One pane per maker call
|
||||
|
||||
In MarkM's [makeMint slide](https://docs.agoric.com/guides/js-programming/hardened-js.html#from-ocaps-to-electronic-rights-mint-and-purse), each stacked pane is one call to `makeMint`. Inside a pane is what that one call made: one issuer, mint, brand and ledger, and a stack of purses, because `makePurse` runs many times per mint. For each box, ask: *a new one per what call?*
|
||||
|
||||
- Stack a box only when its scope makes many. `store.readOnly()` returns the same object every time, so readOnly is 1:1 with its store and not stacked.
|
||||
- Put state where the code keeps it. If one Durable Object holds many stores in one kv, the kv is one table in the DO's pane, like makeMint's ledger, not one per store.
|
||||
- Name a pane after the real maker (the class or function in the code), not an invented `makeFoo`.
|
||||
- Nested scopes nest panes: issuer ⊃ account ⊃ hold.
|
||||
- Facets that close over shared state go in one pane, each facet a box, with arrows to the shared state table: an ERTP mint, issuer and brand; an account and its revoker. Drawing facets apart is how the picture shows attenuation.
|
||||
- A stack can be over time: one vat pane per incarnation.
|
||||
|
||||
## Between vats
|
||||
|
||||
A reference to an object in another vat is a proxy in the holder's vat that forwards over CapTP or Cap'n Web. Draw the holder's vat as a small pane with the proxy in it, and the arrow from the proxy onward. That proxy is where a crash shows up as a broken reference.
|
||||
|
||||
## Include an adversary
|
||||
|
||||
Add a Mallory who holds whatever is most likely to leak (an instance id, a webkey, a URL), with an arrow to exactly what it reaches. Her caption says what she *can't* reach. Mallory makes the absent arrows visible.
|
||||
|
||||
## Vocabulary
|
||||
|
||||
@@ -43,71 +50,61 @@ leave the arrow out.
|
||||
|---|---|---|
|
||||
| blue ball | `actor(cx, cy, label)` | a person or a program with its own agency |
|
||||
| grey ball | `actor(cx, cy, label, "url(#ext)")` | outside the system: a browser extension, a third-party service |
|
||||
| pale region | `maker(x, y, w, h, "makeFoo")` | a maker (factory, DO class) and the instances it made; the stacked inner panes say "there are many" |
|
||||
| rounded square | `obj(x, y, w, h, label, stacked)` | an object or facet; `stacked` when one is made per instance |
|
||||
| pale region | `maker(x, y, w, h, "makeFoo")` | a maker (factory, DO class) and the instances it made; stacked panes say "there are many" |
|
||||
| rounded square | `obj(x, y, w, h, label, stacked)` | an object or facet; `stacked` when its scope makes many |
|
||||
| ledger table | `table(x, y, title, rows, [colW0, colW1])` | an object's state; rows are key/value; `rowY(i)` and `colX` give arrow anchors |
|
||||
| dot → arrowhead | `ref(x1, y1, x2, y2, bend)` | holder references target; `bend` (±0.05–0.3) curves around things |
|
||||
| speech bubble | the `path` + `code` block | the one call the picture is about, in `E(target).method(args)` form |
|
||||
| caption | `cap(x, y, text, attrs)` | what an actor holds, and what it can't reach |
|
||||
|
||||
Facets are separate objects (`store` vs `readOnly`): drawing them apart
|
||||
is how the picture shows attenuation.
|
||||
|
||||
## Include an adversary
|
||||
|
||||
Add a Mallory who holds whatever is most likely to leak (an instance
|
||||
id, a webkey, a URL), with an arrow to exactly what it reaches. The
|
||||
caption says what she *can't* reach. Absent arrows are the security
|
||||
argument, and Mallory makes them visible.
|
||||
|
||||
## Layout
|
||||
|
||||
- Actors in a row along the top (y≈200), makers below (y≈320 onward),
|
||||
captions along the bottom (y≈ height − 14).
|
||||
- Put each maker under the actors that mostly use it, so arrows run
|
||||
short and downward.
|
||||
- Speech bubble at the top, its tail pointing at the speaker. Move the
|
||||
bubble's path (`M x,y`) and the tail segment (`h… l-38,48 l6,-48`)
|
||||
together.
|
||||
- Captions: two or three short lines, never on top of an arrow or a
|
||||
ball. Use `"text-anchor": "start"` to set one beside a ball.
|
||||
- Long arrows that cross a maker: increase `|bend|` until the curve
|
||||
clears tables and objects. The control point is the midpoint offset
|
||||
by `bend × (−dy, dx)`.
|
||||
- Actors in a row along the top (y≈200), makers below (y≈320 onward), captions along the bottom (y≈ height − 14).
|
||||
- Put each maker under the actors that mostly use it, so arrows run short and downward.
|
||||
- Speech bubble at the top, its tail pointing at the speaker. Move the bubble's path (`M x,y`) and the tail segment (`h… l-38,48 l6,-48`) together.
|
||||
- Captions: two or three short lines, never on an arrow or a ball. Use `"text-anchor": "start"` to set one beside a ball.
|
||||
- Long arrows that cross a maker: increase `|bend|` until the curve clears tables and objects. The control point is the midpoint offset by `bend × (−dy, dx)`. Where one bend can't clear everything, give explicit control points (the sugarMint page's `via` and `via2`).
|
||||
|
||||
## Step-through (algorithm animation)
|
||||
|
||||
When the story is a sequence of state changes (create, checkpoint, crash, revive), keep one layout and step through frames, like slides:
|
||||
|
||||
- Each frame is one message. The bubble shows it, with its tail at the sender; a step inside some object gets a dashed bubble with no tail.
|
||||
- Orange marks what that message changed: a halo on new objects and tables, a fill on new rows, orange for new references.
|
||||
- Below the picture: a short heading, a sentence saying what the message did and why, and a cite line (`file:line`).
|
||||
- Dead things fade (opacity 0.25); broken references are red, dashed, with a ✕.
|
||||
- Controls: Prev/Next, arrow keys, a slider, and `#sN` deep links.
|
||||
- In code, name frames (`F.save`, `F.revive`) and derive visibility from them (`on(F.sturdy, F.rebuild)`, `fresh(F.save)`), so inserting a frame doesn't shift every index.
|
||||
|
||||
## Accessibility
|
||||
|
||||
Keep `<title>` short. Write `<desc>` as prose that names every actor and
|
||||
maker, every reference, the bubble's call, and what the adversary
|
||||
can't reach. Someone who can't see the picture should get the same
|
||||
argument from it.
|
||||
Keep `<title>` short. Write `<desc>` as prose that names every actor and maker, every reference, the bubble's call, and what the adversary can't reach. Someone who can't see the picture should get the same argument from it. A step-through sets `<desc>` per frame.
|
||||
|
||||
## Render and check
|
||||
|
||||
The page is self-contained (no network). Render a PNG with headless
|
||||
Chromium. The viewport comes out shorter than `--window-size`, so render
|
||||
taller and crop to the SVG size:
|
||||
Render with headless Chromium. The viewport comes out shorter than `--window-size`, so render taller and crop to the SVG size; `--force-prefers-reduced-motion` keeps highlights from being caught mid-fade:
|
||||
|
||||
```sh
|
||||
chromium --headless=new --disable-gpu --no-sandbox --hide-scrollbars \
|
||||
chromium --headless=new --disable-gpu --no-sandbox --hide-scrollbars --force-prefers-reduced-motion \
|
||||
--window-size=W,$((H+100)) --screenshot=full.png "file://$PWD/NAME.html"
|
||||
python3 -c "from PIL import Image; Image.open('full.png').crop((0,0,W,H)).save('NAME.png')" && rm full.png
|
||||
```
|
||||
|
||||
Then **look at the PNG** (Read it) and fix overlaps: captions on arrows,
|
||||
arrows through tables, text clipped at the bottom. Expect two or three
|
||||
rounds. Commit the HTML (source) and the PNG separately, so the source
|
||||
diff stays readable.
|
||||
**Look at each screenshot** (Read it) and fix overlaps: captions on arrows, arrows through tables, text clipped at the bottom. Expect two or three rounds. If arrowheads vanish, look for an id collision: SVG marker ids share the page's id namespace, and an `<h2 id="head">` once hijacked `url(#head)`. The template's marker is `arrow`.
|
||||
|
||||
QA screenshots in a scratch directory are fine at any point. Don't commit a PNG until the user confirms the diagram is right; a step-through gets none unless asked. Commit the HTML and the PNG separately, so the source diff stays readable.
|
||||
|
||||
## Review checklist
|
||||
|
||||
- Does every arrow cite something in the code? Is any real reference
|
||||
missing?
|
||||
- Does each actor hold only what its job needs (POLA)? If the picture
|
||||
shows an actor holding more, that's a finding about the design, not a
|
||||
drawing problem.
|
||||
- Are facets drawn apart where they differ in authority?
|
||||
- Does every arrow cite something in the code? Is any real reference missing?
|
||||
- Does each actor hold only what its job needs? If the picture shows an actor holding more, that's a finding about the design, not a drawing problem.
|
||||
- For each stacked box: is a new one really made per instance? For each unstacked box: is there really only one?
|
||||
- Are facets drawn apart where they differ in authority, and pointed at shared state where they share it?
|
||||
- Do references into another vat go through a proxy in the holder's vat?
|
||||
- Does the adversary's caption match what the arrows show?
|
||||
- Does `<desc>` tell the same story in prose?
|
||||
- Is any secret value drawn? Elide values (`session=…`, `{…}`): the
|
||||
picture shows *that* a row exists, not its contents.
|
||||
- Is any secret value drawn? Elide values (`session=…`, `{…}`): the picture shows *that* a row exists, not its contents.
|
||||
|
||||
## TODO
|
||||
|
||||
Migrate or copy sequence-diagram-actor-sim here. It lives at `~/projects/ymax-workspace/agoric-sdk/.agents/skills/sequence-diagram-actor-sim/SKILL.md`, on agoric-sdk branches `connolly/ago-1264-agentic-planning` and `connolly/ago-1299-agentic-planning-tdd`, not yet on master.
|
||||
@@ -28,7 +28,7 @@ adversary can and cannot reach.</desc>
|
||||
<stop offset="0%" stop-color="#6cbcf4"/>
|
||||
<stop offset="100%" stop-color="#4aa8ec"/>
|
||||
</linearGradient>
|
||||
<marker id="head" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="9" markerHeight="9" orient="auto-start-reverse">
|
||||
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="9" markerHeight="9" orient="auto-start-reverse">
|
||||
<path d="M0,0 L10,5 L0,10 z" fill="#1d4f7a"/>
|
||||
</marker>
|
||||
</defs>
|
||||
@@ -54,7 +54,7 @@ const dot = (x, y) => el("circle", { cx: x, cy: y, r: 4.5, fill: INK });
|
||||
const ref = (x1, y1, x2, y2, bend = 0, extra = {}) => {
|
||||
dot(x1, y1);
|
||||
const mx = (x1 + x2) / 2 - (y2 - y1) * bend, my = (y1 + y2) / 2 + (x2 - x1) * bend;
|
||||
el("path", { d: `M${x1},${y1} Q${mx},${my} ${x2},${y2}`, fill: "none", stroke: INK, "stroke-width": 2, "marker-end": "url(#head)", ...extra });
|
||||
el("path", { d: `M${x1},${y1} Q${mx},${my} ${x2},${y2}`, fill: "none", stroke: INK, "stroke-width": 2, "marker-end": "url(#arrow)", ...extra });
|
||||
};
|
||||
|
||||
// maker box: a pale rounded region, with stacked instances inside
|
||||
|
||||
Reference in new issue
Block a user