DEADBYTE MCP V0.15.5 / R46 CONTROLLER
====================================

ENTRY POINT
-----------
Primary operator entry point:

  npx -y deadbyte-mcp@0.15.5 remote

Bare `remote` is a foreground device session. It starts the verified runtime, arms process,
coding, and autonomous authority, verifies those three planes are ARMED, and requires Desktop and Host
to stay DISARMED. R40 Desktop observation/UIA grounding remains available read-only; GUI mutation needs
the separate explicit Desktop standing grant and Autonomous authority cannot substitute for it.
The production Bridge uses the compact capability profile (exact 43 tools / 6 gateways) while local
stdio MCP keeps the exact full 81-tool profile. The compact console shows request-before-result
Live Activity without raw SHA text, request IDs, payload JSON, or duplicate Bridge stdout by
default; use `remote --verbose` for the detailed audit/runtime stream. Ctrl+C/SIGTERM or foreground
input closure revokes Desktop/process/coding/autonomous authority, applies fail-safe Host disarm, and parks
the Bridge. A detached nonce-bound guardian performs the same fixed revoke+park cleanup if the
foreground owner is hard-killed. The v2 session marker records owner PID, guardian PID, and random
256-bit nonce so a guardian cannot remove a replacement session marker; a later start recovers only
a dead stale owner with no live guardian. `remote status` and other explicit subcommands remain
one-shot operations.

The package/controller CMD launchers remain compatibility-only and forward into the canonical
controller root. A copied/misbound controller fails closed before creating command runtime state.

CLOSING OR EXITING THE LEGACY MENU DOES NOT STOP A STARTED RUNTIME.
Only explicit park/stop/restart lifecycle commands mutate verified owned processes outside the
foreground `remote` session contract.

STATE
-----
OFFLINE  bridge absent, cloud absent
PARKED   bridge absent, cloud verified alive
ONLINE   bridge verified alive, cloud verified alive, local readiness passes
DEGRADED contradictory or unverified partial state

State is derived from process identity + readiness. PID alone is never authority.
OWNERSHIP
---------
runtime/*.instance.json binds each owned process to:

  schema + component
  256-bit instance nonce
  PID
  UTC creation time
  executable path
  executable SHA-256

Stale, reused, mismatched, corrupt, or unobservable identities are never adopted
or blindly killed.

MACHINE IDENTITY
----------------
MachineRuntimeEnabled defaults to True. One persistent Ed25519 identity lives below the canonical
DEADBYTE state root and survives release/generation activation. The controller forwards
DEADBYTE_MACHINE_RUNTIME only to the Bridge child. Public `machine_status`/`machine_list` expose
the identity public key and active release/generation binding; `machine_ping` returns a signed
nonce proof. `machinetest` verifies the public SPKI-derived machine_id and Ed25519 signature over
HTTPS without mutating authority. `machine_revoke` remains host-authority gated.

AGENT RUNTIME
-------------
AgentRuntimeEnabled is a trusted boolean configuration field. Default in the
example configuration is False. When True, the controller injects:

  DEADBYTE_AGENT_RUNTIME=1

only while spawning the Bridge child, then restores/removes the parent variable.
Status and menu show Agent runtime : ENABLED or DISABLED.

CODING PLANE
------------
CodingRuntimeEnabled is a separate trusted feature flag. CodingPolicyFile defines
allowed project roots, denied paths, executable hashes and command budgets.
Registration does not authorize mutation/execution.

  armcoding      enable a policy-hash-bound standing coding grant
  disarmcoding   revoke coding authority immediately
  codingstatus   report configured/standing-grant/disarmed state
  codingtest     run public edit + command + benchmark + durable task proof

The coding surface also exposes bounded multi-file reads plus TypeScript-backed symbol outline,
definition, references, and receipt-backed edit-by-symbol. Semantic edits still commit through the
same coding lease, exact file precondition, and signed surgical-edit receipt path.

Coding commands are explicit host-code authority and are not AppContainer sandboxed.
The standing grant remains active until explicit revoke; no timer maintenance is required.

AUTONOMOUS PRODUCTION PLANE
---------------------------
AutonomousRuntimeEnabled requires CodingRuntimeEnabled. AutonomousPolicyFile binds the
coding policy SHA-256, allowed roots, planner backend, iteration/mutation/resource
budgets, and trusted build/test/benchmark/release profiles. The R27 generation rebinds
policy digests and profile hashes to the explicit mutable development root; the release slot stays immutable.

  armautonomous      require coding authority, then enable a standing autonomous grant
  disarmautonomous   revoke autonomous authority immediately
  autonomousstatus   report configured/standing-grant/coding-disarmed state
  autonomoustest     run the R37 compact public capability-closure MRTR production gate

disarmcoding also revokes autonomous authority. No MCP tool creates or widens either
grant. Provider-backed planners (openai_compatible, openai_responses, or hash-pinned codex_app_server) use the background supervisor; client_sampling uses the connected MCP client's model with durable resume state.

R27 IMMUTABLE SLOT UPDATE
-------------------------
Use npm run self-update:runtime with exact --stage, --development-root, --expected-version, and
--expected-manifest bindings. The updater is operator-only machinery, never an MCP capability.
Release bytes are copied once into a content-addressed immutable slot; mutable workspace/runtime
state and coding/host development authority live outside that slot. Coding/autonomous grants are
revoked before verified stop and restored only with --restore-standing-grants. Activation is one
atomic active-release.json replacement after the release, generation and launcher are verified.
Rollback restores the prior pointer, launchers and workspace placement before restarting known-good.

R28 PERSISTENT TRANSPORT
------------------------
The production Cloud component is the release-owned `deadbyte-tunnel-host.exe`, not a Quick Tunnel
wrapper. The generation pins the exact cloudflared executable and external tunnel-token file by
SHA-256 and pins one stable full MCP URL file. Controller start/status re-hash those dependencies
and reject `*.trycloudflare.com` for the v2 transport. The native host launches cloudflared directly
with `--token-file`, fixes the local origin at 127.0.0.1:8787, and owns descendants in a kill-on-close
Windows Job. Transport updates do not arm host authority or widen coding/autonomous grants.

HOST PLANE
----------
HostPolicyFile optionally configures registration of host_file_read,
host_file_write, and host_exec. Registration is not authorization.

  armhost      enable a policy-hash-bound standing host grant
  disarmhost   revoke host authority immediately
  hoststatus   report configured/standing-grant/disarmed state
  hosttest     require active host authority and run the public host smoke

The normal final state is DISARMED. host_exec accepts no raw shell command; local
policy pins executable path/hash, root, script extension, timeout, and output budget.

TEST VS FULLTEST
----------------
test uses the public modern MCP endpoint for proof + independent receipt verify.
machinetest performs a non-mutating public machine status/list/ping gate and verifies
SHA-256(SPKI) plus the Ed25519 ping signature. fulltest additionally runs public
contained execution, and when agent mode is present it submits/runs/verifies a two-step
durable agent task. It then runs the local canonical three-operation AppContainer/replay/evidence gate.

The Windows native binaries must first pass npm run gate:windows.
