Skip to content

Review code lens: tautological-test criterion (the detector only catches textually identical sides) #3046

Description

@kyle-sexton

Spun out of Lane C (#2936) during adversarial validation. Refs #2933.

What we found

The tautological-test anti-pattern is well covered in proseplugins/tdd/skills/principles/reference/anti-patterns-khorikov.md:96,270 and, as a checklist item, plugins/testing/skills/write/context/write.md:78 ("expected values are independently sourced … never recomputed the same way the code under test computes them").

While adjudicating Lane C, coverage was initially claimed to be executable as well, via testing/audit's cant-fail-scan.sh rule testing/audit/rule-recomputed-expectation. That claim is false, and the script says so in its own header:

v1 detects the decidable core — textually identical sides — not every recomputation shape.

A validator ran the scanner over three canonical tautological tests and got blocks that fired a block rule: 0. The canonical Khorikov shape — compute expected with the production algorithm in the arrange section, then assert against it — has non-identical sides and does not fire.

The gap

Nothing judges the semantic shape. A reviewer reading the diff can see "this expected value was derived the same way the code derives it"; no criterion asks them to.

What to build

A criterion in the review code lens (plugins/review/skills/quality-gate/context/criteria.md and/or plugins/review/agents/code-reviewer.md — placement is part of the work) that asks, of a changed or added test: is the expected value independently sourced? A known-good literal, a hand-computed value, a worked example, a fixture, or the spec — as against re-deriving it through the same steps the code under test takes.

Scope notes:

  • This is a review-lens criterion, not a detector upgrade. Widening rule-recomputed-expectation past textually-identical sides is a separate, harder question (the general shape is undecidable) and is explicitly not in scope here.
  • The criterion must respect the finding-suppression doctrine already in the lens: skip what tooling already enforces. Where cant-fail-scan.sh does fire, the scanner owns the finding.
  • Round-trip / identity assertions (output compared against its own input) are the adjacent case named at write.md:78 and belong in the same criterion.

Acceptance criteria

  • A tautological-expectation criterion exists in the review code lens, naming the independent-source-of-truth requirement
  • The criterion states its relationship to cant-fail-scan.sh so the two do not double-report
  • The SSOT (docs/upstream/aihero-shipping-course.md, Lane C) records the criterion as landed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: needs-triageDefault until a priority tier is assigned.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions