arbiterdesign 0.1.1 → 0.1.2

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.
@@ -71,6 +71,7 @@ function queue(rawJson, opts = {}) {
71
71
  dimension: entry.dimension,
72
72
  verified: entry.verified,
73
73
  pending: pending.length + 1,
74
+ checkin: (0, store_1.readConfig)(paths)?.checkin ?? 'feature',
74
75
  review: 'npx arbiter review',
75
76
  },
76
77
  };
@@ -17,6 +17,7 @@ const format_1 = require("../format");
17
17
  const store_1 = require("../store");
18
18
  function rules(id, opts = {}) {
19
19
  const paths = (0, store_1.resolvePaths)((0, store_1.findRoot)(opts.cwd));
20
+ opts = { ...opts, config: (0, store_1.readConfig)(paths) };
20
21
  const cap = (0, store_1.readConfig)(paths)?.activeCap ?? store_1.ACTIVE_CAP;
21
22
  if (id)
22
23
  return one(id, paths, opts.json);
@@ -59,6 +60,8 @@ function pendingList(pending, opts) {
59
60
  const groups = groupByTrigger(pending);
60
61
  if (opts.json) {
61
62
  return JSON.stringify({
63
+ firstRun: !opts.config?.onboarded,
64
+ checkin: opts.config?.checkin ?? 'feature',
62
65
  count: pending.length,
63
66
  polish: pending.filter((d) => d.level === 'polish').length,
64
67
  groups: groups.map((g) => ({ trigger: g.trigger, items: g.items, polish: g.polish })),
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * `arbiter setup --checkin <feature|quiet|every>` — the one preference the first `/arbiter` asks
4
+ * for, written to arbiter.json. Running it also marks the project as onboarded, so the intro
5
+ * never shows twice. Later: "be quieter" → the agent runs it again.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.CHECKINS = void 0;
9
+ exports.setup = setup;
10
+ const store_1 = require("../store");
11
+ exports.CHECKINS = ['feature', 'quiet', 'every'];
12
+ function setup(opts) {
13
+ const paths = (0, store_1.resolvePaths)((0, store_1.findRoot)(opts.cwd));
14
+ const config = (0, store_1.readConfig)(paths);
15
+ if (!config)
16
+ return { exitCode: 1, output: { status: 'invalid', errors: ['no arbiter.json here — run `npx arbiter init` first'] } };
17
+ const checkin = (opts.checkin ?? config.checkin ?? 'feature');
18
+ if (!exports.CHECKINS.includes(checkin))
19
+ return { exitCode: 1, output: { status: 'invalid', errors: [`--checkin must be one of ${exports.CHECKINS.join(' | ')}`] } };
20
+ const next = { ...config, checkin, onboarded: config.onboarded ?? (0, store_1.now)() };
21
+ (0, store_1.writeConfig)(paths, next);
22
+ return { exitCode: 0, output: { status: 'saved', checkin, onboarded: next.onboarded } };
23
+ }
package/dist/index.js CHANGED
@@ -12,6 +12,7 @@ const export_1 = require("./commands/export");
12
12
  const publish_1 = require("./commands/publish");
13
13
  const pull_1 = require("./commands/pull");
14
14
  const snapshot_1 = require("./commands/snapshot");
15
+ const setup_1 = require("./commands/setup");
15
16
  const rules_1 = require("./commands/rules");
16
17
  const init_1 = require("./commands/init");
17
18
  const review_1 = require("./commands/review");
@@ -123,6 +124,15 @@ program
123
124
  const r = (0, sweep_1.sweepCommand)(id, opts);
124
125
  process.stdout.write(r.text + '\n');
125
126
  });
127
+ program
128
+ .command('setup')
129
+ .description('Save how Arbiter checks in while you work: --checkin feature (one line after big work) | quiet | every. Marks the project as onboarded.')
130
+ .option('--checkin <mode>', 'feature | quiet | every')
131
+ .action((opts) => {
132
+ const result = (0, setup_1.setup)(opts);
133
+ process.stdout.write(JSON.stringify(result.output, null, 2) + '\n');
134
+ process.exit(result.exitCode);
135
+ });
126
136
  program
127
137
  .command('snapshot <work>')
128
138
  .description('Attach a picture to a piece of work, named as its decisions named it: snapshot "Settings build" --file shot.png')
@@ -12,6 +12,7 @@ const node_http_1 = __importDefault(require("node:http"));
12
12
  const record_1 = require("../commands/record");
13
13
  const rules_1 = require("../commands/rules");
14
14
  const review_1 = require("../commands/review");
15
+ const setup_1 = require("../commands/setup");
15
16
  const store_1 = require("../store");
16
17
  const tmp = () => node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'arbiter-pending-'));
17
18
  const input = (over = {}) => JSON.stringify({
@@ -196,3 +197,18 @@ function post(port, p, body) {
196
197
  // And it's in the file as its own line, so a URL never collides with the separator.
197
198
  strict_1.default.match(node_fs_1.default.readFileSync(p.archive, 'utf8'), /^- \*\*Ref:\*\* ENG-2$/m);
198
199
  });
200
+ (0, node_test_1.test)('first /arbiter: the queue reports firstRun until setup records the check-in answer', () => {
201
+ const cwd = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'arbiter-onboard-'));
202
+ (0, store_1.writeConfig)((0, store_1.resolvePaths)(cwd), { version: 1, destination: 'local', author: 'test' });
203
+ const before = JSON.parse((0, rules_1.rules)(undefined, { cwd, pending: true, json: true }));
204
+ strict_1.default.equal(before.firstRun, true);
205
+ strict_1.default.equal(before.checkin, 'feature');
206
+ const r = (0, setup_1.setup)({ cwd, checkin: 'quiet' });
207
+ strict_1.default.equal(r.exitCode, 0);
208
+ const after = JSON.parse((0, rules_1.rules)(undefined, { cwd, pending: true, json: true }));
209
+ strict_1.default.equal(after.firstRun, false);
210
+ strict_1.default.equal(after.checkin, 'quiet');
211
+ const queued = (0, record_1.queue)(JSON.stringify({ change: 'c', decision: 'd', rationale: 'r', trigger: 'T', scope: 'global', dimension: 'visual', class: 'judgment', level: 'polish' }), { cwd, author: 'test' });
212
+ strict_1.default.equal(queued.output.checkin, 'quiet', 'record --pending tells the agent the setting');
213
+ strict_1.default.equal((0, setup_1.setup)({ cwd, checkin: 'loud' }).exitCode, 1, 'unknown modes are refused');
214
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arbiterdesign",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Records design decisions made during agent-assisted UI work and feeds them back into the agent's context.",
5
5
  "homepage": "https://arbiter.design",
6
6
  "repository": {
@@ -23,13 +23,54 @@ Design work is iterative. A screen redesigned six times is one piece of work, no
23
23
  npx arbiter record --pending '<json>'
24
24
  ```
25
25
 
26
- (JSON shape below). Then — **only if the piece of work included a `feature`-level decision** — add one line to your reply carrying its Change line, not a count:
26
+ (JSON shape below). The output carries `checkin`, the user's answer from their first `/arbiter`:
27
+
28
+ - `feature` (default) — **only if the piece of work included a `feature`-level decision**, add one line to your reply carrying its Change line, not a count. At most once per session.
29
+ - `quiet` — say nothing. Ever. They run `/arbiter` when they want it.
30
+ - `every` — one line each time a piece of work settles and you queue, whatever its level.
31
+
32
+ The line, when there is one:
27
33
 
28
34
  ```
29
35
  Queued: Settings is now a tab-row shell with four routes under it (+2 pattern, +4 polish) — /arbiter when you're ready.
30
36
  ```
31
37
 
32
- A count on every reply gets ignored; a sentence about what changed, only after something big, gets read. **At most once per session.** After that, queue silently — the user knows the queue exists. If the work was only patterns and polish, say nothing. Never phrase it as a question ("should we run arbiter?") — it's a statement of what was queued, and the user decides when. Do not show the widget. Do not list the decisions. The queue lives in `.arbiter/pending.md`, so it survives the session; the user can judge it here, in the review page, or never.
38
+ A count on every reply gets ignored; a sentence about what changed, only after something big, gets read. After the line, queue silently — the user knows the queue exists. If the work was only patterns and polish, say nothing. Never phrase it as a question ("should we run arbiter?") — it's a statement of what was queued, and the user decides when. Do not show the widget. Do not list the decisions. The queue lives in `.arbiter/pending.md`, so it survives the session; the user can judge it here, in the review page, or never.
39
+
40
+ ## The first `/arbiter` — intro, then the queue
41
+
42
+ The queue JSON carries `firstRun: true` until the project has been through this once. When it does, before anything else, say this — verbatim, it's been written for the reader:
43
+
44
+ > **Arbiter's on.** While I build UI, I record the design decisions I make — what changed, the rule behind it, what was rejected — so nothing gets re-decided and your team can see why things are the way they are.
45
+ >
46
+ > **How it works**
47
+ > 1. You build as usual. I say nothing about decisions until a piece of work settles — then one line.
48
+ > 2. `/arbiter` shows what's queued. For each: **Confirm**, **Make it a rule**, or **Skip**. Rules go into `DECISIONS.md`, and I read them before touching UI.
49
+ > 3. When you want the team to see it, say **publish** — I'll give you a link to a board they can read and comment on.
50
+ >
51
+ > **Commands**
52
+ > - `/arbiter` — review what's queued
53
+ > - **publish** — say it, get the board link
54
+ > - **"record that"** / **"make that a rule"** — mid-chat, recorded, no questions
55
+
56
+ Then one question, with the selection widget (text fallback: the same three lines, numbered):
57
+
58
+ - **header** — `While you work`
59
+ - **question** — `When should Arbiter check in about decisions?`
60
+ - **options** —
61
+ - `A line after big work` (Recommended) — *When a feature-sized piece settles, one sentence saying what was queued. Never mid-iteration, at most once a session.*
62
+ - `Nothing until I ask` — *Queued silently. /arbiter whenever you want to see it.*
63
+ - `A line after everything` — *One sentence every time a piece of work settles, big or small.*
64
+
65
+ Record the answer — Skip means the recommended one:
66
+
67
+ ```
68
+ npx arbiter setup --checkin feature # A line after big work
69
+ npx arbiter setup --checkin quiet # Nothing until I ask
70
+ npx arbiter setup --checkin every # A line after everything
71
+ ```
72
+
73
+ That also marks the project as onboarded. Then continue with the queue as below; if it's empty, one line: `Nothing queued yet — build something.`
33
74
 
34
75
  **When they ask** — `/arbiter`, "let's review", "what did you decide" — read the queue with `npx arbiter rules --pending --json`. It comes back grouped by piece of work (`groups[].trigger`), feature and pattern items in `items`, polish in `polish`. Present the feature and pattern items (below); polish is never presented individually. Judge each answer with:
35
76
 
@@ -303,6 +344,10 @@ If the project publishes to a hosted board, `npx arbiter pull` brings comments a
303
344
  - When the user says *"approve C-0001, Sam signed off"*: `npx arbiter candidate C-0001 --state approved --why "Sam: <their words>"`.
304
345
  - Never act on a comment the user hasn't pointed at. Don't summarise the comments file unprompted; `arbiter review` shows them beside each screen.
305
346
 
347
+ ## Changing how often Arbiter checks in
348
+
349
+ *"Be quieter about decisions"*, *"stop telling me"*, *"tell me after everything"* — run `npx arbiter setup --checkin quiet|feature|every` and confirm in four words. No question.
350
+
306
351
  ## Retiring a rule
307
352
 
308
353
  If the user says a rule is dead with nothing replacing it — *"we don't need the empty-state rule any more"* — retire it, reason in their words: