Skip to content

Tracking: harden Maestro remote servers for hosted runtimes #76

Not planned

Description

@haasonsaas

Current Status

  • 2026-04-23: #79 is now complete via merged PR #133 (0f9609e2f4e78966dcca8c3ebaff5bd06c6f89b0). Hosted session scope and headless runtime scope now bind to verified JWT/shared-token/API-key principals, reuse scope across JWT rotation for the same user/workspace, preserve explicit local anon mode, and keep full long principal identifiers in the hash input so the hashed scope-key path does not collide across tenants.
  • 2026-04-23: #81 is complete and should be read as landed public behavior, not open implementation work. Public main has the hosted runner entrypoint/config surface, required workspace-root and runner-session validation, hosted readyz/draining behavior, and the single-session/runtime boundary.
  • 2026-04-23: #83 is closed after re-validating current public main; Maestro-core drain/export/restore is already present, including persisted snapshot-manifest.v1, workspace export-path recording, Rust restore-manifest loading, restored_from_snapshot replay, and not-ready partial-restore behavior.
  • 2026-04-23: #84 is complete as a runtime decision/parity-contract issue: Rust is the target runtime kernel, TypeScript remains the compatibility bridge, and the public conformance/runtime surface reflects that split.
  • 2026-04-23: #85 is complete as a conformance issue: public CI already runs rust-hosted-conformance, and local validation on current public main is green for both hosted-runner Rust tests and the hosted headless conformance suite.
  • 2026-04-23: #77 is now complete via merged PR #135 (d3f9bbe6f7a8d57f85e73b172fb06768aa1aa6e2). Hosted/headless sessions now carry an explicit workspaceRoot, agent/runtime context uses that effective root instead of the web-server process cwd, and utility command/read/search/watch calls are enforced against the assigned workspace boundary.
  • Remaining work in this umbrella is the actual remote-server hardening still tracked below: fleet-safe routing/ownership across replicas (#78) and deploy/runtime-image production hardening (#80). Cross-repo orchestration for drain/restore now lives in evalops/platform#838 and evalops/deploy#1126.

Agent handoff: read this first

This is the top-level tracker for making Maestro remote/headless servers safe to run as hosted infrastructure, not just as a local web process.

Use this order:

  1. Bind headless remote sessions to explicit workspace sandboxes #77 — Bind every remote/headless runtime to an explicit workspace sandbox. Without this, utility commands/file search/file reads/file watches and MCP/LSP/git/team-memory context are grounded in the server process cwd or caller-provided cwd.
  2. Make headless runtime fleet-safe across Maestro web replicas #78 — Make the headless runtime fleet-safe across web replicas. Without this, the Helm chart's replicaCount: 2 fights the process-local HeadlessRuntimeService map and SSE/POST session affinity.
  3. Bring Maestro Helm and runtime image up to hosted remote-server requirements #80 — Bring Helm/runtime-image/web-server production settings up to hosted remote requirements.

Keep this linked with the Platform integration spine:

Current source read

Reviewed heads on 2026-04-22:

  • evalops/maestro@ae6e88a22d3a36d34d07c5c507375cfd7fdcd372
  • evalops/platform@7b003938349939052f90ae41241599993a7c06c9

Relevant Maestro source:

  • src/web-server.ts creates the app-wide web/headless runtime services and builds agents from process.cwd().
  • src/server/headless-runtime-service.ts owns the process-local runtime map, replay buffer, subscribers, heartbeats, controller leases, and utility operations.
  • src/server/handlers/headless-sessions.ts exposes /api/headless/* create/subscribe/events/messages/heartbeat/disconnect endpoints.
  • packages/tui-rs/src/headless/remote_transport.rs is the Rust HTTP/SSE client for remote headless sessions.
  • deploy/helm/maestro/* currently deploys two replicas with only basic probes/env.

Why this is separate from the Platform runtime issues

#72 and evalops/platform#780 are about adopting Platform's durable AgentRun ledger and driving Maestro headless from Platform. This tracker is about Maestro's own remote-server boundary: workspace isolation, multi-replica behavior, identity scoping, and production deploy shape. Both tracks are needed; neither replaces the other.

Acceptance Criteria

  • Each sub-issue above is cross-linked from this tracker.
  • A hosted Maestro remote server has a defined workspace/sandbox root per session and cannot operate on arbitrary server filesystem paths.
  • Running more than one web replica is either explicitly disabled or backed by sticky routing plus durable runtime-owner/session routing semantics.
  • Session scope and authorization use verified principals and workspace/team claims.
  • The Helm chart documents and enforces the minimum production contract for API auth, Redis/Postgres/session storage, probes, graceful draining, and SSE/headless routing.

Remote Runner Follow-Up Issues Added 2026-04-22

These issues connect this Maestro hardening tracker to the account-scoped remote runner build in evalops/platform#781:

Tech split correction for agents picking this up: Maestro is already Rust-first for the native TUI/agent path, including tool execution and remote attach transport. The current hosted web/headless Docker path still runs Node/TypeScript, so v1 may bridge through that surface, but the runner contract should not assume Node is the target. Prefer a Rust-native hosted runner once it can expose the same headless HTTP/SSE/session contract. Keep Platform remote-runner control plane/gateway/provisioner in Go.

Related: #84 — Rust core runtime parity contract


Runtime Parity / Conformance Links

Use #85 as the protocol-level acceptance bar: lifecycle, subscribe/events/messages/heartbeat/disconnect, viewer/controller roles, permission request/response, utility operations, workspace-root enforcement, cursor replay/reset, and drain/resume behavior should match across the current TypeScript web/headless bridge and the target Rust runtime.

Activity

  1. haasonsaas commented on Apr 22, 2026

    @haasonsaas
    ContributorAuthor

    Cross-linking the remote-server hardening issue graph:

    Related integration spine:

  2. haasonsaas commented on Apr 22, 2026

    @haasonsaas
    ContributorAuthor

    Adding the product/control-plane follow-up from the remote runner discussion:

    • evalops/platform#781 proposes the account-scoped remote runner control plane where users can start/attach/stop timed Maestro sessions against their EvalOps account.

    Relationship: this tracker (#76) hardens Maestro as the hosted remote runtime. evalops/platform#781 is the Platform product/control plane that provisions, meters, routes, and tears down those runtimes.

  3. haasonsaas commented on Apr 22, 2026

    @haasonsaas
    ContributorAuthor

    Correction for future agents: Rust is already the primary native Maestro agent/TUI path; Node is still the current web/headless server image. Please do not implement this tracker as “keep runtime Node, keep Rust client-only.” The better target is a hosted-runner contract that can be served by the current Node bridge first and by a Rust-native runner as it matures.

  4. haasonsaas commented on Apr 22, 2026

    @haasonsaas
    ContributorAuthor

    Cross-linking #84: the remote hardening tracker should steer toward a Rust core runtime with rough parity against the current TypeScript web/headless surface. The downloaded source snapshot reinforced that the durable remote/session layer and the runtime kernel need a clear protocol contract between them.

  5. haasonsaas commented on Apr 22, 2026

    @haasonsaas
    ContributorAuthor

    Reference repos worth internalizing before Phase 1 — three OSS systems have already converged on the abstract shape we're building. In priority order for engineer-hours:

    1. OpenHands V1 (All-Hands-AI/OpenHands:openhands/app_server/ + OpenHands/software-agent-sdk:openhands-agent-server/). SOTA hosted coding agent on K8s with separate control plane. V0 sunsets 2026-04-01 so this is the actively-maintained path. The SandboxService / AppConversationService / EventService / PendingMessageService split is the design we're writing.

    2. openai/codex — codex-rs/app-server/ + app-server-protocol/. ~3k SLOC of protocol discipline; Rust but lifts to any language. Priority files: thread_state.rs, transport/remote_control/protocol.rs, transport/auth.rs, transport/mod.rs.

    3. e2b-dev/infra — packages/client-proxy/. Our attach gateway is conceptually their proxy: session-ID routing, Redis catalog, lookup-or-resume, GCP-LB-aware timeouts. ~2k SLOC of Go.

    One hour reading each, in that order, will change acceptance criteria on ~6 of the open issues in this tracker. The design we're writing is ~90% isomorphic to what they landed on; divergences should be chosen deliberately, not accidentally.

  6. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    Cross-link: #83 is now closed after validating current public main. The Maestro-core drain/export/restore contract is already present in the public tree; the remaining follow-through from that thread is cross-repo orchestration in evalops/platform#838 and evalops/deploy#1126, plus the broader remote-server hardening items still tracked here.

  7. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    Tracker update: #81, #83, #84, and #85 are now closed after re-validating the current public tree.

    The top-of-body status has been updated so the next pass starts from the real remaining surface: workspace sandboxing (#77), fleet-safe routing/ownership (#78), verified hosted identity/session scope (#79), and deploy/runtime-image hardening (#80).

  8. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #79 is in flight via PR #133 now. This is the verified-principal slice: hosted/session scope and headless runtime scope stop keying off bearer-token hashes for JWT users, JWT rotation within the same user/workspace keeps the same hosted-session scope, local unauthenticated mode stays explicit anon, and /debug/z is no longer outside the auth boundary when auth is configured.

  9. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #79 is landed and closed now via #133 (0f9609e2f4e78966dcca8c3ebaff5bd06c6f89b0). That slice now uses verified request principals for hosted session and headless runtime scope, keeps JWT rotation stable within the same workspace, fixes the long-identifier hash-collision edge called out in review, and moves /debug/z behind the authenticated boundary when auth is configured.

  10. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    Update on the hosted-runtime tracker: #77 is now in review via #135 (jh/workspace-sandbox-root-20260423).

    That PR adds explicit session workspace roots, hosted-runner root pinning, runtime/agent cwd threading, and utility command/read/search/watch enforcement against the assigned root.

  11. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #77 is merged and closed via #135 (d3f9bbe6f7a8d57f85e73b172fb06768aa1aa6e2). The tracker now narrows to the remaining hosted-runtime gaps: #78 for fleet-safe runtime ownership/routing and #80 for deploy/runtime-image hardening.

  12. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    Update on the hosted-runtime tracker: #78 now has a reviewable slice in #136 (jh/runtime-owner-routing-20260423).

    That PR adds the structured runtime_owned_elsewhere HTTP contract for hosted runner owner mismatches, including TS ErrorInfo metadata and Rust remote transport classification, so future gateway routing and client recovery can key off a stable code rather than error text.

  13. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #78 update: #136 merged as 0cc289e7ba27becccbf66b5d1937e03d52291e26.

    The hosted runtime now has a stable runtime_owned_elsewhere error contract across TS web-hosted responses, Rust remote transport classification, and the protocol docs. I am moving on to the next #78 gap: deployment/runtime guardrails for multi-replica remote mode.

  14. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #78 update: the deployment guardrail slice is now in review via #137 (jh/remote-replica-guard-20260423).

    It defaults the Maestro Helm chart to one replica for process-local headless runtime routing and rejects multi-replica renders unless sticky-session or durable-owner routing is explicitly declared.

  15. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #78 update: #137 merged as dcd2f0d8fbaeccbb81823cc831e0aa35a459befc.

    The Helm chart now fails closed for unsafe multi-replica process-local headless routing: default replicas are 1, and replicaCount > 1 requires sticky-session or durable-owner routing mode. Remaining tracker work is the actual durable owner/session routing plus shutdown drain/transfer path.

  16. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    Update on hosted-runtime hardening: #80 is now in review via #138 (jh/helm-runtime-shape-20260423).

    That PR gives the Maestro Helm chart production-shaped defaults and blocks unsafe multi-replica hosted runtime deployments unless routing is explicitly configured.

  17. haasonsaas commented on Apr 23, 2026

    @haasonsaas
    ContributorAuthor

    #80 is now complete via merged PR #138 (fa65eda33ea058b08328a33778ea0767db1b447f).

    That closes the Helm/runtime deployment-shape slice: restricted pod defaults, service account controls, writable /tmp, startup/graceful shutdown behavior, PDB/HPA templates, and a Helm guard against unsafe multi-replica hosted-runtime deployments without configured routing.

  18. haasonsaas commented on Apr 24, 2026

    @haasonsaas
    ContributorAuthor

    Update on hosted-runtime hardening: Maestro #158 is now open for #78.

    It adds the structured runtime_not_ready drain contract for hosted headless session traffic and aligns the Rust remote client classifier so draining/not-ready responses become retryable RuntimeNotReady instead of generic remote errors.

  19. haasonsaas commented on Apr 24, 2026

    @haasonsaas
    ContributorAuthor

    Update on #78: PR #163 is now in review.

    This moves the shutdown/drain piece forward by making hosted-runner drains happen during Kubernetes preStop and process SIGINT/SIGTERM, writing the existing manifest envelope before the pod closes connections.

  20. haasonsaas commented on Apr 24, 2026

    @haasonsaas
    ContributorAuthor

    Related hosted-runtime hardening update: #72 advanced via merged public #168 and internal evalops/maestro-internal#1481. Hosted headless session starts now create a Platform AgentRun trigger when configured, giving the hosted runtime path its first durable ledger correlation point without changing local/offline behavior.

  21. haasonsaas commented on Apr 24, 2026

    @haasonsaas
    ContributorAuthor

    Maestro #78 advanced via #169 (jh/runtime-drain-signal-20260424).

    The PR exposes hosted-runner drain status and manifest metadata through readiness/identity, which is a small step toward deterministic shutdown drain/transfer behavior for hosted runtimes.

  22. haasonsaas commented on Jun 20, 2026

    @haasonsaas
    ContributorAuthor

    Status refresh — verified on main (June 2026). 7 of 8 sub-issues are closed.

    Closed: #77 (workspace sandbox), #79 (verified principals), #80 (Helm/runtime image), #81 (hosted runner entrypoint), #83 (snapshot/drain/resume), #84 (Rust parity contract), #85 (conformance suite). #89 (responsiveness mocks) also closed.

    Sole remaining child: #78 — fleet-safe routing. Verified landed on main: workspace boundary enforced, verified-principal scoping in, Helm defaults to replicaCount: 1 with a render-time guardrail (templates/_helpers.tpl:86) requiring sticky-session/durable-owner for multi-replica, and a preStop drain hook. What is not done: the durable owner/session routing implementation and shutdown session transfer — details in #78.

    Leaving this tracker open for #78.

  23. haasonsaas commented on Jul 19, 2026

    @haasonsaas
    ContributorAuthor

    Stale triage (2026-07-19): tracker mostly complete — #79/#81/#82/#83/#84/#85 closed. Remaining hosted multi-replica work lives in #78. Keep as parent tracker until #78 resolves or split is explicit.

  24. haasonsaas commented on Nov 26, 2026

    @haasonsaas
    ContributorAuthor

    Retiring the umbrella tracker. The explicit handoff to #78 covers durable owner and session routing across replicas and transfer or reclaim of active sessions across pod shutdown. The status update records the shipped safeguards and completed child issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions