memento-mori-jester 0.1.46 → 0.1.48
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/CHANGELOG.md +12 -0
- package/README.md +27 -3
- package/ROADMAP.md +3 -1
- package/docs/GETTING_STARTED.md +19 -17
- package/docs/PRODUCTION_READINESS.md +68 -0
- package/docs/RELEASE.md +2 -1
- package/docs/RELEASE_NOTES_v0.1.47.md +25 -0
- package/docs/RELEASE_NOTES_v0.1.48.md +31 -0
- package/package.json +3 -2
- package/scripts/check-production-readiness.mjs +131 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ All notable changes to Memento Mori Jester are tracked here.
|
|
|
4
4
|
|
|
5
5
|
## Unreleased
|
|
6
6
|
|
|
7
|
+
## 0.1.48
|
|
8
|
+
|
|
9
|
+
- Added `docs/PRODUCTION_READINESS.md` to define the current production-grade bar across npm packaging, GitHub Action usage, MCP setup, git hooks, docs, release automation, and support.
|
|
10
|
+
- Added `npm run production:check`, a static readiness guard for version/release-note coverage, package metadata, public package files, workflow runtime expectations, and onboarding docs.
|
|
11
|
+
- Wired the production readiness check into `npm test` so CI catches readiness drift alongside the existing build, unit tests, and package dry run.
|
|
12
|
+
|
|
13
|
+
## 0.1.47
|
|
14
|
+
|
|
15
|
+
- Reworked the README Start Here section into a clearer four-step path: try without writing files, add a recommended preset, connect an agent, then add hooks or CI.
|
|
16
|
+
- Updated Getting Started to mirror the same onboarding order and mention playground sample buttons.
|
|
17
|
+
- Kept this as a docs-only onboarding release; no CLI, MCP, config, review, playground runtime, or release workflow behavior changed.
|
|
18
|
+
|
|
7
19
|
## 0.1.46
|
|
8
20
|
|
|
9
21
|
- Added one-click sample buttons to the local playground for command, plan, diff, and final-answer reviews.
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ See the full [demo transcript](docs/DEMO.md).
|
|
|
16
16
|
|
|
17
17
|
## Start Here
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
### 1. Try It Without Writing Files
|
|
20
20
|
|
|
21
21
|
```powershell
|
|
22
22
|
npx -y memento-mori-jester@latest start
|
|
@@ -25,11 +25,13 @@ npx -y memento-mori-jester@latest command "git reset --hard"
|
|
|
25
25
|
npx -y memento-mori-jester@latest playground
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
`start` prints the guided checklist. `playground` opens the local browser UI with sample buttons for commands, plans, diffs, and final answers.
|
|
29
|
+
|
|
30
|
+
### 2. Add It To A Project
|
|
29
31
|
|
|
30
32
|
```powershell
|
|
31
33
|
npx -y memento-mori-jester@latest config recommend
|
|
32
|
-
npx -y memento-mori-jester@latest bootstrap --preset
|
|
34
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset>
|
|
33
35
|
```
|
|
34
36
|
|
|
35
37
|
That writes:
|
|
@@ -38,6 +40,25 @@ That writes:
|
|
|
38
40
|
- `memento-mori.mcp.json`
|
|
39
41
|
- `MEMENTO_MORI.md`
|
|
40
42
|
|
|
43
|
+
Common presets are `node`, `python`, `web`, `api`, `infra`, `ai`, and `security`.
|
|
44
|
+
|
|
45
|
+
### 3. Connect Your Agent
|
|
46
|
+
|
|
47
|
+
```powershell
|
|
48
|
+
npx -y memento-mori-jester@latest setup
|
|
49
|
+
npx -y memento-mori-jester@latest setup --agent codex
|
|
50
|
+
npx -y memento-mori-jester@latest setup --agent claude
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Use the generated MCP snippet and agent instruction in Codex, Claude Code, or another MCP-capable client.
|
|
54
|
+
|
|
55
|
+
### 4. Add Hooks Or CI When Ready
|
|
56
|
+
|
|
57
|
+
```powershell
|
|
58
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset> --hook pre-commit
|
|
59
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset> --hook pre-commit --hook pre-push
|
|
60
|
+
```
|
|
61
|
+
|
|
41
62
|
Add it to GitHub code scanning:
|
|
42
63
|
|
|
43
64
|
```powershell
|
|
@@ -474,6 +495,7 @@ Release checklist:
|
|
|
474
495
|
|
|
475
496
|
```powershell
|
|
476
497
|
npm.cmd test
|
|
498
|
+
npm.cmd run production:check
|
|
477
499
|
npm.cmd run pack:dry
|
|
478
500
|
git tag -a v0.1.x -m "Memento Mori Jester v0.1.x"
|
|
479
501
|
git push origin main
|
|
@@ -482,6 +504,8 @@ git push origin v0.1.x
|
|
|
482
504
|
|
|
483
505
|
Pushing a `v*` tag creates the GitHub Release and publishes the matching package version to npm through trusted publishing.
|
|
484
506
|
|
|
507
|
+
The production readiness bar is documented in [docs/PRODUCTION_READINESS.md](docs/PRODUCTION_READINESS.md).
|
|
508
|
+
|
|
485
509
|
GitHub: <https://github.com/Martin123132/Memento-Mori>
|
|
486
510
|
|
|
487
511
|
See [docs/RELEASE.md](docs/RELEASE.md).
|
package/ROADMAP.md
CHANGED
|
@@ -6,6 +6,8 @@ Memento Mori Jester is usable today as a CLI, MCP server, GitHub Action, and git
|
|
|
6
6
|
|
|
7
7
|
## Recently Shipped
|
|
8
8
|
|
|
9
|
+
- Production readiness checklist and static guard in v0.1.48 for package, workflow, docs, release, and support drift.
|
|
10
|
+
- README onboarding polish in v0.1.47 around the shortest path from `npx` to playground, agent setup, hooks, and CI.
|
|
9
11
|
- Playground sample buttons in v0.1.46 for trying command, plan, diff, and final-answer reviews from the first screen.
|
|
10
12
|
- Fixture curation pass in v0.1.45 that moved all built-in and structural rule evidence to medium-or-better confidence.
|
|
11
13
|
- Additional precision pass for fixture-driven tuning signals (scoped to high-signal rule families first).
|
|
@@ -35,7 +37,7 @@ Memento Mori Jester is usable today as a CLI, MCP server, GitHub Action, and git
|
|
|
35
37
|
|
|
36
38
|
## Product Ideas
|
|
37
39
|
|
|
38
|
-
-
|
|
40
|
+
- Add `doctor --json` and support templates so diagnostics and bug reports are easier to collect.
|
|
39
41
|
|
|
40
42
|
## Quality And Safety
|
|
41
43
|
|
package/docs/GETTING_STARTED.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
This is the shortest path for a normal project.
|
|
4
4
|
|
|
5
|
-
## 1.
|
|
5
|
+
## 1. Try It Without Writing Files
|
|
6
6
|
|
|
7
7
|
For a guided checklist:
|
|
8
8
|
|
|
@@ -18,8 +18,6 @@ npx -y memento-mori-jester@latest doctor
|
|
|
18
18
|
|
|
19
19
|
You should see four `PASS` lines.
|
|
20
20
|
|
|
21
|
-
## 2. See The Point
|
|
22
|
-
|
|
23
21
|
```powershell
|
|
24
22
|
npx -y memento-mori-jester@latest command "git reset --hard"
|
|
25
23
|
```
|
|
@@ -38,19 +36,21 @@ For the local browser version:
|
|
|
38
36
|
npx -y memento-mori-jester@latest playground
|
|
39
37
|
```
|
|
40
38
|
|
|
39
|
+
The playground starts on `127.0.0.1` and includes sample buttons for command, plan, diff, and final-answer reviews.
|
|
40
|
+
|
|
41
41
|
If a rule feels noisy, ask for tuning advice before disabling it:
|
|
42
42
|
|
|
43
43
|
```powershell
|
|
44
44
|
npx -y memento-mori-jester@latest tune risky-domain
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## 2. Add It To A Project
|
|
48
48
|
|
|
49
49
|
Run this from the folder of the project you want protected:
|
|
50
50
|
|
|
51
51
|
```powershell
|
|
52
52
|
npx -y memento-mori-jester@latest config recommend
|
|
53
|
-
npx -y memento-mori-jester@latest bootstrap --preset
|
|
53
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset>
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
Use `--preset ai` for LLM, MCP, and agent apps, `--preset api` for backend APIs, `--preset web` for frontend/browser apps, `--preset infra` for deployment or cloud infrastructure repos, or `--preset security` for a stricter general policy.
|
|
@@ -65,32 +65,34 @@ That creates:
|
|
|
65
65
|
|
|
66
66
|
Existing files are kept. Add `--force` only when you want to overwrite the starter files.
|
|
67
67
|
|
|
68
|
-
##
|
|
68
|
+
## 3. Agent Instruction
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
For exact Codex, Claude Code, or generic MCP snippets:
|
|
71
71
|
|
|
72
72
|
```powershell
|
|
73
|
-
npx -y memento-mori-jester@latest
|
|
73
|
+
npx -y memento-mori-jester@latest setup
|
|
74
|
+
npx -y memento-mori-jester@latest setup --agent codex
|
|
75
|
+
npx -y memento-mori-jester@latest setup --agent claude
|
|
74
76
|
```
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
Put this in your agent rules or custom instructions:
|
|
77
79
|
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
+
```text
|
|
81
|
+
Before risky commands, final answers, commits, or large edits, call the Memento Mori Jester. Treat BLOCK as requiring a changed plan, and CAUTION as requiring at least one concrete verification step.
|
|
80
82
|
```
|
|
81
83
|
|
|
82
|
-
##
|
|
84
|
+
## 4. Optional Git Hooks
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
To make git call the Jester before commits:
|
|
85
87
|
|
|
86
88
|
```powershell
|
|
87
|
-
npx -y memento-mori-jester@latest
|
|
89
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset> --hook pre-commit
|
|
88
90
|
```
|
|
89
91
|
|
|
90
|
-
|
|
92
|
+
To also check before pushing:
|
|
91
93
|
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
+
```powershell
|
|
95
|
+
npx -y memento-mori-jester@latest bootstrap --preset <recommended-preset> --hook pre-commit --hook pre-push
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
## What To Share With Someone Else
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
# Production Readiness
|
|
2
|
+
|
|
3
|
+
This checklist defines what "production grade" means for Memento Mori Jester right now. It is intentionally practical: the project is a local CLI, MCP server, GitHub Action, and hook helper, so production readiness means users can install it, understand it, wire it in, recover from failures, and verify releases without guesswork.
|
|
4
|
+
|
|
5
|
+
## Current Bar
|
|
6
|
+
|
|
7
|
+
- The npm package installs with `npx -y memento-mori-jester@latest` and exposes the CLI plus MCP server binaries.
|
|
8
|
+
- The default path is local and deterministic: reviews run on user-provided text, diffs, commands, plans, and final answers without sending project code to a hosted API.
|
|
9
|
+
- GitHub Releases and npm publishing are automated from annotated `v*` tags through GitHub Actions trusted publishing.
|
|
10
|
+
- CI runs tests and a package dry run on every push to `main` and pull request.
|
|
11
|
+
- The local playground, GitHub Action, MCP setup snippets, preset examples, fixtures, and release notes ship in the npm package.
|
|
12
|
+
|
|
13
|
+
## npm Package
|
|
14
|
+
|
|
15
|
+
- `package.json` includes repository, homepage, bugs, binaries, exports, public package files, and public publish access.
|
|
16
|
+
- `package-lock.json` version matches `package.json`.
|
|
17
|
+
- `npm run pack:dry` confirms the package includes `dist`, `docs`, `examples`, `scripts`, `README.md`, `CHANGELOG.md`, `ROADMAP.md`, and `LICENSE`.
|
|
18
|
+
- `prepublishOnly` runs tests and a package dry run for local publish attempts.
|
|
19
|
+
|
|
20
|
+
## GitHub Action
|
|
21
|
+
|
|
22
|
+
- `action.yml` builds with Node 24 through `actions/setup-node@v6`.
|
|
23
|
+
- Action inputs cover `fail-on`, `subject`, `config`, `no-config`, `format`, `output-file`, and `summary`.
|
|
24
|
+
- SARIF output and GitHub step summaries remain separate so users can enable readable summaries without new GitHub write permissions.
|
|
25
|
+
- Example workflows in `examples/` and `examples/ci/` stay aligned with the action shape.
|
|
26
|
+
|
|
27
|
+
## MCP And Agent Setup
|
|
28
|
+
|
|
29
|
+
- `jester setup`, `jester mcp-config`, and `jester bootstrap` provide copy-paste setup for Codex, Claude Code, and generic MCP clients.
|
|
30
|
+
- `memento-mori-jester-mcp` is published as a package binary.
|
|
31
|
+
- `jester doctor` verifies the MCP server file exists and that the review engine blocks a known destructive command.
|
|
32
|
+
|
|
33
|
+
## Git Hooks
|
|
34
|
+
|
|
35
|
+
- `jester bootstrap --hook pre-commit` and `--hook pre-push` install managed hooks only when requested.
|
|
36
|
+
- Hooks use the same deterministic local review engine as CLI and MCP calls.
|
|
37
|
+
- `jester hook-status` lets users inspect managed hook state.
|
|
38
|
+
|
|
39
|
+
## Documentation
|
|
40
|
+
|
|
41
|
+
- `README.md` leads with a no-write first run, project bootstrap, agent setup, and optional hooks/CI.
|
|
42
|
+
- `docs/GETTING_STARTED.md`, `docs/CLI.md`, `docs/RELEASE.md`, and `docs/TRUSTED_PUBLISHING.md` cover the core adoption and release paths.
|
|
43
|
+
- Every public release has matching `CHANGELOG.md` notes and `docs/RELEASE_NOTES_vX.Y.Z.md`.
|
|
44
|
+
|
|
45
|
+
## Support And Recovery
|
|
46
|
+
|
|
47
|
+
- Package metadata points bug reports at the GitHub issues page.
|
|
48
|
+
- `jester doctor`, `jester config validate`, and `jester rules` are the first troubleshooting commands.
|
|
49
|
+
- `jester tune`, `jester tune coverage`, and the fixture suite give maintainers a way to inspect noisy rules before changing defaults.
|
|
50
|
+
- npm publish has a manual workflow fallback, but the normal release path is tag-driven trusted publishing.
|
|
51
|
+
|
|
52
|
+
## Static Guard
|
|
53
|
+
|
|
54
|
+
`npm run production:check` validates the production-readiness contract:
|
|
55
|
+
|
|
56
|
+
- current version release notes and changelog section exist,
|
|
57
|
+
- package metadata and public package files are present,
|
|
58
|
+
- CI, release, publish, and composite action workflows use the expected runtime and steps,
|
|
59
|
+
- onboarding docs mention the important adoption paths,
|
|
60
|
+
- production readiness documentation covers package, GitHub Action, MCP, git hooks, docs, and support.
|
|
61
|
+
|
|
62
|
+
`npm test` runs this check after the TypeScript build and unit tests.
|
|
63
|
+
|
|
64
|
+
## Known Next Gaps
|
|
65
|
+
|
|
66
|
+
- Add `SECURITY.md` and issue templates for clearer support intake.
|
|
67
|
+
- Add `doctor --json` for easier automated diagnostics.
|
|
68
|
+
- Continue expanding pass-case fixtures from real-world usage so false-positive tuning remains evidence-based.
|
package/docs/RELEASE.md
CHANGED
|
@@ -7,11 +7,12 @@ This project publishes GitHub Releases and npm packages from `v*` tags.
|
|
|
7
7
|
```powershell
|
|
8
8
|
npm.cmd version 0.1.x --no-git-tag-version
|
|
9
9
|
npm.cmd test
|
|
10
|
+
npm.cmd run production:check
|
|
10
11
|
npm.cmd run pack:dry
|
|
11
12
|
git diff --check
|
|
12
13
|
```
|
|
13
14
|
|
|
14
|
-
Move the current changelog bullets into a matching version section and add `docs/RELEASE_NOTES_v0.1.x.md` before committing.
|
|
15
|
+
Move the current changelog bullets into a matching version section and add `docs/RELEASE_NOTES_v0.1.x.md` before committing. Keep `docs/PRODUCTION_READINESS.md` and `npm run production:check` aligned when package, workflow, docs, or support expectations change.
|
|
15
16
|
|
|
16
17
|
## 2. Tag And Push
|
|
17
18
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# v0.1.47 Release Notes
|
|
2
|
+
|
|
3
|
+
This is a docs-only onboarding release. It makes the first README path clearer without changing CLI behavior, review behavior, MCP tools, config, playground runtime, GitHub Actions, or release automation.
|
|
4
|
+
|
|
5
|
+
## Changed
|
|
6
|
+
|
|
7
|
+
- Reworked README Start Here into four steps:
|
|
8
|
+
- try Jester without writing files,
|
|
9
|
+
- add it to a project with the recommended preset,
|
|
10
|
+
- connect Codex, Claude Code, or a generic MCP client,
|
|
11
|
+
- add hooks or GitHub code scanning when ready.
|
|
12
|
+
- Updated Getting Started to follow the same order and mention the playground sample buttons.
|
|
13
|
+
- Updated the roadmap with the shipped README polish and the next demo/onboarding idea.
|
|
14
|
+
|
|
15
|
+
## Release Validation
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
npm.cmd test
|
|
19
|
+
npm.cmd run demo:svg:check
|
|
20
|
+
npm.cmd run pack:dry
|
|
21
|
+
git diff --check
|
|
22
|
+
node .\dist\cli.js start
|
|
23
|
+
node .\dist\cli.js config recommend
|
|
24
|
+
git diff | node .\dist\cli.js diff --fail-on block --subject "v0.1.47 README onboarding polish"
|
|
25
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# v0.1.48 Release Notes
|
|
2
|
+
|
|
3
|
+
This release adds a production-readiness bar and a static guard to keep the public package, workflows, docs, and release metadata aligned as the project grows.
|
|
4
|
+
|
|
5
|
+
## Added
|
|
6
|
+
|
|
7
|
+
- `docs/PRODUCTION_READINESS.md`, covering:
|
|
8
|
+
- npm package expectations,
|
|
9
|
+
- GitHub Action behavior,
|
|
10
|
+
- MCP and agent setup,
|
|
11
|
+
- git hooks,
|
|
12
|
+
- documentation and release metadata,
|
|
13
|
+
- support and recovery paths.
|
|
14
|
+
- `npm run production:check`, which validates version/release-note coverage, package metadata, public package files, workflow runtime expectations, action summary support, and onboarding docs.
|
|
15
|
+
|
|
16
|
+
## Changed
|
|
17
|
+
|
|
18
|
+
- `npm test` now runs the production readiness check after the TypeScript build and unit suite.
|
|
19
|
+
- README and release docs now mention the production readiness check.
|
|
20
|
+
|
|
21
|
+
## Release Validation
|
|
22
|
+
|
|
23
|
+
```powershell
|
|
24
|
+
npm.cmd test
|
|
25
|
+
npm.cmd run production:check
|
|
26
|
+
npm.cmd run demo:svg:check
|
|
27
|
+
npm.cmd run pack:dry
|
|
28
|
+
git diff --check
|
|
29
|
+
node .\dist\cli.js doctor
|
|
30
|
+
git diff | node .\dist\cli.js diff --fail-on block --subject "v0.1.48 production readiness audit"
|
|
31
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "memento-mori-jester",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.48",
|
|
4
4
|
"description": "A local court-jester sidecar for AI coding agents: review plans, commands, diffs, and final claims before they get too pleased with themselves.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
"build": "tsc -p tsconfig.json",
|
|
40
40
|
"start": "node dist/server.js",
|
|
41
41
|
"start:mcp": "node dist/server.js",
|
|
42
|
-
"test": "npm run build && node scripts/run-tests.mjs",
|
|
42
|
+
"test": "npm run build && node scripts/run-tests.mjs && npm run production:check",
|
|
43
43
|
"doctor": "node dist/cli.js doctor",
|
|
44
44
|
"demo:svg": "node scripts/render-demo-svg.mjs",
|
|
45
45
|
"demo:svg:check": "node scripts/render-demo-svg.mjs --check",
|
|
46
|
+
"production:check": "node scripts/check-production-readiness.mjs",
|
|
46
47
|
"pack:dry": "npm pack --dry-run",
|
|
47
48
|
"prepare": "npm run build",
|
|
48
49
|
"prepublishOnly": "npm test && npm run pack:dry"
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
|
|
5
|
+
const root = process.cwd();
|
|
6
|
+
const failures = [];
|
|
7
|
+
|
|
8
|
+
function read(path) {
|
|
9
|
+
return readFileSync(join(root, path), "utf8");
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function readJson(path) {
|
|
13
|
+
return JSON.parse(read(path));
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function requireFile(path) {
|
|
17
|
+
if (!existsSync(join(root, path))) {
|
|
18
|
+
failures.push(`${path} is missing.`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function requireText(path, pattern, description) {
|
|
23
|
+
const content = read(path);
|
|
24
|
+
if (!pattern.test(content)) {
|
|
25
|
+
failures.push(`${path} should include ${description}.`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function requirePackageFile(packageJson, value) {
|
|
30
|
+
if (!Array.isArray(packageJson.files) || !packageJson.files.includes(value)) {
|
|
31
|
+
failures.push(`package.json files should include ${value}.`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const packageJson = readJson("package.json");
|
|
36
|
+
const packageLock = readJson("package-lock.json");
|
|
37
|
+
const version = packageJson.version;
|
|
38
|
+
const tag = `v${version}`;
|
|
39
|
+
|
|
40
|
+
if (!/^\d+\.\d+\.\d+$/.test(version)) {
|
|
41
|
+
failures.push(`package.json version should be plain semver. Saw ${version}.`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (packageLock.version !== version || packageLock.packages?.[""]?.version !== version) {
|
|
45
|
+
failures.push("package-lock.json version should match package.json.");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
for (const path of [
|
|
49
|
+
"README.md",
|
|
50
|
+
"CHANGELOG.md",
|
|
51
|
+
"ROADMAP.md",
|
|
52
|
+
"LICENSE",
|
|
53
|
+
"docs/RELEASE.md",
|
|
54
|
+
"docs/TRUSTED_PUBLISHING.md",
|
|
55
|
+
"docs/PRODUCTION_READINESS.md",
|
|
56
|
+
`docs/RELEASE_NOTES_${tag}.md`,
|
|
57
|
+
"action.yml",
|
|
58
|
+
".github/workflows/ci.yml",
|
|
59
|
+
".github/workflows/npm-publish.yml",
|
|
60
|
+
".github/workflows/release.yml",
|
|
61
|
+
"examples/github-action.yml",
|
|
62
|
+
"examples/github-code-scanning.yml",
|
|
63
|
+
"examples/ci/README.md",
|
|
64
|
+
"examples/presets/README.md",
|
|
65
|
+
"examples/fixtures/preset-review-cases.json"
|
|
66
|
+
]) {
|
|
67
|
+
requireFile(path);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
requireText("CHANGELOG.md", new RegExp(`## ${version.replaceAll(".", "\\.")}`), `a ${version} section`);
|
|
71
|
+
requireText(`docs/RELEASE_NOTES_${tag}.md`, /## Release Validation/, "release validation commands");
|
|
72
|
+
requireText("README.md", /## Start Here/, "Start Here onboarding");
|
|
73
|
+
requireText("README.md", /config recommend/, "preset recommendation onboarding");
|
|
74
|
+
requireText("README.md", /setup --agent codex/, "Codex setup onboarding");
|
|
75
|
+
requireText("README.md", /github-action --write/, "GitHub Action onboarding");
|
|
76
|
+
requireText("README.md", /License: PolyForm Noncommercial/, "the noncommercial license badge");
|
|
77
|
+
requireText("docs/PRODUCTION_READINESS.md", /npm package/i, "npm package readiness");
|
|
78
|
+
requireText("docs/PRODUCTION_READINESS.md", /GitHub Action/i, "GitHub Action readiness");
|
|
79
|
+
requireText("docs/PRODUCTION_READINESS.md", /MCP/i, "MCP readiness");
|
|
80
|
+
requireText("docs/PRODUCTION_READINESS.md", /git hooks/i, "git hook readiness");
|
|
81
|
+
requireText("docs/PRODUCTION_READINESS.md", /support/i, "support readiness");
|
|
82
|
+
|
|
83
|
+
for (const publicFile of ["dist", "docs", "examples", "scripts", "CHANGELOG.md", "LICENSE", "README.md", "ROADMAP.md"]) {
|
|
84
|
+
requirePackageFile(packageJson, publicFile);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
for (const binName of ["jester", "memento-mori-jester", "memento-mori-jester-mcp"]) {
|
|
88
|
+
if (!packageJson.bin?.[binName]) {
|
|
89
|
+
failures.push(`package.json bin should include ${binName}.`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (packageJson.license !== "SEE LICENSE IN LICENSE") {
|
|
94
|
+
failures.push("package.json license should point to LICENSE.");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (packageJson.publishConfig?.access !== "public") {
|
|
98
|
+
failures.push("package.json publishConfig.access should be public.");
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
requireText(".github/workflows/ci.yml", /actions\/checkout@v6/, "checkout@v6");
|
|
102
|
+
requireText(".github/workflows/ci.yml", /actions\/setup-node@v6/, "setup-node@v6");
|
|
103
|
+
requireText(".github/workflows/ci.yml", /node-version:\s*24/, "Node 24");
|
|
104
|
+
requireText(".github/workflows/ci.yml", /npm test/, "npm test");
|
|
105
|
+
requireText(".github/workflows/ci.yml", /npm run pack:dry/, "package dry run");
|
|
106
|
+
|
|
107
|
+
requireText(".github/workflows/npm-publish.yml", /tags:\s*\n\s*-\s*"v\*"/, "tag-triggered publishing");
|
|
108
|
+
requireText(".github/workflows/npm-publish.yml", /workflow_dispatch/, "manual publish fallback");
|
|
109
|
+
requireText(".github/workflows/npm-publish.yml", /id-token:\s*write/, "trusted publishing id-token permission");
|
|
110
|
+
requireText(".github/workflows/npm-publish.yml", /Verify tag matches package version/, "tag/package version guard");
|
|
111
|
+
requireText(".github/workflows/npm-publish.yml", /npm run pack:dry/, "package dry run before publish");
|
|
112
|
+
requireText(".github/workflows/npm-publish.yml", /npm publish/, "npm publish step");
|
|
113
|
+
|
|
114
|
+
requireText(".github/workflows/release.yml", /tags:\s*\n\s*-\s*"v\*"/, "tag-triggered GitHub Releases");
|
|
115
|
+
requireText(".github/workflows/release.yml", /docs\/RELEASE_NOTES_\$\{TAG\}\.md/, "release notes lookup");
|
|
116
|
+
requireText(".github/workflows/release.yml", /gh release create/, "GitHub Release creation");
|
|
117
|
+
|
|
118
|
+
requireText("action.yml", /summary:/, "summary input");
|
|
119
|
+
requireText("action.yml", /GITHUB_STEP_SUMMARY/, "GitHub step summary output");
|
|
120
|
+
requireText("action.yml", /actions\/setup-node@v6/, "setup-node@v6");
|
|
121
|
+
requireText("action.yml", /node-version:\s*24/, "Node 24");
|
|
122
|
+
|
|
123
|
+
if (failures.length > 0) {
|
|
124
|
+
console.error("Production readiness check failed:");
|
|
125
|
+
for (const failure of failures) {
|
|
126
|
+
console.error(`- ${failure}`);
|
|
127
|
+
}
|
|
128
|
+
process.exit(1);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log(`Production readiness check passed for ${tag}.`);
|