@mmerterden/multi-agent-pipeline 24.0.0 → 24.1.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/CHANGELOG.md +22 -0
- package/README.md +2 -0
- package/README.tr.md +2 -0
- package/docs/facts.json +2 -2
- package/docs/features.md +8 -0
- package/install/_dev-only-files.mjs +1 -0
- package/manifest.json +43 -42
- package/package.json +4 -2
- package/pipeline/commands/multi-agent/SKILL.md +1 -1
- package/pipeline/commands/multi-agent/analysis/SKILL.md +1 -1
- package/pipeline/contract/CHANGELOG.md +15 -0
- package/pipeline/contract/fixtures/error-invalid-request.json +1 -1
- package/pipeline/contract/fixtures/error-unauthorized.json +1 -1
- package/pipeline/contract/fixtures/runs-awaiting-question.json +6 -1
- package/pipeline/contract/fixtures/runs-empty.json +1 -1
- package/pipeline/contract/fixtures/runs-failed.json +21 -1
- package/pipeline/contract/fixtures/runs-old-schema.json +18 -3
- package/pipeline/contract/fixtures/runs-pr-opened-redacted.json +31 -1
- package/pipeline/contract/fixtures/runs-pr-opened.json +31 -1
- package/pipeline/contract/fixtures/runs-running.json +16 -1
- package/pipeline/contract/manifest.json +13 -13
- package/pipeline/contract/types/index.d.ts +19 -1
- package/pipeline/multi-agent-refs/analysis/render.md +12 -1
- package/pipeline/multi-agent-refs/help/en.md +10 -2
- package/pipeline/multi-agent-refs/help/tr.md +8 -2
- package/pipeline/multi-agent-refs/phases/phase-0-init.md +1 -0
- package/pipeline/multi-agent-refs/phases/phase-4-commit.md +1 -0
- package/pipeline/multi-agent-refs/phases/phase-5-report.md +1 -1
- package/pipeline/multi-agent-refs/tracker-contract.md +36 -10
- package/pipeline/office/index.html +75 -2
- package/pipeline/schemas/activity.schema.json +63 -4
- package/pipeline/schemas/now-lines.json +103 -0
- package/pipeline/schemas/now-lines.schema.json +42 -0
- package/pipeline/schemas/runs-index.schema.json +22 -1
- package/pipeline/scripts/_contract-core.mjs +1 -1
- package/pipeline/scripts/activity-snapshot.mjs +27 -1
- package/pipeline/scripts/phase-tracker.sh +80 -12
- package/pipeline/scripts/render-work-summary.sh +51 -1
- package/pipeline/scripts/runs-index.mjs +2 -1
- package/pipeline/skills/.skill-manifest.json +1 -1
- package/pipeline/scripts/.doctor-mut.47076.mjs +0 -2253
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "now-lines.schema.json",
|
|
4
|
+
"title": "Current-action lines",
|
|
5
|
+
"description": "The canonical lines a run writes with `phase-tracker.sh now`, one set per phase. The tracker caps each at `cap` characters after runtime values are substituted, so a template is already too long when it exceeds the cap empty. lint-now-lines.mjs holds this file and the phase docs to each other.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"additionalProperties": false,
|
|
8
|
+
"required": ["cap", "phases"],
|
|
9
|
+
"properties": {
|
|
10
|
+
"$comment": { "type": "string" },
|
|
11
|
+
"cap": {
|
|
12
|
+
"type": "integer",
|
|
13
|
+
"minimum": 20,
|
|
14
|
+
"maximum": 200,
|
|
15
|
+
"description": "Characters the tracker keeps. Beyond it the line is cut, so a longer template loses its end rather than being refused."
|
|
16
|
+
},
|
|
17
|
+
"phases": {
|
|
18
|
+
"type": "object",
|
|
19
|
+
"minProperties": 1,
|
|
20
|
+
"description": "Keyed by the phase id as a string, matching schemas/phases.json.",
|
|
21
|
+
"propertyNames": { "pattern": "^[0-9]+$" },
|
|
22
|
+
"additionalProperties": {
|
|
23
|
+
"type": "object",
|
|
24
|
+
"additionalProperties": false,
|
|
25
|
+
"required": ["name", "lines"],
|
|
26
|
+
"properties": {
|
|
27
|
+
"name": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"minLength": 1,
|
|
30
|
+
"description": "The phase's name, which must be the one phases.json gives it."
|
|
31
|
+
},
|
|
32
|
+
"lines": {
|
|
33
|
+
"type": "array",
|
|
34
|
+
"minItems": 1,
|
|
35
|
+
"description": "What this phase says it is doing. Angle brackets mark a runtime value.",
|
|
36
|
+
"items": { "type": "string", "minLength": 1 }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -379,7 +379,8 @@
|
|
|
379
379
|
"completedAt",
|
|
380
380
|
"now",
|
|
381
381
|
"subs",
|
|
382
|
-
"subList"
|
|
382
|
+
"subList",
|
|
383
|
+
"tokens"
|
|
383
384
|
],
|
|
384
385
|
"properties": {
|
|
385
386
|
"id": {
|
|
@@ -437,6 +438,26 @@
|
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
},
|
|
441
|
+
"tokens": {
|
|
442
|
+
"type": "object",
|
|
443
|
+
"required": ["in", "out", "cached"],
|
|
444
|
+
"x-sensitivity": "none",
|
|
445
|
+
"description": "What this one phase spent, from its own tracker counters. The run's total is the `tokens` beside it on the run record. Added in 1.6.0.",
|
|
446
|
+
"properties": {
|
|
447
|
+
"in": {
|
|
448
|
+
"type": "integer",
|
|
449
|
+
"minimum": 0
|
|
450
|
+
},
|
|
451
|
+
"out": {
|
|
452
|
+
"type": "integer",
|
|
453
|
+
"minimum": 0
|
|
454
|
+
},
|
|
455
|
+
"cached": {
|
|
456
|
+
"type": "integer",
|
|
457
|
+
"minimum": 0
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
},
|
|
440
461
|
"progress": {
|
|
441
462
|
"type": ["number", "null"],
|
|
442
463
|
"minimum": 0,
|
|
@@ -21,7 +21,7 @@ import { launchRepoAllowed, launchRepos } from "./launch-request.mjs";
|
|
|
21
21
|
import { selectRuns } from "./runs-index.mjs";
|
|
22
22
|
|
|
23
23
|
/** The contract as a whole; pipeline/contract/manifest.json carries the same. */
|
|
24
|
-
export const CONTRACT_VERSION = "2.
|
|
24
|
+
export const CONTRACT_VERSION = "2.4.0";
|
|
25
25
|
/** Confirm tokens held at once; the oldest is dropped past this. */
|
|
26
26
|
export const MAX_CONFIRMS = 256;
|
|
27
27
|
/** How long a kill or gc confirm token stays valid. */
|
|
@@ -84,7 +84,7 @@ import { ArgsError, parseArgs as parseArgv } from "../lib/args.mjs";
|
|
|
84
84
|
|
|
85
85
|
exitOnHelp(import.meta.url);
|
|
86
86
|
|
|
87
|
-
export const CONTRACT_VERSION = "1.
|
|
87
|
+
export const CONTRACT_VERSION = "1.5.0";
|
|
88
88
|
export const RECENT_MS = 10 * 60_000;
|
|
89
89
|
|
|
90
90
|
export const ROLES = JSON.parse(
|
|
@@ -875,6 +875,9 @@ const MAX_TASKS = 20;
|
|
|
875
875
|
const TASK_STATES = new Set(["pending", "in_progress", "completed"]);
|
|
876
876
|
const fraction = (v) =>
|
|
877
877
|
typeof v === "number" && v >= 0 && v <= 1 ? Math.round(v * 100) / 100 : null;
|
|
878
|
+
// runs-index keeps `subs` as the count an older reader already decodes and the
|
|
879
|
+
// steps themselves as `subList`, so the list is read from there.
|
|
880
|
+
const subRows = (p) => (Array.isArray(p?.subList) ? p.subList : []);
|
|
878
881
|
// The command a table runs, named the way a user types it.
|
|
879
882
|
// The commands installed beside this script; a mode with no command of its
|
|
880
883
|
// own (dev, short, dev-local) is a /multi-agent run.
|
|
@@ -1026,10 +1029,33 @@ function renderTable(team, clean, now) {
|
|
|
1026
1029
|
name: phaseRow?.name || phaseName(runType, shownPhase),
|
|
1027
1030
|
last: LAST_PHASE,
|
|
1028
1031
|
},
|
|
1032
|
+
// The office shows what the terminal surfaces show, from the same record:
|
|
1033
|
+
// which model is spending, what the phase is doing right now, and how far
|
|
1034
|
+
// through its own steps it is. Without these the page can only name the
|
|
1035
|
+
// phase, which is the one thing a reader already knows.
|
|
1029
1036
|
phaseHistory: phases.map((p) => ({
|
|
1030
1037
|
id: Number.isFinite(Number(p.id)) ? Number(p.id) : null,
|
|
1031
1038
|
name: clean(p.name, 60) ?? "",
|
|
1032
1039
|
status: String(p.status ?? "pending"),
|
|
1040
|
+
model: clean(p.model, 40) ?? null,
|
|
1041
|
+
// Only a phase that is working, or stopped where it was working, has a
|
|
1042
|
+
// current action; on any other status it would describe a past moment.
|
|
1043
|
+
// Falling back to the step in progress keeps the card from going blank
|
|
1044
|
+
// on a phase that moved without writing a line.
|
|
1045
|
+
now:
|
|
1046
|
+
p.status === "in_progress" || p.status === "failed"
|
|
1047
|
+
? (clean(p.now, 60) ??
|
|
1048
|
+
clean(subRows(p).find((x) => x?.status === "in_progress")?.name, 60) ??
|
|
1049
|
+
null)
|
|
1050
|
+
: null,
|
|
1051
|
+
tokens: Number(p.tokens?.in ?? 0) + Number(p.tokens?.out ?? 0) || null,
|
|
1052
|
+
subs: subRows(p)
|
|
1053
|
+
.slice(0, MAX_TASKS)
|
|
1054
|
+
.map((sb) => ({
|
|
1055
|
+
id: clean(String(sb?.id ?? ""), 12) ?? "",
|
|
1056
|
+
name: clean(sb?.name, 60) ?? "",
|
|
1057
|
+
status: TASK_STATES.has(sb?.status) ? sb.status : "pending",
|
|
1058
|
+
})),
|
|
1033
1059
|
startedAt: p.startedAt ?? null,
|
|
1034
1060
|
completedAt: p.completedAt ?? null,
|
|
1035
1061
|
progress: fraction(p.progress),
|
|
@@ -918,6 +918,48 @@ EOF
|
|
|
918
918
|
# Every segment is omitted while it is empty, so a pending phase is just its name
|
|
919
919
|
# and a finished one carries its whole bill. Separator is ` - `, not a middle dot:
|
|
920
920
|
# a subject is a task title and travels through surfaces that are not a terminal.
|
|
921
|
+
# A task subject is a title: it travels through surfaces that are not a terminal
|
|
922
|
+
# and a host truncates it where it likes, so the length is ours to decide. The
|
|
923
|
+
# action is the only segment that grows without a bound, so it is last and it is
|
|
924
|
+
# the one that gets shortened; the phase, its elapsed time and its step counter
|
|
925
|
+
# are what a reader scans for and never drop.
|
|
926
|
+
#
|
|
927
|
+
# Order of sacrifice when the line is too long: the cost, which comes back when
|
|
928
|
+
# the phase completes; then the action, down to a floor below which it says
|
|
929
|
+
# nothing; then the tokens; then the model.
|
|
930
|
+
SUBJECT_MAX=96
|
|
931
|
+
SUBJECT_ACTION_FLOOR=24
|
|
932
|
+
|
|
933
|
+
# Each segment arrives on its own so the drop order is the code rather than a
|
|
934
|
+
# claim about it: nothing has to be parsed back out of an assembled line.
|
|
935
|
+
compose_subject() {
|
|
936
|
+
local phase="$1" model="$2" elapsed="$3" tok="$4" cost="$5" step="$6" act="$7" line
|
|
937
|
+
_subject_fits() { line="$phase$model$elapsed$tok$cost$step$act"; [ "${#line}" -le "$SUBJECT_MAX" ]; }
|
|
938
|
+
|
|
939
|
+
_subject_fits && { printf '%s' "$line"; return 0; }
|
|
940
|
+
cost=""
|
|
941
|
+
_subject_fits && { printf '%s' "$line"; return 0; }
|
|
942
|
+
|
|
943
|
+
if [ -n "$act" ]; then
|
|
944
|
+
local room=$(( SUBJECT_MAX - ${#phase} - ${#model} - ${#elapsed} - ${#tok} - ${#step} - 6 ))
|
|
945
|
+
if [ "$room" -ge "$SUBJECT_ACTION_FLOOR" ]; then
|
|
946
|
+
act=" - ${act:3:$room}..."
|
|
947
|
+
_subject_fits && { printf '%s' "$line"; return 0; }
|
|
948
|
+
fi
|
|
949
|
+
fi
|
|
950
|
+
|
|
951
|
+
tok=""
|
|
952
|
+
_subject_fits && { printf '%s' "$line"; return 0; }
|
|
953
|
+
|
|
954
|
+
# The model is the last to go: without it a reader cannot tell what is
|
|
955
|
+
# spending, and by this point the action has already been cut to its floor.
|
|
956
|
+
# The phase, its elapsed time and its counter stay, which is what the order
|
|
957
|
+
# above promises.
|
|
958
|
+
model=""
|
|
959
|
+
_subject_fits && { printf '%s' "$line"; return 0; }
|
|
960
|
+
printf '%s' "$line"
|
|
961
|
+
}
|
|
962
|
+
|
|
921
963
|
subjects() {
|
|
922
964
|
need_jq
|
|
923
965
|
local state want="${1:-}" new_only=""
|
|
@@ -946,17 +988,20 @@ subjects() {
|
|
|
946
988
|
(.id // ""), (.name // ""), (.status // ""),
|
|
947
989
|
(.started_at // ""), (.completed_at // ""), (.model // ""),
|
|
948
990
|
(((.tokens_in // 0) + (.tokens_out // 0)) | tostring),
|
|
949
|
-
(usd_of(.) | if . == null then "" else (((. * 100) | floor) / 100 | tostring) end)
|
|
991
|
+
(usd_of(.) | if . == null then "" else (((. * 100) | floor) / 100 | tostring) end),
|
|
992
|
+
([.subs[]? | select(.status == "completed")] | length | tostring),
|
|
993
|
+
([.subs[]?] | length | tostring),
|
|
994
|
+
(. as $p | ($p.meta.Now // "") | if . == "" then ([$p.subs[]? | select(.status == "in_progress") | .name] | first // "") else . end)
|
|
950
995
|
] | join("\u001f")')
|
|
951
|
-
local pid pname pstatus p_start p_end pmodel ptok pusd
|
|
952
|
-
while IFS=$'\x1f' read -r pid pname pstatus p_start p_end pmodel ptok pusd; do
|
|
996
|
+
local pid pname pstatus p_start p_end pmodel ptok pusd pdone ptotal paction
|
|
997
|
+
while IFS=$'\x1f' read -r pid pname pstatus p_start p_end pmodel ptok pusd pdone ptotal paction; do
|
|
953
998
|
[ -n "$pid" ] || continue
|
|
954
999
|
[ -z "$want" ] || [ "$want" = "$pid" ] || continue
|
|
955
1000
|
if [ -n "$new_only" ]; then
|
|
956
1001
|
case "$new_ids" in *" $pid "*) ;; *) continue ;; esac
|
|
957
1002
|
fi
|
|
958
|
-
local
|
|
959
|
-
[ -n "$pmodel" ] &&
|
|
1003
|
+
local seg_phase="Phase $pid $pname" seg_model=""
|
|
1004
|
+
[ -n "$pmodel" ] && seg_model=" - $pmodel"
|
|
960
1005
|
local s_ep e_ep el=""
|
|
961
1006
|
s_ep=$(iso_to_epoch "$p_start")
|
|
962
1007
|
e_ep=$(iso_to_epoch "$p_end")
|
|
@@ -967,11 +1012,26 @@ subjects() {
|
|
|
967
1012
|
esac
|
|
968
1013
|
fi
|
|
969
1014
|
if [ -n "$el" ] && [ "$el" -lt 0 ] 2>/dev/null; then el=0; fi
|
|
970
|
-
|
|
1015
|
+
local seg_el=""
|
|
1016
|
+
[ -n "$el" ] && seg_el=" - $(format_elapsed "$el")"
|
|
1017
|
+
local seg_tok="" seg_cost=""
|
|
971
1018
|
if [ "${ptok:-0}" -gt 0 ] 2>/dev/null; then
|
|
972
|
-
|
|
973
|
-
[ -n "$pusd" ] &&
|
|
1019
|
+
seg_tok=" - $(format_tokens "$ptok") tok"
|
|
1020
|
+
[ -n "$pusd" ] && seg_cost=" - $(printf '~$%.2f' "$pusd" 2>/dev/null || echo '')"
|
|
974
1021
|
fi
|
|
1022
|
+
# The counter and the action belong to a phase that is running or stopped in
|
|
1023
|
+
# place. On a finished phase they would describe a moment that has passed,
|
|
1024
|
+
# and on a pending one there is nothing to describe.
|
|
1025
|
+
local seg_step="" seg_act=""
|
|
1026
|
+
case "$pstatus" in
|
|
1027
|
+
in_progress|failed)
|
|
1028
|
+
[ "${ptotal:-0}" -gt 0 ] 2>/dev/null && seg_step=" - step ${pdone:-0}/${ptotal}"
|
|
1029
|
+
[ -n "$paction" ] && seg_act=" - $paction"
|
|
1030
|
+
;;
|
|
1031
|
+
esac
|
|
1032
|
+
local line
|
|
1033
|
+
line=$(compose_subject "$seg_phase" "$seg_model" "$seg_el" \
|
|
1034
|
+
"$seg_tok" "$seg_cost" "$seg_step" "$seg_act")
|
|
975
1035
|
printf '%s\n' "$line"
|
|
976
1036
|
|
|
977
1037
|
# Sub-phases ride out on the SAME list, indented in the subject string.
|
|
@@ -1173,20 +1233,21 @@ render() {
|
|
|
1173
1233
|
((.tokens_out // 0) | tostring),
|
|
1174
1234
|
((.subs // []) | length | tostring),
|
|
1175
1235
|
((.meta // {}) | keys_unsorted | join(",")),
|
|
1236
|
+
(.model // ""),
|
|
1176
1237
|
(usd_of(.) | if . == null then "" else (((. * 100) | floor) / 100 | tostring) end)
|
|
1177
1238
|
] | join("")
|
|
1178
1239
|
')
|
|
1179
1240
|
|
|
1180
1241
|
local phase_count=0
|
|
1181
1242
|
local -a row_status=() row_started=() row_completed=() row_id=() row_name=()
|
|
1182
|
-
local -a row_tin=() row_tout=() row_subcount=() row_metakeys=() row_usd=()
|
|
1243
|
+
local -a row_tin=() row_tout=() row_subcount=() row_metakeys=() row_usd=() row_model=()
|
|
1183
1244
|
if [ -n "$phase_data" ]; then
|
|
1184
|
-
local _s _st _ed _id _nm _ti _to _sc _mk _us
|
|
1185
|
-
while IFS=$'\x1f' read -r _s _st _ed _id _nm _ti _to _sc _mk _us; do
|
|
1245
|
+
local _s _st _ed _id _nm _ti _to _sc _mk _md _us
|
|
1246
|
+
while IFS=$'\x1f' read -r _s _st _ed _id _nm _ti _to _sc _mk _md _us; do
|
|
1186
1247
|
row_status+=("$_s"); row_started+=("$_st"); row_completed+=("$_ed")
|
|
1187
1248
|
row_id+=("$_id"); row_name+=("$_nm")
|
|
1188
1249
|
row_tin+=("$_ti"); row_tout+=("$_to")
|
|
1189
|
-
row_subcount+=("$_sc"); row_metakeys+=("$_mk"); row_usd+=("$_us")
|
|
1250
|
+
row_subcount+=("$_sc"); row_metakeys+=("$_mk"); row_usd+=("$_us"); row_model+=("$_md")
|
|
1190
1251
|
phase_count=$((phase_count + 1))
|
|
1191
1252
|
done <<< "$phase_data"
|
|
1192
1253
|
fi
|
|
@@ -1266,6 +1327,13 @@ render() {
|
|
|
1266
1327
|
fi
|
|
1267
1328
|
[ -n "$usd_label" ] && [ -n "$tok_label" ] && tok_label="${tok_label} · ${usd_label}"
|
|
1268
1329
|
|
|
1330
|
+
# The model belongs beside the bill it explains: a phase's cost means
|
|
1331
|
+
# nothing without knowing which model spent it, and on the card there is
|
|
1332
|
+
# room to say so plainly.
|
|
1333
|
+
local p_model="${row_model[$i]}"
|
|
1334
|
+
[ -n "$p_model" ] && [ -n "$tok_label" ] && tok_label="${p_model} · ${tok_label}"
|
|
1335
|
+
[ -n "$p_model" ] && [ -z "$tok_label" ] && tok_label="$p_model"
|
|
1336
|
+
|
|
1269
1337
|
local right_block=""
|
|
1270
1338
|
if [ -n "$el_label" ] && [ -n "$tok_label" ]; then
|
|
1271
1339
|
right_block=$(printf "%b%s%b ${C_DIM}·${C_RESET} %b%s%b" "$el_color" "$el_label" "$C_RESET" "$C_DIM" "$tok_label" "$C_RESET")
|
|
@@ -9,7 +9,13 @@
|
|
|
9
9
|
# changed?" without parsing the full pipeline log.
|
|
10
10
|
#
|
|
11
11
|
# Usage:
|
|
12
|
-
# render-work-summary.sh <task-id> [--
|
|
12
|
+
# render-work-summary.sh <task-id> [--format markdown|terminal]
|
|
13
|
+
# [--worktree <path>] [--branch <name>]
|
|
14
|
+
#
|
|
15
|
+
# `markdown` (the default) is the block a channel carries: a Jira comment, a
|
|
16
|
+
# Confluence page, a pull request body. `terminal` is the same facts for the
|
|
17
|
+
# person who just watched the run: no markup, one screen, and it names what is
|
|
18
|
+
# left for them. The two render from one collection, so they cannot disagree.
|
|
13
19
|
# [--base-branch <name>]
|
|
14
20
|
#
|
|
15
21
|
# Source of truth precedence:
|
|
@@ -55,6 +61,7 @@ need_value() { [ $# -ge 2 ] || { echo "render-work-summary: $1 needs a value" >&
|
|
|
55
61
|
|
|
56
62
|
while [ $# -gt 0 ]; do
|
|
57
63
|
case "$1" in
|
|
64
|
+
--format) need_value "$@"; FORMAT="$2"; shift 2 ;;
|
|
58
65
|
--worktree) need_value "$@"; WORKTREE="$2"; shift 2 ;;
|
|
59
66
|
--branch) need_value "$@"; BRANCH="$2"; shift 2 ;;
|
|
60
67
|
--base-branch) need_value "$@"; BASE="$2"; shift 2 ;;
|
|
@@ -264,6 +271,49 @@ rejected=$(jq -r '.rejected // [] | length' <<< "$state_triage" 2>/dev/null || e
|
|
|
264
271
|
approved=$(jq -r '.approved // false' <<< "$state_triage" 2>/dev/null || echo false)
|
|
265
272
|
|
|
266
273
|
# ─── Render ────────────────────────────────────────────────────────
|
|
274
|
+
if [ "${FORMAT:-markdown}" = "terminal" ]; then
|
|
275
|
+
# Plain text, because this is read where it is printed. The order answers the
|
|
276
|
+
# three questions a person has when a run stops: what changed, was it checked,
|
|
277
|
+
# and is anything waiting on me.
|
|
278
|
+
line="${state_jira:-this run}"
|
|
279
|
+
[ -n "$state_branch" ] && line="$line on $state_branch"
|
|
280
|
+
printf '%s\n\n' "$line"
|
|
281
|
+
|
|
282
|
+
if [ -n "$tasks_block" ]; then
|
|
283
|
+
printf 'What changed\n'
|
|
284
|
+
printf '%s\n' "$tasks_block" | sed 's/^/ /'
|
|
285
|
+
fi
|
|
286
|
+
if [ "$files_count" -gt 0 ]; then
|
|
287
|
+
printf ' %d file(s) changed (+%d / -%d)\n' "$files_count" "$total_add" "$total_del"
|
|
288
|
+
fi
|
|
289
|
+
printf '\n'
|
|
290
|
+
|
|
291
|
+
if [ "$accepted" != "0" ] || [ "$deferred" != "0" ] || [ "$rejected" != "0" ]; then
|
|
292
|
+
printf 'Checked\n review: %s accepted, %s deferred, %s rejected\n\n' \
|
|
293
|
+
"$accepted" "$deferred" "$rejected"
|
|
294
|
+
fi
|
|
295
|
+
|
|
296
|
+
# The file counts come from `base...tip`, so a non-zero count means the work
|
|
297
|
+
# is committed. Saying "nothing published" there would be false on the
|
|
298
|
+
# commit-straight-to-branch path, which is a configured way to run.
|
|
299
|
+
printf 'Delivered\n'
|
|
300
|
+
if [ -n "$state_pr" ] && [ "$state_pr" != "null" ]; then
|
|
301
|
+
printf ' pull request %s\n' "$state_pr"
|
|
302
|
+
elif [ "$files_count" -gt 0 ] && [ -n "$state_branch" ]; then
|
|
303
|
+
printf ' committed on %s, no pull request\n' "$state_branch"
|
|
304
|
+
else
|
|
305
|
+
printf ' nothing published\n'
|
|
306
|
+
fi
|
|
307
|
+
printf '\n'
|
|
308
|
+
|
|
309
|
+
# Deferred findings are the one thing a reader has to act on, so they are
|
|
310
|
+
# last and they are named rather than counted away.
|
|
311
|
+
if [ "${deferred:-0}" != "0" ]; then
|
|
312
|
+
printf 'Left for you\n %s deferred finding(s)\n' "$deferred"
|
|
313
|
+
fi
|
|
314
|
+
exit 0
|
|
315
|
+
fi
|
|
316
|
+
|
|
267
317
|
printf '### Work Summary\n'
|
|
268
318
|
|
|
269
319
|
header="**Task**: \`$state_jira\`"
|
|
@@ -82,7 +82,7 @@ const PHASE_WAITING_FROM = PHASE_CONTRACT.thresholds.waitingFromPhase;
|
|
|
82
82
|
*/
|
|
83
83
|
const LAST_PHASE = PHASE_CONTRACT.phases[PHASE_CONTRACT.phases.length - 1].id;
|
|
84
84
|
|
|
85
|
-
export const CONTRACT_VERSION = "1.
|
|
85
|
+
export const CONTRACT_VERSION = "1.6.0";
|
|
86
86
|
|
|
87
87
|
const STATE_MAX_BYTES = 16 * 1024 * 1024;
|
|
88
88
|
|
|
@@ -378,6 +378,7 @@ function summarisePhases(tracker) {
|
|
|
378
378
|
status: sub?.status ?? "pending",
|
|
379
379
|
}))
|
|
380
380
|
: [],
|
|
381
|
+
tokens: { in: tin, out: tout, cached: tcached },
|
|
381
382
|
progress: phaseProgress(status, tasks),
|
|
382
383
|
tasks,
|
|
383
384
|
};
|