Skip to content

fix(tdd): post-merge Copilot round-4 fixes — class-invariant rewrite + fixture clarity#8

Merged
intel352 merged 1 commit into
mainfrom
fix/tdd-post-merge-copilot-fixes
Apr 25, 2026
Merged

fix(tdd): post-merge Copilot round-4 fixes — class-invariant rewrite + fixture clarity#8
intel352 merged 1 commit into
mainfrom
fix/tdd-post-merge-copilot-fixes

Conversation

@intel352
Copy link
Copy Markdown
Contributor

Summary

Cherry-pick of commit 911c62e, which was not captured in the PR #5 squash merge (f1baa9a). Contains 4 files changed across the test-driven-development skill:

  • SKILL.md — add flow-note linking Verify Regression Invariant prose to diagram node (verify_green → verify_invariant → refactor); fix class-invariant revert-and-restore guidance (Important finding: PR skill: test-driven-development — Verify Regression Invariant + class invariant coverage #5 shipped wrong instruction)
  • scenario.md — clarify Sum spec: 0 on empty input is correct; the actual bug is 0 on single-element input (off-by-one in loop)
  • old-flow.md — reframe "returns 0 for empty" as correct behavior, not a symptom; describe the panic as a regression from correct to crashing
  • new-flow.md — fix indentation: Edge-case sweep is under Class invariant heuristic check (was at wrong level)

Key fix — class-invariant guidance (Important)

PR #5 shipped this in SKILL.md:

Both must fail when the class invariant is broken and pass when it is restored.

That is wrong — "both must fail" implies ALL sibling rows fail when you revert ONE method. The correct behavior is:

Old (wrong):

Both must fail when the class invariant is broken

New (correct):

revert only the previously-broken method so the overall test fails (its row fails;
correct siblings still pass), then restore it so the full table passes again.
Optionally, temporarily introduce the same invariant violation into a known-good
sibling to prove its row would also fail, then restore both and confirm the table
is green.

Runtime launch transcript

Step 1b trigger check: documentation-only PR (skill prose + fixture markdown). No build config, deployment config, version pins, startup config, migrations, or plugin loading paths touched. Step 1b: NOT triggered.

Step 1c trigger check: no version pins in diff. Step 1c: NOT triggered.

Verdict: PASS (doc-only; neither runtime-launch nor version-skew steps apply)

Verify Regression Invariant

Not applicable — documentation-only, no code paths. Prose correctness verified by reading old vs. new:

  • Old: "Both must fail" — logically incorrect for table-driven test reverting one method
  • New: "its row fails; correct siblings still pass" — matches actual test behavior

🤖 Generated with Claude Code

- SKILL.md: add flow-note linking Verify Regression Invariant prose to
  diagram node (verify_green → verify_invariant → refactor)
- SKILL.md: fix class-invariant revert-and-restore guidance — revert
  only the previously-broken method so its row fails and correct
  siblings still pass; restore to make full table green
- scenario.md: clarify Sum spec — 0-on-empty is correct; actual bug is
  0-on-single-element (off-by-one)
- old-flow.md: reframe "returns 0 for empty" as correct behavior, not a
  symptom; describe the panic as a regression from correct to crashing
- new-flow.md: indent Edge-case sweep under Class invariant heuristic
  check (introduced by colon; was at wrong indentation level)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 25, 2026 03:08
@intel352 intel352 requested review from Copilot and removed request for Copilot April 25, 2026 03:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the test-driven-development skill documentation and fixtures to correct previously incorrect class-invariant regression guidance and to clarify the narrow-regression fixture narrative (what’s “correct behavior” vs the actual bug/regression).

Changes:

  • Link “Verify Regression Invariant” prose to the corresponding diagram node/path (verify_green → verify_invariant → refactor).
  • Correct the class-invariant “revert-and-restore” instruction to reflect expected table-driven test behavior (only the reverted method’s row fails; correct siblings pass).
  • Clarify the narrow-regression fixture story: empty input returning 0 is correct; the regression is an empty-slice panic, and the original bug is single-element returning 0.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.

File Description
skills/test-driven-development/SKILL.md Fixes/clarifies Verify Regression Invariant + class-invariant revert/restore guidance and ties prose to the diagram node.
skills/test-driven-development/test-fixtures/narrow-regression/scenario.md Clarifies the intended spec vs the actual off-by-one bug in the fixture scenario.
skills/test-driven-development/test-fixtures/narrow-regression/old-flow.md Reframes the “hidden problem” as a regression from correct empty handling to a crash.
skills/test-driven-development/test-fixtures/narrow-regression/new-flow.md Fixes list indentation so Edge-case sweep sits under the intended heuristic section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@intel352 intel352 merged commit fb8fd1c into main Apr 25, 2026
15 checks passed
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.

2 participants