mcp-pacemaker 2.0.1 → 2.1.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.
Files changed (80) hide show
  1. package/CHANGELOG.md +105 -1
  2. package/CONTRIBUTING.md +49 -13
  3. package/README.md +361 -60
  4. package/THIRD_PARTY_NOTICES.txt +1 -28
  5. package/autostart/windows/account-task.ps1 +167 -0
  6. package/autostart/windows/inspect-task.ps1 +42 -0
  7. package/autostart/windows/inspect-worker-process-sessions.ps1 +155 -0
  8. package/autostart/windows/legacy-task.ps1 +301 -0
  9. package/autostart/windows/register-task.ps1 +11 -2
  10. package/bin/account-task-adapter.mjs +47 -0
  11. package/bin/account-upgrade-controller.mjs +198 -0
  12. package/bin/account-upgrade-worker.mjs +134 -0
  13. package/bin/account-worker-session.mjs +215 -0
  14. package/bin/cli-dispatch.mjs +154 -0
  15. package/bin/cli-main.mjs +1007 -0
  16. package/bin/cli-selection.mjs +43 -0
  17. package/bin/cli.mjs +7 -876
  18. package/bin/legacy-1.3.json +32 -0
  19. package/bin/legacy-installation.mjs +217 -0
  20. package/bin/legacy-task.mjs +52 -0
  21. package/bin/legacy-upgrade.mjs +471 -0
  22. package/bin/managed-runtime.mjs +170 -0
  23. package/bin/managed-state.mjs +257 -0
  24. package/bin/managed-upgrade.mjs +491 -0
  25. package/bin/mcp-bridge.mjs +132 -4
  26. package/bin/pooling-batches.mjs +13 -0
  27. package/bin/pooling-writer.mjs +4 -0
  28. package/bin/prewarm.mjs +33 -21
  29. package/bin/runtime-context.mjs +100 -0
  30. package/bin/service-control.mjs +27 -4
  31. package/bin/stable-launcher.mjs +54 -0
  32. package/bin/task-only-controller.mjs +226 -0
  33. package/bin/task-scope.mjs +65 -0
  34. package/bin/task-transaction-protocol.mjs +173 -0
  35. package/bin/top.mjs +22 -10
  36. package/bin/update-check.mjs +13 -2
  37. package/bin/upgrade-autostart.mjs +47 -0
  38. package/bin/upgrade-capability.json +8 -0
  39. package/bin/upgrade-dependencies.mjs +122 -0
  40. package/bin/upgrade-package.mjs +203 -0
  41. package/bin/windows-legacy/LegacyProcessBroker.build.json +42 -0
  42. package/bin/windows-legacy/LegacyProcessBroker.exe +0 -0
  43. package/bin/windows-legacy/src/AssemblyInfo.cs +8 -0
  44. package/bin/windows-legacy/src/LegacyNative.cs +783 -0
  45. package/bin/windows-legacy/src/LegacyProcessBroker.cs +841 -0
  46. package/bin/windows-legacy-process.mjs +241 -0
  47. package/bin/windows-lifetime/ProcessLifetimeHelper.build.json +38 -0
  48. package/bin/windows-lifetime/ProcessLifetimeHelper.exe +0 -0
  49. package/bin/windows-lifetime/src/AssemblyInfo.cs +8 -0
  50. package/bin/windows-lifetime/src/ProcessLifetimeHelper.cs +468 -0
  51. package/bin/windows-process-lifetime.mjs +218 -0
  52. package/bin/windows-task-channel/TaskChannelGuard.build.json +45 -0
  53. package/bin/windows-task-channel/TaskChannelGuard.exe +0 -0
  54. package/bin/windows-task-channel/src/AssemblyInfo.cs +8 -0
  55. package/bin/windows-task-channel/src/ChannelCliContext.cs +210 -0
  56. package/bin/windows-task-channel/src/ChannelFiles.cs +231 -0
  57. package/bin/windows-task-channel/src/ChannelNative.cs +477 -0
  58. package/bin/windows-task-channel/src/ChannelSession.cs +203 -0
  59. package/bin/windows-task-channel/src/TaskChannelGuard.cs +686 -0
  60. package/bin/windows-task-channel.mjs +335 -0
  61. package/docs/account-upgrades.md +205 -0
  62. package/docs/execution-context.md +113 -0
  63. package/package.json +12 -5
  64. package/supervisor/supervise.mjs +226 -40
  65. package/tools/account-upgrade/qualify-two-account.ps1 +66 -0
  66. package/tools/windows-legacy/README.md +225 -0
  67. package/tools/windows-legacy/build.ps1 +122 -0
  68. package/tools/windows-legacy/inventory.mjs +90 -0
  69. package/tools/windows-process-lifetime/README.md +119 -0
  70. package/tools/windows-process-lifetime/build.ps1 +122 -0
  71. package/tools/windows-process-lifetime/inventory.mjs +86 -0
  72. package/tools/windows-task-channel/README.md +329 -0
  73. package/tools/windows-task-channel/build.ps1 +107 -0
  74. package/tools/windows-task-channel/inventory.mjs +117 -0
  75. package/ui/dist/THIRD_PARTY_NOTICES.txt +1 -28
  76. package/ui/dist/assets/{index-CgPruWYi.js → index-CcwMo2sI.js} +1 -1
  77. package/ui/dist/assets/index-PVcuDNrN.css +1 -0
  78. package/ui/dist/index.html +2 -2
  79. package/ui/dist/third-party-manifest.json +37 -25
  80. package/ui/dist/assets/index-CaLPg0c-.css +0 -1
package/CHANGELOG.md CHANGED
@@ -7,10 +7,110 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [2.1.0] - 2026-10-12
11
+
12
+ Target release: 2.1.0. This candidate has not yet been published.
13
+
14
+ ### Added
15
+
16
+ - Explicit managed `upgrade --to`, read-only plans, isolated `--sxs` instances with
17
+ retained OS-assigned listeners, stable launchers, admission control and a durable
18
+ activation/recovery journal. Bare `upgrade` and `--self` remain compatible.
19
+ - Preserve ports and host wiring during managed replacement; retain the previous
20
+ package and restrict rollback to verified, unchanged pre-admission state.
21
+ - Add one-time restart-only migration for the exact Windows 1.3.0 registration,
22
+ with interactive uncertainty acknowledgement, held process identities, partial
23
+ observed-descendant receipts and scoped task/CLI rollback. No machine reboot.
24
+ - Refuse unsupported or unknown supervisor/autostart identities before interruption.
25
+ - Add explicit Windows original-account upgrades with a task-only administrator
26
+ controller and authenticated original-user worker. Keep current-user scope as
27
+ the default, preserve task security/account settings, and refuse unavailable or
28
+ changed logged-on session identity. Real elevated two-account qualification
29
+ remains required; `--all-users` is unsupported.
30
+
31
+ ### Fixed
32
+
33
+ - Contain Windows bridge descendants in a kill-on-close Job Object before any
34
+ workload starts, preventing nested cmd/Node trees from surviving abrupt bridge
35
+ loss. Fail startup if containment cannot be established.
36
+ - Preserve existing task security during legacy migration instead of resubmitting
37
+ its owner, allowing an ordinary user to update an eligible Administrators-owned
38
+ task without changing its permissions.
39
+ - Handle Task Scheduler's equivalent XML serialization during post-write checks
40
+ and restoration, including rediscovery after rollback. Keep raw revision
41
+ preconditions, original backups and complete resource-security checks intact.
42
+ - Avoid Windows upgrade-authorization failures caused by slow thread enumeration
43
+ and already-terminated thread records while retaining complete identity and
44
+ authority checks.
45
+ - Capture larger legacy process trees with bounded discovery and distinguish
46
+ reused parent PIDs from proven descendant relationships.
47
+ - Recheck shared-session test cooldown deadlines after early timer delivery before
48
+ acquiring a replacement generation.
49
+ - Wait for the metrics test process and its stdio to close before removing fixture files.
50
+ - Pin the Windows process-lifetime and task-channel helpers to their own packaged directory
51
+ instead of inheriting the caller's working directory. A process's working directory cannot
52
+ be removed on Windows, so a detached helper previously blocked removal of the instance,
53
+ configuration and staging directories with `EPERM`.
54
+ - Report the native refusal reason when the task channel declines a request, instead of a
55
+ bare refusal with no cause.
56
+
57
+ ### Security
58
+
59
+ - Refuse elevated or unverified default Windows upgrade and recovery before
60
+ staging, task writes or runtime launch, preserving the original runtime authority.
61
+ - Raise the CLI's `smol-toml` floor to `1.9.0`.
62
+ - Move the dashboard build to Tailwind CSS `4.3.3`, removing the vulnerable
63
+ `braces` and `postcss-selector-parser` dependency paths, and pin `source-map-js`
64
+ to `1.2.2`.
65
+ - Retire the 2.0.2 producer exception from fresh native and OSV scans. New releases
66
+ require complete clean producer evidence; historical receipts retain their
67
+ original source bindings and expiry.
68
+
69
+ ### Changed
70
+
71
+ - **Breaking for privileged callers.** The bridge, supervisor and default upgrades now verify
72
+ the caller before any runtime work and refuse an elevated or root caller at startup with
73
+ `User-runtime execution refused: …`. This is not Windows-only and not upgrade-only: on Linux
74
+ and macOS a `root` process is refused, which includes the default user in most container
75
+ images. There is no override; run as an ordinary account. Shipping this in a minor release is
76
+ deliberate — the previous behaviour let a bridge run with authority it could not verify.
77
+ - Update the Tailwind PostCSS adapter, class-merging dependency, generated dashboard
78
+ assets and license attribution while retaining the existing theme configuration.
79
+
80
+ ## [2.0.2] - 2026-10-06
81
+
10
82
  ### Fixed
