shipcraft 2.45.0 → 2.47.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.
Files changed (2) hide show
  1. package/README.md +40 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -19,6 +19,18 @@ A coding agent asked to make a failing test pass has two ways to do it: fix the
19
19
 
20
20
  Prose rules in `AGENTS.md` ("never edit the tests") help, but nothing enforces them. Shipcraft turns that rule into a mechanical check that runs where agents can't argue with it: in the git hook and again in CI.
21
21
 
22
+ ## What it catches
23
+
24
+ | The problem | What Shipcraft does |
25
+ |---|---|
26
+ | An agent edits, skips or deletes a failing test, or changes the test config, so the suite goes green | The git hook refuses the commit, in three lines: what happened, why, and the next step |
27
+ | Someone skips the hook (`git commit --no-verify`, an edited hook) | `shipcraft ci` re-checks every commit of the branch from a clean checkout; the full suite runs in CI too, on your machine or in your GitHub checks ([docs/github-ci.md](docs/github-ci.md)), except on docs-only PRs |
28
+ | A PR changes the config to switch off its own checks | The PR is judged by the config on the base branch, not by its own |
29
+ | The code that passes the tests was never read by anyone else | A different agent (Codex, Claude or Gemini) reviews the PR against your spec; a blocker counts only if it reproduced it |
30
+ | A merge goes in before CI and review are green | `shipcraft merge` refuses; `--no-review "<reason>"` waives the review, never CI, and the reason is recorded in the PR and in the numbers |
31
+ | Agents that don't know the process | `init` writes the cycle into `AGENTS.md`, and every refusal names the next step, often the exact command |
32
+ | No way to tell whether the process pays for itself | Every hook, CI and review run is logged on your machine; `shipcraft report` gives the times and refusals |
33
+
22
34
  ## How it works
23
35
 
24
36
  Work is split into two roles, and they should be different agents (or an agent and you):
@@ -40,7 +52,7 @@ flowchart LR
40
52
  H --> I["shipcraft merge"]
41
53
  ```
42
54
 
43
- The hook only runs the locked cases, so commits stay fast. `shipcraft ci` then repeats every check on every commit of the branch, from a clean checkout, and runs the full suite. A commit made with `--no-verify` or with an edited hook is caught there.
55
+ The hook only runs the locked cases, so commits stay fast. `shipcraft ci` then repeats every check on every commit of the branch, from a clean checkout, and the full suite runs in CI, on your machine or in your GitHub checks (docs-only PRs skip it). A commit made with `--no-verify` or with an edited hook is caught there.
44
56
 
45
57
  Every refusal is three lines: **what happened, why it matters, and the next step**. Most "Next" lines contain the exact command to run, so an agent that has never heard of Shipcraft can recover on its own.
46
58
 
@@ -54,6 +66,13 @@ Every refusal is three lines: **what happened, why it matters, and the next step
54
66
 
55
67
  ## Quick start
56
68
 
69
+ What you need:
70
+
71
+ - **macOS** (Apple silicon or Intel) for the npm package and `install.sh`. On Linux, build from source (below). Windows is not supported.
72
+ - **git**, and a project with tests: Python with pytest, TypeScript/JavaScript with vitest or jest, Go with [gotestsum](https://github.com/gotestyourself/gotestsum) (`go install gotest.tools/gotestsum@latest`), or any runner that writes JUnit XML (see [Configuration](#configuration)).
73
+ - Optional, for `shipcraft pr` and `shipcraft merge`: a GitHub remote named `origin` and `gh` logged in.
74
+ - Optional, for the review: the `codex`, `claude` or `gemini` CLI. The review sends the diff to that agent's provider; without one, `init` turns the review off.
75
+
57
76
  Installing is two steps, and step 2 is required: add the package (or the binary), then run `init` at the repository root. `init` sets up Shipcraft and wires its hooks; until it runs, Shipcraft checks none of your commits. From the npm package, step 2 is `pnpm exec shipcraft init` or `npx -- shipcraft init`.
58
77
 
59
78
  ```bash
@@ -113,6 +132,24 @@ shipcraft merge 42
113
132
 
114
133
  Without a GitHub remote, the cycle still works up to the commits: `red`, the hook and `shipcraft ci --base <ref>` run locally; `pr` and `merge` need GitHub.
115
134
 
135
+ ### See it refuse
136
+
137
+ After the RED commit, before you write the code, try the four shortcuts an agent takes. Make each change, run `git commit -am "fix rounding"`, read the refusal, and undo it with `git restore --staged --worktree <file>` before the next one:
138
+
139
+ 1. change the expected value in a locked test: `shipcraft refused: locked test <file> changed after RED`;
140
+ 2. skip the test (`t.Skip`, `pytest.mark.skip`, `it.skip`): the same refusal;
141
+ 3. delete the test file: `shipcraft refused: locked file <file> was deleted`;
142
+ 4. change `.shipcraft.toml`: `shipcraft refused: .shipcraft.toml changed … with lock … open`.
143
+
144
+ Each refusal goes on with a `Why:` line and a `Next:` line that says how to recover.
145
+
146
+ ### Removing Shipcraft
147
+
148
+ 1. Remove the binary: `pnpm remove shipcraft` (or `npm rm shipcraft`) with the npm install, `install.sh --uninstall` with the script, or `cargo uninstall shipcraft` from source.
149
+ 2. Delete `.shipcraft.toml` and the `.shipcraft/` folder.
150
+ 3. Remove the block between `<!-- shipcraft -->` and `<!-- /shipcraft -->` in `AGENTS.md` and in `CLAUDE.md` (delete either file if `init` created it and nothing else is in it).
151
+ 4. Remove the hooks: with plain git hooks, `commit-msg` and `post-commit` in the hooks folder (`git rev-parse --git-path hooks` prints it), the two files marked `# shipcraft hook`; with lefthook, husky or pre-commit, the `shipcraft` lines in the hook manager's file.
152
+
116
153
  Upgrading: with the npm install, `pnpm add -DE shipcraft@latest` (or `npm i -D --save-exact shipcraft@latest`) and commit `package.json` with the lockfile; every clone then gets the same version. To go back, pin the previous one exactly: `pnpm add -DE shipcraft@<version>`, and commit both files again. With `install.sh`, run it again, or `install.sh --version <version>`. A version older than the config's `shipcraft_min` refuses to run: going back past it also means lowering `shipcraft_min` in `.shipcraft.toml`, with no lock open. Release notes say which version to go back to when a release changes something you may want to undo.
117
154
 
118
155
  ## Commands
@@ -124,7 +161,7 @@ Upgrading: with the npm install, `pnpm add -DE shipcraft@latest` (or `npm i -D -
124
161
  | `shipcraft red` | Runs the suite, requires assertion failures, and writes the lock in `.shipcraft/locks/<id>.json`. |
125
162
  | `shipcraft check [--commit-msg <file>]` | Called by the hook. Judges the commit being made against open locks and closes a lock when its cases pass. |
126
163
  | `shipcraft close` | Closes a lock in its own commit; the post-commit hook runs it, and you can run it by hand. |
127
- | `shipcraft ci --base <ref> [--pr]` | Re-checks every commit in `<ref>..HEAD` and runs the full suite on HEAD. Runs locally or in GitHub Actions. |
164
+ | `shipcraft ci --base <ref> [--pr]` | Re-checks every commit in `<ref>..HEAD` and runs the full suite on HEAD, unless the PR is docs only or `[execution] suite_checks` leaves the suite to your GitHub checks. Runs locally or in GitHub Actions. |
128
165
  | `shipcraft pr [--title <t>] [--body <file>]` | Pushes the branch, opens or updates the PR, runs CI and review, and publishes the `shipcraft/ci` and `shipcraft/review` statuses. |
129
166
  | `shipcraft review [--pr <n>]` | Runs the review on the local HEAD (to catch blockers before opening the PR) or on any PR. |
130
167
  | `shipcraft merge <pr> [--no-review "<reason>"]` | Merges only when CI and review are green on the PR's head. `--no-review "<reason>"` is the recorded way out, and the reason shows up in the PR and in the numbers. |
@@ -223,7 +260,7 @@ Shipcraft is developed with Shipcraft: specs in `docs/`, RED and GREEN by separa
223
260
 
224
261
  ## Contributing
225
262
 
226
- Pull requests from outside the project are not accepted for now; bug reports and field reports are welcome as issues. See [CONTRIBUTING.md](CONTRIBUTING.md), and [SECURITY.md](SECURITY.md) for vulnerabilities.
263
+ Pull requests from outside the project are not accepted for now; bug reports and field reports are welcome as issues. Tried it? A field report helps most: where you got stuck in this README, how long the hook took, and any refusal that looked wrong, with its three lines. See [CONTRIBUTING.md](CONTRIBUTING.md), and [SECURITY.md](SECURITY.md) for vulnerabilities.
227
264
 
228
265
  ## License
229
266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipcraft",
3
- "version": "2.45.0",
3
+ "version": "2.47.0",
4
4
  "description": "A seatbelt for test-driven development with coding agents: locks the tests at RED so GREEN cannot quietly undo them.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": { "type": "git", "url": "git+https://github.com/victorassisalves/shipcraft.git" },
@@ -10,7 +10,7 @@
10
10
  "files": ["bin/shipcraft.js", "LICENSE", "README.md"],
11
11
  "engines": { "node": ">=18" },
12
12
  "optionalDependencies": {
13
- "shipcraft-darwin-arm64": "2.45.0",
14
- "shipcraft-darwin-x64": "2.45.0"
13
+ "shipcraft-darwin-arm64": "2.47.0",
14
+ "shipcraft-darwin-x64": "2.47.0"
15
15
  }
16
16
  }