@sjawhar/pi-envoy 9.7.1 → 10.1.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.
@@ -213,11 +213,11 @@ field, and choosing your next issue are in [Working an issue](skill://dispatch/r
213
213
  ## Asking
214
214
 
215
215
  Two kinds of question reach a human. A decision about the design a document records is a decision
216
- block in that document ([Decision blocks](#decision-blocks)), whatever phase the work is in and
217
- whether or not the document was approved: a block in an approved document makes the approval
218
- stale, which is right. A Legion phase worker sends such a decision to its architect, which writes
219
- the block (`skill://legion-worker`). A to-do or permission only a human can give, or a decision
220
- with no document to live in, is a `dispatch ask`. The gates below apply to both.
216
+ block in that document ([Decision blocks](#decision-blocks)), at every phase, approved or not: a
217
+ block in an approved document leaves the approval stale until the answer, which carries it
218
+ forward when it is the whole change (below). A Legion phase worker sends it to its architect,
219
+ which writes the block (`skill://legion-worker`). A to-do or permission only a human can give, or
220
+ a decision with no document to live in, is a `dispatch ask`. The gates below apply to both.
221
221
 
222
222
  ### Before you ask
223
223
 
@@ -368,33 +368,33 @@ See [Following](#following) for why you receive what happens to asks you open an
368
368
  ## Approval of a spec
369
369
 
370
370
  Approval is a property of a document, not a question you phrase: a human approves a specific
371
- version, the way a pull-request review approves a commit, and any later version makes that
372
- approval stale. A later version also moves an open request to that version and leaves it waiting
373
- on you until you request again, which hands the same request back to the human. Answering a
374
- decision block writes a new version, so request approval only when all three hold: every decision
375
- block is settled, which means answered or waived as the next paragraph
376
- says; the human has agreed to every point in the spec; and the current version has not been
377
- approved. A Legion root spec under an armed design gate always goes to approval once all three
378
- hold (`skill://legion-architect`).
371
+ version, the way a pull-request review approves a commit, and a later version leaves that approval
372
+ stale, unless the human's own answer to a decision block is the whole change since the version
373
+ they approved; then Dispatch records an `approved` review in their name at that version and emits
374
+ `artifact.approved`, so request nothing. When the answer changes text outside its block, rewrite
375
+ that text, run the fresh reader below on it and request again. A later version also moves an open
376
+ request with it, waiting on you until you request again. Request only when all three hold: every
377
+ decision block is settled (answered or waived, below); the human has agreed to every point in the
378
+ spec; and the current version has not been approved. A Legion root spec under an armed design gate
379
+ always goes to approval once all three hold (`skill://legion-architect`).
379
380
 
380
381
  Before calling `dispatch request-approval`, have a fresh read-only reader check the current spec
381
- against the code and the human's words, then resolve every finding. A Legion architect uses its
382
- `plan-gap-analyst`; another session uses the read-only reader its host supplies.
383
-
384
- When all three hold, request it in the pass that finishes the spec: a design waiting with nothing in
385
- the human's Inbox waits on nobody. When a human asks for approval while a block is open, do not
386
- request it and do not hold it silently: name each open block and ask them to answer it or waive
387
- it. For a waiver, close the block with `dispatch resolve-ask --kind resolved` (their words as
388
- `--reason`), then write their decision into the text in their words and request.
389
- `dispatch request-approval` refuses while any block is open.
382
+ against the code and the human's words, then resolve every finding. A Legion architect uses
383
+ `plan-gap-analyst`, another session the read-only reader its host supplies. When all three hold,
384
+ request in the pass that finishes the spec: a design waiting with nothing in the human's Inbox
385
+ waits on nobody. When a human asks for approval while a block is open, neither request it nor hold
386
+ it silently: name each open block and ask them to answer or waive it. For a waiver, close it with
387
+ `dispatch resolve-ask --kind resolved` (their words as `--reason`), write their decision into the
388
+ text in their words and request. `dispatch request-approval` refuses while any block is open.
390
389
 
391
390
  An approval request carries nothing new: a point the human has not agreed to gets its own decision
392
391
  block first, with your recommendation, or, when it is a choice you can make yourself
393
392
  ([Before you ask](#before-you-ask), gate 1) and the human will not want a say in it, comes out of
394
393
  the spec and is made where the work happens; an inference you cannot defend in a decision block
395
394
  comes out of the spec. `--summary` says in one to three sentences what the human is approving and
396
- nothing else: no commentary on itself or on the conversation, and no open question. The Inbox
397
- shows it after "Approve spec.md (version N)?". Never write "Approve" options into an ordinary
395
+ nothing else: no commentary on itself or on the conversation, and no open question; after an
396
+ earlier approval, one sentence naming what changed since it, since the card shows that approval
397
+ and its `Show diff` control carries the detail. Never write "Approve" options into an ordinary
398
398
  `dispatch ask`; only humans approve. The call, its result and its answer:
399
399
  [Approval requests](skill://dispatch/references/documents.md#approval-requests).
400
400
 
@@ -6,9 +6,22 @@ commands do not cover.
6
6
  ## Agent authentication
7
7
 
8
8
  Use a personal Dispatch token: a human mints it in Dispatch **Settings → Agent tokens** and supplies
9
- it to the agent through `dispatch.token` in `~/.config/opencode/envoy.json` or `DISPATCH_TOKEN`.
10
- The server records the minting human as the owner of that session's writes. `DISPATCH_AGENT_TOKEN`
11
- is the shared devbox fallback; do not configure it for an individual agent.
9
+ it to the agent through `DISPATCH_TOKEN` or `dispatch.token` in the `envoy.json` the agent's
10
+ session reads. Under an Oh My Pi profile other than `default`, a Claude Code `CLAUDE_CONFIG_DIR` or
11
+ an OpenCode `OPENCODE_CONFIG_DIR`, that is the `envoy.json` in the session's own directory; any
12
+ other session reads the file `ENVOY_CONFIG_FILE` names when it is set, else
13
+ `~/.config/legion/envoy.json` (under `$XDG_CONFIG_HOME` when set). The plugin hands the path it
14
+ chose to the session's commands in `ENVOY_CONFIG_FILE` beside `DISPATCH_HOST`, and the `dispatch`
15
+ command reads the file `ENVOY_CONFIG_FILE` names whenever `DISPATCH_HOST` is set, else its host
16
+ plugin's rule; in a Claude Code Bash that lacks both, as a subagent's can,
17
+ `CLAUDE_CODE_CHILD_SESSION=1` makes the host `claude`, so the command reads `CLAUDE_CONFIG_DIR`'s
18
+ file. A `dispatch.token` written `!<command>` is a command whose output is the token. A checkout's
19
+ `.envoy/envoy.json` may set `dispatch.serverUrl` only with the `dispatch.token` beside it, and
20
+ `dispatch.token` only with its own `dispatch.serverUrl` beside it; an `envoy` section there is not
21
+ read. The file's token goes only to its own `dispatch.serverUrl`: a
22
+ `DISPATCH_URL` naming another server needs `DISPATCH_TOKEN` or `DISPATCH_TOKEN_FILE`. The server
23
+ records the minting human as the owner of that session's writes.
24
+ `DISPATCH_AGENT_TOKEN` is the shared devbox fallback; do not configure it for an individual agent.
12
25
 
13
26
  The deployed Dispatch server's browser origin is configured separately with
14
27
  `DISPATCH_SERVER_URL` in the deployment `compose/.env`. Do not change an
@@ -226,7 +226,27 @@ nothing, and a different `--summary` is refused, since it would rewrite the card
226
226
  reading. The answer reaches you as `artifact.approved` or `artifact.changes_requested` with the
227
227
  pinned `version` and closes the request, so the next call opens a new one; `changes_requested`
228
228
  carries the reason, which is your next piece of work. Those reads show the document's approval
229
- state; `stale` means it was approved and then edited.
229
+ state; `stale` means it was approved and changed since, other than as the next paragraph says.
230
+
231
+ A human's own answer to a decision block in a document they approved can carry the approval to
232
+ the version it writes. Dispatch compares that version with the version they approved, every
233
+ decision block cut out of both; when the text outside the blocks is the same and every block added or
234
+ answered since has their answer, it records an `approved` review in their name pinned to the new version and
235
+ emits `artifact.approved`, in the transaction that writes the version, and answers an approval
236
+ request open on the document `Approve` in their name. The answer was the whole change since the
237
+ version they approved, so request nothing: `dispatch doc-read` shows `Approval: approved vN` at
238
+ the new version. An edit inside the block before the answer does not stop this. A change
239
+ outside the blocks, whoever wrote it (an upload or a typed edit included), a block added since the
240
+ approval that the human has not answered (open or waived), a block the approved version held that
241
+ someone else answered or that was waived since, a decided block whose question or options were
242
+ changed (its answer decided the question it was given on), a removed block, a request for changes
243
+ newer than the approval, or a document they never approved leaves the approval stale, and the next
244
+ request shows them the diff: a request on a document a human approved earlier carries
245
+ `approved` (`{version, at, by}`) in `ask.approval`, and its Inbox card puts
246
+ `Approved at version N on <date> by <who>.` and a `Show diff` control under the question, which
247
+ shows what changed between the two versions with every decision block cut out. So that request's
248
+ `--summary` is one sentence naming what changed since that approval, and repeats nothing the diff
249
+ shows.
230
250
 
231
251
  ## A document that is reloading
232
252
 
@@ -107,7 +107,11 @@ Link the pull request that delivers the issue with `--external-link` when you op
107
107
  renders its state and checks from that link, and `dispatch read` lists it under `External links:`.
108
108
  The command is authenticated with the same bearer as every
109
109
  other `dispatch` command: a Legion pane reads it from the `DISPATCH_TOKEN_FILE` path the daemon sets on
110
- the pane; an OMP session outside Legion reads `dispatch.token` from `~/.config/opencode/envoy.json`.
110
+ the pane; any other session's `dispatch` command reads `dispatch.token` from the `envoy.json` its
111
+ host's plugin read, which the plugin hands it in `ENVOY_CONFIG_FILE`. By that plugin's rule, that
112
+ is an OMP session's profile directory under an omp profile other than `default`, a Claude Code
113
+ session's `CLAUDE_CONFIG_DIR` (its subagents' too) or an OpenCode session's `OPENCODE_CONFIG_DIR`,
114
+ else the file `ENVOY_CONFIG_FILE` names, else `~/.config/legion/envoy.json`.
111
115
 
112
116
  A write to an issue still in `triage` answers once with `… is still in triage …`; move the status
113
117
  when work has started.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/pi-envoy",
3
- "version": "9.7.1",
3
+ "version": "10.1.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "omp": {