werkrevisor 0.10.0: change kind feature with tests, built-in DB schema paths #7

Merged
mi merged 5 commits from claude-code/change-kinds-feature-with-tests into main 2026-10-05 17:02:52 +02:00
Collaborator

werkrevisor 0.10.0: change kind "feature with tests", harmless files, built-in DB schema paths, config version skew.

  • Main code with purely additive tests (new test methods or asserts) is AI-approvable; any changed or removed test line stays YELLOW.
  • [categories] harmless lists files that do not count as "other files".
  • DB schema paths are built in and always give at least YELLOW.
  • Settings unknown to the installed werkrevisor in a changed .werkrevisor.toml give YELLOW instead of RED.

Details: the PR document under docs/prs/.

🤖 Generated with Claude Code

werkrevisor 0.10.0: change kind "feature with tests", harmless files, built-in DB schema paths, config version skew. - Main code with purely additive tests (new test methods or asserts) is AI-approvable; any changed or removed test line stays YELLOW. - `[categories] harmless` lists files that do not count as "other files". - DB schema paths are built in and always give at least YELLOW. - Settings unknown to the installed werkrevisor in a changed `.werkrevisor.toml` give YELLOW instead of RED. Details: the PR document under `docs/prs/`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claude-code added 4 commits 2026-10-05 16:48:04 +02:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- feature_with_tests: main code with purely additive tests is AI-approvable.
- Every changed or removed test line breaks purely additive; more skip markers count.
- [categories] harmless keeps a change kind AI-approvable; harmless_only is a kind of its own.
- DB schema paths are built-in hard-YELLOW paths that no config layer removes.
- A changed .werkrevisor.toml with settings unknown to the installed version is YELLOW, not RED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: PR#7 document states the solution, answered questions and follow-ups
werkator build succeeded after 00:05
ai-review/assessment AI findings; a developer approval after checking them unlocks the merge; review requested from mi
ai-review/gate build succeeded after 00:12
c0ec0e478d
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator

🟠 werkrevisor: ORANGE / FINDINGS

Change kind: mixed.

Reasons

  • YELLOW test changes are not purely additive: tests/test_change_kinds.py:117 disables a test, tests/test_change_kinds.py:118 disables a test
  • YELLOW change kind 'mixed' (main code, tests, other files, docs); AI-approvable are only: docs only, tests only added, docs and tests, refactoring with unchanged tests
  • YELLOW risky paths changed: config/hsadmin-ng.toml (config/), config/werkprobe.toml (config/), werkrevisor/config.py (werkrevisor/config.py)
  • YELLOW 2 changed files were given to the AI only as diff, not in full, so it could not check them against the rest of their file (all full files together would exceed [review] max_full_files_chars = 120000): werkrevisor/config.py, werkrevisor/rules.py
  • ORANGE model reports 2 key issues ([review] red_min_findings = 2)
  • YELLOW model recommends merge with caution

Findings

  1. Possible Bug at werkrevisor/rules.py:120-130

    The moved-line exemption in find_test_weakening lets a removed line be offset by an identical added line anywhere in the file. A changed non-assert line can therefore go undetected. Example: removing var a = new A(1); while adding the same text elsewhere, as the new value of a different setup, passes as purely additive. This is narrow, but it contradicts the "any changed line stays YELLOW" claim.

  2. Possible Bug at werkrevisor/rules.py:14-15

    BUILTIN_DB_SCHEMA_PATHS contains **/*.sql, **/migration/** and **/migrations/**. If first_match requires at least one directory for **/, root-level paths such as schema.sql or migrations/0001.py are not flagged. This cannot be confirmed from the diff, because first_match is not shown. The tests only cover nested paths, so the root-level case is untested.

Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 87212 / out 507 (reasoning included in out), duration 10.7 s, cost 0.1795 USD (reported), config: defaults + host + repository (.werkrevisor.toml at base 2c41b91).
Reviewed head `c0ec0e478d4d8258a5b9d85dc204d10cca951d99` against base `2c41b912f4cac9bab652006d45c3bd634e718a77`, werkrevisor 0.9.0.
<!-- werkrevisor:c0ec0e478d4d8258a5b9d85dc204d10cca951d99 --> <!-- werkrevisor-verdict:ORANGE --> ## 🟠 werkrevisor: ORANGE / FINDINGS Change kind: `mixed`. ### Reasons - **YELLOW** test changes are not purely additive: tests/test_change_kinds.py:117 disables a test, tests/test_change_kinds.py:118 disables a test - **YELLOW** change kind 'mixed' (main code, tests, other files, docs); AI-approvable are only: docs only, tests only added, docs and tests, refactoring with unchanged tests - **YELLOW** risky paths changed: config/hsadmin-ng.toml (config/**), config/werkprobe.toml (config/**), werkrevisor/config.py (werkrevisor/config.py) - **YELLOW** 2 changed files were given to the AI only as diff, not in full, so it could not check them against the rest of their file (all full files together would exceed [review] max_full_files_chars = 120000): werkrevisor/config.py, werkrevisor/rules.py - **ORANGE** model reports 2 key issues ([review] red_min_findings = 2) - **YELLOW** model recommends merge with caution ### Findings 1. **Possible Bug** at `werkrevisor/rules.py:120-130` The moved-line exemption in `find_test_weakening` lets a removed line be offset by an identical added line anywhere in the file. A changed non-assert line can therefore go undetected. Example: removing `var a = new A(1);` while adding the same text elsewhere, as the new value of a different setup, passes as purely additive. This is narrow, but it contradicts the "any changed line stays YELLOW" claim. 2. **Possible Bug** at `werkrevisor/rules.py:14-15` `BUILTIN_DB_SCHEMA_PATHS` contains `**/*.sql`, `**/migration/**` and `**/migrations/**`. If `first_match` requires at least one directory for `**/`, root-level paths such as `schema.sql` or `migrations/0001.py` are not flagged. This cannot be confirmed from the diff, because `first_match` is not shown. The tests only cover nested paths, so the root-level case is untested. <sub> Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 87212 / out 507 (reasoning included in out), duration 10.7 s, cost 0.1795 USD (reported), config: defaults + host + repository (.werkrevisor.toml at base 2c41b91).<br> Reviewed head `c0ec0e478d4d8258a5b9d85dc204d10cca951d99` against base `2c41b912f4cac9bab652006d45c3bd634e718a77`, werkrevisor 0.9.0. </sub>
ai-reviewer requested review from mi 2026-10-05 16:50:27 +02:00
claude-code added 1 commit 2026-10-05 17:00:01 +02:00
Only lines without content may move in a test file; skip markers in string literals are test data
werkator build succeeded after 00:20
ai-review/assessment AI findings; a developer approval after checking them unlocks the merge; a human review request is pending
ai-review/gate build succeeded after 00:29
857990c59a
Fixes the two rule findings of the self-review: a re-added line with content passed as additive,
and the skip markers in the test data of test_change_kinds.py counted as disabled tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator

🟠 werkrevisor: ORANGE / FINDINGS

Change kind: mixed.

Reasons

  • YELLOW test changes are not purely additive: tests/test_change_kinds.py:119 disables a test, tests/test_change_kinds.py:127 disables a test, tests/test_change_kinds.py:128 disables a test
  • YELLOW change kind 'mixed' (main code, tests, other files, docs); AI-approvable are only: docs only, tests only added, docs and tests, refactoring with unchanged tests
  • YELLOW risky paths changed: config/hsadmin-ng.toml (config/), config/werkprobe.toml (config/), werkrevisor/config.py (werkrevisor/config.py)
  • YELLOW 2 changed files were given to the AI only as diff, not in full, so it could not check them against the rest of their file (all full files together would exceed [review] max_full_files_chars = 120000): werkrevisor/config.py, werkrevisor/rules.py
  • ORANGE model reports 3 key issues ([review] red_min_findings = 2)
  • YELLOW model recommends merge with caution

Findings

  1. Possible Bug at werkrevisor/rules.py:124-133

    The STRUCTURAL_LINE re-add exemption counts removed } lines against added } lines by stripped text. A PR can remove a closing brace of an existing test and add an unrelated } elsewhere without any finding, so a restructured test passes as purely additive. The risk is limited, since only content-free lines are exempt.

  2. Possible Bug at werkrevisor/rules.py:143-156

    categorize checks harmless last, but change_kind drops it from cats before the checks. A PR that changes only harmless files and docs gives {"docs"} and becomes docs_only, so harmless_only and the docs rules mix. This is probably intended. However, harmless_only is checked only for cats == {"harmless"}, and a harmless file combined with a deleted-test or weakened-test PR is not checked against weakening at all unless tests are present.

  3. Config Validation at werkrevisor/config.py:536-551

    _split_unknown keeps a section as known[section] = values when values is not a dict, and drops a section whose keys are all unknown. Validation then runs on a reduced config. A section that mixes a host-only key with unknown keys is still checked, but an unknown section name that would otherwise carry a type error is hidden. The PR doc claims that invalid settings stay RED, and this holds only for the known part of the file.

Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 88369 / out 699 (reasoning included in out), duration 23.5 s, cost 0.1837 USD (reported), config: defaults + host + repository (.werkrevisor.toml at base 2c41b91).
Reviewed head `857990c59a3f6bea93e5bc683ad2e310ec1cdffe` against base `2c41b912f4cac9bab652006d45c3bd634e718a77`, werkrevisor 0.9.0.
<!-- werkrevisor:857990c59a3f6bea93e5bc683ad2e310ec1cdffe --> <!-- werkrevisor-verdict:ORANGE --> ## 🟠 werkrevisor: ORANGE / FINDINGS Change kind: `mixed`. ### Reasons - **YELLOW** test changes are not purely additive: tests/test_change_kinds.py:119 disables a test, tests/test_change_kinds.py:127 disables a test, tests/test_change_kinds.py:128 disables a test - **YELLOW** change kind 'mixed' (main code, tests, other files, docs); AI-approvable are only: docs only, tests only added, docs and tests, refactoring with unchanged tests - **YELLOW** risky paths changed: config/hsadmin-ng.toml (config/**), config/werkprobe.toml (config/**), werkrevisor/config.py (werkrevisor/config.py) - **YELLOW** 2 changed files were given to the AI only as diff, not in full, so it could not check them against the rest of their file (all full files together would exceed [review] max_full_files_chars = 120000): werkrevisor/config.py, werkrevisor/rules.py - **ORANGE** model reports 3 key issues ([review] red_min_findings = 2) - **YELLOW** model recommends merge with caution ### Findings 1. **Possible Bug** at `werkrevisor/rules.py:124-133` The `STRUCTURAL_LINE` re-add exemption counts removed `}` lines against added `}` lines by stripped text. A PR can remove a closing brace of an existing test and add an unrelated `}` elsewhere without any finding, so a restructured test passes as purely additive. The risk is limited, since only content-free lines are exempt. 2. **Possible Bug** at `werkrevisor/rules.py:143-156` `categorize` checks `harmless` last, but `change_kind` drops it from `cats` before the checks. A PR that changes only harmless files and docs gives `{"docs"}` and becomes `docs_only`, so `harmless_only` and the docs rules mix. This is probably intended. However, `harmless_only` is checked only for `cats == {"harmless"}`, and a harmless file combined with a deleted-test or weakened-test PR is not checked against `weakening` at all unless tests are present. 3. **Config Validation** at `werkrevisor/config.py:536-551` `_split_unknown` keeps a section as `known[section] = values` when `values` is not a dict, and drops a section whose keys are all unknown. Validation then runs on a reduced config. A section that mixes a host-only key with unknown keys is still checked, but an unknown section name that would otherwise carry a type error is hidden. The PR doc claims that invalid settings stay RED, and this holds only for the known part of the file. <sub> Usage: model `openrouter/anthropic/claude-sonnet-5.5`, LLM done, calls 1, tokens in 88369 / out 699 (reasoning included in out), duration 23.5 s, cost 0.1837 USD (reported), config: defaults + host + repository (.werkrevisor.toml at base 2c41b91).<br> Reviewed head `857990c59a3f6bea93e5bc683ad2e310ec1cdffe` against base `2c41b912f4cac9bab652006d45c3bd634e718a77`, werkrevisor 0.9.0. </sub>
mi merged commit 94f059c1e1 into main 2026-10-05 17:02:52 +02:00
mi deleted branch claude-code/change-kinds-feature-with-tests 2026-10-05 17:02:52 +02:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkrevisor#7