@openthink/stamp 1.5.2 → 1.6.1
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 +86 -9
- package/dist/hooks/pre-receive.cjs.map +1 -1
- package/dist/index.js +599 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -39,12 +39,20 @@ what guarantees you actually get:
|
|
|
39
39
|
|
|
40
40
|
| Shape | Origin is… | Enforcement | Command to run |
|
|
41
41
|
|---|---|---|---|
|
|
42
|
-
| **Server-gated**
|
|
43
|
-
| **
|
|
42
|
+
| **Server-gated** | A stamp server you deployed | The server's pre-receive hook rejects any push without a valid stamped merge | `stamp bootstrap` on a clone of a server-provisioned repo |
|
|
43
|
+
| **PR-check** (recommended for GitHub teams) | GitHub directly | A GitHub Action (`stamp/verify-attestation@v1.6.0`) runs on every PR; branch protection requires the green check before the GitHub merge button works | `stamp init` (defaults to PR-check on a github.com origin) |
|
|
44
|
+
| **Local-only** (advisory) | GitHub / GitLab / etc. directly | None — direct `git push origin main` succeeds; the stamp config is documentation + a discipline aid | `stamp init --mode local-only --no-pr-check` |
|
|
44
45
|
|
|
45
|
-
These are not interchangeable. Server-gated
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
These are not interchangeable. Server-gated and PR-check both enforce the
|
|
47
|
+
gate; local-only signs your merges with a verifiable attestation but the
|
|
48
|
+
remote does not reject anything. Pick deliberately.
|
|
49
|
+
|
|
50
|
+
PR-check mode is the natural fit for teams that already merge through GitHub
|
|
51
|
+
PRs. The reviewer flow stays local (`stamp review` runs your AI personas on
|
|
52
|
+
your machine, full speed and full control), the resulting attestation is
|
|
53
|
+
content-addressed (survives squash + rebase + merge-commit), and the PR's
|
|
54
|
+
green-check requirement keeps the human in the merge loop. No server to
|
|
55
|
+
host, no on-call, no separate trust root.
|
|
48
56
|
|
|
49
57
|
### Server-gated path
|
|
50
58
|
|
|
@@ -62,19 +70,63 @@ the three starter reviewers (security, standards, product), and lands them on
|
|
|
62
70
|
`main` via a single signed merge that the server hook accepts. From there it's
|
|
63
71
|
the normal review/merge cycle.
|
|
64
72
|
|
|
73
|
+
### PR-check path
|
|
74
|
+
|
|
75
|
+
For teams that merge through GitHub PRs, `stamp init` (with no `--mode`
|
|
76
|
+
flag against a github.com origin) drops a `.github/workflows/stamp-verify.yml`
|
|
77
|
+
that runs the verifier on every PR. Wire it into branch protection and the
|
|
78
|
+
gate is real:
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
cd myproject
|
|
82
|
+
stamp init # scaffolds .stamp/ + workflow file
|
|
83
|
+
git add .stamp .github && git commit -m "stamp: scaffold + PR-check workflow"
|
|
84
|
+
git push origin main
|
|
85
|
+
# In GitHub: Settings → Branches → main → Require status checks →
|
|
86
|
+
# add `stamp verify` (the workflow's job name) as required
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Per-PR developer flow:
|
|
90
|
+
|
|
91
|
+
```sh
|
|
92
|
+
git checkout -b feature
|
|
93
|
+
# ...make changes, commit...
|
|
94
|
+
stamp review --diff main..HEAD # local AI reviewers run + verdicts land in DB
|
|
95
|
+
stamp attest --into main --push origin # signs the attestation + atomically pushes
|
|
96
|
+
# branch + refs/stamp/attestations/<patch-id>
|
|
97
|
+
# Open the PR; the workflow runs stamp/verify-attestation against your branch
|
|
98
|
+
# Reviewer's check goes green → human clicks merge in the GitHub UI
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The attestation is keyed on the **content** of the diff (`git patch-id`), so
|
|
102
|
+
it survives every GitHub merge strategy: squash, rebase, and merge-commit
|
|
103
|
+
all preserve the same patch-id and the same attestation.
|
|
104
|
+
|
|
105
|
+
By default the gate is **loose on base advancement** (matches GitHub's
|
|
106
|
+
"approval persists when main moves" semantic) — the patch-id-equivalence is
|
|
107
|
+
sufficient. Set `strict_base: true` under your branch rule in
|
|
108
|
+
`.stamp/config.yml` to require re-attest whenever the target branch's tip
|
|
109
|
+
advances.
|
|
110
|
+
|
|
65
111
|
### Local-only path
|
|
66
112
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
113
|
+
`--mode local-only` and `--no-pr-check` are independent flags — local-only
|
|
114
|
+
controls what `AGENTS.md` says about enforcement; `--no-pr-check` controls
|
|
115
|
+
whether the workflow file is scaffolded. To get the pre-1.6.0 behavior
|
|
116
|
+
(`.stamp/` + `AGENTS.md` only, no GitHub Action), pass BOTH:
|
|
70
117
|
|
|
71
118
|
```sh
|
|
72
119
|
cd myproject
|
|
73
|
-
stamp init --mode local-only
|
|
120
|
+
stamp init --mode local-only --no-pr-check # scaffolds .stamp/ + AGENTS.md only
|
|
74
121
|
git add .stamp AGENTS.md && git commit -m "stamp: advisory config"
|
|
75
122
|
git push origin main
|
|
76
123
|
```
|
|
77
124
|
|
|
125
|
+
`--mode local-only` alone (without `--no-pr-check`) still drops the workflow
|
|
126
|
+
— operators using local-only often mirror to GitHub for visibility, and the
|
|
127
|
+
PR check makes that mirror useful as a gate. Skip the workflow only when you
|
|
128
|
+
explicitly don't want it.
|
|
129
|
+
|
|
78
130
|
You can still run `stamp review` / `stamp merge` / `stamp verify` against this
|
|
79
131
|
repo — the merge commits carry signed attestations and `stamp verify <sha>`
|
|
80
132
|
validates them on any clone. What you don't get: server-side rejection of
|
|
@@ -173,6 +225,31 @@ stamp push <target> # plain git push; hook stderr forward
|
|
|
173
225
|
stamp verify <sha> # verify a merge commit's attestation locally
|
|
174
226
|
```
|
|
175
227
|
|
|
228
|
+
**PR-check mode (alternative to `stamp merge` for GitHub PR workflows):**
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
stamp attest [<branch>] --into <target> [--push <remote>]
|
|
232
|
+
# validate the gate, sign an attestation envelope,
|
|
233
|
+
# write to refs/stamp/attestations/<patch-id>;
|
|
234
|
+
# with --push, also git push --atomic branch +
|
|
235
|
+
# attestation ref to <remote> in one transaction
|
|
236
|
+
stamp verify-pr <head> --base <ref> --into <branch>
|
|
237
|
+
# consumer side; used by stamp/verify-attestation@v1
|
|
238
|
+
# action and runnable locally for debugging
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**User & invite management (server-gated mode only):**
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
stamp invites mint <name> --role <admin|member> # mint a single-use invite token
|
|
245
|
+
stamp invites accept <share-url> # redeem an invite token
|
|
246
|
+
stamp users list # enumerate enrolled users
|
|
247
|
+
stamp users promote <name> --to <admin|owner> # owner-only
|
|
248
|
+
stamp users demote <name> --to <admin|member> # owner-only
|
|
249
|
+
stamp users remove <name> # owner / admin-removes-member
|
|
250
|
+
stamp trust grant <name> # stage a per-repo signing-trust PR
|
|
251
|
+
```
|
|
252
|
+
|
|
176
253
|
**Browsing history:**
|
|
177
254
|
|
|
178
255
|
```
|