Skip to content

T-T3QJ-retire-tests-parity-harness

Status: closed/done · Impact: low · Complexity: small

tests/parity/ is a finished Python→TypeScript migration-parity harness whose runner was deleted months ago. Its fixtures are orphaned — nothing in the test suite, quality_checks, lefthook, or CI loads them — yet six source-file comments still describe it as a live gate, which misleads readers and rots as the tree moves. Delete the directory and the stale references.

LocationRole today
tests/parity/Orphaned migration-parity fixtures. The run_parity.py runner that consumed them was deleted 2026-06-01; the validator goldens were dropped 2026-06-13. Nothing loads what remains.
tests/parity/canonical/17 *.input.json / *.expected.txt pairs capturing canonical_json byte-equivalence — dead data with no harness reading it.
tests/parity/exit_codes.jsonStatic lease exit-code reference table; no code reads it.
tests/parity/README.mdClaims the fixtures are “replayed by the bun:test suite” — inaccurate; they are not loaded by any test.
plugin/lib/util/naming.tsDocstring (line 7) cites “a parity test in tests/parity/”.
plugin/lib/model/ops/validate.tsDocstring (line 28) cites the byte-identical copy as “locked by tests/parity/”; a second comment (line 671) attributes the exit-2→1 delta to “the parity” gate.
plugin/lib/services/lease/canonical_json.tsDocstring (lines 17-18) says “the parity harness verifies this implementation against” tests/parity/canonical/.
plugin/lib/services/lease/canonical_json_cli.tsDocstring (line 8) says it is “backed by the tests/parity/canonical/ fixtures”.
plugin/lib/services/lease/tree.tsDocstring (line 5) references “the parity-gate harness”.
plugin/lib/services/lease/tests/canonical_json.test.tsComment (line 7) says the fixtures are “gated by run_parity.py” — a file that no longer exists.

tests/parity/ is gone. No .ts source comment references tests/parity or run_parity, and no comment describes the deleted parity harness/gate as if it were live. The byte-equivalence coverage that matters survives where it already lives: the hardcoded unit tests in plugin/lib/services/lease/tests/canonical_json.test.ts. bun test and bunx tsc --noEmit stay green.

  1. Delete the tests/parity/ directory (canonical/, exit_codes.json, README.md).
  2. Edit the six source comments so each describes the surviving unit-test coverage instead of the deleted harness — drop every tests/parity/ / run_parity.py path citation and every “parity harness/gate” mention that implies a live gate. Leave the legitimate “byte parity” wording in canonical_json.ts (line 24) that explains why the serializer is hand-rolled.
  3. Run bun test and bunx tsc --noEmit to confirm nothing depended on the fixtures.
LocationKindChange
tests/parity/deleteRemove the orphaned parity harness directory (fixtures, exit_codes.json, README.md).
plugin/lib/util/naming.tsmodifyDrop the “parity test in tests/parity/” citation from the module docstring.
plugin/lib/model/ops/validate.tsmodifyRemove the “locked by tests/parity/” citation (line 28) and the “locked by the parity” gate attribution (line 671); keep the documented exit-2→1 config-error delta note, without the dead-harness reference.
plugin/lib/services/lease/canonical_json.tsmodifyRewrite the docstring (lines 17-18) to point at the surviving unit tests instead of the deleted parity harness; keep the line-24 byte-parity serialization rationale.
plugin/lib/services/lease/canonical_json_cli.tsmodifyDrop the “backed by the tests/parity/canonical/ fixtures” citation.
plugin/lib/services/lease/tree.tsmodifyRemove the “parity-gate harness” reference from the docstring.
plugin/lib/services/lease/tests/canonical_json.test.tsmodifyReplace the “gated by run_parity.py” comment with a note that these hardcoded tests are now the canonical canonical_json coverage.
  • AC-1: tests/parity/ no longer exists (test ! -e tests/parity succeeds).
  • AC-2: grep -rn -E "tests/parity|run_parity" plugin/ --include="*.ts" returns no matches.
  • AC-3: bun test passes — the hardcoded canonical_json unit tests in plugin/lib/services/lease/tests/canonical_json.test.ts stay green.
  • AC-4: bunx tsc --noEmit passes.
  • The closed/done task documents that mention tests/parity as historical context — T-DHUF, T-JO4I, T-LIYW, T-P3HA, T-YNJO — and their generated site/ mirrors. They are immutable historical records, not live references; rewriting them is revisionism, not dangling-reference cleanup.
  • The canonical_json implementation and its unit-test assertions. Only comments change here; behavior and coverage are untouched.
  • none

Surfaced 2026-06-28 while reviewing the monorepo migration. A check of tests/parity/ confirmed the run_parity.py runner was deleted 2026-06-01 and the validator goldens dropped 2026-06-13, leaving the directory orphaned. The closed T-YBKU retired plugin/scripts and plugin/validators but never removed this directory, despite a validate.ts comment implying it would.

Captured by /sdlc:task-work on 2026-06-28. PR: pending.

  • AC-1: agent-manual — test ! -e tests/parity succeeded after git rm -r tests/parity (35 files removed).
  • AC-2: auto — command grep -rn -E "tests/parity|run_parity" plugin/ --include="*.ts" returned no matches; a follow-up sweep for “parity harness”/“parity-gate” phrasing in the six edited files also found none.
  • AC-3: auto — bun test plugin/lib/services/lease/tests/canonical_json.test.ts passes 10/10. The full suite’s lone failure (task_auto_define behavioural test) is a pre-existing environmental flake — it fails identically from the main checkout with this branch’s files untouched, on git fetch origin inside a throwaway temp repo — not a regression from this change.
  • AC-4: auto — bunx tsc --noEmit exits 0.
  • The deterministic relevance check immediately caught that the misleadingly-named PR #502 (chore/retire-tests-parity) had only added this task’s spec, not done the work — so the task was genuinely actionable.
  • The change was exactly as scoped: pure comment edits plus deletion of orphaned, unloaded fixtures. tsc and the canonical_json unit suite stayed green with zero adjustment, confirming nothing actually depended on the fixtures.
  • The baseline-gated quality gate reported 3 false-positive new-drift findings — a bun test dashboard line whose PID is not normalized (24505 vs the baseline’s 89733), and two rumdl summary-count lines (Found 30 issues in 10/648 files) that shifted only because this branch legitimately deleted one markdown file (tests/parity/README.md), changing the file-count denominator. The gate’s output normalizer should also mask process IDs and treat tool summary/count lines (issue counts, N/M files) as non-gating, so a legitimate file deletion or a non-deterministic PID does not surface as new drift. → T-BQRU-quality-normalize-ports-pids-timings (PID facet), T-BCNP-quality-gate-ignores-summary-and-corpus-lines (summary/count-line facet)
  • The task_auto_define behavioural test needs a reachable origin remote inside a throwaway temp git repo; in this sandbox that git fetch origin fails, so the full bun test verb exits non-zero on every run regardless of the change under test. That makes bun test an unreliable gate signal here — the test should provision a local bare origin for its temp repo (or skip when no network/remote is available) so the suite is hermetic. → T-03JW-task-auto-define-test-hermetic-origin

← Back to Tasks