shipwright-cli 3.1.0 → 3.2.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/README.md +21 -7
- package/config/defaults.json +25 -2
- package/config/policy.json +1 -1
- package/dashboard/public/index.html +6 -0
- package/dashboard/public/styles.css +76 -0
- package/dashboard/server.ts +51 -0
- package/dashboard/src/core/api.ts +5 -0
- package/dashboard/src/types/api.ts +10 -0
- package/dashboard/src/views/metrics.ts +69 -1
- package/package.json +1 -1
- package/scripts/lib/daemon-adaptive.sh +4 -2
- package/scripts/lib/daemon-patrol.sh +2 -2
- package/scripts/lib/daemon-state.sh +7 -0
- package/scripts/lib/helpers.sh +3 -1
- package/scripts/lib/pipeline-detection.sh +1 -1
- package/scripts/lib/pipeline-intelligence.sh +5 -3
- package/scripts/lib/pipeline-quality-checks.sh +8 -4
- package/scripts/lib/pipeline-stages.sh +132 -2
- package/scripts/sw +1 -1
- package/scripts/sw-activity.sh +1 -7
- package/scripts/sw-adaptive.sh +7 -7
- package/scripts/sw-adversarial.sh +1 -1
- package/scripts/sw-architecture-enforcer.sh +1 -1
- package/scripts/sw-auth.sh +1 -1
- package/scripts/sw-autonomous.sh +1 -1
- package/scripts/sw-changelog.sh +1 -1
- package/scripts/sw-checkpoint.sh +1 -1
- package/scripts/sw-ci.sh +11 -6
- package/scripts/sw-cleanup.sh +1 -1
- package/scripts/sw-code-review.sh +36 -17
- package/scripts/sw-connect.sh +1 -1
- package/scripts/sw-context.sh +1 -1
- package/scripts/sw-cost.sh +60 -3
- package/scripts/sw-daemon.sh +5 -2
- package/scripts/sw-dashboard.sh +1 -1
- package/scripts/sw-db.sh +13 -5
- package/scripts/sw-decide.sh +1 -1
- package/scripts/sw-decompose.sh +1 -1
- package/scripts/sw-deps.sh +1 -1
- package/scripts/sw-developer-simulation.sh +1 -1
- package/scripts/sw-discovery.sh +54 -4
- package/scripts/sw-doc-fleet.sh +1 -1
- package/scripts/sw-docs-agent.sh +1 -1
- package/scripts/sw-docs.sh +1 -1
- package/scripts/sw-doctor.sh +1 -1
- package/scripts/sw-dora.sh +1 -1
- package/scripts/sw-durable.sh +9 -5
- package/scripts/sw-e2e-orchestrator.sh +1 -1
- package/scripts/sw-eventbus.sh +7 -4
- package/scripts/sw-evidence.sh +1 -1
- package/scripts/sw-feedback.sh +1 -1
- package/scripts/sw-fix.sh +1 -1
- package/scripts/sw-fleet-discover.sh +1 -1
- package/scripts/sw-fleet-viz.sh +6 -4
- package/scripts/sw-fleet.sh +1 -1
- package/scripts/sw-github-app.sh +3 -2
- package/scripts/sw-github-checks.sh +1 -1
- package/scripts/sw-github-deploy.sh +1 -1
- package/scripts/sw-github-graphql.sh +1 -1
- package/scripts/sw-guild.sh +1 -1
- package/scripts/sw-heartbeat.sh +1 -1
- package/scripts/sw-hygiene.sh +5 -3
- package/scripts/sw-incident.sh +9 -5
- package/scripts/sw-init.sh +1 -1
- package/scripts/sw-instrument.sh +1 -1
- package/scripts/sw-intelligence.sh +3 -2
- package/scripts/sw-jira.sh +1 -1
- package/scripts/sw-launchd.sh +1 -1
- package/scripts/sw-linear.sh +1 -1
- package/scripts/sw-logs.sh +1 -1
- package/scripts/sw-loop.sh +72 -16
- package/scripts/sw-memory.sh +2 -2
- package/scripts/sw-mission-control.sh +1 -1
- package/scripts/sw-model-router.sh +3 -2
- package/scripts/sw-otel.sh +4 -2
- package/scripts/sw-oversight.sh +1 -1
- package/scripts/sw-pipeline-composer.sh +3 -1
- package/scripts/sw-pipeline-vitals.sh +11 -6
- package/scripts/sw-pipeline.sh +20 -8
- package/scripts/sw-pm.sh +5 -4
- package/scripts/sw-pr-lifecycle.sh +1 -1
- package/scripts/sw-predictive.sh +11 -5
- package/scripts/sw-prep.sh +1 -1
- package/scripts/sw-ps.sh +1 -1
- package/scripts/sw-public-dashboard.sh +3 -2
- package/scripts/sw-quality.sh +13 -6
- package/scripts/sw-reaper.sh +1 -1
- package/scripts/sw-recruit.sh +1 -1
- package/scripts/sw-regression.sh +1 -1
- package/scripts/sw-release-manager.sh +1 -1
- package/scripts/sw-release.sh +1 -1
- package/scripts/sw-remote.sh +1 -1
- package/scripts/sw-replay.sh +1 -1
- package/scripts/sw-retro.sh +1 -1
- package/scripts/sw-review-rerun.sh +1 -1
- package/scripts/sw-scale.sh +5 -3
- package/scripts/sw-security-audit.sh +1 -1
- package/scripts/sw-self-optimize.sh +168 -4
- package/scripts/sw-session.sh +1 -1
- package/scripts/sw-setup.sh +1 -1
- package/scripts/sw-standup.sh +1 -1
- package/scripts/sw-status.sh +1 -1
- package/scripts/sw-strategic.sh +11 -6
- package/scripts/sw-stream.sh +7 -4
- package/scripts/sw-swarm.sh +3 -2
- package/scripts/sw-team-stages.sh +1 -1
- package/scripts/sw-templates.sh +3 -3
- package/scripts/sw-testgen.sh +11 -6
- package/scripts/sw-tmux-pipeline.sh +1 -1
- package/scripts/sw-tmux.sh +35 -1
- package/scripts/sw-trace.sh +1 -1
- package/scripts/sw-tracker.sh +1 -1
- package/scripts/sw-triage.sh +2 -2
- package/scripts/sw-upgrade.sh +1 -1
- package/scripts/sw-ux.sh +1 -1
- package/scripts/sw-webhook.sh +3 -2
- package/scripts/sw-widgets.sh +7 -4
- package/scripts/sw-worktree.sh +1 -1
package/scripts/sw-testgen.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="3.
|
|
9
|
+
VERSION="3.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
|
|
12
12
|
# ─── Handle subcommands ───────────────────────────────────────────────────────
|
|
@@ -98,7 +98,8 @@ analyze_coverage() {
|
|
|
98
98
|
if [[ -f "$target_script" ]]; then
|
|
99
99
|
# Parse function definitions
|
|
100
100
|
function_names=$(grep -E '^[a-zA-Z_][a-zA-Z0-9_]*\(\)' "$target_script" | sed 's/().*//' || echo "")
|
|
101
|
-
total_functions=$(echo "$function_names" | grep -c . ||
|
|
101
|
+
total_functions=$(echo "$function_names" | grep -c . || true)
|
|
102
|
+
total_functions="${total_functions:-0}"
|
|
102
103
|
fi
|
|
103
104
|
|
|
104
105
|
# Find existing tests that call these functions
|
|
@@ -182,7 +183,8 @@ EOF
|
|
|
182
183
|
fi
|
|
183
184
|
|
|
184
185
|
local untested_count=0
|
|
185
|
-
[[ -n "$untested_functions" ]] && untested_count=$(echo "$untested_functions" | grep -c . ||
|
|
186
|
+
[[ -n "$untested_functions" ]] && untested_count=$(echo "$untested_functions" | grep -c . || true)
|
|
187
|
+
untested_count="${untested_count:-0}"
|
|
186
188
|
|
|
187
189
|
if [[ $untested_count -eq 0 ]]; then
|
|
188
190
|
success "All functions have tests"
|
|
@@ -338,15 +340,18 @@ score_quality() {
|
|
|
338
340
|
|
|
339
341
|
# Count assertions
|
|
340
342
|
local assertion_count=0
|
|
341
|
-
assertion_count=$(grep -c -E '(assert_|test_|expect_)' "$test_file" ||
|
|
343
|
+
assertion_count=$(grep -c -E '(assert_|test_|expect_)' "$test_file" || true)
|
|
344
|
+
assertion_count="${assertion_count:-0}"
|
|
342
345
|
|
|
343
346
|
# Count edge case patterns
|
|
344
347
|
local edge_case_count=0
|
|
345
|
-
edge_case_count=$(grep -c -E '(empty|null|nil|missing|invalid|error|fail)' "$test_file" ||
|
|
348
|
+
edge_case_count=$(grep -c -E '(empty|null|nil|missing|invalid|error|fail)' "$test_file" || true)
|
|
349
|
+
edge_case_count="${edge_case_count:-0}"
|
|
346
350
|
|
|
347
351
|
# Count error path tests
|
|
348
352
|
local error_path_count=0
|
|
349
|
-
error_path_count=$(grep -c -E '(exit|return 1|error|ERROR)' "$test_file" ||
|
|
353
|
+
error_path_count=$(grep -c -E '(exit|return 1|error|ERROR)' "$test_file" || true)
|
|
354
|
+
error_path_count="${error_path_count:-0}"
|
|
350
355
|
|
|
351
356
|
# Calculate score (0-100)
|
|
352
357
|
local quality_score=0
|
package/scripts/sw-tmux.sh
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# ║ shipwright tmux fix — Auto-fix common issues ║
|
|
12
12
|
# ║ shipwright tmux reload — Reload tmux config ║
|
|
13
13
|
# ╚═══════════════════════════════════════════════════════════════════════════╝
|
|
14
|
-
VERSION="3.
|
|
14
|
+
VERSION="3.2.0"
|
|
15
15
|
set -euo pipefail
|
|
16
16
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
17
17
|
|
|
@@ -227,6 +227,16 @@ tmux_doctor() {
|
|
|
227
227
|
check_warn "pane-border-status: ${border_status} — agent names won't show"
|
|
228
228
|
fi
|
|
229
229
|
|
|
230
|
+
# Check pane-active-border-style for cyan accent
|
|
231
|
+
local border_style
|
|
232
|
+
border_style="$(tmux show-option -gv pane-active-border-style 2>/dev/null || echo "")"
|
|
233
|
+
if [[ "$border_style" == *"#00d4ff"* ]]; then
|
|
234
|
+
check_pass "pane-active-border-style: cyan accent applied"
|
|
235
|
+
else
|
|
236
|
+
check_warn "Pane border format missing cyan accent"
|
|
237
|
+
echo -e " ${DIM}Fix: set -g pane-active-border-style 'fg=#00d4ff,bg=#1a1a2e'${RESET}"
|
|
238
|
+
fi
|
|
239
|
+
|
|
230
240
|
# Check dark theme hooks
|
|
231
241
|
if tmux show-hooks -g 2>/dev/null | grep -q "after-split-window"; then
|
|
232
242
|
check_pass "Dark theme hooks active"
|
|
@@ -499,6 +509,30 @@ tmux_fix() {
|
|
|
499
509
|
fixed=$((fixed + 1))
|
|
500
510
|
fi
|
|
501
511
|
|
|
512
|
+
# Fix 11: default-terminal
|
|
513
|
+
local term
|
|
514
|
+
term="$(tmux show-option -gv default-terminal 2>/dev/null || echo "unknown")"
|
|
515
|
+
if [[ "$term" != *"256color"* ]]; then
|
|
516
|
+
tmux set -g default-terminal "tmux-256color" 2>/dev/null
|
|
517
|
+
success "Fixed: default-terminal → tmux-256color (was ${term})"
|
|
518
|
+
fixed=$((fixed + 1))
|
|
519
|
+
fi
|
|
520
|
+
|
|
521
|
+
# Fix 12: pane-active-border-style (cyan accent)
|
|
522
|
+
local border_style
|
|
523
|
+
border_style="$(tmux show-option -gv pane-active-border-style 2>/dev/null || echo "")"
|
|
524
|
+
if [[ "$border_style" != *"#00d4ff"* ]]; then
|
|
525
|
+
tmux set -g pane-active-border-style "fg=#00d4ff,bg=#1a1a2e" 2>/dev/null
|
|
526
|
+
success "Fixed: pane-active-border-style → cyan accent (#00d4ff)"
|
|
527
|
+
fixed=$((fixed + 1))
|
|
528
|
+
fi
|
|
529
|
+
|
|
530
|
+
# Source overlay for complete styling (pane-border-format, hooks, etc.)
|
|
531
|
+
if [[ -f "$HOME/.tmux/shipwright-overlay.conf" ]]; then
|
|
532
|
+
tmux source-file "$HOME/.tmux/shipwright-overlay.conf" 2>/dev/null && \
|
|
533
|
+
success "Sourced: shipwright-overlay.conf" || true
|
|
534
|
+
fi
|
|
535
|
+
|
|
502
536
|
echo ""
|
|
503
537
|
if [[ $fixed -eq 0 ]]; then
|
|
504
538
|
success "No fixes needed — tmux is already optimized!"
|
package/scripts/sw-trace.sh
CHANGED
package/scripts/sw-tracker.sh
CHANGED
package/scripts/sw-triage.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="3.
|
|
9
|
+
VERSION="3.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
12
12
|
|
|
@@ -601,7 +601,7 @@ cmd_team() {
|
|
|
601
601
|
fi
|
|
602
602
|
fi
|
|
603
603
|
|
|
604
|
-
# ── Fallback:
|
|
604
|
+
# ── Fallback: default complexity/risk mapping ──
|
|
605
605
|
if [[ -z "$template" ]]; then
|
|
606
606
|
case "${complexity}-${risk}" in
|
|
607
607
|
trivial-low|simple-low)
|
package/scripts/sw-upgrade.sh
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
# ╔═══════════════════════════════════════════════════════════════════════════╗
|
|
3
3
|
# ║ sw upgrade — Detect and apply updates from the repo ║
|
|
4
4
|
# ╚═══════════════════════════════════════════════════════════════════════════╝
|
|
5
|
-
VERSION="3.
|
|
5
|
+
VERSION="3.2.0"
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
package/scripts/sw-ux.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="3.
|
|
9
|
+
VERSION="3.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
|
|
12
12
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
package/scripts/sw-webhook.sh
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
set -euo pipefail
|
|
7
7
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
8
8
|
|
|
9
|
-
VERSION="3.
|
|
9
|
+
VERSION="3.2.0"
|
|
10
10
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
11
11
|
|
|
12
12
|
# ─── Cross-platform compatibility ──────────────────────────────────────────
|
|
@@ -373,7 +373,8 @@ cmd_status() {
|
|
|
373
373
|
echo ""
|
|
374
374
|
if [[ -f "$WEBHOOK_EVENTS_FILE" ]]; then
|
|
375
375
|
local event_count
|
|
376
|
-
event_count=$(wc -l < "$WEBHOOK_EVENTS_FILE" 2>/dev/null ||
|
|
376
|
+
event_count=$(wc -l < "$WEBHOOK_EVENTS_FILE" 2>/dev/null || true)
|
|
377
|
+
event_count="${event_count:-0}"
|
|
377
378
|
info "Recent webhook events (${event_count} total):"
|
|
378
379
|
tail -5 "$WEBHOOK_EVENTS_FILE" 2>/dev/null | jq -c '{ts, repo, issue, label}' || echo " (no events yet)"
|
|
379
380
|
else
|
package/scripts/sw-widgets.sh
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
set -euo pipefail
|
|
9
9
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
10
10
|
|
|
11
|
-
VERSION="3.
|
|
11
|
+
VERSION="3.2.0"
|
|
12
12
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
13
13
|
REPO_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
14
14
|
|
|
@@ -82,7 +82,8 @@ _get_test_stats() {
|
|
|
82
82
|
|
|
83
83
|
# Count test-related events
|
|
84
84
|
local pass_count
|
|
85
|
-
pass_count=$(grep -i "test.*passed" "$EVENTS_FILE" 2>/dev/null | wc -l ||
|
|
85
|
+
pass_count=$(grep -i "test.*passed" "$EVENTS_FILE" 2>/dev/null | wc -l || true)
|
|
86
|
+
pass_count="${pass_count:-0}"
|
|
86
87
|
pass_count=$(_safe_num "$pass_count")
|
|
87
88
|
|
|
88
89
|
echo "$pass_count"
|
|
@@ -109,11 +110,13 @@ _get_health_score() {
|
|
|
109
110
|
recent_events=$(tail -n 100 "$EVENTS_FILE" 2>/dev/null || true)
|
|
110
111
|
|
|
111
112
|
local success_count
|
|
112
|
-
success_count=$(echo "$recent_events" | grep -i "stage.*completed" | wc -l ||
|
|
113
|
+
success_count=$(echo "$recent_events" | grep -i "stage.*completed" | wc -l || true)
|
|
114
|
+
success_count="${success_count:-0}"
|
|
113
115
|
success_count=$(_safe_num "$success_count")
|
|
114
116
|
|
|
115
117
|
local fail_count
|
|
116
|
-
fail_count=$(echo "$recent_events" | grep -i "stage.*failed" | wc -l ||
|
|
118
|
+
fail_count=$(echo "$recent_events" | grep -i "stage.*failed" | wc -l || true)
|
|
119
|
+
fail_count="${fail_count:-0}"
|
|
117
120
|
fail_count=$(_safe_num "$fail_count")
|
|
118
121
|
|
|
119
122
|
local total=$((success_count + fail_count))
|
package/scripts/sw-worktree.sh
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
# ║ Each agent gets its own worktree so parallel agents don't clobber ║
|
|
6
6
|
# ║ each other's files. Worktrees live in .worktrees/ relative to root. ║
|
|
7
7
|
# ╚═══════════════════════════════════════════════════════════════════════════╝
|
|
8
|
-
VERSION="3.
|
|
8
|
+
VERSION="3.2.0"
|
|
9
9
|
set -euo pipefail
|
|
10
10
|
trap 'echo "ERROR: $BASH_SOURCE:$LINENO exited with status $?" >&2' ERR
|
|
11
11
|
|