11
83
 
12
- - Resolve native directory watcher paths before watching logs and test control files,
84
+ - Replace the old GitHub-install quick start in the npm package documentation with
85
+ npm-first installation, exact-version commands, prerequisites and setup boundaries.
86
+ - Preserve npm package-type permissions in isolated consumer checks instead of silently
87
+ reverting directory, file, Git, or remote dependency restrictions to npm defaults.
88
+ - Resolve native directory watcher paths in publication and compatibility test helpers,
13
89
  avoiding Windows short-path watcher crashes without changing the selected files.
90
+ - Restore the legacy publisher's skipped-matrix job and whole-second timestamp handling
91
+ in reusable secret-collection admission, preserving source and execution checks.
92
+
93
+ ### Changed
94
+
95
+ - Make the manual npm publisher reusable for explicitly selected stable 1.x/2.x
96
+ versions, with immutable published comparison peers and no active bootstrap actions.
97
+ - Keep the existing GitHub source-CI, collection/review, preparation, OIDC staging,
98
+ verification and separately approved owner-publication route for the selected release.
99
+
100
+ ### Security
101
+
102
+ - Record a temporary **2.0.2-only producer risk acceptance** for `smol-toml 1.8.0`
103
+ in the CLI runtime and `braces 3.0.3`, `postcss-selector-parser 6.1.4` and
104
+ `source-map-js 1.2.1` in UI build tooling. The October 6 review keeps the
105
+ original **2026-10-12T00:00:00Z** expiry and binds both unchanged producer
106
+ locks and the exact native reports. Raw audit/OSV findings remain visible.
107
+ Dependency upgrades stay deferred from this documentation release.
108
+ This is not a patch or a clean advisory result; fresh-consumer findings are
109
+ not exempted. Remediation and exception removal are required
110
+ before expiry or the next release. See the
111
+ [exact advisories, exposure, mitigations and follow-up](docs/npm-publishing.md#temporary-202-producer-risk-acceptance).
112
+
113
+ ## [2.0.1]
14
114
 
15
115
  ### Changed
16
116
 
@@ -445,6 +545,10 @@ one is a trap for anyone building something similar.
445
545
  - Do not report a teardown the bridge initiated as a crash. `taskkill /F` exits non-zero, so
446
546
  every recycle, idle reap and session close was recorded as a failure, burying real ones.
447
547
 
548
+ [Unreleased]: https://github.com/girishkvs/mcp-pacemaker/compare/v2.1.0...HEAD
549
+ [2.1.0]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v2.1.0
550
+ [2.0.2]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v2.0.2
551
+ [2.0.1]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v2.0.1
448
552
  [2.0.0]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v2.0.0
449
553
  [1.3.0]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v1.3.0
450
554
  [1.2.0]: https://github.com/girishkvs/mcp-pacemaker/releases/tag/v1.2.0
package/CONTRIBUTING.md CHANGED
@@ -18,12 +18,16 @@ part of its security posture. The setup CLI and the dashboard may use dependenci
18
18
 
19
19
  ## Lockfiles must resolve to the public registry
20
20
 
21
- CI fails any lockfile containing a `resolved` URL outside `registry.npmjs.org`. If you work
22
- behind a private mirror, re-resolve before committing:
21
+ CI fails any lockfile containing a `resolved` URL outside `registry.npmjs.org`.
22
+ Do not bypass a required registry policy to produce those URLs. Restore through the
23
+ approved registry and preserve exact package names, versions and verified archive
24
+ integrities when canonicalizing mirror-specific URLs for the public lockfile.
25
+ Hosted CI must still restore the resulting lock from its configured registry.
23
26
 
24
- ```bash
25
- npm install --registry https://registry.npmjs.org
26
- ```
27
+ For npm 12 mirrors whose metadata and tarball URLs have different prefixes,
28
+ `replace-registry-host` supports command-local URL-prefix mapping back through the
29
+ approved registry. This does not require relaxing `allow-remote`, disabling TLS,
30
+ changing global settings or committing a private registry configuration.
27
31
 
28
32
  ## Tests
29
33
 
@@ -35,8 +39,13 @@ Tests are `node:test` only, no framework. Each test file that starts a bridge ow
35
39
  ports, because files run in parallel; the current allocation is listed at the top of
36
40
  `test/auth-token.test.mjs`. Pick unused ones for a new file.
37
41
 
38
- Before submitting, run the complete `npm test` command with its normal file concurrency.
39
- Focused or serialized runs help diagnose failures but do not replace that run. Record the
42
+ Before submitting, run the complete `npm test` command with its normal file concurrency
43
+ (`--test-concurrency=4`, matching the four vCPUs on hosted runners). CI and the local
44
+ publication gate go through `npm run test:contract -- <name>` instead, which adds the
45
+ execution-context preflight and, on Windows, splits the suite into the ordinary-account lane
46
+ and the session lane; `npm run test:contract -- source --check` reports what a lane would run
47
+ without running it. Focused or serialized runs help diagnose failures but do not replace that
48
+ run. Record the
40
49
  exact Node and npm versions, OS, architecture, and command; matching only the Node major is
41
50
  not enough to reproduce a CI failure.
42
51
 
@@ -63,6 +72,14 @@ platform; Windows also exercises the real executable. Those checks do not replac
63
72
  byte-for-byte rebuild, and a rolling CI image may not contain the recorded compiler.
64
73
  No compiler or PowerShell host runs in the production config-write path.
65
74
 
75
+ Windows bridge lifetime containment uses a **separate** packaged helper. Build
76
+ and byte-for-byte verify it with `tools/windows-process-lifetime/build.ps1` and
77
+ `-Verify`; see its README for the ownership and failure contract. Do not change
78
+ the immutable config-security helper to update the lifetime helper. Run both
79
+ `test/windows-process-lifetime.test.mjs` and `test/windows-lifetime-startup.test.mjs`
80
+ on supported Windows/Node versions. They retain owned PID/creation-time cleanup
81
+ receipts and TCP heartbeat observations outside Git.
82
+
66
83
  Batch tests must cover the full five-second trailing debounce, merging complete snapshots,
67
84
  Reload now, requests during a flip, stale active revisions, whole-batch Cancel/Undo and late
68
85
  commit outcomes. Use controlled clocks for scheduling boundaries and real file/HTTP cases for
@@ -77,9 +94,17 @@ sleeping a fixed interval.
77
94
 
78
95
  ## Real-version compatibility gates
79
96
 
97
+ The dashboard uses the Tailwind 4 PostCSS adapter. Its optimizer stays disabled
98
+ until generated selectors and license attribution have been checked; Vite still
99
+ minifies the final CSS. Keep the inline Vite and standalone PostCSS settings
100
+ consistent, and run the UI tests before regenerating the dashboard and notices.
101
+
80
102
  These are separate, mandatory CI gates, not substitutes for `npm test`. The root CI job runs
81
- CLI/API pairs on Windows, Linux and macOS with Node 20, 22 and 24. The Linux/Node 22 UI
82
- job runs one Chromium browser matrix after building the dashboard.
103
+ CLI/API pairs on Linux and macOS with Node 20, 22 and 24. The Windows pair runs in the
104
+ `windows-ordinary` job through `tools/windows-ci/ci-ordinary-user.ps1 -Contract compatibility`,
105
+ which prepares, exercises and removes its fixtures inside a disposable standard account: the
106
+ fixtures record the temp root that owns them, so an administrator-prepared pair is refused. The
107
+ Linux/Node 22 UI job runs one Chromium browser matrix after building the dashboard.
83
108
 
84
109
  ```bash
85
110
  npm ci
@@ -103,15 +128,22 @@ instead of installing bundled Chromium. CI uses bundled Chromium, not that overr
103
128
  Both standalone test commands **fail** when preparation is missing or candidate bytes have
104
129
  changed. Clean and prepare again after changing package files, built assets, or Node major.
105
130
 
106
- Scope is explicitly **1.3.0, 1.3.1, 2.0.0 and 2.0.1**, not arbitrary compatible-looking versions.
131
+ Historical compatibility baselines remain explicitly **1.3.0 and 2.0.0**.
132
+ Candidate versions must be canonical stable **1.x legacy / 2.x current** versions.
133
+ The owner selects the actual release and any exact opposite-major patch pair;
134
+ support in the harness alone is not evidence that every patch was tested.
107
135
  The same harness runs in both maintained branches:
108
136
 
109
137
  | Preparation | Selected legacy / current pair |
110
138
  |---|---|
111
- | Default in the 2.0.1 checkout | Immutable 1.3.0 / packed 2.0.1 |
139
+ | Default in the selected 2.1.0 checkout | Immutable 1.3.0 / packed 2.1.0 |
112
140
  | Default in the 1.3.1 checkout | Packed 1.3.1 / immutable 2.0.0 |
113
141
  | `npm run compat:prepare:baseline` | Immutable 1.3.0 / immutable 2.0.0 |
114
- | `npm run compat:prepare -- --peer-root <opposite-patch-checkout>` | Packed 1.3.1 / packed 2.0.1 |
142
+ | `npm run compat:prepare -- --peer-root <opposite-patch-checkout>` | Packed explicit 1.x peer / packed 2.1.0 |
143
+
144
+ These selections are not qualification evidence. The 2.1.0 candidate requires fresh
145
+ exact-byte gates; selecting it does not select an opposite-major patch pair.
146
+ Earlier 1.3.1/2.0.2 and 1.3.1/2.0.1 results remain historical.
115
147
 
116
148
  Run both API and browser gates for the explicit patch pair before publishing either complete
117
149
  dual-major release set. The two default CI pairs alone do not establish that combined result.
@@ -175,7 +207,7 @@ API, admin mutation, SSE and MCP requests go to the real backend, without respon
175
207
  Nested JS assets are included. The old-tab upgrade case does not substitute assets: it stops
176
208
  the actual selected 1.x process and starts the selected 2.x process on the same port before refresh.
177
209
 
178
- No other version compatibility is claimed. Writable downgrade is checked on a fresh
210
+ Only the executed exact version pairs establish compatibility. Writable downgrade is checked on a fresh
179
211
  synthetic config with default ownership and inherited security. The test does not change
180
212
  tokens, elevate, or set ACLs. It checks unchanged caller authority and, on Windows, the actual
181
213
  selected 1.x helper's full/partial audit visibility. Caller-context hashes are not direct measurements
@@ -200,6 +232,10 @@ the user's global prefix, host configuration, live bridge, or npm credentials. I
200
232
  resolved caller registry/cache and offline setting without a mirror fallback. Registry
201
233
  signatures and provenance are separate post-publication checks, not inferred from this smoke test.
202
234
 
235
+ The consumer preserves npm's effective `allow-directory`, `allow-file`, `allow-git`, and
236
+ `allow-remote` values, including environment overrides. It does not replace restrictions
237
+ with defaults or grant permissions when an install is rejected.
238
+
203
239
  ## Changing how a host is wired
204
240
 
205
241
  Host adapters live in `HOSTS` in `bin/cli.mjs`. Each one declares where that host's config