shipwright-cli 2.2.1 → 2.2.2

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.
Files changed (115) hide show
  1. package/README.md +12 -13
  2. package/docs/AGI-PLATFORM-PLAN.md +5 -5
  3. package/docs/AGI-WHATS-NEXT.md +11 -8
  4. package/docs/README.md +2 -0
  5. package/package.json +1 -1
  6. package/scripts/check-version-consistency.sh +72 -0
  7. package/scripts/lib/daemon-adaptive.sh +610 -0
  8. package/scripts/lib/daemon-dispatch.sh +489 -0
  9. package/scripts/lib/daemon-failure.sh +387 -0
  10. package/scripts/lib/daemon-patrol.sh +1113 -0
  11. package/scripts/lib/daemon-poll.sh +1202 -0
  12. package/scripts/lib/daemon-state.sh +550 -0
  13. package/scripts/lib/daemon-triage.sh +490 -0
  14. package/scripts/lib/helpers.sh +51 -0
  15. package/scripts/lib/pipeline-intelligence.sh +0 -6
  16. package/scripts/lib/pipeline-quality-checks.sh +2 -0
  17. package/scripts/lib/pipeline-stages.sh +20 -0
  18. package/scripts/sw +26 -4
  19. package/scripts/sw-activity.sh +1 -1
  20. package/scripts/sw-adaptive.sh +2 -2
  21. package/scripts/sw-adversarial.sh +1 -1
  22. package/scripts/sw-architecture-enforcer.sh +1 -1
  23. package/scripts/sw-auth.sh +1 -1
  24. package/scripts/sw-autonomous.sh +1 -1
  25. package/scripts/sw-changelog.sh +1 -1
  26. package/scripts/sw-checkpoint.sh +1 -1
  27. package/scripts/sw-ci.sh +1 -1
  28. package/scripts/sw-cleanup.sh +1 -1
  29. package/scripts/sw-code-review.sh +1 -1
  30. package/scripts/sw-connect.sh +1 -1
  31. package/scripts/sw-context.sh +1 -1
  32. package/scripts/sw-cost.sh +1 -1
  33. package/scripts/sw-daemon.sh +52 -4816
  34. package/scripts/sw-dashboard.sh +1 -1
  35. package/scripts/sw-db.sh +1 -1
  36. package/scripts/sw-decompose.sh +1 -1
  37. package/scripts/sw-deps.sh +1 -1
  38. package/scripts/sw-developer-simulation.sh +1 -1
  39. package/scripts/sw-discovery.sh +1 -1
  40. package/scripts/sw-doc-fleet.sh +1 -1
  41. package/scripts/sw-docs-agent.sh +1 -1
  42. package/scripts/sw-docs.sh +1 -1
  43. package/scripts/sw-doctor.sh +42 -1
  44. package/scripts/sw-dora.sh +1 -1
  45. package/scripts/sw-durable.sh +1 -1
  46. package/scripts/sw-e2e-orchestrator.sh +1 -1
  47. package/scripts/sw-eventbus.sh +1 -1
  48. package/scripts/sw-feedback.sh +1 -1
  49. package/scripts/sw-fix.sh +1 -1
  50. package/scripts/sw-fleet-discover.sh +1 -1
  51. package/scripts/sw-fleet-viz.sh +3 -3
  52. package/scripts/sw-fleet.sh +1 -1
  53. package/scripts/sw-github-app.sh +1 -1
  54. package/scripts/sw-github-checks.sh +1 -1
  55. package/scripts/sw-github-deploy.sh +1 -1
  56. package/scripts/sw-github-graphql.sh +1 -1
  57. package/scripts/sw-guild.sh +1 -1
  58. package/scripts/sw-heartbeat.sh +1 -1
  59. package/scripts/sw-hygiene.sh +1 -1
  60. package/scripts/sw-incident.sh +1 -1
  61. package/scripts/sw-init.sh +1 -1
  62. package/scripts/sw-instrument.sh +1 -1
  63. package/scripts/sw-intelligence.sh +1 -1
  64. package/scripts/sw-jira.sh +1 -1
  65. package/scripts/sw-launchd.sh +1 -1
  66. package/scripts/sw-linear.sh +1 -1
  67. package/scripts/sw-logs.sh +1 -1
  68. package/scripts/sw-loop.sh +1 -1
  69. package/scripts/sw-memory.sh +1 -1
  70. package/scripts/sw-mission-control.sh +1 -1
  71. package/scripts/sw-model-router.sh +1 -1
  72. package/scripts/sw-otel.sh +4 -4
  73. package/scripts/sw-oversight.sh +1 -1
  74. package/scripts/sw-pipeline-composer.sh +1 -1
  75. package/scripts/sw-pipeline-vitals.sh +1 -1
  76. package/scripts/sw-pipeline.sh +16 -56
  77. package/scripts/sw-pipeline.sh.mock +7 -0
  78. package/scripts/sw-pm.sh +1 -1
  79. package/scripts/sw-pr-lifecycle.sh +1 -1
  80. package/scripts/sw-predictive.sh +1 -1
  81. package/scripts/sw-prep.sh +1 -1
  82. package/scripts/sw-ps.sh +1 -1
  83. package/scripts/sw-public-dashboard.sh +1 -1
  84. package/scripts/sw-quality.sh +1 -1
  85. package/scripts/sw-reaper.sh +1 -1
  86. package/scripts/sw-recruit.sh +9 -1
  87. package/scripts/sw-regression.sh +1 -1
  88. package/scripts/sw-release-manager.sh +1 -1
  89. package/scripts/sw-release.sh +1 -1
  90. package/scripts/sw-remote.sh +1 -1
  91. package/scripts/sw-replay.sh +1 -1
  92. package/scripts/sw-retro.sh +1 -1
  93. package/scripts/sw-scale.sh +8 -5
  94. package/scripts/sw-security-audit.sh +1 -1
  95. package/scripts/sw-self-optimize.sh +158 -7
  96. package/scripts/sw-session.sh +1 -1
  97. package/scripts/sw-setup.sh +1 -1
  98. package/scripts/sw-standup.sh +3 -3
  99. package/scripts/sw-status.sh +1 -1
  100. package/scripts/sw-strategic.sh +1 -1
  101. package/scripts/sw-stream.sh +8 -2
  102. package/scripts/sw-swarm.sh +7 -10
  103. package/scripts/sw-team-stages.sh +1 -1
  104. package/scripts/sw-templates.sh +1 -1
  105. package/scripts/sw-testgen.sh +1 -1
  106. package/scripts/sw-tmux-pipeline.sh +1 -1
  107. package/scripts/sw-tmux.sh +1 -1
  108. package/scripts/sw-trace.sh +1 -1
  109. package/scripts/sw-tracker.sh +24 -6
  110. package/scripts/sw-triage.sh +1 -1
  111. package/scripts/sw-upgrade.sh +1 -1
  112. package/scripts/sw-ux.sh +1 -1
  113. package/scripts/sw-webhook.sh +1 -1
  114. package/scripts/sw-widgets.sh +1 -1
  115. package/scripts/sw-worktree.sh +1 -1
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  <a href="https://github.com/sethdford/shipwright/actions/workflows/test.yml"><img src="https://github.com/sethdford/shipwright/actions/workflows/test.yml/badge.svg" alt="Tests"></a>
14
14
  <a href="https://github.com/sethdford/shipwright/actions/workflows/shipwright-pipeline.yml"><img src="https://github.com/sethdford/shipwright/actions/workflows/shipwright-pipeline.yml/badge.svg" alt="Pipeline"></a>
15
15
  <img src="https://img.shields.io/badge/tests-103_suites_passing-4ade80?style=flat-square" alt="103 suites">
16
- <img src="https://img.shields.io/badge/version-2.1.2-00d4ff?style=flat-square" alt="v2.1.2">
16
+ <img src="https://img.shields.io/badge/version-2.2.2-00d4ff?style=flat-square" alt="v2.2.2">
17
17
  <img src="https://img.shields.io/badge/license-MIT-green?style=flat-square" alt="MIT License">
18
18
  <img src="https://img.shields.io/badge/bash-3.2%2B-7c3aed?style=flat-square" alt="Bash 3.2+">
19
19
  </p>
@@ -23,7 +23,7 @@
23
23
  ## Table of Contents
24
24
 
25
25
  - [Shipwright Builds Itself](#shipwright-builds-itself)
26
- - [What's New in v2.1.2](#whats-new-in-v212)
26
+ - [What's New in v2.2.2](#whats-new-in-v222)
27
27
  - [How It Works](#how-it-works)
28
28
  - [Install](#install)
29
29
  - [Quick Start](#quick-start)
@@ -46,17 +46,16 @@ This repo uses Shipwright to process its own issues. Label a GitHub issue with `
46
46
 
47
47
  ---
48
48
 
49
- ## What's New in v2.1.2
49
+ ## What's New in v2.2.2
50
50
 
51
- **AGI-Level Agent Recruitment** — dynamic role creation, LLM-powered matching, closed-loop learning:
51
+ **Docs & platform polish** — doc-fleet, shared libs, policy schema, release infra:
52
52
 
53
- - **`recruit match`** AI/heuristic task→role matching with `--json` output for pipeline integration
54
- - **`recruit team`**Context-aware team composition with cost estimation
55
- - **`recruit route`**Smart routing based on agent performance history
56
- - **Cross-system integration** — Pipeline, PM, triage, loop, and swarm all use recruit for model/role selection
57
- - **Self-tuning heuristics** — System learns keyword→role mappings from successful outcomes
58
- - **Meta-learning**Accuracy tracking and self-correction for matching decisions
59
- - **CI auto-discovery** — All 103 test suites now run in CI (previously 26)
53
+ - **Doc-fleet**Five Cursor agents (doc-architect, claude-md, strategy-curator, pattern-writer, readme-optimizer) keep docs, strategy, and README in sync
54
+ - **Pipeline lib split** `scripts/lib/pipeline-quality.sh`, `daemon-health.sh`, `policy.sh` for reuse and tests
55
+ - **Policy schema**`config/policy.json` and `docs/config-policy.md` for hygiene, quality, and platform rules
56
+ - **Release infra** — npm, GitHub Releases (darwin/linux/windows), Homebrew tap; `scripts/build-release.sh` and `.github/workflows/release.yml` ship all platforms
57
+
58
+ **v2.1.2**: AGI-level recruit `recruit match` / `team` / `route`, cross-system integration, 103 test suites in CI
60
59
 
61
60
  **v2.1.0**: tmux visual overhaul — role-colored borders, pipeline status widgets, active pane depth
62
61
 
@@ -163,7 +162,7 @@ shipwright fleet start
163
162
  shipwright fix "upgrade deps" --repos ~/a,~/b,~/c
164
163
 
165
164
  # Release automation
166
- shipwright release --version 2.1.0
165
+ shipwright release --version 2.2.2
167
166
  shipwright changelog generate
168
167
  ```
169
168
 
@@ -382,7 +381,7 @@ shipwright fix "feat: add auth" --repos ~/a,~/b,~/c
382
381
  shipwright fleet-viz
383
382
 
384
383
  # Release automation
385
- shipwright release --version 2.1.0
384
+ shipwright release --version 2.2.2
386
385
  shipwright changelog generate
387
386
  shipwright deploys list
388
387
 
@@ -51,7 +51,7 @@
51
51
 
52
52
  **Goal:** Pipeline and daemon are split into sourced modules; no single file > 2000 lines for orchestration core.
53
53
 
54
- **Status:** 3.2 and 3.4 done (pipeline-quality.sh and daemon-health.sh created, wired, and sourced). 3.1 and 3.3 (full stage/poll extraction) deferred high risk, requires incremental approach.
54
+ **Status:** All done. 3.1 pipeline fully decomposed: sw-pipeline.sh reduced from 8,665 → 2,434 lines (72% reduction) by wiring pipeline-state.sh, pipeline-github.sh, pipeline-detection.sh, pipeline-quality-checks.sh, pipeline-intelligence.sh, pipeline-stages.sh. 3.2 done (pipeline-quality.sh). 3.3 daemon fully decomposed: sw-daemon.sh reduced from 6,150 → 1,351 lines (78% reduction) by wiring daemon-state.sh, daemon-adaptive.sh, daemon-triage.sh, daemon-failure.sh, daemon-dispatch.sh, daemon-patrol.sh, daemon-poll.sh. 3.4 done (daemon-health.sh). All tests pass.
55
55
 
56
56
  | # | Task | Owner | Acceptance |
57
57
  | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----- | --------------------------------------------------------------------- |
@@ -66,7 +66,7 @@
66
66
 
67
67
  **Goal:** Triage all TODO/FIXME/HACK; remove dead code; reduce fallback count.
68
68
 
69
- **Status:** 4.1–4.2 done (PLATFORM-TODO-TRIAGE.md created with full triage: 4 github-issue, 3 accepted-debt, 0 stale). 4.3–4.4 ongoing (run hygiene dead-code; reduce fallbacks over time). Pre-existing `now_unix` bug in sw-scale.sh fixed.
69
+ **Status:** All done. 4.1–4.2 triage complete (PLATFORM-TODO-TRIAGE.md: 4 github-issue, 3 accepted-debt). 4.3 dead code scan complete — 1 confirmed dead function (get_adaptive_heartbeat_timeout in daemon-adaptive.sh, accepted debt; may wire later). No unused scripts. No .bak/temp files. 4.4 fallback count reduced from 71 → 54 via monolith decomposition; remaining fallbacks are legitimate defensive patterns (intelligence heuristics, template fallbacks, grep-based search fallbacks). Pre-existing `now_unix` bug in sw-scale.sh fixed.
70
70
 
71
71
  | # | Task | Owner | Acceptance |
72
72
  | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -------------------------------------------------------- |
@@ -94,10 +94,10 @@
94
94
 
95
95
  ## Current Snapshot (from platform-refactor scan)
96
96
 
97
- - **hardcoded:** 58 | **fallback:** 54 | **TODO:** 37 | **FIXME:** 19 | **HACK/KLUDGE:** 17
97
+ - **hardcoded:** 66 | **fallback:** 71 | **TODO:** 38 | **FIXME:** 19 | **HACK/KLUDGE:** 18
98
98
  - **Triage:** 4 github-issue, 3 accepted-debt, 0 stale, 0 fix-now (see `docs/PLATFORM-TODO-TRIAGE.md`)
99
- - **Largest scripts:** sw-pipeline.sh (8600+), sw-daemon.sh (6000+), sw-loop.sh (2400+), sw-recruit.sh (2200+), sw-prep.sh (1600+), sw-memory.sh (1600+).
100
- - _Last scan: 2026-02-16. Re-scan after full helpers migration to track delta._
99
+ - **Largest scripts:** sw-pipeline.sh (8665), sw-daemon.sh (6150), sw-loop.sh (2492), sw-recruit.sh (2636), sw-prep.sh (1657), sw-memory.sh (1634). Pipeline/daemon have extracted libs (scripts/lib/pipeline-_.sh, scripts/lib/daemon-_.sh).
100
+ - _Last scan: 2026-02-16. Run `shipwright hygiene platform-refactor` to refresh._
101
101
 
102
102
  ---
103
103
 
@@ -40,13 +40,13 @@
40
40
 
41
41
  ## 4. Not audited E2E
42
42
 
43
- | Item | What | Next step |
44
- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------- |
45
- | ~~**Pipeline E2E with policy**~~ | **Done.** `sw-policy-e2e-test.sh` (26 tests) verifies pipeline-quality.sh reads coverage/gate thresholds from policy, policy_get with mock and real configs. | Added to npm test suite. |
46
- | ~~**Daemon E2E with policy**~~ | **Done.** `sw-policy-e2e-test.sh` verifies daemon policy_get for poll_interval, heartbeat_timeout, stage_timeouts, auto_scale_interval. | Covered in policy E2E test. |
47
- | **Platform-health workflow E2E** | Workflow validated locally (schema, scan, report steps); not yet triggered via workflow_dispatch in CI. | Trigger workflow (workflow_dispatch) to confirm end-to-end in real CI. |
48
- | **Doctor with no platform-hygiene** | When `.claude/platform-hygiene.json` is missing, doctor shows "Platform hygiene not run". Not wrong, but we never auto-run it. | Optional: doctor could run `hygiene platform-refactor` once and then show section. |
49
- | ~~**Full npm test with policy**~~ | **Done.** `sw-policy-e2e-test.sh` added to npm test; 26 policy-specific assertions covering policy_get, pipeline-quality.sh, daemon thresholds, and sanity checks. | In test suite. |
43
+ | Item | What | Next step |
44
+ | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------- |
45
+ | ~~**Pipeline E2E with policy**~~ | **Done.** `sw-policy-e2e-test.sh` (26 tests) verifies pipeline-quality.sh reads coverage/gate thresholds from policy, policy_get with mock and real configs. | Added to npm test suite. |
46
+ | ~~**Daemon E2E with policy**~~ | **Done.** `sw-policy-e2e-test.sh` verifies daemon policy_get for poll_interval, heartbeat_timeout, stage_timeouts, auto_scale_interval. | Covered in policy E2E test. |
47
+ | **Platform-health workflow E2E** | Workflow validated locally (schema, scan, report steps); not yet triggered via workflow_dispatch in CI. | Trigger workflow (workflow_dispatch) to confirm end-to-end in real CI. |
48
+ | ~~**Doctor with no platform-hygiene**~~ | **Done.** Doctor now auto-runs `hygiene platform-refactor` when report is missing; `--skip-platform-scan` flag available for fast mode. | Complete. |
49
+ | ~~**Full npm test with policy**~~ | **Done.** `sw-policy-e2e-test.sh` added to npm test; 26 policy-specific assertions covering policy_get, pipeline-quality.sh, daemon thresholds, and sanity checks. | In test suite. |
50
50
 
51
51
  ---
52
52
 
@@ -61,7 +61,10 @@
61
61
  - [x] **TODO/FIXME/HACK** — Phase 4 triage complete: 4 github-issue, 3 accepted-debt, 0 stale. See `docs/PLATFORM-TODO-TRIAGE.md`.
62
62
  - [x] **Strategic + hygiene** — Strategic CI workflow now runs hygiene platform-refactor before analysis.
63
63
  - [ ] **Platform-health workflow_dispatch** — Trigger once in CI to confirm end-to-end execution.
64
- - [ ] **Monolith decomposition (Phase 3.1, 3.3)** — Deferred; high risk, requires incremental extraction.
64
+ - [x] **Monolith decomposition (Phase 3.1, 3.3)** — Done. Pipeline 8,665 → 2,434 lines; daemon 6,150 1,351 lines. All libs wired and sourced.
65
+ - [x] **Doctor auto-hygiene** — Doctor auto-runs platform-refactor when report missing; `--skip-platform-scan` flag added.
66
+ - [x] **Dead code scan** — 1 confirmed dead function (accepted debt); no unused scripts or temp files.
67
+ - [x] **Fallback reduction** — Counts reduced 71 → 54 via decomposition; remaining are legitimate patterns.
65
68
 
66
69
  ---
67
70
 
package/docs/README.md CHANGED
@@ -78,6 +78,8 @@ Navigation hub for all Shipwright docs. Start here or jump to a section.
78
78
 
79
79
  ## See Also
80
80
 
81
+ - [../CHANGELOG.md](../CHANGELOG.md) — Version history and release notes
82
+ - **Release automation** — Prefer CLI: `shipwright version bump <x.y.z>`, `shipwright version check`, `shipwright release build`. Scripts: `scripts/update-version.sh`, `scripts/check-version-consistency.sh`, `scripts/build-release.sh`. Website footer reads version from repo `package.json` at build time.
81
83
  - [demo/README.md](../demo/README.md) — Demo app for pipeline testing
82
84
  - [claude-code/CLAUDE.md.shipwright](../claude-code/CLAUDE.md.shipwright) — Downstream repo template
83
85
  - [.github/pull_request_template.md](../.github/pull_request_template.md) — PR checklist
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipwright-cli",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Orchestrate autonomous Claude Code agent teams in tmux",
5
5
  "bin": {
6
6
  "shipwright": "./scripts/sw",
@@ -0,0 +1,72 @@
1
+ #!/usr/bin/env bash
2
+ # ╔═══════════════════════════════════════════════════════════════════════════╗
3
+ # ║ Shipwright — Version consistency check ║
4
+ # ║ Fails if package.json version != README badge / script VERSION= ║
5
+ # ║ Run in CI or before release to catch drift. ║
6
+ # ╚═══════════════════════════════════════════════════════════════════════════╝
7
+ set -euo pipefail
8
+
9
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
10
+ REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
11
+
12
+ CANONICAL=""
13
+ if [[ -f "$REPO_ROOT/package.json" ]]; then
14
+ if command -v jq &>/dev/null; then
15
+ CANONICAL="$(jq -r .version "$REPO_ROOT/package.json")"
16
+ else
17
+ CANONICAL="$(grep -oE '"version":\s*"[^"]+"' "$REPO_ROOT/package.json" | head -1 | sed 's/.*"\([^"]*\)".*/\1/')"
18
+ fi
19
+ fi
20
+
21
+ if [[ -z "$CANONICAL" ]]; then
22
+ echo "check-version-consistency: could not read version from package.json" >&2
23
+ exit 1
24
+ fi
25
+
26
+ ERR=0
27
+
28
+ # README badge: version-X.Y.Z and alt="vX.Y.Z"
29
+ if [[ -f "$REPO_ROOT/README.md" ]]; then
30
+ if ! grep -q "badge/version-$CANONICAL" "$REPO_ROOT/README.md"; then
31
+ echo "check-version-consistency: README badge version does not match package.json ($CANONICAL)" >&2
32
+ ERR=1
33
+ fi
34
+ if ! grep -q "alt=\"v$CANONICAL\"" "$REPO_ROOT/README.md"; then
35
+ echo "check-version-consistency: README alt version does not match package.json ($CANONICAL)" >&2
36
+ ERR=1
37
+ fi
38
+ fi
39
+
40
+ # Sample scripts: VERSION= must match (check a few key ones)
41
+ SAMPLES=(
42
+ "$REPO_ROOT/scripts/sw"
43
+ "$REPO_ROOT/scripts/sw-daemon.sh"
44
+ "$REPO_ROOT/scripts/sw-pipeline.sh"
45
+ "$REPO_ROOT/scripts/install-remote.sh"
46
+ )
47
+ for f in "${SAMPLES[@]}"; do
48
+ if [[ -f "$f" ]]; then
49
+ V="$(grep -m1 '^VERSION="' "$f" 2>/dev/null | sed 's/^VERSION="\([^"]*\)".*/\1/')"
50
+ if [[ -n "$V" && "$V" != "$CANONICAL" ]]; then
51
+ echo "check-version-consistency: $(basename "$f") has VERSION=$V, expected $CANONICAL" >&2
52
+ ERR=1
53
+ fi
54
+ fi
55
+ done
56
+
57
+ # Any script under scripts/ with ^VERSION=" that differs
58
+ while IFS= read -r file; do
59
+ V="$(grep -m1 '^VERSION="' "$file" 2>/dev/null | sed 's/^VERSION="\([^"]*\)".*/\1/')"
60
+ if [[ -n "$V" && "$V" != "$CANONICAL" ]]; then
61
+ echo "check-version-consistency: $(basename "$file") has VERSION=$V, expected $CANONICAL" >&2
62
+ ERR=1
63
+ fi
64
+ done < <(grep -rl '^VERSION="' "$REPO_ROOT/scripts/" 2>/dev/null || true)
65
+
66
+ if [[ $ERR -eq 1 ]]; then
67
+ echo "Run: bash scripts/update-version.sh $CANONICAL" >&2
68
+ exit 1
69
+ fi
70
+
71
+ echo "Version consistent: $CANONICAL"
72
+ exit 0