@sjawhar/claude-envoy 5.12.5 → 5.14.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.
Files changed (25) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.omp-plugin/plugin.json +1 -1
  3. package/dist/codex-hook.js +8 -8
  4. package/dist/dispatch.js +8 -8
  5. package/dist/envoy-channel.js +52 -18
  6. package/dist/session-hook.js +8 -8
  7. package/legion/skills/legion-architect/SKILL.md +76 -84
  8. package/legion/skills/legion-architect/references/acceptance.md +83 -79
  9. package/legion/skills/legion-architect/references/decomposition.md +73 -77
  10. package/legion/skills/legion-architect/references/design-gate.md +1 -1
  11. package/legion/skills/legion-architect/references/plan-changes.md +30 -0
  12. package/legion/skills/legion-architect/references/plan.md +66 -0
  13. package/legion/skills/legion-architect/references/wake-routing.md +28 -27
  14. package/legion/skills/legion-controller/references/admission.md +34 -10
  15. package/legion/skills/legion-controller/references/daily-report.md +57 -17
  16. package/legion/skills/legion-retro/SKILL.md +65 -60
  17. package/legion/skills/legion-retro/references/pr-body-content.md +22 -23
  18. package/legion/skills/legion-worker/SKILL.md +89 -21
  19. package/legion/skills/legion-worker/references/ci-checks.md +28 -7
  20. package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +1 -1
  21. package/legion/skills/legion-worker/references/merge-gate.md +64 -25
  22. package/legion/skills/legion-worker/references/pr-body.md +22 -29
  23. package/legion/skills/legion-worker/references/results.md +50 -0
  24. package/legion/skills/legion-worker/references/review-threads.md +19 -4
  25. package/package.json +2 -2
@@ -1,17 +1,24 @@
1
1
  # The merge gate: review and the production check
2
2
 
3
- Read it when you review or approve, or work a look of a closed issue's production check. Your role prompt gives the review submission, its footer, the thread rule, the CI read and the forward-merge confirmation; this page gives what it does not. The merger's steps are all in its role prompt.
3
+ Read it when you review or approve, or work a look of a closed issue's production check.
4
+ Your role prompt gives the review submission, its footer, the thread rule, the CI read and the forward-merge confirmation; this page gives the rest.
5
+ The merger's steps are all in its role prompt.
4
6
 
5
7
  ## The reviewer
6
8
 
7
9
  1. Read CI on GitHub and the issue's results with `dispatch results --issue <issue>`, never from a handoff.
8
- 2. When the diff the round reads touches runtime code (the whole change, or the difference from the commit your task names), run `task(agent="thermonuclear-deep-review")` and `task(agent="thermonuclear-code-quality")` once at the head the round reviews, and `wait` for each result: each runs as a job of its own. Each agent reviews only the diff its task supplies, so name in each task the commit, the head and `git diff <sha> <head>` as the diff, or the whole change. The last two sentences of your task, `Last reviewed commit: <sha>.` and `Review entry: <n>.`, are the daemon's; your role prompt says how to read them.
9
- 3. A result that carries no report, or that names another place for it, is a failed run, not a verdict: run that agent again, or read its transcript. Reading the agent's diff yourself and recording that in its place is the same as answering the rubric from a bare verdict. When you can do neither, that half of the round has no review: tell the architect, do not approve, and wait with a `WAITING` line naming what you wait on until it answers.
10
- 4. A `CHANGES` from either half is answered in the review: its findings are carried into a `REQUEST_CHANGES`, or each finding is recorded with why it does not stand. Your `APPROVE` needs both halves run at the reviewed head, or both `Thermo` rows reading `not run` because the diff the round reads touches no runtime code (the whole change, or the difference from the last reviewed commit to the head).
10
+ 2. When the diff the round reads touches runtime code (the whole change, or the difference from the commit your task names), run `task(agent="thermonuclear-deep-review")` and `task(agent="thermonuclear-code-quality")` once at the head the round reviews, and `wait` for each result: each runs as a job of its own.
11
+ Each agent reviews only the diff its task supplies: name in each task the commit, the head and `git diff <sha> <head>`, or the whole change.
12
+ The last two sentences of your task, `Last reviewed commit: <sha>.` and `Review entry: <n>.`, are the daemon's; your role prompt says how to read them.
13
+ 3. A result that carries no report, or that names another place for it, is a failed run, not a verdict: run that agent again, or read its transcript.
14
+ Reading the agent's diff yourself and recording that in its place is the same as answering the rubric from a bare verdict.
15
+ When you can do neither, that half of the round has no review: tell the architect, do not approve, and wait with a `WAITING` line naming what you wait on until it answers.
16
+ 4. A `CHANGES` from either half is answered in the review: its findings are carried into a `REQUEST_CHANGES`, or each finding is recorded with why it does not stand.
17
+ Your `APPROVE` needs both halves run at the reviewed head, or both `Thermo` rows reading `not run` because the diff the round reads touches no runtime code.
11
18
 
