@sjawhar/claude-envoy 6.11.1 → 6.12.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 (30) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.omp-plugin/plugin.json +1 -1
  3. package/dist/codex-hook.js +201 -21
  4. package/dist/dispatch.js +201 -21
  5. package/dist/envoy-channel.js +203 -23
  6. package/dist/session-hook.js +201 -21
  7. package/legion/skills/legion-architect/SKILL.md +2 -2
  8. package/legion/skills/legion-architect/references/acceptance.md +1 -1
  9. package/legion/skills/legion-architect/references/decomposition.md +2 -2
  10. package/legion/skills/legion-architect/references/operations.md +1 -1
  11. package/legion/skills/legion-controller/SKILL.md +5 -5
  12. package/legion/skills/legion-controller/references/backlog-stewardship.md +3 -3
  13. package/legion/skills/legion-controller/references/consolidation.md +1 -1
  14. package/legion/skills/legion-controller/references/daily-report.md +6 -17
  15. package/legion/skills/legion-controller/references/escalation.md +1 -1
  16. package/legion/skills/legion-controller/references/finding-asks-steps.md +4 -4
  17. package/legion/skills/legion-controller/references/finding-asks.md +16 -15
  18. package/legion/skills/legion-controller/references/operations-steps.md +2 -2
  19. package/legion/skills/legion-controller/references/operations.md +5 -5
  20. package/legion/skills/legion-controller/references/park-asks.md +2 -2
  21. package/legion/skills/legion-controller/references/triage.md +1 -1
  22. package/legion/skills/legion-oracle/SKILL.md +1 -1
  23. package/legion/skills/legion-worker/references/conflicts-and-rewrites.md +0 -2
  24. package/legion/skills/legion-worker/references/findings-steps.md +5 -5
  25. package/legion/skills/legion-worker/references/findings.md +13 -22
  26. package/legion/skills/legion-worker/references/results.md +15 -2
  27. package/package.json +1 -1
  28. package/skills/dispatch/SKILL.md +7 -3
  29. package/skills/dispatch-first/SKILL.md +1 -1
  30. package/skills/dispatch-writing-specs/SKILL.md +1 -1
@@ -17720,8 +17720,8 @@ function dispatchToolSchema(spec, z, opts) {
17720
17720
  var ISSUE_REFERENCE = "An issue is a native KEY or external owner/repo#n reference. An external reference addresses an existing Dispatch issue, including one linked to that GitHub pull request; only dispatch issue with --external creates a native issue.";
17721
17721
  var BOARD_NEIGHBOUR_REFUSAL = "The server refuses a key that does not exist, one in another project, this issue itself, an empty value, and a pair the board does not hold in that order.";
17722
17722
  var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is a native KEY or external owner/repo#n reference; a project is a project key such as CORE and addresses an unlinked project document named by artifact.";
17723
- var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. Then give " + "your recommendation and its reason.";
17724
- var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
17723
+ var ASK_QUESTION_CONTRACT = "The question names the concrete case first: which machines, files, sessions or people, and the " + "numbers. It asks the choice in those terms, saying what happens to whom under each option " + '("Ship Friday and risk signing out 1,240 users, or hold to Monday?"), never "How should we ' + 'proceed?" or "Which option?", because a reader cannot work back from a general question to ' + "the case. It carries every fact the reader needs to decide and nothing " + "that does not change the decision. Generalize only after the specifics, if at all. A question " + "between two or more real choices gives one recommendation and its reason. A request for one " + "act only the person can do (an approval, a credential, a grant, a setting of their own " + "account) says what the act is, what it changes and how to do it, and gives no recommendation.";
17724
+ var ASK_OPTIONS_CONTRACT = "Options carry only the real choices: each is within your rules, and a person could choose " + "it. Add no option that breaks your rules or that no one would choose. Each option has a " + "label, and its description says what that approach costs. A request for one act only the " + "person can do has the two options Done and Can't.";
17725
17725
  var ASK_IS_FOR_A_PERSON = "An ask is a question for a person, never a request to another agent. Ask an agent by envoy_send or a comment on the issue.";
17726
17726
  var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.";
17727
17727
  var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
@@ -18092,6 +18092,39 @@ var RESULT_RECORD_FIELDS = [
18092
18092
  ];
18093
18093
  var RESULT_RETRACT_RULE = "Pass retract with the id of a result recorded before, and reason with why that result is " + "wrong, to retract it.";
18094
18094
  var RESULT_SHAPE_RULE = `${RESULT_RETRACT_RULE} A call with retract takes reason and no other argument. A call ` + "without retract records a result, and it takes issue, check, role, verdict and commit.";
18095
+ var DEPLOY_REPO = /^[A-Za-z0-9_.-]+\/[A-Za-z0-9_.-]+$/;
18096
+ var DEPLOY_PROGRAM = /^[a-z0-9-]{1,64}$/;
18097
+ var DEPLOY_COMMIT = /^[0-9a-f]{40}$/;
18098
+ var DEPLOY_TIME = /^(\d{4})-(\d{2})-(\d{2})T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/;
18099
+ function deployRepoProblem(value) {
18100
+ const input = value;
18101
+ return typeof input["repo"] !== "string" || !DEPLOY_REPO.test(input["repo"]) ? "repo must be owner/repo" : undefined;
18102
+ }
18103
+ function deployProblem(value) {
18104
+ const input = value;
18105
+ const repo = deployRepoProblem(input);
18106
+ if (repo !== undefined)
18107
+ return repo;
18108
+ if (typeof input["program"] !== "string" || !DEPLOY_PROGRAM.test(input["program"]))
18109
+ return "program must be 1 to 64 lowercase letters, digits or hyphens";
18110
+ if (typeof input["commit"] !== "string" || !DEPLOY_COMMIT.test(input["commit"]))
18111
+ return "commit must be 40 lowercase hexadecimal characters";
18112
+ if (input["deployed_at"] !== undefined) {
18113
+ const value = input["deployed_at"];
18114
+ if (typeof value !== "string")
18115
+ return "deployed_at must be RFC3339";
18116
+ const parts = DEPLOY_TIME.exec(value);
18117
+ const timestamp = Date.parse(value);
18118
+ if (parts === null || !Number.isFinite(timestamp))
18119
+ return "deployed_at must be RFC3339";
18120
+ const calendar = new Date(`${parts[1]}-${parts[2]}-${parts[3]}T00:00:00Z`);
18121
+ if (calendar.toISOString().slice(0, 10) !== value.slice(0, 10))
18122
+ return "deployed_at must be a valid calendar date";
18123
+ if (timestamp > Date.now() + 5 * 60 * 1000)
18124
+ return "deployed_at must not be more than five minutes in the future";
18125
+ }
18126
+ return;
18127
+ }
18095
18128
  function resultProblem(value) {
18096
18129
  const input = value;
18097
18130
  const carried = RESULT_RECORD_FIELDS.filter((field) => input[field] !== undefined);
@@ -18273,7 +18306,7 @@ var dispatchToolSpecs = [
18273
18306
  }
18274
18307
  ]
18275
18308
  },
18276
- description: `${ASK_IS_FOR_A_PERSON} ${ASK_WAITS_ON_THE_ASSIGNEE} ` + "Open a to-do or permission only a human can give, or a decision that has no document to " + "live in. A question about the design an issue's document records is not this tool: write " + "it into that document as a decision block (dispatch doc-edit inserting an ask block at the " + "end of the section it concerns), at every phase, approved spec or not; the block reaches " + "the Inbox and its answer lands next to its context. Never give an ask an Approve option: a " + "document is approved through dispatch request-approval. Do not use this tool for a status " + "update or discussion; use dispatch message instead. Never create an issue to park a " + "question: the question is an ask on the issue it concerns. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " For an action only a human can perform, state what it changes and risks as constraints. " + "Anything that requires a human to do, including a credential or grant renewal, is an ask, " + "never a message. Measure what you can first, and put the measurement and the size of the " + "population it covers in the question; drop an option that cannot fix most of that " + "population, never offer it cut down, and keep an option not to act (Hold). Set urgency high " + "when your work halts on the answer, and keep working on everything else. " + "Anchor a to-do about a document passage, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". ` + `A quote anchor is pinned to its block. ${ASK_BOUND_RULE} The lines images appends count ` + `toward that bound, and an ask has at most 8 options. ${RELATED_CHECK_RESULT} ` + `An ask among the related items says whether it is answered, by whom and with which options. ${OWNER_REFERENCE}`,
18309
+ description: `${ASK_IS_FOR_A_PERSON} ${ASK_WAITS_ON_THE_ASSIGNEE} ` + "Open a to-do or permission only a human can give, or a decision that has no document to " + "live in. Ask for a decision only when two or more choices are real. Where only one is " + "real, make it, and tell the person what you did and why. A question about the design an " + "issue's document records is not this tool: write " + "it into that document as a decision block (dispatch doc-edit inserting an ask block at the " + "end of the section it concerns), at every phase, approved spec or not; the block reaches " + "the Inbox and its answer lands next to its context. Never give an ask an Approve option: a " + "document is approved through dispatch request-approval. Do not use this tool for a status " + "update or discussion; use dispatch message instead. Never create an issue to park a " + "question: the question is an ask on the issue it concerns. " + ASK_QUESTION_CONTRACT + " " + ASK_OPTIONS_CONTRACT + " For an action only a human can perform, state what it changes and risks as constraints, " + "and a safer alternative as a fact, never as an option. " + "Anything that requires a human to do, including a credential or grant renewal, is an ask, " + "never a message. Measure what you can first, and put the measurement and the size of the " + "population it covers in the question; drop an option that cannot fix most of that " + "population, and never offer it cut down. Offer an option not to act (Hold) only where not " + "acting is a real choice and the question names its cost. Set urgency high " + "when your work halts on the answer, and keep working on everything else. " + "Anchor a to-do about a document passage, thread reply_to/reply_to_ask, or cite a dispatch:// " + `reference \u2014 it must be answerable from its own text and anchor alone, never "see above". ` + `A quote anchor is pinned to its block. ${ASK_BOUND_RULE} The lines images appends count ` + `toward that bound, and an ask has at most 8 options. ${RELATED_CHECK_RESULT} ` + `An ask among the related items says whether it is answered, by whom and with which options. ${OWNER_REFERENCE}`,
18277
18310
  arguments: (z) => ({
18278
18311
  issue: z.string().describe(ISSUE_REFERENCE).optional(),
18279
18312
  project: z.string().describe("Project key owning the document.").optional(),
@@ -18593,14 +18626,51 @@ var dispatchToolSpecs = [
18593
18626
  refusal: (value) => resultProblem(value) ?? RESULT_SHAPE_RULE
18594
18627
  }
18595
18628
  },
18629
+ {
18630
+ name: "dispatch_deploy",
18631
+ example: {
18632
+ repo: "acme/widgets",
18633
+ program: "worker",
18634
+ commit: "1111111111111111111111111111111111111111"
18635
+ },
18636
+ description: "Record a deployed program's build. Dispatch records the credential's writer; the body cannot choose one. A repeat of the current commit changes nothing, including its time. An older time at another commit is DEPLOY_NOT_NEWEST and names the current build. The repository must hold the commit. A project-scoped credential cannot write a deployment-wide fact. --dry-run checks the arguments and sends nothing; --json prints the complete wire answer.",
18637
+ arguments: (z) => ({
18638
+ repo: z.string().describe("The deployed repository, owner/repo."),
18639
+ program: z.string().describe("The deployed program, 1 to 64 lowercase letters, digits or hyphens."),
18640
+ commit: z.string().describe("The deployed build, 40 lowercase hexadecimal characters."),
18641
+ deployed_at: z.string().describe("The deployment time in RFC3339. Omit it for the server's clock; a time over five minutes ahead is refused.").optional(),
18642
+ url: z.string().describe("The deployment's URL, if it has one.").optional(),
18643
+ json: z.boolean().describe("Print the complete wire answer as JSON.").optional()
18644
+ }),
18645
+ validation: {
18646
+ check: (value) => deployProblem(value) === undefined,
18647
+ message: "Name repo, program and commit.",
18648
+ refusal: (value) => deployProblem(value) ?? "Name repo, program and commit."
18649
+ }
18650
+ },
18651
+ {
18652
+ name: "dispatch_deploys",
18653
+ example: { repo: "acme/widgets" },
18654
+ description: "Read the current deploy of each program in a repository, in program order, with its commit, deployment time, source and URL. --json prints the complete wire answer, including the writer and a known workflow attempt or null for an unknown attempt.",
18655
+ arguments: (z) => ({
18656
+ repo: z.string().describe("The deployed repository, owner/repo."),
18657
+ json: z.boolean().describe("Print the complete wire answer as JSON.").optional()
18658
+ }),
18659
+ validation: {
18660
+ check: (value) => deployRepoProblem(value) === undefined,
18661
+ message: "repo must be owner/repo",
18662
+ refusal: (value) => deployRepoProblem(value) ?? "repo must be owner/repo"
18663
+ }
18664
+ },
18596
18665
  {
18597
18666
  name: "dispatch_results",
18598
18667
  example: { issue: "DSP-1" },
18599
- description: "Print each check of an issue's Verification document with every result recorded against " + "it, newest first. " + "Each check prints what Dispatch compared its results with. A before_merge check is " + "compared with the head of each pull request Dispatch holds for the check's issue, open " + "or merged. An after_merge check is compared with the branch that issue's pull request " + "merged into and with the repository's default branch, and with the default branch alone " + "where Dispatch holds no merge of the issue. A default_branch check is compared with the " + "repository's default branch alone, whatever branch the pull request merged into. Where " + "a check compared with nothing, it says which of three things happened: the issue has no " + "pull request and no branch to compare with, Dispatch cannot read the repository, or a " + "read Dispatch made did not answer. " + "Each check then prints one line that answers the gate: whether a pass of it stands, and " + "from which roles. A pass stands when its commit is one of the commits the check " + "compared with, the check's words did not move after the result was recorded, and no " + "retraction stands against it. " + "The check's own words print once, under the check. Each result then prints its verdict, " + "its role, its whole 40-character commit, where that commit stands, whether the check's " + "words moved after it was recorded, the time, its id, and the reading the role recorded. " + "A result nobody gave a reading says so. A retracted result prints as retracted, with " + "the reason and the caller that retracted it. A check with no result says so. " + `${CHECK_PROVED_BY_CI}: ` + "no role records its result, and Dispatch reads it from GitHub at the head of the " + "issue's open pull request of the highest number, else at the head of its merged one of " + "the highest number. Its one result prints as `- <id> (before_merge): <verdict> at " + "<commit> by ci (CI run <name>, <conclusion>), <where that commit stands>. <the check's " + "words>`, then the `A pass stands:` line a recorded check prints, then `Pull request line:` " + "and the line to write into the pull-request body unchanged, then the reading: the " + "conclusion, the run's output title and summary, and its URL. A run that proves nothing " + "prints `- <id> (before_merge): no result:`, the sentence that names why, and the check's " + "words, then the `A pass stands:` line, then `Pull request line:` and `- Check <id> " + "(before_merge): CI run <name> has no result (<case>)`. That is a run that has not " + "concluded, one that concluded neutral, skipped or cancelled, one absent at the head, an " + "issue with no pull request head, or GitHub not read, with what GitHub answered. " + "A pull-request line writes `CI run <name>` only when it keeps every word of the name, " + "and `the CI run the check names` in its place where it drops one: a word the line drops, " + "such as an issue key or a word holding `_`. " + "A push that moves a pull request's head leaves a result at the commit before it, with " + "no write of anyone's: record the check again at the new head. A check CI proves is read " + "again at the new head by itself. " + ISSUE_REFERENCE,
18668
+ description: "Print each check of an issue's Verification document with every result recorded against " + "it, newest first. " + "Each check prints what Dispatch compared its results with. A before_merge check is " + "compared with every open pull request head, or the final head of the last to merge when " + "none is open. An after_merge result counts only at a commit that holds the work's merge " + "on the compared branch. A default_branch check names the default branch alone. " + "With no known merge, an after_merge check compares with nothing and says so. " + "A read that failed is not known, never a pass or a fail. The newest branch result decides " + "and names its id and commit. A pass and fail at that commit are not known until retraction. " + "Production and graph checks count only results recorded for the current deploy of the " + "program they read. The output names that deploy and says why an excluded result counts " + "for nothing. The check's words must be unchanged and the result unretracted. " + "The check's own words print once, under the check. Each result then prints its verdict, " + "its role, its whole 40-character commit, where that commit stands, whether the check's " + "words moved after it was recorded, the time, its id, and the reading the role recorded. " + "A result nobody gave a reading says so. A retracted result prints as retracted, with " + "the reason and the caller that retracted it. A check with no result says so. " + `${CHECK_PROVED_BY_CI}: ` + "no role records its result. Dispatch reads GitHub at every open head, or the final head " + "of the last pull request to merge when none is open. Its result prints as `- <id> (before_merge): <verdict> at " + "<commit> by ci (CI run <name>, <conclusion>), <where that commit stands>. <the check's " + "words>`, then the `A pass stands:` line a recorded check prints, then `Pull request line:` " + "and the line to write into the pull-request body unchanged, then the reading: the " + "conclusion, the run's output title and summary, and its URL. A run that proves nothing " + "prints `- <id> (before_merge): no result:`, the sentence that names why, and the check's " + "words, then the `A pass stands:` line, then `Pull request line:` and `- Check <id> " + "(before_merge): CI run <name> has no result (<case>)`. That is a run that has not " + "concluded, one that concluded neutral, skipped or cancelled, one absent at the head, an " + "issue with no pull request head, or GitHub not read, with what GitHub answered. " + "A pull-request line writes `CI run <name>` only when it keeps every word of the name, " + "and `the CI run the check names` in its place where it drops one: a word the line drops, " + "such as an issue key or a word holding `_`. " + "A push that moves a pull request's head leaves a result at the commit before it, with " + "no write of anyone's: record the check again at the new head. A check CI proves is read " + "again at the new head by itself. " + ISSUE_REFERENCE,
18600
18669
  arguments: (z) => ({
18601
18670
  issue: z.string().describe(ISSUE_REFERENCE),
18602
- at: z.string().describe("One commit of 40 lowercase hex characters. It becomes the only thing every check is compared with. Dispatch reads GitHub for none of it, except the check runs of a check CI proves, which it reads at the issue's newest pull request head as on every read, so that check's result stands at this commit only where it is that head.").optional(),
18603
- brief: z.boolean().describe("Cut each reading whose result stands at none of the compared commits to its first 200 characters. Every other reading prints whole.").optional()
18671
+ at: z.string().describe("One commit of 40 lowercase hex characters. It becomes the only thing every check is compared with. Dispatch reads GitHub for none of it, except the check runs of a check CI proves, which it reads at each open pull request head, or with none open the final head of the newest merged one, as on every read, so that check's result stands at this commit only where it is the head it was read at.").optional(),
18672
+ brief: z.boolean().describe("Cut each reading whose result stands at none of the compared commits to its first 200 characters. Every other reading prints whole.").optional(),
18673
+ json: z.boolean().describe("Print the complete results wire answer as JSON.").optional()
18604
18674
  })
18605
18675
  },
18606
18676
  {
@@ -18942,6 +19012,13 @@ var IssueDeployedEventPayloadSchema = strictObject({
18942
19012
  run_id: number2().int().positive(),
18943
19013
  completed_at: exports_iso.datetime()
18944
19014
  });
19015
+ var DeployRecordedEventPayloadSchema = strictObject({
19016
+ repo: string2(),
19017
+ program: string2(),
19018
+ commit: string2(),
19019
+ deployed_at: string2(),
19020
+ source: _enum2(["delivery_run", "route"])
19021
+ });
18945
19022
  var childStatusEventPayloadFields = {
18946
19023
  child_key: string2(),
18947
19024
  from: string2(),
@@ -19328,6 +19405,7 @@ var EVENT_TYPE_MEMBERS = {
19328
19405
  "comment.reopened": true,
19329
19406
  "comment.resolved": true,
19330
19407
  "decision.kept": true,
19408
+ "deploy.recorded": true,
19331
19409
  "handoff.recorded": true,
19332
19410
  "issue.claimed": true,
19333
19411
  "issue.closed": true,
@@ -27275,6 +27353,12 @@ class DispatchClient {
27275
27353
  async issueResults(issue, at) {
27276
27354
  return this.#json("GET", ["api", "v1", "issues", await this.#resolveIssue(issue), "results"], undefined, at === undefined ? undefined : { at });
27277
27355
  }
27356
+ async recordDeploy(input) {
27357
+ return this.#json("POST", ["api", "v1", "deploys"], input);
27358
+ }
27359
+ async deploys(repo) {
27360
+ return this.#json("GET", ["api", "v1", "deploys"], undefined, { repo });
27361
+ }
27278
27362
  async retractResult(resultID, input) {
27279
27363
  return this.#json("POST", ["api", "v1", "results", resultID, "retract"], input);
27280
27364
  }
@@ -29784,6 +29868,8 @@ var issueFreeTools = {
29784
29868
  dispatch_limits: true,
29785
29869
  dispatch_api: true,
29786
29870
  dispatch_inbox: true,
29871
+ dispatch_deploy: true,
29872
+ dispatch_deploys: true,
29787
29873
  dispatch_send_to_agent: true,
29788
29874
  dispatch_architecture_sync: true
29789
29875
  };
@@ -31327,7 +31413,8 @@ var BRIEF_READING_CHARACTERS = 200;
31327
31413
  var COMPARISON_REASONS = {
31328
31414
  no_pull_request_or_branch: () => "the issue has no pull request and no branch to compare with",
31329
31415
  repository_unreadable: (repo = "the repository") => `Dispatch cannot read ${repo}`,
31330
- read_failed: (repo) => repo === undefined ? "a read Dispatch made did not answer" : `a read Dispatch made of ${repo} did not answer`
31416
+ read_failed: (repo) => repo === undefined ? "a read Dispatch made did not answer" : `a read Dispatch made of ${repo} did not answer`,
31417
+ not_merged: () => "the work has no merge that Dispatch knows"
31331
31418
  };
31332
31419
  function isComparisonReason(reason) {
31333
31420
  return Object.hasOwn(COMPARISON_REASONS, reason);
@@ -31355,8 +31442,13 @@ function basisText(basis) {
31355
31442
  const pullRequest = basis.pull_request === undefined ? "pull request " : `${pullRequestName(basis, basis.pull_request)} `;
31356
31443
  return `the head of ${pullRequest}at ${basis.commit ?? "an unnamed commit"}${learned}`;
31357
31444
  }
31358
- if (basis.kind === "branch")
31359
- return `branch ${branchName(basis)}${learned}`;
31445
+ if (basis.kind === "branch") {
31446
+ if (basis.merge_commit === undefined)
31447
+ return `branch ${branchName(basis)}${learned}`;
31448
+ const repository = basis.repo === undefined ? "" : `in ${basis.repo} `;
31449
+ const merged = basis.merge_commit === undefined ? "" : `, merged at ${basis.merge_commit}`;
31450
+ return `${repository}branch ${basis.branch ?? "unnamed"}${merged}${learned}`;
31451
+ }
31360
31452
  return `the commit you named, ${basis.commit ?? ""}${learned}`;
31361
31453
  }
31362
31454
  function basisPlace(basis) {
@@ -31389,9 +31481,53 @@ function checkWordsText(check, result) {
31389
31481
  }
31390
31482
  return result.check_words_moved ? `The check's words moved after this result (${versions})` : `The check's words did not move after this result (${versions})`;
31391
31483
  }
31392
- function passStandsText(pass) {
31484
+ function passStandsText(pass, check, repository) {
31393
31485
  if (pass === undefined)
31394
31486
  return "Whether a pass stands is not known: this Dispatch server does not say";
31487
+ const branch = check !== undefined && (check.when === "after_merge" || check.when === "default_branch") && !(check.compared_with ?? []).some((basis) => basis.kind === "named");
31488
+ if (branch && check !== undefined) {
31489
+ const results = check.results ?? [];
31490
+ const deciding = pass.results ?? [];
31491
+ const passed = results.find((result) => result.verdict === "pass" && deciding.includes(result.id));
31492
+ const failed = results.find((result) => result.verdict === "fail" && deciding.includes(result.id));
31493
+ const result = results.find((result) => deciding.includes(result.id));
31494
+ const repo = repository ?? check.compared_with?.[0]?.repo ?? "the repository";
31495
+ const deploy = pass.deploy;
31496
+ const program = deploy?.program ?? check.program ?? "the program";
31497
+ const roles = (pass.roles ?? []).join(", ");
31498
+ if (pass.answer === "yes" && passed !== undefined)
31499
+ return `A pass stands: yes, from ${roles}, as the newest result is pass ${passed.id} at ${pass.commit ?? passed.commit_sha}`;
31500
+ switch (pass.reason) {
31501
+ case "fail":
31502
+ if (failed !== undefined)
31503
+ return `A pass stands: no, as the newest result is fail ${failed.id} at ${pass.commit ?? failed.commit_sha}`;
31504
+ break;
31505
+ case "no_result":
31506
+ return "A pass stands: no, as no result counts at a commit that holds the merge";
31507
+ case "pass_and_fail":
31508
+ if (passed !== undefined && failed !== undefined)
31509
+ return `A pass stands: not known, as pass ${passed.id} and fail ${failed.id} both count at ${pass.commit ?? passed.commit_sha}. A retraction of the wrong one ends it`;
31510
+ break;
31511
+ case "not_placed":
31512
+ if (result !== undefined)
31513
+ return `A pass stands: not known, as Dispatch could not place ${result.verdict} ${result.id} at ${pass.commit ?? result.commit_sha}`;
31514
+ break;
31515
+ case "read_failed":
31516
+ return "A pass stands: not known, as a read Dispatch made did not answer";
31517
+ case "program_not_named":
31518
+ return `A pass stands: not known, as ${repo} runs more than one program and this check names none`;
31519
+ case "no_deploy":
31520
+ return `A pass stands: not known, as Dispatch holds no deploy of ${program} in ${repo}`;
31521
+ case "deploy_not_merged":
31522
+ if (deploy !== undefined)
31523
+ return `A pass stands: not known, as ${program} runs ${deploy.commit} since ${deploy.deployed_at}, which does not hold the merge`;
31524
+ break;
31525
+ case "no_result_from_deploy":
31526
+ if (deploy !== undefined)
31527
+ return `A pass stands: not known, as no result counts for ${program} at ${deploy.commit}, deployed ${deploy.deployed_at}`;
31528
+ break;
31529
+ }
31530
+ }
31395
31531
  if (pass.answer === "yes") {
31396
31532
  const roles = pass.roles ?? [];
31397
31533
  return roles.length === 0 ? "A pass stands: yes" : `A pass stands: yes, from ${roles.join(", ")}`;
@@ -31420,6 +31556,8 @@ function resultLines(check, result, brief) {
31420
31556
  if (retracted !== undefined) {
31421
31557
  lines.push(` Retracted by ${actorText(retracted.actor)} at ${retracted.created_at}. The reason: ${retracted.reason}`);
31422
31558
  }
31559
+ if (result.not_counted !== undefined && result.not_counted !== "")
31560
+ lines.push(` It counts for nothing: ${result.not_counted}.`);
31423
31561
  return [...lines, ...readingLines(result, brief)];
31424
31562
  }
31425
31563
  function ciCheckLines(check, ci, brief) {
@@ -31441,7 +31579,7 @@ function ciCheckLines(check, ci, brief) {
31441
31579
  ...readingLines(derived, brief, " ")
31442
31580
  ];
31443
31581
  }
31444
- function checkLines(check, brief) {
31582
+ function checkLines(check, brief, repository) {
31445
31583
  if (check.ci !== undefined)
31446
31584
  return ciCheckLines(check, check.ci, brief);
31447
31585
  const bases = check.compared_with ?? [];
@@ -31449,12 +31587,15 @@ function checkLines(check, brief) {
31449
31587
  const compared = bases.length > 0 ? `Compared with ${bases.map(basisText).join(", ")}` : reason === undefined ? "Compared with nothing, and this Dispatch server does not say why" : `Compared with nothing: ${reasonText(reason)}`;
31450
31588
  const results = check.results ?? [];
31451
31589
  return [
31452
- `- ${check.block_id} (${check.when}). ${compared}. ${passStandsText(check.pass_stands)}.`,
31590
+ `- ${check.block_id} (${check.when}). ${compared}. ${passStandsText(check.pass_stands, check, repository)}.`,
31591
+ ...check.pass_stands?.deploy === undefined ? [] : [
31592
+ ` Program ${check.pass_stands.deploy.program} runs ${check.pass_stands.deploy.commit} since ${check.pass_stands.deploy.deployed_at}; a pass of this check must come from this deploy.`
31593
+ ],
31453
31594
  ` The check's words: ${check.text}`,
31454
31595
  ...results.length === 0 ? [" No result is recorded for this check."] : results.flatMap((result) => resultLines(check, result, brief))
31455
31596
  ];
31456
31597
  }
31457
- function formatCheckResults(results, brief = false) {
31598
+ function formatCheckResults(results, brief = false, repositories) {
31458
31599
  if (results.verification_artifact_id === "") {
31459
31600
  return `${results.issue} has no Verification document, so it has no checks. Write one (verification.md) with a check block per thing that must be proved.`;
31460
31601
  }
@@ -31462,7 +31603,7 @@ function formatCheckResults(results, brief = false) {
31462
31603
  if (checks.length === 0) {
31463
31604
  return `${results.issue}'s Verification document holds no check blocks.`;
31464
31605
  }
31465
- const blocks = checks.map((check) => checkLines(check, brief).join(`
31606
+ const blocks = checks.map((check) => checkLines(check, brief, repositories?.[check.issue_key]).join(`
31466
31607
  `));
31467
31608
  return [`Checks of ${results.issue}:`, ...blocks].join(`
31468
31609
 
@@ -32198,8 +32339,15 @@ async function resultsCommand(context) {
32198
32339
  const brief = optionalBoolean(args, "brief") === true;
32199
32340
  const results = await client.issueResults(issue, at);
32200
32341
  const checks = results.checks ?? [];
32342
+ const repositories = {};
32343
+ const owners = new Set(checks.filter((check) => check.pass_stands?.reason === "program_not_named" || check.pass_stands?.reason === "no_deploy").map((check) => check.issue_key));
32344
+ await Promise.all([...owners].map(async (owner) => {
32345
+ const issue = await client.getIssue(owner);
32346
+ if (issue.resolved_repo != null)
32347
+ repositories[owner] = issue.resolved_repo;
32348
+ }));
32201
32349
  return {
32202
- text: formatCheckResults(results, brief),
32350
+ text: formatCheckResults(results, brief, repositories),
32203
32351
  details: {
32204
32352
  issue,
32205
32353
  checks: checks.length,
@@ -32624,6 +32772,7 @@ var WRITE_ROUTES = [
32624
32772
  { method: "POST", pattern: "/api/v1/issues/{key}/results", commands: ["result"] },
32625
32773
  { method: "POST", pattern: "/api/v1/issues/{key}/results/dry-run", commands: ["result"] },
32626
32774
  { method: "POST", pattern: "/api/v1/results/{id}/retract", commands: ["result"] },
32775
+ { method: "POST", pattern: "/api/v1/deploys", commands: ["deploy"] },
32627
32776
  { method: "POST", pattern: "/api/v1/issues/{key}/handoffs/{phase}", commands: ["handoff-write"] },
32628
32777
  { method: "POST", pattern: "/api/v1/issues/{key}/artifacts", commands: ["artifact"] },
32629
32778
  { method: "POST", pattern: "/api/v1/projects/{key}/artifacts", commands: ["artifact"] },
@@ -33569,6 +33718,37 @@ async function sendToAgentCommand(context) {
33569
33718
  };
33570
33719
  }
33571
33720
 
33721
+ // ../envoy-client/src/dispatch-commands/deploy.ts
33722
+ function deployText(deploy) {
33723
+ const link = deploy.url === "" ? "" : ` ${deploy.url}`;
33724
+ return `${deploy.program}: ${deploy.commit} since ${deploy.deployed_at} (source: ${deploy.source}, recorded by ${actorText(deploy.recorded_by)}).${link}`;
33725
+ }
33726
+ async function deployCommand(context) {
33727
+ const { args, client } = context;
33728
+ const input = {
33729
+ repo: stringArg(args, "repo"),
33730
+ program: stringArg(args, "program"),
33731
+ commit: stringArg(args, "commit"),
33732
+ ...defined("deployed_at", optionalString(args, "deployed_at")),
33733
+ ...defined("url", optionalString(args, "url"))
33734
+ };
33735
+ const result = await client.recordDeploy(input);
33736
+ return {
33737
+ text: optionalBoolean(args, "json") === true ? JSON.stringify(result, null, 2) : deployText(result.deploy),
33738
+ details: { repo: input.repo, deploy: result.deploy }
33739
+ };
33740
+ }
33741
+ async function deploysCommand(context) {
33742
+ const { args, client } = context;
33743
+ const result = await client.deploys(stringArg(args, "repo"));
33744
+ const deploys = result.deploys ?? [];
33745
+ return {
33746
+ text: optionalBoolean(args, "json") === true ? JSON.stringify(result, null, 2) : deploys.length === 0 ? `Dispatch holds no deploys for ${result.repo}.` : deploys.map(deployText).join(`
33747
+ `),
33748
+ details: { repo: result.repo, deploys }
33749
+ };
33750
+ }
33751
+
33572
33752
  // ../envoy-client/src/dispatch-commands/documents.ts
33573
33753
  import { resolve as resolvePath3 } from "path";
33574
33754
 
@@ -35777,6 +35957,8 @@ var dispatchCommands = {
35777
35957
  dispatch_review: acting(reviewCommand),
35778
35958
  dispatch_result: acting(resultCommand),
35779
35959
  dispatch_results: acting(resultsCommand),
35960
+ dispatch_deploy: acting(deployCommand),
35961
+ dispatch_deploys: acting(deploysCommand),
35780
35962
  dispatch_artifact: {
35781
35963
  ...acting(artifactCommand),
35782
35964
  dryRun: artifactDryRun,
@@ -37068,20 +37250,18 @@ function tradeProjects(env) {
37068
37250
  }
37069
37251
  return sorted;
37070
37252
  }
37253
+ var ROLE_KEY_NAMED = `this role's agent-secrets key in the directory ${KEY_DIR_VAR} names`;
37071
37254
  async function machineKey(env) {
37072
37255
  const dir = value(env, KEY_DIR_VAR);
37073
37256
  if (value(env, IDENTITY_VAR) !== IDENTITY_KUBERNETES || dir === "")
37074
37257
  return await newDpopKey();
37075
- const path = join9(dir, ROLE_KEY_FILE);
37076
37258
  let pem;
37077
37259
  try {
37078
- pem = await readFile6(path, "utf8");
37260
+ pem = await readFile6(join9(dir, ROLE_KEY_FILE), "utf8");
37079
37261
  } catch (error) {
37080
- throw new Error(`read this role's agent-secrets key ${path}: ${messageOf(error)}`, {
37081
- cause: error
37082
- });
37262
+ throw new Error(`read ${ROLE_KEY_NAMED}: ${readErrorCode(error)}`);
37083
37263
  }
37084
- return await importDpopKey(pem, `this role's agent-secrets key ${path}`);
37264
+ return await importDpopKey(pem, ROLE_KEY_NAMED);
37085
37265
  }
37086
37266
  async function brokerTokenClient(env, own = "", read) {
37087
37267
  const brokerUrl = value(env, BROKER_URL_VAR);
@@ -31,14 +31,14 @@ Your role prompt holds the lifecycle rules, this skill the procedures.
31
31
 
32
32
  1. Read `STRATEGY.md` where the repository has one, and its design principles (`AGENTS.md` here).
33
33
  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`.
34
- Ask a person only what neither settles, with a recommendation.
34
+ Ask a person only what neither settles.
35
35
 
36
36
  2. Where you doubt that a design is the right thing to build, state the problem to `task(agent="design-outsider")` and read its answer with `wait`: it asks whether the thing should exist at all, what the smallest thing that gives the person what they asked for is, and what to delete.
37
37
 
38
38
  3. A root: write and edit the spec as `skill://legion-architect/references/design-gate.md` says, since a new version closes the gate, except two kinds it names.
39
39
  A child: as `skill://legion-architect/references/decomposition.md`, "Creating children", says.
40
40
 
41
- 4. Decompose, adopt, split across repositories or record a wait on outside work as `skill://legion-architect/references/decomposition.md` says.
41
+ 4. Decompose, adopt, split across repositories or record a wait on other work as `skill://legion-architect/references/decomposition.md` says.
42
42
 
43
43
  5. Before you write or give an issue's plan, read `skill://legion-architect/references/plan.md`:
44
44
  a root's plan comes before `register_gate`, a child's before `release_children`, and an issue with none runs the default steps.
@@ -69,7 +69,7 @@ The steps after your acceptance in the task run, then retro, then the merger mer
69
69
  A person's request after your sign-off is a requirement of this issue: the role that holds the phase makes the `request_backward_move`.
70
70
  When the merger reports:
71
71
 
72
- - the issue moved back with `request_backward_move`: its reason says why the fix is a change to the change's own logic that no merge of the base resolves; you start nothing;
72
+ - the issue moved back with `request_backward_move`: you start nothing;
73
73
 
74
74
  - a merge GitHub refuses for a repository setting or an App permission:
75
75
  open a `dispatch ask` naming the pull request, the head and GitHub's refusal, and never bypass a rule;
@@ -1,6 +1,6 @@
1
1
  # Decomposing a tree
2
2
 
3
- Read this before you read a child's handoff, create or adopt children, review a child's spec, split work across repositories, record a wait on outside work, or attach architecture components.
3
+ Read this before you read a child's handoff, create or adopt children, review a child's spec, split work across repositories, record a wait on other work, or attach architecture components.
4
4
 
5
5
  ## Reading the tree
6
6
 
@@ -91,7 +91,7 @@ Your `gh` reads every repository your App is installed on (`-R owner/repo`).
91
91
 
92
92
  ## Recording a wait on other work
93
93
 
94
- When an issue must wait on a sibling or on an issue outside this tree, set its `blocked_by` list as `skill://dispatch`, "Choosing what to work on", says.
94
+ When an issue must wait on a sibling, set its `blocked_by` list as `skill://dispatch`, "Choosing what to work on", says.
95
95
  A blocker's close is its Dispatch issue reaching `done`, not a merge or a deploy: pick a blocker whose close is the fact the issue needs.
96
96
  Legion starts the issue once its blockers close.
97
97
 
@@ -23,7 +23,7 @@ EOF
23
23
 
24
24
  ## A clear defect another role writes to you
25
25
 
26
- A clear defect another role writes to you comes as a Dispatch comment that mentions your role, its first line `Clear defect from <role>` (`skill://legion-architect/SKILL.md`, "Escalation judgment").
26
+ A clear defect another role writes to you comes as a Dispatch comment that mentions your role, its first line `Clear defect from <role>`, or as the controller's reply under one, `Not filed: dispatch://<KEY>; role:<token> is mentioned here` (`skill://legion-architect/SKILL.md`, "Escalation judgment").
27
27
  Carry it in this tree: in an open pull request, or in a child.
28
28
  Reply under its evidence comment with the issue that carries it.
29
29
  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").
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: legion-controller
3
- description: Use when you are a Legion project's controller session, on its start message or any controller wake, a person's message or mention, a clear defect no tree owns, an architect's escalation, the prioritization pass, a merge hold, an operation of your own work, or the daily report.
3
+ description: Use when you are a Legion project's controller session, on its start message or any controller wake, a person's message or mention, a clear defect, an architect's escalation, the prioritization pass, a merge hold, an operation of your own work, or the daily report.
4
4
  ---
5
5
 
6
6
  # Legion Controller
7
7
 
8
- You are the one persistent, wake-driven session of a Legion project. You start no work yourself: work reaches Legion by a person's decision, or as a clear defect a role reports that no running tree owns.
8
+ You are the one persistent, wake-driven session of a Legion project. You start no work yourself: work reaches Legion by a person's decision, or as a clear defect a role reports.
9
9
 
10
10
  ## Rules
11
11
 
@@ -52,7 +52,7 @@ Every launch opens with a start message, and Envoy keeps no wake sent while no c
52
52
  | `parked-decision` | `skill://legion-controller/references/parked-decisions.md#deciding` |
53
53
  | `held` (it comes only escalated), `update-stalled`, an architect's escalation | `skill://legion-controller/references/escalation.md` |
54
54
  | A finding ask's reference or answer | `skill://legion-controller/references/finding-asks.md` |
55
- | A clear defect no tree owns, which a role writes to you | `skill://legion-controller/references/finding-asks.md#file-a-clear-defect-no-tree-owns` |
55
+ | A clear defect, which a role writes to you | `skill://legion-controller/references/finding-asks.md#file-a-clear-defect` |
56
56
  | A comment that mentions your role and asks for an action on an agent | `skill://legion-controller/references/operations.md#an-action-another-agent-asks-for` |
57
57
  | A scope question, a routing request | `skill://legion-controller/references/backlog-stewardship.md` |
58
58
  | A Slack mention | `skill://legion-controller/references/slack-mentions.md` |
@@ -61,7 +61,7 @@ Every launch opens with a start message, and Envoy keeps no wake sent while no c
61
61
 
62
62
  ## Issues handed to Legion
63
63
 
64
- The daemon works only issues labelled `legion` (any case), and a labelled root in `todo` is admitted. Label an issue only when a person asks you to (a direct message, a Slack request that asks Legion to do it, their answer to a finding ask, or a directive the weekly plan records with its link), or for a clear defect no running tree owns. Never take a person's label off. How: `skill://legion-controller/references/triage.md#label-an-issue-for-a-person`.
64
+ The daemon works only issues labelled `legion` (any case), and a labelled root in `todo` is admitted. Label an issue only when a person asks you to (a direct message, a Slack request that asks Legion to do it, their answer to a finding ask, or a directive the weekly plan records with its link), or for a clear defect you file. Never take a person's label off. How: `skill://legion-controller/references/triage.md#label-an-issue-for-a-person`.
65
65
 
66
66
  ## Free slots
67
67
 
@@ -75,7 +75,7 @@ Only you write the project's merge holds, one line a hold in the Dispatch docume
75
75
 
76
76
  ## Findings, and the issues you file
77
77
 
78
- File an issue only when a person asks you to, for a clear defect no running tree owns, and the report issue. A clear defect goes to the tree that owns its code from the role that found it, and you forward none. Any other problem is a finding: open a `dispatch ask` on the report issue as `skill://legion-worker/references/findings.md` says, and file nothing until a person answers. Each issue you file carries a `Filed for` line (`skill://legion-controller/references/finding-asks.md#the-filed-for-line`).
78
+ File an issue only when a person asks you to, for a clear defect, and the report issue. Any other problem is a finding: open a `dispatch ask` as `skill://legion-worker/references/findings.md` says, and file nothing until a person answers. Each issue you file carries a `Filed for` line (`skill://legion-controller/references/finding-asks.md#the-filed-for-line`).
79
79
 
80
80
  ## Daily report
81
81
 
@@ -29,7 +29,7 @@ A directive is a direct Dispatch message to you: answer it, carry it out, record
29
29
 
30
30
  ## Answering controller deliveries
31
31
 
32
- Read every delivery against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions. Answer a routing request with the owner the one-owner map names and how to reach it (its role token or session), so the asker writes to it: you forward no message to another session. Never merge or enqueue a pull request, whatever credential you hold: a request to merge one goes to the architect of the tree that owns it (`skill://legion-controller/references/operations.md#a-request-to-another-session`).
32
+ Read every delivery against live Dispatch and daemon state. You decide labels, `todo`, `backlog`, `icebox` and board order. Answer a scope question from the weekly plan and the deployment instructions. Answer a routing request with the owner the one-owner map names and how to reach it (its role token or session), so the asker writes to it: you forward no message to another session. Never merge or enqueue a pull request, whatever credential you hold: a request to merge one goes to the architect of its tree (`skill://legion-controller/references/operations.md#a-request-to-another-session`).
33
33
 
34
34
  ## The owner audit
35
35
 
@@ -53,6 +53,6 @@ Only work that a person's directive, recorded in the plan with its link, moves t
53
53
  A labelled root the daemon queued or runs, which the weekly plan says to defer, is parked at your next pass only when the plan's line names a person's request: `set_status` to `backlog` (`icebox` for longer), citing that request in a comment. A plan row with no such request moves nothing; ask instead:
54
54
 
55
55
  1. Find your earlier ask: step 1 of `skill://legion-controller/references/park-asks.md`, with `Asked whether to defer: ` for `Asked whether to park: `, its second line the plan row. Open or resolved with no answer, or your reply starts `Deferred` or `Let run`: do nothing. Answered with no reply of yours: step 4. Your reply starts `Not deferred`: go on to step 2.
56
- 2. Check that Legion runs the root: it carries the label, stands in `admission.active` or `admission.waiting`, and its `phase` is not `done`. If not, do nothing. Else open a `dispatch ask` on the report issue naming the root and the plan row, options `Defer it` and `Let it run`, follow it, and comment on the root: first line `Asked whether to defer: dispatch://<REPORT KEY>/ask/<id>`, second line the plan row exactly.
56
+ 2. Check that Legion runs the root: it carries the label, stands in `admission.active` or `admission.waiting`, and its `phase` is not `done`. If not, do nothing. Else open a `dispatch ask` naming the root and the plan row, options `Defer it` and `Let it run`, follow it, and comment on the root: first line `Asked whether to defer: dispatch://<ASK KEY>/ask/<id>`, second line the plan row exactly.
57
57
  3. Name the row and the ask in the day's report while it is open.
58
- 4. On `Defer it` while step 2's check holds, park the root as above, citing the answer. On `Let it run`, move nothing and take the deferral off that plan row with `dispatch doc-edit`. Reply under the ask, first line exactly `Deferred dispatch://<root>`, `Not deferred dispatch://<root>` or `Let run dispatch://<root>` (`dispatch comment --issue <REPORT KEY> --reply-to-ask '<ask id>' --body-file -`).
58
+ 4. On `Defer it` while step 2's check holds, park the root as above, citing the answer. On `Let it run`, move nothing and take the deferral off that plan row with `dispatch doc-edit`. Reply under the ask, first line exactly `Deferred dispatch://<root>`, `Not deferred dispatch://<root>` or `Let run dispatch://<root>` (`dispatch comment --issue <the ask's issue> --reply-to-ask '<ask id>' --body-file -`).
@@ -23,7 +23,7 @@ Skip a pair the issues already settle: one closed as a duplicate of the other, o
23
23
 
24
24
  Ask each agent also, for each issue of its shard changed in the last 24 hours that fails, what it fails on (the broken tool, check, rule or component), its evidence, and the records read. Shard the issues closed in that time too (`dispatch issues --project <PROJECT> --status done --updated-since "$(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ)" --all`). Group the issues that fail for one cause yourself, and keep a group of three or more whose issues each need their own change; a group one fix clears is a set of duplicates.
25
25
 
26
- Root each cause once: comment its evidence on the open issue that tracks it; else write it to the architect of the running tree that owns the code, as `skill://legion-worker/references/findings.md#write-to-the-owner` says; else post its evidence on the report issue with `controller` as the role and take it as `skill://legion-controller/references/finding-asks.md#file-a-clear-defect-no-tree-owns` says. Comment the result on each issue of the group, and close none of them.
26
+ Root each cause once: comment its evidence on the open issue that tracks it; else post its evidence on the report issue with `controller` as the role and take it as `skill://legion-controller/references/finding-asks.md#file-a-clear-defect` says. Comment the result on each issue of the group, and close none of them.
27
27
 
28
28
  ## The record
29
29
 
@@ -1,39 +1,28 @@
1
1
  # Daily report
2
2
 
3
- Read this on your first turn of each UTC day, and when you open, follow or answer a finding ask: the report issue holds them all.
3
+ Read this on your first turn of each UTC day.
4
4
 
5
5
  ## Find the report issue
6
6
 
7
7
  Use 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>`).
8
8
  When none exists, create it once, the one issue you file unasked, and park it in `icebox`: it holds no work and never carries the `legion` label.
9
- Assign it to the person who answers for the project (the deployment instructions name them, else the owner `dispatch whoami` names), because its asks reach that person's Inbox;
9
+ Assign it to the person who answers for the project (the deployment instructions name them, else the owner `dispatch whoami` names);
10
10
  with nobody known, leave out `--assignee`.
11
11
 
12
12
  ```text
13
13
  dispatch issue --project <PROJECT> --title 'Legion daily report' --assignee '<email>' --spec-file - <<'EOF'
14
14
  ## Summary
15
15
 
16
- Legion's controller posts one message here each day: what Legion finished, what it closed without a change and why, and what is running. Legion's agents also post here the evidence of each clear defect they found that no tree owns, which the controller files for Legion. They ask here whether a problem that needs a decision needs an issue. This issue is not work, so it carries no `legion` label and stays in icebox.
16
+ Legion's controller posts one message here each day: what Legion finished, what it closed without a change and why, and what is running. Legion's agents also post here the evidence of each clear defect they found, which the controller files for Legion. This issue is not work, so it carries no `legion` label and stays in icebox.
17
17
  EOF
18
18
  legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
19
19
  ```
20
20
 
21
- ## Keep it answerable
22
-
23
- Each time you read it:
24
-
25
- - `Status: done`: the close withdrew its open asks, and Dispatch refuses new ones.
26
- Reopen it with `set_status` to `icebox` and say so in the day's report.
27
-
28
- - `Assignee: unassigned` with a person known: `dispatch issue-update --issue <REPORT KEY> --assignee <email>`.
29
- A refusal (`400 ASSIGNEE_NOT_ALLOWED` names an email nobody has signed in to Dispatch with) leaves it as it was: name it in your summary.
30
-
31
- - While it is unassigned, open each report with one sentence asking a person to take the issue from its header:
32
- until someone does, its asks go to the project's default assignee.
33
-
34
21
  ## When
35
22
 
36
- After the turn's own work, read the report issue, keep it answerable, and post when its `Events:` show no `message.created` from today.
23
+ After the turn's own work, read the report issue.
24
+ When it reads `Status: done`, reopen it with `set_status` to `icebox` and say so in the day's report.
25
+ Post when its `Events:` show no `message.created` from today.
37
26
 
38
27
  ## What
39
28
 
@@ -17,7 +17,7 @@ The architect decided against its own retry, so the issue stays at `phase: held`
17
17
 
18
18
  ## A child that looks independent
19
19
 
20
- Check the child and its parent in `read_state` and Dispatch. When it still looks independent, open an ask on the report issue naming the child, why, and the root you would file, with the options `File an issue`, `File it for Legion` and `Do not file`. Never label a child or cut its `child_of` link: that admits it as a root while its tree still records it. Only on a person's yes:
20
+ Check the child and its parent in `read_state` and Dispatch. When it still looks independent, open an ask naming the child, why, and the root you would file, with the options `File an issue`, `File it for Legion` and `Do not file`. Never label a child or cut its `child_of` link: that admits it as a root while its tree still records it. Only on a person's yes:
21
21
 
22
22
  1. File the root with no `--parent`: `dispatch issue --project <PROJECT> --title '<title>' --spec-file -`, its spec citing the ask and carrying its `Filed for` line, with `--label legion` only when the answer asks Legion to run it. `<PROJECT>` is the issue key's prefix (`daemon.project`), not the lowercase token in role names.
23
23
  2. Park the child (`set_status` to `icebox`), with a comment naming the new root and the person's answer.