@agenticcli/shipguard 0.5.1 → 0.6.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 +20 -1
- package/dist/checksum-manifest.json +5 -5
- package/dist/{chunk-QUBEIHTH.js → chunk-3NSULPWH.js} +32 -1
- package/dist/{chunk-R2U4UQXN.js → chunk-KYVEU6H4.js} +338 -45
- package/dist/{chunk-5T42QTNT.js → chunk-MPQ42F54.js} +25 -7
- package/dist/cli-facts.json +45 -10
- package/dist/cli.js +2557 -280
- package/dist/{config-generator-TUQCF2SD.js → config-generator-2AC37XZ2.js} +2 -2
- package/dist/{dist-PI34PRNW.js → dist-3SW45O4F.js} +3 -1
- package/dist/{pro-scanner-MAKMWHIY.js → pro-scanner-3DY7KU5C.js} +2 -2
- package/docs/placement-kit.md +105 -0
- package/package.json +15 -14
- package/rules/free-bundle.json +1307 -0
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
DEFAULT_MAX_FILES,
|
|
3
3
|
DEFAULT_MAX_FILE_SIZE_BYTES,
|
|
4
4
|
DEFAULT_MAX_TOTAL_BYTES
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-3NSULPWH.js";
|
|
6
|
+
import "./chunk-MPQ42F54.js";
|
|
7
7
|
|
|
8
8
|
// src/core/config-generator.ts
|
|
9
9
|
import { writeFileSync, existsSync } from "fs";
|
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
allConformanceVectors,
|
|
15
15
|
canonicalJson,
|
|
16
16
|
canonicalizeFinding,
|
|
17
|
+
compileCached,
|
|
17
18
|
computeExecutableHash,
|
|
18
19
|
computeMatcherRuntimeId,
|
|
19
20
|
decodeUtf8Strict,
|
|
@@ -34,7 +35,7 @@ import {
|
|
|
34
35
|
selectExpected,
|
|
35
36
|
stripBom,
|
|
36
37
|
verifyExactSet
|
|
37
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MPQ42F54.js";
|
|
38
39
|
export {
|
|
39
40
|
CapTracker,
|
|
40
41
|
DEFAULT_CAPS,
|
|
@@ -51,6 +52,7 @@ export {
|
|
|
51
52
|
allConformanceVectors,
|
|
52
53
|
canonicalJson,
|
|
53
54
|
canonicalizeFinding,
|
|
55
|
+
compileCached,
|
|
54
56
|
computeExecutableHash,
|
|
55
57
|
computeMatcherRuntimeId,
|
|
56
58
|
decodeUtf8Strict,
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# ShipGuard placement kit
|
|
2
|
+
|
|
3
|
+
Copy-paste blocks for the three places ShipGuard needs to exist: your agent's instructions,
|
|
4
|
+
your Claude Code project config, and CI.
|
|
5
|
+
|
|
6
|
+
**The rule that makes the rest make sense:** a snippet TEACHES, a hook ENFORCES. Text in a
|
|
7
|
+
repo file is advice a model can talk itself out of — agents have been observed using
|
|
8
|
+
`git commit --no-verify` across consecutive commits despite explicit deny rules. So put the
|
|
9
|
+
snippet in for understanding, and install the hook for enforcement:
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
shipguard hook # git pre-push + pre-merge-commit
|
|
13
|
+
shipguard hook --target claude # runs outside the model — the agent can't route around it
|
|
14
|
+
shipguard hook --target ci # server-side — nothing local can skip it
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## 1. `AGENTS.md` snippet
|
|
20
|
+
|
|
21
|
+
Paste this into your repo's `AGENTS.md`. Most coding agents read that file; **Claude Code
|
|
22
|
+
does not**, which is why section 2 exists as well — an `AGENTS.md`-only setup leaves those
|
|
23
|
+
callers uncovered.
|
|
24
|
+
|
|
25
|
+
```markdown
|
|
26
|
+
## Release gate — ShipGuard
|
|
27
|
+
|
|
28
|
+
Before you merge, push, or tell the user something is ready to ship, run:
|
|
29
|
+
|
|
30
|
+
shipguard scan --json --strict
|
|
31
|
+
|
|
32
|
+
Exit code 0 does NOT mean "safe". It means "the scan ran". Read the JSON:
|
|
33
|
+
|
|
34
|
+
- `recommendation` is the verdict: `SAFE_TO_SHIP`, `REVIEW_BEFORE_SHIP`, or `DO_NOT_SHIP`.
|
|
35
|
+
- `degraded: true` means the scan could not check everything. The verdict is then always
|
|
36
|
+
`DO_NOT_SHIP`, and `degradedReasons[].code` says why. Fix the cause; do not ship past it.
|
|
37
|
+
- With `--strict`, exit 1 means blocked — by a blocking finding OR by an unfinished scan.
|
|
38
|
+
|
|
39
|
+
Never report a scan as passing on the exit code alone. Never pass `--no-verify` to get
|
|
40
|
+
around a ShipGuard hook.
|
|
41
|
+
|
|
42
|
+
Run `shipguard schema --json` for the full contract: verdict values, exit-code meanings,
|
|
43
|
+
and this project's scan limits.
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## 2. `CLAUDE.md` import line
|
|
49
|
+
|
|
50
|
+
Claude Code reads `CLAUDE.md`, not `AGENTS.md`. Add this one line so the same instructions
|
|
51
|
+
load for Claude Code sessions without maintaining two copies:
|
|
52
|
+
|
|
53
|
+
```markdown
|
|
54
|
+
@AGENTS.md
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If you would rather not import the whole file, paste the section-1 block directly into
|
|
58
|
+
`CLAUDE.md` instead. Either way, remember section 2 only teaches — run
|
|
59
|
+
`shipguard hook --target claude` to make it binding.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 3. GitHub Actions verdict job
|
|
64
|
+
|
|
65
|
+
`shipguard hook --target ci` writes this file for you at
|
|
66
|
+
`.github/workflows/shipguard.yml`. It is reproduced here so you can review it before
|
|
67
|
+
installing, or add it by hand:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
name: ShipGuard release gate
|
|
71
|
+
|
|
72
|
+
on:
|
|
73
|
+
pull_request:
|
|
74
|
+
push:
|
|
75
|
+
branches: [main]
|
|
76
|
+
|
|
77
|
+
jobs:
|
|
78
|
+
shipguard:
|
|
79
|
+
name: ShipGuard verdict
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
steps:
|
|
82
|
+
- uses: actions/checkout@v4
|
|
83
|
+
- uses: actions/setup-node@v4
|
|
84
|
+
with:
|
|
85
|
+
node-version: '20'
|
|
86
|
+
- name: Run the release gate
|
|
87
|
+
run: npx --yes @agenticcli/shipguard scan --json --strict
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Turn on branch protection for the **ShipGuard verdict** check. Without it the job is
|
|
91
|
+
advisory: a red check that nothing requires is a suggestion, not a gate.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Which layer binds whom
|
|
96
|
+
|
|
97
|
+
| Layer | Binds humans | Binds agents | Skippable |
|
|
98
|
+
|---|---|---|---|
|
|
99
|
+
| `AGENTS.md` / `CLAUDE.md` snippet | teaches | teaches | entirely — it is text |
|
|
100
|
+
| git hook (`shipguard hook`) | yes | only well-behaved ones | `--no-verify` |
|
|
101
|
+
| Claude Code hook (`--target claude`) | n/a | yes — runs outside the model | only by editing the settings file |
|
|
102
|
+
| CI job + branch protection (`--target ci`) | yes | yes | no |
|
|
103
|
+
|
|
104
|
+
Install all three where you can. ShipGuard never blocks on its own — that is the point of
|
|
105
|
+
the passive default. Installing a hook is the deliberate act that turns the hard stop on.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticcli/shipguard",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "CLI-first release gate for AI-built apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli.js",
|
|
@@ -9,19 +9,11 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist",
|
|
12
|
+
"rules",
|
|
12
13
|
"templates",
|
|
13
14
|
"docs",
|
|
14
15
|
"README.md"
|
|
15
16
|
],
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsup",
|
|
18
|
-
"dev": "tsup --watch",
|
|
19
|
-
"lint": "eslint src --ext .ts",
|
|
20
|
-
"prepublishOnly": "bash \"$(git rev-parse --show-toplevel)/scripts/release-gate.sh\"",
|
|
21
|
-
"test": "vitest run",
|
|
22
|
-
"test:watch": "vitest",
|
|
23
|
-
"clean": "rm -rf dist"
|
|
24
|
-
},
|
|
25
17
|
"dependencies": {
|
|
26
18
|
"@noble/hashes": "^2.2.0",
|
|
27
19
|
"chalk": "^5.4.0",
|
|
@@ -33,15 +25,15 @@
|
|
|
33
25
|
"yaml": "^2.7.0"
|
|
34
26
|
},
|
|
35
27
|
"devDependencies": {
|
|
36
|
-
"@agenticcli/matcher-contract": "workspace:*",
|
|
37
|
-
"@agenticcli/shared": "workspace:*",
|
|
38
28
|
"@types/node": "^22.0.0",
|
|
39
29
|
"@typescript-eslint/eslint-plugin": "^7",
|
|
40
30
|
"@typescript-eslint/parser": "^7",
|
|
41
31
|
"eslint": "^8",
|
|
42
32
|
"tsup": "^8.5.1",
|
|
43
33
|
"typescript": "^5.8.0",
|
|
44
|
-
"vitest": "^3.2.0"
|
|
34
|
+
"vitest": "^3.2.0",
|
|
35
|
+
"@agenticcli/shared": "0.1.0",
|
|
36
|
+
"@agenticcli/matcher-contract": "0.5.1"
|
|
45
37
|
},
|
|
46
38
|
"keywords": [
|
|
47
39
|
"shipguard",
|
|
@@ -74,5 +66,14 @@
|
|
|
74
66
|
},
|
|
75
67
|
"publishConfig": {
|
|
76
68
|
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "tsup",
|
|
72
|
+
"dev": "tsup --watch",
|
|
73
|
+
"lint": "eslint src --ext .ts",
|
|
74
|
+
"test": "vitest run",
|
|
75
|
+
"test:slow": "VITEST_SLOW=1 vitest run tests/slow",
|
|
76
|
+
"test:watch": "vitest",
|
|
77
|
+
"clean": "rm -rf dist"
|
|
77
78
|
}
|
|
78
|
-
}
|
|
79
|
+
}
|