# 180.C.26.01 — Native macOS menu-bar Remote Host shell: live hardware run

- **Date:** 2026-07-07 (run window 18:36–18:53 UTC)
- **Rig:** `MAC-HOST-03` — physical MacBook Air, Apple Silicon (arm64), macOS
  26.5.2 (build 25F84), Xcode 26.5 / Swift 6.3.2, Node v24.13.1
- **Operator:** `operator:macos-install-qa:elikem-macbook-air-2026-07-07`
- **Checklist item:** `180.C.26.01` — Build the macOS Remote Host app shell with
  menu bar status, local pause/stop/unpair controls, diagnostics, and
  session-active indicator.

## What ran

1. `apps/bellona/remote-host/macos/scripts/bundle-app.sh` built the SwiftPM
   AppKit shell (`swift build -c release`) and assembled
   `Bellona Remote Host.app` (`Info.plist` `LSUIElement=true`, bundle id
   `com.oshun.bellona.remote-host`); `plutil -lint` passed.
2. `scripts/macos-menu-bar-shell-evidence.ts` booted the REAL
   `@bellona/remote-gateway` and REAL `@bellona/remote-host` in one process on
   this Mac with a gateway-issued development identity. Gateway log:
   `host.handshake.accepted` for `device:studio-macbook-air`
   (`host-connection:000001`, 2026-07-07T18:38:00.771Z).
3. The native shell launched in attach mode (`BELLONA_SHELL_HOST_PORT=59852`),
   rendered the NSStatusItem menu from `GET /v1/local-control/menu-bar-model`,
   and logged `running as login-session app`.

## Structured stage evidence record

```json
{
  "menuBarShellRunOnMac": {
    "passed": true,
    "capturedAt": "2026-07-07T18:52:18.000Z",
    "macOSRunnerId": "MAC-HOST-03",
    "operatorId": "operator:macos-install-qa:elikem-macbook-air-2026-07-07",
    "evidenceArtifactIds": [
      "artifact:180.C.26.01:menu-bar-shell-run:2026-07-07-mac-host-03-live-model-ready",
      "artifact:180.C.26.01:menu-bar-shell-run:2026-07-07-mac-host-03-pause-resume-roundtrip",
      "artifact:180.C.26.01:menu-bar-shell-run:2026-07-07-mac-host-03-local-diagnostics",
      "artifact:180.C.26.01:menu-bar-shell-run:2026-07-07-mac-host-03-unpair-identity-removed",
      "artifact:180.C.26.01:menu-bar-shell-run:2026-07-07-mac-host-03-sigterm-clean-exit"
    ]
  }
}
```

## Observed behavior (live transcripts)

**Live menu-bar model from the real host** (paired + connected through the real
gateway; attention reasons are the REAL TCC and adapter state of this Mac —
Screen Recording/Accessibility not granted to the host, Blender addon not
connected):

```json
{
  "appName": "Bellona Remote Host",
  "statusItemLabel": "Bellona Remote Host: needs attention",
  "tone": "attention",
  "sessionIndicator": { "visible": false, "label": "No active session" },
  "gatewayLabel": "127.0.0.1:59849",
  "attentionReasons": ["permissions-missing", "adapter-health:1"],
  "controls": [
    { "id": "open-control-room", "enabled": true },
    { "id": "pause-session", "enabled": false },
    { "id": "unpair", "enabled": true }
  ]
}
```

**Pause → resume round trip** (2026-07-07T18:40:06.897Z):
`POST /v1/local-control/pause` flipped the derived model to
`paused | Bellona Remote Host: session paused | resume enabled: True`;
`POST /v1/local-control/resume` restored it. While paused, the pause-gated
executor refuses new gateway dispatches fail-loud with the resume remediation
(`RemoteHostPausedError`, unit-covered in `src/local-control.test.ts`).

**Diagnostics** (2026-07-07T18:40:07.750Z): `POST /v1/local-control/diagnostics`
wrote a redacted host snapshot
(`local-diagnostics-2026-07-07T18-40-07.750Z.json`) containing adapter health,
gateway state, mac permission checks, running jobs, and the derived menu-bar
model.

**Stop session:** `POST /v1/local-control/stop-session` executed
`cancelAllCommands('menu-bar-stop-session')` (0 active commands at the time).

**Unpair:** `POST /v1/local-control/unpair` stopped the gateway connection and
REMOVED the development identity file
(`{"removed":true,"storage":"development-file"}`); the model flipped to
`Bellona Remote Host: not paired` with
`["host-not-paired","gateway-offline","permissions-missing","adapter-health:1"]`.
The macOS Keychain removal path (`security delete-generic-password`) is
implemented in `MacOSKeychainRemoteHostIdentityStore.removeIdentity` and
exercised in the launchd run, where the host on darwin defaulted to the Keychain
store and failed loud on the missing item.

**Graceful SIGTERM** (18:52:18Z): the shell logged
`received SIGTERM; stopping remote host child gracefully` then
`terminated cleanly`, and the process exited.

## Authentication posture verified live

- Requests without the local-control token → `401 local_control_token_invalid`.
- Token file minted `0600` next to the host identity file
  (`-rw------- … local-control.token`).
- Non-loopback callers are refused (`403 loopback_required`, unit-covered).

## Notes and residual scope

- UI screenshot evidence was not captured in this run: macOS Screen
  Recording/Accessibility permission for the automation helper was not granted
  during the background session. The shell's rendered content is derived
  byte-for-byte from `deriveMacOSMenuBarModel` (asserted over HTTP in
  `src/local-control.test.ts`), and the app process was verified running in the
  login session (`ps` output) with its stdout action log captured.
- Signing/notarization of the bundle remains `180.C.26.06` (blocked: no
  Developer ID identity on this rig — `security find-identity -v -p codesigning`
  reports 0 identities).
