Skip to content

docs(skills): [#2603] teach write-unit-test per-clause mutations and a record for removed tests - #2612

Merged
josecelano merged 0 commit into
torrust:developfrom
josecelano:2603-write-unit-test-skill-rule-mutations-and-removed-tests
Oct 21, 2026
Merged

josecelano merged 0 commit into
torrust:developfrom
josecelano:2603-write-unit-test-skill-rule-mutations-and-removed-tests

Conversation

@josecelano

Copy link
Copy Markdown
Member

Adds two short, evidence-backed rules to the write-unit-test skill, as specified in #2603 (merged in PR #2604): derive at least one mutation from each clause of a stated rule, including negative clauses, and record every removed or merged test in a refactor whose acceptance criterion is that the existing tests still pass. Both come from the implementation retrospective of #2415, where the first showed up as a release test that passed under a mutation breaking only one of the rule's two clauses, and the second as a duplicate test deleted during a conversion (manager tests 17 to 16) with no record.

Closes #2603

Changes

  • .github/skills/dev/testing/write-unit-test/SKILL.md: a new section "Prove a Test Guards Each Clause of a Rule" after the existing "Prove a Regression Test Guards the Bug", which it links to instead of repeating (list the clauses, one mutation per clause that breaks only it, record clause, mutation and failing tests, applied only to rules stated in a specification, ADR or acceptance criterion); a new section "Remove or Merge a Test Only With a Record"; and one Quick Checklist entry for each. The existing section is unchanged (no line of the file is deleted).
  • Issue-local files in docs/issues/open/2603-write-unit-test-skill-rule-mutations-and-removed-tests/: the spec's progress, manual-verification-evidence.md, and agent-review-reports.md.

The maintainer approved the final wording before the skill commits. Two things differ from the wording agreed in the spec, both disclosed in the spec's progress log: each new section cites the #2415 observation in one sentence, and the removed-test rule is its own section instead of a paragraph. The spec's T3 row asked for two checklist entries where its Commit Points and AC3 mean one per rule, so one entry was added for each and the row corrected.

Validation

  • M2 (evidence V2): on the real Give each application component its own cancellation token #2415 conversion commit, found by its subject on develop, git and grep show one test removed and manager.rs going from 17 to 16 tests, with no mention of the removal in the commit message. The new rule would have flagged it. The independent reviewer re-ran these commands and got the same output.
  • M1 (evidence V1): applying the per-clause section to the Give each application component its own cancellation token #2415 release rule yields the mutation that the original test missed. It was not blind, because the finding was already known, and the mutation outcomes are cited from the Give each application component its own cancellation token #2415 evidence, not re-run; both limits are stated in the evidence.
  • The independent Task Reviewer passed the branch with findings (AC1 to AC4 and linter all pass); its findings are addressed and the report is in agent-review-reports.md.
  • linter all and every pre-commit run exited 0, and the pre-push hook passed on the push. Documentation only: no source or test changes, so no Rust tests apply.

As for #2414 and #2415, the maintainer's review and merge of this PR is the acceptance review, and the acceptance criteria are ticked afterwards in the archive PR. The branch is not rebased onto the latest develop: its newer commits touch neither the skill nor this folder, and it merges cleanly.

@josecelano
josecelano requested a review from a team as a code owner October 21, 2026 13:57
Copilot AI balanced review requested due to automatic review settings October 21, 2026 13:57
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Oct 21, 2026
Set the spec's related-pr and add the progress-log entry for the pull request.

Co-authored-by: Copilot <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation matches the agreed scope, explicitly states verification limitations, and has no unresolved blocking findings.

No open issues 🎉

What changed in this PR

Updates the unit-testing skill for #2603 with two evidence-based rules drawn from #2415.

Changes:

  • Requires mutations for each stated rule clause, including negative clauses.
  • Requires records of removed or merged tests in qualifying refactors.
  • Documents verification, review results, and implementation progress.
File Description
docs/​issues/​open/​2603-write-unit-test-skill-rule-mutations-and-removed-tests/​manual-verification-evidence.md Records both walkthroughs and their limitations.
docs/​issues/​open/​2603-write-unit-test-skill-rule-mutations-and-removed-tests/​ISSUE.md Updates progress, evidence, and maintainer decisions.
docs/​issues/​open/​2603-write-unit-test-skill-rule-mutations-and-removed-tests/​agent-review-reports.md Records independent review and follow-up actions.
.github/​skills/​dev/​testing/​write-unit-test/​SKILL.md Adds both rules and corresponding checklist entries.

Review effort: Balanced

@josecelano
josecelano requested a review from da2ce7 October 21, 2026 14:25
@josecelano josecelano self-assigned this Oct 21, 2026
@josecelano

Copy link
Copy Markdown
Member Author

ACK d83b32b

@josecelano
josecelano merged commit 11d5d2d into torrust:develop Oct 21, 2026
1 check passed
josecelano added a commit to josecelano/torrust-tracker that referenced this pull request Oct 21, 2026
…losed

Move the torrust#2603 spec and its issue-local artifacts from docs/issues/open/ to docs/issues/closed/ after PR torrust#2612 merged and the issue closed. Set status to done and repoint spec-path and artifact references. Tick the acceptance criteria and checkpoints approved by the maintainer, and record the archive in the progress log.

Co-authored-by: Copilot <[email protected]>
@da2ce7

da2ce7 commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Post-merge note: this pull request requested a review from this account and was closed without one at its final head. A post-merge review will not be done: It changed only Markdown: two new sections and two checklist entries in the write-unit-test skill guide and the #2603 issue records, with no source, script or workflow change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Teach the write-unit-test skill to derive mutations from each rule clause and to record removed tests

3 participants