Repository navigation
Commit bb17ca3
authored
Optional knob to waive npm release-age soak for the zero-dependency commy-mcp bundle (#29)
## Problem
An operator who runs npm's
[`min-release-age`](https://docs.npmjs.com/cli/using-npm/config#min-release-age)
supply-chain soak can't launch a freshly-published
`@codeforbreakfast/commy-mcp` release. npm compiles `min-release-age`
into a global `before=` publish-date cutoff over the whole install tree,
with **no per-package or per-scope exclude**, so every commy-mcp version
younger than the window is filtered → `ENOVERSIONS: No versions
available` → the MCP server never launches.
`min-release-age` exists to hold back a freshly-published release so a
compromised one can be caught before you auto-pull it — it guards you
against the **publisher's own not-yet-vetted code**. Waiving it is
therefore a deliberate trust decision about the publisher, not a free
pass.
## Change
Expose an optional, **off-by-default** operator knob,
`COMMY_NPM_MIN_RELEASE_AGE`, threaded into the launcher env as
`npm_config_min_release_age` (scoped to commy's own `npx` invocation).
Set it to `0` to trust the commy publisher and run a fresh release
immediately; leave it unset to keep your own npm setting fully in force.
The published package is a **zero-dependency bundle** —
`scripts/assemble-npm-package.ts` inlines every dependency into a single
`server.js`, and the generated manifest has no `dependencies` field. So
the waiver is cleanly scoped to exactly this one publisher: no
transitive dependency tree rides along with the decision.
The safety property — verified against npm 11.12.1 — is that an unset
knob never weakens the operator's own configuration: an unset/empty env
var leaves a consumer's `.npmrc min-release-age` untouched (npm ignores
an empty env var rather than overriding the file), and only an explicit
`0` waives the soak. The launcher test pins this by asserting the
userConfig is optional with no default.
## Surface
- `clients/claude-code/.claude-plugin/plugin.json` — optional
`COMMY_NPM_MIN_RELEASE_AGE` userConfig declaration
- `clients/claude-code/.mcp.json` — thread it as
`npm_config_min_release_age`
- `clients/claude-code/launcher.test.ts` — pin the threaded knob and its
off-by-default contract
- `docs/self-hosting.md` — document the knob and when an operator needs
it1 parent 9b9b783 commit bb17ca3
4 files changed
Lines changed: 49 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
| |||
58 | 59 | | |
59 | 60 | | |
60 | 61 | | |
61 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
62 | 72 | | |
63 | 73 | | |
64 | 74 | | |
| |||
0 commit comments