Skip to content

Core split milestone 11: the Herdr MCP read moves to the runtime, web install goes async, and remote-target programs get a registry - #137

Merged
arach merged 8 commits into
openscout-app:mainfrom
arach:milestone/11
Oct 23, 2026
Merged

arach merged 8 commits into
openscout-app:mainfrom
arach:milestone/11

Conversation

@arach

@arach arach commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR brings milestone 11 of the fork's core-split integration branch into main. It opens from milestone/11, a fixed branch at core-split 46430261ff89457c691bfa976daeb28ea9e8350c, so core-split can keep moving while this is reviewed. Hosted CI passed on that exact commit: https://github.com/arach/scout/actions/runs/39893792662 ("Typecheck and unit tests", "scoutd verification", and "Dormant extension channel" on macos-14 and ubuntu-24.04).

The MCP Herdr workspaces tool reads through the runtime. herdr_workspaces was the last production caller of the CLI's web-API bridge, which read the private web origin with a browser cookie or a bootstrap token. It now makes one GET to the local runtime's /v1/terminal-hosts/herdr/workspaces projection.

  • The read sends no web bearer, cookie or bootstrap token. It never starts the app, retries, or falls back to another source. A Unix socket selection has no HTTP fallback.
  • An eight-second deadline covers the request and the body. The response is bounded at 2 MiB, validated strictly by version, and correlated to the exact session. Redirects and ambient credentials are off.
  • "Not scanned" and "unavailable" stay distinct from an empty result. A partial empty observation stays incomplete, never absent.
  • The MCP result gains runtimeRead, the runtime's observation provenance, or readError, a safe HTTP status and code, never both. The tool's name, inputs and existing fields are unchanged. An older or refusing runtime reads as unavailable. There is no fallback to the web origin.
  • The bridge (packages/cli/src/cli/web-api.ts), its tests and its temporary private-inventory exception are removed. The inventory's negative list names the retired source. The interface is documented in docs/herdr-workspaces-mcp.md.

Web install leaves the synchronous Bun loop.

  • One deadline now covers the full-web download's request headers and its body-to-file pipeline. Before, only the request had a deadline, so a stream that stalled after its headers could hang. A test hook can only shorten the production deadline. The checksum over the stream and the cleanup of a partial install are unchanged.
  • Archive extraction moves from a synchronous tar call to an asynchronous one with the same bounds: a 30 s timeout, the same kill signal, and a 128 KiB output limit. Errors read as before. On Linux, garbage collection during a synchronous child process finalizes stdio against the wrong event loop, so the next stdout write fails (spawnSync: stop pointing the VM at the loop it waits on oven-sh/bun#44581).
  • A regression fixture runs the real install path in a child process, forces garbage collection at the spawn boundary, and proves that the next command's stdout still works. Other tests pin the extraction bounds, cancel a stalled body at the deadline with no partial files left, and keep the installed client and key when an upgrade stalls.
  • The fence inventory appends a named record, 175 -> 174. It retires web.ts / spawnSync and web.test.ts / spawnSync, and adds the fixture's Bun.spawnSync. The fixture is test-only; production installation does not use it.

Remote-target programs get a registry. The updater's encoded spawnSync runs a fixed program on a remote target, which the sync-exec allowlist cannot describe.

  • scripts/remote-target-programs.md names that program with a reason and an owner.
  • scripts/remote-target-programs.test.ts checks the registry against the source. An unregistered change to the program or its wrapper fails, and so does a missing, duplicated or renamed entry.
  • Root test:unit:source runs this check first, so the hosted unit job reaches it with no workflow change.

Each fork PR merged into core-split on its own, with a merge commit, after hosted CI passed on its reviewed head:

  • arach/scout#95: retire the MCP browser-cookie read bridge, and move web install off the synchronous loop.
  • arach/scout#111: register the updater's remote-target program beside the sync fence.

@arach
arach merged commit 038aaa0 into openscout-app:main Oct 23, 2026
arach added a commit that referenced this pull request Oct 25, 2026
♻️ Remove apps from public core and retain host pairing
@arach
arach deleted the milestone/11 branch November 20, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant