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.
| Location | Role 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.json | Static lease exit-code reference table; no code reads it. |
tests/parity/README.md | Claims the fixtures are “replayed by the bun:test suite” — inaccurate; they are not loaded by any test. |
plugin/lib/util/naming.ts | Docstring (line 7) cites “a parity test in tests/parity/”. |
plugin/lib/model/ops/validate.ts | Docstring (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.ts | Docstring (lines 17-18) says “the parity harness verifies this implementation against” tests/parity/canonical/. |
plugin/lib/services/lease/canonical_json_cli.ts | Docstring (line 8) says it is “backed by the tests/parity/canonical/ fixtures”. |
plugin/lib/services/lease/tree.ts | Docstring (line 5) references “the parity-gate harness”. |
plugin/lib/services/lease/tests/canonical_json.test.ts | Comment (line 7) says the fixtures are “gated by run_parity.py” — a file that no longer exists. |
Proposed
Section titled “Proposed”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.
Approach
Section titled “Approach”- Delete the
tests/parity/directory (canonical/,exit_codes.json,README.md). - Edit the six source comments so each describes the surviving unit-test coverage instead of the
deleted harness — drop every
tests/parity//run_parity.pypath citation and every “parity harness/gate” mention that implies a live gate. Leave the legitimate “byte parity” wording incanonical_json.ts(line 24) that explains why the serializer is hand-rolled. - Run
bun testandbunx tsc --noEmitto confirm nothing depended on the fixtures.
Files to touch
Section titled “Files to touch”| Location | Kind | Change |
|---|---|---|
tests/parity/ | delete | Remove the orphaned parity harness directory (fixtures, exit_codes.json, README.md). |
plugin/lib/util/naming.ts | modify | Drop the “parity test in tests/parity/” citation from the module docstring. |
plugin/lib/model/ops/validate.ts | modify | Remove 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.ts | modify | Rewrite 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.ts | modify | Drop the “backed by the tests/parity/canonical/ fixtures” citation. |
plugin/lib/services/lease/tree.ts | modify | Remove the “parity-gate harness” reference from the docstring. |
plugin/lib/services/lease/tests/canonical_json.test.ts | modify | Replace the “gated by run_parity.py” comment with a note that these hardcoded tests are now the canonical canonical_json coverage. |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
tests/parity/no longer exists (test ! -e tests/paritysucceeds). - AC-2:
grep -rn -E "tests/parity|run_parity" plugin/ --include="*.ts"returns no matches. - AC-3:
bun testpasses — the hardcodedcanonical_jsonunit tests inplugin/lib/services/lease/tests/canonical_json.test.tsstay green. - AC-4:
bunx tsc --noEmitpasses.
Out of scope
Section titled “Out of scope”- The closed/done task documents that mention
tests/parityas historical context —T-DHUF,T-JO4I,T-LIYW,T-P3HA,T-YNJO— and their generatedsite/mirrors. They are immutable historical records, not live references; rewriting them is revisionism, not dangling-reference cleanup. - The
canonical_jsonimplementation and its unit-test assertions. Only comments change here; behavior and coverage are untouched.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”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.
Post-mortem
Section titled “Post-mortem”Captured by /sdlc:task-work on 2026-06-28. PR: pending.
Acceptance criteria coverage
Section titled “Acceptance criteria coverage”- AC-1: agent-manual —
test ! -e tests/paritysucceeded aftergit 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.tspasses 10/10. The full suite’s lone failure (task_auto_definebehavioural test) is a pre-existing environmental flake — it fails identically from the main checkout with this branch’s files untouched, ongit fetch origininside a throwaway temp repo — not a regression from this change. - AC-4: auto —
bunx tsc --noEmitexits 0.
What worked
Section titled “What worked”- 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.
tscand the canonical_json unit suite stayed green with zero adjustment, confirming nothing actually depended on the fixtures.
Friction and automation gaps
Section titled “Friction and automation gaps”- The baseline-gated quality gate reported 3 false-positive
new-driftfindings — abun testdashboard line whose PID is not normalized (24505vs the baseline’s89733), and tworumdlsummary-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_definebehavioural test needs a reachableoriginremote inside a throwaway temp git repo; in this sandbox thatgit fetch originfails, so the fullbun testverb exits non-zero on every run regardless of the change under test. That makesbun testan unreliable gate signal here — the test should provision a local bareoriginfor its temp repo (or skip when no network/remote is available) so the suite is hermetic. →T-03JW-task-auto-define-test-hermetic-origin
Spawned follow-up tasks
Section titled “Spawned follow-up tasks”- T-BQRU-quality-normalize-ports-pids-timings — linked (existing open/ready owner of the PID-normalization facet of friction bullet #1).
- T-BCNP-quality-gate-ignores-summary-and-corpus-lines — linked (existing owner of the summary/count-line facet of friction bullet #1).
T-03JW-task-auto-define-test-hermetic-origin(https://github.com/sksizer/dev/pull/505) — spawned (Upstream-plugin / sdlc-meta) for friction bullet #2.