@jakobm/peacekeeper 0.26.0 → 0.27.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 +294 -98
- package/dist/cmdabra.yaml +174 -116
- package/dist/package.json +5 -5
- package/dist/src/modules/cli/legacy-commands.js +37 -0
- package/dist/src/modules/cli/service.js +48 -40
- package/dist/src/modules/configuration/facade.js +1 -0
- package/dist/src/modules/configuration/project-config-defaults.json +2 -1
- package/dist/src/modules/configuration/project-config.js +20 -8
- package/dist/src/modules/configuration/update-config.js +16 -2
- package/dist/src/modules/dependencies.yaml +1 -1
- package/dist/src/modules/lifecycle/checkpoint-instructions.js +1 -1
- package/dist/src/modules/lifecycle/cleanup-ended-session.js +1 -1
- package/dist/src/modules/maintenance/cleanup-merged-branches.js +4 -4
- package/dist/src/modules/maintenance/initialize-codex-worktree.js +1 -1
- package/dist/src/modules/maintenance/remove-empty-directories.js +1 -1
- package/dist/src/modules/projects/check-project-requirements.txt +32 -31
- package/dist/src/modules/projects/check-project.js +16 -16
- package/dist/src/modules/projects/codex-setup-prefix.sh +2 -2
- package/dist/src/modules/projects/create-project-core.js +13 -28
- package/dist/src/modules/projects/generate-github-setup.js +16 -55
- package/dist/src/modules/projects/github-setup-prefix.sh +29 -2
- package/dist/src/modules/projects/github-setup-repository-template.sh +1 -40
- package/dist/src/modules/projects/github-setup-suffix-template.sh +7 -5
- package/dist/src/modules/projects/install-hooks.js +6 -5
- package/dist/src/modules/releases/configure-github.js +57 -0
- package/dist/src/modules/releases/facade.js +3 -2
- package/dist/src/modules/releases/github-configuration.js +166 -0
- package/dist/src/modules/releases/github-policy.js +45 -11
- package/dist/src/modules/releases/github-remote.js +230 -0
- package/dist/src/modules/testing/check-test-receipt.js +17 -22
- package/dist/src/modules/testing/receipt-state.js +27 -1
- package/dist/src/modules/testing/record-test-receipt.js +14 -13
- package/dist/src/modules/testing/run-tests.js +23 -14
- package/dist/src/modules/testing/types.js +1 -0
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -6,6 +6,37 @@ The public npm package is `@jakobm/peacekeeper`; its CLI command is `peacekeeper
|
|
|
6
6
|
Install it with `npm install --save-exact @jakobm/peacekeeper@<version>`, selecting
|
|
7
7
|
a published version. Replace the example dependency pin below with that version.
|
|
8
8
|
|
|
9
|
+
## Command groups
|
|
10
|
+
|
|
11
|
+
Use `peacekeeper <group> <command>`. Running a group without a command displays
|
|
12
|
+
its help; `--help` also works at the root, group, and command levels. Shell
|
|
13
|
+
completion follows the same hierarchy.
|
|
14
|
+
|
|
15
|
+
| Group | Commands |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| `project` | `create`, `check`, `update-config`, `check-conventions` |
|
|
18
|
+
| `test` | `run`, `check-receipt`, `record-receipt` |
|
|
19
|
+
| `github` | `configure`, `generate-setup` |
|
|
20
|
+
| `release` | `assess`, `verify`, `verify-protection`, `verify-version`, `publish` |
|
|
21
|
+
| `codex` | `install-hooks`, `init-worktree`, `checkpoint`, `session-start`, `stop`, `session-end` |
|
|
22
|
+
| `cleanup` | `merged-branches`, `empty-directories`, `queue-merged-worktree` |
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
peacekeeper project check
|
|
26
|
+
peacekeeper test run --checkpoint
|
|
27
|
+
peacekeeper github configure --help
|
|
28
|
+
peacekeeper release publish patch
|
|
29
|
+
peacekeeper cleanup merged-branches --execute
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The previous flat command names remain accepted for existing scripts and hooks.
|
|
33
|
+
For example, `run-tests --checkpoint` maps to `test run --checkpoint`,
|
|
34
|
+
`checkpoint-codex-changes` maps to `codex checkpoint`, and `release patch` maps
|
|
35
|
+
to `release publish patch`. Bare `release` now displays the release group's help.
|
|
36
|
+
Help and generated project files use the grouped names. Update existing package
|
|
37
|
+
scripts and CI to those names, and run `peacekeeper codex install-hooks` to migrate
|
|
38
|
+
lifecycle hooks while preserving unrelated handlers.
|
|
39
|
+
|
|
9
40
|
## Architecture
|
|
10
41
|
|
|
11
42
|
All application code and tests are authored in TypeScript. Domain modules belong to the
|
|
@@ -35,15 +66,33 @@ The CLI also exposes Cmdabra's global `--cmdabra-complete` option for
|
|
|
35
66
|
It accepts the current word index followed by all command-line words and prints
|
|
36
67
|
completion candidates without running a command.
|
|
37
68
|
|
|
69
|
+
## Testing Peacekeeper
|
|
70
|
+
|
|
71
|
+
Run `npm test` with the pinned Volta toolchain to build and run type checks,
|
|
72
|
+
module boundaries, repository conventions, and the complete test suite.
|
|
73
|
+
|
|
74
|
+
Read-only CLI behavior is covered by human-readable `.case` acceptance files in
|
|
75
|
+
[`tests/acceptance`](tests/acceptance/README.md), following the pattern used by
|
|
76
|
+
Ledlight and Cmdabra. Each case runs the actual CLI in an isolated temporary Git
|
|
77
|
+
repository and compares stdout, stderr, and exit status. Sections supply command
|
|
78
|
+
arguments, project configuration, files, environment, and stdin as needed. The
|
|
79
|
+
runner also rejects unexpected file changes.
|
|
80
|
+
|
|
81
|
+
Keep network operations, publishing, background workers, and repository mutations
|
|
82
|
+
in the existing integration suites with controlled dependencies. Acceptance cases
|
|
83
|
+
cover deterministic output and local preflight failures for those commands.
|
|
84
|
+
CLI syntax validation and generated help output are covered by Cmdabra's own tests.
|
|
85
|
+
Expected output is reviewed text; tests never regenerate it automatically.
|
|
86
|
+
|
|
38
87
|
## Create a compliant TypeScript project
|
|
39
88
|
|
|
40
|
-
`create
|
|
89
|
+
`project create` creates a minimal ESM TypeScript library in an existing, completely
|
|
41
90
|
empty GitHub repository. The command version owns the generated project contract,
|
|
42
91
|
all tool pins, and the exact `@jakobm/peacekeeper` development dependency. This
|
|
43
92
|
command additionally requires Volta so generation and verification use those pins.
|
|
44
93
|
|
|
45
94
|
```sh
|
|
46
|
-
peacekeeper
|
|
95
|
+
peacekeeper project create \
|
|
47
96
|
--repository https://github.com/OWNER/REPOSITORY.git \
|
|
48
97
|
--directory /absolute/path/to/REPOSITORY \
|
|
49
98
|
--package-name @scope/REPOSITORY \
|
|
@@ -69,50 +118,151 @@ An argument or preflight failure creates nothing. A later failure leaves the loc
|
|
|
69
118
|
directory for inspection but does not commit or push. A push failure leaves the
|
|
70
119
|
verified local commit. Inspect or remove the directory before retrying.
|
|
71
120
|
|
|
72
|
-
The
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
`
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
To
|
|
121
|
+
The generator creates an executable `setup-github-config.sh` and never runs it.
|
|
122
|
+
Use it in two steps, with the same plan directory:
|
|
123
|
+
|
|
124
|
+
```sh
|
|
125
|
+
./setup-github-config.sh ./github-plans
|
|
126
|
+
# Review every saved plan, including protection deletions.
|
|
127
|
+
./setup-github-config.sh --execute ./github-plans
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
The wrapper invokes the generator's exact `@jakobm/peacekeeper` version through
|
|
131
|
+
`npm exec --package`, then runs `groundskeeper secrets sync --name
|
|
132
|
+
RELEASE_POLICY_TOKEN --new-repo OWNER/REPO` only after every configuration has
|
|
133
|
+
succeeded and been read back. Planning never synchronizes secrets. Published
|
|
134
|
+
projects also require initial manual npm publication and trusted publishing
|
|
135
|
+
configuration; generating or running GitHub setup does not publish a package.
|
|
136
|
+
|
|
137
|
+
To generate the same wrapper for existing repositories:
|
|
89
138
|
|
|
90
139
|
```sh
|
|
91
|
-
peacekeeper generate-
|
|
140
|
+
peacekeeper github generate-setup \
|
|
92
141
|
--repository https://github.com/OWNER/REPOSITORY.git \
|
|
93
|
-
--repository https://github.com/OWNER/ANOTHER-REPOSITORY.git
|
|
142
|
+
--repository https://github.com/OWNER/ANOTHER-REPOSITORY.git > setup-github-config.sh
|
|
94
143
|
```
|
|
95
144
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
145
|
+
Generation reads and validates remote policy and captures the exact source SHA
|
|
146
|
+
for each repository. The wrapper refuses to plan from a different commit if that
|
|
147
|
+
source subsequently moves. For a single repository, `--policy-pr NUMBER` selects
|
|
148
|
+
an introduction/upgrade PR, and `--source-ref COMMIT_SHA` asserts its expected head
|
|
149
|
+
(or the expected default-branch SHA). Generate separate wrappers for repositories
|
|
150
|
+
with different explicit policy sources. Existing generated scripts retain their
|
|
151
|
+
old implementation; regenerate them to adopt this flow.
|
|
152
|
+
|
|
153
|
+
## Plan and apply exact GitHub configuration
|
|
154
|
+
|
|
155
|
+
`github configure` owns GitHub policy for one explicit `OWNER/REPO` on github.com.
|
|
156
|
+
It works outside a Git checkout and reads policy files exclusively from GitHub;
|
|
157
|
+
local configuration, dependencies and target-repository code are not executed.
|
|
158
|
+
Dry-run is the default:
|
|
159
|
+
|
|
160
|
+
```sh
|
|
161
|
+
peacekeeper github configure --repository OWNER/REPO --plan-file github-plan.json
|
|
162
|
+
peacekeeper github configure --plan-file github-plan.json --execute
|
|
163
|
+
|
|
164
|
+
# Bootstrap using an open PR in the same repository targeting its default branch.
|
|
165
|
+
peacekeeper github configure --repository OWNER/REPO --policy-pr 31 \
|
|
166
|
+
--source-ref FULL_HEAD_SHA --plan-file bootstrap-plan.json
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
The source is resolved to an exact commit before reading `peacekeeper.config.yaml`
|
|
170
|
+
and `.github/CODEOWNERS`. An absent configuration uses the running version's
|
|
171
|
+
bundled defaults, including repository-owner fallback for a null
|
|
172
|
+
`git.requiredApprover`. Absence is established from the source Git tree; API or
|
|
173
|
+
permission failures never select defaults. Invalid YAML/schema and legacy
|
|
174
|
+
`peacekeeper.config.json` are errors. The personal repository owner must be the
|
|
175
|
+
required approver, and CODEOWNERS must contain exactly one effective rule,
|
|
176
|
+
`* @OWNER`, even when configuration defaults are used.
|
|
177
|
+
|
|
178
|
+
A policy PR's files are read at its exact head SHA. The result marks this as
|
|
179
|
+
bootstrap: GitHub uses CODEOWNERS from the target branch, so ownership changes in
|
|
180
|
+
that PR only become effective after merge. This command configures GitHub settings
|
|
181
|
+
and never merges the PR or claims that unmerged ownership files are already active.
|
|
182
|
+
`--source-ref` is an expected SHA guard for the selected source, not a way to skip
|
|
183
|
+
PR validation or select an unrelated historical commit.
|
|
184
|
+
|
|
185
|
+
The owned surface is exactly:
|
|
186
|
+
|
|
187
|
+
- Repository merge methods: merge commits enabled, squash and rebase disabled.
|
|
188
|
+
- Repository auto-merge availability and automatic merged-branch deletion enabled.
|
|
189
|
+
- Exactly the two canonical active branch rulesets from the bundled shared policy.
|
|
190
|
+
- No classic branch protection rules anywhere in the repository.
|
|
191
|
+
|
|
192
|
+
**Every other repository-owned branch ruleset and every classic protection rule
|
|
193
|
+
will be deleted, including protections for other branches and wildcard rules
|
|
194
|
+
that do not currently match a branch.** The canonical rulesets protect only the
|
|
195
|
+
default branch; other branches can lose protection. There is no preserve-other-
|
|
196
|
+
branches option. Future exceptions belong in versioned Peacekeeper configuration.
|
|
197
|
+
Secrets, collaborators, deploy keys, webhooks, environments, security settings,
|
|
198
|
+
and tag/push rulesets are outside the owned surface and are preserved. Inherited
|
|
199
|
+
active branch rules that cannot be proven compatible with the canonical policy
|
|
200
|
+
are blockers and must be resolved at their source. Missing bypass visibility or
|
|
201
|
+
incomplete inventory blocks planning instead of assuming there are no restrictions.
|
|
202
|
+
|
|
203
|
+
Dry-run shows every creation, update and deletion with before/after policy and
|
|
204
|
+
blockers. `--plan-file` saves a new JSON file exclusively (existing files are not
|
|
205
|
+
overwritten). Omit it to inspect a plan without saving. Execute requires the saved
|
|
206
|
+
plan. Policy-source overrides cannot be combined with `--execute`; an optional
|
|
207
|
+
`--repository OWNER/REPO` asserts the saved target without changing it. Generated
|
|
208
|
+
wrappers always use this assertion before synchronizing secrets.
|
|
209
|
+
Before writing, Peacekeeper validates the plan against its current canonical
|
|
210
|
+
policy, exact package version, source SHA, default branch/SHA, stable repo identity
|
|
211
|
+
and relevant observed GitHub configuration. A moved source or changed precondition
|
|
212
|
+
requires a new plan. Editing the plan does not authorize arbitrary API requests.
|
|
213
|
+
|
|
214
|
+
The executor establishes and checks the canonical protections before deletions,
|
|
215
|
+
checks relevant remote state between operations and reads the entire owned surface
|
|
216
|
+
back before success. GitHub has no transactions: concurrent changes can still
|
|
217
|
+
occur between checks and API writes. Failures report completed/attempted operations
|
|
218
|
+
and read-back state where available. After a partial failure, plan again into a
|
|
219
|
+
new file/directory and apply the remaining changes; already correct configuration
|
|
220
|
+
needs no rollback. The same recovery applies to a partially completed multi-repo
|
|
221
|
+
wrapper. After verified success, a fresh plan has no changes. Secret synchronization
|
|
222
|
+
is a separate step; a secret-sync failure does not roll back GitHub settings.
|
|
223
|
+
|
|
224
|
+
Use a manually authenticated GitHub identity with repository Administration write
|
|
225
|
+
access for execute, and sufficient Contents/Administration read access for complete
|
|
226
|
+
policy inspection. Do not put admin-write credentials in Actions secrets.
|
|
227
|
+
The shared policy model also serves `release verify-protection`; that existing
|
|
228
|
+
command retains its documented semantic alternatives, including equivalent classic
|
|
229
|
+
protection, while github configure verifies the exact owned configuration.
|
|
230
|
+
|
|
231
|
+
### Machine-readable contract
|
|
232
|
+
|
|
233
|
+
Add `--json` for a JSON result on stdout. Human output is not an automation API.
|
|
234
|
+
Every result contains `resultFormatVersion: 1`, `peacekeeperVersion`, and `status`.
|
|
235
|
+
Planning results include `plan`; failures include an error and/or blocker details.
|
|
236
|
+
Status values are `planned`, `blocked`, `stale`, `partial`, `verification-failed`,
|
|
237
|
+
`succeeded`, and `failed`. Execute results include `completed` and, when available,
|
|
238
|
+
`attempted`, `observed`, `readbackError` and `bootstrap`. A blocked plan can be saved
|
|
239
|
+
for inspection but cannot execute. Planning errors that prevent a complete plan
|
|
240
|
+
return structured blockers without writing a plan file.
|
|
241
|
+
|
|
242
|
+
Saved plans use `formatVersion: 1` and contain `peacekeeperVersion`,
|
|
243
|
+
`repository: { id, slug }`, `source: { kind, sha, defaultBranch, defaultSha,
|
|
244
|
+
policyPr? }`, `bootstrap`, `configSource` (`remote` or `defaults`), `observed`,
|
|
245
|
+
`desired`, `changes` and `blockers`. `observed` covers owned repository settings,
|
|
246
|
+
repository-owned/inherited branch rulesets, and complete classic protection rules
|
|
247
|
+
with allowance actors. `desired` carries canonical settings/rulesets and absence
|
|
248
|
+
requirements. Changes identify their resource `kind`, `action`, existing `id`
|
|
249
|
+
where applicable, and `before`/`after` policy as applicable.
|
|
250
|
+
|
|
251
|
+
Policy arrays are normalized as unordered collections. Response metadata is
|
|
252
|
+
excluded; unknown rule parameters remain significant. GitHub's empty
|
|
253
|
+
`required_reviewers` list and null check integration IDs normalize away, and omitted
|
|
254
|
+
`require_extra_approval_for_unattributed_changes` uses GitHub's true default.
|
|
255
|
+
These rules apply equally to canonical policy and observed state.
|
|
256
|
+
|
|
257
|
+
Exit status is 0 for an unblocked plan (even with changes) or verified execute
|
|
258
|
+
success, 1 for blockers, stale/invalid plans, partial execution or other operational
|
|
259
|
+
failures, and 2 for Cmdabra syntax errors. Plan/execute is a Peacekeeper-owned
|
|
260
|
+
contract, not a generic API request format. Groundskeeper should retain plans
|
|
261
|
+
unchanged and return them to the same exactly pinned Peacekeeper version.
|
|
112
262
|
|
|
113
263
|
When moving an existing project to Peacekeeper, update its dependency and lockfile,
|
|
114
264
|
package scripts, and configuration filename together. Replace previous lifecycle
|
|
115
|
-
hook commands with the definitions below before running `peacekeeper install-hooks`.
|
|
265
|
+
hook commands with the definitions below before running `peacekeeper codex install-hooks`.
|
|
116
266
|
The installer recognizes Peacekeeper commands; it does not translate commands
|
|
117
267
|
from a differently named package. Each existing worktree needs the new dependency
|
|
118
268
|
and configuration. Test receipts start fresh under the new package identity;
|
|
@@ -131,9 +281,9 @@ Include these entries in the caller's `package.json`, alongside its other script
|
|
|
131
281
|
"private": true,
|
|
132
282
|
"scripts": {
|
|
133
283
|
"lint": "eslint .",
|
|
134
|
-
"test": "peacekeeper run
|
|
135
|
-
"cleanup:branches": "peacekeeper cleanup
|
|
136
|
-
"cleanup:empty-directories": "peacekeeper
|
|
284
|
+
"test": "peacekeeper test run",
|
|
285
|
+
"cleanup:branches": "peacekeeper cleanup merged-branches",
|
|
286
|
+
"cleanup:empty-directories": "peacekeeper cleanup empty-directories"
|
|
137
287
|
},
|
|
138
288
|
"devDependencies": {
|
|
139
289
|
"eslint": "^9.39.5"
|
|
@@ -154,9 +304,12 @@ Peacekeeper uses the complete bundled [defaults](src/modules/configuration/proje
|
|
|
154
304
|
The defaults contain no test commands; configure those before running tests or
|
|
155
305
|
recording or reusing a test receipt.
|
|
156
306
|
|
|
157
|
-
Run `peacekeeper update-config` to create the file or recursively fill missing
|
|
307
|
+
Run `peacekeeper project update-config` to create the file or recursively fill missing
|
|
158
308
|
fields from the defaults. Existing values, including empty arrays, are preserved.
|
|
159
309
|
Comments in an existing YAML file are preserved. Review newly inserted values.
|
|
310
|
+
The old `tests.commands` field is migrated to `tests.all`; `tests.checkpoint`
|
|
311
|
+
defaults to an empty list. If both `commands` and `all` exist, resolve that
|
|
312
|
+
ambiguity manually before updating.
|
|
160
313
|
Invalid YAML, unknown fields, or invalid existing
|
|
161
314
|
values cause failure without changing the file. Repeating the command on a
|
|
162
315
|
complete valid file leaves it unchanged.
|
|
@@ -165,11 +318,11 @@ The former `peacekeeper.config.json` filename is not accepted. Rename and conver
|
|
|
165
318
|
it before upgrading so Peacekeeper cannot silently fall back to defaults.
|
|
166
319
|
|
|
167
320
|
All CLI commands validate configuration before executing, except help,
|
|
168
|
-
`
|
|
321
|
+
`project check --explain`, and `project update-config`. Checkpoint hooks instead validate
|
|
169
322
|
the event worktree configuration when the event requires instructions or a check.
|
|
170
323
|
An incomplete existing file fails
|
|
171
324
|
with missing field paths and a repair hint. Updates introducing new fields
|
|
172
|
-
therefore require `peacekeeper update-config` before ordinary commands can run.
|
|
325
|
+
therefore require `peacekeeper project update-config` before ordinary commands can run.
|
|
173
326
|
|
|
174
327
|
Complete example:
|
|
175
328
|
|
|
@@ -187,10 +340,13 @@ git:
|
|
|
187
340
|
- test
|
|
188
341
|
releaseTestWorkflow: test.yml
|
|
189
342
|
tests:
|
|
190
|
-
|
|
343
|
+
all:
|
|
191
344
|
- eslint .
|
|
192
|
-
- peacekeeper check-conventions
|
|
345
|
+
- peacekeeper project check-conventions
|
|
193
346
|
- node --test
|
|
347
|
+
checkpoint:
|
|
348
|
+
- eslint .
|
|
349
|
+
- peacekeeper project check-conventions
|
|
194
350
|
receiptMaxAgeMinutes: 60
|
|
195
351
|
npmTestUsesRunner: true
|
|
196
352
|
conventions:
|
|
@@ -203,7 +359,30 @@ projectChecks:
|
|
|
203
359
|
- test
|
|
204
360
|
```
|
|
205
361
|
|
|
206
|
-
`git.remote` and `git.defaultBranch` identify the branch used for checkpointing and cleanup. `git.branchPrefix` names new task branches. `git.requiredApprover` names the personal GitHub repository owner who must approve other users' PRs and may bypass only the approval ruleset from a PR. Set it explicitly after `update-config`; its bundled default is `null`. The root project must contain `.github/CODEOWNERS` with the single non-comment rule `* @OWNER`, matching this value.
|
|
362
|
+
`git.remote` and `git.defaultBranch` identify the branch used for checkpointing and cleanup. `git.branchPrefix` names new task branches. `git.requiredApprover` names the personal GitHub repository owner who must approve other users' PRs and may bypass only the approval ruleset from a PR. Set it explicitly after `project update-config`; its bundled default is `null`. The root project must contain `.github/CODEOWNERS` with the single non-comment rule `* @OWNER`, matching this value.
|
|
363
|
+
|
|
364
|
+
`peacekeeper test run` is the full test command and runs `tests.all`.
|
|
365
|
+
`peacekeeper test run --checkpoint` runs `tests.checkpoint` instead; the flag
|
|
366
|
+
is off by default. Each consuming project chooses both lists. Every checkpoint
|
|
367
|
+
command must also occur in `all` as the **exact same shell command string**.
|
|
368
|
+
Invalid membership fails configuration validation before either mode executes
|
|
369
|
+
any test commands, including with `--force` or existing receipts. An empty
|
|
370
|
+
checkpoint list is valid, as is one containing all commands. `tests.all` must
|
|
371
|
+
contain at least one command before tests or receipt commands can be used.
|
|
372
|
+
|
|
373
|
+
Both modes always run the local `project check` validation first, even when all
|
|
374
|
+
selected commands have valid receipts or the checkpoint list is empty. Explicit
|
|
375
|
+
`project check` invocations in either list are rejected as redundant. Commands
|
|
376
|
+
run in list order from the caller's Git root; install any executables they use.
|
|
377
|
+
Repeated identical strings run once per invocation. The runner stops at the
|
|
378
|
+
first failure and records a receipt immediately after each successful command.
|
|
379
|
+
|
|
380
|
+
`receiptMaxAgeMinutes` controls how long each command receipt can be reused.
|
|
381
|
+
Set `npmTestUsesRunner` to `true` only when the caller's `npm test` script invokes
|
|
382
|
+
`peacekeeper test run`; the rerun hint then uses `npm test -- --force` (and
|
|
383
|
+
`--checkpoint` when selected). Otherwise it uses the explicit package path.
|
|
384
|
+
`loggingDirectory` stores hook invocation logs relative to the primary Git
|
|
385
|
+
worktree's root.
|
|
207
386
|
|
|
208
387
|
`loggingEnabled` has the bundled default `true`; set it to `false` to disable invocation logs and the background cleanup worker's log file. Existing logs are kept. The setting is read from the primary checkout's configuration, including for linked worktrees. SessionStart and Stop logs include the process and event working directories, event type, primary-checkout classification, and hook response or error. Only selected event fields are logged, never the full incoming payload. These logs require the Peacekeeper script to start; a missing Node.js executable or package must be diagnosed in Codex's own logs.
|
|
209
388
|
|
|
@@ -227,21 +406,38 @@ branch's upstream. If a push fails, earlier pushes are kept and the checkpoint
|
|
|
227
406
|
records a failure; fix the cause and rerun the checkpoint command to retry without
|
|
228
407
|
creating another commit when there are no new changes.
|
|
229
408
|
|
|
230
|
-
Receipts are stored outside the repository under `peacekeeper-test-receipts` in
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
409
|
+
Receipts are stored outside the repository under `peacekeeper-test-receipts` in
|
|
410
|
+
Node.js's `os.tmpdir()`. Each Git root has one file containing separate receipts
|
|
411
|
+
keyed by exact command strings, independent of the selected test level. After
|
|
412
|
+
`test run --checkpoint`, a subsequent `test run` skips shared commands with
|
|
413
|
+
valid receipts and runs the remaining commands. Running `all` also covers
|
|
414
|
+
`checkpoint`. Receipt validation fingerprints changed files and the process
|
|
415
|
+
environment; changing a command creates a different cache identity. Legacy
|
|
416
|
+
whole-suite receipts are ignored and replaced as commands pass.
|
|
417
|
+
|
|
418
|
+
Each command's previous receipt is invalidated before it runs. Successful
|
|
419
|
+
commands keep their receipts if a later command fails, so a retry can resume
|
|
420
|
+
with the failed or untested commands. `--force` and CI bypass reuse and invalidate
|
|
421
|
+
all selected receipts up front, including commands not reached after a failure;
|
|
422
|
+
receipts for unselected commands are preserved. Failed project validation
|
|
423
|
+
invalidates all command receipts for the repository.
|
|
424
|
+
|
|
425
|
+
The runner compares repository contents and the test environment before and
|
|
426
|
+
after each command. If either changes during that command, it exits with an
|
|
427
|
+
error and records no receipt for it. Rerun tests on the resulting contents.
|
|
236
428
|
Test-generated files should be ignored or written outside the repository.
|
|
237
429
|
|
|
430
|
+
`test check-receipt` succeeds only when every command in `tests.all` has a valid
|
|
431
|
+
receipt. `test record-receipt` certifies those commands without executing them.
|
|
432
|
+
Both support `--checkpoint` to select `tests.checkpoint` instead.
|
|
433
|
+
|
|
238
434
|
### 3. `.codex/hooks.json`
|
|
239
435
|
|
|
240
436
|
Install or update the project hooks from the caller's Git worktree:
|
|
241
437
|
|
|
242
438
|
```sh
|
|
243
|
-
npm exec --no -- peacekeeper install-hooks --dry-run
|
|
244
|
-
npm exec --no -- peacekeeper install-hooks
|
|
439
|
+
npm exec --no -- peacekeeper codex install-hooks --dry-run
|
|
440
|
+
npm exec --no -- peacekeeper codex install-hooks
|
|
245
441
|
```
|
|
246
442
|
|
|
247
443
|
The command creates or updates `.codex/hooks.json` at the Git root. It preserves
|
|
@@ -275,7 +471,7 @@ The installed file contains these definitions (other existing hooks are retained
|
|
|
275
471
|
"hooks": [
|
|
276
472
|
{
|
|
277
473
|
"type": "command",
|
|
278
|
-
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\"
|
|
474
|
+
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\" codex session-start",
|
|
279
475
|
"timeout": 30,
|
|
280
476
|
"statusMessage": "Loading Codex checkpoint instructions"
|
|
281
477
|
}
|
|
@@ -287,7 +483,7 @@ The installed file contains these definitions (other existing hooks are retained
|
|
|
287
483
|
"hooks": [
|
|
288
484
|
{
|
|
289
485
|
"type": "command",
|
|
290
|
-
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\"
|
|
486
|
+
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\" codex stop",
|
|
291
487
|
"timeout": 30,
|
|
292
488
|
"statusMessage": "Checking for an uncommitted Codex checkpoint"
|
|
293
489
|
}
|
|
@@ -299,7 +495,7 @@ The installed file contains these definitions (other existing hooks are retained
|
|
|
299
495
|
"hooks": [
|
|
300
496
|
{
|
|
301
497
|
"type": "command",
|
|
302
|
-
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\"
|
|
498
|
+
"command": "node \"$(git rev-parse --show-toplevel)/node_modules/@jakobm/peacekeeper/dist/bin/peacekeeper.js\" codex session-end",
|
|
303
499
|
"timeout": 3,
|
|
304
500
|
"statusMessage": "Scheduling merged branch cleanup"
|
|
305
501
|
}
|
|
@@ -310,14 +506,14 @@ The installed file contains these definitions (other existing hooks are retained
|
|
|
310
506
|
}
|
|
311
507
|
```
|
|
312
508
|
|
|
313
|
-
The commands resolve the package from the current Git worktree. Install dependencies in each worktree where the hooks will run; the commands need that worktree's `node_modules/@jakobm/peacekeeper`. The checkpoint hooks apply only to linked worktrees. `SessionStart` supplies the checkpoint instructions before work begins, including on resume, fork, and after compaction; no matcher is needed. `Stop` uses the same package-owned instructions as a fallback. You do not need to copy checkpoint rules into each project's `AGENTS.md`. Explicit user instructions not to commit or push take precedence: the agent must skip the checkpoint command when they conflict, even if `Stop` requests it. The hook checks Git state and cannot determine user intent itself. When uncommitted changes remain, the `Stop` hook asks the agent to review the diff and run `checkpoint
|
|
509
|
+
The commands resolve the package from the current Git worktree. Install dependencies in each worktree where the hooks will run; the commands need that worktree's `node_modules/@jakobm/peacekeeper`. The checkpoint hooks apply only to linked worktrees. `SessionStart` supplies the checkpoint instructions before work begins, including on resume, fork, and after compaction; no matcher is needed. `Stop` uses the same package-owned instructions as a fallback. You do not need to copy checkpoint rules into each project's `AGENTS.md`. Explicit user instructions not to commit or push take precedence: the agent must skip the checkpoint command when they conflict, even if `Stop` requests it. The hook checks Git state and cannot determine user intent itself. When uncommitted changes remain, the `Stop` hook asks the agent to review the diff and run `codex checkpoint` with a descriptive English commit message. That command stages all changes and commits them on a task branch; it refuses the configured default branch. With `git.checkpointPushRemotes`, it pushes without force to each listed remote, including new branches. An empty array keeps the branch local.
|
|
314
510
|
|
|
315
511
|
`SessionEnd` starts a detached worker to clean up the session worktree and branch only if the captured branch tip is still unchanged and fully merged into the remote default branch. Dirty or locked worktrees are kept. Worker output is appended to `cleanup-ended-session.log` in the shared Git directory. Cleanup does not require the primary worktree to have the default branch checked out. A local default branch that can fast-forward is updated before cleanup: a branch not checked out in any worktree is moved atomically, while a checked-out branch is merged in its clean worktree so its files and index stay synchronized. A dirty or diverged default branch is left unchanged. Codex loads project hooks only after the project hook source is trusted; review them with `/hooks`. The three-second `SessionEnd` timeout is the maximum documented for that event. See the [Codex hooks reference](https://learn.chatgpt.com/docs/hooks) for hook loading, trust, and timeout behavior.
|
|
316
512
|
|
|
317
513
|
### Adopting shared checkpoint instructions
|
|
318
514
|
|
|
319
515
|
For a project that already uses the Stop hook, upgrade to a package release that
|
|
320
|
-
includes `
|
|
516
|
+
includes `codex session-start` and `codex install-hooks`, then run the installer above.
|
|
321
517
|
The installer also updates `Stop` and `SessionEnd`. Review and trust the updated hooks with `/hooks`,
|
|
322
518
|
then start a new session or resume one to load the instructions. The pinned package version must include these commands.
|
|
323
519
|
|
|
@@ -328,7 +524,7 @@ them. The shared policy then follows the installed package version.
|
|
|
328
524
|
|
|
329
525
|
## Check the setup
|
|
330
526
|
|
|
331
|
-
From the caller's Git worktree, run `npm test` for
|
|
527
|
+
From the caller's Git worktree, run `npm test` for `tests.all`, `npm test -- --checkpoint` for `tests.checkpoint`, `npm test -- --force` to bypass command receipts, `npm run cleanup:branches` to preview merged branch cleanup, and `npm run cleanup:empty-directories` to preview removal of empty directories and directories containing only ignored files. The latter command protects the root `.git`, `node_modules`, and `tmp` directories; other selected directories are removed recursively, including their ignored contents. Add `-- --execute` to either cleanup package script to apply it. Run `npm exec --no -- peacekeeper --help` for the complete command list. To create a manual checkpoint, use `npm exec --no -- peacekeeper codex checkpoint --subject "<subject>" --body "<body paragraph>"`.
|
|
332
528
|
|
|
333
529
|
Directory cleanup also preserves nested Git repositories and linked worktrees,
|
|
334
530
|
including their parent directories when those parents are ignored. It does not
|
|
@@ -359,27 +555,27 @@ does not grant trust automatically.
|
|
|
359
555
|
Define general file conventions in `peacekeeper.config.yaml` and run:
|
|
360
556
|
|
|
361
557
|
```sh
|
|
362
|
-
peacekeeper check-conventions
|
|
558
|
+
peacekeeper project check-conventions
|
|
363
559
|
```
|
|
364
560
|
|
|
365
|
-
Add `peacekeeper check-conventions` explicitly to `tests.
|
|
561
|
+
Add `peacekeeper project check-conventions` explicitly to `tests.all` to include it
|
|
366
562
|
in the normal test run at the desired position. It is not added automatically.
|
|
367
563
|
Each rule is reported as a Node.js test. Violations, file errors, failed generators,
|
|
368
564
|
and invalid configuration cause a nonzero exit status; one failing rule does not
|
|
369
|
-
hide the results of later rules. A failed command in `run
|
|
370
|
-
|
|
565
|
+
hide the results of later rules. A failed command in `test run` has no passing
|
|
566
|
+
receipt; successful earlier commands retain their own receipts.
|
|
371
567
|
|
|
372
568
|
All configured paths and generator working directories are relative to the Git
|
|
373
569
|
root, even when the command is invoked from a subdirectory. Use forward slashes
|
|
374
570
|
on every platform. There is no separate conventions file. `conventions.rules: []`
|
|
375
571
|
is valid and reports that no rules are configured. Existing projects must run
|
|
376
|
-
`peacekeeper update-config` to add this field before ordinary commands can run;
|
|
572
|
+
`peacekeeper project update-config` to add this field before ordinary commands can run;
|
|
377
573
|
existing rules and YAML comments are preserved.
|
|
378
574
|
|
|
379
575
|
Standalone checks always run and do not create or reuse test receipts. When
|
|
380
|
-
included in `tests.
|
|
381
|
-
use `peacekeeper run
|
|
382
|
-
Run `check-conventions --update` separately from that flow when updating output.
|
|
576
|
+
included in `tests.all`, they follow `test run`' existing receipt reuse;
|
|
577
|
+
use `peacekeeper test run --force` to rerun the full configured test flow.
|
|
578
|
+
Run `project check-conventions --update` separately from that flow when updating output.
|
|
383
579
|
|
|
384
580
|
The `testing` module owns rule execution and Node test reporting. The
|
|
385
581
|
`configuration` module owns the rule contract and strict validation, and `cli`
|
|
@@ -517,7 +713,7 @@ The command must succeed. The expected directory must exist and contain exactly
|
|
|
517
713
|
the same relative file paths and bytes, including hidden and nested files.
|
|
518
714
|
Empty directories are not compared. Generation must be deterministic.
|
|
519
715
|
|
|
520
|
-
Run `peacekeeper check-conventions --update` to regenerate all configured outputs.
|
|
716
|
+
Run `peacekeeper project check-conventions --update` to regenerate all configured outputs.
|
|
521
717
|
This replaces each expected directory only after its generator succeeds, removing
|
|
522
718
|
stale files. Expected directories must contain only reproducible generated output;
|
|
523
719
|
review the diff before committing. Git metadata paths and expected paths containing
|
|
@@ -531,18 +727,18 @@ previous expected files and reports its exit status and output.
|
|
|
531
727
|
|
|
532
728
|
## Check project conventions locally
|
|
533
729
|
|
|
534
|
-
Run `peacekeeper check
|
|
730
|
+
Run `peacekeeper project check` to check the local project configuration.
|
|
535
731
|
|
|
536
732
|
Declare the mandatory boolean `publishesToNpm` in `peacekeeper.config.yaml`.
|
|
537
|
-
Its default is `false`; `update-config` inserts `false` without inferring intent
|
|
733
|
+
Its default is `false`; `project update-config` inserts `false` without inferring intent
|
|
538
734
|
from package metadata. Set it to `true` for packages published to npm (including
|
|
539
735
|
restricted scoped packages). Peacekeeper itself sets it to `true`.
|
|
540
|
-
A missing field in an existing configuration is a
|
|
736
|
+
A missing field in an existing configuration is a project check error.
|
|
541
737
|
|
|
542
738
|
With `true`, declare a publishable package (`private` absent or `false`), a valid
|
|
543
739
|
npm name, stable version, description, license, nonempty `files` list, and
|
|
544
740
|
`publishConfig` with registry `https://registry.npmjs.org/` and explicit access
|
|
545
|
-
`public` or `restricted`. Add a direct `peacekeeper release` package script
|
|
741
|
+
`public` or `restricted`. Add a direct `peacekeeper release publish` package script
|
|
546
742
|
(the npm-exec and local Node CLI forms are also supported), a packaging check
|
|
547
743
|
after `npm ci` in the selected PR workflow
|
|
548
744
|
(`npm pack`, optionally `--dry-run --json`, or `npm run test:package`), and the
|
|
@@ -558,13 +754,13 @@ proven free of publication code by this local check. Remove dedicated npm
|
|
|
558
754
|
publishing credentials and trusted-publisher registrations separately.
|
|
559
755
|
Internal `npm pack`, build scripts, module entry points and CLI metadata remain
|
|
560
756
|
allowed, as do deployment workflows and read authentication for dependencies.
|
|
561
|
-
PR checks, lockfiles, toolchain requirements and `verify-
|
|
757
|
+
PR checks, lockfiles, toolchain requirements and `release verify-protection`
|
|
562
758
|
remain independent of publication intent, including `git.releaseRequiredChecks`.
|
|
563
759
|
|
|
564
760
|
All projects must declare nonblank `author` and `repository` values in
|
|
565
761
|
`package.json`. npm object forms are supported with nonblank `author.name`
|
|
566
762
|
and `repository.url` strings.
|
|
567
|
-
Run `peacekeeper
|
|
763
|
+
Run `peacekeeper project check --explain` for the complete expected
|
|
568
764
|
architecture, requirements, configuration examples, and verification limits.
|
|
569
765
|
The command prints the bundled [formal requirements](src/modules/projects/check-project-requirements.txt),
|
|
570
766
|
which can also be read without a repository or project configuration.
|
|
@@ -580,8 +776,8 @@ Platform-specific `setup.linux.script`, `setup.macos.script`, and
|
|
|
580
776
|
`setup.windows.script` overrides, when present, must start with the same prefix.
|
|
581
777
|
The setup requires Bash and curl, activates or installs Volta, logs tool versions,
|
|
582
778
|
and runs `npm ci` using the package.json pins. It then runs
|
|
583
|
-
`peacekeeper
|
|
584
|
-
`peacekeeper cleanup
|
|
779
|
+
`peacekeeper codex init-worktree --sync-primary` followed by
|
|
780
|
+
`peacekeeper cleanup merged-branches --execute` before any project-specific setup,
|
|
585
781
|
initializing each new linked worktree from the exact commit fetched from the
|
|
586
782
|
configured remote default branch, safely synchronizing the primary checkout, and
|
|
587
783
|
removing merged branches and their linked worktrees.
|
|
@@ -597,8 +793,8 @@ The required sequence ends like this:
|
|
|
597
793
|
script = '''
|
|
598
794
|
# ...the required Peacekeeper setup prefix...
|
|
599
795
|
npm ci
|
|
600
|
-
npm exec --no -- peacekeeper
|
|
601
|
-
npm exec --no -- peacekeeper cleanup
|
|
796
|
+
npm exec --no -- peacekeeper codex init-worktree --sync-primary
|
|
797
|
+
npm exec --no -- peacekeeper cleanup merged-branches --execute
|
|
602
798
|
# Add custom project setup below
|
|
603
799
|
'''
|
|
604
800
|
```
|
|
@@ -614,7 +810,7 @@ completion in the linked worktree's private Git directory, retries interrupted
|
|
|
614
810
|
|
|
615
811
|
## Assess unpublished changes
|
|
616
812
|
|
|
617
|
-
Run `peacekeeper assess
|
|
813
|
+
Run `peacekeeper release assess` (or `npm exec --no -- peacekeeper release assess`)
|
|
618
814
|
from a project using Peacekeeper. A syntactically valid invocation writes one
|
|
619
815
|
pretty-printed JSON object to stdout, with fields ordered as `recommendation`,
|
|
620
816
|
`model`, `releaseSha`, `previousReleaseSha`, and `motivation`:
|
|
@@ -678,7 +874,7 @@ give `noop`; incomplete or ambiguous evidence gives `undetermined`. Codex has
|
|
|
678
874
|
The caller's branch and uncommitted files are preserved. Fetching updates remote
|
|
679
875
|
tracking refs; temporary worktrees and assessment refs are cleaned up afterward.
|
|
680
876
|
The command only recommends a release: it does not change versions, create a PR,
|
|
681
|
-
commit, tag, push, or publish, and it does not change `peacekeeper release`.
|
|
877
|
+
commit, tag, push, or publish, and it does not change `peacekeeper release publish`.
|
|
682
878
|
Codex logs are captured separately from the final JSON. AI assessments can be
|
|
683
879
|
wrong; the result applies to the fetched commit, and callers should reassess if
|
|
684
880
|
the default branch changes before using it.
|
|
@@ -738,10 +934,10 @@ inspection only when GitHub omits them from its response.
|
|
|
738
934
|
Enable `allow_auto_merge` in repository settings: this permits opting in per PR;
|
|
739
935
|
Peacekeeper never enables auto-merge on individual PRs.
|
|
740
936
|
|
|
741
|
-
`check
|
|
742
|
-
`tests.
|
|
937
|
+
`project check` makes no network requests. It runs implicitly before
|
|
938
|
+
`tests.all` or `tests.checkpoint`, including when reusing receipts, and checks that the configured
|
|
743
939
|
PR workflow uses only `pull_request`, with `branches` set to exactly
|
|
744
|
-
`[git.defaultBranch]`, and runs `verify-
|
|
940
|
+
`[git.defaultBranch]`, and runs `release verify-protection` with `GH_TOKEN` after `npm ci` and
|
|
745
941
|
before tests in a job listed in `git.releaseRequiredChecks`. The job and step must
|
|
746
942
|
not skip verification or ignore failures. The online verifier then checks that
|
|
747
943
|
exactly those configured check names are mandatory on GitHub, including its own
|
|
@@ -752,7 +948,7 @@ For example, in a required `test` job:
|
|
|
752
948
|
|
|
753
949
|
```yaml
|
|
754
950
|
- run: npm ci
|
|
755
|
-
- run: peacekeeper verify-
|
|
951
|
+
- run: peacekeeper release verify-protection
|
|
756
952
|
env:
|
|
757
953
|
GH_TOKEN: ${{ secrets.RELEASE_POLICY_TOKEN }}
|
|
758
954
|
- run: npm test
|
|
@@ -763,15 +959,15 @@ This creates a local-to-CI chain: missing workflows are detected on the next loc
|
|
|
763
959
|
continuous monitoring. Removing both CI and the local invocation prevents this
|
|
764
960
|
chain from running. No central scheduled audit is required by this setup.
|
|
765
961
|
|
|
766
|
-
The PR test job runs `peacekeeper verify-
|
|
962
|
+
The PR test job runs `peacekeeper release verify-protection` before its tests.
|
|
767
963
|
The command reads the actual default branch from GitHub, regardless of the PR
|
|
768
964
|
base. Other release commands require their configured branch to match it.
|
|
769
|
-
`peacekeeper release` checks the default branch before preparing a release
|
|
965
|
+
`peacekeeper release publish` checks the default branch before preparing a release
|
|
770
966
|
and again immediately before each merge attempt. Before publishing,
|
|
771
|
-
`peacekeeper verify
|
|
967
|
+
`peacekeeper release verify` checks the policy, matching package/tag/lockfile
|
|
772
968
|
versions, a same-repository merged `release/v<version>` PR, and successful required
|
|
773
969
|
jobs in its latest PR workflow run. Manual tags without that PR are rejected.
|
|
774
|
-
`verify-
|
|
970
|
+
`release verify-version` remains available for local version checks alone.
|
|
775
971
|
|
|
776
972
|
API failures, missing permissions, and unverifiable rules stop the commands.
|
|
777
973
|
Bypass actors are the exception when GitHub omits them: policy verification then
|
|
@@ -838,7 +1034,7 @@ configuration compatibility, but no longer selects the default-branch merge meth
|
|
|
838
1034
|
From a clean repository root, run `npm run release -- patch`, `minor`, or `major`.
|
|
839
1035
|
The required `prerelease` script runs `npm ci` first, replacing `node_modules`
|
|
840
1036
|
with the exact dependency versions in the committed lockfile before npm resolves
|
|
841
|
-
and starts Peacekeeper. Always use the npm script; invoking `peacekeeper release`
|
|
1037
|
+
and starts Peacekeeper. Always use the npm script; invoking `peacekeeper release publish`
|
|
842
1038
|
directly bypasses this dependency bootstrap.
|
|
843
1039
|
The command fetches the default branch and uses a temporary detached worktree to
|
|
844
1040
|
increment the package and lockfile versions. Your current branch and local default
|
|
@@ -878,17 +1074,17 @@ normally or with a handled error; a killed process may leave a temporary worktre
|
|
|
878
1074
|
that needs manual cleanup.
|
|
879
1075
|
|
|
880
1076
|
Other npm projects can use this command through package scripts such as
|
|
881
|
-
`"prerelease": "npm ci"` and `"release": "peacekeeper release"`. npm runs the
|
|
1077
|
+
`"prerelease": "npm ci"` and `"release": "peacekeeper release publish"`. npm runs the
|
|
882
1078
|
former automatically before the latter. The project must use a root package
|
|
883
1079
|
with a stable version, a `peacekeeper.config.yaml` with
|
|
884
1080
|
`git.releaseRequiredChecks`, and the supported tag-triggered GitHub Actions
|
|
885
|
-
publish job. Add `peacekeeper verify-
|
|
886
|
-
test job and `peacekeeper verify
|
|
1081
|
+
publish job. Add `peacekeeper release verify-protection` to a required PR
|
|
1082
|
+
test job and `peacekeeper release verify` before publishing, with `GH_TOKEN`
|
|
887
1083
|
and `RELEASE_TAG` set for release verification. Both commands are shipped with
|
|
888
1084
|
the package; no verifier script or artifact upload needs to be copied.
|
|
889
1085
|
Set `git.releaseTestWorkflow` to the PR workflow filename (for this
|
|
890
1086
|
repository: `"test.yml"`). Keep publishing in a separate workflow to satisfy
|
|
891
|
-
`check
|
|
1087
|
+
`project check`'s PR-only trigger policy. All configured check names
|
|
892
1088
|
must be jobs in the selected PR workflow's run.
|
|
893
1089
|
The `publish` job must contain a step whose command is exactly `npm publish`.
|
|
894
1090
|
Its `if` can be omitted when the workflow triggers only on pushes of
|
|
@@ -898,10 +1094,10 @@ For combined workflows or other triggers, the job must use the exact condition
|
|
|
898
1094
|
Explicit alternative job conditions are not supported. Workspaces are not supported.
|
|
899
1095
|
|
|
900
1096
|
Configuration migration: previously optional fields must now be declared. Run
|
|
901
|
-
`peacekeeper update-config`, review the inserted defaults, and commit the result.
|
|
1097
|
+
`peacekeeper project update-config`, review the inserted defaults, and commit the result.
|
|
902
1098
|
The default `git.checkpointPushRemotes` value publishes to `origin`; use an
|
|
903
1099
|
explicit empty array to keep checkpoint branches local. Empty
|
|
904
1100
|
`git.releaseRequiredChecks` is valid configuration but blocks release
|
|
905
|
-
policy verification; empty `tests.
|
|
1101
|
+
policy verification; empty `tests.all` blocks test execution and receipts.
|
|
906
1102
|
`projectChecks` always explicitly selects the workflow and jobs. This change does
|
|
907
|
-
not add online GitHub verification to `check
|
|
1103
|
+
not add online GitHub verification to `project check`.
|