Skip to content

Create Python subprocess timing helpers and migrate command wrappers #8120

@doublemover

Description

@doublemover

Parent inventory: #8108
Blocked by: #8119

Objective

Centralize subprocess execution helpers so command running, timing, diagnostics, encoding, and failure handling are consistent.

Shared Module Specification

  • Add scripts/objc3c_tooling/subprocesses.py.
  • Expose a structured command result with command, cwd, return code, stdout, stderr, duration, and optional timed-step metadata.
  • Support timeouts, cwd, environment overlays, UTF-8 decoding policy, stdout/stderr echo control, and bounded failure snippets.
  • Preserve call sites that need raw subprocess.CompletedProcess[str] or migrate them carefully.
  • Avoid global logging frameworks.

Migration Checklist

  • Migrate exact run_capture duplicates first.
  • Migrate run_command and run only where return-shape semantics match.
  • Migrate run_step to structured duration records where schemas match.
  • Migrate ensure_success while preserving required message text.
  • Keep accumulated-failure workflows distinct from immediate-raise workflows.

Complete Replacement Inventory

  • run_capture - 63 definition(s)/local occurrence(s) to replace or explicitly document as intentionally local if semantics differ.
    • scripts/benchmark_objc3c_performance.py:55
    • scripts/build_objc3c_distribution_credibility_dashboard.py:50
    • scripts/build_objc3c_security_posture.py:40
    • scripts/check_getting_started_integration.py:34
    • scripts/check_getting_started_surface.py:33
    • scripts/check_objc3c_application_architecture_integration.py:30
    • scripts/check_objc3c_bonus_experience_integration.py:26
    • scripts/check_objc3c_compiler_throughput_integration.py:25
    • scripts/check_objc3c_conformance_corpus_integration.py:28
    • scripts/check_objc3c_distribution_credibility_end_to_end.py:33
    • scripts/check_objc3c_packaging_channels_end_to_end.py:35
    • scripts/check_objc3c_performance_governance_end_to_end.py:32
    • scripts/check_objc3c_performance_integration.py:26
    • scripts/check_objc3c_public_conformance_reporting_end_to_end.py:32
    • scripts/check_objc3c_release_operations_end_to_end.py:31
    • scripts/check_objc3c_runnable_application_architecture_end_to_end.py:25
    • scripts/check_objc3c_runnable_block_arc_conformance.py:54
    • scripts/check_objc3c_runnable_block_arc_end_to_end.py:38
    • scripts/check_objc3c_runnable_bonus_experience_end_to_end.py:37
    • scripts/check_objc3c_runnable_bootstrap_end_to_end.py:37
    • scripts/check_objc3c_runnable_compiler_throughput_end_to_end.py:36
    • scripts/check_objc3c_runnable_concurrency_conformance.py:59
    • scripts/check_objc3c_runnable_concurrency_end_to_end.py:38
    • scripts/check_objc3c_runnable_conformance_corpus_end_to_end.py:36
    • scripts/check_objc3c_runnable_developer_tooling_end_to_end.py:38
    • scripts/check_objc3c_runnable_error_conformance.py:57
    • scripts/check_objc3c_runnable_error_end_to_end.py:38
    • scripts/check_objc3c_runnable_interop_end_to_end.py:38
    • scripts/check_objc3c_runnable_metaprogramming_conformance.py:74
    • scripts/check_objc3c_runnable_metaprogramming_end_to_end.py:38
    • scripts/check_objc3c_runnable_object_model_conformance.py:102
    • scripts/check_objc3c_runnable_object_model_end_to_end.py:38
    • scripts/check_objc3c_runnable_package_ecosystem_end_to_end.py:25
    • scripts/check_objc3c_runnable_performance_end_to_end.py:37
    • scripts/check_objc3c_runnable_release_candidate_end_to_end.py:40
    • scripts/check_objc3c_runnable_runtime_performance_end_to_end.py:36
    • scripts/check_objc3c_runnable_showcase_end_to_end.py:37
    • scripts/check_objc3c_runnable_stdlib_advanced_end_to_end.py:36
    • scripts/check_objc3c_runnable_stdlib_foundation_end_to_end.py:36
    • scripts/check_objc3c_runnable_stdlib_program_end_to_end.py:27
    • scripts/check_objc3c_runnable_storage_reflection_conformance.py:50
    • scripts/check_objc3c_runnable_storage_reflection_end_to_end.py:38
    • scripts/check_objc3c_runtime_architecture_integration.py:103
    • scripts/check_objc3c_runtime_architecture_proof_packet.py:92
    • scripts/check_objc3c_runtime_performance_integration.py:26
    • scripts/check_objc3c_stdlib_advanced_integration.py:28
    • scripts/check_objc3c_stdlib_foundation_integration.py:28
    • scripts/check_objc3c_stdlib_program_integration.py:33
    • scripts/check_platform_hardening_build_package_validation.py:30
    • scripts/check_security_hardening_response_drill.py:43
    • scripts/check_security_hardening_runtime_hardening.py:41
    • scripts/check_showcase_integration.py:36
    • scripts/objc3c_public_workflow_runner.py:217
    • scripts/publish_objc3c_distribution_trust_report.py:34
    • scripts/publish_objc3c_external_repro_corpus.py:37
    • scripts/publish_objc3c_performance_report.py:34
    • scripts/publish_objc3c_public_conformance_report.py:34
    • scripts/publish_objc3c_security_advisories.py:28
    • scripts/run_objc3c_comparative_baselines.py:53
    • scripts/run_objc3c_external_validation_replay.py:40
    • scripts/run_objc3c_lowering_runtime_stress.py:38
    • scripts/run_objc3c_stdlib_workspace_smoke.py:26
    • scripts/shared_compiler_runtime_acceptance_harness.py:652
  • run_command - 10 definition(s)/local occurrence(s) to replace or explicitly document as intentionally local if semantics differ.
    • scripts/build_governance_extension_review_workflow_summary.py:35
    • scripts/build_runtime_corrective_acceptance_workload_summary.py:23
    • scripts/check_governance_sustainability_closeout_gate.py:149
    • scripts/check_objc3c_library_cli_parity.py:697
    • scripts/check_runtime_corrective_closeout_gate.py:57
    • scripts/check_source_hygiene_authenticity.py:26
    • scripts/probe_objc3c_llvm_capabilities.py:49
    • scripts/run_activation_preflight.py:218
    • scripts/run_bootstrap_readiness.py:87
    • scripts/run_open_blocker_audit.py:330
  • run - 13 definition(s)/local occurrence(s) to replace or explicitly document as intentionally local if semantics differ.
    • scripts/build_objc3c_package_channels.py:48
    • scripts/build_objc3c_release_manifest.py:51
    • scripts/build_objc3c_update_manifest.py:41
    • scripts/check_objc3c_dependency_boundaries.py:204
    • scripts/check_objc3c_library_cli_parity.py:929
    • scripts/check_objc3c_runtime_acceptance.py:871
    • scripts/check_platform_hardening_install_matrix_integration.py:27
    • scripts/check_platform_hardening_toolchain_range_replay.py:35
    • scripts/check_showcase_surface.py:29
    • scripts/merge_objc3_runtime_metadata_linker_artifacts.py:124
    • scripts/objc3c_public_workflow_runner.py:211
    • scripts/probe_objc3c_llvm_capabilities.py:271
    • scripts/publish_release_runtime_claim_matrix.py:31
  • run_step - 12 definition(s)/local occurrence(s) to replace or explicitly document as intentionally local if semantics differ.
    • scripts/benchmark_objc3c_runtime_inspector.py:50
    • scripts/build_long_horizon_operations_migration_rollback_summary.py:33
    • scripts/build_objc3c_adoption_legibility_evidence.py:51
    • scripts/build_objc3c_long_horizon_operations_evidence.py:62
    • scripts/check_application_architecture_template_harness.py:31
    • scripts/check_objc3c_developer_tooling_integration.py:20
    • scripts/check_objc3c_governance_sustainability_integration.py:82
    • scripts/check_objc3c_package_ecosystem_integration.py:32
    • scripts/check_objc3c_platform_hardening_integration.py:35
    • scripts/check_objc3c_runnable_platform_hardening_end_to_end.py:36
    • scripts/check_security_hardening_supply_chain_audit.py:39
    • scripts/materialize_objc3c_project_template.py:64
  • ensure_success - 5 definition(s)/local occurrence(s) to replace or explicitly document as intentionally local if semantics differ.
    • scripts/build_objc3c_security_posture.py:56
    • scripts/publish_objc3c_distribution_trust_report.py:50
    • scripts/publish_objc3c_performance_report.py:56
    • scripts/publish_objc3c_public_conformance_report.py:56
    • scripts/publish_release_runtime_claim_matrix.py:71

Performance And Reliability Requirements

  • Keep helper code small, dependency-light, and fast enough for normal development feedback.
  • Add focused tests for edge cases before broad migration.
  • Preserve existing output schemas and public behavior unless an intentional bug fix is validated.
  • Keep production helpers separated from test-only helpers.
  • Do not use tmp/ as durable source-of-truth; generated temporary files are allowed only as transient command inputs.

Fast Tests

  • Add tests for success, nonzero exit, timeout, cwd handling, env overlay, stdout/stderr capture, and bounded diagnostics.
  • Run focused tests for scripts that publish command result summaries.
  • Run python -m py_compile for changed modules/scripts.
  • Run affected npm/script validation batches.

End-To-End Completion Criteria

  • Command execution behavior is consistent across migrated scripts.
  • Failure output remains actionable without flooding logs.
  • Each migrated timed step records duration accurately enough for slow-test diagnosis.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions