machine-bridge-mcp 3.0.0-beta.21 → 3.0.0-beta.26

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 (102) hide show
  1. package/CHANGELOG.md +134 -0
  2. package/CONTRIBUTING.md +3 -3
  3. package/GOVERNANCE.md +2 -2
  4. package/README.md +24 -6
  5. package/browser-extension/manifest.json +1 -1
  6. package/docs/AGENT_CONTEXT.md +10 -7
  7. package/docs/ARCHITECTURE.md +35 -22
  8. package/docs/AUDIT.md +85 -1
  9. package/docs/CLIENTS.md +6 -2
  10. package/docs/ENGINEERING.md +31 -9
  11. package/docs/LOCAL_AUTOMATION.md +4 -2
  12. package/docs/LOGGING.md +8 -8
  13. package/docs/OPERATIONS.md +43 -17
  14. package/docs/PRIVACY.md +18 -4
  15. package/docs/PROJECT_STANDARDS.md +2 -2
  16. package/docs/RELEASING.md +35 -11
  17. package/docs/TESTING.md +36 -16
  18. package/docs/THREAT_MODEL.md +20 -5
  19. package/docs/TOOL_REFERENCE.md +18 -12
  20. package/docs/UPGRADING.md +32 -0
  21. package/package.json +15 -6
  22. package/scripts/check-plan.mjs +8 -0
  23. package/scripts/coverage-check.mjs +30 -1
  24. package/scripts/foreground-daemon-recovery.mjs +88 -0
  25. package/scripts/github-release.mjs +22 -16
  26. package/scripts/install-published-prerelease.mjs +7 -7
  27. package/scripts/official-mcp-conformance.mjs +243 -0
  28. package/scripts/persistent-activation-process.mjs +36 -0
  29. package/scripts/release-candidate-manifest.mjs +12 -0
  30. package/scripts/release-publication-guard.mjs +65 -0
  31. package/scripts/release-state.mjs +1 -1
  32. package/scripts/sbom-check.mjs +99 -0
  33. package/scripts/start-release-candidate.mjs +39 -13
  34. package/src/local/agent-context-projection.mjs +26 -7
  35. package/src/local/agent-context.mjs +25 -4
  36. package/src/local/autostart-log-maintenance.mjs +36 -0
  37. package/src/local/capability-observer.mjs +5 -0
  38. package/src/local/child-process-settlement.mjs +103 -0
  39. package/src/local/cli-activate.mjs +42 -5
  40. package/src/local/cli-service.mjs +55 -5
  41. package/src/local/cli.mjs +59 -10
  42. package/src/local/daemon-process.mjs +24 -3
  43. package/src/local/delegated-process-sandbox.mjs +1 -0
  44. package/src/local/execution-routing.mjs +231 -0
  45. package/src/local/git-service.mjs +3 -1
  46. package/src/local/job-runner.mjs +55 -19
  47. package/src/local/macos-trust-broker.mjs +7 -0
  48. package/src/local/managed-job-runner-claim.mjs +54 -0
  49. package/src/local/managed-job-runner.mjs +13 -2
  50. package/src/local/process-execution.mjs +2 -2
  51. package/src/local/process-identity.mjs +11 -0
  52. package/src/local/process-tree-ownership-types.d.ts +37 -0
  53. package/src/local/process-tree-ownership.mjs +49 -41
  54. package/src/local/process-tree.mjs +1 -1
  55. package/src/local/relay-call-recovery.mjs +40 -21
  56. package/src/local/runtime-activation.mjs +357 -38
  57. package/src/local/runtime-capabilities.mjs +22 -6
  58. package/src/local/runtime-diagnostics.mjs +9 -2
  59. package/src/local/runtime.mjs +18 -4
  60. package/src/local/service-convergence.mjs +33 -0
  61. package/src/local/service-owner.mjs +147 -0
  62. package/src/local/service-restart-handoff.mjs +22 -8
  63. package/src/local/service-runtime.mjs +145 -0
  64. package/src/local/service.mjs +143 -25
  65. package/src/local/state.mjs +104 -7
  66. package/src/local/stdio.mjs +139 -45
  67. package/src/local/system-network-route.mjs +76 -0
  68. package/src/local/tool-executor.mjs +24 -6
  69. package/src/local/tools.mjs +6 -5
  70. package/src/local/windows-service-convergence.mjs +49 -0
  71. package/src/local/windows-service.mjs +30 -53
  72. package/src/shared/mcp-protocol.d.mts +27 -0
  73. package/src/shared/mcp-protocol.mjs +256 -0
  74. package/src/shared/mcp-subscriptions.d.mts +4 -0
  75. package/src/shared/mcp-subscriptions.mjs +59 -0
  76. package/src/shared/relay-contract.json +1 -0
  77. package/src/shared/result-projection.d.mts +2 -1
  78. package/src/shared/result-projection.mjs +13 -2
  79. package/src/shared/server-metadata.json +11 -4
  80. package/src/shared/tool-argument-validation.d.mts +17 -0
  81. package/src/shared/tool-argument-validation.mjs +325 -0
  82. package/src/shared/tool-catalog.json +18 -12
  83. package/src/worker/durable-stream-calls.ts +12 -24
  84. package/src/worker/http.ts +36 -2
  85. package/src/worker/index.ts +181 -165
  86. package/src/worker/mcp-http-contract.ts +276 -0
  87. package/src/worker/mcp-jsonrpc.ts +12 -6
  88. package/src/worker/mcp-legacy-dispatch.ts +104 -0
  89. package/src/worker/mcp-modern-controller.ts +199 -0
  90. package/src/worker/mcp-modern-proxy.ts +126 -0
  91. package/src/worker/mcp-modern-stream.ts +71 -0
  92. package/src/worker/mcp-session.ts +12 -3
  93. package/src/worker/mcp-stream-proxy-contract.ts +67 -0
  94. package/src/worker/mcp-stream-proxy.ts +17 -60
  95. package/src/worker/mcp-tool-call-input.ts +23 -0
  96. package/src/worker/tool-catalog.ts +29 -1
  97. package/src/worker/tool-timeout.ts +53 -12
  98. package/src/worker/worker-mcp-config.ts +23 -0
  99. package/src/worker/worker-metadata.ts +10 -1
  100. package/src/worker/worker-runtime-config.ts +19 -0
  101. package/src/worker/worker-static-routes.ts +7 -2
  102. package/tsconfig.local.json +7 -1
package/docs/TESTING.md CHANGED
@@ -24,17 +24,29 @@ The suite includes:
24
24
  - GitHub backlog enforcement that paginates all open issues and pull requests, permits only the current branch PR, and requires standard closing keywords for every open issue before a guarded push;
25
25
  - release-impact enforcement requiring a new package version and CHANGELOG section for release-relevant changes;
26
26
  - strict dev/beta/rc/stable channel parsing and npm dist-tag enforcement;
27
- - persistent candidate relay/service handoff ordering, early-failure provider restoration after lock cleanup, and aggregated restoration failures;
27
+ - persistent candidate relay/service handoff ordering; machine-service-before-startup lock acquisition and release; POSIX, XDG, and Windows separation of the ordinary profile state root from the machine-service control root; service-stop, ambiguous provider-state, and pre-mutation foreground/daemon-owner refusal; pending/committed machine-owner transactions; missing, corrupt, mismatched, and partial owner state; token-protected one-way daemon readiness; first-attempt device-authentication rejection; exactly one same-name/same-identity repair deployment; bounded repeated rejection; exact-version/entrypoint pre-remote provider restoration; post-remote compatible-service forward recovery; and aggregated cleanup/restoration failures;
28
28
  - owner-only local and registry prerelease activation records;
29
29
  - npm/GitHub prerelease metadata validation, minimum soak timing, blocking-issue rejection, and stable-promotion content/file-mode identity;
30
30
  - release-state diagnostics distinguishing missing local/remote version tags from tags that point to the wrong commit, plus a release-CI gate that rejects missing, pending, failed, pull-request-only, stale, or wrong-commit runs;
31
+ - GitHub publication ownership: missing confirmation, non-TTY/background invocation, concurrent live owner, stale lock reclamation, and lock release after success/failure; remote tag/Release mutation remains outside ordinary automated tests;
31
32
  - generated Cloudflare Worker types under ignored `.wrangler/` state and strict TypeScript checking, including unused-local and unused-parameter rejection; packaging rejects generated declarations;
32
33
  - Conventional Commit title validation, shared Markdown escaping regression coverage, and generated MCP tool-reference drift detection;
34
+ - phase-labelled local self-tests with scheduler-tolerant process/CLI success-path and convergence budgets, while explicit timeout/cancellation fixtures retain short deadlines, so failures identify the runtime, state, daemon takeover, CLI, service, shell, or Worker-source boundary;
33
35
  - direct tests for shared project-metadata reads, strict integer normalization, plain-record classification, and canonical profile/Worker/job/lock inventory;
34
36
  - recursive syntax validation for every JavaScript file under the shipped/runtime/test roots plus the shell wrapper;
35
37
  - shared tool-catalog schema, annotation, and profile-inventory checks;
36
- - default working-agreement injection without user files, bounded automatic project metadata, script-body non-disclosure, user-global opt-out, repository opt-out rejection, global `model_instructions_file` injection in stdio/remote initialization, hierarchical precedence, `.agents/skills` and `.codex/skills` compatibility discovery, live project/skill rescanning and fingerprints, automatic task ranking/loading with English inflection normalization, bounded Chinese/English intent aliases, capability-name weighting, and selected-skill instruction loading; automatic `package.*` commands with English/Chinese workflow-intent matching and Windows command-shim execution, explicit command override/removal, direct argv handling, timeout ceilings, runtime-keyed routing-telemetry privacy, and execution-profile denial;
38
+ - default working-agreement injection without user files, bounded automatic project metadata, script-body non-disclosure, user-global opt-out, repository opt-out rejection, global `model_instructions_file` injection in stdio/remote initialization, hierarchical precedence, `.agents/skills` and `.codex/skills` compatibility discovery, live project/skill rescanning and fingerprints, conditional static-context omission through `known_refresh_fingerprint`, automatic task ranking/loading with English inflection normalization, bounded Chinese/English intent aliases, capability-name weighting, and selected-skill instruction loading; automatic `package.*` commands with English/Chinese workflow-intent matching and Windows command-shim execution, explicit command override/removal, direct argv handling, timeout ceilings, bilingual set-level route regression across Bash, commands, sessions, jobs, files/Git, browser, applications, resources, and diagnostics, effective-role filtering of application/browser/shell metadata, route ambiguity/fallback bounds, runtime-keyed routing-telemetry privacy, and execution-profile denial;
37
39
  - concurrent complete-before-visible lock claims, atomic replacement under active readers, malformed-lock grace, snapshot/token-safe reclamation, absolute-age expiry, PID-reuse detection, bounded startup-lock waiting, and wall-clock rollback injection proving duration deadlines remain monotonic;
40
+ - managed-job timeout-tree fixtures with an explicit descendant-PID readiness checkpoint before timeout and cleanup assertions, preventing scheduler delay from being misclassified as a missing cleanup target;
41
+ - managed-job non-timing approval, resource validation/redaction, output, discard, and cleanup/recovery steps with a named 120-second success budget; the aggregate-output proof uses four steps with a 600-second observer, while the managed-job tree fixture uses a 180-second timeout and 150-second descendant-readiness window; timeout/tree-kill and cancellation remain independent semantic tests;
42
+ - deterministic child-settlement coverage for delayed `exit`/`close` delivery, including POSIX zombie detection and recovery of the real exit code without weakening genuine timeout/tree-kill semantics;
43
+ - ordinary managed-job terminal observation uses 480 seconds, exceeding the longest three-phase 3×120-second fixture plan plus startup margin without changing production timeout semantics;
44
+ - managed-job CLI list/inspect/submit/read success and rejection fixtures with a distinct 120-second subprocess budget plus structured status/signal/error diagnostics; explicit job-step timeout and cancellation contracts remain independently short;
45
+ - local-self managed-job CLI subprocesses explicitly clear `NODE_V8_COVERAGE`; the top-level local-self remains instrumented, while dedicated CLI-entrypoint and managed-job fixtures provide the gated module evidence without recursive profiler startup;
46
+ - shell timeout-tree fixtures with a separate descendant-PID readiness checkpoint and bounded coverage-tolerant timeout/exit windows, while a distinct 50 ms fixture preserves direct timeout classification coverage;
47
+ - direct argv isolation success coverage with a named 30-second process budget, separate from short timeout fixtures, so scheduler delay cannot masquerade as shell interpretation or process-tracking failure;
48
+ - maintenance-lock contention with an explicit child-ready checkpoint and parent-controlled release handshake, including pipe-close cleanup, rather than a short time-based holder that can expire before delayed assertions execute;
49
+ - atomic exclusive-file creation with four simultaneously released Node processes, proving exactly one complete winner and only expected `EEXIST` losers without using a twelve-process cold-start stress test as a proxy for correctness;
38
50
  - foreground takeover of active and orphaned background daemons with current service-lock metadata, foreground-process protection, bounded final lock-handoff retry, actual-PID exit waiting, POSIX non-escalating timeout behavior, Windows verified-daemon stop semantics, daemon lock mode/version/process-start metadata, launchd service-target semantics, and silent idempotent duplicate service starts; daemon fixture subprocesses intentionally do not inherit V8 coverage because their purpose is ownership timing rather than code measurement;
39
51
  - fail-closed service lifecycle ordering for provider-stop, all-workspace daemon-stop, and definition removal, including platform/daemon/removal failure injection and normalized macOS/systemd/Windows results; service-PATH coverage reproduces two nested npm run-script prefixes plus a stale prior candidate runtime and proves the current Node/runtime and inherited user tools remain while npm-private and inactive-runtime entries are removed; Windows coverage reproduces an inline `/TR` command above 262 characters, proves the short launcher action remains bounded, verifies least-privilege logon registration, restart/log routing, language-independent `Ready`/`Running` observation, and state-observed stop/removal despite localized nonzero command output;
40
52
  - private service-environment capture/load coverage for exact allowlisting, value bounds and control-character rejection, non-proxy secret exclusion, runtime-value precedence, Windows case-insensitive replacement, explicit empty-value clearing, and preservation across a later environment-free startup;
@@ -53,8 +65,9 @@ The suite includes:
53
65
  - fixed internal command execution with validated argv, no shell, isolated HOME/temp/cache, bounded output/deadlines, and ordinary cancellation/process tracking while arbitrary delegated process tools remain sandbox-gated;
54
66
  - author-email privacy in `git_log`;
55
67
  - isolated command HOME/temp/cache behavior;
56
- - one-shot timeout, descendant process-group/tree termination including descendants that ignore graceful shutdown after the direct child has already exited, post-`SIGTERM` ownership refresh, targeted PID identity fallback when full process-table inspection is unavailable, PID-reuse denial, repeated leak checks, cancellation, and process-session interaction;
57
- - layered fixed runtime diagnostics for filesystem, direct process, shell, managed-job storage, and resource availability; machine-readable execution guardrails that must keep CPU, memory, and network isolation marked unenforced unless an actual OS boundary is added;
68
+ - one-shot timeout, descendant process-group/tree termination including descendants that ignore graceful shutdown after the direct child has already exited, post-`SIGTERM` ownership refresh, one shared monotonic budget across full and targeted ownership probes, observation deadlines derived from the exported graceful-termination and ownership-budget constants with bounded scheduling margin, a real uncooperative-child regression proving hard `spawnSync` timeout termination, synchronous smoke/self-test timeout hard termination, targeted PID identity fallback when full process-table inspection is unavailable, empty-snapshot fail-closed behavior, exact start-time/PID-reuse denial, deterministic `close`/post-`exit` fallback races, managed-job terminal persistence and runner exit, repeated leak checks, cancellation, and process-session interaction;
69
+ - layered fixed runtime diagnostics for filesystem, direct process, shell, managed-job storage, and resource availability, with a separate bounded 30-second process/shell health budget rather than reuse of user-command or short timeout-test deadlines; machine-readable execution guardrails that must keep CPU, memory, and network isolation marked unenforced unless an actual OS boundary is added;
70
+ - Git operation setup under scheduler contention: runtime Git success fixtures and the fail-closed read-only repository-root probe use a bounded 30-second metadata budget, avoiding a hidden 10-second subdeadline beneath 30-60 second status/log/diff/show operations;
58
71
  - local resource CLI registration, permission checks, dynamic reload, state-path redaction, content non-disclosure, and the extracted runtime-resource boundary for bounded binary/UTF-8 reads plus generation authorization;
59
72
  - real Ed25519 and RSA generation, idempotent reuse, public/private correspondence, mode enforcement, incomplete/mismatched/symlink rejection, and private-content non-disclosure;
60
73
  - real-machine canonical-full sandbox acceptance for outside-workspace I/O, direct/shell execution, full environment inheritance, SSH prerequisites, temporary authorized-key writing, and detached cleanup without external state changes;
@@ -69,7 +82,7 @@ The suite includes:
69
82
  - shared no-follow bounded-file reads for normal files, over-limit data, directories, and symbolic links;
70
83
  - owner-only directory enforcement rejecting final symlinks, failing closed on POSIX chmod errors, verifying `0700`, and retaining Windows portability; Worker temporary-secret lifecycle coverage for process-start-bound names, valid stale-owner reclamation, ambiguous-owner retention, `0600` mode, deletion failures, and simultaneous deployment/cleanup failures;
71
84
  - SARIF security-gate behavior for unknown findings, exact accepted rule/path matches, path mismatch rejection, rationale quality, and exception expiry;
72
- - deterministic property tests over hostile browser-protocol byte strings, canonical/custom policy combinations, argv bounds/NULs, and a real direct process proving shell metacharacters remain literal argv;
85
+ - deterministic property tests over hostile browser-protocol byte strings, canonical/custom policy combinations, argv bounds/NULs, and a real direct process proving shell metacharacters remain literal argv; process-tree tests also assert Darwin uses a target-PGID `ps` query, preserve the global inspection budget, and repeatedly prove anti-`SIGTERM` descendants exit after foreground timeout;
73
86
  - prototype-shaped command, action, role, profile, form-field, keyboard, and resource names proving that inherited object properties are never interpreted as dispatch or authority; current-schema malformed OAuth roles are repaired to disabled reviewer accounts with credential revocation;
74
87
  - canonical Worker deployment URL extraction proving unrelated `/mcp`, `/healthz`, path-bearing, and wrong-name URLs cannot be persisted as upload evidence;
75
88
  - byte-exact UTF-8 DOM-source truncation across emoji and Chinese partial-code-point boundaries, including equality between the reported byte count and the encoded returned source;
@@ -80,7 +93,7 @@ The suite includes:
80
93
  - P-256 root generation, root-certified ephemeral session issuance, macOS trust-broker build/signature checks, signed WebSocket preflight, one-time transactional nonce consumption, challenge transcript binding, wrong-root/session/tamper/expiry/replay rejection, and prevention of unauthenticated candidate churn;
81
94
  - request-scoped effective authority and catalog-wide risk review; non-escalatable reviewer/editor/operator ceilings; authenticated-owner direct execution; control-plane root denial; external and sensitive path composition; persistence-target rejection; symbolic-link ancestor and patch-move canonicalization; owner-only browser/application/data-export and persistent-plan effects; account/client/refresh-family ownership of processes, output sessions, and jobs; delegated sandbox fail-closed behavior; legacy-lease non-consumption; and malformed-record rejection;
82
95
  - root-certified ephemeral P-256 account-administration requests with origin/method/path/body/key/time/nonce binding, transactional one-time nonce consumption, removal of the long-lived administration secret, certificate/signature/body tamper rejection, nonce replay rejection, malformed nonce-state fail-closed behavior, one-megabyte response bounds, immediate oversized-response cancellation, and strict successful JSON-object validation;
83
- - live local Worker OAuth registration, the unauthenticated `resource_metadata` challenge, protected-resource and authorization-server discovery, Streamable transport metadata, consent, URL-constructed `303` callbacks including the ChatGPT and hosted Claude redirect URIs with encoded state, PKCE, `offline_access`, form-encoded authorization-code and refresh-token exchanges, fifteen-minute access tokens, trusted single-account client binding, optional DPoP proof and token-family binding, unsupported critical-header rejection, proof-verification non-consumption, post-authorization replay consumption, invalid-grant cache-exhaustion resistance, independent client revocation, refresh-family idle/absolute limits, bounded consumed-token/revoked-family replay state, record-level schema validation, access/refresh rotation, idempotent identity-equivalent concurrent refresh recovery with identical replacement credentials and expiration, retry-budget throttling, post-grace replay with whole-family access/refresh revocation, account-version refresh revocation, authorization-code replay rejection, pending-registration throttling that excludes already authorized DCR clients, exact built-in ChatGPT/Grok browser origins, additive custom origins, unrelated-origin preflight rejection, no CORS response sharing for unrelated or opaque origins, opaque-origin authorization-form routing, exact per-request redirect-origin CSP with narrowly scoped Microsoft regional-consent and final Copilot Studio handoff exceptions, accessible credential-error rendering, protocol negotiation, HMAC-bound MCP session issuance, SSE content negotiation including `q=0`, immediate stream priming, keepalive and terminal-event framing, HTTP abort without implicit cancellation, explicit cancellation after response disconnect, shared Worker/local timeout ceilings, two-session same-id concurrency, sessionless same-id independence, session-scoped cancellation isolation, same-session duplicate rejection, daemon-backed session bootstrap, dynamic tool advertisement, rich content, candidate/probing/ready transitions, invalid readiness-result rejection, incumbent preservation until verified handover, daemon replacement, cancellation, malformed daemon JSON/non-object rejection, duplicate hello rejection, and unknown-message closure. The metadata/refresh contract is the path used by Claude DCR and Copilot Studio Dynamic discovery. The same integration runs an `editor` account against a canonical `full` daemon and proves that `server_info` and remote `project_overview` report effective `edit` authority while retaining the full daemon ceiling only in explicitly scoped fields.
96
+ - live local Worker OAuth registration and authorization metadata; PKCE, DCR, refresh rotation/replay, account/client/family revocation, DPoP, actual `/mcp` Origin checks, bounded CORS/CSP, exact callback handling, and bounded OAuth persistence; modern MCP `2026-07-28` per-request `_meta`, open-JSON structural budgets, bounded resource subscriptions, strict dual-media `Accept` quality values, mirrored header/body validation, `server/discover`, result identity, cache hints, same-token/same-request-ID concurrency, role-hidden/unknown/schema `-32602` non-dispatch, credential-free private cancellation (including public-header forgery and DPoP replay controls), request-scoped streaming, filtered `subscriptions/listen`, removed-method 404 behavior, and no session/replay leakage; plus the complete legacy MCP `2025-11-25` initialize, pre-persistence raw-argument validation, signed-session cancellation, sequence event, recovery GET, `Last-Event-ID`, duplicate-domain, and replay-isolation suite. The same integration covers shared Worker/local timeout ceilings, daemon candidate/probing/ready replacement, malformed daemon messages, rich content, account-role projection, and stable catalog behavior before/during/after daemon availability.
84
97
  - local runtime proof that one blocked tool handler does not serialize an independent handler, plus relay fault injection proving an undeliverable terminal result interrupts the ambiguous socket and enters reconnect backoff.
85
98
  - a real headless-Chrome OAuth navigation regression with four cases: `form-action 'self'` blocks the first cross-origin callback, allowing only the registered callback blocks the regional redirect, allowing the registered and regional callbacks blocks the final Copilot Studio redirect, and the complete policy preserves `code` and `state` through all three cross-origin hops. Linux CI fails if Chrome is unavailable; other environments skip only this browser executable check while retaining the Worker CSP assertions.
86
99
 
@@ -106,11 +119,14 @@ For deterministic release validation, perform an isolated-profile smoke test wit
106
119
 
107
120
  ## Critical-module coverage gate
108
121
 
109
- `npm run coverage:test` runs selected in-process and lightweight entrypoint fixtures under V8 coverage and enforces per-module function and branch baselines. The measured set includes policy, typed errors, call registration, execution middleware, lifecycle/observability, logging, Runtime/CLI orchestration, state persistence, relay lifecycle, managed-job lifecycle/runner/storage/projection, browser broker/direct-request/runtime-client routing and loopback upgrade handling, the independently injected service CLI adapter, Agent configuration/projection/skill discovery and bounded text reads, capability ranking, runtime path redaction, browser protocol/operation boundaries, runtime reporting/diagnostics/capability composition, and Worker OAuth state/authorization-page/pending/policy/error/JSON-RPC/WebSocket protocol modules. The full stdio and workerd OAuth/MCP integration still runs separately.
122
+ `npm run coverage:test` runs selected in-process and lightweight entrypoint fixtures under V8 coverage and enforces per-module function and branch baselines. The measured set includes policy, typed errors, call registration, bounded child-process settlement, execution middleware, lifecycle/observability, logging, Runtime/CLI orchestration, persistent candidate activation, state persistence, relay lifecycle, managed-job lifecycle/runner/storage/projection, browser broker/direct-request/runtime-client routing and loopback upgrade handling, the independently injected service CLI adapter, Agent configuration/projection/skill discovery and bounded text reads, capability ranking, runtime path redaction, browser protocol/operation boundaries, runtime reporting/diagnostics/capability composition, and Worker OAuth state/authorization-page/pending/policy/error/JSON-RPC/WebSocket protocol modules. The full stdio and workerd OAuth/MCP integration still runs separately.
110
123
 
111
- The gate deliberately reports each module rather than one aggregate percentage. New extracted pure/domain modules carry explicit branch floors, while the broad CLI entrypoint remains reported and locked independently. Worker pending calls and policy now have branch minima instead of function-only gates. A refactor may raise a threshold, but must not lower one merely to make CI green without an explicit audit explanation.
124
+ Coverage belongs to the selected top-level fixtures. Concurrency, process-identity, and daemon-takeover helpers explicitly set `NODE_V8_COVERAGE` to an empty value: Node reinjects the parent coverage directory when the variable is merely deleted, which would start a profiler in every helper and distort both runtime and host load without improving the gated module evidence. Helper scripts assert this isolation where practical.
125
+ Managed-job runners remain instrumented because their lifecycle modules are gated; only test-plan business steps clear coverage, preventing nested profiler startup from replacing the behavior the test is intended to observe. The suite also holds a queued status beyond the recovery grace period while a provisional runner claim is live, verifies that no recovery occurs, and checks that the child upgrades the one-time-token claim to an exact token-free process identity.
112
126
 
113
- `npm run typecheck` combines strict Worker TypeScript with a focused `tsconfig.local.json` gate. High-risk JavaScript contracts opt in with `// @ts-check` and JSDoc types; the gate currently covers policy, call lifecycle, Agent configuration/path resolution, public projection, skill discovery, bounded Agent text reads, runtime path redaction, browser handshake parsing, capability ranking, monotonic deadlines, number/record normalization, and bounded metadata reads. `@ts-ignore`, implicit `any`, or unchecked parallel contract shapes are not accepted as migration shortcuts.
127
+ The gate deliberately reports each module rather than one aggregate percentage. New extracted pure/domain modules carry explicit branch floors, while the broad CLI entrypoint remains reported and locked independently. The machine-service owner, owner-aware service runtime, and Windows convergence modules require 100% function coverage with high branch floors; runtime activation remains independently gated. Worker pending calls and policy have branch minima instead of function-only gates. A refactor may raise a threshold, but must not lower one merely to make CI green without an explicit audit explanation.
128
+
129
+ `npm run typecheck` combines strict Worker TypeScript with a focused `tsconfig.local.json` gate. High-risk JavaScript contracts opt in with `// @ts-check` and JSDoc types; the gate currently covers policy, call lifecycle, Agent configuration/path resolution, public projection, skill discovery, bounded Agent text reads, runtime path redaction, browser handshake parsing, capability ranking, monotonic deadlines, number/record normalization, bounded metadata reads, the machine-service owner transaction, owner-aware service convergence, Windows service convergence, child settlement, and process-tree ownership. `@ts-ignore`, implicit `any`, or unchecked parallel contract shapes are not accepted as migration shortcuts.
114
130
 
115
131
  ## Additional release checks
116
132
 
@@ -120,14 +136,14 @@ npm run worker:dry-run
120
136
  npm audit --audit-level=high
121
137
  npm audit --omit=dev --audit-level=high
122
138
  npm audit signatures
123
- npm sbom --sbom-format cyclonedx
139
+ npm run sbom:test
124
140
  npm pack --dry-run
125
141
  npm run version:check
126
142
  npm run release-impact:check
127
143
  npm run release:acceptance:verify
128
144
  ```
129
145
 
130
- GitHub Actions uses the pinned Node 26/npm 12 baseline in three execution paths. Ubuntu runs `check:full` and verifies interactive candidate acceptance. macOS and Windows run `check:platform` plus the installed-package smoke test, preserving platform coverage without repeating every Worker, browser, and package integration fixture three times. A separate package-audit job scans reachable Git history, audits complete and production dependency graphs, verifies registry signatures and attestations, validates a CycloneDX SBOM under the runner temporary directory, repeats the isolated installation test, and performs a package dry run. Because Node 26 currently bundles npm 11, every npm execution job downloads the exact npm 12.0.1 tarball, rejects redirects, verifies its recorded SHA-512 SRI, and exposes that verified CLI through `GITHUB_PATH`. Separate pinned workflows validate governance titles, dependency changes, CodeQL, and OpenSSF Scorecard. Third-party Actions remain pinned to immutable commits, SARIF findings fail closed unless exactly reviewed, and source release creation requires successful push-triggered CI, CodeQL, Governance, and Scorecard runs for the exact `main` commit.
146
+ GitHub Actions uses the pinned Node 26/npm 12 baseline in three execution paths. Ubuntu runs `check:full` and verifies interactive candidate acceptance. macOS and Windows run `check:platform` plus the installed-package smoke test, preserving platform coverage without repeating every Worker, browser, and package integration fixture three times. A separate package-audit job scans reachable Git history, audits complete and production dependency graphs, verifies registry signatures and attestations, validates a CycloneDX SBOM under the runner temporary directory; the local/full gate independently runs `sbom:test` through the pinned npm CLI, repeats the isolated installation test, and performs a package dry run. Because Node 26 currently bundles npm 11, every npm execution job downloads the exact npm 12.0.1 tarball, rejects redirects, verifies its recorded SHA-512 SRI, and exposes that verified CLI through `GITHUB_PATH`. Separate pinned workflows validate governance titles, dependency changes, CodeQL, and OpenSSF Scorecard. Third-party Actions remain pinned to immutable commits, SARIF findings fail closed unless exactly reviewed, and source release creation requires successful push-triggered CI, CodeQL, Governance, and Scorecard runs for the exact `main` commit.
131
147
 
132
148
  ## Test design rules
133
149
 
@@ -148,7 +164,7 @@ Run `npm run privacy:check` before committing and before packaging. Run and revi
148
164
 
149
165
  ## Package manifest
150
166
 
151
- `npm run package:test` executes a real silent `npm pack --dry-run --json`, requires clean parseable JSON, rejects sensitive local artifacts, credential-like file classes, and generated Worker type declarations, validates every packaged mode as `0644` or `0755`, and verifies that required runtime, script, browser-extension, privacy, governance, and release files are present. Exact runtime install-script approvals are version-bound, so a Wrangler/workerd refresh must also update the reviewed allowlist and pass a clean npm install without blocked-script warnings. `npm run install:test` requires npm 12, installs the real tarball from a package-free directory into an isolated global prefix with the documented options, verifies the packaged npm engine requirement, rejects blocked-script warnings, confirms optional `fsevents` is absent, verifies `--version`, then runs the installed CLI with zero arguments from an isolated workspace/state root. A fake Wrangler JavaScript entrypoint terminates at a controlled deployment boundary, so the probe exercises startup without mutating a live account. Package testing is full-plan-only; installation smoke runs in the Ubuntu full plan, the macOS/Windows platform plan, and package audit.
167
+ `npm run package:test` executes a real silent `npm pack --dry-run --json`, requires clean parseable JSON, rejects sensitive local artifacts, credential-like file classes, and generated Worker type declarations, validates every packaged mode as `0644` or `0755`, and verifies that required runtime, script, browser-extension, privacy, governance, and release files are present. Exact runtime install-script approvals are version-bound, so a Wrangler/workerd refresh must also update the reviewed allowlist when the resolved workerd build changes and must pass a clean npm install without blocked-script warnings. A Wrangler-only or Miniflare-only patch that retains the same workerd build must prove that the existing single exact approval still matches the lockfile. `npm run install:test` requires npm 12, installs the real tarball from a package-free directory into an isolated global prefix with the documented options, verifies the packaged npm engine requirement, rejects blocked-script warnings, confirms optional `fsevents` is absent, verifies `--version`, then runs the installed CLI with zero arguments from an isolated workspace/state root. A fake Wrangler JavaScript entrypoint terminates at a controlled deployment boundary, so the probe exercises startup without mutating a live account. Package testing is full-plan-only; installation smoke runs in the Ubuntu full plan, the macOS/Windows platform plan, and package audit.
152
168
 
153
169
  `npm run lint` uses ESLint as a semantic JavaScript correctness gate rather than a style formatter. It covers the Node CLI/runtime, repository scripts, tests, and packaged browser extension and rejects undefined identifiers in function bodies that `node --check` cannot detect. A dedicated lint-gate self-test proves that both Node and browser configurations reject a synthetic undefined binding while accepting the service-worker `importScripts` global. A focused `shell:test` requires Wrangler to run through the current Node executable and its package JavaScript entrypoint rather than a `.cmd` or shell shim. Architecture tests require `shell:test`, `lint:test`, `lint`, and `install:test` to remain in the complete check pipeline and reject non-exact direct dependency ranges.
154
170
 
@@ -156,11 +172,15 @@ The stdio integration test also sends an oversized line, verifies bounded reject
156
172
 
157
173
  ## Architecture and documentation regression checks
158
174
 
159
- `npm run architecture:test` runs independent module-boundary, repository-hygiene, browser/security-structure, and release/documentation-contract checks. It validates the explicit fast/full check plans, local import graph, domain/adapter direction, module headroom budgets, immutable workflow references, package-script targets, documentation links, publication inventory, and selected security-shape invariants. Critical coverage thresholds include every extracted OAuth refresh, token issuance, stream subscription, static metadata/routing, quota guard, edge logger, and filesystem-state module. These source-shape checks are deliberately supplementary: behavior, denial, race, and fault-injection tests remain authoritative for semantic guarantees. Tests must not depend on a fixed CI job count when the actual invariant is that every npm job uses the same verified bootstrap.
160
- ## Resumable MCP delivery coverage
175
+ `npm run architecture:test` runs independent module-boundary, repository-hygiene, browser/security-structure, and release/documentation-contract checks. It validates the explicit fast/full check plans, local import graph, domain/adapter direction, module headroom budgets, immutable workflow references, package-script targets, documentation links, publication inventory, and selected security-shape invariants. Critical coverage thresholds include every extracted OAuth refresh, token issuance, stream subscription, static metadata/routing, quota guard, edge logger, filesystem-state module, system-route classifier, and remote timeout/catalog projection. These source-shape checks are deliberately supplementary: behavior, denial, race, and fault-injection tests remain authoritative for semantic guarantees. Tests must not depend on a fixed CI job count when the actual invariant is that every npm job uses the same verified bootstrap.
176
+ ## MCP delivery and conformance coverage
161
177
 
162
178
  `npm run mcp-resumption:test` directly exercises stream cursor parsing, OAuth-token/MCP-session isolation, immediate pending/terminal polls, active and completed replay, orphaned-stream restart ambiguity, persisted-call restart recovery, strict call-record validation, request-key uniqueness, operation/reconnect deadlines, repeated detach/rebind retention extension, stale-generation rejection, prototype-safe aggregation, exactly-once completion, result-size fallback, SHA-256 tamper detection, transient persistence failure, expiry, capacity, completed-record eviction, the four-row plain-stream budget, and the fixed six-row durable-call lifecycle budget.
163
179
 
164
- `npm run worker-runtime-infrastructure:test` verifies outer-Worker stream ownership, stripping of caller-supplied internal headers, bounded descriptor/subscribe adaptation, fixed request budgets, bounded transient subscription retries, outer metadata/404/invalid-method bypass, stateful burst limiting, structured and duplicate-suppressed gateway failures, coalesced alarm writes, sequence-zero/sequence-one framing, subscription-error closure, subscriber replacement, non-daemon socket isolation, and the shared two-minute/64-stream/1.5-MiB contract. It models the production durable-call boundary: initiation persists ownership without retaining a terminal Promise, later success or daemon rejection settles once, send failure cleans the record, capacity fails closed, and same-instance reconnect moves ownership to a new generation while rejecting the stale one. Deadline tests prove both JSON-only timer/sweep behavior and persisted-call alarm expiry without leaking request keys. A direct runtime-alarm coordinator test verifies the earliest transient-or-durable deadline, alarm removal when no deadline remains, event-entry expiry before rescheduling, and bounded reporting when Durable Object alarm storage fails. The same suite also proves that direct same-instance handover preserves the remaining timeout budget. `npm run worker:integration-test` performs the real Wrangler path: the role-filtered catalog remains stable before, during, and after daemon availability changes; execution still fails closed without a ready daemon; an open SSE stream coexists with concurrent `server_info` and explicit cancellation; verified same-instance replacement transfers an in-flight call before incumbent close; disconnect/recovery remains token/session isolated; and sequence-one acknowledgement is not delivered twice. Managed-job integration treats `__proto__`, `constructor`, `toString`, and `valueOf` environment/resource-map keys as ordinary own data while retaining duplicate-key rejection. Static architecture checks forbid a stream-initiation `dispatchJsonRpc` Promise, `resumption.attach`, Durable Object `waitUntil`, Promise-valued recovery state, or return of the obsolete transient `registerEvent` branch. The parser accumulates complete SSE events and does not assume network chunk boundaries. CORS coverage requires both `DPoP` and `Last-Event-ID`.
180
+ `npm run worker-runtime-infrastructure:test` verifies both delivery eras. Modern coverage proves private prepare/subscribe/cancel control headers are stripped at the public edge, transient ownership is memory-only, cancellation releases it exactly once, no event ID or replay record is created, and already-attached internal settlement cannot make a cancelled stream reusable. Legacy coverage retains descriptor/subscriber adaptation, sequence-zero/sequence-one framing, hibernatable subscription replacement, durable ownership/settlement, timeout/reconnect alarms, two-minute/64-stream/1.5-MiB bounds, stale-generation rejection, result acknowledgement/replay, and same-instance handover. Shared checks cover stateful burst limiting, gateway failures, daemon call deadlines, socket isolation, output/log maintenance, and no request-key leaks.
181
+
182
+ `npm run worker:integration-test` exercises the real Wrangler/OAuth/daemon path. It runs ordinary modern and legacy regression cases by default. When `MBM_OFFICIAL_CONFORMANCE_CHECKOUT` and `MBM_OFFICIAL_CONFORMANCE_SCENARIOS` are set, it also drives the pinned official MCP conformance checkout through a test-only loopback proxy that injects the already-created short-lived test bearer token. The production OAuth endpoint is unchanged, the alpha conformance package is not added to the dependency graph, and `tests/mcp-conformance-baseline.yml` contains only check-scoped exclusions for capabilities the production server intentionally does not advertise. A new unrelated failure or a stale expected-failure entry fails the run. The checkout must be a real directory with a committed lockfile and installed dependencies; missing or cleaned checkouts fail before Worker startup rather than surfacing as an ambiguous spawn error. Treat the alpha runner as an external audit tool: record its exact commit, inspect its own `npm audit` result, run it only against the loopback proxy, and remove the checkout afterward.
183
+
184
+ `npm run tool-arguments:test` compiles all tool schemas under the bounded JSON Schema 2020-12 subset and covers type, range, length, array, object, pattern, enum, conditional/composition, unsupported dialect/keyword, external `$ref`, depth, node-count, issue-count, and value-redaction behavior. Worker and stdio integration additionally prove malformed calls are rejected before daemon/local side effects.
165
185
 
166
- Beta.21 closeout requires a fresh pass of the complete 63-task fast plan and 91-task full plan after the final relay error-classification changes; an earlier green run cannot be reused as terminal evidence.
186
+ Every candidate closeout requires fresh fast and full plans after the final packaged-source change; an earlier green run from another prerelease or pre-documentation tree is not terminal evidence.
@@ -37,10 +37,17 @@ The hosted MCP client, its prompts, tools, extensions, and retrieved content are
37
37
  - OAuth state, PKCE, redirect URI, resource binding, and request size;
38
38
  - account status, account version, account role, trusted client binding, token expiry, and refresh-family state;
39
39
  - DPoP proof method, target URL, timestamp, unique identifier, access-token hash, and key thumbprint when DPoP is used;
40
- - MCP session state, protocol version, method shape, request IDs, cancellation, and allowed tool exposure.
40
+ - modern per-request protocol metadata, valid positive `Accept` quality values, actual `/mcp` Origin, header/body consistency for version/method/name/declared primitive parameters, request IDs, role-visible tool exposure, raw argument schemas, and response-stream cancellation;
41
+ - legacy initialization, signed session, explicit cancellation, and bounded replay state when the client selects MCP `2025-11-25`.
41
42
 
42
43
  A client registration is not authority. Authority begins only after successful account authorization binds the client to one account and role version.
43
44
 
45
+ Capability discovery is also an authorization boundary. Task routing and application/browser metadata are built from the effective account/daemon policy intersection, not from the daemon ceiling. Route scores and fallbacks are advisory and cannot manufacture authority; direct Bash remains available only when the effective policy already exposes it. A restricted account must not learn hidden local application inventory or receive names of unavailable execution tools through the resolver.
46
+
47
+ Mirrored MCP headers are an intermediary-routing boundary. The Worker compares every required modern header with the JSON-RPC body before authorization-dependent dispatch; a mismatch fails with `-32020` before the daemon can observe the call. Tool schemas are compiled from a bounded JSON Schema 2020-12 subset at startup and runtime traversal charges every array item and own object property to a fixed work budget. Open metadata/capability/subscription JSON also has a fixed structural-node/depth/key budget, and resource subscriptions are count/length bounded. Unsupported dialects or keywords fail closed, external network `$ref` values are not dereferenced, and validation diagnostics omit argument values and unbounded caller identifiers.
48
+
49
+ Modern cancellation deliberately crosses the OAuth boundary only through an unguessable internal stream capability. The public Worker strips caller-provided control headers before the service binding, the cancellation request contains no bearer token or DPoP proof, and the Durable Object consumes the capability before OAuth only to cancel a currently indexed call. Guessing remains bounded by 256-bit randomness; a compromised service binding or Worker runtime is already inside this trust boundary.
50
+
44
51
  ### Worker to local daemon
45
52
 
46
53
  The Worker is a relay and authorization layer, not the source of local OS authority.
@@ -113,6 +120,8 @@ Machine Bridge considers:
113
120
  The implementation aims to preserve these invariants:
114
121
 
115
122
  - unknown, malformed, stale, replayed, duplicated, unauthorized, and over-limit input is rejected;
123
+ - an intermediary cannot authorize or route one modern method/name while the Worker executes another body; mirrored-header mismatch is rejected before dispatch;
124
+ - modern request IDs are not global identities across clients sharing one bearer token, while legacy duplicate and cancellation domains remain bound to the signed session;
116
125
  - the stable account-role discovery catalog is not treated as execution authority; every call is intersected with the current end-to-end-ready daemon policy and fails closed when that authority is absent;
117
126
  - remote authority is the intersection of daemon policy and account role, never the union;
118
127
  - no approval record, token refresh, or local migration state can elevate a delegated role;
@@ -182,7 +191,9 @@ UI state can change between inspection and action. Pages can present deceptive c
182
191
 
183
192
  ### Managed jobs
184
193
 
185
- Managed jobs outlive MCP calls and daemon reconnects. Plans and resources are validated and ownership-bound, but an authorized owner plan can still consume resources or perform destructive work. Finally steps must be idempotent because recovery may retry them.
194
+ Synchronous identity and sandbox probes use `SIGKILL` when their declared deadline expires; a soft timeout signal is not treated as a bound because the caller can otherwise remain blocked. POSIX forced process-tree escalation requires a non-empty captured ownership set and exact PID/start-time continuity. If process inspection is unavailable or ambiguous, Machine Bridge may leave a resistant descendant for operator cleanup rather than risk signaling a reused process group.
195
+
196
+ Managed jobs outlive MCP calls and daemon reconnects. Plans and resources are validated and ownership-bound, but an authorized owner plan can still consume resources or perform destructive work. Finally steps must be idempotent because recovery may retry them. Process-tree escalation revalidates captured PID, start-time, and process-group identity so PID reuse cannot redirect `SIGKILL` to an unrelated process. Full and targeted process snapshots share one monotonic budget per ownership decision, preventing descendant count or a stalled process-table query from expanding shutdown latency without bound. Darwin additionally queries only the target PGID, reducing the chance that unrelated process-table load erases all ownership evidence and forces fail-closed descendant retention. A missing ChildProcess `close` event after observed `exit` receives a bounded output-drain fallback and cannot leave a managed-job runner permanently unresolved.
186
197
 
187
198
  ### Availability and resource exhaustion
188
199
 
@@ -190,12 +201,16 @@ Application-level limits bound many requests and outputs. An authorized owner pr
190
201
 
191
202
  ### System VPN/TUN and distributed activation
192
203
 
193
- A system VPN/TUN can remain administratively connected while its selected upstream route, synthetic DNS mapping, or transport path is temporarily unusable. Machine Bridge can detect missing inbound relay traffic, classify the socket close, bound retry delay, and report outage history, but it cannot select or repair a third-party VPN node. `system-network-stack` is therefore not a claim of direct routing. A Worker transport/liveness invalidation is treated as a retryable socket-generation failure; elevating it to a permanent protocol error would let an ordinary network fault restart the daemon and amplify the outage. Unknown protocol messages and authentication or version mismatch remain fail-closed.
204
+ A system VPN/TUN can remain administratively connected while its selected upstream route, synthetic DNS mapping, or transport path is temporarily unusable. Machine Bridge can detect missing inbound relay traffic, classify the socket close, bound retry delay, report outage history, and on macOS classify the default route as tunnel/VPN versus a coarse non-tunnel category. It cannot identify the failing upstream node or repair a third-party VPN. `system-network-stack` is therefore not a claim of direct routing. The route diagnostic deliberately omits interface identity, addresses, DNS answers, and endpoints. A Worker transport/liveness invalidation is treated as a retryable socket-generation failure; elevating it to a permanent protocol error would let an ordinary network fault restart the daemon and amplify the outage. Unknown protocol messages and authentication or version mismatch remain fail-closed.
205
+
206
+ Candidate activation verifies the foreground candidate before service handoff and records exact package/deployment evidence. It does not provide an atomic transaction spanning Cloudflare deployment and every local service manager. The machine-global service definition therefore has an owner-only pending/committed ledger, all service writers share one fixed per-user lock, and any path that also acquires a workspace startup lock uses machine-service-first ordering. Provider-active state is not authenticity evidence: the exact owner-bound service daemon must publish a token-protected readiness checkpoint after device authentication, relay probe, and `ready_ack`. Missing, corrupt, pending, mismatched, or unready ownership fails closed.
194
207
 
195
- Candidate activation verifies the foreground candidate before service handoff and records exact package/deployment evidence. It does not provide an atomic transaction spanning Cloudflare deployment and every local service manager. If the Worker changes and the local handoff later fails, the operator may need the recorded previous runtime/deployment evidence to complete rollback. Local cleanup errors are aggregated rather than hidden, but remote rollback is not fabricated.
208
+ An explicit candidate device-authentication rejection permits one same-name redeployment with the unchanged selected identity; ambiguous network or health failure does not. After remote preparation, local compensation installs and starts the compatible candidate service rather than reviving a known-incompatible old daemon. Before remote preparation, restoration of an older service requires the same version and entrypoint to reappear as a verified service-mode daemon. The wrapper intentionally has no transaction-wide hard kill, because killing the parent could bypass cleanup and leave detached deployment helpers; each internal stage has its own deadline instead. Persistent Cloudflare, service-manager, filesystem, or process-inspection failure can still require operator diagnosis. Local cleanup errors are aggregated rather than hidden, and remote rollback is not fabricated.
196
209
 
197
210
  ### External governance and publication
198
211
 
212
+ GitHub tag/Release publication requires an explicit confirmation flag, TTY-backed stdin/stdout/stderr, and one process-identity lock shared through the common Git directory. This blocks the supported MCP, managed-job, CI, redirected, and ordinary background paths and prevents concurrent publication from separate linked worktrees. It is a workflow and accountability boundary, not cryptographic user-presence authentication: arbitrary code already executing as the same OS user can allocate a pseudo-terminal and invoke the same command. A protected release environment, hardware-backed user presence, or a separately isolated principal is required when adversarial same-user separation is part of the threat model.
213
+
199
214
  Code cannot create a second independent reviewer, npm OIDC trust relationship, protected publication environment, Apple Developer identity, or external certification. These remain explicit operational requirements.
200
215
 
201
216
  ## Validation map
@@ -209,7 +224,7 @@ Regression suites cover:
209
224
  - delegated sandbox behavior and fail-closed platform detection;
210
225
  - process/session cleanup, generated-key rollback including cleanup failure, managed-job lifecycle and recovery, state locks, atomic persistence, and destructive removal;
211
226
  - browser pairing, version/capability handshake, broker routing, independent concurrency limits, public-error redaction, sensitive input, and navigation controls;
212
- - audit-chain integrity, privacy redaction, package contents, installation, release impact, dependency integrity, CodeQL, and Scorecard findings;
227
+ - audit-chain integrity, privacy redaction, package contents, installation, release impact, dependency integrity, CodeQL, Scorecard findings, and GitHub publication guard/lock behavior;
213
228
  - malformed, over-limit, concurrent, replayed, stale, and fault-injected inputs.
214
229
 
215
230
  See [TESTING.md](TESTING.md) for the test inventory and [AUDIT.md](AUDIT.md) for historical findings and residual limitations.
@@ -66,7 +66,7 @@ Tool count: **51**.
66
66
 
67
67
  **Server information**
68
68
 
69
- Return authenticated account authority, effective policy/tools, daemon capability ceiling, runtime metadata, and protocol status. Treat authorization.effective_policy and authorization.effective_tools as authoritative; daemon.policy is only a ceiling.
69
+ Return live authorization, effective tools, daemon/relay health, runtime state, and protocol status. Use this for authority or connectivity diagnosis, not for repository inventory. Treat authorization.effective_policy and authorization.effective_tools as authoritative; daemon.policy is only a ceiling.
70
70
 
71
71
  | Contract field | Value |
72
72
  |---|---|
@@ -89,7 +89,7 @@ Return authenticated account authority, effective policy/tools, daemon capabilit
89
89
 
90
90
  **Project overview**
91
91
 
92
- Summarize the connected workspace and repository. Remote responses report the authenticated account effective policy/tools at policy and tools, with the daemon capability ceiling preserved separately as daemonPolicy and daemonTools.
92
+ Summarize the connected workspace, repository root, top-level entries, and project-facing runtime context. Use this for repository inventory, not as the primary live relay-health check. Remote responses report authenticated-account effective policy/tools separately from the daemon capability ceiling.
93
93
 
94
94
  | Contract field | Value |
95
95
  |---|---|
@@ -112,7 +112,7 @@ Summarize the connected workspace and repository. Remote responses report the au
112
112
 
113
113
  **Load session bootstrap**
114
114
 
115
- Load built-in working agreements, bounded automatic project facts, user-global and root workspace instructions, and capability refresh metadata for MCP session initialization.
115
+ Load built-in working agreements, bounded automatic project facts, user-global and root workspace instructions, and capability refresh metadata. Modern clients call it explicitly; legacy initialize clients receive the same bounded guidance through the compatibility adapter.
116
116
 
117
117
  | Contract field | Value |
118
118
  |---|---|
@@ -142,7 +142,7 @@ Load built-in working agreements, bounded automatic project facts, user-global a
142
142
 
143
143
  **Resolve task capabilities**
144
144
 
145
- Rescan built-in and automatic project context, local instruction files, skills, explicit and automatic package commands, installed applications, and browser capability metadata; rank the capabilities relevant to the current task and optionally load the best skill.
145
+ Rescan task-relevant instructions, skills, registered commands, installed applications, browser metadata, and the effective tool catalog. Return bounded set-level execution routes, ranked tools, routing ambiguity, and an optional selected skill. Pass known_refresh_fingerprint to omit unchanged static instructions while recomputing task-specific ranking. The result is advisory: direct Bash and every other policy-allowed tool remain available.
146
146
 
147
147
  | Contract field | Value |
148
148
  |---|---|
@@ -178,6 +178,12 @@ Rescan built-in and automatic project context, local instruction files, skills,
178
178
  "include_selected_skill": {
179
179
  "type": "boolean",
180
180
  "default": true
181
+ },
182
+ "known_refresh_fingerprint": {
183
+ "type": "string",
184
+ "pattern": "^[a-f0-9]{64}$",
185
+ "maxLength": 64,
186
+ "description": "Previous refresh fingerprint. When it still matches, unchanged static instructions are omitted while task-specific ranking is recomputed."
181
187
  }
182
188
  },
183
189
  "required": [
@@ -490,7 +496,7 @@ Open the local pairing page and return the packaged unpacked-extension path for
490
496
 
491
497
  **List browser tabs**
492
498
 
493
- List tabs from the paired user's existing Chromium browser profile.
499
+ Read the tab inventory from the paired existing Chromium profile without creating, activating, or closing a tab. Use browser_manage_tabs for tab mutations.
494
500
 
495
501
  | Contract field | Value |
496
502
  |---|---|
@@ -529,7 +535,7 @@ List tabs from the paired user's existing Chromium browser profile.
529
535
 
530
536
  **Manage browser tabs**
531
537
 
532
- Create, activate, or close tabs in the paired existing browser profile.
538
+ Create, activate, or close tabs in the paired existing Chromium profile. Use browser_list_tabs when only a read-only tab inventory is needed.
533
539
 
534
540
  | Contract field | Value |
535
541
  |---|---|
@@ -585,7 +591,7 @@ Create, activate, or close tabs in the paired existing browser profile.
585
591
 
586
592
  **Read browser page source**
587
593
 
588
- Read bounded serialized current DOM HTML from the active or selected browser tab. max_bytes is one aggregate budget across at most 64 accessible frames, with explicit frame, node, and byte truncation metadata.
594
+ Read bounded raw serialized DOM HTML from the active or selected tab when source markup is required. Use browser_inspect_page for semantic elements, actionability, reusable refs, and structured interaction planning. max_bytes is one aggregate budget across at most 64 accessible frames.
589
595
 
590
596
  | Contract field | Value |
591
597
  |---|---|
@@ -634,7 +640,7 @@ Read bounded serialized current DOM HTML from the active or selected browser tab
634
640
 
635
641
  **Inspect browser page**
636
642
 
637
- Inspect a bounded snapshot-version-2 semantic representation across at most 64 accessible frames, with one aggregate element budget, bounded reusable refs, actionability state, bounded page-controlled metadata, and explicit scan/frame truncation.
643
+ Inspect a bounded semantic/actionability snapshot with reusable element refs for structured browser decisions and actions. This is not raw page source; use browser_get_source when serialized DOM HTML is required. The aggregate element budget spans at most 64 accessible frames.
638
644
 
639
645
  | Contract field | Value |
640
646
  |---|---|
@@ -1300,7 +1306,7 @@ Populate a browser file input from registered local resource files without retur
1300
1306
 
1301
1307
  **Load agent context**
1302
1308
 
1303
- Discover built-in defaults, bounded automatic project facts, Codex-compatible global/root-to-target instruction precedence, progressively disclosed local skills, explicit commands, and safe automatic package-script command aliases for a target path.
1309
+ Discover the instruction, skill, and registered-command inventory for a target path, including precedence and provenance. Use this when the caller needs the context itself; use resolve_task_capabilities when it needs task-specific ranking and execution-route advice.
1304
1310
 
1305
1311
  | Contract field | Value |
1306
1312
  |---|---|
@@ -1455,7 +1461,7 @@ List effective direct-argv commands from project manifests and safe automatic pa
1455
1461
 
1456
1462
  **Run registered local command**
1457
1463
 
1458
- Run an effective manifest or automatic package-script command through its fixed argv, cwd, timeout ceiling, and extra-argument policy. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.
1464
+ Prefer this when the repository already defines the desired operation as a registered command or package script. It runs the fixed argv/cwd/timeout contract without shell reinterpretation; use exec_command for ad hoc pipelines or run_process for an unregistered executable argv. Large output is retained for read_process.
1459
1465
 
1460
1466
  | Contract field | Value |
1461
1467
  |---|---|
@@ -1988,7 +1994,7 @@ Return bounded metadata and patch output for one revision without running reposi
1988
1994
 
1989
1995
  **Run process directly**
1990
1996
 
1991
- Execute an argv array without a command shell. This avoids shell parsing but does not sandbox the executable or code it launches. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.
1997
+ Run an explicit executable plus argv when no shell syntax is needed and no registered command fits. This avoids quoting, globbing, pipelines, and redirection, but it is not a sandbox; use exec_command when Bash composition is the convenient choice. Large output is retained for read_process.
1992
1998
 
1993
1999
  | Contract field | Value |
1994
2000
  |---|---|
@@ -2796,7 +2802,7 @@ Request cancellation of a detached managed job. The runner terminates the active
2796
2802
 
2797
2803
  **Execute shell command**
2798
2804
 
2799
- Execute a shell command with workspace cwd. This is not a sandbox and has the operating-system authority of the local user. Large stdout/stderr is previewed inline and retained temporarily for paged read_process continuation.
2805
+ Run Bash-compatible shell composition in the workspace: pipelines, redirection, globbing, conditionals, or compact multi-command probes. This is the convenient general escape hatch, not a sandbox, and has the local user's operating-system authority. Prefer run_local_command for an existing fixed project command and run_process when no shell syntax is needed. Large output is retained for read_process.
2800
2806
 
2801
2807
  | Contract field | Value |
2802
2808
  |---|---|
package/docs/UPGRADING.md CHANGED
@@ -67,6 +67,38 @@ Legacy version 2 lease state may be listed, revoked, or cleared for cleanup, but
67
67
 
68
68
  `ACCOUNT_ADMIN_SECRET` is deleted from local state and is no longer deployed to the Worker. Account and OAuth-client administration uses the same root-certified ephemeral session established for daemon startup or an independently authorized local administration command.
69
69
 
70
+ ## Version 3.0.0-beta.25 MCP 2026-07-28 transition
71
+
72
+ Beta.25 makes MCP `2026-07-28` primary while retaining MCP `2025-11-25` as a compatibility adapter.
73
+
74
+ Modern clients must:
75
+
76
+ - send `io.modelcontextprotocol/protocolVersion` and `io.modelcontextprotocol/clientCapabilities` in every request `_meta`;
77
+ - include both `application/json` and `text/event-stream` in HTTP `Accept` and the required `MCP-Protocol-Version`, `Mcp-Method`, and applicable `Mcp-Name`/`Mcp-Param-*` headers;
78
+ - use `server/discover` instead of `initialize`;
79
+ - treat each HTTP response stream as request-scoped and cancelled when closed;
80
+ - not use `Mcp-Session-Id`, recovery GET, SSE event IDs, or `Last-Event-ID`.
81
+
82
+ Legacy MCP `2025-11-25` clients may continue to initialize and use the signed-session resumable path. Reconnect modern clients by rediscovering and issuing fresh requests; reconnect legacy clients by reinitializing. Existing OAuth accounts, daemon identity, service state, managed jobs, resources, and browser pairing do not require migration solely because of the protocol change.
83
+
84
+ The tool catalog is now enforced as bounded JSON Schema 2020-12 at both Worker and local runtime boundaries. Clients that previously sent unknown fields, wrong scalar types, fractional integer values, or out-of-range values will receive `-32602` before side effects rather than handler-specific fallback behavior. Fix the request; do not retry unchanged.
85
+
86
+ ## Version 3.0.0-beta.24 candidate-activation convergence
87
+
88
+ Beta.23 is blocked and must not be accepted, published, or promoted. Owner-machine activation proved that a Worker could report the expected version and pass health verification while rejecting the candidate daemon before WebSocket admission because the active device-authentication material had not converged. The failed transaction then restarted an older service definition that could not authenticate to the already advanced Worker.
89
+
90
+ Beta.24 treats candidate device authentication and end-to-end readiness as required deployment evidence. One explicit authentication rejection triggers exactly one same-name redeployment with the unchanged selected identity; it does not rotate the device root, OAuth token version, account credentials, or Worker name. Candidate startup is bounded to three attempts. If remote preparation has occurred and activation still fails, local recovery installs and starts the compatible candidate service instead of restoring an incompatible old daemon. Before remote preparation, an older service is restored only when the same version and entrypoint reappear as a verified service daemon. Provider stop and start results must include verified inactive/active state; ambiguous systemd states and non-persistent Windows task completion fail closed. The original failure remains visible for diagnosis.
91
+
92
+ Beta.24 also introduces an owner-only machine-service ledger and an explicit readiness checkpoint. Service installation binds the canonical workspace, state root, exact runtime entrypoint, and version in a pending-to-committed transaction. Start/restart refuse missing, corrupt, pending, or mismatched ownership and do not accept a provider PID as proof of readiness; the exact service daemon must complete authentication, relay probing, and `ready_ack`. All machine-global service writers use one fixed per-user lock before any workspace startup lock, eliminating cross-workspace definition races and lock-order cycles. Existing beta.23 service definitions do not have this ledger; exact candidate activation installs and commits the beta.24 owner before the final handoff. Do not manually fabricate or copy `service-owner.json`.
93
+
94
+ No state-schema, OAuth-store, browser-pairing, resource, or managed-job migration is introduced. Upgrade through the exact candidate workflow. Do not delete state or rotate secrets in response to an isolated activation rejection.
95
+
96
+ ## Version 3.0.0-beta.23 foreground-contract change
97
+
98
+ Beta.23 requires coordinated Worker and daemon/CLI metadata convergence. The Worker-specific `tools/list` schema narrows configurable foreground timeouts to 85 seconds while preserving each tool’s 30- or 60-second default and rejects larger values before daemon dispatch. Local/stdio callers retain the 1–600 second schema. Work that can exceed the remote foreground boundary must use process sessions, managed jobs, or independently terminal mutation/validation calls.
99
+
100
+ `machine-mcp doctor` and `diagnose_runtime` also gain a macOS-only coarse default-route check. A `tunnel-or-vpn` result is evidence that an operating-system packet tunnel carries the route; it does not identify a failing node and is not authority to modify third-party VPN settings. Upgrade through the normal exact-version candidate flow and reload the packaged extension because its `version_name` is synchronized with the package.
101
+
70
102
  ## Version 3 beta.21 relay-continuity change
71
103
 
72
104
  Beta.21 changes the Worker-side stream-call record and MCP discovery contract. `tools/list` is stable for an authenticated account role; `server_info.authorization.effective_tools` remains the live execution authority. Streamed calls persist their daemon instance, WebSocket generation, request correlation, and deadlines so Durable Object hibernation or restart does not itself orphan an active call. JSON-only requests retain the prior bounded in-event path.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "machine-bridge-mcp",
3
- "version": "3.0.0-beta.21",
3
+ "version": "3.0.0-beta.26",
4
4
  "description": "Cross-client MCP bridge for local agent context, structured browser and application automation, files, Git, processes, resources, and durable jobs over stdio or OAuth relay.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -56,6 +56,7 @@
56
56
  "release:backfill": "node scripts/github-release.mjs --backfill",
57
57
  "stdio:integration-test": "node tests/stdio-integration-test.mjs",
58
58
  "catalog:test": "node tests/catalog-test.mjs",
59
+ "tool-arguments:test": "node tests/tool-argument-validation-test.mjs",
59
60
  "managed-jobs:test": "node tests/managed-jobs-test.mjs",
60
61
  "ssh-key:test": "node tests/ssh-key-test.mjs",
61
62
  "full-access:test": "node tests/full-access-test.mjs",
@@ -100,6 +101,7 @@
100
101
  "policy-docs:check": "node scripts/generate-policy-reference.mjs --check",
101
102
  "coverage:test": "node scripts/coverage-check.mjs",
102
103
  "capability-ranking:test": "node tests/capability-ranking-test.mjs",
104
+ "execution-routing:test": "node tests/execution-routing-test.mjs",
103
105
  "lifecycle:test": "node tests/lifecycle-test.mjs",
104
106
  "runtime-handlers:test": "node tests/runtime-handler-matrix-test.mjs",
105
107
  "cli-entrypoint:test": "node tests/cli-entrypoint-test.mjs",
@@ -164,19 +166,26 @@
164
166
  "candidate-runtime-store:test": "node tests/candidate-runtime-store-test.mjs",
165
167
  "service-restart:test": "node tests/service-restart-handoff-test.mjs",
166
168
  "browser-identity:test": "node tests/browser-extension-identity-test.mjs",
167
- "mcp-resumption:test": "node tests/mcp-resumption-test.mjs"
169
+ "mcp-resumption:test": "node tests/mcp-resumption-test.mjs",
170
+ "mcp-protocol:test": "node tests/mcp-protocol-test.mjs",
171
+ "mcp-modern-controller:test": "node tests/mcp-modern-controller-test.mjs",
172
+ "mcp:conformance": "node scripts/official-mcp-conformance.mjs",
173
+ "mcp:conformance:test": "node tests/official-mcp-conformance-test.mjs",
174
+ "sbom-check:test": "node tests/sbom-check-test.mjs",
175
+ "sbom:test": "node scripts/sbom-check.mjs",
176
+ "release-publication-guard:test": "node tests/release-publication-guard-test.mjs"
168
177
  },
169
178
  "dependencies": {
170
179
  "https-proxy-agent": "9.1.0",
171
180
  "proxy-from-env": "2.1.0",
172
- "wrangler": "4.114.0",
181
+ "wrangler": "4.115.0",
173
182
  "ws": "8.21.1"
174
183
  },
175
184
  "devDependencies": {
176
- "@types/node": "26.1.1",
177
- "eslint": "10.7.0",
185
+ "@types/node": "26.1.2",
186
+ "eslint": "10.8.0",
178
187
  "fast-check": "4.9.0",
179
- "globals": "17.7.0",
188
+ "globals": "17.8.0",
180
189
  "typescript": "7.0.2"
181
190
  },
182
191
  "keywords": [
@@ -13,6 +13,7 @@ export const FAST_CHECK_TASKS = Object.freeze([
13
13
  "runtime-activation:test",
14
14
  "candidate-runtime-store:test",
15
15
  "release-state:test",
16
+ "release-publication-guard:test",
16
17
  "release-ci:test",
17
18
  "network-retry:test",
18
19
  "check-runner:test",
@@ -26,6 +27,7 @@ export const FAST_CHECK_TASKS = Object.freeze([
26
27
  "dpop:test",
27
28
  "security-audit:test",
28
29
  "sarif-security:test",
30
+ "sbom-check:test",
29
31
  "shell:test",
30
32
  "architecture:test",
31
33
  "markdown:test",
@@ -51,13 +53,18 @@ export const FAST_CHECK_TASKS = Object.freeze([
51
53
  "logging-structure:test",
52
54
  "worker-runtime-infrastructure:test",
53
55
  "mcp-resumption:test",
56
+ "mcp-protocol:test",
57
+ "mcp-modern-controller:test",
58
+ "mcp:conformance:test",
54
59
  "lint:test",
55
60
  "lint",
56
61
  "typecheck",
57
62
  "syntax",
58
63
  "deadline:test",
59
64
  "catalog:test",
65
+ "tool-arguments:test",
60
66
  "capability-ranking:test",
67
+ "execution-routing:test",
61
68
  "agent-boundaries:test",
62
69
  "browser-identity:test",
63
70
  "browser-command:test",
@@ -92,6 +99,7 @@ export const FULL_ONLY_CHECK_TASKS = Object.freeze([
92
99
  "coverage:test",
93
100
  "browser-bridge:test",
94
101
  "package:test",
102
+ "sbom:test",
95
103
  "install:test",
96
104
  "stdio:integration-test",
97
105
  "worker:integration-test",