shipwright-cli 2.2.0 → 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.
- package/README.md +15 -16
- package/config/policy.schema.json +104 -29
- package/docs/AGI-PLATFORM-PLAN.md +11 -7
- package/docs/AGI-WHATS-NEXT.md +26 -20
- package/docs/README.md +2 -0
- package/package.json +1 -1
- package/scripts/check-version-consistency.sh +72 -0
- package/scripts/lib/daemon-adaptive.sh +610 -0
- package/scripts/lib/daemon-dispatch.sh +489 -0
- package/scripts/lib/daemon-failure.sh +387 -0
- package/scripts/lib/daemon-patrol.sh +1113 -0
- package/scripts/lib/daemon-poll.sh +1202 -0
- package/scripts/lib/daemon-state.sh +550 -0
- package/scripts/lib/daemon-triage.sh +490 -0
- package/scripts/lib/helpers.sh +81 -1
- package/scripts/lib/pipeline-detection.sh +278 -0
- package/scripts/lib/pipeline-github.sh +196 -0
- package/scripts/lib/pipeline-intelligence.sh +1706 -0
- package/scripts/lib/pipeline-quality-checks.sh +1054 -0
- package/scripts/lib/pipeline-quality.sh +11 -0
- package/scripts/lib/pipeline-stages.sh +2508 -0
- package/scripts/lib/pipeline-state.sh +529 -0
- package/scripts/sw +26 -4
- package/scripts/sw-activity.sh +1 -1
- package/scripts/sw-adaptive.sh +2 -2
- 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 +1 -1
- package/scripts/sw-cleanup.sh +1 -1
- package/scripts/sw-code-review.sh +1 -1
- package/scripts/sw-connect.sh +1 -1
- package/scripts/sw-context.sh +1 -1
- package/scripts/sw-cost.sh +1 -1
- package/scripts/sw-daemon.sh +52 -4816
- package/scripts/sw-dashboard.sh +1 -1
- package/scripts/sw-db.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 +1 -1
- 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 +42 -1
- package/scripts/sw-dora.sh +1 -1
- package/scripts/sw-durable.sh +1 -1
- package/scripts/sw-e2e-orchestrator.sh +1 -1
- package/scripts/sw-eventbus.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 +3 -3
- package/scripts/sw-fleet.sh +1 -1
- package/scripts/sw-github-app.sh +1 -1
- 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 +1 -1
- package/scripts/sw-incident.sh +1 -1
- package/scripts/sw-init.sh +1 -1
- package/scripts/sw-instrument.sh +1 -1
- package/scripts/sw-intelligence.sh +1 -1
- 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 +1 -1
- package/scripts/sw-memory.sh +1 -1
- package/scripts/sw-mission-control.sh +1 -1
- package/scripts/sw-model-router.sh +1 -1
- package/scripts/sw-otel.sh +4 -4
- package/scripts/sw-oversight.sh +1 -1
- package/scripts/sw-pipeline-composer.sh +1 -1
- package/scripts/sw-pipeline-vitals.sh +1 -1
- package/scripts/sw-pipeline.sh +23 -56
- package/scripts/sw-pipeline.sh.mock +7 -0
- package/scripts/sw-pm.sh +1 -1
- package/scripts/sw-pr-lifecycle.sh +1 -1
- package/scripts/sw-predictive.sh +1 -1
- package/scripts/sw-prep.sh +1 -1
- package/scripts/sw-ps.sh +1 -1
- package/scripts/sw-public-dashboard.sh +1 -1
- package/scripts/sw-quality.sh +1 -1
- package/scripts/sw-reaper.sh +1 -1
- package/scripts/sw-recruit.sh +9 -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-scale.sh +8 -5
- package/scripts/sw-security-audit.sh +1 -1
- package/scripts/sw-self-optimize.sh +158 -7
- package/scripts/sw-session.sh +1 -1
- package/scripts/sw-setup.sh +1 -1
- package/scripts/sw-standup.sh +3 -3
- package/scripts/sw-status.sh +1 -1
- package/scripts/sw-strategic.sh +1 -1
- package/scripts/sw-stream.sh +8 -2
- package/scripts/sw-swarm.sh +7 -10
- package/scripts/sw-team-stages.sh +1 -1
- package/scripts/sw-templates.sh +1 -1
- package/scripts/sw-testgen.sh +1 -1
- package/scripts/sw-tmux-pipeline.sh +1 -1
- package/scripts/sw-tmux.sh +1 -1
- package/scripts/sw-trace.sh +1 -1
- package/scripts/sw-tracker.sh +24 -6
- package/scripts/sw-triage.sh +1 -1
- package/scripts/sw-upgrade.sh +1 -1
- package/scripts/sw-ux.sh +1 -1
- package/scripts/sw-webhook.sh +1 -1
- package/scripts/sw-widgets.sh +1 -1
- package/scripts/sw-worktree.sh +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
<p align="center">
|
|
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
|
-
<img src="https://img.shields.io/badge/tests-
|
|
16
|
-
<img src="https://img.shields.io/badge/version-2.
|
|
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.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.
|
|
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.
|
|
49
|
+
## What's New in v2.2.2
|
|
50
50
|
|
|
51
|
-
**
|
|
51
|
+
**Docs & platform polish** — doc-fleet, shared libs, policy schema, release infra:
|
|
52
52
|
|
|
53
|
-
-
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
- **
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- **CI auto-discovery** — All 99 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.
|
|
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.
|
|
384
|
+
shipwright release --version 2.2.2
|
|
386
385
|
shipwright changelog generate
|
|
387
386
|
shipwright deploys list
|
|
388
387
|
|
|
@@ -432,7 +431,7 @@ shipwright templates list
|
|
|
432
431
|
|
|
433
432
|
## Architecture
|
|
434
433
|
|
|
435
|
-
100+ bash scripts (~100K lines),
|
|
434
|
+
100+ bash scripts (~100K lines), 103 test suites (1000+ tests), plus a TypeScript dashboard server. Bash 3.2 compatible — runs on macOS and Linux out of the box.
|
|
436
435
|
|
|
437
436
|
**Core Layers:**
|
|
438
437
|
|
|
@@ -503,7 +502,7 @@ Tools & UX
|
|
|
503
502
|
**Manual development:** Fork, branch, then:
|
|
504
503
|
|
|
505
504
|
```bash
|
|
506
|
-
npm test # 1000+ tests across
|
|
505
|
+
npm test # 1000+ tests across 103 suites
|
|
507
506
|
```
|
|
508
507
|
|
|
509
508
|
## License
|
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"$id": "https://shipwright.dev/schemas/policy-v1.json",
|
|
4
3
|
"title": "Shipwright Policy",
|
|
5
|
-
"description": "Central policy for Shipwright — timeouts, limits, thresholds.",
|
|
4
|
+
"description": "Central policy for Shipwright — timeouts, limits, thresholds. Validated by CI platform-health workflow.",
|
|
6
5
|
"type": "object",
|
|
6
|
+
"required": ["version"],
|
|
7
7
|
"properties": {
|
|
8
|
+
"$schema": { "type": "string" },
|
|
9
|
+
"description": { "type": "string" },
|
|
8
10
|
"version": { "type": "string" },
|
|
9
11
|
"daemon": {
|
|
10
12
|
"type": "object",
|
|
11
13
|
"properties": {
|
|
12
|
-
"poll_interval_seconds": { "type": "integer", "minimum":
|
|
13
|
-
"health_heartbeat_timeout": { "type": "integer", "minimum":
|
|
14
|
+
"poll_interval_seconds": { "type": "integer", "minimum": 1 },
|
|
15
|
+
"health_heartbeat_timeout": { "type": "integer", "minimum": 1 },
|
|
14
16
|
"stage_timeouts": {
|
|
15
17
|
"type": "object",
|
|
16
|
-
"additionalProperties": { "type": "integer", "minimum":
|
|
18
|
+
"additionalProperties": { "type": "integer", "minimum": 1 }
|
|
17
19
|
},
|
|
18
|
-
"auto_scale_interval_cycles": { "type": "integer" },
|
|
19
|
-
"optimize_interval_cycles": { "type": "integer" },
|
|
20
|
-
"stale_reaper_interval_cycles": { "type": "integer" }
|
|
21
|
-
|
|
20
|
+
"auto_scale_interval_cycles": { "type": "integer", "minimum": 1 },
|
|
21
|
+
"optimize_interval_cycles": { "type": "integer", "minimum": 1 },
|
|
22
|
+
"stale_reaper_interval_cycles": { "type": "integer", "minimum": 1 },
|
|
23
|
+
"stale_timeout_multiplier": { "type": "integer", "minimum": 1 },
|
|
24
|
+
"stale_state_hours": { "type": "integer", "minimum": 1 }
|
|
25
|
+
},
|
|
26
|
+
"additionalProperties": false
|
|
22
27
|
},
|
|
23
28
|
"pipeline": {
|
|
24
29
|
"type": "object",
|
|
25
30
|
"properties": {
|
|
26
|
-
"max_iterations_default": { "type": "integer" },
|
|
31
|
+
"max_iterations_default": { "type": "integer", "minimum": 1 },
|
|
32
|
+
"max_cycles_convergence_cap": { "type": "integer", "minimum": 1 },
|
|
27
33
|
"coverage_threshold_percent": {
|
|
28
34
|
"type": "integer",
|
|
29
35
|
"minimum": 0,
|
|
@@ -34,42 +40,111 @@
|
|
|
34
40
|
"minimum": 0,
|
|
35
41
|
"maximum": 100
|
|
36
42
|
},
|
|
37
|
-
"memory_baseline_fallback_percent": {
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
"memory_baseline_fallback_percent": {
|
|
44
|
+
"type": "integer",
|
|
45
|
+
"minimum": 0,
|
|
46
|
+
"maximum": 100
|
|
47
|
+
},
|
|
48
|
+
"memory_inject_fallback_percent": {
|
|
49
|
+
"type": "integer",
|
|
50
|
+
"minimum": 0,
|
|
51
|
+
"maximum": 100
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"additionalProperties": false
|
|
40
55
|
},
|
|
41
56
|
"quality": {
|
|
42
57
|
"type": "object",
|
|
43
58
|
"properties": {
|
|
44
|
-
"coverage_threshold": {
|
|
45
|
-
|
|
46
|
-
|
|
59
|
+
"coverage_threshold": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 0,
|
|
62
|
+
"maximum": 100
|
|
63
|
+
},
|
|
64
|
+
"gate_score_threshold": {
|
|
65
|
+
"type": "integer",
|
|
66
|
+
"minimum": 0,
|
|
67
|
+
"maximum": 100
|
|
68
|
+
},
|
|
69
|
+
"audit_weights": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"test_pass": { "type": "integer", "minimum": 0 },
|
|
73
|
+
"coverage": { "type": "integer", "minimum": 0 },
|
|
74
|
+
"security": { "type": "integer", "minimum": 0 },
|
|
75
|
+
"architecture": { "type": "integer", "minimum": 0 },
|
|
76
|
+
"correctness": { "type": "integer", "minimum": 0 }
|
|
77
|
+
},
|
|
78
|
+
"additionalProperties": false
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
"additionalProperties": false
|
|
47
82
|
},
|
|
48
83
|
"strategic": {
|
|
49
84
|
"type": "object",
|
|
50
85
|
"properties": {
|
|
51
|
-
"max_issues_per_cycle": { "type": "integer" },
|
|
52
|
-
"cooldown_seconds": { "type": "integer" },
|
|
53
|
-
"overlap_threshold_percent": {
|
|
54
|
-
|
|
55
|
-
|
|
86
|
+
"max_issues_per_cycle": { "type": "integer", "minimum": 1 },
|
|
87
|
+
"cooldown_seconds": { "type": "integer", "minimum": 0 },
|
|
88
|
+
"overlap_threshold_percent": {
|
|
89
|
+
"type": "integer",
|
|
90
|
+
"minimum": 0,
|
|
91
|
+
"maximum": 100
|
|
92
|
+
},
|
|
93
|
+
"strategy_lines": { "type": "integer", "minimum": 1 }
|
|
94
|
+
},
|
|
95
|
+
"additionalProperties": false
|
|
56
96
|
},
|
|
57
97
|
"sweep": {
|
|
58
98
|
"type": "object",
|
|
59
99
|
"properties": {
|
|
60
|
-
"cron_minutes": { "type": "integer" },
|
|
61
|
-
"stuck_threshold_hours": { "type": "integer" },
|
|
100
|
+
"cron_minutes": { "type": "integer", "minimum": 1 },
|
|
101
|
+
"stuck_threshold_hours": { "type": "integer", "minimum": 1 },
|
|
62
102
|
"retry_template": { "type": "string" },
|
|
63
|
-
"retry_max_iterations": { "type": "integer" },
|
|
64
|
-
"stuck_retry_max_iterations": { "type": "integer" }
|
|
65
|
-
}
|
|
103
|
+
"retry_max_iterations": { "type": "integer", "minimum": 1 },
|
|
104
|
+
"stuck_retry_max_iterations": { "type": "integer", "minimum": 1 }
|
|
105
|
+
},
|
|
106
|
+
"additionalProperties": false
|
|
66
107
|
},
|
|
67
108
|
"hygiene": {
|
|
68
109
|
"type": "object",
|
|
69
110
|
"properties": {
|
|
70
|
-
"artifact_age_days": { "type": "integer" }
|
|
71
|
-
}
|
|
111
|
+
"artifact_age_days": { "type": "integer", "minimum": 1 }
|
|
112
|
+
},
|
|
113
|
+
"additionalProperties": false
|
|
114
|
+
},
|
|
115
|
+
"recruit": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"self_tune_min_matches": { "type": "integer", "minimum": 1 },
|
|
119
|
+
"self_tune_min_success_rate": {
|
|
120
|
+
"type": "integer",
|
|
121
|
+
"minimum": 0,
|
|
122
|
+
"maximum": 100
|
|
123
|
+
},
|
|
124
|
+
"match_confidence_threshold": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"minimum": 0,
|
|
127
|
+
"maximum": 1
|
|
128
|
+
},
|
|
129
|
+
"max_match_history_size": { "type": "integer", "minimum": 1 },
|
|
130
|
+
"max_profile_task_history": { "type": "integer", "minimum": 1 },
|
|
131
|
+
"meta_learning_accuracy_floor": {
|
|
132
|
+
"type": "integer",
|
|
133
|
+
"minimum": 0,
|
|
134
|
+
"maximum": 100
|
|
135
|
+
},
|
|
136
|
+
"auto_evolve_after_outcomes": { "type": "integer", "minimum": 1 },
|
|
137
|
+
"llm_timeout_seconds": { "type": "integer", "minimum": 1 },
|
|
138
|
+
"default_model": { "type": "string" },
|
|
139
|
+
"promote_threshold_tasks": { "type": "integer", "minimum": 1 },
|
|
140
|
+
"promote_threshold_success_rate": {
|
|
141
|
+
"type": "integer",
|
|
142
|
+
"minimum": 0,
|
|
143
|
+
"maximum": 100
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"additionalProperties": false
|
|
72
147
|
}
|
|
73
148
|
},
|
|
74
|
-
"additionalProperties":
|
|
149
|
+
"additionalProperties": false
|
|
75
150
|
}
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
**Goal:** Policy and helpers are the default; at least two key scripts read from policy; plan is visible and tracked.
|
|
22
22
|
|
|
23
|
-
**Status:** Done. 1.1–1.3 done (strategic + hygiene read policy; plan linked from STRATEGY P6). 1.4 done —
|
|
23
|
+
**Status:** Done. 1.1–1.3 done (strategic + hygiene read policy; plan linked from STRATEGY P6). 1.4 done — all ~98 scripts migrated to `lib/helpers.sh`; zero duplicated helper blocks remain.
|
|
24
24
|
|
|
25
25
|
| # | Task | Owner | Acceptance |
|
|
26
26
|
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -------------------------------------------------------------------------------------------- |
|
|
@@ -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
|
|
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
|
|
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
|
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | -------------------------------------------------------- |
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
**Goal:** Platform health is measured and improved continuously.
|
|
83
83
|
|
|
84
|
-
**Status:** 5.1 done (shipwright-platform-health.yml with threshold gate). 5.2 done (strategic reads platform-hygiene + AGI rule). 5.3 done (doctor shows platform health counts). 5.4 done (policy.schema.json
|
|
84
|
+
**Status:** 5.1 done (shipwright-platform-health.yml with threshold gate). 5.2 done (strategic reads platform-hygiene + AGI rule; CI workflow now runs hygiene before strategic). 5.3 done (doctor shows platform health counts). 5.4 done (config/policy.schema.json created; ajv validates; integrated in CI). E2E policy tests added (sw-policy-e2e-test.sh, 26 tests).
|
|
85
85
|
|
|
86
86
|
| # | Task | Owner | Acceptance |
|
|
87
87
|
| --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----- | --------------------------------------------------------- |
|
|
@@ -94,9 +94,10 @@
|
|
|
94
94
|
|
|
95
95
|
## Current Snapshot (from platform-refactor scan)
|
|
96
96
|
|
|
97
|
-
- **hardcoded:**
|
|
98
|
-
- **
|
|
99
|
-
-
|
|
97
|
+
- **hardcoded:** 66 | **fallback:** 71 | **TODO:** 38 | **FIXME:** 19 | **HACK/KLUDGE:** 18
|
|
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 (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._
|
|
100
101
|
|
|
101
102
|
---
|
|
102
103
|
|
|
@@ -120,3 +121,6 @@ Sweep workflow (`.github/workflows/shipwright-sweep.yml`) uses hardcoded values:
|
|
|
120
121
|
- **docs/config-policy.md** — Policy usage and roadmap.
|
|
121
122
|
- **scripts/lib/policy.sh** — policy_get helper.
|
|
122
123
|
- **scripts/lib/helpers.sh** — Canonical colors and output helpers.
|
|
124
|
+
- **config/policy.schema.json** — JSON Schema for policy validation.
|
|
125
|
+
- **docs/PLATFORM-TODO-TRIAGE.md** — Phase 4 TODO/FIXME/HACK triage results.
|
|
126
|
+
- **scripts/sw-policy-e2e-test.sh** — E2E policy integration tests (26 tests).
|
package/docs/AGI-WHATS-NEXT.md
CHANGED
|
@@ -20,45 +20,51 @@
|
|
|
20
20
|
| Item | What | Next step |
|
|
21
21
|
| ------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
22
22
|
| ~~**Phase 3 libs not sourced**~~ | **Done.** `pipeline-quality.sh` sourced by `sw-pipeline.sh` and `sw-quality.sh`; `daemon-health.sh` sourced by `sw-daemon.sh`. | Wired and verified. |
|
|
23
|
-
|
|
|
23
|
+
| ~~**Policy JSON Schema validation**~~ | **Done.** `config/policy.schema.json` created; `ajv-cli` validates successfully; optional step in platform-health workflow confirmed working. | Validated locally; trigger workflow_dispatch in CI to confirm. |
|
|
24
24
|
| ~~**Sweep workflow still hardcoded**~~ | **Done.** Sweep workflow now checks out repo, reads `config/policy.json`, and exports `STUCK_THRESHOLD_HOURS`, `RETRY_TEMPLATE`, `RETRY_MAX_ITERATIONS`, `STUCK_RETRY_MAX_ITERATIONS` to env. | Wired. |
|
|
25
|
-
| ~~**Helpers adoption (Phase 1.4)**~~ | **Done.**
|
|
25
|
+
| ~~**Helpers adoption (Phase 1.4)**~~ | **Done.** All ~98 scripts migrated to `lib/helpers.sh`. Zero duplicated info/success/warn/error blocks remain. | Complete. |
|
|
26
26
|
| **Monolith decomposition (Phase 3.1–3.4)** | Pipeline stages, pipeline quality gate, daemon poll loop, daemon health are **not** extracted into separate sourced files. Line counts unchanged (8600+ / 6000+). | Defer or do incrementally: extract one module (e.g. pipeline quality gate block) and source it. |
|
|
27
27
|
|
|
28
28
|
---
|
|
29
29
|
|
|
30
30
|
## 3. Not integrated
|
|
31
31
|
|
|
32
|
-
| Item
|
|
33
|
-
|
|
|
34
|
-
| ~~**pipeline-quality.sh**~~
|
|
35
|
-
| ~~**daemon-health.sh**~~
|
|
36
|
-
|
|
|
37
|
-
| ~~**Test suite and policy**~~
|
|
32
|
+
| Item | What | Next step |
|
|
33
|
+
| ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
|
|
34
|
+
| ~~**pipeline-quality.sh**~~ | **Done.** Sourced by `sw-pipeline.sh` and `sw-quality.sh`; duplicate policy_get for thresholds removed. | Wired. |
|
|
35
|
+
| ~~**daemon-health.sh**~~ | **Done.** Sourced by `sw-daemon.sh`; `get_adaptive_heartbeat_timeout` calls `daemon_health_timeout_for_stage` when loaded. | Wired. |
|
|
36
|
+
| ~~**Strategic + platform-hygiene**~~ | **Done.** `shipwright-strategic.yml` now runs `hygiene platform-refactor` before strategic analysis, feeding fresh data to the AI agent. | Wired. |
|
|
37
|
+
| ~~**Test suite and policy**~~ | **Done.** Policy read test added to `sw-hygiene-test.sh` (Test 12): verifies `policy_get` reads from config and returns default when key missing. | Covered. |
|
|
38
38
|
|
|
39
39
|
---
|
|
40
40
|
|
|
41
41
|
## 4. Not audited E2E
|
|
42
42
|
|
|
43
|
-
| Item
|
|
44
|
-
|
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
| **Platform-health workflow E2E**
|
|
48
|
-
|
|
|
49
|
-
|
|
|
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
|
|
|
53
53
|
## 5. Summary checklist
|
|
54
54
|
|
|
55
55
|
- [x] **Wire or remove** pipeline-quality.sh and daemon-health.sh — sourced in pipeline, quality, daemon.
|
|
56
|
-
- [
|
|
56
|
+
- [x] **Policy schema** — `config/policy.schema.json` created; ajv validates successfully; integrated in CI.
|
|
57
57
|
- [x] **Sweep** — Workflow reads policy.json and exports env vars.
|
|
58
|
-
- [x] **Helpers** —
|
|
59
|
-
- [x] **Test** — Policy read test in hygiene-test.sh (Test 12).
|
|
60
|
-
- [
|
|
61
|
-
- [
|
|
58
|
+
- [x] **Helpers** — All ~98 scripts migrated to lib/helpers.sh; zero duplicated helper blocks remain.
|
|
59
|
+
- [x] **Test** — Policy read test in hygiene-test.sh (Test 12) + 26 E2E policy tests in sw-policy-e2e-test.sh.
|
|
60
|
+
- [x] **E2E** — Pipeline + daemon policy assertions in sw-policy-e2e-test.sh; platform-health workflow validated locally.
|
|
61
|
+
- [x] **TODO/FIXME/HACK** — Phase 4 triage complete: 4 github-issue, 3 accepted-debt, 0 stale. See `docs/PLATFORM-TODO-TRIAGE.md`.
|
|
62
|
+
- [x] **Strategic + hygiene** — Strategic CI workflow now runs hygiene platform-refactor before analysis.
|
|
63
|
+
- [ ] **Platform-health workflow_dispatch** — Trigger once in CI to confirm end-to-end execution.
|
|
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.
|
|
62
68
|
|
|
63
69
|
---
|
|
64
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
|
@@ -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
|