Skip to content

DDD: extract recovery and admission contexts from application-service lifecycle #8

Description

@seonghobae

Structural gap

Current foundation correctly separates Core sandbox_execution, Supporting artifact_analysis / application_service, and infrastructure adapters, but the accepted product Context Map also requires Workload Admission, Isolation Policy, Runtime Provisioning, Network/Egress, Evidence/Provenance, Session Lifecycle, and Recovery responsibilities to remain independently understandable and testable.

PR #6 currently keeps caller-scoped lease ownership, launch idempotency, expiration scheduling and cleanup retry state together in application_service::coordinator. That is an acceptable process-local bridge for issue #5, but it must not become the permanent home for durable admission capacity, crash recovery, orphan reconciliation, or network policy.

Boundary decision to prove before moving code

  • application_service owns translation of an approved application request into one service lease and consumer-facing lease semantics.
  • workload_admission owns authenticated admission intent, idempotency scope, capacity reservation and rejection receipts once admission becomes durable/distributed.
  • session_lifecycle owns active lease/session state transitions and cancellation semantics.
  • recovery owns expiration scheduling, failed-cleanup retry policy, restart/orphan reconciliation and cleanup evidence.
  • network_egress owns deny-by-default/controlled-egress policy rather than Podman-specific networking.
  • sandbox_execution owns backend-neutral isolation requirements and verified runtime state.

Do not mechanically split the current process-local coordinator before these contracts are executable; preserve a compatibility facade if public callers exist.

RED/GREEN acceptance

  1. architecture fitness first proves forbidden dependency directions and the intended context ownership;
  2. durable/restart work cannot be added under generic application_service coordinator internals;
  3. recovery policy prevents starvation, bounds retry/resource use, and has deterministic crash/orphan fixtures;
  4. admission and recovery do not import Podman/containerd/gVisor implementation DTOs;
  5. network/egress policy remains backend-neutral and default-deny;
  6. external consumers use versioned ports/contracts only;
  7. code moves update public exports/tests/docs in one bounded slice and preserve compatibility only where required;
  8. owned production statement/branch coverage and public rustdoc remain 100%.

This issue is structural follow-up after issue #5’s process-local correctness is proven. It is not permission for cosmetic folder churn.

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions