@sjawhar/claude-envoy 2.11.2 → 2.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.
- package/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/dispatch.js +35 -18
- package/dist/envoy-channel.js +56 -20
- package/dist/session-hook.js +35 -18
- package/legion/skills/legion-architect/references/acceptance.md +1 -1
- package/legion/skills/legion-architect/references/wake-routing.md +2 -2
- package/legion/skills/legion-controller/SKILL.md +7 -0
- package/legion/skills/legion-controller/references/admission.md +32 -0
- package/legion/skills/legion-controller/references/daily-report.md +9 -3
- package/legion/skills/legion-controller/references/session.md +5 -1
- package/legion/skills/legion-controller/references/slack-mentions.md +1 -1
- package/legion/skills/legion-controller/references/triage.md +8 -8
- package/legion/skills/legion-controller/references/wakes.md +13 -1
- package/package.json +2 -2
- package/skills/dispatch/SKILL.md +1 -1
package/.omp-plugin/plugin.json
CHANGED
package/dist/dispatch.js
CHANGED
|
@@ -14791,7 +14791,6 @@ var ProjectSchema = strictObject({
|
|
|
14791
14791
|
gated_steps: array(_enum2(GATED_STEPS)).optional(),
|
|
14792
14792
|
created_at: string2()
|
|
14793
14793
|
}).readonly();
|
|
14794
|
-
var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
|
|
14795
14794
|
var RepoProjectSchema = strictObject({
|
|
14796
14795
|
repo: string2(),
|
|
14797
14796
|
project: string2(),
|
|
@@ -14813,6 +14812,11 @@ var ArchitectureSourceSchema = strictObject({
|
|
|
14813
14812
|
components: number2().int()
|
|
14814
14813
|
}).readonly();
|
|
14815
14814
|
var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
|
|
14815
|
+
var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
|
|
14816
|
+
project: string2(),
|
|
14817
|
+
assignee: string2().nullable(),
|
|
14818
|
+
thread_logins: array(string2()).optional()
|
|
14819
|
+
}).readonly();
|
|
14816
14820
|
var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
|
|
14817
14821
|
var ArchitectureSyncedEventPayloadSchema = strictObject({
|
|
14818
14822
|
repo: string2().optional(),
|
|
@@ -15030,7 +15034,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
|
|
|
15030
15034
|
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.";
|
|
15031
15035
|
var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
|
|
15032
15036
|
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.";
|
|
15033
|
-
var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee
|
|
15037
|
+
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.";
|
|
15034
15038
|
var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
|
|
15035
15039
|
function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
|
|
15036
15040
|
return {
|
|
@@ -15285,7 +15289,7 @@ var dispatchToolSpecs = [
|
|
|
15285
15289
|
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
|
|
15286
15290
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
|
|
15287
15291
|
priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
|
|
15288
|
-
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee
|
|
15292
|
+
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
|
|
15289
15293
|
components: componentsArgument(z).optional(),
|
|
15290
15294
|
repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
|
|
15291
15295
|
})
|
|
@@ -15297,7 +15301,7 @@ var dispatchToolSpecs = [
|
|
|
15297
15301
|
priority: 1,
|
|
15298
15302
|
before: "DSP-2"
|
|
15299
15303
|
},
|
|
15300
|
-
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
15304
|
+
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
15301
15305
|
arguments: (z) => ({
|
|
15302
15306
|
issue: z.string().describe(ISSUE_REFERENCE),
|
|
15303
15307
|
status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
|
|
@@ -15305,7 +15309,7 @@ var dispatchToolSpecs = [
|
|
|
15305
15309
|
title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
|
|
15306
15310
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
|
|
15307
15311
|
priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
|
|
15308
|
-
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
15312
|
+
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
15309
15313
|
external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
|
|
15310
15314
|
route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
|
|
15311
15315
|
parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
|
|
@@ -15561,7 +15565,7 @@ var dispatchToolSpecs = [
|
|
|
15561
15565
|
{
|
|
15562
15566
|
name: "dispatch_request_approval",
|
|
15563
15567
|
example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
|
|
15564
|
-
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
15568
|
+
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
15565
15569
|
arguments: (z) => ({
|
|
15566
15570
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
15567
15571
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
@@ -15720,10 +15724,11 @@ var dispatchToolSpecs = [
|
|
|
15720
15724
|
{
|
|
15721
15725
|
name: "dispatch_project",
|
|
15722
15726
|
example: { key: "CORE", name: "Core" },
|
|
15723
|
-
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person
|
|
15727
|
+
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
|
|
15724
15728
|
arguments: (z) => ({
|
|
15725
15729
|
key: z.string().describe("The new project's key, such as CORE."),
|
|
15726
|
-
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
|
|
15730
|
+
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
|
|
15731
|
+
default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
|
|
15727
15732
|
}),
|
|
15728
15733
|
strict: true
|
|
15729
15734
|
},
|
|
@@ -15770,7 +15775,7 @@ var dispatchToolSpecs = [
|
|
|
15770
15775
|
{
|
|
15771
15776
|
name: "dispatch_whoami",
|
|
15772
15777
|
example: {},
|
|
15773
|
-
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
15778
|
+
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
15774
15779
|
arguments: () => ({}),
|
|
15775
15780
|
strict: true
|
|
15776
15781
|
},
|
|
@@ -22737,13 +22742,15 @@ function openAskAge(ageSeconds) {
|
|
|
22737
22742
|
const days = Math.floor(hours / 24);
|
|
22738
22743
|
return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
|
|
22739
22744
|
}
|
|
22740
|
-
function
|
|
22741
|
-
|
|
22742
|
-
|
|
22745
|
+
function namedPerson(person) {
|
|
22746
|
+
return person === undefined || person === "" ? undefined : person;
|
|
22747
|
+
}
|
|
22748
|
+
function waitsOnPerson(ask) {
|
|
22749
|
+
return namedPerson(ask.waiting_on_person);
|
|
22743
22750
|
}
|
|
22744
22751
|
function openAskLine(ask, baseUrl) {
|
|
22745
22752
|
const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
|
|
22746
|
-
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${
|
|
22753
|
+
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
|
|
22747
22754
|
}
|
|
22748
22755
|
function formatOpenAsksSummary(response, baseUrl) {
|
|
22749
22756
|
const scope = "active open asks you authored on open issues and project documents";
|
|
@@ -23211,9 +23218,10 @@ async function askCommand(context) {
|
|
|
23211
23218
|
});
|
|
23212
23219
|
const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
|
|
23213
23220
|
const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
|
|
23221
|
+
const asked = waitsOnPerson(ask);
|
|
23214
23222
|
return {
|
|
23215
23223
|
text: [
|
|
23216
|
-
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
|
|
23224
|
+
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
|
|
23217
23225
|
...checkLines,
|
|
23218
23226
|
...declinedLines,
|
|
23219
23227
|
await followsAsk(askOwner, input.subscriptions),
|
|
@@ -23799,9 +23807,10 @@ async function requestApprovalCommand(context) {
|
|
|
23799
23807
|
}
|
|
23800
23808
|
const details = await followedAskDetails(client, result.ask, resolved.artifact);
|
|
23801
23809
|
const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
|
|
23810
|
+
const waitsOn = waitsOnPerson(result.ask);
|
|
23802
23811
|
return {
|
|
23803
23812
|
text: [
|
|
23804
|
-
`${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
23813
|
+
`${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
23805
23814
|
...coverageLines
|
|
23806
23815
|
].join(`
|
|
23807
23816
|
`),
|
|
@@ -24844,15 +24853,23 @@ async function projectCommand(context) {
|
|
|
24844
24853
|
project = await client.createProject({
|
|
24845
24854
|
key: stringArg(args, "key"),
|
|
24846
24855
|
name: stringArg(args, "name"),
|
|
24856
|
+
...defined("default_assignee", optionalString(args, "default_assignee")),
|
|
24847
24857
|
actor
|
|
24848
24858
|
});
|
|
24849
24859
|
} catch (error) {
|
|
24850
24860
|
throw refusalWithCode(error);
|
|
24851
24861
|
}
|
|
24852
24862
|
const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
|
|
24863
|
+
const projectDefault = namedPerson(project.default_assignee);
|
|
24853
24864
|
return {
|
|
24854
|
-
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}
|
|
24855
|
-
|
|
24865
|
+
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
|
|
24866
|
+
Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
|
|
24867
|
+
details: {
|
|
24868
|
+
project: project.key,
|
|
24869
|
+
name: project.name,
|
|
24870
|
+
created_at: project.created_at,
|
|
24871
|
+
...defined("default_assignee", projectDefault)
|
|
24872
|
+
}
|
|
24856
24873
|
};
|
|
24857
24874
|
}
|
|
24858
24875
|
async function projectsCommand(context) {
|
|
@@ -25445,7 +25462,7 @@ async function whoamiCommand(context) {
|
|
|
25445
25462
|
const proved = identity.kind === "agent" ? identity.session ?? null : null;
|
|
25446
25463
|
const project = identity.kind === "agent" ? identity.project ?? null : null;
|
|
25447
25464
|
const session = proved ?? sessionId;
|
|
25448
|
-
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee,
|
|
25465
|
+
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
|
|
25449
25466
|
const signInNeeded = owner === null && service !== null && proved !== null;
|
|
25450
25467
|
const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
|
|
25451
25468
|
const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
|
package/dist/envoy-channel.js
CHANGED
|
@@ -36431,7 +36431,6 @@ var ProjectSchema = strictObject({
|
|
|
36431
36431
|
gated_steps: array(_enum2(GATED_STEPS)).optional(),
|
|
36432
36432
|
created_at: string2()
|
|
36433
36433
|
}).readonly();
|
|
36434
|
-
var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
|
|
36435
36434
|
var RepoProjectSchema = strictObject({
|
|
36436
36435
|
repo: string2(),
|
|
36437
36436
|
project: string2(),
|
|
@@ -36453,6 +36452,11 @@ var ArchitectureSourceSchema = strictObject({
|
|
|
36453
36452
|
components: number2().int()
|
|
36454
36453
|
}).readonly();
|
|
36455
36454
|
var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
|
|
36455
|
+
var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
|
|
36456
|
+
project: string2(),
|
|
36457
|
+
assignee: string2().nullable(),
|
|
36458
|
+
thread_logins: array(string2()).optional()
|
|
36459
|
+
}).readonly();
|
|
36456
36460
|
var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
|
|
36457
36461
|
var ArchitectureSyncedEventPayloadSchema = strictObject({
|
|
36458
36462
|
repo: string2().optional(),
|
|
@@ -36670,7 +36674,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
|
|
|
36670
36674
|
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.";
|
|
36671
36675
|
var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
|
|
36672
36676
|
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.";
|
|
36673
|
-
var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee
|
|
36677
|
+
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.";
|
|
36674
36678
|
var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
|
|
36675
36679
|
function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
|
|
36676
36680
|
return {
|
|
@@ -36925,7 +36929,7 @@ var dispatchToolSpecs = [
|
|
|
36925
36929
|
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
|
|
36926
36930
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
|
|
36927
36931
|
priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
|
|
36928
|
-
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee
|
|
36932
|
+
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
|
|
36929
36933
|
components: componentsArgument(z).optional(),
|
|
36930
36934
|
repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
|
|
36931
36935
|
})
|
|
@@ -36937,7 +36941,7 @@ var dispatchToolSpecs = [
|
|
|
36937
36941
|
priority: 1,
|
|
36938
36942
|
before: "DSP-2"
|
|
36939
36943
|
},
|
|
36940
|
-
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
36944
|
+
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
36941
36945
|
arguments: (z) => ({
|
|
36942
36946
|
issue: z.string().describe(ISSUE_REFERENCE),
|
|
36943
36947
|
status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
|
|
@@ -36945,7 +36949,7 @@ var dispatchToolSpecs = [
|
|
|
36945
36949
|
title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
|
|
36946
36950
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
|
|
36947
36951
|
priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
|
|
36948
|
-
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
36952
|
+
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
36949
36953
|
external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
|
|
36950
36954
|
route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
|
|
36951
36955
|
parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
|
|
@@ -37201,7 +37205,7 @@ var dispatchToolSpecs = [
|
|
|
37201
37205
|
{
|
|
37202
37206
|
name: "dispatch_request_approval",
|
|
37203
37207
|
example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
|
|
37204
|
-
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
37208
|
+
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
37205
37209
|
arguments: (z) => ({
|
|
37206
37210
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
37207
37211
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
@@ -37360,10 +37364,11 @@ var dispatchToolSpecs = [
|
|
|
37360
37364
|
{
|
|
37361
37365
|
name: "dispatch_project",
|
|
37362
37366
|
example: { key: "CORE", name: "Core" },
|
|
37363
|
-
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person
|
|
37367
|
+
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
|
|
37364
37368
|
arguments: (z) => ({
|
|
37365
37369
|
key: z.string().describe("The new project's key, such as CORE."),
|
|
37366
|
-
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
|
|
37370
|
+
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
|
|
37371
|
+
default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
|
|
37367
37372
|
}),
|
|
37368
37373
|
strict: true
|
|
37369
37374
|
},
|
|
@@ -37410,7 +37415,7 @@ var dispatchToolSpecs = [
|
|
|
37410
37415
|
{
|
|
37411
37416
|
name: "dispatch_whoami",
|
|
37412
37417
|
example: {},
|
|
37413
|
-
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
37418
|
+
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
37414
37419
|
arguments: () => ({}),
|
|
37415
37420
|
strict: true
|
|
37416
37421
|
},
|
|
@@ -49139,13 +49144,15 @@ function openAskAge(ageSeconds) {
|
|
|
49139
49144
|
const days = Math.floor(hours / 24);
|
|
49140
49145
|
return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
|
|
49141
49146
|
}
|
|
49142
|
-
function
|
|
49143
|
-
|
|
49144
|
-
|
|
49147
|
+
function namedPerson(person) {
|
|
49148
|
+
return person === undefined || person === "" ? undefined : person;
|
|
49149
|
+
}
|
|
49150
|
+
function waitsOnPerson(ask) {
|
|
49151
|
+
return namedPerson(ask.waiting_on_person);
|
|
49145
49152
|
}
|
|
49146
49153
|
function openAskLine(ask, baseUrl) {
|
|
49147
49154
|
const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
|
|
49148
|
-
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${
|
|
49155
|
+
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
|
|
49149
49156
|
}
|
|
49150
49157
|
function formatOpenAsksSummary(response, baseUrl) {
|
|
49151
49158
|
const scope = "active open asks you authored on open issues and project documents";
|
|
@@ -49548,9 +49555,10 @@ async function askCommand(context) {
|
|
|
49548
49555
|
});
|
|
49549
49556
|
const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
|
|
49550
49557
|
const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
|
|
49558
|
+
const asked = waitsOnPerson(ask);
|
|
49551
49559
|
return {
|
|
49552
49560
|
text: [
|
|
49553
|
-
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
|
|
49561
|
+
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
|
|
49554
49562
|
...checkLines,
|
|
49555
49563
|
...declinedLines,
|
|
49556
49564
|
await followsAsk(askOwner, input.subscriptions),
|
|
@@ -50136,9 +50144,10 @@ async function requestApprovalCommand(context) {
|
|
|
50136
50144
|
}
|
|
50137
50145
|
const details = await followedAskDetails(client, result.ask, resolved.artifact);
|
|
50138
50146
|
const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
|
|
50147
|
+
const waitsOn = waitsOnPerson(result.ask);
|
|
50139
50148
|
return {
|
|
50140
50149
|
text: [
|
|
50141
|
-
`${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
50150
|
+
`${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
50142
50151
|
...coverageLines
|
|
50143
50152
|
].join(`
|
|
50144
50153
|
`),
|
|
@@ -51181,15 +51190,23 @@ async function projectCommand(context) {
|
|
|
51181
51190
|
project = await client.createProject({
|
|
51182
51191
|
key: stringArg(args, "key"),
|
|
51183
51192
|
name: stringArg(args, "name"),
|
|
51193
|
+
...defined("default_assignee", optionalString(args, "default_assignee")),
|
|
51184
51194
|
actor
|
|
51185
51195
|
});
|
|
51186
51196
|
} catch (error) {
|
|
51187
51197
|
throw refusalWithCode(error);
|
|
51188
51198
|
}
|
|
51189
51199
|
const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
|
|
51200
|
+
const projectDefault = namedPerson(project.default_assignee);
|
|
51190
51201
|
return {
|
|
51191
|
-
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}
|
|
51192
|
-
|
|
51202
|
+
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
|
|
51203
|
+
Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
|
|
51204
|
+
details: {
|
|
51205
|
+
project: project.key,
|
|
51206
|
+
name: project.name,
|
|
51207
|
+
created_at: project.created_at,
|
|
51208
|
+
...defined("default_assignee", projectDefault)
|
|
51209
|
+
}
|
|
51193
51210
|
};
|
|
51194
51211
|
}
|
|
51195
51212
|
async function projectsCommand(context) {
|
|
@@ -51750,7 +51767,7 @@ async function whoamiCommand(context) {
|
|
|
51750
51767
|
const proved = identity.kind === "agent" ? identity.session ?? null : null;
|
|
51751
51768
|
const project = identity.kind === "agent" ? identity.project ?? null : null;
|
|
51752
51769
|
const session = proved ?? sessionId;
|
|
51753
|
-
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee,
|
|
51770
|
+
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
|
|
51754
51771
|
const signInNeeded = owner === null && service !== null && proved !== null;
|
|
51755
51772
|
const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
|
|
51756
51773
|
const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
|
|
@@ -53123,12 +53140,31 @@ var legionBlockedIssue = object({
|
|
|
53123
53140
|
issue: issueKey,
|
|
53124
53141
|
blockedBy: array(issueKey)
|
|
53125
53142
|
});
|
|
53143
|
+
var LEGION_HELD_REASONS = [
|
|
53144
|
+
"tree_closed",
|
|
53145
|
+
"tree_parked",
|
|
53146
|
+
"label_off",
|
|
53147
|
+
"ancestry",
|
|
53148
|
+
"root_awaiting_person",
|
|
53149
|
+
"design_gate",
|
|
53150
|
+
"dispatch_blocker",
|
|
53151
|
+
"children_first",
|
|
53152
|
+
"accepted_ancestor",
|
|
53153
|
+
"at_work",
|
|
53154
|
+
"unclassified"
|
|
53155
|
+
];
|
|
53156
|
+
var legionHeldIssue = object({
|
|
53157
|
+
issue: issueKey,
|
|
53158
|
+
reason: _enum2(LEGION_HELD_REASONS),
|
|
53159
|
+
heldBy: array(issueKey).optional()
|
|
53160
|
+
});
|
|
53126
53161
|
var legionAdmission = object({
|
|
53127
53162
|
cap: number2().int().nonnegative(),
|
|
53128
53163
|
active: array(nonEmptyString2),
|
|
53129
53164
|
waiting: array(nonEmptyString2),
|
|
53130
53165
|
trees: array(issueKey).optional(),
|
|
53131
53166
|
blocked: array(legionBlockedIssue),
|
|
53167
|
+
held: array(legionHeldIssue).optional(),
|
|
53132
53168
|
free: number2().int().nonnegative().optional()
|
|
53133
53169
|
});
|
|
53134
53170
|
var legionControllerLocator = object({
|
|
@@ -56163,9 +56199,9 @@ var import_nats2 = __toESM(require_mod4(), 1);
|
|
|
56163
56199
|
|
|
56164
56200
|
// package.json
|
|
56165
56201
|
var name = "@sjawhar/claude-envoy";
|
|
56166
|
-
var version2 = "2.
|
|
56202
|
+
var version2 = "2.13.0";
|
|
56167
56203
|
var legion = {
|
|
56168
|
-
daemonApiVersion:
|
|
56204
|
+
daemonApiVersion: 98
|
|
56169
56205
|
};
|
|
56170
56206
|
|
|
56171
56207
|
// ../pi-shared/src/agent-stream.ts
|
package/dist/session-hook.js
CHANGED
|
@@ -13778,7 +13778,6 @@ var ProjectSchema = strictObject({
|
|
|
13778
13778
|
gated_steps: array(_enum2(GATED_STEPS)).optional(),
|
|
13779
13779
|
created_at: string2()
|
|
13780
13780
|
}).readonly();
|
|
13781
|
-
var ProjectDefaultAssigneeSchema = strictObject({ project: string2(), assignee: string2().nullable() }).readonly();
|
|
13782
13781
|
var RepoProjectSchema = strictObject({
|
|
13783
13782
|
repo: string2(),
|
|
13784
13783
|
project: string2(),
|
|
@@ -13800,6 +13799,11 @@ var ArchitectureSourceSchema = strictObject({
|
|
|
13800
13799
|
components: number2().int()
|
|
13801
13800
|
}).readonly();
|
|
13802
13801
|
var RepoProjectUpdatedEventPayloadSchema = strictObject({ mapping: RepoProjectSchema, deleted: boolean2() }).readonly();
|
|
13802
|
+
var ProjectDefaultAssigneeUpdatedEventPayloadSchema = strictObject({
|
|
13803
|
+
project: string2(),
|
|
13804
|
+
assignee: string2().nullable(),
|
|
13805
|
+
thread_logins: array(string2()).optional()
|
|
13806
|
+
}).readonly();
|
|
13803
13807
|
var ArchitectureSourceUpdatedEventPayloadSchema = strictObject({ source: ArchitectureSourceSchema, deleted: boolean2() }).readonly();
|
|
13804
13808
|
var ArchitectureSyncedEventPayloadSchema = strictObject({
|
|
13805
13809
|
repo: string2().optional(),
|
|
@@ -14017,7 +14021,7 @@ var OWNER_REFERENCE = "Exactly one of issue and project is required. An issue is
|
|
|
14017
14021
|
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.";
|
|
14018
14022
|
var ASK_OPTIONS_CONTRACT = "Options carry the genuinely different approaches. Each option has a label, and its description " + "says what that approach costs.";
|
|
14019
14023
|
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.";
|
|
14020
|
-
var ASK_WAITS_ON_THE_ASSIGNEE = "An ask waits on the issue's assignee
|
|
14024
|
+
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.";
|
|
14021
14025
|
var HUMAN_AGREED_TO_DOCUMENT = "the human has agreed to every point in the document";
|
|
14022
14026
|
function documentOwnerValidation(requireArtifact, alwaysRequireArtifact = false) {
|
|
14023
14027
|
return {
|
|
@@ -14272,7 +14276,7 @@ var dispatchToolSpecs = [
|
|
|
14272
14276
|
spec: z.string().describe(`Optional initial primary-document markdown. ${SPEC_WRITING_POINTER}`).optional(),
|
|
14273
14277
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Optional initial labels, at most 20 labels of up to 40 characters.").optional(),
|
|
14274
14278
|
priority: z.number({ int: true, min: 0, max: 3 }).describe("Optional coarse priority, a number from 0 to 3: 0 is highest and 3 is lowest.").optional(),
|
|
14275
|
-
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee
|
|
14279
|
+
assignee: z.string().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); defaults to your owner when you act for a person, else the parent's assignee, else the project's default assignee. Every project names a default assignee, so a new issue always has one. A question on it reaches the person it was handed to, else the issue's assignee, else the project's default assignee. Set it only when a person said who owns the issue.").optional(),
|
|
14276
14280
|
components: componentsArgument(z).optional(),
|
|
14277
14281
|
repo: z.string().describe("The repository the issue targets, owner/name, mapped to the issue's project in Settings; a child inherits its parent's when unset, and an issue with none on its parent chain takes the project's default.").optional()
|
|
14278
14282
|
})
|
|
@@ -14284,7 +14288,7 @@ var dispatchToolSpecs = [
|
|
|
14284
14288
|
priority: 1,
|
|
14285
14289
|
before: "DSP-2"
|
|
14286
14290
|
},
|
|
14287
|
-
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue. Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
14291
|
+
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, set " + "its priority, set or clear its assignee, link a URL (the pull request that delivers it, a " + "run, a document), set its " + "route, set or clear its parent, replace the issues it is blocked by, attach it to " + "architecture components, set the repository it targets, or move it on its project's " + "board. Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. A non-empty external_links is " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link; an empty external_links removes every link instead. components " + "replaces the issue's own attachment. Closing an issue " + "(status done) requires reason, the note that says why: it is posted on the issue as a " + "message, then the issue closes, so the close carries its note; closing an issue that is " + "already closed is refused (ISSUE_CLOSED) before anything is posted. Reason goes only " + "with status done. Closing an issue withdraws every open ask " + "it holds (resolution kind withdrawn, naming the closer), and reopening it brings exactly " + "those asks back. " + "A closed issue still takes messages and comments, though not asks or artifacts; of this " + "tool's fields it takes only a board move " + "(before, after), components, " + "a reopening status (any status but done), and an external_links write that adds no new " + "link (so a link can move to the issue that replaced it); everything else, priority " + "included, waits for the reopen. " + "priority is yours to set and a human overrides it. assignee is the person who answers " + "this issue's asks, and every ask on it waits on them until a person hands that ask on. " + "Passing null unassigns the issue, and every ask on it then waits on the project's default " + "assignee: a question reaches the person it was handed to, else the issue's assignee, else " + "the project's default assignee, so every question reaches a person. " + "Set the assignee when a person said who owns the work, as you " + "file the issue or hand it over. before and after move the issue on " + "its project's board: before puts it above that issue, after below, and both together " + "land it between them. A project's board order is one agent's to keep; in a Legion " + "deployment that is the controller. Never reassign an issue a person holds to get a " + "faster answer: who holds it is their call. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
14288
14292
|
arguments: (z) => ({
|
|
14289
14293
|
issue: z.string().describe(ISSUE_REFERENCE),
|
|
14290
14294
|
status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
|
|
@@ -14292,7 +14296,7 @@ var dispatchToolSpecs = [
|
|
|
14292
14296
|
title: z.string({ min: 1, max: ISSUE_TITLE_MAX }).describe("Replacement title, at most 1,000 characters.").optional(),
|
|
14293
14297
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
|
|
14294
14298
|
priority: z.number({ int: true, min: 0, max: 3 }).nullable().optional().describe("Coarse priority: 0 is P0 (highest) through 3 is P3 (lowest); null clears it."),
|
|
14295
|
-
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
14299
|
+
assignee: z.string().nullable().optional().describe("Email of the person who answers this issue's asks (someone who has signed in to Dispatch); null unassigns the issue, and every ask on it then waits on the project's default assignee. Set it only when a person said who owns the issue, never to move a question off the person holding it."),
|
|
14296
14300
|
external_links: z.array(z.string({ min: 1 })).describe("URLs to link; a non-empty list merges into the issue's existing external links by URL, an empty list removes every link instead.").optional(),
|
|
14297
14301
|
route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
|
|
14298
14302
|
parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional(),
|
|
@@ -14548,7 +14552,7 @@ var dispatchToolSpecs = [
|
|
|
14548
14552
|
{
|
|
14549
14553
|
name: "dispatch_request_approval",
|
|
14550
14554
|
example: { issue: "DSP-1", summary: "A live sync replaces the nightly export." },
|
|
14551
|
-
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
14555
|
+
description: "Ask a human to approve a document at its current version. Before calling, have a fresh read-only reader check the spec against the code and the human's words, then resolve every finding; a Legion architect runs `plan-gap-analyst` and `plan-reviewer`. Opens an approval ask (Approve / " + "Request changes) in the human's Inbox whose question names the document and version, " + "followed by the summary; the answer pins a review to that version and arrives as " + "artifact.approved or artifact.changes_requested. " + "The request reaches the person it was handed to, else the issue's assignee, else the " + "project's default assignee, so it always reaches a person, and this tool's answer names " + "that person. " + "An open request follows the document: a " + "later version moves it to that version and leaves it waiting on you, as a human's reply in " + "its thread does. Only the first move since the request was opened or handed back sends an " + "event, and never to the session whose version made it; dispatch doc-read shows whom it " + "waits on. Once the revision is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", call this again to hand that same Inbox row back. The request carries nothing new. A " + "call while it already waits on the human hands nothing back: the same summary changes " + "nothing, and a different one is refused, since it would rewrite the card the human is " + "reading. Approve and Request changes each close the request, so the next call opens a new " + "one. Call it once per revision, when the revision is complete, never after each edit. An " + "approval goes stale when the document changes outside its decision blocks after it, until " + "a later version's text is exactly the approved version's again, as when an accidental " + "edit is undone exactly, and no decision block in it was decided since: that version " + "carries the approval and the document reads approved at it, so nothing is requested for " + "it. When the document does not read approved, request approval again once that revision " + "is complete and " + HUMAN_AGREED_TO_DOCUMENT + ", with a one-sentence summary naming what changed since the earlier approval: the card " + "names that approval (version, date, reviewer) and its Show diff control carries the detail. " + "A human's own answer to a decision block carries the approval to the version it writes when " + "that answer is the whole change since the approved version, so nothing is requested for " + "it. A new version of a Legion root spec closes its armed design gate until a human " + "approves it; a carried approval reopens it too. " + "Refused, with nothing sent, while the document holds an open decision block, even when a " + "human asked for approval: the refusal names each block; ask the human to answer or waive " + "it first. " + "Refused 409 PLAN_APPROVED_BY_REVIEW on an issue's plan, which its plan review approves " + "(dispatch plan-approve), never a person. " + "On an issue's spec the answer ends with a `Coverage of <name>:` line naming each requirement " + "the spec marks that no check serves, in any document of the issue or of its descendants, or saying " + "the spec marks no requirements; a spec every requirement of which has a check gets no such line. It never " + "names a missing plan task, and a gap refuses nothing. " + OWNER_REFERENCE,
|
|
14552
14556
|
arguments: (z) => ({
|
|
14553
14557
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
14554
14558
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
@@ -14707,10 +14711,11 @@ var dispatchToolSpecs = [
|
|
|
14707
14711
|
{
|
|
14708
14712
|
name: "dispatch_project",
|
|
14709
14713
|
example: { key: "CORE", name: "Core" },
|
|
14710
|
-
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. When no person
|
|
14714
|
+
description: "Create a Dispatch project from a key and a name, so issues and project documents can be filed under it. " + "Projects cannot be renamed or deleted, so a mistyped key stays for good: check the keys that exist first " + "with dispatch projects. When a person asks for a project, make the key from its name. Check the key with " + "dispatch projects. If the key is free, create the project. Ask the person only when the key is in use. " + "A key that already exists is refused " + "with 409 PROJECT_EXISTS whoever created it, so after a retry it can mean the first call made the project. " + `A key that is not a project key (${PROJECT_KEY_RULE}) or an empty name is refused with 400 ` + `INVALID_PROJECT, and a name over ${PROJECT_NAME_MAX} characters with 400 CAP_EXCEEDED. ` + "Every project names a default assignee, the person its unowned work lands on: the login " + "default_assignee names, else the person creating the project, else the person your " + "credential acts for. A call that names none under a credential acting for no person is " + "refused with 400 INVALID_PROJECT naming default_assignee, so ask a person who it should " + "be rather than choosing one. A login nobody has signed in with is refused with 400 " + "ASSIGNEE_NOT_ALLOWED. The answer names the default the project took. When no person " + "asked for a project and an existing project already covers the work, do not create a project. File an " + "issue in that project with dispatch issue.",
|
|
14711
14715
|
arguments: (z) => ({
|
|
14712
14716
|
key: z.string().describe("The new project's key, such as CORE."),
|
|
14713
|
-
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`)
|
|
14717
|
+
name: z.string({ max: PROJECT_NAME_MAX }).describe(`The project's name, shown beside its key, at most ${PROJECT_NAME_MAX} characters.`),
|
|
14718
|
+
default_assignee: z.string().describe("Email of the person the project's unowned work lands on: a new issue with no assignee, and every question on an issue nobody holds. It must name a person who has signed in to Dispatch. Left out, it falls to the person creating the project, else the person your credential acts for; a credential that acts for nobody must name it.").optional()
|
|
14714
14719
|
}),
|
|
14715
14720
|
strict: true
|
|
14716
14721
|
},
|
|
@@ -14757,7 +14762,7 @@ var dispatchToolSpecs = [
|
|
|
14757
14762
|
{
|
|
14758
14763
|
name: "dispatch_whoami",
|
|
14759
14764
|
example: {},
|
|
14760
|
-
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
14765
|
+
description: "Who Dispatch takes this session for: {session, owner, service, project}. session is the session Dispatch records your writes as. It is the session your credential proved, and the tool says so when that is not the session you run in. owner is the lowercase email of the person you act for, and is the first choice of assignee for issues you create. owner is null under the shared token and under a broker token that names a service and no person. With a null owner, a create with no assignee falls back to the parent's assignee and then to the project's default assignee, which every project names, so every issue you create has an assignee. A question on an issue reaches the person it was handed to, else the issue's assignee, else the project's default assignee. service is the subject of the verified service-account token that authenticated you, or the fleet a broker token naming no person belongs to, or null. A broker token that names a service may read and is refused every write with SIGN_IN_REQUIRED, which names the command a person signs in on that machine with. project is the one project key your credential may write, or null when it names none.",
|
|
14761
14766
|
arguments: () => ({}),
|
|
14762
14767
|
strict: true
|
|
14763
14768
|
},
|
|
@@ -21741,13 +21746,15 @@ function openAskAge(ageSeconds) {
|
|
|
21741
21746
|
const days = Math.floor(hours / 24);
|
|
21742
21747
|
return `${days}d${hours % 24 === 0 ? "" : ` ${hours % 24}h`}`;
|
|
21743
21748
|
}
|
|
21744
|
-
function
|
|
21745
|
-
|
|
21746
|
-
|
|
21749
|
+
function namedPerson(person) {
|
|
21750
|
+
return person === undefined || person === "" ? undefined : person;
|
|
21751
|
+
}
|
|
21752
|
+
function waitsOnPerson(ask) {
|
|
21753
|
+
return namedPerson(ask.waiting_on_person);
|
|
21747
21754
|
}
|
|
21748
21755
|
function openAskLine(ask, baseUrl) {
|
|
21749
21756
|
const priority = ask.priority === null ? "" : `P${ask.priority} \xB7 `;
|
|
21750
|
-
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${
|
|
21757
|
+
return `- ${openAskAge(ask.age_seconds)} \xB7 ${priority}${ownerTitle(ask.owner)} \xB7 asked of ${waitsOnPerson(ask) ?? "nobody"} \xB7 ${ask.question} \xB7 ${new URL(ask.ref, baseUrl).toString()}`;
|
|
21751
21758
|
}
|
|
21752
21759
|
function formatOpenAsksSummary(response, baseUrl) {
|
|
21753
21760
|
const scope = "active open asks you authored on open issues and project documents";
|
|
@@ -22215,9 +22222,10 @@ async function askCommand(context) {
|
|
|
22215
22222
|
});
|
|
22216
22223
|
const declinedLines = ask.issue_key === null ? [] : declinedAskLines(ask.advice, ask.issue_key, linkBase);
|
|
22217
22224
|
const adviceLines = await otherAdviceLines(() => renderAdvice(input.tool, askOwner.label, ask.advice, {}));
|
|
22225
|
+
const asked = waitsOnPerson(ask);
|
|
22218
22226
|
return {
|
|
22219
22227
|
text: [
|
|
22220
|
-
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency}): ${ask.question}`,
|
|
22228
|
+
`Asked ${ask.id} on ${askOwner.label} (urgency ${ask.urgency})${asked === undefined ? "" : `, waiting on ${asked}`}: ${ask.question}`,
|
|
22221
22229
|
...checkLines,
|
|
22222
22230
|
...declinedLines,
|
|
22223
22231
|
await followsAsk(askOwner, input.subscriptions),
|
|
@@ -22803,9 +22811,10 @@ async function requestApprovalCommand(context) {
|
|
|
22803
22811
|
}
|
|
22804
22812
|
const details = await followedAskDetails(client, result.ask, resolved.artifact);
|
|
22805
22813
|
const outcome = result.recorded ? `Approval requested for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}).` : `The approval request for ${resolved.artifact.name} (document id ${resolved.artifact.id}) at version ${result.version} (ask ${result.ask.id}) already waits on the human, so this call changed nothing: nothing since it last reached the human (a newer version, a human's reply in its thread, or your progress note) left it waiting on you.`;
|
|
22814
|
+
const waitsOn = waitsOnPerson(result.ask);
|
|
22806
22815
|
return {
|
|
22807
22816
|
text: [
|
|
22808
|
-
`${outcome} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
22817
|
+
`${outcome}${waitsOn === undefined ? "" : ` It waits on ${waitsOn}.`} The human's Inbox asks: ${JSON.stringify(result.ask.question)}. The answer arrives as artifact.approved or artifact.changes_requested. An edit before the answer moves this request to the new version and leaves it waiting on you, and a change outside the decision blocks after approval makes the approval stale: either way, request again for the new version once the human has agreed to every point in it, which hands this request back or opens a new one, with a --summary naming what changed since the earlier approval. The human's own answer to a decision block carries the approval when that answer is the whole change since the approved version, and answers an open request Approve in their name: request nothing then.`,
|
|
22809
22818
|
...coverageLines
|
|
22810
22819
|
].join(`
|
|
22811
22820
|
`),
|
|
@@ -23848,15 +23857,23 @@ async function projectCommand(context) {
|
|
|
23848
23857
|
project = await client.createProject({
|
|
23849
23858
|
key: stringArg(args, "key"),
|
|
23850
23859
|
name: stringArg(args, "name"),
|
|
23860
|
+
...defined("default_assignee", optionalString(args, "default_assignee")),
|
|
23851
23861
|
actor
|
|
23852
23862
|
});
|
|
23853
23863
|
} catch (error) {
|
|
23854
23864
|
throw refusalWithCode(error);
|
|
23855
23865
|
}
|
|
23856
23866
|
const href = new URL(`/projects/${encodeURIComponent(project.key)}`, linkBase).toString();
|
|
23867
|
+
const projectDefault = namedPerson(project.default_assignee);
|
|
23857
23868
|
return {
|
|
23858
|
-
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}
|
|
23859
|
-
|
|
23869
|
+
text: `Created project ${project.key} (${project.name}) at ${project.created_at}: ${href}` + (projectDefault === undefined ? "" : `
|
|
23870
|
+
Its unowned work lands on ${projectDefault}: a question on an issue nobody holds reaches them.`),
|
|
23871
|
+
details: {
|
|
23872
|
+
project: project.key,
|
|
23873
|
+
name: project.name,
|
|
23874
|
+
created_at: project.created_at,
|
|
23875
|
+
...defined("default_assignee", projectDefault)
|
|
23876
|
+
}
|
|
23860
23877
|
};
|
|
23861
23878
|
}
|
|
23862
23879
|
async function projectsCommand(context) {
|
|
@@ -24449,7 +24466,7 @@ async function whoamiCommand(context) {
|
|
|
24449
24466
|
const proved = identity.kind === "agent" ? identity.session ?? null : null;
|
|
24450
24467
|
const project = identity.kind === "agent" ? identity.project ?? null : null;
|
|
24451
24468
|
const session = proved ?? sessionId;
|
|
24452
|
-
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee,
|
|
24469
|
+
const unowned = "no owner, so an issue you create without an assignee takes its parent's assignee, else the project's default assignee, which every project names, so the issue always has one.";
|
|
24453
24470
|
const signInNeeded = owner === null && service !== null && proved !== null;
|
|
24454
24471
|
const acting = owner !== null ? `Session ${session} acts for ${owner}: issues you create without an assignee are assigned to ${owner}.` : service !== null ? signInNeeded ? `Session ${session} runs as service ${serviceSubjectLabel(service)} and no person, so it may read but Dispatch refuses every write it makes: run \`agent-secrets login\` on this machine to write as yourself.` : `Session ${session} runs as service ${serviceSubjectLabel(service)}: ${unowned}` : `Session ${session} runs under the shared token: ${unowned}`;
|
|
24455
24472
|
const elsewhere = proved !== null && proved !== sessionId ? ` Your credential names session ${proved}, which is not this host session (${sessionId}): Dispatch records every write you make as ${proved}.` : "";
|
|
@@ -249,6 +249,6 @@ The first phase that resume starts needs no slot of its own either, since the ro
|
|
|
249
249
|
A changes request, or a newer version of the document that hands the request back to you, leaves the gate closed, so it holds the tree's work until a new approval.
|
|
250
250
|
While your answered root stands in the line, your record carries `waitingLine`: your place in the line and its length, your `part` (`returned`) and `kind` (`answered`), your `partPlace` of `partLength` among the issues whose work came back, `holdsSlot` true because your root has held its slot since its start, `since`, the moment your work came back, and `reason`, the daemon's own sentence for that place.
|
|
251
251
|
An issue that has not started carries `rootRank`, `ownRank` and `rootKey` in place of `since`, the two Dispatch ranks that placed it and the key of its tree root.
|
|
252
|
-
`why` beside it says why any issue of your tree is not working now, in one word and one sentence: `claim_stopped`, a claim nothing will wake; `waiting`, this line; `blocked`, a Dispatch link or an open child below it; `unlisted`, an issue the record holds in the workflow that no admission list places.
|
|
252
|
+
`why` beside it says why any issue of your tree is not working now, in one word and one sentence: `claim_stopped`, a claim nothing will wake; `waiting`, this line; `blocked`, a Dispatch link or an open child below it, though its reason can be the sentence of the issue's `admission.held` word (the sentence table of `packages/daemon/internal/projection/why.go` says when); `unlisted`, an issue the record holds in the workflow that no admission list places.
|
|
253
253
|
Nothing is sent to you about that wait, and your resume task says what answered it.
|
|
254
254
|
Act on neither your place nor your wait: the daemon starts you again on the pass that reads the answer.
|
|
@@ -15,7 +15,7 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
15
15
|
| Wake | Procedure |
|
|
16
16
|
| --- | --- |
|
|
17
17
|
| `carried-gate-opened` | Only a root whose catch-up said `carried` gets it. Its `version` and `reason`: a human approved the old root's spec document at `version`, which opened the gate this root carried; the daemon has started any child waiting on it. It names no step: the carry brings the old root's gate records, and the catch-up reports every gated step the carry did not bring as unregistered, so register each of those on this issue's own document for that step (`skill://legion-architect/references/design-gate.md`). It is not `design-approved`: do not proceed to section 2 or release a wave because of it, and start nothing. |
|
|
18
|
-
| `child-status` | A child of your tree left the workflow or re-entered it, or joined your tree from the admission queue; the reason names the child and its new status, or reads `<KEY> joined the tree of <ROOT> from the admission queue
|
|
18
|
+
| `child-status` | A child of your tree left the workflow or re-entered it, or joined your tree from the admission queue or from a closed tree; the reason names the child and its new status, or reads `<KEY> joined the tree of <ROOT> from the admission queue`, or, for a member of a closed tree your release took, `<KEY> joined the tree of <ROOT> from the closed tree of <OLD ROOT>`. `todo` (a human's move, your `release_children`, or your `rerun_child`) means it runs again under your tree from planning, and the daemon starts it; you start nothing. A child held for a blocker starts the same way once nothing holds it, and the reason, naming it and its root, says what cleared the hold: its last blocker's close, naming the issues it waited on, now done, or a person or you taking its blocked-by links off; you start nothing for it either. `backlog`, `icebox` or `triage` (a human's move, or your `park_child`) means the daemon has suspended its workers, and it advances no further until it is set back to `todo`. A `park_child` and then a `rerun_child` is that child's restart and not a park, because the daemon refuses `rerun_child` on a child whose phase is not `done` (`CHILD_RUNNING`, `packages/daemon/internal/api/architect.go`). Joined from the admission queue means a root that waited for a slot and never ran, which a person made a child of your tree or your `release_children` adopted, now runs in your tree with no architect of its own and takes an admission slot of its own when its work starts, from planning when it is `todo` and parked otherwise; one that waits on an unfinished blocked-by issue is held for that blocker like any other child, and starts when nothing holds it; you start nothing. A reason saying an issue is beneath an ancestor whose reviewed head the daemon has already accepted is a person's `todo` the daemon recorded and holds at `admitted`: nothing starts it until that ancestor closes, and a `request_backward_move` of the ancestor is what runs it under the ancestor now. What the rest of the tree does is your decision. When a park leaves no child that an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
|
|
19
19
|
| `child-closed` | Read the child completion and remaining open children. Re-scope open work, and take out with `park_child` each child the result makes unneeded (first take its link off each sibling that waits on it, or park that sibling too when its work ends with the parked child, under the same rule, as section 2 says) and say why with `dispatch comment`. Park a child only when a person asked for that move, or when the work is done, folded into another issue or no longer needed. Then file any new child the result calls for, after the red-team check in `skill://legion-architect/references/decomposition.md`, and release it at once with `release_children`, blocked by what it builds on (section 2). When a worker waits on this child for a missing surface (see `phase-finished`), tell it to continue with `envoy_publish` to its role topic. The last child's close is not the end-game (section 3). When it was the last child an issue in `accepting` waits on, run that issue's last round (`skill://legion-architect/references/acceptance.md`). |
|
|
20
20
|
| `child-release-stalled` | Its `reason` names a child your `release_children` released that your tree has not recorded, its parent, and why, one of three: the parent's release has not reached the daemon after three tries; or GitHub did not answer the App installation read of a repository on the child's parent chain, and the release left the child unrecorded because a parent on that chain is not `todo`, or did not write the child `todo` because its parent is not recorded; or the daemon's recovery of such a repository, once GitHub answered, still left children unrecorded (one notice per tree lists them all, each with its parent). Read the parent's record with the `legion` tool's `read_record` (`issue` the parent); release the parent first when the `reason` says to, then run `release_children` for the child again once the parent is recorded in your tree, and tell the controller if it never is. |
|
|
21
21
|
| `child-not-recorded` | Its `reason` names a child your tree did not record and why: its repository resolves to none (neither it nor an ancestor names one, and the project has no default), or to one not mapped to the project, or to one the daemon leaves out for a missing GitHub App. The daemon said why on the child too. Set the child's repository to one of the project's (`dispatch issue-update --repo owner/name`), then release it again with `release_children`; tell the controller when the repository it needs is not served. |
|
|
@@ -38,4 +38,4 @@ and 7 (a conflict, the hand-over, the close) is in
|
|
|
38
38
|
## A root that joins your tree, and a refused release
|
|
39
39
|
|
|
40
40
|
- A root that waited in the admission queue, never ran and never left another tree joins your tree once a person makes it your child, if it is `todo`, and otherwise at your release of it (the `child-status` row of [wake routing](skill://legion-architect/references/wake-routing.md)); once in, it is held for its blockers like any child you release. A root that left another tree, handed over by its finished tree or admitted as an orphan, stays its own tree and never joins yours, even one that was your root's child before your root was admitted again. A labelled `todo` issue under a child you have not released, unless it ran as a tree of its own or left another tree, is held under that unreleased child (not a blocked-by hold): it waits for no slot until your release of it or of that child brings it in, with any `todo` child of its own.
|
|
41
|
-
- A release that cannot take a child in is refused 409 and writes nothing, its message naming the child and why: release the rest again without it. `CHILD_NOT_ADOPTABLE` is an issue that runs or ran as a tree of its own, carries a run handed over to it, or was handed over (or admitted as an orphan) as a root of its own: leave it there, or ask the controller. `CHILD_IN_OTHER_TREE` is another tree's child. When the tree it names is a root held under an unreleased child of yours (a root that queued and never ran, so it has no architect of its own), release that root, or the unreleased child it sits under, instead: its children come with it. Otherwise re-parent the child back in Dispatch, or ask that tree's architect or the controller.
|
|
41
|
+
- A release that cannot take a child in is refused 409 and writes nothing, its message naming the child and why: release the rest again without it. `CHILD_NOT_ADOPTABLE` is an issue that runs or ran as a tree of its own, carries a run handed over to it, or was handed over (or admitted as an orphan) as a root of its own, and a member of a closed tree that holds an admission slot, which the daemon started and keeps where it stands: leave it there, or ask the controller. `CHILD_IN_OTHER_TREE` is another tree's child. One kind of other tree's child does join yours: a member of a tree whose root the daemon's record says is `done` and whose linger has run out, standing at `admitted` with no slot of its own, which your release records in your tree with its repository kept and its generation raised by one — at `admitted` when it is `todo`, and in any other status as a parked child at `done`, which a `todo` runs again. `admission.held` reads `tree_closed` for more issues than a release takes: a member whose tree's linger still runs, and a member past `admitted`, read that word too and stay refused (the `tree_closed` row of `skill://legion-controller/references/admission.md`). When the tree it names is a root held under an unreleased child of yours (a root that queued and never ran, so it has no architect of its own), release that root, or the unreleased child it sits under, instead: its children come with it. Otherwise re-parent the child back in Dispatch, or ask that tree's architect or the controller.
|
|
@@ -195,6 +195,13 @@ Every move to `todo` you make is one of these:
|
|
|
195
195
|
`skill://legion-controller/references/wakes.md#a-tree-that-waits-on-an-event-outside-legion`);
|
|
196
196
|
- stopped-session work that a person's directive in the weekly plan moves to Legion.
|
|
197
197
|
|
|
198
|
+
`admission.held` is every issue the daemon's record holds in the workflow that stands in neither
|
|
199
|
+
`admission.active` nor `admission.waiting`: each row gives the issue, one word for why nothing of
|
|
200
|
+
it runs, and the issues that hold it. Read it beside `admission.blocked`, which names Dispatch
|
|
201
|
+
links and children-first waits alone. The daemon starts none of the issues in `admission.held` by
|
|
202
|
+
itself, so a row ends when a person acts or when the tree that owns the work moves;
|
|
203
|
+
`skill://legion-controller/references/admission.md` gives the word for each row and what ends it.
|
|
204
|
+
|
|
198
205
|
## Findings, and the issues you file
|
|
199
206
|
|
|
200
207
|
File an issue only when a person asks you to (a direct message, a Slack request, or their answer
|
|
@@ -25,3 +25,35 @@ wake — an unanswered `awaiting_person` root only when its label or its Dispatc
|
|
|
25
25
|
resume unsafe. Holding no slot is by itself no fault: a root waiting in the line and a child its
|
|
26
26
|
architect has not released yet hold none while their tree runs. The wake is live only, so a
|
|
27
27
|
controller that starts later finds such a root by the last row, as its start procedure does.
|
|
28
|
+
|
|
29
|
+
## `admission.held`: what nothing starts
|
|
30
|
+
|
|
31
|
+
`admission.held` is every issue the daemon's record holds in the workflow that stands in neither
|
|
32
|
+
`admission.active` nor `admission.waiting`. Each row carries the issue, one word for why nothing
|
|
33
|
+
of it runs, and `heldBy`, the issues that hold it, which is absent where no issue holds it. The
|
|
34
|
+
daemon reads the words in the order of the table below and takes the first that is true, so one
|
|
35
|
+
issue reads one word, and that word is the same in `read_state` and in the `tick` notice. The
|
|
36
|
+
list names no issue `admission.active` or `admission.waiting` names, so the three lists together
|
|
37
|
+
are every issue of the workflow and what each one is doing. `admission.blocked` keeps its own
|
|
38
|
+
rows beside them: it names Dispatch links and children-first waits alone, and an issue it names
|
|
39
|
+
that stands in `admission.held` reads there under whichever word the daemon's order gives it,
|
|
40
|
+
which can be an earlier one — a child under a shut gate that a link also holds reads
|
|
41
|
+
`design_gate`. A blocked root the line carries stands in `admission.waiting` and has no held row
|
|
42
|
+
at all.
|
|
43
|
+
|
|
44
|
+
The daemon starts none of these issues by itself. Name them in the day's report and take nothing
|
|
45
|
+
for them, except where the row's last column names an act of yours.
|
|
46
|
+
|
|
47
|
+
| Word | What it means | What ends the hold |
|
|
48
|
+
|---|---|---|
|
|
49
|
+
| `tree_closed` | The daemon's record of the issue's tree root says `done`, or that root's linger is still running after it left the workflow. `heldBy` names that root | An architect's `release_children` of the live tree whose Dispatch parent the issue reaches: the daemon records it in that tree with its repository kept and its generation raised by one, at `admitted` when it is `todo` and in any other status as a parked child at `done`, which a `todo` runs again. The row alone does not say whether that release would be accepted, and three kinds of issue read this word that no release takes: a member of a tree still in its linger, and a member of a parked tree, whose park starts a linger of its own, both refused while that linger runs; and a member past `admitted`, refused `CHILD_IN_OTHER_TREE`. A member of a closed tree that holds an admission slot stands in `admission.active` and has no held row: a release of one past `admitted`, the usual member at work, is refused `CHILD_IN_OTHER_TREE`, and of one at `admitted`, `CHILD_IN_OTHER_TREE` while its root's linger runs and `CHILD_NOT_ADOPTABLE` once that linger has ended |
|
|
50
|
+
| `tree_parked` | The issue's tree root left the workflow to `backlog` or `icebox`, because that tree was parked (by a person, or by your own hold), and that root's linger has run out. While it still runs the member reads `tree_closed` instead. `heldBy` names that root | A `todo` on the root, which re-admits the tree, and nothing else: no release takes such a member. Where the park is your own hold, the parked-root walk decides it (`skill://legion-controller/references/parked-decisions.md`) |
|
|
51
|
+
| `label_off` | The issue is a root the admission queue does not carry, because the record says the `legion` label is off. A person took it out of Legion | A person's label. Take no issue back yourself: the intake rule in your deployment instructions keeps such a root out |
|
|
52
|
+
| `ancestry` | The root's Dispatch chain reaches another live root, so the issue is that tree's unreleased work. `heldBy` names the live roots on that chain | That tree's architect releasing the issue, or releasing the parent above it; or every live root leaving that chain, after which it queues as a root of its own |
|
|
53
|
+
| `root_awaiting_person` | The issue's tree root has handed work to a person, a question or its spec, and has not resumed yet, whether or not the person has answered, so the daemon starts no issue of the tree. `heldBy` names that root | The root's resume, which the person's answer or review brings: the daemon then resumes the root's architect |
|
|
54
|
+
| `design_gate` | The design gate of the issue's tree root is not open at every step the deployment gates. `heldBy` names that root | A person's approval of each gated step's document at its current version |
|
|
55
|
+
| `dispatch_blocker` | A Dispatch `blocked_by` link of the issue names an issue that is not `done`, and holds the issue where it stands. `heldBy` names the unfinished blockers | Each blocker reaching `done` (a person's close, or the blocker's own merge), or the link taken off by a person or by the tree's architect. The issue is in `admission.blocked` as well |
|
|
56
|
+
| `children_first` | Dispatch shows an open child under the issue, so its own first phase waits for the children. `heldBy` names the open children | The last open child leaving the workflow, which is the tree architect's work. The issue is in `admission.blocked` as well |
|
|
57
|
+
| `accepted_ancestor` | The daemon has accepted the reviewed head of an issue above this one, so nothing of its own work starts before that ancestor closes. `heldBy` names that ancestor | The ancestor's close, which the merge of its pull request writes |
|
|
58
|
+
| `at_work` | An issue in a phase that keeps no admission slot; no issue reads it today (`record.HeldAtWork` says why) | None today: no issue reads this word. No `heldBy`: no other issue holds it |
|
|
59
|
+
| `unclassified` | No word above is true of the issue. The daemon logs it once for that issue and run | Nothing of yours. Name it in the day's report with its `phase` and `status`, so a person can read what the daemon could not say |
|
|
@@ -26,8 +26,7 @@ legion({ op: "set_status", issue: "<report KEY>", status: "icebox" })
|
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
With no person known, leave out `--assignee`: the issue then goes to your token's owner, or, under
|
|
29
|
-
the shared token, to the project's default assignee
|
|
30
|
-
unassigned.
|
|
29
|
+
the shared token, to the project's default assignee, which every project names.
|
|
31
30
|
|
|
32
31
|
## Keep it answerable
|
|
33
32
|
|
|
@@ -43,7 +42,8 @@ Each time you read it:
|
|
|
43
42
|
(`400 ASSIGNEE_NOT_ALLOWED` names an email nobody has signed in to Dispatch with): name it, with
|
|
44
43
|
its first line, in your summary.
|
|
45
44
|
- While `Assignee:` says `unassigned`, open each report with one sentence asking a person to take
|
|
46
|
-
the issue from its header, because its asks
|
|
45
|
+
the issue from its header, because until someone does, its asks go to the project's default
|
|
46
|
+
assignee and not to the person the report is for.
|
|
47
47
|
|
|
48
48
|
## When
|
|
49
49
|
|
|
@@ -71,6 +71,12 @@ every issue by its `dispatch://` link and what it does for the reader, every pul
|
|
|
71
71
|
link's wait ends when each blocker reaches `done` (a person's close, or the blocker's own
|
|
72
72
|
merge) or its link is taken off (by a person or the tree's architect), and a children-first wait
|
|
73
73
|
ends when the last open child leaves the workflow, so take nothing for them.
|
|
74
|
+
- **What nothing starts.** Each issue in `admission.held`, grouped by its `reason`, with the
|
|
75
|
+
issues `heldBy` names: each group's count and its issues. Say for each
|
|
76
|
+
group what ends the hold, from the table in
|
|
77
|
+
`skill://legion-controller/references/admission.md`, so a reader sees whose act the work waits
|
|
78
|
+
on. An issue whose `reason` is `unclassified` goes in the report with its `phase` and its
|
|
79
|
+
`status`: the daemon could give it no word, and a person reads it.
|
|
74
80
|
- **Phase workers nothing will prompt.** Each entry of the tick's `silent` list, with the role whose
|
|
75
81
|
claim is silent and how long it has been quiet (`skill://legion-controller/references/wakes.md`).
|
|
76
82
|
That list arrives on the tick wake alone and is in no `read_state` field, so the report names the
|
|
@@ -29,7 +29,11 @@ answer to your ask, a mention), Envoy or Slack. No `legion controller start` can
|
|
|
29
29
|
`issues.<KEY>.holdReason`, `issues.<KEY>.architect`, `issues.<KEY>.tree` (the root of the
|
|
30
30
|
issue's tree), `admission.cap`, `admission.active` (the issues holding a slot, roots and
|
|
31
31
|
children), `admission.waiting` (the issues in the line, in its order), `admission.trees` (the
|
|
32
|
-
roots of the live trees), `admission.blocked`, `
|
|
32
|
+
roots of the live trees), `admission.blocked`, `admission.held` (every issue the record holds
|
|
33
|
+
in the workflow that stands in neither `admission.active` nor `admission.waiting`, each with
|
|
34
|
+
one word for why nothing of it runs and the issues that hold it;
|
|
35
|
+
`skill://legion-controller/references/admission.md` gives the word for each row and what ends
|
|
36
|
+
it), `capabilities[]`, `daemon.project`, and
|
|
33
37
|
`settings` (the daemon's resolved `legion.yaml`, with no credential in it).
|
|
34
38
|
- `op: "set_status"` with `issue` and `status` (`todo`, `backlog` or `icebox`) moves an issue. Each
|
|
35
39
|
call mints its grant in-process from the secret the session registered with, so a stale secret
|
|
@@ -141,7 +141,7 @@ architect for it, whatever it asks. For a person's mention, take the first of th
|
|
|
141
141
|
no label and waits for a person to hand it over. Never label a request outside the scope the
|
|
142
142
|
deployment instructions state. Reply with the new issue's key, its title, the link and assignee
|
|
143
143
|
the `Created` line names (naming nobody, Dispatch assigns the issue to your token's owner, or,
|
|
144
|
-
under the shared token, to the project's default assignee
|
|
144
|
+
under the shared token, to the project's default assignee, which every project names),
|
|
145
145
|
and whether Legion will take it: with the label, triage admits it in its next turn unless a
|
|
146
146
|
person's request says to wait or puts it out of scope. That request is the request itself, the
|
|
147
147
|
deployment instructions, or a line of the weekly plan that names the person's request behind it.
|
|
@@ -72,14 +72,14 @@ Read this on a `triage` wake, at every start, and when a person hands you an iss
|
|
|
72
72
|
work is done, folded into another issue (name it) or no longer needed.
|
|
73
73
|
For a root you admitted, say in that comment who will be asked: `Assigned to <login>,
|
|
74
74
|
who will get this tree's questions and its design approval`, or, when `Assignee:` says
|
|
75
|
-
`unassigned`, `Unassigned —
|
|
76
|
-
until someone takes it from the issue header (Assignee, beside Priority)`.
|
|
77
|
-
approval only when your system prompt's `Design gate steps:` sentence names
|
|
78
|
-
when it reads `Design gate steps: none.` nobody approves a design, so drop
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
project
|
|
82
|
-
architect's asks reach
|
|
75
|
+
`unassigned`, `Unassigned — this tree's questions and its design approval go to the project's
|
|
76
|
+
default assignee until someone takes it from the issue header (Assignee, beside Priority)`.
|
|
77
|
+
Promise the design approval only when your system prompt's `Design gate steps:` sentence names
|
|
78
|
+
at least one step; when it reads `Design gate steps: none.` nobody approves a design, so drop
|
|
79
|
+
"and its design approval". Take the assignee from the read, never from how the issue was
|
|
80
|
+
created: an issue filed with no assignee lands on the project's default assignee, which every
|
|
81
|
+
project names, but a person can clear an assignee later, and a root with none still has its
|
|
82
|
+
architect's asks reach the project's default assignee.
|
|
83
83
|
|
|
84
84
|
## Label an issue for a person
|
|
85
85
|
|
|
@@ -34,7 +34,7 @@ child, so the issue it names may be either. Name the free slots; take nothing.
|
|
|
34
34
|
daemon waits half a minute and folds that window's events into one wake. Take nothing: it is not
|
|
35
35
|
Legion's.
|
|
36
36
|
|
|
37
|
-
## `tick on <PROJECT>` (`{kind: "tick", openCapabilities?, blocked?, silent?}`)
|
|
37
|
+
## `tick on <PROJECT>` (`{kind: "tick", openCapabilities?, blocked?, held?, silent?}`)
|
|
38
38
|
|
|
39
39
|
The daemon's periodic wake, a minute after it starts and then every
|
|
40
40
|
`controller_wake_interval_seconds` (an hour by default), whatever the slots. Run the skill's every-turn
|
|
@@ -59,6 +59,18 @@ link is taken off (by a person or the tree's architect), and a children-first wa
|
|
|
59
59
|
last open child leaves the workflow: name the waits in the day's report and
|
|
60
60
|
take nothing for them.
|
|
61
61
|
|
|
62
|
+
`held`, when present, is `[{issue, reason, heldBy?}, …]`: every issue the daemon's record holds
|
|
63
|
+
in the workflow that stands in neither `admission.active` nor `admission.waiting`, each with one
|
|
64
|
+
word for why nothing of it runs and the issues that hold it. `heldBy` is absent where no issue
|
|
65
|
+
holds the one that waits. The field is absent where the project holds nothing, as `blocked` is.
|
|
66
|
+
`read_state` shows the same rows under `admission.held`, with the same word for each issue, and
|
|
67
|
+
`legion state` prints their counts as `admission.held:`. The word for each row, and what ends
|
|
68
|
+
each hold, is the table in `skill://legion-controller/references/admission.md`. The rows name the
|
|
69
|
+
blocked issues again, under whichever word the daemon's order gives them, so an issue can stand
|
|
70
|
+
in `blocked` and in `held` at once: `blocked` is what readers use for a link or a children-first
|
|
71
|
+
wait, and `held` says of every held issue what it waits for. Name them in the day's report and
|
|
72
|
+
take nothing for them.
|
|
73
|
+
|
|
62
74
|
`silent`, when present, is `[{issue, role, lastStep, silent, backgroundSince?}, …]`: every issue whose phase worker
|
|
63
75
|
nothing will prompt, with the role whose claim is silent, the moment that claim's agent last
|
|
64
76
|
stepped, and how long it has been quiet.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sjawhar/claude-envoy",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.13.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"description": "Claude Code plugin for Legion's Envoy bus",
|
|
6
6
|
"type": "module",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"AGENTS.md"
|
|
20
20
|
],
|
|
21
21
|
"legion": {
|
|
22
|
-
"daemonApiVersion":
|
|
22
|
+
"daemonApiVersion": 98
|
|
23
23
|
},
|
|
24
24
|
"repository": {
|
|
25
25
|
"type": "git",
|
package/skills/dispatch/SKILL.md
CHANGED
|
@@ -15,7 +15,7 @@ Dispatch is a record for the people who decide, never a log of your work.
|
|
|
15
15
|
## Asks and ask blocks
|
|
16
16
|
|
|
17
17
|
- 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.
|
|
18
|
-
- An ask waits on the issue's assignee
|
|
18
|
+
- An ask waits on its asked-of person, else the issue's assignee, else the project's default assignee; no agent hands one on.
|
|
19
19
|
- A design question's ask block ends its section:
|
|
20
20
|
|
|
21
21
|
```md
|