Skip to content

test: migrate Python golden harness to tryscript and harden port-prep specs#42

Merged
jlevy merged 8 commits intomasterfrom
codex/repren-python-prep-port-plan
Feb 28, 2026
Merged

test: migrate Python golden harness to tryscript and harden port-prep specs#42
jlevy merged 8 commits intomasterfrom
codex/repren-python-prep-port-plan

Conversation

@jlevy
Copy link
Owner

@jlevy jlevy commented Feb 27, 2026

Summary

This PR prepares repren as a high-fidelity source-of-truth for the Rust port by migrating the Python golden harness to tryscript and hardening the port-prep documentation/spec workflow.

Key Changes

  • Migrated golden integration tests from bash to tryscript:
    • removed legacy harness files: tests/run.sh, tests/golden-tests.sh, tests/golden-tests-expected.log
    • added modular suites under tests/tryscript/:
      • help-errors.tryscript.md
      • replacements.tryscript.md
      • renames-and-full.tryscript.md
      • patterns-and-case.tryscript.md
      • walk-and-filters.tryscript.md
      • backups-undo-clean.tryscript.md
      • json-output.tryscript.md
      • regex-wordbreaks.tryscript.md
  • Migrated fixtures from tests/work-dir to tests/tryscript/fixtures.
  • Added deterministic tryscript config at repo root:
    • tryscript.config.js
  • Added golden quality gate script:
    • scripts/check-golden-coverage.sh
    • enforces required module presence, key CLI flag coverage, and no bare ... elisions.
  • Updated project wiring:
    • Makefile: test-golden, test-golden-coverage, update-golden; make test now runs pytest + golden gate + tryscript
    • CI (.github/workflows/ci.yml): runs pytest, golden coverage gate, and tryscript
    • tests/pytests.py: integration test now runs tryscript suite
  • Added/updated planning artifacts for Rust parity prep:
    • new active migration spec for tryscript
    • rust-port prep spec/research updates and supersession annotations
    • synced/closed the associated tbd issue tree

Why

  • Golden sessions are now easier to review and maintain.
  • Behavior domains are explicit, making Python→Rust parity mapping straightforward.
  • Golden discipline is enforced with automated coverage/anti-pattern checks.

Validation

  • uv run python devtools/lint.py
  • uv run pytest
  • bash scripts/check-golden-coverage.sh
  • npx tryscript@latest run tests/tryscript/*.tryscript.md

All checks pass locally.

@jlevy jlevy merged commit 3056b53 into master Feb 28, 2026
5 checks passed
@jlevy jlevy deleted the codex/repren-python-prep-port-plan branch February 28, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant