@plot-pm/board 0.21.0 → 0.22.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/board-server.mjs +200 -192
- package/package.json +1 -1
- package/plot-config.sh +43 -12
- package/plot-dispatch.sh +3 -3
- package/plot-fleet-scan.sh +9 -11
- package/plot-host.sh +754 -390
- package/plot-plan-meta.sh +7 -3
- package/plot-pr-merged.sh +43 -47
- package/plot-tmp.sh +1 -3
package/package.json
CHANGED
package/plot-config.sh
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Plot helper: read a key from the adopting project's `## Plot Config`.
|
|
3
3
|
# Usage: plot-config.sh get <key> [default]
|
|
4
|
+
# plot-config.sh get-raw <key> [default]
|
|
4
5
|
# Output: the configured value, or the default (possibly empty). Exit 0 always
|
|
5
6
|
# for `get` — missing file, missing section, and missing key all fall
|
|
6
7
|
# back to the default so callers can rely on the output unconditionally.
|
|
@@ -19,7 +20,9 @@
|
|
|
19
20
|
# - **Plan directory:** `docs/plans/` (with a backticked value + prose note)
|
|
20
21
|
# - **Branch prefixes:** `idea/` (plans), `feature/`, `bug/` (list + prose)
|
|
21
22
|
# Backticks (markdown decoration) and `(...)` (human prose) are stripped from
|
|
22
|
-
# the value
|
|
23
|
+
# the value, and a comma gains one following space. `get-raw` strips the
|
|
24
|
+
# backticks only, for a key whose value is a pattern — `Shipped code paths`
|
|
25
|
+
# holds an extended regex, where `(` and `,` are syntax. Lines
|
|
23
26
|
# outside the `## Plot Config` section never match (no prose false positives),
|
|
24
27
|
# and neither do HTML-commented example lines.
|
|
25
28
|
#
|
|
@@ -162,6 +165,22 @@
|
|
|
162
165
|
# Hosts plans yes | no (no = refuse plan files)
|
|
163
166
|
# Tracker plot | jira | github-issues | linear (+ URL)
|
|
164
167
|
# (plot = plans in this repo ARE the tracker; absent = same)
|
|
168
|
+
# Sprint owner plot (absent = same as unset)
|
|
169
|
+
# Independent of `Tracker`: who owns /plot-sprint, as
|
|
170
|
+
# opposed to where issues live. Absent, or any value but
|
|
171
|
+
# `plot`, changes nothing — sprints follow `Tracker` alone,
|
|
172
|
+
# same as before this key existed. `Sprint owner: plot`
|
|
173
|
+
# is the one declaration that lets plot own sprints
|
|
174
|
+
# while `Tracker` still names an external tracker for
|
|
175
|
+
# issues (e.g. a Bitbucket repo with Jira tickets).
|
|
176
|
+
# Tracker approved status
|
|
177
|
+
# the status word a plan's issues are set to when the plan
|
|
178
|
+
# reaches Approved, in the tracker's own vocabulary
|
|
179
|
+
# (`Approved`, `In Progress`). Read by plot-issue-status.sh.
|
|
180
|
+
# Absent or empty = Approved writes nothing. Unlike the
|
|
181
|
+
# `plan:*` label `plot-plan-state.sh` writes at every
|
|
182
|
+
# phase including Approved, this status word is optional
|
|
183
|
+
# and Jira-shaped — the two writes are separate paths.
|
|
165
184
|
# Tracker delivered status
|
|
166
185
|
# the status word a plan's issues are set to when the plan
|
|
167
186
|
# reaches Delivered, in the tracker's own vocabulary
|
|
@@ -176,6 +195,10 @@
|
|
|
176
195
|
# the project's own vocabulary (`Bug`, `Task`). Absent or
|
|
177
196
|
# empty = `Task`. The issue opens in the first project
|
|
178
197
|
# `Ticket prefixes` names.
|
|
198
|
+
# Shipped code paths an extended regex over repo-relative paths; a merge
|
|
199
|
+
# that changes a matching path ships code, and reconcile
|
|
200
|
+
# section 22 asks it for a changeset. Read with `get-raw`.
|
|
201
|
+
# Default `^(packages/[^/]+/src/|skills/)`, Plot's layout.
|
|
179
202
|
# Ticket prefixes the tracker project keys this repository's work lives
|
|
180
203
|
# in, comma-separated (`PROJ-A, PROJ-B`). NOT
|
|
181
204
|
# `Branch prefixes`, which sits next to it and holds
|
|
@@ -215,6 +238,15 @@
|
|
|
215
238
|
# Read back by /plot-board-setup to verify auth against
|
|
216
239
|
# the right instance — without it the only runnable
|
|
217
240
|
# check verifies nothing.
|
|
241
|
+
# Default branch job a job path (`<folder>/<job>`) that builds the default
|
|
242
|
+
# branch outside the multibranch job `Jenkins instance`
|
|
243
|
+
# names. Read by `jenkins_sha_runs` only for the
|
|
244
|
+
# repository's own default branch (`git symbolic-ref
|
|
245
|
+
# refs/remotes/origin/HEAD`); every other branch still
|
|
246
|
+
# reads the multibranch job. `PLOT_JENKINS_JOB` overrides
|
|
247
|
+
# it, as it overrides `Jenkins instance`. Absent: the
|
|
248
|
+
# default branch reads the multibranch job like any
|
|
249
|
+
# other branch, unchanged.
|
|
218
250
|
#
|
|
219
251
|
# `Plan template` is a repo-root-relative path to the plan template /plot-idea
|
|
220
252
|
# instantiates; when absent, /plot-idea falls back to the shipped template.
|
|
@@ -228,11 +260,13 @@
|
|
|
228
260
|
|
|
229
261
|
set -uo pipefail
|
|
230
262
|
|
|
231
|
-
cmd="${1:?Usage: plot-config.sh get <key> [default]}"
|
|
232
|
-
key="${2:?Usage: plot-config.sh get <key> [default]}"
|
|
263
|
+
cmd="${1:?Usage: plot-config.sh get|get-raw <key> [default]}"
|
|
264
|
+
key="${2:?Usage: plot-config.sh get|get-raw <key> [default]}"
|
|
233
265
|
default="${3:-}"
|
|
234
266
|
|
|
235
|
-
|
|
267
|
+
# Parenthetical prose, markdown backticks, list separators — in that order.
|
|
268
|
+
prose='s/\([^)]*\)//g; s/`//g; s/[[:space:]]*,[[:space:]]*/, /g;'
|
|
269
|
+
case "$cmd" in get) ;; get-raw) prose='s/`//g;' ;; *) echo "plot-config: unknown subcommand '$cmd' (only 'get' and 'get-raw' are supported)" >&2; exit 1 ;; esac
|
|
236
270
|
|
|
237
271
|
# THE CALLER'S ROOT IS TAKEN WHERE IT OFFERS ONE. `git rev-parse` is ~5 ms and
|
|
238
272
|
# this script runs once per config key, so a caller reading several keys pays
|
|
@@ -266,21 +300,18 @@ if [ -n "$config_file" ]; then
|
|
|
266
300
|
/^##[[:space:]]/ { in_section = (tolower($0) ~ /^##[[:space:]]+plot config[[:space:]]*$/) ; next }
|
|
267
301
|
in_section { print }
|
|
268
302
|
' "$config_file")
|
|
269
|
-
# Value extraction.
|
|
270
|
-
#
|
|
271
|
-
# So we can uniformly treat backticks as markdown decoration and `(...)` as
|
|
272
|
-
# human prose, stripping both. This tolerates real-world config written like
|
|
303
|
+
# Value extraction. `get` treats backticks as markdown decoration and `(...)`
|
|
304
|
+
# as human prose, stripping both, so real-world config written like
|
|
273
305
|
# - **Plan directory:** `docs/plans/` (date-prefixed, never moved)
|
|
274
306
|
# - **Branch prefixes:** `idea/` (plans), `feature/`, `bug/`, `docs/`
|
|
275
|
-
# without truncating multi-value
|
|
307
|
+
# reads without truncating a multi-value list to its first backtick span.
|
|
308
|
+
# `get-raw` strips only the backticks, so a regex keeps its groups and quantifiers.
|
|
276
309
|
value=$(printf '%s\n' "$section" \
|
|
277
310
|
| grep -m1 -iE "^[[:space:]]*[-*]?[[:space:]]*\**${key}[:*]" \
|
|
278
311
|
| sed -E '
|
|
279
312
|
s/^[^:]*:[[:space:]]*//; # drop list marker, bold, "key:"
|
|
280
313
|
s/^\**[[:space:]]*//; # drop leading bold before value
|
|
281
|
-
|
|
282
|
-
s/`//g; # drop markdown backticks
|
|
283
|
-
s/[[:space:]]*,[[:space:]]*/, /g; # normalize list separators
|
|
314
|
+
'"$prose"'
|
|
284
315
|
s/[[:space:]]+/ /g; # collapse internal whitespace
|
|
285
316
|
s/^[[:space:]]+//; s/[[:space:]]+$//') # trim ends
|
|
286
317
|
fi
|
package/plot-dispatch.sh
CHANGED
|
@@ -824,7 +824,7 @@ request_brief() { # $1 = branch, $2 = slug → 0 if a command was started
|
|
|
824
824
|
# being written.
|
|
825
825
|
_brief_settings="$(bash "$(dirname "${BASH_SOURCE[0]}")/plot-agent-settings.sh" 2>/dev/null || echo "")"
|
|
826
826
|
( set -m; cd "$repo_root" \
|
|
827
|
-
&& PLOT_UNATTENDED=1 PLOT_PLAN_SLUG="$bslug" PLOT_BRIEF_BRANCH="$branch" \
|
|
827
|
+
&& PLOT_UNATTENDED=1 PLOT_MAIN_CHECKOUT_WRITER=1 PLOT_PLAN_SLUG="$bslug" PLOT_BRIEF_BRANCH="$branch" \
|
|
828
828
|
PLOT_AGENT_SETTINGS="$_brief_settings" \
|
|
829
829
|
exec nohup sh -c "$cmd \"\$@\"" plot-brief \
|
|
830
830
|
"$(brief_prompt "$branch" "$bslug")" \
|
|
@@ -1555,7 +1555,7 @@ start_worker() {
|
|
|
1555
1555
|
# the export reaches the wrapper and nothing else.
|
|
1556
1556
|
{ [ -n "$capabilities" ] && export PLOT_CAPABILITIES="$capabilities"; true; } && \
|
|
1557
1557
|
PLOT_BRANCH="$branch" PLOT_WORKTREE="$wt" \
|
|
1558
|
-
PLOT_SLUG="$slug" \
|
|
1558
|
+
PLOT_SLUG="$slug" PLOT_MAIN_CHECKOUT_WRITER= \
|
|
1559
1559
|
PLOT_SESSION_ID="$session" \
|
|
1560
1560
|
PLOT_AGENT="${PLOT_AGENT:-}" \
|
|
1561
1561
|
PLOT_HARNESS="$launch_harness" \
|
|
@@ -2563,7 +2563,7 @@ if [ "$mode" = "start" ]; then
|
|
|
2563
2563
|
if [ -n "${PLOT_START_DESK:-}" ]; then
|
|
2564
2564
|
start_wt="$PLOT_START_DESK"
|
|
2565
2565
|
else
|
|
2566
|
-
start_wt="$wt_root/${wt_prefix}
|
|
2566
|
+
start_wt="$wt_root/${wt_prefix}desk-$(plot_session_id | cut -c1-8)"
|
|
2567
2567
|
fi
|
|
2568
2568
|
if [ -e "$start_wt" ]; then
|
|
2569
2569
|
echo " skipped $start_wt — a desk of that name already exists"
|
package/plot-fleet-scan.sh
CHANGED
|
@@ -261,14 +261,7 @@ script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
|
261
261
|
. "$script_dir/plot-tmp.sh"
|
|
262
262
|
cfg() { "$script_dir/plot-config.sh" get "$1" "${2:-}"; }
|
|
263
263
|
|
|
264
|
-
do_fetch=1
|
|
265
|
-
next_only=0
|
|
266
|
-
list_all=0
|
|
267
|
-
why_nothing=0
|
|
268
|
-
slice_names=0
|
|
269
|
-
loose=0
|
|
270
|
-
log_pulse=0
|
|
271
|
-
as_json=0
|
|
264
|
+
do_fetch=1; next_only=0; list_all=0; why_nothing=0; slice_names=0; loose=0; log_pulse=0; as_json=0
|
|
272
265
|
# Whether the JSON document is ASSEMBLED, which is not the same question as
|
|
273
266
|
# whether it is PRINTED. `--json`/`--stream` need it to print; `--log-pulse`
|
|
274
267
|
# needs it to write the bridge and prints prose. Measured 2026-09-06 on this
|
|
@@ -954,12 +947,14 @@ EOF
|
|
|
954
947
|
# REPORTED ONLY WHERE THE LISTING ARRIVED. A failed or throttled call writes no
|
|
955
948
|
# `.list-arrived`, and carrying its empty cache forward would turn one refusal
|
|
956
949
|
# into a listing the next pulse trusts.
|
|
950
|
+
#
|
|
951
|
+
# `.list-arrived` IS THE LAST LINE. A scan killed while it prints the rows has
|
|
952
|
+
# printed no `.list-arrived`, so `carried_listing` refuses the partial listing,
|
|
953
|
+
# and `scanOnce` adopts a killed scan's listing only where `.list-arrived` is
|
|
954
|
+
# its last line.
|
|
957
955
|
report_listing() {
|
|
958
956
|
[ -n "$HOST_STATE_CACHE" ] || return 0
|
|
959
957
|
[ -f "$HOST_STATE_CACHE/.list-arrived" ] || return 0
|
|
960
|
-
printf 'listing: %s\t%s\t%s\t%s\n' .list-arrived 1 - - >&2
|
|
961
|
-
[ -f "$HOST_STATE_CACHE/.list-complete" ] \
|
|
962
|
-
&& printf 'listing: %s\t%s\t%s\t%s\n' .list-complete 1 - - >&2
|
|
963
958
|
# WHAT THE LISTING COST, MEASURED RATHER THAN MODELLED. The Bitbucket arm sweeps
|
|
964
959
|
# one request per tracked branch per state, and this scan is the only thing that
|
|
965
960
|
# knows how many branches it tracked. A board predicting the number from the
|
|
@@ -986,6 +981,9 @@ EOF
|
|
|
986
981
|
# sentinel the host payload's plain rows already use.
|
|
987
982
|
printf 'listing: %s\t%s\t%s\t%s\n' "$key" "$_st" "${_chk:--}" "${_dft:--}" >&2
|
|
988
983
|
done
|
|
984
|
+
[ -f "$HOST_STATE_CACHE/.list-complete" ] \
|
|
985
|
+
&& printf 'listing: %s\t%s\t%s\t%s\n' .list-complete 1 - - >&2
|
|
986
|
+
printf 'listing: %s\t%s\t%s\t%s\n' .list-arrived 1 - - >&2
|
|
989
987
|
}
|
|
990
988
|
|
|
991
989
|
prefill_pr_states() {
|