Skip to content

Latest commit

 

History

History
58 lines (49 loc) · 75.8 KB

python-engine-architecture.md

File metadata and controls

58 lines (49 loc) · 75.8 KB

Python Engine Architecture

This inventory is the ownership map for the Python engine refactor. Keep it aligned with the code as modules move; do not use it to document planned behavior that is not wired yet.

Ownership Map

Workflow Primary owner Supporting modules Compatibility boundary
CLI command routing and runtime facade python/envctl_engine/runtime/command_router.py, python/envctl_engine/runtime/engine_runtime_dispatch.py, and python/envctl_engine/runtime/engine_runtime.py runtime/engine_runtime_*_support.py, runtime/engine_runtime_action_facade.py, runtime/engine_runtime_action_support.py, runtime/engine_runtime_bookkeeping_support.py, runtime/engine_runtime_cli_facade.py, runtime/engine_runtime_cli_support.py, runtime/engine_runtime_construction.py, runtime/engine_runtime_debug_facade.py, runtime/engine_runtime_debug_support.py, runtime/engine_runtime_dependency_env.py, runtime/engine_runtime_doctor_facade.py, runtime/engine_runtime_doctor_support.py, runtime/engine_runtime_lifecycle_facade.py, runtime/engine_runtime_planning_facade.py, runtime/engine_runtime_service_facade.py, runtime/engine_runtime_startup_facade.py, runtime/engine_runtime_truth_facade.py, runtime/utility_command_support.py, runtime/command_catalog.py, runtime/command_alias_catalog.py, runtime/command_flag_catalog.py, runtime/command_catalog_registry.py, runtime/command_policy.py, runtime/command_resolution.py, runtime/service_command_autodetect.py, runtime/command_models.py, runtime/command_flag_storage.py, runtime/command_special_flags.py, runtime/startup_inspection_support.py, runtime/browser_diagnostics.py, runtime/browser_env_preview.py, runtime/browser_cors_diagnostics.py, runtime/browser_runtime_diagnostics.py, runtime/browser_startup_projection.py, runtime/help_general.py, runtime/help_metadata.py, runtime/help_topic_lifecycle.py, runtime/help_topic_planning.py, runtime/help_topic_actions.py, runtime/help_topic_inspection.py, runtime/help_topic_maintenance.py, runtime/help_topic_catalog.py, runtime/help_topic_rendering.py, runtime/help_topics.py PythonEngineRuntime remains the CLI-facing facade. Runtime construction/wiring, planning/startup compatibility wrappers, service/env/hook/command compatibility wrappers, action command compatibility wrappers, CLI command compatibility wrappers, utility command table dispatch, debug command compatibility wrappers, doctor/readiness/release-gate compatibility wrappers, lifecycle/cleanup compatibility wrappers, state/service truth compatibility wrappers, command catalog compatibility exports, command alias/supported-command ownership, command flag/mode/env-token ownership, registry uniqueness validation, service command autodetection/suggestion ownership, route model/error ownership, flag-storage mapping ownership, special/env flag policy ownership, startup explanation/preflight payload ownership, browser-safe env preview/redaction, CORS diagnostics/projection, persisted runtime diagnostics, startup env projection, service command autodetection/suggestion heuristics, command-family help metadata, general help rendering, command-help topic catalog family data, command-help topic rendering, and dependency/service env projection ownership are grouped in focused owners while implementation stays in focused runtime modules.
Configuration loading python/envctl_engine/config/__init__.py config/models.py, config/load_support.py, config/command_defaults.py, config/defaults.py, config/source_discovery.py, config/service_parsing.py, config/dependency_env_templates.py, config/persistence.py, config/persistence_values.py, config/persistence_payload.py, config/persistence_rendering.py, config/profile_defaults.py envctl_engine.config remains the public import surface for config models, defaults, loading, source discovery, command/default resolution, and dependency env template helpers. Typed config dataclasses live in models.py; load_support.py owns loader-only policy for dependency inference, startup-profile construction, runtime scope IDs, path resolution, plan-agent aliases, and mode parsing; command, directory, and frontend test-path default resolution lives in command_defaults.py; default value and managed-key construction lives in defaults.py; .envctl/legacy source discovery, generated-worktree parent config root resolution, and envctl text parsing live in source_discovery.py; additional-service and Supabase Auth user parsing lives in service_parsing.py; dependency env marker parsing, scoped template rendering, legacy template upgrades, and template stripping live in dependency_env_templates.py; managed config value parsing and validation live in persistence_values.py; nested/flat config payload hydration lives in persistence_payload.py; managed block rendering/merge/review text lives in persistence_rendering.py; persistence.py stays as the save and ignore-policy facade.
Runtime lifecycle, start, resume, stop, and cleanup python/envctl_engine/runtime/engine_runtime_lifecycle_support.py startup/startup_orchestrator.py, runtime/lifecycle_cleanup_orchestrator.py, runtime/lifecycle_requirement_ports.py, runtime/lifecycle_service_termination.py, runtime/lifecycle_service_stop_selection.py, runtime/lifecycle_dependency_stop.py, runtime/lifecycle_stopped_metadata.py, runtime/lifecycle_blast_support.py, runtime/lifecycle_blast_ports.py, runtime/lifecycle_blast_processes.py, runtime/lifecycle_blast_docker.py, runtime/lifecycle_worktree_cleanup.py, runtime/lifecycle_worktree_metadata.py, runtime/lifecycle_worktree_processes.py, runtime/lifecycle_worktree_containers.py, runtime/session_management.py Existing lifecycle command flags and exit statuses stay stable. Requirement-key lookup, requirement port collection, component port collection, and requirement port release live in lifecycle_requirement_ports.py; runtime service termination, process ownership checks, selected-service termination fanout, and service port release live in lifecycle_service_termination.py; targeted stop execution, spinner lifecycle, and state persistence stay in the cleanup orchestrator; service-stop target selection, runtime-scope filtering, explicit service/project selector handling, and interactive-selection fallback live in lifecycle_service_stop_selection.py; dependency stop component selection and component pruning live in lifecycle_dependency_stop.py; dashboard stopped-service metadata projection lives in lifecycle_stopped_metadata.py; blast-all cleanup sequencing lives in lifecycle_blast_support.py, with port sweeping in lifecycle_blast_ports.py, process predicates/tree ordering in lifecycle_blast_processes.py, and Docker container/volume policy in lifecycle_blast_docker.py; delete/blast/self-destruct worktree cleanup sequencing lives in lifecycle_worktree_cleanup.py; worktree metadata/artifact cleanup, listener/cwd process cleanup, and tree-scoped Docker cleanup live in lifecycle_worktree_metadata.py, lifecycle_worktree_processes.py, and lifecycle_worktree_containers.py while engine_runtime_lifecycle_support.py keeps legacy patch points.
Startup orchestration python/envctl_engine/startup/startup_orchestrator.py startup/context_selection.py, startup/session_lifecycle.py, startup/run_reuse_resolution.py, startup/disabled_startup_resolution.py, startup/execution_preparation.py, startup/selected_context_startup.py, startup/post_start_reconcile.py, startup/requirements_execution.py, startup/requirements_component_startup.py, startup/requirements_native_adapter.py, startup/resume_restore_policy.py, startup/resume_restore_execution.py, startup/resume_restore_project.py, startup/resume_restore_results.py, startup/service_backend_migration_support.py, startup/service_execution.py, startup/service_execution_environment.py, startup/service_execution_policy.py, startup/service_execution_records.py, startup/service_attach_execution.py, startup/service_launch_diagnostics.py, startup/finalization.py, startup/finalization_plan_output.py, startup/finalization_run_state.py, startup/plan_agent_handoff.py, startup/restart_prestop_support.py, startup/run_reuse_identity.py, startup/run_reuse_support.py, startup/startup_selection_support.py, startup/service_bootstrap_domain.py, startup/service_env_support.py, startup/service_runtime_state_support.py, startup/service_frontend_bootstrap_support.py StartupOrchestrator.execute is the sequence owner; project discovery/selection, explicit filtering, duplicate handling, selection phase/snapshot emission, and plan-agent worktree recovery stay in context selection support. Startup session creation, run-id resolution, run/session identifier announcement, mode-toggle validation, startup-hook contract validation, and runtime readiness gate emission stay in session lifecycle support. Auto-resume/reuse phase orchestration, run-reuse event emission, dashboard resume handling, planning-PR handoff, and startup branch-entry snapshot routing stay in run-reuse resolution support. Disabled startup dashboard-state finalization, artifact writes, plan-agent handoff validation, disabled plan messaging, headless summary handoff, plan-agent attach handoff, and interactive dashboard entry stay in disabled startup resolution support. Docker prewarm execution preparation and phase emission stay in execution preparation support. Selected-context startup execution, spinner policy/lifecycle emission, parallel/sequential dispatch, result recording, warning rendering handoff, and degraded local-startup handling stay in selected context startup support. Post-start strict truth reconciliation, degraded plan-agent handoff reconciliation skips, state.reconcile events, and strict-truth failure marking stay in post-start reconcile support. Successful, degraded-handoff, and failed startup finalization, final artifact writes, startup failure event emission, started-service cleanup, port session release, timing summary routing, startup breakdown emission, dashboard summary/status output, before-dashboard-entry snapshots, and interactive dashboard entry stay in startup finalization support. Dry-run output, restart rebound summaries, headless attach guidance, plan-agent attach fallback, and degraded plan-agent handoff terminal text live in finalization_plan_output.py; run-state and planning-dashboard state construction live in finalization_run_state.py; startup.finalization re-exports those helpers for compatibility. Preserved-service merge events, project startup warning rendering, and failure-status rendering also stay in startup finalization support. Resume restore coordination, spinner policy wiring, and parallel/sequential restore dispatch live in resume_restore_execution.py; per-project restore timing, requirement reuse, stale-service replacement, port release/reservation, and app-service restart live in resume_restore_project.py; restore result state mutation, degraded requirement marking, and timing-line rendering live in resume_restore_results.py, while plan-agent dependency bootstrap, launch execution, launch-state, launch spinner text, launch failure policy/messages, validation/degradation decisions, stale attach-target degradation, and local-startup degradation events stay in startup handoff support. Restart pre-stop phase orchestration, spinner lifecycle emission, state lookup/fallback, selection policy, route conversion, service/requirement preservation policy, restart port assignment mapping/application, orphan-listener scan planning, orphan-listener PID/cwd matching, and matched listener termination/release policy stay in restart pre-stop support. Run reuse identity support owns startup identity metadata, fingerprints, project identity normalization, and mismatch helpers. Run reuse support owns reuse decisions, plan debug orch-group parsing, dashboard stopped-service restore metadata parsing/removal, dashboard stopped-service restore route/session/event preparation, fresh-start replacement service selection, and fresh-start existing-service termination handoff. Trees start selection, plan-backed preselection, and restart requirement inclusion policy stay in startup selection support. Managed requirement component startup orchestration, synthetic bind-conflict retry handoff, Supabase contract/fingerprint/reinit policy, configured-command fallback, port-plan updates, and success/failure event projection live in requirements_component_startup.py; requirements startup support remains a compatibility facade, while native adapter selection, Docker command timing/probe trace emission, effective-port projection, and adapter result normalization live in requirements_native_adapter.py. Backend migration/bootstrap command execution, async-driver retry handling, warning rendering, and migration marker detection live in service_backend_migration_support.py. Configured core service-type resolution stays in service bootstrap support; env-file resolution, frontend local env synchronization, backend env contract construction, sensitive env scrubbing, and env assignment parsing stay in service env support; backend/frontend runtime prep cache fingerprints and prep-state persistence stay in service runtime state support; frontend dependency probing, install command selection, bootstrap command execution, and frontend prepare sequencing stay in service frontend bootstrap support. Service workdir/log-path/env compatibility, dependency/retry emitters, and configured-service discovery live in service_execution_environment.py; service attach/prep parallel policy, additional-service layer ordering, backend listener expectation, CORS projection, and command-env fallback live in service execution policy support; launched service record finalization and launch dataclasses live in service_execution_records.py; attached-service start callbacks, service descriptors, process launch, actual-port detection, listener enforcement, and generic/legacy service-manager dispatch live in service_attach_execution.py; runtime launch diagnostics payload assembly lives in service launch diagnostics support.
Action commands python/envctl_engine/actions/action_command_orchestrator.py actions/action_command_execution_support.py, actions/action_command_project_facade.py, actions/action_command_test_facade.py, actions/action_commit_message_support.py, actions/action_commit_support.py, actions/action_failed_rerun_support.py, actions/action_failed_test_spec_support.py, actions/action_git_state_support.py, actions/action_migrate_context_support.py, actions/action_migrate_execution_support.py, actions/action_migrate_failure_support.py, actions/action_migrate_result_support.py, actions/action_migrate_support.py, actions/action_output_support.py, actions/action_pr_message_support.py, actions/action_pr_workflow_support.py, actions/action_protected_artifacts.py, actions/action_project_report_owner.py, actions/action_review_artifact_support.py, actions/action_review_base_support.py, actions/action_review_iteration_support.py, actions/action_review_original_plan_support.py, actions/action_review_output_support.py, actions/action_review_plan_support.py, actions/action_review_workflow_support.py, actions/action_runtime_facade.py, actions/action_ship_checks.py, actions/action_ship_conflicts.py, actions/action_ship_contract.py, actions/action_ship_support.py, actions/action_spinner_support.py, actions/action_target_support.py, actions/actions_test.py, actions/actions_test_classification.py, actions/actions_test_command_discovery.py, actions/actions_test_frontend_paths.py, actions/actions_test_models.py, actions/actions_test_package_discovery.py, actions/actions_test_python_discovery.py, actions/actions_test_suggestions.py, actions/action_test_command_support.py, actions/action_test_execution_support.py, actions/action_test_suite_event_support.py, actions/action_test_suite_execution_support.py, actions/action_test_suite_outcome_support.py, actions/action_test_suite_presentation.py, actions/action_test_suite_run_loop.py, actions/action_test_interrupt_support.py, actions/action_test_manifest_support.py, actions/action_test_plan_support.py, actions/action_test_policy_support.py, actions/action_test_runner.py, actions/action_test_runner_failures.py, actions/action_test_runner_progress.py, actions/action_test_service_support.py, actions/action_test_spinner_support.py, actions/action_test_status_support.py, actions/action_test_support_models.py, actions/action_test_summary_support.py, actions/action_test_summary_artifacts.py, actions/action_test_summary_collection.py, actions/action_test_summary_display.py, actions/action_test_summary_formatting.py, actions/action_test_summary_git.py, actions/action_worktree_runner.py, actions/action_worktree_target_resolution.py, actions/action_worktree_self_destruct.py, actions/project_action_domain.py, actions/project_action_support.py, actions/project_action_workflow_factory.py, actions/project_action_workflows.py ActionCommandOrchestrator remains the compatibility entry point. Action command dispatch, target-resolution finish handling, action spinner lifecycle orchestration, action command output, artifacts, and return codes remain compatible. Current-worktree target resolution and worktree-layout/main-repo detection live in action_worktree_target_resolution.py; delete/blast execution stays in action_worktree_runner.py; self-destruct safety checks and detached helper launch live in action_worktree_self_destruct.py, with the runner preserving legacy imports and patch points. Test action wrappers live in the test facade, while git/project/migrate/reporting compatibility wrappers live in the project facade and delegate to action-owned helpers. Test command models, frontend path normalization, configured-command classification, Python/pytest detection, package-manager detection, and suggestion rendering live in focused actions_test_* modules while actions_test.py keeps the patch-sensitive discovery/bootstrap compatibility surface. actions_test_command_discovery.py coordinates ordering and default/suggestion selection, actions_test_python_discovery.py owns backend/root pytest and unittest discovery, actions_test_package_discovery.py owns root/frontend package-manager test detection, and actions_test_suggestions.py owns labels, confidence, reasons, and command text. Test target/execution-spec models live in action_test_support_models.py; failed-test manifest parsing, selector sanitization, unittest identifier resolution, and frontend failed-file derivation live in action_test_manifest_support.py; configured/default test execution-spec construction, backend Python command normalization, and legacy tree test-script detection live in action_test_command_support.py; failed-only rerun execution-spec construction lives in action_failed_test_spec_support.py; test execution-spec planning lives in action_test_plan_support.py; test status rendering lives in action_test_status_support.py; parallel execution and suite-spinner policy live in action_test_policy_support.py; action_test_support.py keeps compatibility exports and patch-sensitive wrappers. Test action execution, prerequisite checks, suite-plan event emission, and execution-mode announcements live in action_test_execution_support.py; per-suite command execution, runner callback wiring, and interrupt cleanup live in action_test_suite_execution_support.py; per-suite outcome collection lives in action_test_suite_outcome_support.py; sequential/parallel suite scheduling and failure aggregation live in action_test_suite_run_loop.py; suite status text, command rendering, parsed-count status emission, interactive finish rows, and spinner/progress finish routing live in action_test_suite_presentation.py; suite start/finish event payloads live in action_test_suite_event_support.py. Test-suite rich row spinner availability, rendering, lifecycle events, and progress updates live in action_test_spinner_support.py and are re-exported from action_test_support.py for compatibility. Test-runner interrupt registration, process-group termination, queued-cancel accounting, and interrupt cleanup event emission live in action_test_interrupt_support.py; failure normalization, per-suite live progress state/status formatting, and parallel progress state/rendering live in action_test_runner_failures.py and action_test_runner_progress.py, with action_test_runner.py retaining only high-level test-action orchestration and final summary handling. Test failure-summary artifact persistence, failed-test/generic-suite collection, terminal summary rendering, traceback/output compaction, and git-state fingerprinting live in the focused action_test_summary_* owner modules; action_test_summary_support.py remains a compatibility re-export facade. Commit workflow staging/push and protected-artifact skipping live in action_commit_support.py; commit message resolution and commit-ledger pointer handling live in action_commit_message_support.py; git root/default-branch/dirty-worktree/PR URL probes live in action_git_state_support.py; project action workflow dependency bundles and runner methods for commit, PR, ship, and review live in project_action_workflows.py; project action workflow runner construction and compatibility dependency adapters live in project_action_workflow_factory.py; migrate requirement/context projection lives in action_migrate_context_support.py; migrate failure headline/hint summarization lives in action_migrate_failure_support.py; migrate result records and terminal rendering live in action_migrate_result_support.py; action_migrate_support.py is the compatibility re-export facade. Project action environment/replacements, backend test env projection, migrate backend env contract metadata, command resolution, streaming review execution policy, project-action handler construction, review artifact parsing, failure reports, and persisted action report metadata live in project_action_support.py, with owner-bound callback adapters in action_project_report_owner.py. PR title/body/range rendering, PR creation workflow orchestration, protected envctl-local artifact partitioning, review artifact file/path writing, review output rendering/stat pruning, original-plan resolution, review-base selection, tree-diffs output placement, analyze-helper invocation, and review action summary fallback orchestration are action-owned helpers re-exported through the project action domain for compatibility. Ship workflow sequencing stays in action_ship_support.py; ship payload/output/protected-path reporting lives in action_ship_contract.py; merge-conflict reporting and prediction lives in action_ship_conflicts.py; GitHub check probing and normalization lives in action_ship_checks.py. Review artifact path/text helpers live in action_review_artifact_support.py; original-plan lookup and review bundle metadata injection live in action_review_original_plan_support.py; review-base resolution lives in action_review_base_support.py; analyze iteration selection, tree-diffs paths, and helper invocation live in action_review_iteration_support.py; action_review_plan_support.py is the compatibility re-export facade.
Planning and generated worktrees python/envctl_engine/planning/worktree_domain.py and python/envctl_engine/planning/worktree_orchestrator.py planning/protocols.py, planning/menu.py, planning/menu_rendering.py, planning/menu_input.py, planning/menu_selection.py, planning/planning_files.py, planning/planning_tree_discovery.py, planning/planning_project_prediction.py, planning/worktree_runtime_bridge.py, planning/worktree_setup_runtime_bridge.py, planning/worktree_creation_runtime_bridge.py, planning/worktree_selection_runtime_bridge.py, planning/worktree_sync_runtime_bridge.py, planning/worktree_code_intelligence.py, planning/worktree_code_intelligence_cgc.py, planning/worktree_code_intelligence_config.py, planning/worktree_code_intelligence_files.py, planning/worktree_code_intelligence_metadata.py, planning/worktree_code_intelligence_models.py, planning/worktree_creation_commands.py, planning/worktree_creation_flow.py, planning/worktree_creation_recovery.py, planning/worktree_identity.py, planning/worktree_menu_terminal_support.py, planning/worktree_path_support.py, planning/worktree_plan_project_selection.py, planning/worktree_plan_selection.py, planning/worktree_planning_menu.py, planning/worktree_prompt_selection.py, planning/worktree_provenance.py, planning/worktree_git_hooks.py, planning/worktree_main_task.py, planning/worktree_project_catalog.py, planning/worktree_selection_memory.py, planning/worktree_setup_coordinator.py, planning/worktree_setup_entries.py, planning/worktree_shared_artifacts.py, planning/worktree_spinner_support.py, planning/worktree_sync_deletion.py, planning/worktree_sync_orchestration.py Public worktree setup helpers keep current behavior while implementation moves behind owners. Shared planning protocol shapes live in planning/protocols.py. Public planning package exports are a thin facade: planning file discovery/selection parsing lives in planning_files.py, tree project discovery/filtering lives in planning_tree_discovery.py, dry-run project prediction/counting lives in planning_project_prediction.py, and generated-worktree identity records live in worktree_identity.py. The terminal planning menu keeps PlanningSelectionMenu as the patchable facade; frame rendering/windowing lives in menu_rendering.py, terminal byte decoding/cleanup lives in menu_input.py, and count mutation/submission policy lives in menu_selection.py. worktree_runtime_bridge.py is the compatibility/runtime wiring facade and owns the production bridge factory; setup-worktree runtime wiring lives in worktree_setup_runtime_bridge.py; git worktree creation/add/recovery runtime wiring lives in worktree_creation_runtime_bridge.py; plan-project selection, prompt selection, and planning-menu runtime wiring live in worktree_selection_runtime_bridge.py; plan-worktree sync/delete runtime wiring lives in worktree_sync_runtime_bridge.py. Worktree creation sequencing, partial-failure result preservation, provenance/code-intelligence handoff, MAIN_TASK.md seeding, and plan-agent CLI pairing live in worktree_creation_flow.py. Code-intelligence coordination lives in worktree_code_intelligence.py, with identity/config policy, Serena/config file copying, CGC reuse/indexing, metadata shape, and shared records split into focused owners. Path/root/selection-target parsing lives in worktree_path_support.py; planning menu terminal adapters live in worktree_menu_terminal_support.py; generated-worktree setup and sync share spinner policy/lifecycle output through worktree_spinner_support.py. worktree_domain.py remains a compatibility facade and keeps lazy patch points for legacy tests/callers without owning production collaborator construction.
Plan-agent launch transports python/envctl_engine/planning/plan_agent/launch.py planning/plan_agent/launch_policy.py, cmux_transport.py, cmux_workspace_support.py, cmux_surface_support.py, cmux_bootstrap_support.py, cmux_workflow_submission_support.py, cmux_goal_support.py, cmux_worktree_launch_support.py, cmux_review_launch_support.py, tmux_transport.py, tmux_launch_support.py, tmux_identity_support.py, tmux_attach_support.py, tmux_health_support.py, tmux_window_support.py, tmux_surface_support.py, tmux_prompt_submission_support.py, tmux_prompt_readiness_support.py, tmux_workflow_queue_support.py, tmux_workflow_submission_support.py, tmux_worktree_launch_support.py, omx_transport.py, omx_launch_support.py, omx_attach_support.py, omx_lock_support.py, omx_spawn_support.py, omx_validation_support.py, superset_transport.py, superset_worktree_launch_support.py, superset_cli_support.py, superset_goal_agent_support.py, superset_desktop_support.py, workflow_build.py, workflow_prompt_support.py, workflow_e2e_prompt_context.py, workflow_runtime_addresses.py, workflow_queue_support.py, workflow_queue_interaction.py, workflow_bootstrap_commands.py, workflow_review_support.py, workflow.py, recovery.py Prompt presets, direct prompts, readiness, recovery text, and launch flags remain stable. Shared launch option parsing, transport fallback policy, CLI command defaults, ULW support checks, readiness timing, and prereq command projection stay in launch_policy.py; config.py remains the compatibility facade for older imports and patch points. Cmux workspace discovery, configured workspace resolution, list-output parsing, workspace creation, and starter-surface probing stay in cmux_workspace_support.py; cmux surface creation, command I/O, paste/send helpers, readiness polling, read-screen handling, and surface preparation stay in cmux_surface_support.py; cmux background bootstrap thread creation, completion events, failure events, event-snapshot persistence, per-worktree bootstrap sequencing, review-tab bootstrap sequencing, queue fallback event emission, and review preset submission stay in cmux_bootstrap_support.py; cmux prompt/direct submission and transport-specific bootstrap adapter wiring stay in cmux_workflow_submission_support.py; cmux Codex /goal submission, active-goal gating, and queue-ready fallback ownership stay in cmux_goal_support.py; cmux per-worktree surface creation/reuse outcome handling and background-bootstrap handoff stay in cmux_worktree_launch_support.py; cmux review-tab readiness, workspace/surface launch failures, review bootstrap handoff, launch events, and user summary stay in cmux_review_launch_support.py; cmux_transport.py remains the compatibility and patch surface, with stateless workspace/surface helpers exported as direct owner aliases and only callback-wiring functions kept as wrappers. Tmux launch orchestration, unhealthy existing-session handoff, existing-session policy, session/window fanout, attach target construction, and aggregate partial/failure summaries stay in tmux_launch_support.py; tmux deterministic session names, collision suffixing, and worktree window names stay in tmux_identity_support.py; tmux existing-session attach resolution, worktree-path matching, requested-session fallback, and unhealthy-session event/outcome reporting stay in tmux_attach_support.py; tmux existing Codex/OpenCode session health, empty-screen detection, ready/active screen classification, and unhealthy diagnostic payloads stay in tmux_health_support.py; tmux session/window creation, mouse scrollback enablement, window existence checks, and readiness polling stay in tmux_window_support.py; tmux low-level target selection, command execution, key/text submission, prompt paste-buffer handling, and screen capture stay in tmux_surface_support.py; tmux prompt submission, bootstrap adapter wiring, and Codex /goal handling stay in tmux_prompt_submission_support.py; tmux CLI readiness waits and post-submit readiness checks stay in tmux_prompt_readiness_support.py; tmux transport-specific Codex queued-step handoff stays in tmux_workflow_queue_support.py; per-worktree bootstrap sequencing, OMX existing-session prompt wrapping, and queue fallback event emission stay in tmux_workflow_submission_support.py; shared Codex queued-step sequencing, /goal-before-prompt policy, queue failure classification, and workflow-queued event payloads stay in workflow_queue_support.py; shared Codex queue screen polling, picker submission, and tab-confirmation loops stay in workflow_queue_interaction.py; shared CLI bootstrap cd/command typing stays in workflow_bootstrap_commands.py; tmux per-worktree launch outcome/event sequencing stays in tmux_worktree_launch_support.py; tmux_transport.py remains the compatibility and patch surface, with stateless low-level surface helpers exported as direct owner aliases and callback-wiring functions kept as wrappers; omx_transport.py remains the compatibility and patch surface, with stateless lock/spawn/session-payload helpers exported as direct owner aliases and launch/attach/validation wrappers kept where they inject collaborators; OMX launch orchestration, existing-session policy, spawn/attach/bootstrap/validation sequencing, event emission, runtime snapshot persistence, and aggregate partial/failure summaries stay in omx_launch_support.py; OMX state-file parsing, payload candidate filtering, tmux pane discovery, attach diagnostics, existing-session discovery, and attach readiness polling stay in omx_attach_support.py; stale OMX tmux extended-key lock cleanup stays in omx_lock_support.py; OMX spawn root selection, launch environment shaping, detached process retention, metadata payloads, and failure diagnostics stay in omx_spawn_support.py; OMX post-launch attach validation, missing-worktree detection, stale attach-target reporting, and retained-spawn exit pruning stay in omx_validation_support.py; Superset per-worktree prompt resolution, public CLI command construction, result parsing, desktop bridge/open/verify handoff, events, and launch outcomes stay in superset_worktree_launch_support.py; Superset git-branch lookup, workspace naming, and workspace-open command execution stay in superset_cli_support.py; Superset Codex /goal host-agent registration, launcher generation, and host database discovery stay in superset_goal_agent_support.py; Superset desktop cache verification, bridge writes, restart policy, workspace payload parsing, result formatting, and CLI error shaping stay in superset_desktop_support.py; superset_transport.py remains the compatibility and callback-wiring surface; workflow construction, prompt-template loading, slash-command formatting, and tab-title shortening stay in workflow_build.py; direct-prompt resolution and ULW shaping stay in workflow_prompt_support.py; browser-E2E original-task source context and follow-up prompt enrichment stay in workflow_e2e_prompt_context.py; runtime address state loading, worktree filtering, dependency/service address rendering, and implement-task prompt injection stay in workflow_runtime_addresses.py; review prompt argument rendering, original-plan lookup, plan selector inference, and dashboard relaunch command construction stay in workflow_review_support.py; workflow.py remains the compatibility surface for workflow helpers.
Requirements bootstrap python/envctl_engine/requirements/orchestrator.py requirements/supabase.py, requirements/supabase_lifecycle/orchestrator.py, requirements/supabase_lifecycle/*.py, postgres.py, redis.py, n8n.py, adapter_base.py, adapter_lifecycle_models.py, adapter_policy.py, adapter_port_cleanup.py, container_lifecycle_state.py, container_lifecycle_execution.py, container_lifecycle_probe_phase.py, external.py, external_mode.py, external_env.py, external_probe.py, external_outcome.py, common.py, common_contracts.py, docker_runtime.py, docker_image_support.py, container_state_support.py Adapter APIs used by startup and runtime stay stable during component extraction. requirements/supabase.py remains the compatibility facade; Supabase startup sequencing lives in the lifecycle orchestrator, while compose service discovery and alias normalization live in supabase_lifecycle/service_resolution.py; stale Auth/Kong gateway preflight cleanup lives in supabase_lifecycle/gateway_preflight.py; compose graph sequencing and network-recovery stage emission live in supabase_lifecycle/graph_flow.py; compose up handoff, readiness detection, port-publish diagnostics, compose process termination, env-port parsing, and timeout recovery live in supabase_lifecycle/compose_handoff.py; DB listener probing, retry bring-up, restart/recreate recovery, DB probe stage emission, and DB failure-detail flow live in supabase_lifecycle/db_flow.py; native Supabase DB container discovery, port-adoption, recreation, readiness probing, and high-level DB lifecycle decisions live in supabase_lifecycle/native_db.py; native DB image selection and Docker create-command assembly live in supabase_lifecycle/native_db_commands.py; native DB create/start timeout recovery, published-port inspection, state-error probing, retry sleeps, and forced container removal live in supabase_lifecycle/native_db_recovery.py; and Auth/Kong probe, wait, restart, recreate, gateway mismatch, final readiness, and failure-detail flow live in supabase_lifecycle/auth_flow.py. Shared adapter lifecycle records live in adapter_lifecycle_models.py; env parsing, timeout/probe policy, and port-mismatch policy live in adapter_policy.py; bind-conflict safe cleanup, conflict guidance, and port wait probing live in adapter_port_cleanup.py; shared requirement result records, retry policy, bind-conflict detection, and deterministic container naming live in common_contracts.py; Docker command execution, command-error shaping, and serialized macOS port-publish locking live in docker_runtime.py; Docker image pull policy, inspect checks, and pull orchestration live in docker_image_support.py; container existence/status/state-error inspection, host-port discovery, missing-port diagnostics, and stop/remove cleanup live in container_state_support.py; common.py remains the compatibility facade for legacy shared requirement imports. Container lifecycle state, event emission, duration accounting, success/failure projection, and port-reset bookkeeping live in container_lifecycle_state.py; container discovery and start/create execution live in container_lifecycle_execution.py, while readiness probing, local settle, restart recovery, and recreate recovery live in container_lifecycle_probe_phase.py behind compatibility wrappers on the executor. Externally managed dependency behavior is split behind the stable external.py facade: mode policy lives in external_mode.py, runtime/app env and resource projection live in external_env.py, optional live probes live in external_probe.py, and startup outcome projection lives in external_outcome.py. adapter_base.py remains the compatibility facade for legacy adapter imports.
Dashboard and terminal UI python/envctl_engine/ui/dashboard/orchestrator.py and python/envctl_engine/runtime/engine_runtime_ui_bridge.py ui/dashboard/rendering.py, ui/dashboard/snapshot_rendering.py, ui/dashboard/snapshot_support.py, ui/dashboard/service_rendering.py, ui/dashboard/ai_session_rendering.py, ui/dashboard/dependency_rendering.py, ui/dashboard/pr_link_rendering.py, ui/dashboard/terminal_ui.py, ui/terminal_command_readers.py, ui/terminal_input_stream.py, ui/terminal_tty_modes.py, ui/textual/screens/config_wizard_components.py, ui/textual/screens/config_wizard_action_bundle.py, ui/textual/screens/config_wizard_component_actions.py, ui/textual/screens/config_wizard_body_actions.py, ui/textual/screens/config_wizard_fields.py, ui/textual/screens/config_wizard_form.py, ui/textual/screens/config_wizard_hints.py, ui/textual/screens/config_wizard_layout.py, ui/textual/screens/config_wizard_navigation.py, ui/textual/screens/config_wizard_values.py, ui/textual/screens/config_wizard_status.py, ui/textual/screens/config_wizard_list_rendering.py, ui/textual/screens/config_wizard_step_flow.py, ui/textual/screens/config_wizard_suggestions.py, ui/textual/screens/config_wizard_suggestion_actions.py, ui/textual/screens/config_wizard_flow_actions.py, ui/textual/screens/config_wizard_focus_actions.py, ui/textual/screens/planning_selector_model.py, ui/textual/screens/selector/backend_policy.py, ui/textual/screens/selector/io_probe.py, ui/textual/screens/selector/read_guard.py, ui/textual/screens/selector/textual_driver_instrumentation.py, ui/textual/screens/selector/prompt_toolkit_io_instrumentation.py, ui/textual/screens/selector/selection_state.py, ui/textual/screens/selector/textual_app_focus_actions.py, ui/textual/screens/selector/textual_app_key_actions.py, ui/textual/screens/selector/textual_app_runtime.py, ui/textual/screens/selector/textual_app_navigation_actions.py, ui/textual/screens/selector/textual_app_selection_actions.py, ui/textual/screens/selector/textual_key_telemetry.py, ui/textual/screens/selector/textual_key_policy.py, ui/dashboard/command_support.py, ui/dashboard/command_input_support.py, ui/dashboard/orchestrator_command_mixin.py, ui/dashboard/orchestrator_failure_mixin.py, ui/dashboard/orchestrator_target_mixin.py, ui/dashboard/orchestrator_stop_mixin.py, ui/dashboard/orchestrator_pr_mixin.py, ui/dashboard/orchestrator_restart_mixin.py, ui/dashboard/failure_detail_support.py, ui/dashboard/stop_scope_support.py, ui/dashboard/restart_selection_support.py, ui/dashboard/pr_and_target_support.py, ui/dashboard/pr_selection_support.py, ui/dashboard/pr_commit_support.py, ui/dashboard/pr_scope_support.py, ui/dashboard/project_target_support.py, ui/dashboard/review_tab_support.py, ui/dashboard/target_selection_support.py, ui/dashboard/target_service_catalog.py, ui/backend.py, ui/backend_selector_support.py, ui/backend_selector_debug.py, ui/backend_selector_subprocess.py, ui/backend_selector_tty.py, ui/backend_resolver.py, ui/command_loop.py DashboardOrchestrator stays the compatibility facade. Rendering compatibility wrappers live in ui/dashboard/rendering.py; full snapshot print orchestration lives in ui/dashboard/snapshot_rendering.py; dashboard snapshot projection/accounting lives in ui/dashboard/snapshot_support.py; service row/status/configured/stopped-service rendering, AI session/run-command row resolution, dependency row rendering/scope inference, dashboard PR-link root resolution/lookup/caching, interactive command dispatch, terminal input, text dialogs, session-kill helpers, failure detail output, stop-scope selection/token mapping, restart selection, PR selection/branch choice, dirty-PR commit preflight, PR target/root scoping, origin review-tab flow, project/commit target-scope selection, target/service/test-scope selection, and service-catalog projection are owned by focused dashboard modules and exposed through behavior mixins on the orchestrator facade; command-line fallback/basic input backend orchestration lives in ui/terminal_command_readers.py; byte-level terminal input buffering, CR/LF pairing, preserved selector handoff input, stale control-sequence discard, and escape decoding live in ui/terminal_input_stream.py, while line-mode normalization and terminal restoration live in ui/terminal_tty_modes.py; ui/backend.py owns backend facade selection and ui/backend_selector_support.py coordinates selector handoff/preflight routing while selector debug telemetry, subprocess payload/result handling, and TTY/env/preflight primitives live in ui/backend_selector_debug.py, ui/backend_selector_subprocess.py, and ui/backend_selector_tty.py; Textual config wizard action factory construction lives in config_wizard_action_bundle.py; component rows and selected-state projection live in config_wizard_components.py; component list navigation, focus-driven default-mode selection, component/service-startup toggles, split-row action availability, and list-selection dispatch live in config_wizard_component_actions.py; body visibility, welcome/empty/review copy, and visible field synchronization live in config_wizard_body_actions.py; key-action resolution and primitive list cursor movement live in config_wizard_navigation.py; field metadata, ID helpers, additional-service form parsing, visibility rules, and hydration defaults live in config_wizard_fields.py; form widget synchronization, validation display, focus-on-error behavior, and validated text/port/additional-service application live in config_wizard_form.py; field hints and directory/entrypoint validation live in config_wizard_hints.py; wizard CSS and static widget composition live in config_wizard_layout.py; suggestion discovery, cycling, and detection event payloads live in config_wizard_suggestions.py; focused suggestion-field detection, accepted-suggestion mutation, accepted-suggestion telemetry, and suggestion action availability live in config_wizard_suggestion_actions.py; wizard back/next/submit flow, validation gates, final save/exit handoff, and list-selection suppression live in config_wizard_flow_actions.py; step-specific focus routing lives in config_wizard_focus_actions.py; field value lookup and validated text/port mutation live in config_wizard_values.py; status copy, validation-status derivation, action-button policy, list rendering, and step sequencing live in config_wizard_status.py, config_wizard_list_rendering.py, and config_wizard_step_flow.py; planning selector row normalization, render-entry text, status/result policy, filter visibility, and count toggling live in planning_selector_model.py; Textual selector backend choice, env/debug toggles, selector IDs, event emission, and driver-thread snapshots live in selector/backend_policy.py; selector FD/termios/pending-byte probing lives in selector/io_probe.py; selector nonblocking read guards live in selector/read_guard.py; Textual parser/select/read instrumentation lives in selector/textual_driver_instrumentation.py; prompt-toolkit posix IO instrumentation lives in selector/prompt_toolkit_io_instrumentation.py; selector row initialization, row rendering, row/filter visibility primitives, selected-value projection, submit fallback, and fallback recovery live in selector/selection_state.py; selector focus routing, list/filter/button focus handoff, focus-order cycling, and focus telemetry live in selector/textual_app_focus_actions.py; selector key-action dispatch, raw/event key tracing, filter key recovery, submit suppression, and slash-focus handling live in selector/textual_app_key_actions.py; selector keyboard navigation, single-select focus synchronization, edge hints, escape recovery, and navigation key debug handoff live in selector/textual_app_navigation_actions.py; selector selection-action event emission, toggle/select orchestration, list-selection handling, and row-click model-index parsing live in selector/textual_app_selection_actions.py; selector app status rendering, focus identity/order telemetry, submit/cancel/exit event emission, and error-state/timer lifecycle live in selector/textual_app_runtime.py; selector key counters, idle snapshots, driver telemetry, and final key summaries live in selector/textual_key_telemetry.py; selector top-level and filter-focused key decisions live in selector/textual_key_policy.py while command behavior, runtime UI bridge behavior, wizard/selector screen behavior, and rendering contracts remain compatible.
State actions and generated runtime contracts python/envctl_engine/state/action_orchestrator.py, python/envctl_engine/state/, and python/envctl_engine/runtime_feature_inventory.py state/action_command_support.py, state/action_log_support.py, state/action_health_support.py, runtime_feature_definition_schema.py, runtime_feature_*_command_definitions.py, runtime_feature_command_definitions.py, runtime_feature_extra_definitions.py, runtime_feature_definitions.py, runtime_feature_contracts.py, contracts/*.json, scripts/generate_*, scripts/release_shipability_gate.py StateActionOrchestrator remains the logs/clear-logs/health/errors route facade; state loading, project guardrails, command branching, target-selection flow, action lifecycle events, and reconciliation live in action_command_support.py; log payload rendering, recent issue scanning, clear-log mutation, failed-service payloads, and parallel service mapping live in action_log_support.py; health payload/status summarization, service/dependency rows, project grouping, status badges, and health palette/rendering live in action_health_support.py. Runtime feature schema lives in runtime_feature_definition_schema.py; command feature catalog data is split by command area across runtime_feature_*_command_definitions.py, with runtime_feature_command_definitions.py kept as the ordered compatibility aggregate; non-command feature catalog data lives in runtime_feature_extra_definitions.py; runtime_feature_definitions.py remains the public compatibility facade; runtime_feature_inventory.py remains the public compatibility/builder facade; matrix/gap-report rendering, gap-plan rendering, validation, and timestamps live in runtime_feature_contracts.py. Checked-in artifacts change only when generated output changes intentionally.

Invariants

  • Supported CLI flags, compatibility commands, route selection, exit statuses, and user-facing command output must remain stable unless a task explicitly requires a compatibility-preserving update.
  • .envctl-state artifact schemas, startup logs, debug reports, runtime readiness files, and state repository models are persistent contracts.
  • Prompt installation behavior and plan-agent launch semantics are contracts across Codex, OpenCode, cmux, tmux, omx, ULW, headless, new-session, and direct-prompt paths.
  • Generated contract artifacts are maintained by their generator scripts; update checked-in JSON only after comparing generated output.
  • Generated worktree setup must stay confined to the current checkout or generated worktree targets. Do not mutate sibling worktrees as a side effect of planning changes.
  • Serena is the symbol navigation tool for exact definitions, references, and diagnostics. CGC context Envctl is for broad repo graph analysis. Literal strings and docs/config text can use native search.

How To Change Areas

  • Runtime: add or move behavior into a focused runtime/engine_runtime_*_support.py owner, use runtime/engine_runtime_construction.py for object graph setup, runtime/command_alias_catalog.py for command aliases and supported-command inventory, runtime/command_flag_catalog.py for supported flag/mode/env-token registries, runtime/command_catalog_registry.py for catalog uniqueness validation, runtime/command_catalog.py for compatibility exports, runtime/command_models.py for route models/errors, runtime/command_flag_storage.py for flag value/pair storage mappings, runtime/command_special_flags.py for special runtime flags, env-style assignments, default route policies, and plan-agent option validation, runtime/startup_inspection_support.py for startup explanation, preflight payloads, plan selection previews, and additional-service inspection warnings, runtime/browser_env_preview.py for browser-safe env preview/redaction, runtime/browser_cors_diagnostics.py for CORS projection and mismatch warnings, runtime/browser_runtime_diagnostics.py for persisted run-state diagnostics, runtime/browser_startup_projection.py for explain-startup env projection, runtime/browser_diagnostics.py for compatibility exports, runtime/help_metadata.py for command-family ordering/default interactivity, runtime/help_general.py for top-level help rendering, runtime/help_topic_lifecycle.py, runtime/help_topic_planning.py, runtime/help_topic_actions.py, runtime/help_topic_inspection.py, and runtime/help_topic_maintenance.py for command-family help catalog data, runtime/help_topic_catalog.py for aggregate compatibility exports, runtime/help_topic_rendering.py for topic model/rendering, runtime/help_topics.py for command-help compatibility exports and route lookup, runtime/utility_command_support.py for utility command table dispatch, runtime/lifecycle_blast_support.py for blast-all ecosystem cleanup, runtime/engine_runtime_dependency_env.py for dependency env projection, scoped launch-env templates, service source aliases, and service env overlays, runtime/service_truth_diagnostics.py, runtime/service_listener_truth.py, runtime/service_status_truth.py, and runtime/service_post_start_truth.py for service truth ownership, runtime/engine_runtime_planning_facade.py and runtime/engine_runtime_startup_facade.py for compatibility wrapper groups, runtime/engine_runtime_service_facade.py for service/env/hook/command wrappers, runtime/engine_runtime_action_facade.py for action command wrappers, runtime/engine_runtime_cli_facade.py for CLI command wrappers and hook migration, runtime/engine_runtime_debug_facade.py for debug command wrappers, runtime/engine_runtime_doctor_facade.py for doctor/readiness/release-gate wrappers, runtime/engine_runtime_lifecycle_facade.py for cleanup/lifecycle wrappers, and runtime/engine_runtime_truth_facade.py for state/service truth wrappers, then keep PythonEngineRuntime as a thin facade and run runtime dispatch/contract tests.
  • Configuration: keep envctl_engine.config as the import-compatible facade; move cohesive parsing/rendering/load domains into config/* owners when they exceed config-model/load responsibility. Typed config contracts belong in config/models.py; loader-only dependency inference, startup profile construction, runtime scope IDs, path resolution, plan-agent aliases, and mode parsing belong in config/load_support.py; command, directory, and frontend test-path default resolution belongs in config/command_defaults.py; default values and managed-key lists belong in config/defaults.py; .envctl/legacy source discovery, generated-worktree parent config root resolution, and envctl text parsing belong in config/source_discovery.py; additional-service and Supabase Auth user parsers belong in config/service_parsing.py; dependency env template markers, legacy upgrade handling, and template section stripping belong in config/dependency_env_templates.py; managed config value conversion and validation belong in config/persistence_values.py; config payload hydration belongs in config/persistence_payload.py; managed block rendering and review text belong in config/persistence_rendering.py; save/ignore policy remains in config/persistence.py.
  • Startup: extract lifecycle phases behind narrow inputs and result objects while preserving StartupOrchestrator.execute as the readable sequence; keep resume/restore route, reuse, context, and port policy in startup/resume_restore_policy.py, stale restore coordination in startup/resume_restore_execution.py, per-project restore execution in startup/resume_restore_project.py, and restore state/timing result application in startup/resume_restore_results.py; keep backend migration/bootstrap helpers in startup/service_backend_migration_support.py; keep service env-file and backend env-contract behavior in startup/service_env_support.py, runtime prep cache/fingerprint behavior in startup/service_runtime_state_support.py, frontend bootstrap/dependency-install behavior in startup/service_frontend_bootstrap_support.py, and service_bootstrap_domain.py as the compatibility facade.
  • Actions: route each action through action-owned helpers; keep ActionCommandOrchestrator as the compatibility entry point, use action_command_test_facade.py and action_command_project_facade.py for compatibility wrapper groups, keep project-action compatibility wrappers in project_action_domain.py, and split tests by action behavior. Commit staging/push belongs in action_commit_support.py; commit message resolution and commit-ledger behavior belongs in action_commit_message_support.py; git root/default-branch/dirty-worktree/PR URL probes belong in action_git_state_support.py; commit/PR/ship/review workflow dependency bundles and action runner methods belong in project_action_workflows.py; project-action workflow runner construction and compatibility dependency adapters belong in project_action_workflow_factory.py; migrate requirement/context projection belongs in action_migrate_context_support.py; migrate failure headline and hint summarization belongs in action_migrate_failure_support.py; migrate result collection/rendering belongs in action_migrate_result_support.py; action_migrate_support.py keeps compatibility exports; PR creation sequencing belongs in action_pr_workflow_support.py; review artifact path/text helpers belong in action_review_artifact_support.py; review/analyze original-plan behavior belongs in action_review_original_plan_support.py; review-base behavior belongs in action_review_base_support.py; analyze iteration/output/helper execution belongs in action_review_iteration_support.py; action_review_plan_support.py keeps the compatibility exports; review action control flow and fallback summary writing belongs in action_review_workflow_support.py; output rendering/stat pruning belongs in action_review_output_support.py; ship workflow sequencing belongs in action_ship_support.py; ship output/result contract behavior belongs in action_ship_contract.py; ship merge-conflict reporting belongs in action_ship_conflicts.py; ship GitHub check probing/normalization belongs in action_ship_checks.py; configured/default test execution-spec construction, backend Python command normalization, and legacy tree test-script detection belong in action_test_command_support.py; failed-only rerun execution-spec construction belongs in action_failed_test_spec_support.py; test execution-spec planning belongs in action_test_plan_support.py; test status rendering belongs in action_test_status_support.py; parallel execution and suite-spinner policy belongs in action_test_policy_support.py; test action execution and suite-policy announcements belong in action_test_execution_support.py; per-suite execution, runner callback wiring, outcome collection, and interrupt cleanup belong in action_test_suite_execution_support.py; sequential/parallel suite scheduling belongs in action_test_suite_run_loop.py; suite status/summary/finish presentation belongs in action_test_suite_presentation.py; rich test-suite row spinner behavior belongs in action_test_spinner_support.py; per-suite live progress and parallel progress state/rendering belongs in action_test_runner_progress.py; test interrupt process cleanup belongs in action_test_interrupt_support.py; failed-test manifest parsing and selector validation belongs in action_test_manifest_support.py.
  • Ship workflow: keep the public run_ship_workflow as a compatibility wrapper, keep injected collaborators grouped in ShipWorkflowDependencies, keep phase sequencing and shared phase state in ShipWorkflowRunner/ShipWorkflowState, and keep payload, conflict, and GitHub-check contracts in their existing owner modules.
  • State actions: keep StateActionOrchestrator as the public facade; move state-action command flow into state/action_command_support.py, reusable log/error payload behavior into state/action_log_support.py, reusable health payload/row/rendering behavior into state/action_health_support.py, and preserve legacy private wrappers on the facade for hidden tests and CLI compatibility.
  • Planning and worktrees: keep caller-facing helpers stable first, move cohesive internals into planning-owned modules, and preserve fresh AI worktree safety checks. Path/root/target-token behavior belongs in worktree_path_support.py; terminal planning-menu rendering/key adapters belong in worktree_menu_terminal_support.py; setup and sync spinner output belongs in worktree_spinner_support.py.
  • Transports: share launch vocabulary through planning/plan_agent/models.py and helper modules; keep transport-specific process/session behavior in the transport modules.
  • Requirements: split adapters behind stable adapter APIs. Shared adapter helpers belong in lifecycle model, policy, cleanup, external dependency, or outcome owners rather than broad facades. Supabase should be decomposed by configuration, lifecycle, readiness, database setup, auth users, repair, and reporting.
  • Dashboard and Textual UI: keep orchestration, rendering, dashboard snapshot projection/accounting, service row/status/configured/stopped-service rendering, AI session/run-command row resolution, dependency rendering/scope inference, PR-link root resolution/lookup/caching, backend resolution, interactive command dispatch, terminal input/dialog/session helpers, dashboard command availability, failure details, stop/restart selectors, PR/review-tab flow, target/service/test-scope selection, and service-catalog projection separate. Keep interactive command dispatch and hidden-command policy in ui/dashboard/command_support.py; keep terminal input, text dialogs, command parsing wrappers, repo-root lookup, and session-kill helpers in ui/dashboard/command_input_support.py; keep command-line fallback/basic input orchestration in ui/terminal_command_readers.py; keep byte-level terminal stream buffering and escape parsing in ui/terminal_input_stream.py, with terminal mode restoration in ui/terminal_tty_modes.py and compatibility wrappers in ui/terminal_session.py. Keep backend selector handoff coordination in ui/backend_selector_support.py, selector debug telemetry in ui/backend_selector_debug.py, selector subprocess payload/result handling in ui/backend_selector_subprocess.py, and selector env/TTY/preflight primitives in ui/backend_selector_tty.py. Keep planning selector row normalization, render-entry text, status/result policy, filter visibility, and count toggling in ui/textual/screens/planning_selector_model.py. Keep Textual selector backend/env/debug policy in ui/textual/screens/selector/backend_policy.py; keep selector FD/termios/pending-byte probing in ui/textual/screens/selector/io_probe.py; keep selector nonblocking read guards in ui/textual/screens/selector/read_guard.py; keep Textual parser/select/read instrumentation in ui/textual/screens/selector/textual_driver_instrumentation.py; keep prompt-toolkit posix IO instrumentation in ui/textual/screens/selector/prompt_toolkit_io_instrumentation.py; keep selector row/filter visibility/selection/submit/fallback state policy in ui/textual/screens/selector/selection_state.py; keep selector top-level and filter-focused key decisions in ui/textual/screens/selector/textual_key_policy.py; keep selector app key-trace payload emission in ui/textual/screens/selector/textual_app_key_trace.py; keep selector focus routing, list/filter/button focus handoff, focus-order cycling, and focus telemetry in ui/textual/screens/selector/textual_app_focus_actions.py; keep selector key-action dispatch, raw/event key tracing, filter key recovery, submit suppression, and slash-focus handling in ui/textual/screens/selector/textual_app_key_actions.py; keep selector initial-navigation replay in ui/textual/screens/selector/textual_app_initial_navigation.py; keep selector keyboard navigation, single-select focus synchronization, edge hints, escape recovery, and navigation key debug handoff in ui/textual/screens/selector/textual_app_navigation_actions.py; keep selector selection-action event emission, toggle/select orchestration, list-selection handling, and row-click model-index parsing in ui/textual/screens/selector/textual_app_selection_actions.py; keep selector key counters, idle snapshots, and driver telemetry in ui/textual/screens/selector/textual_key_telemetry.py; keep Textual config wizard action factory construction in ui/textual/screens/config_wizard_action_bundle.py; keep component rows and selected-state projection in ui/textual/screens/config_wizard_components.py; keep component list navigation, default-mode focus sync, component/service-startup toggles, split-row availability, and list-selection dispatch in ui/textual/screens/config_wizard_component_actions.py; keep body visibility, welcome/empty/review copy, and visible-field synchronization in ui/textual/screens/config_wizard_body_actions.py; keep key-action resolution and primitive list cursor policy in ui/textual/screens/config_wizard_navigation.py; keep field metadata, ID helpers, additional-service form parsing, visible field rules, and value hydration in ui/textual/screens/config_wizard_fields.py; keep form widget synchronization, validation display, focus-on-error behavior, and validated text/port/additional-service application in ui/textual/screens/config_wizard_form.py; keep hint/directory-validation policy in ui/textual/screens/config_wizard_hints.py; keep wizard CSS and static widget composition in ui/textual/screens/config_wizard_layout.py; keep suggestion discovery/cycling/event payload policy in ui/textual/screens/config_wizard_suggestions.py; keep focused suggestion-field detection, accepted-suggestion mutation, accepted-suggestion telemetry, and suggestion action availability in ui/textual/screens/config_wizard_suggestion_actions.py; keep wizard back/next/submit flow, validation gates, final save/exit handoff, and list-selection suppression in ui/textual/screens/config_wizard_flow_actions.py; keep step-specific focus routing in ui/textual/screens/config_wizard_focus_actions.py; keep field value lookup and validated text/port mutation policy in ui/textual/screens/config_wizard_values.py; keep wizard status copy, validation-status derivation, action-button policy, list-row rendering, and step sequencing in ui/textual/screens/config_wizard_status.py, ui/textual/screens/config_wizard_list_rendering.py, and ui/textual/screens/config_wizard_step_flow.py; the screen modules should remain app/runtime owners. Protect each owner with focused UI tests and keep DashboardOrchestrator and selector package wrappers for compatibility callers.

Test Ownership

  • Runtime startup regression coverage is split by lifecycle owner: core startup, env-file projection, migration/bootstrap, service rebound, plan launch, plan resume, plan selection, plan parallelism, requirements, external requirements, interactive startup, resume, and setup-worktree flows. Shared startup fixtures live in tests/python/runtime/engine_runtime_real_startup_test_support.py.
  • Startup orchestrator flow coverage is split by phase owner: disabled dashboard-state flows, plan-agent handoff/degradation, startup failure finalization, run reuse/expand, and plan-agent dependency bootstrap. Shared startup flow fixtures live in tests/python/startup/startup_orchestrator_flow_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Startup spinner/restart integration coverage is split by behavior owner: spinner display and policy, parallel progress, restart port preservation, restart service scoping and dependency preservation, fingerprint replacement, and dashboard stopped-service restore. Shared fixtures live in tests/python/startup/startup_spinner_integration_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Service bootstrap coverage is split by behavior owner: test_service_env_support.py covers env-file resolution, backend env contracts, sensitive env scrubbing, and launch env projection; test_service_runtime_state_support.py covers runtime prep cache/fingerprint and backend dependency state decisions; test_service_frontend_bootstrap_support.py covers frontend dependency probing, install command selection, and prepare sequencing; test_service_bootstrap_domain.py covers backend bootstrap command orchestration and migration command handling.
  • Runtime command parity coverage is split by command owner: doctor/readiness, facade delegates, help/inventory, startup explanation and plan-agent previews, and state/config commands. Direct help metadata, top-level rendering, and command-topic rendering coverage lives in tests/python/runtime/test_help_metadata.py, tests/python/runtime/test_help_general.py, and tests/python/runtime/test_help_topics.py. Shared command-parity fixtures live in tests/python/runtime/engine_runtime_command_parity_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Runtime environment coverage is split by behavior owner: mode/route validation, service environment projection, external dependency auto-detection, dependency env templates/overlays, and readiness/profile enablement. Dependency/service env projection logic lives in runtime/engine_runtime_dependency_env.py and stays covered by test_engine_runtime_env_service_projection.py and test_engine_runtime_env_templates.py. Shared runtime-env fixtures live in tests/python/runtime/engine_runtime_env_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Prompt install support production code and coverage are split by behavior owner: install command flow, target path/home resolution, template registry/rendering contracts, Codex skill writes, and direct-prompt resolution. The public runtime/prompt_install_support.py module remains as a compatibility re-export facade only. Shared prompt-install fixtures live in tests/python/runtime/prompt_install_support_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Plan-agent launch coverage is split by transport and workflow owner: launch prerequisite/transport/prompt/cycles/new-session option matrices, cmux/Codex goal activation, cmux cycle queueing, cmux workspace flow/configured/default/created-workspace selection, cmux review-agent launch, tmux launch flow/existing-session/identity-window/workflow-queue/readiness behavior, tmux launch orchestration, tmux identity/session handling, OMX launch orchestration, omx config resolution, omx workflow wrapping, omx attach discovery/validation, omx attach flow/discovery, omx spawn diagnostics/env handling, Superset launch, terminal readiness parsing, workflow construction, direct-prompt shaping/runtime address injection, queued prompt readiness, and tab-title formatting. Shared launch fixtures live in tests/python/planning/plan_agent_launch_support_test_support.py; obsolete broad transport/workflow breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Planning worktree setup coverage is split by owner: plan selection/sync, worktree creation flow, plan archival, provenance, path/root/selection-target parsing, planning terminal-menu adapters, code-intelligence bootstrap and owner modules, git-hook and recovery behavior, fresh-AI protection, and spinner lifecycle. Direct code-intelligence owner coverage lives in tests/python/planning/test_worktree_code_intelligence_owners.py; direct creation-flow coverage lives in tests/python/planning/test_worktree_creation_flow.py. Shared setup fixtures live in tests/python/planning/planning_worktree_setup_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Runtime lifecycle parity coverage is split by behavior owner: blast/cleanup, mode-scoped restart/start policy, resume policy, restore startup execution, legacy/skip-startup resume paths, state-action lookup, and stop/health handling. Direct blast owner coverage lives in tests/python/runtime/test_lifecycle_blast_support.py; shared lifecycle fixtures live in tests/python/runtime/lifecycle_parity_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Action CLI coverage is split by behavior owner: ship/status handoff, PR creation/update, commit ledger/protected-artifact policy, git-state probes, review/analyze artifact paths, original-plan and review-base selection, analyze-helper invocation, review workflow fallback summaries, and review-completion output rendering. Shared action CLI fixtures live in tests/python/actions/actions_cli_test_support.py; direct owner coverage for commit workflow and ledger handling lives in tests/python/actions/test_action_commit_support.py; direct owner coverage for git-state helpers lives in tests/python/actions/test_action_git_state_support.py; direct owner coverage for PR workflow orchestration lives in tests/python/actions/test_action_pr_workflow_support.py; direct owner coverage for review artifact helpers lives in tests/python/actions/test_action_review_artifact_support.py; direct owner coverage for review original-plan helpers lives in tests/python/actions/test_action_review_original_plan_support.py; direct owner coverage for review-base helpers lives in tests/python/actions/test_action_review_base_support.py; direct owner coverage for review iteration/helper execution lives in tests/python/actions/test_action_review_iteration_support.py; compatibility coverage for review/analyze planning lives in tests/python/actions/test_action_review_plan_support.py; direct owner coverage for review action orchestration lives in tests/python/actions/test_action_review_workflow_support.py; direct owner coverage for ship workflow status handling lives in tests/python/actions/test_action_ship_support.py, with conflict/check/result owner coverage in tests/python/actions/test_action_ship_owner_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Action parity coverage is split by action owner: core actions, git, migrate env contracts, migrate reporting, failed backend reruns, failed frontend reruns, failed-rerun validation/state, test discovery, execution, failure summaries, bootstrap, parallel execution, interrupts, spinner behavior, flags, service scope, and worktree actions. Direct test planning compatibility coverage lives in tests/python/actions/test_action_test_plan_support.py; direct test status rendering coverage lives in tests/python/actions/test_action_test_status_support.py; direct test policy coverage lives in tests/python/actions/test_action_test_policy_support.py; direct test execution-plan owner coverage lives in tests/python/actions/test_action_test_execution_support.py; direct suite run-loop coverage lives in tests/python/actions/test_action_test_suite_run_loop.py; direct suite presentation coverage lives in tests/python/actions/test_action_test_suite_presentation.py; suite execution behavior is protected by focused execution parity suites and the suite-spinner policy regression in tests/python/actions/test_actions_test_execution_parity.py; direct interrupt owner coverage lives in tests/python/actions/test_action_test_interrupt_support.py; direct parallel progress owner coverage lives in tests/python/actions/test_action_test_runner_progress.py; shared action parity fixtures live in tests/python/actions/actions_parity_test_support.py.
  • Dashboard orchestrator coverage is split by behavior owner: command input/dialog/session helpers, interactive command dispatch, restart basic selection/resources/configured-missing behavior, stop scope, PR-flow selection, PR message prompts, dirty-target preflight, project-action failure details, target shortcuts/single-project/tree/service-scope/return-flow selection, failure details, and review-tab launch. Shared dashboard fixtures live in tests/python/ui/dashboard_orchestrator_test_support.py; direct command-input owner coverage lives in tests/python/ui/test_dashboard_command_input_support.py; obsolete broad restart-selector, target-selection, and PR-flow breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Dashboard rendering parity coverage is split by display owner: snapshot projection/accounting, service rows/status/configured/stopped-service rows, dependency rows/shared dependency grouping and visual host rewriting, AI session/run-command rows, and output links/PR metadata. Direct snapshot owner coverage lives in tests/python/ui/test_dashboard_snapshot_support.py; direct service owner coverage lives in tests/python/ui/test_dashboard_service_rendering.py; direct dependency owner coverage lives in tests/python/ui/test_dashboard_dependency_rendering.py; direct PR-link owner coverage lives in tests/python/ui/test_dashboard_pr_link_rendering.py; direct AI-session owner coverage lives in tests/python/ui/test_dashboard_ai_session_rendering.py; shared rendering fixtures live in tests/python/ui/dashboard_rendering_parity_test_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.
  • Requirement adapter contract coverage is split by adapter and Supabase lifecycle owner: postgres, redis, n8n, Supabase compose, Supabase native DB behavior, and Supabase stack core, network recovery, DB probe recovery, Auth/Kong recovery, and handoff/timeout behavior. Shared fake process runners live in tests/python/requirements/requirements_adapter_contract_support.py; obsolete omnibus breadcrumbs were removed so focused owner suites are the only runnable paths.