@sjawhar/claude-envoy 6.25.2 → 6.27.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.
@@ -1,39 +1,39 @@
1
1
  # Backlog stewardship
2
2
 
3
- Read this for the prioritization pass (each turn it is due, and its daily form on the first turn of each UTC day and after each directive a person gives), a scope question or routing request on your role topic, and stopped-session work. The deployment instructions name the weekly-planning issue; its newest `plan-week-*` artifact is the work order and the one-owner map, and Dispatch board rank is that order in force.
3
+ The deployment instructions name the weekly-planning issue. Its newest `plan-week-*` artifact is the work order and the one-owner map, and Dispatch board rank is that order in force.
4
4
 
5
5
  Claim no Envoy role but `legion-<project>-controller`: another ends your wake delivery.
6
6
 
7
7
  ## The prioritization pass
8
8
 
9
- The pass keeps the order of the work aligned with the project's priorities. Run it at most once a turn, after the wake's work, as the last step before your summary, and before the daily report on the turn that posts it.
9
+ Run the pass at most once a turn, after the wake's work, as the last step before your summary, and before the daily report on the turn that posts it.
10
10
 
11
11
  - It is due on every turn that a `tick`, `slot-free` or `todo` wake starts.
12
12
  - Its daily form is due on your first turn of each UTC day and after every directive from a person, even one that seems to touch one issue.
13
- - On any other turn it is due when the wake's work is done, nothing else waits, and `dispatch issues --project <KEY> --updated-since <the time of your newest pass line> --all` lists an issue, or when your context holds no pass line.
13
+ - On any other turn it is due when the wake's work is done, nothing else waits, and `dispatch issues --project <KEY> --updated-since <your newest pass line's time> --all` lists an issue, or when your context holds no pass line.
14
14
 
15
15
  1. Read the `read_state` summary's admission lines, the newest weekly plan, and the open roots, and make [the owner audit](#the-owner-audit) on that read.
16
- 2. Change only a rank, an admission or the plan, where it no longer matches the project's priorities, and change nothing else. Admit an issue only as the intake your deployment instructions give and `skill://legion-controller/references/admission.md#your-moves-to-todo` allow: a free slot is no reason to admit.
16
+ 2. Change only a rank, an admission or the plan, where it no longer matches the project's priorities. Admit an issue only as the intake your deployment instructions give and `skill://legion-controller/references/admission.md#your-moves-to-todo` allow: a free slot is no reason to admit.
17
17
  3. In the daily form, also [reconcile the weekly plan](#reconcile-the-weekly-plan).
18
18
  4. End the pass with exactly one line: `Prioritization pass at <RFC3339>: <what it changed, or none>`.
19
19
 
20
20
  ## Reconcile the weekly plan
21
21
 
22
22
  1. Read the weekly-planning issue and its newest `plan-week-*` artifact (by its latest `artifact.version` event) before you change any issue.
23
- 2. Rank the plan by the deployment's priorities (`dispatch priorities --project <KEY>`). An issue takes the rank of the highest priority its `Advances:` line names, its own or inherited; an issue that advances none ranks below all. Order the plan's lines by rank, highest first, keeping the plan's order within a rank; a line that lists several issues takes its highest issue's rank. Move a line that breaks this order, unless a person asked for a different order of that work: then cite that request beside the line (a request to do the work is no request about its order). Name each move in your turn's summary.
24
- 3. For every plan line whose key has this project's prefix (`daemon.project`), make the board order match the line order exactly, from the plan alone: `dispatch issue-update --issue <KEY> --before <OTHER>` (or `--after`). Set P0 only on the project owner's own words cited on the issue, never from a plan line alone (it skips the admission cap), and only with the `p0` credential your deployment instructions name, as priority 0 without it is refused `403 OAUTH_SCOPE_REQUIRED`; with none named, tell the owner to set P0 at a browser. Set any other priority a line states; leave it where it states none. Change the P0 bound (`set_p0_bound`, `clear_p0_bound`) only on a person's word, cited in its reason.
25
- 4. Reconcile the one-owner map. A `live` or `unresponsive` owner in `envoy_sessions` still owns its work: change nothing. Only an owner that reads `gone`, or that the registry has no record of, has no session. Route such unowned work to a session whose `dir` is a checkout of the issue's repository (`dispatch issue-update --issue <KEY> --route session:<session id>`) and `envoy_send` it `You own <KEY>: <title>.`. Never route an issue that carries the `legion` label, and never change its `Assignee:`, which decides who receives asks.
26
- 5. Edit that line's owner in the artifact with `dispatch doc-edit`, guarded by the token of the current `dispatch doc-read`, replacing superseded text rather than logging changes.
23
+ 2. Rank the plan by the deployment's priorities (`dispatch priorities --project <KEY>`). An issue ranks at the highest priority its `Advances:` line names, its own or inherited, and below all when it advances none. A line that lists several issues ranks at its highest issue. Order the lines by rank, highest first, keeping the plan's order within a rank. Move a line that breaks this order, unless a person asked for another order of that work: then cite that request beside the line (a request to do the work is no request about its order). Name each move in your turn's summary.
24
+ 3. For every plan line whose key has this project's prefix (`daemon.project`), make the board order match the line order exactly, from the plan alone: `dispatch issue-update --issue <KEY> --before <OTHER>` (or `--after`). An issue with no priority of its own takes that of the nearest issue above it that has one. Make an issue P0 only on the project owner's own words cited on it, never from a plan line alone (P0 skips the admission cap), and only with the `p0` credential your deployment instructions name. That holds for setting priority 0, a move under a P0 issue (`--parent`) or a clear (`--clear-priority`) that makes an issue P0, and a new issue with no priority under a P0 issue: Dispatch refuses each without that credential, `403 OAUTH_SCOPE_REQUIRED`. With none named, tell the owner to set P0 at a browser. Give a new issue under a P0 issue a priority from 1 to 3 unless those words make it P0. Set any other priority a line states, and leave it where it states none. Change the P0 bound (`set_p0_bound`, `clear_p0_bound`) only on a person's word, cited in its reason.
25
+ 4. Reconcile the one-owner map. An owner that reads `live` or `unresponsive` in `envoy_sessions` keeps its work: change nothing. Only one that reads `gone`, or that the registry does not know, has no session. Route its work to a session whose `dir` is a checkout of the issue's repository (`dispatch issue-update --issue <KEY> --route session:<session id>`) and `envoy_send` it `You own <KEY>: <title>.`. Never route an issue labelled `legion`, and never change its `Assignee:`, which decides who receives asks.
26
+ 5. Edit that line's owner in the artifact with `dispatch doc-edit`, guarded by the current `dispatch doc-read`'s token, replacing superseded text rather than logging changes.
27
27
 
28
- A directive is a direct Dispatch message to you: answer it, carry it out, record the rule it sets in its weekly-plan row (or the directives section) with the message's link, then run the daily form of the prioritization pass.
28
+ A directive is a direct Dispatch message to you: answer it, carry it out, and record the rule it sets in its weekly-plan row (or the directives section) with the message's link. Then run the daily form of the pass.
29
29
 
30
30
  ## Answering controller deliveries
31
31
 
32
- Read every delivery against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions. Answer a routing request with the owner the one-owner map names and how to reach it (its role token or session), so the asker writes to it: you forward no message to another session. Never merge or enqueue a pull request, whatever credential you hold: a request to merge one goes to the architect of its tree (`skill://legion-controller/references/operations.md#a-request-to-another-session`).
32
+ Read every delivery on your role topic against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions. Answer a routing request with the owner the one-owner map names and how to reach it (its role token or session), so the asker writes to it. Forward no message to another session. Never merge or enqueue a pull request, whatever credential you hold: a request to merge one goes to the architect of its tree (`skill://legion-controller/references/operations.md#a-request-to-another-session`).
33
33
 
34
34
  ## The owner audit
35
35
 
36
- At each pass, read the open roots, the same read as the pass's step 1: `dispatch issues --project <KEY> --all`, each row that names no parent (no ` · child of <KEY>` outside quotes) and whose status is not `done`. In that read:
36
+ The pass's step 1 reads the open roots: the rows of `dispatch issues --project <KEY> --all` that name no parent (no ` · child of <KEY>` outside quotes) and are not `done`. In that read:
37
37
 
38
38
  - An unclaimed row in `triage`, `icebox`, `backlog` or `todo` is a decision: someone builds it, or it closes.
39
39
  - A close that says a defect cannot happen cites the code that prevents it, or the issue is unread.
@@ -44,15 +44,15 @@ At each pass, read the open roots, the same read as the pass's step 1: `dispatch
44
44
 
45
45
  ## Recovering stopped-session work
46
46
 
47
- A session route is stopped only after two reads of `dispatch issues --project <KEY> --route-status no_holder --all`, at least ten minutes apart, on two wakes, both list it. Then read its owner in `envoy_sessions`: recover the work only from one that reads `gone`, or `unresponsive` with a `last_seen` more than 20 minutes old.
47
+ A session route is stopped only when two reads of `dispatch issues --project <KEY> --route-status no_holder --all` on two wakes, at least ten minutes apart, both list it. Then read its owner in `envoy_sessions`: recover the work only from one that reads `gone`, or `unresponsive` with a `last_seen` more than 20 minutes old.
48
48
 
49
- Only work that a person's directive, recorded in the plan with its link, moves to Legion when its session stops is yours to move: keep its labels, add `legion`, then `set_status` it to `todo`, and update its owner row. Never apply this to an issue in a live Legion tree.
49
+ Move only the work that a person's directive, recorded in the plan with its link, sends to Legion when its session stops: keep its labels, add `legion`, then `set_status` it to `todo`, and update its owner row. Never apply this to an issue in a live Legion tree.
50
50
 
51
51
  ## A root the plan defers
52
52
 
53
- A labelled root the daemon queued or runs, which the weekly plan says to defer, is parked at your next pass only when the plan's line names a person's request: `set_status` to `backlog` (`icebox` for longer), citing that request in a comment. A plan row with no such request moves nothing; ask instead:
53
+ A labelled root the daemon queued or runs, which the weekly plan says to defer, is parked at your next pass only when the plan's line names a person's request: `set_status` to `backlog` (`icebox` for longer), citing that request in a comment. A plan row with no such request moves nothing. Ask instead:
54
54
 
55
- 1. Find your earlier ask: step 1 of `skill://legion-controller/references/park-asks.md`, with `Asked whether to defer: ` for `Asked whether to park: `, its second line the plan row. Open or resolved with no answer, or your reply starts `Deferred` or `Let run`: do nothing. Answered with no reply of yours: step 4. Your reply starts `Not deferred`: go on to step 2.
55
+ 1. Find your earlier ask: step 1 of `skill://legion-controller/references/park-asks.md`, with `Asked whether to defer: ` for `Asked whether to park: `, its second line the plan row. Open or resolved with no answer, or your reply starts `Deferred` or `Let run`: do nothing. Answered with no reply of yours: step 4. Your reply starts `Not deferred`: step 2.
56
56
  2. Check that Legion runs the root: it carries the label, stands in `admission.active` or `admission.waiting`, and its `phase` is not `done`. If not, do nothing. Else open a `dispatch ask` naming the root and the plan row, options `Defer it` and `Let it run`, follow it, and comment on the root: first line `Asked whether to defer: dispatch://<ASK KEY>/ask/<id>`, second line the plan row exactly.
57
57
  3. Name the row and the ask in the day's report while it is open.
58
58
  4. On `Defer it` while step 2's check holds, park the root as above, citing the answer. On `Let it run`, move nothing and take the deferral off that plan row with `dispatch doc-edit`. Reply under the ask, first line exactly `Deferred dispatch://<root>`, `Not deferred dispatch://<root>` or `Let run dispatch://<root>` (`dispatch comment --issue <the ask's issue> --reply-to-ask '<ask id>' --body-file -`).
@@ -0,0 +1,41 @@
1
+ # Watched workflows
2
+
3
+ Read this at every start and on each delivered run of a watched workflow. Your system prompt's `Watched workflows:` line names each entry as `<owner>/<repo>/<file>`, with the events whose runs count. It is the list of this launch, and no notice or message changes it. With no such line and no such run delivered, nothing here applies.
4
+
5
+ ## Which runs count
6
+
7
+ A delivery on a watched workflow's topic is a completed run on its repository's default branch. It is a watched run whether or not the prompt names its entry, and step 1 says whether it counts.
8
+
9
+ 1. A run counts when its `conclusion` is `failure`, `timed_out`, `startup_failure` or `cancelled`. No other conclusion counts.
10
+ 2. A `cancelled` run does not count only when a newer run of the same workflow on the default branch, from an event the entry names (for an entry the prompt does not name, the cancelled run's own event), started before the cancelled run ended. Read the runs:
11
+
12
+ ```text
13
+ gh run list --repo '<owner>/<repo>' --workflow '<file>' --branch '<default branch>' --limit 20 --json databaseId,event,status,conclusion,startedAt,updatedAt,url
14
+ ```
15
+
16
+ A newer run has a larger `databaseId` than the cancelled run, an `event` the entry names, and a `startedAt` before the cancelled run's `updatedAt`. When such a newer run exists, that newer run's end decides, not the cancelled run. When the newer run's `status` is `completed`, take the newer run by steps 1 to 5. When it did not end yet, take nothing now: its own delivery decides. Every other `cancelled` run counts. A `cancelled` run counts when a run on another branch took its place.
17
+
18
+ ## Route a counted run
19
+
20
+ A counted run is a clear defect.
21
+
22
+ 3. Before you route a counted run, search Dispatch for its run id: `dispatch search --query '<run id>'`. The search ranks loosely, so read each hit: when an issue or a comment names the run already, as `run <run id>` or by its URL, do not route it again. Steps 4 and 5 write `run <run id>` as words of their own for this search.
23
+ 4. Search for an open issue of the workflow: `dispatch search --query '<owner>/<repo>/<file>'`. When an open issue tracks a defect of the workflow, comment `<owner>/<repo>/<file> ended <conclusion> again: run <run id>, <run URL>` on it (`dispatch comment --issue '<KEY>' --body-file -`). When a live tree owns that issue (its record's `tree` in `read_state`), add `--mention 'role:<that tree's architect's token>'`, built as `skill://legion-controller/references/operations.md#a-request-to-another-session` says, so the comment reaches it. File nothing new.
24
+ 5. Otherwise, route the run as `skill://legion-controller/references/finding-asks.md#file-a-clear-defect` routes a clear defect that you find yourself. Its evidence is `run <run id>, <run URL>`. The issue that you file has a title that names `<owner>/<repo>/<file>`. Its spec ends with `Filed for Legion from controller on <report issue>: run <run id>, <run URL>`.
25
+
26
+ ## At every start
27
+
28
+ 6. Read each repository that the prompt's entries name, once, for its default branch and GitHub's spelling of its name (entries whose `<owner>/<repo>` differ only in case name one repository):
29
+
30
+ ```text
31
+ gh api 'repos/<owner>/<repo>' --jq '[.full_name, .default_branch]'
32
+ ```
33
+
34
+ Compare its `full_name` with the `<owner>/<repo>` of each entry of that repository. When they differ (a difference of case counts), name that entry in your summary: its topic never matches a run. When the read fails, step 7 applies to each entry of that repository. Then, for each entry and each event of the entry, read its newest completed run on its repository's default branch:
35
+
36
+ ```text
37
+ gh run list --repo '<owner>/<repo>' --workflow '<file>' --branch '<default branch>' --event '<event>' --status completed --limit 1 --json databaseId,conclusion,event,headBranch,startedAt,updatedAt,url
38
+ ```
39
+
40
+ Its `databaseId` is the run id, and its `updatedAt` is the run's end. When that run counts by step 1, take it by steps 2 to 5, as a delivered run. A `legion:` notice that Envoy took a watched topic after a 503 asks for this read for one entry and event: make it with the command above, only when the prompt's line names that entry with that event.
41
+ 7. When a `gh` read of step 2 or 6 fails, name the entry and `gh`'s first line in your summary. Act on nothing that read would decide. When a value for a placeholder of those commands holds `'` (a branch name can), run nothing with it: name the entry and the value in your summary.
@@ -46,7 +46,8 @@ When the run gives no result, the line reads `CI run <name> has no result (<case
46
46
  - A job the repository runs on a pull request only under a label (on cybermonklabs/legion, the slow suites) does not run without it.
47
47
  A job that holds its own steps then has a run concluded `skipped`; a job that calls a workflow, as each such job on cybermonklabs/legion does, has only its own run, under its bare name (`test`), concluded `skipped`, and no job of the called file starts, so the run a check names (`test / test`) is `absent`.
48
48
  The implementer adds that job's own `lane:<output>` label, never `full-ci`, then pushes, because the workflow starts on a push and not on a label.
49
- The label stays on while a `ci_check` of the issue names such a job, and comes off when none does: the merge queue runs every held-back job before the change lands, so a held-back job that no check names needs no label.
49
+ The label stays on while a `ci_check` of the issue names such a job, and comes off when none does: a pull request runs a held-back job only for a need its body names, a check that names the job is that need, and while the label is on each push runs the job again.
50
+ On cybermonklabs/legion the label acts on the pull request's runs alone: the merge queue runs a slow suite when the queue's own generator selects it against the queue's base, whatever the labels, so a change can merge with no run of a held-back job its paths select and no check names, and ci-ok's `not run at this head:` line names that job on the pull request.
50
51
  No job runs on a pull request in part: on cybermonklabs/legion test, pi-legion and envoy-infra-go are held back, while tooling-checks, pi-legion-build and envoy-infra-build, their builds and checks, run on every pull request, each job's check named `<job> / <job>` (`test / test`, `tooling-checks / tooling-checks`); the browser suite's pull-request lane is dispatch-browser-pr, whose checks are named `dispatch-browser-pr / <job>`, and its full lane, dispatch-browser, is held back (`lane:dispatch_browser`).
51
52
  On cybermonklabs/legion a check of the edited-migrations, gofmt, OpenAPI or pmdoc steps names `envoy-go-build / envoy-go-build`, which every pull request runs; envoy-go-checks is envoy's script tests, a held-back slow suite, and a check naming it for those steps passes under its label with none of them run.
52
53
 
@@ -43,7 +43,7 @@ The pull request body's `Checks` lines are in `skill://legion-worker/references/
43
43
  ## The rules every phase's evidence follows
44
44
 
45
45
  - The tester tries to break the changed surface (wrong and boundary inputs, the second and the concurrent run, the party it must refuse) and writes a failing test for each way it breaks that no existing test catches.
46
- Lint, types and the unit and integration suites are CI's: read on GitHub the ones the head ran, rerun no lane as evidence, and wait for none; a suite the repository holds back for its merge queue has no run at the head, and that is no gap.
46
+ Lint, types and the unit and integration suites are CI's: read on GitHub the ones the head ran, rerun no lane as evidence, and wait for none; a slow suite the repository holds back on a pull request has no run at the head unless a label turns it on, and that is no gap in the tester's evidence; the merge queue runs such a suite when the queue's own selection, against the queue's base, picks it, and on cybermonklabs/legion ci-ok's `not run at this head:` line names each one the head's paths select.
47
47
 
48
48
  - On a new head, the tester reruns each check the change since the head it last tested can reach (for a merge of the base, `skill://legion-worker/references/conflicts-and-rewrites.md#reading-a-merge-of-the-base`) and records each other check with no `ci_check` at the new head unrun, its `--observed` naming the earlier pass and why the merge misses it.
49
49
 
@@ -18,4 +18,4 @@ An install of your own (an interpreter, a browser, a second toolchain, an extrac
18
18
 
19
19
  ## The Dispatch browser suite
20
20
 
21
- A spec you add or change in `packages/dispatch` runs in the pod one spec a command (`bun run e2e -- e2e/<spec file>`), against the pod's own Postgres (*The database your tests use* in `skill://legion-worker/references/tools.md`). The change's proof is CI at the head: a pull request runs the rows tagged `@pr` in the `dispatch-browser-pr` checks, and every other row runs in the `dispatch-browser` checks, which the merge queue runs before the change lands and a pull request runs only under `lane:dispatch_browser`, for a need the pull request names.
21
+ A spec you add or change in `packages/dispatch` runs in the pod one spec a command (`bun run e2e -- e2e/<spec file>`), against the pod's own Postgres (*The database your tests use* in `skill://legion-worker/references/tools.md`). The change's proof is CI at the head: a pull request runs the rows tagged `@pr` in the `dispatch-browser-pr` checks, and every other row runs in the `dispatch-browser` checks, which the merge queue runs when the queue's own generator selects them against the queue's base, and a pull request runs only under `lane:dispatch_browser`, for a need the pull request names; ci-ok's `not run at this head:` line names `dispatch-browser` on a pull request whose paths select it and that did not run it.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "6.25.2",
3
+ "version": "6.27.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -45,6 +45,6 @@
45
45
  "zod": "4.3.6"
46
46
  },
47
47
  "legion": {
48
- "daemonApiVersion": 291
48
+ "daemonApiVersion": 292
49
49
  }
50
50
  }