Skip to content

refactor(runtime-host): specialize storage-root composition to interactive roots #3037

Closed

Description

@Astro-Han

Problem

Runtime Host composition is generic over StorageRootKind, but StorageRootKind currently has exactly one member: interactive.

The generic parameter propagates through:

  • RuntimeHostCompositionContext
  • RuntimeHostCompositionFactory
  • RuntimeHostCompositionSource
  • RuntimeHostKernelOptions
  • RuntimeHostKernel.start()

Because the kernel stores a non-generic internal option type, it also needs eraseRootKind() to bridge the generic facade back to the same single concrete kind.

There is no second Runtime Host producer or consumer that benefits from this abstraction.

Proposed change

  • Specialize Runtime Host composition and kernel types to StateRootOwner<'interactive'>.
  • Remove the Runtime Host storage-root kind generic parameters.
  • Remove eraseRootKind() and the associated type adaptation.
  • Preserve the existing storage-root authentication, ownership, locking, and lifecycle behavior.

Acceptance criteria

  • Runtime Host composition types are no longer generic over StorageRootKind.
  • RuntimeHostKernel.start() accepts the concrete interactive root owner.
  • eraseRootKind() is removed.
  • Existing Runtime Host compositions compile without type assertions or replacement adapters.
  • Storage-root identity, authentication, and lease behavior remain unchanged.
  • Focused Runtime Host tests, type checking, and formatting pass.

Non-goals

  • Adding a new storage-root kind.
  • Changing storage marker or ownership formats.
  • Changing root locking or process-residency behavior.
  • Removing retainUntilProcessExit().
  • Generalizing Runtime Host for hypothetical execution authorities.

Context

Verified on main at 1a71db5c0fa85771330354360388ecf47ba95c2e.

Relevant code:

  • packages/storage/src/root-authority.ts
  • packages/runtime-host/src/server/host-composition.ts
  • packages/runtime-host/src/server/host-kernel.ts

This issue was identified and prepared with AI assistance (Codex). A human contributor reviewed the analysis and owns the submission.

Activity

  1. added
    enhancement
    help wanted
    on Aug 15, 2026
  2. Sun-GLiang commented on Aug 15, 2026

    @Sun-GLiang
    Member

    Hi, I’d like to work on this issue.
    My plan:

    • Create a new branch: refactor/runtime-host-interactive-roots.
    • Specialize Runtime Host composition and kernel APIs to InteractiveRootOwner.
    • Remove the unused StorageRootKind generics and eraseRootKind().
    • Update existing Runtime Host composition call sites without adding casts or adapters.
    • Add compile-time regression coverage and run Runtime Host tests, type checking, linting, and formatting.

    Storage-root authentication, ownership, locking, lease, and lifecycle behavior will remain unchanged.

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

Metadata

Metadata

Assignees

Labels

enhancementhelp wanted

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions