@sjawhar/claude-envoy 6.13.0 → 6.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.omp-plugin/plugin.json +1 -1
- package/dist/codex-hook.js +20 -3
- package/dist/dispatch.js +20 -3
- package/dist/envoy-channel.js +21 -4
- package/dist/session-hook.js +20 -3
- package/legion/skills/legion-architect/references/plan.md +4 -2
- package/package.json +1 -1
package/.omp-plugin/plugin.json
CHANGED
package/dist/codex-hook.js
CHANGED
|
@@ -14455,6 +14455,11 @@ var COMMENT_ARGUMENT = "Comment id (uuid), or a dispatch://KEY/comment/<id> or "
|
|
|
14455
14455
|
var MESSAGE_ARGUMENT = "Message id (uuid), or a dispatch://KEY/message/<id> reference; a reference accepts an " + "8+ character id prefix that is unique on its owner.";
|
|
14456
14456
|
var ASK_BOUND_RULE = "Dispatch bounds an ask's question and its options together, refuses a longer one and names " + "the bound, and `dispatch limits` prints it. An ask is short and asks one thing; its reasoning " + "goes in the document, not in the question.";
|
|
14457
14457
|
var DISPATCH_HANDOFF_BODY_MAX = 262144;
|
|
14458
|
+
var STEP_RESULTS = ["passed", "failed", "stopped"];
|
|
14459
|
+
var PLANNED_STEP_STATES = ["not started", "running", ...STEP_RESULTS];
|
|
14460
|
+
var STEP_TASK_MAX = 64;
|
|
14461
|
+
var STEP_TASK_PATTERN = new RegExp(`^[a-z0-9][a-z0-9-]{0,${STEP_TASK_MAX - 1}}$`);
|
|
14462
|
+
var STEP_TASK_RULE_WORDS = `lowercase letters, digits and hyphens, starting with a letter or a digit, at most ${STEP_TASK_MAX} bytes`;
|
|
14458
14463
|
var HANDOFF_PHASE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
|
|
14459
14464
|
var HANDOFF_PHASE_RULE_WORDS = "a lowercase letter, then up to 31 lowercase letters, digits or hyphens, such as implement";
|
|
14460
14465
|
var HANDOFF_PHASE_RULE = `phase is not a handoff phase: ${HANDOFF_PHASE_RULE_WORDS}`;
|
|
@@ -15310,7 +15315,7 @@ var dispatchToolSpecs = [
|
|
|
15310
15315
|
{
|
|
15311
15316
|
name: "dispatch_steps",
|
|
15312
15317
|
example: { issue: "DSP-1" },
|
|
15313
|
-
description: "Print each step that ran on
|
|
15318
|
+
description: "Print each task of an issue's plan and each step that ran on the issue, as the Legion " + "daemon recorded it at the step's start and at its end, and the experiment and the " + "variant the issue was drawn into, where its records name one. The first line is " + "`<KEY>: <n> steps in <m> tasks`, where m counts each task listed, a task of the plan " + "with no run included. Where the records of the issue's newest run name an experiment, " + "the next line is `Experiment <experiment>: variant <variant>.`, and an issue whose " + "newest run's records name none prints no such line. The tasks of the issue's newest " + "plan come first, in the plan's order, then each other task with a run, in the order " + "each first ran. A task of the plan prints `task <task> needs <needs>: <place> <step> " + "<state>, ...`: needs is the tasks it needs as a list, [a,b], [] where it needs none, " + "and - where its plan node recorded none, then each step the plan gives it, where state " + "is where Dispatch says it stands among the records of the plan's own run: not started, " + "running, or the result of its newest run there. Then each run of a step of the task " + "prints one line: `<task> " + "<step> <kind> <role> <type> attempt <attempt> <agent> <model> <started_at> <ended_at> " + "<result>`. kind is step, retro or merge. step is the step's place in its task, from 1, " + "and 0 for a retro or a merge. attempt counts the runs of the same task, step and kind, " + "from 1. agent is the claim of the role that ran the step, and model is the model that " + "answered it, as provider/model. result is passed, failed or stopped. A field with no " + "value prints -, and a run that has not ended prints running for its end and its result. " + "A closed issue's steps read too. An issue that no step ran on and that has no plan prints " + "0 steps in 0 tasks, and a key Dispatch does not hold fails as dispatch read fails for it, " + `NOT_FOUND: not found. ${ISSUE_REFERENCE}`,
|
|
15314
15319
|
arguments: (z) => ({
|
|
15315
15320
|
issue: z.string().describe(ISSUE_REFERENCE)
|
|
15316
15321
|
}),
|
|
@@ -32990,6 +32995,11 @@ function stepLine(record) {
|
|
|
32990
32995
|
...record.ended_at === null ? ["running", "running"] : [record.ended_at, orDash(record.result)]
|
|
32991
32996
|
].join(" ");
|
|
32992
32997
|
}
|
|
32998
|
+
function taskLine(task, needs, planned) {
|
|
32999
|
+
const states = planned.map((step) => `${step.step} ${step.name} ${step.state}`);
|
|
33000
|
+
const needed = needs === null ? "-" : `[${needs.join(",")}]`;
|
|
33001
|
+
return `task ${task} needs ${needed}: ${states.join(", ")}`;
|
|
33002
|
+
}
|
|
32993
33003
|
function variantLines(records) {
|
|
32994
33004
|
const newest = Math.max(...records.map((record) => record.generation));
|
|
32995
33005
|
const named = records.find((record) => record.generation === newest && record.experiment != null && record.variant != null);
|
|
@@ -32998,13 +33008,20 @@ function variantLines(records) {
|
|
|
32998
33008
|
async function stepsCommand(context) {
|
|
32999
33009
|
const { client, issue } = context;
|
|
33000
33010
|
const read = await client.listSteps(issue());
|
|
33001
|
-
const tasks = (read.tasks ?? []).map((task) => ({ task
|
|
33011
|
+
const tasks = (read.tasks ?? []).map((task) => ({ ...task, steps: task.steps ?? [] }));
|
|
33002
33012
|
const records = tasks.flatMap((task) => task.steps);
|
|
33013
|
+
const lines = tasks.flatMap((task) => {
|
|
33014
|
+
const runs = task.steps.map(stepLine);
|
|
33015
|
+
const planned = task.planned ?? [];
|
|
33016
|
+
if (planned.length === 0)
|
|
33017
|
+
return runs;
|
|
33018
|
+
return [taskLine(task.task, task.needs ?? null, planned), ...runs];
|
|
33019
|
+
});
|
|
33003
33020
|
return {
|
|
33004
33021
|
text: [
|
|
33005
33022
|
`${read.issue}: ${records.length} steps in ${tasks.length} tasks`,
|
|
33006
33023
|
...variantLines(records),
|
|
33007
|
-
...
|
|
33024
|
+
...lines
|
|
33008
33025
|
].join(`
|
|
33009
33026
|
`),
|
|
33010
33027
|
details: { issue: read.issue, tasks }
|
package/dist/dispatch.js
CHANGED
|
@@ -15055,6 +15055,11 @@ var COMMENT_ARGUMENT = "Comment id (uuid), or a dispatch://KEY/comment/<id> or "
|
|
|
15055
15055
|
var MESSAGE_ARGUMENT = "Message id (uuid), or a dispatch://KEY/message/<id> reference; a reference accepts an " + "8+ character id prefix that is unique on its owner.";
|
|
15056
15056
|
var ASK_BOUND_RULE = "Dispatch bounds an ask's question and its options together, refuses a longer one and names " + "the bound, and `dispatch limits` prints it. An ask is short and asks one thing; its reasoning " + "goes in the document, not in the question.";
|
|
15057
15057
|
var DISPATCH_HANDOFF_BODY_MAX = 262144;
|
|
15058
|
+
var STEP_RESULTS = ["passed", "failed", "stopped"];
|
|
15059
|
+
var PLANNED_STEP_STATES = ["not started", "running", ...STEP_RESULTS];
|
|
15060
|
+
var STEP_TASK_MAX = 64;
|
|
15061
|
+
var STEP_TASK_PATTERN = new RegExp(`^[a-z0-9][a-z0-9-]{0,${STEP_TASK_MAX - 1}}$`);
|
|
15062
|
+
var STEP_TASK_RULE_WORDS = `lowercase letters, digits and hyphens, starting with a letter or a digit, at most ${STEP_TASK_MAX} bytes`;
|
|
15058
15063
|
var HANDOFF_PHASE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
|
|
15059
15064
|
var HANDOFF_PHASE_RULE_WORDS = "a lowercase letter, then up to 31 lowercase letters, digits or hyphens, such as implement";
|
|
15060
15065
|
var HANDOFF_PHASE_RULE = `phase is not a handoff phase: ${HANDOFF_PHASE_RULE_WORDS}`;
|
|
@@ -15910,7 +15915,7 @@ var dispatchToolSpecs = [
|
|
|
15910
15915
|
{
|
|
15911
15916
|
name: "dispatch_steps",
|
|
15912
15917
|
example: { issue: "DSP-1" },
|
|
15913
|
-
description: "Print each step that ran on
|
|
15918
|
+
description: "Print each task of an issue's plan and each step that ran on the issue, as the Legion " + "daemon recorded it at the step's start and at its end, and the experiment and the " + "variant the issue was drawn into, where its records name one. The first line is " + "`<KEY>: <n> steps in <m> tasks`, where m counts each task listed, a task of the plan " + "with no run included. Where the records of the issue's newest run name an experiment, " + "the next line is `Experiment <experiment>: variant <variant>.`, and an issue whose " + "newest run's records name none prints no such line. The tasks of the issue's newest " + "plan come first, in the plan's order, then each other task with a run, in the order " + "each first ran. A task of the plan prints `task <task> needs <needs>: <place> <step> " + "<state>, ...`: needs is the tasks it needs as a list, [a,b], [] where it needs none, " + "and - where its plan node recorded none, then each step the plan gives it, where state " + "is where Dispatch says it stands among the records of the plan's own run: not started, " + "running, or the result of its newest run there. Then each run of a step of the task " + "prints one line: `<task> " + "<step> <kind> <role> <type> attempt <attempt> <agent> <model> <started_at> <ended_at> " + "<result>`. kind is step, retro or merge. step is the step's place in its task, from 1, " + "and 0 for a retro or a merge. attempt counts the runs of the same task, step and kind, " + "from 1. agent is the claim of the role that ran the step, and model is the model that " + "answered it, as provider/model. result is passed, failed or stopped. A field with no " + "value prints -, and a run that has not ended prints running for its end and its result. " + "A closed issue's steps read too. An issue that no step ran on and that has no plan prints " + "0 steps in 0 tasks, and a key Dispatch does not hold fails as dispatch read fails for it, " + `NOT_FOUND: not found. ${ISSUE_REFERENCE}`,
|
|
15914
15919
|
arguments: (z) => ({
|
|
15915
15920
|
issue: z.string().describe(ISSUE_REFERENCE)
|
|
15916
15921
|
}),
|
|
@@ -39096,6 +39101,11 @@ function stepLine(record) {
|
|
|
39096
39101
|
...record.ended_at === null ? ["running", "running"] : [record.ended_at, orDash(record.result)]
|
|
39097
39102
|
].join(" ");
|
|
39098
39103
|
}
|
|
39104
|
+
function taskLine(task, needs, planned) {
|
|
39105
|
+
const states = planned.map((step) => `${step.step} ${step.name} ${step.state}`);
|
|
39106
|
+
const needed = needs === null ? "-" : `[${needs.join(",")}]`;
|
|
39107
|
+
return `task ${task} needs ${needed}: ${states.join(", ")}`;
|
|
39108
|
+
}
|
|
39099
39109
|
function variantLines(records) {
|
|
39100
39110
|
const newest = Math.max(...records.map((record) => record.generation));
|
|
39101
39111
|
const named = records.find((record) => record.generation === newest && record.experiment != null && record.variant != null);
|
|
@@ -39104,13 +39114,20 @@ function variantLines(records) {
|
|
|
39104
39114
|
async function stepsCommand(context) {
|
|
39105
39115
|
const { client, issue } = context;
|
|
39106
39116
|
const read = await client.listSteps(issue());
|
|
39107
|
-
const tasks = (read.tasks ?? []).map((task) => ({ task
|
|
39117
|
+
const tasks = (read.tasks ?? []).map((task) => ({ ...task, steps: task.steps ?? [] }));
|
|
39108
39118
|
const records = tasks.flatMap((task) => task.steps);
|
|
39119
|
+
const lines = tasks.flatMap((task) => {
|
|
39120
|
+
const runs = task.steps.map(stepLine);
|
|
39121
|
+
const planned = task.planned ?? [];
|
|
39122
|
+
if (planned.length === 0)
|
|
39123
|
+
return runs;
|
|
39124
|
+
return [taskLine(task.task, task.needs ?? null, planned), ...runs];
|
|
39125
|
+
});
|
|
39109
39126
|
return {
|
|
39110
39127
|
text: [
|
|
39111
39128
|
`${read.issue}: ${records.length} steps in ${tasks.length} tasks`,
|
|
39112
39129
|
...variantLines(records),
|
|
39113
|
-
...
|
|
39130
|
+
...lines
|
|
39114
39131
|
].join(`
|
|
39115
39132
|
`),
|
|
39116
39133
|
details: { issue: read.issue, tasks }
|
package/dist/envoy-channel.js
CHANGED
|
@@ -37255,6 +37255,11 @@ var COMMENT_ARGUMENT = "Comment id (uuid), or a dispatch://KEY/comment/<id> or "
|
|
|
37255
37255
|
var MESSAGE_ARGUMENT = "Message id (uuid), or a dispatch://KEY/message/<id> reference; a reference accepts an " + "8+ character id prefix that is unique on its owner.";
|
|
37256
37256
|
var ASK_BOUND_RULE = "Dispatch bounds an ask's question and its options together, refuses a longer one and names " + "the bound, and `dispatch limits` prints it. An ask is short and asks one thing; its reasoning " + "goes in the document, not in the question.";
|
|
37257
37257
|
var DISPATCH_HANDOFF_BODY_MAX = 262144;
|
|
37258
|
+
var STEP_RESULTS = ["passed", "failed", "stopped"];
|
|
37259
|
+
var PLANNED_STEP_STATES = ["not started", "running", ...STEP_RESULTS];
|
|
37260
|
+
var STEP_TASK_MAX = 64;
|
|
37261
|
+
var STEP_TASK_PATTERN = new RegExp(`^[a-z0-9][a-z0-9-]{0,${STEP_TASK_MAX - 1}}$`);
|
|
37262
|
+
var STEP_TASK_RULE_WORDS = `lowercase letters, digits and hyphens, starting with a letter or a digit, at most ${STEP_TASK_MAX} bytes`;
|
|
37258
37263
|
var HANDOFF_PHASE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
|
|
37259
37264
|
var HANDOFF_PHASE_RULE_WORDS = "a lowercase letter, then up to 31 lowercase letters, digits or hyphens, such as implement";
|
|
37260
37265
|
var HANDOFF_PHASE_RULE = `phase is not a handoff phase: ${HANDOFF_PHASE_RULE_WORDS}`;
|
|
@@ -38110,7 +38115,7 @@ var dispatchToolSpecs = [
|
|
|
38110
38115
|
{
|
|
38111
38116
|
name: "dispatch_steps",
|
|
38112
38117
|
example: { issue: "DSP-1" },
|
|
38113
|
-
description: "Print each step that ran on
|
|
38118
|
+
description: "Print each task of an issue's plan and each step that ran on the issue, as the Legion " + "daemon recorded it at the step's start and at its end, and the experiment and the " + "variant the issue was drawn into, where its records name one. The first line is " + "`<KEY>: <n> steps in <m> tasks`, where m counts each task listed, a task of the plan " + "with no run included. Where the records of the issue's newest run name an experiment, " + "the next line is `Experiment <experiment>: variant <variant>.`, and an issue whose " + "newest run's records name none prints no such line. The tasks of the issue's newest " + "plan come first, in the plan's order, then each other task with a run, in the order " + "each first ran. A task of the plan prints `task <task> needs <needs>: <place> <step> " + "<state>, ...`: needs is the tasks it needs as a list, [a,b], [] where it needs none, " + "and - where its plan node recorded none, then each step the plan gives it, where state " + "is where Dispatch says it stands among the records of the plan's own run: not started, " + "running, or the result of its newest run there. Then each run of a step of the task " + "prints one line: `<task> " + "<step> <kind> <role> <type> attempt <attempt> <agent> <model> <started_at> <ended_at> " + "<result>`. kind is step, retro or merge. step is the step's place in its task, from 1, " + "and 0 for a retro or a merge. attempt counts the runs of the same task, step and kind, " + "from 1. agent is the claim of the role that ran the step, and model is the model that " + "answered it, as provider/model. result is passed, failed or stopped. A field with no " + "value prints -, and a run that has not ended prints running for its end and its result. " + "A closed issue's steps read too. An issue that no step ran on and that has no plan prints " + "0 steps in 0 tasks, and a key Dispatch does not hold fails as dispatch read fails for it, " + `NOT_FOUND: not found. ${ISSUE_REFERENCE}`,
|
|
38114
38119
|
arguments: (z) => ({
|
|
38115
38120
|
issue: z.string().describe(ISSUE_REFERENCE)
|
|
38116
38121
|
}),
|
|
@@ -60381,6 +60386,11 @@ function stepLine(record) {
|
|
|
60381
60386
|
...record.ended_at === null ? ["running", "running"] : [record.ended_at, orDash(record.result)]
|
|
60382
60387
|
].join(" ");
|
|
60383
60388
|
}
|
|
60389
|
+
function taskLine(task, needs, planned) {
|
|
60390
|
+
const states = planned.map((step) => `${step.step} ${step.name} ${step.state}`);
|
|
60391
|
+
const needed = needs === null ? "-" : `[${needs.join(",")}]`;
|
|
60392
|
+
return `task ${task} needs ${needed}: ${states.join(", ")}`;
|
|
60393
|
+
}
|
|
60384
60394
|
function variantLines(records) {
|
|
60385
60395
|
const newest = Math.max(...records.map((record) => record.generation));
|
|
60386
60396
|
const named = records.find((record) => record.generation === newest && record.experiment != null && record.variant != null);
|
|
@@ -60389,13 +60399,20 @@ function variantLines(records) {
|
|
|
60389
60399
|
async function stepsCommand(context) {
|
|
60390
60400
|
const { client, issue } = context;
|
|
60391
60401
|
const read = await client.listSteps(issue());
|
|
60392
|
-
const tasks = (read.tasks ?? []).map((task) => ({ task
|
|
60402
|
+
const tasks = (read.tasks ?? []).map((task) => ({ ...task, steps: task.steps ?? [] }));
|
|
60393
60403
|
const records = tasks.flatMap((task) => task.steps);
|
|
60404
|
+
const lines = tasks.flatMap((task) => {
|
|
60405
|
+
const runs = task.steps.map(stepLine);
|
|
60406
|
+
const planned = task.planned ?? [];
|
|
60407
|
+
if (planned.length === 0)
|
|
60408
|
+
return runs;
|
|
60409
|
+
return [taskLine(task.task, task.needs ?? null, planned), ...runs];
|
|
60410
|
+
});
|
|
60394
60411
|
return {
|
|
60395
60412
|
text: [
|
|
60396
60413
|
`${read.issue}: ${records.length} steps in ${tasks.length} tasks`,
|
|
60397
60414
|
...variantLines(records),
|
|
60398
|
-
...
|
|
60415
|
+
...lines
|
|
60399
60416
|
].join(`
|
|
60400
60417
|
`),
|
|
60401
60418
|
details: { issue: read.issue, tasks }
|
|
@@ -66858,7 +66875,7 @@ var import_nats5 = __toESM(require_mod4(), 1);
|
|
|
66858
66875
|
|
|
66859
66876
|
// package.json
|
|
66860
66877
|
var name2 = "@sjawhar/claude-envoy";
|
|
66861
|
-
var version2 = "6.
|
|
66878
|
+
var version2 = "6.14.0";
|
|
66862
66879
|
var package_default = {
|
|
66863
66880
|
name: name2,
|
|
66864
66881
|
version: version2,
|
package/dist/session-hook.js
CHANGED
|
@@ -18042,6 +18042,11 @@ var COMMENT_ARGUMENT = "Comment id (uuid), or a dispatch://KEY/comment/<id> or "
|
|
|
18042
18042
|
var MESSAGE_ARGUMENT = "Message id (uuid), or a dispatch://KEY/message/<id> reference; a reference accepts an " + "8+ character id prefix that is unique on its owner.";
|
|
18043
18043
|
var ASK_BOUND_RULE = "Dispatch bounds an ask's question and its options together, refuses a longer one and names " + "the bound, and `dispatch limits` prints it. An ask is short and asks one thing; its reasoning " + "goes in the document, not in the question.";
|
|
18044
18044
|
var DISPATCH_HANDOFF_BODY_MAX = 262144;
|
|
18045
|
+
var STEP_RESULTS = ["passed", "failed", "stopped"];
|
|
18046
|
+
var PLANNED_STEP_STATES = ["not started", "running", ...STEP_RESULTS];
|
|
18047
|
+
var STEP_TASK_MAX = 64;
|
|
18048
|
+
var STEP_TASK_PATTERN = new RegExp(`^[a-z0-9][a-z0-9-]{0,${STEP_TASK_MAX - 1}}$`);
|
|
18049
|
+
var STEP_TASK_RULE_WORDS = `lowercase letters, digits and hyphens, starting with a letter or a digit, at most ${STEP_TASK_MAX} bytes`;
|
|
18045
18050
|
var HANDOFF_PHASE_PATTERN = /^[a-z][a-z0-9-]{0,31}$/;
|
|
18046
18051
|
var HANDOFF_PHASE_RULE_WORDS = "a lowercase letter, then up to 31 lowercase letters, digits or hyphens, such as implement";
|
|
18047
18052
|
var HANDOFF_PHASE_RULE = `phase is not a handoff phase: ${HANDOFF_PHASE_RULE_WORDS}`;
|
|
@@ -18897,7 +18902,7 @@ var dispatchToolSpecs = [
|
|
|
18897
18902
|
{
|
|
18898
18903
|
name: "dispatch_steps",
|
|
18899
18904
|
example: { issue: "DSP-1" },
|
|
18900
|
-
description: "Print each step that ran on
|
|
18905
|
+
description: "Print each task of an issue's plan and each step that ran on the issue, as the Legion " + "daemon recorded it at the step's start and at its end, and the experiment and the " + "variant the issue was drawn into, where its records name one. The first line is " + "`<KEY>: <n> steps in <m> tasks`, where m counts each task listed, a task of the plan " + "with no run included. Where the records of the issue's newest run name an experiment, " + "the next line is `Experiment <experiment>: variant <variant>.`, and an issue whose " + "newest run's records name none prints no such line. The tasks of the issue's newest " + "plan come first, in the plan's order, then each other task with a run, in the order " + "each first ran. A task of the plan prints `task <task> needs <needs>: <place> <step> " + "<state>, ...`: needs is the tasks it needs as a list, [a,b], [] where it needs none, " + "and - where its plan node recorded none, then each step the plan gives it, where state " + "is where Dispatch says it stands among the records of the plan's own run: not started, " + "running, or the result of its newest run there. Then each run of a step of the task " + "prints one line: `<task> " + "<step> <kind> <role> <type> attempt <attempt> <agent> <model> <started_at> <ended_at> " + "<result>`. kind is step, retro or merge. step is the step's place in its task, from 1, " + "and 0 for a retro or a merge. attempt counts the runs of the same task, step and kind, " + "from 1. agent is the claim of the role that ran the step, and model is the model that " + "answered it, as provider/model. result is passed, failed or stopped. A field with no " + "value prints -, and a run that has not ended prints running for its end and its result. " + "A closed issue's steps read too. An issue that no step ran on and that has no plan prints " + "0 steps in 0 tasks, and a key Dispatch does not hold fails as dispatch read fails for it, " + `NOT_FOUND: not found. ${ISSUE_REFERENCE}`,
|
|
18901
18906
|
arguments: (z) => ({
|
|
18902
18907
|
issue: z.string().describe(ISSUE_REFERENCE)
|
|
18903
18908
|
}),
|
|
@@ -35894,6 +35899,11 @@ function stepLine(record) {
|
|
|
35894
35899
|
...record.ended_at === null ? ["running", "running"] : [record.ended_at, orDash(record.result)]
|
|
35895
35900
|
].join(" ");
|
|
35896
35901
|
}
|
|
35902
|
+
function taskLine(task, needs, planned) {
|
|
35903
|
+
const states = planned.map((step) => `${step.step} ${step.name} ${step.state}`);
|
|
35904
|
+
const needed = needs === null ? "-" : `[${needs.join(",")}]`;
|
|
35905
|
+
return `task ${task} needs ${needed}: ${states.join(", ")}`;
|
|
35906
|
+
}
|
|
35897
35907
|
function variantLines(records) {
|
|
35898
35908
|
const newest = Math.max(...records.map((record) => record.generation));
|
|
35899
35909
|
const named = records.find((record) => record.generation === newest && record.experiment != null && record.variant != null);
|
|
@@ -35902,13 +35912,20 @@ function variantLines(records) {
|
|
|
35902
35912
|
async function stepsCommand(context) {
|
|
35903
35913
|
const { client, issue } = context;
|
|
35904
35914
|
const read = await client.listSteps(issue());
|
|
35905
|
-
const tasks = (read.tasks ?? []).map((task) => ({ task
|
|
35915
|
+
const tasks = (read.tasks ?? []).map((task) => ({ ...task, steps: task.steps ?? [] }));
|
|
35906
35916
|
const records = tasks.flatMap((task) => task.steps);
|
|
35917
|
+
const lines = tasks.flatMap((task) => {
|
|
35918
|
+
const runs = task.steps.map(stepLine);
|
|
35919
|
+
const planned = task.planned ?? [];
|
|
35920
|
+
if (planned.length === 0)
|
|
35921
|
+
return runs;
|
|
35922
|
+
return [taskLine(task.task, task.needs ?? null, planned), ...runs];
|
|
35923
|
+
});
|
|
35907
35924
|
return {
|
|
35908
35925
|
text: [
|
|
35909
35926
|
`${read.issue}: ${records.length} steps in ${tasks.length} tasks`,
|
|
35910
35927
|
...variantLines(records),
|
|
35911
|
-
...
|
|
35928
|
+
...lines
|
|
35912
35929
|
].join(`
|
|
35913
35930
|
`),
|
|
35914
35931
|
details: { issue: read.issue, tasks }
|
|
@@ -46,8 +46,10 @@ So on a task with no reviewer step and no `acceptance:owner`, such a check holds
|
|
|
46
46
|
|
|
47
47
|
## What Legion refuses
|
|
48
48
|
|
|
49
|
-
`register_plan` answers `409 PLAN_REFUSED` with `reasons: [{task, reason}]`,
|
|
50
|
-
|
|
49
|
+
`register_plan` answers `409 PLAN_REFUSED` with `reasons: [{task, reason}]`, a reason for each cause, its `task` empty for a cause of the whole plan.
|
|
50
|
+
Past the first reasons of one kind, it counts the rest of that kind in one more reason, of the whole plan.
|
|
51
|
+
Give each task block an id of lowercase letters, digits and hyphens, starting with a letter or a digit, at most 64 bytes: Legion refuses any other id, since Dispatch records no step of such a task.
|
|
52
|
+
Fix each reason and give a new version; the next refusal names what is left.
|
|
51
53
|
A reason that ends `This release of Legion does not carry it out yet.` names a plan a later release takes: write it again within the table above.
|
|
52
54
|
|
|
53
55
|
An issue whose experiment's group runs the project's default steps takes no plan: give it none, and it runs the default steps.
|