arbiterdesign 0.1.2 → 0.1.4

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,183 @@
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 "…" [--candidate C-0001]
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 remove D-0004 take out a record that was never real: a decision, a screen (C-0001),
50
+ or a picture (--snapshot "<work>")
51
+ arbiter unlink D-0004 detach a decision from the screen it was recorded against
52
+ arbiter review judge the queue in a browser page
53
+ arbiter verify [id] re-check a decision's claim against its files
54
+ arbiter sweep D-0004 [--queue] find existing violations of a mechanical rule
55
+ arbiter candidate add "<name>" track a generated direction [--feature f] [--snapshot img | --capture]
56
+ arbiter candidate C-0002 --state … generated | in_review | approved | rejected | superseded
57
+ arbiter board candidates and their states
58
+ arbiter export static folder of the board for people without the repo [--feature f] [--include-rules] [--open]
59
+ arbiter publish board online at arbiter.design, with comments; prints the share link. Nothing to set up.
60
+ arbiter publish --to <url|pages> your own hosted Arbiter, or GitHub Pages (git destination + export + commit + push)
61
+ arbiter publish --on-push also write a GitHub Actions workflow that republishes on every push, and set its secret
62
+ arbiter publish --auto republish whenever the record changes — no GitHub, no CI, no repository needed
63
+ arbiter pull bring comments and "looks good" reactions down into .arbiter/comments.json
64
+ arbiter drift deviations per screen: accepts, unverified claims, rules broken
65
+ arbiter rules active rules [--dimension <name>] [--json]
66
+ arbiter rules --pending the queue
67
+ arbiter rules --archive everything ever
68
+ arbiter rules D-0003 one decision in full
69
+ arbiter update newest Arbiter: install it, refresh the skill file, re-pin the workflow [--check]
70
+ ```
71
+
72
+ `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.
73
+
74
+ ## Screenshots
75
+
76
+ The agent takes one picture per piece of work, when the work settles and it changed how a specific screen looks. Size isn't the test — a polish fix usually lives on one screen and earns a picture; a font or token change has no single screen to point at and doesn't. Motion and anything behavioural can't be carried by a still, so they don't either.
77
+
78
+ The agent's own screenshot tool hands it an image, not a file, so it renders to disk with a headless browser (`chrome --headless --screenshot=…`) and attaches that. When it can't — no browser, app not running, screen behind a login — it says so once, naming the reason, whatever the check-in setting. `--capture` is the manual fallback and is macOS only; elsewhere, save a screenshot and pass `--file`.
79
+
80
+ Name a piece of work after the screen it changed where the work splits that way — `Settings — billing` rather than one `Settings build` across four routes — and one picture per piece of work is one per screen.
81
+
82
+ ## Taking something out
83
+
84
+ Three acts, and only one is a removal.
85
+
86
+ | | What it means | Command |
87
+ |---|---|---|
88
+ | **Retire** | It was real, it's over | `arbiter record --retire D-0003 --why "…"` |
89
+ | **Remove** | It was never real | `arbiter remove D-0004` |
90
+ | **Unlink** | Real, attached to the wrong screen | `arbiter unlink D-0004` |
91
+
92
+ The archive is append-only for judgments: a call you changed your mind about is superseded, and that history is the point. It isn't append-only for mistakes. A test entry, an agent misfire, or a screen invented to work around a bug is a record that says something false, and keeping it forever makes the archive less trustworthy, not more.
93
+
94
+ So `remove` deletes — from the archive, from `DECISIONS.md`, from the candidate files — and prints the full record it removed, because git holds the history only for people who have a repo. It refuses while anything still points at the record: an active rule (retire it), a decision another one supersedes, or a screen with decisions still linked (`--force` unlinks them in one go).
95
+
96
+ `arbiter remove --snapshot "<work>"` takes only the picture; the work and its decisions stay, and the board keeps the old image until the next publish.
97
+
98
+ ## Verification
99
+
100
+ 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.
101
+
102
+ ## Sweep
103
+
104
+ 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.
105
+
106
+ 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`:
107
+
108
+ ```json
109
+ { "sweep": { "exclude": ["app/globals.css", "design-reference/**", "docs/**"] },
110
+ "overlap": { "ignore": ["audit", "journey"] } }
111
+ ```
112
+
113
+ `overlap.ignore` lists project words too common to signal that two rules overlap.
114
+
115
+ ## Review page
116
+
117
+ `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.
118
+
119
+ ## Export
120
+
121
+ `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.
122
+
123
+ ## Hosted board
124
+
125
+ 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.
126
+
127
+ Two ways to keep the board current without anyone remembering.
128
+
129
+ `npx arbiter publish --auto` is the one that works anywhere. It sets `hosted.auto` in `arbiter.json`, and from then on the board republishes whenever the record changes — after judging, after a screen changes state, after a picture is attached or removed. No GitHub, no CI, no git repository. Queueing decisions doesn't trigger it, since the queue is never published. If a republish fails — offline, service down — the command still succeeds and says the board is behind; the record is already written, and git is what holds it. `--no-auto` turns it off.
130
+
131
+ `npx arbiter publish --on-push` is the GitHub route, and 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.
132
+
133
+ ## Candidates
134
+
135
+ 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.
136
+
137
+ 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.
138
+
139
+ ## The record
140
+
141
+ ```
142
+ id D-0001, sequential
143
+ date ISO 8601
144
+ author who decided
145
+ class mechanical | judgment
146
+ level feature | pattern | polish — how big a call; polish is never reviewed individually
147
+ dimension structure | interaction | states | content | visual | motion | access
148
+ change what happened, as a PM would say it — what the reviewer reads
149
+ decision the same call as a rule someone could follow — what future sessions read
150
+ rejected alternatives that lost, "<option> — <why>", one line each
151
+ trigger the piece of work ("Settings build") — the grouping key for review
152
+ verdict fix | accept | rule
153
+ scope global | file:<path> | pattern:<name>
154
+ rationale one line, required
155
+ supersedes id | null
156
+ commit short SHA | null
157
+ files files the agent touched — evidence for verification
158
+ paths where a rule applies (directories or files) — what sweep scans
159
+ expect { present?: [..], absent?: [..] } — strings to check in files
160
+ verified true | false | null (never checked / not checkable)
161
+ candidate C-0001 | null
162
+ ```
163
+
164
+ 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.
165
+
166
+ ## Kill conditions
167
+
168
+ Fixed before Stage 0 started, per the roadmap. Do not move.
169
+
170
+ - **Stage 0** — if only mechanical verdicts get recorded after three weeks of use, the judgment layer isn't real.
171
+ - **Stage 4 (candidates / board)** — build only if **5 or more** generated screens are in flight at once. If that never happens, cut it.
172
+
173
+ ## Updating
174
+
175
+ 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.
176
+
177
+ ## Development
178
+
179
+ ```bash
180
+ npm install
181
+ npm run build
182
+ npm test
183
+ ```
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ /**
3
+ * Keeping a board current without GitHub, CI, or even a git repository.
4
+ *
5
+ * `publish --on-push` needs GitHub Actions, which needs GitHub. A git hook would at least need a
6
+ * repository. Plenty of projects have neither — local only, or deployed straight to a server — and
7
+ * for them the board goes stale the moment someone forgets to publish.
8
+ *
9
+ * The board changes when the record changes, so that's the moment to republish: after judging,
10
+ * after a screen changes state, after a picture is attached or removed. `hosted.auto` in
11
+ * arbiter.json turns it on. Nothing watches anything; this runs inside a command the user ran.
12
+ *
13
+ * Still only two things touch the network — publish and pull — and this is publish, switched on
14
+ * deliberately in a committed file where everyone on the project can see it.
15
+ */
16
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
+ if (k2 === undefined) k2 = k;
18
+ var desc = Object.getOwnPropertyDescriptor(m, k);
19
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
+ desc = { enumerable: true, get: function() { return m[k]; } };
21
+ }
22
+ Object.defineProperty(o, k2, desc);
23
+ }) : (function(o, m, k, k2) {
24
+ if (k2 === undefined) k2 = k;
25
+ o[k2] = m[k];
26
+ }));
27
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
29
+ }) : function(o, v) {
30
+ o["default"] = v;
31
+ });
32
+ var __importStar = (this && this.__importStar) || (function () {
33
+ var ownKeys = function(o) {
34
+ ownKeys = Object.getOwnPropertyNames || function (o) {
35
+ var ar = [];
36
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
+ return ar;
38
+ };
39
+ return ownKeys(o);
40
+ };
41
+ return function (mod) {
42
+ if (mod && mod.__esModule) return mod;
43
+ var result = {};
44
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
+ __setModuleDefault(result, mod);
46
+ return result;
47
+ };
48
+ })();
49
+ Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.autoPublishOn = autoPublishOn;
51
+ exports.autoPublish = autoPublish;
52
+ const hosted_1 = require("./hosted");
53
+ const store_1 = require("./store");
54
+ /** Off unless arbiter.json says `hosted.auto` and the project has been published once. */
55
+ function autoPublishOn(cwd) {
56
+ const paths = (0, store_1.resolvePaths)((0, store_1.findRoot)(cwd));
57
+ return !!(0, store_1.readConfig)(paths)?.hosted?.auto && !!(0, hosted_1.readLink)(paths);
58
+ }
59
+ /**
60
+ * Republish, if it's on. Returns a line to print, or null. Never throws and never changes an exit
61
+ * code: a board that failed to update is worth a sentence, not a failed command — the record is
62
+ * already written, and git is what actually holds it.
63
+ */
64
+ async function autoPublish(cwd) {
65
+ if (!autoPublishOn(cwd))
66
+ return null;
67
+ const link = (0, hosted_1.readLink)((0, store_1.resolvePaths)((0, store_1.findRoot)(cwd)));
68
+ const { publish } = await Promise.resolve().then(() => __importStar(require('./commands/publish')));
69
+ try {
70
+ // Always the board this project is already linked to. Falling through to the default host
71
+ // would create a second, empty board somewhere else entirely.
72
+ const r = await publish({ cwd, to: link.url });
73
+ if (r.ok && r.url)
74
+ return `Board updated — ${r.url}`;
75
+ const failed = r.steps.find((s) => s.outcome === 'failed');
76
+ return `Board not updated: ${failed?.note ?? 'publish failed'} — run \`npx arbiter publish\` when you can.`;
77
+ }
78
+ catch (e) {
79
+ return `Board not updated: ${e.message} — run \`npx arbiter publish\` when you can.`;
80
+ }
81
+ }
@@ -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) {