12
19
  ### What the base requires
13
20
 
14
- Read the base's required checks with the base name escaped in the same command (a raw `#` or `%` reads another branch):
21
+ Read the base's required checks, the base name escaped in the same command (a raw `#` or `%` reads another branch):
15
22
 
16
23
  ```bash
17
24
  base=$(gh pr view <n> -R <o>/<r> --json baseRefName -q .baseRefName) && \
@@ -21,34 +28,59 @@ base=$(gh pr view <n> -R <o>/<r> --json baseRefName -q .baseRefName) && \
21
28
  echo code_scanning: && gh api --paginate "repos/<o>/<r>/rules/branches/$base_path" --jq '.[] | select(.type=="code_scanning") | .parameters'
22
29
  ```
23
30
 
24
- A `code_scanning` rule requires an analysis that no status-check list names. A read GitHub refuses leaves the required set unknown: report it to the architect, do not approve, and wait with a `WAITING` line naming the read.
31
+ A `code_scanning` rule requires an analysis that no status-check list names.
32
+ A read GitHub refuses leaves the required set unknown: report it to the architect, do not approve, and wait with a `WAITING` line naming the read.
25
33
 
26
34
  ### The head's checks
27
35
 
28
- - Read the check runs and, every page, the commit statuses: `gh api --paginate 'repos/<o>/<r>/commits/<headRefOid>/status?per_page=100' --jq '.statuses[] | [.context, .state] | @tsv'`. Read the status list, never that endpoint's top-level `state`, which reads `pending` for a head with no status.
29
- - The newest run of a name (latest `started_at`) decides, and the newest status of a context. `--paginate` runs `--jq` once per page, so choose over the merged list.
30
- - A check run `queued`, `requested`, `waiting`, `pending` or `in_progress`, or a status `pending`, is running: wait, unapproved. A run waiting on an environment's approval, another App's check run, or a status left `pending` has no bound; when it stands longer than its CI usually takes, tell the architect and wait.
31
- - A check the base does not require holds no approval. A red one whose log shows the change breaks something is a finding; any other is named in the review body.
32
- - The daemon's `checkRuns` count in the issue's `mergeWait` is only the runs a settlement applied: read GitHub before you act.
36
+ - Read the check runs and, every page, the commit statuses:
37
+ `gh api --paginate 'repos/<o>/<r>/commits/<headRefOid>/status?per_page=100' --jq '.statuses[] | [.context, .state] | @tsv'`.
38
+ Read the list, never the endpoint's top-level `state`, which reads `pending` for a head with no status.
33
39
 
34
- ### A required item with no run at the head
40
+ - The newest run of a name (latest `started_at`) decides, and the newest status of a context.
41
+ `--paginate` runs `--jq` per page, so choose over the merged list.
42
+
43
+ - A required check run `queued`, `requested`, `waiting`, `pending` or `in_progress`, or such a status `pending`: wait, unapproved.
44
+ A run waiting on an environment's approval, another App's check run, or a status left `pending` has no bound: once it outlasts its usual CI time, tell the architect and wait.
45
+
46
+ - A check the base does not require holds no approval: a red one is a finding if its log shows the change breaks something, else name it in the review body.
47
+
48
+ - The `checkRuns` of the issue's `mergeWait` counts only the runs a settlement applied: read GitHub before you act.
35
49
 
36
- Never approve a head while a required item has no run. Sort it, in this order. Cases 2, 3, 4 and 6 end: tell the architect, do not approve, and wait with a `WAITING` line naming what you wait on.
50
+ ### A required item with no run at the head
37
51
 
38
- 1. Read `gh pr view <n> --repo <o>/<r> --json mergeable,mergeStateStatus` first. `DIRTY` takes a forward merge, which is the implementer's before the review and the merger's in `merging`: the daemon asks for it and tells you the new head when it lands. `UNKNOWN`: read again each minute for up to five minutes, then report it to the architect as a refused read.
39
- 2. A fork head whose runs stand `action_required` waits on a maintainer. Never close and reopen it.
40
- 3. A check only a commit status reports, or a workflow another repository defines: nothing here starts it. Never close and reopen it.
41
- 4. A required workflow whose `paths` or `paths-ignore` filter, as the base holds it, skips every file of the change: a reopen sends the same event, so the head or the workflow must change.
42
- 5. The remedy's case: a `BLOCKED` head, not from a fork (`--json isCrossRepository`), with no run `action_required`, where a workflow under `.github/workflows/` (as the merge commit holds it) has a job reporting the item whose `on:` runs it for `pull_request` with no `types` that leave out `reopened`, no `branches` filter that excludes the base and no path filter that skips the whole change, and neither list holds a run of it. A job reports its `name:` or its key, with ` (<matrix values>)` for a matrix job and `<calling job> / <job>` for a reusable workflow's; for `code_scanning`, the analysis jobs report under their own names and the `CodeQL` run is the code-scanning App's. Tell the architect why, close the pull request, wait a minute, and reopen it at the same head (a quicker reopen can have its run cancelled by the close's own run). Approve only once the item's run concluded green. One close and reopen covers every item of the head: name the others to the architect in the same message. A head with any item in case 2 or 3 takes no remedy, and an item still with no run after the reopen's runs concluded is never reopened again.
43
- 6. Anything else: tell the architect, do not approve, and wait.
52
+ Never approve a head while a required item has no run; sort it in this order.
53
+ Cases 2, 3, 4 and 6 end: tell the architect, do not approve, and wait with a `WAITING` line naming what you wait on.
54
+
55
+ 1. Read `gh pr view <n> --repo <o>/<r> --json mergeable,mergeStateStatus` first.
56
+ `DIRTY` takes a forward merge, the implementer's before the review and the merger's in `merging`: the daemon asks for it and names the new head.
57
+ `UNKNOWN`: read each minute for up to five minutes, then report it to the architect as a refused read.
58
+ 2. A fork head whose runs stand `action_required` waits on a maintainer.
59
+ Never close and reopen it.
60
+ 3. A check only a commit status reports, or a workflow another repository defines: nothing here starts it.
61
+ Never close and reopen it.
62
+ 4. A required workflow whose `paths` or `paths-ignore` filter, as the base holds it, skips every file of the change:
63
+ a reopen sends the same event, so the head or the workflow must change.
64
+ 5. The remedy's case: a `BLOCKED` head, not from a fork (`--json isCrossRepository`), with no run `action_required`, where a workflow under `.github/workflows/` (as the merge commit holds it) has a job reporting the item whose `on:` runs it for `pull_request` with no `types` that leave out `reopened`, no `branches` filter that excludes the base and no path filter that skips the whole change, and neither list holds a run of it.
65
+ A job reports its `name:` or key, ` (<matrix values>)` after it for a matrix job, `<calling job> / <job>` for a reusable workflow's;
66
+ for `code_scanning`, the analysis jobs report under their own names and the `CodeQL` run is the code-scanning App's.
67
+ Tell the architect why, close the pull request, wait a minute, and reopen it at the same head (the close's own run can cancel a quicker reopen's).
68
+ Approve only once the item's run concluded green.
69
+ One close and reopen covers every item of the head: name the others to the architect in the same message.
70
+ A head with any item in case 2 or 3 takes no remedy, and an item with no run once the reopen's runs concluded is never reopened.
71
+ 6. Anything else.
44
72
 
