arbiterdesign 0.1.1 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Edmond Hua
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Edmond Hua
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,143 +1,151 @@
1
- # Arbiter
2
-
3
- A decision layer for AI-generated UI. Records the design calls made during agent-assisted UI work — what was chosen, what was rejected, and why — and feeds them back into the agent's context so the same call never has to be made twice.
4
-
5
- ```bash
6
- npx arbiterdesign init
7
- ```
8
-
9
- That's the whole install. It writes:
10
-
11
- | File | What it is |
12
- |---|---|
13
- | `DECISIONS.md` | Active rules, grouped by dimension. Capped at 40. The agent reads this before UI work. |
14
- | `.arbiter/archive.md` | Every decision ever, append-only. Never loaded into the agent. |
15
- | `.arbiter/pending.md` | Decisions the agent queued that you haven't judged yet. |
16
- | `.arbiter/candidates/` | One page per generated screen or direction, with its state, snapshot, decisions, and why it lost. |
17
- | `CANDIDATES.md` | Index of candidates — written only when `destination` is `git`. |
18
- | `.claude/skills/arbiter/SKILL.md` or `.cursor/rules/arbiter.mdc` | Tells the agent to surface its decisions after UI work and record what you confirm. |
19
- | `arbiter.json` | Config. `destination: "local"`. |
20
- | `AGENTS.md` | One line appended, pointing at `DECISIONS.md`. Merged, never overwritten. |
21
- | `CLAUDE.md` (Claude Code) / `.cursor/commands/arbiter.md` (Cursor) | Same pointer line in Claude Code's own context file; a `/arbiter` command for Cursor. |
22
-
23
- Running `init` twice changes nothing.
24
-
25
- ## How it works
26
-
27
- 1. You ask the agent to build a screen. It reads `DECISIONS.md` first.
28
- 2. You iterate. It says nothing about decisions while you're iterating — each version you move past becomes a rejected alternative on the one that replaced it.
29
- 3. When you move on, it queues the design calls it made — sized as `feature`, `pattern`, or `polish` — and, after feature-level work, says one line about what changed.
30
- 4. You judge them when you want — in chat with `/arbiter`, or in the browser with `npx arbiter review`. Grouped by piece of work; each item reads **Change** (what happened) / **Pattern** (the rule) / **Rejected** (what lost). Per item: **Confirm**, **Make it a rule**, **Skip**, or type a correction. Polish is one line per group — **Confirm all**.
31
- 5. Rules enter `DECISIONS.md`. Everything judged enters the archive. Skips vanish.
32
-
33
- You can also just say it: *"make that a rule"*, *"reject the tabs, going with a single page"*. It records without asking.
34
-
35
- Nothing enforces anything. Rules inform generation; they don't gate it.
36
-
37
- ## Commands
38
-
39
- ```
40
- arbiter init install into this project [--destination git]
41
- arbiter snapshot "<work>" --file x.png a picture for a piece of work (or --capture on macOS); publish carries it
42
- arbiter record walk through a decision at the terminal
43
- arbiter record '<json>' record now (what the agent calls)
44
- arbiter record --pending '<json>' queue for later
45
- arbiter record P-0003 --as rule judge a queued one: accept | rule | skip | fix --to "…"
46
- arbiter record --all --as accept judge every queued item [--level polish] [--trigger "Settings build"]
47
- arbiter record --findings f.json queue a scanner's findings for verdicts
48
- arbiter record --retire D-0003 --why "…" drop a rule with no replacement
49
- arbiter review judge the queue in a browser page
50
- arbiter verify [id] re-check a decision's claim against its files
51
- arbiter sweep D-0004 [--queue] find existing violations of a mechanical rule
52
- arbiter candidate add "<name>" track a generated direction [--feature f] [--snapshot img | --capture]
53
- arbiter candidate C-0002 --state … generated | in_review | approved | rejected | superseded
54
- arbiter board candidates and their states
55
- arbiter export static folder of the board for people without the repo [--feature f] [--include-rules] [--open]
56
- arbiter publish board online at arbiter.design, with comments; prints the share link. Nothing to set up.
57
- arbiter publish --to <url|pages> your own hosted Arbiter, or GitHub Pages (git destination + export + commit + push)
58
- arbiter pull bring comments and "looks good" reactions down into .arbiter/comments.json
59
- arbiter drift deviations per screen: accepts, unverified claims, rules broken
60
- arbiter rules active rules [--dimension <name>] [--json]
61
- arbiter rules --pending the queue
62
- arbiter rules --archive everything ever
63
- arbiter rules D-0003 one decision in full
64
- ```
65
-
66
- `record` exit codes: `0` recorded · `1` invalid · `2` overlap — re-run with `--supersedes <id>` or `--keep-both` · `3` cap reached · `4` contradicted — the named files don't match the claim.
67
-
68
- ## Verification
69
-
70
- A mechanical decision can name `files` and an `expect` — literal strings that must be `present` in / `absent` from them (write `regex:<pattern>` for a pattern, e.g. `regex:#[0-9a-fA-F]{6}\b` for any hex colour). Arbiter reads only those files, never the repo. A claim that doesn't hold is refused. `accept` verdicts are never checked: an exception is a deviation by definition.
71
-
72
- ## Sweep
73
-
74
- Recording a mechanical rule with `expect.absent` reports how much existing code breaks it. `arbiter sweep <id>` lists the lines; `--queue` turns each file into a pending item to confirm as an exception or fix. Read-only — fixes are the agent's job. Judgment rules can't sweep.
75
-
76
- The scan set is the rule's `paths` (directories or files) if it names any, else its `file:` scope, else the whole project. Keep token definitions and reference HTML out with `arbiter.json`:
77
-
78
- ```json
79
- { "sweep": { "exclude": ["app/globals.css", "design-reference/**", "docs/**"] },
80
- "overlap": { "ignore": ["audit", "journey"] } }
81
- ```
82
-
83
- `overlap.ignore` lists project words too common to signal that two rules overlap.
84
-
85
- ## Review page
86
-
87
- `arbiter review` opens a local page with two tabs. **Decisions** — the queue, grouped by dimension, each card showing the screen it was made for. Confirm / Make it a rule / Skip / Fix; overlaps and contradictions surface inline. **Candidates** — every direction with its snapshot; Approve (with why — kept on the ones it replaces), Reject, In review. Both write the same files as the CLI.
88
-
89
- ## Export
90
-
91
- `arbiter export` writes `arbiter-export/` — one `index.html` plus snapshots, no server, no JS. Open it locally or drop the folder on any static host and send the link. It's the stakeholder view only: each screen, its state, who approved, why the others lost, and what was decided in plain words. No verdict controls — feedback comes back through a person. This is the cheap test of whether stakeholders actually look, before anything hosted gets built.
92
-
93
- ## Hosted board
94
-
95
- The hosted board at [arbiter.design](https://arbiter.design) serves a board at a share link and lets people comment or say "looks good" after a magic-link sign-in. Git stays the record: the service holds one board version per project and the comments, nothing else. `npx arbiter publish` uploads; `npx arbiter pull` brings comments back, where `arbiter review` shows them beside each screen. Only `publish` and `pull` ever touch the network. The service itself is a separate, private codebase.
96
-
97
- ## Candidates
98
-
99
- When several directions are generated for one feature, each is a candidate. A snapshot comes from the agent's browser tool (`--snapshot <image>`) or, on macOS, from you: `--capture` drops into drag-to-select and saves what you pick. Approving one supersedes the rest with the reason kept. Decisions link to a candidate; its page lists them. `npx arbiter publish` does all of the below in one go — switches to git, exports, commits, turns on GitHub Pages through `gh` if it's signed in, pushes, prints the link. It's the only command that touches the network, and only when you run it.
100
-
101
- With `destination: "git"` in `arbiter.json`, every candidate change commits its page, a `CANDIDATES.md` index, and the export page under `docs/arbiter/` (never pushed). Turn on GitHub Pages for the `docs` folder once, and the board is served at `https://<owner>.github.io/<repo>/arbiter/` — always current, no login, no server. `board` prints the URL. Set `"pages": false` to skip, or `"pages": { "dir": "…", "includeRules": true }` to change it.
102
-
103
- ## The record
104
-
105
- ```
106
- id D-0001, sequential
107
- date ISO 8601
108
- author who decided
109
- class mechanical | judgment
110
- level feature | pattern | polish — how big a call; polish is never reviewed individually
111
- dimension structure | interaction | states | content | visual | motion | access
112
- change what happened, as a PM would say it — what the reviewer reads
113
- decision the same call as a rule someone could follow — what future sessions read
114
- rejected alternatives that lost, "<option> — <why>", one line each
115
- trigger the piece of work ("Settings build") — the grouping key for review
116
- verdict fix | accept | rule
117
- scope global | file:<path> | pattern:<name>
118
- rationale one line, required
119
- supersedes id | null
120
- commit short SHA | null
121
- files files the agent touched — evidence for verification
122
- paths where a rule applies (directories or files) — what sweep scans
123
- expect { present?: [..], absent?: [..] } — strings to check in files
124
- verified true | false | null (never checked / not checkable)
125
- candidate C-0001 | null
126
- ```
127
-
128
- Only `rule` verdicts enter `DECISIONS.md`. A `rule` whose scope overlaps an active rule is refused until you say whether it replaces the old one; superseded rules leave the active file and stay in the archive.
129
-
130
- ## Kill conditions
131
-
132
- Fixed before Stage 0 started, per the roadmap. Do not move.
133
-
134
- - **Stage 0** — if only mechanical verdicts get recorded after three weeks of use, the judgment layer isn't real.
135
- - **Stage 4 (candidates / board)** — build only if **5 or more** generated screens are in flight at once. If that never happens, cut it.
136
-
137
- ## Development
138
-
139
- ```bash
140
- npm install
141
- npm run build
142
- npm test
143
- ```
1
+ # Arbiter
2
+
3
+ A decision layer for AI-generated UI. Records the design calls made during agent-assisted UI work — what was chosen, what was rejected, and why — and feeds them back into the agent's context so the same call never has to be made twice.
4
+
5
+ ```bash
6
+ npx arbiterdesign init
7
+ ```
8
+
9
+ That's the whole install. It writes:
10
+
11
+ | File | What it is |
12
+ |---|---|
13
+ | `DECISIONS.md` | Active rules, grouped by dimension. Capped at 40. The agent reads this before UI work. |
14
+ | `.arbiter/archive.md` | Every decision ever, append-only. Never loaded into the agent. |
15
+ | `.arbiter/pending.md` | Decisions the agent queued that you haven't judged yet. |
16
+ | `.arbiter/candidates/` | One page per generated screen or direction, with its state, snapshot, decisions, and why it lost. |
17
+ | `CANDIDATES.md` | Index of candidates — written only when `destination` is `git`. |
18
+ | `.claude/skills/arbiter/SKILL.md` or `.cursor/rules/arbiter.mdc` | Tells the agent to surface its decisions after UI work and record what you confirm. |
19
+ | `arbiter.json` | Config. `destination: "local"`. |
20
+ | `AGENTS.md` | One line appended, pointing at `DECISIONS.md`. Merged, never overwritten. |
21
+ | `CLAUDE.md` (Claude Code) / `.cursor/commands/arbiter.md` (Cursor) | Same pointer line in Claude Code's own context file; a `/arbiter` command for Cursor. |
22
+
23
+ Running `init` twice changes nothing.
24
+
25
+ ## How it works
26
+
27
+ 1. You ask the agent to build a screen. It reads `DECISIONS.md` first.
28
+ 2. You iterate. It says nothing about decisions while you're iterating — each version you move past becomes a rejected alternative on the one that replaced it.
29
+ 3. When you move on, it queues the design calls it made — sized as `feature`, `pattern`, or `polish` — and, after feature-level work, says one line about what changed.
30
+ 4. You judge them when you want — in chat with `/arbiter`, or in the browser with `npx arbiter review`. Grouped by piece of work; each item reads **Change** (what happened) / **Pattern** (the rule) / **Rejected** (what lost). Per item: **Confirm**, **Make it a rule**, **Skip**, or type a correction. Polish is one line per group — **Confirm all**.
31
+ 5. Rules enter `DECISIONS.md`. Everything judged enters the archive. Skips vanish.
32
+
33
+ You can also just say it: *"make that a rule"*, *"reject the tabs, going with a single page"*. It records without asking.
34
+
35
+ Nothing enforces anything. Rules inform generation; they don't gate it.
36
+
37
+ ## Commands
38
+
39
+ ```
40
+ arbiter init install into this project [--destination git]
41
+ arbiter snapshot "<work>" --file x.png a picture for a piece of work (or --capture on macOS); publish carries it
42
+ arbiter record walk through a decision at the terminal
43
+ arbiter record '<json>' record now (what the agent calls)
44
+ arbiter record --pending '<json>' queue for later
45
+ arbiter record P-0003 --as rule judge a queued one: accept | rule | skip | fix --to "…"
46
+ arbiter record --all --as accept judge every queued item [--level polish] [--trigger "Settings build"]
47
+ arbiter record --findings f.json queue a scanner's findings for verdicts
48
+ arbiter record --retire D-0003 --why "…" drop a rule with no replacement
49
+ arbiter review judge the queue in a browser page
50
+ arbiter verify [id] re-check a decision's claim against its files
51
+ arbiter sweep D-0004 [--queue] find existing violations of a mechanical rule
52
+ arbiter candidate add "<name>" track a generated direction [--feature f] [--snapshot img | --capture]
53
+ arbiter candidate C-0002 --state … generated | in_review | approved | rejected | superseded
54
+ arbiter board candidates and their states
55
+ arbiter export static folder of the board for people without the repo [--feature f] [--include-rules] [--open]
56
+ arbiter publish board online at arbiter.design, with comments; prints the share link. Nothing to set up.
57
+ arbiter publish --to <url|pages> your own hosted Arbiter, or GitHub Pages (git destination + export + commit + push)
58
+ arbiter publish --on-push also write a GitHub Actions workflow that republishes on every push, and set its secret
59
+ arbiter pull bring comments and "looks good" reactions down into .arbiter/comments.json
60
+ arbiter drift deviations per screen: accepts, unverified claims, rules broken
61
+ arbiter rules active rules [--dimension <name>] [--json]
62
+ arbiter rules --pending the queue
63
+ arbiter rules --archive everything ever
64
+ arbiter rules D-0003 one decision in full
65
+ arbiter update newest Arbiter: install it, refresh the skill file, re-pin the workflow [--check]
66
+ ```
67
+
68
+ `record` exit codes: `0` recorded · `1` invalid · `2` overlap — re-run with `--supersedes <id>` or `--keep-both` · `3` cap reached · `4` contradicted — the named files don't match the claim.
69
+
70
+ ## Verification
71
+
72
+ A mechanical decision can name `files` and an `expect` — literal strings that must be `present` in / `absent` from them (write `regex:<pattern>` for a pattern, e.g. `regex:#[0-9a-fA-F]{6}\b` for any hex colour). Arbiter reads only those files, never the repo. A claim that doesn't hold is refused. `accept` verdicts are never checked: an exception is a deviation by definition.
73
+
74
+ ## Sweep
75
+
76
+ Recording a mechanical rule with `expect.absent` reports how much existing code breaks it. `arbiter sweep <id>` lists the lines; `--queue` turns each file into a pending item to confirm as an exception or fix. Read-only — fixes are the agent's job. Judgment rules can't sweep.
77
+
78
+ The scan set is the rule's `paths` (directories or files) if it names any, else its `file:` scope, else the whole project. Keep token definitions and reference HTML out with `arbiter.json`:
79
+
80
+ ```json
81
+ { "sweep": { "exclude": ["app/globals.css", "design-reference/**", "docs/**"] },
82
+ "overlap": { "ignore": ["audit", "journey"] } }
83
+ ```
84
+
85
+ `overlap.ignore` lists project words too common to signal that two rules overlap.
86
+
87
+ ## Review page
88
+
89
+ `arbiter review` opens a local page with two tabs. **Decisions** — the queue, grouped by dimension, each card showing the screen it was made for. Confirm / Make it a rule / Skip / Fix; overlaps and contradictions surface inline. **Candidates** — every direction with its snapshot; Approve (with why — kept on the ones it replaces), Reject, In review. Both write the same files as the CLI.
90
+
91
+ ## Export
92
+
93
+ `arbiter export` writes `arbiter-export/` — one `index.html` plus snapshots, no server, no JS. Open it locally or drop the folder on any static host and send the link. It's the stakeholder view only: each screen, its state, who approved, why the others lost, and what was decided in plain words. No verdict controls — feedback comes back through a person. This is the cheap test of whether stakeholders actually look, before anything hosted gets built.
94
+
95
+ ## Hosted board
96
+
97
+ The hosted board at [arbiter.design](https://arbiter.design) serves a board at a share link and lets people comment or say "looks good" after a magic-link sign-in. Git stays the record: the service holds one board version per project and the comments, nothing else. `npx arbiter publish` uploads; `npx arbiter pull` brings comments back, where `arbiter review` shows them beside each screen. Only `publish` and `pull` ever touch the network. The service itself is a separate, private codebase.
98
+
99
+ `npx arbiter publish --on-push` keeps the board current without anyone remembering: it writes `.github/workflows/arbiter.yml`, which runs `publish` when decisions land on the default branch, and sets the `ARBITER_PUBLISH_TOKEN` repository secret through `gh` if it's signed in (otherwise it prints the one-line instruction). Commit the workflow together with `.arbiter/hosted.json`. Under CI, `publish` only ever updates the board that file names — it refuses to create one, so a repo where the file wasn't committed can't mint orphan boards on every push.
100
+
101
+ ## Candidates
102
+
103
+ When several directions are generated for one feature, each is a candidate. A snapshot comes from the agent's browser tool (`--snapshot <image>`) or, on macOS, from you: `--capture` drops into drag-to-select and saves what you pick. Approving one supersedes the rest with the reason kept. Decisions link to a candidate; its page lists them. `npx arbiter publish` does all of the below in one go — switches to git, exports, commits, turns on GitHub Pages through `gh` if it's signed in, pushes, prints the link. It's the only command that touches the network, and only when you run it.
104
+
105
+ With `destination: "git"` in `arbiter.json`, every candidate change commits its page, a `CANDIDATES.md` index, and the export page under `docs/arbiter/` (never pushed). Turn on GitHub Pages for the `docs` folder once, and the board is served at `https://<owner>.github.io/<repo>/arbiter/` — always current, no login, no server. `board` prints the URL. Set `"pages": false` to skip, or `"pages": { "dir": "…", "includeRules": true }` to change it.
106
+
107
+ ## The record
108
+
109
+ ```
110
+ id D-0001, sequential
111
+ date ISO 8601
112
+ author who decided
113
+ class mechanical | judgment
114
+ level feature | pattern | polish — how big a call; polish is never reviewed individually
115
+ dimension structure | interaction | states | content | visual | motion | access
116
+ change what happened, as a PM would say it — what the reviewer reads
117
+ decision the same call as a rule someone could follow — what future sessions read
118
+ rejected alternatives that lost, "<option> — <why>", one line each
119
+ trigger the piece of work ("Settings build") — the grouping key for review
120
+ verdict fix | accept | rule
121
+ scope global | file:<path> | pattern:<name>
122
+ rationale one line, required
123
+ supersedes id | null
124
+ commit short SHA | null
125
+ files files the agent touched — evidence for verification
126
+ paths where a rule applies (directories or files) — what sweep scans
127
+ expect { present?: [..], absent?: [..] } — strings to check in files
128
+ verified true | false | null (never checked / not checkable)
129
+ candidate C-0001 | null
130
+ ```
131
+
132
+ Only `rule` verdicts enter `DECISIONS.md`. A `rule` whose scope overlaps an active rule is refused until you say whether it replaces the old one; superseded rules leave the active file and stay in the archive.
133
+
134
+ ## Kill conditions
135
+
136
+ Fixed before Stage 0 started, per the roadmap. Do not move.
137
+
138
+ - **Stage 0** — if only mechanical verdicts get recorded after three weeks of use, the judgment layer isn't real.
139
+ - **Stage 4 (candidates / board)** — build only if **5 or more** generated screens are in flight at once. If that never happens, cut it.
140
+
141
+ ## Updating
142
+
143
+ Two things go stale independently: the package pinned in your devDependencies, and the skill file `init` copied into the project — the agent's whole protocol. `init` stamps the skill file with the version that wrote it, so Arbiter can tell the two apart with no network: when they differ, the queue's JSON carries `update`, and the agent says one line. `npx arbiter update` installs the newest package, refreshes the skill file from it, and re-pins the publish workflow if there is one. Settings, `DECISIONS.md`, and the archive are untouched. `--check` reports without changing anything. Nothing checks the registry on its own.
144
+
145
+ ## Development
146
+
147
+ ```bash
148
+ npm install
149
+ npm run build
150
+ npm test
151
+ ```
@@ -37,7 +37,7 @@ function addCandidate(name, opts = {}) {
37
37
  feature: opts.feature?.trim() || null,
38
38
  state: 'generated',
39
39
  snapshot: null,
40
- author: opts.author ?? config?.author ?? (0, store_1.gitUserName)(root) ?? node_os_1.default.userInfo().username,
40
+ author: opts.author ?? (0, store_1.gitUserName)(root) ?? config?.author ?? node_os_1.default.userInfo().username,
41
41
  date: (0, store_1.now)(),
42
42
  commit: (0, store_1.currentCommit)(root),
43
43
  supersededBy: null,
@@ -72,55 +72,55 @@ function page(d) {
72
72
  : `<p class="empty">Nothing to show yet.</p>`;
73
73
  const rules = d.rules ? rulesSection(d.rules) : '';
74
74
  const counts = STATE_ORDER.map((s) => [s, d.candidates.filter((c) => c.state === s).length]).filter(([, n]) => n);
75
- return `<!doctype html>
76
- <html lang="en">
77
- <head>
78
- <meta charset="utf-8">
79
- <meta name="viewport" content="width=device-width, initial-scale=1">
80
- <title>${esc(d.project)} — design decisions</title>
81
- <style>
82
- :root { color-scheme: light dark; --bg:#fafaf9; --card:#fff; --ink:#1c1917; --muted:#78716c; --line:#e7e5e4; --tag:#f5f5f4; --ok:#15803d; --bad:#b91c1c; --warn:#b45309; }
83
- @media (prefers-color-scheme: dark) { :root { --bg:#0c0a09; --card:#1c1917; --ink:#fafaf9; --muted:#a8a29e; --line:#292524; --tag:#292524; --ok:#4ade80; --bad:#f87171; --warn:#fbbf24; } }
84
- * { box-sizing: border-box; }
85
- body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,sans-serif; padding:0 20px 80px; }
86
- header, main { max-width: 920px; margin: 0 auto; }
87
- header { padding: 40px 0 8px; }
88
- header h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
89
- header p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
90
- h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 44px 0 14px; }
91
- .cand { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 14px; }
92
- .cand.lesser { grid-template-columns: 220px minmax(0,1fr); padding: 16px 20px; opacity: .85; }
93
- @media (max-width: 680px) { .cand, .cand.lesser { grid-template-columns: 1fr; } }
94
- .shot { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--tag); min-height: 60px; display:flex; align-items:center; justify-content:center; color: var(--muted); font-size: 13px; }
95
- .shot img { display:block; width:100%; height:auto; }
96
- h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
97
- .lesser h3 { font-size: 15px; }
98
- .state { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--tag); color: var(--muted); vertical-align: 2px; margin-left: 8px; }
99
- .state.approved { color: var(--ok); } .state.rejected, .state.superseded { color: var(--bad); } .state.in_review { color: var(--warn); }
100
- .who { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
101
- .reason { font-style: italic; margin: 0 0 12px; }
102
- .decs h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
103
- .decs ul { margin: 0; padding-left: 18px; }
104
- .decs li { margin: 3px 0; }
105
- .decs li small { color: var(--muted); display: block; }
106
- .empty { color: var(--muted); text-align: center; padding: 80px 0; }
107
- .rules { margin-top: 60px; border-top: 1px solid var(--line); padding-top: 30px; }
108
- .rules ul { padding-left: 18px; } .rules li { margin: 6px 0; } .rules li small { color: var(--muted); display: block; }
109
- footer { max-width: 920px; margin: 60px auto 0; color: var(--muted); font-size: 13px; }
110
- </style>
111
- </head>
112
- <body>
113
- <header>
114
- <h1>${esc(d.project)} — design decisions</h1>
115
- <p>${d.candidates.length} screen${d.candidates.length === 1 ? '' : 's'}${counts.length ? ' · ' + counts.map(([s, n]) => `${n} ${STATE_LABEL[s].toLowerCase()}`).join(' · ') : ''} · exported ${d.generated}</p>
116
- </header>
117
- <main>
118
- ${body}
119
- ${rules}
120
- </main>
121
- <footer>Read-only. Feedback goes to whoever owns these decisions — they decide what becomes a rule. Made with Arbiter.</footer>
122
- </body>
123
- </html>
75
+ return `<!doctype html>
76
+ <html lang="en">
77
+ <head>
78
+ <meta charset="utf-8">
79
+ <meta name="viewport" content="width=device-width, initial-scale=1">
80
+ <title>${esc(d.project)} — design decisions</title>
81
+ <style>
82
+ :root { color-scheme: light dark; --bg:#fafaf9; --card:#fff; --ink:#1c1917; --muted:#78716c; --line:#e7e5e4; --tag:#f5f5f4; --ok:#15803d; --bad:#b91c1c; --warn:#b45309; }
83
+ @media (prefers-color-scheme: dark) { :root { --bg:#0c0a09; --card:#1c1917; --ink:#fafaf9; --muted:#a8a29e; --line:#292524; --tag:#292524; --ok:#4ade80; --bad:#f87171; --warn:#fbbf24; } }
84
+ * { box-sizing: border-box; }
85
+ body { margin:0; background:var(--bg); color:var(--ink); font:16px/1.55 -apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,sans-serif; padding:0 20px 80px; }
86
+ header, main { max-width: 920px; margin: 0 auto; }
87
+ header { padding: 40px 0 8px; }
88
+ header h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
89
+ header p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
90
+ h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 44px 0 14px; }
91
+ .cand { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 24px; margin-bottom: 14px; }
92
+ .cand.lesser { grid-template-columns: 220px minmax(0,1fr); padding: 16px 20px; opacity: .85; }
93
+ @media (max-width: 680px) { .cand, .cand.lesser { grid-template-columns: 1fr; } }
94
+ .shot { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--tag); min-height: 60px; display:flex; align-items:center; justify-content:center; color: var(--muted); font-size: 13px; }
95
+ .shot img { display:block; width:100%; height:auto; }
96
+ h3 { font-size: 18px; font-weight: 600; margin: 0 0 4px; letter-spacing: -0.01em; }
97
+ .lesser h3 { font-size: 15px; }
98
+ .state { font-size: 12px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--tag); color: var(--muted); vertical-align: 2px; margin-left: 8px; }
99
+ .state.approved { color: var(--ok); } .state.rejected, .state.superseded { color: var(--bad); } .state.in_review { color: var(--warn); }
100
+ .who { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
101
+ .reason { font-style: italic; margin: 0 0 12px; }
102
+ .decs h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; font-weight: 600; }
103
+ .decs ul { margin: 0; padding-left: 18px; }
104
+ .decs li { margin: 3px 0; }
105
+ .decs li small { color: var(--muted); display: block; }
106
+ .empty { color: var(--muted); text-align: center; padding: 80px 0; }
107
+ .rules { margin-top: 60px; border-top: 1px solid var(--line); padding-top: 30px; }
108
+ .rules ul { padding-left: 18px; } .rules li { margin: 6px 0; } .rules li small { color: var(--muted); display: block; }
109
+ footer { max-width: 920px; margin: 60px auto 0; color: var(--muted); font-size: 13px; }
110
+ </style>
111
+ </head>
112
+ <body>
113
+ <header>
114
+ <h1>${esc(d.project)} — design decisions</h1>
115
+ <p>${d.candidates.length} screen${d.candidates.length === 1 ? '' : 's'}${counts.length ? ' · ' + counts.map(([s, n]) => `${n} ${STATE_LABEL[s].toLowerCase()}`).join(' · ') : ''} · exported ${d.generated}</p>
116
+ </header>
117
+ <main>
118
+ ${body}
119
+ ${rules}
120
+ </main>
121
+ <footer>Read-only. Feedback goes to whoever owns these decisions — they decide what becomes a rule. Made with Arbiter.</footer>
122
+ </body>
123
+ </html>
124
124
  `;
125
125
  }
126
126
  function section(feature, cands, d) {
@@ -136,15 +136,15 @@ function card(c, d) {
136
136
  const decisions = decs.length
137
137
  ? `<div class="decs"><h4>Decided here</h4><ul>${decs.map((x) => `<li>${esc(x.change ?? x.decision)}${x.rejected.length ? `<small>over ${esc(x.rejected.map((r) => r.split(' — ')[0]).join(', '))}</small>` : ''}</li>`).join('')}</ul></div>`
138
138
  : '';
139
- return `<article class="cand${lesser ? ' lesser' : ''}">
140
- <div class="shot">${shot}</div>
141
- <div>
142
- <h3>${esc(c.name)}<span class="state ${c.state}">${state}</span></h3>
143
- <p class="who">${esc(c.author)} · ${c.date.slice(0, 10)}</p>
144
- ${c.reason ? `<p class="reason">“${esc(c.reason)}”</p>` : ''}
145
- ${c.notes ? `<p>${esc(c.notes)}</p>` : ''}
146
- ${decisions}
147
- </div>
139
+ return `<article class="cand${lesser ? ' lesser' : ''}">
140
+ <div class="shot">${shot}</div>
141
+ <div>
142
+ <h3>${esc(c.name)}<span class="state ${c.state}">${state}</span></h3>
143
+ <p class="who">${esc(c.author)} · ${c.date.slice(0, 10)}</p>
144
+ ${c.reason ? `<p class="reason">“${esc(c.reason)}”</p>` : ''}
145
+ ${c.notes ? `<p>${esc(c.notes)}</p>` : ''}
146
+ ${decisions}
147
+ </div>
148
148
  </article>`;
149
149
  }
150
150
  function rulesSection(rules) {