@sjawhar/claude-envoy 4.11.0 → 4.11.1

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 (66) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.omp-plugin/plugin.json +1 -1
  3. package/AGENTS.md +43 -497
  4. package/dist/envoy-channel.js +1 -1
  5. package/legion/skills/legion-architect/SKILL.md +88 -66
  6. package/legion/skills/legion-architect/references/acceptance.md +89 -258
  7. package/legion/skills/legion-architect/references/decomposition.md +94 -213
  8. package/legion/skills/legion-architect/references/design-gate.md +88 -353
  9. package/legion/skills/legion-architect/references/wake-routing.md +51 -43
  10. package/legion/skills/legion-controller/SKILL.md +50 -181
  11. package/legion/skills/legion-controller/references/admission.md +25 -54
  12. package/legion/skills/legion-controller/references/backlog-stewardship.md +23 -119
  13. package/legion/skills/legion-controller/references/consolidation.md +9 -93
  14. package/legion/skills/legion-controller/references/daily-report.md +21 -99
  15. package/legion/skills/legion-controller/references/escalation.md +16 -118
  16. package/legion/skills/legion-controller/references/finding-asks.md +31 -162
  17. package/legion/skills/legion-controller/references/park-asks.md +33 -0
  18. package/legion/skills/legion-controller/references/parked-decisions.md +20 -264
  19. package/legion/skills/legion-controller/references/session.md +26 -84
  20. package/legion/skills/legion-controller/references/slack-mentions.md +18 -134
  21. package/legion/skills/legion-controller/references/triage.md +18 -89
  22. package/legion/skills/legion-controller/references/wakes.md +22 -549
  23. package/legion/skills/legion-controller/references/weekly-audit.md +9 -90
  24. package/legion/skills/legion-oracle/SKILL.md +19 -28
  25. package/legion/skills/legion-retro/SKILL.md +54 -93
  26. package/legion/skills/legion-retro/references/learnings.md +21 -33
  27. package/legion/skills/legion-retro/references/pr-body-content.md +21 -37
  28. package/legion/skills/legion-worker/SKILL.md +50 -64
  29. package/legion/skills/legion-worker/references/ci-checks.md +16 -84
  30. package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +34 -93
  31. package/legion/skills/legion-worker/references/default-branch-check.md +22 -60
  32. package/legion/skills/legion-worker/references/findings.md +25 -180
  33. package/legion/skills/legion-worker/references/foreign-path.md +14 -22
  34. package/legion/skills/legion-worker/references/gvisor.md +20 -0
  35. package/legion/skills/legion-worker/references/merge-gate.md +43 -419
  36. package/legion/skills/legion-worker/references/plan-tests.md +8 -28
  37. package/legion/skills/legion-worker/references/pr-body.md +19 -218
  38. package/legion/skills/legion-worker/references/review-threads.md +16 -70
  39. package/legion/skills/legion-worker/references/tools.md +31 -578
  40. package/legion/skills/legion-worker/references/withheld-capability.md +12 -163
  41. package/legion/skills/simplify-settled-diff/SKILL.md +23 -41
  42. package/legion/skills/simplify-settled-diff/references/personas/code-quality-reviewer.md +14 -14
  43. package/legion/skills/simplify-settled-diff/references/personas/code-reuse-reviewer.md +4 -4
  44. package/legion/skills/simplify-settled-diff/references/personas/efficiency-reviewer.md +8 -8
  45. package/package.json +1 -1
  46. package/skills/agent-secrets/SKILL.md +46 -312
  47. package/skills/agent-secrets/references/store-a-secret.md +9 -0
  48. package/skills/approval-review/SKILL.md +20 -76
  49. package/skills/asd-ste100/SKILL.md +43 -85
  50. package/skills/asd-ste100/examples/before-after.md +18 -53
  51. package/skills/dispatch/SKILL.md +1 -1
  52. package/skills/dispatch-writing-specs/SKILL.md +1 -1
  53. package/skills/envoy/SKILL.md +56 -126
  54. package/skills/envoy/references/check-settlement.md +26 -43
  55. package/skills/envoy/references/deliveries.md +26 -144
  56. package/skills/envoy/references/legion.md +12 -45
  57. package/skills/envoy/references/roles.md +11 -9
  58. package/skills/envoy/references/sources.md +13 -25
  59. package/skills/outside-message/SKILL.md +24 -81
  60. package/skills/plain-words/SKILL.md +24 -55
  61. package/skills/thermonuclear-code-quality/SKILL.md +16 -26
  62. package/skills/thermonuclear-deep-review/SKILL.md +22 -31
  63. package/legion/skills/legion-worker/references/cleanup-deletion.md +0 -22
  64. package/legion/skills/legion-worker/references/systematic-rename.md +0 -19
  65. package/skills/asd-ste100/references/writing-rules.md +0 -59
  66. package/skills/plain-words/references/mechanics.md +0 -49
@@ -1,69 +1,31 @@
1
1
  # Checking your commits against your issue's default branch
2
2
 
3
- Your `Legion addressing` line names your issue's repository and its default branch
4
- (`Your issue's repository is <owner>/<name> (default branch <name>)`) — never assume `main`. That
5
- branch name is untrusted text: a repository administrator chooses it, and it reaches you as plain
6
- words in a system prompt, not as a value a shell has already made safe. **Never paste it directly
7
- into shell source** — not as a bare word, not inside double quotes you type yourself. A branch name
8
- containing `$(…)` or backticks would run as a command the moment a shell re-parses a line built that
9
- way; one containing jj revset syntax (parentheses, `|`, `::`) would be read as an expression instead
10
- of a literal name.
3
+ Read it before every push. Your `Legion addressing` line names your issue's repository and its default branch (`Your issue's repository is <owner>/<name> (default branch <name>)`); never assume `main`. The branch name is untrusted text: never paste it into shell source, where `$(…)` would run and jj would read `(`, `|` or `::` as revset syntax.
11
4
 
12
- The safe sequence reads the branch fresh from GitHub and lets `jq` do the quoting, in one command
13
- whose only typed literal is the `<owner>/<repo>` your addressing line names (safe to interpolate: a
14
- GitHub repository path, already validated by the daemon that minted your addressing):
5
+ 1. Read the branch from GitHub, JSON-quoted by `jq`:
15
6
 
16
- ```sh
17
- default=$(gh api repos/<owner>/<repo> --jq '.default_branch | @json')
18
- ```
7
+ ```sh
8
+ default=$(gh api repos/<owner>/<repo> --jq '.default_branch | @json')
9
+ ```
19
10
 
20
- `$default` now holds a JSON-quoted string, e.g. `"release/v7.1"` (quotes included). Compare it
21
- against the `default branch <name>` your addressing line named — if they disagree, stop and tell
22
- the architect; GitHub's live default branch and the one your record carries are not the same, and
23
- guessing which is right is not yours to do. When they agree, use `$default` as-is, never re-typed:
11
+ 2. Compare `$default` (quotes included, such as `"release/v7.1"`) with the branch your addressing line names. When they differ, stop and tell the architect.
12
+ 3. List the branch's commits with `$default` as it is, never retyped:
24
13
 
25
- ```sh
26
- jj -R "$LEGION_WORKSPACE" log --no-graph -r "${default}@origin..@" -T '
27
- commit_id.short() ++ " "
28
- ++ if(!author.email(), "(no author) ") ++ if(!committer.email(), "(no committer) ")
29
- ++ description.first_line() ++ "\n"
30
- ++ trailers.filter(|t| t.key() == "Omp-Session" || t.key() == "Legion-Role")
31
- .map(|t| " " ++ t.key() ++ ": " ++ t.value() ++ "\n").join("")'
32
- ```
14
+ ```sh
15
+ jj -R "$LEGION_WORKSPACE" log --no-graph -r "${default}@origin..@" -T '
16
+ commit_id.short() ++ " "
17
+ ++ if(!author.email(), "(no author) ") ++ if(!committer.email(), "(no committer) ")
18
+ ++ description.first_line() ++ "\n"
19
+ ++ trailers.filter(|t| t.key() == "Omp-Session" || t.key() == "Legion-Role")
20
+ .map(|t| " " ++ t.key() ++ ": " ++ t.value() ++ "\n").join("")'
21
+ ```
33
22
 
34
- Because `$default` already carries its own quote characters, jj's revset parser reads
35
- `"release/v7.1"@origin..@` as a quoted string literal naming the bookmark, whatever characters the
36
- branch name holds — parentheses, spaces, or shell metacharacters included — rather than as revset
37
- syntax or shell code. Bash's own `"${default}@origin..@"` substitutes `$default`'s value once,
38
- literally; it never re-evaluates the substituted text, so a `$(…)` sequence inside the branch name
39
- never runs.
23
+ Never `ancestors(@, 5)`, which stops at five commits. Earlier phases' commits are in the list too, each with its own role's lines.
40
24
 
41
- For each commit, the command prints its short commit id, `(no author)` or `(no committer)` where
42
- that email is empty, and its first line. Under that line it prints the commit's `Omp-Session` and
43
- `Legion-Role` trailers, one indented `key: value` line each.
25
+ ## What your own commits must show
44
26
 
45
- Every commit you made must show `Omp-Session` with your session and `Legion-Role` with your
46
- `LEGION_ROLE`. Check your own commits, not the whole list: earlier phases' commits are in the list
47
- too, and each carries the lines of its own role.
48
-
49
- ## What the lines must show, and what to do when they do not
50
-
51
- - Your session is `DISPATCH_SESSION_ID` under Oh My Pi and `CLAUDE_CODE_SESSION_ID` under Claude
52
- Code. A jj commit's `Omp-Session` line names the session your pane registered: the id in the
53
- name of the `omp-attribution-<id>.toml` file at the end of `JJ_CONFIG`
54
- (`printf '%s\n' "${JJ_CONFIG##*:}"` prints that file's path). That id differs from
55
- `DISPATCH_SESSION_ID` only after a session switch or a fork.
56
- - A commit of yours that shows a line short is cured as `skill://legion-worker` says, in "Every
57
- role pushes its own commits".
58
- - A commit of yours that shows another session or another role: send the architect this log.
59
- - The git author and committer name no role, so do not compare them. The troubleshooting section
60
- on which role made a commit says why (cybermonklabs/legion
61
- `docs/site/src/content/docs/legion/troubleshooting.md`).
62
- - A commit that shows `(no author)` or `(no committer)` is one that `jj git push` refuses: send
63
- the architect this log.
64
- - Never set `user.name`, `user.email`, `templates.commit_trailers`,
65
- `templates.revert_description`, `templates.duplicate_description` or any `trailer.*` key in any
66
- jj or Git scope (`jj config set`, `--config`, `git config`). The repository-scoped jj config is
67
- one file that every workspace of the clone shares, and a `templates.commit_trailers` there
68
- replaces the overlay's trailers. A `trailer.*` key in Git's config changes how git writes the
69
- git wrapper's lines.
27
+ - `Omp-Session:` with your session and `Legion-Role:` with your `LEGION_ROLE`. Your session is `DISPATCH_SESSION_ID` under Oh My Pi and `CLAUDE_CODE_SESSION_ID` under Claude Code. A jj commit names the session your pane registered: the id in the `omp-attribution-<id>.toml` file at the end of `JJ_CONFIG` (`printf '%s\n' "${JJ_CONFIG##*:}"`), which differs only after a session switch or a fork.
28
+ - A line short: cure it as `skill://legion-worker`, "Commits and pushes", says.
29
+ - Another session or another role, or `(no author)` or `(no committer)`, which `jj git push` refuses: send the architect this log.
30
+ - The git author and committer name no role; do not compare them.
31
+ - Never set `user.name`, `user.email`, `templates.commit_trailers`, `templates.revert_description`, `templates.duplicate_description` or any `trailer.*` key in any jj or git scope: the repository's jj config is shared by every workspace of the clone, and a `templates.commit_trailers` there replaces the pane's trailers.
@@ -1,212 +1,57 @@
1
1
  # A finding outside your issue
2
2
 
3
- Read this when you find a problem the issue you work does not cover: a defect in another
4
- component, repository or tool, a gap in Legion itself, or a `fail` on a look of the production
5
- check the project's `production_check` setting gives the tester. It holds for
6
- every Legion role (each phase worker, each architect, the controller) and for each of their
7
- subagents, and it replaces the filing step of `skill://dispatch-first` and `skill://dispatch`. The
8
- controller fixes nothing itself: it hands a finding to the tree that owns the code, as
9
- `skill://legion-controller`, "Findings, and the issues you file", says.
10
- A child's own architect opens no ask itself: where this page says to open a `dispatch ask`, it
11
- sends the finding to the architect above it with `envoy_publish`, and the root's architect opens
12
- the ask (`skill://legion-architect`, "Every turn").
3
+ Read it when you find a problem your issue does not cover (a defect in another component, repository or tool, a gap in Legion itself) or a production check look fails. It holds for every Legion role and its subagents, and replaces the filing step of `skill://dispatch-first`. A child's own architect opens no ask itself: it sends the finding to the architect above it, and the root's architect opens the ask.
13
4
 
14
5
  ## Fix it where you are, else hand it over, and ask only for a decision
15
6
 
16
- A finding outside your issue never becomes a `dispatch issue` you file. Take the first of these
17
- three steps that fits:
18
-
19
- 1. **Fix it here.** A defect with a clear fix in code your tree touches or depends on goes into
20
- your tree's own pull request, while you are in that code. The fix needs no choice a person must
21
- make, and the evidence shows the defect. Say in your handoff and in the pull request body what
22
- you fixed beside the issue's own work. A fix deferred to another issue is a fix nobody makes.
23
- 2. **Hand it over.** Any other clear defect goes to the controller with its evidence, as [Send a
24
- finding to the controller](#send-a-finding-to-the-controller) says. The controller gives it to
25
- the running tree whose code it is. Only when no tree owns that code does it file a Legion root.
26
- 3. **Ask.** A finding that needs a person's authority, taste or risk appetite is a `dispatch ask`
27
- with one recommendation, as [Where it goes](#where-it-goes) says: whether the work is wanted at
28
- all, which of several designs, who owns it, or a change of scope, cost or risk.
29
-
30
- A fix you are not sure of is not step 1: hand it over, or ask when a person must decide.
31
-
32
- - A problem inside your issue is not such a finding: fix it in your change, since nothing needed
33
- for correctness is deferred.
34
- - A problem inside your tree is work its root spec's acceptance needs. A phase worker's such
35
- problem outside its own issue goes to the architect that owns its issue, the one its
36
- `Legion addressing` line names (`skill://legion-worker`, *Stop rules*). That architect adds it
37
- to an open pull request of an issue it owns, or files a child under its own issue when it is a
38
- separately deliverable change. It sends a problem in an issue it does not own to the architect
39
- above it. Anything else, in the same repository or not, is a finding.
40
- - Search first (`skill://dispatch-first`): when an open issue already tracks the problem, comment
41
- the evidence on that issue and send or ask nothing. When an open ask on the report issue already
42
- asks about it (`dispatch open-asks --project <PROJECT>` lists them), add your evidence under that
43
- ask (`dispatch comment --issue <REPORT KEY> --reply-to-ask '<ask id>' --body-file -`, the
44
- evidence on stdin) and open no second one.
45
-
46
- These issues are filed:
47
-
48
- - an architect's children of its own issue (`dispatch issue --parent`, `skill://legion-architect`)
49
- - a Legion root the controller files for a clear defect no running tree owns
50
- - an issue a person asked the controller to file, in a direct message, in a Slack request, or in
51
- their answer to an ask
52
- - the report issue itself, which the controller creates once when the project has none
53
-
54
- `skill://legion-controller`, "Findings, and the issues you file", and
55
- `skill://legion-controller/references/daily-report.md` say how.
7
+ A finding outside your issue never becomes a `dispatch issue` you file. Take the first step that fits:
8
+
9
+ 1. **Fix it here.** A defect with a clear fix, in code your tree touches or depends on, goes into your tree's own pull request; say so in your handoff and the PR body.
10
+ 2. **Hand it over.** Any other clear defect goes to the controller with its evidence (*Send a finding to the controller*). It gives the work to the tree that owns the code, or files a Legion root when none does.
11
+ 3. **Ask.** A finding that needs a person's authority, taste or risk appetite (whether it is wanted, which design, who owns it, a change of scope, cost or risk) is a `dispatch ask` with one recommendation (*What the ask says*).
12
+
13
+ A fix you are not sure of is not step 1. A problem inside your issue is fixed in your change. A phase worker's problem inside its tree but outside its issue goes to the architect its `Legion addressing` line names.
14
+
15
+ Search first (`skill://dispatch-first`). An open issue that tracks the problem gets your evidence as a comment. An open ask on the report issue about it (`dispatch open-asks --project <PROJECT>`) gets your evidence as a reply (`dispatch comment --issue <REPORT KEY> --reply-to-ask '<ask id>' --body-file -`); open no second one.
56
16
 
57
17
  ## Send a finding to the controller
58
18
 
59
- Post the evidence first as a `dispatch comment` on the report issue ([Where it goes](#where-it-goes)
60
- says which), its first line exactly `Clear defect from <your role token>`. It prints
61
- `Posted comment <id>`. Then send the controller one message with
62
- `envoy_publish` to the controller topic your `Legion addressing` line names, with
63
- `expects_reply: false`. It holds:
64
-
65
- - your role token, from your `Legion addressing` line
66
- - the defect: what went wrong, where and to whom, with the numbers, and the issue it came from
67
- (`dispatch://<KEY>`)
68
- - where the fix belongs: the repository and the component
69
- - the fix
70
- - the evidence comment, `dispatch://<REPORT KEY>/comment/<id>`
71
-
72
- The controller hands it to the running tree whose code it is, and files a Legion root only when no
73
- tree owns that code. Either way it replies under your evidence comment with where the work went.
74
- You file nothing, and you wait for nothing. When the report issue is missing or closed, put the
75
- evidence in the message itself. A production check's recorded result then names the defect as
76
- sent to the controller, and the `fail` that records it closes the check, so that look names no
77
- next look of its own.
19
+ 1. Post the evidence as a `dispatch comment` on the report issue (*Where it goes*), its first line exactly `Clear defect from <your role token>`. It prints `Posted comment <id>`.
20
+ 2. `envoy_publish` one message to the controller topic your `Legion addressing` line names, with `expects_reply: false`: your role token; the defect (what went wrong, where, to whom, the numbers, `dispatch://<KEY>`); the repository and component where the fix belongs; the fix; and `dispatch://<REPORT KEY>/comment/<id>`.
21
+ 3. File nothing and wait for nothing. The controller replies under your evidence comment with where the work went. When the report issue is missing or closed, put the evidence in the message itself.
78
22
 
79
23
  ### When no controller takes it
80
24
 
81
- The controller topic is a live wake: a message published while no controller runs reaches nobody
82
- at the time. `envoy_publish`'s own answer tells you whether one took it. A publish to a role
83
- answers with its live `holder`, and with no count of recipients: the listener forwards a role
84
- message to its holder alone. When no live session holds `legion-<project>-controller`, because
85
- nobody claims it or its holder has not registered within the live window, the answer says Envoy
86
- kept the message for one hour, and its `kept_until` is the time that hour ends. The next session
87
- to hold the role live in that hour is handed it once. A keep is not a delivery: a controller can
88
- stay away for the whole hour, and Envoy then drops the message unread, so a kept finding can
89
- reach nobody. When your publish named your session, Envoy also sends your session a message that
90
- names the dropped one, unless it dropped it more than an hour late. For a holder that is not
91
- live, the answer also names that holder, its `holder_state` and its `last_seen`: an
92
- `unresponsive` controller is not a stopped one, so release nothing, take nothing from it, and
93
- publish no second copy.
94
- Treat a kept answer as a controller not taking it. The finding has not been taken yet,
95
- so make it an ask, as
96
- [What the ask says](#what-the-ask-says) spells it, on the first
97
- of these that holds, so a person sees it and the controller finds it when it returns:
98
-
99
- 1. **The report issue is open:** ask there, the question opening `Clear defect from <your role
100
- token>` and `--ref` naming your evidence comment. Then reply `Asked dispatch://<REPORT
101
- KEY>/ask/<id>` under that comment, so the controller takes the ask and not the comment. The
102
- report issue's assignee sees the ask, and the controller's catch-up takes it.
103
- 2. **The report issue is missing or closed:** ask on your own issue, the evidence posted there as
104
- a comment first. Then publish the ask's reference to the architect that owns your issue, the
105
- one your `Legion addressing` line names (`skill://legion-worker`, *Stop rules*). A root's
106
- architect holds its own ask. The architect holds your issue's acceptance until a controller has
107
- taken the ask (`skill://legion-architect`, "Acceptance and the merge"). That hold is what keeps
108
- the ask readable: an open ask on a closed issue drops out of the controller's own listing
109
- (`asks.go`'s `listOpenAsks` takes `i.closed_at is null`), so an issue that closed over one hides
110
- it for good.
111
- 3. **Your own issue is closed too** (Dispatch refuses the ask `409 ISSUE_CLOSED`, as on a
112
- production check): put the report issue back in reach yourself, with the `dispatch` commands
113
- below, and ask there. Never `legion({op: "set_status"})`, which the controller's report steps
114
- (`skill://legion-controller/references/daily-report.md`) use: that op is the controller's
115
- alone, and your session is refused `set_status is not
116
- available to a phase-worker session` (`packages/pi-legion/src/tools.ts`'s `OPERATIONS`). No
117
- other issue can hold an answerable ask, so this is the one case a role writes the report issue.
118
- A report issue holds no work, which is why it sits in `icebox` and why neither write below is
119
- the move the rule limits:
120
- move an issue to `backlog`, `icebox` or `triage` only when a person asked for that move, or when the work is done, folded into another issue or no longer needed, and cite that reason in a comment on the issue.
121
- - It exists and is closed: `dispatch issue-update --issue <REPORT KEY> --status icebox`. Send
122
- the status by itself. A closed issue takes a reopening status alone, and refuses it beside
123
- an assignee or any other field (`api/issue_patch.go`, the `before.ClosedAt` branch). This is
124
- the one lifecycle status your own prompt lets you write. The report issue is in no tree, so
125
- the daemon re-asserts nothing on it: `workflow`'s `sessionStatusWrite` acts only for a
126
- session that claims the issue's tree, or for an admitted root.
127
- - A search finds none: create it as "Where it goes" names it, `dispatch issue --project
128
- <PROJECT> --title 'Legion daily report' --spec-file -`, with the Summary
129
- `skill://legion-controller/references/daily-report.md` gives, then park it with
130
- `dispatch issue-update --issue <NEW KEY> --status icebox`. It carries no `legion` label.
131
- - Then post the evidence there and ask there, as [What the ask says](#what-the-ask-says)
132
- spells it. Say in your summary that you reopened or created it, so the controller knows.
133
-
134
- Name the ask in your summary, and in the result a production check records. A look that must wait
135
- for the answer reports `pending` with a `wake_at` of its own, the time you want to look again:
136
- nothing else starts the next look.
25
+ A publish to a role answers with its live `holder`. When no live session holds the controller role, the answer says Envoy kept the message for one hour (`kept_until`); a keep is not a delivery. An `unresponsive` holder is not a stopped one: release nothing, take nothing from it, and publish no second copy. Treat a kept answer as a controller not taking it, and make the finding an ask on the first of these that holds:
26
+
27
+ 1. **The report issue is open:** ask there, the question opening `Clear defect from <your role token>` and `--ref` naming your evidence comment, then reply `Asked dispatch://<REPORT KEY>/ask/<id>` under that comment.
28
+ 2. **The report issue is missing or closed:** post the evidence on your own issue and ask there, then publish the ask's reference to the architect that owns your issue. It holds your issue's acceptance until a controller takes the ask, since an open ask on a closed issue drops out of the controller's listing.
29
+ 3. **Your own issue is closed too** (`409 ISSUE_CLOSED`): put the report issue back in reach, then post and ask there, and say in your summary that you did. This is the one lifecycle status you write, and never through the `legion` tool's `set_status`.
30
+ - It exists and is closed: `dispatch issue-update --issue <REPORT KEY> --status icebox`, the status alone (a closed issue refuses a reopening status beside any other field).
31
+ - None exists: `dispatch issue --project <PROJECT> --title 'Legion daily report' --spec-file -`, with the Summary `skill://legion-controller/references/daily-report.md` gives, then `dispatch issue-update --issue <NEW KEY> --status icebox`. It carries no `legion` label.
137
32
 
138
33
  ## Where it goes
139
34
 
140
- An ask goes on the controller's report issue whenever it is open: the issue the deployment
141
- instructions name for Legion's reports, else the project's `Legion daily report`, which
142
- `dispatch search --query '"Legion daily report"' --project <PROJECT>` finds. It stays open in
143
- `icebox`, so the ask stays answerable whatever happens to the issue it came from; once an issue
144
- closes, its close withdraws its open asks (a reopen brings them back), and Dispatch refuses their
145
- answers (`409 ISSUE_CLOSED`). The question names the issue the finding came from by its
146
- `dispatch://` reference.
147
-
148
- When the project has no report issue yet, or a person closed it (`dispatch read` shows `Status:
149
- done`, and Dispatch refuses the ask with `409 ISSUE_CLOSED`), do not create or reopen one yourself
150
- (the controller does): send the finding to the controller as text, with `envoy_publish` to the
151
- controller topic your `Legion addressing` line names (`expects_reply: false`), holding the problem,
152
- the issue it came from, the evidence and the decision it needs. The controller creates or reopens
153
- the report issue and opens the ask. When that publish fails because no controller holds the role,
154
- take step 2 or 3 of [When no controller takes it](#when-no-controller-takes-it). A production
155
- check's recorded result then names the finding as sent to the controller, or names the ask.
35
+ An ask goes on the controller's report issue while it is open: the issue the deployment instructions name for Legion's reports, else the project's `Legion daily report` (`dispatch search --query '"Legion daily report"' --project <PROJECT>`). It stays open in `icebox`, so its asks stay answerable; a closed issue withdraws its open asks and refuses answers. With no open report issue, send the finding to the controller as text (the problem, the issue it came from, the evidence and the decision it needs), and the controller opens the ask; when no controller takes that publish, follow step 2 or 3 above.
156
36
 
157
37
  ## What the ask says
158
38
 
159
- The question stands alone, since the ask view shows no comment. It holds at most 2,000 characters,
160
- the `Ref: <reference>` line `--ref` appends included (about 75 characters for a comment's
161
- reference). Its first line names who asks: `Clear defect from <your role token>` for a clear
162
- defect no controller took, else `Finding from <your role token>`. The architect's acceptance and the
163
- controller's catch-up find a finding ask by that line. Then it names the concrete case before any
164
- general statement of it:
165
-
166
- - what went wrong, where and to whom: the issue it came from (`dispatch://<KEY>`), the machine,
167
- file, command or session, and the numbers;
168
- - where the fix would belong: the repository and component, and a plain statement that it is not
169
- Legion's when it is not. A problem is not Legion's because you work in Legion: name the
170
- component that misbehaved;
171
- - the decision a person must make, what happens to whom under each option, and your
172
- recommendation and its reason. A clear defect no controller took carries the fix instead, and its
173
- options ask where the work goes, with `Hand it to the owning tree` first and recommended.
174
-
175
- Evidence the decision does not need (full command output, logs, every file and line, the pull
176
- request) goes in a comment. Post it first as a `dispatch comment` on the issue the ask goes on,
177
- which prints `Posted comment <id>`, and cite that comment with `--ref`, the one reference an ask
178
- takes. That issue,
179
- `<ASK KEY>` below, is the report issue, except as [When no controller takes
180
- it](#when-no-controller-takes-it) says:
39
+ The question stands alone in at most 2,000 characters, the `Ref:` line `--ref` appends included. Its first line is `Clear defect from <your role token>` for a clear defect no controller took, else `Finding from <your role token>`. Then the concrete case: what went wrong, where and to whom (`dispatch://<KEY>`, the machine, file, command or session, the numbers); where the fix belongs, saying plainly when it is not Legion's; the decision a person must make, each option's effect and your recommendation. A clear defect carries the fix instead, with `Hand it to the owning tree` as the first, recommended option. Evidence the decision does not need goes in a comment posted first and cited by `--ref`:
181
40
 
182
41
  ```bash
183
42
  dispatch comment --issue '<ASK KEY>' --body-file - <<'EOF'
184
43
  <the evidence: commands, output with its time, file:line, links>
185
44
  EOF
186
- # Keep `File it for Legion` only when your Legion addressing line lists the repository where the
187
- # fix belongs. For a clear defect no controller took, replace the `File an issue` option below with
188
- # 'Hand it to the owning tree: <the tree, when you know it>', the first option and recommended.
45
+ # Keep `File it for Legion` only when your Legion addressing line lists the repository where the fix belongs.
189
46
  dispatch ask --issue '<ASK KEY>' --ref 'dispatch://<ASK KEY>/comment/<id>' --question-file - \
190
47
  --option 'File an issue: <what it would track, and who would own it>' \
191
48
  --option 'File it for Legion: Legion works it once it is filed' \
192
49
  --option 'Do not file: <what stays as it is>' <<'EOF'
193
50
  Finding from <your role token>
194
- <what went wrong, where and to whom, with dispatch://<KEY> and the numbers; where the fix belongs, and that it is not Legion's when it is not; what each option does to whom; your recommendation and why>
51
+ <what went wrong, where and to whom, with dispatch://<KEY> and the numbers; where the fix belongs; what each option does to whom; your recommendation and why>
195
52
  EOF
196
53
  ```
197
54
 
198
- Legion refuses to record an issue on a repository the project does not map, hence that condition.
199
-
200
55
  ## Tell the controller about the ask
201
56
 
202
- The person answers in Dispatch, and the answer reaches only the ask's followers. So once the ask is
203
- open, `envoy_publish` its reference, `dispatch://<REPORT KEY>/ask/<id>` (the id from the
204
- `Asked <id> on …` line), to the controller topic your `Legion addressing` line names, with
205
- `expects_reply: false`. The controller follows the ask and files what the person's answer asks for;
206
- you file nothing, whatever the answer says. The controller itself skips this step, since it follows
207
- each ask it opens. When the listener kept that publish rather than a holder taking it, do nothing
208
- more for an ask on the report issue: the controller's catch-up follows it at its next start.
209
-
210
- An ask on the report issue blocks nothing of your own issue: its work goes on. One on your own
211
- issue holds its acceptance, as step 2 of [When no controller takes
212
- it](#when-no-controller-takes-it) says.
57
+ The answer reaches only the ask's followers. Once the ask is open, `envoy_publish` `dispatch://<REPORT KEY>/ask/<id>` to the controller topic with `expects_reply: false`; the controller files what the answer asks for, and you file nothing. When the listener only kept that publish, do nothing more for an ask on the report issue: the controller's catch-up finds it. An ask on the report issue blocks nothing of your own issue; one on your own issue holds its acceptance. A production check look names the message or the ask in its result and summary.
@@ -1,27 +1,19 @@
1
1
  # A path you did not write
2
2
 
3
- Your workspace is shared with the issue's other roles. Read this before the `jj new` your
4
- role prompt has you run at the turn's start, and so before your first commit:
3
+ Read this when step 2 of `skill://legion-worker` lists a path you did not write. Before this branch's first push, read the second list against your default branch at origin instead of `legion/<issue>@origin`.
5
4
 
6
- cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" diff -r @ --name-only
7
- jj -R "$LEGION_WORKSPACE" diff --from "legion/<issue>@origin" --to @ --name-only
5
+ - The path is only in the second list, or already inside a commit of yours: split nothing, and tell the architect.
6
+ - The path is in the first list (the working copy `@`): take your own paths out of `@`, without `jj new` first:
8
7
 
9
- (Read the second against your default branch at origin before this branch's first push.)
10
- Every path yours: commit and push as your role prompt says. A path you did not write that is
11
- only in the second list, or already inside a commit of yours: split nothing, tell the architect.
12
- A path you did not write in the first list:
8
+ ```bash
9
+ cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" split -m '<issue>: <what you did>' <your paths…>
10
+ jj -R "$LEGION_WORKSPACE" metaedit -r @- --update-author
11
+ jj -R "$LEGION_WORKSPACE" bookmark set legion/<issue> -r @-
12
+ jj -R "$LEGION_WORKSPACE" git push --bookmark legion/<issue>
13
+ ```
13
14
 
14
- cd -- "$LEGION_WORKSPACE" && jj -R "$LEGION_WORKSPACE" split -m '<issue>: <what you did>' <your paths…>
15
- jj -R "$LEGION_WORKSPACE" metaedit -r @- --update-author
16
- jj -R "$LEGION_WORKSPACE" bookmark set legion/<issue> -r @-
17
- jj -R "$LEGION_WORKSPACE" git push --bookmark legion/<issue>
18
-
19
- No `jj new` first: the push carries that path unless its parent has no description. This split is
20
- the one exception to "Never `jj describe` or `jj split` the working-copy commit you found at the
21
- turn's start", because its `-m` writes your trailers on the commit that holds your paths. The
22
- metaedit fills the author when the found commit has none: `jj git push` refuses a commit with no
23
- author. Always `-m`, or your commit has no message of yours.
24
- The remainder keeps that path, and the push above moves the bookmark's commit alone, so it stays
25
- out of the branch. Never put the bookmark on the remainder, described or not: that
26
- pushes the other role's file. Read the first list again, then tell the architect what it held.
27
- Recover forward (`jj new`, `jj restore <paths>`), never `jj undo`, `jj abandon` or `jj op restore`.
15
+ 1. Always pass `-m`: it writes your trailers on the commit that holds your paths. This split is the one exception to never splitting the working copy you found.
16
+ 2. The metaedit fills an empty author, which `jj git push` refuses.
17
+ 3. The other role's path stays in the remainder `@`. Never put the bookmark on the remainder: that pushes the other role's file.
18
+ 4. Read the first list again, then tell the architect what it held.
19
+ 5. Recover forward (`jj new`, `jj restore <paths>`), never with `jj undo`, `jj abandon` or `jj op restore`.
@@ -0,0 +1,20 @@
1
+ # What gVisor changes in your pod
2
+
3
+ Read it before you walk a path one component at a time, trust a tool's binary or set a stack limit in your pod, and before you report a duration measured there.
4
+
5
+ Issue pods run under gVisor unless the deployment's `runtime.kubernetes.sandbox` puts the issue in a GKE Sandbox microVM (`docs/kubernetes.md`, "Issue pods in microVMs"). These items are about a gVisor pod.
6
+
7
+ - Under gVisor `openat` with `O_DIRECTORY|O_NOFOLLOW` follows a link to a directory, and `openat2` can return `ENOSYS`. Open each path component with `O_PATH|O_NOFOLLOW|O_CLOEXEC` and read its kind with `fstat`.
8
+ - Read off a tool's binary whether it calls `openat2`:
9
+
10
+ ```sh
11
+ b=$(readlink -f "$(command -v <tool>)")
12
+ n=$(nm -D --undefined-only "$b" | wc -l)
13
+ bad=$(nm -D --undefined-only "$b" | grep -c openat2 || true) # grep -c exits 1 on no match
14
+ [ "$n" -gt 0 ] || { echo "no dynamic symbols: static binary or nm failed, use a tracer"; exit 2; }
15
+ [ "$bad" -eq 0 ] || { echo "this binary calls openat2 and fails under gVisor"; exit 2; }
16
+ ```
17
+
18
+ An undefined `openat2` symbol proves the binary calls it. Its absence proves nothing: a call through `syscall(SYS_openat2, …)` leaves only `syscall` in the table. A total of zero is a static binary or a failed `nm`, not a clean result. To show a binary safe, trace it.
19
+ - Set the stack with `ulimit -S -s <n>` first, the hard limit only where it reads `unlimited`, then read both back and refuse a mismatch: `unlimited` gives 8 MiB under gVisor, which caps the stack at 128 MiB.
20
+ - Compare durations within one pod only, and label every figure taken in a gVisor pod a gVisor figure.