45
73
  ### The issue's checks
46
74
 
47
- - Approval is gated by the issue's own `before_merge` checks, as your role prompt says; a `ci_check` check as `skill://legion-worker/references/ci-checks.md` says. A check whose `run` is a whole test suite with no pass standing is a finding for the architect: wait for its rewrite, and request no changes for it.
75
+ - Approval is gated by the issue's own `before_merge` checks, as your role prompt says;
76
+ a `ci_check` check as `skill://legion-worker/references/ci-checks.md` says.
77
+ With no tester step, the implementer's evidence for each is what you read.
78
+ A check whose `run` is a whole test suite with no pass standing is a finding for the architect: wait for its rewrite, and request no changes for it.
48
79
 
49
80
  ### A merge of the base is reviewed for what it changed
50
81
 
51
- After a forward merge of the base, read the merge (`skill://legion-worker/references/conflicts-and-rewrites.md`) and this change's own commits since the head your last submitted review read, its Legion footer's `head`. This lists your session's reviews, oldest first, so the last line is your last review; no line, or `no head` on it, means you read the branch's whole diff:
82
+ After a forward merge, read the merge (`skill://legion-worker/references/conflicts-and-rewrites.md`) and this change's own commits since your last submitted review's footer `head`.
83
+ This lists your session's reviews, oldest first; no line, or `no head` on the last one, means you read the whole diff:
52
84
 
53
85
  ```bash
54
86
  gh api --paginate repos/<o>/<r>/pulls/<n>/reviews --jq '.[] | {id, state, submitted_at, footer: ([.body // "" | scan("<!-- legion: (\\{.*?\\}) -->")] | last | .[0]? // "" | try fromjson catch {})} | select(.footer.phase == "review" and .footer.session == "<your session id>") | [.id, .state, .submitted_at, (.footer.head // "no head")] | @tsv'
@@ -56,7 +88,14 @@ gh api --paginate repos/<o>/<r>/pulls/<n>/reviews --jq '.[] | {id, state, submit
56
88
 
57
89
  ## The production check after the close
58
90
 
59
- - `projects.<KEY>.production_check` in `legion.yaml` is `tester` (the default) or `off`. Under `off` the close opens no check at all. A check keeps the role it opened with, and only that role may report on it (`CHECK_ROLE_MISMATCH`).
60
- - Reach the deploy as the deployment instructions say. When they name an agent or a role for it, `envoy_publish` the merge commit to that topic with `expects_reply: false`, and await no reply. Open a `dispatch ask` only where the instructions name nobody; the look still ends `pending`.
61
- - A staging pass is no production pass: staging does not run every resource production does.
62
- - Report each look's verdict as your role prompt says. A `fail` follows `skill://legion-worker/references/findings.md`: file no issue.
91
+ - `projects.<KEY>.production_check` in `legion.yaml` is `tester` (the default) or `off`, under which the close opens no check.
92
+ A check keeps the role it opened with, and only that role may report on it (`CHECK_ROLE_MISMATCH`).
93
+
94
+ - Reach the deploy as the deployment instructions say.
95
+ When they name an agent or a role, `envoy_publish` the merge commit to its topic with `expects_reply: false` and await no reply.
96
+ Open a `dispatch ask` only where the instructions name nobody; the look still ends `pending`.
97
+
98
+ - A staging pass is no production pass: staging may lack resources production runs.
99
+
100
+ - Report each look's verdict as your role prompt says.
101
+ A `fail` follows `skill://legion-worker/references/findings.md`: file no issue.
@@ -1,10 +1,12 @@
1
- # PR body, recorded results, and the simplify pass
1
+ # The pull request body and the simplify pass
2
2
 
3
- Read it before you edit the pull request body, record or read a check's result, or run the simplify pass.
3
+ Read it before you write or edit the pull request body, or run the simplify pass.
4
+ A check's result and the evidence each phase owes: `skill://legion-worker/references/results.md`.
4
5
 
5
6
  ## The pull request body template
6
7
 
7
- The implementer writes the body from this template when the pull request opens; later phases keep it current. Edit the live body: read it (`gh api repos/{owner}/{repo}/pulls/{number} --jq .body`), change your lines, write it back (`--method PATCH ... -F body=@body.md`).
8
+ The implementer writes the body from this template when the pull request opens; later phases keep it current.
9
+ Edit the live body: read it (`gh api repos/{owner}/{repo}/pulls/{number} --jq .body`), change your lines, write it back (`--method PATCH ... -F body=@body.md`).
8
10
 
9
11
  ```
10
12
  ## For the reviewer
@@ -13,15 +15,15 @@ The implementer writes the body from this template when the pull request opens;
13
15
  **Why:** <the problem, one or two sentences, ending with the Dispatch key in parentheses — the key only, never a URL>
14
16
  **Change:**
15
17
  - <two to five bullets, each one behaviour a user or operator meets, never a file name>
16
- **Look at first:** <one to three `path:line` places where a wrong decision would hurt> (the reviewer writes this line)
18
+ **Look at first:** <one to three `path:line` places where a wrong decision would hurt> (the reviewer writes this line; with no reviewer step, the implementer does)
17
19
  **Proven by:** <the surface and the run of the check the change turns on, one line>
18
20
  **Not proven / risk:**
19
- - <one line per claim recorded as unproven before the merge>, or the single word `none` (the reviewer writes this line; `none` is invalid while such a claim stands)
21
+ - <one line per claim recorded as unproven before the merge>, or the single word `none` (the reviewer writes this line; with no reviewer step, the implementer does; `none` is invalid while such a claim stands)
20
22
  **Size:** <files changed, +added/−removed>
21
23
 
22
24
  ## Verification
23
25
 
24
- **Threads:** <n> resolved, 0 unresolved. Each answered and resolved individually by the implementer, the pull request's author, never in bulk (the reviewer names the bot threads it accepted; it resolves none itself):
26
+ **Threads:** <n> resolved, 0 unresolved. Each answered and resolved individually by the implementer, the pull request's author, never in bulk (the reviewer names the bot threads it accepted; it resolves none itself; with no reviewer step, the implementer resolves each bot thread it fixed or declined, with its reason in the reply):
25
27
  - Thread <node id>: fixed in <commit-sha> — <one line>; resolved at <head-sha>.
26
28
  - Thread <node id>: not a defect — <reason>; resolved at <head-sha>.
27
29
  - Thread <node id>: accepted by the reviewer — <its reason, one line>; resolved at <head-sha>.
@@ -31,6 +33,7 @@ The implementer writes the body from this template when the pull request opens;
31
33
  - `thermonuclear-deep-review`: <APPROVE | CHANGES>, <n> findings stand
32
34
  - `thermonuclear-code-quality`: <APPROVE | CHANGES>, <n> findings stand
33
35
  Where the diff the round reads touches no runtime code, each row reads `not run (<the whole change | <last-reviewed-sha>..<sha>> touches no runtime code)`, and the two rows of the last round the pair ran in stay beside them.
36
+ With no reviewer step, the implementer writes the pair as the one line `thermonuclear pair: not run (no reviewer step in this task)` instead of the two rows, whatever the diff touches; do not record a second pair.
34
37
 
35
38
  **Checks:** one line per `check` block of the issue's Verification document, in the document's
36
39
  order. Each is the line `dispatch result` printed when the result was recorded, or the
@@ -49,29 +52,19 @@ GitHub refuses a body over 65,536 characters: past about 48,000, link evidence r
49
52
 
50
53
  ## The brief for the human
51
54
 
52
- The implementer keeps `Outcome`, `Why`, `Change`, `Proven by` and `Size` true after every push. At each round the reviewer writes `Look at first`, and `Not proven / risk`, copying word for word every claim recorded as unproven (the tester's `failures`, its own review). A requirement there is unmet, unless only the deploy can show it and the plan names its observation. A stale `Outcome` is a finding against the implementer; the merger rewrites nothing.
55
+ The implementer keeps `Outcome`, `Why`, `Change`, `Proven by` and `Size` true after every push.
56
+ At each round the reviewer writes `Look at first` and `Not proven / risk`, copying word for word every claim recorded as unproven (the tester's `failures`, its own review).
57
+ With no reviewer step, the implementer writes both, including what its own evidence does not prove; where the body claims a check that has not concluded at the head, the implementer names that check under `Not proven / risk`.
58
+ With no reviewer step, at retro the implementer updates `Not proven / risk` after reading the tester's handoff where the task has a tester step.
59
+ A requirement there is unmet, unless only the deploy can show it and the plan names its observation.
60
+ A stale `Outcome` is a finding against the implementer; the merger rewrites nothing.
53
61
 
54
- ## What a result is
62
+ ## The simplify pass and the `Thermo` line
55
63
 
56
- - **A check** is a `check` block of the issue's Verification document: what it `serves`, its `surface` (`browser`, `cli` or `api`), its `run`, its `when` (`before_merge`, `after_merge` or `default_branch`) and its `negative_control`. The architect writes the checks; one carrying `ci_check` is CI's (`skill://legion-worker/references/ci-checks.md`).
57
- - **A result** is one run of one check: `dispatch result --issue <issue> --check <block id> --role <your role> --verdict pass --commit <sha>`, with `--surface`, `--run`, `--observed` and `--negative-control`. These refuse a bare `-`: use `--run-file` and its kin, one reading stdin per call. Put the printed line into the body unchanged.
58
- - The surface is production-like (the real-process harness, a sandbox repository, a real browser, a development stack, staging) and has the resource the change touches; `--run` or `--observed` links to the run. A unit or integration test is a regression lock, never a result, except as the job a `ci_check` names.
59
- - Record a result only after its commit is pushed (`400 RESULT_COMMIT_UNKNOWN`).
60
- - **A check that cannot fail is not a result.** The negative control shows it failing on a deliberately wrong input. A documented procedure counts only when it ran: reading it is not a run.
61
- - A `before_merge` result stands while its commit is the head of an open pull request Dispatch attributes to the check's issue (`packages/envoy/internal/dispatch/delivery/attribution.go`), or the final head of a merged one, and while no part of the check's block has changed. So after a push, record each check with no `ci_check` again.
64
+ - The implementer runs `skill://simplify-settled-diff` once per pull request, in its first implementing round, after its own results and before it completes, whatever the diff touches, a docs-only diff included.
65
+ Applied: rerun the fast local checks and the issue's checks the simplify diff touches, and record them at the applied head.
66
+ A defect the pass reports is fixed outside the pass and the results recorded again, never dropped as out of scope;
67
+ the `Thermo` line names the count and the fixing commit.
62
68
 
63
- ## The rules every phase's evidence follows
64
-
65
- - 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 the red test for a way no test would catch. Lint, types and the unit and integration suites are CI's: read them on GitHub at the head, rerun no lane as evidence, and wait for none.
66
- - After a forward merge, the tester reruns each check the merge can reach (`skill://legion-worker/references/conflicts-and-rewrites.md`) 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. A class search that finds an instance, or a parent's last round, takes a full test round.
67
- - The implementer runs `skill://simplify-settled-diff` once per pull request, in its first implementing round, after its own results and before it completes, whatever the diff touches, a docs-only diff included. Applied: rerun the fast local checks and the issue's checks the simplify diff touches, and record them at the applied head. A defect the pass reports is fixed outside the pass and the results recorded again, never dropped as out of scope; the `Thermo` line names the count and the fixing commit.
68
- - The reviewer's pair runs at the head each round reviews, over the diff that round reads, when that diff touches runtime code; the `Thermo` line records the range it read and a row per half, and earlier rounds' rows stay beside them.
69
-
70
- ## Never waiting on CI
71
-
72
- - A red check that failed on its own is re-run once with `gh run rerun <run-id> --failed`, and its settlement waited for as `skill://envoy` says, never by sleeping. A merge-group run is never re-run.
73
- - A required check missing at the head: read `gh pr view <n> --json mergeStateStatus` first. `DIRTY` means the head conflicts with its base, so no `pull_request` run starts and a body edit re-judges nothing: merge the base forward. A green `pull_request_target` run beside it proves nothing.
74
-
75
- ## When no surface reaches the changed path
76
-
77
- Report it to the architect with `envoy_publish`, naming the missing surface and what it would have to do (a rig, a sandbox holding the resource, a credential, a command), and do not complete. The architect builds it and resumes you. A code path that first runs after the merge (a deploy workflow's inline step, a post-merge helper, a production-only resource) is an `after_merge` check instead, recorded after the merge by the role the project's `production_check` names (under `off` nothing records it), unless the implementer can run it against a development stack before then.
69
+ - The reviewer's pair runs at the head each round reviews, over the diff that round reads, when that diff touches runtime code;
70
+ the `Thermo` line records the range it read and a row per half, and earlier rounds' rows stay beside them.
@@ -0,0 +1,50 @@
1
+ # Checks, results and the evidence each phase owes
2
+
3
+ Read it before you record or read a check's result, judge another role's evidence, act on a red or missing CI check at the head, or find that no surface reaches the changed path.
4
+ The pull request body's `Checks` lines are in `skill://legion-worker/references/pr-body.md`.
5
+
6
+ ## What a result is
7
+
8
+ - **A check** is a `check` block of the issue's Verification document:
9
+ what it `serves`, its `surface` (`browser`, `cli` or `api`), its `run`, its `when` (`before_merge`, `after_merge` or `default_branch`) and its `negative_control`.
10
+ The architect writes the checks; one carrying `ci_check` is CI's (`skill://legion-worker/references/ci-checks.md`).
11
+
12
+ - **A result** is one run of one check: `dispatch result --issue <issue> --check <block id> --role <your role> --verdict pass --commit <sha>`, with `--surface`, `--run`, `--observed` and `--negative-control`.
13
+ These refuse a bare `-`: use `--run-file` and its kin, one reading stdin per call.
14
+ Put the printed line into the body unchanged.
15
+
16
+ - The surface is production-like (the real-process harness, a sandbox repository, a real browser, a development stack, staging) and has the resource the change touches;
17
+ `--run` or `--observed` links to the run.
18
+ A unit or integration test is no result, except as the job a `ci_check` names.
19
+
20
+ - Record a result only after its commit is pushed (`400 RESULT_COMMIT_UNKNOWN`).
21
+
22
+ - A check that cannot fail is not a result.
23
+ The negative control shows it failing on a deliberately wrong input.
24
+ A documented procedure counts only when it ran: reading it is not a run.
25
+
26
+ - A `before_merge` result stands while its commit is the head of an open pull request Dispatch attributes to the check's issue (`packages/envoy/internal/dispatch/delivery/attribution.go`), or the final head of a merged one, and while no part of the check's block has changed.
27
+ So after a push, record each `before_merge` check with no `ci_check` again.
28
+
29
+ ## The rules every phase's evidence follows
30
+
31
+ - 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.
32
+ Lint, types and the unit and integration suites are CI's: read them on GitHub at the head, rerun no lane as evidence, and wait for none.
33
+
34
+ - After a forward merge, the tester reruns each check the merge can reach (`skill://legion-worker/references/conflicts-and-rewrites.md`) 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.
35
+ A class search that finds an instance, or a parent's last round, takes a full test round.
36
+
37
+ ## Never waiting on CI
38
+
39
+ - The implementer re-runs once a red check whose failure is not in this pull request's code, with `gh run rerun <run-id> --failed`, and is woken by its settlement as `skill://envoy` says, never by sleeping.
40
+ A merge-group run is never re-run.
41
+
42
+ - A required check missing at the head: read `gh pr view <n> --json mergeStateStatus` first.
43
+ `DIRTY` means the head conflicts with its base, so no `pull_request` run starts and a body edit re-judges nothing: merge the base forward.
44
+ A green `pull_request_target` run beside it proves nothing.
45
+
46
+ ## When no surface reaches the changed path
47
+
48
+ Report it to the architect with `envoy_publish`, naming the missing surface and what it would have to do (a rig, a sandbox holding the resource, a credential, a command), and do not complete.
49
+ The architect has it built in this tree and resumes you.
50
+ A code path that first runs after the merge (a deploy workflow's inline step, a post-merge helper, a production-only resource) is an `after_merge` check instead, recorded after the merge by the role the project's `production_check` names (under `off` nothing records it), unless the implementer can run it against a development stack before then.
@@ -1,16 +1,27 @@
1
1
  # Review threads
2
2
 
3
3
  Read it when you reply on, list or resolve a review thread, or judge a bot's finding.
4
+ With no reviewer step, the implementer lists unresolved bot threads before each completion, including retro;
5
+ it replies to and resolves each it fixes or declines, and records it in `Threads`.
6
+ It names each declined thread to the task's architect, by node id with its reason, in its completion summary when it implements.
7
+ It names them at retro in the Dispatch message of `skill://legion-retro` step 5, since a retro summary holds two sentences.
8
+ At retro it answers the threads it finds; a run still going may open more, so retro's message names each such run (`skill://legion-retro` step 5).
4
9
 
5
- - Reply on each thread you answer, one disposition reply per thread: the implementer's `Fixed in <commit>: <one line>` or `Declined: <reason>`, the reviewer's reason in its own words. No reply resolves anything.
6
- - Only the pull request's author can resolve its threads, and the implementer opens every Legion pull request. So the implementer resolves each thread it answered, and each bot thread the reviewer accepted and named to it by node id, one call per thread, never in bulk and never a thread it has not read:
10
+ - Reply on each thread you answer, one disposition reply per thread:
11
+ the implementer's `Fixed in <commit>: <one line>` or `Declined: <reason>`, the reviewer's reason in its own words.
12
+ No reply resolves anything.
13
+
14
+ - Only the pull request's author can resolve its threads, and the implementer opens every Legion pull request.
15
+ So the implementer resolves each thread it answered, and each bot thread the reviewer accepted and named to it by node id, one call per thread, never in bulk and never a thread it has not read:
7
16
 
8
17
  ```bash
9
18
  gh api graphql -f query='mutation($id:ID!){resolveReviewThread(input:{threadId:$id}){thread{isResolved}}}' -F id=<thread node id>
10
19
  ```
11
20
 
12
21
  When GitHub refuses, send the thread and GitHub's message to the architect with `envoy_publish`; never skip it.
13
- - The implementer records each thread in the PR body's `Threads` section, stamped with the head it just pushed.
22
+
23
+ - The implementer records each thread in the PR body's `Threads` section, stamped with the head it just pushed, or at retro with the head retro found.
24
+
14
25
  - The reviewer lists the threads, replies, and names the threads it accepted to the implementer by node id (on the implementer's role topic, or in its review body):
15
26
 
16
27
  ```bash
@@ -18,6 +29,10 @@ Read it when you reply on, list or resolve a review thread, or judge a bot's fin
18
29
  ```
19
30
 
20
31
  `--paginate` prints one JSON object per page; add `--slurp` for one document.
32
+
21
33
  - GitHub cannot tell a CI bot from a person whose `gh` acts as an App, so accept such a thread only when its finding is settled.
34
+
22
35
  - A reviewer who disagrees with a resolution replies and unresolves it; a finding it cannot accept becomes its own `REQUEST_CHANGES`.
23
- - The reviewer verifies thread state in `gh api graphql`, never from the `Threads` section, and its approval never waits on a resolution. The merger resolves nothing.
36
+
37
+ - The reviewer verifies thread state in `gh api graphql`, never from the `Threads` section, and its approval never waits on a resolution.
38
+ The merger resolves nothing.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sjawhar/claude-envoy",
3
- "version": "5.12.5",
3
+ "version": "5.14.0",
4
4
  "license": "Apache-2.0",
5
5
  "description": "Claude Code plugin for Legion's Envoy bus",
6
6
  "type": "module",
@@ -19,7 +19,7 @@
19
19
  "AGENTS.md"
20
20
  ],
21
21
  "legion": {
22
- "daemonApiVersion": 217
22
+ "daemonApiVersion": 219
23
23
  },
24
24
  "repository": {
25
25
  "type": "git",