Skip to content

Add an adopt-only lifecycle for zero-interruption migrations #98

Description

@schickling-assistant

A live migration can publish a declaration for an already-running task and rely
on identity-based adoption. Today that declaration becomes an ordinary restart
contract: if the task exits, reconciliation reaps the old PTY record and
launches the declared command; if the task disappears between the migration
preflight and the first pass, it launches immediately. There is no fail-closed
way to say "adopt this generation if present, but never create or replace it
without a separate authorization."

Required contract

Add an explicit task lifecycle policy (name bikesheddable; this issue uses
adopt-only):

  • Alive: adopt without replacement.
  • Dead: retain/freeze; do not reap or launch.
  • Absent: do not launch.
  • Explicit replacement: a separately authorized operation or declaration
    transition restores ordinary launch/restart behavior.
  • Before any authorized reap/restart, persist an immutable generation receipt
    containing enough bounded process and PTY metadata to diagnose the prior
    generation.

The policy must be part of the effective launch contract and machine-readable
inspection output. It must not be inferred from comments, arbitrary metadata,
or backend keep tags.

Acceptance

  • A live task is adopted; after it exits, no cold launch occurs.
  • An absent adopt-only task never launches.
  • Transitioning to ordinary service lifecycle permits an explicit replacement.
  • Reap/restart preserves a generation receipt before removing the old backend
    record.
  • Red-before/green-after integration coverage uses an isolated synthetic PTY
    root.

Relationship to existing issues

The ordinary service behavior remains correct for normal declarations. This is
a distinct migration lifecycle, not a change to default restart semantics.

Posted on behalf of @schickling
field value
agent_name co2-bear
agent_session_id a078daee-6f98-4916-91a8-d21291407789
agent_tool Codex CLI
agent_tool_version 0.145.0
agent_runtime Codex CLI 0.145.0
agent_model unknown
runtime_profile /nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json
skills_manifest /nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json
worktree st2-adopt-only-migration/schickling/adopt-only-migration
machine dev3
tooling_profile dotfiles@0fb7e03

Activity

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

    area:agent-specAgent Spec format, parsing, and the agent-spec crate · Set: manualarea:reconcileSupervisor run loop, lifecycle, restart, park, and teardown · Set: manualorigin:agentFiled or primarily produced by an AI agent · Set: manualtype:featureNew user-visible or system capability · Set: manual

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions