@sjawhar/claude-envoy 5.12.4 → 5.13.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.
@@ -2,5 +2,5 @@
2
2
  "name": "claude-envoy",
3
3
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
4
4
  "mcpServers": "./.mcp.json",
5
- "version": "5.12.4"
5
+ "version": "5.13.0"
6
6
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-envoy",
3
- "version": "5.12.4",
3
+ "version": "5.13.0",
4
4
  "description": "Put Envoy events into the Claude Code session's own conversation and expose Envoy MCP tools.",
5
5
  "mcpServers": {}
6
6
  }
@@ -62199,9 +62199,9 @@ var import_nats5 = __toESM(require_mod4(), 1);
62199
62199
 
62200
62200
  // package.json
62201
62201
  var name2 = "@sjawhar/claude-envoy";
62202
- var version2 = "5.12.4";
62202
+ var version2 = "5.13.0";
62203
62203
  var legion = {
62204
- daemonApiVersion: 217
62204
+ daemonApiVersion: 219
62205
62205
  };
62206
62206
  var package_default = {
62207
62207
  name: name2,
@@ -63997,7 +63997,7 @@ var legionIssue = object({
63997
63997
  tree: issueKey.optional(),
63998
63998
  repo: nonEmptyString2.optional(),
63999
63999
  defaultBranch: nonEmptyString2.optional(),
64000
- holdReason: literal("escalated").optional(),
64000
+ holdReason: _enum2(["escalated", "task-stopped", "children"]).optional(),
64001
64001
  heldFrom: _enum2(LEGION_WORKFLOW_PHASES).optional(),
64002
64002
  lingerUntil: timestamp.optional(),
64003
64003
  ancestry: array(issueKey).optional(),
@@ -64049,6 +64049,8 @@ var LEGION_HELD_REASONS = [
64049
64049
  "dispatch_blocker",
64050
64050
  "children_first",
64051
64051
  "accepted_ancestor",
64052
+ "children_before_retro",
64053
+ "task_stopped",
64052
64054
  "at_work",
64053
64055
  "unclassified"
64054
64056
  ];
@@ -64403,6 +64405,12 @@ var legionAnsweredPause = object({
64403
64405
  endedAt: timestamp.optional(),
64404
64406
  endedBy: legionPauseActor.optional()
64405
64407
  });
64408
+ var LegionPlanRegisterResponse = object({
64409
+ plan: object({
64410
+ version: number2().int().positive().optional(),
64411
+ tasks: array(object({ id: nonEmptyString2.optional(), steps: array(nonEmptyString2).optional() })).optional()
64412
+ }).optional()
64413
+ });
64406
64414
  var LegionProjectPauseResponse = object({
64407
64415
  pause: legionAnsweredPause.optional()
64408
64416
  });
@@ -64454,8 +64462,11 @@ var LegionHandoffCompleteRequest = strictObject({
64454
64462
  handoffVersion: number2().int().positive().optional(),
64455
64463
  wakeAt: LegionInstant.optional(),
64456
64464
  planRating: legionPlanRatingScale(number2()).optional(),
64457
- planReason: legionPlanReason.optional()
64458
- }).refine((request) => legionPlanRatingLoneField(request.planRating, request.planReason) === undefined, { message: "planRating and planReason appear together" });
64465
+ planReason: legionPlanReason.optional(),
64466
+ returnTo: number2().int().positive().optional()
64467
+ }).refine((request) => legionPlanRatingLoneField(request.planRating, request.planReason) === undefined, { message: "planRating and planReason appear together" }).refine((request) => request.returnTo === undefined || request.verdict === "fail", {
64468
+ message: "returnTo is carried only by a completion with the verdict fail"
64469
+ });
64459
64470
  var LegionIssueStatusRequest = strictObject({
64460
64471
  grantId: nonEmptyString2,
64461
64472
  issue: nonEmptyString2,
@@ -64512,6 +64523,17 @@ var LegionChildRequest = strictObject({
64512
64523
  grantId: nonEmptyString2,
64513
64524
  issue: nonEmptyString2
64514
64525
  });
64526
+ var LegionPlanRegisterRequest = strictObject({
64527
+ grantId: nonEmptyString2,
64528
+ issue: nonEmptyString2,
64529
+ artifactId: uuid2(),
64530
+ version: number2().int().positive()
64531
+ });
64532
+ var LegionTaskStopRequest = strictObject({
64533
+ grantId: nonEmptyString2,
64534
+ issue: nonEmptyString2,
64535
+ task: nonEmptyString2
64536
+ });
64515
64537
  var ISSUE_RECORD_READS = [
64516
64538
  "phase",
64517
64539
  "status",
@@ -64875,7 +64897,9 @@ function createLegionDaemonClient(baseUrl, options) {
64875
64897
  phaseRetry: (input) => post("/legion/v1/phase/retry", LegionPhaseRetryRequest, LegionEmptyResponse, input),
64876
64898
  signOff: (input) => post("/legion/v1/signoff", LegionSignOffRequest, LegionEmptyResponse, input),
64877
64899
  rootClose: (input) => post("/legion/v1/roots/close", LegionRootCloseRequest, LegionEmptyResponse, input),
64878
- childRerun: (input) => post("/legion/v1/children/rerun", LegionChildRequest, LegionEmptyResponse, input)
64900
+ childRerun: (input) => post("/legion/v1/children/rerun", LegionChildRequest, LegionEmptyResponse, input),
64901
+ planRegister: (input) => post("/legion/v1/plans/register", LegionPlanRegisterRequest, LegionPlanRegisterResponse, input),
64902
+ taskStop: (input) => post("/legion/v1/tasks/stop", LegionTaskStopRequest, LegionEmptyResponse, input)
64879
64903
  };
64880
64904
  }
64881
64905
 
@@ -65943,6 +65967,8 @@ var planReason = legionPlanReasonRules(string2({ error: PLAN_REASON_REQUIRED }),
65943
65967
  blank: PLAN_REASON_REQUIRED,
65944
65968
  long: `handoff_complete's plan_reason holds at most ${PLAN_REASON_MOST} characters`
65945
65969
  });
65970
+ var RETURN_TO_REFUSAL = "handoff_complete's return_to is a whole number of 1 or more: the place of a step of your task, 1 for its first";
65971
+ var returnTo = number2({ error: RETURN_TO_REFUSAL }).int({ error: RETURN_TO_REFUSAL }).min(1, { error: RETURN_TO_REFUSAL });
65946
65972
  var unknownFieldsRefusal = (op, refused, takes) => [
65947
65973
  ...refused.map((field) => `${op} does not accept field "${field}"`),
65948
65974
  `it takes ${takes.length === 0 ? "none" : takes.join(", ")}`
@@ -65965,7 +65991,8 @@ var PhaseOpArguments = discriminatedUnion("op", [
65965
65991
  }).optional(),
65966
65992
  wake_at: nextLook.optional(),
65967
65993
  plan_rating: planRating.optional(),
65968
- plan_reason: planReason.optional()
65994
+ plan_reason: planReason.optional(),
65995
+ return_to: returnTo.optional()
65969
65996
  }).refine((args) => legionPlanRatingLoneField(args.plan_rating, args.plan_reason) !== "rating", {
65970
65997
  error: "handoff_complete names plan_rating without plan_reason: send the rating of the plan with one sentence of why, the two together"
65971
65998
  }).refine((args) => legionPlanRatingLoneField(args.plan_rating, args.plan_reason) !== "reason", {
@@ -66015,14 +66042,14 @@ function phaseOpParameters(zod) {
66015
66042
  return byField;
66016
66043
  }
66017
66044
  var PHASE_OP_SENTENCES = {
66018
- readRecord: "read_record returns the record of `issue` from the daemon's record route for that issue, your own issue when you leave `issue` out. " + "A held issue names in `heldFrom` the phase the hold took it out of. A failed claim carries `failure`: the " + "`cause` word for what failed it, the `detail` sentence beside that word, `at`, when it failed, and " + "`attempts`, the four counts it failed with. A todo written on a held root releases the hold and starts " + "that phase again, as the architect's retry_or_escalate with retry does. ",
66045
+ readRecord: "read_record returns the record of `issue` from the daemon's record route for that issue, your own issue when you leave `issue` out. " + "A held issue names in `heldFrom` the phase the hold took it out of, and in `holdReason` why it is held when its hold has a reason: " + "`escalated` (its architect sent it to the controller), `task-stopped` (its owner stopped its task with stop_task) or `children` (it " + "waits, before its retro, for the issues beneath it). A failed claim carries `failure`: the " + "`cause` word for what failed it, the `detail` sentence beside that word, `at`, when it failed, and " + "`attempts`, the four counts it failed with. A todo written on a held root releases the hold and starts " + "that phase again, as the architect's retry_or_escalate with retry does, but a root held `task-stopped` starts its task again at its " + "first step (a task that never started waits for its gate and its line, as any task does before its first step), and a root held " + "`children` stays held until the issues beneath it close. ",
66019
66046
  readReleaseRecords: "read_release_records returns this deployment's idle-release records from `since` (an RFC 3339 time) on, read with this session's own claim: " + "every release, resume and hold the daemon recorded, and over them the counts of releases, of the releases among them that suspended no " + "role, of resumes by wake kind and of holds by reason, the pod-hours released, the share of releases woken again within ten minutes, and " + "the median, 90th percentile and maximum seconds from a wake to the woken role's first turn. A wake that a project pause held is " + "counted as `heldByPause` and left out of those seconds, since its wait measures the pause. A release that suspended no role is woken by " + "nothing, so the pod-hours released and the woken share count the releases that suspended a role alone. ",
66020
66047
  requestBackwardMove: "request_backward_move returns an issue to an earlier phase (`to`, `reason`). A phase worker moves its own issue. " + "The architect that owns an issue in accepting moves it, named by `issue`, back to planning, implementing or testing. That move counts no review round. ",
66021
66048
  readBuild: "read_build reports the build this process runs: the plugin package and version the process loaded, and the contract that build speaks. " + "It also reports the contract the daemon states on its answer to the health route. " + "That contract is null where the daemon stated none, where the daemon refused the health route and where no answer reached this process at all, and a note of its own says which. " + "The two numbers can differ, and the answer shows both. " + "Report the version this call answers, never the one at the plugin's path on the image. " + "In a pod, an Oh My Pi role relaunched onto the daemon's contract loads the build that relaunch installed under the role's own state home, " + "and a Claude Code role installs no plugin: it loads its pod image's own claude-envoy. " + "read_build reads no project state. "
66022
66049
  };
66023
66050
  var STALE_ENTRY_INSTRUCTION = "End this turn without completing. The task of the entry the phase is on is owed to this claim, and the daemon sends it by itself. " + "That task is work of its own: do what it asks at the head it names and complete it with a handoff of its own, never this completion's " + "record, commit or verdict";
66024
66051
  function legionToolDescription(host) {
66025
- return "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + (host.before ?? "") + "handoff_complete (phase workers alone: the daemon refuses an architect's completion, with ACCEPTANCE_IS_SIGN_OFF where nothing else refuses it first, since an architect accepts with sign_off; " + "the daemon accepts a completion only from the role working the issue's current phase, " + "or a role's first completion of the phase it left, which it records and which moves nothing, " + "and the checking role's report on a look of its closed issue's production check) reports this phase complete: `summary` (two sentences for the " + "architect), `verdict` pass|fail from the tester alone on a phase completion (the daemon refuses a verdict from " + "any other role there) and pass|pending|fail on a production check report (pending: production does not carry the merge " + "yet, or carries it with a requirement only the deploy can show still unobserved and a look still to follow; on the check's last look, only for an issue with no such requirement). " + "A planning, implementing, testing or reviewing phase ends with a handoff record on the " + "Dispatch issue: write it with `dispatch handoff-write --issue <issue> --phase <plan|implement|test|review> --body-file <file>` before " + "calling. This call reads from Dispatch the newest record of the phase your role works or, once the issue has moved on, of the phase it left, " + "and reports it with `commit`, the head that record's body names " + "(`head`, the 40-character lower-case commit the work it reports was done against); in implementing, the implementer's must be the commit its " + "workspace stands on, `@-`, pushed to `legion/<issue>@origin`, so push the branch first; retro, the merger's completion and a phase you left with no record, or with an implement record naming no head, report the commit the workspace stands on. It " + "refuses, posting nothing, a phase you work with no record, a Dispatch that does not answer, and, in implementing, an implement record naming no head, an " + "implementer's `@-` not yet on `legion/<issue>@origin`, or an implement record whose head is not that pushed `@-`, each naming the remedy. A production check report " + "(the task whose first line is `Production check of <KEY>`, handed once the merge closed the issue to the role the check records) needs no " + "handoff and no commit: it carries its verdict and summary alone. A pending report also names `wake_at`, an RFC 3339 time: when you want the " + "next look. A pass, a fail, and a pending on the check's last look end the check, so none of them carries `wake_at` " + "(CHECK_WAKE_UNEXPECTED), and a pending on any other look is refused without one (CHECK_WAKE_REQUIRED). A report on an issue whose check is " + "closed or never opened is refused (CHECK_NOT_OPEN), and so is one from a role the check does not record (CHECK_ROLE_MISMATCH). " + `The completion that ends the retro carries \`plan_rating\` (${LEGION_PLAN_RATING_LEAST} to ${LEGION_PLAN_RATING_MOST}) and \`plan_reason\`, as ` + "skill://legion-retro says, and the daemon refuses a completion that breaks that skill's rating rule " + "(PLAN_RATING_REQUIRED, PLAN_RATING_UNEXPECTED or PLAN_RATING_INPUT). " + "The daemon refuses " + "HANDOFF_SESSION_MISMATCH (another session wrote the record), HANDOFF_NOT_NEW (the record is the one you named for your previous phase: " + "write this phase's handoff), " + "HANDOFF_STALE_ENTRY (this completion is of a phase entry behind the one your role's phases row names, because the phase was entered " + `again while your turn ran, and nothing was recorded. ${STALE_ENTRY_INSTRUCTION}), the implementer's completion of implementing with no open ` + "pull request on `legion/<issue>` and none recorded " + "merged (HANDOFF_NO_PULL_REQUEST: open it; one naming a closed pull request is the architect's to decide); a refused completion changed " + "nothing, so fix what it names and complete again. " + "ready_for_update answers the daemon's update message on this issue's pod: `round` is the round id that message names, and the " + "daemon takes your answer for that round alone. Push every commit you want kept to the issue branch " + "first. Then let each subagent and each background job that you started finish, or stop it. Commit and push what it made " + "before you answer. The daemon replaces the pod and its disk when the round ends. The round ends at the moment the message " + "names. It can end earlier, once every role has answered, no role is in a turn and each role's last report names no running " + "subagent or background job. No answer delays that moment, and the end of a turn is no answer. If a subagent or a background " + "job finishes after you answer, commit and push what it made. Then call ready_for_update again with the same round. " + "The call ends no phase. The daemon holds your next task until your process comes back on the new pod, in this same session. " + (host.after ?? "") + `What a later phase needs goes in your handoff; a question for another live role goes to its role topic with ${host.envoyPublish}.`;
66052
+ return "Perform the workflow operation the Legion daemon assigned this role. The daemon advances phases; this tool cannot spawn workers. " + (host.before ?? "") + "handoff_complete (phase workers alone: the daemon refuses an architect's completion, with ACCEPTANCE_IS_SIGN_OFF where nothing else refuses it first, since an architect accepts with sign_off; " + "the daemon accepts a completion only from the role working the issue's current phase, " + "or a role's first completion of the phase it left, which it records and which moves nothing, " + "and the checking role's report on a look of its closed issue's production check) reports this phase complete: `summary` (two sentences for the " + "architect), `verdict` pass|fail from the tester alone on a phase completion (the daemon refuses a verdict from " + "any other role there) and pass|pending|fail on a production check report (pending: production does not carry the merge " + "yet, or carries it with a requirement only the deploy can show still unobserved and a look still to follow; on the check's last look, only for an issue with no such requirement). " + "A tester's fail may name `return_to`, the place of a step of the task its issue runs, 1 for its first: the step the task goes back " + "to; without it, the task goes back to the first implementation step before the step that failed. Only a completion with the verdict " + "fail names it (RETURN_TO_NEEDS_FAIL), a place below 1 is refused (INVALID_RETURN_TO), and so is a step the task cannot go back to " + "(RETURN_REFUSED). " + "A planning, implementing, testing or reviewing phase ends with a handoff record on the " + "Dispatch issue: write it with `dispatch handoff-write --issue <issue> --phase <plan|implement|test|review> --body-file <file>` before " + "calling. This call reads from Dispatch the newest record of the phase your role works or, once the issue has moved on, of the phase it left, " + "and reports it with `commit`, the head that record's body names " + "(`head`, the 40-character lower-case commit the work it reports was done against); in implementing, the implementer's must be the commit its " + "workspace stands on, `@-`, pushed to `legion/<issue>@origin`, so push the branch first; retro, the merger's completion and a phase you left with no record, or with an implement record naming no head, report the commit the workspace stands on. It " + "refuses, posting nothing, a phase you work with no record, a Dispatch that does not answer, and, in implementing, an implement record naming no head, an " + "implementer's `@-` not yet on `legion/<issue>@origin`, or an implement record whose head is not that pushed `@-`, each naming the remedy. A production check report " + "(the task whose first line is `Production check of <KEY>`, handed once the merge closed the issue to the role the check records) needs no " + "handoff and no commit: it carries its verdict and summary alone. A pending report also names `wake_at`, an RFC 3339 time: when you want the " + "next look. A pass, a fail, and a pending on the check's last look end the check, so none of them carries `wake_at` " + "(CHECK_WAKE_UNEXPECTED), and a pending on any other look is refused without one (CHECK_WAKE_REQUIRED). A report on an issue whose check is " + "closed or never opened is refused (CHECK_NOT_OPEN), and so is one from a role the check does not record (CHECK_ROLE_MISMATCH). " + `The completion that ends the retro carries \`plan_rating\` (${LEGION_PLAN_RATING_LEAST} to ${LEGION_PLAN_RATING_MOST}) and \`plan_reason\`, as ` + "skill://legion-retro says, and the daemon refuses a completion that breaks that skill's rating rule " + "(PLAN_RATING_REQUIRED, PLAN_RATING_UNEXPECTED or PLAN_RATING_INPUT). " + "The daemon refuses " + "HANDOFF_SESSION_MISMATCH (another session wrote the record), HANDOFF_NOT_NEW (the record is the one you named for your previous phase: " + "write this phase's handoff), " + "HANDOFF_STALE_ENTRY (this completion is of a phase entry behind the one your role's phases row names, because the phase was entered " + `again while your turn ran, and nothing was recorded. ${STALE_ENTRY_INSTRUCTION}), the implementer's completion of implementing with no open ` + "pull request on `legion/<issue>` and none recorded " + "merged (HANDOFF_NO_PULL_REQUEST: open it; one naming a closed pull request is the architect's to decide); a refused completion changed " + "nothing, so fix what it names and complete again. " + "ready_for_update answers the daemon's update message on this issue's pod: `round` is the round id that message names, and the " + "daemon takes your answer for that round alone. Push every commit you want kept to the issue branch " + "first. Then let each subagent and each background job that you started finish, or stop it. Commit and push what it made " + "before you answer. The daemon replaces the pod and its disk when the round ends. The round ends at the moment the message " + "names. It can end earlier, once every role has answered, no role is in a turn and each role's last report names no running " + "subagent or background job. No answer delays that moment, and the end of a turn is no answer. If a subagent or a background " + "job finishes after you answer, commit and push what it made. Then call ready_for_update again with the same round. " + "The call ends no phase. The daemon holds your next task until your process comes back on the new pod, in this same session. " + (host.after ?? "") + `What a later phase needs goes in your handoff; a question for another live role goes to its role topic with ${host.envoyPublish}.`;
66026
66053
  }
66027
66054
  function pluginBuildOf(manifest) {
66028
66055
  return {
@@ -66099,6 +66126,9 @@ async function executePhaseOp(runtime, input) {
66099
66126
  if (named !== "" && named !== claim.issue) {
66100
66127
  throw new Error(`handoff_complete reports this session's own issue ${claim.issue}; leave issue out, or name ${claim.issue}, not ${named}`);
66101
66128
  }
66129
+ if (args.return_to !== undefined && args.verdict !== "fail") {
66130
+ throw new Error("handoff_complete names return_to without the verdict fail: only the completion of a step that failed, with the verdict fail, names the step its task returns to; send it again without return_to");
66131
+ }
66102
66132
  const { plan_rating: planRating, plan_reason: planReason } = args;
66103
66133
  const rating = planRating === undefined || planReason === undefined ? undefined : { planRating, planReason };
66104
66134
  return retryWhileDaemonRestarts("handoff_complete", () => completeHandoff(runtime, args, rating), runtime.restart);
@@ -66248,6 +66278,9 @@ async function completeHandoff(runtime, args, rating) {
66248
66278
  const { daemon, claim } = runtime;
66249
66279
  const record = await recordFrom(daemon, claim.issue);
66250
66280
  if (record.phase === "done") {
66281
+ if (args.return_to !== undefined) {
66282
+ throw new Error("handoff_complete's return_to names the step a failed step's task returns to, and a report on a production check names none; send it again without return_to");
66283
+ }
66251
66284
  const check = record.check;
66252
66285
  if (check !== undefined) {
66253
66286
  if (args.verdict === undefined) {
@@ -66284,7 +66317,8 @@ async function completeHandoff(runtime, args, rating) {
66284
66317
  summary: args.summary,
66285
66318
  verdict: args.verdict ?? "",
66286
66319
  ...report,
66287
- ...rating
66320
+ ...rating,
66321
+ ...args.return_to === undefined ? {} : { returnTo: args.return_to }
66288
66322
  });
66289
66323
  }
66290
66324
 
@@ -1,122 +1,114 @@
1
1
  ---
2
2
  name: legion-architect
3
- description: "Use when you are a Legion root or child architect, before any lifecycle action: decomposing or adopting children, the design gate, releasing children, a delivered wake, a worker's escalation, or accepting a reviewed head."
3
+ description: "Use when you are a Legion root or child architect, before any lifecycle action: decomposing or adopting children, the design gate, an issue's plan, releasing children, a delivered wake, a worker's escalation, or accepting an issue's head."
4
4
  ---
5
5
 
6
6
  # Legion architect
7
7
 
8
- You own one issue and every issue under it until the merge that closes it. The daemon starts every
9
- worker and moves every phase; you write no code. Your role prompt holds the lifecycle rules, this
10
- skill the procedures.
8
+ You own one issue and every issue under it until the merge that closes it.
9
+ The daemon starts every worker and moves every phase; you write no code.
10
+ Your role prompt holds the lifecycle rules, this skill the procedures.
11
11
 
12
12
  ## Every turn
13
13
 
14
- - Act on delivered wakes by the [wake routing](#wake-routing); build no wait loop.
15
- - Check each claim against the code as fetched now (the default branch your addressing line names,
16
- or the head under review), and tell every reader you dispatch to do the same.
17
- - Before you end a turn that waits on a person, make sure their question is open: a decision
18
- block, a `dispatch ask` or `dispatch request-approval`. A root's questions go on the root: one on
19
- a child starts no wait, and the tree stands still. A child's own architect opens none; it sends
20
- each question to the architect above it with `envoy_publish`.
21
- - Message a role with `envoy_publish` to `notifications.role.<token>`, with a token from your
22
- addressing line or from `roleToken` in `@legion/contracts`: a typed token may reach nobody.
14
+ - Act on each delivered wake by its row in `skill://legion-architect/references/wake-routing.md`; build no wait loop.
15
+
16
+ - Check each claim against the code as fetched now (the default branch your addressing line names, or the head under review), and tell every reader you dispatch to do the same.
17
+
18
+ - Before you end a turn that waits on a person, make sure their question is open: a decision block, a `dispatch ask` or `dispatch request-approval`.
19
+ A root's questions go on the root: one on a child starts no wait, and the tree stands still.
20
+ A child's own architect opens none; it sends each question to the architect above it with `envoy_publish`.
21
+
22
+ - Message a role with `envoy_publish` to `notifications.role.<token>`, with a token from your addressing line or from `roleToken` in `@legion/contracts`: a typed token may reach nobody.
23
+
23
24
  - The deployment instructions override this skill where they conflict.
24
25
 
25
26
  ## 1. Decompose or adopt
26
27
 
27
28
  1. Read `STRATEGY.md` where the repository has one, and its design principles (`AGENTS.md` here).
28
- Find the standard solution (a web search, and how two or three well-regarded projects solve it)
29
- and cite it in the spec's `Design`. Ask a person only what neither settles, with a recommendation.
30
- 2. Before you write a design, state the problem and the design principles, with no design of
31
- yours, to `task(agent="design-outsider")`, and read its answer with `wait`. Record it on the
32
- issue or in `plan.md`, with your reason wherever you do not follow it. Run it again when a
33
- push-back or a review changes what the design is for.
34
- 3. A root: write and edit the spec as `skill://legion-architect/references/design-gate.md` says,
35
- since any new version closes the gate. A child: as
36
- `skill://legion-architect/references/decomposition.md`, "Creating children", says.
37
- 4. Decompose, adopt, split across repositories or record a wait on outside work as
38
- `skill://legion-architect/references/decomposition.md` says, red-team check first.
39
- 5. File every child before `dispatch request-approval` (or `register_gate` where your line gates no
40
- step): the gate's opening starts the root's own first phase, and a later child runs beside it.
41
-
42
- - Mark each requirement as a `requirement` block and write `verification.md` beside the spec: one
43
- `check` block per thing to prove, with `serves`, `surface` (`browser`, `cli` or `api`), `run`,
44
- `when` (`before_merge`, `after_merge` or `default_branch`) and `negative_control`. A check
45
- carrying `ci_check` is CI's and takes no `run`
46
- (`skill://legion-architect/references/design-gate.md#a-check-ci-proves`).
47
- - Every child names the running system its criteria are proven on (the command, service or page
48
- the tester drives) and the repository skill that drives it; building a missing path is this
49
- tree's work.
50
- - **Show the surface before you ask.** Where this tree builds or changes a page, screen or
51
- dashboard a person opens, that person sees it and answers before you request approval
52
- (`skill://legion-architect/references/design-gate.md`, "Show the surface before you ask"). A
53
- child's own architect sends such a surface up to the root's architect.
29
+ Find the standard solution (a web search, and how two or three well-regarded projects solve it) and cite it in the spec's `Design`.
30
+ Ask a person only what neither settles, with a recommendation.
31
+
32
+ 2. Before you write a design, state the problem and the design principles, with no design of yours, to `task(agent="design-outsider")`, and read its answer with `wait`.
33
+ Record it on the issue or in `plan.md`, with your reason wherever you do not follow it.
34
+ Run it again when a push-back or a review changes what the design is for.
35
+
36
+ 3. A root: write and edit the spec as `skill://legion-architect/references/design-gate.md` says, since any new version closes the gate.
37
+ A child: as `skill://legion-architect/references/decomposition.md`, "Creating children", says.
38
+
39
+ 4. Decompose, adopt, split across repositories or record a wait on outside work as `skill://legion-architect/references/decomposition.md` says, red-team check first.
40
+
41
+ 5. Before you write or give an issue's plan, read `skill://legion-architect/references/plan.md`:
42
+ a root's plan comes before `register_gate`, a child's before `release_children`, and an issue with none runs the default steps.
43
+ Before you stop a task or change a plan Legion runs, read `skill://legion-architect/references/plan-changes.md`.
44
+
45
+ 6. File every child before `dispatch request-approval` (or `register_gate` where your line gates no step):
46
+ the gate's opening starts the root's own first phase, and a later child runs beside it.
47
+
48
+ - Mark each requirement as a `requirement` block and write `verification.md` beside the spec:
49
+ one `check` block per thing to prove, with `serves`, `surface` (`browser`, `cli` or `api`), `run`, `when` (`before_merge`, `after_merge` or `default_branch`) and `negative_control`.
50
+ A check carrying `ci_check` is CI's and takes no `run` (`skill://legion-architect/references/design-gate.md#a-check-ci-proves`).
51
+
52
+ - Where this tree builds or changes a page, screen or dashboard a person opens, that person sees it and answers before you request approval (`skill://legion-architect/references/design-gate.md`, "Show the surface before you ask").
53
+ A child's own architect sends such a surface up to the root's architect.
54
54
 
55
55
  ## 2. Children in flight
56
56
 
57
- - A root releases no child until every gated step is open: `design-approved`, and under more than
58
- one step `gatedSteps` in `read_record` showing each `approved`.
59
- - Set a child's dependencies in one call: `dispatch issue-update --issue <child> --blocked-by <a>
60
- --blocked-by <b>`. It replaces the whole list, so read the existing links first (`dispatch read`).
61
- - Release each child once it is filed:
62
- `legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`. Legion holds a child
63
- whose blockers are not `done`. Never hold a release back for a close: a child released after the
64
- root's merge runs as an orphan root. Never block a child on its own parent, which merges last.
57
+ - A root releases no child until every gated step is open:
58
+ `design-approved`, and under more than one step `gatedSteps` in `read_record` showing each `approved`.
59
+
60
+ - Set a child's dependencies as `skill://legion-architect/references/decomposition.md`, "Recording a wait on other work", says.
61
+
62
+ - Release each child once it is filed: `legion({ op: "release_children", issues: ["LEGION-41", "LEGION-42"] })`.
63
+ Legion holds a child whose blockers are not `done`.
64
+ Never hold a release back for a close: a child released after the root's merge runs as an orphan root.
65
+ Never block a child on its own parent, which merges last.
66
+
65
67
  - On each `child-closed`, read the child's handoff, edit the specs of open children it changes.
66
68
 
67
69
  ## 3. Children complete
68
70
 
69
- A parent's own first phase waits while Dispatch shows an open child under it (the `children-first`
70
- row). A child filed after its parent started runs beside it, and the parent's sign-off waits for
71
- its last round (section 4).
71
+ A parent's own first phase waits while Dispatch shows an open child under it (the `children-first` row).
72
72
 
73
73
  ## 4. Integration verification
74
74
 
75
- - Prove every criterion of your issue in its own pull request, by its own tester evidence, never in
76
- a child; never downgrade one. A parent signs off only after its last round
77
- (`skill://legion-architect/references/acceptance.md`, "The last round").
78
- - While the work is built, a role runs the application from the issue's branch and uses it as its
79
- user would: a passing check does not show that a person can do their job with it.
80
- - Where the work is a page or a tool a person uses, offer that person a running build before the
81
- review; the deployment instructions say how a pod runs one.
75
+ - Prove every criterion of your issue in its own pull request, from the evidence its task's steps give (`skill://legion-architect/references/acceptance.md`, "Accepting"), never in a child; never downgrade one.
76
+ A parent signs off only after its last round (`skill://legion-architect/references/acceptance.md`, "The last round").
77
+
78
+ - While the work is built, a role runs the application from the issue's branch and uses it as its user would:
79
+ a passing check does not show that a person can do their job with it.
80
+
81
+ - Where the work is a page or a tool a person uses, offer that person a running build before the review; the deployment instructions say how a pod runs one.
82
82
 
83
83
  ## 5. Retro
84
84
 
85
- Your `sign_off` starts retro; never message the implementer to start it. A retro that reports a
86
- defect holds its completion until you say whether it moves the issue back, which only retro can do
87
- while it holds the phase. A retro that cannot write the body:
88
- `skill://legion-architect/references/acceptance.md`, "Retro's result".
85
+ Where the task has `acceptance:owner`, your `sign_off` starts retro; without it, the last step starts retro.
86
+ Never message the implementer to start retro.
87
+ A retro that reports a defect holds its completion until you say whether it moves the issue back, which only retro can do while it holds the phase.
88
+ A retro that cannot write the body: `skill://legion-architect/references/acceptance.md`, "Retro's result".
89
89
 
90
90
  ## 6. Acceptance and the merge
91
91
 
92
- In `accepting` no worker runs; the issue's own architect accepts it. Read, against the goal, every
93
- check and every requirement, in the five sources that
94
- `skill://legion-architect/references/acceptance.md`, "Accepting", lists.
92
+ In `accepting`, which only a task naming `acceptance:owner` enters, no worker runs:
93
+ read, against the goal, every check and requirement in `skill://legion-architect/references/acceptance.md`, "Accepting".
95
94
 
96
- Run the `goal-red-team` read your role prompt names. Accept only when a pass stands for every
97
- `before_merge` check at the approved head, every requirement has a check, and none is unmet or read
98
- narrower than written: post a `dispatch comment` naming each check and its result, then
99
- `legion({ op: "sign_off", issue: "<KEY>" })`. Otherwise `request_backward_move` with `to`
100
- (`implementing` or `testing`) and a `reason` naming the check's block id. Wait for a `ci_check` run
101
- still going; a name no run answers is yours to correct in the check. Finding asks, refusals and
102
- what follows: `skill://legion-architect/references/acceptance.md`.
95
+ Run `task(agent="goal-red-team")` as your role prompt says, then `wait` for its report.
96
+ Accept only when a pass stands for every `before_merge` check at the last step's head, every requirement has a check, and none is unmet or read narrower than written:
97
+ post a `dispatch comment` naming each check and its result, then `legion({ op: "sign_off", issue: "<KEY>" })`.
98
+ Wait for a `ci_check` run still going; a name no run answers is yours to correct in the check.
99
+ Finding asks, refusals and what follows: `skill://legion-architect/references/acceptance.md`.
103
100
 
104
101
  ## 7. Close
105
102
 
106
- The merge closes the issue once every issue beneath it has left the workflow; nothing after it is
107
- yours (`skill://legion-architect/references/acceptance.md`, "The close").
103
+ The merge closes the issue once every issue beneath it has left the workflow;
104
+ nothing after it is yours (`skill://legion-architect/references/acceptance.md`, "The close").
108
105
 
109
- ## Wake routing
106
+ ## Escalation judgment
110
107
 
111
- Handle each delivered wake by its row in `skill://legion-architect/references/wake-routing.md`.
108
+ - Send the controller (its topic is on your addressing line) a child that serves no criterion of the root, a need for admission slots, and two trees changing the same code.
112
109
 
113
- ## Escalation judgment
110
+ - Carry a clear defect the controller gives you in this tree:
111
+ in an open pull request, or in a child after the red-team check; reply under its evidence comment with the issue that carries it.
112
+ It changes the root spec only where it changes the Summary, a requirement, a check or the scope (`skill://legion-architect/references/design-gate.md`, "After approval").
114
113
 
115
- - Send the controller (its topic is on your addressing line) a child that serves no criterion of
116
- the root, a need for admission slots, and two trees changing the same code.
117
- - A clear defect the controller gives you is this tree's work: an open pull request, or a child
118
- after the red-team check; reply under its evidence comment with the issue that carries it. It
119
- changes the root spec only where it changes the Summary, a requirement, a check or the scope
120
- (`skill://legion-architect/references/design-gate.md`, "After approval").
121
- - A tool a worker cannot get is a pull request to the worker image
122
- (`skill://legion-worker/references/tools.md`).
114
+ - A tool a worker cannot get is a pull request to the worker image (`skill://legion-worker/references/tools.md`).