@allocator-one/harness-cli 1.14.0 → 1.15.0

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/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  # @allocator-one/harness-cli
2
2
 
3
3
  The `harness` CLI and MCP server for [Harness](https://harness.infra.one),
4
- allocator.one's issue tracker. It is a standalone Node client that keeps no
5
- local issue state. Issues live on the server, so there is nothing to commit or
6
- sync.
4
+ allocator.one's issue tracker. The same CLI is also published as
5
+ `@allocator-one/operator`, under the command `operator`, for driving
6
+ Operator from the terminal and any agent (see
7
+ [Two names](#two-names-harness-and-operator)). It is a standalone Node client
8
+ that keeps no local issue state. Issues live on the server, so there is
9
+ nothing to commit or sync.
7
10
 
8
11
  ## Install
9
12
 
@@ -18,8 +21,54 @@ Or run it without installing:
18
21
  npx -y @allocator-one/harness-cli ready
19
22
  ```
20
23
 
24
+ The same CLI under its Operator name, as the `operator` command:
25
+
26
+ ```sh
27
+ npm i -g @allocator-one/operator
28
+ operator --help
29
+ ```
30
+
31
+ ```sh
32
+ npx -y @allocator-one/operator --help
33
+ ```
34
+
21
35
  Requires Node >= 20.
22
36
 
37
+ ## Two names: `harness` and `operator`
38
+
39
+ One build ships as two npm packages, always at the same version from the
40
+ same release. Each installs one command:
41
+
42
+ | Package | Command |
43
+ | --- | --- |
44
+ | `@allocator-one/harness-cli` | `harness` |
45
+ | `@allocator-one/operator` | `operator` |
46
+
47
+ Install either package or both. They don't conflict, and `npx -y` or
48
+ `pnpm dlx` runs the package's one command.
49
+
50
+ Both names run the same code against the same server and share everything
51
+ stored locally: the login in `~/.config/harness/credentials.json`, the repo
52
+ config, the caches and the `HARNESS_*` environment variables. Sign in with
53
+ `operator login` or `harness login` and both commands are signed in.
54
+ `logout` under either name signs both out.
55
+
56
+ Only the presentation depends on the name you typed:
57
+
58
+ - `operator --help` lists the Operator commands first (today `jobs`,
59
+ `job`, `watch`, `steer`, `cancel`, `pause`, `continue`, `procedure`, `plan`, `gate`, `conditions`, `assignments`, `tools`, `tool`, `skills` and `mcp`), then the issue-tracker commands under "Issues:", then
60
+ sign-in and housekeeping under "General:". `harness --help` is unchanged,
61
+ with one flat list of commands.
62
+ - `operator mcp` serves the MCP server under the name `operator`, and
63
+ `harness mcp` under `harness`. The tools are the same.
64
+
65
+ Messages, exit codes and `--json` output are the same under both names, so
66
+ a script written for `harness` works with `operator` unchanged. The CLI
67
+ tells the names apart by the command path it was started with. Launchers
68
+ that start it by its file path instead, such as npm's Windows shims, pnpm,
69
+ Volta and Yarn PnP, hide that path. In that case the CLI goes by the
70
+ package that installed it, which gives the same answer.
71
+
23
72
  ## Sign in
24
73
 
25
74
  You don't need to configure anything. Commands target
@@ -35,7 +84,11 @@ worktree, and agent slot on the machine.
35
84
  - `harness logout`: revokes the stored login on the server and deletes it
36
85
  locally.
37
86
  - `harness whoami`: shows the resolved host and where the credential came
38
- from.
87
+ from. With an outside expert's `pxc_…` credential it also names the
88
+ expert's role and plan (see [Outside experts](#outside-experts)).
89
+
90
+ `operator login`, `operator logout` and `operator whoami` are the same
91
+ commands and use the same stored login.
39
92
 
40
93
  The automatic login only runs when stdout is a terminal and `CI` is unset
41
94
  or empty. Elsewhere (agents, CI, pipes), a command that has no credential
@@ -43,7 +96,8 @@ prints how to authenticate and exits with code `2`. For those headless
43
96
  contexts, mint an `aone_…` API token (admin → API tokens) with the
44
97
  `harness:read` scope, adding `harness:write` if the workflow changes
45
98
  anything (claim, create, update, comment, close), and export it as
46
- `HARNESS_API_TOKEN`.
99
+ `HARNESS_API_TOKEN`. An outside expert uses their `pxc_…` credential the
100
+ same way (see [Outside experts](#outside-experts)).
47
101
 
48
102
  > **Never set `HARNESS_API_TOKEN` or `HARNESS_ACTOR` in an interactive
49
103
  > session.** The browser login attributes writes to the real user, and
@@ -111,10 +165,22 @@ prints the full, untruncated comment thread with comment ids. The
111
165
  (`yes, by CLI-3 (cancelled), CLI-4 (archived), CLI-5`). When the issue has
112
166
  wait conditions, `Waiting:` says how many still hold it, and a
113
167
  `Wait conditions:` section lists each one (`[ ] gate "Finance sign-off" · <id>`,
114
- `[x] not before … (satisfied …)`, `system event`) with the id
168
+ `[ ] gate "Compliance sign-off" [compliance] owned by Compliance officer (role:compliance_officer) · <id>`,
169
+ `[x] not before … (satisfied …)`, `system event`) with the key and id
115
170
  `harness gate satisfy` takes.
116
171
  `harness activity <id>` prints the issue's activity timeline: comments,
117
- creation, and state and assignee changes. It shows the newest 20 entries
172
+ creation, state and assignee changes, wait-condition events
173
+ (`Ada satisfied the gate "Finance sign-off"`), and field changes
174
+ (`changed priority from High to Urgent`, `renamed the issue from “…” to “…”`,
175
+ `edited the description`, `added label regression and removed label idea`,
176
+ `set the parent to CLI-3`, `archived the issue`). A description edit records
177
+ only that it happened, never the text. When a write was made under an agent
178
+ or CLI label, the person comes first and the label follows in quotes:
179
+ `Ada via “Claude Code” moved the issue from Backlog to In progress`. A field
180
+ this CLI does not know yet prints as `changed the <field> field`; `--json`
181
+ passes every entry through as the server sent it. A server that does not
182
+ record field changes yet refuses to serve them; the timeline then comes
183
+ without them, and a stderr notice says so. It shows the newest 20 entries
118
184
  (`--limit` accepts 1–100), and `--all` reads further back.
119
185
 
120
186
  **Create.** Creating an issue before you write code keeps the work tracked:
@@ -263,6 +329,7 @@ harness plan create --file plan.yaml --team IO --idempotency-key q3-report
263
329
  harness plan show <plan-id>
264
330
  harness plan release <plan-id> --collaborator grace@example.com
265
331
  harness gate satisfy IO-121 "Finance sign-off"
332
+ harness gate satisfy IO-121 compliance # by the gate's key
266
333
  ```
267
334
 
268
335
  **The plan file** is the API's request body, as JSON (`.json`) or YAML
@@ -287,6 +354,9 @@ steps:
287
354
  conditions:
288
355
  - kind: gate
289
356
  label: Finance sign-off
357
+ - gate: compliance # a gate with this key; the label defaults to it
358
+ label: Compliance sign-off
359
+ owner: role:compliance_officer
290
360
  - key: send
291
361
  title: Send the report
292
362
  blocked_by: [review]
@@ -306,6 +376,16 @@ steps:
306
376
  `target_id`). The allowed events are `deal_stage_changed`,
307
377
  `opportunity_stage_changed`, `form_submitted`, and `investment_executed`.
308
378
  Every condition must hold before the step is ready.
379
+ - A gate can carry a `key`, a lowercase slug (`a-z`, `0-9` and `-`) unique
380
+ among the step's gates, which `gate satisfy` accepts. `gate: <key>` is
381
+ shorthand for `kind: gate` with that key, labelled with the key unless
382
+ `label` is given. A gate can also have an `owner`: `role:<role>` (one of
383
+ the fund-team roles `gp`, `compliance_officer`, `valuer`, `accountant`,
384
+ `auditor` and `counsel`), `user:<id or email>` (a member who can use
385
+ Operator), or `expert:<email>` (an outside expert, never a member's
386
+ email). Only the owner can tick an owned gate. You can't name yourself as
387
+ an owner, and that includes a role you hold. `owner: null` or no owner
388
+ leaves the gate unowned.
309
389
  - A plan has at most 100 steps, its root included.
310
390
  - `--team` (or `HARNESS_TEAM` or the repo config) is the root's team and the
311
391
  default team for people's steps. `--idempotency-key` works as it does for
@@ -322,13 +402,39 @@ harness: The plan is not valid; nothing was changed (HTTP 422)
322
402
  plan: A plan with Operator steps needs a positive spend budget [spend_budget_required]
323
403
  ```
324
404
 
405
+ A gate's owner is checked the same way. The owner violations are
406
+ `invalid_owner`, `unknown_role`, `unknown_owner`, `owner_is_member`,
407
+ `owner_is_actor` (you named yourself), `owner_not_allowed` (an owner on a
408
+ condition that is not a gate), `expert_owner_requires_plan`, and
409
+ `duplicate_gate_key`. A `gate:` that conflicts with the condition's `kind`
410
+ or `key` is `invalid_condition`.
411
+
325
412
  **Show.** `harness plan show <plan-id>` prints the plan's status, budgets,
326
413
  revision, and spend estimate, then every step in tree order (indented by
327
414
  depth) with its key, executor, state, and status. The status is `ready`,
328
415
  `held` (edited since the release), `not in revision` (added after it),
329
416
  `waiting` (on a wait condition), `container`, `done`, `cancelled`,
330
417
  `archived`, or `-`. The edges and each step's wait conditions come after
331
- the steps.
418
+ the steps. Each gate shows its key and owner. A `Waiting for:` section then
419
+ lists the open gates each step waits for, with the gate's owner and the
420
+ people who can tick it. When nobody can, it says `nobody can tick`:
421
+
422
+ ```text
423
+ Waiting for:
424
+ IO-121 "Compliance sign-off" [compliance] · Compliance officer (role:compliance_officer) · can tick: Ada Lovelace, Grace Hopper (expert, Acme LLP)
425
+ IO-122 "Legal review" [legal] · Bob Smith (user:7d3c2a1e-5b4f-4c8d-9e0a-1f2b3c4d5e6f) · nobody can tick
426
+ IO-123 "Smoke test" · no owner, anyone with standing can tick
427
+ ```
428
+
429
+ An owner shows as its name followed by how the server names it: a role
430
+ (`Compliance officer (role:compliance_officer)`), a member by user id
431
+ (`Bob Smith (user:<uuid>)`, even when the plan document named them by
432
+ email), or an outside expert by email (`val@example.com (expert)`).
433
+
434
+ `--json` prints the plan as the server sends it, including each step's
435
+ `waiting_for` (`condition_id`, `key`, `label`, `owner`, and `holders`:
436
+ `[]` when nobody can tick, `null` for an unowned gate or when the holders
437
+ are not known).
332
438
 
333
439
  **Edit.** `harness plan edit <plan-id> --file edits.yaml` changes step
334
440
  executors and keys, naming each step by its `step` key or `issue`
@@ -356,14 +462,379 @@ pauses every step until the plan is released again.
356
462
 
357
463
  **Gates.** `harness gate satisfy <issue> <gate>` ticks a gate and
358
464
  `harness gate unsatisfy <issue> <gate>` unticks it. `<gate>` is the gate's
359
- label or its condition id from `harness show`. A label matches exactly
360
- first, then ignoring case, and a label that more than one gate carries is
361
- refused with their ids. Ticking a gate requires staff standing in the
362
- organization.
465
+ key, its label, or its condition id, all shown by `harness show`. None of
466
+ the three outranks the others: when `<gate>` exactly matches more than one
467
+ condition, say one gate's key and another gate's label, the command
468
+ refuses and lists each one's id, key, and label instead of choosing. Pass
469
+ the condition id of the one you mean. Only when nothing matches exactly
470
+ does a label or key match ignoring case, and that too is refused when more
471
+ than one gate matches. Ticking a gate requires staff standing in the
472
+ organization or a place in its plan's room. Only the owner can tick an
473
+ owned gate, and only its owner or Harness staff can untick it. Anyone else
474
+ gets an error that names the gate's owner as of the refusal, which the
475
+ server sends with it, and exits `1`:
476
+
477
+ ```text
478
+ harness: Cannot satisfy gate "Compliance sign-off" on IO-121: only its owner, Compliance officer (role:compliance_officer), can tick it (HTTP 403)
479
+ ```
480
+
481
+ A gate with no owner by then gets the same error without a name. Against
482
+ a server that does not send the owner, the command reads the conditions
483
+ again to find it.
484
+
485
+ **Conditions.** `harness conditions <issue>` lists an issue's wait
486
+ conditions, oldest first, one per line as `show` lists them: each one's
487
+ box, what it waits for (a gate's label, key and owner), when and by whom it
488
+ was satisfied, and its id. `--json` is the list as the server sends it.
363
489
 
364
490
  A server without the plan API answers the plan commands with a 404, and the
365
491
  error says that the server may predate plans.
366
492
 
493
+ ## Outside experts
494
+
495
+ An outside expert invited to a plan can hold a `pxc_…` credential. The
496
+ expert mints it in their own expert view, with a fresh code from their
497
+ authenticator app, and it lasts at most 30 days. It reaches only:
498
+
499
+ - their assignments (`GET /api/v1/expert/assignments`);
500
+ - on a step assigned to them, the gates they own: listed, ticked and
501
+ unticked.
502
+
503
+ To the CLI it is an ordinary bearer credential. In a terminal, paste it
504
+ into `harness login --no-browser`, which verifies it against the
505
+ assignments and stores it like any login. For an agent or a script, export
506
+ it as `HARNESS_API_TOKEN`. Writes are attributed to the expert's own
507
+ account either way.
508
+
509
+ ```sh
510
+ harness login --no-browser # paste the pxc_ credential
511
+ harness whoami # the expert's role and plan
512
+ harness assignments # their steps, and the gates they own on each
513
+ harness conditions IO-130 # their gates on one step
514
+ harness gate satisfy IO-130 valuation # tick one, by key, label or id
515
+ ```
516
+
517
+ `harness whoami` says the credential is an outside expert's and names the
518
+ expert's role, the plan and how many steps are assigned to them:
519
+
520
+ ```text
521
+ Host: https://harness.infra.one (via stored login)
522
+ Credential: stored login, an outside expert's pxc_ credential
523
+ Expert: Valuer on plan 0b6f5e9a-6c1e-4d3f-9a39-2f1f8f7e4c11 (released) · 1 assigned step
524
+ Reaches: its own assignments and the gates it owns on them (assignments, conditions, gate)
525
+ Verified: ok (server API 1.4.693)
526
+ ```
527
+
528
+ `whoami --json` always carries `expert`: `null` for any other credential,
529
+ and for a `pxc_…` one `{id, role, plan: {id, status} | null,
530
+ assigned_steps}`, beside the usual `url`, `source`, `verified`,
531
+ `server_version` and `host_source`.
532
+
533
+ `harness assignments` lists each step assigned to the expert that they
534
+ still hold, in identifier order: its state, due date, how many open issues
535
+ block it, the gates on it they own, and its description (left out for a
536
+ step Operator runs). The expert view never names a member: a gate shows its
537
+ owner as a role, or `you` for the expert's own gate, and who ticked it as
538
+ `you`, the role it was ticked as, `an outside expert` or `a member`.
539
+ `--json` is the server's data unchanged: `expert` (`{id, role}`), `plan`
540
+ (`{id, status}` or `null`) and `assignments`, each with `identifier`,
541
+ `title`, `description`, `state` (`{name, type}`), `due_date`,
542
+ `open_blockers` and `gates`. Any other credential gets a 403
543
+ (`expert_credential_required`).
544
+
545
+ `harness conditions <issue>` and `harness gate satisfy|unsatisfy` read and
546
+ tick only the expert's own gates. After a tick the CLI counts only the
547
+ expert's own gates still open, because the step's other conditions are out
548
+ of the expert's view. A step that isn't assigned to the expert answers 404,
549
+ which the error says.
550
+
551
+ **Every other command that reads or changes Harness or Operator data is
552
+ refused** with a 403 `expert_bound_credential`, reads and writes alike.
553
+ (`whoami`, `version`, `login` and `logout` keep working: they use only the
554
+ routes the credential reaches.) The CLI says what the credential reaches
555
+ and exits `1`:
556
+
557
+ ```text
558
+ harness: This expert credential may only read its own assignments and tick its own gates — an outside expert's pxc_ credential only lists its own assignments and reads and ticks the gates it owns on them: assignments, conditions <issue> and gate satisfy|unsatisfy (assignment_list, condition_list and gate_set over MCP) (HTTP 403)
559
+ ```
560
+
561
+ The platform reads the credential, the expert's seat and the account again
562
+ on every request. An expired or revoked credential, a revoked or ended
563
+ seat, a suspended account or a changed authenticator answers 401 at once.
564
+ With a `pxc_…` credential the error lists those causes, and the command
565
+ exits `1`. If the seat is still open, mint a new credential in the expert
566
+ view. `harness logout` forgets a stored `pxc_…` credential without
567
+ revoking it, because the session route refuses it; revoke it in the expert
568
+ view to end it at once. Storing a `pxc_…` credential replaces (and
569
+ revokes) a stored member login, so log in again to use the other
570
+ commands.
571
+
572
+ ## Operator jobs
573
+
574
+ `jobs`, `job` and `watch` read the Operator jobs you see in the Chat Mode
575
+ workbench, in the organization your credential belongs to. They need the
576
+ `operator:read` scope (a browser login carries it) and an admin or member
577
+ role there.
578
+
579
+ ```sh
580
+ harness jobs --status waiting --mine
581
+ harness job <job-id>
582
+ harness watch <job-id>
583
+ ```
584
+
585
+ Everything is by reference: states, codes, counts, ids and workbench links.
586
+ None of them shows a job's objective text, because the API never returns it:
587
+ it can quote what Operator read. Each job shows its `objective_kind` and the
588
+ workbench link where its objective can be read instead. Approval happens in the
589
+ app. No command approves anything; they print the approval link.
590
+
591
+ - `harness jobs` lists jobs newest first, with their state, what they wait
592
+ on, kind, owner and plan step, followed by the approval link of each job
593
+ waiting for approval. `--status` takes comma-separated job states (`draft`,
594
+ `planning`, `ready`, `running`, `waiting_for_approval`,
595
+ `waiting_for_human`, `paused`, `failed`, `needs_reconciliation`,
596
+ `completed`, `cancelled`) or the aliases `open` (not done), `waiting` and
597
+ `done`. `--mine` lists only your own jobs. Pages hold 20 jobs (`--limit`,
598
+ at most 50). A page can come back short, or even empty, while older jobs
599
+ exist, because the server drops the jobs you may not see after reading
600
+ the page. stderr says so. `--all` follows every page, 50 jobs each unless
601
+ `--limit` says otherwise, for up to 100 pages; past that it stops, exits
602
+ `1` and asks you to narrow the list with `--status` or `--mine`.
603
+ - `harness job <job-id>` shows the job's status, plan version, progress,
604
+ remaining window and budget, spend, the change set waiting for approval
605
+ with its link, the grant, verification, effect counts, blockers,
606
+ artifacts, pinned skill, people, saved procedures, and what you can do
607
+ in the workbench.
608
+ - `harness job <job-id> --changes` shows the job's latest change set
609
+ instead, by reference: its id, version, status, digest and plan version,
610
+ and each action's type, version, order, effect count, required
611
+ capabilities and digest, with the approval link. Values and targets never
612
+ leave the app; review them there. A job that has proposed nothing prints
613
+ "No pending change set" (`change_set` is `null` under `--json`).
614
+ - `harness job <job-id> --people` shows who is on the job, by name: the
615
+ requester, the execution principal (the person it runs as), the owner,
616
+ the approvers and the collaborators. A person the job doesn't name shows
617
+ as their user id; the API never sends emails. Pass both flags to see
618
+ both, and `--json` returns them under the job's id, state, link and
619
+ approval link.
620
+ - `harness watch <job-id>` prints the job's events and state changes as
621
+ they happen, polling every 2 seconds, until the job completes, fails or
622
+ is cancelled, or a person has to act. A person has to act exactly when
623
+ the job's `waiting_on` is set: an approval, a person, reconciliation,
624
+ verification or delivery. `watch` stops there with the link to act on:
625
+ the approval link when the job waits for approval. A job paused with
626
+ nothing for a person to do, such as one whose deliveries are still
627
+ sending, resumes by itself, so `watch` keeps following it, every 10
628
+ seconds. `--through-waits` follows through a person's waits too, also
629
+ every 10 seconds. `--after <seq>` starts after an event sequence instead
630
+ of replaying the history. `--json` prints one document when the watch
631
+ ends, with the outcome, the job's last state, the events read (ids, codes,
632
+ numbers and booleans only), and `next_after` to resume from.
633
+ - `watch` only reads, so it retries a failed poll three times (after 1, 2
634
+ and 4 seconds, or longer when the server sends `Retry-After`) when the API
635
+ is unreachable, answers with a 5xx, or rate-limits. If the poll still
636
+ fails, or you press Ctrl-C, stderr names the `--after` to resume from, and
637
+ `--json` still prints the document with the events read so far. When the
638
+ reader of its output goes away (`watch <id> | head -1`), it stops polling
639
+ and exits quietly.
640
+
641
+ `watch` exits `0` when the job completed, `4` when a person has to act,
642
+ `5` when the job failed or was cancelled, and `130` on Ctrl-C (see
643
+ [Scripting contract](#scripting-contract)).
644
+
645
+ A 403 names why the server refused: Operator switched off for the
646
+ organization (`operator_disabled`), no admin or member role there
647
+ (`operator_not_permitted`), a credential that acts as no person
648
+ (`actor_required`), or a missing `operator:read` scope (`forbidden`). A job
649
+ that does not exist, is in another organization, or is not shared with you
650
+ answers the same 404.
651
+
652
+ ## Steering, cancelling and pausing a job
653
+
654
+ `steer`, `cancel` and `pause` change or stop an Operator job the way the
655
+ workbench's controls do, under the same rules and with your current
656
+ authority. They need the `operator:write` scope (a browser login carries it)
657
+ and an admin or member role in the organization.
658
+
659
+ ```sh
660
+ harness steer <job-id> "Only use the audited Q3 figures"
661
+ harness steer <job-id> --instruction-file instruction.md # "-" reads stdin
662
+ harness cancel <job-id>
663
+ harness pause <job-id>
664
+ ```
665
+
666
+ - `harness steer <job-id> <instruction>` posts the instruction in the job's
667
+ room, attributed to you, wherever the app offers Steer. The job's owner
668
+ and collaborators may steer. Work the instruction changes needs a fresh
669
+ approval: earlier approvals stop applying to it. Steering a running job
670
+ stops its current run so it can take the instruction. An instruction is 1
671
+ to 10,000 characters once trimmed, and is sent trimmed; a longer or blank
672
+ one is refused before anything is sent (exit `2`). Quote it: unquoted
673
+ words that look like options (`--json`, `--help`) are read as options, not
674
+ text. Put `--` before an instruction that starts with `-`, or pass it with
675
+ `--instruction-file <path>` (`-` for stdin), which takes any text as it
676
+ is. Words and `--instruction-file` together are a usage error.
677
+ - `harness cancel <job-id>` ends the job. Effects already committed stay
678
+ committed, and the command prints their counts; staged effects that never
679
+ ran count as unknown.
680
+ - `harness pause <job-id>` holds a running job for a person without
681
+ resetting its active-time budget. Continue it to run again.
682
+
683
+ Only the job's execution principal may cancel or pause it. Each command
684
+ prints the job as `job` shows it afterwards (`--json`: the same document),
685
+ and approving still happens in the app.
686
+
687
+ None of them is idempotent, so the CLI sends each one once and never retries
688
+ it, not even after a timeout or a server error. What a failure means depends
689
+ on whether the request can have reached the server:
690
+
691
+ - It cannot have (the name did not resolve, the connection was refused, the
692
+ TLS handshake failed): nothing changed, and the command exits `3` like
693
+ any unreachable API.
694
+ - It may have (a timeout, a dropped connection, a 5xx, an answer that cannot
695
+ be read): the outcome is unknown. The command exits `1` and says so; check
696
+ `harness job <job-id>` before trying again.
697
+
698
+ The server's message comes first, followed by what to do about it:
699
+
700
+ | Status | Code | Meaning |
701
+ | --- | --- | --- |
702
+ | 400 | `bad_request` | The request carried a field the server does not accept. Nothing changed; update the CLI. |
703
+ | 403 | `principal_required` | `cancel` and `pause` are the job's execution principal's own. Its owner or a collaborator can still steer it, which stops its current run. |
704
+ | 403 | `operator_disabled`, `operator_not_permitted`, `actor_required`, `forbidden`, `run_bound_credential` | As for `jobs`, except that `forbidden` means a missing `operator:write` scope. |
705
+ | 404 | `not_found` | The job does not exist, is in another organization, or is not shared with you. |
706
+ | 409 | `invalid_state` | The app wouldn't offer the control now: Steer on a finished, failed or awaiting-approval job (or one needing reconciliation), Cancel on a job that already ended, Pause on a job that isn't running. |
707
+ | 409 | `reconciliation_required` | Steer: partial effects need reconciling in the app first. |
708
+ | 409 | `deliveries_unsettled` | Steer: a delivery is still sending, or its outcome is unknown. If `job` shows the job waiting on delivery, settle it in the app (an unknown delivery never settles by itself); otherwise steer again once it has sent. |
709
+ | 409 | `principal_inactive` | The job's execution principal no longer holds the rights to run it. Nothing changed. |
710
+ | 409 | `cancellation_scope_changed` | Cancel: the job's work changed while it was being cancelled. It was not cancelled; read it and decide again. |
711
+ | 422 | `invalid_instruction`, `validation_error` | Steer: the instruction is blank or too long, or the job's room refused it. |
712
+
713
+ ## Continue and saved procedures
714
+
715
+ ```sh
716
+ harness continue <job-id> # a new window for a job, as Continue does in the app
717
+ harness procedure save <job-id> --name "Monthly close" # save a verified job as a procedure
718
+ harness procedure show <procedure-id> # its versions and the parameters a run takes
719
+ harness procedure run <procedure-id> --param period=2026-09 --param count:=3
720
+ harness procedure run <procedure-id> --params-file params.json --version 2
721
+ ```
722
+
723
+ They act with the authority, budgets and kill controls of the Chat Mode
724
+ workbench, and need the `operator:write` scope (a browser login carries it;
725
+ `procedure show` needs `operator:read`).
726
+
727
+ - `continue` opens a new audited window for a job that ran out of time or
728
+ waits on a person, or retries a failed run or verification, exactly as
729
+ Continue does in the app. Only the job's execution principal, the person
730
+ it runs as, may continue it. It prints the job afterwards, as `job` does.
731
+ - `procedure save` saves a job's recipe as a versioned procedure. Only the
732
+ job's owner can save it, and only once it completed with its work
733
+ verified. Saving again saves another procedure.
734
+ - `procedure show` prints the procedure's name, the job it was saved from
735
+ and that job's link, the current version, each version's recipe digest,
736
+ capability ids and action roster, and the JSON schema of the parameters a
737
+ run takes. It never shows a version's recipe or anything the saved job
738
+ read. When the schema's `scoped_inputs` require `contact_reconciliation`,
739
+ a run needs `--group <contact-group-id>` and `--source <uploaded-file-id>`.
740
+ - `procedure run` starts a new job from the procedure, as Rerun does in the
741
+ app. Nothing of the saved job carries over: the run has fresh inputs, your
742
+ own current rights, and a change set that needs its own approval, which
743
+ happens in the app. It prints the new job's link. `--version <n>` runs only
744
+ while that version is still current. `--param name=value` passes a string
745
+ and `--param name:=<json>` a JSON value (repeatable); `--params-file <path>`
746
+ (`-` for stdin) passes one JSON object instead. A bad `--param` (one
747
+ without `=`, a name given twice or with whitespace around it), an
748
+ unreadable or invalid `--params-file`, both together, a `--version` that
749
+ isn't a positive integer, `--version`, `--params-file`, `--group` or
750
+ `--source` given twice, or a `--group` or `--source` with whitespace around
751
+ it exits `2` before anything is sent.
752
+ - When the new procedure or job can't be read back as you, the answer is
753
+ only its id and link, for people and under `--json` alike.
754
+
755
+ **None of these writes is idempotent**, so none is ever retried
756
+ automatically, not after a timeout or a 5xx either: a second continue opens
757
+ another window, a second save saves another procedure, a second run starts
758
+ another job. Their exit codes say whether trying again is safe:
759
+
760
+ - `3` only when the request never reached the server (the name did not
761
+ resolve, the connection was refused, the TLS handshake failed). Nothing
762
+ changed.
763
+ - `1` with "Outcome unknown" when it may have: a timeout, a dropped
764
+ connection, an answer that could not be read (then the server received
765
+ it), or a 5xx. Check what the error names first (`job <id>`, the job's
766
+ procedures, or `jobs` for a run's new job) before trying again. A 503
767
+ `service_unavailable` from `procedure run` is the exception: the server
768
+ refused the run before starting it.
769
+
770
+ The MCP tools follow the same rule: only a request that never reached the
771
+ server says "cannot reach the API".
772
+
773
+ A `continue` that answers 404 may still have happened, if the job went out
774
+ of your sight just as it was continued: check `job <id>` first.
775
+ `job <id> --changes` reads the job and then its change set; when a new
776
+ change set lands between the two reads, stderr says so.
777
+
778
+ Every refusal exits `1` with the server's message, what it means and the
779
+ HTTP status:
780
+
781
+ | Status | Code | Meaning |
782
+ | --- | --- | --- |
783
+ | 400 | `bad_request` | The request carried a field the server does not accept. Nothing changed; update the CLI. |
784
+ | 403 | `principal_required` | `continue`: only the job's execution principal may continue it. |
785
+ | 403 | `owner_required` | `procedure save`: only the job's owner can save it. |
786
+ | 403 | `operator_disabled`, `operator_not_permitted`, `actor_required`, `forbidden` | As for every Operator command; `forbidden` here means a missing `operator:write` scope. |
787
+ | 404 | `not_found` | The same answer for a job or procedure that doesn't exist, is in another organization, or that you can't see. |
788
+ | 409 | `invalid_state`, `reconciliation_required`, `principal_inactive`, `deliveries_unsettled` | `continue`: nothing to continue, partial effects to reconcile in the app, a principal who lost the rights, or a delivery still sending or of unknown outcome (settle it in the app when `job <id>` shows it waiting on delivery). |
789
+ | 409 | `version_conflict`, `concurrent_change` | `procedure run`: the named version is no longer current, or the procedure changed while the run started. No job was started. |
790
+ | 422 | `not_saveable`, `validation_error` | `procedure save`: the job isn't completed and verified, or the name holds control characters. |
791
+ | 422 | `invalid_rerun` | `procedure run`: the inputs don't fit the parameters, or your current rights don't cover the run. No job was started. |
792
+ | 503 | `service_unavailable` | `procedure run`: Operator's operational profile is unavailable. No job was started. |
793
+
794
+ ## Operator's catalog
795
+
796
+ What Operator can do in your organization, and the skills it has:
797
+
798
+ ```sh
799
+ harness tools # the capabilities Operator can use now, by id
800
+ harness tools --domain crm # one domain's
801
+ harness tools domains # every domain, with how many
802
+ harness tools search "find a party" # by keyword, best match first
803
+ harness tool crm.party.search # one capability, with its whole input schema
804
+ harness tool crm.party.search --schema result # a read's result schema
805
+ harness skills # the skills assigned to Operator
806
+ ```
807
+
808
+ - **Only what Operator can use now.** A capability that ships disabled or is
809
+ switched off for the organization never appears, so there is no
810
+ "enabled" column.
811
+ - **Kinds.** Each capability is a `read`, a `write`, or a `send` (a write
812
+ delivered beyond the platform, such as an email). Write and send
813
+ capabilities, and any proposal, always need a person's approval in the app
814
+ before they take effect. A capability without a kind shows as `unknown`,
815
+ never as a read. These commands run and approve nothing.
816
+ - **Pages.** The index comes 25 to a page and a search 15, with no page size
817
+ to choose. When there is more, stderr says how many there are in all and
818
+ names the next page's cursor: `--all` follows every page (up to 200), and
819
+ `--cursor <cursor>` reads the next one, or every page from there with
820
+ `--all`. `tools search` takes `--domain`, `--all`, and `--cursor` as well.
821
+ An empty `--domain` or `--cursor` is a usage error.
822
+ - **Schemas.** `tool <id>` fetches every page of the schema and prints it
823
+ whole. A page that is out of order, skipped, of another schema, or at odds
824
+ with the others' fragment count fails the command, and no schema is
825
+ printed. `--json` returns the capability with its `input_schema` (or
826
+ `result_schema`) as an object. Only a read has a result schema.
827
+ - **Skills** show each skill's invocation name, title, the SHA-256 of its
828
+ content, and its id. Their content and description are never exposed.
829
+
830
+ Operator needs the `operator:read` scope, an admin or member role in the
831
+ organization the credential is bound to, and Operator switched on there.
832
+ Login tokens carry the scope; `aone_` tokens need to be minted with it. A
833
+ refusal exits 1 with the server's message and what it means
834
+ (`operator_disabled`, `operator_not_permitted`, `actor_required`). `tool`
835
+ answers a capability that doesn't exist, ships disabled, or is switched off
836
+ with the same 404.
837
+
367
838
  ## Uploads
368
839
 
369
840
  `harness upload <path>` uploads a file and prints a markdown reference to
@@ -465,7 +936,10 @@ can read.
465
936
  | `0` | Success, including `ready --claim` finding nothing to claim. |
466
937
  | `1` | The command failed. Causes include an API error (the message gives the HTTP status, followed by any per-field errors or plan violations, one per line), a response the CLI cannot interpret, a partial failure across several ids, or a local refusal such as an unreadable or oversized upload. |
467
938
  | `2` | Usage or configuration error, including "not signed in" outside a terminal. Nothing was sent. |
468
- | `3` | The API was unreachable (DNS, TLS, connection refused, or timeout). Retry with backoff, and if the API stays down, say so instead of dropping tracked work. |
939
+ | `3` | The API was unreachable (DNS, TLS, connection refused, or timeout). Retry with backoff, and if the API stays down, say so instead of dropping tracked work. Operator's writes (`steer`, `cancel`, `pause`, `continue`, `procedure save`, `procedure run`) exit `3` only when the request never reached the server; when it may have, they exit `1` with "Outcome unknown", and you check what the error names (`job`, or `jobs` for a run's new job) before running one again. |
940
+ | `4` | `watch` only: a person has to act on the Operator job (its `waiting_on` is set: an approval, a person, reconciliation, verification or delivery). The link to act on is on stdout. |
941
+ | `5` | `watch` only: the Operator job failed or was cancelled. |
942
+ | `130` | `watch` only: interrupted with Ctrl-C. stderr names the `--after` to resume from. |
469
943
 
470
944
  ## MCP server
471
945
 
@@ -475,14 +949,23 @@ can read.
475
949
  claude mcp add --scope user harness -- npx -y @allocator-one/harness-cli mcp
476
950
  ```
477
951
 
478
- With a global install, `harness mcp` works as the command instead of the
479
- `npx` form. Any other MCP client can use the same command:
952
+ Or register it under its Operator name. The server then reports its name
953
+ as `operator`, and it serves the same tools:
954
+
955
+ ```sh
956
+ claude mcp add --scope user operator -- npx -y @allocator-one/operator mcp
957
+ ```
958
+
959
+ Register one of the two, not both, or every tool appears twice.
960
+
961
+ With a global install, `harness mcp` (or `operator mcp`) works as the
962
+ command instead of the `npx` form. Any other MCP client can use the same command:
480
963
 
481
964
  ```json
482
965
  { "mcpServers": { "harness": { "command": "npx", "args": ["-y", "@allocator-one/harness-cli", "mcp"] } } }
483
966
  ```
484
967
 
485
- The server exposes 58 tools:
968
+ The server exposes 72 tools:
486
969
 
487
970
  | Area | Tools |
488
971
  | --- | --- |
@@ -494,7 +977,11 @@ The server exposes 58 tools:
494
977
  | Labels | `label_list`, `label_create`, `label_update`, `label_delete` |
495
978
  | Teams and states | `team_list`, `team_create`, `team_rename`, `team_set_default`, `workflow_states`, `state_add`, `state_update`, `state_order`, `state_delete` |
496
979
  | People | `member_list`, `member_add`, `member_set_role`, `user_list` |
497
- | Plans and gates | `plan_create`, `plan_show`, `plan_edit`, `plan_release`, `plan_hold`, `gate_set` |
980
+ | Plans and gates | `plan_create`, `plan_show`, `plan_edit`, `plan_release`, `plan_hold`, `gate_set`, `condition_list` |
981
+ | Outside experts | `assignment_list` |
982
+ | Operator jobs | `jobs_list`, `job_show`, `job_changes`, `job_steer`, `job_cancel`, `job_pause` |
983
+ | Continue and procedures | `job_continue`, `procedure_save`, `procedure_show`, `procedure_run` |
984
+ | Operator's catalog | `tools_search` (without `query` it browses the index; `domain`, `cursor`, `all`), `skills_list` |
498
985
  | Other | `stats`, `upload` |
499
986
 
500
987
  The tools cover the issue workflow and the admin surface. Some commands are
@@ -513,16 +1000,42 @@ Some tools behave differently from their commands:
513
1000
  - `state_delete` and `label_delete` don't need the CLI's `--yes`.
514
1001
  - `plan_create` takes the plan as an object (`plan`), with `team` and
515
1002
  `idempotency_key` beside it, instead of a file. Its schema describes the
516
- steps and conditions, and keys inside `plan` that the schema does not
517
- know are still sent, so the server reports them. `plan_edit` takes
1003
+ steps and conditions, including a gate's `key` and `owner` and the
1004
+ `gate: <key>` shorthand, which makes `kind` optional. Keys inside `plan`
1005
+ that the schema does not know are still sent, so the server reports them. `plan_edit` takes
518
1006
  `steps`, `retry_budget`, and `spend_budget_cents` directly. As with every
519
1007
  tool, a top-level argument the tool does not declare is dropped.
520
- `gate_set` takes `issue`, `gate`, and `satisfied`.
1008
+ `gate_set` takes `issue`, `gate` (a key, label, or condition id), and
1009
+ `satisfied`.
521
1010
  - An API error's details come back in the tool error text: a validation
522
1011
  error's fields, and an invalid plan's violations, one per line by step
523
1012
  key.
1013
+ - With an outside expert's `pxc_…` credential, `assignment_list`,
1014
+ `condition_list` and `gate_set` work on the expert's own steps and gates.
1015
+ Every other tool returns the `expert_bound_credential` refusal, with the
1016
+ same explanation the CLI prints.
524
1017
  - `issue_list` with `ready: true` gives every issue an `agent_step` flag,
525
1018
  read from its team as `ready` does.
1019
+ - `jobs_list` takes `status` as a list of job states and aliases. There is
1020
+ no watch tool: poll `job_show` until `state` is `completed`, `failed` or
1021
+ `cancelled`, or `waiting_on` is set. A person has to act exactly when
1022
+ `waiting_on` is set; a job paused without it resumes by itself. Neither
1023
+ tool approves anything; give a person the `approval_url`.
1024
+ - `job_steer`, `job_cancel` and `job_pause` return the job as `job_show`
1025
+ does. None is idempotent, so none is retried: after an error that leaves
1026
+ the outcome unknown, read the job with `job_show` before calling one
1027
+ again. All three carry `idempotentHint: false`. `job_cancel` sets
1028
+ `destructiveHint: true`; `job_steer` (it voids earlier approvals and stops
1029
+ a run) and `job_pause` (it stops a run) leave MCP's default, which is also
1030
+ destructive. Approving stays in the app.
1031
+ - `job_changes` is the CLI's `job --changes`. There is no tool for
1032
+ `job --people`: `job_show` already returns the requester, execution
1033
+ principal, participants and approvers.
1034
+ - `procedure_run` takes `parameters` as an object, beside `version`,
1035
+ `group_id` and `source_resource_id`. `job_continue`, `procedure_save` and
1036
+ `procedure_run` are never retried and carry `idempotentHint: false`; a
1037
+ failed call's error says what to check before calling again, and only a
1038
+ request that never reached the server says "cannot reach the API".
526
1039
 
527
1040
  For example, `issue_list` with `{"ready": true, "team": "CLI"}` returns the
528
1041
  ready queue, and `issue_claim` with `{"id": "CLI-12"}` claims an issue
@@ -575,7 +1088,7 @@ automatic login asks for confirmation first, as described above. Plain
575
1088
  | Variable | Effect |
576
1089
  | --- | --- |
577
1090
  | `HARNESS_API_URL` | Target host (https, or http against localhost only). |
578
- | `HARNESS_API_TOKEN` | An `aone_…` API token. It takes precedence over the stored login. Headless use only. |
1091
+ | `HARNESS_API_TOKEN` | An `aone_…` API token, or an outside expert's `pxc_…` credential. It takes precedence over the stored login. Headless use only. |
579
1092
  | `HARNESS_ACTOR` | Write attribution, sent only when set. Without it the server attributes writes to the signed-in user, or for `aone_` tokens to the token's name. Headless use only. |
580
1093
  | `HARNESS_TEAM` | Default team key for commands that take `--team`. |
581
1094
  | `HARNESS_CACHE_DIR` | Where `show` stores downloaded images. Must be an absolute path. |
@@ -591,7 +1104,7 @@ automatic login asks for confirmation first, as described above. Plain
591
1104
  | `~/.config/harness/credentials.json` | The stored login: one `{url, token}` pair, mode 0600. |
592
1105
  | `~/.config/harness/trusted-hosts.json` | Repo-config hosts you agreed to log in to. |
593
1106
  | `~/.cache/harness/attachments/` | Images downloaded by `show` (or `HARNESS_CACHE_DIR`). |
594
- | `~/.cache/harness/update-check.json` | The daily update-check stamp. |
1107
+ | `~/.cache/harness/update-check.json` | The daily update-check stamp (`update-check-operator.json` for `@allocator-one/operator`). |
595
1108
  | `~/.cache/harness/upgrade.lock` | Held while an automatic upgrade runs. |
596
1109
 
597
1110
  None of these files is tracker state: issues stay on the server. The
@@ -603,6 +1116,9 @@ longer need them.
603
1116
  **Notice.** Each run reads the cached stamp and prints at most one stderr
604
1117
  line when a newer release exists:
605
1118
  `harness: 1.13.0 is available (you have 1.12.1) — npm i -g @allocator-one/harness-cli@latest`.
1119
+ The notice follows the package you installed. An `@allocator-one/operator`
1120
+ install checks that package's own latest release, keeps its own stamp, and
1121
+ is told to upgrade `@allocator-one/operator`.
606
1122
  When the stamp is more than a day old, a detached background process
607
1123
  refreshes it from the npm registry. A command never waits on that network
608
1124
  request. The notice applies only to global and project-local installs, not
@@ -611,7 +1127,8 @@ to `npx` or a git checkout.
611
1127
  **Automatic upgrade on HTTP 426.** The CLI sends its version with every
612
1128
  request, and the server refuses versions below its minimum with a 426. In
613
1129
  that case the CLI runs
614
- `npm install --global --ignore-scripts @allocator-one/harness-cli@latest`,
1130
+ `npm install --global --ignore-scripts @allocator-one/harness-cli@latest`
1131
+ (or `@allocator-one/operator@latest`, for an install of that package),
615
1132
  re-runs the original command, and exits with that command's exit code.
616
1133
  Re-running is safe only for this status. The server answers 426 before
617
1134
  authentication and before the request handler, so the refused request