schema_version: runtime-execution-policy-matrix-v1
chunk: "000267"
title: Runtime Execution Plan / Parallelism Policy Audit
generated_at: "2026-05-18T23:43:00.000Z"
source: runtime-concurrency-registry-and-runtime-execution-plan
status: implementation_input
authority_boundary: "Planning artifact only; does not mutate lifecycle, approval, dispatcher, close/commit, lease, or service authority."
canonical_inputs:
  - ai/governance/registries/runtime-concurrency.yaml
  - ai/governance/registries/work-registration-policy.yaml
  - ai/governance/registries/validation-matrix.yaml
  - node ai/runtime/dist/cli.js runtime execution-plan --json
  - node ai/runtime/dist/cli.js runtime parallelism --json
principles:
  - Runtime/Node owns validation, service, restart, work-registration, liveness, journal, and scheduling truth.
  - Shell remains bootstrap, emergency, or thin facade only.
  - Runtime work registration is required for meaningful work and remains the single work truth.
  - Runtime/GraphQL snapshot is canonical UI truth; Socket.IO remains invalidation-only.
  - Read-only inspection may run in parallel; authority, service, lifecycle, and shared-state mutation must serialize by lock/lease.
current_registry_summary:
  readonly_parallel:
    - validate
  singleton_or_exclusive:
    - lifecycle_transition
    - close_commit
    - approval_creation
    - summary_reconciliation
    - runtime_build_activation
    - daemon_restart
    - timeline_archive
    - audit_archive
    - consultant_response_import
    - consultant_recommendation_record
  transport_adapter:
    - telegram_transport
matrix:
  - operation: read_only_repo_inspection
    role: Orchestrator | Developer | QA | Runtime Executor
    resources_touched: [workspace_files]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: false
    service_restart_required: false
    can_run_parallel: true
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: true
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: prompt_intent_or_existing_work
    notes: "Read-only commands should still be visible through prompt/tool intent, but do not need exclusive scheduling."
  - operation: requirements_or_planning_artifact_edit
    role: Requirements | Requirements Review | Prompt Synthesizer | Orchestrator | Chunk Planner
    resources_touched: [ai_requirements, ai_chunks, ai_work_packages, ai_reports]
    mutates_authority_state: false
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: true
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: required
    notes: "Planning roles must register work before creating or editing durable workflow artifacts."
  - operation: implementation_file_edit
    role: Developer
    resources_touched: [workspace_files, git_worktree]
    mutates_authority_state: false
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: conditional
    can_run_parallel: conditional
    must_serialize_per_chunk: true
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: conditional
    blocks_reload: "true when editing Runtime source until build/reload completes"
    allowed_in_fail_fast_mode: true
    required_registration: required
    notes: "Parallel implementation is safe only for disjoint files/resources; Runtime source edits create reload-required scheduling input."
  - operation: codex_hook_pretool_meaningful_action
    role: Codex | evidence-backed Runtime role
    resources_touched: [runtime_work_registration_state, runtime_state_journal]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: true
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: true
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: "preflight registers or fails according to policy"
    notes: "Hooks are lightweight triggers into the existing work model, not a second scheduler."
  - operation: summary_validation
    role: Runtime Executor
    resources_touched: [chunk_summary, runtime_summary_schema]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: true
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    notes: "May run with other read-only validation when daemon is fresh."
  - operation: governance_validation
    role: Runtime Executor
    resources_touched: [governance_registries, runtime_source_read]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: true
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    notes: "Read-only, but depends on fresh Runtime build when Runtime source changed."
  - operation: runtime_full_validation
    role: Runtime Executor
    resources_touched: [validation_graph, runtime_generation, runtime_state]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: true
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    current_registry_operation: validate
  - operation: backend_tests
    role: Developer | QA
    resources_touched: [backend_build_artifacts, test_database_optional]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: conditional
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: "only for database-backed e2e"
    safe_during_runtime_reload: true
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: required
    notes: "Unit tests can parallelize; database e2e must serialize on the configured test database."
  - operation: frontend_tests
    role: Developer | QA
    resources_touched: [frontend_build_artifacts, browser_test_runtime_optional]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: conditional
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: "only for shared browser/dev-server proof"
    safe_during_runtime_reload: true
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: required
    notes: "Pure frontend tests are parallel-safe; browser proof uses shared ports and must be scheduled."
  - operation: browser_smoke_or_action_panel_proof
    role: QA
    resources_touched: [frontend_dev_server, backend_api, runtime_api, browser_context]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: conditional
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: true
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: true
    required_registration: required_qa_evidence
    notes: "Required for user-visible live behavior and work-visibility chunks; do not run during reload or service resurrection."
  - operation: runtime_health_read_model_warm_refresh
    role: Runtime Executor
    resources_touched: [runtime_health_read_model, runtime_state_journal]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: false
    must_serialize_globally: true
    requires_lease: false
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: automatic_when_meaningful
    notes: "Controller already prevents overlapping refresh; it must not mask real degraded service state."
  - operation: bounded_maintenance_archive
    role: Runtime Executor
    resources_touched: [action_timeline, audit_index, archive_files]
    mutates_authority_state: false
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: false
    must_serialize_globally: true
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    current_registry_operations: [timeline_archive, audit_archive]
  - operation: runtime_build_activation
    role: Runtime Executor
    resources_touched: [runtime_source, immutable_generation, dist_symlink, build_manifest]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: false
    must_serialize_globally: true
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    current_registry_operation: runtime_build_activation
  - operation: runtime_api_reload_or_daemon_restart
    role: Runtime Supervisor
    resources_touched: [runtime_daemon, runtime_socket, active_generation, service_status]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: true
    can_run_parallel: false
    must_serialize_per_chunk: false
    must_serialize_globally: true
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
    current_registry_operation: daemon_restart
    notes: "Must use typed supervisor and verify generation before declaring success."
  - operation: service_supervisor_action
    role: Runtime Supervisor
    resources_touched: [service_process, service_status, service_fail_log]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: true
    can_run_parallel: false
    must_serialize_per_chunk: false
    must_serialize_globally: "per service target"
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: "true when target is runtime-api or shared dev server"
    allowed_in_fail_fast_mode: true
    required_registration: automatic_wrapper
  - operation: lifecycle_transition
    role: Runtime Executor
    resources_touched: [chunk_lifecycle, validation_state]
    mutates_authority_state: true
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: false
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: false
    required_registration: required
    current_registry_operation: lifecycle_transition
  - operation: approval_creation
    role: Runtime Executor
    resources_touched: [operator_question_state, approval_state]
    mutates_authority_state: false
    mutates_repo_files: false
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: false
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: false
    required_registration: required
    current_registry_operation: approval_creation
  - operation: close_commit_dispatcher
    role: Dispatcher
    resources_touched: [git_index, git_commit, chunk_lifecycle, dispatcher_state]
    mutates_authority_state: true
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: true
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: true
    allowed_in_fail_fast_mode: false
    required_registration: automatic_wrapper
    current_registry_operation: close_commit
  - operation: consultant_checkpoint_import_or_recommendation
    role: Consultant Checkpoint
    resources_touched: [consultant_checkpoint_state, consultant_reports]
    mutates_authority_state: false
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: conditional
    must_serialize_per_chunk: false
    must_serialize_globally: false
    requires_lease: true
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: required
    current_registry_operations: [consultant_response_import, consultant_recommendation_record]
  - operation: qa_review
    role: QA
    resources_touched: [chunk_artifact, validation_evidence, qa_evidence]
    mutates_authority_state: false
    mutates_repo_files: true
    mutates_runtime_state: true
    service_restart_required: false
    can_run_parallel: false
    must_serialize_per_chunk: true
    must_serialize_globally: false
    requires_lease: false
    safe_during_runtime_reload: false
    blocks_reload: false
    allowed_in_fail_fast_mode: true
    required_registration: required_qa_evidence
    notes: "QA must only be active when QA-specific evidence exists; self-checks must not mark QA active."
bottlenecks:
  - "The canonical registry currently exposes only validate as readonly_parallel; backend/frontend/browser/test phases need explicit scheduler rows before automated parallel execution."
  - "Singleton work-session projection can hide concurrent phase detail unless later chunks add per-phase queued/blocked projection or safely serialize."
  - "Runtime reload and browser proof both share user-visible services and must remain serialized until safe-point scheduling is implemented."
risks:
  - "Running browser proof during Runtime reload can create the service-unavailable/socket noise the operator observed."
  - "Raw shell test/validation commands can bypass work registration unless routed through wrappers or hook preflight."
  - "Dispatcher/close_commit parallelism must remain globally guarded because it mutates git and lifecycle authority."
next_scheduler_inputs:
  - chunk: "000268"
    input: "Hook preflight should consult this matrix for allowed/blocked reason vocabulary."
  - chunk: "000269"
    input: "Runtime reload scheduler should use blocks_reload and safe_during_runtime_reload fields as policy seed."
  - chunk: "000272"
    input: "Parallel validation planner should split read-only validation from shared browser/database/service phases."
  - chunk: "000273"
    input: "Action Panel should project queued/blocked/deferred work from Runtime scheduling truth."
