Skip to content

Migrate build publish and materialize scripts onto shared Python tooling helpers #8126

@doublemover

Description

@doublemover

Parent inventory: #8108
Blocked by: #8119, #8120, #8123, #8124

Objective

Migrate build, publish, and materialize scripts onto shared Python tooling helpers without introducing a publisher framework.

Shared Module Specification

  • Migrate repeated path, JSON IO, text/JSON write, subprocess, timed-step, Markdown, summary, and output-writing helpers in scripts/build_*, scripts/publish_*, and scripts/materialize_*.
  • Keep report-specific schema construction local.
  • Preserve generated artifact paths, report schemas, and public Markdown content unless intentionally fixing a validated bug.
  • Prefer readability over maximum abstraction.

Migration Checklist

  • Migrate file/path/JSON helpers first.
  • Migrate command-result helpers second.
  • Migrate Markdown/report primitives third.
  • Migrate parser option groups only where concrete and identical.
  • Run changed scripts in batches and compare durable output shape where practical.

Inventory

  • Replacement scope is every matching helper occurrence from the Python inventories in the path/JSON, subprocess, report, and CLI-option issues that lives in scripts/build_*, scripts/publish_*, or scripts/materialize_*.
  • High-risk helper groups: write_text, write_json, render_markdown, render_markdown_report, build_summary, build_summary_payload, write_outputs, run_step, and ensure_success.

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

  • Run python -m py_compile for every changed build/publish/materialize script.
  • Run focused scripts that write JSON and Markdown artifacts.
  • Compare generated outputs for stable key ordering, newline policy, and path rendering.
  • Run affected npm/public workflow commands after migration batches.

End-To-End Completion Criteria

  • Build/publish/materialize scripts use shared primitives for generic work.
  • Report-specific logic remains local and readable.
  • Generated artifacts remain deterministic and schema-compatible.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions