Skip to content

Tests-fix revert produces compile errors, not failures, when the new tests reference symbols the fix introduces #149

Description

@dmccoystephenson

Gap

Phase 4's Tests-fix item (template line 365 at fa50415, the checkout form now the default) reverts the production fix and expects the new tests to FAIL. When the new tests reference symbols the fix introduces — a constant, a new method, a new exception type — reverting the whole production diff produces COMPILATION ERROR … cannot find symbol, not assertion failures. A compile error is not evidence that the tests detect the bug; it is evidence that they reference the fix. On Stephenson-Software/trace#81 the new tests used MetricDto.MAX_LENGTH and GlobalExceptionHandler.handleDataIntegrityViolation, both introduced by the fix.

What produced the real signal: keep the new declarations and strip only the behavioural part of the fix (the @Size annotations and the catch block, with the constant and the method stub left in place), so the tests compile and fail at runtime (expected: <400> but was: <403>, Unexpected exception type thrown).

The #136 change to the checkout form does not address this — git checkout origin/main -- <src files> removes the declarations just as git stash did.

Suggested instruction text

Under Tests-fix, after the checkout-form paragraph:

If the new tests reference symbols the fix introduces (a constant, a new method, a new type), reverting the whole diff only yields a compile error, which proves nothing. Instead remove the behavioural change while keeping the declarations — delete the annotation or the branch, leave the constant and the method stub — so the tests compile and fail at runtime. Copy the real sources to a scratch file first (Phase 3 scratch-file rule) and restore from there; a git checkout of the branch tip is the restore, so confirm git status --porcelain is empty afterwards.

Origin

Filed from dmccoystephenson/trace-dev-loop#11 (label template-rule), which stays open there until the template carries this text and the skill retrofits it.


drafted by Claude on behalf of Daniel Stephenson

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

    template-ruleShould be promoted into create-dev-loop.md

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions