schema_version: runtime-api-resurrection-safety-decision-v1
chunk: "000297"
generated_at: "2026-05-21T22:44:49Z"
source: "runtime-api-killed-process-resurrection-proof-if-safe"
mode: "safety_decision"

decision:
  safe_to_kill_runtime_api: false
  result: "not_attempted"
  reason: >-
    The live Runtime API daemon is supervised and restartable through the typed
    `runtime_api_restart` action, but the current supervisor loop only executes
    queued requests. It does not autonomously watch `.tmp/runtime-api/pid`,
    observe unsolicited daemon death, decide resurrection policy, enqueue
    recovery, or record an unplanned Runtime API failure/recovery state without
    an operator/requested restart path.
  stop_condition_hit: >-
    Recovery policy lacks the watchdog/circuit-breaker/backoff semantics
    required for a safe Runtime API killed-process proof.

current_runtime_api:
  pid_file: ".tmp/runtime-api/pid"
  pid: 70642
  command: "node dist/daemon/runtime-daemon.js"
  status: "running"
  ownership_evidence: >-
    `.tmp/runtime-api/pid` points to a live process whose command line is
    `node dist/daemon/runtime-daemon.js`. `.tmp/runtime-api/manual-daemon.pid`
    points to a stale zombie shell process and is not suitable as authority.
  input_capture: "ai/reports/report-000297-runtime-api-resurrection-inputs.txt"

supervisor_policy:
  status: "running"
  available_actions:
    - runtime_api_restart
    - runtime_api_build_reload
  planned_restart_path_exists: true
  unsolicited_failure_watchdog_exists: false
  autonomous_recovery_enqueue_exists: false
  unplanned_runtime_api_policy_exists: false
  service_fail_log_for_runtime_api_exists: false
  notes:
    - >-
      `runRuntimeSupervisorOnce()` scans queued request files and executes a
      claimed request; it does not scan Runtime API liveness and create a
      recovery request itself.
    - >-
      `restartRuntimeApi()` records planned reload/restart events and verifies
      socket, freshness, health snapshot, and pid stability after a requested
      restart.

evidence:
  inspected_files:
    - "ai/runtime/src/modules/supervisor/runtime-supervisor.ts"
    - "ai/runtime/src/modules/testing/service-resurrection-smoke.ts"
    - "ai/governance/registries/carry-forward-debt.yaml"
  runtime_commands:
    - "node ai/runtime/dist/cli.js supervisor status --json"
    - "node ai/runtime/dist/cli.js supervisor actions --json"
    - "node ai/runtime/dist/cli.js runtime-services --json"
  prior_proof_baseline:
    - "chunk-000242 proved planned Runtime API restart/browser recovery."
    - "chunk-000261 proved safe local/dev frontend killed-process resurrection."
    - "chunk-000271 proved frontend/backend local-dev resurrection policy/smoke."

cfd_0024_narrowing:
  status: "open"
  remaining_scope: >-
    Implement Runtime API watchdog ownership before killing the daemon: observe
    unsolicited Runtime API death from supervisor-owned liveness checks, record
    policy decision and suppression/cooldown state, enqueue typed recovery,
    record recovery_started/recovered/recovery_failed evidence, and then prove
    browser-visible recovery from Runtime/GraphQL truth.
  not_required_for_this_chunk:
    - "No arbitrary process kill."
    - "No manual shell recovery truth."
    - "No simulated/faked resurrection proof."

next_action:
  recommendation: "carry_forward"
  implementation_needed:
    - "Runtime API watchdog loop or supervisor liveness monitor."
    - "Policy with planned/manual suppression, cooldown, max attempts, and circuit breaker."
    - "Runtime API service fail log events for observed_failure, recovery_started, recovery_completed, recovery_failed, manual_action_required."
    - "Browser proof after watchdog implementation."
