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

Open
#1,589 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
git, typescript
Domain
testing, tooling

Research direction

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.

Written by the indexing model from the issue text.

Description

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).
Dominant language
TypeScript
Stars
1
Forks
1
Avg merge
11h 3m
Merged PRs (30d)
84

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from sequant-io/sequant

All issues in sequant-io/sequant

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.