fix(review-residue): the Tests line's printed command reproduces the class beside it (doMock, vi.mock(import()), the prose rule) and rendered paths are shell-quoted

Aperta
#1,589 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
git, typescript
Ambito
testing, tooling

Direzione di ricerca

Start in src/lib/workflow/review-residue.ts at the Tests line command and the rendered path commands; compare the command’s matching rules with MOCK_CALL_RE and isProseGate in src/lib/prose-gate.ts. Read the printed-command cases in src/lib/workflow/review-residue.test.ts and run the Vitest filters named in the issue. Done when both command reproduction cases pass, paths with spaces work, and the command table in docs/reference/review-residue.md reflects the updated Tests command.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Follow-up of #1520 (PR #1587); from QA 3's advisory notes and the independent code review.

Problem

R-3 on #1520 says every residue and test line carries the command that produced it, so a reviewer can re-run it. Two things break that promise on the Tests lines:

  1. The printed command is grep -nE 'vi\.mock|jest\.mock|SKILL\.md' <path> (src/lib/workflow/review-residue.ts:294), but the class beside it comes from MOCK_CALL_RE (:186), which also matches doMock and vitest's typed vi.mock(import("x")), and from isProseGate (src/lib/prose-gate.ts), which needs a read of a SKILL.md plus an assertion. A file classed mock because of vi.doMock("child_process") prints a grep that returns nothing; a file with // see SKILL.md prints a grep that hits while the class says real. The command does not reproduce the classification it sits beside. Today the command string names none of doMock, import( or the read rule (sed -n 294p … | grep -c doMock → 0).
  2. Paths in every rendered command (numstatCmd, the hot-file git log, the test-line grep) are interpolated bare. A path with a space or a shell metacharacter breaks the copy-paste command.

Acceptance Criteria

  • AC-1: Each Tests line's command, run on the test file's text, agrees with the class shown: it hits exactly when the class is mock or prose, and reports nothing for real. A case runs the printed command (through sh -c on fixture sources written to a temp dir) for a vi.doMock file, a vi.mock(import(...)) file, a prose gate and a // see SKILL.md mention, and compares. Evidence: npx vitest run src/lib/workflow/review-residue.test.ts -t "printed command" → ≥ 1 passed, 0 failed (new case; today the filter matches 0 of 13 tests)
  • AC-1 is classified as a gate test by isGateTestEvidence; the PR body carries its SEQUANT_MUTATION record (revert the command string to the current grep → the doMock comparison fails; restore).
  • AC-2: A diff path containing a space renders inside every command single-quoted (or otherwise shell-escaped), and sh -c on the rendered numstat command for that path exits 0 against a fixture repo. Evidence: npx vitest run src/lib/workflow/review-residue.test.ts -t "space" → ≥ 1 passed, 0 failed (new case; today 0 of 13)
  • AC-3: docs/reference/review-residue.md's command table shows the new test-line command. Evidence: grep -c 'doMock' docs/reference/review-residue.md → ≥ 1 (today 0)

May touch

src/lib/workflow/review-residue.ts (the command strings and a shared quoting helper), review-residue.test.ts, docs/reference/review-residue.md, CHANGELOG.

Non-Goals

  • Changing the seam classes or the rule behind them (#1566 for prose).
  • Quoting anything other than paths.
  • No edits under plugin/, .claude/skills/, templates/skills/ (plugin freeze).
Lingua principale
TypeScript
Stelle
1
Fork
1
Merge medio
11h 3m
PR unite (30g)
84

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di sequant-io/sequant

Tutte le issue di sequant-io/sequant

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.